aiware-js 1.0.0-master.793 → 1.0.0-master.794
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/js-core.esm.js +1 -1
- package/js-core.esm.js.gz +0 -0
- package/js-core.esm48.js +1 -1
- package/js-core.esm48.js.gz +0 -0
- package/js-core.umd.js +2 -2
- package/js-core.umd.js.gz +0 -0
- package/locales/es.json +1 -1
- package/locales/fr.json +1 -1
- package/package.json +1 -1
package/js-core.esm.js
CHANGED
|
@@ -1528,4 +1528,4 @@ createScheduledJob(input:{
|
|
|
1528
1528
|
}
|
|
1529
1529
|
`)}),n},[]).join("\r\n")}
|
|
1530
1530
|
}
|
|
1531
|
-
`,l={entityId:t,entityType:e};try{a=yield baseGraphQLApi({query:s,operationName:n,variables:l,graphEndpoint:u,token:d})}catch(e){i=!0}if(a.errors){if(0===(o=a.errors.filter(({message:e})=>e.includes(' does not exist in "AuthPermissionType" enum.')).map(({message:e})=>{var t='Value "',n=e.substring(t.length).indexOf('"');return e.substring(t.length,t.length+n)})).length)throw i=!0,a={},new Error((null==(f=(a.errors||[])[0])?void 0:f.message)||"Error")}else i=!0}const c=a.data||{};return Object.keys(c).map(e=>{var t=e.split("__");return 3===t.length?{fetchedTargetEntityType:t[0],fetchedTargetGroupType:t[1],fetchedTargetAction:t[2],hasPermission:c[e][0].hasPermission}:{fetchedTargetEntityType:t[0],fetchedTargetAction:t[1],hasPermission:c[e][0].hasPermission}}).reduce((e,t)=>{var n=t.fetchedTargetGroupType||t.fetchedTargetEntityType;return t.hasPermission&&(e[n]||(e[n]={}),e[n][t.fetchedTargetAction]=t.hasPermission),e},{})})}function getMyRights(t){return __awaiter(this,void 0,void 0,function*(){var e="getMyRights";return(yield baseGraphQLApiWithError(Object.assign({query:"\n query getMyRights {\n myRights {\n operations\n }\n }\n ",operationName:e},t))).myRights.operations})}const selectPermissionsByEntity=(t,n,r)=>e=>{return t&&n&&(e=e[namespace].permissionsByObject[t])&&e[n]?e[n][r||t]:void 0},selectMyRights=e=>e[namespace].rights;var index=Object.freeze({__proto__:null,selectPermissionsByEntity:selectPermissionsByEntity,selectMyRights:selectMyRights});function*fetchObjectPermissions(t){var{entityId:t,entityType:n}=t.payload,i=yield select(selectApiConfigs$2),e=yield select(graphEndpointSelector),o=yield select(sessionTokenSelector),a=yield select(selectIsOLPEnabled),r=yield select(selectPermissionsByEntity(n,t));if(!r||"success"!==r.status&&"pending"!==r.status){yield put(actions.fetchObjectPermissionsStarted({entityId:t,entityType:n}));try{let r={};if(a)r=yield call$j(getObjectPermissions,e,o,{entityType:n,entityId:t});else{let e=yield select(selectMyRights);if("success"!==e.status&&"pending"!==e.status){yield put(actions.fetchMyRightsStarted);try{var s=yield call$j(getMyRights,i);yield put(actions.fetchMyRightsSucceeded(s)),e=yield select(selectMyRights)}catch(e){throw yield put(actions.fetchMyRightsFailed),e}}else"pending"===e.status&&(yield take([actions.fetchMyRightsFailed,actions.fetchMyRightsSucceeded]),e=yield select(selectMyRights));const l=e["myRights"];getPermissionTypesToQuery(n).forEach(n=>{var{action:e,resource:t}=n.targetActions.reduce((e,t)=>(e.action[t.targetAction]=convertPermissionsToRights(t.resource||n.targetObjectType,t.targetAction,l),e.resource=t.resource,e),{action:{}});r[t||n.targetObjectType]=e})}yield put(actions.fetchObjectPermissionsSucceeded({entityId:t,entityType:n,permissions:r}))}catch(e){actions.fetchObjectPermissionsFailed({entityId:t,entityType:n})}}}function*watchPermissionsStart(){yield takeEvery$1(actions.fetchObjectPermissionsStart.type,fetchObjectPermissions)}function*rootSaga(){yield all([watchPermissionsStart()])}function getPermissionsModule(){return{id:namespace,reducerMap:{[namespace]:permissionsReducer},sagas:[rootSaga],initialActions:[]}}const useOrganizationPermissions=e=>{const t=react$1.exports.useRef(),n=useDispatch(),r=null==(o=useSelector(userSelector$2).organization)?void 0:o.organizationId,i=useSelector(selectPermissionsByEntity(EAuthResourceType.Organization,String(r),e));react$1.exports.useEffect(()=>{!r||i&&"failure"!==i.status&&"idle"!==i.status&&t.current===r||(t.current=r,n(actions.fetchObjectPermissionsStart({entityType:EAuthResourceType.Organization,entityId:String(r)})))},[n,r,i]);var o=react$1.exports.useCallback(e=>{return!isPermissionLoading(i)&&hasPermission(i,e)},[i]);return{permissions:i,hasPermission:o}},rateLimiter=new RateLimiter,checkAndDecodeBase64String=t=>{if(null==t||!t.trim())return t;try{return window.btoa(window.atob(t))==t?window.atob(t):t}catch(e){return t}};function SnackbarRenderer(){return jsxRuntime.exports.jsx(Provider$2,Object.assign({store:store$5},{children:jsxRuntime.exports.jsx(DynamicModuleLoader,Object.assign({modules:[getSnackbarModule()]},{children:jsxRuntime.exports.jsx(CustomSnackbar,{})}))}))}store$5.addModules([getWidgetsModule(),getPanelsModule(registry,registryLookup),getDataModule(),getConfigModule(),getAuthModule(),getPermissionsModule()]);let hasLoaded=!1;const AppBarPreLoader=()=>{var e=useSelector(authSelector);return(null==(e=null==e?void 0:e.user)?void 0:e.token)&&!hasLoaded&&(hasLoaded=!0,setTimeout(()=>{store$5.addModules([getAppbarPanelModule()])},0)),null};function ApplicationDialogPreLoader(){var e=useSelector(authSelector);return(null==(e=null==e?void 0:e.user)?void 0:e.token)&&hasLoaded?jsxRuntime.exports.jsx(ApplicationDialog,{}):null}const authHelpers={updateToken(e){e?store$5.dispatch(updateTokenRequest({token:e})):console.error("[AiWARE JS]: Please provide a valid token!")},logout(e){"function"==typeof e?(e(),setTimeout(()=>{store$5.dispatch(logout())},1e3)):store$5.dispatch(logout())},reportAppActivity(e){rateLimiter.checkIfCanCall(e)&&store$5.dispatch(updateActivityStatus$1())}};function PortalRenderer(){return jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment,{children:[jsxRuntime.exports.jsx(SupportCenterPixel,{}),jsxRuntime.exports.jsx(Provider$2,Object.assign({store:store$5},{children:jsxRuntime.exports.jsx(AppBarPreLoader,{})}))]})}function ApplicationDialogRenderer(){return jsxRuntime.exports.jsx(jsxRuntime.exports.Fragment,{children:jsxRuntime.exports.jsx(Provider$2,Object.assign({store:store$5},{children:jsxRuntime.exports.jsx(AIWareIntlProvider,{children:jsxRuntime.exports.jsx(ApplicationDialogPreLoader,{})})}))})}const ThemeInitializer=()=>(useTheme(),null),root=getElement("aiWARE"),reactDOMroot=(root.classList.add("aiware-el"),client$1.createRoot(root)),mountWidget=("_auth"===window.name?handleImplicitRedirect(window.location.hash,window.opener):reactDOMroot.render(jsxRuntime.exports.jsx(AIWareCacheProvider,{children:jsxRuntime.exports.jsxs(AIWareThemeProvider$1,{children:[jsxRuntime.exports.jsx(PortalRenderer,{}),jsxRuntime.exports.jsx(SnackbarRenderer,{}),jsxRuntime.exports.jsx(ApplicationDialogRenderer,{}),jsxRuntime.exports.jsx(ThemeInitializer,{})]})})),(e,t)=>{var n=getUniqueID(),{name:e,elementId:r,config:i}=e;return e&&r&&i||console.error("[aiwarejs-error]: `mountWidget` function should include all the following params: name, elementId, config"),store$5.dispatch(mountWidget$1({elementId:r,widgetName:e,widgetConfig:i,widgetId:n,onComplete:t})),n}),unmountWidget=e=>(store$5.dispatch(unmountWidget$1(e)),!0),mountPanel=(e,t)=>{const n=e.panelId||getUniqueID();var{microFrontend:e,panelConfig:r}=e;store$5.dispatch(mountPanel$1({microFrontend:e,panelId:n,panelConfig:r}));const i=[...(null==(e=null==r?void 0:r.header)?void 0:e.actions)||[],...(null==(e=null==r?void 0:r.footer)?void 0:e.actions)||[]].filter(e=>e.submit).map(e=>e.action);r={id:n,sagas:[function*(){yield takeEvery$1(i.map(e=>e.type),function*(){var e=(yield select(e=>e.data.find(e=>e.id===n)))["data"];t&&t(e)})}]};return store$5.addModule(r),n},unmountPanel=e=>(store$5.dispatch(unmountPanel$1(e)),!0),hidePanel=e=>(store$5.dispatch(hidePanel$1(e)),!0),unmountAllPanel=()=>{store$5.dispatch(unmountAllPanel$1(""))};function init(e,t){var n,e=validateConfig(e);e?(n=e["authToken"],n=checkAndDecodeBase64String(n||""),store$5.dispatch(getInitConfig(Object.assign(Object.assign({},e),{authToken:n,onComplete:t})))):console.error("@aiware/js initialization failed. Please pass valid configuration object.")}function helpCenter(){var e=new HelpCenter$2({actions:{setCustomKnowledgeBaseUrlAction:setCustomKnowledgeBaseUrl,setCustomDocsUrlAction:setCustomDocsUrl,updateSelectedTabAction:updateSelectedTab}});return{openKnowledgeBasePanel:e.openKnowledgeBasePanel.bind(e),openDocsPanel:e.openDocsPanel.bind(e)}}function dataCenter(){var e=new DataCenter$1;return{openImporterPanel:e.openImporterPanel.bind(e)}}function handleEvents(){function n(e){if(!e||"string"!=typeof e)throw new SdkError("Please provide a valid event name!");if(!SdkEvents[e])throw new SdkError("Unknown event: "+e)}return{on:function(e,t){n(e),sdkEventManager.on.call(sdkEventManager,e,t)},off:function(e){n(e),sdkEventManager.off.call(sdkEventManager,e)}}}const mountPanelForResponse=e=>mountPanelForResponse$1(e,store$5),aiwareEvents=handleEvents();window&&(window.aiWare_initTesting=()=>{window.aiWare_store=store$5,window.aiWare_theme={darkTheme:darkTheme$1,lightTheme:lightTheme$1}},window.aiware={init:init,auth:authHelpers,helpCenter:helpCenter(),dataCenter:dataCenter(),on:aiwareEvents.on,off:aiwareEvents.off,hidePanel:hidePanel,unmountPanel:unmountPanel,store:store$5,registry:registry,registerComponent:registerComponent,AvailableWidgets:AvailableWidgets,mountPanelAction:mountPanel$1,unmountPanelAction:unmountPanel$1,hidePanelAction:hidePanel$1,updatePanelMicroFrontendPropsAction:updatePanelMicroFrontendProps,setData:setData,mountWidget:mountWidget,mountPanel:mountPanel,mountPanelForResponse:mountPanelForResponse,unmountWidget:unmountWidget,version:"sdk_release_version",commit:"10d218711",releaseDate:"2023-08-22T14:33:21.577Z"});export{enableBetaFeatures as $,AIWareIntlProvider as A,Box$1 as B,devErrorLogger as C,useLocation as D,DynamicModuleLoader as E,FormattedMessage$1 as F,Button$1 as G,authErrorMessage as H,Grid$1 as I,FormControl$1 as J,TextField$1 as K,LoadingButton$1 as L,classNames as M,resetPasswordRequest as N,InputLabel$1 as O,Provider$2 as P,OutlinedInput$1 as Q,Routes as R,Switch$1 as S,Typography$1 as T,InputAdornment$1 as U,IconButton$1 as V,Select$1 as W,Location as X,MenuItem$1 as Y,Divider$1 as Z,_extends$3 as _,generateUtilityClasses as a,Card$1 as a$,all as a0,createTheme$1 as a1,systemStyled as a2,useThemeProps$1 as a3,useId as a4,useControlled$1 as a5,usePreviousProps$1 as a6,useEventCallback as a7,setRef as a8,inputClasses$1 as a9,List$2 as aA,ListItem$1 as aB,ListItemIcon$1 as aC,ListItemText$1 as aD,flowCenterDialogAction as aE,img$p as aF,img$q as aG,img$s as aH,img$t as aI,Tooltip$1 as aJ,img$j as aK,img$I as aL,Skeleton$1 as aM,takeLatest$1 as aN,fetchAllTags as aO,put as aP,select as aQ,fetchFlows as aR,call$j as aS,fetchTemplateGallery as aT,isRevisionsExistOnServerRequest as aU,FormLabel$1 as aV,default_1$d as aW,FormGroup$1 as aX,FormControlLabel$1 as aY,Checkbox$1 as aZ,fetchTemplateGalleryFallback as a_,inputBaseClasses$1 as aa,outlinedInputClasses$1 as ab,filledInputClasses$1 as ac,Popper$1 as ad,alpha as ae,ListSubheader$1 as af,ClearIcon as ag,ArrowDropDownIcon as ah,Chip$1 as ai,createBox$1 as aj,createAction as ak,createReducer as al,ENGINE_OWNER_TYPES as am,ENGINE_FILTER_TYPES as an,preferredLanguageSelector as ao,baseUrlSelector as ap,rootApiSelector as aq,sessionTokenSelector as ar,graphEndpointSelector as as,controllerNodeRedImageSelector as at,controllerUrlSelector as au,automateControllerUrlSelector as av,flowCenterDialogSelector as aw,automateUrlSelector as ax,Portal$1 as ay,flowCenterDialogReducer as az,styled$1 as b,getSnackbarModule as b$,CardContent$1 as b0,img$n as b1,CardActions$1 as b2,flowStyles as b3,NoResults as b4,CircularProgress$1 as b5,img$d as b6,Dialog$1 as b7,setApiEndpoint as b8,TableContainer$1 as b9,fetchEngine as bA,img$l as bB,AIWareFormatMessage as bC,FormattedDate as bD,fetchVeritoneGraphQLApi as bE,useTheme as bF,KeyboardArrowRight as bG,KeyboardArrowLeft as bH,InputUnstyled as bI,isHostComponent as bJ,getDefaultExportFromNamespaceIfNotNamed as bK,commonjsRequire as bL,reactDom as bM,Transition$1 as bN,_defineProperty$x as bO,__awaiter$e as bP,__generator$2 as bQ,__spread as bR,React5 as bS,TransitionGroup$1 as bT,connect$1 as bU,Bookmark as bV,EngineFlagIcons as bW,createAsyncThunk as bX,withStyles as bY,getConfigModule as bZ,getAuthModule as b_,Table$1 as ba,TableHead$1 as bb,TableRow$1 as bc,TableCell$1 as bd,TableSortLabel$1 as be,TableBody$1 as bf,img$i as bg,default_1 as bh,ClickAwayListener as bi,Fade$1 as bj,img$u as bk,img$r as bl,img$S as bm,img$E as bn,DialogTitle$1 as bo,DialogContent$1 as bp,DialogActions$1 as bq,Snackbar$1 as br,default_1$6 as bs,Search$1 as bt,img$k as bu,img$m as bv,img$W as bw,Tabs$2 as bx,Tab$2 as by,deleteEngine as bz,Paper$1 as c,Edit as c$,AIWareCacheProvider as c0,img$T as c1,img$f as c2,img$e as c3,isEmpty_1 as c4,Backdrop$1 as c5,getDefaultMiddleware as c6,isNil_1 as c7,UpDown as c8,Icon$1 as c9,_toPropertyKey as cA,_inheritsLoose$2 as cB,hoistNonReactStatics_cjs as cC,commonjsGlobal$2 as cD,combineReducers as cE,createSelector$1 as cF,fork as cG,statusPill as cH,AIWareThemeProvider$1 as cI,LocalizationProvider as cJ,AdapterDateFns as cK,CalendarPicker as cL,Stack$4 as cM,Close$1 as cN,FullscreenExit as cO,Fullscreen as cP,TabPanel as cQ,default_1$8 as cR,unmountPanel$1 as cS,AvailableComponents as cT,delay$1 as cU,hidePanel$1 as cV,mountPanel$1 as cW,DialogContentText$1 as cX,userSelector$2 as cY,MoreVert$1 as cZ,Menu$1 as c_,get_1 as ca,map_1 as cb,keys_1 as cc,RadioGroup$1 as cd,Avatar$1 as ce,img$y as cf,baseGraphQLApi as cg,FormHelperText$2 as ch,img$h as ci,StyledEngineProvider as cj,ThemeProvider as ck,lightTheme$1 as cl,CssBaseline as cm,Hide as cn,has_1 as co,showMessage as cp,MessageSeverity as cq,Radio$2 as cr,createSvgIcon$2 as cs,_createCompounder as ct,_baseIteratee as cu,isArrayLike_1 as cv,toInteger_1 as cw,_typeof$D as cx,_assertThisInitialized$x as cy,_setPrototypeOf$z as cz,capitalize$2 as d,_baseEach as d$,Upload as d0,Delete$1 as d1,CustomTabs as d2,useBackupImg as d3,img$1B as d4,validate as d5,configSelector as d6,baseGraphQLApiWithError as d7,VerifiedFilled as d8,Add as d9,channel$2 as dA,useIntl as dB,VideoCamera as dC,Image$1 as dD,Sound as dE,Description as dF,toNumber_1 as dG,ProgressStepper as dH,size_1 as dI,take as dJ,CurlyBraces as dK,UnknownDocument as dL,VariableSizeList as dM,sdkEventManager as dN,SdkEvents as dO,SdkError as dP,EngineClassIcons as dQ,Mode2 as dR,EngineModeIcons as dS,DeploymentModelIcons as dT,guid as dU,EditList as dV,ButtonBase$1 as dW,isObject_1 as dX,_arrayMap as dY,_Symbol as dZ,isArguments_1 as d_,ExpandLess$1 as da,ExpandMore$1 as db,Collapse$1 as dc,img$18 as dd,Filter$1 as de,DynamicTable as df,useTheme$3 as dg,getThemeProps as dh,useEnhancedEffect$3 as di,React as dj,_arrayPush as dk,isArray_1 as dl,_baseToString as dm,_baseTrim as dn,_castSlice as dp,_stringToArray as dq,toString_1 as dr,ReactIs as ds,upperFirst_1 as dt,isString_1 as du,_baseGet as dv,_baseSlice as dw,_castPath as dx,_toKey as dy,_isIndex as dz,_objectWithoutPropertiesLoose$2 as e,MenuList$1 as e$,_arrayFilter as e0,_getNative as e1,eq_1 as e2,_root as e3,_Uint8Array as e4,_overArg as e5,_isPrototype as e6,isObjectLike_1 as e7,_baseGetTag as e8,_arrayLikeKeys as e9,useSlotProps as eA,_arraySome as eB,EntityType as eC,generateState as eD,injectIntl as eE,ErrorBoundary$1 as eF,EPermissionAction as eG,Process as eH,Information as eI,Download as eJ,NewFolder as eK,SpecialFolder as eL,User as eM,Source as eN,Search$2 as eO,selectIsOLPEnabled as eP,ListItemSecondaryAction$1 as eQ,getLibraryModule as eR,cmsUrlSelector as eS,debounce_1 as eT,SearchStructuredData as eU,Grow$1 as eV,index as eW,actions as eX,hasPermission as eY,UserAddFilled as eZ,Popover$1 as e_,isBuffer$4 as ea,isFunction_1 as eb,isTypedArray_1 as ec,_Stack as ed,_baseFor as ee,identity_1 as ef,_isIterateeCall as eg,isSymbol_1 as eh,_baseMap as ei,_baseUnary as ej,_Set as ek,_setToArray as el,_SetCache as em,_cacheHas as en,img$P as eo,img$O as ep,img$1x as eq,img$1w as er,img$1v as es,img$M as et,img$1z as eu,img$L as ev,authSelector as ew,ListItemAvatar$1 as ex,takeEvery$1 as ey,emphasize as ez,clsx as f,ConfirmationModal as f$,MoveFolder as f0,EAuthResourceType as f1,Slide$1 as f2,img$b as f3,selectApiConfigs$2 as f4,selectPanelByPanelName as f5,FullScreenContainer as f6,EngineCategoryIcons as f7,isPermissionLoading as f8,Settings$2 as f9,img$A as fA,Undefined as fB,PodcastSource as fC,YoutubeSource as fD,TVSource as fE,RadioSource as fF,selectOrgId as fG,navSectionStyles as fH,selectIsUserAdmin as fI,AvatarGroup$1 as fJ,index$1 as fK,ErrorState$2 as fL,Stepper$1 as fM,StepConnector$1 as fN,Step$1 as fO,StepLabel$1 as fP,isEqual_1 as fQ,NullState$2 as fR,Group as fS,PermissionChangedAction as fT,Lock as fU,useOrganizationPermissions as fV,EAuthSubResourceType as fW,AddGroup as fX,initialConfigSelector as fY,EMessageTypes as fZ,errors as f_,Hamburger as fa,List as fb,enginesFilter as fc,panelsSelector as fd,Badge$1 as fe,MoreHor as ff,convertEntityToAuthResource as fg,AutoSizer as fh,InfiniteLoader as fi,FixedSizeList as fj,selectUserOrgEdgeVersion as fk,EditAttributes as fl,gqlIntrospection as fm,ProcessingDetail as fn,img$x as fo,img$z as fp,img$5 as fq,FilterRemove as fr,AlarmTwo as fs,tableInfiniteScroll as ft,CheckCircle as fu,FolderOpen as fv,Voice as fw,useDoubleClick as fx,FolderFilled as fy,Time as fz,generateUtilityClass as g,statusFilter as g$,EnumHelpers as g0,formatBytes as g1,LinearProgress$1 as g2,NotInterested as g3,mountPanelForResponse$1 as g4,default_1$9 as g5,tableStyles as g6,ArrowDown as g7,ArrowUp as g8,useInterval as g9,Slider$1 as gA,getDefaultExportFromCjs as gB,_getSymbols as gC,stubArray_1 as gD,_baseGetAllKeys as gE,_getTag as gF,_nodeUtil as gG,_getAllKeys as gH,_castFunction as gI,Article as gJ,Task as gK,View as gL,_objectSpread2 as gM,serialize as gN,stringify$2 as gO,compile as gP,isNumber_1 as gQ,Check as gR,EngineIconsRenderer as gS,FormattedRelativeTime$1 as gT,BottomQueue as gU,TopQueue as gV,Pause as gW,Cancel as gX,Folder as gY,Hidden as gZ,dateRangeFilter as g_,Iam as ga,safeFormatMessage as gb,contextMenuStyles as gc,Users as gd,SecurityGroup as ge,getOrganizationPanelModule as gf,Lock2 as gg,EApplicationConfigLevel as gh,NoApps as gi,EApplicationConfigType as gj,green$1 as gk,md5 as gl,selectIsSuperAdmin as gm,organizations_selector as gn,actions$5 as go,AddUser as gp,selectors as gq,LibraryDropdown as gr,Remove as gs,Save as gt,Input$3 as gu,getElement as gv,client$1 as gw,Copy as gx,ArrowForward as gy,Modal$1 as gz,composeClasses as h,TableLoadingState as h0,setDuration as h1,resetDuration as h2,createStack as h3,toFinite_1 as h4,_baseForOwn as h5,_arrayReduce as h6,hasIn_1 as h7,now_1 as h8,useSyncExternalStoreExports as h9,registry as hA,registerComponent as hB,AvailableWidgets as hC,updatePanelMicroFrontendProps as hD,setData as hE,root as hF,mountWidget as hG,unmountWidget as hH,mountPanel as hI,unmountPanel as hJ,hidePanel as hK,unmountAllPanel as hL,init as hM,aiwareEvents as hN,Engines as ha,EngineComponentLoader as hb,imageUpload as hc,characterCountTextField as hd,tabsClasses$1 as he,Packages as hf,Resources$1 as hg,selectUserCanCreatePackage as hh,PackagesAvatar as hi,actionChannel as hj,cancelled as hk,flush$4 as hl,cancel as hm,tableSearchComponents as hn,FlowTemplate as ho,Node as hp,Palette as hq,FlowCenter2 as hr,ArrowBack as hs,Schema as ht,panelComponents as hu,img$4 as hv,img$w as hw,Clear as hx,ExpandLess as hy,ExpandMore as hz,createSvgIcon$1 as i,jsxRuntime as j,interopRequireDefault as k,createSlice as l,makeStyles as m,Route as n,useDispatch as o,useSelector as p,authStatusSelector as q,react$1 as r,store$5 as s,authContextSelector as t,useThemeProps as u,AuthContext as v,lodash as w,Alert$1 as x,betaFeaturesSelector as y,useNavigate as z};
|
|
1531
|
+
`,l={entityId:t,entityType:e};try{a=yield baseGraphQLApi({query:s,operationName:n,variables:l,graphEndpoint:u,token:d})}catch(e){i=!0}if(a.errors){if(0===(o=a.errors.filter(({message:e})=>e.includes(' does not exist in "AuthPermissionType" enum.')).map(({message:e})=>{var t='Value "',n=e.substring(t.length).indexOf('"');return e.substring(t.length,t.length+n)})).length)throw i=!0,a={},new Error((null==(f=(a.errors||[])[0])?void 0:f.message)||"Error")}else i=!0}const c=a.data||{};return Object.keys(c).map(e=>{var t=e.split("__");return 3===t.length?{fetchedTargetEntityType:t[0],fetchedTargetGroupType:t[1],fetchedTargetAction:t[2],hasPermission:c[e][0].hasPermission}:{fetchedTargetEntityType:t[0],fetchedTargetAction:t[1],hasPermission:c[e][0].hasPermission}}).reduce((e,t)=>{var n=t.fetchedTargetGroupType||t.fetchedTargetEntityType;return t.hasPermission&&(e[n]||(e[n]={}),e[n][t.fetchedTargetAction]=t.hasPermission),e},{})})}function getMyRights(t){return __awaiter(this,void 0,void 0,function*(){var e="getMyRights";return(yield baseGraphQLApiWithError(Object.assign({query:"\n query getMyRights {\n myRights {\n operations\n }\n }\n ",operationName:e},t))).myRights.operations})}const selectPermissionsByEntity=(t,n,r)=>e=>{return t&&n&&(e=e[namespace].permissionsByObject[t])&&e[n]?e[n][r||t]:void 0},selectMyRights=e=>e[namespace].rights;var index=Object.freeze({__proto__:null,selectPermissionsByEntity:selectPermissionsByEntity,selectMyRights:selectMyRights});function*fetchObjectPermissions(t){var{entityId:t,entityType:n}=t.payload,i=yield select(selectApiConfigs$2),e=yield select(graphEndpointSelector),o=yield select(sessionTokenSelector),a=yield select(selectIsOLPEnabled),r=yield select(selectPermissionsByEntity(n,t));if(!r||"success"!==r.status&&"pending"!==r.status){yield put(actions.fetchObjectPermissionsStarted({entityId:t,entityType:n}));try{let r={};if(a)r=yield call$j(getObjectPermissions,e,o,{entityType:n,entityId:t});else{let e=yield select(selectMyRights);if("success"!==e.status&&"pending"!==e.status){yield put(actions.fetchMyRightsStarted);try{var s=yield call$j(getMyRights,i);yield put(actions.fetchMyRightsSucceeded(s)),e=yield select(selectMyRights)}catch(e){throw yield put(actions.fetchMyRightsFailed),e}}else"pending"===e.status&&(yield take([actions.fetchMyRightsFailed,actions.fetchMyRightsSucceeded]),e=yield select(selectMyRights));const l=e["myRights"];getPermissionTypesToQuery(n).forEach(n=>{var{action:e,resource:t}=n.targetActions.reduce((e,t)=>(e.action[t.targetAction]=convertPermissionsToRights(t.resource||n.targetObjectType,t.targetAction,l),e.resource=t.resource,e),{action:{}});r[t||n.targetObjectType]=e})}yield put(actions.fetchObjectPermissionsSucceeded({entityId:t,entityType:n,permissions:r}))}catch(e){actions.fetchObjectPermissionsFailed({entityId:t,entityType:n})}}}function*watchPermissionsStart(){yield takeEvery$1(actions.fetchObjectPermissionsStart.type,fetchObjectPermissions)}function*rootSaga(){yield all([watchPermissionsStart()])}function getPermissionsModule(){return{id:namespace,reducerMap:{[namespace]:permissionsReducer},sagas:[rootSaga],initialActions:[]}}const useOrganizationPermissions=e=>{const t=react$1.exports.useRef(),n=useDispatch(),r=null==(o=useSelector(userSelector$2).organization)?void 0:o.organizationId,i=useSelector(selectPermissionsByEntity(EAuthResourceType.Organization,String(r),e));react$1.exports.useEffect(()=>{!r||i&&"failure"!==i.status&&"idle"!==i.status&&t.current===r||(t.current=r,n(actions.fetchObjectPermissionsStart({entityType:EAuthResourceType.Organization,entityId:String(r)})))},[n,r,i]);var o=react$1.exports.useCallback(e=>{return!isPermissionLoading(i)&&hasPermission(i,e)},[i]);return{permissions:i,hasPermission:o}},rateLimiter=new RateLimiter,checkAndDecodeBase64String=t=>{if(null==t||!t.trim())return t;try{return window.btoa(window.atob(t))==t?window.atob(t):t}catch(e){return t}};function SnackbarRenderer(){return jsxRuntime.exports.jsx(Provider$2,Object.assign({store:store$5},{children:jsxRuntime.exports.jsx(DynamicModuleLoader,Object.assign({modules:[getSnackbarModule()]},{children:jsxRuntime.exports.jsx(CustomSnackbar,{})}))}))}store$5.addModules([getWidgetsModule(),getPanelsModule(registry,registryLookup),getDataModule(),getConfigModule(),getAuthModule(),getPermissionsModule()]);let hasLoaded=!1;const AppBarPreLoader=()=>{var e=useSelector(authSelector);return(null==(e=null==e?void 0:e.user)?void 0:e.token)&&!hasLoaded&&(hasLoaded=!0,setTimeout(()=>{store$5.addModules([getAppbarPanelModule()])},0)),null};function ApplicationDialogPreLoader(){var e=useSelector(authSelector);return(null==(e=null==e?void 0:e.user)?void 0:e.token)&&hasLoaded?jsxRuntime.exports.jsx(ApplicationDialog,{}):null}const authHelpers={updateToken(e){e?store$5.dispatch(updateTokenRequest({token:e})):console.error("[AiWARE JS]: Please provide a valid token!")},logout(e){"function"==typeof e?(e(),setTimeout(()=>{store$5.dispatch(logout())},1e3)):store$5.dispatch(logout())},reportAppActivity(e){rateLimiter.checkIfCanCall(e)&&store$5.dispatch(updateActivityStatus$1())}};function PortalRenderer(){return jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment,{children:[jsxRuntime.exports.jsx(SupportCenterPixel,{}),jsxRuntime.exports.jsx(Provider$2,Object.assign({store:store$5},{children:jsxRuntime.exports.jsx(AppBarPreLoader,{})}))]})}function ApplicationDialogRenderer(){return jsxRuntime.exports.jsx(jsxRuntime.exports.Fragment,{children:jsxRuntime.exports.jsx(Provider$2,Object.assign({store:store$5},{children:jsxRuntime.exports.jsx(AIWareIntlProvider,{children:jsxRuntime.exports.jsx(ApplicationDialogPreLoader,{})})}))})}const ThemeInitializer=()=>(useTheme(),null),root=getElement("aiWARE"),reactDOMroot=(root.classList.add("aiware-el"),client$1.createRoot(root)),mountWidget=("_auth"===window.name?handleImplicitRedirect(window.location.hash,window.opener):reactDOMroot.render(jsxRuntime.exports.jsx(AIWareCacheProvider,{children:jsxRuntime.exports.jsxs(AIWareThemeProvider$1,{children:[jsxRuntime.exports.jsx(PortalRenderer,{}),jsxRuntime.exports.jsx(SnackbarRenderer,{}),jsxRuntime.exports.jsx(ApplicationDialogRenderer,{}),jsxRuntime.exports.jsx(ThemeInitializer,{})]})})),(e,t)=>{var n=getUniqueID(),{name:e,elementId:r,config:i}=e;return e&&r&&i||console.error("[aiwarejs-error]: `mountWidget` function should include all the following params: name, elementId, config"),store$5.dispatch(mountWidget$1({elementId:r,widgetName:e,widgetConfig:i,widgetId:n,onComplete:t})),n}),unmountWidget=e=>(store$5.dispatch(unmountWidget$1(e)),!0),mountPanel=(e,t)=>{const n=e.panelId||getUniqueID();var{microFrontend:e,panelConfig:r}=e;store$5.dispatch(mountPanel$1({microFrontend:e,panelId:n,panelConfig:r}));const i=[...(null==(e=null==r?void 0:r.header)?void 0:e.actions)||[],...(null==(e=null==r?void 0:r.footer)?void 0:e.actions)||[]].filter(e=>e.submit).map(e=>e.action);r={id:n,sagas:[function*(){yield takeEvery$1(i.map(e=>e.type),function*(){var e=(yield select(e=>e.data.find(e=>e.id===n)))["data"];t&&t(e)})}]};return store$5.addModule(r),n},unmountPanel=e=>(store$5.dispatch(unmountPanel$1(e)),!0),hidePanel=e=>(store$5.dispatch(hidePanel$1(e)),!0),unmountAllPanel=()=>{store$5.dispatch(unmountAllPanel$1(""))};function init(e,t){var n,e=validateConfig(e);e?(n=e["authToken"],n=checkAndDecodeBase64String(n||""),store$5.dispatch(getInitConfig(Object.assign(Object.assign({},e),{authToken:n,onComplete:t})))):console.error("@aiware/js initialization failed. Please pass valid configuration object.")}function helpCenter(){var e=new HelpCenter$2({actions:{setCustomKnowledgeBaseUrlAction:setCustomKnowledgeBaseUrl,setCustomDocsUrlAction:setCustomDocsUrl,updateSelectedTabAction:updateSelectedTab}});return{openKnowledgeBasePanel:e.openKnowledgeBasePanel.bind(e),openDocsPanel:e.openDocsPanel.bind(e)}}function dataCenter(){var e=new DataCenter$1;return{openImporterPanel:e.openImporterPanel.bind(e)}}function handleEvents(){function n(e){if(!e||"string"!=typeof e)throw new SdkError("Please provide a valid event name!");if(!SdkEvents[e])throw new SdkError("Unknown event: "+e)}return{on:function(e,t){n(e),sdkEventManager.on.call(sdkEventManager,e,t)},off:function(e){n(e),sdkEventManager.off.call(sdkEventManager,e)}}}const mountPanelForResponse=e=>mountPanelForResponse$1(e,store$5),aiwareEvents=handleEvents();window&&(window.aiWare_initTesting=()=>{window.aiWare_store=store$5,window.aiWare_theme={darkTheme:darkTheme$1,lightTheme:lightTheme$1}},window.aiware={init:init,auth:authHelpers,helpCenter:helpCenter(),dataCenter:dataCenter(),on:aiwareEvents.on,off:aiwareEvents.off,hidePanel:hidePanel,unmountPanel:unmountPanel,store:store$5,registry:registry,registerComponent:registerComponent,AvailableWidgets:AvailableWidgets,mountPanelAction:mountPanel$1,unmountPanelAction:unmountPanel$1,hidePanelAction:hidePanel$1,updatePanelMicroFrontendPropsAction:updatePanelMicroFrontendProps,setData:setData,mountWidget:mountWidget,mountPanel:mountPanel,mountPanelForResponse:mountPanelForResponse,unmountWidget:unmountWidget,version:"sdk_release_version",commit:"f8f30b1f7",releaseDate:"2023-08-22T18:54:25.533Z"});export{enableBetaFeatures as $,AIWareIntlProvider as A,Box$1 as B,devErrorLogger as C,useLocation as D,DynamicModuleLoader as E,FormattedMessage$1 as F,Button$1 as G,authErrorMessage as H,Grid$1 as I,FormControl$1 as J,TextField$1 as K,LoadingButton$1 as L,classNames as M,resetPasswordRequest as N,InputLabel$1 as O,Provider$2 as P,OutlinedInput$1 as Q,Routes as R,Switch$1 as S,Typography$1 as T,InputAdornment$1 as U,IconButton$1 as V,Select$1 as W,Location as X,MenuItem$1 as Y,Divider$1 as Z,_extends$3 as _,generateUtilityClasses as a,Card$1 as a$,all as a0,createTheme$1 as a1,systemStyled as a2,useThemeProps$1 as a3,useId as a4,useControlled$1 as a5,usePreviousProps$1 as a6,useEventCallback as a7,setRef as a8,inputClasses$1 as a9,List$2 as aA,ListItem$1 as aB,ListItemIcon$1 as aC,ListItemText$1 as aD,flowCenterDialogAction as aE,img$p as aF,img$q as aG,img$s as aH,img$t as aI,Tooltip$1 as aJ,img$j as aK,img$I as aL,Skeleton$1 as aM,takeLatest$1 as aN,fetchAllTags as aO,put as aP,select as aQ,fetchFlows as aR,call$j as aS,fetchTemplateGallery as aT,isRevisionsExistOnServerRequest as aU,FormLabel$1 as aV,default_1$d as aW,FormGroup$1 as aX,FormControlLabel$1 as aY,Checkbox$1 as aZ,fetchTemplateGalleryFallback as a_,inputBaseClasses$1 as aa,outlinedInputClasses$1 as ab,filledInputClasses$1 as ac,Popper$1 as ad,alpha as ae,ListSubheader$1 as af,ClearIcon as ag,ArrowDropDownIcon as ah,Chip$1 as ai,createBox$1 as aj,createAction as ak,createReducer as al,ENGINE_OWNER_TYPES as am,ENGINE_FILTER_TYPES as an,preferredLanguageSelector as ao,baseUrlSelector as ap,rootApiSelector as aq,sessionTokenSelector as ar,graphEndpointSelector as as,controllerNodeRedImageSelector as at,controllerUrlSelector as au,automateControllerUrlSelector as av,flowCenterDialogSelector as aw,automateUrlSelector as ax,Portal$1 as ay,flowCenterDialogReducer as az,styled$1 as b,getSnackbarModule as b$,CardContent$1 as b0,img$n as b1,CardActions$1 as b2,flowStyles as b3,NoResults as b4,CircularProgress$1 as b5,img$d as b6,Dialog$1 as b7,setApiEndpoint as b8,TableContainer$1 as b9,fetchEngine as bA,img$l as bB,AIWareFormatMessage as bC,FormattedDate as bD,fetchVeritoneGraphQLApi as bE,useTheme as bF,KeyboardArrowRight as bG,KeyboardArrowLeft as bH,InputUnstyled as bI,isHostComponent as bJ,getDefaultExportFromNamespaceIfNotNamed as bK,commonjsRequire as bL,reactDom as bM,Transition$1 as bN,_defineProperty$x as bO,__awaiter$e as bP,__generator$2 as bQ,__spread as bR,React5 as bS,TransitionGroup$1 as bT,connect$1 as bU,Bookmark as bV,EngineFlagIcons as bW,createAsyncThunk as bX,withStyles as bY,getConfigModule as bZ,getAuthModule as b_,Table$1 as ba,TableHead$1 as bb,TableRow$1 as bc,TableCell$1 as bd,TableSortLabel$1 as be,TableBody$1 as bf,img$i as bg,default_1 as bh,ClickAwayListener as bi,Fade$1 as bj,img$u as bk,img$r as bl,img$S as bm,img$E as bn,DialogTitle$1 as bo,DialogContent$1 as bp,DialogActions$1 as bq,Snackbar$1 as br,default_1$6 as bs,Search$1 as bt,img$k as bu,img$m as bv,img$W as bw,Tabs$2 as bx,Tab$2 as by,deleteEngine as bz,Paper$1 as c,Edit as c$,AIWareCacheProvider as c0,img$T as c1,img$f as c2,img$e as c3,isEmpty_1 as c4,Backdrop$1 as c5,getDefaultMiddleware as c6,isNil_1 as c7,UpDown as c8,Icon$1 as c9,_toPropertyKey as cA,_inheritsLoose$2 as cB,hoistNonReactStatics_cjs as cC,commonjsGlobal$2 as cD,combineReducers as cE,createSelector$1 as cF,fork as cG,statusPill as cH,AIWareThemeProvider$1 as cI,LocalizationProvider as cJ,AdapterDateFns as cK,CalendarPicker as cL,Stack$4 as cM,Close$1 as cN,FullscreenExit as cO,Fullscreen as cP,TabPanel as cQ,default_1$8 as cR,unmountPanel$1 as cS,AvailableComponents as cT,delay$1 as cU,hidePanel$1 as cV,mountPanel$1 as cW,DialogContentText$1 as cX,userSelector$2 as cY,MoreVert$1 as cZ,Menu$1 as c_,get_1 as ca,map_1 as cb,keys_1 as cc,RadioGroup$1 as cd,Avatar$1 as ce,img$y as cf,baseGraphQLApi as cg,FormHelperText$2 as ch,img$h as ci,StyledEngineProvider as cj,ThemeProvider as ck,lightTheme$1 as cl,CssBaseline as cm,Hide as cn,has_1 as co,showMessage as cp,MessageSeverity as cq,Radio$2 as cr,createSvgIcon$2 as cs,_createCompounder as ct,_baseIteratee as cu,isArrayLike_1 as cv,toInteger_1 as cw,_typeof$D as cx,_assertThisInitialized$x as cy,_setPrototypeOf$z as cz,capitalize$2 as d,_baseEach as d$,Upload as d0,Delete$1 as d1,CustomTabs as d2,useBackupImg as d3,img$1B as d4,validate as d5,configSelector as d6,baseGraphQLApiWithError as d7,VerifiedFilled as d8,Add as d9,channel$2 as dA,useIntl as dB,VideoCamera as dC,Image$1 as dD,Sound as dE,Description as dF,toNumber_1 as dG,ProgressStepper as dH,size_1 as dI,take as dJ,CurlyBraces as dK,UnknownDocument as dL,VariableSizeList as dM,sdkEventManager as dN,SdkEvents as dO,SdkError as dP,EngineClassIcons as dQ,Mode2 as dR,EngineModeIcons as dS,DeploymentModelIcons as dT,guid as dU,EditList as dV,ButtonBase$1 as dW,isObject_1 as dX,_arrayMap as dY,_Symbol as dZ,isArguments_1 as d_,ExpandLess$1 as da,ExpandMore$1 as db,Collapse$1 as dc,img$18 as dd,Filter$1 as de,DynamicTable as df,useTheme$3 as dg,getThemeProps as dh,useEnhancedEffect$3 as di,React as dj,_arrayPush as dk,isArray_1 as dl,_baseToString as dm,_baseTrim as dn,_castSlice as dp,_stringToArray as dq,toString_1 as dr,ReactIs as ds,upperFirst_1 as dt,isString_1 as du,_baseGet as dv,_baseSlice as dw,_castPath as dx,_toKey as dy,_isIndex as dz,_objectWithoutPropertiesLoose$2 as e,MenuList$1 as e$,_arrayFilter as e0,_getNative as e1,eq_1 as e2,_root as e3,_Uint8Array as e4,_overArg as e5,_isPrototype as e6,isObjectLike_1 as e7,_baseGetTag as e8,_arrayLikeKeys as e9,useSlotProps as eA,_arraySome as eB,EntityType as eC,generateState as eD,injectIntl as eE,ErrorBoundary$1 as eF,EPermissionAction as eG,Process as eH,Information as eI,Download as eJ,NewFolder as eK,SpecialFolder as eL,User as eM,Source as eN,Search$2 as eO,selectIsOLPEnabled as eP,ListItemSecondaryAction$1 as eQ,getLibraryModule as eR,cmsUrlSelector as eS,debounce_1 as eT,SearchStructuredData as eU,Grow$1 as eV,index as eW,actions as eX,hasPermission as eY,UserAddFilled as eZ,Popover$1 as e_,isBuffer$4 as ea,isFunction_1 as eb,isTypedArray_1 as ec,_Stack as ed,_baseFor as ee,identity_1 as ef,_isIterateeCall as eg,isSymbol_1 as eh,_baseMap as ei,_baseUnary as ej,_Set as ek,_setToArray as el,_SetCache as em,_cacheHas as en,img$P as eo,img$O as ep,img$1x as eq,img$1w as er,img$1v as es,img$M as et,img$1z as eu,img$L as ev,authSelector as ew,ListItemAvatar$1 as ex,takeEvery$1 as ey,emphasize as ez,clsx as f,ConfirmationModal as f$,MoveFolder as f0,EAuthResourceType as f1,Slide$1 as f2,img$b as f3,selectApiConfigs$2 as f4,selectPanelByPanelName as f5,FullScreenContainer as f6,EngineCategoryIcons as f7,isPermissionLoading as f8,Settings$2 as f9,img$A as fA,Undefined as fB,PodcastSource as fC,YoutubeSource as fD,TVSource as fE,RadioSource as fF,selectOrgId as fG,navSectionStyles as fH,selectIsUserAdmin as fI,AvatarGroup$1 as fJ,index$1 as fK,ErrorState$2 as fL,Stepper$1 as fM,StepConnector$1 as fN,Step$1 as fO,StepLabel$1 as fP,isEqual_1 as fQ,NullState$2 as fR,Group as fS,PermissionChangedAction as fT,Lock as fU,useOrganizationPermissions as fV,EAuthSubResourceType as fW,AddGroup as fX,initialConfigSelector as fY,EMessageTypes as fZ,errors as f_,Hamburger as fa,List as fb,enginesFilter as fc,panelsSelector as fd,Badge$1 as fe,MoreHor as ff,convertEntityToAuthResource as fg,AutoSizer as fh,InfiniteLoader as fi,FixedSizeList as fj,selectUserOrgEdgeVersion as fk,EditAttributes as fl,gqlIntrospection as fm,ProcessingDetail as fn,img$x as fo,img$z as fp,img$5 as fq,FilterRemove as fr,AlarmTwo as fs,tableInfiniteScroll as ft,CheckCircle as fu,FolderOpen as fv,Voice as fw,useDoubleClick as fx,FolderFilled as fy,Time as fz,generateUtilityClass as g,statusFilter as g$,EnumHelpers as g0,formatBytes as g1,LinearProgress$1 as g2,NotInterested as g3,mountPanelForResponse$1 as g4,default_1$9 as g5,tableStyles as g6,ArrowDown as g7,ArrowUp as g8,useInterval as g9,Slider$1 as gA,getDefaultExportFromCjs as gB,_getSymbols as gC,stubArray_1 as gD,_baseGetAllKeys as gE,_getTag as gF,_nodeUtil as gG,_getAllKeys as gH,_castFunction as gI,Article as gJ,Task as gK,View as gL,_objectSpread2 as gM,serialize as gN,stringify$2 as gO,compile as gP,isNumber_1 as gQ,Check as gR,EngineIconsRenderer as gS,FormattedRelativeTime$1 as gT,BottomQueue as gU,TopQueue as gV,Pause as gW,Cancel as gX,Folder as gY,Hidden as gZ,dateRangeFilter as g_,Iam as ga,safeFormatMessage as gb,contextMenuStyles as gc,Users as gd,SecurityGroup as ge,getOrganizationPanelModule as gf,Lock2 as gg,EApplicationConfigLevel as gh,NoApps as gi,EApplicationConfigType as gj,green$1 as gk,md5 as gl,selectIsSuperAdmin as gm,organizations_selector as gn,actions$5 as go,AddUser as gp,selectors as gq,LibraryDropdown as gr,Remove as gs,Save as gt,Input$3 as gu,getElement as gv,client$1 as gw,Copy as gx,ArrowForward as gy,Modal$1 as gz,composeClasses as h,TableLoadingState as h0,setDuration as h1,resetDuration as h2,createStack as h3,toFinite_1 as h4,_baseForOwn as h5,_arrayReduce as h6,hasIn_1 as h7,now_1 as h8,useSyncExternalStoreExports as h9,registry as hA,registerComponent as hB,AvailableWidgets as hC,updatePanelMicroFrontendProps as hD,setData as hE,root as hF,mountWidget as hG,unmountWidget as hH,mountPanel as hI,unmountPanel as hJ,hidePanel as hK,unmountAllPanel as hL,init as hM,aiwareEvents as hN,Engines as ha,EngineComponentLoader as hb,imageUpload as hc,characterCountTextField as hd,tabsClasses$1 as he,Packages as hf,Resources$1 as hg,selectUserCanCreatePackage as hh,PackagesAvatar as hi,actionChannel as hj,cancelled as hk,flush$4 as hl,cancel as hm,tableSearchComponents as hn,FlowTemplate as ho,Node as hp,Palette as hq,FlowCenter2 as hr,ArrowBack as hs,Schema as ht,panelComponents as hu,img$4 as hv,img$w as hw,Clear as hx,ExpandLess as hy,ExpandMore as hz,createSvgIcon$1 as i,jsxRuntime as j,interopRequireDefault as k,createSlice as l,makeStyles as m,Route as n,useDispatch as o,useSelector as p,authStatusSelector as q,react$1 as r,store$5 as s,authContextSelector as t,useThemeProps as u,AuthContext as v,lodash as w,Alert$1 as x,betaFeaturesSelector as y,useNavigate as z};
|
package/js-core.esm.js.gz
CHANGED
|
Binary file
|
package/js-core.esm48.js
CHANGED
|
@@ -108,4 +108,4 @@ import{l as createSlice,w as lodash,cE as combineReducers,cF as createSelector,a
|
|
|
108
108
|
...applicationFields
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
|
-
`;return yield baseGraphQLApiWithError(Object.assign({query:t,variables:{input:a},operationName:e},s))}),deleteApp$1=(t,s)=>__awaiter(void 0,void 0,void 0,function*(){var e="deleteApplication";return yield baseGraphQLApiWithError(Object.assign({query:"\n mutation deleteApplication ($id: ID!) {\n deleteApplication(id: $id) {\n id\n message\n }\n }\n ",variables:{id:s},operationName:e},t))}),selectUIStateStatus=e=>e[namespace].uiState.status,selectApps=e=>e[namespace].apps[AppType.Apps],selectQueryOptions=e=>e[namespace].apps[AppType.QueryOptions],selectTotalAppsInQuery=e=>e[namespace].apps[AppType.TotalAppsInQuery],selectFilters=e=>e[namespace]?e[namespace].filterState.filter:{},selectApiConfigs=createSelector([rootApiSelector,graphEndpointSelector,sessionTokenSelector],(e,t,s)=>({apiRoot:e,graphQLEndpoint:t,token:s})),APP_CENTER_TEXT={cancel:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"ac.st.cancel",defaultMessage:"Cancel",description:"Cancel"}),delete:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"ac.st.delete",defaultMessage:"Delete",description:"Delete"}),close:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"ac.st.close",defaultMessage:"CLOSE",description:"Close"}),closePanel:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"ac.st.closePanel",defaultMessage:"Close Panel",description:"Close Panel"}),deleteApp:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"ac.st.deleteApp",defaultMessage:"Delete Application",description:"Delete Application"}),editApp:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"ac.st.editApp",defaultMessage:"Edit Application",description:"Edit Application"}),appDetails:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"ac.st.appDetails",defaultMessage:"Application Details",description:"Application Details"})},ConfirmDelete=({open:e,appName:t,testName:s,handleCloseConfirmDelete:a,handleConfirmDelete:i})=>jsxRuntime.exports.jsxs(Dialog,Object.assign({"data-test":s,open:e,onClose:a,maxWidth:"xs","aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description"},{children:[jsxRuntime.exports.jsx(DialogTitle,Object.assign({id:"alert-dialog-title"},{children:jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h3"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-browse.app-list-row.delete-confirmation-title",defaultMessage:"Confirm Delete",description:"Title of the delete app confirmation modal"})}))})),jsxRuntime.exports.jsx(DialogContent,{children:jsxRuntime.exports.jsx(DialogContentText,Object.assign({id:"alert-dialog-description"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-browse.app-list-row.delete-confirmation-message",defaultMessage:"Are you sure you want to delete {appName}? This action can not be undone.",description:"This message is show when prompting the user to confirm the delete of an app from the apps list",values:{appName:t}})}))}),jsxRuntime.exports.jsxs(DialogActions,{children:[jsxRuntime.exports.jsx(Button,Object.assign({color:"secondary",onClick:a},{children:APP_CENTER_TEXT.cancel()})),jsxRuntime.exports.jsx(Button,Object.assign({variant:"contained",onClick:i,autoFocus:!0},{children:APP_CENTER_TEXT.delete()}))]})]})),useStyles$7=makeStyles()(e=>({panelRoot:{width:"100%"},panelContainer:{display:"flex",flexDirection:"column",width:"100%",padding:e.spacing(2)},panelHeader:{display:"flex",justifyContent:"space-between",alignItems:"center",paddingLeft:e.spacing(1),marginBottom:e.spacing(1),"&.with-secondary-title":{alignItems:"flex-start"}},panelBody:{display:"flex",flexGrow:1},divider:{marginBottom:e.spacing(2)},appHeader:{minHeight:"120px"},headerInfo:{paddingLeft:e.spacing(4)},appInfo:{paddingTop:e.spacing(6)},appInfoBody:{paddingLeft:e.spacing(4),paddingTop:e.spacing(3)},appOverview:{paddingTop:e.spacing(6),bottom:e.spacing(6),minHeight:"120px"},sectionTitle:{paddingBottom:e.spacing(3)},textContent:{fontStyle:"normal",fontWeight:400,fontSize:14,lineHeight:20},titleInline:{fontWeight:600,marginRight:e.spacing(1)},contentRow:{paddingBottom:e.spacing(3)},appDescription:{paddingTop:e.spacing(2),paddingBottom:e.spacing(2)},appVersion:{paddingLeft:e.spacing(3)},appMainLayout:{paddingTop:e.spacing(2)},appTabPanels:{width:"100%"},appContainer:{paddingLeft:e.spacing(3),paddingTop:e.spacing(2)}})),visuallyHidden={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:-1,overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"};var visuallyHidden$1=visuallyHidden;const PanelHeader=({appId:e})=>{const t=useDispatch();var s=useStyles$7()["classes"];const[a,i]=react.exports.useState(null);var n=()=>{i(null)};return jsxRuntime.exports.jsxs("div",Object.assign({className:classNames(s.panelHeader)},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({"data-test":"app-details-action-panel-title",variant:"h1"},{children:APP_CENTER_TEXT.appDetails()})),jsxRuntime.exports.jsx(Typography,Object.assign({style:visuallyHidden$1,id:"app-details-close-action"},{children:APP_CENTER_TEXT.closePanel()})),jsxRuntime.exports.jsxs("div",{children:[jsxRuntime.exports.jsx(IconButton,Object.assign({"aria-label":"more options",onClick:e=>{i(e.currentTarget)},"data-test":"app-details-actions-button",size:"large"},{children:jsxRuntime.exports.jsx(MoreVert,{})})),jsxRuntime.exports.jsx(Tooltip,Object.assign({title:APP_CENTER_TEXT.closePanel()},{children:jsxRuntime.exports.jsx(IconButton,Object.assign({onClick:()=>{t(hidePanel("APPLICATION_DETAILS_PANEL"))},"aria-labelledby":"app-details-close-action","data-test":"app-details-close-action",size:"large"},{children:jsxRuntime.exports.jsx(Hide,{})}))}))]}),jsxRuntime.exports.jsxs(Menu,Object.assign({anchorEl:a,open:Boolean(a),onClose:n,onBlur:n,"data-test":"app-details-action-panel-menu"},{children:[jsxRuntime.exports.jsxs(MenuItem,Object.assign({onClick:()=>{t(actions.uiState.toggleEditApp(e))}},{children:[jsxRuntime.exports.jsx(ListItemIcon,{children:jsxRuntime.exports.jsx(Edit,{fontSize:"small"})}),jsxRuntime.exports.jsx(Typography,Object.assign({variant:"inherit",noWrap:!0,"data-test":"app-details-action-panel-menu-btn-edit-app"},{children:APP_CENTER_TEXT.editApp()}))]})),jsxRuntime.exports.jsx(Divider,{}),jsxRuntime.exports.jsxs(MenuItem,Object.assign({onClick:()=>{t(actions.uiState.confirmDeleteApp({id:e}))}},{children:[jsxRuntime.exports.jsx(ListItemIcon,{children:jsxRuntime.exports.jsx(Delete,{fontSize:"small"})}),jsxRuntime.exports.jsx(Typography,Object.assign({variant:"inherit",noWrap:!0,"data-test":"app-details-action-panel-menu-btn-delete"},{children:APP_CENTER_TEXT.deleteApp()}))]}))]}))]}))};function*fetchApplications(){var e=yield select(selectApiConfigs),t=yield select(preferredLanguageSelector),t=AIWareFormatMessage(t);if(e)try{yield put(actions.uiState.fetchingApps());var s=yield call(getApplications,e);yield put(actions.apps.appsFetchSucceeded(s)),yield put(actions.uiState.fetchingDone())}catch(e){yield put(showMessage({content:t({id:"os-app-center-browse.get-all-applications-fail",defaultMessage:[{type:0,value:"Fetching applications failed"}]}),severity:MessageSeverity.Error})),yield put(actions.uiState.fetchingFailed())}}function*fetchFilterApplications(e){yield delay(650);var{page:t,limit:s,orderBy:a}=yield select(selectQueryOptions);if("appCenterBrowse/filterState/setFilters"===e.type&&1!==t)yield put(actions.apps.setQueryOptions({page:1,limit:s,orderBy:a}));else{var e=yield select(selectFilters),i={},e=(lodash.exports.isEmpty(e.name)||(i.name=e.name),lodash.exports.isEmpty(e.status)||(i.status=e.status),lodash.exports.isEmpty(e.entityTags)||(i.entityTags=lodash.exports.map(e.entityTags,e=>({key:e.tagKey}))),e.created.isSearch&&(i.dateTimeFilter=[{field:"createdDateTime",fromDateTime:e.created.startDate,toDateTime:e.created.endDate}]),e.lastUpdated.isSearch&&(i.dateTimeFilter=[...i.dateTimeFilter||[],{field:"modifiedDateTime",fromDateTime:e.lastUpdated.startDate,toDateTime:e.lastUpdated.endDate}]),{page:t,limit:s,orderBy:a,filter:i}),t=yield select(selectApiConfigs),s=yield select(preferredLanguageSelector),a=AIWareFormatMessage(s);if(t)try{yield put(actions.uiState.fetchingApps());var n=yield call(getApplicationsWithFilter,t,e);yield put(actions.apps.appsFetchSucceeded(n)),yield put(actions.uiState.fetchingDone())}catch(e){yield put(showMessage({content:a({id:"os-app-center-browse.get-all-applications-fail",defaultMessage:[{type:0,value:"Fetching applications failed"}]}),severity:MessageSeverity.Error})),yield put(actions.uiState.fetchingFailed())}}}function*mutateAppWorkflow(t){var t=t["payload"],s=yield select(selectApiConfigs),a=yield select(preferredLanguageSelector),a=AIWareFormatMessage(a);if(s)try{var e=(yield call(applicationWorkflow,s,t)).applicationWorkflow;yield put(actions.apps.mutateApplicationWorkflowSuccess(e)),yield put(showMessage({content:a({id:"os-app-center-browse.snackbar.appSuccessAction",defaultMessage:[{type:0,value:"App successfully "},{type:1,value:"action"},{type:0,value:"d"}]},{action:t.action}),severity:MessageSeverity.Success}))}catch(e){yield put(showMessage({content:a({id:"os-app-center-browse.snackbar.appFailedAction",defaultMessage:[{type:0,value:"App failed to "},{type:1,value:"action"}]},{action:t.action}),severity:MessageSeverity.Error}));try{var i=yield call(getApplication,s,t.id);yield put(actions.apps.refreshAppStateSuccess(i))}catch(e){yield put(actions.uiState.fetchingFailed())}}}function*deleteApp(t){var t=t["payload"],s=yield select(selectApiConfigs),a=yield select(preferredLanguageSelector),a=AIWareFormatMessage(a);if(s)try{yield call(deleteApp$1,s,t.id),yield put(showMessage({content:a({id:"os-app-center-browse.snackbar.app-delete-success",defaultMessage:[{type:0,value:"App successfully deleted"}]}),severity:MessageSeverity.Success})),yield put(actions.apps.deleteAppSuccess(t))}catch(e){yield put(showMessage({content:a({id:"os-app-center-browse.snackbar.app-delete-fail",defaultMessage:[{type:0,value:"App failed to be deleted"}]}),severity:MessageSeverity.Error}));try{var i=yield call(getApplication,s,t.id);yield put(actions.apps.deleteAppFailed(i))}catch(e){yield put(actions.uiState.fetchingFailed())}}}function*toggleAppDetails(e){e=e.payload;if(!e)return yield put(hidePanel("APP_CENTER_DETAILS"));e={name:"APPLICATION_DETAILS_PANEL",config:{name:"Application Details",applicationId:e.id,disableInstallFeature:!0,headerComponent:jsxRuntime.exports.jsx(PanelHeader,{appId:e.id}),appIsOwned:!0}};yield put(mountPanel({panelId:"APPLICATION_DETAILS_PANEL",microFrontend:e,panelConfig:{type:"APP_BAR_PANEL_TEMPLATE",marginTop:55,marginStart:0,size:"xlarge",zIndex:1001}}))}function*toggleEditApp(e){e=e.payload;if(!e)return yield put(hidePanel("APP_CENTER_DETAILS"));yield put(mountPanel({panelId:"APP_CENTER_NEW",microFrontend:{name:"APP_CENTER_NEW",config:{name:"Edit app",appId:e}},panelConfig:{type:"APP_BAR_PANEL_TEMPLATE",header:{title:"Edit app",divider:!0},marginTop:55,size:"xlarge",zIndex:1002}})),yield put(hidePanel("APPLICATION_DETAILS_PANEL"))}const rootHash={};function*confirmDeleteApp(e){const t=e["payload"];t.closeModal?(rootHash.confirmDeleteRoot.unmount(),delete rootHash.confirmDeleteRoot):(yield select(selectApiConfigs))&&((e=getElement("confirm-delete-root")).classList.add("aiware-el"),e=client.createRoot(e),(rootHash.confirmDeleteRoot=e).render(jsxRuntime.exports.jsx(AIWareCacheProvider,{children:jsxRuntime.exports.jsx(AIWareThemeProvider,{children:jsxRuntime.exports.jsx(Provider,Object.assign({store:store},{children:jsxRuntime.exports.jsx(AIWareIntlProvider,{children:jsxRuntime.exports.jsx(ConfirmDelete,{open:!t.closeModal,appName:t.name||"this application",testName:"application-details-panel.delete-confirmation-modal",handleCloseConfirmDelete:()=>__awaiter(this,void 0,void 0,function*(){return yield store.dispatch(actions.uiState.confirmDeleteApp({id:t.id,closeModal:!0}))}),handleConfirmDelete:()=>__awaiter(this,void 0,void 0,function*(){yield store.dispatch(actions.apps.deleteApp({id:t.id})),yield store.dispatch(actions.uiState.confirmDeleteApp({id:t.id,closeModal:!0})),yield store.dispatch(hidePanel("APPLICATION_DETAILS_PANEL"))})})})}))})})))}function*watchFetchApp(){yield takeLatest$1([actions.uiState.initApps.type],fetchApplications)}function*watchSetFilters(){yield takeLatest$1(actions.filterState.setFilters.type,fetchFilterApplications)}function*watchSetQueryOptions(){yield takeLatest$1(actions.apps.setQueryOptions.type,fetchFilterApplications)}function*watchAppWorkflow(){yield takeLatest$1(actions.apps.mutateApplicationWorkflow.type,mutateAppWorkflow)}function*watchDeleteApp(){yield takeLatest$1(actions.apps.deleteApp.type,deleteApp)}function*watchToggleAppDetails(){yield takeLatest$1(actions.uiState.toggleAppDetails.type,toggleAppDetails)}function*watchToggleEditApp(){yield takeLatest$1(actions.uiState.toggleEditApp.type,toggleEditApp)}function*watchconfirmDeleteApp(){yield takeLatest$1(actions.uiState.confirmDeleteApp.type,confirmDeleteApp)}const appSagas=[fork(watchSetFilters),fork(watchSetQueryOptions),fork(watchFetchApp),fork(watchAppWorkflow),fork(watchDeleteApp),fork(watchToggleAppDetails),fork(watchToggleEditApp),fork(watchconfirmDeleteApp)];function*rootSaga(){yield all([...appSagas])}function getAppCenterBrowseModule(){return{id:SLICE_NAME,reducerMap:{[SLICE_NAME]:rootReducer},sagas:[rootSaga],initialActions:[]}}const useStyles$6=makeStyles()(e=>({container:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:e.spacing(4),width:"100%",padding:e.spacing(6)},imgContainer:{display:"flex",justifyContent:"center",alignItems:"center",padding:e.spacing(4),border:"20px solid #C2C6CF",borderRadius:"50%",overflow:"hidden",width:350,aspectRatio:"1 / 1",opacity:.25},logo:{width:"70%",height:"70%",objectFit:"contain"},tableContainer:{overflowX:"initial"},table:{"& td":{verticalAlign:"middle",fontWeight:600}},paginationContainer:{display:"flex",justifyContent:"flex-end",alignItems:"center",gap:e.spacing(3),padding:e.spacing(3)},noResultsContainer:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"}})),mountAppCenterNew=e=>{e(mountPanel({panelId:"APP_CENTER_NEW",microFrontend:{name:"APP_CENTER_NEW",config:{name:"New App Onboarding"}},panelConfig:{type:"APP_BAR_PANEL_TEMPLATE",header:{title:"New App Onboarding",divider:!0},marginTop:55,size:"xlarge",zIndex:1e3}}))},useStyles$5=makeStyles()(e=>({header:{alignItems:"center",display:"flex",zIndex:10,width:"100%",background:"#fff"},marginRight:{marginRight:e.spacing(2)},headerActionContainer:{alignItems:"center",display:"flex",flexGrow:1,height:"100%",justifyContent:"flex-end"}})),Header=()=>{var e=useStyles$5()["classes"];const t=useDispatch();var s=()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-browse.BbPEYs",defaultMessage:"Filter",description:"button to open up a filter panel for apps"});return jsxRuntime.exports.jsxs("header",Object.assign({className:e.header,"data-test":"app-center-browse-header"},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h1","data-test":"app-center-browse-title"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-browse.3G70xl",defaultMessage:"Applications",description:"Header Title for Apps Table"})})),jsxRuntime.exports.jsxs("div",Object.assign({className:e.headerActionContainer},{children:[jsxRuntime.exports.jsx(Button,Object.assign({className:e.marginRight,onClick:()=>{mountAppCenterNew(t)},color:"primary",variant:"contained","data-test":"app-center-browse-add-new"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-browse.TuUJVi",defaultMessage:"Add New",description:"Label of a button that allows user to create a new app"})})),jsxRuntime.exports.jsx(Typography,Object.assign({style:visuallyHidden$1,id:"app-center-browse-filter-panel"},{children:jsxRuntime.exports.jsx(s,{})})),jsxRuntime.exports.jsx(Tooltip,Object.assign({title:jsxRuntime.exports.jsx(s,{})},{children:jsxRuntime.exports.jsx(IconButton,Object.assign({onClick:()=>{t(mountPanel({panelId:"APP_CENTER_FILTER",microFrontend:{name:"APP_CENTER_FILTER",config:{name:"App Filter"}},panelConfig:{type:"APP_BAR_PANEL_TEMPLATE",header:{title:"App Filter",divider:!0},marginTop:55,size:"small",zIndex:1e3}}))},"aria-labelledby":"app-center-browse-filter-panel","data-test":"app-center-browse-filter-panel",size:"large"},{children:jsxRuntime.exports.jsx(Filter,{})}))}))]}))]}))},useStyles$4=makeStyles()(e=>({appListHeader:{position:"sticky",top:0,background:"#fff",zIndex:20},appHeaderCell:{padding:"10px 20px 10px 20px"}})),AppsListTableHeader=()=>{const a=useDispatch(),i=useStyles$4()["classes"],n=useSelector(selectQueryOptions)["orderBy"];return jsxRuntime.exports.jsxs(TableHead,Object.assign({className:i.appListHeader},{children:[jsxRuntime.exports.jsx(TableRow,{children:jsxRuntime.exports.jsx(TableCell,Object.assign({className:i.appHeaderCell,colSpan:10},{children:jsxRuntime.exports.jsx(Header,{})}))}),jsxRuntime.exports.jsxs(TableRow,{children:[jsxRuntime.exports.jsx(TableCell,{}),lodash.exports.map([{id:"name",label:"Application Name"},{id:"status",label:"Status"},{id:"url",label:"URL"},{id:"createdDateTime",label:"Date Created"},{id:"modifiedDateTime",label:"Last Modified"}],e=>{var t,s;return jsxRuntime.exports.jsx(TableCell,Object.assign({className:i.appHeaderCell,"data-test":"apps-list-table-header-app-"+e.label,sortDirection:(null==(t=n[0])?void 0:t.field)===e.id&&n[0].direction},{children:jsxRuntime.exports.jsx(TableSortLabel,Object.assign({active:(null==(t=n[0])?void 0:t.field)===e.id,direction:(null==(t=n[0])?void 0:t.field)===e.id?null==(t=n[0])?void 0:t.direction:"asc",onClick:(s=e.id,()=>{let e="asc";var t=(null==(t=n[0])?void 0:t.field)===s&&n[0].direction;t&&"asc"===t&&(e="desc"),a(actions.apps.setQueryOptions({orderBy:[{field:s,direction:e}],page:1}))})},{children:e.label}))}),e.id)}),jsxRuntime.exports.jsx(TableCell,{})]})]}))},AppRowSkeleton=()=>jsxRuntime.exports.jsxs(TableRow,Object.assign({hover:!0},{children:[jsxRuntime.exports.jsx(TableCell,Object.assign({style:{paddingRight:0}},{children:jsxRuntime.exports.jsx(Skeleton,{animation:"wave",variant:"circular",width:28,height:28})})),jsxRuntime.exports.jsx(TableCell,{children:jsxRuntime.exports.jsx(Skeleton,{animation:"wave",variant:"rectangular",height:22,width:400})}),jsxRuntime.exports.jsx(TableCell,{children:jsxRuntime.exports.jsx(Skeleton,{animation:"wave",variant:"rectangular",height:22})}),jsxRuntime.exports.jsx(TableCell,{children:jsxRuntime.exports.jsx(Skeleton,{animation:"wave",variant:"rectangular",height:22})}),jsxRuntime.exports.jsx(TableCell,{children:jsxRuntime.exports.jsx(Skeleton,{animation:"wave",variant:"rectangular",height:22})}),jsxRuntime.exports.jsx(TableCell,{children:jsxRuntime.exports.jsx(Skeleton,{animation:"wave",variant:"rectangular",height:22})}),jsxRuntime.exports.jsx(TableCell,{})]})),formatDate=e=>{return e?(e=new Date(e)).toLocaleDateString()+" "+e.toLocaleTimeString("en-US",{hour:"numeric",minute:"numeric",hour12:!0}):"--/--/-- --:-- --"},useStyles$3=makeStyles()(e=>({root:{borderRadius:"50%",border:"2px solid #D5DFE9",display:"flex",justifyContent:"center",alignItems:"center",overflow:"hidden"},small:{width:e.spacing(6),height:e.spacing(6)},medium:{width:e.spacing(9),height:e.spacing(9)},large:{width:e.spacing(12),height:e.spacing(12)},xlarge:{width:e.spacing(16),height:e.spacing(16)},logo:{maxWidth:"100%",maxHeight:"100%"},veritoneLogo:{maxWidth:"75%",maxHeight:"75%"}})),CircledLogo=({size:e="medium",path:t,altText:s=""})=>{var a=useStyles$3()["classes"],[t,i]=useBackupImg(t,img$1B);return jsxRuntime.exports.jsx("div",Object.assign({className:a.root+" "+a[e]},{children:jsxRuntime.exports.jsx("img",{className:a.logo+" "+(t==img$1B&&a.veritoneLogo),src:t,alt:s,onError:i})}))},StatusPill=statusPill["jsx"],useStyles$2=makeStyles()(e=>({iconCell:{width:50,paddingRight:0},truncateText:{display:"block",maxWidth:"220px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}})),AppsListRow=({app:a})=>{const[e,i]=react.exports.useState(null),[t,n]=react.exports.useState(!1),o=useDispatch();var s=useStyles$2()["classes"];return jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment,{children:[jsxRuntime.exports.jsxs(TableRow,Object.assign({onClick:()=>{"deleted"!==a.status&&o(actions.uiState.toggleAppDetails({id:a.id,name:a.name}))},style:{cursor:"deleted"!==a.status&&"pointer"},hover:!0,"data-test":"apps-list-table-row","data-test-app-id":a.id},{children:[jsxRuntime.exports.jsx(TableCell,Object.assign({className:s.iconCell},{children:jsxRuntime.exports.jsx(CircledLogo,{size:"small",path:a.signedIconUrl,altText:a.name+" Logo"})})),jsxRuntime.exports.jsx(TableCell,{children:a.name}),jsxRuntime.exports.jsx(TableCell,{children:jsxRuntime.exports.jsx(StatusPill,{statusType:"application",status:a.status})}),jsxRuntime.exports.jsx(TableCell,{children:jsxRuntime.exports.jsx("div",Object.assign({className:s.truncateText},{children:a.url}))}),jsxRuntime.exports.jsx(TableCell,{children:formatDate(a.createdDateTime)}),jsxRuntime.exports.jsx(TableCell,{children:formatDate(a.modifiedDateTime)}),jsxRuntime.exports.jsx(TableCell,{children:jsxRuntime.exports.jsx(IconButton,Object.assign({disabled:"deleted"===a.status,"aria-label":"more options",onClick:e=>{i(e.currentTarget),e.stopPropagation()},"data-test":"app-row-action-trigger",size:"large"},{children:jsxRuntime.exports.jsx(MoreVert,{})}))}),jsxRuntime.exports.jsx(Menu,Object.assign({anchorEl:e,open:Boolean(e),onClose:()=>{i(null)}},{children:!lodash.exports.isEmpty(a.validStateActions)&&lodash.exports.map(a.validStateActions,s=>jsxRuntime.exports.jsx(MenuItem,Object.assign({onClick:e=>{return t=s,e.stopPropagation(),"enable"!==t&&"disable"!==t&&"approve"!==t&&"deploy"!==t&&"reject"!==t&&"submit"!==t||o(actions.apps.mutateApplicationWorkflow({id:a.id,action:t})),"delete"===t&&n(!0),"edit"===t&&o(actions.uiState.toggleEditApp(a.id)),void i(null);var t},"data-test":"app-row-action-button-"+s},{children:s}),s))}))]})),jsxRuntime.exports.jsx(ConfirmDelete,{open:t,appName:a.name,testName:"os-app-center-browse.app-list-row.delete-confirmation-modal",handleCloseConfirmDelete:()=>{n(!1)},handleConfirmDelete:()=>{o(actions.apps.deleteApp({id:a.id})),n(!1)}})]})},NoResults=()=>{var e=useStyles$6()["classes"];const t=useDispatch();return jsxRuntime.exports.jsxs("div",Object.assign({className:e.container},{children:[jsxRuntime.exports.jsx("div",Object.assign({className:e.imgContainer},{children:jsxRuntime.exports.jsx("img",{className:e.logo,src:img$1B,alt:"Veritone Logo"})})),jsxRuntime.exports.jsx("h2",Object.assign({"data-test":"ac-browse-no-results-title"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"applicationsListTable.noResults.message",defaultMessage:"No applications found...",description:"No results found message"})})),jsxRuntime.exports.jsx(Button,Object.assign({className:"test-class",variant:"contained",size:"large",onClick:()=>mountAppCenterNew(t),startIcon:jsxRuntime.exports.jsx(Add,{})},{children:"Add New"}))]}))},AppsListTable=({baseRedirectUrl:t})=>{var e=useStyles$6()["classes"],s=useSelector(selectUIStateStatus);const a=useSelector(selectApps),i=useSelector(selectQueryOptions);var n=useSelector(selectTotalAppsInQuery);const o=useDispatch();return jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment,{children:[jsxRuntime.exports.jsx(TableContainer,Object.assign({className:e.tableContainer},{children:jsxRuntime.exports.jsxs(Table,Object.assign({className:e.table,stickyHeader:!0},{children:[jsxRuntime.exports.jsx(AppsListTableHeader,{}),jsxRuntime.exports.jsxs(TableBody,{children:["pending"===s?lodash.exports.times(10,()=>jsxRuntime.exports.jsx(AppRowSkeleton,{},Math.random())):lodash.exports.map(lodash.exports.keys(a),e=>jsxRuntime.exports.jsx(AppsListRow,{baseRedirectUrl:t,app:a[e]},e)),jsxRuntime.exports.jsx("div",Object.assign({className:e.noResultsContainer},{children:"pending"!==s&&lodash.exports.isEmpty(a)&&jsxRuntime.exports.jsx(NoResults,{})}))]})]}))})),!!n&&jsxRuntime.exports.jsxs("div",Object.assign({className:e.paginationContainer},{children:[jsxRuntime.exports.jsx(Typography,{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-browse.sCzlFD",defaultMessage:"Rows per page: ",description:"Rows per page"})}),jsxRuntime.exports.jsxs(Select,Object.assign({value:i.limit||10,onChange:e=>{o(actions.apps.setQueryOptions(Object.assign(Object.assign({},i),{limit:e.target.value,page:1})))},"data-test":"apps-list-per-page-select",MenuProps:{style:{zIndex:1500}}},{children:[jsxRuntime.exports.jsx(MenuItem,Object.assign({value:10},{children:"10"})),jsxRuntime.exports.jsx(MenuItem,Object.assign({value:20,"data-test":"apps-list-twenty-per-page"},{children:"20"})),jsxRuntime.exports.jsx(MenuItem,Object.assign({value:30},{children:"30"}))]})),jsxRuntime.exports.jsx(Pagination,{count:Math.ceil(n/i.limit),page:i.page,onChange:(e,t)=>{o(actions.apps.setQueryOptions(Object.assign(Object.assign({},i),{page:t})))}})]}))]})},useStyles$1=makeStyles()(e=>({panel:{width:"100%",height:"100%",overflow:"auto",backgroundColor:e.palette.background.paper}})),MainLayout$1=({baseRedirectUrl:e})=>{var t=useStyles$1()["classes"];return jsxRuntime.exports.jsx("div",Object.assign({role:"presentation","data-test":"app-center-browse-widget",className:t.panel},{children:jsxRuntime.exports.jsx(AppsListTable,{baseRedirectUrl:e})}))};function isDeveloperDomain(){return/^(developer\.(((dev|prod)\.)?([a-zA-Z0-9\-]*\.)?)?veritone\.com|localhost|local\.veritone)/.test(window.location.hostname)}const Content=e=>{const t=useDispatch(),{apiRoot:s,graphQLEndpoint:a,token:i}=useSelector(selectApiConfigs);return react.exports.useEffect(()=>{s&&a&&i&&t(actions.uiState.initApps())},[s,a,i,t]),s&&a&&i?jsxRuntime.exports.jsx(MainLayout$1,Object.assign({},e)):null},AppCenterBrowse=e=>{const s=useDispatch();return react.exports.useEffect(()=>{var e=window.location.pathname.split("/"),t=e[2];"applications"===e[1]&&(validate(t)&&isDeveloperDomain()?s(actions.uiState.toggleAppDetails({id:t})):"overview"===e[2]&&"new"===e[3]&&mountAppCenterNew(s))},[s]),jsxRuntime.exports.jsx(AIWareThemeProvider,{children:jsxRuntime.exports.jsx(DynamicModuleLoader,Object.assign({modules:[getAppCenterBrowseModule()]},{children:jsxRuntime.exports.jsx(AIWareIntlProvider,{children:jsxRuntime.exports.jsx(AIWareCacheProvider,{children:jsxRuntime.exports.jsx(Content,Object.assign({},e))})})}))})},ActionPanel=({onClose:e,onDelete:t,onEdit:s,children:a})=>{var i=useStyles$7()["classes"];const[n,o]=react.exports.useState(null);var r=()=>{o(null)};return jsxRuntime.exports.jsx("div",Object.assign({className:classNames(i.panelRoot),"data-test":"app-details-action-panel"},{children:jsxRuntime.exports.jsxs("div",Object.assign({className:i.panelContainer},{children:[jsxRuntime.exports.jsxs("div",Object.assign({className:classNames(i.panelHeader)},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({"data-test":"app-details-action-panel-title",variant:"h1"},{children:APP_CENTER_TEXT.appDetails()})),jsxRuntime.exports.jsx(Typography,Object.assign({style:visuallyHidden$1,id:"app-details-close-action"},{children:APP_CENTER_TEXT.closePanel()})),jsxRuntime.exports.jsxs("div",{children:[jsxRuntime.exports.jsx(IconButton,Object.assign({"aria-label":"more options",onClick:e=>{o(e.currentTarget)},"data-test":"app-details-actions-button",size:"large"},{children:jsxRuntime.exports.jsx(MoreVert,{})})),jsxRuntime.exports.jsx(Tooltip,Object.assign({title:APP_CENTER_TEXT.closePanel()},{children:jsxRuntime.exports.jsx(IconButton,Object.assign({onClick:e,"aria-labelledby":"app-details-close-action","data-test":"app-details-close-action",size:"large"},{children:jsxRuntime.exports.jsx(Hide,{})}))}))]}),jsxRuntime.exports.jsxs(Menu,Object.assign({anchorEl:n,open:Boolean(n),onClose:r,onBlur:r,"data-test":"app-details-action-panel-menu"},{children:[jsxRuntime.exports.jsxs(MenuItem,Object.assign({onClick:s},{children:[jsxRuntime.exports.jsx(ListItemIcon,{children:jsxRuntime.exports.jsx(Edit,{fontSize:"small"})}),jsxRuntime.exports.jsx(Typography,Object.assign({variant:"inherit",noWrap:!0,"data-test":"app-details-action-panel-menu-btn-edit-app"},{children:APP_CENTER_TEXT.editApp()}))]})),jsxRuntime.exports.jsx(Divider,{}),jsxRuntime.exports.jsxs(MenuItem,Object.assign({onClick:t},{children:[jsxRuntime.exports.jsx(ListItemIcon,{children:jsxRuntime.exports.jsx(Delete,{fontSize:"small"})}),jsxRuntime.exports.jsx(Typography,Object.assign({variant:"inherit",noWrap:!0,"data-test":"app-details-action-panel-menu-btn-delete"},{children:APP_CENTER_TEXT.deleteApp()}))]}))]}))]})),jsxRuntime.exports.jsx(Divider,{className:i.divider}),jsxRuntime.exports.jsx("div",Object.assign({className:i.panelBody},{children:a}))]}))}))},MainLayout=()=>jsxRuntime.exports.jsx("div",{children:"MainLayout"}),AppCenterDetails=({appId:e})=>{const t=useDispatch();return jsxRuntime.exports.jsx(ActionPanel,Object.assign({onClose:()=>{t(hidePanel("APP_CENTER_DETAILS"))},onDelete:()=>{console.log("handleDelete")},onEdit:()=>{console.log("handleEdit")}},{children:e&&jsxRuntime.exports.jsx(Container,Object.assign({style:{width:"100%"},"data-test":"app-details-widget"},{children:jsxRuntime.exports.jsx(MainLayout,{})}))}))},useStyles=makeStyles()(e=>({groupFilterContent:{display:"flex",alignItems:"flex-end"},paper:{height:"100%",padding:5,backgroundColor:"#f5f5f5"},groupFilter:{padding:"20px 10px",borderBottom:"1px solid #ccc"},container:{marginTop:"6px",display:"flex",flexWrap:"wrap",alignItems:"center"},clearFilterIcon:{display:"flex",justifyContent:"center"},textField:{border:"1px solid #f5f5f5",backgroundColor:"#f5f5f5",marginRight:e.spacing(2),outline:"none"},formGroup:{display:"flex",flexDirection:"column",margin:"5px 0 5px 0",padding:e.spacing(1),border:"1px solid #8E8E8E",width:"100%"}})),AppsFilter=()=>{var e=useStyles()["classes"];const t=useDispatch(),s=react.exports.useRef(!1),[a,i]=react.exports.useState(useSelector(selectFilters));var n=(new Date).toISOString().split("T")[0];const o={startDate:"",endDate:"",isSearch:!1};react.exports.useEffect(()=>{s.current?t(actions.filterState.setFilters({filter:a})):s.current=!0},[a,t]);const{status:r,lastUpdated:l,created:p,name:c,entityTags:d}=a;var u=e=>{i(Object.assign(Object.assign({},a),{created:Object.assign(Object.assign({},p),{[e.target.name]:e.target.value,isSearch:!0})}))},x=e=>{i(Object.assign(Object.assign({},a),{lastUpdated:Object.assign(Object.assign({},l),{[e.target.name]:e.target.value,isSearch:!0})}))};const m=e=>{switch(e){case"created":case"lastUpdated":i(Object.assign(Object.assign({},a),{[e]:o}));break;case"search":i(Object.assign(Object.assign({},a),{[e]:""}))}};return jsxRuntime.exports.jsx(Grid,Object.assign({container:!0,spacing:3,"data-test":"apps-list-filter-container"},{children:jsxRuntime.exports.jsx(Grid,Object.assign({item:!0,xs:!0},{children:jsxRuntime.exports.jsxs(Paper,Object.assign({className:e.paper},{children:[jsxRuntime.exports.jsxs("div",Object.assign({className:e.groupFilter},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h3","data-test":"app-center-browse-filter-header-name"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"app-center-browse-filter-header-name",defaultMessage:"Name",description:"Name"})})),jsxRuntime.exports.jsx(Input,{"data-test":"app-center-browse-filter-input-name",placeholder:"Application Name",name:"name",value:c,onChange:e=>{e=e.target.value;i(Object.assign(Object.assign({},a),{name:e||""}))},fullWidth:!0})]})),jsxRuntime.exports.jsxs("div",Object.assign({className:e.groupFilter},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h3","data-test":"app-center-browse-filter-header-tags"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-browse-header-tags",defaultMessage:"Tags",description:"tags"})})),jsxRuntime.exports.jsx(EntityTags,{selectedTags:d,setSelectedTags:e=>{i(Object.assign(Object.assign({},a),{entityTags:e||""}))},showHeader:!1})]})),jsxRuntime.exports.jsxs("div",Object.assign({className:e.groupFilter},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h3","data-test":"app-center-filter-header-status"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-browse-header-status",defaultMessage:"Status",description:"Status"})})),jsxRuntime.exports.jsx(Autocomplete,{"data-test":"app-center-browse-filter-field-status",id:"statusFilter",value:{label:r},options:[{label:"active"},{label:"draft"},{label:"deleted"},{label:"pending"},{label:"rejected"},{label:"approved"},{label:"disabled"}],getOptionLabel:e=>e?e.label:"",renderInput:e=>jsxRuntime.exports.jsx(TextField,Object.assign({},e,{label:jsxRuntime.exports.jsx(Typography,Object.assign({variant:"caption"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-browse-select-status-caption",defaultMessage:"Select status",description:"Select status"})})),variant:"standard"})),onChange:(e,t)=>{i(Object.assign(Object.assign({},a),{status:(null==t?void 0:t.label)||""}))}})]})),jsxRuntime.exports.jsxs("div",Object.assign({className:e.groupFilter},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h3","data-test":"app-center-filter-header-created"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-browse-filter-header-label-created",defaultMessage:"Created",description:"Last updated"})})),jsxRuntime.exports.jsxs("form",Object.assign({className:e.container,noValidate:!0},{children:[jsxRuntime.exports.jsxs("div",Object.assign({className:e.formGroup},{children:[jsxRuntime.exports.jsx("label",Object.assign({htmlFor:"startDate"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-browse-filter-date-picker-label-from",defaultMessage:"From",description:"From"})})),jsxRuntime.exports.jsx("input",{"data-test":"app-center-browse-filter-field-created-start-date",id:"startDate",type:"date",name:"startDate",value:p.startDate,onChange:u,className:e.textField,max:p.endDate||n})]})),jsxRuntime.exports.jsxs("div",Object.assign({className:e.formGroup},{children:[jsxRuntime.exports.jsx("label",Object.assign({htmlFor:"endDate"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-browse-filter-date-picker-label-to",defaultMessage:"To",description:"To"})})),jsxRuntime.exports.jsx("input",{"data-test":"app-center-browse-filter-field-created-end-date",id:"endDate",type:"date",name:"endDate",value:p.endDate,onChange:u,className:e.textField,max:n,min:p.startDate})]}))]})),jsxRuntime.exports.jsx("div",Object.assign({className:e.clearFilterIcon},{children:p.isSearch&&jsxRuntime.exports.jsx(IconButton,Object.assign({"data-test":"app-center-browse-filter-created-clear",onClick:()=>m("created"),size:"large"},{children:jsxRuntime.exports.jsx(default_1,{fontSize:"small"})}))}))]})),jsxRuntime.exports.jsxs("div",Object.assign({className:e.groupFilter},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h3","data-test":"app-center-filter-header-last-updated"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"app-center-filter-header-label-last-updated",defaultMessage:"Last updated",description:"Last updated"})})),jsxRuntime.exports.jsxs("form",Object.assign({className:e.container,noValidate:!0},{children:[jsxRuntime.exports.jsxs("div",Object.assign({className:e.formGroup},{children:[jsxRuntime.exports.jsx("label",Object.assign({htmlFor:"startDate"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-browse-filter-date-picker-updated-label-from",defaultMessage:"From",description:"From"})})),jsxRuntime.exports.jsx("input",{"data-test":"app-center-browse-filter-field-updated-start-date",id:"startDate",type:"date",name:"startDate",value:l.startDate,onChange:x,className:e.textField,max:l.endDate||n})]})),jsxRuntime.exports.jsxs("div",Object.assign({className:e.formGroup},{children:[jsxRuntime.exports.jsx("label",Object.assign({htmlFor:"endDate"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-browse-filter-date-picker-updated-label-to",defaultMessage:"To",description:"To"})})),jsxRuntime.exports.jsx("input",{"data-test":"app-center-browse-filter-field-updated-end-date",id:"endDate",type:"date",name:"endDate",value:l.endDate,onChange:x,className:e.textField,max:n,min:l.startDate})]}))]})),jsxRuntime.exports.jsx("div",Object.assign({className:e.clearFilterIcon},{children:l.isSearch&&jsxRuntime.exports.jsx(IconButton,Object.assign({"data-test":"app-center-browse-filter-last-updated-clear",onClick:()=>m("lastUpdated"),size:"large"},{children:jsxRuntime.exports.jsx(default_1,{fontSize:"small"})}))}))]}))]}))}))}))},AppCenterFilter=e=>jsxRuntime.exports.jsx(AIWareThemeProvider,{children:jsxRuntime.exports.jsx(AIWareIntlProvider,{children:jsxRuntime.exports.jsx(AIWareCacheProvider,{children:jsxRuntime.exports.jsx(AppsFilter,{})})})});export{AppCenterBrowse,AppCenterDetails,AppCenterFilter,PanelHeader as AppDetailsPanelHeader,index as actions,selectFilters};
|
|
111
|
+
`;return yield baseGraphQLApiWithError(Object.assign({query:t,variables:{input:a},operationName:e},s))}),deleteApp$1=(t,s)=>__awaiter(void 0,void 0,void 0,function*(){var e="deleteApplication";return yield baseGraphQLApiWithError(Object.assign({query:"\n mutation deleteApplication ($id: ID!) {\n deleteApplication(id: $id) {\n id\n message\n }\n }\n ",variables:{id:s},operationName:e},t))}),selectUIStateStatus=e=>e[namespace].uiState.status,selectApps=e=>e[namespace].apps[AppType.Apps],selectQueryOptions=e=>e[namespace].apps[AppType.QueryOptions],selectTotalAppsInQuery=e=>e[namespace].apps[AppType.TotalAppsInQuery],selectFilters=e=>e[namespace]?e[namespace].filterState.filter:{},selectApiConfigs=createSelector([rootApiSelector,graphEndpointSelector,sessionTokenSelector],(e,t,s)=>({apiRoot:e,graphQLEndpoint:t,token:s})),APP_CENTER_TEXT={cancel:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"ac.st.cancel",defaultMessage:"Cancel",description:"Cancel"}),delete:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"ac.st.delete",defaultMessage:"Delete",description:"Delete"}),close:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"ac.st.close",defaultMessage:"CLOSE",description:"Close"}),closePanel:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"ac.st.closePanel",defaultMessage:"Close Panel",description:"Close Panel"}),deleteApp:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"ac.st.deleteApp",defaultMessage:"Delete Application",description:"Delete Application"}),editApp:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"ac.st.editApp",defaultMessage:"Edit Application",description:"Edit Application"}),appDetails:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"ac.st.appDetails",defaultMessage:"Application Details",description:"Application Details"})},ConfirmDelete=({open:e,appName:t,testName:s,handleCloseConfirmDelete:a,handleConfirmDelete:i})=>jsxRuntime.exports.jsxs(Dialog,Object.assign({"data-test":s,open:e,onClose:a,maxWidth:"xs","aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description"},{children:[jsxRuntime.exports.jsx(DialogTitle,Object.assign({id:"alert-dialog-title"},{children:jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h3"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-browse.app-list-row.delete-confirmation-title",defaultMessage:"Confirm Delete",description:"Title of the delete app confirmation modal"})}))})),jsxRuntime.exports.jsx(DialogContent,{children:jsxRuntime.exports.jsx(DialogContentText,Object.assign({id:"alert-dialog-description"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-browse.app-list-row.delete-confirmation-message",defaultMessage:"Are you sure you want to delete {appName}? This action can not be undone.",description:"This message is show when prompting the user to confirm the delete of an app from the apps list",values:{appName:t}})}))}),jsxRuntime.exports.jsxs(DialogActions,{children:[jsxRuntime.exports.jsx(Button,Object.assign({color:"secondary",onClick:a},{children:APP_CENTER_TEXT.cancel()})),jsxRuntime.exports.jsx(Button,Object.assign({variant:"contained",onClick:i,autoFocus:!0},{children:APP_CENTER_TEXT.delete()}))]})]})),useStyles$7=makeStyles()(e=>({panelRoot:{width:"100%"},panelContainer:{display:"flex",flexDirection:"column",width:"100%",padding:e.spacing(2)},panelHeader:{display:"flex",justifyContent:"space-between",alignItems:"center",paddingLeft:e.spacing(1),marginBottom:e.spacing(1),"&.with-secondary-title":{alignItems:"flex-start"}},panelBody:{display:"flex",flexGrow:1},divider:{marginBottom:e.spacing(2)},appHeader:{minHeight:"120px"},headerInfo:{paddingLeft:e.spacing(4)},appInfo:{paddingTop:e.spacing(6)},appInfoBody:{paddingLeft:e.spacing(4),paddingTop:e.spacing(3)},appOverview:{paddingTop:e.spacing(6),bottom:e.spacing(6),minHeight:"120px"},sectionTitle:{paddingBottom:e.spacing(3)},textContent:{fontStyle:"normal",fontWeight:400,fontSize:14,lineHeight:20},titleInline:{fontWeight:600,marginRight:e.spacing(1)},contentRow:{paddingBottom:e.spacing(3)},appDescription:{paddingTop:e.spacing(2),paddingBottom:e.spacing(2)},appVersion:{paddingLeft:e.spacing(3)},appMainLayout:{paddingTop:e.spacing(2)},appTabPanels:{width:"100%"},appContainer:{paddingLeft:e.spacing(3),paddingTop:e.spacing(2)}})),visuallyHidden={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:-1,overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"};var visuallyHidden$1=visuallyHidden;const PanelHeader=({appId:e})=>{const t=useDispatch();var s=useStyles$7()["classes"];const[a,i]=react.exports.useState(null);var n=()=>{i(null)};return jsxRuntime.exports.jsxs("div",Object.assign({className:classNames(s.panelHeader)},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({"data-test":"app-details-action-panel-title",variant:"h1"},{children:APP_CENTER_TEXT.appDetails()})),jsxRuntime.exports.jsx(Typography,Object.assign({style:visuallyHidden$1,id:"app-details-close-action"},{children:APP_CENTER_TEXT.closePanel()})),jsxRuntime.exports.jsxs("div",{children:[jsxRuntime.exports.jsx(IconButton,Object.assign({"aria-label":"more options",onClick:e=>{i(e.currentTarget)},"data-test":"app-details-actions-button",size:"large"},{children:jsxRuntime.exports.jsx(MoreVert,{})})),jsxRuntime.exports.jsx(Tooltip,Object.assign({title:APP_CENTER_TEXT.closePanel()},{children:jsxRuntime.exports.jsx(IconButton,Object.assign({onClick:()=>{t(hidePanel("APPLICATION_DETAILS_PANEL"))},"aria-labelledby":"app-details-close-action","data-test":"app-details-close-action",size:"large"},{children:jsxRuntime.exports.jsx(Hide,{})}))}))]}),jsxRuntime.exports.jsxs(Menu,Object.assign({anchorEl:a,open:Boolean(a),onClose:n,onBlur:n,"data-test":"app-details-action-panel-menu"},{children:[jsxRuntime.exports.jsxs(MenuItem,Object.assign({onClick:()=>{t(actions.uiState.toggleEditApp(e))}},{children:[jsxRuntime.exports.jsx(ListItemIcon,{children:jsxRuntime.exports.jsx(Edit,{fontSize:"small"})}),jsxRuntime.exports.jsx(Typography,Object.assign({variant:"inherit",noWrap:!0,"data-test":"app-details-action-panel-menu-btn-edit-app"},{children:APP_CENTER_TEXT.editApp()}))]})),jsxRuntime.exports.jsx(Divider,{}),jsxRuntime.exports.jsxs(MenuItem,Object.assign({onClick:()=>{t(actions.uiState.confirmDeleteApp({id:e}))}},{children:[jsxRuntime.exports.jsx(ListItemIcon,{children:jsxRuntime.exports.jsx(Delete,{fontSize:"small"})}),jsxRuntime.exports.jsx(Typography,Object.assign({variant:"inherit",noWrap:!0,"data-test":"app-details-action-panel-menu-btn-delete"},{children:APP_CENTER_TEXT.deleteApp()}))]}))]}))]}))};function*fetchApplications(){var e=yield select(selectApiConfigs),t=yield select(preferredLanguageSelector),t=AIWareFormatMessage(t);if(e)try{yield put(actions.uiState.fetchingApps());var s=yield call(getApplications,e);yield put(actions.apps.appsFetchSucceeded(s)),yield put(actions.uiState.fetchingDone())}catch(e){yield put(showMessage({content:t({id:"os-app-center-browse.get-all-applications-fail",defaultMessage:[{type:0,value:"Fetching applications failed"}]}),severity:MessageSeverity.Error})),yield put(actions.uiState.fetchingFailed())}}function*fetchFilterApplications(e){yield delay(650);var{page:t,limit:s,orderBy:a}=yield select(selectQueryOptions);if("appCenterBrowse/filterState/setFilters"===e.type&&1!==t)yield put(actions.apps.setQueryOptions({page:1,limit:s,orderBy:a}));else{var e=yield select(selectFilters),i={},e=(lodash.exports.isEmpty(e.name)||(i.name=e.name),lodash.exports.isEmpty(e.status)||(i.status=e.status),lodash.exports.isEmpty(e.entityTags)||(i.entityTags=lodash.exports.map(e.entityTags,e=>({key:e.tagKey}))),e.created.isSearch&&(i.dateTimeFilter=[{field:"createdDateTime",fromDateTime:e.created.startDate,toDateTime:e.created.endDate}]),e.lastUpdated.isSearch&&(i.dateTimeFilter=[...i.dateTimeFilter||[],{field:"modifiedDateTime",fromDateTime:e.lastUpdated.startDate,toDateTime:e.lastUpdated.endDate}]),{page:t,limit:s,orderBy:a,filter:i}),t=yield select(selectApiConfigs),s=yield select(preferredLanguageSelector),a=AIWareFormatMessage(s);if(t)try{yield put(actions.uiState.fetchingApps());var n=yield call(getApplicationsWithFilter,t,e);yield put(actions.apps.appsFetchSucceeded(n)),yield put(actions.uiState.fetchingDone())}catch(e){yield put(showMessage({content:a({id:"os-app-center-browse.get-all-applications-fail",defaultMessage:[{type:0,value:"Fetching applications failed"}]}),severity:MessageSeverity.Error})),yield put(actions.uiState.fetchingFailed())}}}function*mutateAppWorkflow(t){var t=t["payload"],s=yield select(selectApiConfigs),a=yield select(preferredLanguageSelector),a=AIWareFormatMessage(a);if(s)try{var e=(yield call(applicationWorkflow,s,t)).applicationWorkflow;yield put(actions.apps.mutateApplicationWorkflowSuccess(e)),yield put(showMessage({content:a({id:"os-app-center-browse.snackbar.appSuccessAction",defaultMessage:[{type:0,value:"App successfully "},{type:1,value:"action"},{type:0,value:"d"}]},{action:t.action}),severity:MessageSeverity.Success}))}catch(e){yield put(showMessage({content:a({id:"os-app-center-browse.snackbar.appFailedAction",defaultMessage:[{type:0,value:"App failed to "},{type:1,value:"action"}]},{action:t.action}),severity:MessageSeverity.Error}));try{var i=yield call(getApplication,s,t.id);yield put(actions.apps.refreshAppStateSuccess(i))}catch(e){yield put(actions.uiState.fetchingFailed())}}}function*deleteApp(t){var t=t["payload"],s=yield select(selectApiConfigs),a=yield select(preferredLanguageSelector),a=AIWareFormatMessage(a);if(s)try{yield call(deleteApp$1,s,t.id),yield put(showMessage({content:a({id:"os-app-center-browse.snackbar.app-delete-success",defaultMessage:[{type:0,value:"App successfully deleted"}]}),severity:MessageSeverity.Success})),yield put(actions.apps.deleteAppSuccess(t))}catch(e){yield put(showMessage({content:a({id:"os-app-center-browse.snackbar.app-delete-fail",defaultMessage:[{type:0,value:"App failed to be deleted"}]}),severity:MessageSeverity.Error}));try{var i=yield call(getApplication,s,t.id);yield put(actions.apps.deleteAppFailed(i))}catch(e){yield put(actions.uiState.fetchingFailed())}}}function*toggleAppDetails(e){e=e.payload;if(!e)return yield put(hidePanel("APP_CENTER_DETAILS"));e={name:"APPLICATION_DETAILS_PANEL",config:{name:"Application Details",applicationId:e.id,disableInstallFeature:!0,headerComponent:jsxRuntime.exports.jsx(PanelHeader,{appId:e.id}),appIsOwned:!0}};yield put(mountPanel({panelId:"APPLICATION_DETAILS_PANEL",microFrontend:e,panelConfig:{type:"APP_BAR_PANEL_TEMPLATE",marginTop:55,marginStart:0,size:"xlarge",zIndex:1001}})),yield put(hidePanel("APP_CENTER_NEW"))}function*toggleEditApp(e){e=e.payload;if(!e)return yield put(hidePanel("APP_CENTER_DETAILS"));yield put(mountPanel({panelId:"APP_CENTER_NEW",microFrontend:{name:"APP_CENTER_NEW",config:{name:"Edit app",appId:e}},panelConfig:{type:"APP_BAR_PANEL_TEMPLATE",header:{title:"Edit app",divider:!0},marginTop:55,size:"xlarge",zIndex:1002}})),yield put(hidePanel("APPLICATION_DETAILS_PANEL"))}const rootHash={};function*confirmDeleteApp(e){const t=e["payload"];t.closeModal?(rootHash.confirmDeleteRoot.unmount(),delete rootHash.confirmDeleteRoot):(yield select(selectApiConfigs))&&((e=getElement("confirm-delete-root")).classList.add("aiware-el"),e=client.createRoot(e),(rootHash.confirmDeleteRoot=e).render(jsxRuntime.exports.jsx(AIWareCacheProvider,{children:jsxRuntime.exports.jsx(AIWareThemeProvider,{children:jsxRuntime.exports.jsx(Provider,Object.assign({store:store},{children:jsxRuntime.exports.jsx(AIWareIntlProvider,{children:jsxRuntime.exports.jsx(ConfirmDelete,{open:!t.closeModal,appName:t.name||"this application",testName:"application-details-panel.delete-confirmation-modal",handleCloseConfirmDelete:()=>__awaiter(this,void 0,void 0,function*(){return yield store.dispatch(actions.uiState.confirmDeleteApp({id:t.id,closeModal:!0}))}),handleConfirmDelete:()=>__awaiter(this,void 0,void 0,function*(){yield store.dispatch(actions.apps.deleteApp({id:t.id})),yield store.dispatch(actions.uiState.confirmDeleteApp({id:t.id,closeModal:!0})),yield store.dispatch(hidePanel("APPLICATION_DETAILS_PANEL"))})})})}))})})))}function*watchFetchApp(){yield takeLatest$1([actions.uiState.initApps.type],fetchApplications)}function*watchSetFilters(){yield takeLatest$1(actions.filterState.setFilters.type,fetchFilterApplications)}function*watchSetQueryOptions(){yield takeLatest$1(actions.apps.setQueryOptions.type,fetchFilterApplications)}function*watchAppWorkflow(){yield takeLatest$1(actions.apps.mutateApplicationWorkflow.type,mutateAppWorkflow)}function*watchDeleteApp(){yield takeLatest$1(actions.apps.deleteApp.type,deleteApp)}function*watchToggleAppDetails(){yield takeLatest$1(actions.uiState.toggleAppDetails.type,toggleAppDetails)}function*watchToggleEditApp(){yield takeLatest$1(actions.uiState.toggleEditApp.type,toggleEditApp)}function*watchconfirmDeleteApp(){yield takeLatest$1(actions.uiState.confirmDeleteApp.type,confirmDeleteApp)}const appSagas=[fork(watchSetFilters),fork(watchSetQueryOptions),fork(watchFetchApp),fork(watchAppWorkflow),fork(watchDeleteApp),fork(watchToggleAppDetails),fork(watchToggleEditApp),fork(watchconfirmDeleteApp)];function*rootSaga(){yield all([...appSagas])}function getAppCenterBrowseModule(){return{id:SLICE_NAME,reducerMap:{[SLICE_NAME]:rootReducer},sagas:[rootSaga],initialActions:[]}}const useStyles$6=makeStyles()(e=>({container:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:e.spacing(4),width:"100%",padding:e.spacing(6)},imgContainer:{display:"flex",justifyContent:"center",alignItems:"center",padding:e.spacing(4),border:"20px solid #C2C6CF",borderRadius:"50%",overflow:"hidden",width:350,aspectRatio:"1 / 1",opacity:.25},logo:{width:"70%",height:"70%",objectFit:"contain"},tableContainer:{overflowX:"initial"},table:{"& td":{verticalAlign:"middle",fontWeight:600}},paginationContainer:{display:"flex",justifyContent:"flex-end",alignItems:"center",gap:e.spacing(3),padding:e.spacing(3)},noResultsContainer:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"}})),mountAppCenterNew=e=>{e(mountPanel({panelId:"APP_CENTER_NEW",microFrontend:{name:"APP_CENTER_NEW",config:{name:"New App Onboarding"}},panelConfig:{type:"APP_BAR_PANEL_TEMPLATE",header:{title:"New App Onboarding",divider:!0},marginTop:55,size:"xlarge",zIndex:1e3}}))},useStyles$5=makeStyles()(e=>({header:{alignItems:"center",display:"flex",zIndex:10,width:"100%",background:"#fff"},marginRight:{marginRight:e.spacing(2)},headerActionContainer:{alignItems:"center",display:"flex",flexGrow:1,height:"100%",justifyContent:"flex-end"}})),Header=()=>{var e=useStyles$5()["classes"];const t=useDispatch();var s=()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-browse.BbPEYs",defaultMessage:"Filter",description:"button to open up a filter panel for apps"});return jsxRuntime.exports.jsxs("header",Object.assign({className:e.header,"data-test":"app-center-browse-header"},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h1","data-test":"app-center-browse-title"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-browse.3G70xl",defaultMessage:"Applications",description:"Header Title for Apps Table"})})),jsxRuntime.exports.jsxs("div",Object.assign({className:e.headerActionContainer},{children:[jsxRuntime.exports.jsx(Button,Object.assign({className:e.marginRight,onClick:()=>{mountAppCenterNew(t)},color:"primary",variant:"contained","data-test":"app-center-browse-add-new"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-browse.TuUJVi",defaultMessage:"Add New",description:"Label of a button that allows user to create a new app"})})),jsxRuntime.exports.jsx(Typography,Object.assign({style:visuallyHidden$1,id:"app-center-browse-filter-panel"},{children:jsxRuntime.exports.jsx(s,{})})),jsxRuntime.exports.jsx(Tooltip,Object.assign({title:jsxRuntime.exports.jsx(s,{})},{children:jsxRuntime.exports.jsx(IconButton,Object.assign({onClick:()=>{t(mountPanel({panelId:"APP_CENTER_FILTER",microFrontend:{name:"APP_CENTER_FILTER",config:{name:"App Filter"}},panelConfig:{type:"APP_BAR_PANEL_TEMPLATE",header:{title:"App Filter",divider:!0},marginTop:55,size:"small",zIndex:1e3}}))},"aria-labelledby":"app-center-browse-filter-panel","data-test":"app-center-browse-filter-panel",size:"large"},{children:jsxRuntime.exports.jsx(Filter,{})}))}))]}))]}))},useStyles$4=makeStyles()(e=>({appListHeader:{position:"sticky",top:0,background:"#fff",zIndex:20},appHeaderCell:{padding:"10px 20px 10px 20px"}})),AppsListTableHeader=()=>{const a=useDispatch(),i=useStyles$4()["classes"],n=useSelector(selectQueryOptions)["orderBy"];return jsxRuntime.exports.jsxs(TableHead,Object.assign({className:i.appListHeader},{children:[jsxRuntime.exports.jsx(TableRow,{children:jsxRuntime.exports.jsx(TableCell,Object.assign({className:i.appHeaderCell,colSpan:10},{children:jsxRuntime.exports.jsx(Header,{})}))}),jsxRuntime.exports.jsxs(TableRow,{children:[jsxRuntime.exports.jsx(TableCell,{}),lodash.exports.map([{id:"name",label:"Application Name"},{id:"status",label:"Status"},{id:"url",label:"URL"},{id:"createdDateTime",label:"Date Created"},{id:"modifiedDateTime",label:"Last Modified"}],e=>{var t,s;return jsxRuntime.exports.jsx(TableCell,Object.assign({className:i.appHeaderCell,"data-test":"apps-list-table-header-app-"+e.label,sortDirection:(null==(t=n[0])?void 0:t.field)===e.id&&n[0].direction},{children:jsxRuntime.exports.jsx(TableSortLabel,Object.assign({active:(null==(t=n[0])?void 0:t.field)===e.id,direction:(null==(t=n[0])?void 0:t.field)===e.id?null==(t=n[0])?void 0:t.direction:"asc",onClick:(s=e.id,()=>{let e="asc";var t=(null==(t=n[0])?void 0:t.field)===s&&n[0].direction;t&&"asc"===t&&(e="desc"),a(actions.apps.setQueryOptions({orderBy:[{field:s,direction:e}],page:1}))})},{children:e.label}))}),e.id)}),jsxRuntime.exports.jsx(TableCell,{})]})]}))},AppRowSkeleton=()=>jsxRuntime.exports.jsxs(TableRow,Object.assign({hover:!0},{children:[jsxRuntime.exports.jsx(TableCell,Object.assign({style:{paddingRight:0}},{children:jsxRuntime.exports.jsx(Skeleton,{animation:"wave",variant:"circular",width:28,height:28})})),jsxRuntime.exports.jsx(TableCell,{children:jsxRuntime.exports.jsx(Skeleton,{animation:"wave",variant:"rectangular",height:22,width:400})}),jsxRuntime.exports.jsx(TableCell,{children:jsxRuntime.exports.jsx(Skeleton,{animation:"wave",variant:"rectangular",height:22})}),jsxRuntime.exports.jsx(TableCell,{children:jsxRuntime.exports.jsx(Skeleton,{animation:"wave",variant:"rectangular",height:22})}),jsxRuntime.exports.jsx(TableCell,{children:jsxRuntime.exports.jsx(Skeleton,{animation:"wave",variant:"rectangular",height:22})}),jsxRuntime.exports.jsx(TableCell,{children:jsxRuntime.exports.jsx(Skeleton,{animation:"wave",variant:"rectangular",height:22})}),jsxRuntime.exports.jsx(TableCell,{})]})),formatDate=e=>{return e?(e=new Date(e)).toLocaleDateString()+" "+e.toLocaleTimeString("en-US",{hour:"numeric",minute:"numeric",hour12:!0}):"--/--/-- --:-- --"},useStyles$3=makeStyles()(e=>({root:{borderRadius:"50%",border:"2px solid #D5DFE9",display:"flex",justifyContent:"center",alignItems:"center",overflow:"hidden"},small:{width:e.spacing(6),height:e.spacing(6)},medium:{width:e.spacing(9),height:e.spacing(9)},large:{width:e.spacing(12),height:e.spacing(12)},xlarge:{width:e.spacing(16),height:e.spacing(16)},logo:{maxWidth:"100%",maxHeight:"100%"},veritoneLogo:{maxWidth:"75%",maxHeight:"75%"}})),CircledLogo=({size:e="medium",path:t,altText:s=""})=>{var a=useStyles$3()["classes"],[t,i]=useBackupImg(t,img$1B);return jsxRuntime.exports.jsx("div",Object.assign({className:a.root+" "+a[e]},{children:jsxRuntime.exports.jsx("img",{className:a.logo+" "+(t==img$1B&&a.veritoneLogo),src:t,alt:s,onError:i})}))},StatusPill=statusPill["jsx"],useStyles$2=makeStyles()(e=>({iconCell:{width:50,paddingRight:0},truncateText:{display:"block",maxWidth:"220px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}})),AppsListRow=({app:a})=>{const[e,i]=react.exports.useState(null),[t,n]=react.exports.useState(!1),o=useDispatch();var s=useStyles$2()["classes"];return jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment,{children:[jsxRuntime.exports.jsxs(TableRow,Object.assign({onClick:()=>{"deleted"!==a.status&&o(actions.uiState.toggleAppDetails({id:a.id,name:a.name}))},style:{cursor:"deleted"!==a.status&&"pointer"},hover:!0,"data-test":"apps-list-table-row","data-test-app-id":a.id},{children:[jsxRuntime.exports.jsx(TableCell,Object.assign({className:s.iconCell},{children:jsxRuntime.exports.jsx(CircledLogo,{size:"small",path:a.signedIconUrl,altText:a.name+" Logo"})})),jsxRuntime.exports.jsx(TableCell,{children:a.name}),jsxRuntime.exports.jsx(TableCell,{children:jsxRuntime.exports.jsx(StatusPill,{statusType:"application",status:a.status})}),jsxRuntime.exports.jsx(TableCell,{children:jsxRuntime.exports.jsx("div",Object.assign({className:s.truncateText},{children:a.url}))}),jsxRuntime.exports.jsx(TableCell,{children:formatDate(a.createdDateTime)}),jsxRuntime.exports.jsx(TableCell,{children:formatDate(a.modifiedDateTime)}),jsxRuntime.exports.jsx(TableCell,{children:jsxRuntime.exports.jsx(IconButton,Object.assign({disabled:"deleted"===a.status,"aria-label":"more options",onClick:e=>{i(e.currentTarget),e.stopPropagation()},"data-test":"app-row-action-trigger",size:"large"},{children:jsxRuntime.exports.jsx(MoreVert,{})}))}),jsxRuntime.exports.jsx(Menu,Object.assign({anchorEl:e,open:Boolean(e),onClose:()=>{i(null)}},{children:!lodash.exports.isEmpty(a.validStateActions)&&lodash.exports.map(a.validStateActions,s=>jsxRuntime.exports.jsx(MenuItem,Object.assign({onClick:e=>{return t=s,e.stopPropagation(),"enable"!==t&&"disable"!==t&&"approve"!==t&&"deploy"!==t&&"reject"!==t&&"submit"!==t||o(actions.apps.mutateApplicationWorkflow({id:a.id,action:t})),"delete"===t&&n(!0),"edit"===t&&o(actions.uiState.toggleEditApp(a.id)),void i(null);var t},"data-test":"app-row-action-button-"+s},{children:s}),s))}))]})),jsxRuntime.exports.jsx(ConfirmDelete,{open:t,appName:a.name,testName:"os-app-center-browse.app-list-row.delete-confirmation-modal",handleCloseConfirmDelete:()=>{n(!1)},handleConfirmDelete:()=>{o(actions.apps.deleteApp({id:a.id})),n(!1)}})]})},NoResults=()=>{var e=useStyles$6()["classes"];const t=useDispatch();return jsxRuntime.exports.jsxs("div",Object.assign({className:e.container},{children:[jsxRuntime.exports.jsx("div",Object.assign({className:e.imgContainer},{children:jsxRuntime.exports.jsx("img",{className:e.logo,src:img$1B,alt:"Veritone Logo"})})),jsxRuntime.exports.jsx("h2",Object.assign({"data-test":"ac-browse-no-results-title"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"applicationsListTable.noResults.message",defaultMessage:"No applications found...",description:"No results found message"})})),jsxRuntime.exports.jsx(Button,Object.assign({className:"test-class",variant:"contained",size:"large",onClick:()=>mountAppCenterNew(t),startIcon:jsxRuntime.exports.jsx(Add,{})},{children:"Add New"}))]}))},AppsListTable=({baseRedirectUrl:t})=>{var e=useStyles$6()["classes"],s=useSelector(selectUIStateStatus);const a=useSelector(selectApps),i=useSelector(selectQueryOptions);var n=useSelector(selectTotalAppsInQuery);const o=useDispatch();return jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment,{children:[jsxRuntime.exports.jsx(TableContainer,Object.assign({className:e.tableContainer},{children:jsxRuntime.exports.jsxs(Table,Object.assign({className:e.table,stickyHeader:!0},{children:[jsxRuntime.exports.jsx(AppsListTableHeader,{}),jsxRuntime.exports.jsxs(TableBody,{children:["pending"===s?lodash.exports.times(10,()=>jsxRuntime.exports.jsx(AppRowSkeleton,{},Math.random())):lodash.exports.map(lodash.exports.keys(a),e=>jsxRuntime.exports.jsx(AppsListRow,{baseRedirectUrl:t,app:a[e]},e)),jsxRuntime.exports.jsx("div",Object.assign({className:e.noResultsContainer},{children:"pending"!==s&&lodash.exports.isEmpty(a)&&jsxRuntime.exports.jsx(NoResults,{})}))]})]}))})),!!n&&jsxRuntime.exports.jsxs("div",Object.assign({className:e.paginationContainer},{children:[jsxRuntime.exports.jsx(Typography,{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-browse.sCzlFD",defaultMessage:"Rows per page: ",description:"Rows per page"})}),jsxRuntime.exports.jsxs(Select,Object.assign({value:i.limit||10,onChange:e=>{o(actions.apps.setQueryOptions(Object.assign(Object.assign({},i),{limit:e.target.value,page:1})))},"data-test":"apps-list-per-page-select",MenuProps:{style:{zIndex:1500}}},{children:[jsxRuntime.exports.jsx(MenuItem,Object.assign({value:10},{children:"10"})),jsxRuntime.exports.jsx(MenuItem,Object.assign({value:20,"data-test":"apps-list-twenty-per-page"},{children:"20"})),jsxRuntime.exports.jsx(MenuItem,Object.assign({value:30},{children:"30"}))]})),jsxRuntime.exports.jsx(Pagination,{count:Math.ceil(n/i.limit),page:i.page,onChange:(e,t)=>{o(actions.apps.setQueryOptions(Object.assign(Object.assign({},i),{page:t})))}})]}))]})},useStyles$1=makeStyles()(e=>({panel:{width:"100%",height:"100%",overflow:"auto",backgroundColor:e.palette.background.paper}})),MainLayout$1=({baseRedirectUrl:e})=>{var t=useStyles$1()["classes"];return jsxRuntime.exports.jsx("div",Object.assign({role:"presentation","data-test":"app-center-browse-widget",className:t.panel},{children:jsxRuntime.exports.jsx(AppsListTable,{baseRedirectUrl:e})}))};function isDeveloperDomain(){return/^(developer\.(((dev|prod)\.)?([a-zA-Z0-9\-]*\.)?)?veritone\.com|localhost|local\.veritone)/.test(window.location.hostname)}const Content=e=>{const t=useDispatch(),{apiRoot:s,graphQLEndpoint:a,token:i}=useSelector(selectApiConfigs);return react.exports.useEffect(()=>{s&&a&&i&&t(actions.uiState.initApps())},[s,a,i,t]),s&&a&&i?jsxRuntime.exports.jsx(MainLayout$1,Object.assign({},e)):null},AppCenterBrowse=e=>{const s=useDispatch();return react.exports.useEffect(()=>{var e=window.location.pathname.split("/"),t=e[2];"applications"===e[1]&&(validate(t)&&isDeveloperDomain()?s(actions.uiState.toggleAppDetails({id:t})):"overview"===e[2]&&"new"===e[3]&&mountAppCenterNew(s))},[s]),jsxRuntime.exports.jsx(AIWareThemeProvider,{children:jsxRuntime.exports.jsx(DynamicModuleLoader,Object.assign({modules:[getAppCenterBrowseModule()]},{children:jsxRuntime.exports.jsx(AIWareIntlProvider,{children:jsxRuntime.exports.jsx(AIWareCacheProvider,{children:jsxRuntime.exports.jsx(Content,Object.assign({},e))})})}))})},ActionPanel=({onClose:e,onDelete:t,onEdit:s,children:a})=>{var i=useStyles$7()["classes"];const[n,o]=react.exports.useState(null);var r=()=>{o(null)};return jsxRuntime.exports.jsx("div",Object.assign({className:classNames(i.panelRoot),"data-test":"app-details-action-panel"},{children:jsxRuntime.exports.jsxs("div",Object.assign({className:i.panelContainer},{children:[jsxRuntime.exports.jsxs("div",Object.assign({className:classNames(i.panelHeader)},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({"data-test":"app-details-action-panel-title",variant:"h1"},{children:APP_CENTER_TEXT.appDetails()})),jsxRuntime.exports.jsx(Typography,Object.assign({style:visuallyHidden$1,id:"app-details-close-action"},{children:APP_CENTER_TEXT.closePanel()})),jsxRuntime.exports.jsxs("div",{children:[jsxRuntime.exports.jsx(IconButton,Object.assign({"aria-label":"more options",onClick:e=>{o(e.currentTarget)},"data-test":"app-details-actions-button",size:"large"},{children:jsxRuntime.exports.jsx(MoreVert,{})})),jsxRuntime.exports.jsx(Tooltip,Object.assign({title:APP_CENTER_TEXT.closePanel()},{children:jsxRuntime.exports.jsx(IconButton,Object.assign({onClick:e,"aria-labelledby":"app-details-close-action","data-test":"app-details-close-action",size:"large"},{children:jsxRuntime.exports.jsx(Hide,{})}))}))]}),jsxRuntime.exports.jsxs(Menu,Object.assign({anchorEl:n,open:Boolean(n),onClose:r,onBlur:r,"data-test":"app-details-action-panel-menu"},{children:[jsxRuntime.exports.jsxs(MenuItem,Object.assign({onClick:s},{children:[jsxRuntime.exports.jsx(ListItemIcon,{children:jsxRuntime.exports.jsx(Edit,{fontSize:"small"})}),jsxRuntime.exports.jsx(Typography,Object.assign({variant:"inherit",noWrap:!0,"data-test":"app-details-action-panel-menu-btn-edit-app"},{children:APP_CENTER_TEXT.editApp()}))]})),jsxRuntime.exports.jsx(Divider,{}),jsxRuntime.exports.jsxs(MenuItem,Object.assign({onClick:t},{children:[jsxRuntime.exports.jsx(ListItemIcon,{children:jsxRuntime.exports.jsx(Delete,{fontSize:"small"})}),jsxRuntime.exports.jsx(Typography,Object.assign({variant:"inherit",noWrap:!0,"data-test":"app-details-action-panel-menu-btn-delete"},{children:APP_CENTER_TEXT.deleteApp()}))]}))]}))]})),jsxRuntime.exports.jsx(Divider,{className:i.divider}),jsxRuntime.exports.jsx("div",Object.assign({className:i.panelBody},{children:a}))]}))}))},MainLayout=()=>jsxRuntime.exports.jsx("div",{children:"MainLayout"}),AppCenterDetails=({appId:e})=>{const t=useDispatch();return jsxRuntime.exports.jsx(ActionPanel,Object.assign({onClose:()=>{t(hidePanel("APP_CENTER_DETAILS"))},onDelete:()=>{console.log("handleDelete")},onEdit:()=>{console.log("handleEdit")}},{children:e&&jsxRuntime.exports.jsx(Container,Object.assign({style:{width:"100%"},"data-test":"app-details-widget"},{children:jsxRuntime.exports.jsx(MainLayout,{})}))}))},useStyles=makeStyles()(e=>({groupFilterContent:{display:"flex",alignItems:"flex-end"},paper:{height:"100%",padding:5,backgroundColor:"#f5f5f5"},groupFilter:{padding:"20px 10px",borderBottom:"1px solid #ccc"},container:{marginTop:"6px",display:"flex",flexWrap:"wrap",alignItems:"center"},clearFilterIcon:{display:"flex",justifyContent:"center"},textField:{border:"1px solid #f5f5f5",backgroundColor:"#f5f5f5",marginRight:e.spacing(2),outline:"none"},formGroup:{display:"flex",flexDirection:"column",margin:"5px 0 5px 0",padding:e.spacing(1),border:"1px solid #8E8E8E",width:"100%"}})),AppsFilter=()=>{var e=useStyles()["classes"];const t=useDispatch(),s=react.exports.useRef(!1),[a,i]=react.exports.useState(useSelector(selectFilters));var n=(new Date).toISOString().split("T")[0];const o={startDate:"",endDate:"",isSearch:!1};react.exports.useEffect(()=>{s.current?t(actions.filterState.setFilters({filter:a})):s.current=!0},[a,t]);const{status:r,lastUpdated:l,created:p,name:c,entityTags:d}=a;var u=e=>{i(Object.assign(Object.assign({},a),{created:Object.assign(Object.assign({},p),{[e.target.name]:e.target.value,isSearch:!0})}))},x=e=>{i(Object.assign(Object.assign({},a),{lastUpdated:Object.assign(Object.assign({},l),{[e.target.name]:e.target.value,isSearch:!0})}))};const m=e=>{switch(e){case"created":case"lastUpdated":i(Object.assign(Object.assign({},a),{[e]:o}));break;case"search":i(Object.assign(Object.assign({},a),{[e]:""}))}};return jsxRuntime.exports.jsx(Grid,Object.assign({container:!0,spacing:3,"data-test":"apps-list-filter-container"},{children:jsxRuntime.exports.jsx(Grid,Object.assign({item:!0,xs:!0},{children:jsxRuntime.exports.jsxs(Paper,Object.assign({className:e.paper},{children:[jsxRuntime.exports.jsxs("div",Object.assign({className:e.groupFilter},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h3","data-test":"app-center-browse-filter-header-name"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"app-center-browse-filter-header-name",defaultMessage:"Name",description:"Name"})})),jsxRuntime.exports.jsx(Input,{"data-test":"app-center-browse-filter-input-name",placeholder:"Application Name",name:"name",value:c,onChange:e=>{e=e.target.value;i(Object.assign(Object.assign({},a),{name:e||""}))},fullWidth:!0})]})),jsxRuntime.exports.jsxs("div",Object.assign({className:e.groupFilter},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h3","data-test":"app-center-browse-filter-header-tags"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-browse-header-tags",defaultMessage:"Tags",description:"tags"})})),jsxRuntime.exports.jsx(EntityTags,{selectedTags:d,setSelectedTags:e=>{i(Object.assign(Object.assign({},a),{entityTags:e||""}))},showHeader:!1})]})),jsxRuntime.exports.jsxs("div",Object.assign({className:e.groupFilter},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h3","data-test":"app-center-filter-header-status"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-browse-header-status",defaultMessage:"Status",description:"Status"})})),jsxRuntime.exports.jsx(Autocomplete,{"data-test":"app-center-browse-filter-field-status",id:"statusFilter",value:{label:r},options:[{label:"active"},{label:"draft"},{label:"deleted"},{label:"pending"},{label:"rejected"},{label:"approved"},{label:"disabled"}],getOptionLabel:e=>e?e.label:"",renderInput:e=>jsxRuntime.exports.jsx(TextField,Object.assign({},e,{label:jsxRuntime.exports.jsx(Typography,Object.assign({variant:"caption"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-browse-select-status-caption",defaultMessage:"Select status",description:"Select status"})})),variant:"standard"})),onChange:(e,t)=>{i(Object.assign(Object.assign({},a),{status:(null==t?void 0:t.label)||""}))}})]})),jsxRuntime.exports.jsxs("div",Object.assign({className:e.groupFilter},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h3","data-test":"app-center-filter-header-created"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-browse-filter-header-label-created",defaultMessage:"Created",description:"Last updated"})})),jsxRuntime.exports.jsxs("form",Object.assign({className:e.container,noValidate:!0},{children:[jsxRuntime.exports.jsxs("div",Object.assign({className:e.formGroup},{children:[jsxRuntime.exports.jsx("label",Object.assign({htmlFor:"startDate"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-browse-filter-date-picker-label-from",defaultMessage:"From",description:"From"})})),jsxRuntime.exports.jsx("input",{"data-test":"app-center-browse-filter-field-created-start-date",id:"startDate",type:"date",name:"startDate",value:p.startDate,onChange:u,className:e.textField,max:p.endDate||n})]})),jsxRuntime.exports.jsxs("div",Object.assign({className:e.formGroup},{children:[jsxRuntime.exports.jsx("label",Object.assign({htmlFor:"endDate"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-browse-filter-date-picker-label-to",defaultMessage:"To",description:"To"})})),jsxRuntime.exports.jsx("input",{"data-test":"app-center-browse-filter-field-created-end-date",id:"endDate",type:"date",name:"endDate",value:p.endDate,onChange:u,className:e.textField,max:n,min:p.startDate})]}))]})),jsxRuntime.exports.jsx("div",Object.assign({className:e.clearFilterIcon},{children:p.isSearch&&jsxRuntime.exports.jsx(IconButton,Object.assign({"data-test":"app-center-browse-filter-created-clear",onClick:()=>m("created"),size:"large"},{children:jsxRuntime.exports.jsx(default_1,{fontSize:"small"})}))}))]})),jsxRuntime.exports.jsxs("div",Object.assign({className:e.groupFilter},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h3","data-test":"app-center-filter-header-last-updated"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"app-center-filter-header-label-last-updated",defaultMessage:"Last updated",description:"Last updated"})})),jsxRuntime.exports.jsxs("form",Object.assign({className:e.container,noValidate:!0},{children:[jsxRuntime.exports.jsxs("div",Object.assign({className:e.formGroup},{children:[jsxRuntime.exports.jsx("label",Object.assign({htmlFor:"startDate"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-browse-filter-date-picker-updated-label-from",defaultMessage:"From",description:"From"})})),jsxRuntime.exports.jsx("input",{"data-test":"app-center-browse-filter-field-updated-start-date",id:"startDate",type:"date",name:"startDate",value:l.startDate,onChange:x,className:e.textField,max:l.endDate||n})]})),jsxRuntime.exports.jsxs("div",Object.assign({className:e.formGroup},{children:[jsxRuntime.exports.jsx("label",Object.assign({htmlFor:"endDate"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-browse-filter-date-picker-updated-label-to",defaultMessage:"To",description:"To"})})),jsxRuntime.exports.jsx("input",{"data-test":"app-center-browse-filter-field-updated-end-date",id:"endDate",type:"date",name:"endDate",value:l.endDate,onChange:x,className:e.textField,max:n,min:l.startDate})]}))]})),jsxRuntime.exports.jsx("div",Object.assign({className:e.clearFilterIcon},{children:l.isSearch&&jsxRuntime.exports.jsx(IconButton,Object.assign({"data-test":"app-center-browse-filter-last-updated-clear",onClick:()=>m("lastUpdated"),size:"large"},{children:jsxRuntime.exports.jsx(default_1,{fontSize:"small"})}))}))]}))]}))}))}))},AppCenterFilter=e=>jsxRuntime.exports.jsx(AIWareThemeProvider,{children:jsxRuntime.exports.jsx(AIWareIntlProvider,{children:jsxRuntime.exports.jsx(AIWareCacheProvider,{children:jsxRuntime.exports.jsx(AppsFilter,{})})})});export{AppCenterBrowse,AppCenterDetails,AppCenterFilter,PanelHeader as AppDetailsPanelHeader,index as actions,selectFilters};
|
package/js-core.esm48.js.gz
CHANGED
|
Binary file
|