mftsccs-browser 3.0.1-beta → 3.0.2-beta

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.
@@ -1324,7 +1324,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
1324
1324
  \****************************************/
1325
1325
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1326
1326
 
1327
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ GetComposition: () => (/* binding */ GetComposition),\n/* harmony export */ GetCompositionById: () => (/* binding */ GetCompositionById),\n/* harmony export */ GetCompositionFromMemory: () => (/* binding */ GetCompositionFromMemory),\n/* harmony export */ GetCompositionFromMemoryNormal: () => (/* binding */ GetCompositionFromMemoryNormal),\n/* harmony export */ GetCompositionFromMemoryWithConnections: () => (/* binding */ GetCompositionFromMemoryWithConnections),\n/* harmony export */ GetCompositionWithAllIds: () => (/* binding */ GetCompositionWithAllIds),\n/* harmony export */ GetCompositionWithId: () => (/* binding */ GetCompositionWithId),\n/* harmony export */ GetCompositionWithIdAndDateFromMemory: () => (/* binding */ GetCompositionWithIdAndDateFromMemory),\n/* harmony export */ GetCompositionWithIdFromMemory: () => (/* binding */ GetCompositionWithIdFromMemory),\n/* harmony export */ GetCompositionWithIdFromMemoryFromConnection: () => (/* binding */ GetCompositionWithIdFromMemoryFromConnection),\n/* harmony export */ GetCompositionWithIdFromMemoryFromConnections: () => (/* binding */ GetCompositionWithIdFromMemoryFromConnections),\n/* harmony export */ GetCompositionWithIdFromMemoryNew: () => (/* binding */ GetCompositionWithIdFromMemoryNew),\n/* harmony export */ RecursiveFetchBuildLayer: () => (/* binding */ RecursiveFetchBuildLayer),\n/* harmony export */ RecursiveFetchBuildLayerDataId: () => (/* binding */ RecursiveFetchBuildLayerDataId),\n/* harmony export */ RecursiveFetchBuildLayerNormal: () => (/* binding */ RecursiveFetchBuildLayerNormal),\n/* harmony export */ recursiveFetch: () => (/* binding */ recursiveFetch),\n/* harmony export */ recursiveFetchConcept: () => (/* binding */ recursiveFetchConcept),\n/* harmony export */ recursiveFetchConceptNormal: () => (/* binding */ recursiveFetchConceptNormal),\n/* harmony export */ recursiveFetchConceptSingleLoop: () => (/* binding */ recursiveFetchConceptSingleLoop),\n/* harmony export */ recursiveFetchWithSubCompositions: () => (/* binding */ recursiveFetchWithSubCompositions)\n/* harmony export */ });\n/* harmony import */ var _Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Api/GetConcept */ \"./src/Api/GetConcept.ts\");\n/* harmony import */ var _Api_GetAllConnectionsOfComposition__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Api/GetAllConnectionsOfComposition */ \"./src/Api/GetAllConnectionsOfComposition.ts\");\n/* harmony import */ var _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../DataStructures/ConceptData */ \"./src/DataStructures/ConceptData.ts\");\n/* harmony import */ var _DataStructures_ConnectionData__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../DataStructures/ConnectionData */ \"./src/DataStructures/ConnectionData.ts\");\n/* harmony import */ var _app__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../app */ \"./src/app.ts\");\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n\n\n\n\n\nfunction GetCompositionById(id) {\n return __awaiter(this, void 0, void 0, function* () {\n let returnOutput = { connectionList: [], compositionList: [] };\n try {\n if (_app__WEBPACK_IMPORTED_MODULE_4__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_4__.sendMessage)('GetCompositionById', { id });\n return res.data;\n }\n catch (error) {\n console.error('GetCompositionById error sw: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_4__.handleServiceWorkerException)(error);\n }\n }\n let connectionListString = yield (0,_Api_GetAllConnectionsOfComposition__WEBPACK_IMPORTED_MODULE_1__.GetAllConnectionsOfComposition)(id);\n returnOutput.connectionList = connectionListString;\n for (let i = 0; i < returnOutput.connectionList.length; i++) {\n if (!returnOutput.compositionList.includes(returnOutput.connectionList[i].ofTheConceptId)) {\n returnOutput.compositionList.push(returnOutput.connectionList[i].ofTheConceptId);\n }\n }\n return returnOutput;\n }\n catch (error) {\n console.error('GetCompositionById error: ', error);\n return returnOutput;\n }\n });\n}\n/**\n * ## format JUSTDATA ##\n * this function builds the composition with the main id as the point of building.\n * @param id id of the main composition that you want to build\n * @param connectionList list of connections\n * @param compositionList list of of_the_concept_ids for all the connections.\n * @returns\n */\nfunction RecursiveFetchBuildLayer(id, connectionList, compositionList) {\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b;\n let returnOutput = {};\n let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);\n if (concept.id == 0 && id != null && id != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);\n concept = conceptString;\n }\n let output = yield recursiveFetch(id, connectionList, compositionList);\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n returnOutput[mainString] = output;\n return returnOutput;\n });\n}\n/**\n * ## format DATAID ##\n * this function builds the composition with the main id as the point of building.\n * @param id id of the main composition that you want to build\n * @param connectionList list of connections\n * @param compositionList list of of_the_concept_ids for all the connections.\n * @returns\n */\nfunction RecursiveFetchBuildLayerDataId(id, connectionList, compositionList) {\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b;\n let returnOutput = {};\n let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);\n if (concept.id == 0 && id != null && id != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);\n concept = conceptString;\n }\n let output = yield recursiveFetch(id, connectionList, compositionList);\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n returnOutput[mainString] = output;\n let FinalReturn = {};\n FinalReturn['created_at'] = concept.entryTimeStamp;\n FinalReturn['data'] = returnOutput;\n FinalReturn['id'] = id;\n return FinalReturn;\n });\n}\n/**\n * ## format Normal ##\n * this function builds the composition with the main id as the point of building.\n * @param id id of the main composition that you want to build\n * @param connectionList list of connections\n * @param compositionList list of of_the_concept_ids for all the connections.\n * @returns\n */\nfunction RecursiveFetchBuildLayerNormal(id, connectionList, compositionList) {\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b;\n let returnOutput = {};\n let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);\n if (concept.id == 0 && id != null && id != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);\n concept = conceptString;\n }\n let output = yield recursiveFetchConceptNormal(concept, connectionList, compositionList);\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n returnOutput[mainString] = output;\n return returnOutput;\n });\n}\n/**\n * ## format JUSTDATA ##\n * this function builds the composition with the main id as the point of building.\n * This just requires the id\n * @param id id of the main composition that you want to build\n * @param connectionList list of connections\n * @param compositionList list of of_the_concept_ids for all the connections.\n * @returns\n */\nfunction GetComposition(id) {\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b;\n if (_app__WEBPACK_IMPORTED_MODULE_4__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_4__.sendMessage)('GetComposition', { id });\n return res.data;\n }\n catch (error) {\n console.error('GetComposition error sw: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_4__.handleServiceWorkerException)(error);\n }\n }\n let connectionList = [];\n let returnOutput = {};\n let connectionListString = yield (0,_Api_GetAllConnectionsOfComposition__WEBPACK_IMPORTED_MODULE_1__.GetAllConnectionsOfComposition)(id);\n connectionList = connectionListString;\n console.log(\"this is the connection list online\", connectionList);\n //connectionList = ConnectionData.GetConnectionsOfComposition(id);\n let compositionList = [];\n for (let i = 0; i < connectionList.length; i++) {\n if (!compositionList.includes(connectionList[i].ofTheConceptId)) {\n compositionList.push(connectionList[i].ofTheConceptId);\n }\n }\n let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);\n if (concept.id == 0 && id != null && id != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);\n concept = conceptString;\n }\n let output = yield recursiveFetch(id, connectionList, compositionList);\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n returnOutput[mainString] = output;\n return returnOutput;\n });\n}\nfunction GetCompositionWithAllIds(id) {\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b;\n let connectionList = [];\n let returnOutput = {};\n let connectionListString = yield (0,_Api_GetAllConnectionsOfComposition__WEBPACK_IMPORTED_MODULE_1__.GetAllConnectionsOfComposition)(id);\n connectionList = connectionListString;\n //connectionList = ConnectionData.GetConnectionsOfComposition(id);\n let compositionList = [];\n for (let i = 0; i < connectionList.length; i++) {\n if (!compositionList.includes(connectionList[i].ofTheConceptId)) {\n compositionList.push(connectionList[i].ofTheConceptId);\n }\n }\n let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);\n if (concept.id == 0 && id != null && id != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);\n concept = conceptString;\n }\n let output = yield recursiveFetchWithSubCompositions(id, connectionList, compositionList);\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n returnOutput[mainString] = output;\n return returnOutput;\n });\n}\n/**\n * ### Format JUSTDATA ###\n * This function just builds data from the memory.\n * This is a function that takes on all the concepts and connections of the concept (as a composition ) and builds\n * it into a json data.\n * @param id this id is just used to get all the composition data from the concepts and connections in memory\n * @returns\n */\nfunction GetCompositionFromMemory(id) {\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b;\n if (_app__WEBPACK_IMPORTED_MODULE_4__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_4__.sendMessage)('GetCompositionFromMemory', { id });\n return res.data;\n }\n catch (error) {\n console.error('GetCompositionFromMemory error sw: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_4__.handleServiceWorkerException)(error);\n }\n }\n let connectionList = [];\n let returnOutput = {};\n //connectionList = await ConnectionData.GetConnectionsOfConcept(id);\n connectionList = yield _DataStructures_ConnectionData__WEBPACK_IMPORTED_MODULE_3__.ConnectionData.GetConnectionsOfCompositionLocal(id);\n //connectionList = ConnectionData.GetConnectionsOfComposition(id);\n let compositionList = [];\n for (let i = 0; i < connectionList.length; i++) {\n if (!compositionList.includes(connectionList[i].ofTheConceptId)) {\n compositionList.push(connectionList[i].ofTheConceptId);\n }\n }\n let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);\n if (concept.id == 0 && id != null && id != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);\n concept = conceptString;\n }\n let output = yield recursiveFetchConcept(concept, connectionList, compositionList);\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n returnOutput[mainString] = output;\n return returnOutput;\n });\n}\n/**\n * ### Format Normal ###\n * This function just builds data from the memory.\n * This is a function that takes on all the concepts and connections of the concept (as a composition ) and builds\n * it into a json data.\n * @param id this id is just used to get all the composition data from the concepts and connections in memory\n * @returns\n */\nfunction GetCompositionFromMemoryNormal(id) {\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b;\n if (_app__WEBPACK_IMPORTED_MODULE_4__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_4__.sendMessage)('GetCompositionFromMemoryNormal', { id });\n return res.data;\n }\n catch (error) {\n console.error('GetCompositionFromMemoryNormal error sw: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_4__.handleServiceWorkerException)(error);\n }\n }\n let connectionList = [];\n let returnOutput = {};\n //connectionList = await ConnectionData.GetConnectionsOfConcept(id);\n connectionList = yield _DataStructures_ConnectionData__WEBPACK_IMPORTED_MODULE_3__.ConnectionData.GetConnectionsOfCompositionLocal(id);\n //connectionList = ConnectionData.GetConnectionsOfComposition(id);\n let compositionList = [];\n for (let i = 0; i < connectionList.length; i++) {\n if (!compositionList.includes(connectionList[i].ofTheConceptId)) {\n compositionList.push(connectionList[i].ofTheConceptId);\n }\n }\n let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);\n if (concept.id == 0 && id != null && id != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);\n concept = conceptString;\n }\n let output = yield recursiveFetchConceptNormal(concept, connectionList, compositionList);\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n returnOutput[mainString] = output;\n return returnOutput;\n });\n}\n/**\n * ### Format DATAIDDATE ####\n * Gets data just from memory\n * @param id\n * @returns\n */\nfunction GetCompositionWithIdFromMemory(id) {\n var arguments_1 = arguments;\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b;\n _app__WEBPACK_IMPORTED_MODULE_4__.Logger.logfunction(GetCompositionWithIdFromMemory, arguments_1);\n if (_app__WEBPACK_IMPORTED_MODULE_4__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_4__.sendMessage)('GetCompositionWithIdFromMemory', { id });\n return res.data;\n }\n catch (error) {\n console.error('GetCompositionWithIdFromMemory error sw: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_4__.handleServiceWorkerException)(error);\n }\n }\n let FinalReturn = {};\n let connectionList = [];\n let returnOutput = {};\n // connectionList = await ConnectionData.GetConnectionsOfConcept(id);\n try {\n connectionList = yield _DataStructures_ConnectionData__WEBPACK_IMPORTED_MODULE_3__.ConnectionData.GetConnectionsOfCompositionLocal(id);\n let compositionList = [];\n for (let i = 0; i < connectionList.length; i++) {\n if (!compositionList.includes(connectionList[i].ofTheConceptId)) {\n compositionList.push(connectionList[i].ofTheConceptId);\n }\n }\n let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);\n if (concept.id == 0 && id != null && id != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);\n concept = conceptString;\n }\n let output = yield recursiveFetchConcept(concept, connectionList, compositionList);\n // let output = await recursiveFetchConceptSingleLoop(concept, connectionList,compositionList );\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n returnOutput[mainString] = output;\n FinalReturn['created_at'] = concept.entryTimeStamp;\n FinalReturn['data'] = returnOutput;\n FinalReturn['id'] = id;\n }\n catch (error) {\n console.log(\"this is the exception in GetCompositionWithIdFromMemory\", id);\n }\n return FinalReturn;\n });\n}\n/**\n * ### Format Normal ####\n * Gets data just from memory\n * @param id\n * @returns\n */\nfunction GetCompositionFromMemoryWithConnections(id, connectionList) {\n var arguments_2 = arguments;\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b;\n _app__WEBPACK_IMPORTED_MODULE_4__.Logger.logfunction(GetCompositionFromMemoryWithConnections, arguments_2);\n if (_app__WEBPACK_IMPORTED_MODULE_4__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_4__.sendMessage)('GetCompositionFromMemoryWithConnections', { id, connectionList });\n return res.data;\n }\n catch (error) {\n console.error('GetCompositionFromMemoryWithConnections error sw: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_4__.handleServiceWorkerException)(error);\n }\n }\n let returnOutput = {};\n // connectionList = await ConnectionData.GetConnectionsOfConcept(id);\n let compositionList = [];\n for (let i = 0; i < connectionList.length; i++) {\n if (!compositionList.includes(connectionList[i].ofTheConceptId)) {\n compositionList.push(connectionList[i].ofTheConceptId);\n }\n }\n let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);\n if (concept.id == 0 && id != null && id != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);\n concept = conceptString;\n }\n let output = yield recursiveFetchConcept(concept, connectionList, compositionList);\n // let output = await recursiveFetchConceptSingleLoop(concept, connectionList,compositionList );\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n returnOutput[mainString] = output;\n let FinalReturn = {};\n FinalReturn['created_at'] = concept.entryTimeStamp;\n FinalReturn['data'] = returnOutput;\n FinalReturn['id'] = id;\n return FinalReturn;\n });\n}\n/**\n * ### Format DATAIDDATE ####\n * Gets data just from memory\n * @param id\n * @returns\n */\nfunction GetCompositionWithIdFromMemoryFromConnection(id, connectionList) {\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b;\n if (_app__WEBPACK_IMPORTED_MODULE_4__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_4__.sendMessage)('GetCompositionWithIdFromMemory', { id });\n return res.data;\n }\n catch (error) {\n console.error('GetCompositionWithIdFromMemory error sw: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_4__.handleServiceWorkerException)(error);\n }\n }\n let returnOutput = {};\n // connectionList = await ConnectionData.GetConnectionsOfConcept(id);\n let compositionList = [];\n for (let i = 0; i < connectionList.length; i++) {\n if (!compositionList.includes(connectionList[i].ofTheConceptId)) {\n compositionList.push(connectionList[i].ofTheConceptId);\n }\n }\n let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);\n if (concept.id == 0 && id != null && id != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);\n concept = conceptString;\n }\n let output = yield recursiveFetchConcept(concept, connectionList, compositionList);\n console.log(\"this is the output\", output, concept);\n // let output = await recursiveFetchConceptSingleLoop(concept, connectionList,compositionList );\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n returnOutput[mainString] = output;\n let FinalReturn = {};\n FinalReturn['created_at'] = concept.entryTimeStamp;\n FinalReturn['data'] = returnOutput;\n FinalReturn['id'] = id;\n return FinalReturn;\n });\n}\n/**\n * ### Format DATAIDDATE ####\n * ### experimental ####\n * This is the new format that needs to work with a single or max two loops\n * @param id the id whose composition needs to be created\n * @returns\n */\nfunction GetCompositionWithIdFromMemoryNew(id) {\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b;\n if (_app__WEBPACK_IMPORTED_MODULE_4__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_4__.sendMessage)('GetCompositionWithIdFromMemoryNew', { id });\n return res.data;\n }\n catch (error) {\n console.error('GetCompositionWithIdFromMemoryNew error sw: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_4__.handleServiceWorkerException)(error);\n }\n }\n let connectionList = [];\n let returnOutput = {};\n //connectionList = await ConnectionData.GetConnectionsOfConcept(id);\n connectionList = yield _DataStructures_ConnectionData__WEBPACK_IMPORTED_MODULE_3__.ConnectionData.GetConnectionsOfCompositionLocal(id);\n let compositionList = [];\n for (let i = 0; i < connectionList.length; i++) {\n if (!compositionList.includes(connectionList[i].ofTheConceptId)) {\n compositionList.push(connectionList[i].ofTheConceptId);\n }\n }\n let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);\n if (concept.id == 0 && id != null && id != undefined) {\n console.log(\"this concept you cannot find \", id);\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);\n concept = conceptString;\n }\n let startTime = new Date().getTime();\n //console.log(\"this is the connection list which has to be looped\", connectionList);\n let output = yield recursiveFetchConceptSingleLoop(concept, connectionList, compositionList);\n console.log(\"this is the time for the data to be made\", new Date().getTime() - startTime);\n // let output = await recursiveFetchConceptSingleLoop(concept, connectionList,compositionList );\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n returnOutput = output;\n let FinalReturn = {};\n FinalReturn['created_at'] = concept.entryTimeStamp;\n FinalReturn['data'] = returnOutput;\n FinalReturn['id'] = id;\n return FinalReturn;\n });\n}\n/**\n * ### Format DATAIDDATE #####\n * ### This just returns composition from memory and not from anywhere else.\n * @param id\n * @returns\n */\nfunction GetCompositionWithIdAndDateFromMemory(id) {\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b;\n if (_app__WEBPACK_IMPORTED_MODULE_4__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_4__.sendMessage)('GetCompositionWithIdAndDateFromMemory', { id });\n return res.data;\n }\n catch (error) {\n console.error('GetCompositionWithIdAndDateFromMemory error sw: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_4__.handleServiceWorkerException)(error);\n }\n }\n let connectionList = [];\n let returnOutput = {};\n connectionList = yield _DataStructures_ConnectionData__WEBPACK_IMPORTED_MODULE_3__.ConnectionData.GetConnectionsOfCompositionLocal(id);\n //connectionList = await ConnectionData.GetConnectionsOfConcept(id);\n let compositionList = [];\n for (let i = 0; i < connectionList.length; i++) {\n if (!compositionList.includes(connectionList[i].ofTheConceptId)) {\n compositionList.push(connectionList[i].ofTheConceptId);\n }\n }\n let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);\n if (concept.id == 0 && id != null && id != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);\n concept = conceptString;\n }\n let output = yield recursiveFetch(id, connectionList, compositionList);\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n returnOutput[mainString] = output;\n let FinalReturn = {};\n FinalReturn['data'] = returnOutput;\n FinalReturn['id'] = id;\n FinalReturn['created_at'] = concept.entryTimeStamp;\n return FinalReturn;\n });\n}\nfunction GetCompositionWithIdFromMemoryFromConnections(id_1) {\n return __awaiter(this, arguments, void 0, function* (id, connectionList = []) {\n var _a, _b;\n let returnOutput = {};\n //connectionList = await ConnectionData.GetConnectionsOfCompositionLocal(id);\n let compositionList = [];\n for (let i = 0; i < connectionList.length; i++) {\n if (!compositionList.includes(connectionList[i].ofTheConceptId)) {\n compositionList.push(connectionList[i].ofTheConceptId);\n }\n }\n let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);\n if (concept.id == 0 && id != null && id != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);\n concept = conceptString;\n }\n let output = yield recursiveFetch(id, connectionList, compositionList);\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n returnOutput[mainString] = output;\n let FinalReturn = {};\n FinalReturn['data'] = returnOutput;\n FinalReturn['id'] = id;\n return FinalReturn;\n });\n}\n/**\n * #### Format DATAID ####\n * ## This will return the composition even if it is not in the local memory ##\n * @param id\n * @returns\n */\nfunction GetCompositionWithId(id) {\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b;\n if (_app__WEBPACK_IMPORTED_MODULE_4__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_4__.sendMessage)('GetCompositionWithId', { id });\n return res.data;\n }\n catch (error) {\n console.error('GetCompositionWithId error sw: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_4__.handleServiceWorkerException)(error);\n }\n }\n let connectionList = [];\n let returnOutput = {};\n let connectionListString = yield (0,_Api_GetAllConnectionsOfComposition__WEBPACK_IMPORTED_MODULE_1__.GetAllConnectionsOfComposition)(id);\n connectionList = connectionListString;\n let compositionList = [];\n for (let i = 0; i < connectionList.length; i++) {\n if (!compositionList.includes(connectionList[i].ofTheConceptId)) {\n compositionList.push(connectionList[i].ofTheConceptId);\n }\n }\n let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);\n if (concept.id == 0 && id != null && id != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);\n concept = conceptString;\n }\n let output = yield recursiveFetch(id, connectionList, compositionList);\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n returnOutput[mainString] = output;\n let FinalReturn = {};\n FinalReturn['data'] = returnOutput;\n FinalReturn['id'] = id;\n return FinalReturn;\n });\n}\n/**\n * ## Format justdata ###\n * ## This contains a concept in the parameter so that you dont have to again find the concept ##\n * This function takes concepts and connections and then builds a json.\n * @param concept The concept that needs to get other concepts that are inside of it.\n * @param connectionList List of connections that are available in the composition. We have to loop over it.\n * @param compositionList Composition list is the list of concepts that have connections inside of them.\n * @param visitedConcepts This is a checking mechanism to not go in loops. So preferably pass an empty array.\n * @returns\n */\nfunction recursiveFetchConcept(concept_1, connectionList_1, compositionList_1) {\n var arguments_3 = arguments;\n return __awaiter(this, arguments, void 0, function* (concept, connectionList, compositionList, visitedConcepts = []) {\n var _a, _b, _c, _d;\n _app__WEBPACK_IMPORTED_MODULE_4__.Logger.logfunction(recursiveFetchConcept, arguments_3);\n let output = {};\n let arroutput = [];\n let id = concept.id;\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n if (!compositionList.includes(id)) {\n return concept === null || concept === void 0 ? void 0 : concept.characterValue;\n }\n else {\n if (visitedConcepts.includes(id)) {\n return \"\";\n }\n else {\n visitedConcepts.push(id);\n }\n for (let i = 0; i < connectionList.length; i++) {\n if (connectionList[i].ofTheConceptId == id) {\n if (id != connectionList[i].toTheConceptId) {\n let toConceptId = connectionList[i].toTheConceptId;\n let toConcept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(toConceptId);\n if ((toConcept == null || toConcept.id == 0) && toConceptId != null && toConceptId != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(toConceptId);\n toConcept = conceptString;\n }\n if (toConcept.id != 0) {\n if ((toConcept === null || toConcept === void 0 ? void 0 : toConcept.type) == null) {\n let toConceptTypeId = toConcept.typeId;\n let toConceptType = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(toConceptTypeId);\n toConcept.type = toConceptType;\n if (toConceptType == null && toConceptTypeId != null && toConceptTypeId != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(toConceptTypeId);\n toConceptType = conceptString;\n toConcept.type = toConceptType;\n }\n }\n }\n let regex = \"the_\";\n let localmainString = (_d = (_c = toConcept === null || toConcept === void 0 ? void 0 : toConcept.type) === null || _c === void 0 ? void 0 : _c.characterValue) !== null && _d !== void 0 ? _d : \"\";\n let localKey = localmainString.replace(regex, \"\");\n if (isNaN(Number(localKey))) {\n if (localKey) {\n const result = yield recursiveFetchConcept(toConcept, connectionList, compositionList, visitedConcepts);\n output[localKey] = result;\n }\n }\n else {\n const result = yield recursiveFetchConcept(toConcept, connectionList, compositionList, visitedConcepts);\n arroutput[localKey] = result;\n output = arroutput;\n }\n }\n else {\n console.log(\"this is the faulty connection \", connectionList[i]);\n }\n }\n }\n }\n return output;\n });\n}\n/**\n* ## Format Normal ###\n* ## This contains a concept in the parameter so that you dont have to again find the concept ##\n* This function takes concepts and connections and then builds a json.\n* @param concept The concept that needs to get other concepts that are inside of it.\n* @param connectionList List of connections that are available in the composition. We have to loop over it.\n* @param compositionList Composition list is the list of concepts that have connections inside of them.\n* @param visitedConcepts This is a checking mechanism to not go in loops. So preferably pass an empty array.\n* @returns\n*/\nfunction recursiveFetchConceptNormal(concept_1, connectionList_1, compositionList_1) {\n var arguments_4 = arguments;\n return __awaiter(this, arguments, void 0, function* (concept, connectionList, compositionList, visitedConcepts = []) {\n var _a, _b, _c, _d;\n _app__WEBPACK_IMPORTED_MODULE_4__.Logger.logfunction(recursiveFetchConceptNormal, arguments_4);\n let startTime = new Date().getTime();\n let output = {};\n let arroutput = [];\n let id = concept.id;\n output[\"id\"] = id;\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n if (!compositionList.includes(id)) {\n return concept === null || concept === void 0 ? void 0 : concept.characterValue;\n }\n else {\n if (visitedConcepts.includes(id)) {\n return \"\";\n }\n else {\n visitedConcepts.push(id);\n }\n for (let i = 0; i < connectionList.length; i++) {\n if (connectionList[i].ofTheConceptId == id) {\n if (id != connectionList[i].toTheConceptId) {\n let toConceptId = connectionList[i].toTheConceptId;\n let toConcept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(toConceptId);\n if ((toConcept == null || toConcept.id == 0) && toConceptId != null && toConceptId != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(toConceptId);\n toConcept = conceptString;\n }\n if (toConcept.id != 0) {\n if ((toConcept === null || toConcept === void 0 ? void 0 : toConcept.type) == null) {\n let toConceptTypeId = toConcept.typeId;\n let toConceptType = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(toConceptTypeId);\n toConcept.type = toConceptType;\n if (toConceptType == null && toConceptTypeId != null && toConceptTypeId != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(toConceptTypeId);\n toConceptType = conceptString;\n toConcept.type = toConceptType;\n }\n }\n }\n let regex = \"the_\";\n let localmainString = (_d = (_c = toConcept === null || toConcept === void 0 ? void 0 : toConcept.type) === null || _c === void 0 ? void 0 : _c.characterValue) !== null && _d !== void 0 ? _d : \"\";\n let localKey = localmainString.replace(regex, \"\");\n if (isNaN(Number(localKey))) {\n if (localKey) {\n const result = yield recursiveFetchConcept(toConcept, connectionList, compositionList, visitedConcepts);\n output[localKey] = result;\n }\n }\n else {\n const result = yield recursiveFetchConcept(toConcept, connectionList, compositionList, visitedConcepts);\n arroutput[localKey] = result;\n output = arroutput;\n }\n }\n else {\n console.log(\"this is the faulty connection \", connectionList[i]);\n }\n }\n }\n }\n // console.log(\"second loop normal\", new Date().getTime() - startTime);\n return output;\n });\n}\n/**\n * ## experimental ##\n* This function takes concepts and connections and then builds a json.\n* @param concept The concept that needs to get other concepts that are inside of it.\n* @param connectionList List of connections that are available in the composition. We have to loop over it.\n* @param compositionList Composition list is the list of concepts that have connections inside of them.\n* @param visitedConcepts This is a checking mechanism to not go in loops. So preferably pass an empty array.\n* @returns\n*/\nfunction recursiveFetchConceptSingleLoop(concept_1, connectionList_1, compositionList_1) {\n return __awaiter(this, arguments, void 0, function* (concept, connectionList, compositionList, visitedConcepts = []) {\n var _a, _b, _c, _d, _e, _f, _g, _h;\n let output = {};\n let id = concept.id;\n let startTime = new Date().getTime();\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n if (!compositionList.includes(id)) {\n let myString = mainString;\n let returnoutput = { [myString]: concept === null || concept === void 0 ? void 0 : concept.characterValue };\n return returnoutput;\n }\n else {\n if (visitedConcepts.includes(id)) {\n return \"\";\n }\n else {\n visitedConcepts.push(id);\n }\n for (let i = 0; i < connectionList.length; i++) {\n let newData = yield (0,_app__WEBPACK_IMPORTED_MODULE_4__.GetTheConcept)(connectionList[i].ofTheConceptId);\n let toConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_4__.GetTheConcept)(connectionList[i].toTheConceptId);\n connectionList[i].ofConcept = newData;\n connectionList[i].toConcept = toConcept;\n let ofKey = newData.id;\n let toConceptKey = (_d = (_c = toConcept === null || toConcept === void 0 ? void 0 : toConcept.type) === null || _c === void 0 ? void 0 : _c.characterValue) !== null && _d !== void 0 ? _d : \"\";\n let regex = \"the_\";\n let localmainString = toConceptKey;\n let localToKey = localmainString.replace(regex, \"\");\n if (output[ofKey] == undefined || output[ofKey] == null) {\n output[ofKey] = {};\n }\n output[ofKey][localToKey] = toConcept.characterValue;\n }\n }\n let finalOutput = {};\n for (let i = 0; i < connectionList.length; i++) {\n let ofConcept = connectionList[i].ofConcept;\n let toConcept = connectionList[i].toConcept;\n let ofConceptKey = (_f = (_e = ofConcept === null || ofConcept === void 0 ? void 0 : ofConcept.type) === null || _e === void 0 ? void 0 : _e.characterValue) !== null && _f !== void 0 ? _f : \"\";\n let toConceptKey = (_h = (_g = toConcept === null || toConcept === void 0 ? void 0 : toConcept.type) === null || _g === void 0 ? void 0 : _g.characterValue) !== null && _h !== void 0 ? _h : \"\";\n let regex = \"the_\";\n let localmainString = toConceptKey;\n let localToKey = localmainString.replace(regex, \"\");\n if (finalOutput[ofConcept.id] == undefined || finalOutput[ofConcept.id] == null) {\n finalOutput[ofConcept.id] = {};\n }\n let internalOutput = finalOutput[ofConcept.id];\n if (internalOutput[ofConceptKey] == undefined || internalOutput[ofConceptKey] == null) {\n internalOutput[ofConceptKey] = {};\n }\n if (output[connectionList[i].ofTheConceptId] != undefined && output[connectionList[i].toTheConceptId] != undefined) {\n internalOutput[ofConceptKey][localToKey] = output[toConcept.id];\n }\n else {\n internalOutput[ofConceptKey][localToKey] = toConcept.characterValue;\n }\n }\n return finalOutput[concept.id];\n });\n}\n/**\n * ## Format justdata ##\n * @param id\n * @param connectionList\n * @param compositionList\n * @param visitedConcepts\n * @returns\n */\nfunction recursiveFetch(id_1, connectionList_1, compositionList_1) {\n return __awaiter(this, arguments, void 0, function* (id, connectionList, compositionList, visitedConcepts = []) {\n var _a, _b, _c, _d;\n let output = {};\n let arroutput = [];\n if (id == 0) {\n return null;\n }\n let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);\n if ((concept == null || concept.id == 0) && id != null && id != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);\n concept = conceptString;\n }\n if (concept.id != 0) {\n if (concept.type == null) {\n let toConceptTypeId = concept.typeId;\n let toConceptType = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(toConceptTypeId);\n concept.type = toConceptType;\n if (toConceptType == null && toConceptTypeId != null && toConceptTypeId != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(toConceptTypeId);\n toConceptType = conceptString;\n concept.type = toConceptType;\n }\n }\n }\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n if (!compositionList.includes(id)) {\n return concept === null || concept === void 0 ? void 0 : concept.characterValue;\n }\n else {\n if (visitedConcepts.includes(id)) {\n return \"\";\n }\n else {\n visitedConcepts.push(id);\n }\n for (let i = 0; i < connectionList.length; i++) {\n let insideTime = new Date().getTime();\n if (connectionList[i].ofTheConceptId == id) {\n if (id != connectionList[i].toTheConceptId) {\n let toConceptId = connectionList[i].toTheConceptId;\n let toConcept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(toConceptId);\n if ((toConcept == null || toConcept.id == 0) && toConceptId != null && toConceptId != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(toConceptId);\n toConcept = conceptString;\n }\n if (toConcept.id != 0) {\n if ((toConcept === null || toConcept === void 0 ? void 0 : toConcept.type) == null) {\n let toConceptTypeId = toConcept.typeId;\n let toConceptType = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(toConceptTypeId);\n toConcept.type = toConceptType;\n if (toConceptType == null && toConceptTypeId != null && toConceptTypeId != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(toConceptTypeId);\n toConceptType = conceptString;\n toConcept.type = toConceptType;\n }\n }\n }\n let regex = \"the_\";\n let localmainString = (_d = (_c = toConcept === null || toConcept === void 0 ? void 0 : toConcept.type) === null || _c === void 0 ? void 0 : _c.characterValue) !== null && _d !== void 0 ? _d : \"\";\n let localKey = localmainString.replace(regex, \"\");\n if (isNaN(Number(localKey))) {\n if (localKey) {\n const result = yield recursiveFetch(toConceptId, connectionList, compositionList, visitedConcepts);\n output[localKey] = result;\n }\n }\n else {\n const result = yield recursiveFetch(toConceptId, connectionList, compositionList, visitedConcepts);\n arroutput[localKey] = result;\n output = arroutput;\n }\n }\n else {\n console.log(\"this is the faulty connection \", connectionList[i]);\n }\n }\n }\n }\n return output;\n });\n}\nfunction recursiveFetchWithSubCompositions(id_1, connectionList_1, compositionList_1) {\n return __awaiter(this, arguments, void 0, function* (id, connectionList, compositionList, visitedConcepts = []) {\n var _a, _b, _c, _d;\n let output = {};\n let arroutput = [];\n if (id == 0) {\n return null;\n }\n let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);\n if ((concept == null || concept.id == 0) && id != null && id != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);\n concept = conceptString;\n }\n if (concept.id != 0) {\n if (concept.type == null) {\n let toConceptTypeId = concept.typeId;\n let toConceptType = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(toConceptTypeId);\n concept.type = toConceptType;\n if (toConceptType == null && toConceptTypeId != null && toConceptTypeId != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(toConceptTypeId);\n toConceptType = conceptString;\n concept.type = toConceptType;\n }\n }\n }\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n if (!compositionList.includes(id)) {\n return concept === null || concept === void 0 ? void 0 : concept.characterValue;\n }\n else {\n if (visitedConcepts.includes(id)) {\n return \"\";\n }\n else {\n visitedConcepts.push(id);\n }\n output[\"id\"] = id;\n for (let i = 0; i < connectionList.length; i++) {\n if (connectionList[i].ofTheConceptId == id) {\n let toConceptId = connectionList[i].toTheConceptId;\n let toConcept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(toConceptId);\n if ((toConcept == null || toConcept.id == 0) && toConceptId != null && toConceptId != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(toConceptId);\n toConcept = conceptString;\n }\n if (toConcept) {\n if ((toConcept === null || toConcept === void 0 ? void 0 : toConcept.type) == null) {\n let toConceptTypeId = toConcept.typeId;\n let toConceptType = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(toConceptTypeId);\n toConcept.type = toConceptType;\n if (toConceptType == null && toConceptTypeId != null && toConceptTypeId != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(toConceptTypeId);\n toConceptType = conceptString;\n toConcept.type = toConceptType;\n }\n }\n }\n let regex = \"the_\";\n let localmainString = (_d = (_c = toConcept === null || toConcept === void 0 ? void 0 : toConcept.type) === null || _c === void 0 ? void 0 : _c.characterValue) !== null && _d !== void 0 ? _d : \"\";\n let localKey = localmainString.replace(regex, \"\");\n if (isNaN(Number(localKey))) {\n if (localKey) {\n const result = yield recursiveFetchWithSubCompositions(toConceptId, connectionList, compositionList);\n output[localKey] = result;\n }\n }\n else {\n const result = yield recursiveFetchWithSubCompositions(toConceptId, connectionList, compositionList);\n arroutput[localKey] = result;\n output = arroutput;\n }\n }\n }\n }\n return output;\n });\n}\n\n\n//# sourceURL=webpack://mftsccs-browser/./src/Services/GetComposition.ts?");
1327
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ GetComposition: () => (/* binding */ GetComposition),\n/* harmony export */ GetCompositionById: () => (/* binding */ GetCompositionById),\n/* harmony export */ GetCompositionFromMemory: () => (/* binding */ GetCompositionFromMemory),\n/* harmony export */ GetCompositionFromMemoryNormal: () => (/* binding */ GetCompositionFromMemoryNormal),\n/* harmony export */ GetCompositionFromMemoryWithConnections: () => (/* binding */ GetCompositionFromMemoryWithConnections),\n/* harmony export */ GetCompositionWithAllIds: () => (/* binding */ GetCompositionWithAllIds),\n/* harmony export */ GetCompositionWithId: () => (/* binding */ GetCompositionWithId),\n/* harmony export */ GetCompositionWithIdAndDateFromMemory: () => (/* binding */ GetCompositionWithIdAndDateFromMemory),\n/* harmony export */ GetCompositionWithIdFromMemory: () => (/* binding */ GetCompositionWithIdFromMemory),\n/* harmony export */ GetCompositionWithIdFromMemoryFromConnection: () => (/* binding */ GetCompositionWithIdFromMemoryFromConnection),\n/* harmony export */ GetCompositionWithIdFromMemoryFromConnections: () => (/* binding */ GetCompositionWithIdFromMemoryFromConnections),\n/* harmony export */ GetCompositionWithIdFromMemoryNew: () => (/* binding */ GetCompositionWithIdFromMemoryNew),\n/* harmony export */ RecursiveFetchBuildLayer: () => (/* binding */ RecursiveFetchBuildLayer),\n/* harmony export */ RecursiveFetchBuildLayerDataId: () => (/* binding */ RecursiveFetchBuildLayerDataId),\n/* harmony export */ RecursiveFetchBuildLayerNormal: () => (/* binding */ RecursiveFetchBuildLayerNormal),\n/* harmony export */ recursiveFetch: () => (/* binding */ recursiveFetch),\n/* harmony export */ recursiveFetchConcept: () => (/* binding */ recursiveFetchConcept),\n/* harmony export */ recursiveFetchConceptNormal: () => (/* binding */ recursiveFetchConceptNormal),\n/* harmony export */ recursiveFetchConceptSingleLoop: () => (/* binding */ recursiveFetchConceptSingleLoop),\n/* harmony export */ recursiveFetchWithSubCompositions: () => (/* binding */ recursiveFetchWithSubCompositions)\n/* harmony export */ });\n/* harmony import */ var _Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Api/GetConcept */ \"./src/Api/GetConcept.ts\");\n/* harmony import */ var _Api_GetAllConnectionsOfComposition__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Api/GetAllConnectionsOfComposition */ \"./src/Api/GetAllConnectionsOfComposition.ts\");\n/* harmony import */ var _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../DataStructures/ConceptData */ \"./src/DataStructures/ConceptData.ts\");\n/* harmony import */ var _DataStructures_ConnectionData__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../DataStructures/ConnectionData */ \"./src/DataStructures/ConnectionData.ts\");\n/* harmony import */ var _app__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../app */ \"./src/app.ts\");\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n\n\n\n\n\nfunction GetCompositionById(id) {\n return __awaiter(this, void 0, void 0, function* () {\n let returnOutput = { connectionList: [], compositionList: [] };\n try {\n if (_app__WEBPACK_IMPORTED_MODULE_4__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_4__.sendMessage)('GetCompositionById', { id });\n return res.data;\n }\n catch (error) {\n console.error('GetCompositionById error sw: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_4__.handleServiceWorkerException)(error);\n }\n }\n let connectionListString = yield (0,_Api_GetAllConnectionsOfComposition__WEBPACK_IMPORTED_MODULE_1__.GetAllConnectionsOfComposition)(id);\n returnOutput.connectionList = connectionListString;\n for (let i = 0; i < returnOutput.connectionList.length; i++) {\n if (!returnOutput.compositionList.includes(returnOutput.connectionList[i].ofTheConceptId)) {\n returnOutput.compositionList.push(returnOutput.connectionList[i].ofTheConceptId);\n }\n }\n return returnOutput;\n }\n catch (error) {\n console.error('GetCompositionById error: ', error);\n return returnOutput;\n }\n });\n}\n/**\n * ## format JUSTDATA ##\n * this function builds the composition with the main id as the point of building.\n * @param id id of the main composition that you want to build\n * @param connectionList list of connections\n * @param compositionList list of of_the_concept_ids for all the connections.\n * @returns\n */\nfunction RecursiveFetchBuildLayer(id, connectionList, compositionList) {\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b;\n let returnOutput = {};\n let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);\n if (concept.id == 0 && id != null && id != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);\n concept = conceptString;\n }\n let output = yield recursiveFetch(id, connectionList, compositionList);\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n returnOutput[mainString] = output;\n return returnOutput;\n });\n}\n/**\n * ## format DATAID ##\n * this function builds the composition with the main id as the point of building.\n * @param id id of the main composition that you want to build\n * @param connectionList list of connections\n * @param compositionList list of of_the_concept_ids for all the connections.\n * @returns\n */\nfunction RecursiveFetchBuildLayerDataId(id, connectionList, compositionList) {\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b;\n let returnOutput = {};\n let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);\n if (concept.id == 0 && id != null && id != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);\n concept = conceptString;\n }\n let output = yield recursiveFetch(id, connectionList, compositionList);\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n returnOutput[mainString] = output;\n let FinalReturn = {};\n FinalReturn['created_at'] = concept.entryTimeStamp;\n FinalReturn['data'] = returnOutput;\n FinalReturn['id'] = id;\n return FinalReturn;\n });\n}\n/**\n * ## format Normal ##\n * this function builds the composition with the main id as the point of building.\n * @param id id of the main composition that you want to build\n * @param connectionList list of connections\n * @param compositionList list of of_the_concept_ids for all the connections.\n * @returns\n */\nfunction RecursiveFetchBuildLayerNormal(id, connectionList, compositionList) {\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b;\n let returnOutput = {};\n let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);\n if (concept.id == 0 && id != null && id != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);\n concept = conceptString;\n }\n let output = yield recursiveFetchConceptNormal(concept, connectionList, compositionList);\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n returnOutput[mainString] = output;\n return returnOutput;\n });\n}\n/**\n * ## format JUSTDATA ##\n * this function builds the composition with the main id as the point of building.\n * This just requires the id\n * @param id id of the main composition that you want to build\n * @param connectionList list of connections\n * @param compositionList list of of_the_concept_ids for all the connections.\n * @returns\n */\nfunction GetComposition(id) {\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b;\n if (_app__WEBPACK_IMPORTED_MODULE_4__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_4__.sendMessage)('GetComposition', { id });\n return res.data;\n }\n catch (error) {\n console.error('GetComposition error sw: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_4__.handleServiceWorkerException)(error);\n }\n }\n let connectionList = [];\n let returnOutput = {};\n let connectionListString = yield (0,_Api_GetAllConnectionsOfComposition__WEBPACK_IMPORTED_MODULE_1__.GetAllConnectionsOfComposition)(id);\n connectionList = connectionListString;\n console.log(\"this is the connection list online\", connectionList);\n //connectionList = ConnectionData.GetConnectionsOfComposition(id);\n let compositionList = [];\n for (let i = 0; i < connectionList.length; i++) {\n if (!compositionList.includes(connectionList[i].ofTheConceptId)) {\n compositionList.push(connectionList[i].ofTheConceptId);\n }\n }\n let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);\n if (concept.id == 0 && id != null && id != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);\n concept = conceptString;\n }\n let output = yield recursiveFetch(id, connectionList, compositionList);\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n returnOutput[mainString] = output;\n return returnOutput;\n });\n}\nfunction GetCompositionWithAllIds(id) {\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b;\n let connectionList = [];\n let returnOutput = {};\n let connectionListString = yield (0,_Api_GetAllConnectionsOfComposition__WEBPACK_IMPORTED_MODULE_1__.GetAllConnectionsOfComposition)(id);\n connectionList = connectionListString;\n //connectionList = ConnectionData.GetConnectionsOfComposition(id);\n let compositionList = [];\n for (let i = 0; i < connectionList.length; i++) {\n if (!compositionList.includes(connectionList[i].ofTheConceptId)) {\n compositionList.push(connectionList[i].ofTheConceptId);\n }\n }\n let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);\n if (concept.id == 0 && id != null && id != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);\n concept = conceptString;\n }\n let output = yield recursiveFetchWithSubCompositions(id, connectionList, compositionList);\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n returnOutput[mainString] = output;\n return returnOutput;\n });\n}\n/**\n * ### Format JUSTDATA ###\n * This function just builds data from the memory.\n * This is a function that takes on all the concepts and connections of the concept (as a composition ) and builds\n * it into a json data.\n * @param id this id is just used to get all the composition data from the concepts and connections in memory\n * @returns\n */\nfunction GetCompositionFromMemory(id) {\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b;\n if (_app__WEBPACK_IMPORTED_MODULE_4__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_4__.sendMessage)('GetCompositionFromMemory', { id });\n return res.data;\n }\n catch (error) {\n console.error('GetCompositionFromMemory error sw: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_4__.handleServiceWorkerException)(error);\n }\n }\n let connectionList = [];\n let returnOutput = {};\n //connectionList = await ConnectionData.GetConnectionsOfConcept(id);\n connectionList = yield _DataStructures_ConnectionData__WEBPACK_IMPORTED_MODULE_3__.ConnectionData.GetConnectionsOfCompositionLocal(id);\n //connectionList = ConnectionData.GetConnectionsOfComposition(id);\n let compositionList = [];\n for (let i = 0; i < connectionList.length; i++) {\n if (!compositionList.includes(connectionList[i].ofTheConceptId)) {\n compositionList.push(connectionList[i].ofTheConceptId);\n }\n }\n let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);\n if (concept.id == 0 && id != null && id != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);\n concept = conceptString;\n }\n let output = yield recursiveFetchConcept(concept, connectionList, compositionList);\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n returnOutput[mainString] = output;\n return returnOutput;\n });\n}\n/**\n * ### Format Normal ###\n * This function just builds data from the memory.\n * This is a function that takes on all the concepts and connections of the concept (as a composition ) and builds\n * it into a json data.\n * @param id this id is just used to get all the composition data from the concepts and connections in memory\n * @returns\n */\nfunction GetCompositionFromMemoryNormal(id) {\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b;\n if (_app__WEBPACK_IMPORTED_MODULE_4__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_4__.sendMessage)('GetCompositionFromMemoryNormal', { id });\n return res.data;\n }\n catch (error) {\n console.error('GetCompositionFromMemoryNormal error sw: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_4__.handleServiceWorkerException)(error);\n }\n }\n let connectionList = [];\n let returnOutput = {};\n //connectionList = await ConnectionData.GetConnectionsOfConcept(id);\n connectionList = yield _DataStructures_ConnectionData__WEBPACK_IMPORTED_MODULE_3__.ConnectionData.GetConnectionsOfCompositionLocal(id);\n //connectionList = ConnectionData.GetConnectionsOfComposition(id);\n let compositionList = [];\n for (let i = 0; i < connectionList.length; i++) {\n if (!compositionList.includes(connectionList[i].ofTheConceptId)) {\n compositionList.push(connectionList[i].ofTheConceptId);\n }\n }\n let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);\n if (concept.id == 0 && id != null && id != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);\n concept = conceptString;\n }\n let output = yield recursiveFetchConceptNormal(concept, connectionList, compositionList);\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n returnOutput[mainString] = output;\n return returnOutput;\n });\n}\n/**\n * ### Format DATAIDDATE ####\n * Gets data just from memory\n * @param id\n * @returns\n */\nfunction GetCompositionWithIdFromMemory(id) {\n var arguments_1 = arguments;\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b;\n _app__WEBPACK_IMPORTED_MODULE_4__.Logger.logfunction(GetCompositionWithIdFromMemory, arguments_1);\n if (_app__WEBPACK_IMPORTED_MODULE_4__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_4__.sendMessage)('GetCompositionWithIdFromMemory', { id });\n return res.data;\n }\n catch (error) {\n console.error('GetCompositionWithIdFromMemory error sw: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_4__.handleServiceWorkerException)(error);\n }\n }\n let FinalReturn = {};\n let connectionList = [];\n let returnOutput = {};\n // connectionList = await ConnectionData.GetConnectionsOfConcept(id);\n try {\n connectionList = yield _DataStructures_ConnectionData__WEBPACK_IMPORTED_MODULE_3__.ConnectionData.GetConnectionsOfCompositionLocal(id);\n let compositionList = [];\n for (let i = 0; i < connectionList.length; i++) {\n if (!compositionList.includes(connectionList[i].ofTheConceptId)) {\n compositionList.push(connectionList[i].ofTheConceptId);\n }\n }\n let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);\n if (concept.id == 0 && id != null && id != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);\n concept = conceptString;\n }\n let output = yield recursiveFetchConcept(concept, connectionList, compositionList);\n // let output = await recursiveFetchConceptSingleLoop(concept, connectionList,compositionList );\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n returnOutput[mainString] = output;\n FinalReturn['created_at'] = concept.entryTimeStamp;\n FinalReturn['data'] = returnOutput;\n FinalReturn['id'] = id;\n }\n catch (error) {\n console.log(\"this is the exception in GetCompositionWithIdFromMemory\", id);\n }\n return FinalReturn;\n });\n}\n/**\n * ### Format Normal ####\n * Gets data just from memory\n * @param id\n * @returns\n */\nfunction GetCompositionFromMemoryWithConnections(id, connectionList) {\n var arguments_2 = arguments;\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b;\n _app__WEBPACK_IMPORTED_MODULE_4__.Logger.logfunction(GetCompositionFromMemoryWithConnections, arguments_2);\n if (_app__WEBPACK_IMPORTED_MODULE_4__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_4__.sendMessage)('GetCompositionFromMemoryWithConnections', { id, connectionList });\n return res.data;\n }\n catch (error) {\n console.error('GetCompositionFromMemoryWithConnections error sw: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_4__.handleServiceWorkerException)(error);\n }\n }\n let returnOutput = {};\n // connectionList = await ConnectionData.GetConnectionsOfConcept(id);\n let compositionList = [];\n for (let i = 0; i < connectionList.length; i++) {\n if (!compositionList.includes(connectionList[i].ofTheConceptId)) {\n compositionList.push(connectionList[i].ofTheConceptId);\n }\n }\n let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);\n if (concept.id == 0 && id != null && id != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);\n concept = conceptString;\n }\n let output = yield recursiveFetchConcept(concept, connectionList, compositionList);\n // let output = await recursiveFetchConceptSingleLoop(concept, connectionList,compositionList );\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n returnOutput[mainString] = output;\n let FinalReturn = {};\n FinalReturn['created_at'] = concept.entryTimeStamp;\n FinalReturn['data'] = returnOutput;\n FinalReturn['id'] = id;\n return FinalReturn;\n });\n}\n/**\n * ### Format DATAIDDATE ####\n * Gets data just from memory\n * @param id\n * @returns\n */\nfunction GetCompositionWithIdFromMemoryFromConnection(id, connectionList) {\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b;\n if (_app__WEBPACK_IMPORTED_MODULE_4__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_4__.sendMessage)('GetCompositionWithIdFromMemory', { id });\n return res.data;\n }\n catch (error) {\n console.error('GetCompositionWithIdFromMemory error sw: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_4__.handleServiceWorkerException)(error);\n }\n }\n let returnOutput = {};\n // connectionList = await ConnectionData.GetConnectionsOfConcept(id);\n let compositionList = [];\n for (let i = 0; i < connectionList.length; i++) {\n if (!compositionList.includes(connectionList[i].ofTheConceptId)) {\n compositionList.push(connectionList[i].ofTheConceptId);\n }\n }\n let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);\n if (concept.id == 0 && id != null && id != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);\n concept = conceptString;\n }\n let output = yield recursiveFetchConcept(concept, connectionList, compositionList);\n console.log(\"this is the output\", output, concept);\n // let output = await recursiveFetchConceptSingleLoop(concept, connectionList,compositionList );\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n returnOutput[mainString] = output;\n let FinalReturn = {};\n FinalReturn['created_at'] = concept.entryTimeStamp;\n FinalReturn['data'] = returnOutput;\n FinalReturn['id'] = id;\n return FinalReturn;\n });\n}\n/**\n * ### Format DATAIDDATE ####\n * ### experimental ####\n * This is the new format that needs to work with a single or max two loops\n * @param id the id whose composition needs to be created\n * @returns\n */\nfunction GetCompositionWithIdFromMemoryNew(id) {\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b;\n if (_app__WEBPACK_IMPORTED_MODULE_4__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_4__.sendMessage)('GetCompositionWithIdFromMemoryNew', { id });\n return res.data;\n }\n catch (error) {\n console.error('GetCompositionWithIdFromMemoryNew error sw: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_4__.handleServiceWorkerException)(error);\n }\n }\n let connectionList = [];\n let returnOutput = {};\n //connectionList = await ConnectionData.GetConnectionsOfConcept(id);\n connectionList = yield _DataStructures_ConnectionData__WEBPACK_IMPORTED_MODULE_3__.ConnectionData.GetConnectionsOfCompositionLocal(id);\n let compositionList = [];\n for (let i = 0; i < connectionList.length; i++) {\n if (!compositionList.includes(connectionList[i].ofTheConceptId)) {\n compositionList.push(connectionList[i].ofTheConceptId);\n }\n }\n let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);\n if (concept.id == 0 && id != null && id != undefined) {\n console.log(\"this concept you cannot find \", id);\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);\n concept = conceptString;\n }\n let startTime = new Date().getTime();\n //console.log(\"this is the connection list which has to be looped\", connectionList);\n let output = yield recursiveFetchConceptSingleLoop(concept, connectionList, compositionList);\n console.log(\"this is the time for the data to be made\", new Date().getTime() - startTime);\n // let output = await recursiveFetchConceptSingleLoop(concept, connectionList,compositionList );\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n returnOutput = output;\n let FinalReturn = {};\n FinalReturn['created_at'] = concept.entryTimeStamp;\n FinalReturn['data'] = returnOutput;\n FinalReturn['id'] = id;\n return FinalReturn;\n });\n}\n/**\n * ### Format DATAIDDATE #####\n * ### This just returns composition from memory and not from anywhere else.\n * @param id\n * @returns\n */\nfunction GetCompositionWithIdAndDateFromMemory(id) {\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b;\n if (_app__WEBPACK_IMPORTED_MODULE_4__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_4__.sendMessage)('GetCompositionWithIdAndDateFromMemory', { id });\n return res.data;\n }\n catch (error) {\n console.error('GetCompositionWithIdAndDateFromMemory error sw: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_4__.handleServiceWorkerException)(error);\n }\n }\n let connectionList = [];\n let returnOutput = {};\n connectionList = yield _DataStructures_ConnectionData__WEBPACK_IMPORTED_MODULE_3__.ConnectionData.GetConnectionsOfCompositionLocal(id);\n //connectionList = await ConnectionData.GetConnectionsOfConcept(id);\n let compositionList = [];\n for (let i = 0; i < connectionList.length; i++) {\n if (!compositionList.includes(connectionList[i].ofTheConceptId)) {\n compositionList.push(connectionList[i].ofTheConceptId);\n }\n }\n let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);\n if (concept.id == 0 && id != null && id != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);\n concept = conceptString;\n }\n let output = yield recursiveFetch(id, connectionList, compositionList);\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n returnOutput[mainString] = output;\n let FinalReturn = {};\n FinalReturn['data'] = returnOutput;\n FinalReturn['id'] = id;\n FinalReturn['created_at'] = concept.entryTimeStamp;\n return FinalReturn;\n });\n}\nfunction GetCompositionWithIdFromMemoryFromConnections(id_1) {\n return __awaiter(this, arguments, void 0, function* (id, connectionList = []) {\n var _a, _b;\n let returnOutput = {};\n //connectionList = await ConnectionData.GetConnectionsOfCompositionLocal(id);\n let compositionList = [];\n for (let i = 0; i < connectionList.length; i++) {\n if (!compositionList.includes(connectionList[i].ofTheConceptId)) {\n compositionList.push(connectionList[i].ofTheConceptId);\n }\n }\n let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);\n if (concept.id == 0 && id != null && id != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);\n concept = conceptString;\n }\n let output = yield recursiveFetch(id, connectionList, compositionList);\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n returnOutput[mainString] = output;\n let FinalReturn = {};\n FinalReturn['data'] = returnOutput;\n FinalReturn['id'] = id;\n return FinalReturn;\n });\n}\n/**\n * #### Format DATAID ####\n * ## This will return the composition even if it is not in the local memory ##\n * @param id\n * @returns\n */\nfunction GetCompositionWithId(id) {\n var arguments_3 = arguments;\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b;\n _app__WEBPACK_IMPORTED_MODULE_4__.Logger.logfunction(GetCompositionWithId, arguments_3);\n if (_app__WEBPACK_IMPORTED_MODULE_4__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_4__.sendMessage)('GetCompositionWithId', { id });\n return res.data;\n }\n catch (error) {\n console.error('GetCompositionWithId error sw: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_4__.handleServiceWorkerException)(error);\n }\n }\n let connectionList = [];\n let returnOutput = {};\n let connectionListString = yield (0,_Api_GetAllConnectionsOfComposition__WEBPACK_IMPORTED_MODULE_1__.GetAllConnectionsOfComposition)(id);\n connectionList = connectionListString;\n let compositionList = [];\n for (let i = 0; i < connectionList.length; i++) {\n if (!compositionList.includes(connectionList[i].ofTheConceptId)) {\n compositionList.push(connectionList[i].ofTheConceptId);\n }\n }\n let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);\n if (concept.id == 0 && id != null && id != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);\n concept = conceptString;\n }\n let output = yield recursiveFetch(id, connectionList, compositionList);\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n returnOutput[mainString] = output;\n let FinalReturn = {};\n FinalReturn['data'] = returnOutput;\n FinalReturn['id'] = id;\n return FinalReturn;\n });\n}\n/**\n * ## Format justdata ###\n * ## This contains a concept in the parameter so that you dont have to again find the concept ##\n * This function takes concepts and connections and then builds a json.\n * @param concept The concept that needs to get other concepts that are inside of it.\n * @param connectionList List of connections that are available in the composition. We have to loop over it.\n * @param compositionList Composition list is the list of concepts that have connections inside of them.\n * @param visitedConcepts This is a checking mechanism to not go in loops. So preferably pass an empty array.\n * @returns\n */\nfunction recursiveFetchConcept(concept_1, connectionList_1, compositionList_1) {\n var arguments_4 = arguments;\n return __awaiter(this, arguments, void 0, function* (concept, connectionList, compositionList, visitedConcepts = []) {\n var _a, _b, _c, _d;\n _app__WEBPACK_IMPORTED_MODULE_4__.Logger.logfunction(recursiveFetchConcept, arguments_4);\n let output = {};\n let arroutput = [];\n let id = concept.id;\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n if (!compositionList.includes(id)) {\n return concept === null || concept === void 0 ? void 0 : concept.characterValue;\n }\n else {\n if (visitedConcepts.includes(id)) {\n return \"\";\n }\n else {\n visitedConcepts.push(id);\n }\n for (let i = 0; i < connectionList.length; i++) {\n if (connectionList[i].ofTheConceptId == id) {\n if (id != connectionList[i].toTheConceptId) {\n let toConceptId = connectionList[i].toTheConceptId;\n let toConcept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(toConceptId);\n if ((toConcept == null || toConcept.id == 0) && toConceptId != null && toConceptId != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(toConceptId);\n toConcept = conceptString;\n }\n if (toConcept.id != 0) {\n if ((toConcept === null || toConcept === void 0 ? void 0 : toConcept.type) == null) {\n let toConceptTypeId = toConcept.typeId;\n let toConceptType = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(toConceptTypeId);\n toConcept.type = toConceptType;\n if (toConceptType == null && toConceptTypeId != null && toConceptTypeId != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(toConceptTypeId);\n toConceptType = conceptString;\n toConcept.type = toConceptType;\n }\n }\n }\n let regex = \"the_\";\n let localmainString = (_d = (_c = toConcept === null || toConcept === void 0 ? void 0 : toConcept.type) === null || _c === void 0 ? void 0 : _c.characterValue) !== null && _d !== void 0 ? _d : \"\";\n let localKey = localmainString.replace(regex, \"\");\n if (isNaN(Number(localKey))) {\n if (localKey) {\n const result = yield recursiveFetchConcept(toConcept, connectionList, compositionList, visitedConcepts);\n output[localKey] = result;\n }\n }\n else {\n const result = yield recursiveFetchConcept(toConcept, connectionList, compositionList, visitedConcepts);\n arroutput[localKey] = result;\n output = arroutput;\n }\n }\n else {\n console.log(\"this is the faulty connection \", connectionList[i]);\n }\n }\n }\n }\n return output;\n });\n}\n/**\n* ## Format Normal ###\n* ## This contains a concept in the parameter so that you dont have to again find the concept ##\n* This function takes concepts and connections and then builds a json.\n* @param concept The concept that needs to get other concepts that are inside of it.\n* @param connectionList List of connections that are available in the composition. We have to loop over it.\n* @param compositionList Composition list is the list of concepts that have connections inside of them.\n* @param visitedConcepts This is a checking mechanism to not go in loops. So preferably pass an empty array.\n* @returns\n*/\nfunction recursiveFetchConceptNormal(concept_1, connectionList_1, compositionList_1) {\n var arguments_5 = arguments;\n return __awaiter(this, arguments, void 0, function* (concept, connectionList, compositionList, visitedConcepts = []) {\n var _a, _b, _c, _d;\n _app__WEBPACK_IMPORTED_MODULE_4__.Logger.logfunction(recursiveFetchConceptNormal, arguments_5);\n let startTime = new Date().getTime();\n let output = {};\n let arroutput = [];\n let id = concept.id;\n output[\"id\"] = id;\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n if (!compositionList.includes(id)) {\n return concept === null || concept === void 0 ? void 0 : concept.characterValue;\n }\n else {\n if (visitedConcepts.includes(id)) {\n return \"\";\n }\n else {\n visitedConcepts.push(id);\n }\n for (let i = 0; i < connectionList.length; i++) {\n if (connectionList[i].ofTheConceptId == id) {\n if (id != connectionList[i].toTheConceptId) {\n let toConceptId = connectionList[i].toTheConceptId;\n let toConcept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(toConceptId);\n if ((toConcept == null || toConcept.id == 0) && toConceptId != null && toConceptId != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(toConceptId);\n toConcept = conceptString;\n }\n if (toConcept.id != 0) {\n if ((toConcept === null || toConcept === void 0 ? void 0 : toConcept.type) == null) {\n let toConceptTypeId = toConcept.typeId;\n let toConceptType = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(toConceptTypeId);\n toConcept.type = toConceptType;\n if (toConceptType == null && toConceptTypeId != null && toConceptTypeId != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(toConceptTypeId);\n toConceptType = conceptString;\n toConcept.type = toConceptType;\n }\n }\n }\n let regex = \"the_\";\n let localmainString = (_d = (_c = toConcept === null || toConcept === void 0 ? void 0 : toConcept.type) === null || _c === void 0 ? void 0 : _c.characterValue) !== null && _d !== void 0 ? _d : \"\";\n let localKey = localmainString.replace(regex, \"\");\n if (isNaN(Number(localKey))) {\n if (localKey) {\n const result = yield recursiveFetchConcept(toConcept, connectionList, compositionList, visitedConcepts);\n output[localKey] = result;\n }\n }\n else {\n const result = yield recursiveFetchConcept(toConcept, connectionList, compositionList, visitedConcepts);\n arroutput[localKey] = result;\n output = arroutput;\n }\n }\n else {\n console.log(\"this is the faulty connection \", connectionList[i]);\n }\n }\n }\n }\n // console.log(\"second loop normal\", new Date().getTime() - startTime);\n return output;\n });\n}\n/**\n * ## experimental ##\n* This function takes concepts and connections and then builds a json.\n* @param concept The concept that needs to get other concepts that are inside of it.\n* @param connectionList List of connections that are available in the composition. We have to loop over it.\n* @param compositionList Composition list is the list of concepts that have connections inside of them.\n* @param visitedConcepts This is a checking mechanism to not go in loops. So preferably pass an empty array.\n* @returns\n*/\nfunction recursiveFetchConceptSingleLoop(concept_1, connectionList_1, compositionList_1) {\n return __awaiter(this, arguments, void 0, function* (concept, connectionList, compositionList, visitedConcepts = []) {\n var _a, _b, _c, _d, _e, _f, _g, _h;\n let output = {};\n let id = concept.id;\n let startTime = new Date().getTime();\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n if (!compositionList.includes(id)) {\n let myString = mainString;\n let returnoutput = { [myString]: concept === null || concept === void 0 ? void 0 : concept.characterValue };\n return returnoutput;\n }\n else {\n if (visitedConcepts.includes(id)) {\n return \"\";\n }\n else {\n visitedConcepts.push(id);\n }\n for (let i = 0; i < connectionList.length; i++) {\n let newData = yield (0,_app__WEBPACK_IMPORTED_MODULE_4__.GetTheConcept)(connectionList[i].ofTheConceptId);\n let toConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_4__.GetTheConcept)(connectionList[i].toTheConceptId);\n connectionList[i].ofConcept = newData;\n connectionList[i].toConcept = toConcept;\n let ofKey = newData.id;\n let toConceptKey = (_d = (_c = toConcept === null || toConcept === void 0 ? void 0 : toConcept.type) === null || _c === void 0 ? void 0 : _c.characterValue) !== null && _d !== void 0 ? _d : \"\";\n let regex = \"the_\";\n let localmainString = toConceptKey;\n let localToKey = localmainString.replace(regex, \"\");\n if (output[ofKey] == undefined || output[ofKey] == null) {\n output[ofKey] = {};\n }\n output[ofKey][localToKey] = toConcept.characterValue;\n }\n }\n let finalOutput = {};\n for (let i = 0; i < connectionList.length; i++) {\n let ofConcept = connectionList[i].ofConcept;\n let toConcept = connectionList[i].toConcept;\n let ofConceptKey = (_f = (_e = ofConcept === null || ofConcept === void 0 ? void 0 : ofConcept.type) === null || _e === void 0 ? void 0 : _e.characterValue) !== null && _f !== void 0 ? _f : \"\";\n let toConceptKey = (_h = (_g = toConcept === null || toConcept === void 0 ? void 0 : toConcept.type) === null || _g === void 0 ? void 0 : _g.characterValue) !== null && _h !== void 0 ? _h : \"\";\n let regex = \"the_\";\n let localmainString = toConceptKey;\n let localToKey = localmainString.replace(regex, \"\");\n if (finalOutput[ofConcept.id] == undefined || finalOutput[ofConcept.id] == null) {\n finalOutput[ofConcept.id] = {};\n }\n let internalOutput = finalOutput[ofConcept.id];\n if (internalOutput[ofConceptKey] == undefined || internalOutput[ofConceptKey] == null) {\n internalOutput[ofConceptKey] = {};\n }\n if (output[connectionList[i].ofTheConceptId] != undefined && output[connectionList[i].toTheConceptId] != undefined) {\n internalOutput[ofConceptKey][localToKey] = output[toConcept.id];\n }\n else {\n internalOutput[ofConceptKey][localToKey] = toConcept.characterValue;\n }\n }\n return finalOutput[concept.id];\n });\n}\n/**\n * ## Format justdata ##\n * @param id\n * @param connectionList\n * @param compositionList\n * @param visitedConcepts\n * @returns\n */\nfunction recursiveFetch(id_1, connectionList_1, compositionList_1) {\n return __awaiter(this, arguments, void 0, function* (id, connectionList, compositionList, visitedConcepts = []) {\n var _a, _b, _c, _d;\n let output = {};\n let arroutput = [];\n if (id == 0) {\n return null;\n }\n let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);\n if ((concept == null || concept.id == 0) && id != null && id != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);\n concept = conceptString;\n }\n if (concept.id != 0) {\n if (concept.type == null) {\n let toConceptTypeId = concept.typeId;\n let toConceptType = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(toConceptTypeId);\n concept.type = toConceptType;\n if (toConceptType == null && toConceptTypeId != null && toConceptTypeId != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(toConceptTypeId);\n toConceptType = conceptString;\n concept.type = toConceptType;\n }\n }\n }\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n if (!compositionList.includes(id)) {\n return concept === null || concept === void 0 ? void 0 : concept.characterValue;\n }\n else {\n if (visitedConcepts.includes(id)) {\n return \"\";\n }\n else {\n visitedConcepts.push(id);\n }\n for (let i = 0; i < connectionList.length; i++) {\n let insideTime = new Date().getTime();\n if (connectionList[i].ofTheConceptId == id) {\n if (id != connectionList[i].toTheConceptId) {\n let toConceptId = connectionList[i].toTheConceptId;\n let toConcept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(toConceptId);\n if ((toConcept == null || toConcept.id == 0) && toConceptId != null && toConceptId != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(toConceptId);\n toConcept = conceptString;\n }\n if (toConcept.id != 0) {\n if ((toConcept === null || toConcept === void 0 ? void 0 : toConcept.type) == null) {\n let toConceptTypeId = toConcept.typeId;\n let toConceptType = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(toConceptTypeId);\n toConcept.type = toConceptType;\n if (toConceptType == null && toConceptTypeId != null && toConceptTypeId != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(toConceptTypeId);\n toConceptType = conceptString;\n toConcept.type = toConceptType;\n }\n }\n }\n let regex = \"the_\";\n let localmainString = (_d = (_c = toConcept === null || toConcept === void 0 ? void 0 : toConcept.type) === null || _c === void 0 ? void 0 : _c.characterValue) !== null && _d !== void 0 ? _d : \"\";\n let localKey = localmainString.replace(regex, \"\");\n if (isNaN(Number(localKey))) {\n if (localKey) {\n const result = yield recursiveFetch(toConceptId, connectionList, compositionList, visitedConcepts);\n output[localKey] = result;\n }\n }\n else {\n const result = yield recursiveFetch(toConceptId, connectionList, compositionList, visitedConcepts);\n arroutput[localKey] = result;\n output = arroutput;\n }\n }\n else {\n console.log(\"this is the faulty connection \", connectionList[i]);\n }\n }\n }\n }\n return output;\n });\n}\nfunction recursiveFetchWithSubCompositions(id_1, connectionList_1, compositionList_1) {\n return __awaiter(this, arguments, void 0, function* (id, connectionList, compositionList, visitedConcepts = []) {\n var _a, _b, _c, _d;\n let output = {};\n let arroutput = [];\n if (id == 0) {\n return null;\n }\n let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);\n if ((concept == null || concept.id == 0) && id != null && id != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);\n concept = conceptString;\n }\n if (concept.id != 0) {\n if (concept.type == null) {\n let toConceptTypeId = concept.typeId;\n let toConceptType = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(toConceptTypeId);\n concept.type = toConceptType;\n if (toConceptType == null && toConceptTypeId != null && toConceptTypeId != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(toConceptTypeId);\n toConceptType = conceptString;\n concept.type = toConceptType;\n }\n }\n }\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n if (!compositionList.includes(id)) {\n return concept === null || concept === void 0 ? void 0 : concept.characterValue;\n }\n else {\n if (visitedConcepts.includes(id)) {\n return \"\";\n }\n else {\n visitedConcepts.push(id);\n }\n output[\"id\"] = id;\n for (let i = 0; i < connectionList.length; i++) {\n if (connectionList[i].ofTheConceptId == id) {\n let toConceptId = connectionList[i].toTheConceptId;\n let toConcept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(toConceptId);\n if ((toConcept == null || toConcept.id == 0) && toConceptId != null && toConceptId != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(toConceptId);\n toConcept = conceptString;\n }\n if (toConcept) {\n if ((toConcept === null || toConcept === void 0 ? void 0 : toConcept.type) == null) {\n let toConceptTypeId = toConcept.typeId;\n let toConceptType = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(toConceptTypeId);\n toConcept.type = toConceptType;\n if (toConceptType == null && toConceptTypeId != null && toConceptTypeId != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(toConceptTypeId);\n toConceptType = conceptString;\n toConcept.type = toConceptType;\n }\n }\n }\n let regex = \"the_\";\n let localmainString = (_d = (_c = toConcept === null || toConcept === void 0 ? void 0 : toConcept.type) === null || _c === void 0 ? void 0 : _c.characterValue) !== null && _d !== void 0 ? _d : \"\";\n let localKey = localmainString.replace(regex, \"\");\n if (isNaN(Number(localKey))) {\n if (localKey) {\n const result = yield recursiveFetchWithSubCompositions(toConceptId, connectionList, compositionList);\n output[localKey] = result;\n }\n }\n else {\n const result = yield recursiveFetchWithSubCompositions(toConceptId, connectionList, compositionList);\n arroutput[localKey] = result;\n output = arroutput;\n }\n }\n }\n }\n return output;\n });\n}\n\n\n//# sourceURL=webpack://mftsccs-browser/./src/Services/GetComposition.ts?");
1328
1328
 
