/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../../chunks/_rollupPluginBabelHelpers","../../core/maybe","../../rest/support/Query"],(function(e,t,r,u){"use strict";function n(e,t,r){return o.apply(this,arguments)}function o(){return(o=t._asyncToGenerator((function*(e,t,u){t=t.clone(),e.capabilities.query.supportsMaxRecordCountFactor&&(t.maxRecordCountFactor=c(e));const n=a(e),o=e.capabilities.query.supportsPagination;t.start=0,t.num=n;let i=null;for(;;){const a=yield e.source.queryFeaturesJSON(t,u);if(r.isNone(i)?i=a:i.features=i.features.concat(a.features),i.exceededTransferLimit=a.exceededTransferLimit,!o||!a.exceededTransferLimit)break;t.start+=n}return i}))).apply(this,arguments)}function a(e){return c(e)*i(e)}function i(e){return e.capabilities.query.maxRecordCount||2e3}function c(e){return e.capabilities.query.supportsMaxRecordCountFactor?u.MAX_MAX_RECORD_COUNT_FACTOR:1}e.getMaxRecordCountFactor=c,e.getMaximumQuerySize=a,e.getMaximumRecordCount=i,e.queryAllJSON=n,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
