@corva/ui 3.80.0-11 → 3.80.0-13

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.
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sources":["../../../../../src/components/DevCenter/AppsDataProvider/effects/utils.ts"],"sourcesContent":["import Jsona from 'jsona';\n\nimport {\n getFracFleets,\n getFracFleetWells,\n getInterventionUnits,\n getPadWells,\n getResolvedAssets,\n getRigs,\n getWells,\n} from '~/clients/jsonApi';\nimport { DEV_CENTER_CLI_APP_ID } from '~/constants';\nimport { ASSET_TYPES } from '~/constants/assetTypes';\nimport { getAppSegment } from '~/utils/devcenter';\n\nimport type {\n AppAssetIdPair,\n AppDataCompletionWell,\n AppDataFracFleet,\n AppDataInterventionUnit,\n AppDataPatch,\n AppDataPatches,\n AppsDataCacheRef,\n AssetId,\n InitializedAppDataDictionary,\n InitializedAppDataEntry,\n InterventionUnitResource,\n JsonApiCollectionResponse,\n JsonApiResource,\n LinkedRigResource,\n PreparedProviderApp,\n PreparedResolverData,\n ProviderApp,\n RigResource,\n WellResource,\n} from '../types';\n\nconst dataFormatter = new Jsona();\n\ntype ResolvedAssetResource = JsonApiResource & {\n attributes: { asset_id: AssetId } & Record<string, unknown>;\n};\n\nexport type ResolvedAssetResponse = Record<string, Array<{ data: ResolvedAssetResource }>>;\n\ntype JsonaInput = Parameters<typeof dataFormatter.deserialize>[0];\n\nconst deserializeCollection = (response: JsonaInput) => {\n const deserialized = dataFormatter.deserialize(response);\n\n if (!Array.isArray(deserialized)) {\n throw new TypeError('Expected a JSON:API collection response');\n }\n\n return deserialized;\n};\n\nconst getRelationshipId = (resource: JsonApiResource | undefined, name: string) => {\n const data = resource?.relationships?.[name]?.data;\n\n return data && !Array.isArray(data) ? data.id : undefined;\n};\n\nconst findIncludedResource = (\n response: JsonApiCollectionResponse,\n type: string,\n id: AssetId | undefined\n) => response.included.find(item => item.type === type && item.id === id);\n\nconst isWellResource = (resource: JsonApiResource | undefined): resource is WellResource =>\n resource?.type === 'well';\n\nconst keyResourcesById = <Resource extends { id: AssetId }>(resources: Resource[]) =>\n resources.reduce<Record<string, Resource>>((acc, resource) => {\n acc[resource.id] = resource;\n\n return acc;\n }, {});\n\nexport const getAppAssetSpecificTypeId = (app: ProviderApp, typeId: string): number =>\n Number(app.settings?.[typeId]);\n\nexport const getUniqAssetIds = (assetIds: AppAssetIdPair[], cachedAssetIds: string[]): number[] => [\n ...new Set(\n assetIds\n .map(([_appId, assetId]) => assetId)\n .filter(assetId => Number.isFinite(assetId) && !cachedAssetIds.includes(String(assetId)))\n ),\n];\n\nexport const fetchWells = async (\n ids: number[]\n): Promise<JsonApiCollectionResponse<WellResource> | null> => {\n if (!ids.length) return null;\n\n try {\n const response: JsonApiCollectionResponse<WellResource> = await getWells({\n ids,\n fields: [\n 'well.name',\n 'well.settings',\n 'well.custom_properties',\n 'well.company',\n 'well.asset_id',\n 'well.last_active_at',\n 'well.program',\n 'well.pad',\n 'well.frac_fleet',\n 'well.id',\n 'well.rig',\n 'rig.name',\n 'rig.asset_id',\n 'company.id',\n 'well.status',\n 'well.archivation',\n 'well.lon_lat',\n ],\n include_arhivation_data: true,\n });\n\n return response;\n } catch (error) {\n console.error(error);\n return null;\n }\n};\n\nexport const fetchRigs = async (\n ids: number[]\n): Promise<JsonApiCollectionResponse<RigResource> | null> => {\n if (!ids.length) return null;\n\n try {\n const response: JsonApiCollectionResponse<RigResource> = await getRigs({\n ids,\n fields: [\n 'rig.name',\n 'rig.settings',\n 'rig.asset_id',\n 'rig.active_well',\n 'rig.last_active_well',\n 'well.name',\n 'well.settings',\n 'well.custom_properties',\n 'well.company',\n 'rig.program',\n 'well.asset_id',\n 'well.last_active_at',\n 'well.id',\n 'well.company.id',\n 'well.lon_lat',\n ],\n });\n\n return response;\n } catch (error) {\n console.error(error);\n return null;\n }\n};\n\nexport const fetchAssetEntitiesByAssetIds = async (\n assetIds: Array<AssetId | null | undefined>\n): Promise<ResolvedAssetResponse | null> => {\n if (!assetIds.length) return null;\n\n try {\n const response: ResolvedAssetResponse = await getResolvedAssets({ assets: assetIds });\n\n return response;\n } catch (error) {\n console.error(error);\n return null;\n }\n};\n\nconst getWellObjectFromWellData = (\n well: WellResource | undefined,\n rig: RigResource | LinkedRigResource | undefined,\n interventionUnit?: InterventionUnitResource\n): AppDataPatch => {\n const appDataWell = well\n ? {\n ...well.attributes,\n id: well.id,\n // NOTE: API doesn't return active child company id\n companyId: getRelationshipId(well, 'company'),\n }\n : undefined;\n\n const appDataInterventionUnit: AppDataInterventionUnit | undefined = interventionUnit\n ? {\n id: Number(interventionUnit.id),\n name: interventionUnit.name,\n active_well: interventionUnit.active_well,\n }\n : undefined;\n\n return {\n well: appDataWell,\n rig: {\n name: rig?.attributes?.name,\n id: rig?.id,\n asset_id: rig?.attributes?.asset_id,\n },\n program: {\n id: rig?.program?.id || null,\n name: rig?.program?.attributes?.name || null,\n },\n ...(appDataInterventionUnit && { interventionUnit: appDataInterventionUnit }),\n // NOTE: Support ff/pad in mixpanel for Asset Dashboards\n completionWellInfo: {\n pad: {\n id: well?.pad?.id || null,\n name: well?.pad?.attributes?.name || null,\n },\n fracFleet: {\n id: well?.fracFleet?.id || null,\n name: well?.fracFleet?.attributes?.name || null,\n },\n },\n };\n};\n\nexport const getAppsDataByWells = (\n appsWellIds: AppAssetIdPair[],\n wellsById: Record<string, WellResource>\n): AppDataPatches => {\n if (!Object.keys(wellsById).length) return {};\n\n return appsWellIds.reduce<AppDataPatches>((acc, [appId, wellId]) => {\n const well = wellsById[wellId];\n if (!well) return acc;\n\n acc[appId] = getWellObjectFromWellData(well, well.rig);\n\n return acc;\n }, {});\n};\n\nexport const getAppsDataByRigs = (\n appsRigIds: AppAssetIdPair[],\n rigsById: Record<string, RigResource>\n): AppDataPatches => {\n if (!Object.keys(rigsById).length) return {};\n\n return appsRigIds.reduce<AppDataPatches>((acc, [appId, rigId]) => {\n const rig = rigsById[rigId];\n acc[appId] = getWellObjectFromWellData(rig?.well, rig);\n\n return acc;\n }, {});\n};\n\nexport const getAppsDataByFFs = (\n appsFracFleetIds: AppAssetIdPair[],\n ffsById: Record<string, AppDataFracFleet>,\n ffWellsData: Record<string, AppDataCompletionWell[]> | null | false\n): AppDataPatches => {\n if (!Object.keys(ffsById).length && !ffWellsData) return {};\n\n return appsFracFleetIds.reduce<AppDataPatches>((acc, [appId, ffId]) => {\n const fracFleet = ffsById[ffId];\n const wells = ffWellsData ? ffWellsData[appId] : undefined;\n const program = fracFleet?.program;\n\n acc[appId] = {\n fracFleet,\n wells,\n program: {\n id: program?.id || null,\n name: program?.name || null,\n },\n };\n\n return acc;\n }, {});\n};\n\nexport const getAppsDataByPads = (\n appsPadIds: AppAssetIdPair[],\n padWellsData: Record<string, AppDataCompletionWell[]> | null | false\n): AppDataPatches => {\n if (!appsPadIds.length && !padWellsData) return {};\n\n return appsPadIds.reduce<AppDataPatches>((acc, [appId]) => {\n acc[appId] = { wells: padWellsData ? padWellsData[appId] : undefined };\n\n return acc;\n }, {});\n};\n\nexport const getAppsDataByInterventionUnits = (\n appsInterventionUnitIds: AppAssetIdPair[],\n interventionUnitsById: Record<string, InterventionUnitResource>,\n appsWellIds: AppAssetIdPair[],\n wellsById: Record<string, WellResource>\n): AppDataPatches => {\n if (!Object.keys(interventionUnitsById).length) return {};\n\n return appsInterventionUnitIds.reduce<AppDataPatches>((acc, [appId, interventionUnitId]) => {\n const interventionUnit = interventionUnitsById[interventionUnitId];\n const appWellId = appsWellIds.find(([wellAppId]) => wellAppId === appId)?.[1];\n const well = (appWellId && wellsById[appWellId]) || interventionUnit.well;\n\n acc[appId] = getWellObjectFromWellData(well, well?.rig, {\n ...interventionUnit,\n ...(interventionUnit.well && {\n active_well: { id: interventionUnit.well.id, ...interventionUnit.well.attributes },\n }),\n });\n\n return acc;\n }, {});\n};\n\nexport const fetchFracFleets = async (ids: number[]): Promise<AppDataFracFleet[] | null> => {\n if (!ids.length) return null;\n\n try {\n const response = await getFracFleets({\n ids,\n fields: [\n 'frac_fleet.name',\n 'frac_fleet.pads',\n 'frac_fleet.program',\n 'frac_fleet.current_pad_id',\n 'frac_fleet.pad_frac_fleets',\n 'frac_fleet.pad_frac_fleet.frac_fleet_lines',\n ],\n });\n if (!response) return [];\n\n const fracFleets: AppDataFracFleet[] = deserializeCollection(response);\n\n return fracFleets;\n } catch (error) {\n console.error(error);\n return [];\n }\n};\n\nexport const fetchInterventionUnits = async (\n ids: number[]\n): Promise<JsonApiCollectionResponse | null> => {\n if (!ids.length) return null;\n\n try {\n const response: JsonApiCollectionResponse = await getInterventionUnits({\n ids,\n fields: ['intervention_unit.name', 'intervention_unit.type', 'intervention_unit.active_well'],\n });\n\n return response;\n } catch (error) {\n console.error(error);\n return null;\n }\n};\n\nexport const fetchFracFleetWells = async (\n appsFFIds: AppAssetIdPair[],\n apps: ProviderApp[]\n): Promise<Record<string, AppDataCompletionWell[]>> => {\n const appsById = keyResourcesById(apps);\n const requests = appsFFIds.map(async ([appId, fracFleetId]) => {\n const app = appsById[appId];\n const options: Record<string, unknown> = { fields: 'all', frac_fleet_id: fracFleetId };\n\n if (appId === DEV_CENTER_CLI_APP_ID) options.app_key = app?.app?.app_key;\n else options.app_id = app?.app?.id;\n\n try {\n const response = await getFracFleetWells(options);\n if (!response) return [];\n\n const wells: AppDataCompletionWell[] = deserializeCollection(response);\n\n return wells;\n } catch (error) {\n console.error(error);\n return [];\n }\n });\n\n const responses = await Promise.all(requests);\n\n return responses.reduce<Record<string, AppDataCompletionWell[]>>((acc, wells, index) => {\n acc[appsFFIds[index][0]] = wells;\n\n return acc;\n }, {});\n};\n\nexport const fetchPadWells = async (\n appsPadIds: AppAssetIdPair[],\n apps: ProviderApp[]\n): Promise<Record<string, AppDataCompletionWell[]>> => {\n const appsById = keyResourcesById(apps);\n const requests = appsPadIds.map(async ([appId, padId]) => {\n const app = appsById[appId];\n const options: Record<string, unknown> = { fields: 'all' };\n\n if (appId === DEV_CENTER_CLI_APP_ID) options.app_key = app?.app?.app_key;\n else options.app_id = app?.app?.id;\n\n try {\n const response = await getPadWells(padId, options);\n if (!response) return [];\n\n const wells: AppDataCompletionWell[] = deserializeCollection(response);\n\n return wells;\n } catch (error) {\n console.error(error);\n return [];\n }\n });\n\n const responses = await Promise.all(requests);\n\n return responses.reduce<Record<string, AppDataCompletionWell[]>>((acc, wells, index) => {\n acc[appsPadIds[index][0]] = wells;\n\n return acc;\n }, {});\n};\n\nexport const getAppHash = (app: ProviderApp): string =>\n [\n app.id,\n getAppAssetSpecificTypeId(app, ASSET_TYPES.well.id),\n getAppAssetSpecificTypeId(app, ASSET_TYPES.rig.id),\n getAppAssetSpecificTypeId(app, ASSET_TYPES.frac_fleet.id),\n getAppAssetSpecificTypeId(app, ASSET_TYPES.pad.id),\n getAppAssetSpecificTypeId(app, ASSET_TYPES.intervention_unit.id),\n getAppAssetSpecificTypeId(app, 'deprecatedAssetId'),\n getAppSegment(app),\n ].join('-');\n\nexport const isAppWithSettings = (app: ProviderApp): boolean =>\n Boolean(\n getAppAssetSpecificTypeId(app, ASSET_TYPES.well.id) ||\n getAppAssetSpecificTypeId(app, ASSET_TYPES.rig.id) ||\n getAppAssetSpecificTypeId(app, ASSET_TYPES.frac_fleet.id) ||\n getAppAssetSpecificTypeId(app, ASSET_TYPES.pad.id) ||\n getAppAssetSpecificTypeId(app, ASSET_TYPES.intervention_unit.id)\n );\n\nexport const getInitialAppData = (app: ProviderApp): InitializedAppDataEntry => ({\n id: app.id,\n rig: null,\n well: null,\n fracFleet: null,\n interventionUnit: null,\n program: { id: null, name: null },\n completionWellInfo: {\n fracFleet: { id: null, name: null },\n pad: { id: null, name: null },\n },\n wells: null,\n isLoading: true,\n appHash: getAppHash(app),\n});\n\nexport const getInitialAppsDataState = (apps: ProviderApp[]): InitializedAppDataDictionary =>\n apps.reduce<InitializedAppDataDictionary>((acc, app) => {\n acc[app.id] = getInitialAppData(app);\n\n return acc;\n }, {});\n\nexport const isAppNeedingInterventionUnitWellRefresh = (app: ProviderApp): boolean => {\n const interventionUnitId = getAppAssetSpecificTypeId(app, ASSET_TYPES.intervention_unit.id);\n const wellId = getAppAssetSpecificTypeId(app, ASSET_TYPES.well.id);\n\n return Boolean(interventionUnitId && !wellId);\n};\n\nexport const prepareDataForResolver = (\n apps: PreparedProviderApp[],\n cache: AppsDataCacheRef\n): PreparedResolverData => {\n const appsWellIds: AppAssetIdPair[] = [];\n const appsRigIds: AppAssetIdPair[] = [];\n const appsFracFleetIds: AppAssetIdPair[] = [];\n const appsInterventionUnitIds: AppAssetIdPair[] = [];\n const appsFracFleetToFetchWellsIds: AppAssetIdPair[] = [];\n const appsPadIds: AppAssetIdPair[] = [];\n const appIds: [ProviderApp['id']][] = [];\n\n apps.forEach(app => {\n const appWellId = getAppAssetSpecificTypeId(app, ASSET_TYPES.well.id);\n const appRigId = getAppAssetSpecificTypeId(app, ASSET_TYPES.rig.id);\n const appFracFleetId = getAppAssetSpecificTypeId(app, ASSET_TYPES.frac_fleet.id);\n const appPadId = getAppAssetSpecificTypeId(app, ASSET_TYPES.pad.id);\n const appInterventionUnitId = getAppAssetSpecificTypeId(app, ASSET_TYPES.intervention_unit.id);\n const appId = app.id;\n\n appIds.push([appId]);\n\n if (appInterventionUnitId) {\n appsInterventionUnitIds.push([appId, appInterventionUnitId]);\n // NOTE: we need to fetch well for intervention unit as there is no well in intervention unit\n if (appWellId) appsWellIds.push([appId, appWellId]);\n } else if (appWellId) {\n appsWellIds.push([appId, appWellId]);\n } else if (appRigId) {\n appsRigIds.push([appId, appRigId]);\n } else if (appFracFleetId) {\n appsFracFleetIds.push([appId, appFracFleetId]);\n if (appPadId) appsPadIds.push([appId, appPadId]);\n else appsFracFleetToFetchWellsIds.push([appId, appFracFleetId]);\n }\n });\n\n const { rigsById, wellsById, fracFleetsById, interventionUnitsById } = cache.current;\n\n return {\n appsWellIds,\n appsRigIds,\n appsFracFleetIds,\n appsPadIds,\n appIds,\n appsFracFleetToFetchWellsIds,\n appsInterventionUnitIds,\n uniqueWellIds: getUniqAssetIds(appsWellIds, Object.keys(wellsById)),\n uniqueRigIds: getUniqAssetIds(appsRigIds, Object.keys(rigsById)),\n uniqueFFIds: getUniqAssetIds(appsFracFleetIds, Object.keys(fracFleetsById)),\n uniqueInterventionUnitIds: getUniqAssetIds(\n appsInterventionUnitIds,\n Object.keys(interventionUnitsById)\n ),\n };\n};\n\nexport const buildWellCache = (\n response: JsonApiCollectionResponse<WellResource>\n): Record<string, WellResource> =>\n keyResourcesById(\n response.data.map(well => {\n const rigResource = findIncludedResource(response, 'rig', getRelationshipId(well, 'rig'));\n const program = findIncludedResource(response, 'program', getRelationshipId(well, 'program'));\n const fracFleet = findIncludedResource(\n response,\n 'frac_fleet',\n getRelationshipId(well, 'frac_fleet')\n );\n const pad = findIncludedResource(response, 'pad', getRelationshipId(well, 'pad'));\n const rig = { ...rigResource, program };\n\n return { ...well, rig, fracFleet, pad };\n })\n );\n\nexport const buildRigCache = (\n response: JsonApiCollectionResponse<RigResource>\n): Record<string, RigResource> =>\n keyResourcesById(\n response.data.map(rig => {\n const wellId =\n getRelationshipId(rig, 'active_well') || getRelationshipId(rig, 'last_active_well');\n const wellResource = findIncludedResource(response, 'well', wellId);\n const program = findIncludedResource(response, 'program', getRelationshipId(rig, 'program'));\n const well = isWellResource(wellResource) ? wellResource : undefined;\n\n return { ...rig, well, program };\n })\n );\n\nexport const buildInterventionUnitCache = (\n response: JsonApiCollectionResponse\n): Record<string, InterventionUnitResource> =>\n keyResourcesById(\n response.data.map(interventionUnit => {\n const wellResource = findIncludedResource(\n response,\n 'well',\n getRelationshipId(interventionUnit, 'active_well')\n );\n const well = isWellResource(wellResource) ? wellResource : undefined;\n\n return {\n ...interventionUnit,\n name: interventionUnit.attributes?.name,\n well,\n };\n })\n );\n\nexport const buildFracFleetCache = (\n fracFleets: AppDataFracFleet[]\n): Record<string, AppDataFracFleet> =>\n fracFleets.reduce<Record<string, AppDataFracFleet>>((acc, fracFleet) => {\n if (fracFleet.id !== undefined) acc[fracFleet.id] = fracFleet;\n\n return acc;\n }, {});\n"],"names":["dataFormatter","Jsona","deserializeCollection","response","deserialized","deserialize","Array","isArray","TypeError","getRelationshipId","resource","name","_resource$relationshi","_resource$relationshi2","data","relationships","id","undefined","findIncludedResource","type","included","find","item","isWellResource","keyResourcesById","resources","reduce","acc","getAppAssetSpecificTypeId","app","typeId","_app$settings","Number","settings","getUniqAssetIds","assetIds","cachedAssetIds","_toConsumableArray","Set","map","_ref","_ref2","_slicedToArray","filter","assetId","isFinite","includes","String","fetchWells","_ref3","_asyncToGenerator","_regeneratorRuntime","mark","ids","wrap","_context","prev","next","length","abrupt","getWells","fields","include_arhivation_data","sent","t0","console","error","stop","_callee","_x","apply","this","arguments","fetchRigs","_ref4","_context2","getRigs","_callee2","_x2","fetchAssetEntitiesByAssetIds","_ref5","_context3","getResolvedAssets","assets","_callee3","_x3","getWellObjectFromWellData","well","rig","interventionUnit","_rig$attributes","_rig$attributes2","_rig$program","_rig$program2","_rig$program2$attribu","_well$pad","_well$pad2","_well$pad2$attributes","_well$fracFleet","_well$fracFleet2","_well$fracFleet2$attr","appDataWell","attributes","companyId","appDataInterventionUnit","active_well","_objectSpread","asset_id","program","completionWellInfo","pad","fracFleet","getAppsDataByWells","appsWellIds","wellsById","Object","keys","_ref6","_ref7","appId","wellId","getAppsDataByRigs","appsRigIds","rigsById","_ref8","_ref9","rigId","getAppsDataByFFs","appsFracFleetIds","ffsById","ffWellsData","_ref10","_ref11","ffId","wells","getAppsDataByPads","appsPadIds","padWellsData","_ref12","getAppsDataByInterventionUnits","appsInterventionUnitIds","interventionUnitsById","_ref14","_appsWellIds$find","_ref15","interventionUnitId","appWellId","_ref16","fetchFracFleets","_ref18","fracFleets","_context4","getFracFleets","_callee4","_x4","fetchInterventionUnits","_ref19","_context5","getInterventionUnits","_callee5","_x5","fetchFracFleetWells","_ref20","_callee7","appsFFIds","apps","appsById","requests","responses","_context7","_ref22","_callee6","_ref21","_app$app","_app$app2","_ref23","fracFleetId","options","_context6","frac_fleet_id","DEV_CENTER_CLI_APP_ID","app_key","app_id","getFracFleetWells","_x8","Promise","all","index","_x6","_x7","fetchPadWells","_ref24","_callee9","_context9","_ref26","_callee8","_ref25","_app$app3","_app$app4","_ref27","padId","_context8","getPadWells","_x11","_x9","_x10","getAppHash","ASSET_TYPES","frac_fleet","intervention_unit","getAppSegment","join","isAppWithSettings","Boolean","getInitialAppData","isLoading","appHash","getInitialAppsDataState","isAppNeedingInterventionUnitWellRefresh","prepareDataForResolver","cache","appsFracFleetToFetchWellsIds","appIds","forEach","appRigId","appFracFleetId","appPadId","appInterventionUnitId","push","current","fracFleetsById","uniqueWellIds","uniqueRigIds","uniqueFFIds","uniqueInterventionUnitIds","buildWellCache","rigResource","buildRigCache","wellResource","buildInterventionUnitCache","_interventionUnit$att","buildFracFleetCache"],"mappings":"ovDAqCA,IAAMA,EAAgB,IAAIC,EAUpBC,EAAwB,SAACC,GAC7B,IAAMC,EAAeJ,EAAcK,YAAYF,GAE/C,IAAKG,MAAMC,QAAQH,GACjB,MAAM,IAAII,UAAU,2CAGtB,OAAOJ,CACT,EAEMK,EAAoB,SAACC,EAAuCC,GAAiB,IAAAC,EAAAC,EAC3EC,EAAOJ,iBAAAA,EAAAA,EAAUK,4BAAqB,UAA/BH,EAA0BD,UAAK,IAAAE,OAA/BH,EAAAG,EAAiCC,KAE9C,OAAOA,IAASR,MAAMC,QAAQO,GAAQA,EAAKE,QAAKC,CAClD,EAEMC,EAAuB,SAC3Bf,EACAgB,EACAH,GAAuB,OACpBb,EAASiB,SAASC,MAAK,SAAAC,GAAI,OAAIA,EAAKH,OAASA,GAAQG,EAAKN,KAAOA,IAAG,EAEnEO,EAAiB,SAACb,GAAqC,MACxC,UAAnBA,eAAAA,EAAUS,KAAe,EAErBK,EAAmB,SAAmCC,GAAqB,OAC/EA,EAAUC,QAAiC,SAACC,EAAKjB,GAG/C,OAFAiB,EAAIjB,EAASM,IAAMN,EAEZiB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B,EAASW,KAAKyB,KAAI,SAAAkD,GAAoB,IAAAuJ,EAC9BF,EAAe5N,EACnBf,EACA,OACAM,EAAkBgF,EAAkB,gBAEhCF,EAAOhE,EAAeuN,GAAgBA,OAAe7N,EAE3D,OAAAyF,EAAAA,EAAA,CAAA,EACKjB,GAAgB,CAAA,EAAA,CACnB9E,KAAiC,UAA3B8E,EAAiBa,kBAAU,IAAA0I,OAAA,EAA3BA,EAA6BrO,KACnC4E,KAAAA,GAEH,IACF,EAEU0J,EAAsB,SACjC3F,GAA8B,OAE9BA,EAAW5H,QAAyC,SAACC,EAAKoF,GAGxD,YAFqB9F,IAAjB8F,EAAU/F,KAAkBW,EAAIoF,EAAU/F,IAAM+F,GAE7CpF,CACR,GAAE,CAAE,EAAC"}
1
+ {"version":3,"file":"utils.js","sources":["../../../../../src/components/DevCenter/AppsDataProvider/effects/utils.ts"],"sourcesContent":["import Jsona from 'jsona';\n\nimport {\n getFracFleets,\n getFracFleetWells,\n getInterventionUnits,\n getPadWells,\n getResolvedAssets,\n getRigs,\n getWells,\n} from '~/clients/jsonApi';\nimport { DEV_CENTER_CLI_APP_ID } from '~/constants';\nimport { ASSET_TYPES } from '~/constants/assetTypes';\nimport { getAppSegment } from '~/utils/devcenter';\n\nimport type {\n AppAssetIdPair,\n AppDataCompletionWell,\n AppDataFracFleet,\n AppDataInterventionUnit,\n AppDataPatch,\n AppDataPatches,\n AppsDataCacheRef,\n AssetId,\n InitializedAppDataDictionary,\n InitializedAppDataEntry,\n InterventionUnitResource,\n JsonApiCollectionResponse,\n JsonApiResource,\n LinkedRigResource,\n PreparedProviderApp,\n PreparedResolverData,\n ProviderApp,\n RigResource,\n WellResource,\n} from '../types';\n\nconst dataFormatter = new Jsona();\n\ntype ResolvedAssetResource = JsonApiResource & {\n attributes: { asset_id: AssetId } & Record<string, unknown>;\n};\n\nexport type ResolvedAssetResponse = Record<string, Array<{ data: ResolvedAssetResource }>>;\n\ntype JsonaInput = Parameters<typeof dataFormatter.deserialize>[0];\n\nconst deserializeCollection = (response: JsonaInput) => {\n const deserialized = dataFormatter.deserialize(response);\n\n if (!Array.isArray(deserialized)) {\n throw new TypeError('Expected a JSON:API collection response');\n }\n\n return deserialized;\n};\n\nconst getRelationshipId = (resource: JsonApiResource | undefined, name: string) => {\n const data = resource?.relationships?.[name]?.data;\n\n return data && !Array.isArray(data) ? data.id : undefined;\n};\n\nconst findIncludedResource = (\n response: JsonApiCollectionResponse,\n type: string,\n id: AssetId | undefined\n) => response.included.find(item => item.type === type && item.id === id);\n\nconst isWellResource = (resource: JsonApiResource | undefined): resource is WellResource =>\n resource?.type === 'well';\n\nconst keyResourcesById = <Resource extends { id: AssetId }>(resources: Resource[]) =>\n resources.reduce<Record<string, Resource>>((acc, resource) => {\n acc[resource.id] = resource;\n\n return acc;\n }, {});\n\nexport const getAppAssetSpecificTypeId = (app: ProviderApp, typeId: string): number =>\n Number(app.settings?.[typeId]);\n\nexport const getUniqAssetIds = (assetIds: AppAssetIdPair[], cachedAssetIds: string[]): number[] => [\n ...new Set(\n assetIds\n .map(([_appId, assetId]) => assetId)\n .filter(assetId => Number.isFinite(assetId) && !cachedAssetIds.includes(String(assetId)))\n ),\n];\n\nexport const fetchWells = async (\n ids: number[]\n): Promise<JsonApiCollectionResponse<WellResource> | null> => {\n if (!ids.length) return null;\n\n try {\n const response: JsonApiCollectionResponse<WellResource> = await getWells({\n ids,\n fields: [\n 'well.name',\n 'well.settings',\n 'well.custom_properties',\n 'well.company',\n 'well.asset_id',\n 'well.last_active_at',\n 'well.program',\n 'well.pad',\n 'well.frac_fleet',\n 'well.id',\n 'well.rig',\n 'rig.name',\n 'rig.asset_id',\n 'company.id',\n 'well.status',\n 'well.archivation',\n 'well.lon_lat',\n ],\n include_arhivation_data: true,\n });\n\n return response;\n } catch (error) {\n console.error(error);\n return null;\n }\n};\n\nexport const fetchRigs = async (\n ids: number[]\n): Promise<JsonApiCollectionResponse<RigResource> | null> => {\n if (!ids.length) return null;\n\n try {\n const response: JsonApiCollectionResponse<RigResource> = await getRigs({\n ids,\n fields: [\n 'rig.name',\n 'rig.settings',\n 'rig.asset_id',\n 'rig.active_well',\n 'rig.last_active_well',\n 'well.name',\n 'well.settings',\n 'well.custom_properties',\n 'well.company',\n 'rig.program',\n 'well.asset_id',\n 'well.last_active_at',\n 'well.id',\n 'well.company.id',\n 'well.lon_lat',\n ],\n });\n\n return response;\n } catch (error) {\n console.error(error);\n return null;\n }\n};\n\nexport const fetchAssetEntitiesByAssetIds = async (\n assetIds: Array<AssetId | null | undefined>\n): Promise<ResolvedAssetResponse | null> => {\n if (!assetIds.length) return null;\n\n try {\n const response: ResolvedAssetResponse = await getResolvedAssets({ assets: assetIds });\n\n return response;\n } catch (error) {\n console.error(error);\n return null;\n }\n};\n\nconst getWellObjectFromWellData = (\n well: WellResource | undefined,\n rig: RigResource | LinkedRigResource | undefined,\n interventionUnit?: InterventionUnitResource\n): AppDataPatch => {\n const appDataWell = well\n ? {\n ...well.attributes,\n id: well.id,\n // NOTE: API doesn't return active child company id\n companyId: getRelationshipId(well, 'company'),\n }\n : undefined;\n\n const appDataInterventionUnit: AppDataInterventionUnit | undefined = interventionUnit\n ? {\n id: Number(interventionUnit.id),\n name: interventionUnit.name,\n active_well: interventionUnit.active_well,\n }\n : undefined;\n\n return {\n well: appDataWell,\n rig: {\n name: rig?.attributes?.name,\n id: rig?.id,\n asset_id: rig?.attributes?.asset_id,\n },\n program: {\n id: rig?.program?.id || null,\n name: rig?.program?.attributes?.name || null,\n },\n ...(appDataInterventionUnit && { interventionUnit: appDataInterventionUnit }),\n // NOTE: Support ff/pad in mixpanel for Asset Dashboards\n completionWellInfo: {\n pad: {\n id: well?.pad?.id || null,\n name: well?.pad?.attributes?.name || null,\n },\n fracFleet: {\n id: well?.fracFleet?.id || null,\n name: well?.fracFleet?.attributes?.name || null,\n },\n },\n };\n};\n\nexport const getAppsDataByWells = (\n appsWellIds: AppAssetIdPair[],\n wellsById: Record<string, WellResource>\n): AppDataPatches => {\n if (!Object.keys(wellsById).length) return {};\n\n return appsWellIds.reduce<AppDataPatches>((acc, [appId, wellId]) => {\n const well = wellsById[wellId];\n if (!well) return acc;\n\n acc[appId] = getWellObjectFromWellData(well, well.rig);\n\n return acc;\n }, {});\n};\n\nexport const getAppsDataByRigs = (\n appsRigIds: AppAssetIdPair[],\n rigsById: Record<string, RigResource>\n): AppDataPatches => {\n if (!Object.keys(rigsById).length) return {};\n\n return appsRigIds.reduce<AppDataPatches>((acc, [appId, rigId]) => {\n const rig = rigsById[rigId];\n acc[appId] = getWellObjectFromWellData(rig?.well, rig);\n\n return acc;\n }, {});\n};\n\nexport const getAppsDataByFFs = (\n appsFracFleetIds: AppAssetIdPair[],\n ffsById: Record<string, AppDataFracFleet>,\n ffWellsData: Record<string, AppDataCompletionWell[]> | null | false\n): AppDataPatches => {\n if (!Object.keys(ffsById).length && !ffWellsData) return {};\n\n return appsFracFleetIds.reduce<AppDataPatches>((acc, [appId, ffId]) => {\n const fracFleet = ffsById[ffId];\n const wells = ffWellsData ? ffWellsData[appId] : undefined;\n const program = fracFleet?.program;\n\n acc[appId] = {\n fracFleet,\n wells,\n program: {\n id: program?.id || null,\n name: program?.name || null,\n },\n };\n\n return acc;\n }, {});\n};\n\nexport const getAppsDataByPads = (\n appsPadIds: AppAssetIdPair[],\n padWellsData: Record<string, AppDataCompletionWell[]> | null | false\n): AppDataPatches => {\n if (!appsPadIds.length && !padWellsData) return {};\n\n return appsPadIds.reduce<AppDataPatches>((acc, [appId]) => {\n acc[appId] = { wells: padWellsData ? padWellsData[appId] : undefined };\n\n return acc;\n }, {});\n};\n\nexport const getAppsDataByInterventionUnits = (\n appsInterventionUnitIds: AppAssetIdPair[],\n interventionUnitsById: Record<string, InterventionUnitResource>,\n appsWellIds: AppAssetIdPair[],\n wellsById: Record<string, WellResource>\n): AppDataPatches => {\n if (!Object.keys(interventionUnitsById).length) return {};\n\n return appsInterventionUnitIds.reduce<AppDataPatches>((acc, [appId, interventionUnitId]) => {\n const interventionUnit = interventionUnitsById[interventionUnitId];\n const appWellId = appsWellIds.find(([wellAppId]) => wellAppId === appId)?.[1];\n const well = (appWellId && wellsById[appWellId]) || interventionUnit?.well;\n\n if (!interventionUnit && !well) return acc;\n\n acc[appId] = getWellObjectFromWellData(\n well,\n well?.rig,\n interventionUnit && {\n ...interventionUnit,\n ...(interventionUnit.well && {\n active_well: { id: interventionUnit.well.id, ...interventionUnit.well.attributes },\n }),\n }\n );\n\n return acc;\n }, {});\n};\n\nexport const fetchFracFleets = async (ids: number[]): Promise<AppDataFracFleet[] | null> => {\n if (!ids.length) return null;\n\n try {\n const response = await getFracFleets({\n ids,\n fields: [\n 'frac_fleet.name',\n 'frac_fleet.pads',\n 'frac_fleet.program',\n 'frac_fleet.current_pad_id',\n 'frac_fleet.pad_frac_fleets',\n 'frac_fleet.pad_frac_fleet.frac_fleet_lines',\n ],\n });\n if (!response) return [];\n\n const fracFleets: AppDataFracFleet[] = deserializeCollection(response);\n\n return fracFleets;\n } catch (error) {\n console.error(error);\n return [];\n }\n};\n\nexport const fetchInterventionUnits = async (\n ids: number[]\n): Promise<JsonApiCollectionResponse | null> => {\n if (!ids.length) return null;\n\n try {\n const response: JsonApiCollectionResponse = await getInterventionUnits({\n ids,\n fields: ['intervention_unit.name', 'intervention_unit.type', 'intervention_unit.active_well'],\n });\n\n return response;\n } catch (error) {\n console.error(error);\n return null;\n }\n};\n\nexport const fetchFracFleetWells = async (\n appsFFIds: AppAssetIdPair[],\n apps: ProviderApp[]\n): Promise<Record<string, AppDataCompletionWell[]>> => {\n const appsById = keyResourcesById(apps);\n const requests = appsFFIds.map(async ([appId, fracFleetId]) => {\n const app = appsById[appId];\n const options: Record<string, unknown> = { fields: 'all', frac_fleet_id: fracFleetId };\n\n if (appId === DEV_CENTER_CLI_APP_ID) options.app_key = app?.app?.app_key;\n else options.app_id = app?.app?.id;\n\n try {\n const response = await getFracFleetWells(options);\n if (!response) return [];\n\n const wells: AppDataCompletionWell[] = deserializeCollection(response);\n\n return wells;\n } catch (error) {\n console.error(error);\n return [];\n }\n });\n\n const responses = await Promise.all(requests);\n\n return responses.reduce<Record<string, AppDataCompletionWell[]>>((acc, wells, index) => {\n acc[appsFFIds[index][0]] = wells;\n\n return acc;\n }, {});\n};\n\nexport const fetchPadWells = async (\n appsPadIds: AppAssetIdPair[],\n apps: ProviderApp[]\n): Promise<Record<string, AppDataCompletionWell[]>> => {\n const appsById = keyResourcesById(apps);\n const requests = appsPadIds.map(async ([appId, padId]) => {\n const app = appsById[appId];\n const options: Record<string, unknown> = { fields: 'all' };\n\n if (appId === DEV_CENTER_CLI_APP_ID) options.app_key = app?.app?.app_key;\n else options.app_id = app?.app?.id;\n\n try {\n const response = await getPadWells(padId, options);\n if (!response) return [];\n\n const wells: AppDataCompletionWell[] = deserializeCollection(response);\n\n return wells;\n } catch (error) {\n console.error(error);\n return [];\n }\n });\n\n const responses = await Promise.all(requests);\n\n return responses.reduce<Record<string, AppDataCompletionWell[]>>((acc, wells, index) => {\n acc[appsPadIds[index][0]] = wells;\n\n return acc;\n }, {});\n};\n\nexport const getAppHash = (app: ProviderApp): string =>\n [\n app.id,\n getAppAssetSpecificTypeId(app, ASSET_TYPES.well.id),\n getAppAssetSpecificTypeId(app, ASSET_TYPES.rig.id),\n getAppAssetSpecificTypeId(app, ASSET_TYPES.frac_fleet.id),\n getAppAssetSpecificTypeId(app, ASSET_TYPES.pad.id),\n getAppAssetSpecificTypeId(app, ASSET_TYPES.intervention_unit.id),\n getAppAssetSpecificTypeId(app, 'deprecatedAssetId'),\n getAppSegment(app),\n ].join('-');\n\nexport const isAppWithSettings = (app: ProviderApp): boolean =>\n Boolean(\n getAppAssetSpecificTypeId(app, ASSET_TYPES.well.id) ||\n getAppAssetSpecificTypeId(app, ASSET_TYPES.rig.id) ||\n getAppAssetSpecificTypeId(app, ASSET_TYPES.frac_fleet.id) ||\n getAppAssetSpecificTypeId(app, ASSET_TYPES.pad.id) ||\n getAppAssetSpecificTypeId(app, ASSET_TYPES.intervention_unit.id)\n );\n\nexport const getInitialAppData = (app: ProviderApp): InitializedAppDataEntry => ({\n id: app.id,\n rig: null,\n well: null,\n fracFleet: null,\n interventionUnit: null,\n program: { id: null, name: null },\n completionWellInfo: {\n fracFleet: { id: null, name: null },\n pad: { id: null, name: null },\n },\n wells: null,\n isLoading: true,\n appHash: getAppHash(app),\n});\n\nexport const getInitialAppsDataState = (apps: ProviderApp[]): InitializedAppDataDictionary =>\n apps.reduce<InitializedAppDataDictionary>((acc, app) => {\n acc[app.id] = getInitialAppData(app);\n\n return acc;\n }, {});\n\nexport const isAppNeedingInterventionUnitWellRefresh = (app: ProviderApp): boolean => {\n const interventionUnitId = getAppAssetSpecificTypeId(app, ASSET_TYPES.intervention_unit.id);\n const wellId = getAppAssetSpecificTypeId(app, ASSET_TYPES.well.id);\n\n return Boolean(interventionUnitId && !wellId);\n};\n\nexport const prepareDataForResolver = (\n apps: PreparedProviderApp[],\n cache: AppsDataCacheRef\n): PreparedResolverData => {\n const appsWellIds: AppAssetIdPair[] = [];\n const appsRigIds: AppAssetIdPair[] = [];\n const appsFracFleetIds: AppAssetIdPair[] = [];\n const appsInterventionUnitIds: AppAssetIdPair[] = [];\n const appsFracFleetToFetchWellsIds: AppAssetIdPair[] = [];\n const appsPadIds: AppAssetIdPair[] = [];\n const appIds: [ProviderApp['id']][] = [];\n\n apps.forEach(app => {\n const appWellId = getAppAssetSpecificTypeId(app, ASSET_TYPES.well.id);\n const appRigId = getAppAssetSpecificTypeId(app, ASSET_TYPES.rig.id);\n const appFracFleetId = getAppAssetSpecificTypeId(app, ASSET_TYPES.frac_fleet.id);\n const appPadId = getAppAssetSpecificTypeId(app, ASSET_TYPES.pad.id);\n const appInterventionUnitId = getAppAssetSpecificTypeId(app, ASSET_TYPES.intervention_unit.id);\n const appId = app.id;\n\n appIds.push([appId]);\n\n if (appInterventionUnitId) {\n appsInterventionUnitIds.push([appId, appInterventionUnitId]);\n // NOTE: we need to fetch well for intervention unit as there is no well in intervention unit\n if (appWellId) appsWellIds.push([appId, appWellId]);\n } else if (appWellId) {\n appsWellIds.push([appId, appWellId]);\n } else if (appRigId) {\n appsRigIds.push([appId, appRigId]);\n } else if (appFracFleetId) {\n appsFracFleetIds.push([appId, appFracFleetId]);\n if (appPadId) appsPadIds.push([appId, appPadId]);\n else appsFracFleetToFetchWellsIds.push([appId, appFracFleetId]);\n }\n });\n\n const { rigsById, wellsById, fracFleetsById, interventionUnitsById } = cache.current;\n\n return {\n appsWellIds,\n appsRigIds,\n appsFracFleetIds,\n appsPadIds,\n appIds,\n appsFracFleetToFetchWellsIds,\n appsInterventionUnitIds,\n uniqueWellIds: getUniqAssetIds(appsWellIds, Object.keys(wellsById)),\n uniqueRigIds: getUniqAssetIds(appsRigIds, Object.keys(rigsById)),\n uniqueFFIds: getUniqAssetIds(appsFracFleetIds, Object.keys(fracFleetsById)),\n uniqueInterventionUnitIds: getUniqAssetIds(\n appsInterventionUnitIds,\n Object.keys(interventionUnitsById)\n ),\n };\n};\n\nexport const buildWellCache = (\n response: JsonApiCollectionResponse<WellResource>\n): Record<string, WellResource> =>\n keyResourcesById(\n response.data.map(well => {\n const rigResource = findIncludedResource(response, 'rig', getRelationshipId(well, 'rig'));\n const program = findIncludedResource(response, 'program', getRelationshipId(well, 'program'));\n const fracFleet = findIncludedResource(\n response,\n 'frac_fleet',\n getRelationshipId(well, 'frac_fleet')\n );\n const pad = findIncludedResource(response, 'pad', getRelationshipId(well, 'pad'));\n const rig = { ...rigResource, program };\n\n return { ...well, rig, fracFleet, pad };\n })\n );\n\nexport const buildRigCache = (\n response: JsonApiCollectionResponse<RigResource>\n): Record<string, RigResource> =>\n keyResourcesById(\n response.data.map(rig => {\n const wellId =\n getRelationshipId(rig, 'active_well') || getRelationshipId(rig, 'last_active_well');\n const wellResource = findIncludedResource(response, 'well', wellId);\n const program = findIncludedResource(response, 'program', getRelationshipId(rig, 'program'));\n const well = isWellResource(wellResource) ? wellResource : undefined;\n\n return { ...rig, well, program };\n })\n );\n\nexport const buildInterventionUnitCache = (\n response: JsonApiCollectionResponse\n): Record<string, InterventionUnitResource> =>\n keyResourcesById(\n response.data.map(interventionUnit => {\n const wellResource = findIncludedResource(\n response,\n 'well',\n getRelationshipId(interventionUnit, 'active_well')\n );\n const well = isWellResource(wellResource) ? wellResource : undefined;\n\n return {\n ...interventionUnit,\n name: interventionUnit.attributes?.name,\n well,\n };\n })\n );\n\nexport const buildFracFleetCache = (\n fracFleets: AppDataFracFleet[]\n): Record<string, AppDataFracFleet> =>\n fracFleets.reduce<Record<string, AppDataFracFleet>>((acc, fracFleet) => {\n if (fracFleet.id !== undefined) acc[fracFleet.id] = fracFleet;\n\n return acc;\n }, {});\n"],"names":["dataFormatter","Jsona","deserializeCollection","response","deserialized","deserialize","Array","isArray","TypeError","getRelationshipId","resource","name","_resource$relationshi","_resource$relationshi2","data","relationships","id","undefined","findIncludedResource","type","included","find","item","isWellResource","keyResourcesById","resources","reduce","acc","getAppAssetSpecificTypeId","app","typeId","_app$settings","Number","settings","getUniqAssetIds","assetIds","cachedAssetIds","_toConsumableArray","Set","map","_ref","_ref2","_slicedToArray","filter","assetId","isFinite","includes","String","fetchWells","_ref3","_asyncToGenerator","_regeneratorRuntime","mark","ids","wrap","_context","prev","next","length","abrupt","getWells","fields","include_arhivation_data","sent","t0","console","error","stop","_callee","_x","apply","this","arguments","fetchRigs","_ref4","_context2","getRigs","_callee2","_x2","fetchAssetEntitiesByAssetIds","_ref5","_context3","getResolvedAssets","assets","_callee3","_x3","getWellObjectFromWellData","well","rig","interventionUnit","_rig$attributes","_rig$attributes2","_rig$program","_rig$program2","_rig$program2$attribu","_well$pad","_well$pad2","_well$pad2$attributes","_well$fracFleet","_well$fracFleet2","_well$fracFleet2$attr","appDataWell","attributes","companyId","appDataInterventionUnit","active_well","_objectSpread","asset_id","program","completionWellInfo","pad","fracFleet","getAppsDataByWells","appsWellIds","wellsById","Object","keys","_ref6","_ref7","appId","wellId","getAppsDataByRigs","appsRigIds","rigsById","_ref8","_ref9","rigId","getAppsDataByFFs","appsFracFleetIds","ffsById","ffWellsData","_ref10","_ref11","ffId","wells","getAppsDataByPads","appsPadIds","padWellsData","_ref12","getAppsDataByInterventionUnits","appsInterventionUnitIds","interventionUnitsById","_ref14","_appsWellIds$find","_ref15","interventionUnitId","appWellId","_ref16","fetchFracFleets","_ref18","fracFleets","_context4","getFracFleets","_callee4","_x4","fetchInterventionUnits","_ref19","_context5","getInterventionUnits","_callee5","_x5","fetchFracFleetWells","_ref20","_callee7","appsFFIds","apps","appsById","requests","responses","_context7","_ref22","_callee6","_ref21","_app$app","_app$app2","_ref23","fracFleetId","options","_context6","frac_fleet_id","DEV_CENTER_CLI_APP_ID","app_key","app_id","getFracFleetWells","_x8","Promise","all","index","_x6","_x7","fetchPadWells","_ref24","_callee9","_context9","_ref26","_callee8","_ref25","_app$app3","_app$app4","_ref27","padId","_context8","getPadWells","_x11","_x9","_x10","getAppHash","ASSET_TYPES","frac_fleet","intervention_unit","getAppSegment","join","isAppWithSettings","Boolean","getInitialAppData","isLoading","appHash","getInitialAppsDataState","isAppNeedingInterventionUnitWellRefresh","prepareDataForResolver","cache","appsFracFleetToFetchWellsIds","appIds","forEach","appRigId","appFracFleetId","appPadId","appInterventionUnitId","push","current","fracFleetsById","uniqueWellIds","uniqueRigIds","uniqueFFIds","uniqueInterventionUnitIds","buildWellCache","rigResource","buildRigCache","wellResource","buildInterventionUnitCache","_interventionUnit$att","buildFracFleetCache"],"mappings":"ovDAqCA,IAAMA,EAAgB,IAAIC,EAUpBC,EAAwB,SAACC,GAC7B,IAAMC,EAAeJ,EAAcK,YAAYF,GAE/C,IAAKG,MAAMC,QAAQH,GACjB,MAAM,IAAII,UAAU,2CAGtB,OAAOJ,CACT,EAEMK,EAAoB,SAACC,EAAuCC,GAAiB,IAAAC,EAAAC,EAC3EC,EAAOJ,iBAAAA,EAAAA,EAAUK,4BAAqB,UAA/BH,EAA0BD,UAAK,IAAA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ACnC,IACF,EAEU+H,EAAgB,SAC3B1O,GAAgD,OAEhDqB,EACErB,EAASW,KAAKyB,KAAI,SAAAiD,GAChB,IAAMgC,EACJ/G,EAAkB+E,EAAK,gBAAkB/E,EAAkB+E,EAAK,oBAC5DsJ,EAAe5N,EAAqBf,EAAU,OAAQqH,GACtDZ,EAAU1F,EAAqBf,EAAU,UAAWM,EAAkB+E,EAAK,YAC3ED,EAAOhE,EAAeuN,GAAgBA,OAAe7N,EAE3D,OAAAyF,EAAAA,EAAA,CAAA,EAAYlB,GAAG,CAAA,EAAA,CAAED,KAAAA,EAAMqB,QAAAA,GACxB,IACF,EAEUmI,EAA6B,SACxC5O,GAAmC,OAEnCqB,EACErB,EAASW,KAAKyB,KAAI,SAAAkD,GAAoB,IAAAuJ,EAC9BF,EAAe5N,EACnBf,EACA,OACAM,EAAkBgF,EAAkB,gBAEhCF,EAAOhE,EAAeuN,GAAgBA,OAAe7N,EAE3D,OAAAyF,EAAAA,EAAA,CAAA,EACKjB,GAAgB,CAAA,EAAA,CACnB9E,KAAiC,UAA3B8E,EAAiBa,kBAAU,IAAA0I,OAAA,EAA3BA,EAA6BrO,KACnC4E,KAAAA,GAEH,IACF,EAEU0J,EAAsB,SACjC3F,GAA8B,OAE9BA,EAAW5H,QAAyC,SAACC,EAAKoF,GAGxD,YAFqB9F,IAAjB8F,EAAU/F,KAAkBW,EAAIoF,EAAU/F,IAAM+F,GAE7CpF,CACR,GAAE,CAAE,EAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"DevCenterIsolatedApp.d.ts","sourceRoot":"","sources":["../../../../src/components/DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedApp.js"],"names":[],"mappings":"AA+SA,eAAO,MAAM,oBAAoB,KAA4C,CAAC"}
1
+ {"version":3,"file":"DevCenterIsolatedApp.d.ts","sourceRoot":"","sources":["../../../../src/components/DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedApp.js"],"names":[],"mappings":"AAkTA,eAAO,MAAM,oBAAoB,KAA4C,CAAC"}
@@ -1,2 +1,2 @@
1
- import e from"@babel/runtime/helpers/defineProperty";import n from"@babel/runtime/helpers/slicedToArray";import t from"@babel/runtime/helpers/objectWithoutProperties";import{useMemo as o,useRef as r,useState as i,useEffect as a,useContext as p,useCallback as s}from"react";import{flushSync as l}from"react-dom";import c from"classnames";import{withRouter as d}from"react-router-dom";import{noop as u}from"lodash";import m from"query-string";import v from"prop-types";import{APP_IFRAME_ATTRIBUTE as f,IsolatedPage as C}from"./IsolatedPage.js";import{ISOLATED_PAGE_APP_CONTAINER_ID as b}from"./constants.js";import{useFullscreenModes as g}from"./useFullscreenModes.js";import h from"./DevCenterIsolatedApp.module.scss.js";import A from"../AppContext.js";import j from"../../../permissions/PermissionsContext.js";import"../../../permissions/constants/index.js";import"../../../permissions/withPermissionsHOC.js";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"../../../clients/jsonApi/index.js";import"../../../utils/shareRecentRequest.js";import"../../../permissions/ProvidePermissions.js";import{getUserUnits as y,subscribeForUserUnitsUpdates as w}from"../../../utils/index.js";import"../AppHeader/AppHeader.js";import"../AppSideBar/AppSideBar.js";import"../AppsDataProvider/effects/utils.js";import"@babel/runtime/helpers/toConsumableArray";import{createDevCenterRouter as x,isCorvaApp as M,isIsolationEnabledInPackageManifest as S,isAppMaximized as I}from"../../../utils/devcenter.js";import{jsx as L}from"react/jsx-runtime";import R from"../DevCenterAppContainer/DevCenterAppContainer.js";import"../NavigationBar/NavigationBar.js";import"../SideBar/SideBar.js";import"../AppSettingsPopover/AppSettingsPopover.js";import"../AppFilterPanelLayout/AppFilterPanelLayout.js";import"../DevCenterRouterContext/DevCenterRouterContext.js";import"../DevCenterRouterContext/UniversalLink/UniversalLink.js";import"./DevCenterIsolatedAppPage.js";import{getAppVersion as P}from"../DevCenterAppContainer/utils.js";import{isInsideNewMobileApp as D}from"../../../utils/mobileDetect.js";var F=["isIsolationFeatureEnabled","onAppFullscreenTransparentMode","onIsMaximizedChange","onInnerContainerMouseEnter","onInnerContainerMouseLeave","onAppContainerClick","setInnerContainerRefFn","onAppRemove","onSettingChange","onSettingsChange","updateCurrentDashboardAppLastAnnotation","apiRateLimiterConfig","trackApiRateLimiterException"];function O(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function E(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?O(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):O(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var T={};function B(e){var d,v,O,B,k,W,z,_=e.isIsolationFeatureEnabled,N=void 0!==_&&_,q=e.onAppFullscreenTransparentMode,U=void 0===q?u:q,H=e.onIsMaximizedChange,V=void 0===H?u:H,G=e.onInnerContainerMouseEnter,J=void 0===G?u:G,K=e.onInnerContainerMouseLeave,Q=void 0===K?u:K,X=e.onAppContainerClick,Y=void 0===X?u:X,Z=e.setInnerContainerRefFn,$=void 0===Z?u:Z,ee=e.onAppRemove,ne=void 0===ee?void 0:ee,te=e.onSettingChange,oe=void 0===te?u:te,re=e.onSettingsChange,ie=void 0===re?u:re,ae=e.updateCurrentDashboardAppLastAnnotation,pe=void 0===ae?u:ae,se=e.apiRateLimiterConfig,le=void 0===se?T:se,ce=e.trackApiRateLimiterException,de=t(e,F),ue=o((function(){return x(de.history)}),[null===(d=de.history)||void 0===d?void 0:d.location]),me=M(null==de||null===(v=de.app)||void 0===v?void 0:v.app)&&!S(null==de||null===(O=de.app)||void 0===O?void 0:O.package)||!N,ve=me?R:C,fe=null===(B=de.app)||void 0===B||null===(k=B.app)||void 0===k?void 0:k.app_key,Ce=P(de.app),be="".concat(fe,"-").concat(Ce),ge=r(),he=r(),Ae=r(),je=r(!1),ye=r(!1),we=I(m.parse(null===(W=de.history)||void 0===W||null===(z=W.location)||void 0===z?void 0:z.search),de.app.id),xe=r(we);xe.current=we;var Me=i(y()),Se=n(Me,2),Ie=Se[0],Le=Se[1];a((function(){var e=w((function(e){return Le(e)}));return function(){return e()}}),[]);var Re=p(A),Pe=j();function De(){U({appId:de.app.id,isModeEnabled:!1}),document.body.classList.remove("dc-isolated-app__body-overflow",h.compensateScroll)}var Fe=s((function(e){var n,t,o,r,i,a=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!N||me||xe.current&&!je.current||je.current===e){var p;a&&ye.current!==a&&(ye.current=a,null===(p=he.current)||void 0===p||p.classList.add(h.containerMaximizedTransparentModal))}else{var s,c=e?"add":"remove";if(null===(n=he.current)||void 0===n||n.classList[c](h.containerMaximizedTransparent),a||"remove"===c)null===(s=he.current)||void 0===s||s.classList[c](h.containerMaximizedTransparentModal);ge.current=null===(t=he.current)||void 0===t||null===(o=t.querySelector("[".concat(f,"]")))||void 0===o||null===(r=o.contentWindow)||void 0===r?void 0:r.document;var d=null===(i=ge.current)||void 0===i?void 0:i.getElementById(b);if(d){if(e){var u=Ae.current.getBoundingClientRect(),m=u.top,v=u.left,C=u.width,g=u.height,A=window.innerWidth!==document.body.clientWidth;l((function(){U({appId:de.app.id,isModeEnabled:!0})})),d.setAttribute("style","\n top: ".concat(m,"px;\n left: ").concat(v,"px;\n width: ").concat(C,"px;\n height: ").concat(g,"px;\n position: absolute;\n ")),document.body.classList.add("dc-isolated-app__body-overflow",A&&h.compensateScroll)}else l((function(){U({appId:de.app.id,isModeEnabled:!1})})),d.setAttribute("style",""),document.body.classList.remove("dc-isolated-app__body-overflow",h.compensateScroll);je.current=e,ye.current=a}}}),[N,me,xe]);a((function(){return De}),[]),a((function(){we&&je.current&&Fe(!1)}),[we]);var Oe=g({containerRef:Ae,appInstanceId:de.app.id,isMaximized:we}),Ee=Oe.isBrowserFullscreen,Te=Oe.enterBrowserFullscreen,Be=Oe.exitBrowserFullscreen,ke=Oe.isSeparateWindow,We=Oe.openSeparateWindow,ze=Oe.closeSeparateWindow,_e=Oe.setSeparateWindowTitle,Ne=s((function(e){he.current=e,$(e)}),[]);return L("div",{className:c("dc-isolated-app",h.fixedSizeContainer),ref:Ae,children:L("div",{ref:Ne,onMouseEnter:J,onMouseLeave:Q,"data-testid":"".concat("DevCenter_AppContainer","_").concat(de.app.app.name),className:c(h.container,D&&h.newMobileAppContainer,we&&h.containerMaximized),children:L(ve,E(E({},de),{},{isBrowserFullscreen:Ee,enterBrowserFullscreen:Te,exitBrowserFullscreen:Be,isSeparateWindow:ke,openSeparateWindow:We,closeSeparateWindow:ze,setSeparateWindowTitle:_e,isNonIsolatedApp:me,appContextValue:Re,devCenterRouter:ue,globalNotificationToastsAPI:window[Symbol.for("notificationToasts")],globalMixpanelEventTracker:window[Symbol.for("logToMixpanel")],onAppContainerClick:Y,onAppRemove:ne,onIsMaximizedChange:V,onSettingChange:oe,onSettingsChange:ie,permissionsContextValue:Pe,setIsFullscreenModalMode:Fe,userUnits:Ie,trackApiRateLimiterException:ce,updateCurrentDashboardAppLastAnnotation:pe,apiRateLimiterConfig:le}),be)})})}B.propTypes={app:v.shape({id:v.number,app:v.shape({name:v.string})}).isRequired,currentUser:v.shape({}).isRequired,isIsolationFeatureEnabled:v.bool,onAppContainerClick:v.func,onAppFullscreenTransparentMode:v.func,onAppRemove:v.func,onInnerContainerMouseEnter:v.func,onInnerContainerMouseLeave:v.func,onIsMaximizedChange:v.func,onSettingChange:v.func,onSettingsChange:v.func,setInnerContainerRefFn:v.func,updateCurrentDashboardAppLastAnnotation:v.func,apiRateLimiterConfig:v.object};var k=d(B);export{k as DevCenterIsolatedApp};
1
+ import e from"@babel/runtime/helpers/defineProperty";import n from"@babel/runtime/helpers/slicedToArray";import t from"@babel/runtime/helpers/objectWithoutProperties";import{useMemo as o,useRef as r,useState as i,useEffect as a,useContext as p,useCallback as s}from"react";import{flushSync as l}from"react-dom";import c from"classnames";import{withRouter as d}from"react-router-dom";import{noop as u}from"lodash";import m from"query-string";import v from"prop-types";import{APP_IFRAME_ATTRIBUTE as f,IsolatedPage as C}from"./IsolatedPage.js";import{ISOLATED_PAGE_APP_CONTAINER_ID as b}from"./constants.js";import{useFullscreenModes as g}from"./useFullscreenModes.js";import h from"./DevCenterIsolatedApp.module.scss.js";import A from"../AppContext.js";import j from"../../../permissions/PermissionsContext.js";import"../../../permissions/constants/index.js";import"../../../permissions/withPermissionsHOC.js";import"@babel/runtime/helpers/asyncToGenerator";import"@babel/runtime/regenerator";import"../../../clients/jsonApi/index.js";import"../../../utils/shareRecentRequest.js";import"../../../permissions/ProvidePermissions.js";import{getUserUnits as y,subscribeForUserUnitsUpdates as w}from"../../../utils/index.js";import"../AppHeader/AppHeader.js";import"../AppSideBar/AppSideBar.js";import"../AppsDataProvider/effects/utils.js";import"@babel/runtime/helpers/toConsumableArray";import{createDevCenterRouter as x,isCorvaApp as M,isIsolationEnabledInPackageManifest as S,isAppMaximized as I}from"../../../utils/devcenter.js";import{jsx as L}from"react/jsx-runtime";import R from"../DevCenterAppContainer/DevCenterAppContainer.js";import"../NavigationBar/NavigationBar.js";import"../SideBar/SideBar.js";import"../AppSettingsPopover/AppSettingsPopover.js";import"../AppFilterPanelLayout/AppFilterPanelLayout.js";import"../DevCenterRouterContext/DevCenterRouterContext.js";import"../DevCenterRouterContext/UniversalLink/UniversalLink.js";import"./DevCenterIsolatedAppPage.js";import{getAppVersion as P}from"../DevCenterAppContainer/utils.js";import{isInsideNewMobileApp as D}from"../../../utils/mobileDetect.js";var F=["isIsolationFeatureEnabled","onAppFullscreenTransparentMode","onIsMaximizedChange","onInnerContainerMouseEnter","onInnerContainerMouseLeave","onAppContainerClick","setInnerContainerRefFn","onAppRemove","onSettingChange","onSettingsChange","updateCurrentDashboardAppLastAnnotation","apiRateLimiterConfig","trackApiRateLimiterException"];function O(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function E(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?O(Object(o),!0).forEach((function(t){e(n,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):O(Object(o)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}))}return n}var T={};function B(e){var d,v,O,B,k,W,z,_=e.isIsolationFeatureEnabled,N=void 0!==_&&_,q=e.onAppFullscreenTransparentMode,U=void 0===q?u:q,H=e.onIsMaximizedChange,V=void 0===H?u:H,G=e.onInnerContainerMouseEnter,J=void 0===G?u:G,K=e.onInnerContainerMouseLeave,Q=void 0===K?u:K,X=e.onAppContainerClick,Y=void 0===X?u:X,Z=e.setInnerContainerRefFn,$=void 0===Z?u:Z,ee=e.onAppRemove,ne=void 0===ee?void 0:ee,te=e.onSettingChange,oe=void 0===te?u:te,re=e.onSettingsChange,ie=void 0===re?u:re,ae=e.updateCurrentDashboardAppLastAnnotation,pe=void 0===ae?u:ae,se=e.apiRateLimiterConfig,le=void 0===se?T:se,ce=e.trackApiRateLimiterException,de=t(e,F),ue=o((function(){return x(de.history)}),[null===(d=de.history)||void 0===d?void 0:d.location]),me=M(null==de||null===(v=de.app)||void 0===v?void 0:v.app)&&!S(null==de||null===(O=de.app)||void 0===O?void 0:O.package)||!N,ve=me?R:C,fe=null===(B=de.app)||void 0===B||null===(k=B.app)||void 0===k?void 0:k.app_key,Ce=P(de.app),be="".concat(fe,"-").concat(Ce),ge=r(),he=r(),Ae=r(),je=r(!1),ye=r(!1),we=I(m.parse(null===(W=de.history)||void 0===W||null===(z=W.location)||void 0===z?void 0:z.search),de.app.id),xe=r(we);xe.current=we;var Me=i(y()),Se=n(Me,2),Ie=Se[0],Le=Se[1];a((function(){var e=w((function(e){return Le(e)}));return function(){return e()}}),[]);var Re=p(A),Pe=j();function De(){U({appId:de.app.id,isModeEnabled:!1}),document.body.classList.remove("dc-isolated-app__body-overflow",h.compensateScroll)}var Fe=s((function(e){var n,t,o,r,i,a=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!N||me||xe.current&&!je.current||je.current===e){var p;a&&ye.current!==a&&(ye.current=a,null===(p=he.current)||void 0===p||p.classList.add(h.containerMaximizedTransparentModal))}else{var s,c=e?"add":"remove";if(null===(n=he.current)||void 0===n||n.classList[c](h.containerMaximizedTransparent),a||"remove"===c)null===(s=he.current)||void 0===s||s.classList[c](h.containerMaximizedTransparentModal);ge.current=null===(t=he.current)||void 0===t||null===(o=t.querySelector("[".concat(f,"]")))||void 0===o||null===(r=o.contentWindow)||void 0===r?void 0:r.document;var d=null===(i=ge.current)||void 0===i?void 0:i.getElementById(b);if(d){if(e){var u=Ae.current.getBoundingClientRect(),m=u.top,v=u.left,C=u.width,g=u.height,A=window.innerWidth!==document.body.clientWidth;l((function(){U({appId:de.app.id,isModeEnabled:!0})})),d.setAttribute("style","\n top: ".concat(m,"px;\n left: ").concat(v,"px;\n width: ").concat(C,"px;\n height: ").concat(g,"px;\n position: absolute;\n ")),document.body.classList.add("dc-isolated-app__body-overflow",A&&h.compensateScroll)}else l((function(){U({appId:de.app.id,isModeEnabled:!1})})),d.setAttribute("style",""),document.body.classList.remove("dc-isolated-app__body-overflow",h.compensateScroll);je.current=e,ye.current=a}}}),[N,me,xe]);a((function(){return De}),[]),a((function(){we&&je.current&&Fe(!1)}),[we]);var Oe=g({containerRef:Ae,appInstanceId:de.app.id,isMaximized:we}),Ee=Oe.isBrowserFullscreen,Te=Oe.enterBrowserFullscreen,Be=Oe.exitBrowserFullscreen,ke=Oe.isSeparateWindow,We=Oe.openSeparateWindow,ze=Oe.closeSeparateWindow,_e=Oe.setSeparateWindowTitle,Ne=s((function(e){he.current=e,$(e)}),[]);return L("div",{className:c("dc-isolated-app",h.fixedSizeContainer,we&&h.containerMaximized),ref:Ae,children:L("div",{ref:Ne,onMouseEnter:J,onMouseLeave:Q,"data-testid":"".concat("DevCenter_AppContainer","_").concat(de.app.app.name),className:c(h.container,D&&h.newMobileAppContainer),children:L(ve,E(E({},de),{},{isBrowserFullscreen:Ee,enterBrowserFullscreen:Te,exitBrowserFullscreen:Be,isSeparateWindow:ke,openSeparateWindow:We,closeSeparateWindow:ze,setSeparateWindowTitle:_e,isNonIsolatedApp:me,appContextValue:Re,devCenterRouter:ue,globalNotificationToastsAPI:window[Symbol.for("notificationToasts")],globalMixpanelEventTracker:window[Symbol.for("logToMixpanel")],onAppContainerClick:Y,onAppRemove:ne,onIsMaximizedChange:V,onSettingChange:oe,onSettingsChange:ie,permissionsContextValue:Pe,setIsFullscreenModalMode:Fe,userUnits:Ie,trackApiRateLimiterException:ce,updateCurrentDashboardAppLastAnnotation:pe,apiRateLimiterConfig:le}),be)})})}B.propTypes={app:v.shape({id:v.number,app:v.shape({name:v.string})}).isRequired,currentUser:v.shape({}).isRequired,isIsolationFeatureEnabled:v.bool,onAppContainerClick:v.func,onAppFullscreenTransparentMode:v.func,onAppRemove:v.func,onInnerContainerMouseEnter:v.func,onInnerContainerMouseLeave:v.func,onIsMaximizedChange:v.func,onSettingChange:v.func,onSettingsChange:v.func,setInnerContainerRefFn:v.func,updateCurrentDashboardAppLastAnnotation:v.func,apiRateLimiterConfig:v.object};var k=d(B);export{k as DevCenterIsolatedApp};
2
2
  //# sourceMappingURL=DevCenterIsolatedApp.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DevCenterIsolatedApp.js","sources":["../../../../src/components/DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedApp.js"],"sourcesContent":["import { useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';\nimport { flushSync } from 'react-dom';\nimport classNames from 'classnames';\nimport { withRouter } from 'react-router-dom';\nimport { noop } from 'lodash';\nimport queryString from 'query-string';\nimport PropTypes from 'prop-types';\n\nimport { APP_IFRAME_ATTRIBUTE, IsolatedPage } from './IsolatedPage';\nimport { ISOLATED_PAGE_APP_CONTAINER_ID } from './constants';\nimport { useFullscreenModes } from './useFullscreenModes';\n\nimport styles from './DevCenterIsolatedApp.module.scss';\n\nimport AppContext from '~/components/DevCenter/AppContext';\nimport { usePermissionsContext } from '~/permissions';\nimport { devcenter as devCenterUtils, getUserUnits, subscribeForUserUnitsUpdates } from '~/utils';\nimport { DevCenterAppContainer } from '~/components/DevCenter';\nimport { getAppVersion } from '~/components/DevCenter/DevCenterAppContainer/utils';\nimport { isInsideNewMobileApp } from '~/utils/mobileDetect';\n\nconst PAGE_NAME = 'DevCenter_AppContainer';\nconst DEFAULT_API_RATE_LIMITER_CONFIG = {};\n\nfunction DevCenterIsolatedAppComponent({\n isIsolationFeatureEnabled = false,\n onAppFullscreenTransparentMode = noop,\n onIsMaximizedChange = noop,\n onInnerContainerMouseEnter = noop,\n onInnerContainerMouseLeave = noop,\n onAppContainerClick = noop,\n setInnerContainerRefFn = noop,\n onAppRemove = undefined,\n onSettingChange = noop,\n onSettingsChange = noop,\n updateCurrentDashboardAppLastAnnotation = noop,\n apiRateLimiterConfig = DEFAULT_API_RATE_LIMITER_CONFIG,\n trackApiRateLimiterException,\n ...props\n}) {\n const devCenterRouter = useMemo(\n () => devCenterUtils.createDevCenterRouter(props.history),\n [props.history?.location]\n );\n\n const isNonIsolatedApp =\n (devCenterUtils.isCorvaApp(props?.app?.app) &&\n !devCenterUtils.isIsolationEnabledInPackageManifest(props?.app?.package)) ||\n !isIsolationFeatureEnabled;\n\n const DCAppComponent = isNonIsolatedApp ? DevCenterAppContainer : IsolatedPage;\n\n // Key to force iframe recreation when app version changes.\n // This ensures global dependencies are re-initialized for the new version.\n const appKey = props.app?.app?.app_key;\n const appVersion = getAppVersion(props.app);\n const iframeKey = `${appKey}-${appVersion}`;\n\n const appIframeDocument = useRef();\n const containerRef = useRef();\n const fixedSizeContainerRef = useRef();\n const fullscreenModeRef = useRef(false);\n const fullscreenModalModeRef = useRef(false);\n\n const isAppMaximized = devCenterUtils.isAppMaximized(\n queryString.parse(props.history?.location?.search),\n props.app.id\n );\n\n // save to ref to not re-create setIsFullscreenModalMode callback on change and reduce the amoount of DC apps re-renders\n const isAppMaximizedRef = useRef(isAppMaximized);\n isAppMaximizedRef.current = isAppMaximized;\n\n const [userUnits, setUserUnits] = useState(getUserUnits());\n\n useEffect(() => {\n const unsubscribeFn = subscribeForUserUnitsUpdates(newUserUnits => setUserUnits(newUserUnits));\n\n return () => unsubscribeFn();\n }, []);\n\n const appContextValue = useContext(AppContext);\n const permissionsContextValue = usePermissionsContext();\n\n /*\n What is fullscreen modal mode?\n\n Our apps, are shown in isolated iFrames. Because of it, when an app has some modal\n and opens it - it's opened inside of its iframe, instead of opening at the center of the screen.\n\n To make app modals & other elements be opened at the center of the screen, as if they are not inside of an iframe,\n we use some hacks.\n\n When the app wants to open a fullscreen element, we make its iframe fullscreen, but with transparent background,\n and we set width/height & position of that app iframe to inner app container that is located inside of the iframe.\n So when iframe's fullscreen element is opened, it looks like it's a part of the platform, and the app which shows the element, looks like\n usual, not in fullscreen\n\n So the platform provides this setIsFullscreenModalMode function to DC apps.\n When DC app wants to open a modal that should be opened at the center of the screen - it needs to\n call setIsFullscreenModalMode(true) first. And when it closes the modal - setIsFullscreenModalMode(false)\n\n Two things are important about this\n - all these styles that make this invisible background work should be applied at once\n - enter and exit from the mode, shouldn't trigger even a single re-render, as it may impact\n some elements inside the DC app\n\n There's a second parameter to `setIsFullscreenModalMode`: `isModal`. It should be used when a fullscreen overlay is displayed\n (Modal, for instance) that should cover everything on screen.\n\n What it does - it basically sets the stretched element's z-index to a very high value, so it covers every other UI element in CWF\n */\n\n function handleAppFullscreenTransparentModeExit() {\n onAppFullscreenTransparentMode({ appId: props.app.id, isModeEnabled: false });\n document.body.classList.remove('dc-isolated-app__body-overflow', styles.compensateScroll);\n }\n\n const setIsFullscreenModalMode = useCallback(\n function setIsFullscreenModalMode(nextIsFullscreenModalModeValue, isModal = false) {\n // When an app is already in fullscreen mode, no need to use this\n // invisible fullscreen mode to make elements take the whole screen\n if (\n !isIsolationFeatureEnabled ||\n isNonIsolatedApp ||\n (isAppMaximizedRef.current && !fullscreenModeRef.current) ||\n fullscreenModeRef.current === nextIsFullscreenModalModeValue\n ) {\n // Adding modal class if modal is opened when non-modal is already open\n if (isModal && fullscreenModalModeRef.current !== isModal) {\n fullscreenModalModeRef.current = isModal;\n containerRef.current?.classList.add(styles.containerMaximizedTransparentModal);\n }\n\n return;\n }\n\n const classesEditMethod = nextIsFullscreenModalModeValue ? 'add' : 'remove';\n\n containerRef.current?.classList[classesEditMethod](styles.containerMaximizedTransparent);\n\n if (isModal || classesEditMethod === 'remove') {\n containerRef.current?.classList[classesEditMethod](\n styles.containerMaximizedTransparentModal\n );\n }\n\n appIframeDocument.current = containerRef.current?.querySelector(\n `[${APP_IFRAME_ATTRIBUTE}]`\n )?.contentWindow?.document;\n\n const isolatedPageAppContainer = appIframeDocument.current?.getElementById(\n ISOLATED_PAGE_APP_CONTAINER_ID\n );\n\n if (!isolatedPageAppContainer) {\n return;\n }\n\n if (nextIsFullscreenModalModeValue) {\n // 1. BATCH ALL READS FIRST - prevents layout thrashing\n const { top, left, width, height } = fixedSizeContainerRef.current.getBoundingClientRect();\n const isBodyScrollVisible = window.innerWidth !== document.body.clientWidth;\n\n // 2. Flush React state updates synchronously to prevent deferred renders\n flushSync(() => {\n onAppFullscreenTransparentMode({ appId: props.app.id, isModeEnabled: true });\n });\n\n // 3. BATCH ALL DOM WRITES - after reads and React flush\n isolatedPageAppContainer.setAttribute(\n 'style',\n `\n top: ${top}px;\n left: ${left}px;\n width: ${width}px;\n height: ${height}px;\n position: absolute;\n `\n );\n document.body.classList.add(\n 'dc-isolated-app__body-overflow',\n isBodyScrollVisible && styles.compensateScroll\n );\n } else {\n // Flush React state updates synchronously before DOM writes\n flushSync(() => {\n onAppFullscreenTransparentMode({ appId: props.app.id, isModeEnabled: false });\n });\n\n // DOM writes after React flush\n isolatedPageAppContainer.setAttribute('style', '');\n document.body.classList.remove('dc-isolated-app__body-overflow', styles.compensateScroll);\n }\n fullscreenModeRef.current = nextIsFullscreenModalModeValue;\n fullscreenModalModeRef.current = isModal;\n },\n [isIsolationFeatureEnabled, isNonIsolatedApp, isAppMaximizedRef]\n );\n\n useEffect(() => {\n return handleAppFullscreenTransparentModeExit;\n }, []);\n\n useEffect(() => {\n if (isAppMaximized && fullscreenModeRef.current) {\n setIsFullscreenModalMode(false);\n }\n }, [isAppMaximized]);\n\n const {\n isBrowserFullscreen,\n enterBrowserFullscreen,\n exitBrowserFullscreen,\n isSeparateWindow,\n openSeparateWindow,\n closeSeparateWindow,\n setSeparateWindowTitle,\n } = useFullscreenModes({\n containerRef: fixedSizeContainerRef,\n appInstanceId: props.app.id,\n isMaximized: isAppMaximized,\n });\n\n /**\n * This should be the same function as calling react-intersection-observer's ref setter actually triggers re-render.\n * Which in its turn causes infinite re-render loop.\n */\n const setContainerRefs = useCallback(node => {\n containerRef.current = node;\n setInnerContainerRefFn(node);\n }, []);\n\n return (\n <div\n className={classNames('dc-isolated-app', styles.fixedSizeContainer)}\n ref={fixedSizeContainerRef}\n >\n <div\n ref={setContainerRefs}\n onMouseEnter={onInnerContainerMouseEnter}\n onMouseLeave={onInnerContainerMouseLeave}\n data-testid={`${PAGE_NAME}_${props.app.app.name}`}\n className={classNames(\n styles.container,\n isInsideNewMobileApp && styles.newMobileAppContainer,\n isAppMaximized && styles.containerMaximized\n )}\n >\n <DCAppComponent\n key={iframeKey}\n {...props}\n isBrowserFullscreen={isBrowserFullscreen}\n enterBrowserFullscreen={enterBrowserFullscreen}\n exitBrowserFullscreen={exitBrowserFullscreen}\n isSeparateWindow={isSeparateWindow}\n openSeparateWindow={openSeparateWindow}\n closeSeparateWindow={closeSeparateWindow}\n setSeparateWindowTitle={setSeparateWindowTitle}\n isNonIsolatedApp={isNonIsolatedApp}\n appContextValue={appContextValue}\n devCenterRouter={devCenterRouter}\n globalNotificationToastsAPI={window[Symbol.for('notificationToasts')]}\n globalMixpanelEventTracker={window[Symbol.for('logToMixpanel')]}\n onAppContainerClick={onAppContainerClick}\n onAppRemove={onAppRemove}\n onIsMaximizedChange={onIsMaximizedChange}\n onSettingChange={onSettingChange}\n onSettingsChange={onSettingsChange}\n permissionsContextValue={permissionsContextValue}\n setIsFullscreenModalMode={setIsFullscreenModalMode}\n userUnits={userUnits}\n trackApiRateLimiterException={trackApiRateLimiterException}\n updateCurrentDashboardAppLastAnnotation={updateCurrentDashboardAppLastAnnotation}\n apiRateLimiterConfig={apiRateLimiterConfig}\n />\n </div>\n </div>\n );\n}\n\nDevCenterIsolatedAppComponent.propTypes = {\n app: PropTypes.shape({\n id: PropTypes.number,\n app: PropTypes.shape({\n name: PropTypes.string,\n }),\n }).isRequired,\n currentUser: PropTypes.shape({}).isRequired,\n isIsolationFeatureEnabled: PropTypes.bool,\n onAppContainerClick: PropTypes.func,\n onAppFullscreenTransparentMode: PropTypes.func,\n onAppRemove: PropTypes.func,\n onInnerContainerMouseEnter: PropTypes.func,\n onInnerContainerMouseLeave: PropTypes.func,\n onIsMaximizedChange: PropTypes.func,\n onSettingChange: PropTypes.func,\n onSettingsChange: PropTypes.func,\n setInnerContainerRefFn: PropTypes.func,\n updateCurrentDashboardAppLastAnnotation: PropTypes.func,\n apiRateLimiterConfig: PropTypes.object,\n};\n\nexport const DevCenterIsolatedApp = withRouter(DevCenterIsolatedAppComponent);\n"],"names":["DEFAULT_API_RATE_LIMITER_CONFIG","DevCenterIsolatedAppComponent","_ref","_props$history","_props$app","_props$app2","_props$app3","_props$app3$app","_props$history2","_props$history2$locat","_ref$isIsolationFeatu","isIsolationFeatureEnabled","_ref$onAppFullscreenT","onAppFullscreenTransparentMode","noop","_ref$onIsMaximizedCha","onIsMaximizedChange","_ref$onInnerContainer","onInnerContainerMouseEnter","_ref$onInnerContainer2","onInnerContainerMouseLeave","_ref$onAppContainerCl","onAppContainerClick","_ref$setInnerContaine","setInnerContainerRefFn","_ref$onAppRemove","onAppRemove","undefined","_ref$onSettingChange","onSettingChange","_ref$onSettingsChange","onSettingsChange","_ref$updateCurrentDas","updateCurrentDashboardAppLastAnnotation","_ref$apiRateLimiterCo","apiRateLimiterConfig","trackApiRateLimiterException","props","_objectWithoutProperties","_excluded","devCenterRouter","useMemo","devCenterUtils","history","location","isNonIsolatedApp","app","package","DCAppComponent","DevCenterAppContainer","IsolatedPage","appKey","app_key","appVersion","getAppVersion","iframeKey","concat","appIframeDocument","useRef","containerRef","fixedSizeContainerRef","fullscreenModeRef","fullscreenModalModeRef","isAppMaximized","queryString","parse","search","id","isAppMaximizedRef","current","_useState","useState","getUserUnits","_useState2","_slicedToArray","userUnits","setUserUnits","useEffect","unsubscribeFn","subscribeForUserUnitsUpdates","newUserUnits","appContextValue","useContext","AppContext","permissionsContextValue","usePermissionsContext","handleAppFullscreenTransparentModeExit","appId","isModeEnabled","document","body","classList","remove","styles","compensateScroll","setIsFullscreenModalMode","useCallback","nextIsFullscreenModalModeValue","_containerRef$current2","_containerRef$current4","_containerRef$current5","_containerRef$current6","_appIframeDocument$cu","isModal","_containerRef$current","add","containerMaximizedTransparentModal","_containerRef$current3","classesEditMethod","containerMaximizedTransparent","querySelector","APP_IFRAME_ATTRIBUTE","contentWindow","isolatedPageAppContainer","getElementById","ISOLATED_PAGE_APP_CONTAINER_ID","_fixedSizeContainerRe","getBoundingClientRect","top","left","width","height","isBodyScrollVisible","window","innerWidth","clientWidth","flushSync","setAttribute","_useFullscreenModes","useFullscreenModes","appInstanceId","isMaximized","isBrowserFullscreen","enterBrowserFullscreen","exitBrowserFullscreen","isSeparateWindow","openSeparateWindow","closeSeparateWindow","setSeparateWindowTitle","setContainerRefs","node","_jsx","className","classNames","fixedSizeContainer","ref","children","onMouseEnter","onMouseLeave","PAGE_NAME","name","container","isInsideNewMobileApp","newMobileAppContainer","containerMaximized","_objectSpread","globalNotificationToastsAPI","Symbol","for","globalMixpanelEventTracker","propTypes","PropTypes","shape","number","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2I,EAAUO,KAC/B3J,+BAAgCoJ,EAAUO,KAC1C9I,YAAauI,EAAUO,KACvBtJ,2BAA4B+I,EAAUO,KACtCpJ,2BAA4B6I,EAAUO,KACtCxJ,oBAAqBiJ,EAAUO,KAC/B3I,gBAAiBoI,EAAUO,KAC3BzI,iBAAkBkI,EAAUO,KAC5BhJ,uBAAwByI,EAAUO,KAClCvI,wCAAyCgI,EAAUO,KACnDrI,qBAAsB8H,EAAUQ,YAGrBC,EAAuBC,EAAW1K"}
1
+ {"version":3,"file":"DevCenterIsolatedApp.js","sources":["../../../../src/components/DevCenter/IsolatedDevCenterAppContainer/DevCenterIsolatedApp.js"],"sourcesContent":["import { useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';\nimport { flushSync } from 'react-dom';\nimport classNames from 'classnames';\nimport { withRouter } from 'react-router-dom';\nimport { noop } from 'lodash';\nimport queryString from 'query-string';\nimport PropTypes from 'prop-types';\n\nimport { APP_IFRAME_ATTRIBUTE, IsolatedPage } from './IsolatedPage';\nimport { ISOLATED_PAGE_APP_CONTAINER_ID } from './constants';\nimport { useFullscreenModes } from './useFullscreenModes';\n\nimport styles from './DevCenterIsolatedApp.module.scss';\n\nimport AppContext from '~/components/DevCenter/AppContext';\nimport { usePermissionsContext } from '~/permissions';\nimport { devcenter as devCenterUtils, getUserUnits, subscribeForUserUnitsUpdates } from '~/utils';\nimport { DevCenterAppContainer } from '~/components/DevCenter';\nimport { getAppVersion } from '~/components/DevCenter/DevCenterAppContainer/utils';\nimport { isInsideNewMobileApp } from '~/utils/mobileDetect';\n\nconst PAGE_NAME = 'DevCenter_AppContainer';\nconst DEFAULT_API_RATE_LIMITER_CONFIG = {};\n\nfunction DevCenterIsolatedAppComponent({\n isIsolationFeatureEnabled = false,\n onAppFullscreenTransparentMode = noop,\n onIsMaximizedChange = noop,\n onInnerContainerMouseEnter = noop,\n onInnerContainerMouseLeave = noop,\n onAppContainerClick = noop,\n setInnerContainerRefFn = noop,\n onAppRemove = undefined,\n onSettingChange = noop,\n onSettingsChange = noop,\n updateCurrentDashboardAppLastAnnotation = noop,\n apiRateLimiterConfig = DEFAULT_API_RATE_LIMITER_CONFIG,\n trackApiRateLimiterException,\n ...props\n}) {\n const devCenterRouter = useMemo(\n () => devCenterUtils.createDevCenterRouter(props.history),\n [props.history?.location]\n );\n\n const isNonIsolatedApp =\n (devCenterUtils.isCorvaApp(props?.app?.app) &&\n !devCenterUtils.isIsolationEnabledInPackageManifest(props?.app?.package)) ||\n !isIsolationFeatureEnabled;\n\n const DCAppComponent = isNonIsolatedApp ? DevCenterAppContainer : IsolatedPage;\n\n // Key to force iframe recreation when app version changes.\n // This ensures global dependencies are re-initialized for the new version.\n const appKey = props.app?.app?.app_key;\n const appVersion = getAppVersion(props.app);\n const iframeKey = `${appKey}-${appVersion}`;\n\n const appIframeDocument = useRef();\n const containerRef = useRef();\n const fixedSizeContainerRef = useRef();\n const fullscreenModeRef = useRef(false);\n const fullscreenModalModeRef = useRef(false);\n\n const isAppMaximized = devCenterUtils.isAppMaximized(\n queryString.parse(props.history?.location?.search),\n props.app.id\n );\n\n // save to ref to not re-create setIsFullscreenModalMode callback on change and reduce the amoount of DC apps re-renders\n const isAppMaximizedRef = useRef(isAppMaximized);\n isAppMaximizedRef.current = isAppMaximized;\n\n const [userUnits, setUserUnits] = useState(getUserUnits());\n\n useEffect(() => {\n const unsubscribeFn = subscribeForUserUnitsUpdates(newUserUnits => setUserUnits(newUserUnits));\n\n return () => unsubscribeFn();\n }, []);\n\n const appContextValue = useContext(AppContext);\n const permissionsContextValue = usePermissionsContext();\n\n /*\n What is fullscreen modal mode?\n\n Our apps, are shown in isolated iFrames. Because of it, when an app has some modal\n and opens it - it's opened inside of its iframe, instead of opening at the center of the screen.\n\n To make app modals & other elements be opened at the center of the screen, as if they are not inside of an iframe,\n we use some hacks.\n\n When the app wants to open a fullscreen element, we make its iframe fullscreen, but with transparent background,\n and we set width/height & position of that app iframe to inner app container that is located inside of the iframe.\n So when iframe's fullscreen element is opened, it looks like it's a part of the platform, and the app which shows the element, looks like\n usual, not in fullscreen\n\n So the platform provides this setIsFullscreenModalMode function to DC apps.\n When DC app wants to open a modal that should be opened at the center of the screen - it needs to\n call setIsFullscreenModalMode(true) first. And when it closes the modal - setIsFullscreenModalMode(false)\n\n Two things are important about this\n - all these styles that make this invisible background work should be applied at once\n - enter and exit from the mode, shouldn't trigger even a single re-render, as it may impact\n some elements inside the DC app\n\n There's a second parameter to `setIsFullscreenModalMode`: `isModal`. It should be used when a fullscreen overlay is displayed\n (Modal, for instance) that should cover everything on screen.\n\n What it does - it basically sets the stretched element's z-index to a very high value, so it covers every other UI element in CWF\n */\n\n function handleAppFullscreenTransparentModeExit() {\n onAppFullscreenTransparentMode({ appId: props.app.id, isModeEnabled: false });\n document.body.classList.remove('dc-isolated-app__body-overflow', styles.compensateScroll);\n }\n\n const setIsFullscreenModalMode = useCallback(\n function setIsFullscreenModalMode(nextIsFullscreenModalModeValue, isModal = false) {\n // When an app is already in fullscreen mode, no need to use this\n // invisible fullscreen mode to make elements take the whole screen\n if (\n !isIsolationFeatureEnabled ||\n isNonIsolatedApp ||\n (isAppMaximizedRef.current && !fullscreenModeRef.current) ||\n fullscreenModeRef.current === nextIsFullscreenModalModeValue\n ) {\n // Adding modal class if modal is opened when non-modal is already open\n if (isModal && fullscreenModalModeRef.current !== isModal) {\n fullscreenModalModeRef.current = isModal;\n containerRef.current?.classList.add(styles.containerMaximizedTransparentModal);\n }\n\n return;\n }\n\n const classesEditMethod = nextIsFullscreenModalModeValue ? 'add' : 'remove';\n\n containerRef.current?.classList[classesEditMethod](styles.containerMaximizedTransparent);\n\n if (isModal || classesEditMethod === 'remove') {\n containerRef.current?.classList[classesEditMethod](\n styles.containerMaximizedTransparentModal\n );\n }\n\n appIframeDocument.current = containerRef.current?.querySelector(\n `[${APP_IFRAME_ATTRIBUTE}]`\n )?.contentWindow?.document;\n\n const isolatedPageAppContainer = appIframeDocument.current?.getElementById(\n ISOLATED_PAGE_APP_CONTAINER_ID\n );\n\n if (!isolatedPageAppContainer) {\n return;\n }\n\n if (nextIsFullscreenModalModeValue) {\n // 1. BATCH ALL READS FIRST - prevents layout thrashing\n const { top, left, width, height } = fixedSizeContainerRef.current.getBoundingClientRect();\n const isBodyScrollVisible = window.innerWidth !== document.body.clientWidth;\n\n // 2. Flush React state updates synchronously to prevent deferred renders\n flushSync(() => {\n onAppFullscreenTransparentMode({ appId: props.app.id, isModeEnabled: true });\n });\n\n // 3. BATCH ALL DOM WRITES - after reads and React flush\n isolatedPageAppContainer.setAttribute(\n 'style',\n `\n top: ${top}px;\n left: ${left}px;\n width: ${width}px;\n height: ${height}px;\n position: absolute;\n `\n );\n document.body.classList.add(\n 'dc-isolated-app__body-overflow',\n isBodyScrollVisible && styles.compensateScroll\n );\n } else {\n // Flush React state updates synchronously before DOM writes\n flushSync(() => {\n onAppFullscreenTransparentMode({ appId: props.app.id, isModeEnabled: false });\n });\n\n // DOM writes after React flush\n isolatedPageAppContainer.setAttribute('style', '');\n document.body.classList.remove('dc-isolated-app__body-overflow', styles.compensateScroll);\n }\n fullscreenModeRef.current = nextIsFullscreenModalModeValue;\n fullscreenModalModeRef.current = isModal;\n },\n [isIsolationFeatureEnabled, isNonIsolatedApp, isAppMaximizedRef]\n );\n\n useEffect(() => {\n return handleAppFullscreenTransparentModeExit;\n }, []);\n\n useEffect(() => {\n if (isAppMaximized && fullscreenModeRef.current) {\n setIsFullscreenModalMode(false);\n }\n }, [isAppMaximized]);\n\n const {\n isBrowserFullscreen,\n enterBrowserFullscreen,\n exitBrowserFullscreen,\n isSeparateWindow,\n openSeparateWindow,\n closeSeparateWindow,\n setSeparateWindowTitle,\n } = useFullscreenModes({\n containerRef: fixedSizeContainerRef,\n appInstanceId: props.app.id,\n isMaximized: isAppMaximized,\n });\n\n /**\n * This should be the same function as calling react-intersection-observer's ref setter actually triggers re-render.\n * Which in its turn causes infinite re-render loop.\n */\n const setContainerRefs = useCallback(node => {\n containerRef.current = node;\n setInnerContainerRefFn(node);\n }, []);\n\n return (\n <div\n className={classNames(\n 'dc-isolated-app',\n styles.fixedSizeContainer,\n isAppMaximized && styles.containerMaximized\n )}\n ref={fixedSizeContainerRef}\n >\n <div\n ref={setContainerRefs}\n onMouseEnter={onInnerContainerMouseEnter}\n onMouseLeave={onInnerContainerMouseLeave}\n data-testid={`${PAGE_NAME}_${props.app.app.name}`}\n className={classNames(\n styles.container,\n isInsideNewMobileApp && styles.newMobileAppContainer\n )}\n >\n <DCAppComponent\n key={iframeKey}\n {...props}\n isBrowserFullscreen={isBrowserFullscreen}\n enterBrowserFullscreen={enterBrowserFullscreen}\n exitBrowserFullscreen={exitBrowserFullscreen}\n isSeparateWindow={isSeparateWindow}\n openSeparateWindow={openSeparateWindow}\n closeSeparateWindow={closeSeparateWindow}\n setSeparateWindowTitle={setSeparateWindowTitle}\n isNonIsolatedApp={isNonIsolatedApp}\n appContextValue={appContextValue}\n devCenterRouter={devCenterRouter}\n globalNotificationToastsAPI={window[Symbol.for('notificationToasts')]}\n globalMixpanelEventTracker={window[Symbol.for('logToMixpanel')]}\n onAppContainerClick={onAppContainerClick}\n onAppRemove={onAppRemove}\n onIsMaximizedChange={onIsMaximizedChange}\n onSettingChange={onSettingChange}\n onSettingsChange={onSettingsChange}\n permissionsContextValue={permissionsContextValue}\n setIsFullscreenModalMode={setIsFullscreenModalMode}\n userUnits={userUnits}\n trackApiRateLimiterException={trackApiRateLimiterException}\n updateCurrentDashboardAppLastAnnotation={updateCurrentDashboardAppLastAnnotation}\n apiRateLimiterConfig={apiRateLimiterConfig}\n />\n </div>\n </div>\n );\n}\n\nDevCenterIsolatedAppComponent.propTypes = {\n app: PropTypes.shape({\n id: PropTypes.number,\n app: PropTypes.shape({\n name: PropTypes.string,\n }),\n }).isRequired,\n currentUser: PropTypes.shape({}).isRequired,\n isIsolationFeatureEnabled: PropTypes.bool,\n onAppContainerClick: PropTypes.func,\n onAppFullscreenTransparentMode: PropTypes.func,\n onAppRemove: PropTypes.func,\n onInnerContainerMouseEnter: PropTypes.func,\n onInnerContainerMouseLeave: PropTypes.func,\n onIsMaximizedChange: PropTypes.func,\n onSettingChange: PropTypes.func,\n onSettingsChange: PropTypes.func,\n setInnerContainerRefFn: PropTypes.func,\n updateCurrentDashboardAppLastAnnotation: PropTypes.func,\n apiRateLimiterConfig: PropTypes.object,\n};\n\nexport const DevCenterIsolatedApp = withRouter(DevCenterIsolatedAppComponent);\n"],"names":["DEFAULT_API_RATE_LIMITER_CONFIG","DevCenterIsolatedAppComponent","_ref","_props$history","_props$app","_props$app2","_props$app3","_props$app3$app","_props$history2","_props$history2$locat","_ref$isIsolationFeatu","isIsolationFeatureEnabled","_ref$onAppFullscreenT","onAppFullscreenTransparentMode","noop","_ref$onIsMaximizedCha","onIsMaximizedChange","_ref$onInnerContainer","onInnerContainerMouseEnter","_ref$onInnerContainer2","onInnerContainerMouseLeave","_ref$onAppContainerCl","onAppContainerClick","_ref$setInnerContaine","setInnerContainerRefFn","_ref$onAppRemove","onAppRemove","undefined","_ref$onSettingChange","onSettingChange","_ref$onSettingsChange","onSettingsChange","_ref$updateCurrentDas","updateCurrentDashboardAppLastAnnotation","_ref$apiRateLimiterCo","apiRateLimiterConfig","trackApiRateLimiterException","props","_objectWithoutProperties","_excluded","devCenterRouter","useMemo","devCenterUtils","history","location","isNonIsolatedApp","app","package","DCAppComponent","DevCenterAppContainer","IsolatedPage","appKey","app_key","appVersion","getAppVersion","iframeKey","concat","appIframeDocument","useRef","containerRef","fixedSizeContainerRef","fullscreenModeRef","fullscreenModalModeRef","isAppMaximized","queryString","parse","search","id","isAppMaximizedRef","current","_useState","useState","getUserUnits","_useState2","_slicedToArray","userUnits","setUserUnits","useEffect","unsubscribeFn","subscribeForUserUnitsUpdates","newUserUnits","appContextValue","useContext","AppContext","permissionsContextValue","usePermissionsContext","handleAppFullscreenTransparentModeExit","appId","isModeEnabled","document","body","classList","remove","styles","compensateScroll","setIsFullscreenModalMode","useCallback","nextIsFullscreenModalModeValue","_containerRef$current2","_containerRef$current4","_containerRef$current5","_containerRef$current6","_appIframeDocument$cu","isModal","_containerRef$current","add","containerMaximizedTransparentModal","_containerRef$current3","classesEditMethod","containerMaximizedTransparent","querySelector","APP_IFRAME_ATTRIBUTE","contentWindow","isolatedPageAppContainer","getElementById","ISOLATED_PAGE_APP_CONTAINER_ID","_fixedSizeContainerRe","getBoundingClientRect","top","left","width","height","isBodyScrollVisible","window","innerWidth","clientWidth","flushSync","setAttribute","_useFullscreenModes","useFullscreenModes","appInstanceId","isMaximized","isBrowserFullscreen","enterBrowserFullscreen","exitBrowserFullscreen","isSeparateWindow","openSeparateWindow","closeSeparateWindow","setSeparateWindowTitle","setContainerRefs","node","_jsx","className","classNames","fixedSizeContainer","containerMaximized","ref","children","onMouseEnter","onMouseLeave","PAGE_NAME","name","container","isInsideNewMobileApp","newMobileAppContainer","_objectSpread","globalNotificationToastsAPI","Symbol","for","globalMixpanelEventTracker","propTypes","PropTypes","shape","number","string","isRequired","currentUser","bool","func","object","DevCenterIsolatedApp","withRouter"],"mappings":"s9FAqBA,IACMA,EAAkC,CAAA,EAExC,SAASC,EAeNC,GAAA,IAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAR,EAdDS,0BAAAA,cAAiCD,EAAAE,EAAAV,EACjCW,+BAAAA,aAAiCC,EAAIF,EAAAG,EAAAb,EACrCc,oBAAAA,aAAsBF,EAAIC,EAAAE,EAAAf,EAC1BgB,2BAAAA,aAA6BJ,EAAIG,EAAAE,EAAAjB,EACjCkB,2BAAAA,aAA6BN,EAAIK,EAAAE,EAAAnB,EACjCoB,oBAAAA,aAAsBR,EAAIO,EAAAE,EAAArB,EAC1BsB,uBAAAA,aAAyBV,EAAIS,EAAAE,GAAAvB,EAC7BwB,YAAAA,oBAAcC,EAASF,GAAAG,GAAA1B,EACvB2B,gBAAAA,eAAkBf,EAAIc,GAAAE,GAAA5B,EACtB6B,iBAAAA,eAAmBj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,mBAAoBA,GACpBC,oBAAqBA,GACrBC,uBAAwBA,GACxB7F,iBAAkBA,GAClBoC,gBAAiBA,GACjBzC,gBAAiBA,GACjBoH,4BAA6BjC,OAAOkC,OAAOC,IAAI,uBAC/CC,2BAA4BpC,OAAOkC,OAAOC,IAAI,kBAC9CxI,oBAAqBA,EACrBI,YAAaA,GACbV,oBAAqBA,EACrBa,gBAAiBA,GACjBE,iBAAkBA,GAClBqD,wBAAyBA,GACzBW,yBAA0BA,GAC1BpB,UAAWA,GACXvC,6BAA8BA,GAC9BH,wCAAyCA,GACzCE,qBAAsBA,KAxBjBoB,OA6Bf,CAEAtD,EAA8B+J,UAAY,CACxClH,IAAKmH,EAAUC,MAAM,CACnB/F,GAAI8F,EAAUE,OACdrH,IAAKmH,EAAUC,MAAM,CACnBX,KAAMU,EAAUG,WAEjBC,WACHC,YAAaL,EAAUC,MAAM,CAAA,GAAIG,WACjC1J,0BAA2BsJ,EAAUM,KACrCjJ,oBAAqB2I,EAAUO,KAC/B3J,+BAAgCoJ,EAAUO,KAC1C9I,YAAauI,EAAUO,KACvBtJ,2BAA4B+I,EAAUO,KACtCpJ,2BAA4B6I,EAAUO,KACtCxJ,oBAAqBiJ,EAAUO,KAC/B3I,gBAAiBoI,EAAUO,KAC3BzI,iBAAkBkI,EAAUO,KAC5BhJ,uBAAwByI,EAAUO,KAClCvI,wCAAyCgI,EAAUO,KACnDrI,qBAAsB8H,EAAUQ,YAGrBC,EAAuBC,EAAW1K"}
@@ -1,2 +1,2 @@
1
- import e from'./../../../ext-esm/style-inject/dist/style-inject.es.js';var o={spacing:"8",container:"DevCenterIsolatedApp-module_container__4H6mS",newMobileAppContainer:"DevCenterIsolatedApp-module_newMobileAppContainer__5Qagb",containerMaximized:"DevCenterIsolatedApp-module_containerMaximized__5N9JC",containerMaximizedTransparent:"DevCenterIsolatedApp-module_containerMaximizedTransparent__o2-O3",containerMaximizedTransparentModal:"DevCenterIsolatedApp-module_containerMaximizedTransparentModal__kSTJM",fixedSizeContainer:"DevCenterIsolatedApp-module_fixedSizeContainer__gzaBd",compensateScroll:"DevCenterIsolatedApp-module_compensateScroll__WEp7e"};e(".DevCenterIsolatedApp-module_container__4H6mS{background-color:var(--palette-app-background);border-radius:8px;bottom:0;left:0;overflow:hidden;position:absolute;right:0;top:0}.DevCenterIsolatedApp-module_newMobileAppContainer__5Qagb{background-color:transparent}.DevCenterIsolatedApp-module_container__4H6mS>div{height:100%}.DevCenterIsolatedApp-module_containerMaximized__5N9JC{bottom:10px;box-shadow:0 0 18px 3px rgba(0,0,0,.75);height:auto;left:10px;overflow:hidden;position:fixed;right:10px;top:10px;width:auto;z-index:1000}.DevCenterIsolatedApp-module_containerMaximizedTransparent__o2-O3{background-color:transparent;bottom:0;height:auto;left:0;overflow:hidden;position:fixed;right:0;top:0;width:auto;z-index:200}.DevCenterIsolatedApp-module_containerMaximizedTransparentModal__kSTJM{z-index:2000}.DevCenterIsolatedApp-module_fixedSizeContainer__gzaBd{bottom:0;left:0;position:absolute;right:0;top:0}.dc-isolated-app__body-overflow{overflow:hidden}.DevCenterIsolatedApp-module_compensateScroll__WEp7e{margin-right:15px}");export{o as default};
1
+ import e from'./../../../ext-esm/style-inject/dist/style-inject.es.js';var o={spacing:"8",fixedSizeContainer:"DevCenterIsolatedApp-module_fixedSizeContainer__gzaBd",container:"DevCenterIsolatedApp-module_container__4H6mS",newMobileAppContainer:"DevCenterIsolatedApp-module_newMobileAppContainer__5Qagb",containerMaximized:"DevCenterIsolatedApp-module_containerMaximized__5N9JC",containerMaximizedTransparent:"DevCenterIsolatedApp-module_containerMaximizedTransparent__o2-O3",containerMaximizedTransparentModal:"DevCenterIsolatedApp-module_containerMaximizedTransparentModal__kSTJM",compensateScroll:"DevCenterIsolatedApp-module_compensateScroll__WEp7e"};e(".DevCenterIsolatedApp-module_container__4H6mS,.DevCenterIsolatedApp-module_fixedSizeContainer__gzaBd{bottom:0;left:0;position:absolute;right:0;top:0}.DevCenterIsolatedApp-module_container__4H6mS{background-color:var(--palette-app-background);border-radius:8px;overflow:hidden}.DevCenterIsolatedApp-module_newMobileAppContainer__5Qagb{background-color:transparent}.DevCenterIsolatedApp-module_container__4H6mS>div{height:100%}.DevCenterIsolatedApp-module_containerMaximized__5N9JC{height:auto;inset:0;overflow:hidden;overscroll-behavior:contain;position:fixed;width:auto;z-index:1000}.DevCenterIsolatedApp-module_containerMaximized__5N9JC .DevCenterIsolatedApp-module_container__4H6mS{box-shadow:0 0 18px 3px rgba(0,0,0,.75);inset:10px;overflow:hidden}.DevCenterIsolatedApp-module_containerMaximizedTransparent__o2-O3{background-color:transparent;bottom:0;height:auto;left:0;overflow:hidden;position:fixed;right:0;top:0;width:auto;z-index:200}.DevCenterIsolatedApp-module_containerMaximizedTransparentModal__kSTJM{z-index:2000}.dc-isolated-app__body-overflow{overflow:hidden}.DevCenterIsolatedApp-module_compensateScroll__WEp7e{margin-right:15px}");export{o as default};
2
2
  //# sourceMappingURL=DevCenterIsolatedApp.module.scss.js.map
@@ -249,7 +249,7 @@ const validateDsn = dsn => {
249
249
 
250
250
  const MCP_SERVER_VERSION = '1.10.0';
251
251
 
252
- var version = "3.80.0-11";
252
+ var version = "3.80.0-13";
253
253
 
254
254
  const CORVA_UI_VERSION = version;
255
255
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corva/ui",
3
- "version": "3.80.0-11",
3
+ "version": "3.80.0-13",
4
4
  "license": "UNLICENSED",
5
5
  "description": "Shared components/utils for Corva ui projects",
6
6
  "repository": {