/*! 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.canvas_bundle_jsonpfunction=window.canvas_bundle_jsonpfunction||[]).push([[17],{64:function(e,r,t){"use strict";t.r(r),t.d(r,"ExpressionsService",(function(){return n.ExpressionsService})),t.d(r,"ServicesContext",(function(){return v})),t.d(r,"useServices",(function(){return a})),t.d(r,"withServices",(function(){return d})),t.d(r,"LegacyServicesProvider",(function(){return S})),t.d(r,"CanvasServiceProvider",(function(){return legacy_CanvasServiceProvider})),t.d(r,"services",(function(){return f})),t.d(r,"startLegacyServices",(function(){return l})),t.d(r,"stopServices",(function(){return g})),t.d(r,"searchService",(function(){return h})),t.d(r,"pluginServices",(function(){return p})),t.d(r,"useCustomElementService",(function(){return k})),t.d(r,"useDataViewsService",(function(){return b})),t.d(r,"useEmbeddablesService",(function(){return w})),t.d(r,"useExpressionsService",(function(){return y})),t.d(r,"useFiltersService",(function(){return H})),t.d(r,"useLabsService",(function(){return m})),t.d(r,"useNavLinkService",(function(){return j})),t.d(r,"useNotifyService",(function(){return E})),t.d(r,"usePlatformService",(function(){return P})),t.d(r,"useReportingService",(function(){return x})),t.d(r,"useVisualizationsService",(function(){return C})),t.d(r,"useWorkpadService",(function(){return _}));var s=t(1),i=t.n(s),n=t(4),c=t(16),o=t(17);const u={search:{}},v=Object(c.createContext)(u),a=()=>Object(c.useContext)(v),d=e=>r=>Object(c.createElement)(e,{...r,services:a()}),S=({providers:e={},children:r})=>{const t={search:{...f,...e}.search.getService()};return Object(o.jsx)(v.Provider,{value:t},r)};class legacy_CanvasServiceProvider{constructor(e){i()(this,"factory",void 0),i()(this,"service",void 0),this.factory=e}setService(e){this.service=e}async start(e,r,t,s,i){this.service=await this.factory(e,r,t,s,i)}getService(){if(!this.service)throw new Error("Service not ready");return this.service}stop(){this.service=void 0}}const f={search:new legacy_CanvasServiceProvider(((e,r,t,s)=>({search:s.data.search})))},l=async(e,r,t,s,i)=>{const n=Object.values(f).map((n=>n.start(e,r,t,s,i)));await Promise.all(n)},g=()=>{Object.values(f).forEach((e=>e.stop()))},{search:h}=f,p=new(t(26).PluginServices),k=()=>p.getHooks().customElement.useService(),b=()=>p.getHooks().dataViews.useService(),w=()=>p.getHooks().embeddables.useService(),y=()=>p.getHooks().expressions.useService(),H=()=>p.getHooks().filters.useService(),m=()=>p.getHooks().labs.useService(),j=()=>p.getHooks().navLink.useService(),E=()=>p.getHooks().notify.useService(),P=()=>p.getHooks().platform.useService(),x=()=>p.getHooks().reporting.useService(),C=()=>p.getHooks().visualizations.useService(),_=()=>p.getHooks().workpad.useService()}}]);