/*! 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. */!function(e){function n(n){for(var t,i,r=n[0],o=n[1],s=0,l=[];sObject.freeze({painlessExecuteAPI:e.apis.painlessExecute,painlessExecuteAPIContexts:e.apis.painlessExecuteAPIContexts,painlessAPIReference:e.scriptedFields.painlessApi,painlessWalkthrough:e.scriptedFields.painlessWalkthrough,painlessLangSpec:e.scriptedFields.painlessLangSpec,esQueryDSL:e.query.queryDsl,modulesScriptingPreferParams:e.elasticsearch.scriptParameters}),s=e=>{const{state:n,message:t}=e.check(r.b.id,r.b.minimumLicenseType);return"valid"===n?{valid:!0}:{valid:!1,message:t}};class plugin_PainlessLabUIPlugin{setup({http:e,getStartServices:n,uiSettings:c},{devTools:l,home:u,licensing:p}){u.featureCatalogue.register({id:r.b.id,title:i.i18n.translate("xpack.painlessLab.registryProviderTitle",{defaultMessage:"Painless Lab (beta)"}),description:i.i18n.translate("xpack.painlessLab.registryProviderDescription",{defaultMessage:"Simulate and debug painless code."}),icon:"empty",path:"/app/dev_tools#/painless_lab",showOnHomePage:!1,category:"admin"});const d=l.register({id:"painless_lab",order:7,isBeta:!0,title:i.i18n.translate("xpack.painlessLab.displayName",{defaultMessage:"Painless Lab"}),enableRouting:!1,disabled:!1,mount:async({element:i,theme$:r})=>{const[l]=await n(),{i18n:{Context:u},notifications:d,docLinks:f,chrome:h,settings:b}=l,g=await Object(a.firstValueFrom)(p.license$),v=s(g);if(!v.valid)return d.toasts.addDanger(v.message),window.location.hash="/dev_tools",()=>{};const{renderApp:m}=await t.e(1).then(t.bind(null,21)),_=m(i,{I18nContext:u,http:e,uiSettings:c,links:o(f),chrome:h,theme$:r,settings:b});return()=>{_()}}});p.license$.subscribe((e=>{s(e).valid||d.isDisabled()?d.isDisabled()&&d.enable():d.disable()}))}start(){}stop(){}}function c(){return new plugin_PainlessLabUIPlugin}},function(e,n){e.exports=__kbnSharedDeps__.React},function(e,n){e.exports=__kbnSharedDeps__.EmotionReact},function(e,n){e.exports=__kbnSharedDeps__.ElasticEui},function(e,n,t){t.r(n);var a=__kbnBundles__.get("plugin/kibanaReact/public");Object.defineProperties(n,Object.getOwnPropertyDescriptors(a))},function(e,n){e.exports=__kbnSharedDeps__.KbnI18nReact},function(e,n){e.exports=__kbnSharedDeps__.ReactDom},function(e,n){e.exports=__kbnSharedDeps__.Lodash},function(e,n){e.exports=__kbnSharedDeps__.KbnMonaco}]);