/*!
 * Copyright (c) 2026 Vertex Software LLC. All rights reserved.
 */
'use strict';

var wrappers_pb = require('./wrappers_pb-Dupo3Hcb.js');
var bundle = require('./bundle-96sYCpzz.js');
var streamAttributes = require('./streamAttributes-ce88H9XR.js');

var model_entity_pbExports = wrappers_pb.requireModel_entity_pb();

const mapPlanePair = bundle.mapper.defineMapper(bundle.mapper.read(bundle.mapper.mapRequiredProp('start', streamAttributes.fromPbPlane), bundle.mapper.mapRequiredProp('end', streamAttributes.fromPbPlane)), ([start, end]) => ({ start, end }));
const mapPlanarDistance = bundle.mapper.defineMapper(bundle.mapper.read(bundle.mapper.getProp('distance'), bundle.mapper.mapRequiredProp('planes', bundle.mapper.compose(mapPlanePair, bundle.mapper.requiredProp('start'))), bundle.mapper.mapRequiredProp('planes', bundle.mapper.compose(mapPlanePair, bundle.mapper.requiredProp('end')))), ([distance, plane1, plane2]) => ({
    type: 'planar-distance',
    distance,
    plane1,
    plane2,
}));
const mapPlanarAngle = bundle.mapper.defineMapper(bundle.mapper.read(bundle.mapper.getProp('angleInRadians'), bundle.mapper.mapRequiredProp('planes', bundle.mapper.compose(mapPlanePair, bundle.mapper.requiredProp('start'))), bundle.mapper.mapRequiredProp('planes', bundle.mapper.compose(mapPlanePair, bundle.mapper.requiredProp('end')))), ([angle, plane1, plane2]) => ({
    type: 'planar-angle',
    angle,
    plane1,
    plane2,
}));
const mapMinimumDistance = bundle.mapper.defineMapper(bundle.mapper.read(bundle.mapper.getProp('distance'), bundle.mapper.mapRequiredProp('closestPoint1', streamAttributes.fromPbVector3f), bundle.mapper.mapRequiredProp('closestPoint2', streamAttributes.fromPbVector3f)), ([distance, point1, point2]) => ({
    type: 'minimum-distance',
    distance,
    point1,
    point2,
}));
const mapSurfaceArea = bundle.mapper.defineMapper(bundle.mapper.read(bundle.mapper.getProp('area')), ([area]) => ({
    type: 'surface-area',
    area,
}));
const mapPlanarDistanceFromResult = bundle.mapper.mapProp('planarDistance', bundle.mapper.ifDefined(mapPlanarDistance));
const mapPlanarAngleFromResult = bundle.mapper.mapProp('planarAngle', bundle.mapper.ifDefined(mapPlanarAngle));
const mapMinimumDistanceFromResult = bundle.mapper.mapProp('minimumDistance', bundle.mapper.ifDefined(mapMinimumDistance));
const mapSurfaceAreaFromResult = bundle.mapper.mapProp('totalSurfaceArea', bundle.mapper.ifDefined(mapSurfaceArea));
const mapMeasurementResult = bundle.mapper.compose(bundle.mapper.pickFirst(mapPlanarDistanceFromResult, mapPlanarAngleFromResult, mapMinimumDistanceFromResult, mapSurfaceAreaFromResult), bundle.mapper.required('Result field'));
const mapMeasureResponse = bundle.mapper.defineMapper(bundle.mapper.read(bundle.mapper.mapRequiredProp('outcome', bundle.mapper.mapRequiredProp('resultsList', bundle.mapper.mapArray(mapMeasurementResult))), bundle.mapper.mapRequiredProp('outcome', bundle.mapper.getProp('isApproximate'))), ([results, isApproximate]) => ({ results, isApproximate }));
const mapMeasureResponseOrThrow = bundle.mapper.ifInvalidThrow(mapMeasureResponse);

var geometry_pbExports = wrappers_pb.requireGeometry_pb();

exports.geometry_pbExports = geometry_pbExports;
exports.mapMeasureResponseOrThrow = mapMeasureResponseOrThrow;
exports.model_entity_pbExports = model_entity_pbExports;
//# sourceMappingURL=geometry_pb-C1IfJb14.js.map

//# sourceMappingURL=geometry_pb-C1IfJb14.js.map