@equinor/esv-intersection 4.0.0 → 4.1.0

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.
Files changed (79) hide show
  1. package/dist/components/axis.d.ts.map +1 -1
  2. package/dist/control/ExtendedCurveInterpolator.d.ts.map +1 -1
  3. package/dist/control/IntersectionReferenceSystem.d.ts.map +1 -1
  4. package/dist/control/LayerManager.d.ts.map +1 -1
  5. package/dist/control/MainController.d.ts.map +1 -1
  6. package/dist/control/ZoomPanHandler.d.ts.map +1 -1
  7. package/dist/control/overlay.d.ts.map +1 -1
  8. package/dist/datautils/colortable.d.ts.map +1 -1
  9. package/dist/datautils/findsample.d.ts.map +1 -1
  10. package/dist/datautils/picks.d.ts.map +1 -1
  11. package/dist/datautils/schematicShapeGenerator.d.ts +5 -5
  12. package/dist/datautils/schematicShapeGenerator.d.ts.map +1 -1
  13. package/dist/datautils/seismicimage.d.ts.map +1 -1
  14. package/dist/datautils/surfacedata.d.ts.map +1 -1
  15. package/dist/datautils/trajectory.d.ts.map +1 -1
  16. package/dist/index.cjs.map +1 -1
  17. package/dist/index.mjs +1240 -282
  18. package/dist/index.mjs.map +1 -1
  19. package/dist/index.umd.js.map +1 -1
  20. package/dist/layers/CalloutCanvasLayer.d.ts.map +1 -1
  21. package/dist/layers/CustomDisplayObjects/ComplexRope.d.ts.map +1 -1
  22. package/dist/layers/CustomDisplayObjects/UniformTextureStretchRope.d.ts.map +1 -1
  23. package/dist/layers/GeomodelCanvasLayer.d.ts.map +1 -1
  24. package/dist/layers/GeomodelLabelsLayer.d.ts.map +1 -1
  25. package/dist/layers/GeomodelLayerV2.d.ts.map +1 -1
  26. package/dist/layers/GridLayer.d.ts.map +1 -1
  27. package/dist/layers/ImageCanvasLayer.d.ts.map +1 -1
  28. package/dist/layers/ReferenceLineLayer.d.ts.map +1 -1
  29. package/dist/layers/SchematicLayer.d.ts.map +1 -1
  30. package/dist/layers/WellborePathLayer.d.ts.map +1 -1
  31. package/dist/layers/base/CanvasLayer.d.ts.map +1 -1
  32. package/dist/layers/base/HTMLLayer.d.ts.map +1 -1
  33. package/dist/layers/base/Layer.d.ts.map +1 -1
  34. package/dist/layers/base/PixiLayer.d.ts.map +1 -1
  35. package/dist/layers/base/SVGLayer.d.ts.map +1 -1
  36. package/dist/layers/schematicInterfaces.d.ts.map +1 -1
  37. package/dist/utils/arc-length.d.ts.map +1 -1
  38. package/dist/utils/root-finder.d.ts.map +1 -1
  39. package/dist/utils/text.d.ts.map +1 -1
  40. package/dist/utils/vectorUtils.d.ts.map +1 -1
  41. package/dist/vendor/pixi-dashed-line/index.d.ts.map +1 -1
  42. package/package.json +2 -4
  43. package/src/components/axis.ts +40 -10
  44. package/src/control/ExtendedCurveInterpolator.ts +47 -9
  45. package/src/control/IntersectionReferenceSystem.ts +110 -30
  46. package/src/control/LayerManager.ts +76 -24
  47. package/src/control/MainController.ts +37 -8
  48. package/src/control/ZoomPanHandler.ts +76 -14
  49. package/src/control/overlay.ts +18 -6
  50. package/src/datautils/colortable.ts +7 -2
  51. package/src/datautils/findsample.ts +12 -2
  52. package/src/datautils/picks.ts +66 -18
  53. package/src/datautils/schematicShapeGenerator.ts +570 -146
  54. package/src/datautils/seismicimage.ts +36 -10
  55. package/src/datautils/surfacedata.ts +119 -40
  56. package/src/datautils/trajectory.ts +56 -17
  57. package/src/layers/CalloutCanvasLayer.ts +129 -26
  58. package/src/layers/CustomDisplayObjects/ComplexRope.ts +2 -1
  59. package/src/layers/CustomDisplayObjects/ComplexRopeGeometry.ts +5 -5
  60. package/src/layers/CustomDisplayObjects/UniformTextureStretchRope.ts +6 -2
  61. package/src/layers/GeomodelCanvasLayer.ts +10 -3
  62. package/src/layers/GeomodelLabelsLayer.ts +212 -87
  63. package/src/layers/GeomodelLayerV2.ts +8 -3
  64. package/src/layers/GridLayer.ts +14 -3
  65. package/src/layers/ImageCanvasLayer.ts +17 -3
  66. package/src/layers/ReferenceLineLayer.ts +31 -9
  67. package/src/layers/SchematicLayer.ts +499 -150
  68. package/src/layers/WellborePathLayer.ts +22 -7
  69. package/src/layers/base/CanvasLayer.ts +18 -4
  70. package/src/layers/base/HTMLLayer.ts +11 -3
  71. package/src/layers/base/Layer.ts +10 -2
  72. package/src/layers/base/PixiLayer.ts +27 -7
  73. package/src/layers/base/SVGLayer.ts +13 -3
  74. package/src/layers/schematicInterfaces.ts +16 -6
  75. package/src/utils/arc-length.ts +31 -5
  76. package/src/utils/root-finder.ts +32 -4
  77. package/src/utils/text.ts +34 -7
  78. package/src/utils/vectorUtils.ts +23 -6
  79. package/src/vendor/pixi-dashed-line/index.ts +66 -13
package/dist/index.mjs CHANGED
@@ -1034,12 +1034,22 @@ class Ro {
1034
1034
  }, this.mainGroup = t, this._showLabels = n, this._labelXDesc = i, this._labelYDesc = r, this._unitOfMeasure = s, o && o.offsetX && (this._offsetX = o.offsetX), o && o.offsetX && (this._offsetY = o.offsetY), o && o.visible && (this.visible = o.visible), this.mainGroup.style("pointer-events", "none"), this._scaleX = Lt().domain([0, 1]).range([0, 1]), this._scaleY = Lt().domain([0, 1]).range([0, 1]);
1035
1035
  }
1036
1036
  renderLabelx() {
1037
- const { _labelXDesc: t, _unitOfMeasure: n, _showLabels: i, _scaleX: r } = this, [, s] = r.range(), o = this.renderGx();
1037
+ const {
1038
+ _labelXDesc: t,
1039
+ _unitOfMeasure: n,
1040
+ _showLabels: i,
1041
+ _scaleX: r
1042
+ } = this, [, s] = r.range(), o = this.renderGx();
1038
1043
  let a = o.select("text.axis-labelx");
1039
1044
  return i ? a.empty() && (a = o.append("text").attr("class", "axis-labelx").attr("fill", "rgba(0,0,0,0.3)").style("text-anchor", "middle").style("font-weight", "800").style("font-size", "10px").text(`${t} (${n})`)) : a.remove(), a.attr("transform", `translate(${s / 2},-4)`), a;
1040
1045
  }
1041
1046
  renderLabely() {
1042
- const { _labelYDesc: t, _unitOfMeasure: n, _showLabels: i, _scaleY: r } = this, [, s] = r.range(), o = this.renderGy();
1047
+ const {
1048
+ _labelYDesc: t,
1049
+ _unitOfMeasure: n,
1050
+ _showLabels: i,
1051
+ _scaleY: r
1052
+ } = this, [, s] = r.range(), o = this.renderGy();
1043
1053
  let a = o.select("text.axis-labely");
1044
1054
  return i ? (a.empty() && (a = o.append("text").attr("class", "axis-labely").attr("fill", "rgba(0,0,0,0.3)").style("text-anchor", "middle").style("font-weight", "800").style("font-size", "10px").text(`${t} (${n})`)), a.attr("transform", `translate(-10,${s / 2})rotate(90)`)) : a.remove(), a;
1045
1055
  }
@@ -2002,7 +2012,14 @@ class Me {
2002
2012
  */
2003
2013
  static findRoot(t, n = 0.01, i = 1e3, r = 0.5, s = 0, o = 1) {
2004
2014
  let a = Me.newton(t, n, i, r);
2005
- return a == null && (a = Me.bisect(t, n, i, r, s, o)), a;
2015
+ return a == null && (a = Me.bisect(
2016
+ t,
2017
+ n,
2018
+ i,
2019
+ r,
2020
+ s,
2021
+ o
2022
+ )), a;
2006
2023
  }
2007
2024
  }
