/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["../../chunks/_rollupPluginBabelHelpers","../../chunks/tslib.es6","../../core/Error","../../core/maybe","../../core/accessorSupport/decorators/property","../../core/arrayUtils","../../core/has","../../core/accessorSupport/ensureType","../../core/accessorSupport/decorators/subclass","../../geometry/Point","../../layers/support/commonProperties","../../rest/support/Query","./support/popupUtils"],(function(e,t,r,o,s,p,i,a,n,u,c,l,y){"use strict";const h=p=>{let i=function(t){function s(){var e;return(e=t.apply(this,arguments)||this).view=null,e}e._inheritsLoose(s,t);var p=s.prototype;return p.fetchPopupFeatures=function(){var t=e._asyncToGenerator((function*(e,t){const{layer:s}=this;if(!e)throw new r("imagerylayerview:fetchPopupFeatures","Nothing to fetch without area",{layer:s});const{popupEnabled:p}=s,i=y.getFetchPopupTemplate(s,t);if(!p||o.isNone(i))throw new r("imagerylayerview:fetchPopupFeatures","Missing required popupTemplate or popupEnabled",{popupEnabled:p,popupTemplate:i});const a=yield i.getRequiredFields(),n=new l;n.timeExtent=this.timeExtent,n.geometry=e,n.outFields=a,n.outSpatialReference=e.spatialReference;const c=this.view.resolution,h="2d"===this.view.type?new u(c,c,this.view.spatialReference):new u(.5*c,.5*c,this.view.spatialReference),{returnTopmostRaster:d,showNoDataRecords:m}=i.layerOptions||{returnTopmostRaster:!0,showNoDataRecords:!1},w={returnDomainValues:!0,returnTopmostRaster:d,pixelSize:h,showNoDataRecords:m,signal:o.isSome(t)?t.signal:null};return s.queryVisibleRasters(n,w).then((e=>e))}));function s(e,r){return t.apply(this,arguments)}return s}(),p.canResume=function(){var e;return!!t.prototype.canResume.call(this)&&(null==(e=this.timeExtent)||!e.isEmpty)},s}(p);return t.__decorate([s.property()],i.prototype,"layer",void 0),t.__decorate([s.property()],i.prototype,"suspended",void 0),t.__decorate([s.property(c.combinedViewLayerTimeExtentProperty)],i.prototype,"timeExtent",void 0),t.__decorate([s.property()],i.prototype,"view",void 0),i=t.__decorate([n.subclass("esri.views.layers.ImageryLayerView")],i),i};return h}));
