aiware-js 2.21.0 → 2.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.esm.js +1 -1
- package/js-core.esm.js +8 -8
- package/js-core.esm18.js +2 -2
- package/js-core.esm19.js +3 -3
- package/js-core.esm2.js +1 -1
- package/js-core.esm28.js +1 -1
- package/js-core.esm30.js +2 -2
- package/js-core.esm31.js +2 -2
- package/js-core.esm32.js +1 -1
- package/js-core.esm33.js +1 -1
- package/js-core.esm34.js +1 -1
- package/js-core.esm35.js +13 -2
- package/js-core.esm36.js +1 -1
- package/js-core.esm37.js +2 -2
- package/js-core.esm38.js +2 -2
- package/js-core.esm4.js +1 -1
- package/js-core.esm41.js +1 -1
- package/js-core.esm43.js +1 -1
- package/js-core.esm44.js +1 -1
- package/js-core.esm45.js +2 -2
- package/js-core.esm46.js +5 -4
- package/js-core.esm47.js +1 -1
- package/js-core.esm48.js +14 -2
- package/js-core.esm49.js +13 -7
- package/js-core.esm5.js +2 -2
- package/js-core.esm50.js +1 -0
- package/js-core.esm7.js +3 -3
- package/js-core.umd.css +92 -92
- package/js-core.umd.js +167 -137
- package/locales/en.json +1 -1
- package/locales/es.json +1 -1
- package/locales/fr.json +1 -1
- package/package.json +4 -2
package/js-core.esm2.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{m as makeStyles,r as react,j as jsxRuntime,P as Provider,s as store,T as Typography
|
|
1
|
+
import{m as makeStyles,r as react,j as jsxRuntime,P as Provider,s as store,T as Typography,A as AIWareIntlProvider,F as FormattedMessage,S as Switch}from"./js-core.esm.js";import{A as AppBar}from"./js-core.esm3.js";function e(r,e,a,t){void 0===a&&(a=global),void 0===t&&(t={});var s=react.exports.useRef(),n=t.capture,o=t.passive,c=t.once;react.exports.useEffect(function(){s.current=e},[e]),react.exports.useEffect(function(){var e,t;if(a&&a.addEventListener)return a.addEventListener(r,e=function(e){return s.current(e)},t={capture:n,passive:o,once:c}),function(){a.removeEventListener(r,e,t)}},[r,a,n,o,c])}!function(){var e={};try{if(process)return process.env=Object.assign({},process.env),Object.assign(process.env,e)}catch(e){}globalThis.process={env:e}}(),window.global=window;var l={},a=function(r,a,e){return l[r]||(l[r]={callbacks:[],value:e}),l[r].callbacks.push(a),{deregister:function(){var e=l[r].callbacks,t=e.indexOf(a);-1<t&&e.splice(t,1)},emit:function(t){l[r].value!==t&&(l[r].value=t,l[r].callbacks.forEach(function(e){a!==e&&e(t)}))}}};function o(l,t){var d,r;return(t=void 0===t?"undefined"!=typeof global&&global.localStorage?global.localStorage:"undefined"!=typeof globalThis&&globalThis.localStorage?globalThis.localStorage:"undefined"!=typeof window&&window.localStorage?window.localStorage:"undefined"!=typeof localStorage?localStorage:null:t)?(r=t,d={get:function(e,t){e=r.getItem(e);return null==e?"function"==typeof t?t():t:JSON.parse(e)},set:function(e,t){r.setItem(e,JSON.stringify(t))}},function(t){return r=t,s=l,n=d.get,o=d.set,c=react.exports.useRef(null),t=react.exports.useState(function(){return n(s,r)}),i=t[0],u=t[1],e("storage",function(e){e.key===s&&(e=JSON.parse(e.newValue),i!==e&&u(e))}),react.exports.useEffect(function(){return c.current=a(s,u,r),function(){c.current.deregister()}},[r,s]),t=react.exports.useCallback(function(e){var t="function"==typeof e?e(i):e;o(s,t),u(t),c.current.emit(e)},[i,o,s]),[i,t];var r,s,n,o,c,i,u}):react.exports.useState}var i=function(){},u={classList:{add:i,remove:i}},d=function(e,t,r){void 0===r&&(r=global);var e=e?o(e,t):react.exports.useState,a=r.matchMedia?r.matchMedia("(prefers-color-scheme: dark)"):{},s="(prefers-color-scheme: dark)"===a.media,n=r.document&&r.document.body||u;return{usePersistedDarkModeState:e,getDefaultOnChange:function(t,r,a){return void 0===t&&(t=n),void 0===r&&(r="dark-mode"),void 0===a&&(a="light-mode"),function(e){t.classList.add(e?r:a),t.classList.remove(e?a:r)}},mediaQueryEventTarget:{addEventListener:function(e,t){return a.addListener&&a.addListener(t)},removeEventListener:function(e,t){return a.removeListener&&a.removeListener(t)}},getInitialValue:function(e){return s?a.matches:e}}};function useDarkMode(t,r){void 0===t&&(t=!1);var a=(r=void 0===r?{}:r).element,s=r.classNameDark,n=r.classNameLight,o=r.onChange,c=r.storageKey,i=(void 0===c&&(c="darkMode"),r.storageProvider),u=r.global,r=react.exports.useMemo(function(){return d(c,i,u)},[c,i,u]),l=r.getDefaultOnChange,p=r.mediaQueryEventTarget,r=(0,r.usePersistedDarkModeState)((0,r.getInitialValue)(t)),f=r[0],g=r[1],m=react.exports.useMemo(function(){return o||l(a,s,n)},[o,a,s,n,l]);return react.exports.useEffect(function(){m(f)},[m,f]),e("change",function(e){return g(e.matches)},p),{value:f,enable:react.exports.useCallback(function(){return g(!0)},[g]),disable:react.exports.useCallback(function(){return g(!1)},[g]),toggle:react.exports.useCallback(function(){return g(function(e){return!e})},[g])}}const APP_BAR="app-bar",THEME_SWITCHER="theme-switcher",SEARCH_BAR="search-bar",defaultLocale="en",useStyles=makeStyles()(e=>({appBarContainer:{display:"flex",padding:"8px",justifyContent:"space-between",alignItems:"center"},margin:{marginTop:54}})),messagesMap={},languages=["en","es","fr"],SampleAppBar=(languages.forEach(e=>{messagesMap[e]={}}),e=>{var t=useStyles()["classes"];const[r,a]=react.exports.useState(defaultLocale),[,s]=react.exports.useState({});react.exports.useEffect(()=>{e.locale&&a(e.locale)},[e.locale]),react.exports.useEffect(()=>{s(messagesMap[r])},[r]);var n=useDarkMode();return jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment,{children:[jsxRuntime.exports.jsx(Provider,Object.assign({store:e.store||store},{children:jsxRuntime.exports.jsx(AppBar,Object.assign({"data-test":APP_BAR},{children:jsxRuntime.exports.jsxs("div",Object.assign({className:t.appBarContainer},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({variant:"subtitle2"},{children:"App Name"})),jsxRuntime.exports.jsx(Typography,Object.assign({"data-test":SEARCH_BAR},{children:jsxRuntime.exports.jsx(AIWareIntlProvider,Object.assign({locale:r},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-sample-app-bar.hXq2hF",defaultMessage:"Search Bar",description:"Primary Search Bar Place Holder Text"})}))})),jsxRuntime.exports.jsxs("div",{children:["☀",jsxRuntime.exports.jsx(Switch,{"data-test":THEME_SWITCHER,onChange:n.toggle,checked:n.value}),"☾"]})]}))}))})),jsxRuntime.exports.jsx("div",{className:t.margin})]})});export{APP_BAR,SEARCH_BAR,SampleAppBar,THEME_SWITCHER};
|
package/js-core.esm28.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as useDispatch,k as useSelector,m as makeStyles,j as jsxRuntime,ea as Slide,cn as unmountPanel,c as Paper,T as Typography
|
|
1
|
+
import{i as useDispatch,k as useSelector,m as makeStyles,j as jsxRuntime,ea as Slide,cn as unmountPanel,c as Paper,T as Typography,a9 as IconButton,eb as hidePanel,aY as default_1,a7 as Divider,r as react,ec as updatePanelMicroFrontendProps,ed as setData,at as Button}from"./js-core.esm.js";import{S as Slider}from"./js-core.esm29.js";import{C as Card}from"./js-core.esm9.js";import{C as CardContent}from"./js-core.esm10.js";import{C as CardActions}from"./js-core.esm11.js";!function(){var e={};try{if(process)return process.env=Object.assign({},process.env),Object.assign(process.env,e)}catch(e){}globalThis.process={env:e}}();const Panel=({panelId:s,children:e})=>{var t;const n=useDispatch(),{microFrontend:a,panelConfig:{minWidth:i,padding:r=0,header:o,footer:l,marginTop:c=0,marginStart:d=0,show:x,width:m=500,zIndex:p=1}}=useSelector(e=>e.panels.find(e=>e.panelId===s)),j=makeStyles()(e=>({container:{position:"fixed",top:c,right:d,height:"100%",minWidth:i,width:m,zIndex:p},padding:{padding:e.spacing(r),paddingTop:e.spacing(r/2)},margin:{margin:e.spacing()},headerContainer:{display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center"},headerTitle:{margin:e.spacing()},actionButton:{margin:e.spacing()},actionContainer:{"&:last-child":{marginRight:e.spacing(2)}},footer:{}}))()["classes"],u=e=>{if(e.icon)return jsxRuntime.exports.jsx(IconButton,Object.assign({className:j.actionButton,onClick:()=>n(e.action),size:"large"},{children:e.icon}));var s=e;return jsxRuntime.exports.jsx(Button,Object.assign({className:j.actionButton,size:s.size,variant:s.variant,onClick:()=>n(e.action)},{children:s.label}))};return jsxRuntime.exports.jsx(Slide,Object.assign({in:x,direction:"left",onExited:()=>n(unmountPanel(s))},{children:jsxRuntime.exports.jsxs(Paper,Object.assign({elevation:3,id:s,"data-test":"panel-"+(s||"unknown"),className:j.container},{children:[o&&jsxRuntime.exports.jsxs("div",{children:[jsxRuntime.exports.jsxs("div",Object.assign({className:j.headerContainer},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({gutterBottom:!0,className:j.headerTitle,variant:"h4"},{children:o.title})),jsxRuntime.exports.jsxs("div",Object.assign({className:j.actionContainer},{children:[null==(t=o.actions)?void 0:t.map(e=>u(e)),jsxRuntime.exports.jsx(IconButton,Object.assign({"data-test":"close-button-"+s,className:j.actionButton,onClick:()=>n(hidePanel(s)),size:"large"},{children:jsxRuntime.exports.jsx(default_1,{})}))]}))]})),o.divider&&jsxRuntime.exports.jsx(Divider,{})]}),jsxRuntime.exports.jsx("div",Object.assign({className:j.padding},{children:e?react.exports.cloneElement(e,Object.assign(Object.assign({},a.config||{}),{dataId:s,hidePanel:()=>n(hidePanel(s))})):jsxRuntime.exports.jsx("div",{children:jsxRuntime.exports.jsx("h1",{children:"No micro frontend passed!"})})})),l&&jsxRuntime.exports.jsxs("div",Object.assign({className:j.footer},{children:[l.divider&&jsxRuntime.exports.jsx(Divider,{}),jsxRuntime.exports.jsxs("div",Object.assign({className:j.headerContainer},{children:[jsxRuntime.exports.jsx("div",{}),jsxRuntime.exports.jsx("div",Object.assign({className:j.actionContainer},{children:null==(t=l.actions)?void 0:t.map(e=>u(e))}))]}))]}))]}))}))},SamplePanel5=e=>jsxRuntime.exports.jsx("div",{children:jsxRuntime.exports.jsx("h1",{children:"Welcome to SamplePanel5!"})}),SamplePanel4=e=>jsxRuntime.exports.jsx("div",{children:jsxRuntime.exports.jsx("h1",{children:"Welcome to SamplePanel4!"})}),SamplePanel3=t=>{const n=useDispatch();return jsxRuntime.exports.jsxs("div",{children:[jsxRuntime.exports.jsx("h1",{children:"Welcome to picker!"}),jsxRuntime.exports.jsx(Typography,Object.assign({id:"discrete-slider",gutterBottom:!0},{children:"Temperature"})),jsxRuntime.exports.jsx(Slider,{"data-test":"slider",defaultValue:t.value,value:t.value,"aria-labelledby":"discrete-slider",valueLabelDisplay:"auto",step:10,marks:!0,min:0,max:110,onChange:(e,s)=>{n(updatePanelMicroFrontendProps({id:t.dataId,props:Object.assign(Object.assign({},t),{value:s})}))},onChangeCommitted:(e,s)=>{n(updatePanelMicroFrontendProps({id:t.dataId,props:Object.assign(Object.assign({},t),{value:s})})),n(setData({id:t.dataId,data:s}))}})]})},SamplePanel2=e=>jsxRuntime.exports.jsx("div",{children:jsxRuntime.exports.jsx("h1",{children:"Welcome to SamplePanel2!"})}),useStyles=makeStyles()(e=>({container:{},root:{minWidth:50},bullet:{display:"inline-block",margin:"0 2px",transform:"scale(0.8)"},title:{fontSize:14},pos:{marginBottom:12}})),SamplePanel1=e=>{var s=useStyles()["classes"],t=jsxRuntime.exports.jsx("span",Object.assign({className:s.bullet},{children:"•"}));return jsxRuntime.exports.jsxs("div",Object.assign({className:s.container},{children:[jsxRuntime.exports.jsxs("h1",{children:["Welcome to SamplePanel1 ",e.name||"Unknown Person","!"]}),jsxRuntime.exports.jsxs(Card,Object.assign({className:s.root},{children:[jsxRuntime.exports.jsxs(CardContent,{children:[jsxRuntime.exports.jsx(Typography,Object.assign({className:s.title,color:"textSecondary",gutterBottom:!0},{children:"Word of the Day"})),jsxRuntime.exports.jsxs(Typography,Object.assign({variant:"h5",component:"h2"},{children:["be",t,"nev",t,"o",t,"lent"]})),jsxRuntime.exports.jsx(Typography,Object.assign({className:s.pos,color:"textSecondary"},{children:"adjective"})),jsxRuntime.exports.jsxs(Typography,Object.assign({variant:"body2",component:"p"},{children:["well meaning and kindly.",jsxRuntime.exports.jsx("br",{}),'"a benevolent smile"']}))]}),jsxRuntime.exports.jsx(CardActions,{children:jsxRuntime.exports.jsx(Button,Object.assign({size:"small"},{children:"Learn More"}))})]}))]}))};export{Panel,SamplePanel1,SamplePanel2,SamplePanel3,SamplePanel4,SamplePanel5};
|
package/js-core.esm30.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{m as makeStyles,el as keyframes,d0 as createTheme,em as TabId,j as jsxRuntime,F as FormattedMessage,en as PersonalProfile,eo as Organizations,cq as mountPanel,ep as DataCenter,eq as
|
|
1
|
+
import{m as makeStyles,el as keyframes,d0 as createTheme,em as TabId,j as jsxRuntime,F as FormattedMessage,en as PersonalProfile,eo as Organizations,cq as mountPanel,ep as DataCenter,eq as Process,er as FlowCenter2,es as DeveloperCenter,et as Marketplace,eu as LibraryCenter,ev as AdminCenter,i as useDispatch,r as react,k as useSelector,c as Paper,T as Typography,a9 as IconButton,at as Button,eb as hidePanel,ew as img$P,a$ as img$Q,a7 as Divider,cf as AIWareThemeProvider,A as AIWareIntlProvider,K as lib,ea as Slide,cn as unmountPanel,B as Box,a8 as Tooltip,ex as img$1,bQ as StyledEngineProvider,bR as ThemeProvider,ey as img$w,ez as userSelector,x as classNames,d4 as takeEvery$1,eA as enableBetaFeatures,eB as Badge,ai as select,ah as put,eC as openLinkOnNewTab}from"./js-core.esm.js";import{organizationSelectors as organizations_selector,selectApiConfigs,isAdminUser,organizationInviteApi as organizationInvites_api}from"./js-core.esm31.js";import{L as LinearProgress}from"./js-core.esm32.js";import"./js-core.esm6.js";import"./js-core.esm9.js";import"./js-core.esm10.js";import"./js-core.esm33.js";import"./js-core.esm11.js";import"./js-core.esm26.js";function __awaiter(e,o,r,l){return new(r=r||Promise)(function(n,t){function a(e){try{i(l.next(e))}catch(e){t(e)}}function s(e){try{i(l.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?n(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(a,s)}i((l=l.apply(e,o||[])).next())})}!function(){var e={};try{if(process)return process.env=Object.assign({},process.env),Object.assign(process.env,e)}catch(e){}globalThis.process={env:e}}();const useStyles$2=makeStyles()(()=>({iconButton:{padding:0,width:38,height:38,borderRadius:"50%","& svg":{fontSize:26},"&:hover":{background:"rgba(228, 240, 252, 0.4)"}},selected:{background:"rgba(228, 240, 252, 0.8)",color:"#0C53B0","& svg, & path":{fill:"#0C53B0"},"&:hover":{background:"rgba(228, 240, 252, 0.8)"}},tabIcon:{display:"flex",justifyContent:"center",alignItems:"center"},img:{maxWidth:30,maxHeight:30}}));function TabIcon({id:e,selected:t=!1,icon:n,onTabIconClick:a,iconComponent:s}){var i=useStyles$2()["classes"];const[o,r]=react.exports.useState(0),[l,c]=react.exports.useState(0),[d,p]=react.exports.useState(!1),m=makeStyles()(()=>({viewRequestsBadge:{"& .Sdk-MuiBadge-badge":{fontFamily:"Nunito",backgroundColor:"#D43060",color:"#fff",zIndex:"unset"}}})),x=m()["classes"],u=useSelector(userSelector);var g=useSelector(organizations_selector.selectOrganizationInvites)||[],j=useSelector(organizations_selector.selectPendingOrgInvites)||[];const b=useSelector(selectApiConfigs),f=()=>__awaiter(this,void 0,void 0,function*(){var e;u&&(isAdminUser(u.roles)&&(e=null==(e=null===u||void 0===u?void 0:u.organization)?void 0:e.organizationId,e=yield organizationInvites_api.fetchPendingOrganizationInvites(e,b),r(e.length)),e=yield organizationInvites_api.fetchOrganizationInvites(b),c(e.length))});"ORGANIZATION_PANEL"!==e||d||(p(!0),__awaiter(this,void 0,void 0,function*(){try{yield f()}catch(e){console.log(e)}})),react.exports.useEffect(()=>{"ORGANIZATION_PANEL"===e&&f()},[g,j]);return jsxRuntime.exports.jsx("div",Object.assign({className:i.tabIcon},{children:jsxRuntime.exports.jsx(IconButton,Object.assign({disableRipple:!0,className:classNames(i.iconButton,{[i.selected]:t}),onClick:function(){a(e)},"data-test-id":"dt-button-tab-icon-"+e,"data-test":"dt-button-tab-icon",size:"large"},{children:s?(g=s,o+l?jsxRuntime.exports.jsx(Badge,Object.assign({badgeContent:o+l,className:x.viewRequestsBadge},{children:g})):g):jsxRuntime.exports.jsx("img",{className:i.img,src:n,draggable:"false",alt:""})}))}))}const useStyles$1=makeStyles()(e=>({tabsContainer:{width:"100%",textAlign:"center",flex:1},menuTabIcon:{paddingBottom:e.spacing(1.6)},flowIcon:{width:50,height:50,color:e.palette.secondary.main}}));function Tabs({selectedId:e,onChangeTab:t,tabsList:n=[],roles:o}){const r=useStyles$1()["classes"],[l,a]=react.exports.useState(e),{adminShortcut:c=!0,betaFeatures:d}=useSelector(e=>e.configs.initConfig),p=window.location.hostname.split(".")[0];function m(e){a(e),t(e)}return react.exports.useEffect(()=>{e!==l&&a(e)},[e,l]),jsxRuntime.exports.jsx(Box,Object.assign({className:r.tabsContainer},{children:n.map((e,t)=>{var{id:e,icon:n,role:a,label:s,iconComponent:i}=e,s=jsxRuntime.exports.jsx(Tooltip,Object.assign({title:s,placement:"left"},{children:jsxRuntime.exports.jsx(Box,Object.assign({className:r.menuTabIcon},{children:jsxRuntime.exports.jsx(TabIcon,{selected:e===l,icon:n,iconComponent:i,onTabIconClick:m,id:e,"data-test":"TabIcon-data-test"+e})}),e)}),e);if(a&&o.includes(a)||!a){if(t<2)return s;if(e===TabId.DATA_CENTER)return s;if(e===TabId.PROCESSING_CENTER_BROWSE&&d)return s;if(e===TabId.FLOW_CENTER)return p.toLocaleLowerCase().includes("automate")?null:s;if(e===TabId.ADMIN_SHORTCUT&&c)return s;if(e===TabId.SETTING_PREFERENCE_PANEL&&d)return p.toLocaleLowerCase().includes("admin")?null:s;if([TabId.MARKETPLACE_CENTER,TabId.LIBRARY_CENTER,TabId.ENGINE_CENTER].includes(e))return d?s:null}return null})}))}function*openAppUrlByShortcut(e){var{cmsAppUrl:t,adminAppUrl:n}=yield select(e=>e.configs.config);switch(e.payload){case"cms":yield put(openLinkOnNewTab({url:t}));break;case"admin":yield put(openLinkOnNewTab({url:n}))}}function*getPanelSaga(){yield takeEvery$1("panels/OPEN_APP_SHORTCUT",openAppUrlByShortcut)}function getPanelModule(){return{id:"os-panel",reducerMap:{panel:{}},sagas:[getPanelSaga],initialActions:[]}}let _=e=>e,_t;const fadeInOut=keyframes(_t=_t||_`
|
|
2
2
|
0% {
|
|
3
3
|
opacity: 0;
|
|
4
4
|
}
|
|
@@ -11,4 +11,4 @@ import{m as makeStyles,el as keyframes,d0 as createTheme,em as TabId,j as jsxRun
|
|
|
11
11
|
100% {
|
|
12
12
|
opacity: 0;
|
|
13
13
|
}
|
|
14
|
-
`),useStyles=makeStyles()(()=>({fullScreen:{position:"fixed",width:"100%",height:"100vh",top:"0",left:"0",backgroundColor:"#ffffff",display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column",textAlign:"center",fontSize:"14px",zIndex:99999,animation:fadeInOut+" 5s linear forwards"},loaderBox:{height:"200px",width:"200px"},veritoneDarkLogo:{height:"200px",width:"200px"}}));let lottieScript,audio;const theme=createTheme({palette:{secondary:{main:"#1871E8"}}}),Logo=()=>{const n=useDispatch();var e=useStyles()["classes"];const[a,s]=react.exports.useState(0),[t,i]=react.exports.useState(!1),[o,r]=react.exports.useState(!1),l=jsxRuntime.exports.jsx("p",Object.assign({style:{pointerEvents:"none"}},{children:"Loading Beta Features"})),[c,d]=react.exports.useState(l),p=useSelector(organizations_selector.selectOrgSwitchInitiated),m=useSelector(e=>{return null==(e=null==(e=null==e?void 0:e.configs)?void 0:e.initConfig)?void 0:e.betaFeatures}),[x,u]=react.exports.useState(!1);return react.exports.useEffect(()=>{x||(u(!0),(lottieScript=document.createElement("script")).setAttribute("src","https://cdnjs.cloudflare.com/ajax/libs/bodymovin/5.7.8/lottie.min.js"),lottieScript.onload=()=>r(!0),(audio=document.createElement("audio")).id="player",audio.src="https://static.veritone.com/aiware-js-animation/sound-effects/chime.wav",document.head.appendChild(lottieScript),document.body.appendChild(audio))},[]),react.exports.useEffect(()=>{if(m&&!p)return;p&&d(jsxRuntime.exports.jsx("p",{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-organization-panel.organizations-switching-loader-message",defaultMessage:"Changing your Organization",description:"organizations switching loader message"})}));const e=10===a;if((e||p)&&(i(!0),o)){const t=window.bodymovin.loadAnimation({container:document.getElementById("loaderAnimation"),path:"https://static.veritone.com/aiware-js-animation/particle-explosion.json",renderer:"svg",loop:!1,autoplay:!0,name:"unicorn"});t.onComplete=()=>{e?(n(enableBetaFeatures()),s(0)):p&&d(l),i(!1),t.destroy()},null!==audio&&void 0!==audio&&audio.play()}},[a,m,n,t,p]),jsxRuntime.exports.jsxs(react.exports.Fragment,{children:[t&&jsxRuntime.exports.jsxs("div",Object.assign({className:e.fullScreen},{children:[jsxRuntime.exports.jsx("div",Object.assign({className:e.loaderBox,id:"loaderAnimation"},{children:!o&&jsxRuntime.exports.jsx("img",{src:img$1,alt:"veritone-logo",className:e.veritoneDarkLogo})})),jsxRuntime.exports.jsxs("div",Object.assign({className:e.loaderBox},{children:[jsxRuntime.exports.jsx(StyledEngineProvider,Object.assign({injectFirst:!0},{children:jsxRuntime.exports.jsx(ThemeProvider,Object.assign({theme:theme},{children:jsxRuntime.exports.jsx(LinearProgress,{color:"secondary"})}))})),c]}))]})),jsxRuntime.exports.jsx("img",{onClick:()=>s(a+1),src:img$w,alt:"footer-icon",draggable:"false"})]})};function getTabAction(e,t,n,a="APP_BAR_PANEL"){return{type:mountPanel({}).type,payload:{panelId:e,microFrontend:{name:a,config:{name:"Veritone",tabId:e,dataId:"dataId",type:"APP_BAR_PANEL_TEMPLATE"}},panelConfig:{type:"APP_BAR_PANEL_TEMPLATE",marginTop:55,marginStart:80,fullScreen:!1,width:n,header:{divider:!0,title:t}}}}}const tabsListDefault=[{id:TabId.PERSONAL_PANEL,label:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-panel.tabItems.personalProfile",defaultMessage:"Personal Profile",description:"Tooltip pops on the sidebar for personal profile"}),iconComponent:jsxRuntime.exports.jsx(PersonalProfile,{}),role:"",action:getTabAction(TabId.PERSONAL_PANEL,jsxRuntime.exports.jsx(FormattedMessage,{id:"os-panel.panelTitle.personalProfile",defaultMessage:"Personal Profile",description:"Header title for personal profile"}),410)},{id:TabId.ORGANIZATION_PANEL,label:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-panel.tabItems.organizations",defaultMessage:"Organizations",description:"Tooltip pops on the sidebar for organizations"}),iconComponent:jsxRuntime.exports.jsx(Organizations,{}),role:"",action:{type:mountPanel({}).type,payload:{panelId:TabId.ORGANIZATION_PANEL,microFrontend:{name:"ORGANIZATION_PANEL"},panelConfig:{type:"APP_BAR_PANEL_TEMPLATE",marginTop:55,marginStart:80,width:560,zIndex:1e3}}}},{id:TabId.CMS_SHORTCUT,label:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-panel.tabItems.dataCenter",defaultMessage:"Data Center",description:"Tooltip pops on the sidebar for data center"}),iconComponent:jsxRuntime.exports.jsx(DataCenter,{}),role:"cms",action:{type:"panels/OPEN_APP_SHORTCUT",payload:"cms"}},{id:TabId.DATA_CENTER,label:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-panel.tabItems.dataCenter",defaultMessage:"Data Center",description:"Tooltip pops on the sidebar for data center"}),iconComponent:jsxRuntime.exports.jsx(DataCenter,{}),role:"cms",action:{type:mountPanel({}).type,payload:{panelId:TabId.DATA_CENTER,microFrontend:{name:"DATA_CENTER_BROWSE"},panelConfig:{type:"APP_BAR_PANEL_TEMPLATE",marginTop:55,marginStart:80,size:"xlarge",zIndex:1e3}}}},{id:TabId.FLOW_CENTER,label:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-panel.tabItems.flowCenter",defaultMessage:"Flow Center",description:"Tooltip pops on the sidebar for flow center"}),iconComponent:jsxRuntime.exports.jsx(FlowCenter2,{}),role:"automate",action:{type:mountPanel({}).type,payload:{panelId:TabId.FLOW_CENTER,microFrontend:{name:"FLOW_CENTER",config:{name:"Veritone",tabId:TabId.FLOW_CENTER,dataId:"dataId",type:"APP_BAR_PANEL_TEMPLATE",zIndex:1200}},panelConfig:{type:"APP_BAR_PANEL_TEMPLATE",marginTop:55,marginStart:80,size:"xxlarge"}}}},{id:TabId.ENGINE_CENTER,label:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-panel.tabItems.developerCenter",defaultMessage:"Developer Center",description:"Tooltip pops on the sidebar for developer center"}),iconComponent:jsxRuntime.exports.jsx(DeveloperCenter,{}),role:"cms",action:{type:"panels/OPEN_APP_SHORTCUT",payload:"developer"}},{id:TabId.MARKETPLACE_CENTER,label:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-panel.tabItems.marketplaceCenter",defaultMessage:"Marketplace",description:"Tooltip pops on the sidebar for marketplace center"}),iconComponent:jsxRuntime.exports.jsx(Marketplace,{}),role:"cms",action:{type:"panels/OPEN_APP_SHORTCUT",payload:"marketplace"}},{id:TabId.LIBRARY_CENTER,label:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-panel.tabItems.libraryCenter",defaultMessage:"Library Center",description:"Tooltip pops on the sidebar for library center"}),iconComponent:jsxRuntime.exports.jsx(LibraryCenter,{}),role:"",action:{type:"panels/OPEN_APP_SHORTCUT",payload:"libray"}},{id:TabId.ADMIN_SHORTCUT,label:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-panel.tabItems.adminCenter",defaultMessage:"Admin Center",description:"Tooltip pops on the sidebar for admin center"}),iconComponent:jsxRuntime.exports.jsx(AdminCenter,{}),role:"admin",action:{type:mountPanel({}).type,payload:{panelId:TabId.ADMIN_SHORTCUT,microFrontend:{name:"ADMIN_CENTER_BROWSE"},panelConfig:{type:"APP_BAR_PANEL_TEMPLATE",marginTop:55,marginStart:80,size:"xlarge",zIndex:1e3}}}}];function AppbarTabPanel({panelId:t,children:e,withTab:n=!0,withChild:a=!0}){const s=useDispatch(),[i,o]=react.exports.useState(),[r,l]=react.exports.useState([]),[c,d]=react.exports.useState(!1);var p=useSelector(e=>e.panels.find(e=>e.panelId===t))||{};const m=useSelector(e=>e.panels);const{microFrontend:x,panelConfig:{minWidth:u,padding:g=0,header:j,footer:b,marginTop:f=0,marginStart:h=0,show:T,tabs:R=[],zIndex:I=1e3,userRoles:C=[],panelId:v,size:y,fullScreen:A,width:P,dimmed:E=0,parentPanelId:N,borderBottom:S}}=p;const O=N?("ORGANIZATION_PANEL"!==N?"":"solid 5px #4D81B7")||("DATA_CENTER"!==N?"":"solid 5px #4D81B7"):"solid 5px #4D81B7",_=makeStyles()(e=>({container:{position:"fixed",top:f,right:A?0:h,height:`calc(100vh - ${f}px)`,minWidth:u,width:P||(A?"100%":function(){switch(y){case"xxlarge":return 1280;case"xlarge":return 1020;case"large":return 720;case"medium":return 560;case"small":return 380;default:return 560}}()),borderBottom:S?"solid 5px #4D81B7":O,zIndex:A?1500:I,transitionTimingFunction:"ease-in-out !important"},padding:{padding:e.spacing(g),paddingTop:e.spacing(g/2)},margin:{margin:e.spacing()},headerContainer:{display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center"},headerTitle:{margin:e.spacing(),marginTop:e.spacing(2)},actionButton:{margin:e.spacing()},footer:{},actionContainer:{"&:last-child":{marginRight:e.spacing(2)}},content:{overflow:"overlay",overflowX:"hidden",height:function(){var e=j?64:0,t=b?64:0;return`calc(100vh - ${f}px - ${e}px - ${t}px - 5px)`}()},paperContainer:{top:56,backgroundColor:"unset !important",boxShadow:"none"},tabContainer:{overflow:"hidden",width:"100%"},tabSelect:{paddingTop:e.spacing(6),width:80,display:"flex",flexDirection:"column"},drawerContainer:{display:"flex",background:e.palette.background.default},tabName:{display:"flex",justifyContent:"space-between",alignItems:"center",height:"61px",padding:e.spacing(0,4,0,6)},actionIcons:{margin:e.spacing(-2.4)},title:{userSelect:"none",fontStyle:"normal",fontSize:"18px",lineHeight:e.spacing(5),letterSpacing:"0.25px",textTransform:"uppercase",color:e.palette.text.secondary},tabContent:{borderRight:n?"0.5px solid "+e.palette.divider:"none",overflowY:"auto",overflowX:"hidden",width:"100%"},buttonAction:{textTransform:"unset"},aiWareIcon:{padding:e.spacing(2.4,0),display:"flex",justifyContent:"center",position:"fixed",bottom:"0",right:"10px"},noShadow:{boxShadow:"none",borderLeft:"0.5px solid "+e.palette.divider},panelMask:{position:"absolute",zIndex:1150,width:"100%",height:"100%",backgroundColor:e.palette.grey[50],opacity:.5}}))()["classes"];react.exports.useEffect(()=>{0<R.length?l([...tabsListDefault,...R]):l(tabsListDefault)},[R]),react.exports.useEffect(()=>{x.config&&x.config.tabId&&o(x.config.tabId)},[x]),react.exports.useEffect(()=>{0<m.length&&i&&n&&(m.find(e=>e.panelId===i)||o(void 0))},[m,i,n]);a=jsxRuntime.exports.jsxs(Paper,Object.assign({className:`${_.container} ${a?"":_.noShadow} `,elevation:3,id:t,square:!0,"data-test":"panel-"+(v||"unknown")},{children:[0<E&&jsxRuntime.exports.jsx("div",{className:_.panelMask}),jsxRuntime.exports.jsxs("div",Object.assign({className:_.drawerContainer},{children:[a&&jsxRuntime.exports.jsxs("div",Object.assign({className:_.tabContent},{children:[j&&jsxRuntime.exports.jsxs("div",{children:[jsxRuntime.exports.jsxs("div",Object.assign({className:_.tabName},{children:[jsxRuntime.exports.jsx(Typography$1,Object.assign({variant:"h1",className:_.title},{children:j.title||(null==(p=r.find(e=>e.id===i))?void 0:p.label)})),jsxRuntime.exports.jsxs("div",Object.assign({className:_.actionIcons},{children:[null==(a=j.actions)?void 0:a.map((e,t)=>e.label?jsxRuntime.exports.jsx(Button$1,Object.assign({size:e.size,variant:e.variant,onClick:()=>s(e.action)},{children:e.label}),e.action.type):jsxRuntime.exports.jsxs(IconButton,Object.assign({onClick:()=>s(e.action),size:"large"},{children:[e.iconUrl&&jsxRuntime.exports.jsx("img",{src:e.iconUrl,alt:"icon",draggable:"false"}),e.icon&&jsxRuntime.exports.jsx("div",{children:e.icon})]}),e.action.type)),jsxRuntime.exports.jsx(IconButton,Object.assign({onClick:()=>s(hidePanel(t)),"data-test":"close-button-"+t,size:"large"},{children:jsxRuntime.exports.jsx("img",{src:N?img$P:img$Q,alt:"icon",draggable:"false"})}))]}))]})),j.divider&&jsxRuntime.exports.jsx(Divider,{})]}),jsxRuntime.exports.jsx("div",Object.assign({className:_.content},{children:e?react.exports.cloneElement(e,Object.assign(Object.assign({},x.config||{}),{dataId:t,hidePanel:()=>s(hidePanel(t)),tabId:i,panelRendered:c})):jsxRuntime.exports.jsx("div",{children:jsxRuntime.exports.jsx("h1",{children:"No micro frontend passed!"})})})),b&&jsxRuntime.exports.jsxs("div",Object.assign({className:_.footer},{children:[b.divider&&jsxRuntime.exports.jsx(Divider,{}),jsxRuntime.exports.jsx("div",Object.assign({className:_.headerContainer},{children:jsxRuntime.exports.jsx("div",Object.assign({className:_.actionContainer},{children:null==(p=b.actions)?void 0:p.map(e=>{var t;if(e.iconUrl)return jsxRuntime.exports.jsxs(IconButton,Object.assign({className:_.actionButton,onClick:(t=e.action,()=>{s(t)}),size:"large"},{children:[e.iconUrl&&jsxRuntime.exports.jsx("img",{src:e.iconUrl,alt:"icon",draggable:"false"}),e.icon&&jsxRuntime.exports.jsx("div",{children:e.icon})]}),e.action.type);const n=e;return jsxRuntime.exports.jsx(Button$1,Object.assign({className:_.actionButton,size:n.size,variant:n.variant,onClick:()=>s(n.action)},{children:n.label}),e.action.type)})}))}))]}))]})),n&&jsxRuntime.exports.jsxs("div",Object.assign({id:"tabs-content",className:_.tabSelect},{children:[jsxRuntime.exports.jsx(Tabs,{selectedId:i,tabsList:r,onChangeTab:function(t){i&&s(hidePanel(i)),o(t);var e,n=r.find(e=>e.id===t);null!=(e=null==n?void 0:n.onClick)&&e.call(n,t),null!=n&&n.action&&s(n.action)},roles:C}),(null===b||void 0===b?void 0:b.logo)&&jsxRuntime.exports.jsx("div",Object.assign({className:_.aiWareIcon},{children:jsxRuntime.exports.jsx(Logo,{})}))]}))]}))]}));return jsxRuntime.exports.jsx(AIWareThemeProvider,{children:jsxRuntime.exports.jsx(AIWareIntlProvider,{children:jsxRuntime.exports.jsx(lib.DynamicModuleLoader,Object.assign({modules:[getPanelModule()]},{children:jsxRuntime.exports.jsx(Slide,Object.assign({"data-id":"123456",in:T,direction:"left",onEntered:()=>d(!0),onExited:()=>s(unmountPanel(t))},{children:a}))}))})})}const AppbarPanel=e=>jsxRuntime.exports.jsx(AppbarTabPanel,Object.assign({},e,{withChild:!0,withTab:!1})),Tab=e=>jsxRuntime.exports.jsx(AppbarTabPanel,Object.assign({},e,{withChild:!1,withTab:!0}));export{AppbarPanel,AppbarTabPanel,Tab as TabPanel};
|
|
14
|
+
`),useStyles=makeStyles()(()=>({fullScreen:{position:"fixed",width:"100%",height:"100vh",top:"0",left:"0",backgroundColor:"#ffffff",display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column",textAlign:"center",fontSize:"14px",zIndex:99999,animation:fadeInOut+" 5s linear forwards"},loaderBox:{height:"200px",width:"200px"},veritoneDarkLogo:{height:"200px",width:"200px"}}));let lottieScript,audio;const theme=createTheme({palette:{secondary:{main:"#1871E8"}}}),Logo=()=>{const n=useDispatch();var e=useStyles()["classes"];const[a,s]=react.exports.useState(0),[t,i]=react.exports.useState(!1),[o,r]=react.exports.useState(!1),l=jsxRuntime.exports.jsx("p",Object.assign({style:{pointerEvents:"none"}},{children:"Loading Beta Features"})),[c,d]=react.exports.useState(l),p=useSelector(organizations_selector.selectOrgSwitchInitiated),m=useSelector(e=>{return null==(e=null==(e=null==e?void 0:e.configs)?void 0:e.initConfig)?void 0:e.betaFeatures}),[x,u]=react.exports.useState(!1);return react.exports.useEffect(()=>{x||(u(!0),(lottieScript=document.createElement("script")).setAttribute("src","https://cdnjs.cloudflare.com/ajax/libs/bodymovin/5.7.8/lottie.min.js"),lottieScript.onload=()=>r(!0),(audio=document.createElement("audio")).id="player",audio.src="https://static.veritone.com/aiware-js-animation/sound-effects/chime.wav",document.head.appendChild(lottieScript),document.body.appendChild(audio))},[]),react.exports.useEffect(()=>{if(m&&!p)return;p&&d(jsxRuntime.exports.jsx("p",{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-organization-panel.organizations-switching-loader-message",defaultMessage:"Changing your Organization",description:"organizations switching loader message"})}));const e=10===a;if((e||p)&&(i(!0),o)){const t=window.bodymovin.loadAnimation({container:document.getElementById("loaderAnimation"),path:"https://static.veritone.com/aiware-js-animation/particle-explosion.json",renderer:"svg",loop:!1,autoplay:!0,name:"unicorn"});t.onComplete=()=>{e?(n(enableBetaFeatures()),s(0)):p&&d(l),i(!1),t.destroy()},null!==audio&&void 0!==audio&&audio.play()}},[a,m,n,t,p]),jsxRuntime.exports.jsxs(react.exports.Fragment,{children:[t&&jsxRuntime.exports.jsxs("div",Object.assign({className:e.fullScreen},{children:[jsxRuntime.exports.jsx("div",Object.assign({className:e.loaderBox,id:"loaderAnimation"},{children:!o&&jsxRuntime.exports.jsx("img",{src:img$1,alt:"veritone-logo",className:e.veritoneDarkLogo})})),jsxRuntime.exports.jsxs("div",Object.assign({className:e.loaderBox},{children:[jsxRuntime.exports.jsx(StyledEngineProvider,Object.assign({injectFirst:!0},{children:jsxRuntime.exports.jsx(ThemeProvider,Object.assign({theme:theme},{children:jsxRuntime.exports.jsx(LinearProgress,{color:"secondary"})}))})),c]}))]})),jsxRuntime.exports.jsx("img",{onClick:()=>s(a+1),src:img$w,alt:"footer-icon",draggable:"false"})]})};function getTabAction(e,t,n,a="APP_BAR_PANEL"){return{type:mountPanel({}).type,payload:{panelId:e,microFrontend:{name:a,config:{name:"Veritone",tabId:e,dataId:"dataId",type:"APP_BAR_PANEL_TEMPLATE"}},panelConfig:{type:"APP_BAR_PANEL_TEMPLATE",marginTop:55,marginStart:80,fullScreen:!1,width:n,header:{divider:!0,title:t}}}}}const tabsListDefault=[{id:TabId.PERSONAL_PANEL,label:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-panel.tabItems.personalProfile",defaultMessage:"Personal Profile",description:"Tooltip pops on the sidebar for personal profile"}),iconComponent:jsxRuntime.exports.jsx(PersonalProfile,{}),role:"",action:getTabAction(TabId.PERSONAL_PANEL,jsxRuntime.exports.jsx(FormattedMessage,{id:"os-panel.panelTitle.personalProfile",defaultMessage:"Personal Profile",description:"Header title for personal profile"}),410)},{id:TabId.ORGANIZATION_PANEL,label:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-panel.tabItems.organizations",defaultMessage:"Organizations",description:"Tooltip pops on the sidebar for organizations"}),iconComponent:jsxRuntime.exports.jsx(Organizations,{}),role:"",action:{type:mountPanel({}).type,payload:{panelId:TabId.ORGANIZATION_PANEL,microFrontend:{name:"ORGANIZATION_PANEL"},panelConfig:{type:"APP_BAR_PANEL_TEMPLATE",marginTop:55,marginStart:80,width:560,zIndex:1e3}}}},{id:TabId.CMS_SHORTCUT,label:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-panel.tabItems.dataCenter",defaultMessage:"Data Center",description:"Tooltip pops on the sidebar for data center"}),iconComponent:jsxRuntime.exports.jsx(DataCenter,{}),role:"cms",action:{type:"panels/OPEN_APP_SHORTCUT",payload:"cms"}},{id:TabId.DATA_CENTER,label:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-panel.tabItems.dataCenter",defaultMessage:"Data Center",description:"Tooltip pops on the sidebar for data center"}),iconComponent:jsxRuntime.exports.jsx(DataCenter,{}),role:"cms",action:{type:mountPanel({}).type,payload:{panelId:TabId.DATA_CENTER,microFrontend:{name:"DATA_CENTER_BROWSE"},panelConfig:{type:"APP_BAR_PANEL_TEMPLATE",marginTop:55,marginStart:80,size:"xlarge",zIndex:1e3}}}},{id:TabId.PROCESSING_CENTER_BROWSE,label:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-panel.tabItems.processingCenter",defaultMessage:"Processing Center",description:"Tooltip pops on the sidebar for processing center"}),iconComponent:jsxRuntime.exports.jsx(Process,{}),role:"cms",action:{type:mountPanel({}).type,payload:{panelId:TabId.PROCESSING_CENTER_BROWSE,microFrontend:{name:"PROCESSING_CENTER_BROWSE"},panelConfig:{type:"APP_BAR_PANEL_TEMPLATE",marginTop:55,marginStart:80,size:"xlarge",zIndex:1e3}}}},{id:TabId.FLOW_CENTER,label:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-panel.tabItems.flowCenter",defaultMessage:"Flow Center",description:"Tooltip pops on the sidebar for flow center"}),iconComponent:jsxRuntime.exports.jsx(FlowCenter2,{}),role:"automate",action:{type:mountPanel({}).type,payload:{panelId:TabId.FLOW_CENTER,microFrontend:{name:"FLOW_CENTER",config:{name:"Veritone",tabId:TabId.FLOW_CENTER,dataId:"dataId",type:"APP_BAR_PANEL_TEMPLATE",zIndex:1200}},panelConfig:{type:"APP_BAR_PANEL_TEMPLATE",marginTop:55,marginStart:80,size:"xxlarge"}}}},{id:TabId.ENGINE_CENTER,label:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-panel.tabItems.developerCenter",defaultMessage:"Developer Center",description:"Tooltip pops on the sidebar for developer center"}),iconComponent:jsxRuntime.exports.jsx(DeveloperCenter,{}),role:"cms",action:{type:"panels/OPEN_APP_SHORTCUT",payload:"developer"}},{id:TabId.MARKETPLACE_CENTER,label:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-panel.tabItems.marketplaceCenter",defaultMessage:"Marketplace",description:"Tooltip pops on the sidebar for marketplace center"}),iconComponent:jsxRuntime.exports.jsx(Marketplace,{}),role:"cms",action:{type:"panels/OPEN_APP_SHORTCUT",payload:"marketplace"}},{id:TabId.LIBRARY_CENTER,label:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-panel.tabItems.libraryCenter",defaultMessage:"Library Center",description:"Tooltip pops on the sidebar for library center"}),iconComponent:jsxRuntime.exports.jsx(LibraryCenter,{}),role:"",action:{type:"panels/OPEN_APP_SHORTCUT",payload:"libray"}},{id:TabId.ADMIN_SHORTCUT,label:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-panel.tabItems.adminCenter",defaultMessage:"Admin Center",description:"Tooltip pops on the sidebar for admin center"}),iconComponent:jsxRuntime.exports.jsx(AdminCenter,{}),role:"admin",action:{type:mountPanel({}).type,payload:{panelId:TabId.ADMIN_SHORTCUT,microFrontend:{name:"ADMIN_CENTER_BROWSE"},panelConfig:{type:"APP_BAR_PANEL_TEMPLATE",marginTop:55,marginStart:80,size:"xlarge",zIndex:1e3}}}}];function AppbarTabPanel({panelId:t,children:e,withTab:n=!0,withChild:a=!0}){const s=useDispatch(),[i,o]=react.exports.useState(),[r,l]=react.exports.useState([]),[c,d]=react.exports.useState(!1);var p=useSelector(e=>e.panels.find(e=>e.panelId===t))||{};const m=useSelector(e=>e.panels);const{microFrontend:x,panelConfig:{minWidth:u,padding:g=0,header:j,footer:b,marginTop:f=0,marginStart:h=0,show:T,tabs:R=[],zIndex:I=1e3,userRoles:C=[],panelId:E,size:P,fullScreen:v,width:y,dimmed:A=0,parentPanelId:N,borderBottom:S}}=p;const _=N?("ORGANIZATION_PANEL"!==N?"":"solid 5px #4D81B7")||("DATA_CENTER"!==N?"":"solid 5px #4D81B7"):"solid 5px #4D81B7",O=makeStyles()(e=>({container:{position:"fixed",top:f,right:v?0:h,height:`calc(100vh - ${f}px)`,minWidth:u,width:y||(v?"100%":function(){switch(P){case"xxlarge":return 1280;case"xlarge":return 1020;case"large":return 720;case"medium":return 560;case"small":return 380;default:return 560}}()),borderBottom:S?"solid 5px #4D81B7":_,zIndex:v?1500:I,transitionTimingFunction:"ease-in-out !important"},padding:{padding:e.spacing(g),paddingTop:e.spacing(g/2)},margin:{margin:e.spacing()},headerContainer:{display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center"},headerTitle:{margin:e.spacing(),marginTop:e.spacing(2)},actionButton:{margin:e.spacing()},footer:{},actionContainer:{"&:last-child":{marginRight:e.spacing(2)}},content:{overflow:"overlay",overflowX:"hidden",height:function(){var e=j?64:0,t=b?64:0;return`calc(100vh - ${f}px - ${e}px - ${t}px - 5px)`}()},paperContainer:{top:56,backgroundColor:"unset !important",boxShadow:"none"},tabContainer:{overflow:"hidden",width:"100%"},tabSelect:{paddingTop:e.spacing(6),width:80,display:"flex",flexDirection:"column"},drawerContainer:{display:"flex",background:e.palette.background.default},tabName:{display:"flex",justifyContent:"space-between",alignItems:"center",height:"61px",padding:e.spacing(0,4,0,6)},actionIcons:{margin:e.spacing(-2.4)},title:{userSelect:"none",fontStyle:"normal",fontSize:"18px",lineHeight:e.spacing(5),letterSpacing:"0.25px",textTransform:"uppercase",color:e.palette.text.secondary},tabContent:{borderRight:n?"0.5px solid "+e.palette.divider:"none",overflowY:"auto",overflowX:"hidden",width:"100%"},buttonAction:{textTransform:"unset"},aiWareIcon:{padding:e.spacing(2.4,0),display:"flex",justifyContent:"center",position:"fixed",bottom:"0",right:"10px"},noShadow:{boxShadow:"none",borderLeft:"0.5px solid "+e.palette.divider},panelMask:{position:"absolute",zIndex:1150,width:"100%",height:"100%",backgroundColor:e.palette.grey[50],opacity:.5}}))()["classes"];react.exports.useEffect(()=>{0<R.length?l([...tabsListDefault,...R]):l(tabsListDefault)},[R]),react.exports.useEffect(()=>{x.config&&x.config.tabId&&o(x.config.tabId)},[x]),react.exports.useEffect(()=>{0<m.length&&i&&n&&(m.find(e=>e.panelId===i)||o(void 0))},[m,i,n]);a=jsxRuntime.exports.jsxs(Paper,Object.assign({className:`${O.container} ${a?"":O.noShadow} `,elevation:3,id:t,square:!0,"data-test":"panel-"+(E||"unknown")},{children:[0<A&&jsxRuntime.exports.jsx("div",{className:O.panelMask}),jsxRuntime.exports.jsxs("div",Object.assign({className:O.drawerContainer},{children:[a&&jsxRuntime.exports.jsxs("div",Object.assign({className:O.tabContent},{children:[j&&jsxRuntime.exports.jsxs("div",{children:[jsxRuntime.exports.jsxs("div",Object.assign({className:O.tabName},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h1",className:O.title},{children:j.title||(null==(p=r.find(e=>e.id===i))?void 0:p.label)})),jsxRuntime.exports.jsxs("div",Object.assign({className:O.actionIcons},{children:[null==(a=j.actions)?void 0:a.map((e,t)=>e.label?jsxRuntime.exports.jsx(Button,Object.assign({size:e.size,variant:e.variant,onClick:()=>s(e.action)},{children:e.label}),e.action.type):jsxRuntime.exports.jsxs(IconButton,Object.assign({onClick:()=>s(e.action),size:"large"},{children:[e.iconUrl&&jsxRuntime.exports.jsx("img",{src:e.iconUrl,alt:"icon",draggable:"false"}),e.icon&&jsxRuntime.exports.jsx("div",{children:e.icon})]}),e.action.type)),jsxRuntime.exports.jsx(IconButton,Object.assign({onClick:()=>s(hidePanel(t)),"data-test":"close-button-"+t,size:"large"},{children:jsxRuntime.exports.jsx("img",{src:N?img$P:img$Q,alt:"icon",draggable:"false"})}))]}))]})),j.divider&&jsxRuntime.exports.jsx(Divider,{})]}),jsxRuntime.exports.jsx("div",Object.assign({className:O.content},{children:e?react.exports.cloneElement(e,Object.assign(Object.assign({},x.config||{}),{dataId:t,hidePanel:()=>s(hidePanel(t)),tabId:i,panelRendered:c})):jsxRuntime.exports.jsx("div",{children:jsxRuntime.exports.jsx("h1",{children:"No micro frontend passed!"})})})),b&&jsxRuntime.exports.jsxs("div",Object.assign({className:O.footer},{children:[b.divider&&jsxRuntime.exports.jsx(Divider,{}),jsxRuntime.exports.jsx("div",Object.assign({className:O.headerContainer},{children:jsxRuntime.exports.jsx("div",Object.assign({className:O.actionContainer},{children:null==(p=b.actions)?void 0:p.map(e=>{var t;if(e.iconUrl)return jsxRuntime.exports.jsxs(IconButton,Object.assign({className:O.actionButton,onClick:(t=e.action,()=>{s(t)}),size:"large"},{children:[e.iconUrl&&jsxRuntime.exports.jsx("img",{src:e.iconUrl,alt:"icon",draggable:"false"}),e.icon&&jsxRuntime.exports.jsx("div",{children:e.icon})]}),e.action.type);const n=e;return jsxRuntime.exports.jsx(Button,Object.assign({className:O.actionButton,size:n.size,variant:n.variant,onClick:()=>s(n.action)},{children:n.label}),e.action.type)})}))}))]}))]})),n&&jsxRuntime.exports.jsxs("div",Object.assign({id:"tabs-content",className:O.tabSelect},{children:[jsxRuntime.exports.jsx(Tabs,{selectedId:i,tabsList:r,onChangeTab:function(t){i&&s(hidePanel(i)),o(t);var e,n=r.find(e=>e.id===t);null!=(e=null==n?void 0:n.onClick)&&e.call(n,t),null!=n&&n.action&&s(n.action)},roles:C}),(null===b||void 0===b?void 0:b.logo)&&jsxRuntime.exports.jsx("div",Object.assign({className:O.aiWareIcon},{children:jsxRuntime.exports.jsx(Logo,{})}))]}))]}))]}));return jsxRuntime.exports.jsx(AIWareThemeProvider,{children:jsxRuntime.exports.jsx(AIWareIntlProvider,{children:jsxRuntime.exports.jsx(lib.DynamicModuleLoader,Object.assign({modules:[getPanelModule()]},{children:jsxRuntime.exports.jsx(Slide,Object.assign({"data-id":"123456",in:T,direction:"left",onEntered:()=>d(!0),onExited:()=>s(unmountPanel(t))},{children:a}))}))})})}const AppbarPanel=e=>jsxRuntime.exports.jsx(AppbarTabPanel,Object.assign({},e,{withChild:!0,withTab:!1})),Tab=e=>jsxRuntime.exports.jsx(AppbarTabPanel,Object.assign({},e,{withChild:!1,withTab:!0}));export{AppbarPanel,AppbarTabPanel,Tab as TabPanel};
|