1329
1329
  /***/ }),
1330
1330
 
@@ -1334,7 +1334,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
1334
1334
  \********************************************/
1335
1335
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1336
1336
 
1337
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ GetCompositionBulk: () => (/* binding */ GetCompositionBulk),\n/* harmony export */ GetCompositionBulkWithDataId: () => (/* binding */ GetCompositionBulkWithDataId),\n/* harmony export */ GetCompositionFromConnectionsInObject: () => (/* binding */ GetCompositionFromConnectionsInObject),\n/* harmony export */ GetCompositionFromConnectionsInObjectNormal: () => (/* binding */ GetCompositionFromConnectionsInObjectNormal),\n/* harmony export */ GetCompositionFromConnectionsWithDataId: () => (/* binding */ GetCompositionFromConnectionsWithDataId),\n/* harmony export */ GetCompositionFromConnectionsWithDataIdFromConnections: () => (/* binding */ GetCompositionFromConnectionsWithDataIdFromConnections),\n/* harmony export */ GetCompositionFromConnectionsWithDataIdInObject: () => (/* binding */ GetCompositionFromConnectionsWithDataIdInObject),\n/* harmony export */ GetCompositionFromConnectionsWithDataIdInObjectNew: () => (/* binding */ GetCompositionFromConnectionsWithDataIdInObjectNew),\n/* harmony export */ GetCompositionFromConnectionsWithDataIdIndex: () => (/* binding */ GetCompositionFromConnectionsWithDataIdIndex),\n/* harmony export */ GetCompositionFromConnectionsWithIndex: () => (/* binding */ GetCompositionFromConnectionsWithIndex),\n/* harmony export */ GetCompositionFromConnectionsWithIndexFromConnections: () => (/* binding */ GetCompositionFromConnectionsWithIndexFromConnections),\n/* harmony export */ GetConnectionDataPrefetch: () => (/* binding */ GetConnectionDataPrefetch)\n/* harmony export */ });\n/* harmony import */ var _Api_GetAllConnectionsOfCompositionBulk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Api/GetAllConnectionsOfCompositionBulk */ \"./src/Api/GetAllConnectionsOfCompositionBulk.ts\");\n/* harmony import */ var _Api_GetConnectionBulk__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Api/GetConnectionBulk */ \"./src/Api/GetConnectionBulk.ts\");\n/* harmony import */ var _app__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../app */ \"./src/app.ts\");\n/* harmony import */ var _FindConnectionsOfCompositionBulkInMemory__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./FindConnectionsOfCompositionBulkInMemory */ \"./src/Services/FindConnectionsOfCompositionBulkInMemory.ts\");\n/* harmony import */ var _GetComposition__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./GetComposition */ \"./src/Services/GetComposition.ts\");\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n\n\n\n\n\n/**\n * ## Format JUSTDATA ##\n * Function converts the conceptIds to json (compositions)\n * This function takes in the conceptIds and returns a list of compositions related to those concepts.\n * @param conceptIds list of concept ids that are compositions.\n * @returns compositions\n */\nfunction GetCompositionBulk() {\n return __awaiter(this, arguments, void 0, function* (conceptIds = []) {\n yield (0,_Api_GetAllConnectionsOfCompositionBulk__WEBPACK_IMPORTED_MODULE_0__.GetAllConnectionsOfCompositionBulk)(conceptIds);\n let compositions = [];\n for (let i = 0; i < conceptIds.length; i++) {\n let comp = yield (0,_GetComposition__WEBPACK_IMPORTED_MODULE_4__.GetCompositionFromMemory)(conceptIds[i]);\n compositions.push(comp);\n }\n return compositions;\n });\n}\n/**\n * ## FORMAT DATAIDDATE ##\n * Function converts the conceptIds to json (compositions)\n * @param conceptIds this is the list of concept ids that should be converted to compostions in data - id format.\n * @returns list of compositions in the data - id format.\n */\nfunction GetCompositionBulkWithDataId() {\n return __awaiter(this, arguments, void 0, function* (conceptIds = []) {\n yield (0,_Api_GetAllConnectionsOfCompositionBulk__WEBPACK_IMPORTED_MODULE_0__.GetAllConnectionsOfCompositionBulk)(conceptIds);\n let compositions = [];\n for (let i = 0; i < conceptIds.length; i++) {\n let comp = yield (0,_GetComposition__WEBPACK_IMPORTED_MODULE_4__.GetCompositionWithIdFromMemory)(conceptIds[i]);\n compositions.push(comp);\n }\n return compositions;\n });\n}\n/**\n * ## FORMAT DATAIDDATE ##\n * This function converts the conceptIds and internal connectionIds to compositions in data-Id format.\n * @param conceptIds This is the list of concept ids that need to be converted to compositions.\n * @param connectionIds These are the internal connectionIds that need to be passed to create the compositions.\n * @returns list of compositions created from the passed conceptIds and connectionIds.\n */\nfunction GetCompositionFromConnectionsWithDataId() {\n var arguments_1 = arguments;\n return __awaiter(this, arguments, void 0, function* (conceptIds = [], connectionIds = []) {\n _app__WEBPACK_IMPORTED_MODULE_2__.Logger.logfunction(GetCompositionFromConnectionsWithDataId, arguments_1);\n if (_app__WEBPACK_IMPORTED_MODULE_2__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_2__.sendMessage)('GetCompositionFromConnectionsWithDataId', { conceptIds, connectionIds });\n return res.data;\n }\n catch (error) {\n console.error('GetCompositionFromConnectionsWithDataId error sw: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_2__.handleServiceWorkerException)(error);\n }\n }\n // let newConnections = await GetConnectionBulk(connectionIds);\n // let oldConnections = await FindConnectionsOfCompositionsBulkInMemory(conceptIds);\n //CheckForConnectionDeletionWithIds(connectionIds,oldConnections);\n let compositions = [];\n for (let i = 0; i < conceptIds.length; i++) {\n let comp = yield (0,_GetComposition__WEBPACK_IMPORTED_MODULE_4__.GetCompositionWithIdFromMemory)(conceptIds[i]);\n compositions.push(comp);\n }\n return compositions;\n });\n}\n/**\n * ## FORMAT DATAIDDATE ##\n * This is just a different version of GetCompositionFromConnectionsWithDataId, This has the added functionality that\n * it also prints out internal connections.\n * This function converts the conceptIds and internal connectionIds to compositions in data-Id format.\n * @param conceptIds This is the list of concept ids that need to be converted to compositions.\n * @param connectionIds These are the internal connectionIds that need to be passed to create the compositions.\n * @returns list of compositions created from the passed conceptIds and connectionIds.\n */\nfunction GetCompositionFromConnectionsWithDataIdFromConnections() {\n var arguments_2 = arguments;\n return __awaiter(this, arguments, void 0, function* (conceptIds = [], connectionIds = []) {\n _app__WEBPACK_IMPORTED_MODULE_2__.Logger.logfunction(GetCompositionFromConnectionsWithDataIdFromConnections, arguments_2);\n if (_app__WEBPACK_IMPORTED_MODULE_2__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_2__.sendMessage)('GetCompositionFromConnectionsWithDataIdFromConnections', { conceptIds, connectionIds });\n return res.data;\n }\n catch (error) {\n console.error('GetCompositionFromConnectionsWithDataIdFromConnections error sw: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_2__.handleServiceWorkerException)(error);\n }\n }\n let newConnections = yield (0,_Api_GetConnectionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionBulk)(connectionIds);\n //CheckForConnectionDeletionWithIds(connectionIds,oldConnections);\n let compositions = [];\n for (let i = 0; i < conceptIds.length; i++) {\n let comp = yield (0,_GetComposition__WEBPACK_IMPORTED_MODULE_4__.GetCompositionWithIdFromMemoryFromConnection)(conceptIds[i], newConnections);\n compositions.push(comp);\n }\n return compositions;\n });\n}\n/**\n * ## Format DATAIDDATE ##\n * This function converts the conceptIds and internal connectionIds to compositions in data-Id format with index(conceptId).\n * @param conceptIds This is the list of concept ids that need to be converted to compositions.\n * @param connectionIds These are the internal connectionIds that need to be passed to create the compositions.\n * @returns dictionary of compositions created from the passed conceptIds and connectionIds with conceptId as its index .\n */\nfunction GetCompositionFromConnectionsWithDataIdIndex() {\n return __awaiter(this, arguments, void 0, function* (conceptIds = [], connectionIds = []) {\n if (_app__WEBPACK_IMPORTED_MODULE_2__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_2__.sendMessage)('GetCompositionFromConnectionsWithDataIdIndex', { conceptIds, connectionIds });\n return res.data;\n }\n catch (error) {\n console.error('GetCompositionFromConnectionsWithDataIdIndex error sw: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_2__.handleServiceWorkerException)(error);\n }\n }\n let newConnections = yield (0,_Api_GetConnectionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionBulk)(connectionIds);\n let myNewConnections = newConnections;\n let oldConnections = yield (0,_FindConnectionsOfCompositionBulkInMemory__WEBPACK_IMPORTED_MODULE_3__.FindConnectionsOfCompositionsBulkInMemory)(conceptIds);\n //CheckForConnectionDeletionWithIds(connectionIds,oldConnections);\n let compositions = {};\n for (let i = 0; i < conceptIds.length; i++) {\n let comp = yield (0,_GetComposition__WEBPACK_IMPORTED_MODULE_4__.GetCompositionWithIdFromMemory)(conceptIds[i]);\n compositions[conceptIds[i]] = comp;\n }\n return compositions;\n });\n}\n/**\n * ## Format is dictionary with key as concept id and value as data (json) ##\n * This function converts the conceptIds and internal connectionIds to compositions format with index(conceptId).\n * @param conceptIds This is the list of concept ids that need to be converted to compositions.\n * @param connectionIds These are the internal connectionIds that need to be passed to create the compositions.\n * @returns dictionary of compositions created from the passed conceptIds and connectionIds with conceptId as its index .\n */\nfunction GetCompositionFromConnectionsWithIndex() {\n return __awaiter(this, arguments, void 0, function* (conceptIds = [], connectionIds = []) {\n let newConnections = yield (0,_Api_GetConnectionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionBulk)(connectionIds);\n let myNewConnections = newConnections;\n let oldConnections = yield (0,_FindConnectionsOfCompositionBulkInMemory__WEBPACK_IMPORTED_MODULE_3__.FindConnectionsOfCompositionsBulkInMemory)(conceptIds);\n //CheckForConnectionDeletionWithIds(connectionIds,oldConnections);\n let compositions = {};\n for (let i = 0; i < conceptIds.length; i++) {\n let comp = yield (0,_GetComposition__WEBPACK_IMPORTED_MODULE_4__.GetCompositionFromMemory)(conceptIds[i]);\n compositions[conceptIds[i]] = comp;\n }\n return compositions;\n });\n}\n/**\n * ## FORMAT DATAIDDATE ##\n * This is just a different version of GetCompositionFromConnectionsWithDataId, This has the added functionality that\n * it also prints out internal connections.\n * This function converts the conceptIds and internal connectionIds to compositions in data-Id format.\n * @param conceptIds This is the list of concept ids that need to be converted to compositions.\n * @param connectionIds These are the internal connectionIds that need to be passed to create the compositions.\n * @returns list of compositions created from the passed conceptIds and connectionIds.\n */\nfunction GetCompositionFromConnectionsWithIndexFromConnections() {\n return __awaiter(this, arguments, void 0, function* (conceptIds = [], connectionIds = []) {\n if (_app__WEBPACK_IMPORTED_MODULE_2__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_2__.sendMessage)('GetCompositionFromConnectionsWithIndexFromConnections', { conceptIds, connectionIds });\n return res.data;\n }\n catch (error) {\n console.error('GetCompositionFromConnectionsWithIndexFromConnections error sw: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_2__.handleServiceWorkerException)(error);\n }\n }\n let newConnections = yield (0,_Api_GetConnectionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionBulk)(connectionIds);\n //CheckForConnectionDeletionWithIds(connectionIds,oldConnections);\n let compositions = [];\n for (let i = 0; i < conceptIds.length; i++) {\n let comp = yield (0,_GetComposition__WEBPACK_IMPORTED_MODULE_4__.GetCompositionFromMemoryWithConnections)(conceptIds[i], newConnections);\n compositions[conceptIds[i]] = comp;\n }\n return compositions;\n });\n}\n/**\n * Used to prefetch all the connections and their related concepts.\n * @param connectionIds these are the connection ids that are used to fetch all the connections and also their related concepts.\n * @returns all the connections that are passed as ids.\n */\nfunction GetConnectionDataPrefetch(connectionIds) {\n var arguments_3 = arguments;\n return __awaiter(this, void 0, void 0, function* () {\n _app__WEBPACK_IMPORTED_MODULE_2__.Logger.logfunction(GetConnectionDataPrefetch, arguments_3);\n if (_app__WEBPACK_IMPORTED_MODULE_2__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_2__.sendMessage)('GetConnectionDataPrefetch', { connectionIds });\n return res.data;\n }\n catch (error) {\n console.error('GetConnectionDataPrefetch error sw: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_2__.handleServiceWorkerException)(error);\n }\n }\n let remainingConnections = [];\n let connectionsAll = [];\n let remainingIds = {};\n for (let i = 0; i < connectionIds.length; i++) {\n let connection = yield _app__WEBPACK_IMPORTED_MODULE_2__.ConnectionData.GetConnection(connectionIds[i]);\n // console.log(\"this is the connection fetch\", connection);\n if (connection.id == 0) {\n remainingConnections.push(connectionIds[i]);\n }\n else {\n connectionsAll.push(connection);\n }\n }\n for (let i = 0; i < remainingConnections.length; i++) {\n remainingIds[connectionIds[i]] = false;\n }\n //await ConnectionData.GetConnectionBulkData(connectionIds, connectionsAll, remainingIds);\n // for(let key in remainingIds){\n // if(remainingIds[key] == false){\n // remainingConnections.push(Number(key));\n // }\n // }\n // remainingConnections = connectionIds;\n let prefetchConcepts = [];\n let connectionsAllLocal = yield (0,_Api_GetConnectionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionBulk)(remainingConnections);\n connectionsAll = [...connectionsAll, ...connectionsAllLocal];\n for (let j = 0; j < connectionsAll.length; j++) {\n prefetchConcepts.push(connectionsAll[j].ofTheConceptId);\n prefetchConcepts.push(connectionsAll[j].toTheConceptId);\n prefetchConcepts.push(connectionsAll[j].typeId);\n }\n yield (0,_app__WEBPACK_IMPORTED_MODULE_2__.GetConceptBulk)(prefetchConcepts);\n return connectionsAll;\n });\n}\n/**\n * ## Format DATAIDDATE ##\n * This function converts the conceptIds and internal connections to create compositions.\n * Format is of a dictionary with ids as the key and value is the composition data.\n * @param conceptIds these are the concept ids that need to be fetched to create their compositions\n * @param connections these are the connections that are used to create the structure.\n * @returns a dictionary / object that has key as their conceptId and the value as their composition object.\n */\nfunction GetCompositionFromConnectionsWithDataIdInObject() {\n var arguments_4 = arguments;\n return __awaiter(this, arguments, void 0, function* (conceptIds = [], connections = []) {\n _app__WEBPACK_IMPORTED_MODULE_2__.Logger.logfunction(GetCompositionFromConnectionsWithDataIdInObject, arguments_4);\n // get all the connections that are not available in memory from the api.\n yield (0,_Api_GetConnectionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionBulk)(connections);\n // create a list of compositions from the fetched concepts and connections.\n let compositions = {};\n for (let i = 0; i < conceptIds.length; i++) {\n let comp = yield (0,_GetComposition__WEBPACK_IMPORTED_MODULE_4__.GetCompositionWithIdFromMemory)(conceptIds[i]);\n compositions[conceptIds[i]] = comp;\n }\n return compositions;\n });\n}\n/**\n * ## Format DATAIDDATE ##\n * ## duplicate ##\n * This function converts the conceptIds and internal connections to create compositions.\n * @param conceptIds these are the concept ids that need to be fetched to create their compositions\n * @param connections these are the connections that are used to create the structure.\n * @returns a dictionary / object that has key as their conceptId and the value as their composition object.\n */\nfunction GetCompositionFromConnectionsWithDataIdInObjectNew() {\n return __awaiter(this, arguments, void 0, function* (conceptIds = [], connections = []) {\n // get all the connections that are not available in memory from the api.\n yield (0,_Api_GetConnectionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionBulk)(connections);\n // create a list of compositions from the fetched concepts and connections.\n let compositions = {};\n for (let i = 0; i < conceptIds.length; i++) {\n let comp = yield (0,_GetComposition__WEBPACK_IMPORTED_MODULE_4__.GetCompositionWithIdFromMemoryNew)(conceptIds[i]);\n compositions[conceptIds[i]] = comp;\n }\n return compositions;\n });\n}\n/**\n * ## Format justdata ##\n * This function converts the conceptIds and internal connections to create compositions.\n * @param conceptIds these are the concept ids that need to be fetched to create their compositions\n * @param connections these are the connections that are used to create the structure.\n * @returns a dictionary / object that has key as their conceptId and the value as their composition object.\n */\nfunction GetCompositionFromConnectionsInObject() {\n return __awaiter(this, arguments, void 0, function* (conceptIds = [], connections = []) {\n // get all the connections that are not available in memory from the api.\n yield (0,_Api_GetConnectionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionBulk)(connections);\n // create a list of compositions from the fetched concepts and connections.\n let compositions = {};\n for (let i = 0; i < conceptIds.length; i++) {\n let comp = yield (0,_GetComposition__WEBPACK_IMPORTED_MODULE_4__.GetCompositionFromMemory)(conceptIds[i]);\n compositions[conceptIds[i]] = comp;\n }\n return compositions;\n });\n}\n/**\n * ## Format Normal ##\n * This function converts the conceptIds and internal connections to create compositions.\n * @param conceptIds these are the concept ids that need to be fetched to create their compositions\n * @param connections these are the connections that are used to create the structure.\n * @returns a dictionary / object that has key as their conceptId and the value as their composition object.\n */\nfunction GetCompositionFromConnectionsInObjectNormal() {\n return __awaiter(this, arguments, void 0, function* (conceptIds = [], connections = []) {\n // get all the connections that are not available in memory from the api.\n yield (0,_Api_GetConnectionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionBulk)(connections);\n // create a list of compositions from the fetched concepts and connections.\n let compositions = {};\n for (let i = 0; i < conceptIds.length; i++) {\n let comp = yield (0,_GetComposition__WEBPACK_IMPORTED_MODULE_4__.GetCompositionFromMemoryNormal)(conceptIds[i]);\n compositions[conceptIds[i]] = comp;\n console.log(\"this is the normal data\", conceptIds[i], comp);\n }\n return compositions;\n });\n}\n\n\n//# sourceURL=webpack://mftsccs-browser/./src/Services/GetCompositionBulk.ts?");
1337
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ GetCompositionBulk: () => (/* binding */ GetCompositionBulk),\n/* harmony export */ GetCompositionBulkWithDataId: () => (/* binding */ GetCompositionBulkWithDataId),\n/* harmony export */ GetCompositionFromConnectionsInObject: () => (/* binding */ GetCompositionFromConnectionsInObject),\n/* harmony export */ GetCompositionFromConnectionsInObjectNormal: () => (/* binding */ GetCompositionFromConnectionsInObjectNormal),\n/* harmony export */ GetCompositionFromConnectionsWithDataId: () => (/* binding */ GetCompositionFromConnectionsWithDataId),\n/* harmony export */ GetCompositionFromConnectionsWithDataIdFromConnections: () => (/* binding */ GetCompositionFromConnectionsWithDataIdFromConnections),\n/* harmony export */ GetCompositionFromConnectionsWithDataIdInObject: () => (/* binding */ GetCompositionFromConnectionsWithDataIdInObject),\n/* harmony export */ GetCompositionFromConnectionsWithDataIdInObjectNew: () => (/* binding */ GetCompositionFromConnectionsWithDataIdInObjectNew),\n/* harmony export */ GetCompositionFromConnectionsWithDataIdIndex: () => (/* binding */ GetCompositionFromConnectionsWithDataIdIndex),\n/* harmony export */ GetCompositionFromConnectionsWithIndex: () => (/* binding */ GetCompositionFromConnectionsWithIndex),\n/* harmony export */ GetCompositionFromConnectionsWithIndexFromConnections: () => (/* binding */ GetCompositionFromConnectionsWithIndexFromConnections),\n/* harmony export */ GetConnectionDataPrefetch: () => (/* binding */ GetConnectionDataPrefetch)\n/* harmony export */ });\n/* harmony import */ var _Api_GetAllConnectionsOfCompositionBulk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Api/GetAllConnectionsOfCompositionBulk */ \"./src/Api/GetAllConnectionsOfCompositionBulk.ts\");\n/* harmony import */ var _Api_GetConnectionBulk__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Api/GetConnectionBulk */ \"./src/Api/GetConnectionBulk.ts\");\n/* harmony import */ var _app__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../app */ \"./src/app.ts\");\n/* harmony import */ var _FindConnectionsOfCompositionBulkInMemory__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./FindConnectionsOfCompositionBulkInMemory */ \"./src/Services/FindConnectionsOfCompositionBulkInMemory.ts\");\n/* harmony import */ var _GetComposition__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./GetComposition */ \"./src/Services/GetComposition.ts\");\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n\n\n\n\n\n/**\n * ## Format JUSTDATA ##\n * Function converts the conceptIds to json (compositions)\n * This function takes in the conceptIds and returns a list of compositions related to those concepts.\n * @param conceptIds list of concept ids that are compositions.\n * @returns compositions\n */\nfunction GetCompositionBulk() {\n return __awaiter(this, arguments, void 0, function* (conceptIds = []) {\n yield (0,_Api_GetAllConnectionsOfCompositionBulk__WEBPACK_IMPORTED_MODULE_0__.GetAllConnectionsOfCompositionBulk)(conceptIds);\n let compositions = [];\n for (let i = 0; i < conceptIds.length; i++) {\n let comp = yield (0,_GetComposition__WEBPACK_IMPORTED_MODULE_4__.GetCompositionFromMemory)(conceptIds[i]);\n compositions.push(comp);\n }\n return compositions;\n });\n}\n/**\n * ## FORMAT DATAIDDATE ##\n * Function converts the conceptIds to json (compositions)\n * @param conceptIds this is the list of concept ids that should be converted to compostions in data - id format.\n * @returns list of compositions in the data - id format.\n */\nfunction GetCompositionBulkWithDataId() {\n return __awaiter(this, arguments, void 0, function* (conceptIds = []) {\n yield (0,_Api_GetAllConnectionsOfCompositionBulk__WEBPACK_IMPORTED_MODULE_0__.GetAllConnectionsOfCompositionBulk)(conceptIds);\n let compositions = [];\n for (let i = 0; i < conceptIds.length; i++) {\n let comp = yield (0,_GetComposition__WEBPACK_IMPORTED_MODULE_4__.GetCompositionWithIdFromMemory)(conceptIds[i]);\n compositions.push(comp);\n }\n return compositions;\n });\n}\n/**\n * ## FORMAT DATAIDDATE ##\n * This function converts the conceptIds and internal connectionIds to compositions in data-Id format.\n * @param conceptIds This is the list of concept ids that need to be converted to compositions.\n * @param connectionIds These are the internal connectionIds that need to be passed to create the compositions.\n * @returns list of compositions created from the passed conceptIds and connectionIds.\n */\nfunction GetCompositionFromConnectionsWithDataId() {\n var arguments_1 = arguments;\n return __awaiter(this, arguments, void 0, function* (conceptIds = [], connectionIds = []) {\n _app__WEBPACK_IMPORTED_MODULE_2__.Logger.logfunction(GetCompositionFromConnectionsWithDataId, arguments_1);\n if (_app__WEBPACK_IMPORTED_MODULE_2__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_2__.sendMessage)('GetCompositionFromConnectionsWithDataId', { conceptIds, connectionIds });\n return res.data;\n }\n catch (error) {\n console.error('GetCompositionFromConnectionsWithDataId error sw: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_2__.handleServiceWorkerException)(error);\n }\n }\n // let newConnections = await GetConnectionBulk(connectionIds);\n // let oldConnections = await FindConnectionsOfCompositionsBulkInMemory(conceptIds);\n //CheckForConnectionDeletionWithIds(connectionIds,oldConnections);\n let compositions = [];\n for (let i = 0; i < conceptIds.length; i++) {\n let comp = yield (0,_GetComposition__WEBPACK_IMPORTED_MODULE_4__.GetCompositionWithIdFromMemory)(conceptIds[i]);\n compositions.push(comp);\n }\n return compositions;\n });\n}\n/**\n * ## FORMAT DATAIDDATE ##\n * This is just a different version of GetCompositionFromConnectionsWithDataId, This has the added functionality that\n * it also prints out internal connections.\n * This function converts the conceptIds and internal connectionIds to compositions in data-Id format.\n * @param conceptIds This is the list of concept ids that need to be converted to compositions.\n * @param connectionIds These are the internal connectionIds that need to be passed to create the compositions.\n * @returns list of compositions created from the passed conceptIds and connectionIds.\n */\nfunction GetCompositionFromConnectionsWithDataIdFromConnections() {\n var arguments_2 = arguments;\n return __awaiter(this, arguments, void 0, function* (conceptIds = [], connectionIds = []) {\n _app__WEBPACK_IMPORTED_MODULE_2__.Logger.logfunction(GetCompositionFromConnectionsWithDataIdFromConnections, arguments_2);\n if (_app__WEBPACK_IMPORTED_MODULE_2__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_2__.sendMessage)('GetCompositionFromConnectionsWithDataIdFromConnections', { conceptIds, connectionIds });\n return res.data;\n }\n catch (error) {\n console.error('GetCompositionFromConnectionsWithDataIdFromConnections error sw: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_2__.handleServiceWorkerException)(error);\n }\n }\n let newConnections = yield (0,_Api_GetConnectionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionBulk)(connectionIds);\n //CheckForConnectionDeletionWithIds(connectionIds,oldConnections);\n let compositions = [];\n for (let i = 0; i < conceptIds.length; i++) {\n let comp = yield (0,_GetComposition__WEBPACK_IMPORTED_MODULE_4__.GetCompositionWithIdFromMemoryFromConnection)(conceptIds[i], newConnections);\n compositions.push(comp);\n }\n return compositions;\n });\n}\n/**\n * ## Format DATAIDDATE ##\n * This function converts the conceptIds and internal connectionIds to compositions in data-Id format with index(conceptId).\n * @param conceptIds This is the list of concept ids that need to be converted to compositions.\n * @param connectionIds These are the internal connectionIds that need to be passed to create the compositions.\n * @returns dictionary of compositions created from the passed conceptIds and connectionIds with conceptId as its index .\n */\nfunction GetCompositionFromConnectionsWithDataIdIndex() {\n var arguments_3 = arguments;\n return __awaiter(this, arguments, void 0, function* (conceptIds = [], connectionIds = []) {\n _app__WEBPACK_IMPORTED_MODULE_2__.Logger.logfunction(GetCompositionFromConnectionsWithDataIdIndex, arguments_3);\n if (_app__WEBPACK_IMPORTED_MODULE_2__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_2__.sendMessage)('GetCompositionFromConnectionsWithDataIdIndex', { conceptIds, connectionIds });\n return res.data;\n }\n catch (error) {\n console.error('GetCompositionFromConnectionsWithDataIdIndex error sw: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_2__.handleServiceWorkerException)(error);\n }\n }\n let newConnections = yield (0,_Api_GetConnectionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionBulk)(connectionIds);\n let myNewConnections = newConnections;\n let oldConnections = yield (0,_FindConnectionsOfCompositionBulkInMemory__WEBPACK_IMPORTED_MODULE_3__.FindConnectionsOfCompositionsBulkInMemory)(conceptIds);\n //CheckForConnectionDeletionWithIds(connectionIds,oldConnections);\n let compositions = {};\n for (let i = 0; i < conceptIds.length; i++) {\n let comp = yield (0,_GetComposition__WEBPACK_IMPORTED_MODULE_4__.GetCompositionWithIdFromMemory)(conceptIds[i]);\n compositions[conceptIds[i]] = comp;\n }\n return compositions;\n });\n}\n/**\n * ## Format is dictionary with key as concept id and value as data (json) ##\n * This function converts the conceptIds and internal connectionIds to compositions format with index(conceptId).\n * @param conceptIds This is the list of concept ids that need to be converted to compositions.\n * @param connectionIds These are the internal connectionIds that need to be passed to create the compositions.\n * @returns dictionary of compositions created from the passed conceptIds and connectionIds with conceptId as its index .\n */\nfunction GetCompositionFromConnectionsWithIndex() {\n return __awaiter(this, arguments, void 0, function* (conceptIds = [], connectionIds = []) {\n let newConnections = yield (0,_Api_GetConnectionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionBulk)(connectionIds);\n let myNewConnections = newConnections;\n let oldConnections = yield (0,_FindConnectionsOfCompositionBulkInMemory__WEBPACK_IMPORTED_MODULE_3__.FindConnectionsOfCompositionsBulkInMemory)(conceptIds);\n //CheckForConnectionDeletionWithIds(connectionIds,oldConnections);\n let compositions = {};\n for (let i = 0; i < conceptIds.length; i++) {\n let comp = yield (0,_GetComposition__WEBPACK_IMPORTED_MODULE_4__.GetCompositionFromMemory)(conceptIds[i]);\n compositions[conceptIds[i]] = comp;\n }\n return compositions;\n });\n}\n/**\n * ## FORMAT DATAIDDATE ##\n * This is just a different version of GetCompositionFromConnectionsWithDataId, This has the added functionality that\n * it also prints out internal connections.\n * This function converts the conceptIds and internal connectionIds to compositions in data-Id format.\n * @param conceptIds This is the list of concept ids that need to be converted to compositions.\n * @param connectionIds These are the internal connectionIds that need to be passed to create the compositions.\n * @returns list of compositions created from the passed conceptIds and connectionIds.\n */\nfunction GetCompositionFromConnectionsWithIndexFromConnections() {\n return __awaiter(this, arguments, void 0, function* (conceptIds = [], connectionIds = []) {\n if (_app__WEBPACK_IMPORTED_MODULE_2__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_2__.sendMessage)('GetCompositionFromConnectionsWithIndexFromConnections', { conceptIds, connectionIds });\n return res.data;\n }\n catch (error) {\n console.error('GetCompositionFromConnectionsWithIndexFromConnections error sw: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_2__.handleServiceWorkerException)(error);\n }\n }\n let newConnections = yield (0,_Api_GetConnectionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionBulk)(connectionIds);\n //CheckForConnectionDeletionWithIds(connectionIds,oldConnections);\n let compositions = [];\n for (let i = 0; i < conceptIds.length; i++) {\n let comp = yield (0,_GetComposition__WEBPACK_IMPORTED_MODULE_4__.GetCompositionFromMemoryWithConnections)(conceptIds[i], newConnections);\n compositions[conceptIds[i]] = comp;\n }\n return compositions;\n });\n}\n/**\n * Used to prefetch all the connections and their related concepts.\n * @param connectionIds these are the connection ids that are used to fetch all the connections and also their related concepts.\n * @returns all the connections that are passed as ids.\n */\nfunction GetConnectionDataPrefetch(connectionIds) {\n var arguments_4 = arguments;\n return __awaiter(this, void 0, void 0, function* () {\n _app__WEBPACK_IMPORTED_MODULE_2__.Logger.logfunction(GetConnectionDataPrefetch, arguments_4);\n if (_app__WEBPACK_IMPORTED_MODULE_2__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_2__.sendMessage)('GetConnectionDataPrefetch', { connectionIds });\n return res.data;\n }\n catch (error) {\n console.error('GetConnectionDataPrefetch error sw: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_2__.handleServiceWorkerException)(error);\n }\n }\n let remainingConnections = [];\n let connectionsAll = [];\n let remainingIds = {};\n for (let i = 0; i < connectionIds.length; i++) {\n let connection = yield _app__WEBPACK_IMPORTED_MODULE_2__.ConnectionData.GetConnection(connectionIds[i]);\n // console.log(\"this is the connection fetch\", connection);\n if (connection.id == 0) {\n remainingConnections.push(connectionIds[i]);\n }\n else {\n connectionsAll.push(connection);\n }\n }\n for (let i = 0; i < remainingConnections.length; i++) {\n remainingIds[connectionIds[i]] = false;\n }\n //await ConnectionData.GetConnectionBulkData(connectionIds, connectionsAll, remainingIds);\n // for(let key in remainingIds){\n // if(remainingIds[key] == false){\n // remainingConnections.push(Number(key));\n // }\n // }\n // remainingConnections = connectionIds;\n let prefetchConcepts = [];\n let connectionsAllLocal = yield (0,_Api_GetConnectionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionBulk)(remainingConnections);\n connectionsAll = [...connectionsAll, ...connectionsAllLocal];\n for (let j = 0; j < connectionsAll.length; j++) {\n prefetchConcepts.push(connectionsAll[j].ofTheConceptId);\n prefetchConcepts.push(connectionsAll[j].toTheConceptId);\n prefetchConcepts.push(connectionsAll[j].typeId);\n }\n yield (0,_app__WEBPACK_IMPORTED_MODULE_2__.GetConceptBulk)(prefetchConcepts);\n return connectionsAll;\n });\n}\n/**\n * ## Format DATAIDDATE ##\n * This function converts the conceptIds and internal connections to create compositions.\n * Format is of a dictionary with ids as the key and value is the composition data.\n * @param conceptIds these are the concept ids that need to be fetched to create their compositions\n * @param connections these are the connections that are used to create the structure.\n * @returns a dictionary / object that has key as their conceptId and the value as their composition object.\n */\nfunction GetCompositionFromConnectionsWithDataIdInObject() {\n var arguments_5 = arguments;\n return __awaiter(this, arguments, void 0, function* (conceptIds = [], connections = []) {\n _app__WEBPACK_IMPORTED_MODULE_2__.Logger.logfunction(GetCompositionFromConnectionsWithDataIdInObject, arguments_5);\n // get all the connections that are not available in memory from the api.\n yield (0,_Api_GetConnectionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionBulk)(connections);\n // create a list of compositions from the fetched concepts and connections.\n let compositions = {};\n for (let i = 0; i < conceptIds.length; i++) {\n let comp = yield (0,_GetComposition__WEBPACK_IMPORTED_MODULE_4__.GetCompositionWithIdFromMemory)(conceptIds[i]);\n compositions[conceptIds[i]] = comp;\n }\n return compositions;\n });\n}\n/**\n * ## Format DATAIDDATE ##\n * ## duplicate ##\n * This function converts the conceptIds and internal connections to create compositions.\n * @param conceptIds these are the concept ids that need to be fetched to create their compositions\n * @param connections these are the connections that are used to create the structure.\n * @returns a dictionary / object that has key as their conceptId and the value as their composition object.\n */\nfunction GetCompositionFromConnectionsWithDataIdInObjectNew() {\n return __awaiter(this, arguments, void 0, function* (conceptIds = [], connections = []) {\n // get all the connections that are not available in memory from the api.\n yield (0,_Api_GetConnectionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionBulk)(connections);\n // create a list of compositions from the fetched concepts and connections.\n let compositions = {};\n for (let i = 0; i < conceptIds.length; i++) {\n let comp = yield (0,_GetComposition__WEBPACK_IMPORTED_MODULE_4__.GetCompositionWithIdFromMemoryNew)(conceptIds[i]);\n compositions[conceptIds[i]] = comp;\n }\n return compositions;\n });\n}\n/**\n * ## Format justdata ##\n * This function converts the conceptIds and internal connections to create compositions.\n * @param conceptIds these are the concept ids that need to be fetched to create their compositions\n * @param connections these are the connections that are used to create the structure.\n * @returns a dictionary / object that has key as their conceptId and the value as their composition object.\n */\nfunction GetCompositionFromConnectionsInObject() {\n return __awaiter(this, arguments, void 0, function* (conceptIds = [], connections = []) {\n // get all the connections that are not available in memory from the api.\n yield (0,_Api_GetConnectionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionBulk)(connections);\n // create a list of compositions from the fetched concepts and connections.\n let compositions = {};\n for (let i = 0; i < conceptIds.length; i++) {\n let comp = yield (0,_GetComposition__WEBPACK_IMPORTED_MODULE_4__.GetCompositionFromMemory)(conceptIds[i]);\n compositions[conceptIds[i]] = comp;\n }\n return compositions;\n });\n}\n/**\n * ## Format Normal ##\n * This function converts the conceptIds and internal connections to create compositions.\n * @param conceptIds these are the concept ids that need to be fetched to create their compositions\n * @param connections these are the connections that are used to create the structure.\n * @returns a dictionary / object that has key as their conceptId and the value as their composition object.\n */\nfunction GetCompositionFromConnectionsInObjectNormal() {\n return __awaiter(this, arguments, void 0, function* (conceptIds = [], connections = []) {\n // get all the connections that are not available in memory from the api.\n yield (0,_Api_GetConnectionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionBulk)(connections);\n // create a list of compositions from the fetched concepts and connections.\n let compositions = {};\n for (let i = 0; i < conceptIds.length; i++) {\n let comp = yield (0,_GetComposition__WEBPACK_IMPORTED_MODULE_4__.GetCompositionFromMemoryNormal)(conceptIds[i]);\n compositions[conceptIds[i]] = comp;\n console.log(\"this is the normal data\", conceptIds[i], comp);\n }\n return compositions;\n });\n}\n\n\n//# sourceURL=webpack://mftsccs-browser/./src/Services/GetCompositionBulk.ts?");
1338
1338
 
