/*! Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one or more contributor license agreements. * Licensed under the Elastic License 2.0; you may not use this file except in compliance with the Elastic License 2.0. */ (window.apm_bundle_jsonpfunction=window.apm_bundle_jsonpfunction||[]).push([[21],{1047:function(t,e,a){"use strict";a.r(e),a.d(e,"loadFieldStats",(function(){return r}));var n=a(25),i=a(477);const r=async({services:t,dataView:e,field:a,fromDate:r,toDate:o,dslQuery:s,size:l,abortController:d})=>{const{data:u}=t;try{if(null==e||!e.id||null==a||!a.type)return{};const t=async t=>(await Object(n.lastValueFrom)(u.search.search({params:Object(i.a)({dataViewPattern:e.title,timeFieldName:e.timeFieldName,fromDate:r,toDate:o,dslQuery:s,runtimeMappings:e.getRuntimeMappings(),...t})},{abortSignal:null==d?void 0:d.signal}))).rawResponse;return await Object(i.d)({searchHandler:t,dataView:e,field:a,fromDate:r,toDate:o,size:l})}catch(t){throw new Error("Could not provide field stats",{cause:t})}}}}]);