/*! 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.observabilityOnboarding_bundle_jsonpfunction=window.observabilityOnboarding_bundle_jsonpfunction||[]).push([[2],{33:function(t,n,e){"use strict";e.r(n),e.d(n,"callObservabilityOnboardingApi",(function(){return i})),e.d(n,"createCallApi",(function(){return o}));let i=()=>{throw new Error("callObservabilityOnboardingApi has to be initialized before used. Call createCallApi first.")};function o(t){i=(n,e)=>{const{params:i}=e,{method:o,pathname:r}=function(t,n={}){const{method:e,pathname:i,version:o}=function(t){var n;const e=t.split(" "),i=e[0].trim().toLowerCase(),o=e[1].trim(),r=null===(n=e[2])||void 0===n?void 0:n.trim();if(!["get","post","put","delete"].includes(i))throw new Error(`Endpoint ${t} was not prefixed with a valid HTTP method`);if(!r&&o.startsWith("/api"))throw new Error(`Missing version for public endpoint ${t}`);return{method:i,pathname:o,version:r}}(t);return{method:e,pathname:Object.keys(n).reduce(((t,e)=>t.replace(`{${e}}`,n[e])),i),version:o}}(n,null==i?void 0:i.path);return async function({http:t},n){const{pathname:e,method:i="get",...o}=function(t){const{body:n,...e}=t;return{...e,...void 0!==n?{body:JSON.stringify(n)}:{},query:{...t.query}}}(n),r=i.toLowerCase();return await t[r](e,o)}(t,{...e,method:o,pathname:r,body:null==i?void 0:i.body,query:null==i?void 0:i.query})}}}}]);