1339
1339
  /***/ }),
1340
1340
 
@@ -1414,7 +1414,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
1414
1414
  \****************************************/
1415
1415
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1416
1416
 
1417
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ GetComposition: () => (/* binding */ GetComposition),\n/* harmony export */ GetCompositionById: () => (/* binding */ GetCompositionById),\n/* harmony export */ GetCompositionFromMemory: () => (/* binding */ GetCompositionFromMemory),\n/* harmony export */ GetCompositionFromMemoryNormal: () => (/* binding */ GetCompositionFromMemoryNormal),\n/* harmony export */ GetCompositionFromMemoryWithConnections: () => (/* binding */ GetCompositionFromMemoryWithConnections),\n/* harmony export */ GetCompositionWithAllIds: () => (/* binding */ GetCompositionWithAllIds),\n/* harmony export */ GetCompositionWithId: () => (/* binding */ GetCompositionWithId),\n/* harmony export */ GetCompositionWithIdAndDateFromMemory: () => (/* binding */ GetCompositionWithIdAndDateFromMemory),\n/* harmony export */ GetCompositionWithIdFromMemory: () => (/* binding */ GetCompositionWithIdFromMemory),\n/* harmony export */ GetCompositionWithIdFromMemoryFromConnection: () => (/* binding */ GetCompositionWithIdFromMemoryFromConnection),\n/* harmony export */ GetCompositionWithIdFromMemoryFromConnections: () => (/* binding */ GetCompositionWithIdFromMemoryFromConnections),\n/* harmony export */ GetCompositionWithIdFromMemoryNew: () => (/* binding */ GetCompositionWithIdFromMemoryNew),\n/* harmony export */ RecursiveFetchBuildLayer: () => (/* binding */ RecursiveFetchBuildLayer),\n/* harmony export */ RecursiveFetchBuildLayerDataId: () => (/* binding */ RecursiveFetchBuildLayerDataId),\n/* harmony export */ RecursiveFetchBuildLayerNormal: () => (/* binding */ RecursiveFetchBuildLayerNormal),\n/* harmony export */ recursiveFetch: () => (/* binding */ recursiveFetch),\n/* harmony export */ recursiveFetchConcept: () => (/* binding */ recursiveFetchConcept),\n/* harmony export */ recursiveFetchConceptNormal: () => (/* binding */ recursiveFetchConceptNormal),\n/* harmony export */ recursiveFetchConceptSingleLoop: () => (/* binding */ recursiveFetchConceptSingleLoop),\n/* harmony export */ recursiveFetchWithSubCompositions: () => (/* binding */ recursiveFetchWithSubCompositions)\n/* harmony export */ });\n/* harmony import */ var _Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Api/GetConcept */ \"./src/Api/GetConcept.ts\");\n/* harmony import */ var _Api_GetAllConnectionsOfComposition__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Api/GetAllConnectionsOfComposition */ \"./src/Api/GetAllConnectionsOfComposition.ts\");\n/* harmony import */ var _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../DataStructures/ConceptData */ \"./src/DataStructures/ConceptData.ts\");\n/* harmony import */ var _DataStructures_ConnectionData__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../DataStructures/ConnectionData */ \"./src/DataStructures/ConnectionData.ts\");\n/* harmony import */ var _app__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../app */ \"./src/app.ts\");\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n\n\n\n\n\nfunction GetCompositionById(id) {\n return __awaiter(this, void 0, void 0, function* () {\n let returnOutput = { connectionList: [], compositionList: [] };\n try {\n if (_app__WEBPACK_IMPORTED_MODULE_4__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_4__.sendMessage)('GetCompositionById', { id });\n return res.data;\n }\n catch (error) {\n console.error('GetCompositionById error sw: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_4__.handleServiceWorkerException)(error);\n }\n }\n let connectionListString = yield (0,_Api_GetAllConnectionsOfComposition__WEBPACK_IMPORTED_MODULE_1__.GetAllConnectionsOfComposition)(id);\n returnOutput.connectionList = connectionListString;\n for (let i = 0; i < returnOutput.connectionList.length; i++) {\n if (!returnOutput.compositionList.includes(returnOutput.connectionList[i].ofTheConceptId)) {\n returnOutput.compositionList.push(returnOutput.connectionList[i].ofTheConceptId);\n }\n }\n return returnOutput;\n }\n catch (error) {\n console.error('GetCompositionById error: ', error);\n return returnOutput;\n }\n });\n}\n/**\n * ## format JUSTDATA ##\n * this function builds the composition with the main id as the point of building.\n * @param id id of the main composition that you want to build\n * @param connectionList list of connections\n * @param compositionList list of of_the_concept_ids for all the connections.\n * @returns\n */\nfunction RecursiveFetchBuildLayer(id, connectionList, compositionList) {\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b;\n let returnOutput = {};\n let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);\n if (concept.id == 0 && id != null && id != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);\n concept = conceptString;\n }\n let output = yield recursiveFetch(id, connectionList, compositionList);\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n returnOutput[mainString] = output;\n return returnOutput;\n });\n}\n/**\n * ## format DATAID ##\n * this function builds the composition with the main id as the point of building.\n * @param id id of the main composition that you want to build\n * @param connectionList list of connections\n * @param compositionList list of of_the_concept_ids for all the connections.\n * @returns\n */\nfunction RecursiveFetchBuildLayerDataId(id, connectionList, compositionList) {\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b;\n let returnOutput = {};\n let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);\n if (concept.id == 0 && id != null && id != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);\n concept = conceptString;\n }\n let output = yield recursiveFetch(id, connectionList, compositionList);\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n returnOutput[mainString] = output;\n let FinalReturn = {};\n FinalReturn['created_at'] = concept.entryTimeStamp;\n FinalReturn['data'] = returnOutput;\n FinalReturn['id'] = id;\n return FinalReturn;\n });\n}\n/**\n * ## format Normal ##\n * this function builds the composition with the main id as the point of building.\n * @param id id of the main composition that you want to build\n * @param connectionList list of connections\n * @param compositionList list of of_the_concept_ids for all the connections.\n * @returns\n */\nfunction RecursiveFetchBuildLayerNormal(id, connectionList, compositionList) {\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b;\n let returnOutput = {};\n let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);\n if (concept.id == 0 && id != null && id != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);\n concept = conceptString;\n }\n let output = yield recursiveFetchConceptNormal(concept, connectionList, compositionList);\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n returnOutput[mainString] = output;\n return returnOutput;\n });\n}\n/**\n * ## format JUSTDATA ##\n * this function builds the composition with the main id as the point of building.\n * This just requires the id\n * @param id id of the main composition that you want to build\n * @param connectionList list of connections\n * @param compositionList list of of_the_concept_ids for all the connections.\n * @returns\n */\nfunction GetComposition(id) {\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b;\n if (_app__WEBPACK_IMPORTED_MODULE_4__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_4__.sendMessage)('GetComposition', { id });\n return res.data;\n }\n catch (error) {\n console.error('GetComposition error sw: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_4__.handleServiceWorkerException)(error);\n }\n }\n let connectionList = [];\n let returnOutput = {};\n let connectionListString = yield (0,_Api_GetAllConnectionsOfComposition__WEBPACK_IMPORTED_MODULE_1__.GetAllConnectionsOfComposition)(id);\n connectionList = connectionListString;\n console.log(\"this is the connection list online\", connectionList);\n //connectionList = ConnectionData.GetConnectionsOfComposition(id);\n let compositionList = [];\n for (let i = 0; i < connectionList.length; i++) {\n if (!compositionList.includes(connectionList[i].ofTheConceptId)) {\n compositionList.push(connectionList[i].ofTheConceptId);\n }\n }\n let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);\n if (concept.id == 0 && id != null && id != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);\n concept = conceptString;\n }\n let output = yield recursiveFetch(id, connectionList, compositionList);\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n returnOutput[mainString] = output;\n return returnOutput;\n });\n}\nfunction GetCompositionWithAllIds(id) {\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b;\n let connectionList = [];\n let returnOutput = {};\n let connectionListString = yield (0,_Api_GetAllConnectionsOfComposition__WEBPACK_IMPORTED_MODULE_1__.GetAllConnectionsOfComposition)(id);\n connectionList = connectionListString;\n //connectionList = ConnectionData.GetConnectionsOfComposition(id);\n let compositionList = [];\n for (let i = 0; i < connectionList.length; i++) {\n if (!compositionList.includes(connectionList[i].ofTheConceptId)) {\n compositionList.push(connectionList[i].ofTheConceptId);\n }\n }\n let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);\n if (concept.id == 0 && id != null && id != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);\n concept = conceptString;\n }\n let output = yield recursiveFetchWithSubCompositions(id, connectionList, compositionList);\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n returnOutput[mainString] = output;\n return returnOutput;\n });\n}\n/**\n * ### Format JUSTDATA ###\n * This function just builds data from the memory.\n * This is a function that takes on all the concepts and connections of the concept (as a composition ) and builds\n * it into a json data.\n * @param id this id is just used to get all the composition data from the concepts and connections in memory\n * @returns\n */\nfunction GetCompositionFromMemory(id) {\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b;\n if (_app__WEBPACK_IMPORTED_MODULE_4__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_4__.sendMessage)('GetCompositionFromMemory', { id });\n return res.data;\n }\n catch (error) {\n console.error('GetCompositionFromMemory error sw: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_4__.handleServiceWorkerException)(error);\n }\n }\n let connectionList = [];\n let returnOutput = {};\n //connectionList = await ConnectionData.GetConnectionsOfConcept(id);\n connectionList = yield _DataStructures_ConnectionData__WEBPACK_IMPORTED_MODULE_3__.ConnectionData.GetConnectionsOfCompositionLocal(id);\n //connectionList = ConnectionData.GetConnectionsOfComposition(id);\n let compositionList = [];\n for (let i = 0; i < connectionList.length; i++) {\n if (!compositionList.includes(connectionList[i].ofTheConceptId)) {\n compositionList.push(connectionList[i].ofTheConceptId);\n }\n }\n let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);\n if (concept.id == 0 && id != null && id != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);\n concept = conceptString;\n }\n let output = yield recursiveFetchConcept(concept, connectionList, compositionList);\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n returnOutput[mainString] = output;\n return returnOutput;\n });\n}\n/**\n * ### Format Normal ###\n * This function just builds data from the memory.\n * This is a function that takes on all the concepts and connections of the concept (as a composition ) and builds\n * it into a json data.\n * @param id this id is just used to get all the composition data from the concepts and connections in memory\n * @returns\n */\nfunction GetCompositionFromMemoryNormal(id) {\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b;\n if (_app__WEBPACK_IMPORTED_MODULE_4__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_4__.sendMessage)('GetCompositionFromMemoryNormal', { id });\n return res.data;\n }\n catch (error) {\n console.error('GetCompositionFromMemoryNormal error sw: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_4__.handleServiceWorkerException)(error);\n }\n }\n let connectionList = [];\n let returnOutput = {};\n //connectionList = await ConnectionData.GetConnectionsOfConcept(id);\n connectionList = yield _DataStructures_ConnectionData__WEBPACK_IMPORTED_MODULE_3__.ConnectionData.GetConnectionsOfCompositionLocal(id);\n //connectionList = ConnectionData.GetConnectionsOfComposition(id);\n let compositionList = [];\n for (let i = 0; i < connectionList.length; i++) {\n if (!compositionList.includes(connectionList[i].ofTheConceptId)) {\n compositionList.push(connectionList[i].ofTheConceptId);\n }\n }\n let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);\n if (concept.id == 0 && id != null && id != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);\n concept = conceptString;\n }\n let output = yield recursiveFetchConceptNormal(concept, connectionList, compositionList);\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n returnOutput[mainString] = output;\n return returnOutput;\n });\n}\n/**\n * ### Format DATAIDDATE ####\n * Gets data just from memory\n * @param id\n * @returns\n */\nfunction GetCompositionWithIdFromMemory(id) {\n var arguments_1 = arguments;\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b;\n _app__WEBPACK_IMPORTED_MODULE_4__.Logger.logfunction(GetCompositionWithIdFromMemory, arguments_1);\n if (_app__WEBPACK_IMPORTED_MODULE_4__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_4__.sendMessage)('GetCompositionWithIdFromMemory', { id });\n return res.data;\n }\n catch (error) {\n console.error('GetCompositionWithIdFromMemory error sw: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_4__.handleServiceWorkerException)(error);\n }\n }\n let FinalReturn = {};\n let connectionList = [];\n let returnOutput = {};\n // connectionList = await ConnectionData.GetConnectionsOfConcept(id);\n try {\n connectionList = yield _DataStructures_ConnectionData__WEBPACK_IMPORTED_MODULE_3__.ConnectionData.GetConnectionsOfCompositionLocal(id);\n let compositionList = [];\n for (let i = 0; i < connectionList.length; i++) {\n if (!compositionList.includes(connectionList[i].ofTheConceptId)) {\n compositionList.push(connectionList[i].ofTheConceptId);\n }\n }\n let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);\n if (concept.id == 0 && id != null && id != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);\n concept = conceptString;\n }\n let output = yield recursiveFetchConcept(concept, connectionList, compositionList);\n // let output = await recursiveFetchConceptSingleLoop(concept, connectionList,compositionList );\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n returnOutput[mainString] = output;\n FinalReturn['created_at'] = concept.entryTimeStamp;\n FinalReturn['data'] = returnOutput;\n FinalReturn['id'] = id;\n }\n catch (error) {\n console.log(\"this is the exception in GetCompositionWithIdFromMemory\", id);\n }\n return FinalReturn;\n });\n}\n/**\n * ### Format Normal ####\n * Gets data just from memory\n * @param id\n * @returns\n */\nfunction GetCompositionFromMemoryWithConnections(id, connectionList) {\n var arguments_2 = arguments;\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b;\n _app__WEBPACK_IMPORTED_MODULE_4__.Logger.logfunction(GetCompositionFromMemoryWithConnections, arguments_2);\n if (_app__WEBPACK_IMPORTED_MODULE_4__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_4__.sendMessage)('GetCompositionFromMemoryWithConnections', { id, connectionList });\n return res.data;\n }\n catch (error) {\n console.error('GetCompositionFromMemoryWithConnections error sw: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_4__.handleServiceWorkerException)(error);\n }\n }\n let returnOutput = {};\n // connectionList = await ConnectionData.GetConnectionsOfConcept(id);\n let compositionList = [];\n for (let i = 0; i < connectionList.length; i++) {\n if (!compositionList.includes(connectionList[i].ofTheConceptId)) {\n compositionList.push(connectionList[i].ofTheConceptId);\n }\n }\n let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);\n if (concept.id == 0 && id != null && id != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);\n concept = conceptString;\n }\n let output = yield recursiveFetchConcept(concept, connectionList, compositionList);\n // let output = await recursiveFetchConceptSingleLoop(concept, connectionList,compositionList );\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n returnOutput[mainString] = output;\n let FinalReturn = {};\n FinalReturn['created_at'] = concept.entryTimeStamp;\n FinalReturn['data'] = returnOutput;\n FinalReturn['id'] = id;\n return FinalReturn;\n });\n}\n/**\n * ### Format DATAIDDATE ####\n * Gets data just from memory\n * @param id\n * @returns\n */\nfunction GetCompositionWithIdFromMemoryFromConnection(id, connectionList) {\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b;\n if (_app__WEBPACK_IMPORTED_MODULE_4__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_4__.sendMessage)('GetCompositionWithIdFromMemory', { id });\n return res.data;\n }\n catch (error) {\n console.error('GetCompositionWithIdFromMemory error sw: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_4__.handleServiceWorkerException)(error);\n }\n }\n let returnOutput = {};\n // connectionList = await ConnectionData.GetConnectionsOfConcept(id);\n let compositionList = [];\n for (let i = 0; i < connectionList.length; i++) {\n if (!compositionList.includes(connectionList[i].ofTheConceptId)) {\n compositionList.push(connectionList[i].ofTheConceptId);\n }\n }\n let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);\n if (concept.id == 0 && id != null && id != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);\n concept = conceptString;\n }\n let output = yield recursiveFetchConcept(concept, connectionList, compositionList);\n console.log(\"this is the output\", output, concept);\n // let output = await recursiveFetchConceptSingleLoop(concept, connectionList,compositionList );\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n returnOutput[mainString] = output;\n let FinalReturn = {};\n FinalReturn['created_at'] = concept.entryTimeStamp;\n FinalReturn['data'] = returnOutput;\n FinalReturn['id'] = id;\n return FinalReturn;\n });\n}\n/**\n * ### Format DATAIDDATE ####\n * ### experimental ####\n * This is the new format that needs to work with a single or max two loops\n * @param id the id whose composition needs to be created\n * @returns\n */\nfunction GetCompositionWithIdFromMemoryNew(id) {\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b;\n if (_app__WEBPACK_IMPORTED_MODULE_4__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_4__.sendMessage)('GetCompositionWithIdFromMemoryNew', { id });\n return res.data;\n }\n catch (error) {\n console.error('GetCompositionWithIdFromMemoryNew error sw: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_4__.handleServiceWorkerException)(error);\n }\n }\n let connectionList = [];\n let returnOutput = {};\n //connectionList = await ConnectionData.GetConnectionsOfConcept(id);\n connectionList = yield _DataStructures_ConnectionData__WEBPACK_IMPORTED_MODULE_3__.ConnectionData.GetConnectionsOfCompositionLocal(id);\n let compositionList = [];\n for (let i = 0; i < connectionList.length; i++) {\n if (!compositionList.includes(connectionList[i].ofTheConceptId)) {\n compositionList.push(connectionList[i].ofTheConceptId);\n }\n }\n let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);\n if (concept.id == 0 && id != null && id != undefined) {\n console.log(\"this concept you cannot find \", id);\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);\n concept = conceptString;\n }\n let startTime = new Date().getTime();\n //console.log(\"this is the connection list which has to be looped\", connectionList);\n let output = yield recursiveFetchConceptSingleLoop(concept, connectionList, compositionList);\n console.log(\"this is the time for the data to be made\", new Date().getTime() - startTime);\n // let output = await recursiveFetchConceptSingleLoop(concept, connectionList,compositionList );\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n returnOutput = output;\n let FinalReturn = {};\n FinalReturn['created_at'] = concept.entryTimeStamp;\n FinalReturn['data'] = returnOutput;\n FinalReturn['id'] = id;\n return FinalReturn;\n });\n}\n/**\n * ### Format DATAIDDATE #####\n * ### This just returns composition from memory and not from anywhere else.\n * @param id\n * @returns\n */\nfunction GetCompositionWithIdAndDateFromMemory(id) {\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b;\n if (_app__WEBPACK_IMPORTED_MODULE_4__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_4__.sendMessage)('GetCompositionWithIdAndDateFromMemory', { id });\n return res.data;\n }\n catch (error) {\n console.error('GetCompositionWithIdAndDateFromMemory error sw: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_4__.handleServiceWorkerException)(error);\n }\n }\n let connectionList = [];\n let returnOutput = {};\n connectionList = yield _DataStructures_ConnectionData__WEBPACK_IMPORTED_MODULE_3__.ConnectionData.GetConnectionsOfCompositionLocal(id);\n //connectionList = await ConnectionData.GetConnectionsOfConcept(id);\n let compositionList = [];\n for (let i = 0; i < connectionList.length; i++) {\n if (!compositionList.includes(connectionList[i].ofTheConceptId)) {\n compositionList.push(connectionList[i].ofTheConceptId);\n }\n }\n let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);\n if (concept.id == 0 && id != null && id != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);\n concept = conceptString;\n }\n let output = yield recursiveFetch(id, connectionList, compositionList);\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n returnOutput[mainString] = output;\n let FinalReturn = {};\n FinalReturn['data'] = returnOutput;\n FinalReturn['id'] = id;\n FinalReturn['created_at'] = concept.entryTimeStamp;\n return FinalReturn;\n });\n}\nfunction GetCompositionWithIdFromMemoryFromConnections(id_1) {\n return __awaiter(this, arguments, void 0, function* (id, connectionList = []) {\n var _a, _b;\n let returnOutput = {};\n //connectionList = await ConnectionData.GetConnectionsOfCompositionLocal(id);\n let compositionList = [];\n for (let i = 0; i < connectionList.length; i++) {\n if (!compositionList.includes(connectionList[i].ofTheConceptId)) {\n compositionList.push(connectionList[i].ofTheConceptId);\n }\n }\n let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);\n if (concept.id == 0 && id != null && id != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);\n concept = conceptString;\n }\n let output = yield recursiveFetch(id, connectionList, compositionList);\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n returnOutput[mainString] = output;\n let FinalReturn = {};\n FinalReturn['data'] = returnOutput;\n FinalReturn['id'] = id;\n return FinalReturn;\n });\n}\n/**\n * #### Format DATAID ####\n * ## This will return the composition even if it is not in the local memory ##\n * @param id\n * @returns\n */\nfunction GetCompositionWithId(id) {\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b;\n if (_app__WEBPACK_IMPORTED_MODULE_4__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_4__.sendMessage)('GetCompositionWithId', { id });\n return res.data;\n }\n catch (error) {\n console.error('GetCompositionWithId error sw: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_4__.handleServiceWorkerException)(error);\n }\n }\n let connectionList = [];\n let returnOutput = {};\n let connectionListString = yield (0,_Api_GetAllConnectionsOfComposition__WEBPACK_IMPORTED_MODULE_1__.GetAllConnectionsOfComposition)(id);\n connectionList = connectionListString;\n let compositionList = [];\n for (let i = 0; i < connectionList.length; i++) {\n if (!compositionList.includes(connectionList[i].ofTheConceptId)) {\n compositionList.push(connectionList[i].ofTheConceptId);\n }\n }\n let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);\n if (concept.id == 0 && id != null && id != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);\n concept = conceptString;\n }\n let output = yield recursiveFetch(id, connectionList, compositionList);\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n returnOutput[mainString] = output;\n let FinalReturn = {};\n FinalReturn['data'] = returnOutput;\n FinalReturn['id'] = id;\n return FinalReturn;\n });\n}\n/**\n * ## Format justdata ###\n * ## This contains a concept in the parameter so that you dont have to again find the concept ##\n * This function takes concepts and connections and then builds a json.\n * @param concept The concept that needs to get other concepts that are inside of it.\n * @param connectionList List of connections that are available in the composition. We have to loop over it.\n * @param compositionList Composition list is the list of concepts that have connections inside of them.\n * @param visitedConcepts This is a checking mechanism to not go in loops. So preferably pass an empty array.\n * @returns\n */\nfunction recursiveFetchConcept(concept_1, connectionList_1, compositionList_1) {\n var arguments_3 = arguments;\n return __awaiter(this, arguments, void 0, function* (concept, connectionList, compositionList, visitedConcepts = []) {\n var _a, _b, _c, _d;\n _app__WEBPACK_IMPORTED_MODULE_4__.Logger.logfunction(recursiveFetchConcept, arguments_3);\n let output = {};\n let arroutput = [];\n let id = concept.id;\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n if (!compositionList.includes(id)) {\n return concept === null || concept === void 0 ? void 0 : concept.characterValue;\n }\n else {\n if (visitedConcepts.includes(id)) {\n return \"\";\n }\n else {\n visitedConcepts.push(id);\n }\n for (let i = 0; i < connectionList.length; i++) {\n if (connectionList[i].ofTheConceptId == id) {\n if (id != connectionList[i].toTheConceptId) {\n let toConceptId = connectionList[i].toTheConceptId;\n let toConcept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(toConceptId);\n if ((toConcept == null || toConcept.id == 0) && toConceptId != null && toConceptId != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(toConceptId);\n toConcept = conceptString;\n }\n if (toConcept.id != 0) {\n if ((toConcept === null || toConcept === void 0 ? void 0 : toConcept.type) == null) {\n let toConceptTypeId = toConcept.typeId;\n let toConceptType = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(toConceptTypeId);\n toConcept.type = toConceptType;\n if (toConceptType == null && toConceptTypeId != null && toConceptTypeId != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(toConceptTypeId);\n toConceptType = conceptString;\n toConcept.type = toConceptType;\n }\n }\n }\n let regex = \"the_\";\n let localmainString = (_d = (_c = toConcept === null || toConcept === void 0 ? void 0 : toConcept.type) === null || _c === void 0 ? void 0 : _c.characterValue) !== null && _d !== void 0 ? _d : \"\";\n let localKey = localmainString.replace(regex, \"\");\n if (isNaN(Number(localKey))) {\n if (localKey) {\n const result = yield recursiveFetchConcept(toConcept, connectionList, compositionList, visitedConcepts);\n output[localKey] = result;\n }\n }\n else {\n const result = yield recursiveFetchConcept(toConcept, connectionList, compositionList, visitedConcepts);\n arroutput[localKey] = result;\n output = arroutput;\n }\n }\n else {\n console.log(\"this is the faulty connection \", connectionList[i]);\n }\n }\n }\n }\n return output;\n });\n}\n/**\n* ## Format Normal ###\n* ## This contains a concept in the parameter so that you dont have to again find the concept ##\n* This function takes concepts and connections and then builds a json.\n* @param concept The concept that needs to get other concepts that are inside of it.\n* @param connectionList List of connections that are available in the composition. We have to loop over it.\n* @param compositionList Composition list is the list of concepts that have connections inside of them.\n* @param visitedConcepts This is a checking mechanism to not go in loops. So preferably pass an empty array.\n* @returns\n*/\nfunction recursiveFetchConceptNormal(concept_1, connectionList_1, compositionList_1) {\n var arguments_4 = arguments;\n return __awaiter(this, arguments, void 0, function* (concept, connectionList, compositionList, visitedConcepts = []) {\n var _a, _b, _c, _d;\n _app__WEBPACK_IMPORTED_MODULE_4__.Logger.logfunction(recursiveFetchConceptNormal, arguments_4);\n let startTime = new Date().getTime();\n let output = {};\n let arroutput = [];\n let id = concept.id;\n output[\"id\"] = id;\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n if (!compositionList.includes(id)) {\n return concept === null || concept === void 0 ? void 0 : concept.characterValue;\n }\n else {\n if (visitedConcepts.includes(id)) {\n return \"\";\n }\n else {\n visitedConcepts.push(id);\n }\n for (let i = 0; i < connectionList.length; i++) {\n if (connectionList[i].ofTheConceptId == id) {\n if (id != connectionList[i].toTheConceptId) {\n let toConceptId = connectionList[i].toTheConceptId;\n let toConcept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(toConceptId);\n if ((toConcept == null || toConcept.id == 0) && toConceptId != null && toConceptId != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(toConceptId);\n toConcept = conceptString;\n }\n if (toConcept.id != 0) {\n if ((toConcept === null || toConcept === void 0 ? void 0 : toConcept.type) == null) {\n let toConceptTypeId = toConcept.typeId;\n let toConceptType = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(toConceptTypeId);\n toConcept.type = toConceptType;\n if (toConceptType == null && toConceptTypeId != null && toConceptTypeId != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(toConceptTypeId);\n toConceptType = conceptString;\n toConcept.type = toConceptType;\n }\n }\n }\n let regex = \"the_\";\n let localmainString = (_d = (_c = toConcept === null || toConcept === void 0 ? void 0 : toConcept.type) === null || _c === void 0 ? void 0 : _c.characterValue) !== null && _d !== void 0 ? _d : \"\";\n let localKey = localmainString.replace(regex, \"\");\n if (isNaN(Number(localKey))) {\n if (localKey) {\n const result = yield recursiveFetchConcept(toConcept, connectionList, compositionList, visitedConcepts);\n output[localKey] = result;\n }\n }\n else {\n const result = yield recursiveFetchConcept(toConcept, connectionList, compositionList, visitedConcepts);\n arroutput[localKey] = result;\n output = arroutput;\n }\n }\n else {\n console.log(\"this is the faulty connection \", connectionList[i]);\n }\n }\n }\n }\n // console.log(\"second loop normal\", new Date().getTime() - startTime);\n return output;\n });\n}\n/**\n * ## experimental ##\n* This function takes concepts and connections and then builds a json.\n* @param concept The concept that needs to get other concepts that are inside of it.\n* @param connectionList List of connections that are available in the composition. We have to loop over it.\n* @param compositionList Composition list is the list of concepts that have connections inside of them.\n* @param visitedConcepts This is a checking mechanism to not go in loops. So preferably pass an empty array.\n* @returns\n*/\nfunction recursiveFetchConceptSingleLoop(concept_1, connectionList_1, compositionList_1) {\n return __awaiter(this, arguments, void 0, function* (concept, connectionList, compositionList, visitedConcepts = []) {\n var _a, _b, _c, _d, _e, _f, _g, _h;\n let output = {};\n let id = concept.id;\n let startTime = new Date().getTime();\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n if (!compositionList.includes(id)) {\n let myString = mainString;\n let returnoutput = { [myString]: concept === null || concept === void 0 ? void 0 : concept.characterValue };\n return returnoutput;\n }\n else {\n if (visitedConcepts.includes(id)) {\n return \"\";\n }\n else {\n visitedConcepts.push(id);\n }\n for (let i = 0; i < connectionList.length; i++) {\n let newData = yield (0,_app__WEBPACK_IMPORTED_MODULE_4__.GetTheConcept)(connectionList[i].ofTheConceptId);\n let toConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_4__.GetTheConcept)(connectionList[i].toTheConceptId);\n connectionList[i].ofConcept = newData;\n connectionList[i].toConcept = toConcept;\n let ofKey = newData.id;\n let toConceptKey = (_d = (_c = toConcept === null || toConcept === void 0 ? void 0 : toConcept.type) === null || _c === void 0 ? void 0 : _c.characterValue) !== null && _d !== void 0 ? _d : \"\";\n let regex = \"the_\";\n let localmainString = toConceptKey;\n let localToKey = localmainString.replace(regex, \"\");\n if (output[ofKey] == undefined || output[ofKey] == null) {\n output[ofKey] = {};\n }\n output[ofKey][localToKey] = toConcept.characterValue;\n }\n }\n let finalOutput = {};\n for (let i = 0; i < connectionList.length; i++) {\n let ofConcept = connectionList[i].ofConcept;\n let toConcept = connectionList[i].toConcept;\n let ofConceptKey = (_f = (_e = ofConcept === null || ofConcept === void 0 ? void 0 : ofConcept.type) === null || _e === void 0 ? void 0 : _e.characterValue) !== null && _f !== void 0 ? _f : \"\";\n let toConceptKey = (_h = (_g = toConcept === null || toConcept === void 0 ? void 0 : toConcept.type) === null || _g === void 0 ? void 0 : _g.characterValue) !== null && _h !== void 0 ? _h : \"\";\n let regex = \"the_\";\n let localmainString = toConceptKey;\n let localToKey = localmainString.replace(regex, \"\");\n if (finalOutput[ofConcept.id] == undefined || finalOutput[ofConcept.id] == null) {\n finalOutput[ofConcept.id] = {};\n }\n let internalOutput = finalOutput[ofConcept.id];\n if (internalOutput[ofConceptKey] == undefined || internalOutput[ofConceptKey] == null) {\n internalOutput[ofConceptKey] = {};\n }\n if (output[connectionList[i].ofTheConceptId] != undefined && output[connectionList[i].toTheConceptId] != undefined) {\n internalOutput[ofConceptKey][localToKey] = output[toConcept.id];\n }\n else {\n internalOutput[ofConceptKey][localToKey] = toConcept.characterValue;\n }\n }\n return finalOutput[concept.id];\n });\n}\n/**\n * ## Format justdata ##\n * @param id\n * @param connectionList\n * @param compositionList\n * @param visitedConcepts\n * @returns\n */\nfunction recursiveFetch(id_1, connectionList_1, compositionList_1) {\n return __awaiter(this, arguments, void 0, function* (id, connectionList, compositionList, visitedConcepts = []) {\n var _a, _b, _c, _d;\n let output = {};\n let arroutput = [];\n if (id == 0) {\n return null;\n }\n let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);\n if ((concept == null || concept.id == 0) && id != null && id != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);\n concept = conceptString;\n }\n if (concept.id != 0) {\n if (concept.type == null) {\n let toConceptTypeId = concept.typeId;\n let toConceptType = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(toConceptTypeId);\n concept.type = toConceptType;\n if (toConceptType == null && toConceptTypeId != null && toConceptTypeId != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(toConceptTypeId);\n toConceptType = conceptString;\n concept.type = toConceptType;\n }\n }\n }\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n if (!compositionList.includes(id)) {\n return concept === null || concept === void 0 ? void 0 : concept.characterValue;\n }\n else {\n if (visitedConcepts.includes(id)) {\n return \"\";\n }\n else {\n visitedConcepts.push(id);\n }\n for (let i = 0; i < connectionList.length; i++) {\n let insideTime = new Date().getTime();\n if (connectionList[i].ofTheConceptId == id) {\n if (id != connectionList[i].toTheConceptId) {\n let toConceptId = connectionList[i].toTheConceptId;\n let toConcept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(toConceptId);\n if ((toConcept == null || toConcept.id == 0) && toConceptId != null && toConceptId != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(toConceptId);\n toConcept = conceptString;\n }\n if (toConcept.id != 0) {\n if ((toConcept === null || toConcept === void 0 ? void 0 : toConcept.type) == null) {\n let toConceptTypeId = toConcept.typeId;\n let toConceptType = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(toConceptTypeId);\n toConcept.type = toConceptType;\n if (toConceptType == null && toConceptTypeId != null && toConceptTypeId != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(toConceptTypeId);\n toConceptType = conceptString;\n toConcept.type = toConceptType;\n }\n }\n }\n let regex = \"the_\";\n let localmainString = (_d = (_c = toConcept === null || toConcept === void 0 ? void 0 : toConcept.type) === null || _c === void 0 ? void 0 : _c.characterValue) !== null && _d !== void 0 ? _d : \"\";\n let localKey = localmainString.replace(regex, \"\");\n if (isNaN(Number(localKey))) {\n if (localKey) {\n const result = yield recursiveFetch(toConceptId, connectionList, compositionList, visitedConcepts);\n output[localKey] = result;\n }\n }\n else {\n const result = yield recursiveFetch(toConceptId, connectionList, compositionList, visitedConcepts);\n arroutput[localKey] = result;\n output = arroutput;\n }\n }\n else {\n console.log(\"this is the faulty connection \", connectionList[i]);\n }\n }\n }\n }\n return output;\n });\n}\nfunction recursiveFetchWithSubCompositions(id_1, connectionList_1, compositionList_1) {\n return __awaiter(this, arguments, void 0, function* (id, connectionList, compositionList, visitedConcepts = []) {\n var _a, _b, _c, _d;\n let output = {};\n let arroutput = [];\n if (id == 0) {\n return null;\n }\n let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);\n if ((concept == null || concept.id == 0) && id != null && id != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);\n concept = conceptString;\n }\n if (concept.id != 0) {\n if (concept.type == null) {\n let toConceptTypeId = concept.typeId;\n let toConceptType = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(toConceptTypeId);\n concept.type = toConceptType;\n if (toConceptType == null && toConceptTypeId != null && toConceptTypeId != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(toConceptTypeId);\n toConceptType = conceptString;\n concept.type = toConceptType;\n }\n }\n }\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n if (!compositionList.includes(id)) {\n return concept === null || concept === void 0 ? void 0 : concept.characterValue;\n }\n else {\n if (visitedConcepts.includes(id)) {\n return \"\";\n }\n else {\n visitedConcepts.push(id);\n }\n output[\"id\"] = id;\n for (let i = 0; i < connectionList.length; i++) {\n if (connectionList[i].ofTheConceptId == id) {\n let toConceptId = connectionList[i].toTheConceptId;\n let toConcept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(toConceptId);\n if ((toConcept == null || toConcept.id == 0) && toConceptId != null && toConceptId != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(toConceptId);\n toConcept = conceptString;\n }\n if (toConcept) {\n if ((toConcept === null || toConcept === void 0 ? void 0 : toConcept.type) == null) {\n let toConceptTypeId = toConcept.typeId;\n let toConceptType = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(toConceptTypeId);\n toConcept.type = toConceptType;\n if (toConceptType == null && toConceptTypeId != null && toConceptTypeId != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(toConceptTypeId);\n toConceptType = conceptString;\n toConcept.type = toConceptType;\n }\n }\n }\n let regex = \"the_\";\n let localmainString = (_d = (_c = toConcept === null || toConcept === void 0 ? void 0 : toConcept.type) === null || _c === void 0 ? void 0 : _c.characterValue) !== null && _d !== void 0 ? _d : \"\";\n let localKey = localmainString.replace(regex, \"\");\n if (isNaN(Number(localKey))) {\n if (localKey) {\n const result = yield recursiveFetchWithSubCompositions(toConceptId, connectionList, compositionList);\n output[localKey] = result;\n }\n }\n else {\n const result = yield recursiveFetchWithSubCompositions(toConceptId, connectionList, compositionList);\n arroutput[localKey] = result;\n output = arroutput;\n }\n }\n }\n }\n return output;\n });\n}\n\n\n//# sourceURL=webpack://mftsccs-browser/./src/Services/GetComposition.ts?");
1417
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ GetComposition: () => (/* binding */ GetComposition),\n/* harmony export */ GetCompositionById: () => (/* binding */ GetCompositionById),\n/* harmony export */ GetCompositionFromMemory: () => (/* binding */ GetCompositionFromMemory),\n/* harmony export */ GetCompositionFromMemoryNormal: () => (/* binding */ GetCompositionFromMemoryNormal),\n/* harmony export */ GetCompositionFromMemoryWithConnections: () => (/* binding */ GetCompositionFromMemoryWithConnections),\n/* harmony export */ GetCompositionWithAllIds: () => (/* binding */ GetCompositionWithAllIds),\n/* harmony export */ GetCompositionWithId: () => (/* binding */ GetCompositionWithId),\n/* harmony export */ GetCompositionWithIdAndDateFromMemory: () => (/* binding */ GetCompositionWithIdAndDateFromMemory),\n/* harmony export */ GetCompositionWithIdFromMemory: () => (/* binding */ GetCompositionWithIdFromMemory),\n/* harmony export */ GetCompositionWithIdFromMemoryFromConnection: () => (/* binding */ GetCompositionWithIdFromMemoryFromConnection),\n/* harmony export */ GetCompositionWithIdFromMemoryFromConnections: () => (/* binding */ GetCompositionWithIdFromMemoryFromConnections),\n/* harmony export */ GetCompositionWithIdFromMemoryNew: () => (/* binding */ GetCompositionWithIdFromMemoryNew),\n/* harmony export */ RecursiveFetchBuildLayer: () => (/* binding */ RecursiveFetchBuildLayer),\n/* harmony export */ RecursiveFetchBuildLayerDataId: () => (/* binding */ RecursiveFetchBuildLayerDataId),\n/* harmony export */ RecursiveFetchBuildLayerNormal: () => (/* binding */ RecursiveFetchBuildLayerNormal),\n/* harmony export */ recursiveFetch: () => (/* binding */ recursiveFetch),\n/* harmony export */ recursiveFetchConcept: () => (/* binding */ recursiveFetchConcept),\n/* harmony export */ recursiveFetchConceptNormal: () => (/* binding */ recursiveFetchConceptNormal),\n/* harmony export */ recursiveFetchConceptSingleLoop: () => (/* binding */ recursiveFetchConceptSingleLoop),\n/* harmony export */ recursiveFetchWithSubCompositions: () => (/* binding */ recursiveFetchWithSubCompositions)\n/* harmony export */ });\n/* harmony import */ var _Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Api/GetConcept */ \"./src/Api/GetConcept.ts\");\n/* harmony import */ var _Api_GetAllConnectionsOfComposition__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Api/GetAllConnectionsOfComposition */ \"./src/Api/GetAllConnectionsOfComposition.ts\");\n/* harmony import */ var _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../DataStructures/ConceptData */ \"./src/DataStructures/ConceptData.ts\");\n/* harmony import */ var _DataStructures_ConnectionData__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../DataStructures/ConnectionData */ \"./src/DataStructures/ConnectionData.ts\");\n/* harmony import */ var _app__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../app */ \"./src/app.ts\");\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n\n\n\n\n\nfunction GetCompositionById(id) {\n return __awaiter(this, void 0, void 0, function* () {\n let returnOutput = { connectionList: [], compositionList: [] };\n try {\n if (_app__WEBPACK_IMPORTED_MODULE_4__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_4__.sendMessage)('GetCompositionById', { id });\n return res.data;\n }\n catch (error) {\n console.error('GetCompositionById error sw: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_4__.handleServiceWorkerException)(error);\n }\n }\n let connectionListString = yield (0,_Api_GetAllConnectionsOfComposition__WEBPACK_IMPORTED_MODULE_1__.GetAllConnectionsOfComposition)(id);\n returnOutput.connectionList = connectionListString;\n for (let i = 0; i < returnOutput.connectionList.length; i++) {\n if (!returnOutput.compositionList.includes(returnOutput.connectionList[i].ofTheConceptId)) {\n returnOutput.compositionList.push(returnOutput.connectionList[i].ofTheConceptId);\n }\n }\n return returnOutput;\n }\n catch (error) {\n console.error('GetCompositionById error: ', error);\n return returnOutput;\n }\n });\n}\n/**\n * ## format JUSTDATA ##\n * this function builds the composition with the main id as the point of building.\n * @param id id of the main composition that you want to build\n * @param connectionList list of connections\n * @param compositionList list of of_the_concept_ids for all the connections.\n * @returns\n */\nfunction RecursiveFetchBuildLayer(id, connectionList, compositionList) {\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b;\n let returnOutput = {};\n let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);\n if (concept.id == 0 && id != null && id != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);\n concept = conceptString;\n }\n let output = yield recursiveFetch(id, connectionList, compositionList);\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n returnOutput[mainString] = output;\n return returnOutput;\n });\n}\n/**\n * ## format DATAID ##\n * this function builds the composition with the main id as the point of building.\n * @param id id of the main composition that you want to build\n * @param connectionList list of connections\n * @param compositionList list of of_the_concept_ids for all the connections.\n * @returns\n */\nfunction RecursiveFetchBuildLayerDataId(id, connectionList, compositionList) {\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b;\n let returnOutput = {};\n let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);\n if (concept.id == 0 && id != null && id != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);\n concept = conceptString;\n }\n let output = yield recursiveFetch(id, connectionList, compositionList);\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n returnOutput[mainString] = output;\n let FinalReturn = {};\n FinalReturn['created_at'] = concept.entryTimeStamp;\n FinalReturn['data'] = returnOutput;\n FinalReturn['id'] = id;\n return FinalReturn;\n });\n}\n/**\n * ## format Normal ##\n * this function builds the composition with the main id as the point of building.\n * @param id id of the main composition that you want to build\n * @param connectionList list of connections\n * @param compositionList list of of_the_concept_ids for all the connections.\n * @returns\n */\nfunction RecursiveFetchBuildLayerNormal(id, connectionList, compositionList) {\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b;\n let returnOutput = {};\n let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);\n if (concept.id == 0 && id != null && id != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);\n concept = conceptString;\n }\n let output = yield recursiveFetchConceptNormal(concept, connectionList, compositionList);\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n returnOutput[mainString] = output;\n return returnOutput;\n });\n}\n/**\n * ## format JUSTDATA ##\n * this function builds the composition with the main id as the point of building.\n * This just requires the id\n * @param id id of the main composition that you want to build\n * @param connectionList list of connections\n * @param compositionList list of of_the_concept_ids for all the connections.\n * @returns\n */\nfunction GetComposition(id) {\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b;\n if (_app__WEBPACK_IMPORTED_MODULE_4__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_4__.sendMessage)('GetComposition', { id });\n return res.data;\n }\n catch (error) {\n console.error('GetComposition error sw: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_4__.handleServiceWorkerException)(error);\n }\n }\n let connectionList = [];\n let returnOutput = {};\n let connectionListString = yield (0,_Api_GetAllConnectionsOfComposition__WEBPACK_IMPORTED_MODULE_1__.GetAllConnectionsOfComposition)(id);\n connectionList = connectionListString;\n console.log(\"this is the connection list online\", connectionList);\n //connectionList = ConnectionData.GetConnectionsOfComposition(id);\n let compositionList = [];\n for (let i = 0; i < connectionList.length; i++) {\n if (!compositionList.includes(connectionList[i].ofTheConceptId)) {\n compositionList.push(connectionList[i].ofTheConceptId);\n }\n }\n let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);\n if (concept.id == 0 && id != null && id != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);\n concept = conceptString;\n }\n let output = yield recursiveFetch(id, connectionList, compositionList);\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n returnOutput[mainString] = output;\n return returnOutput;\n });\n}\nfunction GetCompositionWithAllIds(id) {\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b;\n let connectionList = [];\n let returnOutput = {};\n let connectionListString = yield (0,_Api_GetAllConnectionsOfComposition__WEBPACK_IMPORTED_MODULE_1__.GetAllConnectionsOfComposition)(id);\n connectionList = connectionListString;\n //connectionList = ConnectionData.GetConnectionsOfComposition(id);\n let compositionList = [];\n for (let i = 0; i < connectionList.length; i++) {\n if (!compositionList.includes(connectionList[i].ofTheConceptId)) {\n compositionList.push(connectionList[i].ofTheConceptId);\n }\n }\n let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);\n if (concept.id == 0 && id != null && id != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);\n concept = conceptString;\n }\n let output = yield recursiveFetchWithSubCompositions(id, connectionList, compositionList);\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n returnOutput[mainString] = output;\n return returnOutput;\n });\n}\n/**\n * ### Format JUSTDATA ###\n * This function just builds data from the memory.\n * This is a function that takes on all the concepts and connections of the concept (as a composition ) and builds\n * it into a json data.\n * @param id this id is just used to get all the composition data from the concepts and connections in memory\n * @returns\n */\nfunction GetCompositionFromMemory(id) {\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b;\n if (_app__WEBPACK_IMPORTED_MODULE_4__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_4__.sendMessage)('GetCompositionFromMemory', { id });\n return res.data;\n }\n catch (error) {\n console.error('GetCompositionFromMemory error sw: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_4__.handleServiceWorkerException)(error);\n }\n }\n let connectionList = [];\n let returnOutput = {};\n //connectionList = await ConnectionData.GetConnectionsOfConcept(id);\n connectionList = yield _DataStructures_ConnectionData__WEBPACK_IMPORTED_MODULE_3__.ConnectionData.GetConnectionsOfCompositionLocal(id);\n //connectionList = ConnectionData.GetConnectionsOfComposition(id);\n let compositionList = [];\n for (let i = 0; i < connectionList.length; i++) {\n if (!compositionList.includes(connectionList[i].ofTheConceptId)) {\n compositionList.push(connectionList[i].ofTheConceptId);\n }\n }\n let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);\n if (concept.id == 0 && id != null && id != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);\n concept = conceptString;\n }\n let output = yield recursiveFetchConcept(concept, connectionList, compositionList);\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n returnOutput[mainString] = output;\n return returnOutput;\n });\n}\n/**\n * ### Format Normal ###\n * This function just builds data from the memory.\n * This is a function that takes on all the concepts and connections of the concept (as a composition ) and builds\n * it into a json data.\n * @param id this id is just used to get all the composition data from the concepts and connections in memory\n * @returns\n */\nfunction GetCompositionFromMemoryNormal(id) {\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b;\n if (_app__WEBPACK_IMPORTED_MODULE_4__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_4__.sendMessage)('GetCompositionFromMemoryNormal', { id });\n return res.data;\n }\n catch (error) {\n console.error('GetCompositionFromMemoryNormal error sw: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_4__.handleServiceWorkerException)(error);\n }\n }\n let connectionList = [];\n let returnOutput = {};\n //connectionList = await ConnectionData.GetConnectionsOfConcept(id);\n connectionList = yield _DataStructures_ConnectionData__WEBPACK_IMPORTED_MODULE_3__.ConnectionData.GetConnectionsOfCompositionLocal(id);\n //connectionList = ConnectionData.GetConnectionsOfComposition(id);\n let compositionList = [];\n for (let i = 0; i < connectionList.length; i++) {\n if (!compositionList.includes(connectionList[i].ofTheConceptId)) {\n compositionList.push(connectionList[i].ofTheConceptId);\n }\n }\n let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);\n if (concept.id == 0 && id != null && id != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);\n concept = conceptString;\n }\n let output = yield recursiveFetchConceptNormal(concept, connectionList, compositionList);\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n returnOutput[mainString] = output;\n return returnOutput;\n });\n}\n/**\n * ### Format DATAIDDATE ####\n * Gets data just from memory\n * @param id\n * @returns\n */\nfunction GetCompositionWithIdFromMemory(id) {\n var arguments_1 = arguments;\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b;\n _app__WEBPACK_IMPORTED_MODULE_4__.Logger.logfunction(GetCompositionWithIdFromMemory, arguments_1);\n if (_app__WEBPACK_IMPORTED_MODULE_4__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_4__.sendMessage)('GetCompositionWithIdFromMemory', { id });\n return res.data;\n }\n catch (error) {\n console.error('GetCompositionWithIdFromMemory error sw: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_4__.handleServiceWorkerException)(error);\n }\n }\n let FinalReturn = {};\n let connectionList = [];\n let returnOutput = {};\n // connectionList = await ConnectionData.GetConnectionsOfConcept(id);\n try {\n connectionList = yield _DataStructures_ConnectionData__WEBPACK_IMPORTED_MODULE_3__.ConnectionData.GetConnectionsOfCompositionLocal(id);\n let compositionList = [];\n for (let i = 0; i < connectionList.length; i++) {\n if (!compositionList.includes(connectionList[i].ofTheConceptId)) {\n compositionList.push(connectionList[i].ofTheConceptId);\n }\n }\n let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);\n if (concept.id == 0 && id != null && id != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);\n concept = conceptString;\n }\n let output = yield recursiveFetchConcept(concept, connectionList, compositionList);\n // let output = await recursiveFetchConceptSingleLoop(concept, connectionList,compositionList );\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n returnOutput[mainString] = output;\n FinalReturn['created_at'] = concept.entryTimeStamp;\n FinalReturn['data'] = returnOutput;\n FinalReturn['id'] = id;\n }\n catch (error) {\n console.log(\"this is the exception in GetCompositionWithIdFromMemory\", id);\n }\n return FinalReturn;\n });\n}\n/**\n * ### Format Normal ####\n * Gets data just from memory\n * @param id\n * @returns\n */\nfunction GetCompositionFromMemoryWithConnections(id, connectionList) {\n var arguments_2 = arguments;\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b;\n _app__WEBPACK_IMPORTED_MODULE_4__.Logger.logfunction(GetCompositionFromMemoryWithConnections, arguments_2);\n if (_app__WEBPACK_IMPORTED_MODULE_4__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_4__.sendMessage)('GetCompositionFromMemoryWithConnections', { id, connectionList });\n return res.data;\n }\n catch (error) {\n console.error('GetCompositionFromMemoryWithConnections error sw: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_4__.handleServiceWorkerException)(error);\n }\n }\n let returnOutput = {};\n // connectionList = await ConnectionData.GetConnectionsOfConcept(id);\n let compositionList = [];\n for (let i = 0; i < connectionList.length; i++) {\n if (!compositionList.includes(connectionList[i].ofTheConceptId)) {\n compositionList.push(connectionList[i].ofTheConceptId);\n }\n }\n let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);\n if (concept.id == 0 && id != null && id != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);\n concept = conceptString;\n }\n let output = yield recursiveFetchConcept(concept, connectionList, compositionList);\n // let output = await recursiveFetchConceptSingleLoop(concept, connectionList,compositionList );\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n returnOutput[mainString] = output;\n let FinalReturn = {};\n FinalReturn['created_at'] = concept.entryTimeStamp;\n FinalReturn['data'] = returnOutput;\n FinalReturn['id'] = id;\n return FinalReturn;\n });\n}\n/**\n * ### Format DATAIDDATE ####\n * Gets data just from memory\n * @param id\n * @returns\n */\nfunction GetCompositionWithIdFromMemoryFromConnection(id, connectionList) {\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b;\n if (_app__WEBPACK_IMPORTED_MODULE_4__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_4__.sendMessage)('GetCompositionWithIdFromMemory', { id });\n return res.data;\n }\n catch (error) {\n console.error('GetCompositionWithIdFromMemory error sw: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_4__.handleServiceWorkerException)(error);\n }\n }\n let returnOutput = {};\n // connectionList = await ConnectionData.GetConnectionsOfConcept(id);\n let compositionList = [];\n for (let i = 0; i < connectionList.length; i++) {\n if (!compositionList.includes(connectionList[i].ofTheConceptId)) {\n compositionList.push(connectionList[i].ofTheConceptId);\n }\n }\n let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);\n if (concept.id == 0 && id != null && id != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);\n concept = conceptString;\n }\n let output = yield recursiveFetchConcept(concept, connectionList, compositionList);\n console.log(\"this is the output\", output, concept);\n // let output = await recursiveFetchConceptSingleLoop(concept, connectionList,compositionList );\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n returnOutput[mainString] = output;\n let FinalReturn = {};\n FinalReturn['created_at'] = concept.entryTimeStamp;\n FinalReturn['data'] = returnOutput;\n FinalReturn['id'] = id;\n return FinalReturn;\n });\n}\n/**\n * ### Format DATAIDDATE ####\n * ### experimental ####\n * This is the new format that needs to work with a single or max two loops\n * @param id the id whose composition needs to be created\n * @returns\n */\nfunction GetCompositionWithIdFromMemoryNew(id) {\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b;\n if (_app__WEBPACK_IMPORTED_MODULE_4__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_4__.sendMessage)('GetCompositionWithIdFromMemoryNew', { id });\n return res.data;\n }\n catch (error) {\n console.error('GetCompositionWithIdFromMemoryNew error sw: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_4__.handleServiceWorkerException)(error);\n }\n }\n let connectionList = [];\n let returnOutput = {};\n //connectionList = await ConnectionData.GetConnectionsOfConcept(id);\n connectionList = yield _DataStructures_ConnectionData__WEBPACK_IMPORTED_MODULE_3__.ConnectionData.GetConnectionsOfCompositionLocal(id);\n let compositionList = [];\n for (let i = 0; i < connectionList.length; i++) {\n if (!compositionList.includes(connectionList[i].ofTheConceptId)) {\n compositionList.push(connectionList[i].ofTheConceptId);\n }\n }\n let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);\n if (concept.id == 0 && id != null && id != undefined) {\n console.log(\"this concept you cannot find \", id);\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);\n concept = conceptString;\n }\n let startTime = new Date().getTime();\n //console.log(\"this is the connection list which has to be looped\", connectionList);\n let output = yield recursiveFetchConceptSingleLoop(concept, connectionList, compositionList);\n console.log(\"this is the time for the data to be made\", new Date().getTime() - startTime);\n // let output = await recursiveFetchConceptSingleLoop(concept, connectionList,compositionList );\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n returnOutput = output;\n let FinalReturn = {};\n FinalReturn['created_at'] = concept.entryTimeStamp;\n FinalReturn['data'] = returnOutput;\n FinalReturn['id'] = id;\n return FinalReturn;\n });\n}\n/**\n * ### Format DATAIDDATE #####\n * ### This just returns composition from memory and not from anywhere else.\n * @param id\n * @returns\n */\nfunction GetCompositionWithIdAndDateFromMemory(id) {\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b;\n if (_app__WEBPACK_IMPORTED_MODULE_4__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_4__.sendMessage)('GetCompositionWithIdAndDateFromMemory', { id });\n return res.data;\n }\n catch (error) {\n console.error('GetCompositionWithIdAndDateFromMemory error sw: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_4__.handleServiceWorkerException)(error);\n }\n }\n let connectionList = [];\n let returnOutput = {};\n connectionList = yield _DataStructures_ConnectionData__WEBPACK_IMPORTED_MODULE_3__.ConnectionData.GetConnectionsOfCompositionLocal(id);\n //connectionList = await ConnectionData.GetConnectionsOfConcept(id);\n let compositionList = [];\n for (let i = 0; i < connectionList.length; i++) {\n if (!compositionList.includes(connectionList[i].ofTheConceptId)) {\n compositionList.push(connectionList[i].ofTheConceptId);\n }\n }\n let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);\n if (concept.id == 0 && id != null && id != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);\n concept = conceptString;\n }\n let output = yield recursiveFetch(id, connectionList, compositionList);\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n returnOutput[mainString] = output;\n let FinalReturn = {};\n FinalReturn['data'] = returnOutput;\n FinalReturn['id'] = id;\n FinalReturn['created_at'] = concept.entryTimeStamp;\n return FinalReturn;\n });\n}\nfunction GetCompositionWithIdFromMemoryFromConnections(id_1) {\n return __awaiter(this, arguments, void 0, function* (id, connectionList = []) {\n var _a, _b;\n let returnOutput = {};\n //connectionList = await ConnectionData.GetConnectionsOfCompositionLocal(id);\n let compositionList = [];\n for (let i = 0; i < connectionList.length; i++) {\n if (!compositionList.includes(connectionList[i].ofTheConceptId)) {\n compositionList.push(connectionList[i].ofTheConceptId);\n }\n }\n let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);\n if (concept.id == 0 && id != null && id != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);\n concept = conceptString;\n }\n let output = yield recursiveFetch(id, connectionList, compositionList);\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n returnOutput[mainString] = output;\n let FinalReturn = {};\n FinalReturn['data'] = returnOutput;\n FinalReturn['id'] = id;\n return FinalReturn;\n });\n}\n/**\n * #### Format DATAID ####\n * ## This will return the composition even if it is not in the local memory ##\n * @param id\n * @returns\n */\nfunction GetCompositionWithId(id) {\n var arguments_3 = arguments;\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b;\n _app__WEBPACK_IMPORTED_MODULE_4__.Logger.logfunction(GetCompositionWithId, arguments_3);\n if (_app__WEBPACK_IMPORTED_MODULE_4__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_4__.sendMessage)('GetCompositionWithId', { id });\n return res.data;\n }\n catch (error) {\n console.error('GetCompositionWithId error sw: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_4__.handleServiceWorkerException)(error);\n }\n }\n let connectionList = [];\n let returnOutput = {};\n let connectionListString = yield (0,_Api_GetAllConnectionsOfComposition__WEBPACK_IMPORTED_MODULE_1__.GetAllConnectionsOfComposition)(id);\n connectionList = connectionListString;\n let compositionList = [];\n for (let i = 0; i < connectionList.length; i++) {\n if (!compositionList.includes(connectionList[i].ofTheConceptId)) {\n compositionList.push(connectionList[i].ofTheConceptId);\n }\n }\n let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);\n if (concept.id == 0 && id != null && id != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);\n concept = conceptString;\n }\n let output = yield recursiveFetch(id, connectionList, compositionList);\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n returnOutput[mainString] = output;\n let FinalReturn = {};\n FinalReturn['data'] = returnOutput;\n FinalReturn['id'] = id;\n return FinalReturn;\n });\n}\n/**\n * ## Format justdata ###\n * ## This contains a concept in the parameter so that you dont have to again find the concept ##\n * This function takes concepts and connections and then builds a json.\n * @param concept The concept that needs to get other concepts that are inside of it.\n * @param connectionList List of connections that are available in the composition. We have to loop over it.\n * @param compositionList Composition list is the list of concepts that have connections inside of them.\n * @param visitedConcepts This is a checking mechanism to not go in loops. So preferably pass an empty array.\n * @returns\n */\nfunction recursiveFetchConcept(concept_1, connectionList_1, compositionList_1) {\n var arguments_4 = arguments;\n return __awaiter(this, arguments, void 0, function* (concept, connectionList, compositionList, visitedConcepts = []) {\n var _a, _b, _c, _d;\n _app__WEBPACK_IMPORTED_MODULE_4__.Logger.logfunction(recursiveFetchConcept, arguments_4);\n let output = {};\n let arroutput = [];\n let id = concept.id;\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n if (!compositionList.includes(id)) {\n return concept === null || concept === void 0 ? void 0 : concept.characterValue;\n }\n else {\n if (visitedConcepts.includes(id)) {\n return \"\";\n }\n else {\n visitedConcepts.push(id);\n }\n for (let i = 0; i < connectionList.length; i++) {\n if (connectionList[i].ofTheConceptId == id) {\n if (id != connectionList[i].toTheConceptId) {\n let toConceptId = connectionList[i].toTheConceptId;\n let toConcept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(toConceptId);\n if ((toConcept == null || toConcept.id == 0) && toConceptId != null && toConceptId != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(toConceptId);\n toConcept = conceptString;\n }\n if (toConcept.id != 0) {\n if ((toConcept === null || toConcept === void 0 ? void 0 : toConcept.type) == null) {\n let toConceptTypeId = toConcept.typeId;\n let toConceptType = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(toConceptTypeId);\n toConcept.type = toConceptType;\n if (toConceptType == null && toConceptTypeId != null && toConceptTypeId != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(toConceptTypeId);\n toConceptType = conceptString;\n toConcept.type = toConceptType;\n }\n }\n }\n let regex = \"the_\";\n let localmainString = (_d = (_c = toConcept === null || toConcept === void 0 ? void 0 : toConcept.type) === null || _c === void 0 ? void 0 : _c.characterValue) !== null && _d !== void 0 ? _d : \"\";\n let localKey = localmainString.replace(regex, \"\");\n if (isNaN(Number(localKey))) {\n if (localKey) {\n const result = yield recursiveFetchConcept(toConcept, connectionList, compositionList, visitedConcepts);\n output[localKey] = result;\n }\n }\n else {\n const result = yield recursiveFetchConcept(toConcept, connectionList, compositionList, visitedConcepts);\n arroutput[localKey] = result;\n output = arroutput;\n }\n }\n else {\n console.log(\"this is the faulty connection \", connectionList[i]);\n }\n }\n }\n }\n return output;\n });\n}\n/**\n* ## Format Normal ###\n* ## This contains a concept in the parameter so that you dont have to again find the concept ##\n* This function takes concepts and connections and then builds a json.\n* @param concept The concept that needs to get other concepts that are inside of it.\n* @param connectionList List of connections that are available in the composition. We have to loop over it.\n* @param compositionList Composition list is the list of concepts that have connections inside of them.\n* @param visitedConcepts This is a checking mechanism to not go in loops. So preferably pass an empty array.\n* @returns\n*/\nfunction recursiveFetchConceptNormal(concept_1, connectionList_1, compositionList_1) {\n var arguments_5 = arguments;\n return __awaiter(this, arguments, void 0, function* (concept, connectionList, compositionList, visitedConcepts = []) {\n var _a, _b, _c, _d;\n _app__WEBPACK_IMPORTED_MODULE_4__.Logger.logfunction(recursiveFetchConceptNormal, arguments_5);\n let startTime = new Date().getTime();\n let output = {};\n let arroutput = [];\n let id = concept.id;\n output[\"id\"] = id;\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n if (!compositionList.includes(id)) {\n return concept === null || concept === void 0 ? void 0 : concept.characterValue;\n }\n else {\n if (visitedConcepts.includes(id)) {\n return \"\";\n }\n else {\n visitedConcepts.push(id);\n }\n for (let i = 0; i < connectionList.length; i++) {\n if (connectionList[i].ofTheConceptId == id) {\n if (id != connectionList[i].toTheConceptId) {\n let toConceptId = connectionList[i].toTheConceptId;\n let toConcept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(toConceptId);\n if ((toConcept == null || toConcept.id == 0) && toConceptId != null && toConceptId != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(toConceptId);\n toConcept = conceptString;\n }\n if (toConcept.id != 0) {\n if ((toConcept === null || toConcept === void 0 ? void 0 : toConcept.type) == null) {\n let toConceptTypeId = toConcept.typeId;\n let toConceptType = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(toConceptTypeId);\n toConcept.type = toConceptType;\n if (toConceptType == null && toConceptTypeId != null && toConceptTypeId != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(toConceptTypeId);\n toConceptType = conceptString;\n toConcept.type = toConceptType;\n }\n }\n }\n let regex = \"the_\";\n let localmainString = (_d = (_c = toConcept === null || toConcept === void 0 ? void 0 : toConcept.type) === null || _c === void 0 ? void 0 : _c.characterValue) !== null && _d !== void 0 ? _d : \"\";\n let localKey = localmainString.replace(regex, \"\");\n if (isNaN(Number(localKey))) {\n if (localKey) {\n const result = yield recursiveFetchConcept(toConcept, connectionList, compositionList, visitedConcepts);\n output[localKey] = result;\n }\n }\n else {\n const result = yield recursiveFetchConcept(toConcept, connectionList, compositionList, visitedConcepts);\n arroutput[localKey] = result;\n output = arroutput;\n }\n }\n else {\n console.log(\"this is the faulty connection \", connectionList[i]);\n }\n }\n }\n }\n // console.log(\"second loop normal\", new Date().getTime() - startTime);\n return output;\n });\n}\n/**\n * ## experimental ##\n* This function takes concepts and connections and then builds a json.\n* @param concept The concept that needs to get other concepts that are inside of it.\n* @param connectionList List of connections that are available in the composition. We have to loop over it.\n* @param compositionList Composition list is the list of concepts that have connections inside of them.\n* @param visitedConcepts This is a checking mechanism to not go in loops. So preferably pass an empty array.\n* @returns\n*/\nfunction recursiveFetchConceptSingleLoop(concept_1, connectionList_1, compositionList_1) {\n return __awaiter(this, arguments, void 0, function* (concept, connectionList, compositionList, visitedConcepts = []) {\n var _a, _b, _c, _d, _e, _f, _g, _h;\n let output = {};\n let id = concept.id;\n let startTime = new Date().getTime();\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n if (!compositionList.includes(id)) {\n let myString = mainString;\n let returnoutput = { [myString]: concept === null || concept === void 0 ? void 0 : concept.characterValue };\n return returnoutput;\n }\n else {\n if (visitedConcepts.includes(id)) {\n return \"\";\n }\n else {\n visitedConcepts.push(id);\n }\n for (let i = 0; i < connectionList.length; i++) {\n let newData = yield (0,_app__WEBPACK_IMPORTED_MODULE_4__.GetTheConcept)(connectionList[i].ofTheConceptId);\n let toConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_4__.GetTheConcept)(connectionList[i].toTheConceptId);\n connectionList[i].ofConcept = newData;\n connectionList[i].toConcept = toConcept;\n let ofKey = newData.id;\n let toConceptKey = (_d = (_c = toConcept === null || toConcept === void 0 ? void 0 : toConcept.type) === null || _c === void 0 ? void 0 : _c.characterValue) !== null && _d !== void 0 ? _d : \"\";\n let regex = \"the_\";\n let localmainString = toConceptKey;\n let localToKey = localmainString.replace(regex, \"\");\n if (output[ofKey] == undefined || output[ofKey] == null) {\n output[ofKey] = {};\n }\n output[ofKey][localToKey] = toConcept.characterValue;\n }\n }\n let finalOutput = {};\n for (let i = 0; i < connectionList.length; i++) {\n let ofConcept = connectionList[i].ofConcept;\n let toConcept = connectionList[i].toConcept;\n let ofConceptKey = (_f = (_e = ofConcept === null || ofConcept === void 0 ? void 0 : ofConcept.type) === null || _e === void 0 ? void 0 : _e.characterValue) !== null && _f !== void 0 ? _f : \"\";\n let toConceptKey = (_h = (_g = toConcept === null || toConcept === void 0 ? void 0 : toConcept.type) === null || _g === void 0 ? void 0 : _g.characterValue) !== null && _h !== void 0 ? _h : \"\";\n let regex = \"the_\";\n let localmainString = toConceptKey;\n let localToKey = localmainString.replace(regex, \"\");\n if (finalOutput[ofConcept.id] == undefined || finalOutput[ofConcept.id] == null) {\n finalOutput[ofConcept.id] = {};\n }\n let internalOutput = finalOutput[ofConcept.id];\n if (internalOutput[ofConceptKey] == undefined || internalOutput[ofConceptKey] == null) {\n internalOutput[ofConceptKey] = {};\n }\n if (output[connectionList[i].ofTheConceptId] != undefined && output[connectionList[i].toTheConceptId] != undefined) {\n internalOutput[ofConceptKey][localToKey] = output[toConcept.id];\n }\n else {\n internalOutput[ofConceptKey][localToKey] = toConcept.characterValue;\n }\n }\n return finalOutput[concept.id];\n });\n}\n/**\n * ## Format justdata ##\n * @param id\n * @param connectionList\n * @param compositionList\n * @param visitedConcepts\n * @returns\n */\nfunction recursiveFetch(id_1, connectionList_1, compositionList_1) {\n return __awaiter(this, arguments, void 0, function* (id, connectionList, compositionList, visitedConcepts = []) {\n var _a, _b, _c, _d;\n let output = {};\n let arroutput = [];\n if (id == 0) {\n return null;\n }\n let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);\n if ((concept == null || concept.id == 0) && id != null && id != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);\n concept = conceptString;\n }\n if (concept.id != 0) {\n if (concept.type == null) {\n let toConceptTypeId = concept.typeId;\n let toConceptType = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(toConceptTypeId);\n concept.type = toConceptType;\n if (toConceptType == null && toConceptTypeId != null && toConceptTypeId != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(toConceptTypeId);\n toConceptType = conceptString;\n concept.type = toConceptType;\n }\n }\n }\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n if (!compositionList.includes(id)) {\n return concept === null || concept === void 0 ? void 0 : concept.characterValue;\n }\n else {\n if (visitedConcepts.includes(id)) {\n return \"\";\n }\n else {\n visitedConcepts.push(id);\n }\n for (let i = 0; i < connectionList.length; i++) {\n let insideTime = new Date().getTime();\n if (connectionList[i].ofTheConceptId == id) {\n if (id != connectionList[i].toTheConceptId) {\n let toConceptId = connectionList[i].toTheConceptId;\n let toConcept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(toConceptId);\n if ((toConcept == null || toConcept.id == 0) && toConceptId != null && toConceptId != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(toConceptId);\n toConcept = conceptString;\n }\n if (toConcept.id != 0) {\n if ((toConcept === null || toConcept === void 0 ? void 0 : toConcept.type) == null) {\n let toConceptTypeId = toConcept.typeId;\n let toConceptType = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(toConceptTypeId);\n toConcept.type = toConceptType;\n if (toConceptType == null && toConceptTypeId != null && toConceptTypeId != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(toConceptTypeId);\n toConceptType = conceptString;\n toConcept.type = toConceptType;\n }\n }\n }\n let regex = \"the_\";\n let localmainString = (_d = (_c = toConcept === null || toConcept === void 0 ? void 0 : toConcept.type) === null || _c === void 0 ? void 0 : _c.characterValue) !== null && _d !== void 0 ? _d : \"\";\n let localKey = localmainString.replace(regex, \"\");\n if (isNaN(Number(localKey))) {\n if (localKey) {\n const result = yield recursiveFetch(toConceptId, connectionList, compositionList, visitedConcepts);\n output[localKey] = result;\n }\n }\n else {\n const result = yield recursiveFetch(toConceptId, connectionList, compositionList, visitedConcepts);\n arroutput[localKey] = result;\n output = arroutput;\n }\n }\n else {\n console.log(\"this is the faulty connection \", connectionList[i]);\n }\n }\n }\n }\n return output;\n });\n}\nfunction recursiveFetchWithSubCompositions(id_1, connectionList_1, compositionList_1) {\n return __awaiter(this, arguments, void 0, function* (id, connectionList, compositionList, visitedConcepts = []) {\n var _a, _b, _c, _d;\n let output = {};\n let arroutput = [];\n if (id == 0) {\n return null;\n }\n let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);\n if ((concept == null || concept.id == 0) && id != null && id != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);\n concept = conceptString;\n }\n if (concept.id != 0) {\n if (concept.type == null) {\n let toConceptTypeId = concept.typeId;\n let toConceptType = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(toConceptTypeId);\n concept.type = toConceptType;\n if (toConceptType == null && toConceptTypeId != null && toConceptTypeId != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(toConceptTypeId);\n toConceptType = conceptString;\n concept.type = toConceptType;\n }\n }\n }\n let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"\";\n if (!compositionList.includes(id)) {\n return concept === null || concept === void 0 ? void 0 : concept.characterValue;\n }\n else {\n if (visitedConcepts.includes(id)) {\n return \"\";\n }\n else {\n visitedConcepts.push(id);\n }\n output[\"id\"] = id;\n for (let i = 0; i < connectionList.length; i++) {\n if (connectionList[i].ofTheConceptId == id) {\n let toConceptId = connectionList[i].toTheConceptId;\n let toConcept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(toConceptId);\n if ((toConcept == null || toConcept.id == 0) && toConceptId != null && toConceptId != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(toConceptId);\n toConcept = conceptString;\n }\n if (toConcept) {\n if ((toConcept === null || toConcept === void 0 ? void 0 : toConcept.type) == null) {\n let toConceptTypeId = toConcept.typeId;\n let toConceptType = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(toConceptTypeId);\n toConcept.type = toConceptType;\n if (toConceptType == null && toConceptTypeId != null && toConceptTypeId != undefined) {\n let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(toConceptTypeId);\n toConceptType = conceptString;\n toConcept.type = toConceptType;\n }\n }\n }\n let regex = \"the_\";\n let localmainString = (_d = (_c = toConcept === null || toConcept === void 0 ? void 0 : toConcept.type) === null || _c === void 0 ? void 0 : _c.characterValue) !== null && _d !== void 0 ? _d : \"\";\n let localKey = localmainString.replace(regex, \"\");\n if (isNaN(Number(localKey))) {\n if (localKey) {\n const result = yield recursiveFetchWithSubCompositions(toConceptId, connectionList, compositionList);\n output[localKey] = result;\n }\n }\n else {\n const result = yield recursiveFetchWithSubCompositions(toConceptId, connectionList, compositionList);\n arroutput[localKey] = result;\n output = arroutput;\n }\n }\n }\n }\n return output;\n });\n}\n\n\n//# sourceURL=webpack://mftsccs-browser/./src/Services/GetComposition.ts?");
1418
1418
 
