{"remainingRequest":"/home/cmiss/Jenkins/workspace/mapintegratedvuer/node_modules/thread-loader/dist/cjs.js!/home/cmiss/Jenkins/workspace/mapintegratedvuer/node_modules/babel-loader/lib/index.js!/home/cmiss/Jenkins/workspace/mapintegratedvuer/node_modules/eslint-loader/index.js??ref--14-0!/home/cmiss/Jenkins/workspace/mapintegratedvuer/src/components/scripts/utilities.js","dependencies":[{"path":"/home/cmiss/Jenkins/workspace/mapintegratedvuer/src/components/scripts/utilities.js","mtime":1691447163859},{"path":"/home/cmiss/Jenkins/workspace/mapintegratedvuer/babel.config.js","mtime":1684261475125},{"path":"/home/cmiss/Jenkins/workspace/mapintegratedvuer/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/home/cmiss/Jenkins/workspace/mapintegratedvuer/node_modules/thread-loader/dist/cjs.js","mtime":499162500000},{"path":"/home/cmiss/Jenkins/workspace/mapintegratedvuer/node_modules/babel-loader/lib/index.js","mtime":456789000000},{"path":"/home/cmiss/Jenkins/workspace/mapintegratedvuer/node_modules/eslint-loader/index.js","mtime":499162500000}],"contextDependencies":[],"result":[{"type":"Buffer","data":"base64:dmFyIF9yZWdlbmVyYXRvclJ1bnRpbWUgPSByZXF1aXJlKCIvaG9tZS9jbWlzcy9KZW5raW5zL3dvcmtzcGFjZS9tYXBpbnRlZ3JhdGVkdnVlci9ub2RlX21vZHVsZXMvQGJhYmVsL3J1bnRpbWUvaGVscGVycy9yZWdlbmVyYXRvclJ1bnRpbWUuanMiKS5kZWZhdWx0Owp2YXIgX2FzeW5jVG9HZW5lcmF0b3IgPSByZXF1aXJlKCIvaG9tZS9jbWlzcy9KZW5raW5zL3dvcmtzcGFjZS9tYXBpbnRlZ3JhdGVkdnVlci9ub2RlX21vZHVsZXMvQGJhYmVsL3J1bnRpbWUvaGVscGVycy9hc3luY1RvR2VuZXJhdG9yLmpzIikuZGVmYXVsdDsKcmVxdWlyZSgiY29yZS1qcy9tb2R1bGVzL2VzLmFycmF5Lml0ZXJhdG9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F9jYWxsZWUodHlwZSwgc3BhcmNBcGkpIHsKICAgIHZhciBlbnRyeSwgdXJsOwogICAgcmV0dXJuIF9yZWdlbmVyYXRvclJ1bnRpbWUoKS53cmFwKGZ1bmN0aW9uIF9jYWxsZWUkKF9jb250ZXh0KSB7CiAgICAgIHdoaWxlICgxKSBzd2l0Y2ggKF9jb250ZXh0LnByZXYgPSBfY29udGV4dC5uZXh0KSB7CiAgICAgICAgY2FzZSAwOgogICAgICAgICAgZW50cnkgPSB7fTsKICAgICAgICAgIGlmICghKHR5cGUgPT09ICJBQyIpKSB7CiAgICAgICAgICAgIF9jb250ZXh0Lm5leHQgPSA1OwogICAgICAgICAgICBicmVhazsKICAgICAgICAgIH0KICAgICAgICAgIGVudHJ5ID0gewogICAgICAgICAgICByZXNvdXJjZTogIlJhdCIsCiAgICAgICAgICAgIHR5cGU6ICJNdWx0aUZsYXRtYXAiLAogICAgICAgICAgICBtb2RlOiAibWFpbiIsCiAgICAgICAgICAgIHN0YXRlOiB1bmRlZmluZWQsCiAgICAgICAgICAgIGxhYmVsOiAiIiwKICAgICAgICAgICAgZGlzY292ZXJJZDogdW5kZWZpbmVkCiAgICAgICAgICB9OwogICAgICAgICAgX2NvbnRleHQubmV4dCA9IDE0OwogICAgICAgICAgYnJlYWs7CiAgICAgICAgY2FzZSA1OgogICAgICAgICAgaWYgKCEodHlwZSA9PT0gIkZDIikpIHsKICAgICAgICAgICAgX2NvbnRleHQubmV4dCA9IDk7CiAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgfQogICAgICAgICAgZW50cnkgPSB7CiAgICAgICAgICAgIHJlc291cmNlOiAiRnVuY3Rpb25hbENvbm5lY3Rpdml0eSIsCiAgICAgICAgICAgIHR5cGU6ICJGbGF0bWFwIiwKICAgICAgICAgICAgbW9kZTogIm1haW4iLAogICAgICAgICAgICBzdGF0ZTogdW5kZWZpbmVkLAogICAgICAgICAgICBsYWJlbDogIkZ1bmN0aW9uYWwiLAogICAgICAgICAgICBkaXNjb3ZlcklkOiB1bmRlZmluZWQKICAgICAgICAgIH07CiAgICAgICAgICBfY29udGV4dC5uZXh0ID0gMTQ7CiAgICAgICAgICBicmVhazsKICAgICAgICBjYXNlIDk6CiAgICAgICAgICBpZiAoISh0eXBlID09PSAiM0QiKSkgewogICAgICAgICAgICBfY29udGV4dC5uZXh0ID0gMTQ7CiAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgfQogICAgICAgICAgX2NvbnRleHQubmV4dCA9IDEyOwogICAgICAgICAgcmV0dXJuIGdldEJvZHlTY2FmZm9sZChzcGFyY0FwaSwgImh1bWFuIik7CiAgICAgICAgY2FzZSAxMjoKICAgICAgICAgIHVybCA9IF9jb250ZXh0LnNlbnQ7CiAgICAgICAgICBlbnRyeSA9IHsKICAgICAgICAgICAgcmVzb3VyY2U6IHVybCwKICAgICAgICAgICAgdHlwZTogIlNjYWZmb2xkIiwKICAgICAgICAgICAgbW9kZTogIm1haW4iLAogICAgICAgICAgICBzdGF0ZTogdW5kZWZpbmVkLAogICAgICAgICAgICBsYWJlbDogIkh1bWFuIiwKICAgICAgICAgICAgaXNCb2R5U2NhZmZvbGQ6IHRydWUKICAgICAgICAgIH07CiAgICAgICAgY2FzZSAxNDoKICAgICAgICAgIHJldHVybiBfY29udGV4dC5hYnJ1cHQoInJldHVybiIsIGVudHJ5KTsKICAgICAgICBjYXNlIDE1OgogICAgICAgIGNhc2UgImVuZCI6CiAgICAgICAgICByZXR1cm4gX2NvbnRleHQuc3RvcCgpOwogICAgICB9CiAgICB9LCBfY2FsbGVlKTsKICB9KSk7CiAgcmV0dXJuIGZ1bmN0aW9uIGdldE5ld01hcEVudHJ5KF94LCBfeDIpIHsKICAgIHJldHVybiBfcmVmLmFwcGx5KHRoaXMsIGFyZ3VtZW50cyk7CiAgfTsKfSgpOwoKLyoKICogSW5pdGlhbCBzdGF0ZSBmb3IgdGhlIHNwbGl0IGZsb3cKICovCnZhciBpbml0aWFsU3RhdGUgPSAvKiNfX1BVUkVfXyovZnVuY3Rpb24gKCkgewogIHZhciBfcmVmMiA9IF9hc3luY1RvR2VuZXJhdG9yKCAvKiNfX1BVUkVfXyovX3JlZ2VuZXJhdG9yUnVudGltZSgpLm1hcmsoZnVuY3Rpb24gX2NhbGxlZTIodHlwZSwgc3BhcmNBcGkpIHsKICAgIHZhciBzdGF0ZSwgdXJsOwogICAgcmV0dXJuIF9yZWdlbmVyYXRvclJ1bnRpbWUoKS53cmFwKGZ1bmN0aW9uIF9jYWxsZWUyJChfY29udGV4dDIpIHsKICAgICAgd2hpbGUgKDEpIHN3aXRjaCAoX2NvbnRleHQyLnByZXYgPSBfY29udGV4dDIubmV4dCkgewogICAgICAgIGNhc2UgMDoKICAgICAgICAgIHN0YXRlID0gaW5pdGlhbERlZmF1bHRTdGF0ZSgpOwogICAgICAgICAgaWYgKCEodHlwZSA9PT0gIkZDIikpIHsKICAgICAgICAgICAgX2NvbnRleHQyLm5leHQgPSA4OwogICAgICAgICAgICBicmVhazsKICAgICAgICAgIH0KICAgICAgICAgIHN0YXRlLm1haW5UYWJOYW1lID0gIkZsYXRtYXAiOwogICAgICAgICAgc3RhdGUuZW50cmllc1swXS5yZXNvdXJjZSA9ICJGdW5jdGlvbmFsQ29ubmVjdGl2aXR5IjsKICAgICAgICAgIHN0YXRlLmVudHJpZXNbMF0udHlwZSA9ICJGbGF0bWFwIjsKICAgICAgICAgIHN0YXRlLmVudHJpZXNbMF0ubGFiZWwgPSAiRnVuY3Rpb25hbCI7CiAgICAgICAgICBfY29udGV4dDIubmV4dCA9IDE3OwogICAgICAgICAgYnJlYWs7CiAgICAgICAgY2FzZSA4OgogICAgICAgICAgaWYgKCEodHlwZSA9PT0gIldob2xlQm9keSIpKSB7CiAgICAgICAgICAgIF9jb250ZXh0Mi5uZXh0ID0gMTc7CiAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgfQogICAgICAgICAgX2NvbnRleHQyLm5leHQgPSAxMTsKICAgICAgICAgIHJldHVybiBnZXRCb2R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IjogewogICAgICB0YXhvOiAiTkNCSVRheG9uOjk2ODUiLAogICAgICBpY29uQ2xhc3M6ICJtYXBpY29uLWljb25fY2F0IiwKICAgICAgZGlzcGxheUxhdGVzdENoYW5nZXM6IHRydWUsCiAgICAgIGRpc3BsYXlXYXJuaW5nOiB0cnVlCiAgICB9CiAgfTsKfTsKCi8qCiAqIExvb2sgZm9yIHRoZSBrZXkgaW4gYXZhaWxhYmxlU3BlY2llcyB3aXRoIHRoZSBwcm92aWRlZCBjb25kaXRpb24KICovCnZhciBmaW5kU3BlY2llc0tleSA9IGZ1bmN0aW9uIGZpbmRTcGVjaWVzS2V5KGNvbmRpdGlvbikgewogIGlmIChjb25kaXRpb24pIHsKICAgIHZhciBsaXN0ID0gYXZhaWxhYmxlU3BlY2llcygpOwogICAgZm9yICh2YXIga2V5IGluIGxpc3QpIHsKICAgICAgaWYgKGNvbmRpdGlvbi50YXhvID09PSBsaXN0W2tleV0udGF4bykgewogICAgICAgIGlmIChjb25kaXRpb24uYmlvbG9naWNhbFNleCAmJiBsaXN0W2tleV0uYmlvbG9naWNhbFNleCkgewogICAgICAgICAgaWYgKGNvbmRpdGlvbi5iaW9sb2dpY2FsU2V4ID09PSBsaXN0W2tleV0uYmlvbG9naWNhbFNleCkgcmV0dXJuIGtleTsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgcmV0dXJuIGtleTsKICAgICAgICB9CiAgICAgIH0KICAgIH0KICB9CiAgcmV0dXJuICIiOwp9Owp2YXIgZXh0cmFjdFMzQnVja2V0TmFtZSA9IGZ1bmN0aW9uIGV4dHJhY3RTM0J1Y2tldE5hbWUodXJpKSB7CiAgaWYgKHVyaSkgewogICAgdmFyIHN1YnN0cmluZyA9IHVyaS5zcGxpdCgiLy8iKVsxXTsKICAgIGlmIChzdWJzdHJpbmcpIHsKICAgICAgcmV0dXJuIHN1YnN0cmluZy5zcGxpdCgiLyIpWzBdOwogICAgfQogIH0KICByZXR1cm4gdW5kZWZpbmVkOwp9Owp2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7CiAgICAgICAgICByZXR1cm4gX2NvbnRleHQzLmFicnVwdCgicmV0dXJuIiwgIiIuY29uY2F0KHNwYXJjQXBpLCAiczMtcmVzb3VyY2UvIikuY29uY2F0KGRhdGEuaWQsICIvIikuY29uY2F0KGRhdGEudmVyc2lvbiwgIi9maWxlcy8iKS5jb25jYXQoZGF0YS5wYXRoLCAiP3MzQnVja2V0TmFtZT0iKS5jb25jYXQoYnVja2V0KSk7CiAgICAgICAgY2FzZSAxMToKICAgICAgICAgIGlmICghKHNwZWNpZXMgPT09ICJyYXQiKSkgewogICAgICAgICAgICBfY29udGV4dDMubmV4dCA9IDE1OwogICAgICAgICAgICBicmVhazsKICAgICAgICAgIH0KICAgICAgICAgIHJldHVybiBfY29udGV4dDMuYWJydXB0KCJyZXR1cm4iLCAiaHR0cHM6Ly9tYXBjb3JlLWJ1Y2tldDEuczMudXMtd2VzdC0yLmFtYXpvbmF3cy5jb20vV2hvbGVCb2R5LzMxLU1heS0yMDIxL3JhdEJvZHkvcmF0Qm9keV9zeW5jbWFwX21ldGFkYXRhLmpzb24iKTsKICAgICAgICBjYXNlIDE1OgogICAgICAgICAgaWYgKCEoc3BlY2llcyA9PT0gImh1bWFuIikpIHsKICAgICAgICAgICAgX2NvbnRleHQzLm5leHQgPSAxNzsKICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICB9CiAgICAgICAgICByZXR1cm4gX2NvbnRleHQzLmFicnVwdCgicmV0dXJuIiwgImh0dHBzOi8vbWFwY29yZS1idWNrZXQxLnMzLnVzLXdlc3QtMi5hbWF6b25hd3MuY29tL1dob2xlQm9keS8yNy00LTIzLWh1bWFuL2h1bWFuX2JvZHlfbWV0YWRhdGEuanNvbiIpOwogICAgICAgIGNhc2UgMTc6CiAgICAgICAgY2FzZSAiZW5kIjoKICAgICAgICAgIHJldHVybiBfY29udGV4dDMuc3RvcCgpOwogICAgICB9CiAgICB9LCBfY2FsbGVlMyk7CiAgfSkpOwogIHJldHVybiBmdW5jdGlvbiBnZXRCb2R5U2NhZmZvbGQoX3g1LCBfeDYpIHsKICAgIHJldHVybiBfcmVmMy5hcHBseSh0aGlzLCBhcmd1bWVudHMpOwogIH07Cn0oKTsKZXhwb3J0cy5hdmFpbGFibGVTcGVjaWVzID0gYXZhaWxhYmxlU3BlY2llczsKZXhwb3J0cy5jYXBpdGFsaXNlID0gY2FwaXRhbGlzZTsKZXhwb3J0cy5maW5kU3BlY2llc0tleSA9IGZpbmRTcGVjaWVzS2V5OwpleHBvcnRzLmluaXRpYWxTdGF0ZSA9IGluaXRpYWxTdGF0ZTsKZXhwb3J0cy5pbml0aWFsRGVmYXVsdFN0YXRlID0gaW5pdGlhbERlZmF1bHRTdGF0ZTsKZXhwb3J0cy5nZXRCb2R5U2NhZmZvbGQgPSBnZXRCb2R5U2NhZmZvbGQ7CmV4cG9ydHMuZ2V0TmV3TWFwRW50cnkgPSBnZXROZXdNYXBFbnRyeTs="},{"version":3,"names":["initialDefaultState","mainTabName","zIndex","showDialogIcons","activeDockedId","currentCount","entries","resource","type","mode","id","state","undefined","label","discoverId","sideBarVisibility","search","startUp","getNewMapEntry","_ref","_asyncToGenerator","_regeneratorRuntime","mark","_callee","sparcApi","entry","url","wrap","_callee$","_context","prev","next","getBodyScaffold","sent","isBodyScaffold","abrupt","stop","_x","_x2","apply","arguments","initialState","_ref2","_callee2","_callee2$","_context2","_x3","_x4","capitalise","term","charAt","toUpperCase","slice","availableSpecies","taxo","biologicalSex","iconClass","displayLatestChanges","displayWarning","findSpeciesKey","condition","list","key","extractS3BucketName","uri","substring","split","_ref3","_callee3","species","response","data","bucket","_callee3$","_context3","fetch","concat","ok","json","s3uri","version","path","_x5","_x6","exports"],"sources":["/home/cmiss/Jenkins/workspace/mapintegratedvuer/src/components/scripts/utilities.js"],"sourcesContent":["const initialDefaultState = () => {\n return {\n mainTabName: \"Flatmap\",\n zIndex: 1,\n showDialogIcons: false,\n activeDockedId: 1,\n currentCount: 1,\n entries: [\n {\n resource: \"Rat\",\n type: \"MultiFlatmap\",\n zIndex: 1,\n mode: \"main\",\n id: 1,\n state: undefined,\n label: \"\",\n discoverId: undefined\n }\n ],\n sideBarVisibility: true,\n search: '',\n startUp: true\n };\n}\n\nconst getNewMapEntry = async (type, sparcApi) => {\n let entry = { };\n if (type === \"AC\") {\n entry = {\n resource: \"Rat\",\n type: \"MultiFlatmap\",\n mode: \"main\",\n state: undefined,\n label: \"\",\n discoverId: undefined\n };\n } else if (type === \"FC\") {\n entry = {\n resource: \"FunctionalConnectivity\",\n type: \"Flatmap\",\n mode: \"main\",\n state: undefined,\n label: \"Functional\",\n discoverId: undefined\n }\n } else if (type === \"3D\") {\n const url = await getBodyScaffold(sparcApi, \"human\");\n entry = {\n resource: url,\n type: \"Scaffold\",\n mode: \"main\",\n state: undefined,\n label: \"Human\",\n isBodyScaffold: true\n };\n }\n\n return entry;\n}\n\n/*\n * Initial state for the split flow\n */\nconst initialState = async (type, sparcApi) => {\n const state = initialDefaultState();\n if (type === \"FC\") {\n state.mainTabName = \"Flatmap\";\n state.entries[0].resource = \"FunctionalConnectivity\";\n state.entries[0].type = \"Flatmap\";\n state.entries[0].label = \"Functional\";\n } else if (type === \"WholeBody\") {\n const url = await getBodyScaffold(sparcApi, \"human\");\n state.mainTabName = \"Scaffold\";\n state.entries[0].resource = url;\n state.entries[0].type = \"Scaffold\";\n state.entries[0].label = \"Human\";\n state.entries[0].isBodyScaffold = true;\n }\n\n return state;\n}\n\nconst capitalise = term => {\n if (term)\n return term.charAt(0).toUpperCase() + term.slice(1);\n return term;\n};\n\n/*\n * Provide a list of available species for the flatmap\n */\nconst availableSpecies = () => {\n return {\n \"Human Female\": { taxo: \"NCBITaxon:9606\", biologicalSex: \"PATO:0000383\", iconClass: \"mapicon-icon_human\", displayLatestChanges: true, displayWarning: true },\n \"Human Male\": { taxo: \"NCBITaxon:9606\", biologicalSex: \"PATO:0000384\", iconClass: \"mapicon-icon_human\", displayLatestChanges: true, displayWarning: true },\n \"Rat\": { taxo: \"NCBITaxon:10114\", iconClass: \"mapicon-icon_rat\", displayLatestChanges: true, displayWarning: true },\n \"Mouse\": { taxo: \"NCBITaxon:10090\", iconClass: \"mapicon-icon_mouse\", displayLatestChanges: true, displayWarning: true },\n \"Pig\": { taxo: \"NCBITaxon:9823\", iconClass: \"mapicon-icon_pig\", displayLatestChanges: true, displayWarning: true },\n \"Cat\": { taxo: \"NCBITaxon:9685\", iconClass: \"mapicon-icon_cat\", displayLatestChanges: true, displayWarning: true },\n }\n}\n\n/*\n * Look for the key in availableSpecies with the provided condition\n */\nconst findSpeciesKey = condition => {\n if (condition) {\n const list = availableSpecies();\n for (let key in list) {\n if (condition.taxo === list[key].taxo) {\n if (condition.biologicalSex && list[key].biologicalSex) {\n if (condition.biologicalSex === list[key].biologicalSex)\n return key;\n } else {\n return key;\n }\n }\n }\n }\n return \"\";\n}\n\nconst extractS3BucketName = uri => {\n if (uri) {\n const substring = uri.split(\"//\")[1]\n if (substring) {\n return substring.split(\"/\")[0]\n }\n }\n return undefined\n}\n\nconst getBodyScaffold = async (sparcApi, species) => {\n //Get body scaffold information\n const response = await fetch(`${sparcApi}get_body_scaffold_info/${species}`);\n if (response.ok) {\n const data = await response.json();\n //Construct the url endpoint for downloading the scaffold\n const bucket = extractS3BucketName(data.s3uri);\n return `${sparcApi}s3-resource/${data.id}/${data.version}/files/${data.path}?s3BucketName=${bucket}`;\n } else {\n //Use default url if data is not found for any reason\n if (species === \"rat\") {\n return \"https://mapcore-bucket1.s3.us-west-2.amazonaws.com/WholeBody/31-May-2021/ratBody/ratBody_syncmap_metadata.json\";\n } else if (species === \"human\") {\n return \"https://mapcore-bucket1.s3.us-west-2.amazonaws.com/WholeBody/27-4-23-human/human_body_metadata.json\";\n }\n }\n}\n\nexports.availableSpecies = availableSpecies;\nexports.capitalise = capitalise;\nexports.findSpeciesKey = findSpeciesKey;\nexports.initialState = initialState;\nexports.initialDefaultState = initialDefaultState;\nexports.getBodyScaffold = getBodyScaffold;\nexports.getNew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