/*! 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.enterpriseSearch_bundle_jsonpfunction=window.enterpriseSearch_bundle_jsonpfunction||[]).push([[2],{1012:function(e,n,t){"use strict";t.r(n),t.d(n,"renderApp",(function(){return S})),t.d(n,"renderHeaderActions",(function(){return m}));var r=t(10),i=t.n(r),s=t(21),c=t.n(s),a=t(241),o=t(32),l=t(13),u=t(18),d=t(48),p=t(1),b=t(84),h=t(38),f=t(33),g=t(36),j=t(50),v=t(11);const S=(e,{params:n,core:t,plugins:r,isSidebarEnabled:s=!0},{config:S,data:O})=>{var x,y;const{access:A,appSearch:L,configuredLimits:U,enterpriseSearchVersion:C,errorConnectingMessage:_,features:M,kibanaVersion:P,publicUrl:$,readOnlyMode:k,searchOAuth:w,workplaceSearch:I}=O,{history:T}=n,{application:V,chrome:H,http:D,uiSettings:E}=t,{capabilities:B,navigateToUrl:F}=V,{charts:K,cloud:N,guidedOnboarding:G,lens:W,security:q,share:z}=r,J=function(e){if(e&&e.isCloudEnabled&&e.cloudId&&e.deploymentId&&e.cloudHost)return`https://${e.deploymentId}.ent.${e.cloudHost}${e.cloudDefaultPort&&"443"!==e.cloudDefaultPort?`:${e.cloudDefaultPort}`:""}`}(r.cloud);b.a.enterpriseSearchUrl=$||J||S.host||"";const Q=A||{hasAppSearchAccess:!1,hasWorkplaceSearchAccess:!1},R=null!=M?M:{...p.g},X=(null==N?void 0:N.CloudContextProvider)||(({children:e})=>Object(v.jsx)(i.a.Fragment,null,e));Object(o.resetContext)({createStore:!0});const Y=Object(o.getContext)().store,Z=Object(g.b)({application:V,capabilities:B,charts:K,cloud:N,config:S,data:r.data,guidedOnboarding:G,history:T,isSidebarEnabled:s,lens:W,navigateToUrl:F,productAccess:Q,productFeatures:R,renderHeaderActions:e=>n.setHeaderActionMenu(e?m.bind(null,e,Y):void 0),security:q,setBreadcrumbs:H.setBreadcrumbs,setChromeIsVisible:H.setIsVisible,setDocTitle:H.docTitle.change,share:z,uiSettings:E}),ee=Object(j.b)({canManageLicense:null===(x=t.application.capabilities.management)||void 0===x||null===(y=x.stack)||void 0===y?void 0:y.license_management,license$:r.licensing.license$}),ne=Object(f.b)({errorConnectingMessage:_,http:D,readOnlyMode:k}),te=Object(h.h)();return c.a.render(Object(v.jsx)(l.I18nProvider,null,Object(v.jsx)(u.KibanaThemeProvider,{theme$:n.theme$},Object(v.jsx)(u.KibanaContextProvider,{services:{...t,...r}},Object(v.jsx)(X,null,Object(v.jsx)(a.Provider,{store:Y},Object(v.jsx)(d.b,{history:n.history},Object(v.jsx)(e,{access:Q,appSearch:L,configuredLimits:U,enterpriseSearchVersion:C,features:M,kibanaVersion:P,readOnlyMode:k,searchOAuth:w,workplaceSearch:I}),Object(v.jsx)(h.c,null))))))),n.element),()=>{c.a.unmountComponentAtNode(n.element),Z(),ee(),ne(),te(),r.data.search.session.clear()}},m=(e,n,t)=>(c.a.render(Object(v.jsx)(a.Provider,{store:n},Object(v.jsx)(e,null)),t),()=>c.a.unmountComponentAtNode(t))},50:function(e,n,t){"use strict";t.d(n,"a",(function(){return i})),t.d(n,"b",(function(){return s}));var r=t(32);const i=Object(r.kea)({path:["enterprise_search","licensing_logic"],actions:{setLicense:e=>e,setLicenseSubscription:e=>e},reducers:({props:e})=>({license:[null,{setLicense:(e,n)=>n}],licenseSubscription:[null,{setLicenseSubscription:(e,n)=>n}],canManageLicense:[e.canManageLicense||!1,{}]}),selectors:{hasPlatinumLicense:[e=>[e.license],e=>(null==e?void 0:e.isActive)&&["platinum","enterprise","trial"].includes(null==e?void 0:e.type)],hasGoldLicense:[e=>[e.license],e=>(null==e?void 0:e.isActive)&&["gold","platinum","enterprise","trial"].includes(null==e?void 0:e.type)],isTrial:[e=>[e.license],e=>(null==e?void 0:e.isActive)&&"trial"===(null==e?void 0:e.type)]},events:({props:e,actions:n,values:t})=>({afterMount:()=>{const t=e.license$.subscribe((async e=>{n.setLicense(e)}));n.setLicenseSubscription(t)},beforeUnmount:()=>{t.licenseSubscription&&t.licenseSubscription.unsubscribe()}})}),s=e=>(i(e),i.mount());t(41),t(10),t(12),t(2),t(4),t(39),t(11)},68:function(e,n,t){"use strict";t.d(n,"a",(function(){return r})),t.d(n,"c",(function(){return i})),t.d(n,"b",(function(){return s})),t.d(n,"d",(function(){return c}));const r={_enterpriseSearchUrl:"",get enterpriseSearchUrl(){return this._enterpriseSearchUrl},set enterpriseSearchUrl(e){this._enterpriseSearchUrl||(this._enterpriseSearchUrl=e)}},i=(e="")=>r.enterpriseSearchUrl+e,s=(e="")=>i("/as"+e),c=(e="")=>i("/ws"+e)},84:function(e,n,t){"use strict";var r=t(68);t.d(n,"a",(function(){return r.a})),t.d(n,"c",(function(){return r.c})),t.d(n,"b",(function(){return r.b})),t.d(n,"d",(function(){return r.d}))}}]);