{"version":3,"sources":["webpack:///./vue_merge_request_widget/widgets/security_reports/graphql/security_report_merge_request_download_paths.query.graphql","webpack:///./vue_merge_request_widget/widgets/security_reports/mr_widget_security_reports.vue","webpack:///./vue_merge_request_widget/widgets/security_reports/mr_widget_security_reports.vue?a6ef","webpack:///vue_merge_request_widget/widgets/security_reports/mr_widget_security_reports.vue","webpack:///./vue_merge_request_widget/widgets/security_reports/mr_widget_security_reports.vue?c459"],"names":["doc","loc","source","definitionRefs","findOperation","name","i","definitions","length","element","value","forEach","def","refs","Set","collectFragmentReferences","node","kind","add","type","selectionSet","selections","selection","variableDefinitions","module","exports","operationName","newDoc","hasOwnProperty","opRefs","allRefs","newRefs","refName","size","prevRefs","has","childRef","op","push","oneQuery","components","MrWidget","GlDisclosureDropdown","i18n","apiError","s__","scansHaveRun","props","mr","Object","required","data","hasError","reportTypes","apollo","reportArtifacts","query","securityReportMergeRequestDownloadPathsQuery","variables","projectPath","targetProjectFullPath","iid","String","$options","map","r","toUpperCase","update","_data$project","artifacts","project","mergeRequest","headPipeline","jobs","nodes","reportType","_reportType$artifacts","artifact","fileType","id","path","downloadPath","error","computed","hasSecurityReports","summary","title","listboxOptions","filter","text","sprintf","artifactName","toLowerCase","href","extraAttrs","download","rel","methods","handleIsLoading","isLoading","widgetHelpPopover","options","content","learnMorePath","helpPagePath","anchor","icons","EXTENSION_ICONS","component","_vm","this","_c","_self","attrs","warning","on","scopedSlots","_u","key","fn","staticClass","proxy","_e"],"mappings":"0EACI,IAAIA,EAAM,CAAC,KAAO,WAAW,YAAc,CAAC,CAAC,KAAO,sBAAsB,UAAY,QAAQ,KAAO,CAAC,KAAO,OAAO,MAAQ,gCAAgC,oBAAsB,CAAC,CAAC,KAAO,qBAAqB,SAAW,CAAC,KAAO,WAAW,KAAO,CAAC,KAAO,OAAO,MAAQ,gBAAgB,KAAO,CAAC,KAAO,cAAc,KAAO,CAAC,KAAO,YAAY,KAAO,CAAC,KAAO,OAAO,MAAQ,QAAQ,WAA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eAAAnF,EAAA,KAAA2E,IAAA,OAAA3E,GAAA2E,KACAhB,KAAA,eAAA3D,EAAA,KAAA2E,EAAA,SAAAF,IAUA,OACAW,KAVAX,EACAY,kBAAA7C,cAAA,2DACA8C,aAAAtF,EACAyE,WAAAc,gBAEAF,kBAAA7C,cAAA,6CACA8C,aAAAtF,IAKAwF,KAAAb,EACAc,WAAA,CACAC,SAAA,GACAC,IAAA,kBAMAC,QAAA,CACAC,gBAAAxF,GACA,KAAAyF,UAAAzF,IAGA0F,kBAAA,CACAC,QAAA,CAAAf,MAAAzC,cAAA,mCACAyD,QAAA,CACAb,KAAA5C,cACA,8KAEA0D,cAAAC,YAAA,0DACAC,OAAA,oBAIAC,MAAAC,K,YC7GIC,EAAY,YACd,GHRW,WAAkB,IAAIC,EAAIC,KAAKC,EAAGF,EAAIG,MAAMD,GAAG,OAAQF,EAAIzB,mBAAoB2B,EAAG,YAAY,CAACE,MAAM,CAAC,YAAYJ,EAAIzD,SAAS,aAAayD,EAAI9C,SAASpB,KAAKC,SAAS,mBAAmBiE,EAAI9C,SAAS2C,MAAMQ,QAAQ,cAAcL,EAAI9C,SAAS1D,KAAK,kBAAiB,EAAM,eAAewG,EAAI9C,SAASqC,kBAAkB,QAAUS,EAAIxB,SAAS8B,GAAG,CAAC,aAAaN,EAAIX,iBAAiBkB,YAAYP,EAAIQ,GAAG,CAAC,CAACC,IAAI,iBAAiBC,GAAG,WAAW,MAAO,CAACR,EAAG,yBAAyB,CAACS,YAAY,UAAUP,MAAM,CAAC,KAAO,QAAQ,KAAO,WAAW,MAAQJ,EAAItB,eAAe,eAAc,OAAUkC,OAAM,IAAO,MAAK,EAAM,aAAaZ,EAAIa,OAErmB,IGSpB,EACA,KACA,KACA,MAIa,UAAAd,E","file":"348.57878a53.chunk.js","sourcesContent":["\n var doc = {\"kind\":\"Document\",\"definitions\":[{\"kind\":\"OperationDefinition\",\"operation\":\"query\",\"name\":{\"kind\":\"Name\",\"value\":\"securityReportsDownloadPaths\"},\"variableDefinitions\":[{\"kind\":\"VariableDefinition\",\"variable\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"projectPath\"}},\"type\":{\"kind\":\"NonNullType\",\"type\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"ID\"}}},\"directives\":[]},{\"kind\":\"VariableDefinition\",\"variable\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"iid\"}},\"type\":{\"kind\":\"NonNullType\",\"type\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"String\"}}},\"directives\":[]},{\"kind\":\"VariableDefinition\",\"variable\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"reportTypes\"}},\"type\":{\"kind\":\"ListType\",\"type\":{\"kind\":\"NonNullType\",\"type\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"SecurityReportTypeEnum\"}}}},\"directives\":[]}],\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"project\"},\"arguments\":[{\"kind\":\"Argument\",\"name\":{\"kind\":\"Name\",\"value\":\"fullPath\"},\"value\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"projectPath\"}}}],\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"mergeRequest\"},\"arguments\":[{\"kind\":\"Argument\",\"name\":{\"kind\":\"Name\",\"value\":\"iid\"},\"value\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"iid\"}}}],\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"headPipeline\"},\"arguments\":[],\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"jobs\"},\"arguments\":[{\"kind\":\"Argument\",\"name\":{\"kind\":\"Name\",\"value\":\"securityReportTypes\"},\"value\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"reportTypes\"}}}],\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"nodes\"},\"arguments\":[],\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"name\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"artifacts\"},\"arguments\":[],\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"nodes\"},\"arguments\":[],\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"downloadPath\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"fileType\"},\"arguments\":[],\"directives\":[]}]}}]}}]}}]}}]}}]}}]}}]}}],\"loc\":{\"start\":0,\"end\":587}};\n doc.loc.source = {\"body\":\"query securityReportsDownloadPaths(\\n $projectPath: ID!\\n $iid: String!\\n $reportTypes: [SecurityReportTypeEnum!]\\n) {\\n project(fullPath: $projectPath) {\\n id\\n mergeRequest(iid: $iid) {\\n id\\n headPipeline {\\n id\\n jobs(securityReportTypes: $reportTypes) {\\n nodes {\\n id\\n name\\n artifacts {\\n # eslint-disable-next-line @graphql-eslint/require-id-when-available\\n nodes {\\n downloadPath\\n fileType\\n }\\n }\\n }\\n }\\n }\\n }\\n }\\n}\\n\",\"name\":\"GraphQL request\",\"locationOffset\":{\"line\":1,\"column\":1}};\n \n\n var names = {};\n function unique(defs) {\n return defs.filter(\n function(def) {\n if (def.kind !== 'FragmentDefinition') return true;\n var name = def.name.value\n if (names[name]) {\n return false;\n } else {\n names[name] = true;\n return true;\n }\n }\n )\n }\n \n\n // Collect any fragment/type references from a node, adding them to the refs Set\n function collectFragmentReferences(node, refs) {\n if (node.kind === \"FragmentSpread\") {\n refs.add(node.name.value);\n } else if (node.kind === \"VariableDefinition\") {\n var type = node.type;\n if (type.kind === \"NamedType\") {\n refs.add(type.name.value);\n }\n }\n\n if (node.selectionSet) {\n node.selectionSet.selections.forEach(function(selection) {\n collectFragmentReferences(selection, refs);\n });\n }\n\n if (node.variableDefinitions) {\n node.variableDefinitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n\n if (node.definitions) {\n node.definitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n }\n\n var definitionRefs = {};\n (function extractReferences() {\n doc.definitions.forEach(function(def) {\n if (def.name) {\n var refs = new Set();\n collectFragmentReferences(def, refs);\n definitionRefs[def.name.value] = refs;\n }\n });\n })();\n\n function findOperation(doc, name) {\n for (var i = 0; i < doc.definitions.length; i++) {\n var element = doc.definitions[i];\n if (element.name && element.name.value == name) {\n return element;\n }\n }\n }\n\n function oneQuery(doc, operationName) {\n // Copy the DocumentNode, but clear out the definitions\n var newDoc = {\n kind: doc.kind,\n definitions: [findOperation(doc, operationName)]\n };\n if (doc.hasOwnProperty(\"loc\")) {\n newDoc.loc = doc.loc;\n }\n\n // Now, for the operation we're running, find any fragments referenced by\n // it or the fragments it references\n var opRefs = definitionRefs[operationName] || new Set();\n var allRefs = new Set();\n var newRefs = new Set();\n\n // IE 11 doesn't support \"new Set(iterable)\", so we add the members of opRefs to newRefs one by one\n opRefs.forEach(function(refName) {\n newRefs.add(refName);\n });\n\n while (newRefs.size > 0) {\n var prevRefs = newRefs;\n newRefs = new Set();\n\n prevRefs.forEach(function(refName) {\n if (!allRefs.has(refName)) {\n allRefs.add(refName);\n var childRefs = definitionRefs[refName] || new Set();\n childRefs.forEach(function(childRef) {\n newRefs.add(childRef);\n });\n }\n });\n }\n\n allRefs.forEach(function(refName) {\n var op = findOperation(doc, refName);\n if (op) {\n newDoc.definitions.push(op);\n }\n });\n\n return newDoc;\n }\n \n module.exports = doc;\n \n module.exports[\"securityReportsDownloadPaths\"] = oneQuery(doc, \"securityReportsDownloadPaths\");\n \n","var render = function render(){var _vm=this,_c=_vm._self._c;return (_vm.hasSecurityReports)?_c('mr-widget',{attrs:{\"has-error\":_vm.hasError,\"error-text\":_vm.$options.i18n.apiError,\"status-icon-name\":_vm.$options.icons.warning,\"widget-name\":_vm.$options.name,\"is-collapsible\":false,\"help-popover\":_vm.$options.widgetHelpPopover,\"summary\":_vm.summary},on:{\"is-loading\":_vm.handleIsLoading},scopedSlots:_vm._u([{key:\"action-buttons\",fn:function(){return [_c('gl-disclosure-dropdown',{staticClass:\"gl-ml-3\",attrs:{\"size\":\"small\",\"icon\":\"download\",\"items\":_vm.listboxOptions,\"fluid-width\":true}})]},proxy:true}],null,false,712221865)}):_vm._e()\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import mod from \"-!../../../../../../node_modules/thread-loader/dist/cjs.js??ref--13-0!../../../../../../node_modules/babel-loader/lib/index.js??ref--13-1!../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./mr_widget_security_reports.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../../../../../node_modules/thread-loader/dist/cjs.js??ref--13-0!../../../../../../node_modules/babel-loader/lib/index.js??ref--13-1!../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./mr_widget_security_reports.vue?vue&type=script&lang=js\"","<script>\nimport { GlDisclosureDropdown } from '@gitlab/ui';\nimport MrWidget from '~/vue_merge_request_widget/components/widget/widget.vue';\nimport { helpPagePath } from '~/helpers/help_page_helper';\nimport { s__, sprintf } from '~/locale';\nimport { EXTENSION_ICONS } from '~/vue_merge_request_widget/constants';\nimport securityReportMergeRequestDownloadPathsQuery from './graphql/security_report_merge_request_download_paths.query.graphql';\n\nexport default {\n name: 'WidgetSecurityReportsCE',\n components: {\n MrWidget,\n GlDisclosureDropdown,\n },\n i18n: {\n apiError: s__(\n 'SecurityReports|Failed to get security report information. Please reload the page or try again later.',\n ),\n scansHaveRun: s__('SecurityReports|Security scans have run'),\n },\n props: {\n mr: {\n type: Object,\n required: true,\n },\n },\n data() {\n return {\n hasError: false,\n };\n },\n reportTypes: ['sast', 'secret_detection'],\n apollo: {\n // eslint-disable-next-line @gitlab/vue-no-undef-apollo-properties\n reportArtifacts: {\n query: securityReportMergeRequestDownloadPathsQuery,\n variables() {\n return {\n projectPath: this.mr.targetProjectFullPath,\n iid: String(this.mr.iid),\n reportTypes: this.$options.reportTypes.map((r) => r.toUpperCase()),\n };\n },\n update(data) {\n const artifacts = [];\n\n (data?.project?.mergeRequest?.headPipeline?.jobs?.nodes || []).forEach((reportType) => {\n reportType.artifacts?.nodes.forEach((artifact) => {\n if (artifact.fileType !== 'TRACE') {\n artifacts.push({\n name: reportType.name,\n id: reportType.id,\n path: artifact.downloadPath,\n fileType: artifact.fileType,\n });\n }\n });\n });\n\n return artifacts;\n },\n error() {\n this.hasError = true;\n },\n },\n },\n computed: {\n artifacts() {\n return this.reportArtifacts || [];\n },\n hasSecurityReports() {\n return this.artifacts.length > 0;\n },\n summary() {\n return { title: this.$options.i18n.scansHaveRun };\n },\n listboxOptions() {\n return this.artifacts\n .filter(({ name, path }) => name && path)\n .map(({ name, path, fileType }) => {\n const text = fileType\n ? sprintf(s__('SecurityReports|Download %{artifactName} (%{fileType})'), {\n artifactName: name,\n fileType: fileType.toLowerCase(),\n })\n : sprintf(s__('SecurityReports|Download %{artifactName}'), {\n artifactName: name,\n });\n\n return {\n text,\n href: path,\n extraAttrs: {\n download: '',\n rel: 'nofollow',\n },\n };\n });\n },\n },\n methods: {\n handleIsLoading(value) {\n this.isLoading = value;\n },\n },\n widgetHelpPopover: {\n options: { title: s__('ciReport|Security scan results') },\n content: {\n text: s__(\n 'ciReport|New vulnerabilities are vulnerabilities that the security scan detects in the merge request that are different to existing vulnerabilities in the default branch.',\n ),\n learnMorePath: helpPagePath('user/application_security/detect/security_scan_results', {\n anchor: 'merge-request',\n }),\n },\n },\n icons: EXTENSION_ICONS,\n};\n</script>\n\n<template>\n <mr-widget\n v-if=\"hasSecurityReports\"\n :has-error=\"hasError\"\n :error-text=\"$options.i18n.apiError\"\n :status-icon-name=\"$options.icons.warning\"\n :widget-name=\"$options.name\"\n :is-collapsible=\"false\"\n :help-popover=\"$options.widgetHelpPopover\"\n :summary=\"summary\"\n @is-loading=\"handleIsLoading\"\n >\n <template #action-buttons>\n <gl-disclosure-dropdown\n class=\"gl-ml-3\"\n size=\"small\"\n icon=\"download\"\n :items=\"listboxOptions\"\n :fluid-width=\"true\"\n />\n </template>\n </mr-widget>\n</template>\n","import { render, staticRenderFns } from \"./mr_widget_security_reports.vue?vue&type=template&id=7661dadf\"\nimport script from \"./mr_widget_security_reports.vue?vue&type=script&lang=js\"\nexport * from \"./mr_widget_security_reports.vue?vue&type=script&lang=js\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports"],"sourceRoot":""}