/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
function l({supported:e,disabled:r,ready:t,operationState:s,valid:a}){return e?r||!t?"disabled":s==="active"?"measuring":a?"measured":"ready":"unsupported"}function m(e,r){switch(e){case"unsupported":case"measured":case"ready":return e;case"disabled":return"ready";case"measuring":return r?"measured":"measuring"}}var i=["metric","imperial"],u=["inches","feet","yards","miles","nautical-miles","us-feet","millimeters","centimeters","decimeters","meters","kilometers"],c=["square-inches","square-feet","square-yards","square-miles","square-nautical-miles","square-us-feet","square-millimeters","square-centimeters","square-decimeters","square-meters","square-kilometers","acres","ares","hectares"],n=["liters","megaliters","gigaliters","cubic-millimeters","cubic-centimeters","cubic-decimeters","cubic-meters","cubic-kilometers","cubic-inches","cubic-us-feet","cubic-feet","cubic-yards","cubic-miles"],d=[...i,...u],o=[...i,...c],f=[...i,...n];function b(e,r=!0){return r?e==null?{state:"unavailable"}:{state:"available",value:e}:{state:"invalid"}}function p(e,r){switch(r.type){case"length":return e.formatLength(r);case"area":return e.formatArea(r);case"volume":return e.formatVolume(r);default:return""}}function q(e){return e==="imperial"||e==="metric"}function g(e,r,t=r){let s=e?.filter(a=>r.includes(a));return s&&s.length>0?s.slice():t.slice()}function h(e,r,t,s){let a=e??r??s??void 0;return a&&t.includes(a)?a:t[0]}export{l as a,m as b,u as c,d,o as e,f,b as g,p as h,q as i,g as j,h as k};