1419
1419
  /***/ }),
1420
1420
 
@@ -1424,7 +1424,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
1424
1424
  \********************************************/
1425
1425
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1426
1426
 
1427
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ GetCompositionBulk: () => (/* binding */ GetCompositionBulk),\n/* harmony export */ GetCompositionBulkWithDataId: () => (/* binding */ GetCompositionBulkWithDataId),\n/* harmony export */ GetCompositionFromConnectionsInObject: () => (/* binding */ GetCompositionFromConnectionsInObject),\n/* harmony export */ GetCompositionFromConnectionsInObjectNormal: () => (/* binding */ GetCompositionFromConnectionsInObjectNormal),\n/* harmony export */ GetCompositionFromConnectionsWithDataId: () => (/* binding */ GetCompositionFromConnectionsWithDataId),\n/* harmony export */ GetCompositionFromConnectionsWithDataIdFromConnections: () => (/* binding */ GetCompositionFromConnectionsWithDataIdFromConnections),\n/* harmony export */ GetCompositionFromConnectionsWithDataIdInObject: () => (/* binding */ GetCompositionFromConnectionsWithDataIdInObject),\n/* harmony export */ GetCompositionFromConnectionsWithDataIdInObjectNew: () => (/* binding */ GetCompositionFromConnectionsWithDataIdInObjectNew),\n/* harmony export */ GetCompositionFromConnectionsWithDataIdIndex: () => (/* binding */ GetCompositionFromConnectionsWithDataIdIndex),\n/* harmony export */ GetCompositionFromConnectionsWithIndex: () => (/* binding */ GetCompositionFromConnectionsWithIndex),\n/* harmony export */ GetCompositionFromConnectionsWithIndexFromConnections: () => (/* binding */ GetCompositionFromConnectionsWithIndexFromConnections),\n/* harmony export */ GetConnectionDataPrefetch: () => (/* binding */ GetConnectionDataPrefetch)\n/* harmony export */ });\n/* harmony import */ var _Api_GetAllConnectionsOfCompositionBulk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Api/GetAllConnectionsOfCompositionBulk */ \"./src/Api/GetAllConnectionsOfCompositionBulk.ts\");\n/* harmony import */ var _Api_GetConnectionBulk__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Api/GetConnectionBulk */ \"./src/Api/GetConnectionBulk.ts\");\n/* harmony import */ var _app__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../app */ \"./src/app.ts\");\n/* harmony import */ var _FindConnectionsOfCompositionBulkInMemory__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./FindConnectionsOfCompositionBulkInMemory */ \"./src/Services/FindConnectionsOfCompositionBulkInMemory.ts\");\n/* harmony import */ var _GetComposition__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./GetComposition */ \"./src/Services/GetComposition.ts\");\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n\n\n\n\n\n/**\n * ## Format JUSTDATA ##\n * Function converts the conceptIds to json (compositions)\n * This function takes in the conceptIds and returns a list of compositions related to those concepts.\n * @param conceptIds list of concept ids that are compositions.\n * @returns compositions\n */\nfunction GetCompositionBulk() {\n return __awaiter(this, arguments, void 0, function* (conceptIds = []) {\n yield (0,_Api_GetAllConnectionsOfCompositionBulk__WEBPACK_IMPORTED_MODULE_0__.GetAllConnectionsOfCompositionBulk)(conceptIds);\n let compositions = [];\n for (let i = 0; i < conceptIds.length; i++) {\n let comp = yield (0,_GetComposition__WEBPACK_IMPORTED_MODULE_4__.GetCompositionFromMemory)(conceptIds[i]);\n compositions.push(comp);\n }\n return compositions;\n });\n}\n/**\n * ## FORMAT DATAIDDATE ##\n * Function converts the conceptIds to json (compositions)\n * @param conceptIds this is the list of concept ids that should be converted to compostions in data - id format.\n * @returns list of compositions in the data - id format.\n */\nfunction GetCompositionBulkWithDataId() {\n return __awaiter(this, arguments, void 0, function* (conceptIds = []) {\n yield (0,_Api_GetAllConnectionsOfCompositionBulk__WEBPACK_IMPORTED_MODULE_0__.GetAllConnectionsOfCompositionBulk)(conceptIds);\n let compositions = [];\n for (let i = 0; i < conceptIds.length; i++) {\n let comp = yield (0,_GetComposition__WEBPACK_IMPORTED_MODULE_4__.GetCompositionWithIdFromMemory)(conceptIds[i]);\n compositions.push(comp);\n }\n return compositions;\n });\n}\n/**\n * ## FORMAT DATAIDDATE ##\n * This function converts the conceptIds and internal connectionIds to compositions in data-Id format.\n * @param conceptIds This is the list of concept ids that need to be converted to compositions.\n * @param connectionIds These are the internal connectionIds that need to be passed to create the compositions.\n * @returns list of compositions created from the passed conceptIds and connectionIds.\n */\nfunction GetCompositionFromConnectionsWithDataId() {\n var arguments_1 = arguments;\n return __awaiter(this, arguments, void 0, function* (conceptIds = [], connectionIds = []) {\n _app__WEBPACK_IMPORTED_MODULE_2__.Logger.logfunction(GetCompositionFromConnectionsWithDataId, arguments_1);\n if (_app__WEBPACK_IMPORTED_MODULE_2__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_2__.sendMessage)('GetCompositionFromConnectionsWithDataId', { conceptIds, connectionIds });\n return res.data;\n }\n catch (error) {\n console.error('GetCompositionFromConnectionsWithDataId error sw: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_2__.handleServiceWorkerException)(error);\n }\n }\n // let newConnections = await GetConnectionBulk(connectionIds);\n // let oldConnections = await FindConnectionsOfCompositionsBulkInMemory(conceptIds);\n //CheckForConnectionDeletionWithIds(connectionIds,oldConnections);\n let compositions = [];\n for (let i = 0; i < conceptIds.length; i++) {\n let comp = yield (0,_GetComposition__WEBPACK_IMPORTED_MODULE_4__.GetCompositionWithIdFromMemory)(conceptIds[i]);\n compositions.push(comp);\n }\n return compositions;\n });\n}\n/**\n * ## FORMAT DATAIDDATE ##\n * This is just a different version of GetCompositionFromConnectionsWithDataId, This has the added functionality that\n * it also prints out internal connections.\n * This function converts the conceptIds and internal connectionIds to compositions in data-Id format.\n * @param conceptIds This is the list of concept ids that need to be converted to compositions.\n * @param connectionIds These are the internal connectionIds that need to be passed to create the compositions.\n * @returns list of compositions created from the passed conceptIds and connectionIds.\n */\nfunction GetCompositionFromConnectionsWithDataIdFromConnections() {\n var arguments_2 = arguments;\n return __awaiter(this, arguments, void 0, function* (conceptIds = [], connectionIds = []) {\n _app__WEBPACK_IMPORTED_MODULE_2__.Logger.logfunction(GetCompositionFromConnectionsWithDataIdFromConnections, arguments_2);\n if (_app__WEBPACK_IMPORTED_MODULE_2__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_2__.sendMessage)('GetCompositionFromConnectionsWithDataIdFromConnections', { conceptIds, connectionIds });\n return res.data;\n }\n catch (error) {\n console.error('GetCompositionFromConnectionsWithDataIdFromConnections error sw: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_2__.handleServiceWorkerException)(error);\n }\n }\n let newConnections = yield (0,_Api_GetConnectionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionBulk)(connectionIds);\n //CheckForConnectionDeletionWithIds(connectionIds,oldConnections);\n let compositions = [];\n for (let i = 0; i < conceptIds.length; i++) {\n let comp = yield (0,_GetComposition__WEBPACK_IMPORTED_MODULE_4__.GetCompositionWithIdFromMemoryFromConnection)(conceptIds[i], newConnections);\n compositions.push(comp);\n }\n return compositions;\n });\n}\n/**\n * ## Format DATAIDDATE ##\n * This function converts the conceptIds and internal connectionIds to compositions in data-Id format with index(conceptId).\n * @param conceptIds This is the list of concept ids that need to be converted to compositions.\n * @param connectionIds These are the internal connectionIds that need to be passed to create the compositions.\n * @returns dictionary of compositions created from the passed conceptIds and connectionIds with conceptId as its index .\n */\nfunction GetCompositionFromConnectionsWithDataIdIndex() {\n return __awaiter(this, arguments, void 0, function* (conceptIds = [], connectionIds = []) {\n if (_app__WEBPACK_IMPORTED_MODULE_2__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_2__.sendMessage)('GetCompositionFromConnectionsWithDataIdIndex', { conceptIds, connectionIds });\n return res.data;\n }\n catch (error) {\n console.error('GetCompositionFromConnectionsWithDataIdIndex error sw: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_2__.handleServiceWorkerException)(error);\n }\n }\n let newConnections = yield (0,_Api_GetConnectionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionBulk)(connectionIds);\n let myNewConnections = newConnections;\n let oldConnections = yield (0,_FindConnectionsOfCompositionBulkInMemory__WEBPACK_IMPORTED_MODULE_3__.FindConnectionsOfCompositionsBulkInMemory)(conceptIds);\n //CheckForConnectionDeletionWithIds(connectionIds,oldConnections);\n let compositions = {};\n for (let i = 0; i < conceptIds.length; i++) {\n let comp = yield (0,_GetComposition__WEBPACK_IMPORTED_MODULE_4__.GetCompositionWithIdFromMemory)(conceptIds[i]);\n compositions[conceptIds[i]] = comp;\n }\n return compositions;\n });\n}\n/**\n * ## Format is dictionary with key as concept id and value as data (json) ##\n * This function converts the conceptIds and internal connectionIds to compositions format with index(conceptId).\n * @param conceptIds This is the list of concept ids that need to be converted to compositions.\n * @param connectionIds These are the internal connectionIds that need to be passed to create the compositions.\n * @returns dictionary of compositions created from the passed conceptIds and connectionIds with conceptId as its index .\n */\nfunction GetCompositionFromConnectionsWithIndex() {\n return __awaiter(this, arguments, void 0, function* (conceptIds = [], connectionIds = []) {\n let newConnections = yield (0,_Api_GetConnectionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionBulk)(connectionIds);\n let myNewConnections = newConnections;\n let oldConnections = yield (0,_FindConnectionsOfCompositionBulkInMemory__WEBPACK_IMPORTED_MODULE_3__.FindConnectionsOfCompositionsBulkInMemory)(conceptIds);\n //CheckForConnectionDeletionWithIds(connectionIds,oldConnections);\n let compositions = {};\n for (let i = 0; i < conceptIds.length; i++) {\n let comp = yield (0,_GetComposition__WEBPACK_IMPORTED_MODULE_4__.GetCompositionFromMemory)(conceptIds[i]);\n compositions[conceptIds[i]] = comp;\n }\n return compositions;\n });\n}\n/**\n * ## FORMAT DATAIDDATE ##\n * This is just a different version of GetCompositionFromConnectionsWithDataId, This has the added functionality that\n * it also prints out internal connections.\n * This function converts the conceptIds and internal connectionIds to compositions in data-Id format.\n * @param conceptIds This is the list of concept ids that need to be converted to compositions.\n * @param connectionIds These are the internal connectionIds that need to be passed to create the compositions.\n * @returns list of compositions created from the passed conceptIds and connectionIds.\n */\nfunction GetCompositionFromConnectionsWithIndexFromConnections() {\n return __awaiter(this, arguments, void 0, function* (conceptIds = [], connectionIds = []) {\n if (_app__WEBPACK_IMPORTED_MODULE_2__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_2__.sendMessage)('GetCompositionFromConnectionsWithIndexFromConnections', { conceptIds, connectionIds });\n return res.data;\n }\n catch (error) {\n console.error('GetCompositionFromConnectionsWithIndexFromConnections error sw: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_2__.handleServiceWorkerException)(error);\n }\n }\n let newConnections = yield (0,_Api_GetConnectionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionBulk)(connectionIds);\n //CheckForConnectionDeletionWithIds(connectionIds,oldConnections);\n let compositions = [];\n for (let i = 0; i < conceptIds.length; i++) {\n let comp = yield (0,_GetComposition__WEBPACK_IMPORTED_MODULE_4__.GetCompositionFromMemoryWithConnections)(conceptIds[i], newConnections);\n compositions[conceptIds[i]] = comp;\n }\n return compositions;\n });\n}\n/**\n * Used to prefetch all the connections and their related concepts.\n * @param connectionIds these are the connection ids that are used to fetch all the connections and also their related concepts.\n * @returns all the connections that are passed as ids.\n */\nfunction GetConnectionDataPrefetch(connectionIds) {\n var arguments_3 = arguments;\n return __awaiter(this, void 0, void 0, function* () {\n _app__WEBPACK_IMPORTED_MODULE_2__.Logger.logfunction(GetConnectionDataPrefetch, arguments_3);\n if (_app__WEBPACK_IMPORTED_MODULE_2__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_2__.sendMessage)('GetConnectionDataPrefetch', { connectionIds });\n return res.data;\n }\n catch (error) {\n console.error('GetConnectionDataPrefetch error sw: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_2__.handleServiceWorkerException)(error);\n }\n }\n let remainingConnections = [];\n let connectionsAll = [];\n let remainingIds = {};\n for (let i = 0; i < connectionIds.length; i++) {\n let connection = yield _app__WEBPACK_IMPORTED_MODULE_2__.ConnectionData.GetConnection(connectionIds[i]);\n // console.log(\"this is the connection fetch\", connection);\n if (connection.id == 0) {\n remainingConnections.push(connectionIds[i]);\n }\n else {\n connectionsAll.push(connection);\n }\n }\n for (let i = 0; i < remainingConnections.length; i++) {\n remainingIds[connectionIds[i]] = false;\n }\n //await ConnectionData.GetConnectionBulkData(connectionIds, connectionsAll, remainingIds);\n // for(let key in remainingIds){\n // if(remainingIds[key] == false){\n // remainingConnections.push(Number(key));\n // }\n // }\n // remainingConnections = connectionIds;\n let prefetchConcepts = [];\n let connectionsAllLocal = yield (0,_Api_GetConnectionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionBulk)(remainingConnections);\n connectionsAll = [...connectionsAll, ...connectionsAllLocal];\n for (let j = 0; j < connectionsAll.length; j++) {\n prefetchConcepts.push(connectionsAll[j].ofTheConceptId);\n prefetchConcepts.push(connectionsAll[j].toTheConceptId);\n prefetchConcepts.push(connectionsAll[j].typeId);\n }\n yield (0,_app__WEBPACK_IMPORTED_MODULE_2__.GetConceptBulk)(prefetchConcepts);\n return connectionsAll;\n });\n}\n/**\n * ## Format DATAIDDATE ##\n * This function converts the conceptIds and internal connections to create compositions.\n * Format is of a dictionary with ids as the key and value is the composition data.\n * @param conceptIds these are the concept ids that need to be fetched to create their compositions\n * @param connections these are the connections that are used to create the structure.\n * @returns a dictionary / object that has key as their conceptId and the value as their composition object.\n */\nfunction GetCompositionFromConnectionsWithDataIdInObject() {\n var arguments_4 = arguments;\n return __awaiter(this, arguments, void 0, function* (conceptIds = [], connections = []) {\n _app__WEBPACK_IMPORTED_MODULE_2__.Logger.logfunction(GetCompositionFromConnectionsWithDataIdInObject, arguments_4);\n // get all the connections that are not available in memory from the api.\n yield (0,_Api_GetConnectionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionBulk)(connections);\n // create a list of compositions from the fetched concepts and connections.\n let compositions = {};\n for (let i = 0; i < conceptIds.length; i++) {\n let comp = yield (0,_GetComposition__WEBPACK_IMPORTED_MODULE_4__.GetCompositionWithIdFromMemory)(conceptIds[i]);\n compositions[conceptIds[i]] = comp;\n }\n return compositions;\n });\n}\n/**\n * ## Format DATAIDDATE ##\n * ## duplicate ##\n * This function converts the conceptIds and internal connections to create compositions.\n * @param conceptIds these are the concept ids that need to be fetched to create their compositions\n * @param connections these are the connections that are used to create the structure.\n * @returns a dictionary / object that has key as their conceptId and the value as their composition object.\n */\nfunction GetCompositionFromConnectionsWithDataIdInObjectNew() {\n return __awaiter(this, arguments, void 0, function* (conceptIds = [], connections = []) {\n // get all the connections that are not available in memory from the api.\n yield (0,_Api_GetConnectionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionBulk)(connections);\n // create a list of compositions from the fetched concepts and connections.\n let compositions = {};\n for (let i = 0; i < conceptIds.length; i++) {\n let comp = yield (0,_GetComposition__WEBPACK_IMPORTED_MODULE_4__.GetCompositionWithIdFromMemoryNew)(conceptIds[i]);\n compositions[conceptIds[i]] = comp;\n }\n return compositions;\n });\n}\n/**\n * ## Format justdata ##\n * This function converts the conceptIds and internal connections to create compositions.\n * @param conceptIds these are the concept ids that need to be fetched to create their compositions\n * @param connections these are the connections that are used to create the structure.\n * @returns a dictionary / object that has key as their conceptId and the value as their composition object.\n */\nfunction GetCompositionFromConnectionsInObject() {\n return __awaiter(this, arguments, void 0, function* (conceptIds = [], connections = []) {\n // get all the connections that are not available in memory from the api.\n yield (0,_Api_GetConnectionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionBulk)(connections);\n // create a list of compositions from the fetched concepts and connections.\n let compositions = {};\n for (let i = 0; i < conceptIds.length; i++) {\n let comp = yield (0,_GetComposition__WEBPACK_IMPORTED_MODULE_4__.GetCompositionFromMemory)(conceptIds[i]);\n compositions[conceptIds[i]] = comp;\n }\n return compositions;\n });\n}\n/**\n * ## Format Normal ##\n * This function converts the conceptIds and internal connections to create compositions.\n * @param conceptIds these are the concept ids that need to be fetched to create their compositions\n * @param connections these are the connections that are used to create the structure.\n * @returns a dictionary / object that has key as their conceptId and the value as their composition object.\n */\nfunction GetCompositionFromConnectionsInObjectNormal() {\n return __awaiter(this, arguments, void 0, function* (conceptIds = [], connections = []) {\n // get all the connections that are not available in memory from the api.\n yield (0,_Api_GetConnectionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionBulk)(connections);\n // create a list of compositions from the fetched concepts and connections.\n let compositions = {};\n for (let i = 0; i < conceptIds.length; i++) {\n let comp = yield (0,_GetComposition__WEBPACK_IMPORTED_MODULE_4__.GetCompositionFromMemoryNormal)(conceptIds[i]);\n compositions[conceptIds[i]] = comp;\n console.log(\"this is the normal data\", conceptIds[i], comp);\n }\n return compositions;\n });\n}\n\n\n//# sourceURL=webpack://mftsccs-browser/./src/Services/GetCompositionBulk.ts?");
1427
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ GetCompositionBulk: () => (/* binding */ GetCompositionBulk),\n/* harmony export */ GetCompositionBulkWithDataId: () => (/* binding */ GetCompositionBulkWithDataId),\n/* harmony export */ GetCompositionFromConnectionsInObject: () => (/* binding */ GetCompositionFromConnectionsInObject),\n/* harmony export */ GetCompositionFromConnectionsInObjectNormal: () => (/* binding */ GetCompositionFromConnectionsInObjectNormal),\n/* harmony export */ GetCompositionFromConnectionsWithDataId: () => (/* binding */ GetCompositionFromConnectionsWithDataId),\n/* harmony export */ GetCompositionFromConnectionsWithDataIdFromConnections: () => (/* binding */ GetCompositionFromConnectionsWithDataIdFromConnections),\n/* harmony export */ GetCompositionFromConnectionsWithDataIdInObject: () => (/* binding */ GetCompositionFromConnectionsWithDataIdInObject),\n/* harmony export */ GetCompositionFromConnectionsWithDataIdInObjectNew: () => (/* binding */ GetCompositionFromConnectionsWithDataIdInObjectNew),\n/* harmony export */ GetCompositionFromConnectionsWithDataIdIndex: () => (/* binding */ GetCompositionFromConnectionsWithDataIdIndex),\n/* harmony export */ GetCompositionFromConnectionsWithIndex: () => (/* binding */ GetCompositionFromConnectionsWithIndex),\n/* harmony export */ GetCompositionFromConnectionsWithIndexFromConnections: () => (/* binding */ GetCompositionFromConnectionsWithIndexFromConnections),\n/* harmony export */ GetConnectionDataPrefetch: () => (/* binding */ GetConnectionDataPrefetch)\n/* harmony export */ });\n/* harmony import */ var _Api_GetAllConnectionsOfCompositionBulk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Api/GetAllConnectionsOfCompositionBulk */ \"./src/Api/GetAllConnectionsOfCompositionBulk.ts\");\n/* harmony import */ var _Api_GetConnectionBulk__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Api/GetConnectionBulk */ \"./src/Api/GetConnectionBulk.ts\");\n/* harmony import */ var _app__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../app */ \"./src/app.ts\");\n/* harmony import */ var _FindConnectionsOfCompositionBulkInMemory__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./FindConnectionsOfCompositionBulkInMemory */ \"./src/Services/FindConnectionsOfCompositionBulkInMemory.ts\");\n/* harmony import */ var _GetComposition__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./GetComposition */ \"./src/Services/GetComposition.ts\");\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n\n\n\n\n\n/**\n * ## Format JUSTDATA ##\n * Function converts the conceptIds to json (compositions)\n * This function takes in the conceptIds and returns a list of compositions related to those concepts.\n * @param conceptIds list of concept ids that are compositions.\n * @returns compositions\n */\nfunction GetCompositionBulk() {\n return __awaiter(this, arguments, void 0, function* (conceptIds = []) {\n yield (0,_Api_GetAllConnectionsOfCompositionBulk__WEBPACK_IMPORTED_MODULE_0__.GetAllConnectionsOfCompositionBulk)(conceptIds);\n let compositions = [];\n for (let i = 0; i < conceptIds.length; i++) {\n let comp = yield (0,_GetComposition__WEBPACK_IMPORTED_MODULE_4__.GetCompositionFromMemory)(conceptIds[i]);\n compositions.push(comp);\n }\n return compositions;\n });\n}\n/**\n * ## FORMAT DATAIDDATE ##\n * Function converts the conceptIds to json (compositions)\n * @param conceptIds this is the list of concept ids that should be converted to compostions in data - id format.\n * @returns list of compositions in the data - id format.\n */\nfunction GetCompositionBulkWithDataId() {\n return __awaiter(this, arguments, void 0, function* (conceptIds = []) {\n yield (0,_Api_GetAllConnectionsOfCompositionBulk__WEBPACK_IMPORTED_MODULE_0__.GetAllConnectionsOfCompositionBulk)(conceptIds);\n let compositions = [];\n for (let i = 0; i < conceptIds.length; i++) {\n let comp = yield (0,_GetComposition__WEBPACK_IMPORTED_MODULE_4__.GetCompositionWithIdFromMemory)(conceptIds[i]);\n compositions.push(comp);\n }\n return compositions;\n });\n}\n/**\n * ## FORMAT DATAIDDATE ##\n * This function converts the conceptIds and internal connectionIds to compositions in data-Id format.\n * @param conceptIds This is the list of concept ids that need to be converted to compositions.\n * @param connectionIds These are the internal connectionIds that need to be passed to create the compositions.\n * @returns list of compositions created from the passed conceptIds and connectionIds.\n */\nfunction GetCompositionFromConnectionsWithDataId() {\n var arguments_1 = arguments;\n return __awaiter(this, arguments, void 0, function* (conceptIds = [], connectionIds = []) {\n _app__WEBPACK_IMPORTED_MODULE_2__.Logger.logfunction(GetCompositionFromConnectionsWithDataId, arguments_1);\n if (_app__WEBPACK_IMPORTED_MODULE_2__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_2__.sendMessage)('GetCompositionFromConnectionsWithDataId', { conceptIds, connectionIds });\n return res.data;\n }\n catch (error) {\n console.error('GetCompositionFromConnectionsWithDataId error sw: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_2__.handleServiceWorkerException)(error);\n }\n }\n // let newConnections = await GetConnectionBulk(connectionIds);\n // let oldConnections = await FindConnectionsOfCompositionsBulkInMemory(conceptIds);\n //CheckForConnectionDeletionWithIds(connectionIds,oldConnections);\n let compositions = [];\n for (let i = 0; i < conceptIds.length; i++) {\n let comp = yield (0,_GetComposition__WEBPACK_IMPORTED_MODULE_4__.GetCompositionWithIdFromMemory)(conceptIds[i]);\n compositions.push(comp);\n }\n return compositions;\n });\n}\n/**\n * ## FORMAT DATAIDDATE ##\n * This is just a different version of GetCompositionFromConnectionsWithDataId, This has the added functionality that\n * it also prints out internal connections.\n * This function converts the conceptIds and internal connectionIds to compositions in data-Id format.\n * @param conceptIds This is the list of concept ids that need to be converted to compositions.\n * @param connectionIds These are the internal connectionIds that need to be passed to create the compositions.\n * @returns list of compositions created from the passed conceptIds and connectionIds.\n */\nfunction GetCompositionFromConnectionsWithDataIdFromConnections() {\n var arguments_2 = arguments;\n return __awaiter(this, arguments, void 0, function* (conceptIds = [], connectionIds = []) {\n _app__WEBPACK_IMPORTED_MODULE_2__.Logger.logfunction(GetCompositionFromConnectionsWithDataIdFromConnections, arguments_2);\n if (_app__WEBPACK_IMPORTED_MODULE_2__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_2__.sendMessage)('GetCompositionFromConnectionsWithDataIdFromConnections', { conceptIds, connectionIds });\n return res.data;\n }\n catch (error) {\n console.error('GetCompositionFromConnectionsWithDataIdFromConnections error sw: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_2__.handleServiceWorkerException)(error);\n }\n }\n let newConnections = yield (0,_Api_GetConnectionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionBulk)(connectionIds);\n //CheckForConnectionDeletionWithIds(connectionIds,oldConnections);\n let compositions = [];\n for (let i = 0; i < conceptIds.length; i++) {\n let comp = yield (0,_GetComposition__WEBPACK_IMPORTED_MODULE_4__.GetCompositionWithIdFromMemoryFromConnection)(conceptIds[i], newConnections);\n compositions.push(comp);\n }\n return compositions;\n });\n}\n/**\n * ## Format DATAIDDATE ##\n * This function converts the conceptIds and internal connectionIds to compositions in data-Id format with index(conceptId).\n * @param conceptIds This is the list of concept ids that need to be converted to compositions.\n * @param connectionIds These are the internal connectionIds that need to be passed to create the compositions.\n * @returns dictionary of compositions created from the passed conceptIds and connectionIds with conceptId as its index .\n */\nfunction GetCompositionFromConnectionsWithDataIdIndex() {\n var arguments_3 = arguments;\n return __awaiter(this, arguments, void 0, function* (conceptIds = [], connectionIds = []) {\n _app__WEBPACK_IMPORTED_MODULE_2__.Logger.logfunction(GetCompositionFromConnectionsWithDataIdIndex, arguments_3);\n if (_app__WEBPACK_IMPORTED_MODULE_2__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_2__.sendMessage)('GetCompositionFromConnectionsWithDataIdIndex', { conceptIds, connectionIds });\n return res.data;\n }\n catch (error) {\n console.error('GetCompositionFromConnectionsWithDataIdIndex error sw: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_2__.handleServiceWorkerException)(error);\n }\n }\n let newConnections = yield (0,_Api_GetConnectionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionBulk)(connectionIds);\n let myNewConnections = newConnections;\n let oldConnections = yield (0,_FindConnectionsOfCompositionBulkInMemory__WEBPACK_IMPORTED_MODULE_3__.FindConnectionsOfCompositionsBulkInMemory)(conceptIds);\n //CheckForConnectionDeletionWithIds(connectionIds,oldConnections);\n let compositions = {};\n for (let i = 0; i < conceptIds.length; i++) {\n let comp = yield (0,_GetComposition__WEBPACK_IMPORTED_MODULE_4__.GetCompositionWithIdFromMemory)(conceptIds[i]);\n compositions[conceptIds[i]] = comp;\n }\n return compositions;\n });\n}\n/**\n * ## Format is dictionary with key as concept id and value as data (json) ##\n * This function converts the conceptIds and internal connectionIds to compositions format with index(conceptId).\n * @param conceptIds This is the list of concept ids that need to be converted to compositions.\n * @param connectionIds These are the internal connectionIds that need to be passed to create the compositions.\n * @returns dictionary of compositions created from the passed conceptIds and connectionIds with conceptId as its index .\n */\nfunction GetCompositionFromConnectionsWithIndex() {\n return __awaiter(this, arguments, void 0, function* (conceptIds = [], connectionIds = []) {\n let newConnections = yield (0,_Api_GetConnectionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionBulk)(connectionIds);\n let myNewConnections = newConnections;\n let oldConnections = yield (0,_FindConnectionsOfCompositionBulkInMemory__WEBPACK_IMPORTED_MODULE_3__.FindConnectionsOfCompositionsBulkInMemory)(conceptIds);\n //CheckForConnectionDeletionWithIds(connectionIds,oldConnections);\n let compositions = {};\n for (let i = 0; i < conceptIds.length; i++) {\n let comp = yield (0,_GetComposition__WEBPACK_IMPORTED_MODULE_4__.GetCompositionFromMemory)(conceptIds[i]);\n compositions[conceptIds[i]] = comp;\n }\n return compositions;\n });\n}\n/**\n * ## FORMAT DATAIDDATE ##\n * This is just a different version of GetCompositionFromConnectionsWithDataId, This has the added functionality that\n * it also prints out internal connections.\n * This function converts the conceptIds and internal connectionIds to compositions in data-Id format.\n * @param conceptIds This is the list of concept ids that need to be converted to compositions.\n * @param connectionIds These are the internal connectionIds that need to be passed to create the compositions.\n * @returns list of compositions created from the passed conceptIds and connectionIds.\n */\nfunction GetCompositionFromConnectionsWithIndexFromConnections() {\n return __awaiter(this, arguments, void 0, function* (conceptIds = [], connectionIds = []) {\n if (_app__WEBPACK_IMPORTED_MODULE_2__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_2__.sendMessage)('GetCompositionFromConnectionsWithIndexFromConnections', { conceptIds, connectionIds });\n return res.data;\n }\n catch (error) {\n console.error('GetCompositionFromConnectionsWithIndexFromConnections error sw: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_2__.handleServiceWorkerException)(error);\n }\n }\n let newConnections = yield (0,_Api_GetConnectionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionBulk)(connectionIds);\n //CheckForConnectionDeletionWithIds(connectionIds,oldConnections);\n let compositions = [];\n for (let i = 0; i < conceptIds.length; i++) {\n let comp = yield (0,_GetComposition__WEBPACK_IMPORTED_MODULE_4__.GetCompositionFromMemoryWithConnections)(conceptIds[i], newConnections);\n compositions[conceptIds[i]] = comp;\n }\n return compositions;\n });\n}\n/**\n * Used to prefetch all the connections and their related concepts.\n * @param connectionIds these are the connection ids that are used to fetch all the connections and also their related concepts.\n * @returns all the connections that are passed as ids.\n */\nfunction GetConnectionDataPrefetch(connectionIds) {\n var arguments_4 = arguments;\n return __awaiter(this, void 0, void 0, function* () {\n _app__WEBPACK_IMPORTED_MODULE_2__.Logger.logfunction(GetConnectionDataPrefetch, arguments_4);\n if (_app__WEBPACK_IMPORTED_MODULE_2__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_2__.sendMessage)('GetConnectionDataPrefetch', { connectionIds });\n return res.data;\n }\n catch (error) {\n console.error('GetConnectionDataPrefetch error sw: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_2__.handleServiceWorkerException)(error);\n }\n }\n let remainingConnections = [];\n let connectionsAll = [];\n let remainingIds = {};\n for (let i = 0; i < connectionIds.length; i++) {\n let connection = yield _app__WEBPACK_IMPORTED_MODULE_2__.ConnectionData.GetConnection(connectionIds[i]);\n // console.log(\"this is the connection fetch\", connection);\n if (connection.id == 0) {\n remainingConnections.push(connectionIds[i]);\n }\n else {\n connectionsAll.push(connection);\n }\n }\n for (let i = 0; i < remainingConnections.length; i++) {\n remainingIds[connectionIds[i]] = false;\n }\n //await ConnectionData.GetConnectionBulkData(connectionIds, connectionsAll, remainingIds);\n // for(let key in remainingIds){\n // if(remainingIds[key] == false){\n // remainingConnections.push(Number(key));\n // }\n // }\n // remainingConnections = connectionIds;\n let prefetchConcepts = [];\n let connectionsAllLocal = yield (0,_Api_GetConnectionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionBulk)(remainingConnections);\n connectionsAll = [...connectionsAll, ...connectionsAllLocal];\n for (let j = 0; j < connectionsAll.length; j++) {\n prefetchConcepts.push(connectionsAll[j].ofTheConceptId);\n prefetchConcepts.push(connectionsAll[j].toTheConceptId);\n prefetchConcepts.push(connectionsAll[j].typeId);\n }\n yield (0,_app__WEBPACK_IMPORTED_MODULE_2__.GetConceptBulk)(prefetchConcepts);\n return connectionsAll;\n });\n}\n/**\n * ## Format DATAIDDATE ##\n * This function converts the conceptIds and internal connections to create compositions.\n * Format is of a dictionary with ids as the key and value is the composition data.\n * @param conceptIds these are the concept ids that need to be fetched to create their compositions\n * @param connections these are the connections that are used to create the structure.\n * @returns a dictionary / object that has key as their conceptId and the value as their composition object.\n */\nfunction GetCompositionFromConnectionsWithDataIdInObject() {\n var arguments_5 = arguments;\n return __awaiter(this, arguments, void 0, function* (conceptIds = [], connections = []) {\n _app__WEBPACK_IMPORTED_MODULE_2__.Logger.logfunction(GetCompositionFromConnectionsWithDataIdInObject, arguments_5);\n // get all the connections that are not available in memory from the api.\n yield (0,_Api_GetConnectionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionBulk)(connections);\n // create a list of compositions from the fetched concepts and connections.\n let compositions = {};\n for (let i = 0; i < conceptIds.length; i++) {\n let comp = yield (0,_GetComposition__WEBPACK_IMPORTED_MODULE_4__.GetCompositionWithIdFromMemory)(conceptIds[i]);\n compositions[conceptIds[i]] = comp;\n }\n return compositions;\n });\n}\n/**\n * ## Format DATAIDDATE ##\n * ## duplicate ##\n * This function converts the conceptIds and internal connections to create compositions.\n * @param conceptIds these are the concept ids that need to be fetched to create their compositions\n * @param connections these are the connections that are used to create the structure.\n * @returns a dictionary / object that has key as their conceptId and the value as their composition object.\n */\nfunction GetCompositionFromConnectionsWithDataIdInObjectNew() {\n return __awaiter(this, arguments, void 0, function* (conceptIds = [], connections = []) {\n // get all the connections that are not available in memory from the api.\n yield (0,_Api_GetConnectionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionBulk)(connections);\n // create a list of compositions from the fetched concepts and connections.\n let compositions = {};\n for (let i = 0; i < conceptIds.length; i++) {\n let comp = yield (0,_GetComposition__WEBPACK_IMPORTED_MODULE_4__.GetCompositionWithIdFromMemoryNew)(conceptIds[i]);\n compositions[conceptIds[i]] = comp;\n }\n return compositions;\n });\n}\n/**\n * ## Format justdata ##\n * This function converts the conceptIds and internal connections to create compositions.\n * @param conceptIds these are the concept ids that need to be fetched to create their compositions\n * @param connections these are the connections that are used to create the structure.\n * @returns a dictionary / object that has key as their conceptId and the value as their composition object.\n */\nfunction GetCompositionFromConnectionsInObject() {\n return __awaiter(this, arguments, void 0, function* (conceptIds = [], connections = []) {\n // get all the connections that are not available in memory from the api.\n yield (0,_Api_GetConnectionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionBulk)(connections);\n // create a list of compositions from the fetched concepts and connections.\n let compositions = {};\n for (let i = 0; i < conceptIds.length; i++) {\n let comp = yield (0,_GetComposition__WEBPACK_IMPORTED_MODULE_4__.GetCompositionFromMemory)(conceptIds[i]);\n compositions[conceptIds[i]] = comp;\n }\n return compositions;\n });\n}\n/**\n * ## Format Normal ##\n * This function converts the conceptIds and internal connections to create compositions.\n * @param conceptIds these are the concept ids that need to be fetched to create their compositions\n * @param connections these are the connections that are used to create the structure.\n * @returns a dictionary / object that has key as their conceptId and the value as their composition object.\n */\nfunction GetCompositionFromConnectionsInObjectNormal() {\n return __awaiter(this, arguments, void 0, function* (conceptIds = [], connections = []) {\n // get all the connections that are not available in memory from the api.\n yield (0,_Api_GetConnectionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionBulk)(connections);\n // create a list of compositions from the fetched concepts and connections.\n let compositions = {};\n for (let i = 0; i < conceptIds.length; i++) {\n let comp = yield (0,_GetComposition__WEBPACK_IMPORTED_MODULE_4__.GetCompositionFromMemoryNormal)(conceptIds[i]);\n compositions[conceptIds[i]] = comp;\n console.log(\"this is the normal data\", conceptIds[i], comp);\n }\n return compositions;\n });\n}\n\n\n//# sourceURL=webpack://mftsccs-browser/./src/Services/GetCompositionBulk.ts?");
1428
1428
 
1429
1429
  /***/ }),
1430
1430
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mftsccs-browser",
3
- "version": "3.0.1-beta",
3
+ "version": "3.0.2-beta",
4
4
  "environment": "production",
5
5
  "description": "Full Pack of concept and connection system",
6
6
  "main": "dist/main.bundle.js",