/* COPYRIGHT Esri - https://js.arcgis.com/5.0.18/LICENSE.txt */
import{getPaths as e,isCoordinate as t}from"../../../geometry/support/curves/curveUtils.js";function n(e,t){if("freehandPolygon"===t||"freehandPolyline"===t)return"freehand";return e??("rectangle"===t||"circle"===t?"hybrid":"click")}function r(e){switch(e){case"freehandPolygon":return"polygon";case"freehandPolyline":return"polyline";case"text":return"point";default:return e}}function o(e){return!!e&&("draw-2d"===e.type||"draw-3d"===e.type)}function i(e){return!!e&&"draw-2.0"===e.type}function u(e){if(e.length>1)return!1;const t=e.at(0)?.geometry;return"point"===t?.type||"multipoint"===t?.type&&t.points.length<2}function l(e){return"string"==typeof e?e:e.find(e=>e?.legacyCreateTool)?.legacyCreateTool??e.at(0)?.geometryType}function p(n){if("point"===n.type||"mesh"===n.type)return!1;if(n&&"multipoint"===n.type&&n.points.length>0)return!1;if(n&&"polyline"===n.type){return!e(n).some(e=>e.length>1)}if(n&&"polygon"===n.type){if(n.rings.some(e=>e.length>=3))return!1;if(n.curveRings?.some(e=>e.length>=3||2===e.length&&!t(e[1])))return!1}return!0}export{r as getDrawToolGeometryTypeFromCreateTool,l as getLegacyTool,n as getModeFromCreateOptions,u as graphicsHaveTooFewVerticesForBox,p as isCompletelyDegenerate,o as isDrawGraphicTool,i as isDrawTool};