2008
2025
  class Jo {
@@ -2075,7 +2092,12 @@ class Qe extends pr {
2075
2092
  * @param {Number} iterations Max number of iterations to use
2076
2093
  */
2077
2094
  findTByRootForArcLength(t, n = 0.01, i = 100) {
2078
- return t <= 0 ? 0 : t >= this.length ? 1 : Me.findRoot((s) => t - this.getQuickArcLength(0, s), n, i, t / this.length);
2095
+ return t <= 0 ? 0 : t >= this.length ? 1 : Me.findRoot(
2096
+ (s) => t - this.getQuickArcLength(0, s),
2097
+ n,
2098
+ i,
2099
+ t / this.length
2100
+ );
2079
2101
  }
2080
2102
  /**
2081
2103
  * Function which finds t value for arc length by simple approximation
@@ -2106,7 +2128,12 @@ class Qe extends pr {
2106
2128
  * @param {Number} to t at end (default = 1)
2107
2129
  */
2108
2130
  getArcLength(t = 0, n = 1) {
2109
- return t === 0 && n === 1 ? this.length : Jo.bisect((r) => this.getPointAt(r), t, n, 2e-3);
2131
+ return t === 0 && n === 1 ? this.length : Jo.bisect(
2132
+ (r) => this.getPointAt(r),
2133
+ t,
2134
+ n,
2135
+ 2e-3
2136
+ );
2110
2137
  }
2111
2138
  /**
2112
2139
  * Function calculating length along curve using interpolator.
@@ -2165,9 +2192,15 @@ class Jt {
2165
2192
  curve: n.curveInterpolator || new Qe(t),
2166
2193
  trajectory: n.trajectoryInterpolator || new Qe(
2167
2194
  t.map((h) => [h[0], h[1]]),
2168
- { tension: r || Ai, arcDivisions: i || Pi }
2195
+ {
2196
+ tension: r || Ai,
2197
+ arcDivisions: i || Pi
2198
+ }
2169
2199
  ),
2170
- curtain: n.curtainInterpolator || new Qe(this.projectedPath, { tension: r || Ai, arcDivisions: i || Pi })
2200
+ curtain: n.curtainInterpolator || new Qe(this.projectedPath, {
2201
+ tension: r || Ai,
2202
+ arcDivisions: i || Pi
2203
+ })
2171
2204
  };
2172
2205
  const a = this.getTrajectoryVector(), c = a.map((h) => h * -1);
2173
2206
  s ? (this.endVector = c, this.startVector = a) : (this.endVector = a, this.startVector = c), this._curtainPathCache = void 0;
@@ -2177,7 +2210,11 @@ class Jt {
2177
2210
  * @param length length along the curve
2178
2211
  */
2179
2212
  project(t) {
2180
- const { curtain: n } = this.interpolators, { calculateDisplacementFromBottom: i } = this.options, r = xt(i ? this.length - (t - this._offset) : t - this._offset, 0, this.length);
2213
+ const { curtain: n } = this.interpolators, { calculateDisplacementFromBottom: i } = this.options, r = xt(
2214
+ i ? this.length - (t - this._offset) : t - this._offset,
2215
+ 0,
2216
+ this.length
2217
+ );
2181
2218
  return n.getPointAtArcLength(r, this.options);
2182
2219
  }
2183
2220
  curtainTangent(t) {
@@ -2206,7 +2243,9 @@ class Jt {
2206
2243
  this._curtainPathCache = r;
2207
2244
  }
2208
2245
  if (i) {
2209
- const r = { point: this.project(t), md: t }, s = this._curtainPathCache.filter((a) => a.md > t && a.md < n), o = { point: this.project(n), md: n };
2246
+ const r = { point: this.project(t), md: t }, s = this._curtainPathCache.filter(
2247
+ (a) => a.md > t && a.md < n
2248
+ ), o = { point: this.project(n), md: n };
2210
2249
  return [r, ...s, o];
2211
2250
  }
2212
2251
  return this._curtainPathCache.filter((r) => r.md >= t && r.md <= n);
@@ -2220,7 +2259,11 @@ class Jt {
2220
2259
  return r;
2221
2260
  if (r > this.displacement)
2222
2261
  return s + (r - this.displacement);
2223
- const o = this.interpolators.curtain.getIntersectsAsPositions(r, 0, 1);
2262
+ const o = this.interpolators.curtain.getIntersectsAsPositions(
2263
+ r,
2264
+ 0,
2265
+ 1
2266
+ );
2224
2267
  if (o && o.length)
2225
2268
  return o[0] * s + this._offset;
2226
2269
  }
@@ -2248,20 +2291,34 @@ class Jt {
2248
2291
  r ? (c = [
2249
2292
  o[0] + this.startVector[0] * r * this.displacement,
2250
2293
  o[1] + this.startVector[1] * r * this.displacement
2251
- ], l = -D.distance(c, o)) : n > 0 && (l = D.distance(d, o)), s && (h = [a[0] + this.endVector[0] * s * this.displacement, a[1] + this.endVector[1] * s * this.displacement]);
2294
+ ], l = -D.distance(c, o)) : n > 0 && (l = D.distance(d, o)), s && (h = [
2295
+ a[0] + this.endVector[0] * s * this.displacement,
2296
+ a[1] + this.endVector[1] * s * this.displacement
2297
+ ]);
2252
2298
  const g = [], y = i - n, m = Math.floor(r / y * t), _ = Math.ceil((f - u) / y * t), v = t - _ - m;
2253
2299
  if (c) {
2254
2300
  g.push(c);
2255
2301
  for (let b = 1; b < m; b++) {
2256
2302
  const S = b / m * r * this.displacement;
2257
- g.push([c[0] - this.startVector[0] * S, c[1] - this.startVector[1] * S]);
2303
+ g.push([
2304
+ c[0] - this.startVector[0] * S,
2305
+ c[1] - this.startVector[1] * S
2306
+ ]);
2258
2307
  }
2259
2308
  }
2260
- const M = this.interpolators.trajectory.getPoints(_ - 1, null, u, f);
2309
+ const M = this.interpolators.trajectory.getPoints(
2310
+ _ - 1,
2311
+ null,
2312
+ u,
2313
+ f
2314
+ );
2261
2315
  if (g.push(...M), h) {
2262
2316
  for (let b = 1; b < v - 1; b++) {
2263
2317
  const S = b / v * s * this.displacement;
2264
- g.push([p[0] + this.endVector[0] * S, p[1] + this.endVector[1] * S]);
2318
+ g.push([
2319
+ p[0] + this.endVector[0] * S,
2320
+ p[1] + this.endVector[1] * S
2321
+ ]);
2265
2322
  }
2266
2323
  g.push(h);
2267
2324
  }
@@ -2272,17 +2329,35 @@ class Jt {
2272
2329
  */
2273
2330
  getExtendedTrajectory(t, n = ea, i = na) {
2274
2331
  if (!isFinite(n) || n < 0)
2275
- throw new Error("Invalid parameter, getExtendedTrajectory() must be called with a valid and positive startExtensionLength parameter");
2332
+ throw new Error(
2333
+ "Invalid parameter, getExtendedTrajectory() must be called with a valid and positive startExtensionLength parameter"
2334
+ );
2276
2335
  if (!isFinite(i) || i < 0)
2277
- throw new Error("Invalid parameter, getExtendedTrajectory() must be called with a valid and positive endExtensionLength parameter");
2278
- const r = this.displacement + n + i, s = Math.floor(n / r * t), o = Math.max(Math.ceil(this.displacement / r * t), 1), a = t - o - s, c = [], h = new D(this.interpolators.trajectory.getPointAt(0)), l = new D(this.startVector), u = n / s;
2336
+ throw new Error(
2337
+ "Invalid parameter, getExtendedTrajectory() must be called with a valid and positive endExtensionLength parameter"
2338
+ );
2339
+ const r = this.displacement + n + i, s = Math.floor(
2340
+ n / r * t
2341
+ ), o = Math.max(
2342
+ Math.ceil(this.displacement / r * t),
2343
+ 1
2344
+ ), a = t - o - s, c = [], h = new D(
2345
+ this.interpolators.trajectory.getPointAt(0)
2346
+ ), l = new D(this.startVector), u = n / s;
2279
2347
  for (let _ = s; _ > 0; _--) {
2280
2348
  const v = _ * u, M = h.add(l.scale(v));
2281
2349
  c.push(M.toArray());
2282
2350
  }
2283
- const f = this.interpolators.trajectory.getPoints(o, null, 0, 1);
2351
+ const f = this.interpolators.trajectory.getPoints(
2352
+ o,
2353
+ null,
2354
+ 0,
2355
+ 1
2356
+ );
2284
2357
  c.push(...f);
2285
- const d = new D(this.interpolators.trajectory.getPointAt(1)), p = new D(this.endVector), g = i / (a - 1);
2358
+ const d = new D(
2359
+ this.interpolators.trajectory.getPointAt(1)
2360
+ ), p = new D(this.endVector), g = i / (a - 1);
2286
2361
  for (let _ = 1; _ < a; _++) {
2287
2362
  const v = _ * g, M = d.add(p.scale(v));
2288
2363
  c.push(M.toArray());
@@ -3873,7 +3948,10 @@ class ll {
3873
3948
  * @param elm, -
3874
3949
  * @param options - options
3875
3950
  */
3876
- constructor(t, n, i = { maxZoomLevel: hl, minZoomLevel: cl }) {
3951
+ constructor(t, n, i = {
3952
+ maxZoomLevel: hl,
3953
+ minZoomLevel: cl
3954
+ }) {
3877
3955
  this.xBounds = [0, 1], this.yBounds = [0, 1], this.translateBoundsX = [0, 1], this.translateBoundsY = [0, 1], this._zFactor = 1, this._enableTranslateExtent = !1, this.container = Z(t), this.options = i, this.onRescale = n, this.onZoom = this.onZoom.bind(this), this.calculateTransform = this.calculateTransform.bind(this), this.applyTransform = this.applyTransform.bind(this), this.recalculateZoomTransform = this.recalculateZoomTransform.bind(this), this.rescale = this.rescale.bind(this), this.adjustToSize = this.adjustToSize.bind(this), this.setViewport = this.setViewport.bind(this), this.currentStateAsEvent = this.currentStateAsEvent.bind(this), this.updateTranslateExtent = this.updateTranslateExtent.bind(this), this.scaleX = Lt().domain(this.xBounds).range([0, 1]), this.scaleY = Lt().domain(this.yBounds).range([0, 1]), this.init();
3878
3956
  }
3879
3957
  /**
@@ -3975,7 +4053,14 @@ class ll {
3975
4053
  * Update translate extent (pan limits)
3976
4054
  */
3977
4055
  updateTranslateExtent() {
3978
- const { width: t, xSpan: n, zFactor: i, enableTranslateExtent: r, translateBoundsX: s, translateBoundsY: o } = this;
4056
+ const {
4057
+ width: t,
4058
+ xSpan: n,
4059
+ zFactor: i,
4060
+ enableTranslateExtent: r,
4061
+ translateBoundsX: s,
4062
+ translateBoundsY: o
4063
+ } = this;
3979
4064
  let a = -1 / 0, c = -1 / 0, h = 1 / 0, l = 1 / 0;
3980
4065
  if (r) {
3981
4066
  const u = t / n;
@@ -3990,7 +4075,19 @@ class ll {
3990
4075
  * Create an event object from current state
3991
4076
  */
3992
4077
  currentStateAsEvent() {
3993
- const { scaleX: t, scaleY: n, xBounds: i, yBounds: r, zFactor: s, viewportRatio: o, currentTransform: a, xRatio: c, yRatio: h, width: l, height: u } = this;
4078
+ const {
4079
+ scaleX: t,
4080
+ scaleY: n,
4081
+ xBounds: i,
4082
+ yBounds: r,
4083
+ zFactor: s,
4084
+ viewportRatio: o,
4085
+ currentTransform: a,
4086
+ xRatio: c,
4087
+ yRatio: h,
4088
+ width: l,
4089
+ height: u
4090
+ } = this;
3994
4091
  return {
3995
4092
  xScale: t.copy(),
3996
4093
  yScale: n.copy(),
@@ -4066,7 +4163,13 @@ class ll {
4066
4163
  this.translateBoundsX = t, this.translateBoundsY = n, this.updateTranslateExtent();
4067
4164
  }
4068
4165
  adjustToSize(t, n, i = !1) {
4069
- const { width: r, height: s, scaleX: o, scaleY: a, recalculateZoomTransform: c } = this;
4166
+ const {
4167
+ width: r,
4168
+ height: s,
4169
+ scaleX: o,
4170
+ scaleY: a,
4171
+ recalculateZoomTransform: c
4172
+ } = this;
4070
4173
  let h = 0, l = 0;
4071
4174
  if (typeof t == "number" && typeof n == "number")
4072
4175
  l = n, h = t;
@@ -4088,14 +4191,29 @@ class ll {
4088
4191
  * @returns New transformation matrix
4089
4192
  */
4090
4193
  calculateTransform(t, n, i) {
4091
- const { scaleX: r, xSpan: s, xBounds: o, yBounds: a, zFactor: c, viewportRatio: h, isXInverted: l, isYInverted: u } = this, [f, d] = r.range(), p = Math.abs(n - t), g = s / p, y = p / (d - f), m = i - (u ? -p : p) / c / h / 2, _ = (o[0] - t) / (l ? -y : y), v = (a[0] - m) / ((u ? -y : y) / c);
4194
+ const {
4195
+ scaleX: r,
4196
+ xSpan: s,
4197
+ xBounds: o,
4198
+ yBounds: a,
4199
+ zFactor: c,
4200
+ viewportRatio: h,
4201
+ isXInverted: l,
4202
+ isYInverted: u
4203
+ } = this, [f, d] = r.range(), p = Math.abs(n - t), g = s / p, y = p / (d - f), m = i - (u ? -p : p) / c / h / 2, _ = (o[0] - t) / (l ? -y : y), v = (a[0] - m) / ((u ? -y : y) / c);
4092
4204
  return Xn.translate(_, v).scale(g);
4093
4205
  }
4094
4206
  /**
4095
4207
  * Recalcualate the transform
4096
4208
  */
4097
4209
  recalculateZoomTransform() {
4098
- const { scaleX: t, scaleY: n, container: i, calculateTransform: r, updateTranslateExtent: s } = this, [o, a] = t.domain(), [c, h] = n.domain(), l = c + (h - c) / 2, u = r(o, a, l);
4210
+ const {
4211
+ scaleX: t,
4212
+ scaleY: n,
4213
+ container: i,
4214
+ calculateTransform: r,
4215
+ updateTranslateExtent: s
4216
+ } = this, [o, a] = t.domain(), [c, h] = n.domain(), l = c + (h - c) / 2, u = r(o, a, l);
4099
4217
  s(), this.zoom.transform(i, u);
4100
4218
  }
4101
4219
  setZoomLevelBoundary(t) {
@@ -4267,7 +4385,10 @@ class Et extends De {
4267
4385
  var r, s;
4268
4386
  this.resetTransform();
4269
4387
  const n = t.xBounds[0] > t.xBounds[1], i = t.yBounds[0] > t.yBounds[1];
4270
- (r = this.ctx) == null || r.translate(t.xScale(0), t.yScale(0)), (s = this.ctx) == null || s.scale(t.xRatio * (n ? -1 : 1), t.yRatio * (i ? -1 : 1));
4388
+ (r = this.ctx) == null || r.translate(t.xScale(0), t.yScale(0)), (s = this.ctx) == null || s.scale(
4389
+ t.xRatio * (n ? -1 : 1),
4390
+ t.yRatio * (i ? -1 : 1)
4391
+ );
4271
4392
  }
4272
4393
  clearCanvas() {
4273
4394
  const { ctx: t, canvas: n } = this;
@@ -4390,7 +4511,10 @@ class Or extends De {
4390
4511
  onRescale(t) {
4391
4512
  super.onRescale(t);
4392
4513
  const n = t.xBounds[0] > t.xBounds[1], i = t.yBounds[0] > t.yBounds[1];
4393
- this.setContainerPosition(t.xScale(0), t.yScale(0)), this.setContainerScale(t.xRatio * (n ? -1 : 1), t.yRatio * (i ? -1 : 1));
4514
+ this.setContainerPosition(t.xScale(0), t.yScale(0)), this.setContainerScale(
4515
+ t.xRatio * (n ? -1 : 1),
4516
+ t.yRatio * (i ? -1 : 1)
4517
+ );
4394
4518
  }
4395
4519
  setContainerPosition(t, n) {
4396
4520
  this.container.position.set(t, n);
@@ -4642,7 +4766,13 @@ function q0(e, t) {
4642
4766
  const n = e.x + e.width, i = t.x + t.width, r = e.y + e.height, s = t.y + t.height;
4643
4767
  if (t.x > n || t.y > r || i < e.x || s < e.y)
4644
4768
  return;
4645
- const o = Math.max(0, Math.min(e.x + e.width, t.x + t.width) - Math.max(e.x, t.x)), a = Math.max(0, Math.min(e.y + e.height, t.y + t.height) - Math.max(e.y, t.y));
4769
+ const o = Math.max(
4770
+ 0,
4771
+ Math.min(e.x + e.width, t.x + t.width) - Math.max(e.x, t.x)
4772
+ ), a = Math.max(
4773
+ 0,
4774
+ Math.min(e.y + e.height, t.y + t.height) - Math.max(e.y, t.y)
4775
+ );
4646
4776
  return {
4647
4777
  dx: o,
4648
4778
  dy: a
@@ -4675,7 +4805,10 @@ class j0 extends Et {
4675
4805
  }, this.renderLine = (i, r, s, o, a, c, h = !0) => {
4676
4806
  const { ctx: l } = this, u = h ? i : i + s, f = h ? i + s : i, d = r + 2;
4677
4807
  l != null && (l.strokeStyle = c, l.lineWidth = 1, l.beginPath(), l.moveTo(o, a), l.lineTo(u, d), l.lineTo(f, d), l.stroke());
4678
- }, this.minFontSize = (n == null ? void 0 : n.minFontSize) || Bl, this.maxFontSize = (n == null ? void 0 : n.maxFontSize) || Hl, this.fontSizeFactor = (n == null ? void 0 : n.fontSizeFactor) || Xl, this.offsetMin = (n == null ? void 0 : n.offsetMin) || Ul, this.offsetMax = (n == null ? void 0 : n.offsetMax) || Vl, this.offsetFactor = (n == null ? void 0 : n.offsetFactor) || Yl, this.fontColor = n == null ? void 0 : n.fontColor, n != null && n.backgroundColor ? (this.backgroundActive = !0, this.backgroundColor = n.backgroundColor) : (this.backgroundActive = !1, this.backgroundColor = Wl), this.backgroundPadding = (n == null ? void 0 : n.backgroundPadding) || Gl, this.backgroundBorderRadius = jl(n == null ? void 0 : n.backgroundBorderRadius, ql);
4808
+ }, this.minFontSize = (n == null ? void 0 : n.minFontSize) || Bl, this.maxFontSize = (n == null ? void 0 : n.maxFontSize) || Hl, this.fontSizeFactor = (n == null ? void 0 : n.fontSizeFactor) || Xl, this.offsetMin = (n == null ? void 0 : n.offsetMin) || Ul, this.offsetMax = (n == null ? void 0 : n.offsetMax) || Vl, this.offsetFactor = (n == null ? void 0 : n.offsetFactor) || Yl, this.fontColor = n == null ? void 0 : n.fontColor, n != null && n.backgroundColor ? (this.backgroundActive = !0, this.backgroundColor = n.backgroundColor) : (this.backgroundActive = !1, this.backgroundColor = Wl), this.backgroundPadding = (n == null ? void 0 : n.backgroundPadding) || Gl, this.backgroundBorderRadius = jl(
4809
+ n == null ? void 0 : n.backgroundBorderRadius,
4810
+ ql
4811
+ );
4679
4812
  }
4680
4813
  setGroupFilter(t) {
4681
4814
  this.groupFilter = t, this.callouts = [], this.render();
@@ -4692,12 +4825,32 @@ class j0 extends Et {
4692
4825
  requestAnimationFrame(() => {
4693
4826
  if (this.clearCanvas(), !this.data || !this.rescaleEvent || !this.referenceSystem)
4694
4827
  return;
4695
- const { xScale: n, yScale: i, xBounds: r } = this.rescaleEvent, s = bn(this.fontSizeFactor, this.minFontSize, this.maxFontSize, n);
4828
+ const { xScale: n, yScale: i, xBounds: r } = this.rescaleEvent, s = bn(
4829
+ this.fontSizeFactor,
4830
+ this.minFontSize,
4831
+ this.maxFontSize,
4832
+ n
4833
+ );
4696
4834
  if (!t || this.callouts.length <= 0) {
4697
4835
  const { data: o, ctx: a, groupFilter: c } = this, { calculateDisplacementFromBottom: h } = this.referenceSystem.options, l = h ? r[0] < r[1] : r[0] > r[1], u = 0;
4698
4836
  a != null && (a.font = `bold ${s}px arial`);
4699
- const f = o.filter((p) => c.length <= 0 || c.includes(p.group)), d = bn(this.offsetFactor, this.offsetMin, this.offsetMax, n);
4700
- this.callouts = this.positionCallouts(f, l, n, i, u, s, d);
4837
+ const f = o.filter(
4838
+ (p) => c.length <= 0 || c.includes(p.group)
4839
+ ), d = bn(
4840
+ this.offsetFactor,
4841
+ this.offsetMin,
4842
+ this.offsetMax,
4843
+ n
4844
+ );
4845
+ this.callouts = this.positionCallouts(
4846
+ f,
4847
+ l,
4848
+ n,
4849
+ i,
4850
+ u,
4851
+ s,
4852
+ d
4853
+ );
4701
4854
  }
4702
4855
  this.callouts.forEach((o) => {
4703
4856
  const { pos: a, title: c, color: h } = o, l = n(a.x), u = i(a.y), f = {
@@ -4708,7 +4861,13 @@ class j0 extends Et {
4708
4861
  offsetX: o.dx,
4709
4862
  offsetY: o.dy
4710
4863
  };
4711
- this.renderCallout(c, o.label, f, h, o.alignment);
4864
+ this.renderCallout(
4865
+ c,
4866
+ o.label,
4867
+ f,
4868
+ h,
4869
+ o.alignment
4870
+ );
4712
4871
  });
4713
4872
  });
4714
4873
  }
@@ -4783,7 +4942,14 @@ class j0 extends Et {
4783
4942
  pos: { x: d == null ? void 0 : d[0], y: d == null ? void 0 : d[1] },
4784
4943
  group: f.group,
4785
4944
  alignment: c,
4786
- boundingBox: this.getAnnotationBoundingBox(f.title, f.label, d, i, r, o),
4945
+ boundingBox: this.getAnnotationBoundingBox(
4946
+ f.title,
4947
+ f.label,
4948
+ d,
4949
+ i,
4950
+ r,
4951
+ o
4952
+ ),
4787
4953
  dx: a,
4788
4954
  dy: a
4789
4955
  };
@@ -4809,7 +4975,10 @@ class j0 extends Et {
4809
4975
  for (let n = t.length - 2; n >= 0; --n) {
4810
4976
  const i = t[n];
4811
4977
  for (let r = t.length - 1; r > n; --r) {
4812
- const s = t[r], o = Di(i.boundingBox, s.boundingBox);
4978
+ const s = t[r], o = Di(
4979
+ i.boundingBox,
4980
+ s.boundingBox
4981
+ );
4813
4982
  o && (i.dy += o.dy, i.boundingBox.y -= o.dy);
4814
4983
  }
4815
4984
  }
@@ -4818,7 +4987,10 @@ class j0 extends Et {
4818
4987
  for (let n = t.length - 2; n >= 0; --n) {
4819
4988
  const i = t[n];
4820
4989
  for (let r = t.length - 1; r > n; --r) {
4821
- const s = t[r], o = Di(s.boundingBox, i.boundingBox);
4990
+ const s = t[r], o = Di(
4991
+ s.boundingBox,
4992
+ i.boundingBox
4993
+ );
4822
4994
  o && (i.dy += o.dy, i.boundingBox.y += o.dy);
4823
4995
  }
4824
4996
  }
@@ -4886,7 +5058,11 @@ class Z0 extends Et {
4886
5058
  }
4887
5059
  render() {
4888
5060
  !this.ctx || !this.rescaleEvent || requestAnimationFrame(() => {
4889
- this.clearCanvas(), this.surfaceAreasPaths.forEach((t) => this.drawPolygonPath(t.color, t.path)), this.surfaceLinesPaths.forEach((t) => this.drawLinePath(t.color, t.path));
5061
+ this.clearCanvas(), this.surfaceAreasPaths.forEach(
5062
+ (t) => this.drawPolygonPath(t.color, t.path)
5063
+ ), this.surfaceLinesPaths.forEach(
5064
+ (t) => this.drawLinePath(t.color, t.path)
5065
+ );
4890
5066
  });
4891
5067
  }
4892
5068
  colorToCSSColor(t) {
@@ -4905,7 +5081,10 @@ class Z0 extends Et {
4905
5081
  generateSurfaceLinesPaths() {
4906
5082
  var t;
4907
5083
  this.surfaceLinesPaths = ((t = this.data) == null ? void 0 : t.lines.reduce((n, i) => {
4908
- const s = this.generateLinePaths(i).map((o) => ({ color: this.colorToCSSColor(i.color), path: o }));
5084
+ const s = this.generateLinePaths(i).map((o) => ({
5085
+ color: this.colorToCSSColor(i.color),
5086
+ path: o
5087
+ }));
4909
5088
  return n.push(...s), n;
4910
5089
  }, [])) ?? [];
4911
5090
  }
@@ -4968,11 +5147,21 @@ function eu(e) {
4968
5147
  return e ? e.filter((t) => t.entryPick.md === t.from).map((t) => Un(t.entryPick, "strat-picks")) : [];
4969
5148
  }
4970
5149
  function nu(e) {
4971
- return e ? e.filter((t) => e.findIndex((n) => Math.abs(n.entryPick.md - t.exitPick.md) < 0.5) === -1).map((t) => Un(t.exitPick, "strat-picks")).filter((t, n, i) => n === i.findIndex((r) => r.title === t.title && r.md === t.md)) : [];
4972
- }
4973
- const K0 = (e) => [...tu(e.nonUnitPicks), ...eu(e.unitPicks), ...nu(e.unitPicks)].sort(
4974
- (t, n) => t.md - n.md
4975
- ), iu = (e) => ({
5150
+ return e ? e.filter(
5151
+ (t) => e.findIndex(
5152
+ (n) => Math.abs(n.entryPick.md - t.exitPick.md) < 0.5
5153
+ ) === -1
5154
+ ).map((t) => Un(t.exitPick, "strat-picks")).filter(
5155
+ (t, n, i) => n === i.findIndex(
5156
+ (r) => r.title === t.title && r.md === t.md
5157
+ )
5158
+ ) : [];
5159
+ }
5160
+ const K0 = (e) => [
5161
+ ...tu(e.nonUnitPicks),
5162
+ ...eu(e.unitPicks),
5163
+ ...nu(e.unitPicks)
5164
+ ].sort((t, n) => t.md - n.md), iu = (e) => ({
4976
5165
  unitName: e.identifier,
4977
5166
  topSurface: e.top,
4978
5167
  baseSurface: e.base,
@@ -5002,10 +5191,14 @@ const su = (e) => e.map(iu);
5002
5191
  function ou(e, t) {
5003
5192
  const n = su(t), i = [], r = [];
5004
5193
  return e.forEach((s) => {
5005
- const o = n.filter((a) => {
5006
- var c;
5007
- return ((c = s.pickIdentifier) == null ? void 0 : c.search(new RegExp(`(${a.topSurface}|${a.baseSurface})`, "i"))) !== -1;
5008
- });
5194
+ const o = n.filter(
5195
+ (a) => {
5196
+ var c;
5197
+ return ((c = s.pickIdentifier) == null ? void 0 : c.search(
5198
+ new RegExp(`(${a.topSurface}|${a.baseSurface})`, "i")
5199
+ )) !== -1;
5200
+ }
5201
+ );
5009
5202
  o.length > 0 ? o.forEach(
5010
5203
  (a) => r.push({
5011
5204
  md: s.md,
@@ -5022,7 +5215,9 @@ function ou(e, t) {
5022
5215
  function au(e) {
5023
5216
  const t = [];
5024
5217
  let n = null;
5025
- const i = e.filter((r) => r.level).sort((r, s) => r.unitName.localeCompare(s.unitName) || r.md - s.md || r.ageTop - s.ageTop);
5218
+ const i = e.filter((r) => r.level).sort(
5219
+ (r, s) => r.unitName.localeCompare(s.unitName) || r.md - s.md || r.ageTop - s.ageTop
5220
+ );
5026
5221
  for (; i.length > 0; ) {
5027
5222
  n = i.shift();
5028
5223
  const r = n.identifier;
@@ -5037,21 +5232,27 @@ function au(e) {
5037
5232
  continue;
5038
5233
  }
5039
5234
  let c, h;
5040
- const l = i.find((u) => u.identifier === s);
5235
+ const l = i.find(
5236
+ (u) => u.identifier === s
5237
+ );
5041
5238
  if (l)
5042
5239
  c = o ? n : l, h = o ? l : n, c.md > h.md && ([c, h] = [h, c]), i.splice(i.indexOf(l), 1);
5043
5240
  else if (console.warn(`Unable to find ${s} pick for ${r}`), o)
5044
5241
  if (c = n, h = e.filter((u) => u.level).sort((u, f) => u.md - f.md).find((u) => u.md > c.md), h)
5045
5242
  console.warn(`Using ${h.identifier} as base for ${r}`);
5046
5243
  else {
5047
- console.warn(`Unable to find a base pick for ${r} pick at ${c.md}, ignored`);
5244
+ console.warn(
5245
+ `Unable to find a base pick for ${r} pick at ${c.md}, ignored`
5246
+ );
5048
5247
  continue;
5049
5248
  }
5050
5249
  else if (a)
5051
5250
  if (h = n, c = e.filter((u) => u.level).sort((u, f) => f.md - u.md).find((u) => u.md < h.md), c)
5052
5251
  console.warn(`Using ${c.identifier} as top for ${r}`);
5053
5252
  else {
5054
- console.warn(`Unable to find a top pick for ${r} pick at ${h.md}, ignored`);
5253
+ console.warn(
5254
+ `Unable to find a top pick for ${r} pick at ${h.md}, ignored`
5255
+ );
5055
5256
  continue;
5056
5257
  }
5057
5258
  else {
@@ -5118,7 +5319,19 @@ const J0 = (e) => e ? {
5118
5319
  function tf(e, t) {
5119
5320
  if (!(e && e.datapoints))
5120
5321
  return null;
5121
- const n = t.reduce((d, p) => Math.min(d, p[0]), 0), i = t.reduce((d, p) => Math.max(d, p[0]), 0), r = e.yAxisValues && e.yAxisValues[0], s = e.yAxisValues && e.yAxisValues[e.yAxisValues.length - 1], o = e.datapoints || [], a = -o.reduce((d, p) => Math.min(...p, d), 0), c = o.reduce((d, p) => Math.max(...p, d), 0), h = Math.max(Math.abs(a), Math.abs(c)), l = -h, u = h;
5322
+ const n = t.reduce(
5323
+ (d, p) => Math.min(d, p[0]),
5324
+ 0
5325
+ ), i = t.reduce(
5326
+ (d, p) => Math.max(d, p[0]),
5327
+ 0
5328
+ ), r = e.yAxisValues && e.yAxisValues[0], s = e.yAxisValues && e.yAxisValues[e.yAxisValues.length - 1], o = e.datapoints || [], a = -o.reduce(
5329
+ (d, p) => Math.min(...p, d),
5330
+ 0
5331
+ ), c = o.reduce(
5332
+ (d, p) => Math.max(...p, d),
5333
+ 0
5334
+ ), h = Math.max(Math.abs(a), Math.abs(c)), l = -h, u = h;
5122
5335
  return {
5123
5336
  minX: n,
5124
5337
  maxX: i,
@@ -5158,9 +5371,19 @@ async function ef(e, t, n, i = { isLeftToRight: !0 }) {
5158
5371
  }
5159
5372
  const hu = 2147483648, lu = 4294967295;
5160
5373
  function nf(e, t, n) {
5161
- const i = n.filter((d) => d.data.values), r = mu(i), s = /* @__PURE__ */ new Map(), o = pu(r, t, s);
5374
+ const i = n.filter(
5375
+ (d) => d.data.values
5376
+ ), r = mu(i), s = /* @__PURE__ */ new Map(), o = pu(
5377
+ r,
5378
+ t,
5379
+ s
5380
+ );
5162
5381
  gu(o);
5163
- const a = uu(r, e), c = wu(e, o, t), h = du(s, c), u = [
5382
+ const a = uu(r, e), c = wu(
5383
+ e,
5384
+ o,
5385
+ t
5386
+ ), h = du(s, c), u = [
5164
5387
  ...fu(h, e),
5165
5388
  ...Object.values(c).flat().filter((d) => !d.exclude)
5166
5389
  ];
@@ -5184,14 +5407,20 @@ function fu(e, t) {
5184
5407
  return {
5185
5408
  id: i.id,
5186
5409
  color: pt(i.color),
5187
- data: t.map((o, a) => [o[0], i.top[a], ...s ? [s.top[a]] : []])
5410
+ data: t.map((o, a) => [
5411
+ o[0],
5412
+ i.top[a],
5413
+ ...s ? [s.top[a]] : []
5414
+ ])
5188
5415
  };
5189
5416
  });
5190
5417
  }
5191
5418
  function du(e, t) {
5192
5419
  return Array.from(e.values()).sort((i, r) => i.age - r.age).filter((i) => {
5193
5420
  const r = t[i.name], s = r && r.length > 0;
5194
- return s || console.warn(`Intersection surface group '${i.name}' has no valid entries and will be discarded.`), s;
5421
+ return s || console.warn(
5422
+ `Intersection surface group '${i.name}' has no valid entries and will be discarded.`
5423
+ ), s;
5195
5424
  }).map((i, r) => {
5196
5425
  const o = t[i.name][0];
5197
5426
  return {
@@ -5204,7 +5433,9 @@ function du(e, t) {
5204
5433
  }
5205
5434
  function pu(e, t, n) {
5206
5435
  const i = t && t.find((o) => o.stratUnitLevel === 1), r = i ? i.identifier : "SEABED";
5207
- return e.filter((o) => o.visualization === "interval" || o.visualization === "none").map((o) => {
5436
+ return e.filter(
5437
+ (o) => o.visualization === "interval" || o.visualization === "none"
5438
+ ).map((o) => {
5208
5439
  const a = [], c = Hr(t, o.name, a);
5209
5440
  c || console.warn(`No match for ${o.name} in strat column`);
5210
5441
  const h = a[0] || c, l = h && h.identifier || r;
@@ -5231,11 +5462,15 @@ function gu(e) {
5231
5462
  });
5232
5463
  }
5233
5464
  function Hr(e, t, n = []) {
5234
- const i = e.find((r) => r.identifier.toLowerCase() === t.toLowerCase());
5465
+ const i = e.find(
5466
+ (r) => r.identifier.toLowerCase() === t.toLowerCase()
5467
+ );
5235
5468
  if (i) {
5236
5469
  let r = i;
5237
5470
  do
5238
- n.unshift(r), r = e.find((s) => s.identifier === r.stratUnitParent);
5471
+ n.unshift(r), r = e.find(
5472
+ (s) => s.identifier === r.stratUnitParent
5473
+ );
5239
5474
  while (r);
5240
5475
  return i;
5241
5476
  }
@@ -5261,7 +5496,9 @@ function xu(e, t, n, i) {
5261
5496
  const r = t + 1;
5262
5497
  if (!n || r >= n.length)
5263
5498
  return;
5264
- const s = n.findIndex((o) => o.isBase && o.name === e.name);
5499
+ const s = n.findIndex(
5500
+ (o) => o.isBase && o.name === e.name
5501
+ );
5265
5502
  if (s !== -1)
5266
5503
  return s;
5267
5504
  for (let o = r; o < n.length; o++) {
@@ -5275,24 +5512,32 @@ function vu(e, t, n) {
5275
5512
  return Hr(n, e.name, i), i.some((r) => t.name === r.identifier);
5276
5513
  }
5277
5514
  function wu(e, t, n) {
5278
- return t.reduce((r, s, o) => {
5279
- var a;
5280
- if (!s.isBase) {
5281
- r[s.group] || (r[s.group] = []);
5282
- const c = xu(s, o, t, n);
5283
- (a = r[s.group]) == null || a.push({
5284
- id: s.name,
5285
- label: s.name,
5286
- color: s.unit && yu(s.unit) || lu,
5287
- exclude: s.visualization === "none" || !s.unit,
5288
- data: e.map((h, l) => {
5289
- const u = s.values[l] != null ? bu(c, t, l) : void 0;
5290
- return [h[0], s.values[l], u];
5291
- })
5292
- });
5293
- }
5294
- return r;
5295
- }, {});
5515
+ return t.reduce(
5516
+ (r, s, o) => {
5517
+ var a;
5518
+ if (!s.isBase) {
5519
+ r[s.group] || (r[s.group] = []);
5520
+ const c = xu(
5521
+ s,
5522
+ o,
5523
+ t,
5524
+ n
5525
+ );
5526
+ (a = r[s.group]) == null || a.push({
5527
+ id: s.name,
5528
+ label: s.name,
5529
+ color: s.unit && yu(s.unit) || lu,
5530
+ exclude: s.visualization === "none" || !s.unit,
5531
+ data: e.map((h, l) => {
5532
+ const u = s.values[l] != null ? bu(c, t, l) : void 0;
5533
+ return [h[0], s.values[l], u];
5534
+ })
5535
+ });
5536
+ }
5537
+ return r;
5538
+ },
5539
+ {}
5540
+ );
5296
5541
  }
5297
5542
  function bu(e, t, n) {
5298
5543
  var i, r;
@@ -5315,17 +5560,26 @@ function rf(e) {
5315
5560
  function sf(e, t) {
5316
5561
  if (!e || e.length === 0)
5317
5562
  return [];
5318
- const n = e ? e.map((_) => [_.easting, _.northing, _.tvd, _.md]) : [], i = new pr(n, { tension: 0.75, arcDivisions: 5e3 }), r = i.length, s = Math.round(r * Mu);
5563
+ const n = e ? e.map((_) => [_.easting, _.northing, _.tvd, _.md]) : [], i = new pr(n, {
5564
+ tension: 0.75,
5565
+ arcDivisions: 5e3
5566
+ }), r = i.length, s = Math.round(r * Mu);
5319
5567
  let o;
5320
5568
  s > 0 ? o = Xr(i.getPoints(s), 5e-4, 10) : o = [[n[0][0], n[0][1]]];
5321
5569
  const a = o[0], c = o[o.length - 1], h = D.distance(a, c);
5322
5570
  let l;
5323
5571
  if (h < Tu) {
5324
5572
  const v = t / 180 * Math.PI;
5325
- l = new D(Math.cos(v), Math.sin(v)).mutable;
5573
+ l = new D(
5574
+ Math.cos(v),
5575
+ Math.sin(v)
5576
+ ).mutable;
5326
5577
  } else
5327
5578
  l = Au(o, Su);
5328
- const u = Math.max(0, tn - r), f = u + r, d = [];
5579
+ const u = Math.max(
5580
+ 0,
5581
+ tn - r
5582
+ ), f = u + r, d = [];
5329
5583
  let p = [];
5330
5584
  const g = l.toArray();
5331
5585
  u > 0 && (p = _i(Math.ceil(u * Oi)).map(
@@ -5334,7 +5588,11 @@ function sf(e, t) {
5334
5588
  const y = _i(Math.ceil(tn * Oi)).map(
5335
5589
  (_) => l.set(g).scale(tn * _).add(c).toArray()
5336
5590
  ).splice(1);
5337
- return d.push(...y), Ur(d, void 0, f);
5591
+ return d.push(...y), Ur(
5592
+ d,
5593
+ void 0,
5594
+ f
5595
+ );
5338
5596
  }
5339
5597
  function Au(e, t) {
5340
5598
  const n = D.zero.mutable;
@@ -5393,7 +5651,14 @@ class of extends Et {
5393
5651
  let I;
5394
5652
  const N = 0.07;
5395
5653
  y ? I = l ? Math.min(C, S) : Math.max(C, S) : I = l ? Math.max(k, T) : Math.min(k, T);
5396
- const x = f.invert(f.range()[0]), A = f.invert(f.range()[1]), w = 5, L = 3, E = N * (P / L) * (y ? 1 : -1) * (l ? -1 : 1), F = P / w * (y ? 1 : -1) * (l ? -1 : 1), z = a.map((X) => [X[0], X[1]]), O = this.calcPos(z, I, L, E, x, A);
5654
+ const x = f.invert(f.range()[0]), A = f.invert(f.range()[1]), w = 5, L = 3, E = N * (P / L) * (y ? 1 : -1) * (l ? -1 : 1), F = P / w * (y ? 1 : -1) * (l ? -1 : 1), z = a.map((X) => [X[0], X[1]]), O = this.calcPos(
5655
+ z,
5656
+ I,
5657
+ L,
5658
+ E,
5659
+ x,
5660
+ A
5661
+ );
5397
5662
  if (!O)
5398
5663
  return;
5399
5664
  const $ = a.map((X) => [X[0], X[2]]);
@@ -5441,7 +5706,14 @@ class of extends Et {
5441
5706
  let b;
5442
5707
  const S = 5;
5443
5708
  u ? b = s ? Math.max(M, _) : Math.min(M, _) : b = s ? Math.min(v, m) : Math.max(v, m);
5444
- const T = y / S * (u ? -1 : 1), { data: C } = i, k = this.calcPos(C, b, S, T), R = this.calcLineDir(C, b, S, T, l, u ? D.left : D.right);
5709
+ const T = y / S * (u ? -1 : 1), { data: C } = i, k = this.calcPos(C, b, S, T), R = this.calcLineDir(
5710
+ C,
5711
+ b,
5712
+ S,
5713
+ T,
5714
+ l,
5715
+ u ? D.left : D.right
5716
+ );
5445
5717
  if (!k || !R)
5446
5718
  return;
5447
5719
  const P = b, I = k.y - Dr - p / 2, N = D.angleRight(R) - (u ? Math.PI : 0);
@@ -5457,24 +5729,27 @@ class of extends Et {
5457
5729
  generateSurfacesWithAvgDepth() {
5458
5730
  var n;
5459
5731
  const t = ((n = this.data) == null ? void 0 : n.areas) ?? [];
5460
- this.areasWithAvgTopDepth = t.reduce((i, r) => {
5461
- if (!r.label)
5462
- return i;
5463
- const s = r.data.reduce(
5464
- (a, c) => (c[1] != null && (a.sum += c[1], a.count++), a),
5465
- {
5466
- sum: 0,
5467
- count: 0
5468
- }
5469
- );
5470
- if (s.count === 0)
5471
- return i;
5472
- const o = s.sum / s.count;
5473
- return i.push({
5474
- ...r,
5475
- avgTopDepth: o
5476
- }), i;
5477
- }, []);
5732
+ this.areasWithAvgTopDepth = t.reduce(
5733
+ (i, r) => {
5734
+ if (!r.label)
5735
+ return i;
5736
+ const s = r.data.reduce(
5737
+ (a, c) => (c[1] != null && (a.sum += c[1], a.count++), a),
5738
+ {
5739
+ sum: 0,
5740
+ count: 0
5741
+ }
5742
+ );
5743
+ if (s.count === 0)
5744
+ return i;
5745
+ const o = s.sum / s.count;
5746
+ return i.push({
5747
+ ...r,
5748
+ avgTopDepth: o
5749
+ }), i;
5750
+ },
5751
+ []
5752
+ );
5478
5753
  }
5479
5754
  onMount(t) {
5480
5755
  super.onMount(t);
@@ -5491,10 +5766,15 @@ class of extends Et {
5491
5766
  });
5492
5767
  }
5493
5768
  drawAreaLabels() {
5494
- this.areasWithAvgTopDepth.forEach((t, n, i) => {
5495
- const r = i.reduce((s, o, a) => (a > n && (s == null || o.avgTopDepth < s.avgTopDepth) && (s = o), s), null);
5496
- this.drawAreaLabel(t, r, i, n);
5497
- });
5769
+ this.areasWithAvgTopDepth.forEach(
5770
+ (t, n, i) => {
5771
+ const r = i.reduce(
5772
+ (s, o, a) => (a > n && (s == null || o.avgTopDepth < s.avgTopDepth) && (s = o), s),
5773
+ null
5774
+ );
5775
+ this.drawAreaLabel(t, r, i, n);
5776
+ }
5777
+ );
5498
5778
  }
5499
5779
  drawLineLabels() {
5500
5780
  var t;
@@ -5512,7 +5792,14 @@ class of extends Et {
5512
5792
  for (let f = 0; f < i; f++) {
5513
5793
  const d = n + f * r, p = Tt(t, d, s, o);
5514
5794
  if (p) {
5515
- const g = this.getAlternativeYValueIfAvailable(d, s, o, a, c, h), y = g ? Math.min(p, g) : p;
5795
+ const g = this.getAlternativeYValueIfAvailable(
5796
+ d,
5797
+ s,
5798
+ o,
5799
+ a,
5800
+ c,
5801
+ h
5802
+ ), y = g ? Math.min(p, g) : p;
5516
5803
  l.add(d, y), u++;
5517
5804
  }
5518
5805
  }
@@ -5521,12 +5808,22 @@ class of extends Et {
5521
5808
  getAlternativeYValueIfAvailable(t, n, i, r, s = null, o) {
5522
5809
  if (!r)
5523
5810
  return null;
5524
- let a = Tt(r, t, n, i);
5811
+ let a = Tt(
5812
+ r,
5813
+ t,
5814
+ n,
5815
+ i
5816
+ );
5525
5817
  if (a == null && s && o != null) {
5526
5818
  let c = o + 1;
5527
5819
  for (; a == null && c < s.length; ) {
5528
5820
  const h = s[c++];
5529
- a = Tt((h == null ? void 0 : h.data.map((l) => [l[0], l[1]])) ?? [], t, n, i);
5821
+ a = Tt(
5822
+ (h == null ? void 0 : h.data.map((l) => [l[0], l[1]])) ?? [],
5823
+ t,
5824
+ n,
5825
+ i
5826
+ );
5530
5827
  }
5531
5828
  }
5532
5829
  return a;
@@ -5612,14 +5909,30 @@ class of extends Et {
5612
5909
  if (!t)
5613
5910
  return !0;
5614
5911
  const { xScale: i, yScale: r, xRatio: s } = this.rescaleEvent, o = 200, [a, c] = i.domain(), [h, l] = r.domain();
5615
- let u = t.interpolators.curtain.getIntersects(h, 1, 0);
5912
+ let u = t.interpolators.curtain.getIntersects(
5913
+ h,
5914
+ 1,
5915
+ 0
5916
+ );
5616
5917
  u.length === 0 && (u = [t.interpolators.curtain.getPointAt(0)]);
5617
- let f = t.interpolators.curtain.getIntersects(l, 1, 0);
5618
- f.length === 0 && (f = [t.interpolators.curtain.getPointAt(1)]);
5918
+ let f = t.interpolators.curtain.getIntersects(
5919
+ l,
5920
+ 1,
5921
+ 0
5922
+ );
5923
+ f.length === 0 && (f = [
5924
+ t.interpolators.curtain.getPointAt(1)
5925
+ ]);
5619
5926
  const d = Math.max((I = u[0]) == null ? void 0 : I[0], (N = f[0]) == null ? void 0 : N[0]), p = Math.min((x = u[0]) == null ? void 0 : x[0], (A = f[0]) == null ? void 0 : A[0]), g = {
5620
5927
  left: n ? d : p,
5621
5928
  right: n ? p : d
5622
- }, y = this.getMarginsInWorldCoordinates(), m = a + y, _ = c - y, [v, M] = this.getSurfacesAreaEdges(), b = n ? Math.min(m, v) : Math.max(m, v), S = n ? Math.max(_, M) : Math.min(_, M), T = Math.max(n ? b - g.left : g.left - b, 0), C = Math.max(n ? g.right - S : S - g.right, 0), k = T * s, R = C * s;
5929
+ }, y = this.getMarginsInWorldCoordinates(), m = a + y, _ = c - y, [v, M] = this.getSurfacesAreaEdges(), b = n ? Math.min(m, v) : Math.max(m, v), S = n ? Math.max(_, M) : Math.min(_, M), T = Math.max(
5930
+ n ? b - g.left : g.left - b,
5931
+ 0
5932
+ ), C = Math.max(
5933
+ n ? g.right - S : S - g.right,
5934
+ 0
5935
+ ), k = T * s, R = C * s;
5623
5936
  return T > C || k > o || k < o && R < o && n || ((w = f[0]) == null ? void 0 : w[1]) < h;
5624
5937
  }
5625
5938
  }
@@ -5646,7 +5959,12 @@ class af extends Or {
5646
5959
  this.createPolygons(t.data).forEach((r) => n.poly(r)), n.setStrokeStyle({ width: 1, color: t.color, alpha: 1 }), n.fill({ color: t.color }), this.addChild(n);
5647
5960
  }, this.generateSurfaceLine = (t) => {
5648
5961
  const n = new qt(), { data: i } = t;
5649
- n.setStrokeStyle({ width: Dr, color: t.color, alpha: 1, alignment: 0.5 });
5962
+ n.setStrokeStyle({
5963
+ width: Dr,
5964
+ color: t.color,
5965
+ alpha: 1,
5966
+ alignment: 0.5
5967
+ });
5650
5968
  let s = !1;
5651
5969
  for (let o = 0; o < i.length; o++) {
5652
5970
  const a = i[o];
@@ -5742,8 +6060,20 @@ class cf extends Et {
5742
6060
  const n = parseInt(((f = this.elm) == null ? void 0 : f.getAttribute("width")) ?? "0", 10), i = parseInt(((d = this.elm) == null ? void 0 : d.getAttribute("height")) ?? "0", 10), { xScale: r, yScale: s, xRatio: o, yRatio: a, x: c, y: h } = t, l = n * (o || 1), u = i * (a || 1);
5743
6061
  this.clearCanvas(), this.img != null && (this.isLoading ? this.img.onload = () => {
5744
6062
  var g;
5745
- this.isLoading = !1, this.img != null && ((g = this.ctx) == null || g.drawImage(this.img, r(c || 0), s(h || 0), l, u));
5746
- } : (p = this.ctx) == null || p.drawImage(this.img, r(c || 0), s(h || 0), l, u));
6063
+ this.isLoading = !1, this.img != null && ((g = this.ctx) == null || g.drawImage(
6064
+ this.img,
6065
+ r(c || 0),
6066
+ s(h || 0),
6067
+ l,
6068
+ u
6069
+ ));
6070
+ } : (p = this.ctx) == null || p.drawImage(
6071
+ this.img,
6072
+ r(c || 0),
6073
+ s(h || 0),
6074
+ l,
6075
+ u
6076
+ ));
5747
6077
  }
5748
6078
  }
5749
6079
  const zu = {
@@ -5806,7 +6136,10 @@ const zu = {
5806
6136
  if (this.useTexture)
5807
6137
  if (this.graphics.moveTo(this.cursor.x, this.cursor.y), this.adjustLineStyle(o), a && this.dash.length % 2 === 0) {
5808
6138
  const c = Math.min(this.dash[this.dash.length - 1], s);
5809
- this.graphics.lineTo(t - Math.cos(o) * c, n - Math.sin(o) * c), this.graphics.closePath();
6139
+ this.graphics.lineTo(
6140
+ t - Math.cos(o) * c,
6141
+ n - Math.sin(o) * c
6142
+ ), this.graphics.closePath();
5810
6143
  } else
5811
6144
  this.graphics.lineTo(t, n);
5812
6145
  else {
@@ -5825,7 +6158,12 @@ const zu = {
5825
6158
  let y = s;
5826
6159
  for (; y > 0; ) {
5827
6160
  const m = this.dash[d] * this.scale - p, _ = y > m ? m : y;
5828
- if (a && at.distance(l + c * _, u + h * _, this.start.x, this.start.y) <= _) {
6161
+ if (a && at.distance(
6162
+ l + c * _,
6163
+ u + h * _,
6164
+ this.start.x,
6165
+ this.start.y
6166
+ ) <= _) {
5829
6167
  if (d % 2 === 0) {
5830
6168
  const M = at.distance(l, u, this.start.x, this.start.y) - this.dash[this.dash.length - 1] * this.scale;
5831
6169
  l += c * M, u += h * M, this.graphics.lineTo(l, u);
@@ -5843,7 +6181,13 @@ const zu = {
5843
6181
  drawCircle(t, n, i, r = 80, s) {
5844
6182
  const o = Math.PI * 2 / r;
5845
6183
  let a = 0, c;
5846
- s ? (c = new dt(t + Math.cos(a) * i, n + Math.sin(a) * i), s.apply(c, c), this.moveTo(c[0], c[1])) : (c = new dt(t + Math.cos(a) * i, n + Math.sin(a) * i), this.moveTo(c.x, c.y)), a += o;
6184
+ s ? (c = new dt(
6185
+ t + Math.cos(a) * i,
6186
+ n + Math.sin(a) * i
6187
+ ), s.apply(c, c), this.moveTo(c[0], c[1])) : (c = new dt(
6188
+ t + Math.cos(a) * i,
6189
+ n + Math.sin(a) * i
6190
+ ), this.moveTo(c.x, c.y)), a += o;
5847
6191
  for (let h = 1; h < r + 1; h++) {
5848
6192
  const l = h === r ? c : [t + Math.cos(a) * i, n + Math.sin(a) * i];
5849
6193
  this.lineTo(l[0], l[1]), a += o;
@@ -5870,7 +6214,11 @@ const zu = {
5870
6214
  } else {
5871
6215
  this.moveTo(t[0], t[1]);
5872
6216
  for (let r = 2; r < t.length; r += 2)
5873
- this.lineTo(t[r], t[r + 1], r === t.length - 2);
6217
+ this.lineTo(
6218
+ t[r],
6219
+ t[r + 1],
6220
+ r === t.length - 2
6221
+ );
5874
6222
  }
5875
6223
  else if (n) {
5876
6224
  const r = t[0];
@@ -5902,7 +6250,10 @@ const zu = {
5902
6250
  const n = this.graphics.line;
5903
6251
  n.matrix = new hs(), t && n.matrix.rotate(t), this.scale !== 1 && n.matrix.scale(this.scale, this.scale);
5904
6252
  const i = -this.lineLength;
5905
- n.matrix.translate(this.cursor.x + i * Math.cos(t), this.cursor.y + i * Math.sin(t)), this.graphics.lineStyle(n);
6253
+ n.matrix.translate(
6254
+ this.cursor.x + i * Math.cos(t),
6255
+ this.cursor.y + i * Math.sin(t)
6256
+ ), this.graphics.lineStyle(n);
5906
6257
  }
5907
6258
  // creates or uses cached texture
5908
6259
  static getTexture(t, n) {
@@ -5951,10 +6302,16 @@ const Sn = (e) => new D(e.x, e.y), Du = (e) => new dt(e[0], e[1]), qr = (e) => {
5951
6302
  const s = t[r];
5952
6303
  if (s != null)
5953
6304
  return jr(i, s, n);
5954
- throw new Error(`Trying to read index ${r} of point ${i}, but no such vector was found!`);
6305
+ throw new Error(
6306
+ `Trying to read index ${r} of point ${i}, but no such vector was found!`
6307
+ );
5955
6308
  });
5956
6309
  }, Ni = (e, t, n, i) => e <= i && n <= t, Ou = (e, t, n, i) => e < i && n < t, Nu = (e) => Array.from(new Set(e)), Be = (e, t, n, i) => {
5957
- const r = i.filter((o) => Ni(e, t, o.start, o.end)), s = n.filter((o) => Ni(e, t, o.start, o.end));
6310
+ const r = i.filter(
6311
+ (o) => Ni(e, t, o.start, o.end)
6312
+ ), s = n.filter(
6313
+ (o) => Ni(e, t, o.start, o.end)
6314
+ );
5958
6315
  return {
5959
6316
  overlappingHoles: r,
5960
6317
  overlappingOuterStrings: s
@@ -5962,75 +6319,186 @@ const Sn = (e) => new D(e.x, e.y), Du = (e) => new dt(e[0], e[1]), qr = (e) => {
5962
6319
  }, He = ([e, t], n) => {
5963
6320
  const s = n.flatMap(
5964
6321
  (a) => [a.start - 1e-4, a.start, a.end, a.end + 1e-4]
5965
- ).filter((a) => a >= e && a <= t);
6322
+ ).filter(
6323
+ (a) => a >= e && a <= t
6324
+ );
5966
6325
  return s.push(e), s.push(t), Nu(s).sort((a, c) => a - c);
5967
6326
  }, j = (e) => e.kind === "casing" ? e.innerDiameter : e.diameter, Zr = (e, t, n, i) => {
5968
6327
  const s = e.find(
5969
6328
  (h) => h.start <= i && h.end >= i
5970
- ), o = s ? s.diameter : 0, a = t.filter((h) => j(h) > o).sort((h, l) => j(h) - j(l)).find((h) => h.start <= i && h.end >= i), c = n.find((h) => h.start <= i && h.end >= i && h.diameter > o);
6329
+ ), o = s ? s.diameter : 0, a = t.filter(
6330
+ (h) => j(h) > o
6331
+ ).sort(
6332
+ (h, l) => j(h) - j(l)
6333
+ ).find((h) => h.start <= i && h.end >= i), c = n.find(
6334
+ (h) => h.start <= i && h.end >= i && h.diameter > o
6335
+ );
5971
6336
  return a ? j(a) : c ? c.diameter : 100;
5972
6337
  }, $u = (e, t, n, i) => {
5973
- const s = e.sort((a, c) => c.diameter - a.diameter).find((a) => a.start <= n && a.end >= n), o = t.find((a) => a.start <= n && a.end >= n);
6338
+ const s = e.sort(
6339
+ (a, c) => c.diameter - a.diameter
6340
+ ).find((a) => a.start <= n && a.end >= n), o = t.find(
6341
+ (a) => a.start <= n && a.end >= n
6342
+ );
5974
6343
  return s && i !== "Open hole frac pack" && i !== "Open hole gravel pack" ? j(s) : o ? o.diameter : 100;
5975
6344
  }, Bu = (e, t, n, i) => {
5976
- const s = e.sort((h, l) => j(h) - j(l)).find((h) => h.start <= i && h.end >= i);
6345
+ const s = e.sort(
6346
+ (h, l) => j(h) - j(l)
6347
+ ).find(
6348
+ (h) => h.start <= i && h.end >= i
6349
+ );
5977
6350
  if (s)
5978
6351
  return j(s);
5979
- const o = e.length ? Math.min(...e.map((h) => j(h))) : 0, a = t.sort((h, l) => j(h) - j(l)).find(
6352
+ const o = e.length ? Math.min(...e.map((h) => j(h))) : 0, a = t.sort(
6353
+ (h, l) => j(h) - j(l)
6354
+ ).find(
5980
6355
  (h) => h.start <= i && h.end >= i && o <= j(h)
5981
6356
  );
5982
6357
  if (a)
5983
6358
  return j(a);
5984
- const c = n.find((h) => h.start <= i && h.end >= i && h.diameter);
6359
+ const c = n.find(
6360
+ (h) => h.start <= i && h.end >= i && h.diameter
6361
+ );
5985
6362
  return c ? c.diameter : 100;
5986
6363
  }, Hu = (e, t, n, i, r, s) => {
5987
- const { attachedStrings: o, nonAttachedStrings: a } = Vn(e.referenceIds, t, n);
6364
+ const { attachedStrings: o, nonAttachedStrings: a } = Vn(
6365
+ e.referenceIds,
6366
+ t,
6367
+ n
6368
+ );
5988
6369
  if (o.length === 0)
5989
- throw new Error(`Invalid cement data, can't find referenced casing/completion string for cement with id '${e.id}'`);
6370
+ throw new Error(
6371
+ `Invalid cement data, can't find referenced casing/completion string for cement with id '${e.id}'`
6372
+ );
5990
6373
  o.sort((g, y) => g.end - y.end);
5991
- const c = o[o.length - 1].end, { overlappingOuterStrings: h, overlappingHoles: l } = Be(e.toc, c, a, i), u = [...h, ...l].map((g) => ({
6374
+ const c = o[o.length - 1].end, { overlappingOuterStrings: h, overlappingHoles: l } = Be(
6375
+ e.toc,
6376
+ c,
6377
+ a,
6378
+ i
6379
+ ), u = [
6380
+ ...h,
6381
+ ...l
6382
+ ].map((g) => ({
5992
6383
  start: g.start,
5993
6384
  end: g.end
5994
6385
  }));
5995
- return He([e.toc, c], u).flatMap((g, y, m) => {
5996
- if (y === m.length - 1)
5997
- return [];
5998
- const _ = m[y + 1], v = Zr(o, h, l, g);
5999
- return [{ top: g, bottom: _, diameter: v * r }];
6000
- }).map((g) => ({
6386
+ return He(
6387
+ [e.toc, c],
6388
+ u
6389
+ ).flatMap(
6390
+ (g, y, m) => {
6391
+ if (y === m.length - 1)
6392
+ return [];
6393
+ const _ = m[y + 1], v = Zr(
6394
+ o,
6395
+ h,
6396
+ l,
6397
+ g
6398
+ );
6399
+ return [
6400
+ {
6401
+ top: g,
6402
+ bottom: _,
6403
+ diameter: v * r
6404
+ }
6405
+ ];
6406
+ }
6407
+ ).map((g) => ({
6001
6408
  diameter: g.diameter,
6002
6409
  points: s(g.top, g.bottom)
6003
6410
  }));
6004
6411
  }, Vn = (e, t, n) => [...t, ...n].reduce(
6005
- (i, r) => e.includes(r.id) ? { ...i, attachedStrings: [...i.attachedStrings, r] } : { ...i, nonAttachedStrings: [...i.nonAttachedStrings, r] },
6006
- { attachedStrings: [], nonAttachedStrings: [] }
6412
+ (i, r) => e.includes(r.id) ? { ...i, attachedStrings: [...i.attachedStrings, r] } : {
6413
+ ...i,
6414
+ nonAttachedStrings: [...i.nonAttachedStrings, r]
6415
+ },
6416
+ {
6417
+ attachedStrings: [],
6418
+ nonAttachedStrings: []
6419
+ }
6007
6420
  ), Xu = (e, t, n, i, r, s) => {
6008
- const { attachedStrings: o, nonAttachedStrings: a } = Vn(e.referenceIds, t, n);
6421
+ const { attachedStrings: o, nonAttachedStrings: a } = Vn(
6422
+ e.referenceIds,
6423
+ t,
6424
+ n
6425
+ );
6009
6426
  if (o.length === 0)
6010
- throw new Error(`Invalid cement squeeze data, can't find referenced casing/completion for squeeze with id '${e.id}'`);
6011
- const { overlappingOuterStrings: c, overlappingHoles: h } = Be(e.start, e.end, a, i), l = [...c, ...h].map((p) => ({
6427
+ throw new Error(
6428
+ `Invalid cement squeeze data, can't find referenced casing/completion for squeeze with id '${e.id}'`
6429
+ );
6430
+ const { overlappingOuterStrings: c, overlappingHoles: h } = Be(
6431
+ e.start,
6432
+ e.end,
6433
+ a,
6434
+ i
6435
+ ), l = [
6436
+ ...c,
6437
+ ...h
6438
+ ].map((p) => ({
6012
6439
  start: p.start,
6013
6440
  end: p.end
6014
6441
  }));
6015
- return He([e.start, e.end], l).flatMap((p, g, y) => {
6442
+ return He(
6443
+ [e.start, e.end],
6444
+ l
6445
+ ).flatMap((p, g, y) => {
6016
6446
  if (g === y.length - 1)
6017
6447
  return [];
6018
- const m = y[g + 1], _ = Zr(o, c, h, p);
6019
- return [{ top: p, bottom: m, diameter: _ * r }];
6448
+ const m = y[g + 1], _ = Zr(
6449
+ o,
6450
+ c,
6451
+ h,
6452
+ p
6453
+ );
6454
+ return [
6455
+ {
6456
+ top: p,
6457
+ bottom: m,
6458
+ diameter: _ * r
6459
+ }
6460
+ ];
6020
6461
  }).map((p) => ({
6021
6462
  diameter: p.diameter,
6022
6463
  points: s(p.top, p.bottom)
6023
6464
  }));
6024
6465
  }, Uu = (e, t, n, i, r, s) => {
6025
- const { attachedStrings: o, nonAttachedStrings: a } = Vn(e.referenceIds, t, n), { overlappingHoles: c, overlappingOuterStrings: h } = Be(e.start, e.end, a, i), l = [...o, ...c, ...h].map((p) => ({
6466
+ const { attachedStrings: o, nonAttachedStrings: a } = Vn(
6467
+ e.referenceIds,
6468
+ t,
6469
+ n
6470
+ ), { overlappingHoles: c, overlappingOuterStrings: h } = Be(
6471
+ e.start,
6472
+ e.end,
6473
+ a,
6474
+ i
6475
+ ), l = [
6476
+ ...o,
6477
+ ...c,
6478
+ ...h
6479
+ ].map((p) => ({
6026
6480
  start: p.start,
6027
6481
  end: p.end
6028
6482
  }));
6029
- return He([e.start, e.end], l).flatMap((p, g, y) => {
6483
+ return He(
6484
+ [e.start, e.end],
6485
+ l
6486
+ ).flatMap((p, g, y) => {
6030
6487
  if (g === y.length - 1)
6031
6488
  return [];
6032
- const m = y[g + 1], _ = Bu(o, h, c, p);
6033
- return [{ top: p, bottom: m, diameter: _ * r }];
6489
+ const m = y[g + 1], _ = Bu(
6490
+ o,
6491
+ h,
6492
+ c,
6493
+ p
6494
+ );
6495
+ return [
6496
+ {
6497
+ top: p,
6498
+ bottom: m,
6499
+ diameter: _ * r
6500
+ }
6501
+ ];
6034
6502
  }).map((p) => ({
6035
6503
  diameter: p.diameter,
6036
6504
  points: s(p.top, p.bottom)
@@ -6044,8 +6512,16 @@ const Sn = (e) => new D(e.x, e.y), Du = (e) => new dt(e[0], e[1]), qr = (e) => {
6044
6512
  const s = r.getContext("2d");
6045
6513
  if (s == null)
6046
6514
  throw Error("Could not get canvas context!");
6047
- return s.fillStyle = Vu(r, s, e, t, 0), s.fillRect(0, 0, r.width, r.height), K.from(r);
6048
- }, Wu = ({ scalingFactor: e }) => {
6515
+ return s.fillStyle = Vu(
6516
+ r,
6517
+ s,
6518
+ e,
6519
+ t,
6520
+ 0
6521
+ ), s.fillRect(0, 0, r.width, r.height), K.from(r);
6522
+ }, Wu = ({
6523
+ scalingFactor: e
6524
+ }) => {
6049
6525
  const t = document.createElement("canvas"), n = vt * e;
6050
6526
  t.width = n, t.height = n;
6051
6527
  const i = t.getContext("2d");
@@ -6056,9 +6532,16 @@ const Sn = (e) => new D(e.x, e.y), Du = (e) => new dt(e[0], e[1]), qr = (e) => {
6056
6532
  i.strokeStyle = "#AAAAAA", i.lineWidth = r, i.beginPath();
6057
6533
  const s = n / 3;
6058
6534
  for (let o = -t.width; o < t.width; o++)
6059
- i.moveTo(-t.width + s * o, -t.height), i.lineTo(t.width + s * o, t.height * 2);
6535
+ i.moveTo(-t.width + s * o, -t.height), i.lineTo(
6536
+ t.width + s * o,
6537
+ t.height * 2
6538
+ );
6060
6539
  return i.stroke(), K.from(t);
6061
- }, Gu = ({ innerColor: e, outerColor: t, scalingFactor: n }) => {
6540
+ }, Gu = ({
6541
+ innerColor: e,
6542
+ outerColor: t,
6543
+ scalingFactor: n
6544
+ }) => {
6062
6545
  const i = vt * n, r = document.createElement("canvas");
6063
6546
  r.width = i, r.height = i;
6064
6547
  const s = r.getContext("2d");
@@ -6066,7 +6549,11 @@ const Sn = (e) => new D(e.x, e.y), Du = (e) => new dt(e[0], e[1]), qr = (e) => {
6066
6549
  throw Error("Could not get canvas context!");
6067
6550
  const o = s.createLinearGradient(0, 0, 0, i), a = 0.3, c = 0.7;
6068
6551
  return o.addColorStop(0, t), o.addColorStop(a, e), o.addColorStop(c, e), o.addColorStop(1, t), s.fillStyle = o, s.fillRect(0, 0, r.width, r.height), K.from(r);
6069
- }, qu = ({ firstColor: e, secondColor: t, scalingFactor: n }) => {
6552
+ }, qu = ({
6553
+ firstColor: e,
6554
+ secondColor: t,
6555
+ scalingFactor: n
6556
+ }) => {
6070
6557
  const i = document.createElement("canvas"), r = vt * n, s = n;
6071
6558
  i.width = r, i.height = r;
6072
6559
  const o = i.getContext("2d");
@@ -6077,7 +6564,11 @@ const Sn = (e) => new D(e.x, e.y), Du = (e) => new dt(e[0], e[1]), qr = (e) => {
6077
6564
  for (let c = -i.width; c < i.width; c++)
6078
6565
  o.moveTo(-i.width + a * c, -i.height), o.lineTo(i.width + a * c, i.height);
6079
6566
  return o.stroke(), K.from(i);
6080
- }, ju = ({ firstColor: e, secondColor: t, scalingFactor: n }) => {
6567
+ }, ju = ({
6568
+ firstColor: e,
6569
+ secondColor: t,
6570
+ scalingFactor: n
6571
+ }) => {
6081
6572
  const i = document.createElement("canvas"), r = vt * n;
6082
6573
  i.width = r, i.height = r;
6083
6574
  const s = i.getContext("2d");
@@ -6086,9 +6577,16 @@ const Sn = (e) => new D(e.x, e.y), Du = (e) => new dt(e[0], e[1]), qr = (e) => {
6086
6577
  s.fillStyle = e, s.fillRect(0, 0, i.width, i.height), s.lineWidth = n, s.strokeStyle = t, s.beginPath(), s.setLineDash([20, 10]);
6087
6578
  const o = r / 12;
6088
6579
  for (let a = -i.width; a < i.width; a++)
6089
- s.moveTo(-i.width + o * a, -i.height), s.lineTo(i.width + o * a, i.height * 2);
6580
+ s.moveTo(-i.width + o * a, -i.height), s.lineTo(
6581
+ i.width + o * a,
6582
+ i.height * 2
6583
+ );
6090
6584
  return s.stroke(), K.from(i);
6091
- }, Zu = ({ firstColor: e, secondColor: t, scalingFactor: n }) => {
6585
+ }, Zu = ({
6586
+ firstColor: e,
6587
+ secondColor: t,
6588
+ scalingFactor: n
6589
+ }) => {
6092
6590
  const i = document.createElement("canvas"), r = vt * n, s = n;
6093
6591
  i.width = r, i.height = r;
6094
6592
  const o = i.getContext("2d");
@@ -6097,29 +6595,56 @@ const Sn = (e) => new D(e.x, e.y), Du = (e) => new dt(e[0], e[1]), qr = (e) => {
6097
6595
  o.lineWidth = s, o.fillStyle = e, o.strokeStyle = t, o.fillRect(0, 0, i.width, i.height), o.beginPath(), o.setLineDash([20, 10]);
6098
6596
  const a = r / 12;
6099
6597
  for (let c = -i.width; c < i.width; c++)
6100
- o.moveTo(-i.width + a * c, -i.height), o.lineTo(i.width + a * c, i.height * 2);
6598
+ o.moveTo(-i.width + a * c, -i.height), o.lineTo(
6599
+ i.width + a * c,
6600
+ i.height * 2
6601
+ );
6101
6602
  return o.stroke(), K.from(i);
6102
6603
  }, ye = (e, t) => {
6103
6604
  const n = qr(t), i = Mn(t, n, e);
6104
6605
  return { leftPath: Mn(t, n, -e), rightPath: i };
6105
- }, nn = (e, t) => ({ kind: "casing", start: e, end: t }), Ku = (e, t) => ({ kind: "casing-window", start: e, end: t }), Qu = (e) => {
6106
- const t = (e.windows || []).filter((n) => Ou(e.start, e.end, n.start, n.end)).reduce(
6606
+ }, nn = (e, t) => ({
6607
+ kind: "casing",
6608
+ start: e,
6609
+ end: t
6610
+ }), Ku = (e, t) => ({ kind: "casing-window", start: e, end: t }), Qu = (e) => {
6611
+ const t = (e.windows || []).filter(
6612
+ (n) => Ou(e.start, e.end, n.start, n.end)
6613
+ ).reduce(
6107
6614
  ({ intervals: n, lastBottom: i }, r, s, o) => {
6108
6615
  const a = (
6109
6616
  // last bottom before current start?
6110
6617
  i < r.start ? nn(i, r.start) : null
6111
- ), c = a ? a.end : i, h = Math.max(c, r.start), l = Math.min(e.end, r.end), u = Ku(h, l), f = l, p = s === o.length - 1 && // still room for a casing interval?
6112
- f < e.end ? nn(f, e.end) : null, g = [a, u, p].filter((y) => y != null);
6113
- return { intervals: [...n, ...g], lastBottom: f };
6618
+ ), c = a ? a.end : i, h = Math.max(c, r.start), l = Math.min(e.end, r.end), u = Ku(
6619
+ h,
6620
+ l
6621
+ ), f = l, p = s === o.length - 1 && // still room for a casing interval?
6622
+ f < e.end ? nn(f, e.end) : null, g = [
6623
+ a,
6624
+ u,
6625
+ p
6626
+ ].filter((y) => y != null);
6627
+ return {
6628
+ intervals: [...n, ...g],
6629
+ lastBottom: f
6630
+ };
6114
6631
  },
6115
6632
  { intervals: [], lastBottom: e.start }
6116
6633
  );
6117
6634
  return t.intervals.length ? t.intervals : [nn(e.start, e.end)];
6118
6635
  }, Ju = (e, t, n) => {
6119
- const i = t.diameter * e, r = i / 2, o = t.innerDiameter * e / 2, a = r - o, c = Qu(t).map((h) => {
6120
- const l = n(h.start, h.end), { leftPath: u, rightPath: f } = ye(r, l);
6121
- return { kind: h.kind, leftPath: u, rightPath: f, pathPoints: l };
6122
- });
6636
+ const i = t.diameter * e, r = i / 2, o = t.innerDiameter * e / 2, a = r - o, c = Qu(t).map(
6637
+ (h) => {
6638
+ const l = n(
6639
+ h.start,
6640
+ h.end
6641
+ ), { leftPath: u, rightPath: f } = ye(
6642
+ r,
6643
+ l
6644
+ );
6645
+ return { kind: h.kind, leftPath: u, rightPath: f, pathPoints: l };
6646
+ }
6647
+ );
6123
6648
  return {
6124
6649
  kind: "casing",
6125
6650
  id: t.id,
@@ -6131,15 +6656,37 @@ const Sn = (e) => new D(e.x, e.y), Du = (e) => new dt(e[0], e[1]), qr = (e) => {
6131
6656
  bottom: t.end
6132
6657
  };
6133
6658
  }, t0 = (e, t, n, i, r) => {
6134
- const { overlappingOuterStrings: s, overlappingHoles: o } = Be(e.start, e.end, t, n), a = [...s, ...o].map((u) => ({
6659
+ const { overlappingOuterStrings: s, overlappingHoles: o } = Be(
6660
+ e.start,
6661
+ e.end,
6662
+ t,
6663
+ n
6664
+ ), a = [
6665
+ ...s,
6666
+ ...o
6667
+ ].map((u) => ({
6135
6668
  start: u.start,
6136
6669
  end: u.end
6137
6670
  }));
6138
- return He([e.start, e.end], a).flatMap((u, f, d) => {
6671
+ return He(
6672
+ [e.start, e.end],
6673
+ a
6674
+ ).flatMap((u, f, d) => {
6139
6675
  if (f === d.length - 1)
6140
6676
  return [];
6141
- const p = d[f + 1], g = $u(s, o, u, e.subKind);
6142
- return [{ top: u, bottom: p, diameter: g * i }];
6677
+ const p = d[f + 1], g = $u(
6678
+ s,
6679
+ o,
6680
+ u,
6681
+ e.subKind
6682
+ );
6683
+ return [
6684
+ {
6685
+ top: u,
6686
+ bottom: p,
6687
+ diameter: g * i
6688
+ }
6689
+ ];
6143
6690
  }).map((u) => {
6144
6691
  const f = r(u.top, u.bottom);
6145
6692
  return {
@@ -6157,15 +6704,39 @@ const Sn = (e) => new D(e.x, e.y), Du = (e) => new dt(e[0], e[1]), qr = (e) => {
6157
6704
  t.globalAlpha = i.packingOpacity;
6158
6705
  const d = () => {
6159
6706
  for (let p = -1; p < o; p++) {
6160
- const g = [p * a + u + a / 2, e.height / 2 - h - f - h];
6707
+ const g = [
6708
+ p * a + u + a / 2,
6709
+ e.height / 2 - h - f - h
6710
+ ];
6161
6711
  t.beginPath();
6162
- const y = [...g], m = [g[0] - s * 2, g[1] - h / 4], _ = [g[0], g[1] - h / 2], v = [g[0] + s * 2, g[1] - h / 2 - h / 4], M = [g[0], g[1] - h];
6712
+ const y = [...g], m = [
6713
+ g[0] - s * 2,
6714
+ g[1] - h / 4
6715
+ ], _ = [
6716
+ g[0],
6717
+ g[1] - h / 2
6718
+ ], v = [
6719
+ g[0] + s * 2,
6720
+ g[1] - h / 2 - h / 4
6721
+ ], M = [g[0], g[1] - h];
6163
6722
  t.bezierCurveTo(...y, ...m, ..._), t.bezierCurveTo(..._, ...v, ...M), t.stroke();
6164
6723
  }
6165
6724
  for (let p = -1; p < o; p++) {
6166
- const g = [p * a + a + u + a / 2, e.height / 2 + c / 2 + f];
6725
+ const g = [
6726
+ p * a + a + u + a / 2,
6727
+ e.height / 2 + c / 2 + f
6728
+ ];
6167
6729
  t.beginPath();
6168
- const y = [...g], m = [g[0] - s * 2, g[1] + h / 4], _ = [g[0], g[1] + h / 2], v = [g[0] + s * 2, g[1] + h / 2 + h / 4], M = [g[0], g[1] + h];
6730
+ const y = [...g], m = [
6731
+ g[0] - s * 2,
6732
+ g[1] + h / 4
6733
+ ], _ = [
6734
+ g[0],
6735
+ g[1] + h / 2
6736
+ ], v = [
6737
+ g[0] + s * 2,
6738
+ g[1] + h / 2 + h / 4
6739
+ ], M = [g[0], g[1] + h];
6169
6740
  t.bezierCurveTo(...y, ...m, ..._), t.bezierCurveTo(..._, ...v, ...M), t.stroke();
6170
6741
  }
6171
6742
  };
@@ -6177,11 +6748,23 @@ const Sn = (e) => new D(e.x, e.y), Du = (e) => new dt(e[0], e[1]), qr = (e) => {
6177
6748
  t.lineWidth = 1;
6178
6749
  const a = o / 2;
6179
6750
  for (let c = 0; c <= 4; c++) {
6180
- const h = [c * s, e.height / 2 - o / 2], l = [h[0] - s / 2, h[1] - a], u = [h[0] - s, h[1]];
6751
+ const h = [
6752
+ c * s,
6753
+ e.height / 2 - o / 2
6754
+ ], l = [
6755
+ h[0] - s / 2,
6756
+ h[1] - a
6757
+ ], u = [h[0] - s, h[1]];
6181
6758
  t.beginPath(), t.moveTo(...h), t.lineTo(...l), t.lineTo(...u), t.fill(), t.lineWidth = 1, t.stroke();
6182
6759
  }
6183
6760
  for (let c = 0; c <= 4; c++) {
6184
- const h = [c * s, e.height / 2 + o / 2], l = [h[0] - s / 2, h[1] + a], u = [h[0] - s, h[1]];
6761
+ const h = [
6762
+ c * s,
6763
+ e.height / 2 + o / 2
6764
+ ], l = [
6765
+ h[0] - s / 2,
6766
+ h[1] + a
6767
+ ], u = [h[0] - s, h[1]];
6185
6768
  t.beginPath(), t.moveTo(...h), t.lineTo(...l), t.lineTo(...u), t.fill(), t.lineWidth = 1, t.stroke();
6186
6769
  }
6187
6770
  t.closePath();
@@ -6213,23 +6796,55 @@ const Sn = (e) => new D(e.x, e.y), Du = (e) => new dt(e[0], e[1]), qr = (e) => {
6213
6796
  }),
6214
6797
  orig: new jt(0, 0, e.width, e.height),
6215
6798
  rotate: Ln.MIRROR_HORIZONTAL
6216
- }), n0 = (e, t) => (n) => t.some((i) => n(i) && Cl(e, i)), Wn = {
6799
+ }), n0 = (e, t) => (n) => t.some(
6800
+ (i) => n(i) && Cl(e, i)
6801
+ ), Wn = {
6217
6802
  packing: () => ht(),
6218
6803
  fracLines: () => ht(),
6219
6804
  spikes: (e, t, n, i) => {
6220
- const { canvas: r, ctx: s } = wt(t, i), o = n0(e, n), a = o(Ml), c = o(Pl), h = o(Al), u = a || c || h ? i.yellow : i.red;
6221
- return s.globalAlpha = i.packingOpacity, e.isOpen ? (s.fillStyle = u, s.strokeStyle = u) : (s.fillStyle = i.grey, s.strokeStyle = i.grey), e0(r, s, t.diameter, i), h && Yn(r, s, t.diameter, i, "spike"), bt(r);
6805
+ const { canvas: r, ctx: s } = wt(
6806
+ t,
6807
+ i
6808
+ ), o = n0(
6809
+ e,
6810
+ n
6811
+ ), a = o(
6812
+ Ml
6813
+ ), c = o(
6814
+ Pl
6815
+ ), h = o(
6816
+ Al
6817
+ ), u = a || c || h ? i.yellow : i.red;
6818
+ return s.globalAlpha = i.packingOpacity, e.isOpen ? (s.fillStyle = u, s.strokeStyle = u) : (s.fillStyle = i.grey, s.strokeStyle = i.grey), e0(r, s, t.diameter, i), h && Yn(
6819
+ r,
6820
+ s,
6821
+ t.diameter,
6822
+ i,
6823
+ "spike"
6824
+ ), bt(r);
6222
6825
  }
6223
6826
  }, Kr = {
6224
6827
  packing: () => ht(),
6225
6828
  fracLines: (e, t) => {
6226
- const { canvas: n, ctx: i } = wt(e, t);
6227
- return Yn(n, i, e.diameter, t, "diameter"), bt(n);
6829
+ const { canvas: n, ctx: i } = wt(
6830
+ e,
6831
+ t
6832
+ );
6833
+ return Yn(
6834
+ n,
6835
+ i,
6836
+ e.diameter,
6837
+ t,
6838
+ "diameter"
6839
+ ), bt(n);
6228
6840
  },
6229
6841
  spikes: () => ht()
6230
6842
  }, ke = {
6231
6843
  packing: (e, t) => {
6232
- const { canvas: n, ctx: i } = wt(e, t);
6844
+ const { canvas: n, ctx: i } = wt(
6845
+ e,
6846
+ t
6847
+ );
6233
6848
  return Xe(n, i, t), bt(n);
6234
6849
  },
6235
6850
  fracLines: (e, t) => {
@@ -6239,51 +6854,99 @@ const Sn = (e) => new D(e.x, e.y), Du = (e) => new dt(e[0], e[1]), qr = (e) => {
6239
6854
  spikes: () => ht()
6240
6855
  }, Gn = {
6241
6856
  packing: (e, t) => {
6242
- const { canvas: n, ctx: i } = wt(e, t);
6857
+ const { canvas: n, ctx: i } = wt(
6858
+ e,
6859
+ t
6860
+ );
6243
6861
  return Xe(n, i, t), bt(n);
6244
6862
  },
6245
6863
  fracLines: () => ht(),
6246
6864
  spikes: () => ht()
6247
6865
  }, qn = {
6248
6866
  packing: (e, t) => {
6249
- const { canvas: n, ctx: i } = wt(e, t);
6867
+ const { canvas: n, ctx: i } = wt(
6868
+ e,
6869
+ t
6870
+ );
6250
6871
  return Xe(n, i, t), bt(n);
6251
6872
  },
6252
6873
  fracLines: () => ht(),
6253
6874
  spikes: () => ht()
6254
6875
  }, jn = {
6255
6876
  packing: (e, t, n) => {
6256
- const { canvas: i, ctx: r } = wt(t, n);
6877
+ const { canvas: i, ctx: r } = wt(
6878
+ t,
6879
+ n
6880
+ );
6257
6881
  return Xe(i, r, n), bt(i);
6258
6882
  },
6259
6883
  fracLines: (e, t) => {
6260
- const { canvas: n, ctx: i } = wt(e, t);
6261
- return Yn(n, i, e.diameter, t, "diameter"), bt(n);
6884
+ const { canvas: n, ctx: i } = wt(
6885
+ e,
6886
+ t
6887
+ );
6888
+ return Yn(
6889
+ n,
6890
+ i,
6891
+ e.diameter,
6892
+ t,
6893
+ "diameter"
6894
+ ), bt(n);
6262
6895
  },
6263
6896
  spikes: () => ht()
6264
6897
  }, i0 = (e, t, n) => tt(
6265
6898
  {
6266
6899
  Perforation: () => Wn.packing(),
6267
- CasedHoleFracturation: () => ke.packing(t, n),
6268
- CasedHoleFracPack: () => ke.packing(t, n),
6269
- OpenHoleGravelPack: () => qn.packing(t, n),
6270
- OpenHoleFracPack: () => jn.packing(e, t, n),
6271
- CasedHoleGravelPack: () => Gn.packing(t, n)
6900
+ CasedHoleFracturation: () => ke.packing(
6901
+ t,
6902
+ n
6903
+ ),
6904
+ CasedHoleFracPack: () => ke.packing(
6905
+ t,
6906
+ n
6907
+ ),
6908
+ OpenHoleGravelPack: () => qn.packing(
6909
+ t,
6910
+ n
6911
+ ),
6912
+ OpenHoleFracPack: () => jn.packing(
6913
+ e,
6914
+ t,
6915
+ n
6916
+ ),
6917
+ CasedHoleGravelPack: () => Gn.packing(
6918
+ t,
6919
+ n
6920
+ )
6272
6921
  },
6273
6922
  e.subKind
6274
6923
  ), r0 = (e, t, n) => tt(
6275
6924
  {
6276
6925
  Perforation: () => Wn.fracLines(),
6277
6926
  OpenHoleGravelPack: () => qn.fracLines(),
6278
- OpenHoleFracPack: () => jn.fracLines(t, n),
6279
- CasedHoleFracturation: () => Kr.fracLines(t, n),
6927
+ OpenHoleFracPack: () => jn.fracLines(
6928
+ t,
6929
+ n
6930
+ ),
6931
+ CasedHoleFracturation: () => Kr.fracLines(
6932
+ t,
6933
+ n
6934
+ ),
6280
6935
  CasedHoleGravelPack: () => Gn.fracLines(),
6281
- CasedHoleFracPack: () => ke.fracLines(t, n)
6936
+ CasedHoleFracPack: () => ke.fracLines(
6937
+ t,
6938
+ n
6939
+ )
6282
6940
  },
6283
6941
  e.subKind
6284
6942
  ), s0 = (e, t, n, i) => tt(
6285
6943
  {
6286
- Perforation: () => Wn.spikes(e, n, t, i),
6944
+ Perforation: () => Wn.spikes(
6945
+ e,
6946
+ n,
6947
+ t,
6948
+ i
6949
+ ),
6287
6950
  OpenHoleGravelPack: () => qn.spikes(),
6288
6951
  OpenHoleFracPack: () => jn.spikes(),
6289
6952
  CasedHoleFracturation: () => Kr.spikes(),
@@ -6531,7 +7194,10 @@ class u0 extends En {
6531
7194
  * @param points - An array of {@link Point} objects to construct this rope.
6532
7195
  */
6533
7196
  constructor(t, n) {
6534
- const i = new l0(n, t.height);
7197
+ const i = new l0(
7198
+ n,
7199
+ t.height
7200
+ );
6535
7201
  super({ geometry: i, texture: t }), this.autoUpdate = !0, this.onRender = () => {
6536
7202
  var s, o;
6537
7203
  const r = this.geometry;
@@ -6584,36 +7250,97 @@ const f0 = (e, t, n) => (i) => {
6584
7250
  }, this.perforationRopeAndTextureReferences = [], this.prepareSymbolRenderObject = (r) => {
6585
7251
  const { exaggerationFactor: s = 1 } = this.options, o = r.diameter * s;
6586
7252
  return {
6587
- pathPoints: this.getZFactorScaledPathForPoints(r.start, r.end),
7253
+ pathPoints: this.getZFactorScaledPathForPoints(
7254
+ r.start,
7255
+ r.end
7256
+ ),
6588
7257
  referenceDiameter: o,
6589
7258
  symbolKey: r.symbolKey
6590
7259
  };
6591
- }, this.drawSymbolComponent = ({ pathPoints: r, referenceDiameter: s, symbolKey: o }) => {
7260
+ }, this.drawSymbolComponent = ({
7261
+ pathPoints: r,
7262
+ referenceDiameter: s,
7263
+ symbolKey: o
7264
+ }) => {
6592
7265
  const a = this.getSymbolTexture(o, s);
6593
7266
  this.drawSVGRope(r, a);
6594
7267
  }, this.drawHoleSize = (r, s) => {
6595
7268
  if (s == null)
6596
7269
  return;
6597
- const o = this.getZFactorScaledPathForPoints(s.start, s.end);
7270
+ const o = this.getZFactorScaledPathForPoints(
7271
+ s.start,
7272
+ s.end
7273
+ );
6598
7274
  if (o.length === 0)
6599
7275
  return;
6600
- const { exaggerationFactor: a = 1, holeOptions: c } = this.options, h = s.diameter * a, { rightPath: l, leftPath: u } = ye(h / 2, o), f = this.getHoleTexture(c, h, r);
6601
- this.drawHoleRope(o, f, r), this.drawOutline(u, l, pt(c.lineColor), dl * a, "TopAndBottom", 0);
7276
+ const { exaggerationFactor: a = 1, holeOptions: c } = this.options, h = s.diameter * a, { rightPath: l, leftPath: u } = ye(
7277
+ h / 2,
7278
+ o
7279
+ ), f = this.getHoleTexture(
7280
+ c,
7281
+ h,
7282
+ r
7283
+ );
7284
+ this.drawHoleRope(o, f, r), this.drawOutline(
7285
+ u,
7286
+ l,
7287
+ pt(c.lineColor),
7288
+ dl * a,
7289
+ "TopAndBottom",
7290
+ 0
7291
+ );
6602
7292
  }, this.drawCasing = (r) => {
6603
7293
  const { casingOptions: s } = this.options, o = pt(s.solidColor), a = pt(s.lineColor);
6604
7294
  r.sections.forEach((c, h, l) => {
6605
- const u = Fe.getOutlineClosureType(h, l.length - 1), f = this.createCasingTexture(r.referenceDiameter);
6606
- this.drawRope(c.pathPoints, f, o), c.kind === "casing-window" ? this.drawCasingWindowOutline(c.leftPath, c.rightPath, s, r.casingWallWidth) : this.drawOutline(c.leftPath, c.rightPath, a, r.casingWallWidth, u);
7295
+ const u = Fe.getOutlineClosureType(
7296
+ h,
7297
+ l.length - 1
7298
+ ), f = this.createCasingTexture(
7299
+ r.referenceDiameter
7300
+ );
7301
+ this.drawRope(c.pathPoints, f, o), c.kind === "casing-window" ? this.drawCasingWindowOutline(
7302
+ c.leftPath,
7303
+ c.rightPath,
7304
+ s,
7305
+ r.casingWallWidth
7306
+ ) : this.drawOutline(
7307
+ c.leftPath,
7308
+ c.rightPath,
7309
+ a,
7310
+ r.casingWallWidth,
7311
+ u
7312
+ );
6607
7313
  });
6608
7314
  }, this.generateShoe = (r, s, o, a) => {
6609
- const c = r - o, h = r, l = this.getZFactorScaledPathForPoints(c, h), u = qr(l), f = Mn(l, u, s * (a < 0 ? -1 : 1)), d = l[l.length - 1], p = u[u.length - 1], g = jr(d, p, a + s * (a < 0 ? -1 : 1));
7315
+ const c = r - o, h = r, l = this.getZFactorScaledPathForPoints(c, h), u = qr(l), f = Mn(
7316
+ l,
7317
+ u,
7318
+ s * (a < 0 ? -1 : 1)
7319
+ ), d = l[l.length - 1], p = u[u.length - 1], g = jr(
7320
+ d,
7321
+ p,
7322
+ a + s * (a < 0 ? -1 : 1)
7323
+ );
6610
7324
  return [...f, g];
6611
7325
  }, this.createCementSqueezeShape = (r, s, o, a) => {
6612
7326
  const { exaggerationFactor: c = 1 } = this.options;
6613
- return Xu(r, s, o, a, c, this.getZFactorScaledPathForPoints);
7327
+ return Xu(
7328
+ r,
7329
+ s,
7330
+ o,
7331
+ a,
7332
+ c,
7333
+ this.getZFactorScaledPathForPoints
7334
+ );
6614
7335
  }, this.createPerforationShape = (r, s, o) => {
6615
7336
  const { exaggerationFactor: a = 1 } = this.options;
6616
- return t0(r, s, o, a, this.getZFactorScaledPathForPoints);
7337
+ return t0(
7338
+ r,
7339
+ s,
7340
+ o,
7341
+ a,
7342
+ this.getZFactorScaledPathForPoints
7343
+ );
6617
7344
  }, this.options = {
6618
7345
  ...this.options,
6619
7346
  ...d0(this.id),
@@ -6628,16 +7355,25 @@ const f0 = (e, t, n) => (i) => {
6628
7355
  }
6629
7356
  async onRescale(t) {
6630
7357
  const n = this.scalingFactors.zFactor !== t.zFactor;
6631
- this.scalingFactors = { height: t.height, zFactor: t.zFactor, yScale: t.yScale }, super.optionsRescale(t);
7358
+ this.scalingFactors = {
7359
+ height: t.height,
7360
+ zFactor: t.zFactor,
7361
+ yScale: t.yScale
7362
+ }, super.optionsRescale(t);
6632
7363
  const i = this.yRatio(), r = t.xBounds[0] > t.xBounds[1], s = t.yBounds[0] > t.yBounds[1];
6633
- this.setContainerPosition(t.xScale(0), t.yScale(0)), this.setContainerScale(t.xRatio * (r ? -1 : 1), i * (s ? -1 : 1)), n && (this.clearLayer(), await this.preRender()), this.render();
7364
+ this.setContainerPosition(t.xScale(0), t.yScale(0)), this.setContainerScale(
7365
+ t.xRatio * (r ? -1 : 1),
7366
+ i * (s ? -1 : 1)
7367
+ ), n && (this.clearLayer(), await this.preRender()), this.render();
6634
7368
  }
6635
7369
  async setVisibility(t, n) {
6636
7370
  if (n === this.id) {
6637
7371
  super.setVisibility(t, n);
6638
7372
  return;
6639
7373
  }
6640
- const { internalLayerOptions: i } = this.options, s = (i ? Object.entries(i) : []).find(([a, c]) => c === n), o = s == null ? void 0 : s[0];
7374
+ const { internalLayerOptions: i } = this.options, s = (i ? Object.entries(i) : []).find(
7375
+ ([a, c]) => c === n
7376
+ ), o = s == null ? void 0 : s[0];
6641
7377
  o && (this.internalLayerVisibility[o] = t, this.clearLayer(), await this.preRender(), this.render());
6642
7378
  }
6643
7379
  getInternalLayerIds() {
@@ -6650,12 +7386,18 @@ const f0 = (e, t, n) => (i) => {
6650
7386
  */
6651
7387
  yRatio() {
6652
7388
  const t = this.scalingFactors.yScale.domain(), i = (t[1] - t[0]) * this.scalingFactors.zFactor, r = [t[0], t[0] + i];
6653
- return Math.abs(this.scalingFactors.height / (r[1] - r[0]));
7389
+ return Math.abs(
7390
+ this.scalingFactors.height / (r[1] - r[0])
7391
+ );
6654
7392
  }
6655
7393
  drawRope(t, n, i) {
6656
7394
  if (t.length === 0)
6657
7395
  return;
6658
- const r = new Kn({ texture: n, points: t, textureScale: 1 });
7396
+ const r = new Kn({
7397
+ texture: n,
7398
+ points: t,
7399
+ textureScale: 1
7400
+ });
6659
7401
  r.tint = i || r.tint, this.addChild(r);
6660
7402
  }
6661
7403
  /**
@@ -6669,7 +7411,11 @@ const f0 = (e, t, n) => (i) => {
6669
7411
  */
6670
7412
  drawOutline(t, n, i, r = 1, s = "None", o = 1) {
6671
7413
  const a = t.map((u) => u.clone()).reverse(), c = n[0], h = a[0], l = new qt();
6672
- l.moveTo(c.x, c.y), n.forEach((u) => l.lineTo(u.x, u.y)), (s === "None" || s === "Top") && l.moveTo(h.x, h.y), a.forEach((u) => l.lineTo(u.x, u.y)), (s === "TopAndBottom" || s === "Top") && l.lineTo(c.x, c.y), l.stroke({ width: r, color: i, alignment: o }), this.addChild(l);
7414
+ l.moveTo(c.x, c.y), n.forEach((u) => l.lineTo(u.x, u.y)), (s === "None" || s === "Top") && l.moveTo(h.x, h.y), a.forEach((u) => l.lineTo(u.x, u.y)), (s === "TopAndBottom" || s === "Top") && l.lineTo(c.x, c.y), l.stroke({
7415
+ width: r,
7416
+ color: i,
7417
+ alignment: o
7418
+ }), this.addChild(l);
6673
7419
  }
6674
7420
  /**
6675
7421
  * Uses a dashed outline on one side to represent casing window
@@ -6683,7 +7429,11 @@ const f0 = (e, t, n) => (i) => {
6683
7429
  drawCasingWindowOutline(t, n, { lineColor: i, windowOptions: r }, s = 1) {
6684
7430
  var g, y;
6685
7431
  const o = !!((y = (g = this.referenceSystem) == null ? void 0 : g.options) != null && y.calculateDisplacementFromBottom), [a, c] = o ? [t, n] : [n, t], [h, l] = o ? [1, 0] : [0, 1], u = new qt(), f = a[0];
6686
- u.moveTo(f.x, f.y), a.forEach((m) => u.lineTo(m.x, m.y)), u.setStrokeStyle({ width: s, color: pt(i), alignment: l });
7432
+ u.moveTo(f.x, f.y), a.forEach((m) => u.lineTo(m.x, m.y)), u.setStrokeStyle({
7433
+ width: s,
7434
+ color: pt(i),
7435
+ alignment: l
7436
+ });
6687
7437
  const d = new Tn(u, {
6688
7438
  dash: [r.dashLength, r.spaceLength],
6689
7439
  color: pt(r.dashColor),
@@ -6697,25 +7447,55 @@ const f0 = (e, t, n) => (i) => {
6697
7447
  async preRender() {
6698
7448
  if (!this.data || !this.referenceSystem)
6699
7449
  return;
6700
- const { exaggerationFactor: t = 1 } = this.options, { holeSizes: n, casings: i, cements: r, completion: s, symbols: o, pAndA: a, perforations: c } = this.data;
7450
+ const { exaggerationFactor: t = 1 } = this.options, {
7451
+ holeSizes: n,
7452
+ casings: i,
7453
+ cements: r,
7454
+ completion: s,
7455
+ symbols: o,
7456
+ pAndA: a,
7457
+ perforations: c
7458
+ } = this.data;
6701
7459
  await this.updateSymbolCache(o), n.sort((g, y) => y.diameter - g.diameter);
6702
7460
  const h = n.length > 0 ? (an(n, (g) => g.diameter) ?? 0) * t : fl * t;
6703
- this.internalLayerVisibility.holeLayerId && n.forEach((g) => this.drawHoleSize(h, g)), i.sort((g, y) => y.diameter - g.diameter);
6704
- const l = i.map((g) => this.createCasingRenderObject(g)), u = r.map(
7461
+ this.internalLayerVisibility.holeLayerId && n.forEach(
7462
+ (g) => this.drawHoleSize(h, g)
7463
+ ), i.sort((g, y) => y.diameter - g.diameter);
7464
+ const l = i.map(
7465
+ (g) => this.createCasingRenderObject(g)
7466
+ ), u = r.map(
6705
7467
  (g) => ({
6706
7468
  kind: "cement",
6707
- segments: Hu(g, i, s, n, t, this.getZFactorScaledPathForPoints),
7469
+ segments: Hu(
7470
+ g,
7471
+ i,
7472
+ s,
7473
+ n,
7474
+ t,
7475
+ this.getZFactorScaledPathForPoints
7476
+ ),
6708
7477
  casingIds: (g.referenceIds || []).filter((y) => y)
6709
7478
  })
6710
7479
  ), [f, d] = a.reduce(
6711
7480
  ([g, y], m) => xl(m) ? [[m, ...g], y] : [g, [m, ...y]],
6712
7481
  [[], []]
6713
- ), p = f.map((g) => ({
6714
- kind: "cementSqueeze",
6715
- segments: this.createCementSqueezeShape(g, i, s, n),
6716
- casingIds: g.referenceIds
6717
- }));
6718
- if (this.sortCementAndCasingRenderObjects(l, u, p).forEach(
7482
+ ), p = f.map(
7483
+ (g) => ({
7484
+ kind: "cementSqueeze",
7485
+ segments: this.createCementSqueezeShape(
7486
+ g,
7487
+ i,
7488
+ s,
7489
+ n
7490
+ ),
7491
+ casingIds: g.referenceIds
7492
+ })
7493
+ );
7494
+ if (this.sortCementAndCasingRenderObjects(
7495
+ l,
7496
+ u,
7497
+ p
7498
+ ).forEach(
6719
7499
  f0(
6720
7500
  (g) => {
6721
7501
  this.internalLayerVisibility.casingLayerId && (this.drawCasing(g), g.hasShoe && this.drawShoe(g.bottom, g.referenceRadius));
@@ -6742,36 +7522,82 @@ const f0 = (e, t, n) => (i) => {
6742
7522
  }), this.perforationRopeAndTextureReferences = [], this.internalLayerVisibility.perforationLayerId) {
6743
7523
  const { perforationOptions: g } = this.options, y = c.filter(bl), m = c.filter(Tl), _ = c.filter(Sl);
6744
7524
  y.forEach((v) => {
6745
- const b = this.createPerforationShape(v, i, n).reduce(
7525
+ const b = this.createPerforationShape(
7526
+ v,
7527
+ i,
7528
+ n
7529
+ ).reduce(
6746
7530
  (S, T) => (S[T.diameter] || (S[T.diameter] = []), S[T.diameter] = [...S[T.diameter] ?? [], T], S),
6747
7531
  {}
6748
7532
  );
6749
- Object.values(b).forEach((S) => {
6750
- const T = i0(v, S[0], g), C = this.drawComplexRope(S, T);
6751
- C && this.perforationRopeAndTextureReferences.push({ rope: C, texture: T });
6752
- });
7533
+ Object.values(b).forEach(
7534
+ (S) => {
7535
+ const T = i0(
7536
+ v,
7537
+ S[0],
7538
+ g
7539
+ ), C = this.drawComplexRope(
7540
+ S,
7541
+ T
7542
+ );
7543
+ C && this.perforationRopeAndTextureReferences.push({ rope: C, texture: T });
7544
+ }
7545
+ );
6753
7546
  }), _.forEach((v) => {
6754
- const S = this.createPerforationShape(v, i, n).map((T) => ({ ...T, diameter: T.diameter * 3 })).reduce(
7547
+ const S = this.createPerforationShape(
7548
+ v,
7549
+ i,
7550
+ n
7551
+ ).map((T) => ({
7552
+ ...T,
7553
+ diameter: T.diameter * 3
7554
+ })).reduce(
6755
7555
  (T, C) => (T[C.diameter] || (T[C.diameter] = []), T[C.diameter] = [...T[C.diameter] ?? [], C], T),
6756
7556
  {}
6757
7557
  );
6758
- Object.values(S).forEach((T) => {
6759
- T.forEach((C) => {
6760
- const k = s0(v, c, C, g), R = this.drawComplexRope([C], k);
6761
- R && this.perforationRopeAndTextureReferences.push({ rope: R, texture: k });
6762
- });
6763
- });
7558
+ Object.values(S).forEach(
7559
+ (T) => {
7560
+ T.forEach((C) => {
7561
+ const k = s0(
7562
+ v,
7563
+ c,
7564
+ C,
7565
+ g
7566
+ ), R = this.drawComplexRope([C], k);
7567
+ R && this.perforationRopeAndTextureReferences.push({
7568
+ rope: R,
7569
+ texture: k
7570
+ });
7571
+ });
7572
+ }
7573
+ );
6764
7574
  }), m.forEach((v) => {
6765
- const S = this.createPerforationShape(v, i, n).map((T) => ({ ...T, diameter: T.diameter * 3 })).reduce(
7575
+ const S = this.createPerforationShape(
7576
+ v,
7577
+ i,
7578
+ n
7579
+ ).map((T) => ({
7580
+ ...T,
7581
+ diameter: T.diameter * 3
7582
+ })).reduce(
6766
7583
  (T, C) => (T[C.diameter] || (T[C.diameter] = []), T[C.diameter] = [...T[C.diameter] ?? [], C], T),
6767
7584
  {}
6768
7585
  );
6769
- Object.values(S).forEach((T) => {
6770
- T.forEach((C) => {
6771
- const k = r0(v, C, g), R = this.drawComplexRope([C], k);
6772
- R && this.perforationRopeAndTextureReferences.push({ rope: R, texture: k });
6773
- });
6774
- });
7586
+ Object.values(S).forEach(
7587
+ (T) => {
7588
+ T.forEach((C) => {
7589
+ const k = r0(
7590
+ v,
7591
+ C,
7592
+ g
7593
+ ), R = this.drawComplexRope([C], k);
7594
+ R && this.perforationRopeAndTextureReferences.push({
7595
+ rope: R,
7596
+ texture: k
7597
+ });
7598
+ });
7599
+ }
7600
+ );
6775
7601
  });
6776
7602
  }
6777
7603
  this.internalLayerVisibility.completionLayerId && s.forEach(
@@ -6794,9 +7620,11 @@ const f0 = (e, t, n) => (i) => {
6794
7620
  async updateSymbolCache(t) {
6795
7621
  if (this.textureSymbolCacheArray || (this.textureSymbolCacheArray = {}), !t)
6796
7622
  return;
6797
- const n = Object.keys(this.textureSymbolCacheArray), i = Object.entries(t).map(async ([r, s]) => {
6798
- !n.includes(r) && this.textureSymbolCacheArray && (this.textureSymbolCacheArray[r] = await us.load(s));
6799
- });
7623
+ const n = Object.keys(this.textureSymbolCacheArray), i = Object.entries(t).map(
7624
+ async ([r, s]) => {
7625
+ !n.includes(r) && this.textureSymbolCacheArray && (this.textureSymbolCacheArray[r] = await us.load(s));
7626
+ }
7627
+ );
6800
7628
  await Promise.all(i);
6801
7629
  }
6802
7630
  drawCementPlug(t, n, i, r) {
@@ -6808,10 +7636,16 @@ const f0 = (e, t, n) => (i) => {
6808
7636
  s,
6809
7637
  this.getZFactorScaledPathForPoints
6810
7638
  );
6811
- o && this.drawComplexRope(a, this.getCementPlugTexture(o));
7639
+ o && this.drawComplexRope(
7640
+ a,
7641
+ this.getCementPlugTexture(o)
7642
+ );
6812
7643
  const { rightPath: c, leftPath: h } = a.reduce(
6813
7644
  (l, u) => {
6814
- const { leftPath: f, rightPath: d } = ye(u.diameter / 2, u.points);
7645
+ const { leftPath: f, rightPath: d } = ye(
7646
+ u.diameter / 2,
7647
+ u.points
7648
+ );
6815
7649
  return {
6816
7650
  rightPath: [...l.rightPath, ...d],
6817
7651
  leftPath: [...l.leftPath, ...f]
@@ -6819,11 +7653,21 @@ const f0 = (e, t, n) => (i) => {
6819
7653
  },
6820
7654
  { rightPath: [], leftPath: [] }
6821
7655
  );
6822
- this.drawOutline(h, c, pt("black"), 0.25, "TopAndBottom");
7656
+ this.drawOutline(
7657
+ h,
7658
+ c,
7659
+ pt("black"),
7660
+ 0.25,
7661
+ "TopAndBottom"
7662
+ );
6823
7663
  }
6824
7664
  createCasingRenderObject(t) {
6825
7665
  const { exaggerationFactor: n = 1 } = this.options;
6826
- return Ju(n, t, this.getZFactorScaledPathForPoints);
7666
+ return Ju(
7667
+ n,
7668
+ t,
7669
+ this.getZFactorScaledPathForPoints
7670
+ );
6827
7671
  }
6828
7672
  getCementPlugTexture(t) {
6829
7673
  return this.cementPlugTextureCache || (this.cementPlugTextureCache = ju(t)), this.cementPlugTextureCache;
@@ -6831,18 +7675,29 @@ const f0 = (e, t, n) => (i) => {
6831
7675
  drawSVGRope(t, n) {
6832
7676
  if (t.length === 0)
6833
7677
  return;
6834
- const i = new u0(n, t);
7678
+ const i = new u0(
7679
+ n,
7680
+ t
7681
+ );
6835
7682
  this.addChild(i);
6836
7683
  }
6837
7684
  getSymbolTexture(t, n) {
6838
7685
  var r, s;
6839
7686
  const i = (s = (r = this.textureSymbolCacheArray) == null ? void 0 : r[t]) == null ? void 0 : s.source;
6840
- return i ? new K({ source: i, orig: new jt(0, 0, 0, n), rotate: Ln.MAIN_DIAGONAL }) : void 0;
7687
+ return i ? new K({
7688
+ source: i,
7689
+ orig: new jt(0, 0, 0, n),
7690
+ rotate: Ln.MAIN_DIAGONAL
7691
+ }) : void 0;
6841
7692
  }
6842
7693
  drawHoleRope(t, n, i) {
6843
7694
  if (t.length === 0)
6844
7695
  return;
6845
- const r = new Kn({ texture: n, points: t, textureScale: i / vt });
7696
+ const r = new Kn({
7697
+ texture: n,
7698
+ points: t,
7699
+ textureScale: i / vt
7700
+ });
6846
7701
  this.addChild(r);
6847
7702
  }
6848
7703
  getHoleTexture(t, n, i) {
@@ -6865,14 +7720,31 @@ const f0 = (e, t, n) => (i) => {
6865
7720
  let r = 0;
6866
7721
  const { result: s } = t.reduce(
6867
7722
  (o, a) => {
6868
- const c = o.remainingCement.find((l) => l.casingIds.includes(a.id)), h = o.remainingCementSqueezes.filter((l) => l.casingIds.includes(a.id));
7723
+ const c = o.remainingCement.find(
7724
+ (l) => l.casingIds.includes(a.id)
7725
+ ), h = o.remainingCementSqueezes.filter(
7726
+ (l) => l.casingIds.includes(a.id)
7727
+ );
6869
7728
  return c && (c.zIndex = r++), h.forEach((l) => l.zIndex = r++), a.zIndex = r++, {
6870
- result: [...o.result, c, a, ...h],
6871
- remainingCement: o.remainingCement.filter((l) => l !== c),
6872
- remainingCementSqueezes: o.remainingCementSqueezes.filter((l) => !h.includes(l))
7729
+ result: [
7730
+ ...o.result,
7731
+ c,
7732
+ a,
7733
+ ...h
7734
+ ],
7735
+ remainingCement: o.remainingCement.filter(
7736
+ (l) => l !== c
7737
+ ),
7738
+ remainingCementSqueezes: o.remainingCementSqueezes.filter(
7739
+ (l) => !h.includes(l)
7740
+ )
6873
7741
  };
6874
7742
  },
6875
- { result: [], remainingCement: n, remainingCementSqueezes: i }
7743
+ {
7744
+ result: [],
7745
+ remainingCement: n,
7746
+ remainingCementSqueezes: i
7747
+ }
6876
7748
  );
6877
7749
  return s.filter((o) => o != null).sort((o, a) => o.zIndex - a.zIndex);
6878
7750
  }
@@ -6898,7 +7770,17 @@ const f0 = (e, t, n) => (i) => {
6898
7770
  });
6899
7771
  }
6900
7772
  drawShoe(t, n) {
6901
- const { exaggerationFactor: i = 1, casingOptions: r } = this.options, s = r.shoeSize.width * i, o = r.shoeSize.length * i, a = this.generateShoe(t, n, o, s), c = this.generateShoe(t, n, o, -s);
7773
+ const { exaggerationFactor: i = 1, casingOptions: r } = this.options, s = r.shoeSize.width * i, o = r.shoeSize.length * i, a = this.generateShoe(
7774
+ t,
7775
+ n,
7776
+ o,
7777
+ s
7778
+ ), c = this.generateShoe(
7779
+ t,
7780
+ n,
7781
+ o,
7782
+ -s
7783
+ );
6902
7784
  this.drawBigPolygon(c), this.drawBigPolygon(a);
6903
7785
  }
6904
7786
  getCementTexture() {
@@ -6916,8 +7798,17 @@ const f0 = (e, t, n) => (i) => {
6916
7798
  return this.cementSqueezeTextureCache;
6917
7799
  }
6918
7800
  drawScreen({ start: t, end: n, diameter: i }) {
6919
- const { exaggerationFactor: r = 1, screenOptions: s } = this.options, o = r * i, a = this.getZFactorScaledPathForPoints(t, n), { leftPath: c, rightPath: h } = ye(o / 2, a), l = this.getScreenTexture();
6920
- l && (this.drawCompletionRope(a, l, o), this.drawOutline(c, h, pt(s.lineColor), pl * r, "TopAndBottom"));
7801
+ const { exaggerationFactor: r = 1, screenOptions: s } = this.options, o = r * i, a = this.getZFactorScaledPathForPoints(t, n), { leftPath: c, rightPath: h } = ye(
7802
+ o / 2,
7803
+ a
7804
+ ), l = this.getScreenTexture();
7805
+ l && (this.drawCompletionRope(a, l, o), this.drawOutline(
7806
+ c,
7807
+ h,
7808
+ pt(s.lineColor),
7809
+ pl * r,
7810
+ "TopAndBottom"
7811
+ ));
6921
7812
  }
6922
7813
  drawTubing({ diameter: t, start: n, end: i }) {
6923
7814
  const { exaggerationFactor: r = 1, tubingOptions: s } = this.options, o = r * t, a = this.getZFactorScaledPathForPoints(n, i), c = this.getTubingTexture(s);
@@ -6936,7 +7827,11 @@ const f0 = (e, t, n) => (i) => {
6936
7827
  drawCompletionRope(t, n, i) {
6937
7828
  if (t.length === 0)
6938
7829
  return;
6939
- const r = new h0(n, t, i);
7830
+ const r = new h0(
7831
+ n,
7832
+ t,
7833
+ i
7834
+ );
6940
7835
  this.addChild(r);
6941
7836
  }
6942
7837
  };
@@ -7557,13 +8452,18 @@ class lf extends yl {
7557
8452
  }
7558
8453
  renderWellborePath(t) {
7559
8454
  if (this.rescaleEvent != null) {
7560
- const { xScale: n, yScale: i } = this.rescaleEvent, r = t.map((c) => [n(c[0]), i(c[1])]);
8455
+ const { xScale: n, yScale: i } = this.rescaleEvent, r = t.map((c) => [
8456
+ n(c[0]),
8457
+ i(c[1])
8458
+ ]);
7561
8459
  let s;
7562
8460
  const { curveType: o, tension: a } = this.options;
7563
8461
  switch (o) {
7564
8462
  default:
7565
8463
  case "curveCatmullRom":
7566
- s = P0.alpha(a || I0);
8464
+ s = P0.alpha(
8465
+ a || I0
8466
+ );
7567
8467
  break;
7568
8468
  case "curveLinear":
7569
8469
  s = ts;
@@ -7578,7 +8478,9 @@ class lf extends yl {
7578
8478
  s = S0.beta(a || D0);
7579
8479
  break;
7580
8480
  case "curveCardinal":
7581
- s = M0.tension(a || z0);
8481
+ s = M0.tension(
8482
+ a || z0
8483
+ );
7582
8484
  break;
7583
8485
  case "curveMonotoneX":
7584
8486
  s = C0;
@@ -7647,7 +8549,13 @@ class uf extends Et {
7647
8549
  const a = bn(4, 2.5, 500, this.yScale), c = a * 2, h = this.yScale(t.depth) - a, l = Math.ceil(o.width / c) + 1, u = this.xScale(0) % c;
7648
8550
  s.save(), s.strokeStyle = t.color, this.setCtxLineStyle(s, t), this.setCtxLineWidth(s, t);
7649
8551
  for (let f = -1; f < l; f++)
7650
- s.beginPath(), s.arc(f * c + u + a, h, a, 0, Math.PI), s.stroke();
8552
+ s.beginPath(), s.arc(
8553
+ f * c + u + a,
8554
+ h,
8555
+ a,
8556
+ 0,
8557
+ Math.PI
8558
+ ), s.stroke();
7651
8559
  s.restore(), t.text && this.drawText(s, t, s.canvas.width, h);
7652
8560
  }
7653
8561
  }
@@ -7702,8 +8610,20 @@ class O0 {
7702
8610
  const { container: s } = this;
7703
8611
  this._svgContainer = Z(s).append("div").attr("class", "axis").style("position", "absolute").style("z-index", "10").style("pointer-events", "none");
7704
8612
  const o = this._svgContainer.append("svg").attr("height", `${s.offsetHeight}px`).attr("width", `${s.offsetWidth}px`), a = !0;
7705
- return new Ro(o, a, r.xLabel, r.yLabel, r.unitOfMeasure);
7706
- }, this.container = t, this.layerContainer = document.createElement("div"), this.layerContainer.className = "layer-container", this.container.appendChild(this.layerContainer), this.adjustToSize(+(this.container.getAttribute("width") ?? 0), +(this.container.getAttribute("height") ?? 0)), this._zoomPanHandler = new ll(t, (r) => this.rescale(r)), n) {
8613
+ return new Ro(
8614
+ o,
8615
+ a,
8616
+ r.xLabel,
8617
+ r.yLabel,
8618
+ r.unitOfMeasure
8619
+ );
8620
+ }, this.container = t, this.layerContainer = document.createElement("div"), this.layerContainer.className = "layer-container", this.container.appendChild(this.layerContainer), this.adjustToSize(
8621
+ +(this.container.getAttribute("width") ?? 0),
8622
+ +(this.container.getAttribute("height") ?? 0)
8623
+ ), this._zoomPanHandler = new ll(
8624
+ t,
8625
+ (r) => this.rescale(r)
8626
+ ), n) {
7707
8627
  const { xMin: r, xMax: s, yMin: o, yMax: a, xBounds: c, yBounds: h } = n;
7708
8628
  r !== void 0 && s !== void 0 && o !== void 0 && a !== void 0 && this._zoomPanHandler.setBounds([r, s], [o, a]), c && h && this._zoomPanHandler.setBounds(c, h);
7709
8629
  } else
@@ -7756,7 +8676,9 @@ class O0 {
7756
8676
  }), this;
7757
8677
  }
7758
8678
  getLayer(t) {
7759
- return this.layers.find((n) => n.id === t || n.getInternalLayerIds().includes(t));
8679
+ return this.layers.find(
8680
+ (n) => n.id === t || n.getInternalLayerIds().includes(t)
8681
+ );
7760
8682
  }
7761
8683
  initLayer(t, n) {
7762
8684
  const i = {
@@ -7765,7 +8687,9 @@ class O0 {
7765
8687
  t.onMount(i);
7766
8688
  const r = this.zoomPanHandler.currentStateAsEvent();
7767
8689
  if (t.onUpdate({ ...r, ...n }), t.onRescale(r), this._svgContainer) {
7768
- const s = this.layers.length > 0 ? this.layers.reduce((o, a) => o.order > a.order ? o : a).order : 1;
8690
+ const s = this.layers.length > 0 ? this.layers.reduce(
8691
+ (o, a) => o.order > a.order ? o : a
8692
+ ).order : 1;
7769
8693
  this._svgContainer.style("z-index", `${s + 1}`);
7770
8694
  }
7771
8695
  return this;
@@ -7784,7 +8708,13 @@ class O0 {
7784
8708
  * @param height (required)
7785
8709
  */
7786
8710
  adjustToSize(t, n) {
7787
- const i = Math.max(this._axis ? t - Ir : t, 0), r = Math.max(this._axis ? n - zr : n, 0);
8711
+ const i = Math.max(
8712
+ this._axis ? t - Ir : t,
8713
+ 0
8714
+ ), r = Math.max(
8715
+ this._axis ? n - zr : n,
8716
+ 0
8717
+ );
7788
8718
  if (this._axis) {
7789
8719
  const s = { width: t, height: n };
7790
8720
  this._axis.onResize(s);
@@ -7815,17 +8745,23 @@ class O0 {
7815
8745
  return (t = this._axis) == null || t.hideLabels(), this;
7816
8746
  }
7817
8747
  setAxisOffset(t, n) {
7818
- return this._axis && (this._axis.offsetX = t, this._axis.offsetY = n, this.layers.filter((r) => r instanceof en).forEach((r) => {
8748
+ return this._axis && (this._axis.offsetX = t, this._axis.offsetY = n, this.layers.filter(
8749
+ (r) => r instanceof en
8750
+ ).forEach((r) => {
7819
8751
  r.offsetX = t, r.offsetY = n;
7820
8752
  })), this;
7821
8753
  }
7822
8754
  setXAxisOffset(t) {
7823
- return this._axis && (this._axis.offsetX = t, this.layers.filter((i) => i instanceof en).forEach((i) => {
8755
+ return this._axis && (this._axis.offsetX = t, this.layers.filter(
8756
+ (i) => i instanceof en
8757
+ ).forEach((i) => {
7824
8758
  i.offsetX = t;
7825
8759
  })), this;
7826
8760
  }
7827
8761
  setYAxisOffset(t) {
7828
- return this._axis && (this._axis.offsetY = t, this.layers.filter((i) => i instanceof en).forEach((i) => {
8762
+ return this._axis && (this._axis.offsetY = t, this.layers.filter(
8763
+ (i) => i instanceof en
8764
+ ).forEach((i) => {
7829
8765
  i.offsetY = t;
7830
8766
  })), this;
7831
8767
  }
@@ -7848,7 +8784,9 @@ class O0 {
7848
8784
  return this._axis;
7849
8785
  }
7850
8786
  rescale(t) {
7851
- this._axis && this._axis.onRescale(t), this.layers && this.layers.forEach((n) => n.isVisible === !0 ? n.onRescale(t) : {});
8787
+ this._axis && this._axis.onRescale(t), this.layers && this.layers.forEach(
8788
+ (n) => n.isVisible === !0 ? n.onRescale(t) : {}
8789
+ );
7852
8790
  }
7853
8791
  }
7854
8792
  class N0 {
@@ -7944,8 +8882,19 @@ class ff {
7944
8882
  * @param options.referenceSystem (optional) sets reference system, takes priority over path if both are supplied
7945
8883
  */
7946
8884
  constructor(t) {
7947
- const { container: n, axisOptions: i, scaleOptions: r, referenceSystem: s, layers: o, path: a } = t;
7948
- this._referenceSystem = s || a && new Jt(a), this._overlay = $0(this, n), this.layerManager = new O0(this._overlay.elm.node(), r, i), o && (this.layerManager.addLayers(o), this.setOverlayZIndex(o));
8885
+ const {
8886
+ container: n,
8887
+ axisOptions: i,
8888
+ scaleOptions: r,
8889
+ referenceSystem: s,
8890
+ layers: o,
8891
+ path: a
8892
+ } = t;
8893
+ this._referenceSystem = s || a && new Jt(a), this._overlay = $0(this, n), this.layerManager = new O0(
8894
+ this._overlay.elm.node(),
8895
+ r,
8896
+ i
8897
+ ), o && (this.layerManager.addLayers(o), this.setOverlayZIndex(o));
7949
8898
  }
7950
8899
  /**
7951
8900
  * Sets reference system, overrides any existing reference systems in place
@@ -8019,8 +8968,15 @@ class ff {
8019
8968
  */
8020
8969
  adjustToSize(t, n) {
8021
8970
  this.layerManager.adjustToSize(t, n);
8022
- const i = { width: Math.max(t - Ir, 0), height: Math.max(n - zr, 0) };
8023
- return this.overlay.elm.dispatch("resize", { detail: i, bubbles: !0, cancelable: !0 }), this;
8971
+ const i = {
8972
+ width: Math.max(t - Ir, 0),
8973
+ height: Math.max(n - zr, 0)
8974
+ };
8975
+ return this.overlay.elm.dispatch("resize", {
8976
+ detail: i,
8977
+ bubbles: !0,
8978
+ cancelable: !0
8979
+ }), this;
8024
8980
  }
8025
8981
  /**
8026
8982
  * Set new viewport
@@ -8115,7 +9071,9 @@ class ff {
8115
9071
  return this.layerManager.destroy(), this._overlay.destroy(), this._referenceSystem = void 0, this;
8116
9072
  }
8117
9073
  getHighestZIndex(t) {
8118
- return t.length > 0 ? t.reduce((i, r) => i.order > r.order ? i : r).order : 1;
9074
+ return t.length > 0 ? t.reduce(
9075
+ (i, r) => i.order > r.order ? i : r
9076
+ ).order : 1;
8119
9077
  }
8120
9078
  setOverlayZIndex(t) {
8121
9079
  const n = this.getHighestZIndex(t);