aiware-js 2.37.0 → 2.38.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (164) hide show
  1. package/index.esm.css +92 -92
  2. package/index.esm.css.gz +0 -0
  3. package/index.esm.js.gz +0 -0
  4. package/index.esm.min.css +92 -92
  5. package/index.esm.min.css.gz +0 -0
  6. package/js-core.esm.js +4 -4
  7. package/js-core.esm.js.gz +0 -0
  8. package/js-core.esm10.js.gz +0 -0
  9. package/js-core.esm11.js.gz +0 -0
  10. package/js-core.esm12.js.gz +0 -0
  11. package/js-core.esm13.js.gz +0 -0
  12. package/js-core.esm14.js.gz +0 -0
  13. package/js-core.esm15.js.gz +0 -0
  14. package/js-core.esm16.js.gz +0 -0
  15. package/js-core.esm17.js.gz +0 -0
  16. package/js-core.esm18.js +1 -1
  17. package/js-core.esm18.js.gz +0 -0
  18. package/js-core.esm19.js.gz +0 -0
  19. package/js-core.esm2.js.gz +0 -0
  20. package/js-core.esm20.js +13 -1
  21. package/js-core.esm20.js.gz +0 -0
  22. package/js-core.esm21.js.gz +0 -0
  23. package/js-core.esm22.js.gz +0 -0
  24. package/js-core.esm23.js.gz +0 -0
  25. package/js-core.esm24.js.gz +0 -0
  26. package/js-core.esm25.js.gz +0 -0
  27. package/js-core.esm26.js.gz +0 -0
  28. package/js-core.esm27.js.gz +0 -0
  29. package/js-core.esm28.js.gz +0 -0
  30. package/js-core.esm29.js.gz +0 -0
  31. package/js-core.esm3.js.gz +0 -0
  32. package/js-core.esm30.js.gz +0 -0
  33. package/js-core.esm31.js.gz +0 -0
  34. package/js-core.esm32.js.gz +0 -0
  35. package/js-core.esm33.js +1 -1
  36. package/js-core.esm33.js.gz +0 -0
  37. package/js-core.esm34.js.gz +0 -0
  38. package/js-core.esm35.js.gz +0 -0
  39. package/js-core.esm36.js.gz +0 -0
  40. package/js-core.esm37.js.gz +0 -0
  41. package/js-core.esm38.js +41 -29
  42. package/js-core.esm38.js.gz +0 -0
  43. package/js-core.esm39.js.gz +0 -0
  44. package/js-core.esm4.js +1 -1
  45. package/js-core.esm4.js.gz +0 -0
  46. package/js-core.esm40.js +2 -2
  47. package/js-core.esm40.js.gz +0 -0
  48. package/js-core.esm41.js.gz +0 -0
  49. package/js-core.esm42.js.gz +0 -0
  50. package/js-core.esm43.js.gz +0 -0
  51. package/js-core.esm44.js +2 -2
  52. package/js-core.esm44.js.gz +0 -0
  53. package/js-core.esm45.js +1 -1
  54. package/js-core.esm45.js.gz +0 -0
  55. package/js-core.esm46.js +1 -1
  56. package/js-core.esm46.js.gz +0 -0
  57. package/js-core.esm47.js +31 -1
  58. package/js-core.esm47.js.gz +0 -0
  59. package/js-core.esm48.js +1 -31
  60. package/js-core.esm48.js.gz +0 -0
  61. package/js-core.esm49.js +85 -1
  62. package/js-core.esm49.js.gz +0 -0
  63. package/js-core.esm5.js.gz +0 -0
  64. package/js-core.esm50.js +52 -73
  65. package/js-core.esm50.js.gz +0 -0
  66. package/js-core.esm51.js +7 -63
  67. package/js-core.esm51.js.gz +0 -0
  68. package/js-core.esm52.js +1 -8
  69. package/js-core.esm52.js.gz +0 -0
  70. package/js-core.esm53.js +1 -1
  71. package/js-core.esm53.js.gz +0 -0
  72. package/js-core.esm54.js +56 -1
  73. package/js-core.esm54.js.gz +0 -0
  74. package/js-core.esm55.js +116 -48
  75. package/js-core.esm55.js.gz +0 -0
  76. package/js-core.esm56.js +150 -107
  77. package/js-core.esm56.js.gz +0 -0
  78. package/js-core.esm57.js +57 -149
  79. package/js-core.esm57.js.gz +0 -0
  80. package/js-core.esm58.js +15 -75
  81. package/js-core.esm58.js.gz +0 -0
  82. package/js-core.esm59.js +1 -15
  83. package/js-core.esm59.js.gz +0 -0
  84. package/js-core.esm6.js.gz +0 -0
  85. package/js-core.esm60.js +1 -1
  86. package/js-core.esm60.js.gz +0 -0
  87. package/js-core.esm61.js +121 -1
  88. package/js-core.esm61.js.gz +0 -0
  89. package/js-core.esm62.js +14 -103
  90. package/js-core.esm62.js.gz +0 -0
  91. package/js-core.esm63.js +15 -27
  92. package/js-core.esm63.js.gz +0 -0
  93. package/js-core.esm64.js +13 -19
  94. package/js-core.esm64.js.gz +0 -0
  95. package/js-core.esm65.js +1 -14
  96. package/js-core.esm65.js.gz +0 -0
  97. package/js-core.esm66.js +1 -1
  98. package/js-core.esm66.js.gz +0 -0
  99. package/js-core.esm67.js +61 -1
  100. package/js-core.esm67.js.gz +0 -0
  101. package/js-core.esm68.js +37 -52
  102. package/js-core.esm68.js.gz +0 -0
  103. package/js-core.esm69.js +79 -37
  104. package/js-core.esm69.js.gz +0 -0
  105. package/js-core.esm7.js +1 -1
  106. package/js-core.esm7.js.gz +0 -0
  107. package/js-core.esm70.js +1 -88
  108. package/js-core.esm70.js.gz +0 -0
  109. package/js-core.esm71.js +1 -1
  110. package/js-core.esm71.js.gz +0 -0
  111. package/js-core.esm72.js +35 -1
  112. package/js-core.esm72.js.gz +0 -0
  113. package/js-core.esm73.js +1 -35
  114. package/js-core.esm73.js.gz +0 -0
  115. package/js-core.esm74.js +1 -1
  116. package/js-core.esm74.js.gz +0 -0
  117. package/js-core.esm75.js +1 -1
  118. package/js-core.esm75.js.gz +0 -0
  119. package/js-core.esm76.js +1 -1
  120. package/js-core.esm76.js.gz +0 -0
  121. package/js-core.esm77.js +1 -1
  122. package/js-core.esm77.js.gz +0 -0
  123. package/js-core.esm78.js +1 -1
  124. package/js-core.esm78.js.gz +0 -0
  125. package/js-core.esm79.js +1 -1
  126. package/js-core.esm79.js.gz +0 -0
  127. package/js-core.esm8.js.gz +0 -0
  128. package/js-core.esm80.js +1 -1
  129. package/js-core.esm80.js.gz +0 -0
  130. package/js-core.esm81.js +1 -1
  131. package/js-core.esm81.js.gz +0 -0
  132. package/js-core.esm82.js +1 -1
  133. package/js-core.esm82.js.gz +0 -0
  134. package/js-core.esm83.js +1 -1
  135. package/js-core.esm83.js.gz +0 -0
  136. package/js-core.esm84.js +1 -1
  137. package/js-core.esm84.js.gz +0 -0
  138. package/js-core.esm85.js +1 -1
  139. package/js-core.esm85.js.gz +0 -0
  140. package/js-core.esm86.js +1 -1
  141. package/js-core.esm86.js.gz +0 -0
  142. package/js-core.esm87.js +1 -1
  143. package/js-core.esm87.js.gz +0 -0
  144. package/js-core.esm88.js +1 -1
  145. package/js-core.esm88.js.gz +0 -0
  146. package/js-core.esm89.js +1 -1
  147. package/js-core.esm89.js.gz +0 -0
  148. package/js-core.esm9.js.gz +0 -0
  149. package/js-core.esm90.js +1 -1
  150. package/js-core.esm90.js.gz +0 -0
  151. package/js-core.esm91.js +1 -1
  152. package/js-core.esm91.js.gz +0 -0
  153. package/js-core.umd.css +92 -92
  154. package/js-core.umd.css.gz +0 -0
  155. package/js-core.umd.js +224 -193
  156. package/js-core.umd.js.gz +0 -0
  157. package/js-core.umd.min.css +92 -92
  158. package/js-core.umd.min.css.gz +0 -0
  159. package/locales/en.json +1 -1
  160. package/locales/es.json +1 -1
  161. package/locales/fr.json +1 -1
  162. package/package.json +1 -1
  163. package/js-core.esm92.js +0 -1
  164. package/js-core.esm92.js.gz +0 -0
package/js-core.esm57.js CHANGED
@@ -1,167 +1,75 @@
1
- import{i as createSvgIcon,k as interopRequireDefault,j as jsxRuntime,X as createSlice,t as lodash,ci as combineReducers,cj as createSelector,a2 as rootApiSelector,a4 as graphEndpointSelector,a3 as sessionTokenSelector,ck as fork,d9 as channel,m as makeStyles,cl as AIWareThemeProvider,$ as DynamicModuleLoader,A as AIWareIntlProvider,bK as AIWareCacheProvider,l as useDispatch,n as useSelector,r as react,G as Grid,cm as Stack,T as Typography,F as FormattedMessage,E as IconButton,b6 as default_1$2,x as FormControl,y as TextField,D as InputAdornment,aK as CircularProgress,cr as default_1$3,aB as FormControlLabel,aC as Checkbox,N as Divider,aq as takeLatest$1,B as Box,cv as hidePanel,ct as AvailableComponents,a0 as preferredLanguageSelector,am as Tooltip,cn as Close,M as MenuItem,bV as map_1,bW as keys_1,K as Button,bU as get_1,da as useIntl,c9 as Radio,bO as isEmpty_1,cu as delay,as as put,at as select,av as call,c7 as showMessage,c8 as MessageSeverity,cs as unmountPanel,cw as mountPanel,ah as all,dg as ProgressStepper,bf as AIWareFormatMessage,di as take,dL as Chip,cO as Collapse,cJ as baseGraphQLApiWithError,dl as sdkEventManager,dm as SdkEvents,dn as SdkError,aA as FormGroup,ay as FormLabel,fX as Copy,fY as ArrowForward,cG as img$1y,S as Switch,dt as guid}from"./js-core.esm.js";import{s as set_1,b as InputText,c as InputSelect,S as SchemaOrText,d as InputCheckbox,e as InputRadioGroup,H as Heading,f as uploadFileToS3,g as getSignedWritableUrl,o as orderBy_1,l as lowerCase_1}from"./js-core.esm19.js";import{u as useForm,F as FormProvider}from"./js-core.esm13.js";import{E as EntityTags,L as ListField}from"./js-core.esm21.js";import{f as find_1,a as findIndex_1}from"./js-core.esm14.js";import{d as default_1$4}from"./js-core.esm41.js";import{d as default_1$5}from"./js-core.esm9.js";import{v as v4}from"./js-core.esm42.js";import"./js-core.esm34.js";import"./js-core.esm28.js";import"./js-core.esm26.js";import"./js-core.esm35.js";import"./js-core.esm17.js";import"./js-core.esm27.js";import"./js-core.esm12.js";import"./js-core.esm22.js";import"./js-core.esm29.js";import"./js-core.esm30.js";import"./js-core.esm31.js";import"./js-core.esm23.js";import"./js-core.esm32.js";var ModuleRepo,ModuleStatus,ContextMenuExtensionType,UiInfo,FormStatus,FormValidations,DeploymentModel,IconImportStatus,AppConfigType,AppConfigLevel,VisibilityOffOutlined={},_interopRequireDefault$1=interopRequireDefault.exports,default_1$1=(Object.defineProperty(VisibilityOffOutlined,"__esModule",{value:!0}),VisibilityOffOutlined.default=void 0),_createSvgIcon$1=_interopRequireDefault$1(createSvgIcon),_jsxRuntime$1=jsxRuntime.exports,_default$1=(0,_createSvgIcon$1.default)((0,_jsxRuntime$1.jsx)("path",{d:"M12 6c3.79 0 7.17 2.13 8.82 5.5-.59 1.22-1.42 2.27-2.41 3.12l1.41 1.41c1.39-1.23 2.49-2.77 3.18-4.53C21.27 7.11 17 4 12 4c-1.27 0-2.49.2-3.64.57l1.65 1.65C10.66 6.09 11.32 6 12 6zm-1.07 1.14L13 9.21c.57.25 1.03.71 1.28 1.28l2.07 2.07c.08-.34.14-.7.14-1.07C16.5 9.01 14.48 7 12 7c-.37 0-.72.05-1.07.14zM2.01 3.87l2.68 2.68C3.06 7.83 1.77 9.53 1 11.5 2.73 15.89 7 19 12 19c1.52 0 2.98-.29 4.32-.82l3.42 3.42 1.41-1.41L3.42 2.45 2.01 3.87zm7.5 7.5 2.61 2.61c-.04.01-.08.02-.12.02-1.38 0-2.5-1.12-2.5-2.5 0-.05.01-.08.01-.13zm-3.4-3.4 1.75 1.75c-.23.55-.36 1.15-.36 1.78 0 2.48 2.02 4.5 4.5 4.5.63 0 1.23-.13 1.77-.36l.98.98c-.88.24-1.8.38-2.75.38-3.79 0-7.17-2.13-8.82-5.5.7-1.43 1.72-2.61 2.93-3.53z"}),"VisibilityOffOutlined"),default_1$1=VisibilityOffOutlined.default=_default$1,FilterList={},_interopRequireDefault=interopRequireDefault.exports,default_1=(Object.defineProperty(FilterList,"__esModule",{value:!0}),FilterList.default=void 0),_createSvgIcon=_interopRequireDefault(createSvgIcon),_jsxRuntime=jsxRuntime.exports,_default=(0,_createSvgIcon.default)((0,_jsxRuntime.jsx)("path",{d:"M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z"}),"FilterList"),default_1=FilterList.default=_default;const SLICE_NAME="appCenterNew";function isNpmRepoModule(e){return e.moduleRepo===ModuleRepo.NPM}function isGithubModule(e){return e.moduleRepo===ModuleRepo.Github}!function(e){e.NPM="npm",e.Github="github"}(ModuleRepo=ModuleRepo||{}),function(e){e.ACTIVE="active",e.DELETED="deleted"}(ModuleStatus=ModuleStatus||{}),function(e){e.mention="mention",e.watchlist="watchlist",e.collection="collection",e.tdo="tdo"}(ContextMenuExtensionType=ContextMenuExtensionType||{}),function(e){e.PanelClosed="closed",e.PanelOpen="open"}(UiInfo=UiInfo||{}),function(e){e[e.Pending=0]="Pending",e[e.Submitting=1]="Submitting",e[e.Success=2]="Success",e[e.Error=3]="Error"}(FormStatus=FormStatus||{}),function(e){e.Pending="pending",e.EmptyFieldError="This field should not be empty",e.SpecialCharError="This field cannot contain special characters"}(FormValidations=FormValidations||{}),function(e){e.FullyNetworkIsolated="FullyNetworkIsolated",e.MostlyNetworkIsolated="MostlyNetworkIsolated",e.NonNetworkIsolated="NonNetworkIsolated",e.HumanReview="HumanReview"}(DeploymentModel=DeploymentModel||{}),function(e){e.Idle="idle",e.Uploading="uploading",e.Uploaded="uploaded",e.Failed="failed",e.Aborted="aborted"}(IconImportStatus=IconImportStatus||{}),function(e){e.String="String",e.Boolean="Boolean",e.Date="Date",e.Integer="Integer",e.JSON="JSON",e.Float="Float"}(AppConfigType=AppConfigType||{}),function(e){e.Organization="Organization",e.User="User"}(AppConfigLevel=AppConfigLevel||{});const namespace$7="uiState",initialState$6={status:"idle"},slice$6=createSlice({name:SLICE_NAME+"/"+namespace$7,initialState:initialState$6,reducers:{}}),actions$7=slice$6.actions;var uiState=slice$6.reducer;const namespace$6="appFormState",initialState$5={app:{id:"",configFields:[],contextMenuExtensions:{mentions:[],tdos:[],watchlists:[],collections:[]},contextMenuExtensionIdsForBulkDelete:{ids:[]},name:"",description:"",iconPath:"",url:"",entityTags:[],headerbarEnabled:!0,applicationHeaderbar:{name:"",elementId:"",config:{title:"",backgroundColor:"",zIndex:null,logoSrc:"",help:!1,notification:!1,hidePasswordReset:!1,displaySupportChat:!1}},authMethod:"none",oauthUrl:"",nodeModules:[],flows:[],engines:[],schemas:[],flowsToDelete:[],enginesToDelete:[],schemasToDelete:[]},step:[],isLoadingExistingAppData:!1,isEditForm:!1,isResumeSession:!1,formValidations:FormValidations.Pending,formStatus:FormStatus.Pending,uiInfo:UiInfo.PanelClosed,currentComponents:{engines:[],dataRegistries:[]},apps:[],prevNodeModules:[],prevContextMenuExtensions:{mentions:[],tdos:[],watchlists:[],collections:[]}},slice$5=createSlice({name:SLICE_NAME+"/"+namespace$6,initialState:initialState$5,reducers:{createNewApp(e){e.formStatus=FormStatus.Submitting},editApp(e,t){e.isLoadingExistingAppData=!0,e.isEditForm=!0},setEditAppExistingData(e,t){e.isLoadingExistingAppData=!1,lodash.exports.merge(e.app,t.payload),e.prevNodeModules=t.payload.nodeModules,e.prevContextMenuExtensions=t.payload.contextMenuExtensions},updateAppStart(e,t){e.formStatus=FormStatus.Submitting,e.isEditForm=!0},createAppStart(e,t){e.formStatus=FormStatus.Submitting},createAppSuccess(e,{payload:t}){e.formStatus=FormStatus.Success,lodash.exports.set(e.app,"id",t)},createAppFailed(e,t){e.formStatus=FormStatus.Error},stepper(e,t){e.step=t.payload},updateAppFormField(e,t){var{field:t,value:a}=t.payload;lodash.exports.set(e.app,lodash.exports.camelCase(t),a)},updateApplicationHeaderbar(e,t){var{field:t,value:a}=t.payload;lodash.exports.set(e.app.applicationHeaderbar,t,a)},addConfigField(e,t){e.app.configFields=lodash.exports.concat(e.app.configFields,t.payload)},createConfigField(e,t){e.app.configFields=lodash.exports.concat(e.app.configFields,t.payload.newConfigField)},updateConfigField(e,t){var{configFields:t,index:a}=t.payload;lodash.exports.set(e,`app.configFields[${a}]`,t)},removeConfigField(e,t){e.app.configFields.splice(t.payload.removeIndex,1)},clearConfigFields(e){e.app.configFields=[]},addContextMenuExtension(e,t){var t=t.payload["extension"],a=t.type+"s";e.app.contextMenuExtensions[a]=lodash.exports.concat(e.app.contextMenuExtensions[a],t)},updateContextMenuExtension(e,t){var{extension:t,index:a}=t.payload;lodash.exports.set(e,`app.contextMenuExtensions.${t.type+"s"}[${a}]`,t)},removeContextMenuExtension(e,t){var{extensionType:t,index:a}=t.payload;e.app.contextMenuExtensionIdsForBulkDelete.ids.push(e.app.contextMenuExtensions[t+"s"][a].id),e.app.contextMenuExtensions[t+"s"].splice(a,1)},clearContextMenuExtensions(e){e.app.contextMenuExtensions={mentions:[],tdos:[],watchlists:[],collections:[]}},addNodeModule(e,t){var a=lodash.exports.findIndex(e.app.nodeModules,{moduleName:t.payload.moduleName,status:ModuleStatus.DELETED});0<=a?lodash.exports.set(e,`app.nodeModules[${a}]`,t.payload):e.app.nodeModules=lodash.exports.concat(e.app.nodeModules,t.payload)},updateNodeModule(e,t){var{nodeModules:t,index:a}=t.payload;lodash.exports.set(e,`app.nodeModules[${a}]`,t)},removeNodeModule(e,t){e.app.nodeModules.splice(t.payload,1)},fetchApplications(e,t){e.apps=null==(e=t.payload)?void 0:e.records},resumeSession(e,{payload:t}){lodash.exports.set(e,"app",t),lodash.exports.set(e,"isResumeSession",!0)},clearSession(e){localStorage.removeItem("appOnboardingSession"),lodash.exports.set(e,"app",initialState$5.app)}}}),actions$6=slice$5.actions;var appFormState$1=slice$5.reducer;const namespace$5="flowLinkingPanelState",initialState$4={searchTerm:"",isLoadingSearchResults:!1,sortOrder:"asc",searchResults:[]},slice$4=createSlice({name:SLICE_NAME+"/"+namespace$5,initialState:initialState$4,reducers:{searchByTerm(e,t){set_1(e,"searchTerm",t.payload)},fetchingStart(e){set_1(e,"isLoadingSearchResults",!0)},fetchingDone(e){set_1(e,"isLoadingSearchResults",!1)},toggleSortOrder(e,t){set_1(e,"sortOrder",lodash.exports.isNil(t.payload)?"asc"===e.sortOrder?"desc":"asc":t.payload)},updateFlowLinkingPanelField(e,t){var{field:t,value:a}=t.payload;set_1(e,t,a)}}}),actions$5=slice$4.actions;var flowLinkingPanelState=slice$4.reducer;const namespace$4="schemaLinkingPanelState",initialState$3={searchTerm:"",isLoadingSearchResults:!1,sortOrder:"asc",searchResults:[]},slice$3=createSlice({name:SLICE_NAME+"/"+namespace$4,initialState:initialState$3,reducers:{searchByTerm(e,t){set_1(e,"searchTerm",t.payload)},fetchingStart(e){set_1(e,"isLoadingSearchResults",!0)},fetchingDone(e){set_1(e,"isLoadingSearchResults",!1)},toggleSortOrder(e,t){set_1(e,"sortOrder",lodash.exports.isNil(t.payload)?"asc"===e.sortOrder?"desc":"asc":t.payload)},updateSchemaLinkingPanelField(e,t){var{field:t,value:a}=t.payload;set_1(e,t,a)}}}),actions$4=slice$3.actions;var schemaLinkingPanelState=slice$3.reducer;const namespace$3="engineLinkingPanelState",initialState$2={searchTerm:"",isLoadingSearchResults:!1,sortOrder:"asc",searchResults:[]},slice$2=createSlice({name:SLICE_NAME+"/"+namespace$3,initialState:initialState$2,reducers:{searchByTerm(e,t){set_1(e,"searchTerm",t.payload)},fetchingStart(e){set_1(e,"isLoadingSearchResults",!0)},fetchingDone(e){set_1(e,"isLoadingSearchResults",!1)},toggleSortOrder(e,t){set_1(e,"sortOrder",lodash.exports.isNil(t.payload)?"asc"===e.sortOrder?"desc":"asc":t.payload)},updateEngineLinkingPanelField(e,t){var{field:t,value:a}=t.payload;set_1(e,t,a)}}}),actions$3=slice$2.actions;var engineLinkingPanelState=slice$2.reducer;const namespace$2="appEventsPanelState",initialState$1={getEvents:!1,isLoadingSearchResults:!1,sortOrder:"asc",handlers:[],searchResults:[]},slice$1=createSlice({name:SLICE_NAME+"/"+namespace$2,initialState:initialState$1,reducers:{getEvents(e,t){set_1(e,"getEvents",t.payload)},fetchingStart(e){set_1(e,"isLoadingSearchResults",!0)},fetchingDone(e){set_1(e,"isLoadingSearchResults",!1)},addHandler(e,t){var a=JSON.parse(JSON.stringify(e.handlers)),{eventIds:t,eventNames:s,eventType:n,webhook:i,automateFlowId:o}=t.payload;a.push({eventIds:t,eventNames:s,eventType:n,webhook:i,automateFlowId:o}),set_1(e,"handlers",a)},editHandler(e,t){var{handler:t,index:a}=t.payload;set_1(e,`handlers[${a}]`,t)},deleteHandler(e,t){var t=t.payload,a=JSON.parse(JSON.stringify(e.handlers));a.splice(t,1),set_1(e,"handlers",a)},updateEventsPanelField(e,t){var{field:t,value:a}=t.payload;set_1(e,t,a)},resumeSession(e,{payload:t}){set_1(e,"handlers",t)}}}),actions$2=slice$1.actions;var eventsPanelState=slice$1.reducer;const namespace$1="iconUploadState",initialState={file:null,status:IconImportStatus.Idle},slice=createSlice({name:SLICE_NAME+"/"+namespace$1,initialState:initialState,reducers:{uploadIconStart(e,{payload:t}){e.file=t.file,e.status=IconImportStatus.Uploading},updateIcon(e,{payload:t}){e.file=Object.assign(Object.assign({},e.file),t)},uploadIconSuccess(e){e.status=IconImportStatus.Uploaded},uploadIconFailed(e,{payload:t}){e.file=null,e.error=t,e.status=IconImportStatus.Failed},deleteLocalIcon(e){e.file=null}}}),actions$1=slice.actions;var iconUploadState=slice.reducer;const namespace=SLICE_NAME,actions={[namespace$7]:actions$7,[namespace$6]:actions$6,[namespace$5]:actions$5,[namespace$4]:actions$4,[namespace$3]:actions$3,[namespace$1]:actions$1,[namespace$2]:actions$2},rootReducer=combineReducers({[namespace$7]:uiState,[namespace$6]:appFormState$1,[namespace$3]:engineLinkingPanelState,[namespace$5]:flowLinkingPanelState,[namespace$4]:schemaLinkingPanelState,[namespace$1]:iconUploadState,[namespace$2]:eventsPanelState}),selectApp=e=>e[namespace].appFormState.app,selectApps=e=>e[namespace].appFormState.apps,selectIsEditForm=e=>lodash.exports.pick(e[namespace].appFormState,"isEditForm"),selectIsLoadingExistingAppData=e=>lodash.exports.pick(e[namespace].appFormState,"isLoadingExistingAppData"),selectConfigFields=e=>e[namespace].appFormState.app.configFields,selectContextMenuExtensions=e=>e[namespace].appFormState.app.contextMenuExtensions,selectAppUrl=e=>e[namespace].appFormState.app.url,selectEntityTags=e=>e[namespace].appFormState.app.entityTags,selectNodeModules=e=>e[namespace].appFormState.app.nodeModules,selectPrevNodeModules=e=>e[namespace].appFormState.prevNodeModules,selectPrevContextMenuExtensions=e=>e[namespace].appFormState.prevContextMenuExtensions,selectIsResumeSession=e=>lodash.exports.get(e[namespace].appFormState,"isResumeSession");var appFormState=Object.freeze({__proto__:null,selectApp:selectApp,selectApps:selectApps,selectIsEditForm:selectIsEditForm,selectIsLoadingExistingAppData:selectIsLoadingExistingAppData,selectConfigFields:selectConfigFields,selectContextMenuExtensions:selectContextMenuExtensions,selectAppUrl:selectAppUrl,selectEntityTags:selectEntityTags,selectNodeModules:selectNodeModules,selectPrevNodeModules:selectPrevNodeModules,selectPrevContextMenuExtensions:selectPrevContextMenuExtensions,selectIsResumeSession:selectIsResumeSession});const selectFlowLinkingPanel=e=>e[namespace].flowLinkingPanelState,selectSchemaLinkingPanel=e=>e[namespace].schemaLinkingPanelState,selectEventPanel=e=>e[namespace].appEventsPanelState;var eventPanelState=Object.freeze({__proto__:null,selectEventPanel:selectEventPanel});const selectIcon=e=>e[namespace].iconUploadState.file,selectApiConfigs=createSelector([rootApiSelector,graphEndpointSelector,sessionTokenSelector],(e,t,a)=>({apiRoot:e,graphQLEndpoint:t,token:a}));function __awaiter(e,o,r,l){return new(r=r||Promise)(function(a,t){function s(e){try{i(l.next(e))}catch(e){t(e)}}function n(e){try{i(l.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?a(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,n)}i((l=l.apply(e,o||[])).next())})}const getEnginesByName=(a,s={name:""})=>__awaiter(void 0,void 0,void 0,function*(){var e={name:s.name},t="getEngines";return yield baseGraphQLApiWithError(Object.assign({query:"\n query getEngines($name:String){\n engines(\n name: $name,\n orderBy: {\n field: name,\n direction: asc\n }\n ) {\n records {\n id\n name\n modifiedDateTime\n edgeVersion\n iconPath\n description\n category {\n id\n }\n }\n }\n }\n ",variables:e,operationName:t},a))}),getFlowsByName=(a,s={name:""})=>__awaiter(void 0,void 0,void 0,function*(){var e={name:s.name},t="getFlows";return yield baseGraphQLApiWithError(Object.assign({query:'\n query getFlows($name:String){\n engines(\n name: $name,\n categoryId: "c5458876-43d2-41e8-a340-f734702df04a",\n orderBy: {\n field: name,\n direction: asc\n }\n ) {\n records {\n id,\n name,\n modifiedDateTime,\n edgeVersion\n }\n }\n }\n ',variables:e,operationName:t},a))}),createApplication=(t,a)=>__awaiter(void 0,void 0,void 0,function*(){var e="createApplication";return(yield baseGraphQLApiWithError(Object.assign(Object.assign({query:"\n mutation createApplication ($input: CreateApplication!) {\n createApplication (input: $input) {\n id\n }\n }\n ",variables:{input:a},operationName:e},t),{throwWholeErrorObject:!0})))[e]}),updateAppComponents=(o,r)=>__awaiter(void 0,void 0,void 0,function*(){const{engines:t,dataRegistries:a,id:s}=r,n="updateApplicationComponent";let i="";lodash.exports.forEach(lodash.exports.keys(t),e=>{lodash.exports.isEmpty(t[e])||(i+=`
2
- ${e}Engines: ${n} (input: {
3
- id: "${s}"
4
- componentIds: [${lodash.exports.join(lodash.exports.map(t[e],e=>`"${e}"`),",")}]
5
- type: engines
6
- action: ${e}
7
- }) {
8
- engines {
9
- records {
10
- id
11
- }
12
- }
13
- }
14
- `)}),lodash.exports.forEach(lodash.exports.keys(a),e=>{lodash.exports.isEmpty(a[e])||(i+=`
15
- ${e}DataRegistries: ${n} (input: {
16
- id: "${s}"
17
- componentIds: [${lodash.exports.join(lodash.exports.map(a[e],e=>`"${e}"`),",")}]
18
- type: dataRegistries
19
- action: ${e}
20
- }) {
21
- dataRegistries {
22
- records {
23
- id
24
- }
25
- }
26
- }
27
- `)});var e=`mutation ${n} {
28
- ${i}
29
- }`;return(yield baseGraphQLApiWithError(Object.assign({query:e,operationName:n},o)))[n]}),createAppConfig=(a,s,n)=>__awaiter(void 0,void 0,void 0,function*(){var e="applicationConfigDefinitionCreate",t=lodash.exports.map(n,e=>{var t={appId:s,configKey:e.name,configType:AppConfigType[e.type],configLevel:AppConfigLevel[e.configLevel],required:e.required,description:e.description,secured:!1};return lodash.exports.isNil(e.defaultValue)||(t.defaultValue=e.defaultValue),t});return(yield baseGraphQLApiWithError(Object.assign({query:"mutation applicationConfigDefinitionCreate ($input: [ApplicationConfigDefinitionCreate]) {\n applicationConfigDefinitionCreate (input: $input) {\n records {\n configKey\n }\n }\n }",variables:{input:t},operationName:e},a)))[e]}),applicationFieldsFragment=`fragment applicationFields on Application {
1
+ import{X as createSlice,ci as combineReducers,cj as createSelector,a2 as rootApiSelector,a4 as graphEndpointSelector,a3 as sessionTokenSelector,m as makeStyles,n as useSelector,r as react,j as jsxRuntime,x as FormControl,b$ as FormHelperText$2,aB as FormControlLabel,aC as Checkbox,l as useDispatch,bT as Icon,cC as Upload,bK as AIWareCacheProvider,cl as AIWareThemeProvider,$ as DynamicModuleLoader,A as AIWareIntlProvider,ah as all,F as FormattedMessage,y as TextField,dG as selectApiConfigs$1,I as InputLabel,H as Select,M as MenuItem,t as lodash,eM as selectIsOLPEnabled,cy as userSelector,cv as hidePanel,B as Box,aK as CircularProgress,f8 as img$u,T as Typography,K as Button,N as Divider,ba as Tabs,bb as Tab,eU as Popover,aq as takeLatest$1,am as Tooltip,E as IconButton,fP as AddUser,cz as MoreVert,cn as Close,c5 as Hide,cA as Menu,cD as Delete,f2 as Download,L as LoadingButton,fc as CheckCircle,c7 as showMessage,c8 as MessageSeverity,at as select,as as put,a0 as preferredLanguageSelector,fZ as Modal,bf as AIWareFormatMessage,cJ as baseGraphQLApiWithError}from"./js-core.esm.js";import{f as find_1}from"./js-core.esm14.js";import{g as getProcessingCenterContentTemplatesModule,s as selectContentTemplatesToSave,C as ContentTemplates}from"./js-core.esm58.js";import{d as default_1,S as Stepper,a as Step,b as StepLabel}from"./js-core.esm33.js";import{C as ContentCopy}from"./js-core.esm43.js";import{B as Box$1}from"./js-core.esm31.js";import"./js-core.esm17.js";import"./js-core.esm59.js";import"./js-core.esm28.js";import"./js-core.esm34.js";import"./js-core.esm35.js";import"./js-core.esm39.js";import"./js-core.esm9.js";import"./js-core.esm29.js";import"./js-core.esm20.js";import"./js-core.esm30.js";import"./js-core.esm36.js";import"./js-core.esm32.js";import"./js-core.esm23.js";import"./js-core.esm42.js";import"./js-core.esm24.js";var match,version,store,wmget,wmhas,wmset,set$1,get,has,STATE,ESourcePermission,commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},check=function(e){return e&&e.Math==Math&&e},global$q=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof commonjsGlobal&&commonjsGlobal)||function(){return this}()||Function("return this")(),objectGetOwnPropertyDescriptor={},fails$l=function(e){try{return!!e()}catch(e){return!0}},fails$k=fails$l,descriptors=!fails$l(function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}),fails$j=fails$l,functionBindNative=!fails$l(function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}),NATIVE_BIND$3=functionBindNative,call$i=Function.prototype.call,functionCall=NATIVE_BIND$3?call$i.bind(call$i):function(){return call$i.apply(call$i,arguments)},objectPropertyIsEnumerable={},$propertyIsEnumerable={}.propertyIsEnumerable,getOwnPropertyDescriptor$3=Object.getOwnPropertyDescriptor,NASHORN_BUG=getOwnPropertyDescriptor$3&&!$propertyIsEnumerable.call({1:2},1),createPropertyDescriptor$5=(objectPropertyIsEnumerable.f=NASHORN_BUG?function(e){e=getOwnPropertyDescriptor$3(this,e);return!!e&&e.enumerable}:$propertyIsEnumerable,function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}),NATIVE_BIND$2=functionBindNative,FunctionPrototype$2=Function.prototype,bind$8=FunctionPrototype$2.bind,call$h=FunctionPrototype$2.call,uncurryThis$m=NATIVE_BIND$2&&bind$8.bind(call$h,call$h),functionUncurryThis=NATIVE_BIND$2?function(e){return e&&uncurryThis$m(e)}:function(e){return e&&function(){return call$h.apply(e,arguments)}},uncurryThis$l=functionUncurryThis,toString$8=uncurryThis$l({}.toString),stringSlice$5=uncurryThis$l("".slice),classofRaw$1=function(e){return stringSlice$5(toString$8(e),8,-1)},uncurryThis$k=functionUncurryThis,fails$i=fails$l,classof$7=classofRaw$1,$Object$4=Object,split$3=functionUncurryThis("".split),indexedObject=fails$i(function(){return!$Object$4("z").propertyIsEnumerable(0)})?function(e){return"String"==classof$7(e)?split$3(e,""):$Object$4(e)}:$Object$4,$TypeError$b=TypeError,requireObjectCoercible$4=function(e){if(null==e)throw $TypeError$b("Can't call method on "+e);return e},IndexedObject$1=indexedObject,requireObjectCoercible$3=requireObjectCoercible$4,toIndexedObject$5=function(e){return IndexedObject$1(requireObjectCoercible$3(e))},isCallable$m=function(e){return"function"==typeof e},isCallable$l=isCallable$m,isObject$a=function(e){return"object"==typeof e?null!==e:isCallable$l(e)},global$p=global$q,isCallable$k=isCallable$m,aFunction=function(e){return isCallable$k(e)?e:void 0},getBuiltIn$8=function(e,t){return arguments.length<2?aFunction(global$p[e]):global$p[e]&&global$p[e][t]},uncurryThis$j=functionUncurryThis,objectIsPrototypeOf=functionUncurryThis({}.isPrototypeOf),getBuiltIn$7=getBuiltIn$8,engineUserAgent=getBuiltIn$8("navigator","userAgent")||"",global$o=global$q,userAgent$3=engineUserAgent,process$3=global$o.process,Deno$1=global$o.Deno,versions=process$3&&process$3.versions||Deno$1&&Deno$1.version,v8=versions&&versions.v8,engineV8Version=version=!(version=v8?0<(match=v8.split("."))[0]&&match[0]<4?1:+(match[0]+match[1]):version)&&userAgent$3&&(!(match=userAgent$3.match(/Edge\/(\d+)/))||74<=match[1])&&(match=userAgent$3.match(/Chrome\/(\d+)/))?+match[1]:version,V8_VERSION$1=engineV8Version,fails$h=fails$l,nativeSymbol=!!Object.getOwnPropertySymbols&&!fails$h(function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&V8_VERSION$1&&V8_VERSION$1<41}),NATIVE_SYMBOL$1=nativeSymbol,useSymbolAsUid=nativeSymbol&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,getBuiltIn$6=getBuiltIn$8,isCallable$j=isCallable$m,isPrototypeOf$4=objectIsPrototypeOf,USE_SYMBOL_AS_UID$1=useSymbolAsUid,$Object$3=Object,isSymbol$2=useSymbolAsUid?function(e){return"symbol"==typeof e}:function(e){var t=getBuiltIn$6("Symbol");return isCallable$j(t)&&isPrototypeOf$4(t.prototype,$Object$3(e))},$String$3=String,tryToString$4=function(e){try{return $String$3(e)}catch(e){return"Object"}},isCallable$i=isCallable$m,tryToString$3=tryToString$4,$TypeError$a=TypeError,aCallable$7=function(e){if(isCallable$i(e))return e;throw $TypeError$a(tryToString$3(e)+" is not a function")},aCallable$6=aCallable$7,getMethod$3=function(e,t){e=e[t];return null==e?void 0:aCallable$6(e)},call$g=functionCall,isCallable$h=isCallable$m,isObject$9=isObject$a,$TypeError$9=TypeError,ordinaryToPrimitive$1=function(e,t){var r,o;if("string"===t&&isCallable$h(r=e.toString)&&!isObject$9(o=call$g(r,e)))return o;if(isCallable$h(r=e.valueOf)&&!isObject$9(o=call$g(r,e)))return o;if("string"!==t&&isCallable$h(r=e.toString)&&!isObject$9(o=call$g(r,e)))return o;throw $TypeError$9("Can't convert object to primitive value")},shared$4={exports:{}},isPure=!1,global$n=global$q,defineProperty$7=Object.defineProperty,defineGlobalProperty$3=function(t,r){try{defineProperty$7(global$n,t,{value:r,configurable:!0,writable:!0})}catch(e){global$n[t]=r}return r},global$m=global$q,defineGlobalProperty$2=defineGlobalProperty$3,SHARED="__core-js_shared__",store$3=global$q[SHARED]||defineGlobalProperty$2(SHARED,{}),sharedStore=store$3,store$2=sharedStore,requireObjectCoercible$2=((shared$4.exports=function(e,t){return store$2[e]||(store$2[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.24.1",mode:"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.24.1/LICENSE",source:"https://github.com/zloirock/core-js"}),requireObjectCoercible$4),$Object$2=Object,toObject$4=function(e){return $Object$2(requireObjectCoercible$2(e))},uncurryThis$i=functionUncurryThis,toObject$3=toObject$4,hasOwnProperty=functionUncurryThis({}.hasOwnProperty),hasOwnProperty_1=Object.hasOwn||function(e,t){return hasOwnProperty(toObject$3(e),t)},uncurryThis$h=functionUncurryThis,id=0,postfix=Math.random(),toString$7=uncurryThis$h(1..toString),uid$2=function(e){return"Symbol("+(void 0===e?"":e)+")_"+toString$7(++id+postfix,36)},global$l=global$q,shared$3=shared$4.exports,hasOwn$d=hasOwnProperty_1,uid$1=uid$2,NATIVE_SYMBOL=nativeSymbol,USE_SYMBOL_AS_UID=useSymbolAsUid,WellKnownSymbolsStore=shared$3("wks"),Symbol$2=global$l.Symbol,symbolFor=Symbol$2&&Symbol$2.for,createWellKnownSymbol=USE_SYMBOL_AS_UID?Symbol$2:Symbol$2&&Symbol$2.withoutSetter||uid$1,wellKnownSymbol$i=function(e){var t;return hasOwn$d(WellKnownSymbolsStore,e)&&(NATIVE_SYMBOL||"string"==typeof WellKnownSymbolsStore[e])||(t="Symbol."+e,NATIVE_SYMBOL&&hasOwn$d(Symbol$2,e)?WellKnownSymbolsStore[e]=Symbol$2[e]:WellKnownSymbolsStore[e]=(USE_SYMBOL_AS_UID&&symbolFor?symbolFor:createWellKnownSymbol)(t)),WellKnownSymbolsStore[e]},call$f=functionCall,isObject$8=isObject$a,isSymbol$1=isSymbol$2,getMethod$2=getMethod$3,ordinaryToPrimitive=ordinaryToPrimitive$1,wellKnownSymbol$h=wellKnownSymbol$i,$TypeError$8=TypeError,TO_PRIMITIVE=wellKnownSymbol$i("toPrimitive"),toPrimitive$1=function(e,t){if(!isObject$8(e)||isSymbol$1(e))return e;var r=getMethod$2(e,TO_PRIMITIVE);if(r){if(r=call$f(r,e,t=void 0===t?"default":t),!isObject$8(r)||isSymbol$1(r))return r;throw $TypeError$8("Can't convert object to primitive value")}return ordinaryToPrimitive(e,t=void 0===t?"number":t)},toPrimitive=toPrimitive$1,isSymbol=isSymbol$2,toPropertyKey$3=function(e){e=toPrimitive(e,"string");return isSymbol(e)?e:e+""},global$k=global$q,isObject$7=isObject$a,document$3=global$q.document,EXISTS$1=isObject$7(document$3)&&isObject$7(document$3.createElement),documentCreateElement$2=function(e){return EXISTS$1?document$3.createElement(e):{}},DESCRIPTORS$d=descriptors,fails$g=fails$l,createElement$1=documentCreateElement$2,ie8DomDefine=!descriptors&&!fails$l(function(){return 7!=Object.defineProperty(createElement$1("div"),"a",{get:function(){return 7}}).a}),DESCRIPTORS$c=descriptors,call$e=functionCall,propertyIsEnumerableModule$1=objectPropertyIsEnumerable,createPropertyDescriptor$4=createPropertyDescriptor$5,toIndexedObject$4=toIndexedObject$5,toPropertyKey$2=toPropertyKey$3,hasOwn$c=hasOwnProperty_1,IE8_DOM_DEFINE$1=ie8DomDefine,$getOwnPropertyDescriptor$1=Object.getOwnPropertyDescriptor,objectDefineProperty=(objectGetOwnPropertyDescriptor.f=DESCRIPTORS$c?$getOwnPropertyDescriptor$1:function(e,t){if(e=toIndexedObject$4(e),t=toPropertyKey$2(t),IE8_DOM_DEFINE$1)try{return $getOwnPropertyDescriptor$1(e,t)}catch(e){}if(hasOwn$c(e,t))return createPropertyDescriptor$4(!call$e(propertyIsEnumerableModule$1.f,e,t),e[t])},{}),DESCRIPTORS$b=descriptors,fails$f=fails$l,v8PrototypeDefineBug=descriptors&&fails$l(function(){return 42!=Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype}),isObject$6=isObject$a,$String$2=String,$TypeError$7=TypeError,anObject$e=function(e){if(isObject$6(e))return e;throw $TypeError$7($String$2(e)+" is not an object")},DESCRIPTORS$a=descriptors,IE8_DOM_DEFINE=ie8DomDefine,V8_PROTOTYPE_DEFINE_BUG$1=v8PrototypeDefineBug,anObject$d=anObject$e,toPropertyKey$1=toPropertyKey$3,$TypeError$6=TypeError,$defineProperty=Object.defineProperty,$getOwnPropertyDescriptor=Object.getOwnPropertyDescriptor,ENUMERABLE="enumerable",CONFIGURABLE$1="configurable",WRITABLE="writable",DESCRIPTORS$9=(objectDefineProperty.f=DESCRIPTORS$a?V8_PROTOTYPE_DEFINE_BUG$1?function(e,t,r){var o;return anObject$d(e),t=toPropertyKey$1(t),anObject$d(r),"function"==typeof e&&"prototype"===t&&"value"in r&&WRITABLE in r&&!r[WRITABLE]&&(o=$getOwnPropertyDescriptor(e,t))&&o[WRITABLE]&&(e[t]=r.value,r={configurable:(CONFIGURABLE$1 in r?r:o)[CONFIGURABLE$1],enumerable:(ENUMERABLE in r?r:o)[ENUMERABLE],writable:!1}),$defineProperty(e,t,r)}:$defineProperty:function(e,t,r){if(anObject$d(e),t=toPropertyKey$1(t),anObject$d(r),IE8_DOM_DEFINE)try{return $defineProperty(e,t,r)}catch(e){}if("get"in r||"set"in r)throw $TypeError$6("Accessors not supported");return"value"in r&&(e[t]=r.value),e},descriptors),definePropertyModule$5=objectDefineProperty,createPropertyDescriptor$3=createPropertyDescriptor$5,createNonEnumerableProperty$5=DESCRIPTORS$9?function(e,t,r){return definePropertyModule$5.f(e,t,createPropertyDescriptor$3(1,r))}:function(e,t,r){return e[t]=r,e},makeBuiltIn$3={exports:{}},DESCRIPTORS$8=descriptors,hasOwn$b=hasOwnProperty_1,FunctionPrototype$1=Function.prototype,getDescriptor=DESCRIPTORS$8&&Object.getOwnPropertyDescriptor,EXISTS=hasOwn$b(FunctionPrototype$1,"name"),PROPER=EXISTS&&"something"===function(){}.name,CONFIGURABLE=EXISTS&&(!DESCRIPTORS$8||getDescriptor(FunctionPrototype$1,"name").configurable),functionName={EXISTS:EXISTS,PROPER:PROPER,CONFIGURABLE:CONFIGURABLE},uncurryThis$g=functionUncurryThis,isCallable$g=isCallable$m,store$1=sharedStore,functionToString=functionUncurryThis(Function.toString),inspectSource$4=(isCallable$g(store$1.inspectSource)||(store$1.inspectSource=function(e){return functionToString(e)}),store$1.inspectSource),global$j=global$q,isCallable$f=isCallable$m,inspectSource$3=inspectSource$4,WeakMap$1=global$q.WeakMap,nativeWeakMap=isCallable$f(WeakMap$1)&&/native code/.test(inspectSource$3(WeakMap$1)),shared$2=shared$4.exports,uid=uid$2,keys$1=shared$2("keys"),sharedKey$3=function(e){return keys$1[e]||(keys$1[e]=uid(e))},hiddenKeys$4={},NATIVE_WEAK_MAP=nativeWeakMap,global$i=global$q,uncurryThis$f=functionUncurryThis,isObject$5=isObject$a,createNonEnumerableProperty$4=createNonEnumerableProperty$5,hasOwn$a=hasOwnProperty_1,shared$1=sharedStore,sharedKey$2=sharedKey$3,hiddenKeys$3=hiddenKeys$4,OBJECT_ALREADY_INITIALIZED="Object already initialized",TypeError$4=global$i.TypeError,WeakMap=global$i.WeakMap,enforce=function(e){return has(e)?get(e):set$1(e,{})},getterFor=function(t){return function(e){if(isObject$5(e)&&(e=get(e)).type===t)return e;throw TypeError$4("Incompatible receiver, "+t+" required")}},internalState=(has=NATIVE_WEAK_MAP||shared$1.state?(store=shared$1.state||(shared$1.state=new WeakMap),wmget=uncurryThis$f(store.get),wmhas=uncurryThis$f(store.has),wmset=uncurryThis$f(store.set),set$1=function(e,t){if(wmhas(store,e))throw new TypeError$4(OBJECT_ALREADY_INITIALIZED);return t.facade=e,wmset(store,e,t),t},get=function(e){return wmget(store,e)||{}},function(e){return wmhas(store,e)}):(STATE=sharedKey$2("state"),hiddenKeys$3[STATE]=!0,set$1=function(e,t){if(hasOwn$a(e,STATE))throw new TypeError$4(OBJECT_ALREADY_INITIALIZED);return t.facade=e,createNonEnumerableProperty$4(e,STATE,t),t},get=function(e){return hasOwn$a(e,STATE)?e[STATE]:{}},function(e){return hasOwn$a(e,STATE)}),{set:set$1,get:get,has:has,enforce:enforce,getterFor:getterFor}),fails$e=fails$l,isCallable$e=isCallable$m,hasOwn$9=hasOwnProperty_1,DESCRIPTORS$7=descriptors,CONFIGURABLE_FUNCTION_NAME$1=functionName.CONFIGURABLE,inspectSource$2=inspectSource$4,InternalStateModule$5=internalState,enforceInternalState$1=InternalStateModule$5.enforce,getInternalState$3=InternalStateModule$5.get,defineProperty$6=Object.defineProperty,CONFIGURABLE_LENGTH=DESCRIPTORS$7&&!fails$e(function(){return 8!==defineProperty$6(function(){},"length",{value:8}).length}),TEMPLATE=String(String).split("String"),makeBuiltIn$2=makeBuiltIn$3.exports=function(e,t,r){"Symbol("===String(t).slice(0,7)&&(t="["+String(t).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!hasOwn$9(e,"name")||CONFIGURABLE_FUNCTION_NAME$1&&e.name!==t)&&(DESCRIPTORS$7?defineProperty$6(e,"name",{value:t,configurable:!0}):e.name=t),CONFIGURABLE_LENGTH&&r&&hasOwn$9(r,"arity")&&e.length!==r.arity&&defineProperty$6(e,"length",{value:r.arity});try{r&&hasOwn$9(r,"constructor")&&r.constructor?DESCRIPTORS$7&&defineProperty$6(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}r=enforceInternalState$1(e);return hasOwn$9(r,"source")||(r.source=TEMPLATE.join("string"==typeof t?t:"")),e},isCallable$d=(Function.prototype.toString=makeBuiltIn$2(function(){return isCallable$e(this)&&getInternalState$3(this).source||inspectSource$2(this)},"toString"),isCallable$m),definePropertyModule$4=objectDefineProperty,makeBuiltIn$1=makeBuiltIn$3.exports,defineGlobalProperty$1=defineGlobalProperty$3,defineBuiltIn$a=function(e,t,r,o){var n=(o=o||{}).enumerable,s=void 0!==o.name?o.name:t;if(isCallable$d(r)&&makeBuiltIn$1(r,s,o),o.global)n?e[t]=r:defineGlobalProperty$1(t,r);else{try{o.unsafe?e[t]&&(n=!0):delete e[t]}catch(e){}n?e[t]=r:definePropertyModule$4.f(e,t,{value:r,enumerable:!1,configurable:!o.nonConfigurable,writable:!o.nonWritable})}return e},objectGetOwnPropertyNames={},ceil=Math.ceil,floor$3=Math.floor,mathTrunc=Math.trunc||function(e){e=+e;return(0<e?floor$3:ceil)(e)},trunc=mathTrunc,toIntegerOrInfinity$3=function(e){e=+e;return e!=e||0==e?0:trunc(e)},toIntegerOrInfinity$2=toIntegerOrInfinity$3,max$1=Math.max,min$1=Math.min,toAbsoluteIndex$2=function(e,t){e=toIntegerOrInfinity$2(e);return e<0?max$1(e+t,0):min$1(e,t)},toIntegerOrInfinity$1=toIntegerOrInfinity$3,min=Math.min,toLength$1=function(e){return 0<e?min(toIntegerOrInfinity$1(e),9007199254740991):0},toLength=toLength$1,lengthOfArrayLike$4=function(e){return toLength(e.length)},toIndexedObject$3=toIndexedObject$5,toAbsoluteIndex$1=toAbsoluteIndex$2,lengthOfArrayLike$3=lengthOfArrayLike$4,createMethod$2=function(i){return function(e,t,r){var o,n=toIndexedObject$3(e),s=lengthOfArrayLike$3(n),a=toAbsoluteIndex$1(r,s);if(i&&t!=t){for(;a<s;)if((o=n[a++])!=o)return!0}else for(;a<s;a++)if((i||a in n)&&n[a]===t)return i||a||0;return!i&&-1}},arrayIncludes={includes:createMethod$2(!0),indexOf:createMethod$2(!1)},uncurryThis$e=functionUncurryThis,hasOwn$8=hasOwnProperty_1,toIndexedObject$2=toIndexedObject$5,indexOf$1=arrayIncludes.indexOf,hiddenKeys$2=hiddenKeys$4,push$3=uncurryThis$e([].push),objectKeysInternal=function(e,t){var r,o=toIndexedObject$2(e),n=0,s=[];for(r in o)!hasOwn$8(hiddenKeys$2,r)&&hasOwn$8(o,r)&&push$3(s,r);for(;t.length>n;)!hasOwn$8(o,r=t[n++])||~indexOf$1(s,r)||push$3(s,r);return s},enumBugKeys$3=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],internalObjectKeys$1=objectKeysInternal,enumBugKeys$2=enumBugKeys$3,hiddenKeys$1=enumBugKeys$3.concat("length","prototype"),objectGetOwnPropertySymbols=(objectGetOwnPropertyNames.f=Object.getOwnPropertyNames||function(e){return internalObjectKeys$1(e,hiddenKeys$1)},{}),getBuiltIn$5=(objectGetOwnPropertySymbols.f=Object.getOwnPropertySymbols,getBuiltIn$8),uncurryThis$d=functionUncurryThis,getOwnPropertyNamesModule=objectGetOwnPropertyNames,getOwnPropertySymbolsModule$1=objectGetOwnPropertySymbols,anObject$c=anObject$e,concat$1=functionUncurryThis([].concat),ownKeys$1=getBuiltIn$5("Reflect","ownKeys")||function(e){var t=getOwnPropertyNamesModule.f(anObject$c(e)),r=getOwnPropertySymbolsModule$1.f;return r?concat$1(t,r(e)):t},hasOwn$7=hasOwnProperty_1,ownKeys=ownKeys$1,getOwnPropertyDescriptorModule=objectGetOwnPropertyDescriptor,definePropertyModule$3=objectDefineProperty,copyConstructorProperties$1=function(e,t,r){for(var o=ownKeys(t),n=definePropertyModule$3.f,s=getOwnPropertyDescriptorModule.f,a=0;a<o.length;a++){var i=o[a];hasOwn$7(e,i)||r&&hasOwn$7(r,i)||n(e,i,s(t,i))}},fails$d=fails$l,isCallable$c=isCallable$m,replacement=/#|\.prototype\./,isForced$3=function(e,t){e=data[normalize(e)];return e==POLYFILL||e!=NATIVE&&(isCallable$c(t)?fails$d(t):!!t)},normalize=isForced$3.normalize=function(e){return String(e).replace(replacement,".").toLowerCase()},data=isForced$3.data={},NATIVE=isForced$3.NATIVE="N",POLYFILL=isForced$3.POLYFILL="P",isForced_1=isForced$3,global$h=global$q,getOwnPropertyDescriptor$2=objectGetOwnPropertyDescriptor.f,createNonEnumerableProperty$3=createNonEnumerableProperty$5,defineBuiltIn$9=defineBuiltIn$a,defineGlobalProperty=defineGlobalProperty$3,copyConstructorProperties=copyConstructorProperties$1,isForced$2=isForced_1,_export=function(e,t){var r,o,n,s=e.target,a=e.global,i=e.stat,l=a?global$h:i?global$h[s]||defineGlobalProperty(s,{}):(global$h[s]||{}).prototype;if(l)for(r in t){if(o=t[r],n=e.dontCallGetSet?(n=getOwnPropertyDescriptor$2(l,r))&&n.value:l[r],!isForced$2(a?r:s+(i?".":"#")+r,e.forced)&&void 0!==n){if(typeof o==typeof n)continue;copyConstructorProperties(o,n)}(e.sham||n&&n.sham)&&createNonEnumerableProperty$3(o,"sham",!0),defineBuiltIn$9(l,r,o,e)}},internalObjectKeys=objectKeysInternal,enumBugKeys$1=enumBugKeys$3,objectKeys$2=Object.keys||function(e){return internalObjectKeys(e,enumBugKeys$1)},DESCRIPTORS$6=descriptors,uncurryThis$c=functionUncurryThis,call$d=functionCall,fails$c=fails$l,objectKeys$1=objectKeys$2,getOwnPropertySymbolsModule=objectGetOwnPropertySymbols,propertyIsEnumerableModule=objectPropertyIsEnumerable,toObject$2=toObject$4,IndexedObject=indexedObject,$assign=Object.assign,defineProperty$5=Object.defineProperty,concat=uncurryThis$c([].concat),objectAssign=!$assign||fails$c(function(){var e,t,r,o;return!(!DESCRIPTORS$6||1===$assign({b:1},$assign(defineProperty$5({},"a",{enumerable:!0,get:function(){defineProperty$5(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)||(t={},o="abcdefghijklmnopqrst",(e={})[r=Symbol()]=7,o.split("").forEach(function(e){t[e]=e}),7!=$assign({},e)[r])||objectKeys$1($assign({},t)).join("")!=o})?function(e,t){for(var r=toObject$2(e),o=arguments.length,n=1,s=getOwnPropertySymbolsModule.f,a=propertyIsEnumerableModule.f;n<o;)for(var i,l=IndexedObject(arguments[n++]),c=s?concat(objectKeys$1(l),s(l)):objectKeys$1(l),u=c.length,d=0;d<u;)i=c[d++],DESCRIPTORS$6&&!call$d(a,l,i)||(r[i]=l[i]);return r}:$assign,$$c=_export,assign$1=objectAssign;_export({target:"Object",stat:!0,arity:2,forced:Object.assign!==assign$1},{assign:assign$1});const SLICE_NAME="processingCenter",namespace$2=(!function(e){e.Editor="editor",e.Viewer="viewer",e.Owner="owner"}(ESourcePermission=ESourcePermission||{}),"uiState"),initialState$1={status:"idle"},slice$1=createSlice({name:SLICE_NAME+"/"+namespace$2,initialState:initialState$1,reducers:{init(e){e.status="pending"},initDone(e){e.status="idle"},initFailed(e){e.status="failure"}}}),actions$2=slice$1.actions;var uiState=slice$1.reducer;const namespace$1="sourceConfiguration",initialState={status:"idle",updateStatus:"pending",createStatus:"pending",newAvatar:null,source:void 0,deleteSourceStatus:null,canBeDeletedStatus:"pending",canBeDeleted:null,sourceTypesConfig:{},selectListData:{},retryJobStatus:"pending"},slice=createSlice({name:SLICE_NAME+"/"+namespace$1,initialState:initialState,reducers:{retryJobStart(e,t){e.retryJobStatus="pending"},retryJobSuccess(e){e.retryJobStatus="success"},retryJobFailed(e){e.retryJobStatus="failure"},fetchSourceStart(e,t){e.status="pending"},fetchSourceSuccess(e,t){e.status="success",e.source=t.payload},fetchSourceFailed(e){e.status="failure"},deleteSourceStart(e,t){e.deleteSourceStatus="pending"},deleteSourceSuccess(e){e.deleteSourceStatus="success"},deleteSourceFailed(e){e.deleteSourceStatus="failure"},deleteSourceReset(e){e.deleteSourceStatus=null},checkCanBeDeletedStart(e,t){e.canBeDeletedStatus="pending"},checkCanBeDeletedSuccess(e,t){e.canBeDeletedStatus="idle",e.canBeDeleted=t.payload},checkCanBeDeletedFailed(e,t){e.canBeDeletedStatus="failure",e.canBeDeleted=!1},updateSourceStart(e,t){e.updateStatus="pending"},updateSourceSuccess(e,t){e.updateStatus="success",e.source=t.payload},updateSourceFailed(e){e.updateStatus="failure"},createSourceStart(e,t){e.createStatus="pending"},createSourceSuccess(e,t){e.createStatus="success",e.source=t.payload},createSourceFailed(e){e.createStatus="failure"},setNewAvatar(e,t){e.newAvatar=t.payload},getSourceTypes(e,t){console.log("getting source types")},setSourceTypes(e,t){var t=t.payload;const s={};null!=(t=null==t?void 0:t.records)&&t.forEach(e=>{var t;const r=(null==(t=null==(t=null==e?void 0:e.sourceSchema)?void 0:t.definition)?void 0:t.properties)||{},o=(null==(t=null==(t=null==e?void 0:e.sourceSchema)?void 0:t.definition)?void 0:t.required)||[],n={};Object.keys(r).forEach(e=>{var t=r[e];0<=o.indexOf(e)?t.isRequired=!0:t.isRequired=!1,n[e]=Object.assign(Object.assign({},t),{id:e,title:t.title,type:getFieldType(t),allowMultiple:"array"===t.type,isValid:!0}),n[e].query=getQuery(t)}),null!=(t=Object.keys(n))&&t.forEach(t=>{var e;n[t].hasOwnProperty("peerEnumKey")&&(e=find_1(n,e=>e.id===n[t].peerEnumKey))&&0<Object.keys(e).length&&(n[t].parentId=e.id,n[t].type="childSelect",n[t].options=[],n[t].parentValue=e.value)}),s[null==e?void 0:e.id]={id:e.id,name:e.name,organizationId:e.organizationId,fields:n}}),e.sourceTypesConfig=s},setSelectListData(e,t){e.selectListData[t.payload.key]=t.payload.data||{}}}}),actions$1=slice.actions;var configuration_slice=slice.reducer;function getFieldType(e){return e?"string"===e.type&&e.query||"array"===e.type?"select":e.type:""}function getQuery(e){var t;return e?e.query||(null!=(t=e.items)&&t.query?e.items.query:null):""}const namespace=SLICE_NAME,actions={[namespace$2]:actions$2,[namespace$1]:actions$1},rootReducer=combineReducers({[namespace$2]:uiState,[namespace$1]:configuration_slice}),selectUIStateStatus=e=>e[namespace].uiState.status;var wellKnownSymbol$g=wellKnownSymbol$i,TO_STRING_TAG$3=wellKnownSymbol$i("toStringTag"),test={},toStringTagSupport=(test[TO_STRING_TAG$3]="z","[object z]"===String(test)),TO_STRING_TAG_SUPPORT=toStringTagSupport,isCallable$b=isCallable$m,classofRaw=classofRaw$1,wellKnownSymbol$f=wellKnownSymbol$i,TO_STRING_TAG$2=wellKnownSymbol$i("toStringTag"),$Object$1=Object,CORRECT_ARGUMENTS="Arguments"==classofRaw(function(){return arguments}()),tryGet=function(e,t){try{return e[t]}catch(e){}},classof$6=TO_STRING_TAG_SUPPORT?classofRaw:function(e){var t;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(t=tryGet(e=$Object$1(e),TO_STRING_TAG$2))?t:CORRECT_ARGUMENTS?classofRaw(e):"Object"==(t=classofRaw(e))&&isCallable$b(e.callee)?"Arguments":t},classof$5=classof$6,$String$1=String,toString$6=function(e){if("Symbol"===classof$5(e))throw TypeError("Cannot convert a Symbol value to a string");return $String$1(e)},whitespaces$2="\t\n\v\f\r                 \u2028\u2029\ufeff",uncurryThis$b=functionUncurryThis,requireObjectCoercible$1=requireObjectCoercible$4,toString$5=toString$6,whitespaces$1=whitespaces$2,replace$5=functionUncurryThis("".replace),whitespace="["+whitespaces$1+"]",ltrim=RegExp("^"+whitespace+whitespace+"*"),rtrim=RegExp(whitespace+whitespace+"*$"),createMethod$1=function(t){return function(e){e=toString$5(requireObjectCoercible$1(e));return 1&t&&(e=replace$5(e,ltrim,"")),e=2&t?replace$5(e,rtrim,""):e}},stringTrim={start:createMethod$1(1),end:createMethod$1(2),trim:createMethod$1(3)},global$g=global$q,fails$b=fails$l,uncurryThis$a=functionUncurryThis,toString$4=toString$6,trim=stringTrim.trim,whitespaces=whitespaces$2,$parseInt$1=global$g.parseInt,Symbol$1=global$g.Symbol,ITERATOR$8=Symbol$1&&Symbol$1.iterator,hex=/^[+-]?0x/i,exec$5=uncurryThis$a(hex.exec),FORCED=8!==$parseInt$1(whitespaces+"08")||22!==$parseInt$1(whitespaces+"0x16")||ITERATOR$8&&!fails$b(function(){$parseInt$1(Object(ITERATOR$8))}),numberParseInt=FORCED?function(e,t){e=trim(toString$4(e));return $parseInt$1(e,t>>>0||(exec$5(hex,e)?16:10))}:$parseInt$1,$$b=_export,$parseInt=numberParseInt;_export({global:!0,forced:parseInt!=numberParseInt},{parseInt:numberParseInt});const selectFetchSourceStatus=e=>{return null==(e=null==(e=e[namespace])?void 0:e.sourceConfiguration)?void 0:e.status},selectUpdateSourceStatus=e=>{return null==(e=null==(e=e[namespace])?void 0:e.sourceConfiguration)?void 0:e.updateStatus},selectCreateSourceStatus=e=>{return null==(e=null==(e=e[namespace])?void 0:e.sourceConfiguration)?void 0:e.createStatus},selectDeleteSourceStatus=e=>{return null==(e=null==(e=e[namespace])?void 0:e.sourceConfiguration)?void 0:e.deleteSourceStatus},selectCheckCanBeDeletedStatus=e=>{return null==(e=null==(e=e[namespace])?void 0:e.sourceConfiguration)?void 0:e.canBeDeletedStatus},selectCanBeDeleted=e=>{return null==(e=null==(e=e[namespace])?void 0:e.sourceConfiguration)?void 0:e.canBeDeleted},selectSource=e=>{return null==(e=null==(e=e[namespace])?void 0:e.sourceConfiguration)?void 0:e.source},selectSourceTypesConfig=e=>{return null==(e=null==(e=e[namespace])?void 0:e.sourceConfiguration)?void 0:e.sourceTypesConfig},selectSourceContentTemplates=e=>{return null==(e=null==(e=null==(e=e[namespace])?void 0:e.sourceConfiguration)?void 0:e.source)?void 0:e.contentTemplates},selectSourceTypes=e=>{const t=selectSourceTypesConfig(e);let r={};return Object.keys(t).forEach(e=>{e=parseInt(e,10),e={[t[e].id]:{id:t[e].id,name:t[e].name}};r=Object.assign(Object.assign({},r),e)}),r},selectNewAvatar=e=>e[namespace].sourceConfiguration.newAvatar,selectDynamicSelectListData=e=>{return null==(e=null==(e=e[namespace])?void 0:e.sourceConfiguration)?void 0:e.selectListData},selectRetryJobStatus=e=>{return null==(e=null==(e=e[namespace])?void 0:e.sourceConfiguration)?void 0:e.retryJobStatus},selectApiConfigs=createSelector([rootApiSelector,graphEndpointSelector,sessionTokenSelector],(e,t,r)=>({apiRoot:e,graphQLEndpoint:t,token:r}));function __rest(e,t){var r={};for(n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function __awaiter(e,a,i,l){return new(i=i||Promise)(function(r,t){function o(e){try{s(l.next(e))}catch(e){t(e)}}function n(e){try{s(l.throw(e))}catch(e){t(e)}}function s(e){var t;e.done?r(e.value):((t=e.value)instanceof i?t:new i(function(e){e(t)})).then(o,n)}s((l=l.apply(e,a||[])).next())})}const sourceFields=`
30
2
  id
3
+ sourceType { id }
31
4
  name
32
- description
33
- entityTags {
34
- tagKey
35
- tagValue
36
- }
37
- applicationConfig {
38
- records {
39
- applicationId
40
- configKey
41
- configType
42
- configLevel
43
- required
44
- description
45
- secured
46
- defaultValue
47
- defaultValueJSON
48
- }
49
- offset
50
- limit
51
- count
52
- }
53
- status
54
- url
55
- signedIconUrl
56
- oauth2RedirectUrls
57
- iconSvg
58
- iconUrl
59
- key
60
- clientSecret
61
- validStateActions
5
+ details
6
+ isPublic
7
+ organizationId
62
8
  createdDateTime
63
9
  modifiedDateTime
64
- headerbarEnabled
65
- applicationHeaderbar {
66
- name
67
- elementId
68
- config {
69
- title
70
- backgroundColor
71
- help
72
- zIndex
73
- notification
74
- displaySupportChat
75
- logoSrc
76
- hidePasswordReset
77
- }
10
+ thumbnailUrl
11
+ contentTemplates {
12
+ schemaId
13
+ data
78
14
  }
79
- components {
80
- engines {
15
+ permission
16
+ state
17
+ `;function getSource(r,o){return __awaiter(this,void 0,void 0,function*(){var e="fetchSource",t=`
18
+ query ${e}($id: ID!){
19
+ source(id: $id) {
20
+ ${sourceFields}
21
+ }
22
+ }
23
+ `;return(yield baseGraphQLApiWithError(Object.assign({query:t,operationName:e,variables:{id:o}},r))).source})}function checkSourceDeleteStatus(e,t){return __awaiter(this,void 0,void 0,function*(){return yield baseGraphQLApiWithError(Object.assign({query:`
24
+ query {
25
+ scheduledJobs: scheduledJobs (id: ${t}) {
81
26
  records {
82
- id
83
27
  name
28
+ id
29
+ isActive
30
+ details
84
31
  description
85
- state
86
- iconPath
87
- signedIconPath
88
- deployedVersion
89
- displayName
90
- edgeVersion
91
- categoryId
92
- modifiedDateTime
32
+ startDateTime
33
+ jobs {
34
+ records {
35
+ id
36
+ status
37
+ }
38
+ }
39
+ ingestionStatus
93
40
  }
94
41
  }
95
- dataRegistries {
42
+ tdos: temporalDataObjects(sourceId: ${t}) {
96
43
  records {
97
- id
98
44
  name
99
- description
100
- modifiedDateTime
101
- publishedSchema {
102
- majorVersion
103
- minorVersion
104
- status
105
- }
45
+ id
106
46
  }
107
47
  }
108
- }
109
- contextMenuExtensions {
110
- mentions {
111
- id
112
- label
113
- url
114
- type
115
- }
116
- tdos {
117
- id
118
- label
119
- url
120
- type
121
- }
122
- watchlists {
123
- id
124
- label
125
- url
126
- type
127
- }
128
- collections {
129
- id
130
- label
131
- url
132
- type
48
+ }
49
+ `,variables:{id:t}},e))})}function deleteSource(t,r){return __awaiter(this,void 0,void 0,function*(){var e="deleteSource";return yield baseGraphQLApiWithError(Object.assign({query:"\n mutation deleteSource ($id: ID!) {\n deleteSource(id: $id) {\n id\n }\n }\n ",operationName:e,variables:{id:r}},t))})}const getSourceTypes=(t,r)=>__awaiter(void 0,void 0,void 0,function*(){var e="getSourceTypes";return(yield baseGraphQLApiWithError(Object.assign({query:"\n query getSourceTypes($sourceTypeIds: [ID]) {\n sourceTypes(ids: $sourceTypeIds, limit: 30) {\n records {\n id\n name\n isPublic\n organizationId\n sourceSchema {\n id\n definition\n status\n majorVersion\n minorVersion\n dataRegistryId\n }\n }\n }\n }\n ",operationName:e,variables:{ids:r}},t))).sourceTypes});var location,defer,channel,port,classof$4=classofRaw$1,global$f=global$q,engineIsNode="process"==classofRaw$1(global$q.process),isCallable$a=isCallable$m,$String=String,$TypeError$5=TypeError,aPossiblePrototype$1=function(e){if("object"==typeof e||isCallable$a(e))return e;throw $TypeError$5("Can't set "+$String(e)+" as a prototype")},uncurryThis$9=functionUncurryThis,anObject$b=anObject$e,aPossiblePrototype=aPossiblePrototype$1,objectSetPrototypeOf=Object.setPrototypeOf||("__proto__"in{}?function(){var r,o=!1,e={};try{(r=uncurryThis$9(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(e,[]),o=e instanceof Array}catch(e){}return function(e,t){return anObject$b(e),aPossiblePrototype(t),o?r(e,t):e.__proto__=t,e}}():void 0),defineProperty$4=objectDefineProperty.f,hasOwn$6=hasOwnProperty_1,wellKnownSymbol$e=wellKnownSymbol$i,TO_STRING_TAG$1=wellKnownSymbol$i("toStringTag"),setToStringTag$5=function(e,t,r){(e=e&&!r?e.prototype:e)&&!hasOwn$6(e,TO_STRING_TAG$1)&&defineProperty$4(e,TO_STRING_TAG$1,{configurable:!0,value:t})},getBuiltIn$4=getBuiltIn$8,definePropertyModule$2=objectDefineProperty,wellKnownSymbol$d=wellKnownSymbol$i,DESCRIPTORS$5=descriptors,SPECIES$2=wellKnownSymbol$i("species"),setSpecies$2=function(e){var e=getBuiltIn$4(e),t=definePropertyModule$2.f;DESCRIPTORS$5&&e&&!e[SPECIES$2]&&t(e,SPECIES$2,{configurable:!0,get:function(){return this}})},isPrototypeOf$3=objectIsPrototypeOf,$TypeError$4=TypeError,anInstance$3=function(e,t){if(isPrototypeOf$3(t,e))return e;throw $TypeError$4("Incorrect invocation")},uncurryThis$8=functionUncurryThis,fails$a=fails$l,isCallable$9=isCallable$m,classof$3=classof$6,getBuiltIn$3=getBuiltIn$8,inspectSource$1=inspectSource$4,noop=function(){},empty=[],construct=getBuiltIn$8("Reflect","construct"),constructorRegExp=/^\s*(?:class|function)\b/,exec$4=uncurryThis$8(constructorRegExp.exec),INCORRECT_TO_STRING=!constructorRegExp.exec(noop),isConstructorModern=function(e){if(!isCallable$9(e))return!1;try{return construct(noop,empty,e),!0}catch(e){return!1}},isConstructorLegacy=function(e){if(!isCallable$9(e))return!1;switch(classof$3(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return INCORRECT_TO_STRING||!!exec$4(constructorRegExp,inspectSource$1(e))}catch(e){return!0}},isConstructor$2=(isConstructorLegacy.sham=!0,!construct||fails$a(function(){var e;return isConstructorModern(isConstructorModern.call)||!isConstructorModern(Object)||!isConstructorModern(function(){e=!0})||e})?isConstructorLegacy:isConstructorModern),isConstructor$1=isConstructor$2,tryToString$2=tryToString$4,$TypeError$3=TypeError,aConstructor$1=function(e){if(isConstructor$1(e))return e;throw $TypeError$3(tryToString$2(e)+" is not a constructor")},anObject$a=anObject$e,aConstructor=aConstructor$1,wellKnownSymbol$c=wellKnownSymbol$i,SPECIES$1=wellKnownSymbol$i("species"),speciesConstructor$1=function(e,t){var e=anObject$a(e).constructor;return void 0===e||null==(e=anObject$a(e)[SPECIES$1])?t:aConstructor(e)},NATIVE_BIND$1=functionBindNative,FunctionPrototype=Function.prototype,apply$1=FunctionPrototype.apply,call$c=FunctionPrototype.call,functionApply="object"==typeof Reflect&&Reflect.apply||(NATIVE_BIND$1?call$c.bind(apply$1):function(){return call$c.apply(apply$1,arguments)}),uncurryThis$7=functionUncurryThis,aCallable$5=aCallable$7,NATIVE_BIND=functionBindNative,bind$7=functionUncurryThis(functionUncurryThis.bind),functionBindContext=function(e,t){return aCallable$5(e),void 0===t?e:NATIVE_BIND?bind$7(e,t):function(){return e.apply(t,arguments)}},getBuiltIn$2=getBuiltIn$8,html$2=getBuiltIn$8("document","documentElement"),uncurryThis$6=functionUncurryThis,arraySlice$3=functionUncurryThis([].slice),$TypeError$2=TypeError,validateArgumentsLength$3=function(e,t){if(e<t)throw $TypeError$2("Not enough arguments");return e},userAgent$2=engineUserAgent,engineIsIos=/(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent$2),global$e=global$q,apply=functionApply,bind$6=functionBindContext,isCallable$8=isCallable$m,hasOwn$5=hasOwnProperty_1,fails$9=fails$l,html$1=html$2,arraySlice$2=arraySlice$3,createElement=documentCreateElement$2,validateArgumentsLength$2=validateArgumentsLength$3,IS_IOS$1=engineIsIos,IS_NODE$3=engineIsNode,set=global$e.setImmediate,clear=global$e.clearImmediate,process$2=global$e.process,Dispatch=global$e.Dispatch,Function$1=global$e.Function,MessageChannel=global$e.MessageChannel,String$1=global$e.String,counter=0,queue$1={},ONREADYSTATECHANGE="onreadystatechange";try{location=global$e.location}catch(e){}var flush,head,last,notify$1,toggle,node,promise,then,Internal,OwnPromiseCapability,PromiseWrapper,nativeThen,run=function(e){var t;hasOwn$5(queue$1,e)&&(t=queue$1[e],delete queue$1[e],t())},runner=function(e){return function(){run(e)}},listener=function(e){run(e.data)},post=function(e){global$e.postMessage(String$1(e),location.protocol+"//"+location.host)},task$1=(set&&clear||(set=function(e){validateArgumentsLength$2(arguments.length,1);var t=isCallable$8(e)?e:Function$1(e),r=arraySlice$2(arguments,1);return queue$1[++counter]=function(){apply(t,void 0,r)},defer(counter),counter},clear=function(e){delete queue$1[e]},IS_NODE$3?defer=function(e){process$2.nextTick(runner(e))}:Dispatch&&Dispatch.now?defer=function(e){Dispatch.now(runner(e))}:MessageChannel&&!IS_IOS$1?(port=(channel=new MessageChannel).port2,channel.port1.onmessage=listener,defer=bind$6(port.postMessage,port)):global$e.addEventListener&&isCallable$8(global$e.postMessage)&&!global$e.importScripts&&location&&"file:"!==location.protocol&&!fails$9(post)?(defer=post,global$e.addEventListener("message",listener,!1)):defer=ONREADYSTATECHANGE in createElement("script")?function(e){html$1.appendChild(createElement("script"))[ONREADYSTATECHANGE]=function(){html$1.removeChild(this),run(e)}}:function(e){setTimeout(runner(e),0)}),{set:set,clear:clear}),userAgent$1=engineUserAgent,global$d=global$q,engineIsIosPebble=/ipad|iphone|ipod/i.test(userAgent$1)&&void 0!==global$d.Pebble,userAgent=engineUserAgent,engineIsWebosWebkit=/web0s(?!.*chrome)/i.test(userAgent),global$c=global$q,bind$5=functionBindContext,getOwnPropertyDescriptor$1=objectGetOwnPropertyDescriptor.f,macrotask=task$1.set,IS_IOS=engineIsIos,IS_IOS_PEBBLE=engineIsIosPebble,IS_WEBOS_WEBKIT=engineIsWebosWebkit,IS_NODE$2=engineIsNode,MutationObserver=global$c.MutationObserver||global$c.WebKitMutationObserver,document$2=global$c.document,process$1=global$c.process,Promise$1=global$c.Promise,queueMicrotaskDescriptor=getOwnPropertyDescriptor$1(global$c,"queueMicrotask"),queueMicrotask=queueMicrotaskDescriptor&&queueMicrotaskDescriptor.value,microtask$1=(queueMicrotask||(flush=function(){var e,t;for(IS_NODE$2&&(e=process$1.domain)&&e.exit();head;){t=head.fn,head=head.next;try{t()}catch(e){throw head?notify$1():last=void 0,e}}last=void 0,e&&e.enter()},notify$1=IS_IOS||IS_NODE$2||IS_WEBOS_WEBKIT||!MutationObserver||!document$2?!IS_IOS_PEBBLE&&Promise$1&&Promise$1.resolve?((promise=Promise$1.resolve(void 0)).constructor=Promise$1,then=bind$5(promise.then,promise),function(){then(flush)}):IS_NODE$2?function(){process$1.nextTick(flush)}:(macrotask=bind$5(macrotask,global$c),function(){macrotask(flush)}):(toggle=!0,node=document$2.createTextNode(""),new MutationObserver(flush).observe(node,{characterData:!0}),function(){node.data=toggle=!toggle})),queueMicrotask||function(e){e={fn:e,next:void 0};last&&(last.next=e),head||(head=e,notify$1()),last=e}),global$b=global$q,hostReportErrors$1=function(e,t){var r=global$b.console;r&&r.error&&(1==arguments.length?r.error(e):r.error(e,t))},perform$3=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},Queue$1=function(){this.head=null,this.tail=null},queue=(Queue$1.prototype={add:function(e){e={item:e,next:null};this.head?this.tail.next=e:this.head=e,this.tail=e},get:function(){var e=this.head;if(e)return this.head=e.next,this.tail===e&&(this.tail=null),e.item}},Queue$1),global$a=global$q,promiseNativeConstructor=global$q.Promise,engineIsDeno="object"==typeof Deno&&Deno&&"object"==typeof Deno.version,IS_DENO$1=engineIsDeno,IS_NODE$1=engineIsNode,engineIsBrowser=!engineIsDeno&&!engineIsNode&&"object"==typeof window&&"object"==typeof document,global$9=global$q,NativePromiseConstructor$3=promiseNativeConstructor,isCallable$7=isCallable$m,isForced$1=isForced_1,inspectSource=inspectSource$4,wellKnownSymbol$b=wellKnownSymbol$i,IS_BROWSER=engineIsBrowser,IS_DENO=engineIsDeno,V8_VERSION=engineV8Version,SPECIES=(NativePromiseConstructor$3&&NativePromiseConstructor$3.prototype,wellKnownSymbol$b("species")),SUBCLASSING=!1,NATIVE_PROMISE_REJECTION_EVENT$1=isCallable$7(global$9.PromiseRejectionEvent),FORCED_PROMISE_CONSTRUCTOR$5=isForced$1("Promise",function(){var e=inspectSource(NativePromiseConstructor$3),t=e!==String(NativePromiseConstructor$3);if(!t&&66===V8_VERSION)return!0;if(!V8_VERSION||V8_VERSION<51||!/native code/.test(e)){function r(e){e(function(){},function(){})}e=new NativePromiseConstructor$3(function(e){e(1)});if((e.constructor={})[SPECIES]=r,!(SUBCLASSING=e.then(function(){})instanceof r))return!0}return!t&&(IS_BROWSER||IS_DENO)&&!NATIVE_PROMISE_REJECTION_EVENT$1}),promiseConstructorDetection={CONSTRUCTOR:FORCED_PROMISE_CONSTRUCTOR$5,REJECTION_EVENT:NATIVE_PROMISE_REJECTION_EVENT$1,SUBCLASSING:SUBCLASSING},newPromiseCapability$2={},aCallable$4=aCallable$7,PromiseCapability=function(e){var r,o;this.promise=new e(function(e,t){if(void 0!==r||void 0!==o)throw TypeError("Bad Promise constructor");r=e,o=t}),this.resolve=aCallable$4(r),this.reject=aCallable$4(o)},$$a=(newPromiseCapability$2.f=function(e){return new PromiseCapability(e)},_export),IS_NODE=engineIsNode,global$8=global$q,call$b=functionCall,defineBuiltIn$8=defineBuiltIn$a,setPrototypeOf$2=objectSetPrototypeOf,setToStringTag$4=setToStringTag$5,setSpecies$1=setSpecies$2,aCallable$3=aCallable$7,isCallable$6=isCallable$m,isObject$4=isObject$a,anInstance$2=anInstance$3,speciesConstructor=speciesConstructor$1,task=task$1.set,microtask=microtask$1,hostReportErrors=hostReportErrors$1,perform$2=perform$3,Queue=queue,InternalStateModule$4=internalState,NativePromiseConstructor$2=promiseNativeConstructor,PromiseConstructorDetection=promiseConstructorDetection,newPromiseCapabilityModule$3=newPromiseCapability$2,PROMISE="Promise",FORCED_PROMISE_CONSTRUCTOR$4=PromiseConstructorDetection.CONSTRUCTOR,NATIVE_PROMISE_REJECTION_EVENT=PromiseConstructorDetection.REJECTION_EVENT,NATIVE_PROMISE_SUBCLASSING=PromiseConstructorDetection.SUBCLASSING,getInternalPromiseState=InternalStateModule$4.getterFor(PROMISE),setInternalState$4=InternalStateModule$4.set,NativePromisePrototype$1=NativePromiseConstructor$2&&NativePromiseConstructor$2.prototype,PromiseConstructor=NativePromiseConstructor$2,PromisePrototype=NativePromisePrototype$1,TypeError$3=global$8.TypeError,document$1=global$8.document,process=global$8.process,newPromiseCapability$1=newPromiseCapabilityModule$3.f,newGenericPromiseCapability=newPromiseCapability$1,DISPATCH_EVENT=!!(document$1&&document$1.createEvent&&global$8.dispatchEvent),UNHANDLED_REJECTION="unhandledrejection",REJECTION_HANDLED="rejectionhandled",PENDING=0,FULFILLED=1,REJECTED=2,HANDLED=1,UNHANDLED=2,isThenable=function(e){var t;return!(!isObject$4(e)||!isCallable$6(t=e.then))&&t},callReaction=function(e,t){var r,o,n,s=t.value,a=t.state==FULFILLED,i=a?e.ok:e.fail,l=e.resolve,c=e.reject,u=e.domain;try{i?(a||(t.rejection===UNHANDLED&&onHandleUnhandled(t),t.rejection=HANDLED),!0===i?r=s:(u&&u.enter(),r=i(s),u&&(u.exit(),n=!0)),r===e.promise?c(TypeError$3("Promise-chain cycle")):(o=isThenable(r))?call$b(o,r,l,c):l(r)):c(s)}catch(e){u&&!n&&u.exit(),c(e)}},notify=function(r,o){r.notified||(r.notified=!0,microtask(function(){for(var e,t=r.reactions;e=t.get();)callReaction(e,r);r.notified=!1,o&&!r.rejection&&onUnhandled(r)}))},dispatchEvent=function(e,t,r){var o;DISPATCH_EVENT?((o=document$1.createEvent("Event")).promise=t,o.reason=r,o.initEvent(e,!1,!0),global$8.dispatchEvent(o)):o={promise:t,reason:r},!NATIVE_PROMISE_REJECTION_EVENT&&(t=global$8["on"+e])?t(o):e===UNHANDLED_REJECTION&&hostReportErrors("Unhandled promise rejection",r)},onUnhandled=function(o){call$b(task,global$8,function(){var e=o.facade,t=o.value,r=isUnhandled(o);if(r&&(r=perform$2(function(){IS_NODE?process.emit("unhandledRejection",t,e):dispatchEvent(UNHANDLED_REJECTION,e,t)}),o.rejection=IS_NODE||isUnhandled(o)?UNHANDLED:HANDLED,r.error))throw r.value})},isUnhandled=function(e){return e.rejection!==HANDLED&&!e.parent},onHandleUnhandled=function(t){call$b(task,global$8,function(){var e=t.facade;IS_NODE?process.emit("rejectionHandled",e):dispatchEvent(REJECTION_HANDLED,e,t.value)})},bind$4=function(t,r,o){return function(e){t(r,e,o)}},internalReject=function(e,t,r){e.done||(e.done=!0,(e=r?r:e).value=t,e.state=REJECTED,notify(e,!0))},internalResolve=function(r,e,t){if(!r.done){r.done=!0,t&&(r=t);try{if(r.facade===e)throw TypeError$3("Promise can't be resolved itself");var o=isThenable(e);o?microtask(function(){var t={done:!1};try{call$b(o,e,bind$4(internalResolve,t,r),bind$4(internalReject,t,r))}catch(e){internalReject(t,e,r)}}):(r.value=e,r.state=FULFILLED,notify(r,!1))}catch(e){internalReject({done:!1},e,r)}}};if(FORCED_PROMISE_CONSTRUCTOR$4&&(PromisePrototype=(PromiseConstructor=function(e){anInstance$2(this,PromisePrototype),aCallable$3(e),call$b(Internal,this);var t=getInternalPromiseState(this);try{e(bind$4(internalResolve,t),bind$4(internalReject,t))}catch(e){internalReject(t,e)}}).prototype,(Internal=function(e){setInternalState$4(this,{type:PROMISE,done:!1,notified:!1,parent:!1,reactions:new Queue,rejection:!1,state:PENDING,value:void 0})}).prototype=defineBuiltIn$8(PromisePrototype,"then",function(e,t){var r=getInternalPromiseState(this),o=newPromiseCapability$1(speciesConstructor(this,PromiseConstructor));return r.parent=!0,o.ok=!isCallable$6(e)||e,o.fail=isCallable$6(t)&&t,o.domain=IS_NODE?process.domain:void 0,r.state==PENDING?r.reactions.add(o):microtask(function(){callReaction(o,r)}),o.promise}),OwnPromiseCapability=function(){var e=new Internal,t=getInternalPromiseState(e);this.promise=e,this.resolve=bind$4(internalResolve,t),this.reject=bind$4(internalReject,t)},newPromiseCapabilityModule$3.f=newPromiseCapability$1=function(e){return e===PromiseConstructor||e===PromiseWrapper?new OwnPromiseCapability(e):newGenericPromiseCapability(e)},isCallable$6(NativePromiseConstructor$2))&&NativePromisePrototype$1!==Object.prototype){nativeThen=NativePromisePrototype$1.then,NATIVE_PROMISE_SUBCLASSING||defineBuiltIn$8(NativePromisePrototype$1,"then",function(e,t){var r=this;return new PromiseConstructor(function(e,t){call$b(nativeThen,r,e,t)}).then(e,t)},{unsafe:!0});try{delete NativePromisePrototype$1.constructor}catch(e){}setPrototypeOf$2&&setPrototypeOf$2(NativePromisePrototype$1,PromisePrototype)}$$a({global:!0,constructor:!0,wrap:!0,forced:FORCED_PROMISE_CONSTRUCTOR$4},{Promise:PromiseConstructor}),setToStringTag$4(PromiseConstructor,PROMISE,!1),setSpecies$1(PROMISE);var iterators={},wellKnownSymbol$a=wellKnownSymbol$i,Iterators$4=iterators,ITERATOR$7=wellKnownSymbol$i("iterator"),ArrayPrototype$1=Array.prototype,isArrayIteratorMethod$2=function(e){return void 0!==e&&(Iterators$4.Array===e||ArrayPrototype$1[ITERATOR$7]===e)},classof$2=classof$6,getMethod$1=getMethod$3,Iterators$3=iterators,wellKnownSymbol$9=wellKnownSymbol$i,ITERATOR$6=wellKnownSymbol$i("iterator"),getIteratorMethod$4=function(e){if(null!=e)return getMethod$1(e,ITERATOR$6)||getMethod$1(e,"@@iterator")||Iterators$3[classof$2(e)]},call$a=functionCall,aCallable$2=aCallable$7,anObject$9=anObject$e,tryToString$1=tryToString$4,getIteratorMethod$3=getIteratorMethod$4,$TypeError$1=TypeError,getIterator$3=function(e,t){var r=arguments.length<2?getIteratorMethod$3(e):t;if(aCallable$2(r))return anObject$9(call$a(r,e));throw $TypeError$1(tryToString$1(e)+" is not iterable")},call$9=functionCall,anObject$8=anObject$e,getMethod=getMethod$3,iteratorClose$2=function(e,t,r){var o,n;anObject$8(e);try{if(!(o=getMethod(e,"return"))){if("throw"===t)throw r;return r}o=call$9(o,e)}catch(e){n=!0,o=e}if("throw"===t)throw r;if(n)throw o;return anObject$8(o),r},bind$3=functionBindContext,call$8=functionCall,anObject$7=anObject$e,tryToString=tryToString$4,isArrayIteratorMethod$1=isArrayIteratorMethod$2,lengthOfArrayLike$2=lengthOfArrayLike$4,isPrototypeOf$2=objectIsPrototypeOf,getIterator$2=getIterator$3,getIteratorMethod$2=getIteratorMethod$4,iteratorClose$1=iteratorClose$2,$TypeError=TypeError,Result=function(e,t){this.stopped=e,this.result=t},ResultPrototype=Result.prototype,iterate$2=function(e,t,r){function o(e){return s&&iteratorClose$1(s,"normal",e),new Result(!0,e)}function n(e){return p?(anObject$7(e),f?h(e[0],e[1],o):h(e[0],e[1])):f?h(e,o):h(e)}var s,a,i,l,c,u,d=r&&r.that,p=!(!r||!r.AS_ENTRIES),$=!(!r||!r.IS_RECORD),g=!(!r||!r.IS_ITERATOR),f=!(!r||!r.INTERRUPTED),h=bind$3(t,d);if($)s=e.iterator;else if(g)s=e;else{if(!(r=getIteratorMethod$2(e)))throw $TypeError(tryToString(e)+" is not iterable");if(isArrayIteratorMethod$1(r)){for(a=0,i=lengthOfArrayLike$2(e);a<i;a++)if((l=n(e[a]))&&isPrototypeOf$2(ResultPrototype,l))return l;return new Result(!1)}s=getIterator$2(e,r)}for(c=($?e:s).next;!(u=call$8(c,s)).done;){try{l=n(u.value)}catch(e){iteratorClose$1(s,"throw",e)}if("object"==typeof l&&l&&isPrototypeOf$2(ResultPrototype,l))return l}return new Result(!1)},wellKnownSymbol$8=wellKnownSymbol$i,ITERATOR$5=wellKnownSymbol$i("iterator"),SAFE_CLOSING=!1;try{var called=0,iteratorWithReturn={next:function(){return{done:!!called++}},return:function(){SAFE_CLOSING=!0}};iteratorWithReturn[ITERATOR$5]=function(){return this},Array.from(iteratorWithReturn,function(){throw 2})}catch(e){}var method,checkCorrectnessOfIteration$1=function(e,t){if(!t&&!SAFE_CLOSING)return!1;var r=!1;try{var o={};o[ITERATOR$5]=function(){return{next:function(){return{done:r=!0}}}},e(o)}catch(e){}return r},NativePromiseConstructor$1=promiseNativeConstructor,checkCorrectnessOfIteration=checkCorrectnessOfIteration$1,FORCED_PROMISE_CONSTRUCTOR$3=promiseConstructorDetection.CONSTRUCTOR,promiseStaticsIncorrectIteration=FORCED_PROMISE_CONSTRUCTOR$3||!checkCorrectnessOfIteration(function(e){NativePromiseConstructor$1.all(e).then(void 0,function(){})}),$$9=_export,call$7=functionCall,aCallable$1=aCallable$7,newPromiseCapabilityModule$2=newPromiseCapability$2,perform$1=perform$3,iterate$1=iterate$2,PROMISE_STATICS_INCORRECT_ITERATION$1=promiseStaticsIncorrectIteration,$$8=(_export({target:"Promise",stat:!0,forced:promiseStaticsIncorrectIteration},{all:function(e){var i=this,t=newPromiseCapabilityModule$2.f(i),l=t.resolve,c=t.reject,r=perform$1(function(){var o=aCallable$1(i.resolve),n=[],s=0,a=1;iterate$1(e,function(e){var t=s++,r=!1;a++,call$7(o,i,e).then(function(e){r||(r=!0,n[t]=e,--a)||l(n)},c)}),--a||l(n)});return r.error&&c(r.value),t.promise}}),_export),FORCED_PROMISE_CONSTRUCTOR$2=promiseConstructorDetection.CONSTRUCTOR,NativePromiseConstructor=promiseNativeConstructor,getBuiltIn$1=getBuiltIn$8,isCallable$5=isCallable$m,defineBuiltIn$7=defineBuiltIn$a,NativePromisePrototype=NativePromiseConstructor&&NativePromiseConstructor.prototype,$$7=($$8({target:"Promise",proto:!0,forced:FORCED_PROMISE_CONSTRUCTOR$2,real:!0},{catch:function(e){return this.then(void 0,e)}}),isCallable$5(NativePromiseConstructor)&&(method=getBuiltIn$1("Promise").prototype.catch,NativePromisePrototype.catch!==method)&&defineBuiltIn$7(NativePromisePrototype,"catch",method,{unsafe:!0}),_export),call$6=functionCall,aCallable=aCallable$7,newPromiseCapabilityModule$1=newPromiseCapability$2,perform=perform$3,iterate=iterate$2,PROMISE_STATICS_INCORRECT_ITERATION=promiseStaticsIncorrectIteration,$$6=(_export({target:"Promise",stat:!0,forced:promiseStaticsIncorrectIteration},{race:function(e){var r=this,o=newPromiseCapabilityModule$1.f(r),n=o.reject,t=perform(function(){var t=aCallable(r.resolve);iterate(e,function(e){call$6(t,r,e).then(o.resolve,n)})});return t.error&&n(t.value),o.promise}}),_export),call$5=functionCall,newPromiseCapabilityModule=newPromiseCapability$2,FORCED_PROMISE_CONSTRUCTOR$1=promiseConstructorDetection.CONSTRUCTOR,anObject$6=($$6({target:"Promise",stat:!0,forced:FORCED_PROMISE_CONSTRUCTOR$1},{reject:function(e){var t=newPromiseCapabilityModule.f(this);return call$5(t.reject,void 0,e),t.promise}}),anObject$e),isObject$3=isObject$a,newPromiseCapability=newPromiseCapability$2,promiseResolve$1=function(e,t){return anObject$6(e),isObject$3(t)&&t.constructor===e?t:((0,(e=newPromiseCapability.f(e)).resolve)(t),e.promise)},$$5=_export,getBuiltIn=getBuiltIn$8,FORCED_PROMISE_CONSTRUCTOR=promiseConstructorDetection.CONSTRUCTOR,promiseResolve=promiseResolve$1;function getImageURL(o,n){return __awaiter(this,void 0,void 0,function*(){var e={name:n.name},{url:e,unsignedUrl:t}=(yield baseGraphQLApiWithError(Object.assign({query:`
50
+ query getUrl($name: String!){
51
+ getSignedWritableUrl(key: $name) {
52
+ url
53
+ unsignedUrl
54
+ getUrl
55
+ }
133
56
  }
134
- }
135
- nodeModules(includeDeleted: true) {
136
- moduleId
137
- moduleRepo
138
- moduleName
139
- moduleVersion
140
- isPrivateRepo
141
- isPrivateRegistry
142
- scope
143
- accessToken
144
- registryUrl
145
- sshUrl
146
- status
147
- }
148
- }`,getApplications=a=>__awaiter(void 0,void 0,void 0,function*(){var e="applications",t=`
149
- ${applicationFieldsFragment}
150
- query ${e}($limit: Int, $offset: Int) {
151
- totalResults: ${e}(owned: true, offset: 0, limit: 9999) {
152
- count
153
- }
154
- results: ${e}(limit: $limit, offset: $offset, owned: true) {
155
- records {
156
- ...applicationFields
57
+ `,operationName:"getUrl",variables:e},o))).getSignedWritableUrl,r={method:"PUT",headers:{"Content-Type":n.type,"X-Veritone-Application":"aiware-sdk"},body:n};try{return yield fetch(e,r),t}catch(e){return console.log(e),""}})}function updateSource(o,n){return __awaiter(this,void 0,void 0,function*(){var e="updateSource",t=`
58
+ mutation ${e}($source: UpdateSource!) {
59
+ updateSource(input: $source) {
60
+ ${sourceFields}
157
61
  }
158
- }
62
+ }
63
+ `,r=__rest(n,["sourceType","organizationId","createdDateTime","modifiedDateTime","permission"]);return(yield baseGraphQLApiWithError(Object.assign({query:t,operationName:e,variables:{source:r}},o))).updateSource})}function createSource(r,o){return __awaiter(this,void 0,void 0,function*(){var e="createSource",t=`
64
+ mutation ${e}($source: CreateSource!) {
65
+ createSource(input: $source) {
66
+ ${sourceFields}
67
+ }
159
68
  }
160
- `;return(yield baseGraphQLApiWithError(Object.assign({query:t,variables:{limit:9999,offset:0},operationName:e},a))).results}),getApplication=(a,s)=>__awaiter(void 0,void 0,void 0,function*(){var e="application",t=`
161
- ${applicationFieldsFragment}
162
- query ${e} ($id: ID!) {
163
- ${e}(id: $id) {
164
- ...applicationFields
165
- }
69
+ `;return(yield baseGraphQLApiWithError(Object.assign({query:t,operationName:e,variables:{source:o}},r))).createSource})}function retryJob(t,r){return __awaiter(this,void 0,void 0,function*(){var e="retryJob";return(yield baseGraphQLApiWithError(Object.assign({query:`
70
+ mutation ${e} {
71
+ retryJob(id: "${r}") {
72
+ status
73
+ }
166
74
  }
167
- `;return(yield baseGraphQLApiWithError(Object.assign({query:t,variables:{id:s},operationName:e},a))).application}),updateApplication=(t,a)=>__awaiter(void 0,void 0,void 0,function*(){var e="updateApplication";return(yield baseGraphQLApiWithError(Object.assign({query:"\n mutation updateApplication ($input: UpdateApplication!) {\n updateApplication (input: $input) {\n id\n }\n }\n ",variables:{input:a},operationName:e},t)))[e]}),bulkDeleteContextMenuExtensions=(t,a)=>__awaiter(void 0,void 0,void 0,function*(){var e="bulkDeleteContextMenuExtensions";return(yield baseGraphQLApiWithError(Object.assign({query:"\n mutation bulkDeleteContextMenuExtensions ($input: BulkDeleteContextMenuExtensions!) {\n bulkDeleteContextMenuExtensions (input: $input) {\n mentions {\n id\n label\n url\n type\n }\n tdos {\n id\n label\n url\n type\n }\n watchlists {\n id\n label\n url\n type\n }\n collections {\n id\n label\n url\n type\n }\n }\n }\n ",variables:{input:a},operationName:e},t)))[e]}),deleteConfigField=(t,a,s)=>__awaiter(void 0,void 0,void 0,function*(){var e="applicationConfigDefinitionDelete";return yield baseGraphQLApiWithError(Object.assign({query:"\n mutation applicationConfigDefinitionDelete($appId: ID! $configKey: String!) {\n applicationConfigDefinitionDelete(\n input: {\n appId: $appId\n configKey: $configKey\n }\n )\n {\n success\n code\n msg\n }\n }\n ",variables:{appId:a,configKey:s},operationName:e},t))}),updateConfigField=(t,a)=>__awaiter(void 0,void 0,void 0,function*(){var e="applicationConfigDefinitionUpdate";return yield baseGraphQLApiWithError(Object.assign({query:"\n mutation applicationConfigDefinitionUpdate($input: [ApplicationConfigDefinitionUpdateInput]) {\n applicationConfigDefinitionUpdate(input: $input)\n {\n records {\n applicationId\n configKey\n }\n }\n }",variables:{input:a},operationName:e},t))}),getApplicationConfigFields=(t,a)=>__awaiter(void 0,void 0,void 0,function*(){var e="applicationConfigDefinition";return yield baseGraphQLApiWithError(Object.assign({query:"\n query applicationConfigDefinition ($appId: ID!) {\n applicationConfigDefinition(appId: $appId) {\n records {\n applicationId\n configKey\n configType\n configLevel\n description\n defaultValue\n defaultValueJSON\n required\n secured\n }\n }\n\n }\n ",variables:{appId:a},operationName:e},t))}),getOAuthClientSecret=(t,a)=>__awaiter(void 0,void 0,void 0,function*(){var e="getApplicationOatuhClientSecret";return yield baseGraphQLApiWithError(Object.assign({query:"query getApplicationOatuhClientSecret($id: ID!, $password: String!) {\n application(id: $id) {\n id,\n clientSecret(password: $password)\n }\n }",variables:a,operationName:e},t))}),getSchemasByName=(a,s={name:""})=>__awaiter(void 0,void 0,void 0,function*(){var e={name:s.name},t="getSchemasByDataRegistryName";return yield baseGraphQLApiWithError(Object.assign({query:"\n query getSchemasByDataRegistryName($name:String){\n dataRegistries(\n name: $name\n ){\n records {\n id\n name\n modifiedDateTime\n schemas {\n records {\n id\n dataRegistryId\n modifiedDateTime\n majorVersion\n minorVersion\n }\n }\n }\n }\n }\n ",variables:e,operationName:t},a))}),getEvents$1=t=>__awaiter(void 0,void 0,void 0,function*(){var e="systemEvents";return yield baseGraphQLApiWithError(Object.assign({query:'\n query systemEvents {\n events (application: "system", limit: 9999) {\n records {\n id\n eventName\n eventType\n description\n }\n }\n }\n ',operationName:e},t))});function*searchFlows(e){yield delay(200),yield put(actions.flowLinkingPanelState.fetchingStart());var t=yield select(selectApiConfigs);try{var a=yield call(getFlowsByName,t,{name:e.payload});yield put(actions.flowLinkingPanelState.updateFlowLinkingPanelField({field:"searchResults",value:a.engines.records})),yield put(actions.flowLinkingPanelState.fetchingDone())}catch(e){console.log(e.message),yield put(showMessage({content:e.message,severity:MessageSeverity.Error})),yield put(actions.flowLinkingPanelState.fetchingDone())}}function*watchSearchFlows(){yield takeLatest$1(actions.flowLinkingPanelState.searchByTerm.type,searchFlows)}const flowsSagas=[fork(watchSearchFlows)];function*searchSchemas(e){yield delay(200),yield put(actions.schemaLinkingPanelState.fetchingStart());var t=yield select(selectApiConfigs);try{var a=yield call(getSchemasByName,t,{name:e.payload});yield put(actions.schemaLinkingPanelState.updateSchemaLinkingPanelField({field:"searchResults",value:lodash.exports.map(a.dataRegistries.records,e=>{var t=lodash.exports.reduce(e.schemas.records,(e,t)=>t.majorVersion>e.majorVersion||t.majorVersion==e.majorVersion&&t.minorVersion>e.minorVersion?t:e);return t?{id:t.id,dataRegistryId:t.dataRegistryId,name:e.name,modifiedDateTime:t.modifiedDateTime,version:`v${t.majorVersion}.`+t.minorVersion}:null}).filter(e=>!(!e||!e.name))})),yield put(actions.schemaLinkingPanelState.fetchingDone())}catch(e){yield put(showMessage({content:e.message,severity:MessageSeverity.Error})),yield put(actions.schemaLinkingPanelState.fetchingDone())}}function*watchSearchSchemas(){yield takeLatest$1(actions.schemaLinkingPanelState.searchByTerm.type,searchSchemas)}const schemasSagas=[fork(watchSearchSchemas)];function*searchEngines(e){yield delay(200),yield put(actions.engineLinkingPanelState.fetchingStart());var t=yield select(selectApiConfigs);try{var a=yield call(getEnginesByName,t,{name:e.payload}),s=lodash.exports.filter(a.engines.records,e=>"c5458876-43d2-41e8-a340-f734702df04a"!==e.category.id);yield put(actions.engineLinkingPanelState.updateEngineLinkingPanelField({field:"searchResults",value:s})),yield put(actions.engineLinkingPanelState.fetchingDone())}catch(e){console.log(e.message),yield put(showMessage({content:e.message,severity:MessageSeverity.Error})),yield put(actions.engineLinkingPanelState.fetchingDone())}}function*watchSearchEngines(){yield takeLatest$1(actions.engineLinkingPanelState.searchByTerm.type,searchEngines)}const enginesSagas=[fork(watchSearchEngines)];function*getEvents(e){yield delay(0),yield put(actions.appEventsPanelState.fetchingStart());var t=yield select(selectApiConfigs);try{var a=yield call(getEvents$1,t);yield put(actions.appEventsPanelState.updateEventsPanelField({field:"searchResults",value:a.events.records})),yield put(actions.appEventsPanelState.fetchingDone())}catch(e){console.log(e.message),yield put(showMessage({content:e.message,severity:MessageSeverity.Error})),yield put(actions.appEventsPanelState.fetchingDone())}}function*watchGetEvents(){yield takeLatest$1(actions.appEventsPanelState.getEvents.type,getEvents)}const appEventsSagas=[fork(watchGetEvents)],supportedAppFields$1=["id","name","isPublic","key","category","description","iconUrl","iconSvg","url","oauth2RedirectUrls","checkPermissions","deploymentModel","contextMenuExtensions","eventEndpoint","entityTags","headerbarEnabled","nodeModules","applicationHeaderbar"],formatApp$1=t=>{const a={checkPermissions:t.checkPermissions||!1,name:t.name,key:lodash.exports.snakeCase(t.name)};return supportedAppFields$1.forEach(e=>{if(!lodash.exports.isNil(t[e])){if("applicationHeaderbar"===e)return t.headerbarEnabled&&(a.headerbar=t[e]);a[e]=t[e]}}),lodash.exports.isNil(t.iconPath)||(a.iconUrl=t.iconPath),lodash.exports.isNil(t.oauthUrl)||lodash.exports.isEmpty(t.oauthUrl)||(a.oauth2RedirectUrls=[t.oauthUrl]),a};function*createNewApplication(e){var t=yield select(preferredLanguageSelector),t=AIWareFormatMessage(t||"en"),e=e.payload["app"];if(lodash.exports.isNil(e))throw new Error("Empty app not allowed!");var a=yield select(selectApiConfigs);try{var s,n=formatApp$1(e),i=yield call(createApplication,a,n),{flows:o,engines:r,schemas:l}=e;lodash.exports.isEmpty(o)&&lodash.exports.isEmpty(r)&&lodash.exports.isEmpty(l)||(s={id:i.id},lodash.exports.isEmpty(o)&&lodash.exports.isEmpty(r)||(s.engines={add:[...lodash.exports.map(o,e=>e.id),...lodash.exports.map(r,e=>e.id)],remove:[]}),lodash.exports.isEmpty(l)||(s.dataRegistries={add:lodash.exports.map(l,e=>e.dataRegistryId),remove:[]}),yield call(updateAppComponents,a,s)),lodash.exports.isEmpty(e.configFields)||(yield call(createAppConfig,a,i.id,e.configFields)),yield put(actions.appFormState.createAppSuccess(i.id)),localStorage.removeItem("appOnboardingSession"),yield put(showMessage({content:t({id:"os-app-center-new.snackbar.appCreateSuccess",defaultMessage:[{type:0,value:"Application successfully created"}]}),severity:MessageSeverity.Success})),yield put(unmountPanel("APP_CENTER_NEW"))}catch(e){n=lodash.exports.get(e[0],"data.validationErrors[0].message")||"Application onboarding failed";yield put(actions.appFormState.createAppFailed(e[0].message)),yield put(showMessage({content:t({id:"os-app-center-new.snackbar.appOnboardingFailed",defaultMessage:[{type:1,value:"message"}]},{message:n}),severity:MessageSeverity.Error}))}}function*watchNewApplicationCreateStart(){yield takeLatest$1(actions.appFormState.createAppStart.type,createNewApplication)}const newApplicationSagas=[fork(watchNewApplicationCreateStart)],root="undefined"!=typeof window?window:global,fileUploadChannel=(root.xhrInstances={},channel());function*uploadIcon(t){const a=t.payload.file;t=yield select(preferredLanguageSelector),t=AIWareFormatMessage(t);try{var e=yield call(getUrlBucket,a.name);const n=Object.assign(Object.assign({},a),{status:IconImportStatus.Uploading,percentComplete:0,expiresInSeconds:e.expiresInSeconds,getUrl:e.getUrl,key:e.key,unsignedUrl:e.unsignedUrl,url:e.url}),i=(yield put(actions.iconUploadState.updateIcon(n)),e=>{fileUploadChannel.put(actions.iconUploadState.updateIcon(Object.assign({id:a.id},e)))});var s=yield uploadFileToS3(e,a,{onProgress:e=>{i({percentComplete:e}),sdkEventManager.dispatch(SdkEvents.fileUploadProgress,null,e)},onAbort:e=>{i({status:IconImportStatus.Aborted}),sdkEventManager.dispatch(SdkEvents.fileUpload,new SdkError(e,"abort"),n)},onError:e=>{i({status:IconImportStatus.Failed}),sdkEventManager.dispatch(SdkEvents.fileUpload,new SdkError(e),n)},onUpload:e=>{i({status:IconImportStatus.Uploaded}),sdkEventManager.dispatch(SdkEvents.fileUpload,null,n)}});root.xhrInstances[a.id]=s,yield put(actions.iconUploadState.uploadIconSuccess()),yield put(actions.appFormState.updateAppFormField({field:"iconPath",value:n.getUrl}))}catch(e){yield put(actions.iconUploadState.uploadIconFailed(e.message)),yield put(showMessage({content:t({id:"os-app-center-new.snackbar.iconUploadFail",defaultMessage:[{type:0,value:"Icon upload failed, please try again."}]}),severity:MessageSeverity.Error}))}}function*getUrlBucket(e){var t=yield select(selectApiConfigs);return yield call(getSignedWritableUrl,t,e)}function*watchUploadIconStart(){yield takeLatest$1(actions.iconUploadState.uploadIconStart.type,uploadIcon)}function*watchProgressChannel(){var e=yield take(fileUploadChannel);yield put(e)}const supportedAppFields=["id","name","isPublic","category","description","iconUrl","iconSvg","url","oauth2RedirectUrls","checkPermissions","deploymentModel","eventEndpoint","entityTags","headerbarEnabled","nodeModules","applicationHeaderbar"],formatApp=a=>{const t={checkPermissions:a.checkPermissions||!1,name:a.name,id:a.id};if(lodash.exports.forEach(supportedAppFields,e=>{if(!lodash.exports.isNil(a[e])){if("applicationHeaderbar"===e)return a.headerbarEnabled&&(t.headerbar=a[e]);t[e]=a[e]}}),lodash.exports.isNil(a.iconPath)||(t.iconUrl=a.iconPath),!lodash.exports.isEmpty(a.contextMenuExtensions)){const s={mentions:[],tdos:[],watchlists:[],collections:[]};lodash.exports.forEach(lodash.exports.keys(a.contextMenuExtensions),t=>{lodash.exports.forEach(a.contextMenuExtensions[t],e=>{s[t].push({id:e.id,label:e.label,url:e.url})})}),t.contextMenuExtensions=s}return t},decodeApp=(e,t)=>{const a=[],s=[];lodash.exports.map(lodash.exports.get(e.components.engines,"records"),e=>{("c5458876-43d2-41e8-a340-f734702df04a"===e.categoryId?a:s).push(e)});t=lodash.exports.map(lodash.exports.get(t.applicationConfigDefinition,"records"),e=>{return{id:e.applicationId,name:e.configKey,type:e.configType,configLevel:AppConfigLevel[e.configLevel],required:e.required,description:e.description,defaultValue:e.defaultValue,secured:!1}});return{id:e.id,name:e.name,description:e.description,entityTags:lodash.exports.map(e.entityTags,e=>({tagKey:e.tagKey,tagValue:e.tagValue})),configFields:t,status:e.status,url:e.url,oauth2RedirectUrls:e.oauth2RedirectUrls,iconSvg:e.iconSvg,iconPath:e.iconUrl,key:e.key,clientSecret:e.clientSecret,validStateActions:e.validStateActions,createdDateTime:e.createdDateTime,modifiedDateTime:e.modifiedDateTime,flows:a,engines:s,headerbarEnabled:e.headerbarEnabled,schemas:lodash.exports.map(lodash.exports.get(e.components.dataRegistries,"records"),e=>{return{dataRegistryId:e.id,name:e.name,modifiedDateTime:e.modifiedDateTime,version:(e=e.publishedSchema)?e.majorVersion+"."+e.minorVersion:""}}),contextMenuExtensions:e.contextMenuExtensions,nodeModules:e.nodeModules,applicationHeaderbar:e.applicationHeaderbar}};function*queryAppDetails(e){var t=yield select(selectApiConfigs);return yield call(getApplication,t,e)}function*queryAppConfigFieldDetails(e){var t=yield select(selectApiConfigs);return yield call(getApplicationConfigFields,t,e)}function*editApp(e){var t=yield queryAppDetails(e.payload),e=yield queryAppConfigFieldDetails(e.payload);yield put(actions.appFormState.setEditAppExistingData(decodeApp(t,e)))}function*updateApp(e){var t=yield select(preferredLanguageSelector),t=AIWareFormatMessage(t||"en"),e=e.payload["app"],a=yield select(selectApiConfigs);try{var s,n,i,o,r=formatApp(e),l=yield call(updateApplication,a,r),{flows:p,flowsToDelete:d,engines:c,enginesToDelete:u,schemas:x,schemasToDelete:m,contextMenuExtensionIdsForBulkDelete:g}=e,h=(lodash.exports.isEmpty(p)&&lodash.exports.isEmpty(c)&&lodash.exports.isEmpty(x)&&lodash.exports.isEmpty(d)&&lodash.exports.isEmpty(u)&&lodash.exports.isEmpty(m)||(s={id:l.id},n=lodash.exports.differenceBy(d,p,"id"),i=lodash.exports.differenceBy(u,c,"id"),o=lodash.exports.differenceBy(m,x,"dataRegistryId"),lodash.exports.isEmpty(p)&&lodash.exports.isEmpty(c)&&lodash.exports.isEmpty(n)&&lodash.exports.isEmpty(i)||(s.engines={add:[...lodash.exports.map(p,e=>e.id),...lodash.exports.map(c,e=>e.id)],remove:[...lodash.exports.map(n,e=>e.id),...lodash.exports.map(i,e=>e.id)]}),lodash.exports.isEmpty(x)&&lodash.exports.isEmpty(o)||(s.dataRegistries={add:lodash.exports.map(x,e=>e.dataRegistryId),remove:lodash.exports.map(o,e=>e.dataRegistryId)}),yield call(updateAppComponents,a,s),lodash.exports.isEmpty(g))||(yield call(bulkDeleteContextMenuExtensions,a,g)),yield put(actions.appFormState.createAppSuccess(l.id)),localStorage.removeItem("appOnboardingSession"),yield put(showMessage({content:t({id:"os-app-center-new.app-update-success",defaultMessage:[{type:0,value:"App successfully updated"}]}),severity:MessageSeverity.Success})),"APP_CENTER_DETAILS"),j={name:h,config:{appId:l.id}};yield put(mountPanel({panelId:h,microFrontend:j,panelConfig:{type:"APP_BAR_PANEL_TEMPLATE",marginTop:55,marginStart:0,size:"xlarge"}})),localStorage.removeItem("appOnboardingSession"),yield put(unmountPanel("APP_CENTER_NEW"))}catch(e){yield put(actions.appFormState.createAppFailed(e.message)),yield put(showMessage({content:t({id:"os-app-center-new.app-updating-failed",defaultMessage:[{type:0,value:"App updating failed"}]}),severity:MessageSeverity.Error}))}}function*deleteAppConfigField(e){var e=e["payload"],t=yield select(selectApiConfigs),a=yield select(preferredLanguageSelector),a=AIWareFormatMessage(a);if(t&&e.configToDelete.id)try{yield call(deleteConfigField,t,e.configToDelete.id,e.configToDelete.name)}catch(e){yield put(showMessage({content:a({id:"os-app-center-new.config-field-delete-fail",defaultMessage:[{type:0,value:"Config field failed to be deleted"}]}),severity:MessageSeverity.Error}))}}function*updateAppConfigField(e){var e=e["payload"],t=yield select(selectApiConfigs),a=yield select(preferredLanguageSelector),a=AIWareFormatMessage(a);if(t&&e.configFields.id){var s={configKey:e.configFields.name,description:e.configFields.description,configLevel:e.configFields.configLevel,configType:AppConfigType[e.configFields.type],defaultValue:e.configFields.defaultValue,required:e.configFields.required,secured:!1},e={input:[{filter:{appId:e.configFields.id,configKey:e.name},update:s}]};try{yield call(updateConfigField,t,e.input)}catch(e){yield put(showMessage({content:a({id:"os-app-center-new.config-field-update-fail",defaultMessage:[{type:0,value:"Config field failed to be updated"}]}),severity:MessageSeverity.Error}))}}}function*addAppConfigField(e){var e=e["payload"],t=yield select(selectApiConfigs),a=yield select(preferredLanguageSelector),a=AIWareFormatMessage(a);if(t)try{yield call(createAppConfig,t,e.appId,[e.newConfigField])}catch(e){yield put(showMessage({content:a({id:"os-app-center-new.config-field-create-fail",defaultMessage:[{type:0,value:"Config field failed to be created"}]}),severity:MessageSeverity.Error}))}}function*fetchApplications(){var e=yield select(selectApiConfigs),t=yield select(preferredLanguageSelector),t=AIWareFormatMessage(t);if(e)try{var a=yield call(getApplications,e);yield put(actions.appFormState.fetchApplications(a))}catch(e){yield put(showMessage({content:t({id:"os-app-center-new.get-all-applications-fail",defaultMessage:[{type:0,value:"Fetching applications failed"}]}),severity:MessageSeverity.Error}))}}function*watchEditApp(){yield takeLatest$1(actions.appFormState.editApp.type,editApp)}function*watchUpdateAppStart(){yield takeLatest$1(actions.appFormState.updateAppStart.type,updateApp)}function*watchDeleteConfigField(){yield takeLatest$1(actions.appFormState.removeConfigField.type,deleteAppConfigField)}function*watchUpdateConfigField(){yield takeLatest$1(actions.appFormState.updateConfigField.type,updateAppConfigField)}function*watchCreateConfigField(){yield takeLatest$1(actions.appFormState.createConfigField.type,addAppConfigField)}function*watchGetApplications(){yield takeLatest$1(actions.appFormState.createNewApp.type,fetchApplications)}const editAppSagas=[fork(watchEditApp),fork(watchUpdateAppStart),fork(watchDeleteConfigField),fork(watchUpdateConfigField),fork(watchCreateConfigField),fork(watchGetApplications)];function*updateLocalStorage(){var e=appFormState["selectApp"],t=eventPanelState["selectEventPanel"],e=yield select(e),t=yield select(t);window.localStorage.setItem("appOnboardingSession",JSON.stringify(Object.assign(Object.assign({},e),{eventHandlers:t.handlers})))}function*watchAppForm(){var{appFormState:e,appEventsPanelState:t}=actions,e=[e.updateAppFormField.type,e.updateApplicationHeaderbar.type,e.addConfigField.type,e.createConfigField.type,e.updateConfigField.type,e.removeConfigField.type,e.clearConfigFields.type,e.addContextMenuExtension.type,e.updateContextMenuExtension.type,e.removeContextMenuExtension.type,e.clearContextMenuExtensions.type,e.addNodeModule.type,e.updateNodeModule.type,e.removeNodeModule.type,t.addHandler.type,t.editHandler.type,t.deleteHandler.type];yield takeLatest$1(e,updateLocalStorage)}const updateAppFormSagas=[fork(watchAppForm)];function*rootSaga(){yield all([watchUploadIconStart(),watchProgressChannel(),...appEventsSagas,...flowsSagas,...enginesSagas,...newApplicationSagas,...schemasSagas,...editAppSagas,...updateAppFormSagas])}function getAppCenterNewModule(){return{id:SLICE_NAME,reducerMap:{[SLICE_NAME]:rootReducer},sagas:[rootSaga],initialActions:[]}}const formattedMessageIdPrefix$2="toggle-switch.",Toggle=e=>{var{checked:t,onChange:a}=e;return jsxRuntime.exports.jsxs(Stack,Object.assign({direction:"row",spacing:-1,alignItems:"center"},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h6",sx:{color:t?null:"#5C6269"}},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:formattedMessageIdPrefix$2+"off",defaultMessage:"Off",description:"Off lable for aiware headerbar toggle switch"})})),jsxRuntime.exports.jsx(Switch,Object.assign({color:"secondary",id:"toggle-aiware-headerbar",onChange:a},lodash.exports.omit(e,"className"))),jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h6",sx:{color:t?null:"#5C6269"}},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:formattedMessageIdPrefix$2+"on",defaultMessage:"On",description:"On lable for aiware headerbar toggle switch"})}))]}))},formattedMessageIdPrefix$1="os-app-center-new.headerbar-step.headerbar-toggle.";var ApplicationHeaderbarToggle=({checked:e=!0,onChange:t})=>jsxRuntime.exports.jsxs(Box,Object.assign({width:"100%","data-test":formattedMessageIdPrefix$1+"container"},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h4"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:formattedMessageIdPrefix$1+"title",defaultMessage:"aiWARE Headerbar",description:"Title of the aiware headerbar toggle section"})})),jsxRuntime.exports.jsx(Typography,Object.assign({variant:"body1"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:formattedMessageIdPrefix$1+"instructions",defaultMessage:"This allows the aiWARE header to wrap around your app, keeping it self contained.",description:"Instructions of the aiware headerbar toggle section"})})),jsxRuntime.exports.jsx(FormGroup,{children:jsxRuntime.exports.jsx(FormControl,{children:jsxRuntime.exports.jsx(Toggle,{checked:e,onChange:t,"data-test":formattedMessageIdPrefix$1+"toggle"})})})]}));const useStyles$a=makeStyles()(e=>({editorImg:{maxWidth:"100%",height:"auto"},container:{"& input, textarea":{fontWeight:400},"& fieldset":{borderColor:"#D5DFE9"}},"& fieldset":{borderColor:"#D5DFE9"},textInput:{padding:14.5,boxSizing:"content-box"}})),formattedMessageIdPrefix="os-app-center-new.headerbar-step.customize-headerbar.";var CustomizeApplicationHeaderbar=({handleOnValidate:e})=>{var t=useStyles$a()["classes"];const s=useDispatch(),a=useSelector(selectApp);var n={name:null==(n=a.applicationHeaderbar)?void 0:n.name,elementId:null==(n=a.applicationHeaderbar)?void 0:n.elementId,"config.title":null==(n=a.applicationHeaderbar)?void 0:n.config.title,"config.backgroundColor":null==(n=a.applicationHeaderbar)?void 0:n.config.backgroundColor,"config.zIndex":null==(n=a.applicationHeaderbar)?void 0:n.config.zIndex,"config.logoSrc":null==(n=a.applicationHeaderbar)?void 0:n.config.logoSrc,"config.help":null==(n=a.applicationHeaderbar)?void 0:n.config.help,"config.notification":null==(n=a.applicationHeaderbar)?void 0:n.config.notification,"config.hidePasswordReset":null==(n=a.applicationHeaderbar)?void 0:n.config.hidePasswordReset,"config.displaySupportChat":null==(n=a.applicationHeaderbar)?void 0:n.config.displaySupportChat};const i=useForm({mode:"onChange",defaultValues:n});react.exports.useEffect(()=>{a.headerbarEnabled?null!=e&&e(i.formState.isValid):null!=e&&e(!0)},[i.formState.isValid,a.headerbarEnabled]);var n=e=>{var t=e.target["name"];let a=e.target["value"];"config.zIndex"===t&&(a=Number(a)),s(actions.appFormState.updateApplicationHeaderbar({field:t,value:a}))},o=e=>{var{name:e,checked:t}=e.target;s(actions.appFormState.updateApplicationHeaderbar({field:e,value:t}))};return jsxRuntime.exports.jsxs(Stack,Object.assign({spacing:3,"data-test":formattedMessageIdPrefix+"container"},{children:[jsxRuntime.exports.jsxs(Box,Object.assign({sx:{opacity:a.headerbarEnabled?1:.5}},{children:[jsxRuntime.exports.jsxs(Stack,Object.assign({direction:"row",alignItems:"center",spacing:1},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h4"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:formattedMessageIdPrefix+"title",defaultMessage:"Customize the aiWARE Header",description:"Title of the Customize aiware headerbar section"})})),jsxRuntime.exports.jsx(Typography,Object.assign({variant:"body1"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:formattedMessageIdPrefix+"optional",defaultMessage:"(Optional)",description:"Optional modifier for titles"})}))]})),jsxRuntime.exports.jsx(Typography,Object.assign({variant:"body1"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:formattedMessageIdPrefix+"instructions",defaultMessage:"Your inputs will be injected into the header as JSON and can be used to customize the user interface and functionality.",description:"Instructions of the Customize aiware header bar section"})}))]})),a.headerbarEnabled&&jsxRuntime.exports.jsx(Box,{children:jsxRuntime.exports.jsx(FormProvider,Object.assign({},i,{children:jsxRuntime.exports.jsxs(Grid,Object.assign({className:t.container,container:!0,spacing:5,"data-test":formattedMessageIdPrefix+"form-container"},{children:[jsxRuntime.exports.jsxs(Grid,Object.assign({item:!0,xs:12},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h6",gutterBottom:!0},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:formattedMessageIdPrefix+"headerbar-name",defaultMessage:"Name",description:"You can set a headerbar name"})})),jsxRuntime.exports.jsx(InputText,{variant:"outlined",type:"text",name:"name",fullWidth:!0,"data-test":"app-center-new.aiware-headerbar-name",inputProps:{maxLength:250,className:t.textInput},rules:{required:!0},onChange:n})]})),jsxRuntime.exports.jsxs(Grid,Object.assign({item:!0,xs:12},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h6",gutterBottom:!0},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:formattedMessageIdPrefix+"headerbar-elementId",defaultMessage:"Element ID",description:"You can set a headerbar element id"})})),jsxRuntime.exports.jsx(InputText,{variant:"outlined",name:"elementId",fullWidth:!0,"data-test":"app-center-new.aiware-headerbar-elementId",inputProps:{maxLength:250,className:t.textInput},rules:{required:!0},onChange:n})]})),jsxRuntime.exports.jsxs(Grid,Object.assign({item:!0,xs:12},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h6",gutterBottom:!0},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:formattedMessageIdPrefix+"headerbar-title",defaultMessage:"Title",description:"You can set a headerbar title"})})),jsxRuntime.exports.jsx(InputText,{variant:"outlined",type:"text",name:"config.title",fullWidth:!0,"data-test":"app-center-new.aiware-headerbar-config.title",inputProps:{maxLength:250,className:t.textInput},rules:{required:!0},onChange:n})]})),jsxRuntime.exports.jsxs(Grid,Object.assign({item:!0,xs:2},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h6",gutterBottom:!0},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:formattedMessageIdPrefix+"headerbar-backgroundColor",defaultMessage:"Background Color",description:"You can set a headerbar background color"})})),jsxRuntime.exports.jsx(InputText,{variant:"outlined",type:"color",name:"config.backgroundColor",fullWidth:!0,"data-test":"app-center-new.aiware-headerbar-config.backgroundColor",inputProps:{maxLength:250,className:t.textInput},onChange:n})]})),jsxRuntime.exports.jsxs(Grid,Object.assign({item:!0,xs:12},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h6",gutterBottom:!0},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:formattedMessageIdPrefix+"headerbar-zIndex",defaultMessage:"Z-Index",description:"You can set a headerbar z-index"})})),jsxRuntime.exports.jsx(InputText,{variant:"outlined",type:"number",name:"config.zIndex",fullWidth:!0,"data-test":"app-center-new.aiware-headerbar-config.zIndex",inputProps:{maxLength:250,className:t.textInput},onChange:n})]})),jsxRuntime.exports.jsxs(Grid,Object.assign({item:!0,xs:12},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h6",gutterBottom:!0},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:formattedMessageIdPrefix+"headerbar-logoSource",defaultMessage:"Logo Source",description:"You can set a headerbar logo source"})})),jsxRuntime.exports.jsx(InputText,{variant:"outlined",type:"text",name:"config.logoSrc",fullWidth:!0,"data-test":"app-center-new.aiware-headerbar-config.logoSrc",inputProps:{maxLength:5e3,className:t.textInput},onChange:n})]})),jsxRuntime.exports.jsx(Grid,Object.assign({item:!0,xs:12,style:{padding:"25px 0 0 25px"}},{children:jsxRuntime.exports.jsxs(Box,Object.assign({display:"flex",justifyContent:"start",alignItems:"center"},{children:[jsxRuntime.exports.jsx(InputCheckbox,{name:"config.help",checked:null==(n=null==(t=a.applicationHeaderbar)?void 0:t.config)?void 0:n.help,onChange:o,"data-test":"app-center-new.aiware-headerbar-checkbox-help",label:jsxRuntime.exports.jsx(FormattedMessage,{id:formattedMessageIdPrefix+"checkbox-help",defaultMessage:"Help",description:"Help field checkbox"})}),jsxRuntime.exports.jsx(InputCheckbox,{name:"config.notification",checked:null==(n=null==(t=a.applicationHeaderbar)?void 0:t.config)?void 0:n.notification,onChange:o,"data-test":"app-center-new.aiware-headerbar-checkbox-notification",label:jsxRuntime.exports.jsx(FormattedMessage,{id:formattedMessageIdPrefix+"checkbox-notification",defaultMessage:"Notification",description:"Notification field checkbox"})}),jsxRuntime.exports.jsx(InputCheckbox,{name:"config.displaySupportChat",checked:null==(n=null==(t=a.applicationHeaderbar)?void 0:t.config)?void 0:n.displaySupportChat,onChange:o,"data-test":"app-center-new.aiware-headerbar-checkbox-displaySupportChat",label:jsxRuntime.exports.jsx(FormattedMessage,{id:formattedMessageIdPrefix+"checkbox-displaySupportChat",defaultMessage:"Display Support Chat",description:"Display support chat field checkbox"})}),jsxRuntime.exports.jsx(InputCheckbox,{name:"config.hidePasswordReset",checked:null==(n=null==(t=a.applicationHeaderbar)?void 0:t.config)?void 0:n.hidePasswordReset,onChange:o,"data-test":"app-center-new.aiware-headerbar-checkbox-hidePasswordReset",label:jsxRuntime.exports.jsx(FormattedMessage,{id:formattedMessageIdPrefix+"checkbox-hidePasswordReset",defaultMessage:"Hide Password Reset",description:"Hide password reset field checkbox"})})]}))}))]}))}))})]}))};const useStyles$9=makeStyles()(e=>({container:{padding:e.spacing(6),maxWidth:"100%"},divider:{width:"60rem",margin:e.spacing(5,5,1,6)},list:{width:"60rem",padding:e.spacing(6,0),marginLeft:e.spacing(6)}}));var HeaderbarStep=({handleOnValidate:e})=>{const t=useDispatch();var a=useSelector(selectApp),s=useStyles$9()["classes"];return jsxRuntime.exports.jsxs(Grid,Object.assign({container:!0,flexDirection:"column",rowSpacing:5,columnSpacing:6,className:s.container,"data-test":"app-new-headerbar-step-container"},{children:[jsxRuntime.exports.jsx(Grid,Object.assign({item:!0,flexShrink:0},{children:jsxRuntime.exports.jsx(ApplicationHeaderbarToggle,{checked:a.headerbarEnabled,onChange:e=>{t(actions.appFormState.updateAppFormField({field:"headerbarEnabled",value:e.target.checked}))}})})),jsxRuntime.exports.jsx(Grid,Object.assign({item:!0,flexShrink:0},{children:jsxRuntime.exports.jsx(CustomizeApplicationHeaderbar,{handleOnValidate:e})}))]}))};const useStyles$8=makeStyles()(e=>({container:{padding:e.spacing(6),maxWidth:"100%"},divider:{width:"60rem",margin:e.spacing(5,5,1,6)},list:{width:"60rem",padding:e.spacing(6,0),marginLeft:e.spacing(6)},chip:{marginLeft:"10px"},inputContainer:{paddingTop:"10px"},root:{"&":{width:"100%"}},grayText:{color:"gray"},textInput:{boxSizing:"content-box"}})),ConfigFields=()=>{const a=useDispatch(),s=useSelector(selectConfigFields),e=e=>lodash.exports.map(e,e=>({name:e.name,configLevel:e.configLevel,type:e.type,default:isEmpty_1(e.defaultValue)?"N/A":e.defaultValue})),[n,i]=react.exports.useState(e(s));react.exports.useEffect(()=>{i(e(s))},[s]);const t=(e=!1,t=-1)=>{e={name:"APP_CENTER_CONFIG_FIELDS_FORM",config:{name:"Custom Fields",isEdit:e,editIndex:t}};a(mountPanel({panelId:"APP_CENTER_CONFIG_FIELDS_FORM",microFrontend:e,panelConfig:{type:"APP_BAR_PANEL_TEMPLATE",marginTop:55,marginStart:0,zIndex:1010}}))};return jsxRuntime.exports.jsx(ListField,{idPrefix:"aob-functionality-config-fields",heading:"Application Config Fields",description:"Does your application require config fields? If so, specify them here. Leave blank if not..",actionButtonLabel:"Add Config",items:n,columnNames:["Name","Config Level","Type","Default","",""],canEdit:!0,canDelete:!0,onActionClick:()=>t(),onEditClick:e=>{e=n[e],e=findIndex_1(s,{name:e.name,type:e.type});0<=e&&t(!0,e)},onDeleteClick:e=>{var t=n[e],t=findIndex_1(s,{name:t.name,type:t.type});0<=t&&a(actions.appFormState.removeConfigField({removeIndex:t,configToDelete:s[e]}))},onRequestSort:(e,t)=>{i(orderBy_1(n,lowerCase_1(e),t))}})},urlRegex$1=/^https?:\/\/[(www\.)?a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/,semverRegex=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.?(0|[1-9]?\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,npmModuleNameRegex=/^(@[a-z0-9-~][a-z0-9-._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/,githubHttpsUrlRegex=/^https:\/\/github.com[a-zA-Z0-9-._~/]+?.git$/,uriScopeRegex=/^\/?([a-zA-Z0-9-_.~]+\/?)+$/,CME_PANEL_NAME="APP_CENTER_CONTEXT_MENU_EXTENSIONS",ContextMenuExtensions=()=>{const s=useDispatch(),a=useSelector(selectContextMenuExtensions),e=e=>{return lodash.exports.isNil(e)?[]:Object.values(e).flat().map(e=>({id:e.id,type:e.type,label:e.label,url:e.url||""}))},[n,i]=react.exports.useState(e(a)),o=(react.exports.useEffect(()=>{i(e(a))},[JSON.stringify(a)]),(e=!1,t=void 0,a=-1)=>{e={name:CME_PANEL_NAME,config:{name:"Context Menu Extensions",isEdit:e,extensionType:t,editIndex:a}};s(mountPanel({panelId:CME_PANEL_NAME,microFrontend:e,panelConfig:{type:"APP_BAR_PANEL_TEMPLATE",marginTop:55,marginStart:0,zIndex:1010}}))}),r=e=>{var e=n[e],t=a[e.type+"s"];return{index:lodash.exports.findIndex(t,["id",e.id]),type:e.type}};return jsxRuntime.exports.jsx(ListField,{idPrefix:"aob-functionality-context-menu-extensions",heading:"Context Menu Extensions",description:"Add a menu option to files in aiWare that allow users to send them to your application",actionButtonLabel:"Add Context Menu Extension",items:lodash.exports.map(n,e=>lodash.exports.omit(e,"id")),columnNames:["Type","Label","URL","",""],canEdit:!0,canDelete:!0,onActionClick:()=>o(),onEditClick:e=>{var{index:e,type:t}=r(e);0<=e?o(!0,t,e):console.log("Extension not found",e,t)},onDeleteClick:e=>{var{index:e,type:t}=r(e);0<=e&&s(actions.appFormState.removeContextMenuExtension({extensionType:t,index:e}))},onRequestSort:(e,t)=>{i(lodash.exports.orderBy(n,lodash.exports.lowerCase(e),t))}})},FunctionalityStep=({handleOnValidate:e})=>{var t=useStyles$8()["classes"];const a=useDispatch();var s=useSelector(selectAppUrl);const n=useForm({mode:"onChange",defaultValues:{url:s}});react.exports.useEffect(()=>{null!=e&&e(n.formState.isValid)},[n.formState.isValid]);s=e=>{var{name:e,value:t}=e.target;a(actions.appFormState.updateAppFormField({field:e,value:t}))};return jsxRuntime.exports.jsx(FormProvider,Object.assign({},n,{children:jsxRuntime.exports.jsxs(Grid,Object.assign({container:!0,rowSpacing:5,columnSpacing:6,className:t.container,"data-test":"os-app-center-new-functionality-step-container"},{children:[jsxRuntime.exports.jsxs(Grid,Object.assign({item:!0,xs:12},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h6",gutterBottom:!0,"data-test":"os-app-center-new.application-type-title"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-new.application-type-title-formattedMessage",defaultMessage:"Application Type",description:"Application Type title"})})),jsxRuntime.exports.jsx(Typography,Object.assign({variant:"caption","data-test":"os-app-center-new.application-type-description"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-new.application-type-description-formattedMessage",defaultMessage:"Please select the application type from the list below:",description:"Application Type description"})})),jsxRuntime.exports.jsx("div",Object.assign({className:t.inputContainer},{children:jsxRuntime.exports.jsxs(InputSelect,Object.assign({className:t.root,onChange:s,"data-test":"os-app-center-new.app-type-input",fullWidth:!0,value:"web",name:"app-type"},{children:[jsxRuntime.exports.jsxs(MenuItem,Object.assign({value:"web"},{children:[jsxRuntime.exports.jsx("b",{children:"Web Application"})," ",jsxRuntime.exports.jsx("span",Object.assign({className:t.grayText},{children:"(Accessible via Browser)"}))]})),jsxRuntime.exports.jsxs(MenuItem,Object.assign({disabled:!0},{children:[jsxRuntime.exports.jsx("b",{children:"Docker Application"})," (Run on aiWARE)"," ",jsxRuntime.exports.jsx(Chip,{color:"primary",className:t.chip,size:"small",label:"Coming Soon"})]})),jsxRuntime.exports.jsxs(MenuItem,Object.assign({disabled:!0},{children:[jsxRuntime.exports.jsx("b",{children:"Kubernetes"})," ",jsxRuntime.exports.jsx(Chip,{color:"primary",className:t.chip,size:"small",label:"Coming Soon"})]}))]}))}))]})),jsxRuntime.exports.jsxs(Grid,Object.assign({item:!0,xs:12},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h6",gutterBottom:!0,"data-test":"os-app-center-new.application-url-title"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-new.application-url-title-formattedMessage",defaultMessage:"Application URL",description:"Application url title"})})),jsxRuntime.exports.jsx(Typography,Object.assign({variant:"caption","data-test":"os-app-center-new.application-url-description"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-new.integration-description-formattedMessage",defaultMessage:"Provide the url to access your application. Include http or https.",description:"Application url description"})})),jsxRuntime.exports.jsx("div",Object.assign({className:t.inputContainer},{children:jsxRuntime.exports.jsx(InputText,{className:t.textInput,required:!0,type:"url","data-test":"os-app-center-new.url-input",rules:{required:!0,pattern:{value:urlRegex$1,message:"Must be a valid URL including protocol."}},onChange:s,placeholder:"URL",name:"url",fullWidth:!0})}))]})),jsxRuntime.exports.jsx(Grid,Object.assign({item:!0,xs:12},{children:jsxRuntime.exports.jsx(ConfigFields,{})})),jsxRuntime.exports.jsx(Grid,Object.assign({item:!0,xs:12},{children:jsxRuntime.exports.jsx(ContextMenuExtensions,{})}))]}))}))},useStyles$7=makeStyles()(e=>({container:{padding:e.spacing(6),maxWidth:"100%"},divider:{width:"60rem",margin:e.spacing(5,5,1,6)},list:{width:"60rem",padding:e.spacing(6,0),marginLeft:e.spacing(6)},chip:{marginLeft:"10px",marginTop:"9px",marginRight:"15px",background:"#214167"},inputContainer:{paddingTop:"10px"},root:{"&":{width:"100%"}},checked:{color:"#6098D1"},textInput:{boxSizing:"content-box"}})),useOneClickCopy=a=>{const[t,s]=react.exports.useState(!1);return[e=>{var t;navigator.clipboard.writeText(null!=(t=a.current.dataset.copyToClipboardText)?t:a.current.innerText),s(!0)},e=>jsxRuntime.exports.jsx(Tooltip,Object.assign({open:t,onClose:()=>{s(!1)},title:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-copied-to-clipboard",defaultMessage:"Copied to clipboard",description:"Copied to clipboard"})},e,{children:e.children}))]};var OAuthClientSecret=({appId:a,disabled:e})=>{const s=useSelector(selectApiConfigs),[t,n]=react.exports.useState(""),[i,o]=react.exports.useState(!1),[r,l]=react.exports.useState(!1),[p,d]=react.exports.useState(!1);var c=react.exports.useRef();const[u,x]=useOneClickCopy(c);react.exports.useEffect(()=>{!lodash.exports.isEmpty(t)&&p&&(u(null),d(!1))});const m=react.exports.useRef();const[g,h]=react.exports.useState(!1),[j,f]=react.exports.useState(!1);const[b,y]=react.exports.useState(!1);return jsxRuntime.exports.jsxs(Stack,Object.assign({direction:"column",spacing:2,"data-test":"oauth-client-secret-retrival-tool"},{children:[jsxRuntime.exports.jsx(FormLabel,Object.assign({htmlFor:"clientSecret"},{children:jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h6"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-new.oauth-client-secret-label-formattedMessage",defaultMessage:"Client Secret: OAuth",description:"Lable for the client secret input when selecting OAuth"})}))})),jsxRuntime.exports.jsxs(Stack,Object.assign({direction:"row",spacing:2,alignItems:"center",width:"60%"},{children:[jsxRuntime.exports.jsx(x,{children:jsxRuntime.exports.jsx(InputText,{name:"oauthClientSecret",fullWidth:!0,disabled:!0,ref:c,"data-copy-to-clipboard-text":t,id:"clientSecret",color:"secondary",style:{backgroundColor:"#F2F5F9"},type:j?"text":"password",size:"small",value:t,InputProps:{endAdornment:jsxRuntime.exports.jsx(InputAdornment,Object.assign({position:"end"},{children:jsxRuntime.exports.jsx(IconButton,Object.assign({"data-test":"oauth-client-secret-reveal","aria-label":"toggle client secret visibility",onClick:()=>{lodash.exports.isEmpty(t)?h(!0):f(!j)},disabled:e},{children:j?jsxRuntime.exports.jsx(default_1$4,{}):jsxRuntime.exports.jsx(default_1$1,{})}))}))}})}),jsxRuntime.exports.jsx(IconButton,Object.assign({"aria-label":"copy client secret",onClick:e=>{lodash.exports.isEmpty(t)?(d(!0),h(!0)):u(e)},disabled:e,"data-test":"oauth-client-secret-copy"},{children:jsxRuntime.exports.jsx(Copy,{})}))]})),jsxRuntime.exports.jsxs(Collapse,Object.assign({in:g},{children:[jsxRuntime.exports.jsx(FormLabel,Object.assign({htmlFor:"clientSecret"},{children:jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h6"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-new.oauth-client-secret-password-input-label-formattedMessage",defaultMessage:"Please enter your account password to reveal client secret",description:"Lable for the client secret password input when selecting OAuth"})}))})),jsxRuntime.exports.jsx("form",Object.assign({onSubmit:e=>{e.preventDefault();var t,e=null==(e=m.current)?void 0:e.value;lodash.exports.isEmpty(e)||(t=e,__awaiter(void 0,void 0,void 0,function*(){console.log("handleFetchClientSecret Start");try{o(!0);var e=yield getOAuthClientSecret(s,{id:a,password:t});console.log("Result:",e),n(e.application.clientSecret),h(!1)}catch(e){m.current.focus(),l(!0)}finally{o(!1)}}))}},{children:jsxRuntime.exports.jsxs(Stack,Object.assign({direction:"row",spacing:2},{children:[jsxRuntime.exports.jsx(InputText,{name:"password",InputProps:{endAdornment:jsxRuntime.exports.jsx(InputAdornment,Object.assign({position:"end"},{children:jsxRuntime.exports.jsx(IconButton,Object.assign({"aria-label":"toggle password visibility",onClick:()=>{y(!b)},"data-test":"oauth-client-secret-password-reveal"},{children:b?jsxRuntime.exports.jsx(default_1$4,{}):jsxRuntime.exports.jsx(default_1$1,{})}))}))},inputRef:m,id:"password",color:r?"error":"secondary",type:b?"text":"password",size:"small"}),i?jsxRuntime.exports.jsx(CircularProgress,{color:"secondary"}):jsxRuntime.exports.jsx(IconButton,Object.assign({"aria-label":"submit password",type:"submit","data-test":"oauth-client-secret-password-submit"},{children:jsxRuntime.exports.jsx(ArrowForward,{})}))]}))}))]}))]}))};const AuthenticationStep=({handleOnValidate:e})=>{var t=useStyles$7()["classes"],a=useSelector(selectApp),s=useSelector(selectIsEditForm)["isEditForm"];const n=useDispatch();const i=useForm({mode:"onChange",defaultValues:{oauthUrl:"",authMethod:"none"}});react.exports.useEffect(()=>{null!=e&&e(i.formState.isValid)},[i.formState.isValid]);var o=e=>{var{name:e,value:t}=e.target;n(actions.appFormState.updateAppFormField({field:e,value:t}))};return jsxRuntime.exports.jsx(Box,Object.assign({"data-test":"os-app-center-new-authentication-step-container"},{children:jsxRuntime.exports.jsx(FormProvider,Object.assign({},i,{children:jsxRuntime.exports.jsxs(Grid,Object.assign({container:!0,rowSpacing:5,columnSpacing:6,className:t.container},{children:[jsxRuntime.exports.jsxs(Grid,Object.assign({item:!0,xs:12},{children:[jsxRuntime.exports.jsx(Heading,{title:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-new.authentication-title-formattedMessage",defaultMessage:"Authentication",description:"Authentication title"}),description:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-new.authentication-description-formattedMessage",defaultMessage:"Default authentication is None. OAuth and JWT authentication protocols coming soon",description:"authentication description"}),testName:"os-app-center-new.authentication"}),jsxRuntime.exports.jsx(Typography,{variant:"h6",gutterBottom:!0,"data-test":"os-app-center-new.authentication-title"}),jsxRuntime.exports.jsx(Typography,{variant:"caption","data-test":"os-app-center-new.authentication-description"}),jsxRuntime.exports.jsx("div",Object.assign({className:t.inputContainer},{children:jsxRuntime.exports.jsxs(InputRadioGroup,Object.assign({"data-test":"authentication-radio-group",name:"authMethod",value:a.authMethod,onChange:o,rules:{required:!0},row:!0},{children:[jsxRuntime.exports.jsx(FormControlLabel,{value:"none",control:jsxRuntime.exports.jsx(Radio,{"data-test":"radio-none"}),label:jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h6",color:"textSecondary"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-new.radio-None-formattedMessage",defaultMessage:"None",description:"None"})}))}),jsxRuntime.exports.jsx(FormControlLabel,{value:"oauth",control:jsxRuntime.exports.jsx(Radio,{"data-test":"radio-oauth"}),label:jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h6"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-new.radio-OAuth-formattedMessage",defaultMessage:"OAuth",description:"OAuth"})}))}),jsxRuntime.exports.jsx(FormControlLabel,{value:"jwt",disabled:!0,control:jsxRuntime.exports.jsx(Radio,{"data-test":"radio-jwt"}),label:jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h6",style:{color:"lightgray"}},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-new.radio-JWT-formattedMessage",defaultMessage:"JWT",description:"JWT"})}))}),jsxRuntime.exports.jsx(Chip,{color:"primary",className:t.chip,size:"small",label:"Coming Soon"})]}))}))]})),jsxRuntime.exports.jsx(Grid,Object.assign({item:!0,xs:12},{children:jsxRuntime.exports.jsx(Collapse,Object.assign({in:lodash.exports.isEqual(a.authMethod,"oauth")},{children:jsxRuntime.exports.jsxs(Stack,Object.assign({spacing:5,"data-test":"authentication-oauth-section"},{children:[jsxRuntime.exports.jsx(InputText,{inputProps:{className:t.textInput},name:"oauthUrl",value:a.oauthUrl,onChange:o,fullWidth:!0,variant:"outlined",label:jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h2",style:{color:"lightgray"}},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-new.oauth-url-formattedMessage",defaultMessage:"OAuth URL",description:"Lable for the oauth url input when selecting OAuth"})})),InputLabelProps:{disableAnimation:!1},rules:{required:lodash.exports.isEqual(a.authMethod,"oauth"),pattern:{value:urlRegex$1,message:"Must be a valid URL including protocol."},maxLength:1e3}}),s?jsxRuntime.exports.jsx(OAuthClientSecret,{appId:a.id}):jsxRuntime.exports.jsxs(Box,{children:[jsxRuntime.exports.jsx(OAuthClientSecret,{appId:"",disabled:!0}),jsxRuntime.exports.jsx(Typography,Object.assign({color:"secondary"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-new.oauth-client-secret-not-available-formattedMessage",defaultMessage:"You will be able to retrieve the oauth client secret here after submitting this application.",description:"Instruction durring application onboarding on how to find oauth client secret after application submission."})}))]})]}))}))}))]}))}))}))},useStyles$6=makeStyles()(e=>({container:{width:"100%",padding:"25px 30px"},subheading:{maxWidth:"100%",minWidth:"48.75rem",padding:"30px 0"},titleDesc:{width:"60%",display:"inline-block"},appLogo:{width:"40%",display:"inline-block"},text:{width:"39.5rem",padding:"14px 0",borderBottom:"0.5px solid #D5DFE9",fontWeight:400},textCollapsible:{width:"39.5rem",padding:"8px 0",borderBottom:"0.5px solid #D5DFE9",cursor:"pointer"},collapse:{width:"39.5rem"},collapseContent:{maxHeight:200,overflow:"auto"},pre:{whiteSpace:"pre-line"},asterisk:{color:"#D43060",margin:"0 2px"}})),useStyles$5=makeStyles()(e=>({root:{borderRadius:"50%",border:"1px solid #D5DFE9",display:"flex",justifyContent:"center",alignItems:"center",overflow:"hidden",width:e.spacing(8),height:e.spacing(8)},logo:{maxWidth:"100%",maxHeight:"100%"},veritoneLogo:{maxWidth:"100%",maxHeight:"100%"}})),AppLogo=({path:e})=>{var t=useStyles$5()["classes"];return jsxRuntime.exports.jsx("div",Object.assign({className:t.root},{children:jsxRuntime.exports.jsx("img",{className:t.logo+" "+(!e&&t.veritoneLogo),src:e||img$1y,alt:"app logo"})}))},Row=({label:e,value:t,style:a,testName:s,icon:n,asterisk:i,handleOpenCollapse:o,textTransformValue:r="capitalize"})=>jsxRuntime.exports.jsxs(Box,Object.assign({display:"flex",justifyContent:"space-between",alignItems:"center",textTransform:r,"data-test":s+"-container"},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h6","data-test":"label-"+s},{children:e})),jsxRuntime.exports.jsxs(Box,Object.assign({className:a,display:"flex",justifyContent:"space-between",alignItems:"center",onClick:o},{children:[jsxRuntime.exports.jsxs(Typography,Object.assign({variant:"h6",sx:{fontWeight:400}},{children:[t,i]})),jsxRuntime.exports.jsx(IconButton,Object.assign({"aria-label":"expand row",size:"small",onClick:o,"data-test":s+"-expand-action-trigger"},{children:n}))]}))]})),ConfirmationStep=()=>{var e=useStyles$6()["classes"],t=useSelector(selectApp);return jsxRuntime.exports.jsxs(Box,Object.assign({className:e.container,"data-test":"os-app-center-new-confirmation-step-container"},{children:[jsxRuntime.exports.jsxs(Grid,Object.assign({className:e.subheading},{children:[jsxRuntime.exports.jsxs("div",Object.assign({className:e.titleDesc},{children:[jsxRuntime.exports.jsx(Box,Object.assign({display:"flex",alignItems:"center",textTransform:"capitalize","data-test":"os-app-center-new-confirmation-step.app-name"},{children:jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h2"},{children:lodash.exports.isEmpty(t.name)?"-":t.name}))})),jsxRuntime.exports.jsx(Box,Object.assign({"data-test":"os-app-center-new-confirmation-step.app-description"},{children:jsxRuntime.exports.jsx(Typography,Object.assign({variant:"caption",color:"#2A323C"},{children:lodash.exports.isEmpty(t.description)?"-":t.description}))}))]})),jsxRuntime.exports.jsx("div",Object.assign({"data-test":"os-app-center-new-confirmation-step.app-logo",className:e.appLogo},{children:jsxRuntime.exports.jsx(AppLogo,{path:t.iconPath})}))]})),jsxRuntime.exports.jsxs(Box,Object.assign({sx:{width:"100%"},"data-test":"os-app-center-new-confirmation-step.row-container"},{children:[jsxRuntime.exports.jsx(Row,{label:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-new-confirmation-step.app-url-formattedMessage",defaultMessage:"Application URL:",description:"application url"}),textTransformValue:"none",value:lodash.exports.isEmpty(t.url)?"-":t.url,style:e.text,testName:"os-app-center-new-confirmation-step.app-url"}),jsxRuntime.exports.jsx(Row,{label:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-new-confirmation-step.custom-fields-formattedMessage",defaultMessage:"Custom Fields:",description:"Custom Fields"}),value:lodash.exports.isEmpty(t.configFields)?"-":lodash.exports.join(lodash.exports.map(t.configFields,e=>e.name),", "),style:e.text,testName:"os-app-center-new-confirmation-step.app-custom-fields"}),jsxRuntime.exports.jsx(Row,{label:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-new-confirmation-step.app-headerbar-formattedMessage",defaultMessage:"Headerbar:",description:"headerbar"}),value:t.headerbarEnabled?"On (Default)":"Off",style:e.text,testName:"os-app-center-new-confirmation-step.app-headerbar"}),jsxRuntime.exports.jsx(Row,{label:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-new-confirmation-step.app-auth-formattedMessage",defaultMessage:"Authentication:",description:"auth"}),value:"None (Default)",style:e.text,testName:"os-app-center-new-confirmation-step.app-auth"}),jsxRuntime.exports.jsx(Row,{label:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-new.confirmation-step-app-packages-formattedMessage",defaultMessage:"App Packages:",description:"app packages"}),value:lodash.exports.isEmpty(t.flows)&&lodash.exports.isEmpty(t.engines)&&lodash.exports.isEmpty(t.schemas)?"-":`Automate Flows (${t.flows.length}), Engines (${t.engines.length}), Schemas (${t.schemas.length})`,style:e.text,testName:"os-app-center-new-confirmation-step.app-packages"})]}))]}))},formatDate=e=>{return e?(e=new Date(e)).toLocaleDateString()+" "+e.toLocaleTimeString("en-US",{hour:"numeric",minute:"numeric",hour12:!0}):"--/--/-- --:-- --"};var EngineLinking=()=>{const a=useDispatch(),{engines:s,id:n,enginesToDelete:i}=useSelector(selectApp),e=e=>lodash.exports.map(e,e=>({id:e.id,name:e.name,edgeVersion:e.edgeVersion,modifiedDateTime:formatDate(e.modifiedDateTime)})),[o,r]=(react.exports.useEffect(()=>{r(e(s))},[s]),react.exports.useState([])),l=(react.exports.useEffect(()=>{r(e(s))},[s]),{name:"name",version:"edgeVersion",lastUpdated:"modifiedDateTime"});return jsxRuntime.exports.jsx(ListField,{idPrefix:"aob.engine-linking-list.engines",heading:"aiWARE Engines to Include with App Package",description:"Select engines that interface with your application to be included with your application package.",actionButtonLabel:"Add Engine",items:lodash.exports.map(o,e=>lodash.exports.omit(e,"id")),columnNames:["Name","Version","Last Updated"],canEdit:!1,canDelete:!0,onActionClick:()=>{var e={name:"DATA_CENTER_PROCESS_AI",config:{name:"DATA CENTER PROCESS AI",parentPanelId:"PROCESSING_CENTER_DAG_BUILDER",isFullScreen:!0,marginTop:55,marginStart:0,enableNonSingleEngineJobEngines:!0,aobSelectedEngines:s,onSaveEngineSelection:e=>{a(actions.appFormState.updateAppFormField({field:"engines",value:e}))},panelTitle:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-new.add-package.add-engine-panel.title",defaultMessage:"Add Engine",description:"title for the add engine panel in the app onboarding process"}),panelDescription:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-new.add-package.add-engine-panel.description",defaultMessage:"Select from a list of AI capabilities to apply available engines to your package.",description:"description for the add engine panel in the app onboarding process"}),submitButtonLabel:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-new.add-package.add-engine-panel.submit-button-label",defaultMessage:"Add Engine",description:"label for the add engine panel submit button in the app onboarding process"})}};a(mountPanel({panelId:"DATA_CENTER_PROCESS_AI",microFrontend:e,panelConfig:{type:"APP_BAR_PANEL_TEMPLATE",marginTop:55,marginStart:0,size:"small",zIndex:1003,parentPanelId:"APP_CENTER_NEW",dimmed:0,dimmedStatus:"dimParent"}}))},onRequestSort:(t,e)=>{r(lodash.exports.orderBy(o,[e=>lodash.exports.lowerCase(e[l[lodash.exports.camelCase(t)]])],e))},onDeleteClick:e=>{const t=o[e];a(actions.appFormState.updateAppFormField({field:"engines",value:lodash.exports.reject(s,e=>e.id===t.id)})),r(o.slice(0,e).concat(o.slice(e+1)));e=lodash.exports.findIndex(s,{id:t.id});0<=e&&!lodash.exports.isEmpty(n)&&a(actions.appFormState.updateAppFormField({field:"enginesToDelete",value:[...i,s[e]]}))}})},FlowLinking=()=>{const a=useDispatch(),{flows:s,id:n,flowsToDelete:i}=useSelector(selectApp),[o,r]=(react.exports.useEffect(()=>{var e;r((e=s,lodash.exports.map(e,e=>({id:e.id,name:e.name,version:e.edgeVersion,lastUpdated:formatDate(e.modifiedDateTime)}))))},[s]),react.exports.useState([]));return jsxRuntime.exports.jsx(ListField,{idPrefix:"aob.engine-linking-list.flows",heading:"Automate Flows to Include with App Package",description:"Select Automate flows that interface with your application to be included with your application package.",actionButtonLabel:"Add Flow",items:lodash.exports.map(o,e=>lodash.exports.omit(e,"id")),columnNames:["Name","Version","Last Updated",""],canEdit:!1,canDelete:!0,onDeleteClick:e=>{const t=o[e];a(actions.appFormState.updateAppFormField({field:"flows",value:lodash.exports.reject(s,e=>e.id===t.id)})),r(o.slice(0,e).concat(o.slice(e+1)));e=lodash.exports.findIndex(s,{id:t.id});0<=e&&!lodash.exports.isEmpty(n)&&a(actions.appFormState.updateAppFormField({field:"flowsToDelete",value:[...i,s[e]]}))},onEditClick:lodash.exports.noop,onActionClick:()=>{a(mountPanel({panelId:"APP_CENTER_ADD_FLOW_PANEL",microFrontend:{name:"APP_CENTER_ADD_FLOW_PANEL",config:{name:"Add Flow"}},panelConfig:{type:"APP_BAR_PANEL_TEMPLATE",marginTop:55,marginStart:0,size:"large",zIndex:1001}}))},onRequestSort:(t,e)=>{r(lodash.exports.orderBy(o,[e=>lodash.exports.lowerCase(e[lodash.exports.camelCase(t)])],e))}})},Schema=()=>{const a=useDispatch(),{schemas:s,id:n,schemasToDelete:i}=useSelector(selectApp),[o,r]=(react.exports.useEffect(()=>{var e;r((e=s,lodash.exports.map(e,e=>({dataRegistryId:e.dataRegistryId,name:e.name,version:e.version,lastUpdated:formatDate(e.modifiedDateTime)}))))},[s]),react.exports.useState([]));return jsxRuntime.exports.jsx(ListField,{idPrefix:"aob.engine-linking-list.schemas",heading:"aiWARE Data Schema to Include with App Package",description:"Select Data Schemas that interface with your application to be included with your application package.",actionButtonLabel:"Add Schema",items:lodash.exports.map(o,e=>lodash.exports.omit(e,"dataRegistryId")),columnNames:["Name","Version","Last Updated",""],canEdit:!1,canDelete:!0,onEditClick:lodash.exports.noop,onDeleteClick:e=>{const t=o[e];a(actions.appFormState.updateAppFormField({field:"schemas",value:lodash.exports.reject(s,e=>e.dataRegistryId===t.dataRegistryId)})),r(o.slice(0,e).concat(o.slice(e+1)));e=lodash.exports.findIndex(s,{dataRegistryId:t.dataRegistryId});0<=e&&!lodash.exports.isEmpty(n)&&a(actions.appFormState.updateAppFormField({field:"schemasToDelete",value:[...i,s[e]]}))},onActionClick:()=>{a(mountPanel({panelId:"APP_CENTER_ADD_SCHEMA_PANEL",microFrontend:{name:"APP_CENTER_ADD_SCHEMA_PANEL",config:{name:"Add Schema"}},panelConfig:{type:"APP_BAR_PANEL_TEMPLATE",marginTop:55,marginStart:0,size:"large",zIndex:1001}}))},onRequestSort:(t,e)=>{r(lodash.exports.orderBy(o,[e=>lodash.exports.lowerCase(e[lodash.exports.camelCase(t)])],e))}})},AppPackagesStep=()=>jsxRuntime.exports.jsxs(Stack,Object.assign({spacing:5,p:6,"data-test":"app-package"},{children:[jsxRuntime.exports.jsx(Box,{children:jsxRuntime.exports.jsx(FlowLinking,{})}),jsxRuntime.exports.jsx(Box,{children:jsxRuntime.exports.jsx(EngineLinking,{})}),jsxRuntime.exports.jsx(Box,{children:jsxRuntime.exports.jsx(Schema,{})})]}));const useBasicInfoStyles=makeStyles()(e=>({container:{padding:e.spacing(6),justifyContent:"space-around","& input, textarea":{fontWeight:400},"& fieldset":{borderColor:"#D5DFE9"}},textInput:{padding:26},labelRow:{display:"flex",gap:e.spacing(2),alignItems:"flex-end"},optional:{fontSize:10,marginBottom:e.spacing(1)},select:{"& > div":{fontWeight:400,width:"280px"}}})),useIconImporterStyles=makeStyles()(e=>({iconBox:{display:"flex",justifyContent:"center",alignItems:"center",width:200,height:200,padding:e.spacing(3),border:"1px dashed #D5DFE9",borderRadius:5,transition:"all .2s ease","&:hover":{border:"1px solid #dde6ee"}},innerBox:{position:"relative",background:"#F5F5F5",width:"100%",height:"100%",borderRadius:5,display:"flex",justifyContent:"center",alignItems:"center",transition:"all .2s ease","&:hover":{background:"#dde6ee"}},fileInput:{display:"none"},addIcon:{color:"#555F7C",height:42,width:42,"&:hover":{color:"#555F7C"}},iconPreview:{objectFit:"cover",borderRadius:5,width:"100%",maxHeight:"100%"},removeIcon:{top:"90%",right:66}})),useDragAndDrop=({acceptedFileTypes:i})=>{const t=react.exports.useRef(),e=react.exports.useRef(),o=useDispatch();var a=useSelector(preferredLanguageSelector);const r=AIWareFormatMessage(a),s=react.exports.useCallback(e=>{var t,a,s,n;e&&(i.includes(e.type)?5e6<=e.size?o(showMessage({content:r({id:"os-app-center-new.snackbar.unsupportedFileSize",defaultMessage:[{type:0,value:"File file size must be less than 5 MB"}]}),severity:MessageSeverity.Warning})):({name:t,size:a,type:s}=e,n=URL.createObjectURL(e),n={id:guid(),previewUrl:n,name:t,size:a,type:s},o(actions.iconUploadState.uploadIconStart({file:n}))):o(showMessage({content:r({id:"os-app-center-new.snackbar.unsupportedFileType",defaultMessage:[{type:1,value:"type"},{type:0,value:" is not a supported image type."}]},{type:e.type}),severity:MessageSeverity.Warning})))},[i,o]),n=react.exports.useCallback(e=>{e.preventDefault();e=e.dataTransfer.files[0];s(e)},[s]);const l=e=>{e.preventDefault()};return react.exports.useEffect(()=>{const e=t.current;return e.addEventListener("drop",n),()=>{e.removeEventListener("drop",n)}},[n]),react.exports.useEffect(()=>{const e=t.current;return e&&(e.addEventListener("dragover",l),e.addEventListener("dragleave",l)),()=>{e.removeEventListener("dragover",l),e.removeEventListener("dragleave",l)}},[]),{dropZoneRef:t,fileInputRef:e,handleRemoveFile:e=>{e.stopPropagation(),o(actions.iconUploadState.deleteLocalIcon()),o(actions.appFormState.updateAppFormField({field:"iconPath",value:""}))},handleOpenFilePicker:()=>{e.current.click()},handleIconSelect:e=>{e=e.target.files[0];s(e)}}},acceptedFileTypes=["image/jpeg","image/png","image/gif","image/svg+xml"],IconImporter=({iconPath:e})=>{var t=useSelector(selectIcon),a=useIconImporterStyles()["classes"],{dropZoneRef:s,fileInputRef:n,handleRemoveFile:i,handleIconSelect:o,handleOpenFilePicker:r}=useDragAndDrop({acceptedFileTypes:acceptedFileTypes});return jsxRuntime.exports.jsx("div",Object.assign({className:a.iconBox,ref:s,"data-test":"app-description-icon-dropzone"},{children:e||null!=t&&t.previewUrl?jsxRuntime.exports.jsxs("div",Object.assign({className:a.innerBox,style:{backgroundColor:"transparent"}},{children:[jsxRuntime.exports.jsx(IconButton,Object.assign({style:{position:"absolute"},"data-test":"app-description-icon-remove",className:a.removeIcon,size:"small",onClick:i},{children:jsxRuntime.exports.jsx(default_1$2,{})})),jsxRuntime.exports.jsx("img",{src:(null==t?void 0:t.previewUrl)||e,alt:(null==t?void 0:t.name)||"Icon",className:a.iconPreview,"data-test":"app-description-icon-preview"})]})):jsxRuntime.exports.jsxs(Button,Object.assign({className:a.innerBox,onClick:r},{children:[jsxRuntime.exports.jsx("input",{accept:"image/jpeg, image/png",type:"file",ref:n,className:a.fileInput,onChange:o}),jsxRuntime.exports.jsx(default_1$5,{className:a.addIcon})]}))}))},BasicInfo=({onValidate:e})=>{var t=useBasicInfoStyles()["classes"];const a=useIntl(),s=useDispatch(),n=useSelector(selectApp),i=useSelector(selectIsResumeSession),o=useSelector(selectApps);var r={name:n.name,description:n.description};const l=useForm({mode:"onChange",defaultValues:r});react.exports.useEffect(()=>{e(l.formState.isValid)},[l.formState.isValid]),react.exports.useEffect(()=>{__awaiter(void 0,void 0,void 0,function*(){i&&(l.reset(n),setTimeout(()=>__awaiter(void 0,void 0,void 0,function*(){yield l.trigger()}),500))})},[i]);r=e=>{var{name:e,value:t}=e.target;e=e,t=t,s(actions.appFormState.updateAppFormField({field:e,value:t}))};return jsxRuntime.exports.jsx(Box,Object.assign({"data-test":"basic-info"},{children:jsxRuntime.exports.jsx(FormProvider,Object.assign({},l,{children:jsxRuntime.exports.jsxs(Grid,Object.assign({className:t.container,container:!0,rowSpacing:4,columnSpacing:10,"data-test":"app-description"},{children:[jsxRuntime.exports.jsxs(Grid,Object.assign({container:!0,item:!0,xs:12,sm:8,rowSpacing:2,columnSpacing:6},{children:[jsxRuntime.exports.jsxs(Grid,Object.assign({item:!0,xs:12,sm:6},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h6",gutterBottom:!0},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-new.name-description-label",defaultMessage:"Name & Description",description:"Name & Description"})})),jsxRuntime.exports.jsx(Typography,Object.assign({variant:"caption",paragraph:!0},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-new.application-description-caption",defaultMessage:"Provide a name and description to let users know what your application does.",description:"application name and description caption"})}))]})),jsxRuntime.exports.jsx(Grid,Object.assign({item:!0,xs:12},{children:jsxRuntime.exports.jsx(InputText,{inputProps:{className:t.textInput},"data-test":"app-description-input-name",variant:"outlined",sx:{marginBottom:3},placeholder:"Application Name",name:"name",value:n.name,onChange:r,fullWidth:!0,rules:{required:!0,maxLength:100,validate:{isNameSame:t=>{return!o.find(e=>e.name.toLowerCase()===t.toLowerCase())||a.formatMessage({id:"os-app-center-new.app-description-input-name-error",defaultMessage:[{type:0,value:"An application with this name already exists"}]})}}}})})),jsxRuntime.exports.jsx(Grid,Object.assign({item:!0,xs:12},{children:jsxRuntime.exports.jsx(InputText,{InputProps:{className:t.textInput},"data-test":"app-description-input-description",variant:"outlined",placeholder:"Description",name:"description",fullWidth:!0,multiline:!0,rows:10,value:n.description,onChange:r,rules:{required:!0,maxLength:250}})}))]})),jsxRuntime.exports.jsx(Grid,Object.assign({container:!0,item:!0,xs:12,sm:4,rowSpacing:4,columnSpacing:6},{children:jsxRuntime.exports.jsxs(Grid,Object.assign({item:!0,xs:12},{children:[jsxRuntime.exports.jsxs(Box,Object.assign({sx:{py:1}},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h6",gutterBottom:!0},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-new.icon-image-label",defaultMessage:"App Icon",description:"App Icon"})})),jsxRuntime.exports.jsx(Typography,Object.assign({variant:"caption",paragraph:!0},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-new.image-recommended-label",defaultMessage:"Recommended image size:{br}300x300 .png or .jpg",description:"Recommended image size:{br} 300x300 .png or .jpg",values:{br:jsxRuntime.exports.jsx("br",{})}})}))]})),jsxRuntime.exports.jsx(IconImporter,{iconPath:n.iconPath})]}))})),jsxRuntime.exports.jsx(Grid,Object.assign({item:!0,xs:12},{children:jsxRuntime.exports.jsx(EntityTags,{selectedTags:n.entityTags,setSelectedTags:e=>{s(actions.appFormState.updateAppFormField({field:"entityTags",value:e}))}})}))]}))}))}))},PaletteIntegration=()=>{const a=useDispatch(),t=useSelector(selectApp)["nodeModules"],s=useSelector(selectIsEditForm)["isEditForm"],[n,i]=(react.exports.useEffect(()=>{i((e=>{e=lodash.exports.map(e,(e,t)=>{var a;return isNpmRepoModule(e)?{name:e.moduleName,status:e.status,editIndex:t}:isGithubModule(e)?{name:null!=(a=e.moduleName)?a:e.registryUrl,status:e.status,editIndex:t}:{name:"ERR: unknown package name!",status:ModuleStatus.ACTIVE,editIndex:t}});return lodash.exports.filter(e,e=>e.status===ModuleStatus.ACTIVE)})(t))},[t]),react.exports.useState([]));const o=(e=!1,t=-1)=>{e={name:"APP_CENTER_AUTOMATE_PALETTE_INTEGRATION_PANEL",config:{name:"Add Module",isEdit:e,editIndex:t}};a(mountPanel({panelId:"APP_CENTER_AUTOMATE_PALETTE_INTEGRATION_PANEL",microFrontend:e,panelConfig:{type:"APP_BAR_PANEL_TEMPLATE",marginTop:55,marginStart:0,size:"small",zIndex:1001}}))};return jsxRuntime.exports.jsx(Box,Object.assign({m:5,"data-test":"automate"},{children:jsxRuntime.exports.jsx(ListField,{idPrefix:"aob.automate-palette-integration",heading:"aiWARE Automate Palette Integration",description:"Please specify all the npm packages to install in Automate when this application is enabled in the organization.",actionButtonLabel:"Add Module",items:lodash.exports.map(n,e=>lodash.exports.omit(e,["editIndex","status"])),columnNames:["Palette","",""],canEdit:!0,canDelete:!0,onActionClick:()=>o(),onEditClick:e=>{e=n[e].editIndex;0<=e&&o(!0,e)},onDeleteClick:e=>{e=n[e].editIndex;0<=e&&(s&&t[e].moduleId?a(actions.appFormState.updateNodeModule({nodeModules:Object.assign(Object.assign({},t[e]),{status:ModuleStatus.DELETED}),index:e})):a(actions.appFormState.removeNodeModule(e)))},onRequestSort:(t,e)=>{"Palette"===t&&(t="Name"),i(lodash.exports.orderBy(n,[e=>lodash.exports.lowerCase(e[lodash.exports.camelCase(t)])],e))}})}))},handlerEventMap={webhook:"Webhook",flow:"Automate Flow",none:"None"},AppEventsStep=()=>{const a=useDispatch(),s=useSelector(selectEventPanel)["handlers"],e=e=>0===e.length?[]:lodash.exports.map(e,e=>({handler:handlerEventMap[e.eventType],event:e.eventNames&&e.eventNames.join(", ")})),[n,i]=react.exports.useState(e(s)),o=(react.exports.useEffect(()=>{i(e(s))},[s]),(e=!1,t=-1)=>{e={name:"APP_CENTER_EVENT_PANEL",config:{name:"Add Aiware Event",isEdit:e,editIndex:t}};a(mountPanel({panelId:"APP_CENTER_EVENT_PANEL",microFrontend:e,panelConfig:{type:"APP_BAR_PANEL_TEMPLATE",marginTop:55,marginStart:0,size:"large",zIndex:1010}}))});return jsxRuntime.exports.jsx(Box,Object.assign({m:5,"data-test":"app-event-step"},{children:jsxRuntime.exports.jsx(ListField,{idPrefix:"aob-functionality-event-handlers",heading:"aiWARE Event Handlers",description:"Webhooks (Events) allow external services to be notified when certain events happen in aiWARE. When the specified events happen, we'll send a POST request to each of the URLs & Flows you provide.",actionButtonLabel:"Add Handler",items:n,columnNames:["Handler","Event","",""],canEdit:!0,canDelete:!0,onActionClick:()=>o(),onEditClick:t=>{var e=findIndex_1(s,e=>handlerEventMap[e.eventType]===n[t].handler&&n[t].event===e.eventNames.join(", "));o(!0,e)},onDeleteClick:t=>{var e=findIndex_1(s,e=>handlerEventMap[e.eventType]===n[t].handler&&n[t].event===e.eventNames.join(", "));a(actions.appEventsPanelState.deleteHandler(e))},onRequestSort:(e,t)=>{i(orderBy_1(n,lowerCase_1(e),t))}})}))},AppOnboardingFlow=()=>{const a=useDispatch(),s=useSelector(selectApp),n=useSelector(selectIsEditForm)["isEditForm"],i=useSelector(selectPrevNodeModules),[e,t]=react.exports.useState(!1);var o=e=>t(e);var o=[jsxRuntime.exports.jsx(BasicInfo,{onValidate:o}),jsxRuntime.exports.jsx(FunctionalityStep,{handleOnValidate:o}),jsxRuntime.exports.jsx(HeaderbarStep,{handleOnValidate:o}),jsxRuntime.exports.jsx(AuthenticationStep,{handleOnValidate:o}),jsxRuntime.exports.jsx(PaletteIntegration,{}),jsxRuntime.exports.jsx(Box,Object.assign({"data-test":"app-events"},{children:jsxRuntime.exports.jsx(AppEventsStep,{})})),jsxRuntime.exports.jsx(AppPackagesStep,{}),jsxRuntime.exports.jsx(ConfirmationStep,{})],r=[jsxRuntime.exports.jsx(Button,Object.assign({"data-test":"app-new-submit-app-button",variant:"contained",color:"primary",onClick:()=>{var e,t;e=!1,n?(t=lodash.exports.differenceWith(s.nodeModules,i,lodash.exports.isEqual),a(actions.appFormState.updateAppStart({app:Object.assign(Object.assign({},s),{nodeModules:t}),openBuildPanel:e}))):a(actions.appFormState.createAppStart({app:s,openBuildPanel:e}))}},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-new.{idPrefix}-app-button",defaultMessage:"{verb}",description:"{verb} app button text",values:{idPrefix:n?"update":"submit",verb:n?"Update":"Submit"}})}),"submit-app-button")];return jsxRuntime.exports.jsx(ProgressStepper,{panelName:"APP_CENTER_NEW",sessionKey:"appOnboardingSession",entityId:s.id,onResumeSession:e=>{var t=lodash.exports.omit(e,"eventHandlers"),e=lodash.exports.get(e,"eventHandlers");a(actions.appEventsPanelState.resumeSession(e)),a(actions.appFormState.resumeSession(t))},steps:["Basic Info","Functionality","Headerbar","Authentication","Automate","App Events","App Package","Review"],stepContent:o,customFinalStepButtons:r,nextButtonDisabled:!e,idPrefix:"app-center-new-aob"})},appBarHeight$3=55,headerHeight=64,borderBottom$3=5,useStyles$4=makeStyles()(e=>({ecnPanel:{height:`calc(100vh - ${appBarHeight$3}px - ${headerHeight}px - ${borderBottom$3}px)`}})),MainLayout=({appId:e})=>{var t=useStyles$4()["classes"];const a=useDispatch();var s=useSelector(selectIsLoadingExistingAppData)["isLoadingExistingAppData"];return react.exports.useEffect(()=>{e?a(actions.appFormState.editApp(e)):a(actions.appFormState.createNewApp())},[]),jsxRuntime.exports.jsx("div",Object.assign({role:"presentation","data-test":"app-center-new-widget",className:t.ecnPanel},{children:s?jsxRuntime.exports.jsx(Box,Object.assign({sx:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"}},{children:jsxRuntime.exports.jsx(CircularProgress,{})})):jsxRuntime.exports.jsx(AppOnboardingFlow,{})}))},AppCenterNew=e=>jsxRuntime.exports.jsx(AIWareThemeProvider,{children:jsxRuntime.exports.jsx(DynamicModuleLoader,Object.assign({modules:[getAppCenterNewModule()]},{children:jsxRuntime.exports.jsx(AIWareIntlProvider,{children:jsxRuntime.exports.jsx(AIWareCacheProvider,{children:jsxRuntime.exports.jsx(MainLayout,Object.assign({},e))})})}))}),AddFlowPanel=()=>{const s=useDispatch(),n=useSelector(selectApp),{searchTerm:e,searchResults:i,isLoadingSearchResults:t,sortOrder:a}=useSelector(selectFlowLinkingPanel);react.exports.useEffect(()=>{s(actions.flowLinkingPanelState.searchByTerm(""))},[]);const o=e=>{var t=lodash.exports.findIndex(i,{id:e.target.value}),a=[...n.flows];lodash.exports.includes(lodash.exports.map(a,e=>e.id),i[t].id)?a.splice(lodash.exports.findIndex(a,{id:e.target.value}),1):a.unshift(Object.assign({},i[t])),s(actions.appFormState.updateAppFormField({field:"flows",value:a}))};const r="os-app-center-new.add-flow-panel.";return jsxRuntime.exports.jsxs(Grid,Object.assign({container:!0,spacing:3,p:6,"data-test":r+"container"},{children:[jsxRuntime.exports.jsx(Grid,Object.assign({item:!0,xs:12},{children:jsxRuntime.exports.jsxs(Stack,Object.assign({direction:"row",alignItems:"center",justifyContent:"space-between"},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h1"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-new.add-flow-panel.title",description:"Add Flow Panel Title",defaultMessage:"Add Flow"})})),jsxRuntime.exports.jsx(IconButton,Object.assign({"data-test":r+"close",onClick:()=>{s(hidePanel(AvailableComponents.APP_CENTER_ADD_FLOW_PANEL))}},{children:jsxRuntime.exports.jsx(default_1$2,{})}))]}))})),jsxRuntime.exports.jsx(Grid,Object.assign({item:!0,xs:6},{children:jsxRuntime.exports.jsx(FormControl,Object.assign({variant:"outlined",fullWidth:!0},{children:jsxRuntime.exports.jsx(TextField,{"data-test":r+"search",id:"search-input",placeholder:"Search",type:"search",value:e,onChange:e=>{s(actions.flowLinkingPanelState.searchByTerm(e.target.value))},size:"small",InputProps:{startAdornment:jsxRuntime.exports.jsx(InputAdornment,Object.assign({position:"start"},{children:t?jsxRuntime.exports.jsx(CircularProgress,{size:24}):jsxRuntime.exports.jsx(default_1$3,{})})),style:{borderRadius:100}}})}))})),jsxRuntime.exports.jsx(Grid,Object.assign({item:!0},{children:jsxRuntime.exports.jsx(IconButton,Object.assign({"data-test":r+"sort-toggle",onClick:e=>{s(actions.flowLinkingPanelState.toggleSortOrder())}},{children:jsxRuntime.exports.jsx(default_1,{})}))})),jsxRuntime.exports.jsx(Grid,Object.assign({item:!0,xs:12},{children:jsxRuntime.exports.jsx(FormControl,Object.assign({variant:"outlined"},{children:jsxRuntime.exports.jsx(FormControlLabel,{label:"Select All",control:jsxRuntime.exports.jsx(Checkbox,{"data-test":r+"select-all",onClick:e=>{var t=lodash.exports.isEmpty(lodash.exports.difference(lodash.exports.map(i,e=>e.id),lodash.exports.map(n.flows,e=>e.id)))?[]:lodash.exports.uniqBy([...n.flows,...i],"id");s(actions.appFormState.updateAppFormField({field:"flows",value:t}))},checked:!lodash.exports.isEmpty(n.flows),indeterminate:!lodash.exports.isEmpty(n.flows)&&!lodash.exports.isEmpty(lodash.exports.difference(lodash.exports.map(i,e=>e.id),lodash.exports.map(n.flows,e=>e.id)))})})}))})),jsxRuntime.exports.jsx(Grid,Object.assign({item:!0,xs:12},{children:jsxRuntime.exports.jsx(Divider,{})})),jsxRuntime.exports.jsx(Grid,Object.assign({item:!0},{children:jsxRuntime.exports.jsx(Stack,Object.assign({direction:"column"},{children:lodash.exports.map(lodash.exports.orderBy(i,"name",a),e=>jsxRuntime.exports.jsx(FormControl,Object.assign({variant:"outlined"},{children:jsxRuntime.exports.jsx(FormControlLabel,{label:e.name,control:jsxRuntime.exports.jsx(Checkbox,{"data-test":r+"flow",value:e.id,checked:lodash.exports.includes(lodash.exports.map(n.flows,e=>e.id),e.id),onChange:o})})}),e.id))}))}))]}))},AddSchemaPanel=()=>{const s=useDispatch(),n=useSelector(selectApp),{searchTerm:e,searchResults:i,isLoadingSearchResults:t,sortOrder:a}=useSelector(selectSchemaLinkingPanel);react.exports.useEffect(()=>{s(actions.schemaLinkingPanelState.searchByTerm(""))},[]);const o=e=>{var t=lodash.exports.findIndex(i,{id:e.target.value}),a=[...n.schemas];lodash.exports.includes(lodash.exports.map(a,e=>e.id),i[t].id)?a.splice(lodash.exports.findIndex(a,{id:e.target.value}),1):a.unshift(Object.assign({},i[t])),s(actions.appFormState.updateAppFormField({field:"schemas",value:a}))};const r="os-app-center-new.add-schema-panel.";return jsxRuntime.exports.jsxs(Grid,Object.assign({container:!0,spacing:3,p:6,"data-test":r+"container"},{children:[jsxRuntime.exports.jsx(Grid,Object.assign({item:!0,xs:12},{children:jsxRuntime.exports.jsxs(Stack,Object.assign({direction:"row",alignItems:"center",justifyContent:"space-between"},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h1"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-new.add-schema-panel.title",description:"Add Schema Panel Title",defaultMessage:"Add Schema"})})),jsxRuntime.exports.jsx(IconButton,Object.assign({"data-test":r+"close",onClick:()=>{s(hidePanel(AvailableComponents.APP_CENTER_ADD_SCHEMA_PANEL))}},{children:jsxRuntime.exports.jsx(default_1$2,{})}))]}))})),jsxRuntime.exports.jsx(Grid,Object.assign({item:!0,xs:6},{children:jsxRuntime.exports.jsx(FormControl,Object.assign({variant:"outlined",fullWidth:!0},{children:jsxRuntime.exports.jsx(TextField,{"data-test":r+"search",id:"search-input",placeholder:"Search",type:"search",value:e,onChange:e=>{s(actions.schemaLinkingPanelState.searchByTerm(e.target.value))},size:"small",InputProps:{startAdornment:jsxRuntime.exports.jsx(InputAdornment,Object.assign({position:"start"},{children:t?jsxRuntime.exports.jsx(CircularProgress,{size:24}):jsxRuntime.exports.jsx(default_1$3,{})})),style:{borderRadius:100}}})}))})),jsxRuntime.exports.jsx(Grid,Object.assign({item:!0},{children:jsxRuntime.exports.jsx(IconButton,Object.assign({"data-test":r+"sort-toggle",onClick:e=>{s(actions.schemaLinkingPanelState.toggleSortOrder())}},{children:jsxRuntime.exports.jsx(default_1,{})}))})),jsxRuntime.exports.jsx(Grid,Object.assign({item:!0,xs:12},{children:jsxRuntime.exports.jsx(FormControl,Object.assign({variant:"outlined"},{children:jsxRuntime.exports.jsx(FormControlLabel,{label:"Select All",control:jsxRuntime.exports.jsx(Checkbox,{"data-test":r+"select-all",onClick:e=>{var t=lodash.exports.isEmpty(lodash.exports.difference(lodash.exports.map(i,e=>e.id),lodash.exports.map(n.schemas,e=>e.id)))?[]:lodash.exports.uniqBy([...n.schemas,...i],"id");s(actions.appFormState.updateAppFormField({field:"schemas",value:t}))},checked:!lodash.exports.isEmpty(n.schemas),indeterminate:!lodash.exports.isEmpty(n.schemas)&&!lodash.exports.isEmpty(lodash.exports.difference(lodash.exports.map(i,e=>e.id),lodash.exports.map(n.schemas,e=>e.id)))})})}))})),jsxRuntime.exports.jsx(Grid,Object.assign({item:!0,xs:12},{children:jsxRuntime.exports.jsx(Divider,{})})),jsxRuntime.exports.jsx(Grid,Object.assign({item:!0},{children:jsxRuntime.exports.jsx(Stack,Object.assign({direction:"column"},{children:lodash.exports.map(lodash.exports.orderBy(i,"name",a),e=>jsxRuntime.exports.jsx(FormControl,Object.assign({variant:"outlined"},{children:jsxRuntime.exports.jsx(FormControlLabel,{label:e.name,control:jsxRuntime.exports.jsx(Checkbox,{"data-test":r+"schema",value:e.id,checked:lodash.exports.includes(lodash.exports.map(n.schemas,e=>e.id),e.id),onChange:o})})}),e.id))}))}))]}))},appBarHeight$2=55,borderBottom$2=5,mainHeight$2=`calc(100vh - ${appBarHeight$2+borderBottom$2}px)`,useStyles$3=makeStyles()(e=>({root:{display:"flex",flexFlow:"column",height:mainHeight$2},container:{padding:e.spacing(5),"& input, textarea":{fontWeight:400},"& fieldset":{borderColor:"#D5DFE9"}},"& fieldset":{borderColor:"#D5DFE9"},textInput:{padding:14.5},header:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",marginBottom:20},addButtonWrapper:{flexGrow:1,display:"flex",justifyContent:"flex-end",alignItems:"flex-end",padding:"0px 20px 20px 20px"},inputSelect:{width:"100%"},optional:{fontSize:12,marginBottom:e.spacing(1),marginLeft:e.spacing(1),color:"#9CA8B4"}})),ConfigFieldsForm=({hidePanel:t,isEdit:a=!1,editIndex:s=-1})=>{var e=useStyles$3()["classes"],n=useSelector(preferredLanguageSelector);const i=AIWareFormatMessage(n),o=useDispatch(),r=useSelector(selectApp),l=useSelector(selectConfigFields);var n=()=>a&&0<=s?l[s]:{name:"",configLevel:AppConfigLevel.Organization,type:AppConfigType.String,required:!1,defaultValue:""},p=n();const d=useForm({mode:"onChange",defaultValues:p}),[c,u]=react.exports.useState(n().type),[x,m]=react.exports.useState(n().configLevel);return jsxRuntime.exports.jsx(FormProvider,Object.assign({},d,{children:jsxRuntime.exports.jsxs("form",Object.assign({className:e.root,onSubmit:d.handleSubmit(e=>{a?o(actions.appFormState.updateConfigField({configFields:e,index:s,name:l[s].name})):lodash.exports.isEmpty(r.id)?o(actions.appFormState.addConfigField(e)):o(actions.appFormState.createConfigField({newConfigField:e,appId:r.id})),t()})},{children:[jsxRuntime.exports.jsxs(Grid,Object.assign({className:e.container,container:!0,spacing:5,"data-test":"app-new-config-fields-form-container"},{children:[jsxRuntime.exports.jsx(Grid,Object.assign({item:!0,xs:12},{children:jsxRuntime.exports.jsxs(Box,Object.assign({className:e.header},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h1",color:"secondary","data-test":"app-new-config-fields-header-title"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"app-center-new.config-fields.form-title",defaultMessage:"{label} Config Fields",description:"Form label for supported file types",values:{label:a?"Edit":"Add"}})})),jsxRuntime.exports.jsx(Tooltip,Object.assign({title:jsxRuntime.exports.jsx(FormattedMessage,{id:"app-center-new.config-fields.form-title-close",defaultMessage:"Close",description:"Form label for close tooltip label"})},{children:jsxRuntime.exports.jsx(IconButton,Object.assign({onClick:t,"aria-labelledby":"app-center-new-close-panel","data-test":"app-description-input-icon"},{children:jsxRuntime.exports.jsx(Close,{})}))}))]}))})),jsxRuntime.exports.jsxs(Grid,Object.assign({item:!0,xs:12},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h6",gutterBottom:!0,"data-test":"app-new-config-fields-header-name"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"app-center-new.config-fields.field-name",defaultMessage:"Name",description:"You can set a field name"})})),jsxRuntime.exports.jsx(InputText,{inputProps:{maxLength:50,className:e.textInput},variant:"outlined",type:"text",name:"name",fullWidth:!0,"data-test":"app-new-config-fields-name-content",rules:{required:!0,maxLength:50,validate:{isNameSame:a=>{return!l.find((e,t)=>t!==s&&e.name===a)||i({id:"os-app-center-new.config-name-error",defaultMessage:[{type:0,value:"Please select a different name"}]})}}}})]})),jsxRuntime.exports.jsxs(Grid,Object.assign({item:!0,xs:12},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h6",gutterBottom:!0,"data-test":"app-new-config-fields-header-description"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"app-center-new.config-fields.field-description",defaultMessage:"Description",description:"You can set a field description"})})),jsxRuntime.exports.jsx(InputText,{variant:"outlined",name:"description",fullWidth:!0,multiline:!0,rows:5,"data-test":"app-new-config-fields-description-content",inputProps:{maxLength:250},InputProps:{className:e.textInput},rules:{required:!0,maxLength:250}})]})),jsxRuntime.exports.jsxs(Grid,Object.assign({item:!0,xs:12},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h6",gutterBottom:!0,"data-test":"app-new-config-fields-header-config-level"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"app-center-new.config-fields.config-level",defaultMessage:"Config Level",description:"You can set a config level"})})),jsxRuntime.exports.jsxs(InputSelect,Object.assign({inputProps:{maxLength:50,className:e.textInput},className:e.inputSelect,type:"text",name:"configLevel",value:x,defaultValue:x,onChange:e=>{d.setValue("configLevel",e.target.value),m(e.target.value)},style:{minWidth:"100%"},"data-test":"app-new-config-level-content",rules:{required:!0}},{children:[jsxRuntime.exports.jsx(MenuItem,Object.assign({value:"Organization"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"app-center-new.config-fields.menu-item-organization",defaultMessage:"Organization",description:"You can set a config level"})})),jsxRuntime.exports.jsx(MenuItem,Object.assign({value:"User"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"app-center-new.config-fields.menu-item-user",defaultMessage:"User",description:"You can set a config level"})}))]}))]})),jsxRuntime.exports.jsxs(Grid,Object.assign({item:!0,xs:12},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h6",gutterBottom:!0,"data-test":"app-new-config-fields-header-type"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"app-center-new.config-fields.field-type",defaultMessage:"Type",description:"You can set a field type"})})),jsxRuntime.exports.jsx(InputSelect,Object.assign({inputProps:{maxLength:50,className:e.textInput},className:e.inputSelect,type:"text",name:"type",value:c,onChange:e=>{d.setValue("type",e.target.value),u(e.target.value)},style:{minWidth:"100%"},"data-test":"app-new-config-fields-type-content",rules:{required:!0}},{children:map_1(keys_1(AppConfigType),(e,t)=>jsxRuntime.exports.jsx(MenuItem,Object.assign({value:AppConfigType[e]},{children:AppConfigType[e]}),t))}))]})),jsxRuntime.exports.jsx(Grid,Object.assign({item:!0,xs:12},{children:jsxRuntime.exports.jsx(SchemaOrText,{})})),jsxRuntime.exports.jsx(Grid,Object.assign({item:!0,xs:12,style:{padding:"12.5px 0 0 25px"}},{children:jsxRuntime.exports.jsx(Box,Object.assign({display:"flex",justifyContent:"start",alignItems:"center"},{children:jsxRuntime.exports.jsx(InputCheckbox,{name:"required",defaultChecked:p.required,label:jsxRuntime.exports.jsx(FormattedMessage,{id:"app-center-new.config-fields.required-checkbox",defaultMessage:"Make Required",description:"Required field checkbox"})})}))}))]})),jsxRuntime.exports.jsx(Box,Object.assign({className:e.addButtonWrapper},{children:jsxRuntime.exports.jsx(Button,Object.assign({type:"submit",disabled:!get_1(d,"formState.isValid"),variant:"contained",color:"primary","data-test":"app-new-config-fields-button-submit"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-new-config-fields.submit-button-label",defaultMessage:"{label}",description:"{label} Config Fields",values:{label:a?"Update":"Add"}})}))}))]}))}))},AppCenterConfigFieldsForm=e=>jsxRuntime.exports.jsx(AIWareCacheProvider,{children:jsxRuntime.exports.jsx(AIWareThemeProvider,{children:jsxRuntime.exports.jsx(AIWareIntlProvider,{children:jsxRuntime.exports.jsx(ConfigFieldsForm,{hidePanel:e.hidePanel,isEdit:e.isEdit,editIndex:e.editIndex})})})}),appBarHeight$1=55,borderBottom$1=5,mainHeight$1=`calc(100vh - ${appBarHeight$1+borderBottom$1}px)`,useStyles$2=makeStyles()(e=>({root:{display:"flex",flexFlow:"column",height:mainHeight$1},container:{padding:e.spacing(6),"& input, textarea":{fontWeight:400},"& fieldset":{borderColor:"#D5DFE9"}},"& fieldset":{borderColor:"#D5DFE9"},textInput:{padding:14.5,boxSizing:"content-box"},header:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",marginBottom:30},heading:{fontWeight:600,fontSize:"14px",lineHeight:"20px",letterSpacing:"-1.30385e-09px",color:"#2A323C"},description:{marginBottom:"5px",fontWeight:400,fontSize:"12px",lineHeight:"16px",color:"#5C6269"},label:{fontWeight:400,fontSize:"12px",lineHeight:"16px",color:"#2A323C"},addButtonWrapper:{display:"flex",justifyContent:"flex-end",padding:"0 30px"}})),APP_CENTER_NEW_TEXT={labelPublic:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"app-center-new.pallet-integration-label.public",defaultMessage:"Public",description:"Label for pallet integration public"}),labelToken:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"app-center-new.pallet-integration-label.token",defaultMessage:"Token",description:"Label for pallet integration token"}),tooltipTitle:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"app-center-new.pallet-integration.form-title-close",defaultMessage:"Close",description:"Form label for close tooltip label"}),formControlLabelName:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"app-center-new.pallet-integration.npm-npmjs-label",defaultMessage:"NPM Package stored on NPMJS.COM",description:"NPM Package stored on NPMJS.COM"}),formControlLabelUri:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"app-center-new.pallet-integration.npm-uri-label",defaultMessage:"NPM Package stored at URI",description:"NPM Package stored at URI"}),labelNPM:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"app-center-new.pallet-integration.npm-label",defaultMessage:"NPM",description:"NPM radio button label"}),labelGithub:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"app-center-new.pallet-integration.github-label",defaultMessage:"Github",description:"Github radio button label"}),labelPackageName:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"app-center-new.pallet-integration.package-name-label",defaultMessage:"Package Name",description:"Package name input label"}),labelGithubRepoHttpsUrl:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"app-center-new.pallet-integration.github-https-label",defaultMessage:"Github Repo Https Url",description:"Github repo https url input label"}),labelGithubName:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"app-center-new.pallet-integration.github-name-label",defaultMessage:"Github Package Name (Optional)",description:"Github repo Package Name input label"}),labelVersionOptional:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"app-center-new.pallet-integration.version-optional-label",defaultMessage:"Version (Optional)",description:"Version (Optional) input label"}),labelPrivate:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"app-center-new.pallet-integration.private-label",defaultMessage:"Private",description:"Private input label"}),labelScope:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"app-center-new.pallet-integration.scope-label",defaultMessage:"Scope",description:"Scope input label"}),labelAccessToken:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"app-center-new.pallet-integration.access-token-label",defaultMessage:"Access Token",description:"Access Token input label"}),labelMainNpmRegistry:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"app-center-new.pallet-integration.main-npm-registry-label",defaultMessage:"Main NPM Registry",description:"Main NPM Registry input label"}),labelPrivateRegistry:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"app-center-new.pallet-integration.private-registry-label",defaultMessage:"Private Registry",description:"Private Registry input label"}),labelRegistryUrl:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"app-center-new.pallet-integration.registry-url-label",defaultMessage:"Registry Url",description:"Registry Url input label"})},PaletteIntegrationForm=({hidePanel:a,isEdit:s=!1,editIndex:n=-1})=>{const t=useStyles$2()["classes"],i=useDispatch(),o=useIntl(),r=useSelector(selectNodeModules);var e=e=>"app-new-palette-integration-form-"+e;const l=s&&0<=n?r[n]:{moduleRepo:ModuleRepo.NPM,isPrivateRepo:!1,isPrivateRegistry:!1,moduleName:"",moduleVersion:"",scope:"",accessToken:"",registryUrl:"",sshUrl:"",status:ModuleStatus.ACTIVE},p=useForm({mode:"onChange",defaultValues:l});const[d,c]=react.exports.useState(l.moduleRepo===ModuleRepo.NPM?ModuleRepo.NPM:ModuleRepo.Github),[u,x]=react.exports.useState(l.isPrivateRepo),[m,g]=react.exports.useState(l.isPrivateRegistry);var h=({children:e})=>jsxRuntime.exports.jsx(Typography,Object.assign({className:t.label},{children:e}));var j=jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment,{children:[jsxRuntime.exports.jsx(Grid,Object.assign({item:!0,xs:12},{children:jsxRuntime.exports.jsxs(Stack,Object.assign({spacing:2},{children:[jsxRuntime.exports.jsx(InputText,{fullWidth:!0,"data-test":e("package-name-input"),name:"moduleName",variant:"outlined",label:APP_CENTER_NEW_TEXT.labelPackageName(),InputLabelProps:{disableAnimation:!1},inputProps:{maxLength:500,className:t.textInput},rules:{required:!0,pattern:{value:npmModuleNameRegex,message:o.formatMessage({id:"/runner/_work/aiware-apps/aiware-apps/libs/os/app-center/new/src/lib/components/AutomateStep/PaletteIntegration/PaletteIntegrationForm/.yQi0CM",defaultMessage:[{type:0,value:"Package name must be a valid npm or github package name and cannot use invalid url characters."}]})},validate:{unique:e=>{return e=e,t=o.formatMessage({id:"/runner/_work/aiware-apps/aiware-apps/libs/os/app-center/new/src/lib/components/AutomateStep/PaletteIntegration/PaletteIntegrationForm/.aj5xbA",defaultMessage:[{type:0,value:"Module name already exists for this application."}]}),!!(isEmpty_1(find_1(r,{moduleName:e,status:ModuleStatus.ACTIVE}))||s&&r[n].moduleName===e)||t;var t}},maxLength:500}}),jsxRuntime.exports.jsx(InputText,{fullWidth:!0,"data-test":e("package-version-input"),name:"moduleVersion",variant:"outlined",label:APP_CENTER_NEW_TEXT.labelVersionOptional(),InputLabelProps:{disableAnimation:!1},inputProps:{maxLength:255,className:t.textInput},rules:{required:!1,pattern:{value:semverRegex,message:o.formatMessage({id:"/runner/_work/aiware-apps/aiware-apps/libs/os/app-center/new/src/lib/components/AutomateStep/PaletteIntegration/PaletteIntegrationForm/.ui6Ndd",defaultMessage:[{type:0,value:"Invalid semantic version number."}]})},maxLength:255}})]}))})),jsxRuntime.exports.jsxs(Grid,Object.assign({item:!0,xs:12},{children:[jsxRuntime.exports.jsx(InputRadioGroup,Object.assign({name:"isPrivateRepo",onChange:e=>{if("public"!==e.target.value&&"private"!==e.target.value)throw new Error("Event target value outside accepted values");x("private"===e.target.value)},value:u?"private":"public"},{children:jsxRuntime.exports.jsxs(Stack,Object.assign({direction:"row"},{children:[jsxRuntime.exports.jsx(FormControlLabel,{"data-test":e("public-repo-radio"),label:jsxRuntime.exports.jsx(h,{children:APP_CENTER_NEW_TEXT.labelPublic()}),control:jsxRuntime.exports.jsx(Radio,{}),value:"public"}),jsxRuntime.exports.jsx(FormControlLabel,{"data-test":e("private-repo-radio"),label:jsxRuntime.exports.jsx(h,{children:APP_CENTER_NEW_TEXT.labelPrivate()}),control:jsxRuntime.exports.jsx(Radio,{}),value:"private"})]}))})),jsxRuntime.exports.jsxs(Stack,Object.assign({spacing:2},{children:[jsxRuntime.exports.jsx(InputText,{fullWidth:!0,"data-test":e("scope-input"),disabled:!u,name:"scope",variant:"outlined",label:APP_CENTER_NEW_TEXT.labelScope(),InputLabelProps:{disableAnimation:!1},inputProps:{maxLength:1e3,className:t.textInput},rules:{required:u,pattern:{value:uriScopeRegex,message:o.formatMessage({id:"/runner/_work/aiware-apps/aiware-apps/libs/os/app-center/new/src/lib/components/AutomateStep/PaletteIntegration/PaletteIntegrationForm/.dffPiw",defaultMessage:[{type:0,value:"Must be a valid uri scope segment."}]})},maxLength:1e3}}),jsxRuntime.exports.jsx(InputText,{fullWidth:!0,"data-test":e("access-token-input"),disabled:!u,name:"accessToken",variant:"outlined",label:APP_CENTER_NEW_TEXT.labelAccessToken(),InputLabelProps:{disableAnimation:!1},inputProps:{maxLength:1e3,className:t.textInput},rules:{required:u,maxLength:1e3}})]}))]})),jsxRuntime.exports.jsxs(Grid,Object.assign({item:!0,xs:12},{children:[jsxRuntime.exports.jsx(InputRadioGroup,Object.assign({name:"isPrivateRegistry",onChange:e=>{if("mainRegistry"!==e.target.value&&"privateRegistry"!==e.target.value)throw new Error("Event target value outside accepted values");g("privateRegistry"===e.target.value),p.unregister("registryUrl"),p.register("registryUrl")},value:m?"privateRegistry":"mainRegistry"},{children:jsxRuntime.exports.jsxs(Stack,Object.assign({direction:"row"},{children:[jsxRuntime.exports.jsx(FormControlLabel,{"data-test":e("main-registry-radio"),label:jsxRuntime.exports.jsx(h,{children:APP_CENTER_NEW_TEXT.labelMainNpmRegistry()}),control:jsxRuntime.exports.jsx(Radio,{}),value:"mainRegistry"}),jsxRuntime.exports.jsx(FormControlLabel,{"data-test":e("private-registry-radio"),label:jsxRuntime.exports.jsx(h,{children:APP_CENTER_NEW_TEXT.labelPrivateRegistry()}),control:jsxRuntime.exports.jsx(Radio,{}),value:"privateRegistry"})]}))})),jsxRuntime.exports.jsx(InputText,{fullWidth:!0,"data-test":e("registry-url-input"),disabled:!m,name:"registryUrl",variant:"outlined",label:APP_CENTER_NEW_TEXT.labelRegistryUrl(),InputLabelProps:{disableAnimation:!1},inputProps:{maxLength:500,className:t.textInput},rules:{required:m,pattern:{value:urlRegex$1,message:o.formatMessage({id:"/runner/_work/aiware-apps/aiware-apps/libs/os/app-center/new/src/lib/components/AutomateStep/PaletteIntegration/PaletteIntegrationForm/.gTI7jJ",defaultMessage:[{type:0,value:"Must be a valid URL including protocol."}]})},maxLength:500}})]}))]}),f=jsxRuntime.exports.jsx(Grid,Object.assign({item:!0,xs:12},{children:jsxRuntime.exports.jsxs(Stack,Object.assign({spacing:2},{children:[jsxRuntime.exports.jsx(InputText,{fullWidth:!0,"data-test":e("github-https-url-input"),name:"registryUrl",variant:"outlined",label:APP_CENTER_NEW_TEXT.labelGithubRepoHttpsUrl(),InputLabelProps:{disableAnimation:!1},inputProps:{maxLength:500,className:t.textInput},rules:{required:!0,pattern:{value:githubHttpsUrlRegex,message:o.formatMessage({id:"/runner/_work/aiware-apps/aiware-apps/libs/os/app-center/new/src/lib/components/AutomateStep/PaletteIntegration/PaletteIntegrationForm/.4fROEm",defaultMessage:[{type:0,value:"Must be a valid github https url."}]})},maxLength:500}},"github-https-url"),jsxRuntime.exports.jsx(InputText,{fullWidth:!0,"data-test":e("github-package-name-input"),name:"moduleName",variant:"outlined",label:APP_CENTER_NEW_TEXT.labelGithubName(),InputLabelProps:{disableAnimation:!1},inputProps:{maxLength:500,className:t.textInput},rules:{required:!1,pattern:{value:npmModuleNameRegex,message:o.formatMessage({id:"/runner/_work/aiware-apps/aiware-apps/libs/os/app-center/new/src/lib/components/AutomateStep/PaletteIntegration/PaletteIntegrationForm/.yQi0CM",defaultMessage:[{type:0,value:"Package name must be a valid npm or github package name and cannot use invalid url characters."}]})},maxLength:500}},"github-package-name"),jsxRuntime.exports.jsx(InputText,{fullWidth:!0,"data-test":e("github-token-input"),name:"accessToken",variant:"outlined",label:APP_CENTER_NEW_TEXT.labelToken(),InputLabelProps:{disableAnimation:!1},inputProps:{maxLength:5e3,className:t.textInput},rules:{required:!0,maxLength:5e3}},"github-token"),jsxRuntime.exports.jsx(InputText,{fullWidth:!0,"data-test":e("package-version-input"),name:"moduleVersion",variant:"outlined",label:APP_CENTER_NEW_TEXT.labelVersionOptional(),InputLabelProps:{disableAnimation:!1},inputProps:{maxLength:255,className:t.textInput},rules:{required:!1,pattern:{value:semverRegex,message:o.formatMessage({id:"/runner/_work/aiware-apps/aiware-apps/libs/os/app-center/new/src/lib/components/AutomateStep/PaletteIntegration/PaletteIntegrationForm/.ui6Ndd",defaultMessage:[{type:0,value:"Invalid semantic version number."}]})},maxLength:255}},"github-package-version")]}))}));return jsxRuntime.exports.jsx(FormProvider,Object.assign({},p,{children:jsxRuntime.exports.jsxs("form",Object.assign({className:t.root,onSubmit:p.handleSubmit(e=>{var t=find_1(r,{moduleName:e.moduleName,status:ModuleStatus.DELETED}),t={moduleId:get_1(t,"moduleId",l.moduleId),moduleRepo:e.moduleRepo,isPrivateRepo:u,isPrivateRegistry:m,moduleName:e.moduleName,moduleVersion:e.moduleVersion,scope:e.scope,accessToken:e.accessToken,registryUrl:e.registryUrl,sshUrl:e.sshUrl,status:ModuleStatus.ACTIVE};s?i(actions.appFormState.updateNodeModule({nodeModules:t,index:n})):i(actions.appFormState.addNodeModule(t)),a()})},{children:[jsxRuntime.exports.jsxs(Grid,Object.assign({className:t.container,container:!0,rowSpacing:5,"data-test":"app-new-palette-integration-form-container"},{children:[jsxRuntime.exports.jsxs(Box,Object.assign({className:t.header},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h1",color:"secondary","data-test":"app-new-palette-integration-header-title"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"app-center-new.palette-integration.form-title",defaultMessage:"{label} Npm Module",description:"Form label for supported file types",values:{label:s?"Edit":"Add"}})})),jsxRuntime.exports.jsx(Tooltip,Object.assign({title:APP_CENTER_NEW_TEXT.tooltipTitle()},{children:jsxRuntime.exports.jsx(IconButton,Object.assign({onClick:a,"aria-labelledby":"app-center-new-close-panel","data-test":"app-description-input-icon"},{children:jsxRuntime.exports.jsx(Close,{})}))}))]})),jsxRuntime.exports.jsxs(Box,{children:[jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h6",gutterBottom:!0,className:t.heading,"data-test":"app-new-palette-integration-header-name"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"app-center-new.palette-integration-title.field-name",defaultMessage:"NPM Package or URI",description:"NPM Package/URI title"})})),jsxRuntime.exports.jsx(Typography,Object.assign({className:t.description},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"app-center-new.palette-integration-description.field-name",defaultMessage:"Please specify where the package is stored and choose the access level.",description:"NPM Package/URI description"})}))]}),jsxRuntime.exports.jsx(Box,{children:jsxRuntime.exports.jsx(InputRadioGroup,Object.assign({name:"moduleRepo",onChange:e=>{if("npm"!==e.target.value&&"github"!==e.target.value)throw new Error("Event target value outside accepted values");c(e.target.value===ModuleRepo.NPM?ModuleRepo.NPM:ModuleRepo.Github)},value:d,rules:{required:!0}},{children:jsxRuntime.exports.jsxs(Stack,Object.assign({direction:"row"},{children:[jsxRuntime.exports.jsx(FormControlLabel,{"data-test":e("npm-repo-radio"),label:jsxRuntime.exports.jsx(h,{children:APP_CENTER_NEW_TEXT.labelNPM()}),control:jsxRuntime.exports.jsx(Radio,{}),value:"npm"}),jsxRuntime.exports.jsx(FormControlLabel,{"data-test":e("github-repo-radio"),label:jsxRuntime.exports.jsx(h,{children:APP_CENTER_NEW_TEXT.labelGithub()}),control:jsxRuntime.exports.jsx(Radio,{}),value:"github"})]}))}))}),"npm"===d?j:f]})),jsxRuntime.exports.jsx(Box,Object.assign({className:t.addButtonWrapper},{children:jsxRuntime.exports.jsx(Button,Object.assign({type:"submit",disabled:!get_1(p,"formState.isValid"),variant:"contained",color:"primary","data-test":"app-new-palette-integration-button-submit"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-new-palette-integration.submit-button-label",defaultMessage:"{label}",description:"{label} Config Fields",values:{label:s?"Update":"Add"}})}))}))]}))}))},AppCenterPaletteIntegrationPanel=e=>jsxRuntime.exports.jsx(AIWareCacheProvider,{children:jsxRuntime.exports.jsx(AIWareThemeProvider,{children:jsxRuntime.exports.jsx(AIWareIntlProvider,{children:jsxRuntime.exports.jsx(PaletteIntegrationForm,{hidePanel:e.hidePanel,isEdit:e.isEdit,editIndex:e.editIndex})})})}),appBarHeight=55,borderBottom=5,mainHeight=`calc(100vh - ${appBarHeight+borderBottom}px)`,useStyles$1=makeStyles()(e=>({root:{display:"flex",flexFlow:"column",height:mainHeight},container:{flex:1,padding:e.spacing(5),"& input, textarea":{fontWeight:400},"& fieldset":{borderColor:"#D5DFE9"}},"& fieldset":{borderColor:"#D5DFE9"},textInput:{padding:14.5},headerTable:{verticalAlign:"bottom",paddingTop:"10px",fontWeight:"bold",fontSize:"14px"},tableText:{verticalAlign:"bottom",paddingTop:"10px",fontSize:"14px"},header:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",marginBottom:20},addButtonWrapper:{display:"flex",justifyContent:"flex-end",alignItems:"flex-end",padding:"0px 20px 20px 20px"},inputSelect:{width:"100%"},optional:{fontSize:12,marginBottom:e.spacing(1),marginLeft:e.spacing(1),color:"#9CA8B4"},description:{fontWeight:400,fontSize:"12px",lineHeight:"16px",color:"#5C6269"},hrLight:{opacity:.3,marginTop:"0px"},eventsTable:{overflow:"auto"}})),urlRegex=/[(http(s)?):\/\/(www\.)?a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/,AppEventForm=({hidePanel:s,isEdit:i=!1,editIndex:o=-1})=>{const e=useStyles$1()["classes"],r=useDispatch(),n=useSelector(preferredLanguageSelector),{searchResults:t,handlers:l}=useSelector(selectEventPanel),a=useSelector(selectFlowLinkingPanel)["searchResults"];react.exports.useEffect(()=>{if(i){var{automateFlowId:e,eventIds:t,eventType:a,webhook:s}=l[o];x(s),p.setValue("webhook",s);const n={};t.forEach(e=>{n[e]=!0}),v(e),p.setValue("flow",e),c(a),p.setValue("eventType",a),S(n)}r(actions.appEventsPanelState.getEvents(!0)),r(actions.flowLinkingPanelState.searchByTerm(""))},[]),react.exports.useEffect(()=>{g(t)},[t]),react.exports.useEffect(()=>{b(a)},[a]);const p=useForm({mode:"onChange",defaultValues:{eventType:"none",flow:"",webhook:"",searchTerm:""}}),[d,c]=react.exports.useState("none"),[u,x]=react.exports.useState(""),[m,g]=react.exports.useState(t),[h,j]=react.exports.useState(""),[f,b]=react.exports.useState(a),[y,v]=react.exports.useState(""),[R,S]=react.exports.useState({});react.exports.useEffect(()=>{"none"===d&&p.trigger("eventType"),("flow"===d&&!isEmpty_1(y)||"webhook"===d&&!isEmpty_1(u))&&p.trigger(["flow","webhook"])},[d,p]);var E=e=>{if(Object.keys(R).length){var t;let e={};"webhook"===d?e={webhook:u}:"flow"===d&&(e={automateFlowId:y});const a=[];m.forEach(e=>{R[e.id]&&a.push(e.eventName)}),e=Object.assign(Object.assign({},e),{eventIds:Object.keys(R),eventNames:a,eventType:d}),i?r(actions.appEventsPanelState.editHandler({handler:e,index:o})):r(actions.appEventsPanelState.addHandler(e)),s()}else t=AIWareFormatMessage(n),r(showMessage({content:t({id:"os-app-center-new.event-panel.empty-events-error",defaultMessage:[{type:0,value:"Please select at least one event."}]}),severity:MessageSeverity.Error}))};return jsxRuntime.exports.jsx(FormProvider,Object.assign({},p,{children:jsxRuntime.exports.jsxs("form",Object.assign({className:e.root,onSubmit:p.handleSubmit(E)},{children:[jsxRuntime.exports.jsxs(Grid,Object.assign({className:e.container,container:!0,spacing:5,"data-test":"os-app-center-new.add-event-panel.form-container",direction:"column",flexWrap:"nowrap",overflow:"hidden"},{children:[jsxRuntime.exports.jsxs(Grid,Object.assign({item:!0},{children:[jsxRuntime.exports.jsxs(Box,Object.assign({className:e.header},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h1",color:"secondary","data-test":"os-app-center-new.add-event-panel.header-title"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-new.add-event-panel..form-title",defaultMessage:"{label} AIWARE EVENT",description:"Form label for supported file types",values:{label:i?"Edit":"Add"}})})),jsxRuntime.exports.jsx(Tooltip,Object.assign({title:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-new.add-event-panel..form-title-close",defaultMessage:"Close",description:"Form label for close tooltip label"})},{children:jsxRuntime.exports.jsx(IconButton,Object.assign({onClick:s,"aria-labelledby":"os-app-center-new.add-event-panel..close-panel","data-test":"app-center-new-close-icon"},{children:jsxRuntime.exports.jsx(Close,{})}))}))]})),jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h6",gutterBottom:!0,"data-test":"os-app-center-new.add-event-panel.handler-type-header"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-new.add-event-panel.handler-type",defaultMessage:"Choose a handler type",description:"choose handler"})})),jsxRuntime.exports.jsx(Grid,Object.assign({item:!0,xs:12},{children:jsxRuntime.exports.jsxs(InputSelect,Object.assign({inputProps:{maxLength:50},className:e.inputSelect,name:"handlerType",value:d,onChange:e=>{c(e.target.value)},placeholder:"Select a handler type",style:{minWidth:"100%"},"data-test":"os-app-center-new.add-event-panel.event-handler-type-input"},{children:[jsxRuntime.exports.jsx(MenuItem,Object.assign({value:"none","data-test":"os-app-center-new.add-event-panel.event-handler-type-none"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-new.add-event-panel.none-handler-type",defaultMessage:"None",description:"Select none handler type"})})),jsxRuntime.exports.jsx(MenuItem,Object.assign({value:"webhook","data-test":"os-app-center-new.add-event-panel.event-handler-type-webhook"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-new.add-event-panel.webhook-handler-type",defaultMessage:"Webhook",description:"Select Webhook handler type"})})),jsxRuntime.exports.jsx(MenuItem,Object.assign({value:"flow","data-test":"os-app-center-new.add-event-panel.event-handler-type-flow"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-new.add-event-panel.flow-handler-type",defaultMessage:"Flow",description:"Select flow handler type"})}))]}))})),"webhook"===d&&jsxRuntime.exports.jsxs(Grid,Object.assign({item:!0,xs:12},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h6",gutterBottom:!0,"data-test":"os-app-center-new.add-event-panel.webhook-type-header",mt:6},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-new.add-event-panel.webhook-type",defaultMessage:"Input a webhook URL",description:"input a webhook url"})})),jsxRuntime.exports.jsx(InputText,{sx:{pb:4},inputProps:{maxLength:50,className:e.textInput},variant:"outlined",type:"text",name:"webhook",fullWidth:!0,value:u,onChange:e=>{e=e.target.value,x(e)},"data-test":"os-app-center-new.add-event-panel.webhook-input",rules:{required:!0,pattern:{value:urlRegex,message:"Must be a valid URL including protocol."}}})]})),"flow"===d&&jsxRuntime.exports.jsxs(Grid,Object.assign({item:!0,xs:12},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h6",gutterBottom:!0,"data-test":"os-app-center-new.add-event-panel.flow-type-header",mt:6},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-new.add-event-panel.flow-type",defaultMessage:"Select an Automate Flow",description:"Select an Automate Flow"})})),jsxRuntime.exports.jsx(InputSelect,Object.assign({inputProps:{maxLength:50},className:e.inputSelect,name:"flow",value:y,onChange:e=>{v(e.target.value)},style:{minWidth:"100%"},"data-test":"os-app-center-new.add-event-panel.flow-input",rules:{required:!0}},{children:map_1(f,e=>jsxRuntime.exports.jsx(MenuItem,Object.assign({value:e.id,"data-test":e.name},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-new.add-event-panel..menu-item-placeholder-{id}",defaultMessage:"{name}",description:"{name}",values:{name:e.name}})}),"flow-"+e.id))}))]}))]})),jsxRuntime.exports.jsxs(Grid,Object.assign({item:!0},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h6",gutterBottom:!0,"data-test":"os-app-center-new.add-event-panel.choose-events-header"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-new.add-event-panel..events-header",defaultMessage:"Choose Events to Send",description:"Choose events to send"})})),jsxRuntime.exports.jsx(Typography,Object.assign({"data-test":"app-event-description",className:e.description},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-new.add-event-panel..events-description",defaultMessage:"Which events would you like to trigger this webhook?",description:"Which events would you like to trigger this webhook?"})}))]})),jsxRuntime.exports.jsxs(Grid,Object.assign({item:!0,xs:12,sx:{display:"flex",flexDirection:"column",overflow:"scroll"}},{children:[jsxRuntime.exports.jsxs(Grid,Object.assign({container:!0},{children:[jsxRuntime.exports.jsx(InputText,{sx:{pb:4},inputProps:{maxLength:50,className:e.textInput},variant:"outlined",type:"text",name:"searchTerm",fullWidth:!0,placeholder:"Search Event",value:h,onChange:e=>j(e.target.value),"data-test":"os-app-center-new.add-event-panel.searchTerm-input"}),jsxRuntime.exports.jsx(Grid,Object.assign({item:!0,xs:1},{children:jsxRuntime.exports.jsx(InputCheckbox,{checked:m.length===Object.keys(R).length,label:"",onClick:()=>{{const t=JSON.parse(JSON.stringify(R));m.length===Object.keys(t).length?S({}):(m.forEach(e=>{t[e.id]=!0}),S(t))}}})})),jsxRuntime.exports.jsx(Grid,Object.assign({className:e.headerTable,item:!0,xs:2},{children:"Event Type"})),jsxRuntime.exports.jsx(Grid,Object.assign({className:e.headerTable,item:!0,xs:4},{children:"Event Name"})),jsxRuntime.exports.jsx(Grid,Object.assign({className:e.headerTable,item:!0,xs:5},{children:"Description"}))]})),jsxRuntime.exports.jsx("hr",{className:e.hrLight}),jsxRuntime.exports.jsx("div",Object.assign({className:e.eventsTable},{children:map_1(m,s=>{if((e=>{var t=h.toLowerCase(),{eventName:e,eventType:a,description:s}=e;return e.toLowerCase().includes(t)||a.toLowerCase().includes(t)||s.toLowerCase().includes(t)})(s))return jsxRuntime.exports.jsxs(Grid,Object.assign({container:!0},{children:[jsxRuntime.exports.jsx(Grid,Object.assign({item:!0,xs:1},{children:jsxRuntime.exports.jsx(InputCheckbox,{label:"",value:s.id,checked:!!R[s.id],onClick:e=>{return e=e,t=s.id,a=JSON.parse(JSON.stringify(R)),e.target.checked?a[t]=!0:delete a[t],void S(a);var t,a}})})),jsxRuntime.exports.jsx(Grid,Object.assign({className:e.tableText,item:!0,xs:2},{children:s.eventType})),jsxRuntime.exports.jsx(Grid,Object.assign({className:e.tableText,item:!0,xs:4},{children:s.eventName})),jsxRuntime.exports.jsx(Grid,Object.assign({className:e.tableText,item:!0,xs:5},{children:s.description}))]}),"event-"+s.id)})}))]}))]})),jsxRuntime.exports.jsx(Box,Object.assign({className:e.addButtonWrapper},{children:jsxRuntime.exports.jsx(Button,Object.assign({type:"submit",disabled:!get_1(p,"formState.isValid")||!Object.keys(R).length,onSubmit:E,variant:"contained",color:"primary","data-test":"os-app-center-new.add-event-panel.button-submit"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-app-center-events.submit-button-label",defaultMessage:"{label}",description:"{label} text button",values:{label:i?"Update":"Add"}})}))}))]}))}))},AppEventPanel=e=>jsxRuntime.exports.jsx(AIWareCacheProvider,{children:jsxRuntime.exports.jsx(AIWareThemeProvider,{children:jsxRuntime.exports.jsx(AIWareIntlProvider,{children:jsxRuntime.exports.jsx(AppEventForm,{hidePanel:e.hidePanel,isEdit:e.isEdit,editIndex:e.editIndex})})})}),useStyles=makeStyles()(e=>({form:{display:"flex",flexDirection:"column",height:"100%"},textInput:{padding:14.5},header:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",marginBottom:20},addButtonWrapper:{flexGrow:1,display:"flex",justifyContent:"flex-end",alignItems:"flex-end",padding:"0px 20px 20px 20px"},inputSelect:{textTransform:"capitalize"}})),ContextMenuExtensionForm=({hidePanel:t,isEdit:a,editIndex:s,extensionType:n})=>{var e=useStyles()["classes"];const i=useDispatch();var o=useSelector(selectIsEditForm)["isEditForm"],r=useSelector(selectPrevContextMenuExtensions);const l=useSelector(selectContextMenuExtensions);r=a&&lodash.exports.findIndex(r[n+"s"],e=>lodash.exports.isMatch(e,l[n+"s"][s]))<0,o=a&&o&&!r,r=useForm({mode:"onChange",defaultValues:a&&0<=s&&!lodash.exports.isNil(n)?l[n+"s"][s]:{label:"",url:"",type:""}});const p=r.watch("type");return jsxRuntime.exports.jsx(Box,Object.assign({sx:{p:6,height:"calc(100vh - 60px)"}},{children:jsxRuntime.exports.jsx(FormProvider,Object.assign({},r,{children:jsxRuntime.exports.jsxs("form",Object.assign({onSubmit:r.handleSubmit(e=>{a&&0<=s&&!lodash.exports.isNil(n)?i(actions.appFormState.updateContextMenuExtension({extensionType:n,index:s,extension:e})):(e.id=v4(),i(actions.appFormState.addContextMenuExtension({extension:e}))),null!=t&&t()}),className:e.form},{children:[jsxRuntime.exports.jsxs(Grid,Object.assign({container:!0,direction:"column",spacing:8,"data-test":"app-center-new.context-menu-extension.panel-container",flexWrap:"nowrap"},{children:[jsxRuntime.exports.jsx(Grid,Object.assign({item:!0,xs:12},{children:jsxRuntime.exports.jsxs(Box,Object.assign({className:e.header},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h1",color:"secondary","data-test":"app-center-new.context-menu-extension.panel-header"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"app-center-new.context-menu-extension.form-title",defaultMessage:"{label} a Context Menu Extension",description:"Panel title for context menu extension form",values:{label:a?"Edit":"Add"}})})),jsxRuntime.exports.jsx(Tooltip,Object.assign({title:jsxRuntime.exports.jsx(FormattedMessage,{id:"app-center-new.context-menu-extension.form-title-close",defaultMessage:"Close",description:"Close tooltip label"})},{children:jsxRuntime.exports.jsx(IconButton,Object.assign({onClick:t,"aria-labelledby":"app-center-new-close-panel","data-test":"app-center-new.context-menu-extension.close-button"},{children:jsxRuntime.exports.jsx(Close,{})}))}))]}))})),jsxRuntime.exports.jsxs(Grid,Object.assign({item:!0,xs:12},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h6",gutterBottom:!0,"data-test":"app-center-new.context-menu-extension.type-header"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"app-center-new.context-menu-extensions.type-header-text",defaultMessage:"Type",description:"You can set a type"})})),jsxRuntime.exports.jsx(InputSelect,Object.assign({name:"type",fullWidth:!0,disabled:o,rules:{required:!0},className:e.inputSelect,"data-test":"app-center-new.context-menu-extension.type-input"},{children:Object.values(ContextMenuExtensionType).map(e=>jsxRuntime.exports.jsx(MenuItem,Object.assign({value:e,"data-test":"app-center-new.context-menu-extension.type-input."+e},{children:"tdo"===e?"Media (Temporal Data Objects)":e}),e))}))]})),jsxRuntime.exports.jsxs(Grid,Object.assign({item:!0,xs:12},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h6",gutterBottom:!0,"data-test":"app-center-new.context-menu-extension.label-header"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"app-center-new.context-menu-extensions.label-header",defaultMessage:"Label",description:"You can set a label"})})),jsxRuntime.exports.jsx(InputText,{name:"label",fullWidth:!0,rules:{required:!0,maxLength:50,validate:t=>{var e;return!!lodash.exports.isEmpty(null===l||void 0===l?void 0:l[p+"s"])||!(!(a&&0<=s)||lodash.exports.isNil(n))||(e=null==(e=l[p+"s"])?void 0:e.find(e=>e.label===t),!!lodash.exports.isNil(e))||"Label already exists for this type."}},"data-test":"app-center-new.context-menu-extension.label-input"})]})),jsxRuntime.exports.jsxs(Grid,Object.assign({item:!0,xs:12},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h6",gutterBottom:!0,"data-test":"app-center-new.context-menu-extension.url-header"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"app-center-new.context-menu-extensions.url-header",defaultMessage:"Open a URL in a new tab (optional)",description:"You can set a url"})})),jsxRuntime.exports.jsx(InputText,{placeholder:p&&`https://example.com?${p}Id=\${${p}Id}`,name:"url",fullWidth:!0,rules:{maxLength:255,validate:e=>!!lodash.exports.isEmpty(e)||(urlRegex$1.test(e)?!!lodash.exports.includes(e,"${"+p+"Id}")||"URL must contain ${"+p+"Id}":"Must be a valid URL including protocol.")},"data-test":"app-center-new.context-menu-extension.url-input"})]}))]})),jsxRuntime.exports.jsx(Box,Object.assign({className:e.addButtonWrapper},{children:jsxRuntime.exports.jsx(Button,Object.assign({type:"submit",disabled:!lodash.exports.get(r,"formState.isValid"),variant:"contained",color:"primary","data-test":"app-center-new.context-menu-extension.submit-button"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"app-center-new.context-menu-extensions.submit-button-text",defaultMessage:"{label}",description:"{label} Context Menu Extension",values:{label:a?"Update":"Add"}})}))}))]}))}))}))},ContextMenuExtensionPanel=e=>jsxRuntime.exports.jsx(AIWareCacheProvider,{children:jsxRuntime.exports.jsx(AIWareThemeProvider,{children:jsxRuntime.exports.jsx(AIWareIntlProvider,{children:jsxRuntime.exports.jsx(ContextMenuExtensionForm,{hidePanel:e.hidePanel,isEdit:e.isEdit,editIndex:e.editIndex,extensionType:e.extensionType})})})});export{AddFlowPanel as AppCenterAddFlowPanel,AddSchemaPanel as AppCenterAddSchemaPanel,AppCenterConfigFieldsForm,ContextMenuExtensionPanel as AppCenterContextMenuExtensionPanel,AppEventPanel as AppCenterEventPanel,AppCenterNew,AppCenterPaletteIntegrationPanel};
75
+ `,operationName:e,variables:{jobId:r}},t))).retryJob})}function*retryJobSaga(e){try{yield retryJob(yield select(selectApiConfigs),e.payload),yield put(actions$1.retryJobSuccess())}catch(e){yield put(actions$1.retryJobFailed()),console.log("Problem retrying job",e)}}function*getUpdatedImageForSource(e,t){var{hasImageChanged:r,newImage:o}=t,t=__rest(t,["hasImageChanged","newImage"]);return r&&(null===o?t.thumbnailUrl=null:(r=yield getImageURL(e,o),t.thumbnailUrl=r)),t}function*fetchSourceSaga(e){try{var t=yield getSource(yield select(selectApiConfigs),e.payload);yield put(actions$1.fetchSourceSuccess(t))}catch(e){yield put(actions$1.fetchSourceFailed()),console.log("Problem fetching source",e)}}function*updateSourceSaga(e){var t=yield select(preferredLanguageSelector),t=AIWareFormatMessage(t||"en");try{var r=yield select(selectApiConfigs),o=yield updateSource(r,yield getUpdatedImageForSource(r,e.payload));yield put(actions$1.updateSourceSuccess(o)),yield put(showMessage({content:t({id:"os-processing-center-sources.snackbar.updateSourceSuccess",defaultMessage:[{type:0,value:"Your source was successfully updated"}]}),severity:MessageSeverity.Success}))}catch(e){yield put(actions$1.updateSourceFailed()),yield put(showMessage({content:t({id:"os-processing-center-sources.snackbar.updateSourceFailed",defaultMessage:[{type:0,value:"Your source could not be updated"}]}),severity:MessageSeverity.Error})),console.log("Problem updating source",e)}}function*createSourceSaga(e){var t=yield select(preferredLanguageSelector),t=AIWareFormatMessage(t||"en");try{var r=yield select(selectApiConfigs),o=yield createSource(r,yield getUpdatedImageForSource(r,e.payload));yield put(actions$1.createSourceSuccess(o)),yield put(showMessage({content:t({id:"os-processing-center-sources.snackbar.createSourceSuccess",defaultMessage:[{type:0,value:"Your source was successfully created"}]}),severity:MessageSeverity.Success}))}catch(e){yield put(actions$1.createSourceFailed()),yield put(showMessage({content:t({id:"os-processing-center-sources.snackbar.createSourceFailed",defaultMessage:[{type:0,value:"Your source could not be created"}]}),severity:MessageSeverity.Error})),console.log("Problem creating source",e)}}function*getSourceTypesSaga(e){try{var t=yield select(selectApiConfigs),r=yield getSourceTypes(t,[""]);yield put(actions$1.setSourceTypes(r))}catch(e){yield put(actions$1.fetchSourceFailed()),console.log("An error occured while getting source types",e)}}function*deleteSourceSaga(e){var t=yield select(preferredLanguageSelector),t=AIWareFormatMessage(t);try{yield deleteSource(yield select(selectApiConfigs),e.payload),yield put(actions$1.deleteSourceSuccess()),yield put(showMessage({content:t({id:"os-processing-center-sources.delete-source-success",defaultMessage:[{type:0,value:"The source was deleted."}]}),severity:MessageSeverity.Success}))}catch(e){yield put(actions$1.deleteSourceFailed()),yield put(showMessage({content:t({id:"os-processing-center-sources.delete-source-error",defaultMessage:[{type:0,value:"There was a problem deleting the source."}]}),severity:MessageSeverity.Error})),console.log("Problem deleting source",e)}}function*checkCanBeDeletedSaga(t){var r,o;try{var{scheduledJobs:n,tdos:s}=yield checkSourceDeleteStatus(yield select(selectApiConfigs),t.payload);let e=!0;(null!=(r=null==n?void 0:n.records)&&r.length||null!=(o=null==s?void 0:s.records)&&o.length)&&(e=!1),yield put(actions$1.checkCanBeDeletedSuccess(e))}catch(e){yield put(actions$1.checkCanBeDeletedFailed(t.payload))}}function*fetchSourceWatcher(){yield takeLatest$1(actions$1.fetchSourceStart,fetchSourceSaga),yield takeLatest$1(actions$1.updateSourceStart,updateSourceSaga),yield takeLatest$1(actions$1.createSourceStart,createSourceSaga),yield takeLatest$1(actions$1.getSourceTypes,getSourceTypesSaga),yield takeLatest$1(actions$1.retryJobStart,retryJobSaga)}function*deleteSourceWatcher(){yield takeLatest$1(actions$1.deleteSourceStart,deleteSourceSaga)}function*checkCanBeDeletedWatcher(){yield takeLatest$1(actions$1.checkCanBeDeletedStart,checkCanBeDeletedSaga)}function*initProcessingCenter(){"pending"===(yield select(selectUIStateStatus))&&(yield put(actions.uiState.initDone()))}function*watchProcessingCenterInit(){yield takeLatest$1(actions.uiState.init.type,initProcessingCenter)}function*rootSaga(){yield all([watchProcessingCenterInit(),fetchSourceWatcher(),deleteSourceWatcher(),checkCanBeDeletedWatcher()])}function getProcessingCenterSourcesModule(){return{id:SLICE_NAME,reducerMap:{[SLICE_NAME]:rootReducer},sagas:[rootSaga],initialActions:[]}}getBuiltIn("Promise"),$$5({target:"Promise",stat:!0,forced:FORCED_PROMISE_CONSTRUCTOR},{resolve:function(e){return promiseResolve(this,e)}});var activeXDocument,IteratorPrototype$2,PrototypeOfArrayIteratorPrototype,arrayIterator,objectDefineProperties={},DESCRIPTORS$4=descriptors,V8_PROTOTYPE_DEFINE_BUG=v8PrototypeDefineBug,definePropertyModule$1=objectDefineProperty,anObject$5=anObject$e,toIndexedObject$1=toIndexedObject$5,objectKeys=objectKeys$2,anObject$4=(objectDefineProperties.f=DESCRIPTORS$4&&!V8_PROTOTYPE_DEFINE_BUG?Object.defineProperties:function(e,t){anObject$5(e);for(var r,o=toIndexedObject$1(t),n=objectKeys(t),s=n.length,a=0;a<s;)definePropertyModule$1.f(e,r=n[a++],o[r]);return e},anObject$e),definePropertiesModule=objectDefineProperties,enumBugKeys=enumBugKeys$3,hiddenKeys=hiddenKeys$4,html=html$2,documentCreateElement$1=documentCreateElement$2,sharedKey$1=sharedKey$3,GT=">",LT="<",PROTOTYPE="prototype",SCRIPT="script",IE_PROTO$1=sharedKey$3("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(e){return LT+SCRIPT+GT+e+LT+"/"+SCRIPT+GT},NullProtoObjectViaActiveX=function(e){e.write(scriptTag("")),e.close();var t=e.parentWindow.Object;return e=null,t},NullProtoObjectViaIFrame=function(){var e=documentCreateElement$1("iframe"),t="java"+SCRIPT+":";return e.style.display="none",html.appendChild(e),e.src=String(t),(t=e.contentWindow.document).open(),t.write(scriptTag("document.F=Object")),t.close(),t.F},NullProtoObject=function(){try{activeXDocument=new ActiveXObject("htmlfile")}catch(e){}NullProtoObject="undefined"==typeof document||document.domain&&activeXDocument?NullProtoObjectViaActiveX(activeXDocument):NullProtoObjectViaIFrame();for(var e=enumBugKeys.length;e--;)delete NullProtoObject[PROTOTYPE][enumBugKeys[e]];return NullProtoObject()},objectCreate=(hiddenKeys[IE_PROTO$1]=!0,Object.create||function(e,t){var r;return null!==e?(EmptyConstructor[PROTOTYPE]=anObject$4(e),r=new EmptyConstructor,EmptyConstructor[PROTOTYPE]=null,r[IE_PROTO$1]=e):r=NullProtoObject(),void 0===t?r:definePropertiesModule.f(r,t)}),wellKnownSymbol$7=wellKnownSymbol$i,create$3=objectCreate,defineProperty$3=objectDefineProperty.f,UNSCOPABLES=wellKnownSymbol$7("unscopables"),ArrayPrototype=Array.prototype,addToUnscopables$2=(null==ArrayPrototype[UNSCOPABLES]&&defineProperty$3(ArrayPrototype,UNSCOPABLES,{configurable:!0,value:create$3(null)}),function(e){ArrayPrototype[UNSCOPABLES][e]=!0}),fails$8=fails$l,correctPrototypeGetter=!fails$l(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),hasOwn$4=hasOwnProperty_1,isCallable$4=isCallable$m,toObject$1=toObject$4,sharedKey=sharedKey$3,CORRECT_PROTOTYPE_GETTER=correctPrototypeGetter,IE_PROTO=sharedKey$3("IE_PROTO"),$Object=Object,ObjectPrototype=$Object.prototype,objectGetPrototypeOf=CORRECT_PROTOTYPE_GETTER?$Object.getPrototypeOf:function(e){var t,e=toObject$1(e);return hasOwn$4(e,IE_PROTO)?e[IE_PROTO]:(t=e.constructor,isCallable$4(t)&&e instanceof t?t.prototype:e instanceof $Object?ObjectPrototype:null)},fails$7=fails$l,isCallable$3=isCallable$m,getPrototypeOf$1=objectGetPrototypeOf,defineBuiltIn$6=defineBuiltIn$a,wellKnownSymbol$6=wellKnownSymbol$i,ITERATOR$4=wellKnownSymbol$i("iterator"),BUGGY_SAFARI_ITERATORS$1=!1,NEW_ITERATOR_PROTOTYPE=([].keys&&("next"in(arrayIterator=[].keys())?(PrototypeOfArrayIteratorPrototype=getPrototypeOf$1(getPrototypeOf$1(arrayIterator)))!==Object.prototype&&(IteratorPrototype$2=PrototypeOfArrayIteratorPrototype):BUGGY_SAFARI_ITERATORS$1=!0),null==IteratorPrototype$2||fails$7(function(){var e={};return IteratorPrototype$2[ITERATOR$4].call(e)!==e})),iteratorsCore=(isCallable$3((IteratorPrototype$2=NEW_ITERATOR_PROTOTYPE?{}:IteratorPrototype$2)[ITERATOR$4])||defineBuiltIn$6(IteratorPrototype$2,ITERATOR$4,function(){return this}),{IteratorPrototype:IteratorPrototype$2,BUGGY_SAFARI_ITERATORS:BUGGY_SAFARI_ITERATORS$1}),IteratorPrototype$1=iteratorsCore.IteratorPrototype,create$2=objectCreate,createPropertyDescriptor$2=createPropertyDescriptor$5,setToStringTag$3=setToStringTag$5,Iterators$2=iterators,returnThis$1=function(){return this},createIteratorConstructor$2=function(e,t,r,o){t+=" Iterator";return e.prototype=create$2(IteratorPrototype$1,{next:createPropertyDescriptor$2(+!o,r)}),setToStringTag$3(e,t,!1),Iterators$2[t]=returnThis$1,e},$$4=_export,call$4=functionCall,FunctionName=functionName,isCallable$2=isCallable$m,createIteratorConstructor$1=createIteratorConstructor$2,getPrototypeOf=objectGetPrototypeOf,setPrototypeOf$1=objectSetPrototypeOf,setToStringTag$2=setToStringTag$5,createNonEnumerableProperty$2=createNonEnumerableProperty$5,defineBuiltIn$5=defineBuiltIn$a,wellKnownSymbol$5=wellKnownSymbol$i,Iterators$1=iterators,IteratorsCore=iteratorsCore,PROPER_FUNCTION_NAME$1=FunctionName.PROPER,CONFIGURABLE_FUNCTION_NAME=FunctionName.CONFIGURABLE,IteratorPrototype=IteratorsCore.IteratorPrototype,BUGGY_SAFARI_ITERATORS=IteratorsCore.BUGGY_SAFARI_ITERATORS,ITERATOR$3=wellKnownSymbol$5("iterator"),KEYS="keys",VALUES="values",ENTRIES="entries",returnThis=function(){return this},defineIterator$2=function(e,t,r,o,n,s,a){createIteratorConstructor$1(r,t,o);function i(e){if(e===n&&$)return $;if(!BUGGY_SAFARI_ITERATORS&&e in d)return d[e];switch(e){case KEYS:case VALUES:case ENTRIES:return function(){return new r(this,e)}}return function(){return new r(this)}}var l,c,o=t+" Iterator",u=!1,d=e.prototype,p=d[ITERATOR$3]||d["@@iterator"]||n&&d[n],$=!BUGGY_SAFARI_ITERATORS&&p||i(n),g="Array"==t&&d.entries||p;if(g&&(g=getPrototypeOf(g.call(new e)))!==Object.prototype&&g.next&&(getPrototypeOf(g)!==IteratorPrototype&&(setPrototypeOf$1?setPrototypeOf$1(g,IteratorPrototype):isCallable$2(g[ITERATOR$3])||defineBuiltIn$5(g,ITERATOR$3,returnThis)),setToStringTag$2(g,o,!0)),PROPER_FUNCTION_NAME$1&&n==VALUES&&p&&p.name!==VALUES&&(CONFIGURABLE_FUNCTION_NAME?createNonEnumerableProperty$2(d,"name",VALUES):(u=!0,$=function(){return call$4(p,this)})),n)if(l={values:i(VALUES),keys:s?$:i(KEYS),entries:i(ENTRIES)},a)for(c in l)!BUGGY_SAFARI_ITERATORS&&!u&&c in d||defineBuiltIn$5(d,c,l[c]);else $$4({target:t,proto:!0,forced:BUGGY_SAFARI_ITERATORS||u},l);return d[ITERATOR$3]!==$&&defineBuiltIn$5(d,ITERATOR$3,$,{name:n}),Iterators$1[t]=$,l},toIndexedObject=toIndexedObject$5,addToUnscopables$1=addToUnscopables$2,Iterators=iterators,InternalStateModule$3=internalState,defineProperty$2=objectDefineProperty.f,defineIterator$1=defineIterator$2,DESCRIPTORS$3=descriptors,ARRAY_ITERATOR="Array Iterator",setInternalState$3=InternalStateModule$3.set,getInternalState$2=InternalStateModule$3.getterFor(ARRAY_ITERATOR),es_array_iterator=defineIterator$1(Array,"Array",function(e,t){setInternalState$3(this,{type:ARRAY_ITERATOR,target:toIndexedObject(e),index:0,kind:t})},function(){var e=getInternalState$2(this),t=e.target,r=e.kind,o=e.index++;return!t||o>=t.length?{value:e.target=void 0,done:!0}:"keys"==r?{value:o,done:!1}:"values"==r?{value:t[o],done:!1}:{value:[o,t[o]],done:!1}},"values"),values=Iterators.Arguments=Iterators.Array;if(addToUnscopables$1("keys"),addToUnscopables$1("values"),addToUnscopables$1("entries"),DESCRIPTORS$3&&"values"!==values.name)try{defineProperty$2(values,"name",{value:"values"})}catch(e){}var COLLECTION_NAME,domIterables={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},documentCreateElement=documentCreateElement$2,classList=documentCreateElement$2("span").classList,DOMTokenListPrototype$1=classList&&classList.constructor&&classList.constructor.prototype,domTokenListPrototype=DOMTokenListPrototype$1===Object.prototype?void 0:DOMTokenListPrototype$1,global$7=global$q,DOMIterables=domIterables,DOMTokenListPrototype=domTokenListPrototype,ArrayIteratorMethods=es_array_iterator,createNonEnumerableProperty$1=createNonEnumerableProperty$5,wellKnownSymbol$4=wellKnownSymbol$i,ITERATOR$2=wellKnownSymbol$4("iterator"),TO_STRING_TAG=wellKnownSymbol$4("toStringTag"),ArrayValues=ArrayIteratorMethods.values,handlePrototype=function(t,e){if(t){if(t[ITERATOR$2]!==ArrayValues)try{createNonEnumerableProperty$1(t,ITERATOR$2,ArrayValues)}catch(e){t[ITERATOR$2]=ArrayValues}if(t[TO_STRING_TAG]||createNonEnumerableProperty$1(t,TO_STRING_TAG,e),DOMIterables[e])for(var r in ArrayIteratorMethods)if(t[r]!==ArrayIteratorMethods[r])try{createNonEnumerableProperty$1(t,r,ArrayIteratorMethods[r])}catch(e){t[r]=ArrayIteratorMethods[r]}}};for(COLLECTION_NAME in DOMIterables)handlePrototype(global$7[COLLECTION_NAME]&&global$7[COLLECTION_NAME].prototype,COLLECTION_NAME);handlePrototype(DOMTokenListPrototype,"DOMTokenList");const useStyles$6=makeStyles()(e=>({sourceContainer:{height:"100%",display:"flex",flexDirection:"column",justifyContent:"space-between"},emptyStateContainer:{display:"flex",flexDirection:"column",justifyContent:"flex-start",alignItems:"center",paddingTop:e.spacing(18),width:"100%"},emptyImage:{display:"flex",textAlign:"center",width:"235px",height:"235px",marginBottom:e.spacing(2)},message:{userSelect:"none",paddingBottom:e.spacing(2)},saveButtonEnabled:{color:e.palette.primary.contrastText+" !important"},sourceDetailFooter:{width:"100%",alignSelf:"flex-end",marginTop:"auto"},sourceDetailButtonsContainer:{display:"flex",padding:"16px",flexDirection:"row",justifyContent:"flex-end",alignItems:"flex-end",marginTop:"22px",marginRight:"14px",Button:{color:e.palette.grey[700]}},sourcePanelContainer:{"&:not([hidden])":{overflow:"hidden",padding:"0px 30px 0px 30px",height:"calc(100vh - 324px)",display:"flex",flexDirection:"column",boxSizing:"border-box",justifyContent:"space-between"}},tabPanelContainer:{"&:not([hidden])":{overflow:"hidden",padding:"0px 30px 0px 30px",height:"calc(100vh - 305px)",display:"flex",flexDirection:"column",boxSizing:"border-box",justifyContent:"space-between"}},tabContainer:{"& .Sdk-Mui-selected":{color:"black"}},stepper:{width:"60%",marginBottom:"15px",paddingLeft:"20px"},step:{".MuiStepIcon-root":{width:"35px",height:"35px"},".MuiStepIcon-root.Mui-active":{fill:"#465364"},".MuiStepIcon-root.Mui-completed":{fill:"#465364"}},button:{marginRight:e.spacing(1)}})),useStyles$5=makeStyles()(e=>({headerContainer:{padding:e.spacing(2,2,2,2),width:"100%"},headerActionContainer:{alignItems:"center",display:"flex",flexGrow:1,height:"100%",justifyContent:"flex-end"},headerTitleRow:{alignItems:"center",display:"flex",justifyContent:"space-between",height:"54px",padding:e.spacing(0,0,0,4)},title:{color:"#2A323C"},headerSubtitleRow:{alignItems:"center",display:"flex",justifyContent:"flex-start",padding:e.spacing(0,0,1,4)},subtitle:{},menuList:{width:"auto"},menuItem:{borderRadius:4,padding:e.spacing(1),"& > svg":{marginRight:e.spacing(2)},textTransform:"none"},divider:{marginBottom:e.spacing(1.5),marginTop:e.spacing(1.5)}})),SHARED_TEXT$1={sourceSaveButton:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"processing-panel-sources.tabs.save",defaultMessage:"Save",description:"button to save source"}),sourceDisabledSaveButton:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"processing-panel-sources.tabs.disabled.save",defaultMessage:"The save button is disabled when a template has errors or has not been submitted. Please submit the template and check for errors.",description:"message for disabled save button"}),sourceCancelButton:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"processing-panel-sources.tabs.cancel",defaultMessage:"Cancel",description:"button to cancel and close panel"}),sourceNextButton:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"processing-panel-sources.tabs.next",defaultMessage:"Next",description:"button to go to next step"}),sourceBackButton:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"processing-panel-sources.tabs.back",defaultMessage:"Back",description:"button to go back a step"}),configurationLabel:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"processing-panel-sources.tabs.configuration.label",defaultMessage:"Configuration",description:"Configurations for source"}),contentTemplateLabel:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"processing-panel-sources.tabs.content-template",defaultMessage:"Content Templates",description:"Configurations for Content Templates"}),headerTitleSourceDetail:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"processing-panel-sources.header.source.detail.title",defaultMessage:"Source detail",description:"Title for Source Detail Panel"}),headerTitleSourceCreation:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"processing-panel-sources.header.source.creation.title",defaultMessage:"Source Creation",description:"Title for Source Creation Panel"}),headerSubTitleSourceDetail:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"processing-panel-sources.header.source.detail.subtitle",defaultMessage:"View and modify configurations and settings for this source.",description:"Subtitle for Source Detail Panel"}),headerSubTitleSourceCreation:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"processing-panel-sources.header.source.creation.subtitle",defaultMessage:"Follow the steps below to create a new source.",description:"subtitle for Source Creation Panel"}),headerPermissionsButton:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"processing-panel-sources.header.permissions",defaultMessage:"Permissions",description:"button for permissions"}),headerMoreActionsButton:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"processing-panel-sources.header.more.actions",defaultMessage:"More Actions",description:"button for more actions"}),headerCloseButton:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"processing-panel-sources.header.close.button",defaultMessage:"Close",description:"button for Close / Hide Panel"}),headerDeleteSourceButton:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"processing-panel-sources.header.delete.source.button",defaultMessage:"Delete",description:"button to delete source"}),sourceDetailsRetryButton:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"processing-panel-sources.source.details.try.button",defaultMessage:"Try Again",description:"button to try to reload source"}),sourceDetailsErrorMessage:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"processing-panel-sources.source.details.error.message",defaultMessage:"There was a problem loading the Source",description:"error message on source load"}),deleteModalButtonCancel:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"processing-panel-sources.source.details.delete.modal.button.cancel",defaultMessage:"Cancel",description:"Modal button cancel"}),deleteModalButtonDelete:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"processing-panel-sources.source.details.delete.modal.button.delete",defaultMessage:"Delete",description:"Modal button delete"}),deleteModalTitle:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"processing-panel-sources.source.details.delete.modal.title",defaultMessage:"Delete Source",description:"Modal title for deleting source"}),deleteModalSimpleDescription:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"processing-panel-sources.source.details.delete.modal.description-simple",defaultMessage:"Are you sure you want to delete this source?",description:"Modal simple description for deleting source"}),deleteModalDescription:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"processing-panel-sources.source.details.delete.modal.description",defaultMessage:"Deleting this source will pause all Scheduled Jobs that are currently using this source. You will need to update each schedule with a new source.",description:"Modal description for deleting source"}),deleteModalTitleSourceInUse:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"processing-panel-sources.source.details.delete.modal.title.source.in.use",defaultMessage:"Source In Use",description:"Modal title for deleting source, source in use"}),deleteModalDescriptionSourceInUse:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"processing-panel-sources.source.details.delete.modal.description.source.in.use",defaultMessage:"This source is currently being used in scheduled jobs or ingested content exists from this Source. In order to delete this source, please update each schedule using this source and remove the content.",description:"Modal description for deleting source, source in use"}),imageFileTypeErrorMessage:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"processing-panel-sources.source.details.image.type.error.message",defaultMessage:"Please Select a .png or .jpg file",description:"error message on file selection"}),basicInformationTitle:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"processing-panel-sources.source.details.basic.info.title",defaultMessage:"Basic Information",description:"Title for basic info section"}),basicInformationSubtitle:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"processing-panel-sources.source.details.basic.info.subtitle",defaultMessage:"Provide basic information about this source",description:"Subtitle for basic info section"}),configurationInformationTitle:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"processing-panel-sources.source.details.config.info.title",defaultMessage:"Configuration",description:"Title for configuration info section"}),configurationInformationSubtitle:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"processing-panel-sources.source.details.config.info.subtitle",defaultMessage:"Provide the required configuration in order to import data from this source.",description:"Subtitle for configuration info section"}),sourceAvatarTitle:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"processing-panel-sources.source.details.source.avatar.title",defaultMessage:"Source Avatar",description:"Title for source avatar section"}),sourceAvatarSubtitle:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"processing-panel-sources.source.details.source.avatar.subtitle",defaultMessage:"Recommended image size: 300x300 .png or .jpg",description:"Subtitle for source avatar section"}),sourceNameTextFieldLabel:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"processing-panel-sources.source.details.source.name.textfield.label",defaultMessage:"Source Name",description:"texfield label for source name"}),sourceDescriptionTextFieldLabel:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"processing-panel-sources.source.details.source.description.textfield.label",defaultMessage:"Source Description",description:"texfield label for source description"}),sourceTypeFieldLabel:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"processing-panel-sources.source.details.source.type.selectField.label",defaultMessage:"Source Type",description:"select field label for source type"}),sourceTypeError:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"processing-panel-sources.source.details.source.type.error.message",defaultMessage:"Source Type is required",description:"error for source type field"}),sourceNameError:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"processing-panel-sources.source.details.source.name.error.message",defaultMessage:"Source name is required.",description:"error for source name field"})},useStyles$4=makeStyles()(e=>({actionContainer:{padding:e.spacing(3,2,2,2),display:"flex",justifyContent:"flex-end","& button:last-of-type":{marginLeft:"10px"}}})),modalStyles={position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:400,bgcolor:"background.paper",borderRadius:"5px",boxShadow:24,p:5},DeleteModal=({sourceId:e,onCancel:t,onPanelClose:r})=>{var o=useStyles$4()["classes"];const n=useSelector(selectDeleteSourceStatus);var s="pending"===n,a=useSelector(selectCheckCanBeDeletedStatus);const i=useSelector(selectCanBeDeleted);a="pending"===a;const l=useDispatch();return react.exports.useEffect(()=>{"idle"===n&&(t(),r(),l(actions.sourceConfiguration.deleteSourceReset())),"failure"===n&&(t(),l(actions.sourceConfiguration.deleteSourceReset()))},[n]),jsxRuntime.exports.jsx(Modal,Object.assign({open:!0,onClose:t},{children:jsxRuntime.exports.jsxs(Box$1,Object.assign({sx:modalStyles},{children:[a&&jsxRuntime.exports.jsx(Box$1,Object.assign({sx:{display:"flex",alignItems:"center",justifyContent:"center",height:"150px"}},{children:jsxRuntime.exports.jsx(CircularProgress,{})})),!a&&jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment,{children:[jsxRuntime.exports.jsx(Typography,Object.assign({id:"source-delete-modal-title",variant:"h4"},{children:i?jsxRuntime.exports.jsx(jsxRuntime.exports.Fragment,{children:SHARED_TEXT$1.deleteModalTitle()}):jsxRuntime.exports.jsx(jsxRuntime.exports.Fragment,{children:SHARED_TEXT$1.deleteModalTitleSourceInUse()})})),jsxRuntime.exports.jsx(Typography,Object.assign({id:"source-delete-modal-description",sx:{mt:2}},{children:i?jsxRuntime.exports.jsx(jsxRuntime.exports.Fragment,{children:SHARED_TEXT$1.deleteModalSimpleDescription()}):jsxRuntime.exports.jsx(jsxRuntime.exports.Fragment,{children:SHARED_TEXT$1.deleteModalDescriptionSourceInUse()})})),jsxRuntime.exports.jsxs("div",Object.assign({className:o.actionContainer},{children:[i&&jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment,{children:[jsxRuntime.exports.jsx(Button,Object.assign({onClick:t,disabled:s},{children:SHARED_TEXT$1.deleteModalButtonCancel()})),jsxRuntime.exports.jsx(LoadingButton,Object.assign({onClick:()=>{l(actions.sourceConfiguration.deleteSourceStart(e))},variant:"contained",disableElevation:!0,disableRipple:!0,loading:s},{children:SHARED_TEXT$1.deleteModalButtonDelete()}))]}),!i&&jsxRuntime.exports.jsx(Button,Object.assign({onClick:t},{children:"Okay"}))]}))]})]}))}))},Header=({onPanelClose:e,sourceId:t})=>{var r=useStyles$5()["classes"];const[o,n]=react.exports.useState(null),[s,a]=react.exports.useState(!1),[i,l]=react.exports.useState(!1);var c=Boolean(o);const u=useSelector(selectIsOLPEnabled),d=useSelector(selectSource),p=useSelector(userSelector);react.exports.useEffect(()=>{d&&"owner"===d.permission&&!u&&(p&&p.myRights&&0<=p.myRights.indexOf("cms.media.delete")||p&&p.myRights&&0<=p.myRights.indexOf("recording.delete"))?a(!0):a(!1)},[d]);const $=()=>{n(null)};return jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment,{children:[jsxRuntime.exports.jsxs("div",Object.assign({className:r.headerContainer},{children:[jsxRuntime.exports.jsxs("div",Object.assign({className:r.headerTitleRow,"data-testid":"-header-testid"},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h1","data-testid":"permissions-panel-header-title",className:r.title},{children:t?SHARED_TEXT$1.headerTitleSourceDetail():SHARED_TEXT$1.headerTitleSourceCreation()})),jsxRuntime.exports.jsxs("div",Object.assign({className:r.headerActionContainer},{children:[t&&jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment,{children:[u&&jsxRuntime.exports.jsx(Tooltip,Object.assign({title:SHARED_TEXT$1.headerPermissionsButton()},{children:jsxRuntime.exports.jsx(IconButton,Object.assign({onClick:()=>console.log("clicked permissions"),"aria-labelledby":"permissions-button","data-testid":"source-details-permissions-button",size:"large"},{children:jsxRuntime.exports.jsx(AddUser,{})}))})),jsxRuntime.exports.jsx(Tooltip,Object.assign({title:SHARED_TEXT$1.headerMoreActionsButton()},{children:jsxRuntime.exports.jsx(IconButton,Object.assign({onClick:e=>{n(e.currentTarget),e.stopPropagation()},"aria-labelledby":"more-actions-button","data-testid":"source-details-more-actions-button",size:"large"},{children:jsxRuntime.exports.jsx(MoreVert,{})}))}))]}),jsxRuntime.exports.jsx(Tooltip,Object.assign({title:SHARED_TEXT$1.headerCloseButton()},{children:jsxRuntime.exports.jsx(IconButton,Object.assign({onClick:()=>e(),"aria-labelledby":"source-details-close-button","data-testid":"source-details-close-button",size:"large"},{children:t?jsxRuntime.exports.jsx(Close,{}):jsxRuntime.exports.jsx(Hide,{})}))}))]}))]})),jsxRuntime.exports.jsx("div",Object.assign({className:r.headerSubtitleRow},{children:jsxRuntime.exports.jsx(Typography,Object.assign({variant:"body2","data-testid":"permissions-panel-header-title",className:r.subtitle},{children:t?SHARED_TEXT$1.headerSubTitleSourceDetail():SHARED_TEXT$1.headerSubTitleSourceCreation()}))})),jsxRuntime.exports.jsx(Menu,Object.assign({onClick:e=>e.stopPropagation(),classes:{paper:r.menuList},"data-testid":"pc-sources-item-context-menu",open:c,anchorEl:o,onClose:$},{children:jsxRuntime.exports.jsxs(MenuItem,Object.assign({onClick:e=>{e.stopPropagation(),l(!0),$()},disabled:!s,className:r.menuItem,"data-testid":"pc-sources-context-menu-delete-option"},{children:[jsxRuntime.exports.jsx(Delete,{fontSize:"small"}),SHARED_TEXT$1.headerDeleteSourceButton()]}))}))]})),t&&i&&jsxRuntime.exports.jsx(DeleteModal,{sourceId:t,onCancel:()=>l(!1),onPanelClose:e})]})};var isCallable$1=isCallable$m,isObject$2=isObject$a,setPrototypeOf=objectSetPrototypeOf,inheritIfRequired$1=function(e,t,r){return setPrototypeOf&&isCallable$1(t=t.constructor)&&t!==r&&isObject$2(t=t.prototype)&&t!==r.prototype&&setPrototypeOf(e,t),e},isObject$1=isObject$a,classof$1=classofRaw$1,wellKnownSymbol$3=wellKnownSymbol$i,MATCH$1=wellKnownSymbol$i("match"),isRegexp=function(e){var t;return isObject$1(e)&&(void 0!==(t=e[MATCH$1])?!!t:"RegExp"==classof$1(e))},anObject$3=anObject$e,regexpFlags$1=function(){var e=anObject$3(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t},call$3=functionCall,hasOwn$3=hasOwnProperty_1,isPrototypeOf$1=objectIsPrototypeOf,regExpFlags=regexpFlags$1,RegExpPrototype$2=RegExp.prototype,regexpGetFlags=function(e){var t=e.flags;return void 0!==t||"flags"in RegExpPrototype$2||hasOwn$3(e,"flags")||!isPrototypeOf$1(RegExpPrototype$2,e)?t:call$3(regExpFlags,e)},fails$6=fails$l,global$6=global$q,$RegExp$2=global$q.RegExp,UNSUPPORTED_Y$2=fails$6(function(){var e=$RegExp$2("a","y");return e.lastIndex=2,null!=e.exec("abcd")}),MISSED_STICKY$1=UNSUPPORTED_Y$2||fails$6(function(){return!$RegExp$2("a","y").sticky}),BROKEN_CARET=UNSUPPORTED_Y$2||fails$6(function(){var e=$RegExp$2("^r","gy");return e.lastIndex=2,null!=e.exec("str")}),regexpStickyHelpers={BROKEN_CARET:BROKEN_CARET,MISSED_STICKY:MISSED_STICKY$1,UNSUPPORTED_Y:UNSUPPORTED_Y$2},defineProperty$1=objectDefineProperty.f,proxyAccessor$1=function(e,t,r){r in e||defineProperty$1(e,r,{configurable:!0,get:function(){return t[r]},set:function(e){t[r]=e}})},fails$5=fails$l,global$5=global$q,$RegExp$1=global$q.RegExp,regexpUnsupportedDotAll=fails$5(function(){var e=$RegExp$1(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)}),fails$4=fails$l,global$4=global$q,$RegExp=global$q.RegExp,regexpUnsupportedNcg=fails$4(function(){var e=$RegExp("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")}),DESCRIPTORS$2=descriptors,global$3=global$q,uncurryThis$5=functionUncurryThis,isForced=isForced_1,inheritIfRequired=inheritIfRequired$1,createNonEnumerableProperty=createNonEnumerableProperty$5,getOwnPropertyNames=objectGetOwnPropertyNames.f,isPrototypeOf=objectIsPrototypeOf,isRegExp=isRegexp,toString$3=toString$6,getRegExpFlags$1=regexpGetFlags,stickyHelpers$1=regexpStickyHelpers,proxyAccessor=proxyAccessor$1,defineBuiltIn$4=defineBuiltIn$a,fails$3=fails$l,hasOwn$2=hasOwnProperty_1,enforceInternalState=internalState.enforce,setSpecies=setSpecies$2,wellKnownSymbol$2=wellKnownSymbol$i,UNSUPPORTED_DOT_ALL$1=regexpUnsupportedDotAll,UNSUPPORTED_NCG$1=regexpUnsupportedNcg,MATCH=wellKnownSymbol$i("match"),NativeRegExp=global$3.RegExp,RegExpPrototype$1=NativeRegExp.prototype,SyntaxError=global$3.SyntaxError,exec$3=uncurryThis$5(RegExpPrototype$1.exec),charAt$5=uncurryThis$5("".charAt),replace$4=uncurryThis$5("".replace),stringIndexOf=uncurryThis$5("".indexOf),stringSlice$4=uncurryThis$5("".slice),IS_NCG=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,re1=/a/g,re2=/a/g,CORRECT_NEW=new NativeRegExp(re1)!==re1,MISSED_STICKY=stickyHelpers$1.MISSED_STICKY,UNSUPPORTED_Y$1=stickyHelpers$1.UNSUPPORTED_Y,BASE_FORCED=DESCRIPTORS$2&&(!CORRECT_NEW||MISSED_STICKY||UNSUPPORTED_DOT_ALL$1||UNSUPPORTED_NCG$1||fails$3(function(){return re2[MATCH]=!1,NativeRegExp(re1)!=re1||NativeRegExp(re2)==re2||"/a/i"!=NativeRegExp(re1,"i")})),handleDotAll=function(e){for(var t,r=e.length,o=0,n="",s=!1;o<=r;o++)"\\"===(t=charAt$5(e,o))?n+=t+charAt$5(e,++o):s||"."!==t?("["===t?s=!0:"]"===t&&(s=!1),n+=t):n+="[\\s\\S]";return n},handleNCG=function(e){for(var t,r=e.length,o=0,n="",s=[],a={},i=!1,l=!1,c=0,u="";o<=r;o++){if("\\"===(t=charAt$5(e,o)))t+=charAt$5(e,++o);else if("]"===t)i=!1;else if(!i)switch(!0){case"["===t:i=!0;break;case"("===t:exec$3(IS_NCG,stringSlice$4(e,o+1))&&(o+=2,l=!0),n+=t,c++;continue;case">"===t&&l:if(""===u||hasOwn$2(a,u))throw new SyntaxError("Invalid capture group name");a[u]=!0,l=!(s[s.length]=[u,c]),u="";continue}l?u+=t:n+=t}return[n,s]};if(isForced("RegExp",BASE_FORCED)){for(var RegExpWrapper=function(e,t){var r,o,n=isPrototypeOf(RegExpPrototype$1,this),s=isRegExp(e),a=void 0===t,i=[],l=e;if(!n&&s&&a&&e.constructor===RegExpWrapper)return e;if((s||isPrototypeOf(RegExpPrototype$1,e))&&(e=e.source,a)&&(t=getRegExpFlags$1(l)),e=void 0===e?"":toString$3(e),t=void 0===t?"":toString$3(t),l=e,s=t=UNSUPPORTED_DOT_ALL$1&&"dotAll"in re1&&(r=!!t&&-1<stringIndexOf(t,"s"))?replace$4(t,/s/g,""):t,MISSED_STICKY&&"sticky"in re1&&(o=!!t&&-1<stringIndexOf(t,"y"))&&UNSUPPORTED_Y$1&&(t=replace$4(t,/y/g,"")),UNSUPPORTED_NCG$1&&(e=(a=handleNCG(e))[0],i=a[1]),a=inheritIfRequired(NativeRegExp(e,t),n?this:RegExpPrototype$1,RegExpWrapper),(r||o||i.length)&&(t=enforceInternalState(a),r&&(t.dotAll=!0,t.raw=RegExpWrapper(handleDotAll(e),s)),o&&(t.sticky=!0),i.length)&&(t.groups=i),e!==l)try{createNonEnumerableProperty(a,"source",""===l?"(?:)":l)}catch(e){}return a},keys=getOwnPropertyNames(NativeRegExp),index=0;keys.length>index;)proxyAccessor(RegExpWrapper,NativeRegExp,keys[index++]);(RegExpPrototype$1.constructor=RegExpWrapper).prototype=RegExpPrototype$1,defineBuiltIn$4(global$3,"RegExp",RegExpWrapper,{constructor:!0})}setSpecies("RegExp");var call$2=functionCall,uncurryThis$4=functionUncurryThis,toString$2=toString$6,regexpFlags=regexpFlags$1,stickyHelpers=regexpStickyHelpers,shared=shared$4.exports,create$1=objectCreate,getInternalState$1=internalState.get,UNSUPPORTED_DOT_ALL=regexpUnsupportedDotAll,UNSUPPORTED_NCG=regexpUnsupportedNcg,nativeReplace=shared("native-string-replace",String.prototype.replace),nativeExec=RegExp.prototype.exec,patchedExec=nativeExec,charAt$4=uncurryThis$4("".charAt),indexOf=uncurryThis$4("".indexOf),replace$3=uncurryThis$4("".replace),stringSlice$3=uncurryThis$4("".slice),UPDATES_LAST_INDEX_WRONG=function(){var e=/a/,t=/b*/g;return call$2(nativeExec,e,"a"),call$2(nativeExec,t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),UNSUPPORTED_Y=stickyHelpers.BROKEN_CARET,NPCG_INCLUDED=void 0!==/()??/.exec("")[1],PATCH=UPDATES_LAST_INDEX_WRONG||NPCG_INCLUDED||UNSUPPORTED_Y||UNSUPPORTED_DOT_ALL||UNSUPPORTED_NCG,regexpExec=patchedExec=PATCH?function(e){var t,r,o,n,s,a,i=this,l=getInternalState$1(i),e=toString$2(e),c=l.raw;if(c)return c.lastIndex=i.lastIndex,d=call$2(patchedExec,c,e),i.lastIndex=c.lastIndex,d;var u=l.groups,c=UNSUPPORTED_Y&&i.sticky,d=call$2(regexpFlags,i),l=i.source,p=0,$=e;if(c&&(d=replace$3(d,"y",""),-1===indexOf(d,"g")&&(d+="g"),$=stringSlice$3(e,i.lastIndex),0<i.lastIndex&&(!i.multiline||i.multiline&&"\n"!==charAt$4(e,i.lastIndex-1))&&(l="(?: "+l+")",$=" "+$,p++),t=new RegExp("^(?:"+l+")",d)),NPCG_INCLUDED&&(t=new RegExp("^"+l+"$(?!\\s)",d)),UPDATES_LAST_INDEX_WRONG&&(r=i.lastIndex),o=call$2(nativeExec,c?t:i,$),c?o?(o.input=stringSlice$3(o.input,p),o[0]=stringSlice$3(o[0],p),o.index=i.lastIndex,i.lastIndex+=o[0].length):i.lastIndex=0:UPDATES_LAST_INDEX_WRONG&&o&&(i.lastIndex=i.global?o.index+o[0].length:r),NPCG_INCLUDED&&o&&1<o.length&&call$2(nativeReplace,o[0],t,function(){for(n=1;n<arguments.length-2;n++)void 0===arguments[n]&&(o[n]=void 0)}),o&&u)for(o.groups=s=create$1(null),n=0;n<u.length;n++)s[(a=u[n])[0]]=o[a[1]];return o}:patchedExec,$$3=_export,exec$2=patchedExec,PROPER_FUNCTION_NAME=(_export({target:"RegExp",proto:!0,forced:/./.exec!==exec$2},{exec:exec$2}),functionName.PROPER),defineBuiltIn$3=defineBuiltIn$a,anObject$2=anObject$e,$toString$2=toString$6,fails$2=fails$l,getRegExpFlags=regexpGetFlags,TO_STRING="toString",RegExpPrototype=RegExp.prototype,n$ToString=RegExpPrototype[TO_STRING],NOT_GENERIC=fails$2(function(){return"/a/b"!=n$ToString.call({source:"a",flags:"b"})}),INCORRECT_NAME=PROPER_FUNCTION_NAME&&n$ToString.name!=TO_STRING;(NOT_GENERIC||INCORRECT_NAME)&&defineBuiltIn$3(RegExp.prototype,TO_STRING,function(){var e=anObject$2(this);return"/"+$toString$2(e.source)+"/"+$toString$2(getRegExpFlags(e))},{unsafe:!0});const fetchOptions=(e,t,r)=>fetch(t.graphQLEndpoint,{method:"post",headers:{Authorization:"bearer "+t.token,"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({query:e,variables:r})}).then(e=>e.json()).then(e=>{var t;if(!lodash.exports.isEmpty(e.errors))throw new Error((null==(t=((null==e?void 0:e.errors)||[])[0])?void 0:t.message)||"Error");let r;return r=0<(null==(t=null==(t=null==e?void 0:e.data)?void 0:t.results)?void 0:t.length)?e.data.results:0<(null==(t=null==(t=null==(t=null==e?void 0:e.data)?void 0:t.results)?void 0:t.records)?void 0:t.length)?e.data.results.records:null==(t=null==(e=null==(t=null==(e=null==(t=null==e?void 0:e.data)?void 0:t.dataRegistries)?void 0:e.records[0])?void 0:t.publishedSchema)?void 0:e.structuredDataObjects)?void 0:t.records}),validateFields=(e,a)=>{const i=[],l={};for(const c in a)null!=e&&e.forEach(t=>{var r=t.id;let o="";if(r===c){var n=a[c];let e=!0;var s=t;s.hasOwnProperty("isRequired")&&s.isRequired&&!n&&(e=!1,o=s.title+" is required"),s.hasOwnProperty("pattern")&&!new RegExp(s.pattern).test(n)&&(e=!1,o=s.title+" is not valid"),l[r]=Object.assign(Object.assign({},t),{id:r,isValid:e,errorMessage:o}),i.push({id:r,isValid:e})}});return{isFormValid:i.every(e=>!0===e.isValid),validatedFields:l}},updateFields=(e,t,r)=>{var o=Object.keys(t).length,n=[];let s=0;for(const a in t){const i=t[a];if(i.id===e[a].id){if(s===o)break;r&&r(e=>Object.assign(Object.assign({},e),{[a]:Object.assign(Object.assign({},e[a]),{isValid:i.isValid,errorMessage:i.errorMessage})})),n.push(e[a]),++s}}},useStyles$3=makeStyles()(e=>({field:{width:"100%"},formControlWrapper:{marginTop:15},inputLabel:{fontFamily:"Nunito",fontWeight:300,display:"block",fontSize:14,color:"#5C6269",marginBottom:6},inputLabelError:{color:e.palette.error.main}})),DynamicTextField=({id:e,label:t,required:r,value:o,pattern:n,isDisabled:s=!1,onChange:a,error:i=!1})=>{var l=useStyles$3()["classes"];return jsxRuntime.exports.jsx(TextField,{id:e,label:t,InputLabelProps:{shrink:!0},autoComplete:"off",required:r,value:o,disabled:s,className:l.field,onChange:a,size:"small",error:i,inputProps:{pattern:n}})},DynamicSelect=({id:e,fieldId:r,label:t,required:o,value:n,allowMultiple:s=!1,isDisabled:a=!1,query:i,onChange:l})=>{const[c,u]=react.exports.useState([]),d=useSelector(selectApiConfigs$1),p=useDispatch();react.exports.useEffect(()=>{(void 0===c||0===(null===c||void 0===c?void 0:c.length)&&i)&&fetchOptions(i,d,{}).then(e=>{e=function(e){e=null==e?void 0:e.map(e=>({id:e.id||e,name:e.name||e}));return e}(e);u(e);const t={};e.forEach(e=>{t[e.id]={id:e.id,name:e.name}}),p(actions$1.setSelectListData({key:r,data:t}))})},[i,d,c,r]);return jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment,{children:[jsxRuntime.exports.jsx(InputLabel,Object.assign({required:o,shrink:!0,id:t},{children:t})),jsxRuntime.exports.jsx(Select,Object.assign({notched:!0,size:"small",id:e,labelId:t,label:t,variant:"outlined",multiple:s,sx:{width:"100%"},value:n,required:o,disabled:a||0===c.length,onChange:function(e){e=e.target.value,e="string"==typeof e?e.split(","):e;l&&l(e,s)},MenuProps:{sx:{maxHeight:"30vh"},className:"aiware-el"}},{children:null===c||void 0===c?void 0:c.map(e=>jsxRuntime.exports.jsx(MenuItem,Object.assign({value:e.id},{children:e.name}),e.id))}))]})},fieldType={string:"string",number:"number",boolean:"boolean",select:"select",childSelect:"childSelect"},DynamicChildSelect=({id:e,label:t,required:r,value:o,isDisabled:n=!1,options:s,onChange:a})=>jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment,{children:[jsxRuntime.exports.jsx(InputLabel,Object.assign({required:r,shrink:!0,id:t},{children:t})),jsxRuntime.exports.jsx(Select,Object.assign({notched:!0,size:"small",id:e,labelId:t,label:t,variant:"outlined",sx:{width:"100%"},value:o,disabled:n||0===(null==s?void 0:s.length),required:r,onChange:a},{children:null==s?void 0:s.map(e=>jsxRuntime.exports.jsx(MenuItem,Object.assign({value:e.id},{children:e.name}),e.id))}))]}),DynamicLoader=({isFormDirty:c,sourceDetails:u,sourceTypeFields:e,canEdit:d,onChange:p,onSelectChange:$})=>{const g=useStyles$3()["classes"],t=useSelector(selectDynamicSelectListData),[f,r]=react.exports.useState({});return react.exports.useEffect(()=>{t&&0<Object.keys(t).length&&r(t)},[t]),jsxRuntime.exports.jsx("div",{children:e?Object.keys(e).map(t=>{const r=e[t];var o="dynamicField-"+(null===r||void 0===r?void 0:r.id),n=e=>{p({fieldName:null===r||void 0===r?void 0:r.id,fieldValue:e.target.value})},s=u[null===r||void 0===r?void 0:r.id];switch(r.type){case fieldType.string:return jsxRuntime.exports.jsxs(FormControl,Object.assign({sx:{width:"100%"},className:g.formControlWrapper,error:c&&!(null!==r&&void 0!==r&&r.isValid)},{children:[jsxRuntime.exports.jsx(DynamicTextField,{label:null===r||void 0===r?void 0:r.title,id:o,required:null===r||void 0===r?void 0:r.isRequired,value:s||"",pattern:null===r||void 0===r?void 0:r.pattern,isDisabled:!d,onChange:n,error:c&&!(null!==r&&void 0!==r&&r.isValid)}),c&&!(null!==r&&void 0!==r&&r.isValid)&&jsxRuntime.exports.jsx(FormHelperText$2,{children:null===r||void 0===r?void 0:r.errorMessage})]}),t);case fieldType.boolean:return jsxRuntime.exports.jsxs(FormControl,Object.assign({sx:{width:"100%"},className:g.formControlWrapper,error:c&&!(null!==r&&void 0!==r&&r.isValid)},{children:[jsxRuntime.exports.jsx(FormControlLabel,{id:o,control:jsxRuntime.exports.jsx(Checkbox,{}),label:r.isRequired?`${null===r||void 0===r?void 0:r.title} *`:null===r||void 0===r?void 0:r.title,disabled:!d,onChange:e=>{p({fieldName:null===r||void 0===r?void 0:r.id,fieldValue:e.target.checked})}}),c&&!(null!==r&&void 0!==r&&r.isValid)&&jsxRuntime.exports.jsx(FormHelperText$2,{children:null===r||void 0===r?void 0:r.errorMessage})]}),t);case fieldType.select:return jsxRuntime.exports.jsxs(FormControl,Object.assign({sx:{width:"100%"},className:g.formControlWrapper,error:c&&!(null!==r&&void 0!==r&&r.isValid)},{children:[jsxRuntime.exports.jsx(DynamicSelect,{id:o,fieldId:null===r||void 0===r?void 0:r.id,required:null===r||void 0===r?void 0:r.isRequired,isDisabled:!d,value:null!==r&&void 0!==r&&r.allowMultiple?u[null===r||void 0===r?void 0:r.id]||[]:u[null===r||void 0===r?void 0:r.id]||"",allowMultiple:null===r||void 0===r?void 0:r.allowMultiple,onChange:(e,t)=>{$({fieldName:null===r||void 0===r?void 0:r.id,fieldValue:e},t)},query:(null===r||void 0===r?void 0:r.query)||"",label:null===r||void 0===r?void 0:r.title}),c&&!(null!==r&&void 0!==r&&r.isValid)&&jsxRuntime.exports.jsx(FormHelperText$2,{children:null===r||void 0===r?void 0:r.errorMessage})]}),t);case fieldType.childSelect:{if(!f||0===Object.keys(f).length)return null;var a=null===r||void 0===r?void 0:r.parentId,i=u[a];const l=f[a];let e=[];return l&&(i=function(e,r,o){var t;if(!r)return{};const n={},s={};return null==(t=Object.keys(r))||t.forEach(e=>{const t=r[e];null!=o&&o.forEach(e=>{t.id===e&&(s[t.id]={id:t.id,name:t.name})})}),n[e]=s,n}(a,l,i)[a],e=Object.keys(i).map(e=>{var t;return{id:null==(t=l[e])?void 0:t.id,name:null==(t=l[e])?void 0:t.name}})),jsxRuntime.exports.jsxs(FormControl,Object.assign({sx:{width:"100%"},className:g.formControlWrapper,error:c&&!(null!==r&&void 0!==r&&r.isValid)},{children:[jsxRuntime.exports.jsx(DynamicChildSelect,{id:o,required:null===r||void 0===r?void 0:r.isRequired,value:s||"",isDisabled:!d,label:null===r||void 0===r?void 0:r.title,options:e||[],onChange:n}),c&&!(null!==r&&void 0!==r&&r.isValid)&&jsxRuntime.exports.jsx(FormHelperText$2,{children:null===r||void 0===r?void 0:r.errorMessage})]}),t)}default:return null}}):null})},useStyles$2=makeStyles()(e=>({sectionContainer:{marginTop:"10px",overflowY:"auto","&::-webkit-scrollbar":{display:"none"}},wrapper:{padding:"24px"},mainContent:{display:"flex"},title:{marginBottom:"4px"},subtitle:{marginBottom:"8px"},sourceInfoContainer:{display:"flex",marginTop:"5px",flexDirection:"column",flexGrow:"1",alignItems:"flex-start"},sourceInputsContainer:{display:"flex",flexDirection:"column",alignItems:"center",marginTop:"5px",width:"100%"},sourceInput:{width:"100%"},avatarContainer:{marginTop:"5px",width:"190px",padding:"0 10px 0 40px"},buttons:{display:"flex",justifyContent:"flex-end",alignItems:"flex-end",padding:"16px",Button:{color:e.palette.grey[700]}},saveButtonEnabled:{color:e.palette.primary.contrastText+" !important"},formControlWrapper:{marginTop:15},inputLabel:{fontFamily:"Nunito",fontWeight:300,display:"block",fontSize:14,color:"#5C6269",marginBottom:6},inputLabelError:{color:e.palette.error.main}}));var headersHas,headersSet,wrapRequestOptions,RequestConstructor,EOF,nativeCreateObjectURL,nativeRevokeObjectURL,uncurryThis$3=functionUncurryThis,toIntegerOrInfinity=toIntegerOrInfinity$3,toString$1=toString$6,requireObjectCoercible=requireObjectCoercible$4,charAt$3=uncurryThis$3("".charAt),charCodeAt$1=uncurryThis$3("".charCodeAt),stringSlice$2=uncurryThis$3("".slice),createMethod=function(n){return function(e,t){var r,e=toString$1(requireObjectCoercible(e)),t=toIntegerOrInfinity(t),o=e.length;return t<0||o<=t?n?"":void 0:(r=charCodeAt$1(e,t))<55296||56319<r||t+1===o||(o=charCodeAt$1(e,t+1))<56320||57343<o?n?charAt$3(e,t):r:n?stringSlice$2(e,t,t+2):o-56320+(r-55296<<10)+65536}},stringMultibyte={codeAt:createMethod(!1),charAt:createMethod(!0)},charAt$2=stringMultibyte.charAt,toString=toString$6,InternalStateModule$2=internalState,defineIterator=defineIterator$2,STRING_ITERATOR="String Iterator",setInternalState$2=InternalStateModule$2.set,getInternalState=InternalStateModule$2.getterFor(STRING_ITERATOR),fails$1=(defineIterator(String,"String",function(e){setInternalState$2(this,{type:STRING_ITERATOR,string:toString(e),index:0})},function(){var e=getInternalState(this),t=e.string,r=e.index;return r>=t.length?{value:void 0,done:!0}:(t=charAt$2(t,r),e.index+=t.length,{value:t,done:!1})}),fails$l),wellKnownSymbol$1=wellKnownSymbol$i,IS_PURE=isPure,ITERATOR$1=wellKnownSymbol$i("iterator"),nativeUrl=!fails$1(function(){var e=new URL("b?a=1&b=2&c=3","http://a"),r=e.searchParams,o="";return e.pathname="c%20d",r.forEach(function(e,t){r.delete("b"),o+=t+e}),IS_PURE&&!e.toJSON||!r.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==r.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!r[ITERATOR$1]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==o||"x"!==new URL("http://x",void 0).host}),makeBuiltIn=makeBuiltIn$3.exports,defineProperty=objectDefineProperty,defineBuiltInAccessor$1=function(e,t,r){return r.get&&makeBuiltIn(r.get,t,{getter:!0}),r.set&&makeBuiltIn(r.set,t,{setter:!0}),defineProperty.f(e,t,r)},anObject$1=anObject$e,iteratorClose=iteratorClose$2,callWithSafeIterationClosing$1=function(t,e,r,o){try{return o?e(anObject$1(r)[0],r[1]):e(r)}catch(e){iteratorClose(t,"throw",e)}},toPropertyKey=toPropertyKey$3,definePropertyModule=objectDefineProperty,createPropertyDescriptor$1=createPropertyDescriptor$5,createProperty$2=function(e,t,r){t=toPropertyKey(t);t in e?definePropertyModule.f(e,t,createPropertyDescriptor$1(0,r)):e[t]=r},bind$2=functionBindContext,call$1=functionCall,toObject=toObject$4,callWithSafeIterationClosing=callWithSafeIterationClosing$1,isArrayIteratorMethod=isArrayIteratorMethod$2,isConstructor=isConstructor$2,lengthOfArrayLike$1=lengthOfArrayLike$4,createProperty$1=createProperty$2,getIterator$1=getIterator$3,getIteratorMethod$1=getIteratorMethod$4,$Array$1=Array,arrayFrom$1=function(e){var t,r,o,n,s,a,i=toObject(e),l=isConstructor(this),c=arguments.length,u=1<c?arguments[1]:void 0,d=void 0!==u,c=(d&&(u=bind$2(u,2<c?arguments[2]:void 0)),getIteratorMethod$1(i)),p=0;if(!c||this===$Array$1&&isArrayIteratorMethod(c))for(t=lengthOfArrayLike$1(i),r=l?new this(t):$Array$1(t);p<t;p++)a=d?u(i[p],p):i[p],createProperty$1(r,p,a);else for(s=(n=getIterator$1(i,c)).next,r=l?new this:[];!(o=call$1(s,n)).done;p++)a=d?callWithSafeIterationClosing(n,u,[o.value,p],!0):o.value,createProperty$1(r,p,a);return r.length=p,r},toAbsoluteIndex=toAbsoluteIndex$2,lengthOfArrayLike=lengthOfArrayLike$4,createProperty=createProperty$2,$Array=Array,max=Math.max,arraySliceSimple=function(e,t,r){for(var o=lengthOfArrayLike(e),n=toAbsoluteIndex(t,o),s=toAbsoluteIndex(void 0===r?o:r,o),a=$Array(max(s-n,0)),i=0;n<s;n++,i++)createProperty(a,i,e[n]);return a.length=i,a},uncurryThis$2=functionUncurryThis,maxInt=2147483647,base=36,tMin=1,tMax=26,skew=38,damp=700,initialBias=72,initialN=128,delimiter="-",regexNonASCII=/[^\0-\u007E]/,regexSeparators=/[.\u3002\uFF0E\uFF61]/g,OVERFLOW_ERROR="Overflow: input needs wider integers to process",baseMinusTMin=base-tMin,$RangeError=RangeError,exec$1=uncurryThis$2(regexSeparators.exec),floor$2=Math.floor,fromCharCode=String.fromCharCode,charCodeAt=uncurryThis$2("".charCodeAt),join$2=uncurryThis$2([].join),push$2=uncurryThis$2([].push),replace$2=uncurryThis$2("".replace),split$2=uncurryThis$2("".split),toLowerCase$1=uncurryThis$2("".toLowerCase),ucs2decode=function(e){for(var t=[],r=0,o=e.length;r<o;){var n,s=charCodeAt(e,r++);55296<=s&&s<=56319&&r<o?56320==(64512&(n=charCodeAt(e,r++)))?push$2(t,((1023&s)<<10)+(1023&n)+65536):(push$2(t,s),r--):push$2(t,s)}return t},digitToBasic=function(e){return e+22+75*(e<26)},adapt=function(e,t,r){var o=0;for(e=r?floor$2(e/damp):e>>1,e+=floor$2(e/t);baseMinusTMin*tMax>>1<e;)e=floor$2(e/baseMinusTMin),o+=base;return floor$2(o+(baseMinusTMin+1)*e/(e+skew))},encode=function(e){var t,r=[],o=(e=ucs2decode(e)).length,n=initialN,s=0,a=initialBias;for(u=0;u<e.length;u++)(t=e[u])<128&&push$2(r,fromCharCode(t));var i=r.length,l=i;for(i&&push$2(r,delimiter);l<o;){for(var c=maxInt,u=0;u<e.length;u++)n<=(t=e[u])&&t<c&&(c=t);var d=l+1;if(c-n>floor$2((maxInt-s)/d))throw $RangeError(OVERFLOW_ERROR);for(s+=(c-n)*d,n=c,u=0;u<e.length;u++){if((t=e[u])<n&&++s>maxInt)throw $RangeError(OVERFLOW_ERROR);if(t==n){for(var p=s,$=base;;){var g=$<=a?tMin:a+tMax<=$?tMax:$-a;if(p<g)break;var f=p-g,h=base-g;push$2(r,fromCharCode(digitToBasic(g+f%h))),p=floor$2(f/h),$+=base}push$2(r,fromCharCode(digitToBasic(p))),a=adapt(s,d,l==i),s=0,l++}}s++,n++}return join$2(r,"")},stringPunycodeToAscii=function(e){for(var t,r=[],o=split$2(replace$2(toLowerCase$1(e),regexSeparators,"."),"."),n=0;n<o.length;n++)t=o[n],push$2(r,exec$1(regexNonASCII,t)?"xn--"+encode(t):t);return join$2(r,".")},defineBuiltIn$2=defineBuiltIn$a,defineBuiltIns$1=function(e,t,r){for(var o in t)defineBuiltIn$2(e,o,t[o],r);return e},arraySlice$1=arraySliceSimple,floor$1=Math.floor,mergeSort=function(e,t){var r=e.length,o=floor$1(r/2);return r<8?insertionSort(e,t):merge(e,mergeSort(arraySlice$1(e,0,o),t),mergeSort(arraySlice$1(e,o),t),t)},insertionSort=function(e,t){for(var r,o,n=e.length,s=1;s<n;){for(r=e[o=s];o&&0<t(e[o-1],r);)e[o]=e[--o];o!==s++&&(e[o]=r)}return e},merge=function(e,t,r,o){for(var n=t.length,s=r.length,a=0,i=0;a<n||i<s;)e[a+i]=a<n&&i<s?o(t[a],r[i])<=0?t[a++]:r[i++]:a<n?t[a++]:r[i++];return e},arraySort$1=mergeSort,$$2=_export,global$2=global$q,call=functionCall,uncurryThis$1=functionUncurryThis,DESCRIPTORS$1=descriptors,USE_NATIVE_URL$1=nativeUrl,defineBuiltIn$1=defineBuiltIn$a,defineBuiltIns=defineBuiltIns$1,setToStringTag$1=setToStringTag$5,createIteratorConstructor=createIteratorConstructor$2,InternalStateModule$1=internalState,anInstance$1=anInstance$3,isCallable=isCallable$m,hasOwn$1=hasOwnProperty_1,bind$1=functionBindContext,classof=classof$6,anObject=anObject$e,isObject=isObject$a,$toString$1=toString$6,create=objectCreate,createPropertyDescriptor=createPropertyDescriptor$5,getIterator=getIterator$3,getIteratorMethod=getIteratorMethod$4,validateArgumentsLength$1=validateArgumentsLength$3,wellKnownSymbol=wellKnownSymbol$i,arraySort=mergeSort,ITERATOR=wellKnownSymbol$i("iterator"),URL_SEARCH_PARAMS="URLSearchParams",URL_SEARCH_PARAMS_ITERATOR=URL_SEARCH_PARAMS+"Iterator",setInternalState$1=InternalStateModule$1.set,getInternalParamsState=InternalStateModule$1.getterFor(URL_SEARCH_PARAMS),getInternalIteratorState=InternalStateModule$1.getterFor(URL_SEARCH_PARAMS_ITERATOR),getOwnPropertyDescriptor=Object.getOwnPropertyDescriptor,safeGetBuiltIn=function(e){var t;return DESCRIPTORS$1?(t=getOwnPropertyDescriptor(global$2,e))&&t.value:global$2[e]},nativeFetch=safeGetBuiltIn("fetch"),NativeRequest=safeGetBuiltIn("Request"),Headers=safeGetBuiltIn("Headers"),RequestPrototype=NativeRequest&&NativeRequest.prototype,HeadersPrototype=Headers&&Headers.prototype,RegExp$1=global$2.RegExp,TypeError$2=global$2.TypeError,decodeURIComponent=global$2.decodeURIComponent,encodeURIComponent$1=global$2.encodeURIComponent,charAt$1=uncurryThis$1("".charAt),join$1=uncurryThis$1([].join),push$1=uncurryThis$1([].push),replace$1=uncurryThis$1("".replace),shift$1=uncurryThis$1([].shift),splice=uncurryThis$1([].splice),split$1=uncurryThis$1("".split),stringSlice$1=uncurryThis$1("".slice),plus=/\+/g,sequences=Array(4),percentSequence=function(e){return sequences[e-1]||(sequences[e-1]=RegExp$1("((?:%[\\da-f]{2}){"+e+"})","gi"))},percentDecode=function(t){try{return decodeURIComponent(t)}catch(e){return t}},deserialize=function(e){var t=replace$1(e,plus," "),r=4;try{return decodeURIComponent(t)}catch(e){for(;r;)t=replace$1(t,percentSequence(r--),percentDecode);return t}},find=/[!'()~]|%20/g,replacements={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},replacer=function(e){return replacements[e]},serialize=function(e){return replace$1(encodeURIComponent$1(e),find,replacer)},URLSearchParamsIterator=createIteratorConstructor(function(e,t){setInternalState$1(this,{type:URL_SEARCH_PARAMS_ITERATOR,iterator:getIterator(getInternalParamsState(e).entries),kind:t})},"Iterator",function(){var e=getInternalIteratorState(this),t=e.kind,e=e.iterator.next(),r=e.value;return e.done||(e.value="keys"===t?r.key:"values"===t?r.value:[r.key,r.value]),e},!0),URLSearchParamsState=function(e){this.entries=[],this.url=null,void 0!==e&&(isObject(e)?this.parseObject(e):this.parseQuery("string"==typeof e?"?"===charAt$1(e,0)?stringSlice$1(e,1):e:$toString$1(e)))},URLSearchParamsConstructor=(URLSearchParamsState.prototype={type:URL_SEARCH_PARAMS,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t,r,o,n,s,a,i=getIteratorMethod(e);if(i)for(r=(t=getIterator(e,i)).next;!(o=call(r,t)).done;){if(n=(o=getIterator(anObject(o.value))).next,(s=call(n,o)).done||(a=call(n,o)).done||!call(n,o).done)throw TypeError$2("Expected sequence with length 2");push$1(this.entries,{key:$toString$1(s.value),value:$toString$1(a.value)})}else for(var l in e)hasOwn$1(e,l)&&push$1(this.entries,{key:l,value:$toString$1(e[l])})},parseQuery:function(e){if(e)for(var t,r=split$1(e,"&"),o=0;o<r.length;)(t=r[o++]).length&&(t=split$1(t,"="),push$1(this.entries,{key:deserialize(shift$1(t)),value:deserialize(join$1(t,"="))}))},serialize:function(){for(var e,t=this.entries,r=[],o=0;o<t.length;)e=t[o++],push$1(r,serialize(e.key)+"="+serialize(e.value));return join$1(r,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}},function(){anInstance$1(this,URLSearchParamsPrototype),setInternalState$1(this,new URLSearchParamsState(0<arguments.length?arguments[0]:void 0))}),URLSearchParamsPrototype=URLSearchParamsConstructor.prototype,web_urlSearchParams_constructor=(defineBuiltIns(URLSearchParamsPrototype,{append:function(e,t){validateArgumentsLength$1(arguments.length,2);var r=getInternalParamsState(this);push$1(r.entries,{key:$toString$1(e),value:$toString$1(t)}),r.updateURL()},delete:function(e){validateArgumentsLength$1(arguments.length,1);for(var t=getInternalParamsState(this),r=t.entries,o=$toString$1(e),n=0;n<r.length;)r[n].key===o?splice(r,n,1):n++;t.updateURL()},get:function(e){validateArgumentsLength$1(arguments.length,1);for(var t=getInternalParamsState(this).entries,r=$toString$1(e),o=0;o<t.length;o++)if(t[o].key===r)return t[o].value;return null},getAll:function(e){validateArgumentsLength$1(arguments.length,1);for(var t=getInternalParamsState(this).entries,r=$toString$1(e),o=[],n=0;n<t.length;n++)t[n].key===r&&push$1(o,t[n].value);return o},has:function(e){validateArgumentsLength$1(arguments.length,1);for(var t=getInternalParamsState(this).entries,r=$toString$1(e),o=0;o<t.length;)if(t[o++].key===r)return!0;return!1},set:function(e,t){validateArgumentsLength$1(arguments.length,1);for(var r,o=getInternalParamsState(this),n=o.entries,s=!1,a=$toString$1(e),i=$toString$1(t),l=0;l<n.length;l++)(r=n[l]).key===a&&(s?splice(n,l--,1):(s=!0,r.value=i));s||push$1(n,{key:a,value:i}),o.updateURL()},sort:function(){var e=getInternalParamsState(this);arraySort(e.entries,function(e,t){return e.key>t.key?1:-1}),e.updateURL()},forEach:function(e){for(var t,r=getInternalParamsState(this).entries,o=bind$1(e,1<arguments.length?arguments[1]:void 0),n=0;n<r.length;)o((t=r[n++]).value,t.key,this)},keys:function(){return new URLSearchParamsIterator(this,"keys")},values:function(){return new URLSearchParamsIterator(this,"values")},entries:function(){return new URLSearchParamsIterator(this,"entries")}},{enumerable:!0}),defineBuiltIn$1(URLSearchParamsPrototype,ITERATOR,URLSearchParamsPrototype.entries,{name:"entries"}),defineBuiltIn$1(URLSearchParamsPrototype,"toString",function(){return getInternalParamsState(this).serialize()},{enumerable:!0}),setToStringTag$1(URLSearchParamsConstructor,URL_SEARCH_PARAMS),$$2({global:!0,constructor:!0,forced:!USE_NATIVE_URL$1},{URLSearchParams:URLSearchParamsConstructor}),!USE_NATIVE_URL$1&&isCallable(Headers)&&(headersHas=uncurryThis$1(HeadersPrototype.has),headersSet=uncurryThis$1(HeadersPrototype.set),wrapRequestOptions=function(e){if(isObject(e)){var t,r=e.body;if(classof(r)===URL_SEARCH_PARAMS)return t=e.headers?new Headers(e.headers):new Headers,headersHas(t,"content-type")||headersSet(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),create(e,{body:createPropertyDescriptor(0,$toString$1(r)),headers:createPropertyDescriptor(0,t)})}return e},isCallable(nativeFetch)&&$$2({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(e){return nativeFetch(e,1<arguments.length?wrapRequestOptions(arguments[1]):{})}}),isCallable(NativeRequest))&&((RequestPrototype.constructor=RequestConstructor=function(e){return anInstance$1(this,RequestPrototype),new NativeRequest(e,1<arguments.length?wrapRequestOptions(arguments[1]):{})}).prototype=RequestPrototype,$$2({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:RequestConstructor})),{URLSearchParams:URLSearchParamsConstructor,getState:getInternalParamsState}),$$1=_export,DESCRIPTORS=descriptors,USE_NATIVE_URL=nativeUrl,global$1=global$q,bind=functionBindContext,uncurryThis=functionUncurryThis,defineBuiltIn=defineBuiltIn$a,defineBuiltInAccessor=defineBuiltInAccessor$1,anInstance=anInstance$3,hasOwn=hasOwnProperty_1,assign=objectAssign,arrayFrom=arrayFrom$1,arraySlice=arraySliceSimple,codeAt=stringMultibyte.codeAt,toASCII=stringPunycodeToAscii,$toString=toString$6,setToStringTag=setToStringTag$5,validateArgumentsLength=validateArgumentsLength$3,URLSearchParamsModule=web_urlSearchParams_constructor,InternalStateModule=internalState,setInternalState=InternalStateModule.set,getInternalURLState=InternalStateModule.getterFor("URL"),URLSearchParams$1=URLSearchParamsModule.URLSearchParams,getInternalSearchParamsState=URLSearchParamsModule.getState,NativeURL=global$1.URL,TypeError$1=global$1.TypeError,parseInt$1=global$1.parseInt,floor=Math.floor,pow=Math.pow,charAt=uncurryThis("".charAt),exec=uncurryThis(/./.exec),join=uncurryThis([].join),numberToString=uncurryThis(1..toString),pop=uncurryThis([].pop),push=uncurryThis([].push),replace=uncurryThis("".replace),shift=uncurryThis([].shift),split=uncurryThis("".split),stringSlice=uncurryThis("".slice),toLowerCase=uncurryThis("".toLowerCase),unshift=uncurryThis([].unshift),INVALID_AUTHORITY="Invalid authority",INVALID_SCHEME="Invalid scheme",INVALID_HOST="Invalid host",INVALID_PORT="Invalid port",ALPHA=/[a-z]/i,ALPHANUMERIC=/[\d+-.a-z]/i,DIGIT=/\d/,HEX_START=/^0x/i,OCT=/^[0-7]+$/,DEC=/^\d+$/,HEX=/^[\da-f]+$/i,FORBIDDEN_HOST_CODE_POINT=/[\0\t\n\r #%/:<>?@[\\\]^|]/,FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT=/[\0\t\n\r #/:<>?@[\\\]^|]/,LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE=/^[\u0000-\u0020]+|[\u0000-\u0020]+$/g,TAB_AND_NEW_LINE=/[\t\n\r]/g,parseIPv4=function(e){var t,r,o,n,s,a,i,l=split(e,".");if(l.length&&""==l[l.length-1]&&l.length--,4<(t=l.length))return e;for(r=[],o=0;o<t;o++){if(""==(n=l[o]))return e;if(s=10,1<n.length&&"0"==charAt(n,0)&&(s=exec(HEX_START,n)?16:8,n=stringSlice(n,8==s?1:2)),""===n)a=0;else{if(!exec(10==s?DEC:8==s?OCT:HEX,n))return e;a=parseInt$1(n,s)}push(r,a)}for(o=0;o<t;o++)if(a=r[o],o==t-1){if(a>=pow(256,5-t))return null}else if(255<a)return null;for(i=pop(r),o=0;o<r.length;o++)i+=r[o]*pow(256,3-o);return i},parseIPv6=function(e){function t(){return charAt(e,p)}var r,o,n,s,a,i,l,c=[0,0,0,0,0,0,0,0],u=0,d=null,p=0;if(":"==t()){if(":"!=charAt(e,1))return;p+=2,d=++u}for(;t();){if(8==u)return;if(":"==t()){if(null!==d)return;p++,d=++u}else{for(r=o=0;o<4&&exec(HEX,t());)r=16*r+parseInt$1(t(),16),p++,o++;if("."==t()){if(0==o)return;if(p-=o,6<u)return;for(n=0;t();){if(s=null,0<n){if(!("."==t()&&n<4))return;p++}if(!exec(DIGIT,t()))return;for(;exec(DIGIT,t());){if(a=parseInt$1(t(),10),null===s)s=a;else{if(0==s)return;s=10*s+a}if(255<s)return;p++}c[u]=256*c[u]+s,2!=++n&&4!=n||u++}if(4!=n)return;break}if(":"==t()){if(p++,!t())return}else if(t())return;c[u++]=r}}if(null!==d)for(i=u-d,u=7;0!=u&&0<i;)l=c[u],c[u--]=c[d+i-1],c[d+--i]=l;else if(8!=u)return;return c},findLongestZeroSequence=function(e){for(var t=null,r=1,o=null,n=0,s=0;s<8;s++)0!==e[s]?(r<n&&(t=o,r=n),o=null,n=0):(null===o&&(o=s),++n);return r<n&&(t=o,r=n),t},serializeHost=function(e){var t,r,o,n;if("number"==typeof e){for(t=[],r=0;r<4;r++)unshift(t,e%256),e=floor(e/256);return join(t,".")}if("object"!=typeof e)return e;for(t="",o=findLongestZeroSequence(e),r=0;r<8;r++)n&&0===e[r]||(n=n&&!1,o===r?(t+=r?":":"::",n=!0):(t+=numberToString(e[r],16),r<7&&(t+=":")));return"["+t+"]"},C0ControlPercentEncodeSet={},fragmentPercentEncodeSet=assign({},C0ControlPercentEncodeSet,{" ":1,'"':1,"<":1,">":1,"`":1}),pathPercentEncodeSet=assign({},fragmentPercentEncodeSet,{"#":1,"?":1,"{":1,"}":1}),userinfoPercentEncodeSet=assign({},pathPercentEncodeSet,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),percentEncode=function(e,t){var r=codeAt(e,0);return 32<r&&r<127&&!hasOwn(t,e)?e:encodeURIComponent(e)},specialSchemes={ftp:21,file:null,http:80,https:443,ws:80,wss:443},isWindowsDriveLetter=function(e,t){return 2==e.length&&exec(ALPHA,charAt(e,0))&&(":"==(e=charAt(e,1))||!t&&"|"==e)},startsWithWindowsDriveLetter=function(e){return 1<e.length&&isWindowsDriveLetter(stringSlice(e,0,2))&&(2==e.length||"/"===(e=charAt(e,2))||"\\"===e||"?"===e||"#"===e)},isSingleDot=function(e){return"."===e||"%2e"===toLowerCase(e)},isDoubleDot=function(e){return".."===(e=toLowerCase(e))||"%2e."===e||".%2e"===e||"%2e%2e"===e},SCHEME_START={},SCHEME={},NO_SCHEME={},SPECIAL_RELATIVE_OR_AUTHORITY={},PATH_OR_AUTHORITY={},RELATIVE={},RELATIVE_SLASH={},SPECIAL_AUTHORITY_SLASHES={},SPECIAL_AUTHORITY_IGNORE_SLASHES={},AUTHORITY={},HOST={},HOSTNAME={},PORT={},FILE={},FILE_SLASH={},FILE_HOST={},PATH_START={},PATH={},CANNOT_BE_A_BASE_URL_PATH={},QUERY={},FRAGMENT={},URLState=function(e,t,r){var o,n,e=$toString(e);if(t){if(n=this.parse(e))throw TypeError$1(n);this.searchParams=null}else{if(void 0!==r&&(o=new URLState(r,!0)),n=this.parse(e,null,o))throw TypeError$1(n);(t=getInternalSearchParamsState(new URLSearchParams$1)).bindURL(this),this.searchParams=t}},URLConstructor=(URLState.prototype={type:"URL",parse:function(e,t,r){var o,n,s,a=this,i=t||SCHEME_START,l=0,c="",u=!1,d=!1,p=!1;for(e=$toString(e),t||(a.scheme="",a.username="",a.password="",a.host=null,a.port=null,a.path=[],a.query=null,a.fragment=null,a.cannotBeABaseURL=!1,e=replace(e,LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE,"")),e=replace(e,TAB_AND_NEW_LINE,""),o=arrayFrom(e);l<=o.length;){switch(n=o[l],i){case SCHEME_START:if(!n||!exec(ALPHA,n)){if(t)return INVALID_SCHEME;i=NO_SCHEME;continue}c+=toLowerCase(n),i=SCHEME;break;case SCHEME:if(n&&(exec(ALPHANUMERIC,n)||"+"==n||"-"==n||"."==n))c+=toLowerCase(n);else{if(":"!=n){if(t)return INVALID_SCHEME;c="",i=NO_SCHEME,l=0;continue}if(t&&(a.isSpecial()!=hasOwn(specialSchemes,c)||"file"==c&&(a.includesCredentials()||null!==a.port)||"file"==a.scheme&&!a.host))return;if(a.scheme=c,t)return void(a.isSpecial()&&specialSchemes[a.scheme]==a.port&&(a.port=null));c="","file"==a.scheme?i=FILE:a.isSpecial()&&r&&r.scheme==a.scheme?i=SPECIAL_RELATIVE_OR_AUTHORITY:a.isSpecial()?i=SPECIAL_AUTHORITY_SLASHES:"/"==o[l+1]?(i=PATH_OR_AUTHORITY,l++):(a.cannotBeABaseURL=!0,push(a.path,""),i=CANNOT_BE_A_BASE_URL_PATH)}break;case NO_SCHEME:if(!r||r.cannotBeABaseURL&&"#"!=n)return INVALID_SCHEME;if(r.cannotBeABaseURL&&"#"==n){a.scheme=r.scheme,a.path=arraySlice(r.path),a.query=r.query,a.fragment="",a.cannotBeABaseURL=!0,i=FRAGMENT;break}i="file"==r.scheme?FILE:RELATIVE;continue;case SPECIAL_RELATIVE_OR_AUTHORITY:if("/"!=n||"/"!=o[l+1]){i=RELATIVE;continue}i=SPECIAL_AUTHORITY_IGNORE_SLASHES,l++;break;case PATH_OR_AUTHORITY:if("/"==n){i=AUTHORITY;break}i=PATH;continue;case RELATIVE:if(a.scheme=r.scheme,n==EOF)a.username=r.username,a.password=r.password,a.host=r.host,a.port=r.port,a.path=arraySlice(r.path),a.query=r.query;else if("/"==n||"\\"==n&&a.isSpecial())i=RELATIVE_SLASH;else if("?"==n)a.username=r.username,a.password=r.password,a.host=r.host,a.port=r.port,a.path=arraySlice(r.path),a.query="",i=QUERY;else{if("#"!=n){a.username=r.username,a.password=r.password,a.host=r.host,a.port=r.port,a.path=arraySlice(r.path),a.path.length--,i=PATH;continue}a.username=r.username,a.password=r.password,a.host=r.host,a.port=r.port,a.path=arraySlice(r.path),a.query=r.query,a.fragment="",i=FRAGMENT}break;case RELATIVE_SLASH:if(!a.isSpecial()||"/"!=n&&"\\"!=n){if("/"!=n){a.username=r.username,a.password=r.password,a.host=r.host,a.port=r.port,i=PATH;continue}i=AUTHORITY}else i=SPECIAL_AUTHORITY_IGNORE_SLASHES;break;case SPECIAL_AUTHORITY_SLASHES:if(i=SPECIAL_AUTHORITY_IGNORE_SLASHES,"/"!=n||"/"!=charAt(c,l+1))continue;l++;break;case SPECIAL_AUTHORITY_IGNORE_SLASHES:if("/"==n||"\\"==n)break;i=AUTHORITY;continue;case AUTHORITY:if("@"==n){u&&(c="%40"+c);for(var u=!0,$=arrayFrom(c),g=0;g<$.length;g++){var f=$[g];":"!=f||p?(f=percentEncode(f,userinfoPercentEncodeSet),p?a.password+=f:a.username+=f):p=!0}c=""}else if(n==EOF||"/"==n||"?"==n||"#"==n||"\\"==n&&a.isSpecial()){if(u&&""==c)return INVALID_AUTHORITY;l-=arrayFrom(c).length+1,c="",i=HOST}else c+=n;break;case HOST:case HOSTNAME:if(t&&"file"==a.scheme){i=FILE_HOST;continue}if(":"!=n||d){if(n==EOF||"/"==n||"?"==n||"#"==n||"\\"==n&&a.isSpecial()){if(a.isSpecial()&&""==c)return INVALID_HOST;if(t&&""==c&&(a.includesCredentials()||null!==a.port))return;if(s=a.parseHost(c))return s;if(c="",i=PATH_START,t)return;continue}"["==n?d=!0:"]"==n&&(d=!1),c+=n}else{if(""==c)return INVALID_HOST;if(s=a.parseHost(c))return s;if(c="",i=PORT,t==HOSTNAME)return}break;case PORT:if(!exec(DIGIT,n)){if(n==EOF||"/"==n||"?"==n||"#"==n||"\\"==n&&a.isSpecial()||t){if(""!=c){var h=parseInt$1(c,10);if(65535<h)return INVALID_PORT;a.port=a.isSpecial()&&h===specialSchemes[a.scheme]?null:h,c=""}if(t)return;i=PATH_START;continue}return INVALID_PORT}c+=n;break;case FILE:if(a.scheme="file","/"==n||"\\"==n)i=FILE_SLASH;else{if(!r||"file"!=r.scheme){i=PATH;continue}if(n==EOF)a.host=r.host,a.path=arraySlice(r.path),a.query=r.query;else if("?"==n)a.host=r.host,a.path=arraySlice(r.path),a.query="",i=QUERY;else{if("#"!=n){startsWithWindowsDriveLetter(join(arraySlice(o,l),""))||(a.host=r.host,a.path=arraySlice(r.path),a.shortenPath()),i=PATH;continue}a.host=r.host,a.path=arraySlice(r.path),a.query=r.query,a.fragment="",i=FRAGMENT}}break;case FILE_SLASH:if("/"==n||"\\"==n){i=FILE_HOST;break}r&&"file"==r.scheme&&!startsWithWindowsDriveLetter(join(arraySlice(o,l),""))&&(isWindowsDriveLetter(r.path[0],!0)?push(a.path,r.path[0]):a.host=r.host),i=PATH;continue;case FILE_HOST:if(n==EOF||"/"==n||"\\"==n||"?"==n||"#"==n){if(!t&&isWindowsDriveLetter(c))i=PATH;else{if(""==c){if(a.host="",t)return}else{if(s=a.parseHost(c))return s;if("localhost"==a.host&&(a.host=""),t)return;c=""}i=PATH_START}continue}c+=n;break;case PATH_START:if(a.isSpecial()){if(i=PATH,"/"!=n&&"\\"!=n)continue}else if(t||"?"!=n)if(t||"#"!=n){if(n!=EOF&&(i=PATH,"/"!=n))continue}else a.fragment="",i=FRAGMENT;else a.query="",i=QUERY;break;case PATH:if(n==EOF||"/"==n||"\\"==n&&a.isSpecial()||!t&&("?"==n||"#"==n)){if(isDoubleDot(c)?(a.shortenPath(),"/"==n||"\\"==n&&a.isSpecial()||push(a.path,"")):isSingleDot(c)?"/"==n||"\\"==n&&a.isSpecial()||push(a.path,""):("file"==a.scheme&&!a.path.length&&isWindowsDriveLetter(c)&&(a.host&&(a.host=""),c=charAt(c,0)+":"),push(a.path,c)),c="","file"==a.scheme&&(n==EOF||"?"==n||"#"==n))for(;1<a.path.length&&""===a.path[0];)shift(a.path);"?"==n?(a.query="",i=QUERY):"#"==n&&(a.fragment="",i=FRAGMENT)}else c+=percentEncode(n,pathPercentEncodeSet);break;case CANNOT_BE_A_BASE_URL_PATH:"?"==n?(a.query="",i=QUERY):"#"==n?(a.fragment="",i=FRAGMENT):n!=EOF&&(a.path[0]+=percentEncode(n,C0ControlPercentEncodeSet));break;case QUERY:t||"#"!=n?n!=EOF&&("'"==n&&a.isSpecial()?a.query+="%27":a.query+="#"==n?"%23":percentEncode(n,C0ControlPercentEncodeSet)):(a.fragment="",i=FRAGMENT);break;case FRAGMENT:n!=EOF&&(a.fragment+=percentEncode(n,fragmentPercentEncodeSet))}l++}},parseHost:function(e){var t,r,o;if("["==charAt(e,0))return"]"==charAt(e,e.length-1)&&(t=parseIPv6(stringSlice(e,1,-1)))?void(this.host=t):INVALID_HOST;if(this.isSpecial())return e=toASCII(e),exec(FORBIDDEN_HOST_CODE_POINT,e)||null===(t=parseIPv4(e))?INVALID_HOST:void(this.host=t);if(exec(FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT,e))return INVALID_HOST;for(t="",r=arrayFrom(e),o=0;o<r.length;o++)t+=percentEncode(r[o],C0ControlPercentEncodeSet);this.host=t},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"==this.scheme},includesCredentials:function(){return""!=this.username||""!=this.password},isSpecial:function(){return hasOwn(specialSchemes,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;!t||"file"==this.scheme&&1==t&&isWindowsDriveLetter(e[0],!0)||e.length--},serialize:function(){var e=this,t=e.scheme,r=e.username,o=e.password,n=e.host,s=e.port,a=e.path,i=e.query,l=e.fragment,c=t+":";return null!==n?(c+="//",e.includesCredentials()&&(c+=r+(o?":"+o:"")+"@"),c+=serializeHost(n),null!==s&&(c+=":"+s)):"file"==t&&(c+="//"),c+=e.cannotBeABaseURL?a[0]:a.length?"/"+join(a,"/"):"",null!==i&&(c+="?"+i),null!==l&&(c+="#"+l),c},setHref:function(e){e=this.parse(e);if(e)throw TypeError$1(e);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if("blob"==e)try{return new URLConstructor(e.path[0]).origin}catch(e){return"null"}return"file"!=e&&this.isSpecial()?e+"://"+serializeHost(this.host)+(null!==t?":"+t:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse($toString(e)+":",SCHEME_START)},getUsername:function(){return this.username},setUsername:function(e){var t=arrayFrom($toString(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var r=0;r<t.length;r++)this.username+=percentEncode(t[r],userinfoPercentEncodeSet)}},getPassword:function(){return this.password},setPassword:function(e){var t=arrayFrom($toString(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var r=0;r<t.length;r++)this.password+=percentEncode(t[r],userinfoPercentEncodeSet)}},getHost:function(){var e=this.host,t=this.port;return null===e?"":null===t?serializeHost(e):serializeHost(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,HOST)},getHostname:function(){var e=this.host;return null===e?"":serializeHost(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,HOSTNAME)},getPort:function(){var e=this.port;return null===e?"":$toString(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(""==(e=$toString(e))?this.port=null:this.parse(e,PORT))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+join(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,PATH_START))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){""==(e=$toString(e))?this.query=null:("?"==charAt(e,0)&&(e=stringSlice(e,1)),this.query="",this.parse(e,QUERY)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){""==(e=$toString(e))?this.fragment=null:("#"==charAt(e,0)&&(e=stringSlice(e,1)),this.fragment="",this.parse(e,FRAGMENT))},update:function(){this.query=this.searchParams.serialize()||null}},function(e){var t=anInstance(this,URLPrototype),r=1<validateArgumentsLength(arguments.length,1)?arguments[1]:void 0,r=setInternalState(t,new URLState(e,!1,r));DESCRIPTORS||(t.href=r.serialize(),t.origin=r.getOrigin(),t.protocol=r.getProtocol(),t.username=r.getUsername(),t.password=r.getPassword(),t.host=r.getHost(),t.hostname=r.getHostname(),t.port=r.getPort(),t.pathname=r.getPathname(),t.search=r.getSearch(),t.searchParams=r.getSearchParams(),t.hash=r.getHash())}),URLPrototype=URLConstructor.prototype,accessorDescriptor=function(e,t){return{get:function(){return getInternalURLState(this)[e]()},set:t&&function(e){return getInternalURLState(this)[t](e)},configurable:!0,enumerable:!0}},$=(DESCRIPTORS&&(defineBuiltInAccessor(URLPrototype,"href",accessorDescriptor("serialize","setHref")),defineBuiltInAccessor(URLPrototype,"origin",accessorDescriptor("getOrigin")),defineBuiltInAccessor(URLPrototype,"protocol",accessorDescriptor("getProtocol","setProtocol")),defineBuiltInAccessor(URLPrototype,"username",accessorDescriptor("getUsername","setUsername")),defineBuiltInAccessor(URLPrototype,"password",accessorDescriptor("getPassword","setPassword")),defineBuiltInAccessor(URLPrototype,"host",accessorDescriptor("getHost","setHost")),defineBuiltInAccessor(URLPrototype,"hostname",accessorDescriptor("getHostname","setHostname")),defineBuiltInAccessor(URLPrototype,"port",accessorDescriptor("getPort","setPort")),defineBuiltInAccessor(URLPrototype,"pathname",accessorDescriptor("getPathname","setPathname")),defineBuiltInAccessor(URLPrototype,"search",accessorDescriptor("getSearch","setSearch")),defineBuiltInAccessor(URLPrototype,"searchParams",accessorDescriptor("getSearchParams")),defineBuiltInAccessor(URLPrototype,"hash",accessorDescriptor("getHash","setHash"))),defineBuiltIn(URLPrototype,"toJSON",function(){return getInternalURLState(this).serialize()},{enumerable:!0}),defineBuiltIn(URLPrototype,"toString",function(){return getInternalURLState(this).serialize()},{enumerable:!0}),NativeURL&&(nativeCreateObjectURL=NativeURL.createObjectURL,nativeRevokeObjectURL=NativeURL.revokeObjectURL,nativeCreateObjectURL&&defineBuiltIn(URLConstructor,"createObjectURL",bind(nativeCreateObjectURL,NativeURL)),nativeRevokeObjectURL)&&defineBuiltIn(URLConstructor,"revokeObjectURL",bind(nativeRevokeObjectURL,NativeURL)),setToStringTag(URLConstructor,"URL"),$$1({global:!0,constructor:!0,forced:!USE_NATIVE_URL,sham:!DESCRIPTORS},{URL:URLConstructor}),_export),$includes=arrayIncludes.includes,fails=fails$l,addToUnscopables=addToUnscopables$2,BROKEN_ON_SPARSE=fails$l(function(){return!Array(1).includes()});$({target:"Array",proto:!0,forced:BROKEN_ON_SPARSE},{includes:function(e){return $includes(this,e,1<arguments.length?arguments[1]:void 0)}}),addToUnscopables("includes");const useStyles$1=makeStyles()(e=>({inputContainer:{position:"relative"},fileInput:{position:"absolute",height:1,width:1,overflow:"hidden",clip:"rect(1px, 1px, 1px, 1px)"},imageWrapper:{position:"relative",alignItems:"center",borderRadius:4,border:"1px solid #ccc",boxSizing:"border-box",cursor:"pointer",display:"flex",width:150,height:150,justifyContent:"center",overflow:"hidden"},inputLogo:{position:"relative",height:150,width:150,objectFit:"contain"},removeBtn:{backgroundColor:"rgba(255, 255, 255, .7)",color:"#000",borderRadius:"25px",padding:8,position:"absolute",right:4,top:110}})),ImageInput=({logoUrl:e,onChange:r,canEdit:t})=>{const o=useSelector(selectNewAvatar);var n=useStyles$1()["classes"];const s=react.exports.useRef(null),[a,i]=react.exports.useState(e),[l,c]=react.exports.useState(!1),u=useDispatch();react.exports.useEffect(()=>{var e;o&&(e=URL.createObjectURL(o),i(e))},[o]);return jsxRuntime.exports.jsxs("div",Object.assign({className:n.inputContainer},{children:[jsxRuntime.exports.jsx("input",{ref:s,disabled:!t,id:"logo-input",name:"logo-input",type:"file",accept:"image/jpeg, image/png",onChange:e=>{var t,e=lodash.exports.get(e,"target.files[0]",null);null!==s.current&&(s.current.value=""),(e=>{e=e.type;return["image/jpeg","image/png"].includes(e)})(e)?(t=URL.createObjectURL(e),u(actions$1.setNewAvatar(e)),c(!1),i(t),r()):c(!0)},className:n.fileInput,"aria-label":"Upload Logo"}),jsxRuntime.exports.jsx("div",Object.assign({className:n.imageWrapper,role:"button"},{children:a?jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment,{children:[jsxRuntime.exports.jsx("img",{"data-test":"processing-center-source-image-loaded",src:a,alt:"logo",className:n.inputLogo}),jsxRuntime.exports.jsx(Icon,{"data-test":"processing-center-source-remove-image","aria-label":"Remove Image",fontSize:"large",className:n.removeBtn,onClick:()=>t?(a&&URL.revokeObjectURL(a),i(null),u(actions$1.setNewAvatar(null)),void r()):null,component:default_1})]}):jsxRuntime.exports.jsx(Icon,{onClick:()=>{null!==s.current&&s.current.click()},"data-test":"processing-center-source-upload-icon",fontSize:"large",component:Upload})})),jsxRuntime.exports.jsx(FormHelperText$2,Object.assign({"data-test":"processing-center-sourcelogo-upload-error",error:l},{children:l?SHARED_TEXT$1.imageFileTypeErrorMessage():""}))]}))},SourceConfiguration=({source:e,sourceDetails:t,sourceName:r,sourceDescription:o,selectedType:n,isFormDirty:s,isSourceNameValid:a,isSourceTypeValid:i,sourceTypeFields:l,canEdit:c,onSelectedTypeChanged:u,onHasImageChanged:d,onSourceNameChanged:p,onSourceDescriptionChanged:$,onDynamicTextChange:g,onDynamicSelectChange:f})=>{const h=useDispatch(),m=useSelector(selectSourceTypes);var y=useSelector(selectSourceTypesConfig),S=useStyles$2()["classes"];react.exports.useEffect(()=>{h(actions$1.getSourceTypes({sourceTypes:[""]}))},[]);return jsxRuntime.exports.jsxs("div",Object.assign({className:S.sectionContainer},{children:[jsxRuntime.exports.jsx("section",{children:jsxRuntime.exports.jsxs("div",Object.assign({className:S.mainContent},{children:[jsxRuntime.exports.jsxs("div",Object.assign({className:S.sourceInfoContainer},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h5",className:S.title},{children:SHARED_TEXT$1.basicInformationTitle()})),jsxRuntime.exports.jsx(Typography,Object.assign({variant:"caption",className:S.subtitle},{children:SHARED_TEXT$1.basicInformationSubtitle()})),jsxRuntime.exports.jsxs("div",Object.assign({className:S.sourceInputsContainer},{children:[jsxRuntime.exports.jsx(FormControl,Object.assign({sx:{width:"100%"},className:S.formControlWrapper,error:!0},{children:jsxRuntime.exports.jsx(TextField,{error:s&&!a,type:"text",id:"source-name",variant:"outlined",className:S.sourceInput,value:r,label:SHARED_TEXT$1.sourceNameTextFieldLabel(),InputLabelProps:{shrink:!0},onChange:e=>p(e.target.value),helperText:s&&!a?SHARED_TEXT$1.sourceNameError():"",required:!0,disabled:!c})})),jsxRuntime.exports.jsx(FormControl,Object.assign({sx:{width:"100%"},className:S.formControlWrapper},{children:jsxRuntime.exports.jsx(TextField,{className:S.sourceInput,value:o,variant:"outlined",label:SHARED_TEXT$1.sourceDescriptionTextFieldLabel(),onChange:e=>$(e.target.value),disabled:!c,multiline:!0,rows:4})}))]}))]})),jsxRuntime.exports.jsxs("div",Object.assign({className:S.avatarContainer},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h5",className:S.title},{children:SHARED_TEXT$1.sourceAvatarTitle()})),jsxRuntime.exports.jsx(Typography,Object.assign({variant:"caption",className:S.subtitle},{children:SHARED_TEXT$1.sourceAvatarSubtitle()})),jsxRuntime.exports.jsx(ImageInput,{canEdit:c,logoUrl:null!=e&&e.thumbnailUrl?null==e?void 0:e.thumbnailUrl:null,onChange:()=>d(!0)})]}))]}))}),jsxRuntime.exports.jsx(Divider,{style:{marginTop:"30px",marginBottom:"30px"}}),jsxRuntime.exports.jsxs("div",Object.assign({className:S.sourceInfoContainer},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h5",className:S.title},{children:SHARED_TEXT$1.configurationInformationTitle()})),jsxRuntime.exports.jsx(Typography,Object.assign({variant:"caption",className:S.subtitle},{children:SHARED_TEXT$1.configurationInformationSubtitle()}))]})),jsxRuntime.exports.jsxs("section",{children:[jsxRuntime.exports.jsxs(FormControl,Object.assign({sx:{width:"100%"},className:S.formControlWrapper},{children:[jsxRuntime.exports.jsx(InputLabel,Object.assign({error:s&&!i,required:!0,shrink:!0,id:"Source-Type-Select"},{children:SHARED_TEXT$1.sourceTypeFieldLabel()})),jsxRuntime.exports.jsx(Select,Object.assign({error:s&&!i,notched:!0,size:"small",id:"source-type-selector",labelId:"Source-Type-Select",required:!0,label:SHARED_TEXT$1.sourceTypeFieldLabel(),variant:"outlined",sx:{width:"100%"},value:n,disabled:!((null==e||!e.id)&&c),onChange:e=>{u(e.target.value)}},{children:Object.keys(m).map(e=>{var t;return jsxRuntime.exports.jsx(MenuItem,Object.assign({value:e},{children:null==(t=m[e])?void 0:t.name}),e)})})),s&&!i&&jsxRuntime.exports.jsx(FormHelperText$2,Object.assign({error:s&&!i},{children:SHARED_TEXT$1.sourceTypeError()}))]})),jsxRuntime.exports.jsx(DynamicLoader,{isFormDirty:s,sourceDetails:t,sourceTypesConfig:y,sourceTypeFields:l,canEdit:c,onSelectChange:f,onChange:g})]})]}))},SourceDetail=({hidePanel:e,sourceId:r})=>{const o=useStyles$6()["classes"],n=useDispatch();var t=useSelector(selectFetchSourceStatus);const s=useSelector(selectSource),a=useSelector(selectUpdateSourceStatus),i=useSelector(selectSourceTypesConfig),l=useSelector(selectCreateSourceStatus),[L,M]=react.exports.useState(!1),[c,u]=react.exports.useState((null===s||void 0===s?void 0:s.name)||""),[d,p]=react.exports.useState((null==(_=null===s||void 0===s?void 0:s.details)?void 0:_.sourceDescription)||""),[$,g]=react.exports.useState((null===s||void 0===s?void 0:s.details)||{}),[U,B]=react.exports.useState(!1),[f,h]=react.exports.useState(!1),[F,k]=react.exports.useState(!0),[H,G]=react.exports.useState(!0),[m,y]=react.exports.useState(""),[S,b]=react.exports.useState(!0),q=useSelector(selectNewAvatar),[K,V]=react.exports.useState(!1),[x,R]=react.exports.useState({}),[T,E]=react.exports.useState(0),[O,I]=react.exports.useState(!0),[j,C]=react.exports.useState(0),W=useSelector(selectIsOLPEnabled),v=useSelector(userSelector),Y=useSelector(selectSourceContentTemplates)||[],[X,P]=react.exports.useState([]),A=useSelector(selectContentTemplatesToSave),[z,J]=react.exports.useState(null);var _=Boolean(z);const w=react.exports.useCallback(()=>{n(hidePanel("PROCESSING_CENTER_SOURCES"))},[n]);var N=react.exports.useCallback(()=>{e&&e()},[e]);react.exports.useEffect(()=>{r||y("1")},[]),react.exports.useEffect(()=>{var e=(null==(e=i[m])?void 0:e.fields)||{},e=Q(e);if(!r){const t={};e.map(e=>{t[e.id]=null}),g(t)}e=i[m];R(null==e?void 0:e.fields),s?"viewer"!==s.permission&&!W&&(v&&v.myRights&&0<=v.myRights.indexOf("cms.media.update")||v&&v.myRights&&0<=v.myRights.indexOf("recording.update")||v&&v.myRights&&0<=v.myRights.indexOf("source.update"))?b(!0):b(!1):W||v&&v.myRights&&0<=v.myRights.indexOf("cms.media.create")||v&&v.myRights&&0<=v.myRights.indexOf("recording.create")?b(!0):b(!1)},[m,s,i,n]),react.exports.useEffect(()=>{1===T&&M(!0)},[T]),react.exports.useEffect(()=>{var e;s&&(g(s.details),u((null===s||void 0===s?void 0:s.name)||""),p((null==(e=null===s||void 0===s?void 0:s.details)?void 0:e.sourceDescription)||""),P(null===s||void 0===s?void 0:s.contentTemplates),y((null==(e=null===s||void 0===s?void 0:s.sourceType)?void 0:e.id)||""))},[s]),react.exports.useEffect(()=>{!f||"success"!==a&&"success"!==l||(h(!1),w())},[w,l,f,a]),react.exports.useEffect(()=>{var e=[],t=[],r=[];if(0<Object.entries(A).length){for(const a in A){e.push(A[a].errors),t.push(A[a].submitted);var o={schemaId:A[a].schemaId,data:A[a].data};r.push(o)}var n=e.indexOf(!0),s=t.indexOf(!1);0<=n||0<=s?I(!1):I(!0),P(r)}0===Object.entries(A).length&&(P([]),I(!0))},[A,L]);const Q=t=>Object.keys(t).filter(e=>!0===t[e].isRequired||t[e].pattern).map(e=>Object.assign({},t[e]));if("pending"===t)return jsxRuntime.exports.jsxs("div",Object.assign({role:"presentation","data-test":"processing-center-sources-widget",className:o.sourceContainer},{children:[jsxRuntime.exports.jsx(Header,{sourceId:r,onPanelClose:N}),jsxRuntime.exports.jsx(Box,Object.assign({sx:{display:"flex",width:"100%",height:"400px",alignItems:"center",justifyContent:"center"}},{children:jsxRuntime.exports.jsx(CircularProgress,{})}))]}));if("failure"===t)return jsxRuntime.exports.jsxs("div",Object.assign({role:"presentation","data-test":"processing-center-sources-widget",className:o.sourceContainer},{children:[jsxRuntime.exports.jsx(Header,{sourceId:r,onPanelClose:N}),jsxRuntime.exports.jsxs("div",Object.assign({className:o.emptyStateContainer,"data-test":"empty-state-container"},{children:[jsxRuntime.exports.jsx("img",{"data-test":"empty-state-image",alt:"Empty Source",className:o.emptyImage,src:img$u}),jsxRuntime.exports.jsx(Typography,Object.assign({"data-test":"empty-state-title",className:o.message,variant:"h2",color:"textPrimary"},{children:SHARED_TEXT$1.sourceDetailsErrorMessage()})),jsxRuntime.exports.jsx(Button,Object.assign({variant:"contained",onClick:function(){r&&n(actions.sourceConfiguration.fetchSourceStart(r))}},{children:SHARED_TEXT$1.sourceDetailsRetryButton()}))]}))]}));const Z=()=>jsxRuntime.exports.jsx(SourceConfiguration,{source:s,sourceDetails:$,selectedType:m,sourceName:c,sourceDescription:d,isSourceNameValid:F,isSourceTypeValid:H,sourceTypeFields:x,canEdit:S,isFormDirty:U,onSelectedTypeChanged:y,onHasImageChanged:V,onSourceNameChanged:u,onSourceDescriptionChanged:p,onDynamicTextChange:ne,onDynamicSelectChange:oe}),ee=()=>jsxRuntime.exports.jsx(ContentTemplates,{existingTemplates:Y});t=[SHARED_TEXT$1.configurationLabel(),SHARED_TEXT$1.contentTemplateLabel()];return jsxRuntime.exports.jsxs("div",Object.assign({role:"presentation","data-test":"processing-center-sources-widget",className:o.sourceContainer},{children:[jsxRuntime.exports.jsx(Header,{sourceId:r,onPanelClose:N}),!r&&jsxRuntime.exports.jsx(Divider,{style:{marginBottom:"15px"}}),jsxRuntime.exports.jsxs(Box,Object.assign({sx:{width:"100%"}},{children:[r?jsxRuntime.exports.jsx(Box,Object.assign({sx:{paddingLeft:"15px",borderBottom:.5,borderColor:"#D5DFE9"},className:o.tabContainer},{children:jsxRuntime.exports.jsxs(Tabs,Object.assign({textColor:"primary",indicatorColor:"secondary",value:T,onChange:function(e,t){0===T&&D()&&E(t);0!==T&&E(t)},"aria-label":"Source Tabs"},{children:[jsxRuntime.exports.jsx(Tab,Object.assign({"data-test":"processing-center-source-configuration-tab",label:SHARED_TEXT$1.configurationLabel()},se(0))),jsxRuntime.exports.jsx(Tab,Object.assign({disabled:!S,"data-test":"processing-center-source-content-templates-tab",label:SHARED_TEXT$1.contentTemplateLabel()},se(1)))]}))})):jsxRuntime.exports.jsx(Stepper,Object.assign({className:o.stepper,activeStep:j},{children:t.map((e,t)=>{return jsxRuntime.exports.jsx(Step,Object.assign({className:o.step},{},{children:jsxRuntime.exports.jsx(StepLabel,Object.assign({},{},{children:e}))}),t)})})),jsxRuntime.exports.jsx(Divider,{}),r?jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment,{children:[jsxRuntime.exports.jsx(TabPanel,Object.assign({value:T,index:0},{children:Z()})),jsxRuntime.exports.jsx(TabPanel,Object.assign({value:T,index:1},{children:ee()}))]}):jsxRuntime.exports.jsx("div",Object.assign({className:o.sourcePanelContainer},{children:function(e){switch(e){case 0:return Z();case 1:return ee();default:return}}(j)}))]})),jsxRuntime.exports.jsx("footer",Object.assign({className:o.sourceDetailFooter},{children:r?jsxRuntime.exports.jsxs("div",Object.assign({className:o.sourceDetailButtonsContainer},{children:[jsxRuntime.exports.jsx(Button,Object.assign({"data-test":"processing-center-source-detail-cancel-button",variant:"text",size:"large",sx:{marginRight:"10px"},onClick:()=>w()},{children:SHARED_TEXT$1.sourceCancelButton()})),jsxRuntime.exports.jsx("div",Object.assign({"aria-owns":_?"mouse-over-popover":void 0,"aria-haspopup":"true",onMouseEnter:function(e){J(e.currentTarget)},onMouseLeave:te},{children:jsxRuntime.exports.jsx(Button,Object.assign({disabled:!O||!S,variant:"contained",size:"large",onClick:re,className:o.saveButtonEnabled,"data-test":"processing-center-source-detail-save-button"},{children:SHARED_TEXT$1.sourceSaveButton()}))})),!O&&jsxRuntime.exports.jsxs(Popover,Object.assign({id:"mouse-over-popover",sx:{pointerEvents:"none"},open:_,anchorEl:z,anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"bottom",horizontal:"right"},onClose:te,disableRestoreFocus:!0},{children:[" ",jsxRuntime.exports.jsx(Typography,Object.assign({variant:"body1",sx:{p:2,width:"300px",backgroundColor:"#2A323C",color:"#fff"}},{children:SHARED_TEXT$1.sourceDisabledSaveButton()}))]}))]})):jsxRuntime.exports.jsxs("div",Object.assign({className:o.sourceDetailButtonsContainer},{children:[0===j?jsxRuntime.exports.jsx(Button,Object.assign({"data-test":"processing-center-source-detail-cancel-button",variant:"text",size:"large",sx:{marginRight:"10px"},onClick:()=>w(),className:o.button},{children:SHARED_TEXT$1.sourceCancelButton()})):jsxRuntime.exports.jsx(Button,Object.assign({variant:"text",size:"large","data-test":"processing-center-sources-steps-btn-back",onClick:()=>{C(e=>e-1)},className:o.button},{children:SHARED_TEXT$1.sourceBackButton()})),j===t.length-1?jsxRuntime.exports.jsx(Button,Object.assign({disabled:!O,variant:"contained",size:"large",onClick:re,className:o.button&&o.saveButtonEnabled,"data-test":"processing-center-sources-steps-btn-create"},{children:SHARED_TEXT$1.sourceSaveButton()})):jsxRuntime.exports.jsx(Button,Object.assign({variant:"contained",disabled:!S,size:"large",onClick:()=>{0===j&&D()&&C(e=>e+1)},className:o.button&&o.saveButtonEnabled,"data-test":"processing-center-sources-steps-btn-next"},{children:SHARED_TEXT$1.sourceNextButton()}))]}))}))]}));function te(){J(null)}function D(){var e=(null==(e=i[m])?void 0:e.fields)||{},e=(B(!0),Q(e)),{isFormValid:e,validatedFields:t}=validateFields(e,$),r=!!c&&""!==c,o=!!m&&""!==m,r=(G(o),k(r),r&&o&&e);return r||updateFields(x,t,R),r}function re(){D()&&(h(!0),setTimeout(()=>{var e,t={name:c,details:Object.assign(Object.assign({},$),{sourceDescription:d}),contentTemplates:X,hasImageChanged:K,newImage:q};s?(e=Object.assign(Object.assign({},s),t),n(actions$1.updateSourceStart(e))):(e=Object.assign(Object.assign({},t),{sourceTypeId:m}),n(actions$1.createSourceStart(e)))},1e3))}function oe(e,t){if(t){t=null==e?void 0:e.fieldValue;const r=new Set;[...t].forEach(e=>{r.add(e)});t=Object.assign(Object.assign({},$),{[null==e?void 0:e.fieldName]:Array.from(r)});g(t)}else{t=null==e?void 0:e.fieldValue,e=Object.assign(Object.assign({},$),{[null==e?void 0:e.fieldName]:t.join("")});g(e)}}function ne(e){g(Object.assign(Object.assign({},$),{[null==e?void 0:e.fieldName]:null==e?void 0:e.fieldValue}))}function se(e){return{id:"source-tab-"+e,"aria-controls":"source-tabpanel-"+e}}},TabPanel=e=>{var{children:t,value:r,index:o}=e,e=__rest(e,["children","value","index"]),n=useStyles$6()["classes"];return jsxRuntime.exports.jsx("div",Object.assign({className:n.tabPanelContainer,role:"tabpanel",hidden:r!==o,id:"source-tabpanel-"+o,"aria-labelledby":"source-tab-"+o},e,{children:r===o&&t}))},ProcessingCenterSources=e=>{const t=e["sourceId"],r=useDispatch();return react.exports.useEffect(()=>{t&&(r(actions.sourceConfiguration.fetchSourceStart(t)),r(actions.sourceConfiguration.checkCanBeDeletedStart(t)))},[r,t]),jsxRuntime.exports.jsx(AIWareCacheProvider,{children:jsxRuntime.exports.jsx(AIWareThemeProvider,{children:jsxRuntime.exports.jsx(DynamicModuleLoader,Object.assign({modules:[getProcessingCenterSourcesModule(),getProcessingCenterContentTemplatesModule()]},{children:jsxRuntime.exports.jsx(AIWareIntlProvider,{children:jsxRuntime.exports.jsx(SourceDetail,Object.assign({},e))})}))})})},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 SHARED_TEXT={header:{title:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"pc-error-details-panel.header.title",defaultMessage:"Error Details",description:"Error detail panel header label"}),subTitle:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"pc-error-details-panel.header.subtitle",defaultMessage:"View additional details on the errored task and take available actions.",description:"Error detail panel sub header"}),download:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"pc-error-details-panel.header.download",defaultMessage:"Download Error Output JSON",description:"Error detail panel download label"}),closePanel:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"pc-error-details-panel.header.close",defaultMessage:"Close Panel",description:"Error detail panel close panel label"})},container:{taskId:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"pc-error-details-panel.container.taskId",defaultMessage:"Task ID",description:"Error detail panel container data label Task ID"}),errorType:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"pc-error-details-panel.container.errorType",defaultMessage:"Error Type",description:"Error detail panel container data label Error Type"}),errorTime:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"pc-error-details-panel.container.errorTime",defaultMessage:"Error Time",description:"Error detail panel container data label Error Time"}),errorReason:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"pc-error-details-panel.container.errorReason",defaultMessage:"Error Reason",description:"Error detail panel container data label Error Reason"}),tooltipCopy:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"pc-error-details-panel.container.tooltipCopy",defaultMessage:"Copy Task ID",description:"Error detail panel container data tooltip Copy Task ID"}),tooltipCopied:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"pc-error-details-panel.container.tooltipCopied",defaultMessage:"Copied Task ID!",description:"Error detail panel container data tooltip Copied Task ID"}),unknown:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"pc-error-details-panel.container.value-unknown",defaultMessage:"Unknown",description:"Error detail panel container data unknown"})},footer:{retryJob:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"pc-error-details-panel.footer.retryButton",defaultMessage:"Retry Job",description:"Error detail panel footer button Retry Job"}),close:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"pc-error-details-panel.footer.closeButton",defaultMessage:"Close",description:"Error detail panel footer button Close"})}},PanelHeader=({height:e,onPanelClose:t,onDownload:r,isRetrying:o})=>{e=makeStyles()((e,{height:t})=>({header:{alignItems:"center",display:"flex",justifyContent:"space-between",height:t,padding:e.spacing(2,2,2,6)},headerNoBorder:{alignItems:"center",borderBottom:"0.5px solid transparent",display:"flex",justifyContent:"space-between",height:t,padding:e.spacing(0,0,0,6)},marginRight:{marginRight:e.spacing(2)},navigationToggle:{marginRight:e.spacing(1)},headerActionContainer:{alignItems:"center",display:"flex",flexGrow:1,height:"100%",justifyContent:"flex-end",gap:"10px"},verticalDivider:{borderRight:".5px solid "+e.palette.divider,height:"70%",margin:"0 "+e.spacing(1)},title:{userSelect:"none",fontStyle:"normal",fontSize:"18px",lineHeight:e.spacing(5),letterSpacing:"0.25px",textTransform:"uppercase",color:e.palette.text.secondary},subtitle:{padding:e.spacing(0,0,0,6)}}))({height:e}).classes;return jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment,{children:[jsxRuntime.exports.jsxs("header",Object.assign({className:e.header,"data-testid":"dc-source-creation-iframe-header"},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h1","data-testid":"pc-error-details-panel-header",className:e.title},{children:SHARED_TEXT.header.title()})),jsxRuntime.exports.jsxs("div",Object.assign({className:e.headerActionContainer},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({style:visuallyHidden$1,id:"dc-source-creation-iframe-close-panel"},{children:SHARED_TEXT.header.download()})),jsxRuntime.exports.jsx(Tooltip,Object.assign({title:SHARED_TEXT.header.download()},{children:jsxRuntime.exports.jsx(IconButton,Object.assign({onClick:r,"aria-labelledby":"pc-error-details-panel.download","data-testid":"pc-error-details-panel.download.icon",size:"large",disabled:o},{children:jsxRuntime.exports.jsx(Download,{})}))})),jsxRuntime.exports.jsx(Typography,Object.assign({style:visuallyHidden$1,id:"dc-source-creation-iframe-close-panel"},{children:SHARED_TEXT.header.closePanel()})),jsxRuntime.exports.jsx(Tooltip,Object.assign({title:SHARED_TEXT.header.closePanel()},{children:jsxRuntime.exports.jsx(IconButton,Object.assign({onClick:t,"aria-labelledby":"pc-error-details-panel.close","data-testid":"pc-error-details-panel.close.icon",size:"large",disabled:o},{children:jsxRuntime.exports.jsx(Close,{})}))}))]}))]})),jsxRuntime.exports.jsx("div",Object.assign({className:e.subtitle},{children:jsxRuntime.exports.jsx(Typography,Object.assign({variant:"body1"},{children:SHARED_TEXT.header.subTitle()}))}))]})},PanelFooter=({onClose:e,onRetry:t,isRetrying:r})=>{var o=makeStyles()(e=>({container:{alignItems:"center",display:"flex",justifyContent:"flex-end",marginTop:"auto",padding:e.spacing(0,6,6,6),gap:"15px",position:"absolute",right:0,bottom:0}}))()["classes"];return jsxRuntime.exports.jsxs("div",Object.assign({className:o.container},{children:[jsxRuntime.exports.jsx(LoadingButton,Object.assign({onClick:()=>{t&&t()},variant:"outlined",loading:r,"data-testid":"pc-error-details-panel.retry.button"},{children:SHARED_TEXT.footer.retryJob()})),jsxRuntime.exports.jsx(Button,Object.assign({variant:"contained",onClick:e,disabled:r,"data-testid":"pc-error-details-panel.close.button"},{children:SHARED_TEXT.footer.close()}))]}))},useStyles=makeStyles()(e=>({container:{display:"flex",flexDirection:"column",justifyContent:"flex-start"},dataColumns:{display:"flex",flexWrap:"wrap",padding:e.spacing(6,6,0,6)},dataItem:{width:"50%",display:"flex",flexDirection:"column",padding:e.spacing(0,0,3,0)},errorReasonContainer:{padding:e.spacing(6,6,0,6),display:"flex",flexDirection:"column",height:"70%"},errorRawData:{backgroundColor:"#F7F7F7",border:"1px solid #D5DFE9",borderRadius:"4px",padding:e.spacing(2,6,6,6),whiteSpace:"break-spaces",maxHeight:"50vh",overflowY:"scroll",fontFamily:"monospace",color:"#2A323C",fontSize:"0.95em"}})),downloadAsJSON=(e,t)=>{var e="data:text/json;charset=utf-8,"+encodeURIComponent(JSON.stringify(e,null,4)),r=document.createElement("a");r.setAttribute("href",e),r.setAttribute("download",t),r.click()},getDateTime=e=>{e=new Date(e);return e.toLocaleDateString("en-us")+" "+e.toLocaleTimeString("en-us")},CopyTaskId=({id:t})=>{var e=makeStyles()(e=>({container:{display:"flex",alignItems:"center"},icon:{color:"gray",fontSize:"20px",cursor:"pointer"}}))()["classes"];const[r,o]=react.exports.useState(!1);return jsxRuntime.exports.jsxs("div",Object.assign({className:e.container},{children:[jsxRuntime.exports.jsx(Tooltip,Object.assign({title:t},{children:jsxRuntime.exports.jsx(Typography,Object.assign({noWrap:!0,variant:"body2",sx:{width:"120px"}},{children:t}))})),jsxRuntime.exports.jsx(Tooltip,Object.assign({title:r?SHARED_TEXT.container.tooltipCopied():SHARED_TEXT.container.tooltipCopy()},{children:r?jsxRuntime.exports.jsx(CheckCircle,{className:e.icon}):jsxRuntime.exports.jsx(ContentCopy,{onClick:e=>{r||(o(!0),e.preventDefault(),e.stopPropagation(),navigator.clipboard.writeText(t),setTimeout(()=>o(!1),1200))},className:e.icon})}))]}))},RenderData=({title:e,value:t})=>{var r=useStyles()["classes"],o="string"==typeof t?()=>jsxRuntime.exports.jsx(Typography,{children:t}):()=>t;return jsxRuntime.exports.jsxs("div",Object.assign({className:r.dataItem},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({variant:"body2",sx:{opacity:.75}},{children:e})),o()]}))},RenderErrorReason=({rawData:e})=>{var t=useStyles()["classes"];return jsxRuntime.exports.jsxs("div",Object.assign({className:t.errorReasonContainer,"data-testid":"pc-error-details-panel.error.reason"},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({variant:"body2",sx:{opacity:.75}},{children:SHARED_TEXT.container.errorReason()})),jsxRuntime.exports.jsx("div",Object.assign({className:t.errorRawData},{children:e}))]}))},PanelContainer=({job:e={}})=>{var t=useStyles()["classes"];const r=e.JOB_ID,[o,n]=react.exports.useState(!1),s=useSelector(selectRetryJobStatus),a=useDispatch();let i=null==(l=null==(l=e.TASKS)?void 0:l.records)?void 0:l.find(e=>"failed"===(null==e?void 0:e.status));var l=null!==(i=i||(null==(l=null==(l=e.TASKS)?void 0:l.records)?void 0:l.find(e=>"aborted"===(null==e?void 0:e.status))))&&void 0!==i&&i.createdDateTime?getDateTime(null===i||void 0===i?void 0:i.createdDateTime):SHARED_TEXT.container.unknown(),c=null!==i&&void 0!==i&&i.failureReason?null===i||void 0===i?void 0:i.failureReason:SHARED_TEXT.container.unknown();const u=()=>a(hidePanel("PROCESSING_CENTER_ERROR_DETAIL"));return react.exports.useEffect(()=>{let e;"success"===s?e=()=>{a(showMessage({content:`Retry of Job ${r} queued.`,severity:MessageSeverity.Success}))}:"failure"===s&&(e=()=>{a(showMessage({content:`Failed to start retry of Job ${r}.`,severity:MessageSeverity.Error}))}),["success","failure"].includes(s)&&(setTimeout(()=>u(),1e3),e)&&setTimeout(e,2e3)},[s]),jsxRuntime.exports.jsxs("div",Object.assign({className:t.container},{children:[jsxRuntime.exports.jsx(PanelHeader,{height:64,onPanelClose:u,onDownload:()=>{downloadAsJSON(e,r+"-error.json")},isRetrying:o}),jsxRuntime.exports.jsxs("div",Object.assign({className:t.dataColumns},{children:[jsxRuntime.exports.jsx(RenderData,{title:SHARED_TEXT.container.taskId(),value:jsxRuntime.exports.jsx(CopyTaskId,{id:null===i||void 0===i?void 0:i.id})}),jsxRuntime.exports.jsx(RenderData,{title:SHARED_TEXT.container.errorType(),value:c}),jsxRuntime.exports.jsx(RenderData,{title:SHARED_TEXT.container.errorTime(),value:l})]})),jsxRuntime.exports.jsx(RenderErrorReason,{rawData:JSON.stringify(null===i||void 0===i?void 0:i.taskOutput,null,4)}),jsxRuntime.exports.jsx(PanelFooter,{onClose:u,onRetry:()=>{n(!0),a(actions$1.retryJobStart(r))},isRetrying:o})]}))},ErrorDetailPanel=({jobObj:e})=>jsxRuntime.exports.jsx(AIWareCacheProvider,{children:jsxRuntime.exports.jsx(AIWareThemeProvider,{children:jsxRuntime.exports.jsx(DynamicModuleLoader,Object.assign({modules:[getProcessingCenterSourcesModule()]},{children:jsxRuntime.exports.jsx(AIWareIntlProvider,{children:jsxRuntime.exports.jsx(PanelContainer,{job:e})})}))})});var dynamicLoader_types=Object.freeze({__proto__:null});export{DynamicLoader,ErrorDetailPanel,ImageInput,ProcessingCenterSources,dynamicLoader_types as Types,getProcessingCenterSourcesModule};