/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
export default $arcgis.t(([{queryAllJSON:s},{supportsFieldConfiguration:c},l])=>{function y(r){return r!=null&&typeof r=="object"&&"sourceLayer"in r}function g(r,n){if(!r.map)return;let{map:t}=r;t.layers.includes(n)||(t.add(n),t.reorder(n,t.layers.length-1))}async function m(r,n,t,e=!0){let u=await s(r,n,t),o=l.fromJSON(u);return e&&o.features.forEach(i=>{i.layer=f(r)?r.findSublayerForFeature(i):r,i.origin=i.layer,y(i)&&(i.sourceLayer=i.layer)}),o}function h(r){return r!=null&&typeof r=="object"&&"type"in r&&r.type==="feature"}function F(r){return r!=null&&typeof r=="object"&&"type"in r&&r.type==="graphics"}function f(r){return r!=null&&typeof r=="object"&&"type"in r&&r.type==="subtype-group"&&"sublayers"in r}function j(r){return r?.type==="subtype-sublayer"}function L(r,n){let t=n?.type==="subtype-sublayer"?n.parent:n;return r.allLayerViews.find(e=>{let u=e.layer;return u===t||"sublayers"in u&&u.sublayers!=null&&u.sublayers.includes(t)})}function a(r){let n=r?.type;return n==="binning"||n==="cluster"}function R(r,n){if(!c(r))return;let t=n?.graphic,e=r.featureReduction;if(t){if(t.isAggregate){let u=t.origin;return u&&"featureReductionProvider"in u&&e?a(e)?e:null:void 0}return r}return n?.checkFeatureReduction&&e?a(e)?e:null:r}return{a:g,b:m,c:h,d:F,e:f,f:j,g:L,h:R}},"applications/Components/featureUtils","applications/PortalApp/layerUtils","rest/support/FeatureSet")