ethyca-fides 2.65.0rc3__py2.py3-none-any.whl → 2.65.0rc4__py2.py3-none-any.whl

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.

Potentially problematic release.


This version of ethyca-fides might be problematic. Click here for more details.

Files changed (137) hide show
  1. {ethyca_fides-2.65.0rc3.dist-info → ethyca_fides-2.65.0rc4.dist-info}/METADATA +1 -1
  2. {ethyca_fides-2.65.0rc3.dist-info → ethyca_fides-2.65.0rc4.dist-info}/RECORD +132 -131
  3. fides/_version.py +3 -3
  4. fides/ui-build/static/admin/404.html +1 -1
  5. fides/ui-build/static/admin/_next/static/chunks/{3450-1088b1f14a3dc618.js → 3450-fa454e19b478be0e.js} +1 -1
  6. fides/ui-build/static/admin/_next/static/chunks/{3855-abbb601a0115e0e2.js → 3855-6778fadbd6a3e169.js} +1 -1
  7. fides/ui-build/static/admin/_next/static/chunks/{3872-dc8084d7df0f12e5.js → 3872-5092b054e1e8d48d.js} +1 -1
  8. fides/ui-build/static/admin/_next/static/chunks/3988-df456e3154177395.js +1 -0
  9. fides/ui-build/static/admin/_next/static/chunks/4121-2dbe40591a18a2a3.js +1 -0
  10. fides/ui-build/static/admin/_next/static/chunks/{431-cc1200b1bec1e1ad.js → 431-5e066c3f4280b01e.js} +1 -1
  11. fides/ui-build/static/admin/_next/static/chunks/{5309-a7b637d2e3830582.js → 5309-c0a699af15ca45d2.js} +1 -1
  12. fides/ui-build/static/admin/_next/static/chunks/{6662-29c0da492e0686a5.js → 6662-1367a035440c138c.js} +1 -1
  13. fides/ui-build/static/admin/_next/static/chunks/{6882-306b98265a440778.js → 6882-21b3c7cc73643586.js} +1 -1
  14. fides/ui-build/static/admin/_next/static/chunks/{7476-c3951a31cc8e30f4.js → 7476-b804e3f03aa00010.js} +1 -1
  15. fides/ui-build/static/admin/_next/static/chunks/{79-acd3fc646456c35c.js → 79-873e7107578beb6c.js} +1 -1
  16. fides/ui-build/static/admin/_next/static/chunks/{796-231bc790c78485ec.js → 796-5a2c5ed4399a435c.js} +1 -1
  17. fides/ui-build/static/admin/_next/static/chunks/{9046-e28291074efc2b9c.js → 9046-b3943a17d2db3cbc.js} +1 -1
  18. fides/ui-build/static/admin/_next/static/chunks/pages/{_app-3c2c13846cf0246c.js → _app-31acaafcf470cb55.js} +1 -1
  19. fides/ui-build/static/admin/_next/static/chunks/pages/consent/{configure-0bafadd4832888a2.js → configure-f489535409c8aff6.js} +1 -1
  20. fides/ui-build/static/admin/_next/static/chunks/pages/consent/{privacy-experience-2733b87269ad53d6.js → privacy-experience-64e254a949e16215.js} +1 -1
  21. fides/ui-build/static/admin/_next/static/chunks/pages/consent/{privacy-notices-61625c45fdcf931f.js → privacy-notices-50e4f86f6f9089dc.js} +1 -1
  22. fides/ui-build/static/admin/_next/static/chunks/pages/consent/{reporting-60272475cb0770fc.js → reporting-ef4287120cf0c894.js} +1 -1
  23. fides/ui-build/static/admin/_next/static/chunks/pages/data-catalog/[systemId]/projects/{[projectUrn]-0b3847fe39d90f6d.js → [projectUrn]-63c77acea966f4ad.js} +1 -1
  24. fides/ui-build/static/admin/_next/static/chunks/pages/data-catalog/[systemId]/{projects-12f7220f0ef3a50c.js → projects-c2c082623b354269.js} +1 -1
  25. fides/ui-build/static/admin/_next/static/chunks/pages/data-catalog/[systemId]/{resources-d8db234a44a2ddf4.js → resources-7648bbd4f6711e4d.js} +1 -1
  26. fides/ui-build/static/admin/_next/static/chunks/pages/{data-catalog-de21ee9984a0e989.js → data-catalog-4c1b58a83450ca9c.js} +1 -1
  27. fides/ui-build/static/admin/_next/static/chunks/pages/data-discovery/action-center/[monitorId]/{[systemId]-4b1956ba13d00d12.js → [systemId]-85b7f0e9727cb23f.js} +1 -1
  28. fides/ui-build/static/admin/_next/static/chunks/pages/data-discovery/action-center/{[monitorId]-0d09001cbefac14b.js → [monitorId]-9ab0184ba5268163.js} +1 -1
  29. fides/ui-build/static/admin/_next/static/chunks/pages/data-discovery/{action-center-743321764a03e68d.js → action-center-5ecda7668b93c555.js} +1 -1
  30. fides/ui-build/static/admin/_next/static/chunks/pages/data-discovery/{activity-741553e7f5e5dad3.js → activity-2d4639b9f233d06b.js} +1 -1
  31. fides/ui-build/static/admin/_next/static/chunks/pages/{datamap-286a2f95a62eaa92.js → datamap-575a64ac51fe8c45.js} +1 -1
  32. fides/ui-build/static/admin/_next/static/chunks/pages/dataset/[datasetId]/[collectionName]/{[...subfieldNames]-1574f9f99f3fbd4d.js → [...subfieldNames]-fd26d1fa84a48df5.js} +1 -1
  33. fides/ui-build/static/admin/_next/static/chunks/pages/dataset/[datasetId]/{[collectionName]-7137e44d09c4e66f.js → [collectionName]-cc31252c1cdd27cb.js} +1 -1
  34. fides/ui-build/static/admin/_next/static/chunks/pages/dataset/{[datasetId]-4523752f57210b05.js → [datasetId]-a53c5296364f4f31.js} +1 -1
  35. fides/ui-build/static/admin/_next/static/chunks/pages/{dataset-d1191d3fbb953e64.js → dataset-eb53c23b71dd1b7e.js} +1 -1
  36. fides/ui-build/static/admin/_next/static/chunks/pages/integrations/{[id]-c7355ec8b1375390.js → [id]-90bd999dde04d9b0.js} +1 -1
  37. fides/ui-build/static/admin/_next/static/chunks/pages/integrations-fcaac2ee03a775e6.js +1 -0
  38. fides/ui-build/static/admin/_next/static/chunks/pages/{messaging-40fa5eff36a01f41.js → messaging-7056057042ab08f9.js} +1 -1
  39. fides/ui-build/static/admin/_next/static/chunks/pages/privacy-requests/[id]-615d6d5352b78983.js +1 -0
  40. fides/ui-build/static/admin/_next/static/chunks/pages/privacy-requests-4e6af170fcd23f6a.js +1 -0
  41. fides/ui-build/static/admin/_next/static/chunks/pages/reporting/{datamap-d9b31c6172f67b4c.js → datamap-fa7e3b404d0dc510.js} +1 -1
  42. fides/ui-build/static/admin/_next/static/chunks/pages/settings/consent/[configuration_id]/{[purpose_id]-492682d276a487c3.js → [purpose_id]-44d44498e8c89371.js} +1 -1
  43. fides/ui-build/static/admin/_next/static/chunks/pages/settings/{custom-fields-1a7786045d55904c.js → custom-fields-f5fffa0b8fd5f65b.js} +1 -1
  44. fides/ui-build/static/admin/_next/static/chunks/pages/settings/{domain-records-c62f0e6538a0f14f.js → domain-records-63cb4ffa1a310bca.js} +1 -1
  45. fides/ui-build/static/admin/_next/static/chunks/pages/{systems-f23101c2c99a9abf.js → systems-5656b1f6f992a75d.js} +1 -1
  46. fides/ui-build/static/admin/_next/static/{_Fm4x5HeQXsJ2c2T4P7Lj → vicgGTOV5HHGzNQ6RGIBb}/_buildManifest.js +1 -1
  47. fides/ui-build/static/admin/add-systems/manual.html +1 -1
  48. fides/ui-build/static/admin/add-systems/multiple.html +1 -1
  49. fides/ui-build/static/admin/add-systems.html +1 -1
  50. fides/ui-build/static/admin/consent/configure/add-vendors.html +1 -1
  51. fides/ui-build/static/admin/consent/configure.html +1 -1
  52. fides/ui-build/static/admin/consent/privacy-experience/[id].html +1 -1
  53. fides/ui-build/static/admin/consent/privacy-experience/new.html +1 -1
  54. fides/ui-build/static/admin/consent/privacy-experience.html +1 -1
  55. fides/ui-build/static/admin/consent/privacy-notices/[id].html +1 -1
  56. fides/ui-build/static/admin/consent/privacy-notices/new.html +1 -1
  57. fides/ui-build/static/admin/consent/privacy-notices.html +1 -1
  58. fides/ui-build/static/admin/consent/properties.html +1 -1
  59. fides/ui-build/static/admin/consent/reporting.html +1 -1
  60. fides/ui-build/static/admin/consent.html +1 -1
  61. fides/ui-build/static/admin/data-catalog/[systemId]/projects/[projectUrn]/[resourceUrn].html +1 -1
  62. fides/ui-build/static/admin/data-catalog/[systemId]/projects/[projectUrn].html +1 -1
  63. fides/ui-build/static/admin/data-catalog/[systemId]/projects.html +1 -1
  64. fides/ui-build/static/admin/data-catalog/[systemId]/resources/[resourceUrn].html +1 -1
  65. fides/ui-build/static/admin/data-catalog/[systemId]/resources.html +1 -1
  66. fides/ui-build/static/admin/data-catalog.html +1 -1
  67. fides/ui-build/static/admin/data-discovery/action-center/[monitorId]/[systemId].html +1 -1
  68. fides/ui-build/static/admin/data-discovery/action-center/[monitorId].html +1 -1
  69. fides/ui-build/static/admin/data-discovery/action-center.html +1 -1
  70. fides/ui-build/static/admin/data-discovery/activity.html +1 -1
  71. fides/ui-build/static/admin/data-discovery/detection/[resourceUrn].html +1 -1
  72. fides/ui-build/static/admin/data-discovery/detection.html +1 -1
  73. fides/ui-build/static/admin/data-discovery/discovery/[resourceUrn].html +1 -1
  74. fides/ui-build/static/admin/data-discovery/discovery.html +1 -1
  75. fides/ui-build/static/admin/datamap.html +1 -1
  76. fides/ui-build/static/admin/dataset/[datasetId]/[collectionName]/[...subfieldNames].html +1 -1
  77. fides/ui-build/static/admin/dataset/[datasetId]/[collectionName].html +1 -1
  78. fides/ui-build/static/admin/dataset/[datasetId].html +1 -1
  79. fides/ui-build/static/admin/dataset/new.html +1 -1
  80. fides/ui-build/static/admin/dataset.html +1 -1
  81. fides/ui-build/static/admin/datastore-connection/[id].html +1 -1
  82. fides/ui-build/static/admin/datastore-connection/new.html +1 -1
  83. fides/ui-build/static/admin/datastore-connection.html +1 -1
  84. fides/ui-build/static/admin/images/connector-logos/manual_tasks.svg +25 -0
  85. fides/ui-build/static/admin/index.html +1 -1
  86. fides/ui-build/static/admin/integrations/[id].html +1 -1
  87. fides/ui-build/static/admin/integrations.html +1 -1
  88. fides/ui-build/static/admin/login/[provider].html +1 -1
  89. fides/ui-build/static/admin/login.html +1 -1
  90. fides/ui-build/static/admin/messaging/[id].html +1 -1
  91. fides/ui-build/static/admin/messaging/add-template.html +1 -1
  92. fides/ui-build/static/admin/messaging.html +1 -1
  93. fides/ui-build/static/admin/poc/ant-components.html +1 -1
  94. fides/ui-build/static/admin/poc/form-experiments/AntForm.html +1 -1
  95. fides/ui-build/static/admin/poc/form-experiments/FormikAntFormItem.html +1 -1
  96. fides/ui-build/static/admin/poc/form-experiments/FormikControlled.html +1 -1
  97. fides/ui-build/static/admin/poc/form-experiments/FormikField.html +1 -1
  98. fides/ui-build/static/admin/poc/form-experiments/FormikSpreadField.html +1 -1
  99. fides/ui-build/static/admin/poc/forms.html +1 -1
  100. fides/ui-build/static/admin/poc/table-migration.html +1 -1
  101. fides/ui-build/static/admin/privacy-requests/[id].html +1 -1
  102. fides/ui-build/static/admin/privacy-requests/configure/messaging.html +1 -1
  103. fides/ui-build/static/admin/privacy-requests/configure/storage.html +1 -1
  104. fides/ui-build/static/admin/privacy-requests/configure.html +1 -1
  105. fides/ui-build/static/admin/privacy-requests.html +1 -1
  106. fides/ui-build/static/admin/properties/[id].html +1 -1
  107. fides/ui-build/static/admin/properties/add-property.html +1 -1
  108. fides/ui-build/static/admin/properties.html +1 -1
  109. fides/ui-build/static/admin/reporting/datamap.html +1 -1
  110. fides/ui-build/static/admin/settings/about/alpha.html +1 -1
  111. fides/ui-build/static/admin/settings/about.html +1 -1
  112. fides/ui-build/static/admin/settings/consent/[configuration_id]/[purpose_id].html +1 -1
  113. fides/ui-build/static/admin/settings/consent.html +1 -1
  114. fides/ui-build/static/admin/settings/custom-fields.html +1 -1
  115. fides/ui-build/static/admin/settings/domain-records.html +1 -1
  116. fides/ui-build/static/admin/settings/domains.html +1 -1
  117. fides/ui-build/static/admin/settings/email-templates.html +1 -1
  118. fides/ui-build/static/admin/settings/locations.html +1 -1
  119. fides/ui-build/static/admin/settings/organization.html +1 -1
  120. fides/ui-build/static/admin/settings/regulations.html +1 -1
  121. fides/ui-build/static/admin/systems/configure/[id]/test-datasets.html +1 -1
  122. fides/ui-build/static/admin/systems/configure/[id].html +1 -1
  123. fides/ui-build/static/admin/systems.html +1 -1
  124. fides/ui-build/static/admin/taxonomy.html +1 -1
  125. fides/ui-build/static/admin/user-management/new.html +1 -1
  126. fides/ui-build/static/admin/user-management/profile/[id].html +1 -1
  127. fides/ui-build/static/admin/user-management.html +1 -1
  128. fides/ui-build/static/admin/_next/static/chunks/1169-60d4b584fde8ce55.js +0 -1
  129. fides/ui-build/static/admin/_next/static/chunks/4121-a3935e484614d586.js +0 -1
  130. fides/ui-build/static/admin/_next/static/chunks/pages/integrations-2f51dd2ebc800c0d.js +0 -1
  131. fides/ui-build/static/admin/_next/static/chunks/pages/privacy-requests/[id]-2f2410cdb2f2a918.js +0 -1
  132. fides/ui-build/static/admin/_next/static/chunks/pages/privacy-requests-d731dd036a0eb44d.js +0 -1
  133. {ethyca_fides-2.65.0rc3.dist-info → ethyca_fides-2.65.0rc4.dist-info}/WHEEL +0 -0
  134. {ethyca_fides-2.65.0rc3.dist-info → ethyca_fides-2.65.0rc4.dist-info}/entry_points.txt +0 -0
  135. {ethyca_fides-2.65.0rc3.dist-info → ethyca_fides-2.65.0rc4.dist-info}/licenses/LICENSE +0 -0
  136. {ethyca_fides-2.65.0rc3.dist-info → ethyca_fides-2.65.0rc4.dist-info}/top_level.txt +0 -0
  137. /fides/ui-build/static/admin/_next/static/{_Fm4x5HeQXsJ2c2T4P7Lj → vicgGTOV5HHGzNQ6RGIBb}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2815],{79349:function(e){e.exports=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}},52033:function(e,t,n){var i=n(26194),r=n(26789)(i);e.exports=r},23545:function(e,t,n){var i=n(97141),r=n(72889);e.exports=function e(t,n,s,a,o){var l=-1,c=t.length;for(s||(s=r),o||(o=[]);++l<c;){var u=t[l];n>0&&s(u)?n>1?e(u,n-1,s,a,o):i(o,u):a||(o[o.length]=u)}return o}},49819:function(e,t,n){var i=n(18911)();e.exports=i},26194:function(e,t,n){var i=n(49819),r=n(50098);e.exports=function(e,t){return e&&i(e,t,r)}},67375:function(e,t,n){var i=n(52033),r=n(80068);e.exports=function(e,t){var n=-1,s=r(e)?Array(e.length):[];return i(e,function(e,i,r){s[++n]=t(e,i,r)}),s}},98497:function(e,t,n){var i=n(66070),r=n(79867),s=n(89278),a=n(67375),o=n(73303),l=n(39334),c=n(96348),u=n(31137),d=n(19785);e.exports=function(e,t,n){t=t.length?i(t,function(e){return d(e)?function(t){return r(t,1===e.length?e[0]:e)}:e}):[u];var p=-1;return t=i(t,l(s)),o(a(e,function(e,n,r){return{criteria:i(t,function(t){return t(e)}),index:++p,value:e}}),function(e,t){return c(e,t,n)})}},1197:function(e,t,n){var i=n(31137),r=n(11871),s=n(63132);e.exports=function(e,t){return s(r(e,t,i),e+"")}},54459:function(e,t,n){var i=n(551),r=n(42630),s=n(31137),a=r?function(e,t){return r(e,"toString",{configurable:!0,enumerable:!1,value:i(t),writable:!0})}:s;e.exports=a},73303:function(e){e.exports=function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}},17845:function(e,t,n){var i=n(55193);e.exports=function(e,t){if(e!==t){var n=void 0!==e,r=null===e,s=e==e,a=i(e),o=void 0!==t,l=null===t,c=t==t,u=i(t);if(!l&&!u&&!a&&e>t||a&&o&&c&&!l&&!u||r&&o&&c||!n&&c||!s)return 1;if(!r&&!a&&!u&&e<t||u&&n&&s&&!r&&!a||l&&n&&s||!o&&s||!c)return -1}return 0}},96348:function(e,t,n){var i=n(17845);e.exports=function(e,t,n){for(var r=-1,s=e.criteria,a=t.criteria,o=s.length,l=n.length;++r<o;){var c=i(s[r],a[r]);if(c){if(r>=l)return c;return c*("desc"==n[r]?-1:1)}}return e.index-t.index}},26789:function(e,t,n){var i=n(80068);e.exports=function(e,t){return function(n,r){if(null==n)return n;if(!i(n))return e(n,r);for(var s=n.length,a=t?s:-1,o=Object(n);(t?a--:++a<s)&&!1!==r(o[a],a,o););return n}}},18911:function(e){e.exports=function(e){return function(t,n,i){for(var r=-1,s=Object(t),a=i(t),o=a.length;o--;){var l=a[e?o:++r];if(!1===n(s[l],l,s))break}return t}}},42630:function(e,t,n){var i=n(81822),r=function(){try{var e=i(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=r},72889:function(e,t,n){var i=n(96539),r=n(2900),s=n(19785),a=i?i.isConcatSpreadable:void 0;e.exports=function(e){return s(e)||r(e)||!!(a&&e&&e[a])}},57535:function(e,t,n){var i=n(85638),r=n(80068),s=n(42383),a=n(11611);e.exports=function(e,t,n){if(!a(n))return!1;var o=typeof t;return("number"==o?!!(r(n)&&s(t,n.length)):"string"==o&&t in n)&&i(n[t],e)}},11871:function(e,t,n){var i=n(79349),r=Math.max;e.exports=function(e,t,n){return t=r(void 0===t?e.length-1:t,0),function(){for(var s=arguments,a=-1,o=r(s.length-t,0),l=Array(o);++a<o;)l[a]=s[t+a];a=-1;for(var c=Array(t+1);++a<t;)c[a]=s[a];return c[t]=n(l),i(e,this,c)}}},63132:function(e,t,n){var i=n(54459),r=n(49591)(i);e.exports=r},49591:function(e){var t=Date.now;e.exports=function(e){var n=0,i=0;return function(){var r=t(),s=16-(r-i);if(i=r,s>0){if(++n>=800)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}},551:function(e){e.exports=function(e){return function(){return e}}},95099:function(e,t,n){var i=n(23545),r=n(98497),s=n(1197),a=n(57535),o=s(function(e,t){if(null==e)return[];var n=t.length;return n>1&&a(e,t[0],t[1])?t=[]:n>2&&a(t[0],t[1],t[2])&&(t=[t[0]]),r(e,i(t,1),[])});e.exports=o},24081:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/messaging",function(){return n(18504)}])},35287:function(e,t,n){"use strict";var i=n(24246),r=n(86920),s=n(88038),a=n.n(s);n(27378),t.Z=e=>{let{children:t,title:n,mainProps:s}=e;return(0,i.jsxs)(r.kCb,{"data-testid":n,direction:"column",height:"calc(100vh - 48px)",width:"calc(100vw - 240px)",children:[(0,i.jsxs)(a(),{children:[(0,i.jsxs)("title",{children:["Fides Admin UI - ",n]}),(0,i.jsx)("meta",{name:"description",content:"Privacy Engineering Platform"}),(0,i.jsx)("link",{rel:"icon",href:"/favicon.ico"})]}),(0,i.jsx)(r.kCb,{px:10,py:6,as:"main",overflow:"auto",direction:"column",flex:1,minWidth:0,...s,children:t})]})}},87361:function(e,t,n){"use strict";var i=n(24246),r=n(86920);t.Z=e=>{let{title:t,text:n,onClose:s}=e;return(0,i.jsxs)(r.Ugi,{backgroundColor:"gray.50",border:"1px solid",borderRadius:"md",justifyContent:"space-between",py:4,pr:6,pl:3,"data-testid":"empty-state",gap:2,position:"relative",children:[s&&(0,i.jsx)(r.Two,{boxSize:5,position:"absolute",right:3,top:3,zIndex:1,cursor:"pointer",p:1,onClick:s}),(0,i.jsx)(r.iid,{alignSelf:"start",color:"minos",mt:.5,flexGrow:0}),(0,i.jsxs)(r.kCb,{direction:"column",gap:2,flexGrow:1,children:[(0,i.jsx)(r.X6q,{fontSize:"md",children:t}),(0,i.jsx)(r.xvT,{fontSize:"sm",color:"gray.600",lineHeight:"5",children:n})]})]})}},58754:function(e,t,n){"use strict";var i=n(24246),r=n(86920),s=n(70788);t.Z=e=>{let{heading:t,breadcrumbItems:n,isSticky:a=!0,children:o,rightContent:l,style:c,...u}=e;return(0,i.jsxs)("div",{...u,style:a?{position:"sticky",top:"-24px",paddingTop:"24px",paddingBottom:"24px",paddingLeft:"40px",marginLeft:"-40px",paddingRight:"40px",marginRight:"-40px",marginTop:"-24px",left:0,zIndex:20,backgroundColor:"white",...c}:{paddingBottom:"24px",...c},children:[(0,i.jsxs)(r.jqI,{justify:"space-between",children:["string"==typeof t?(0,i.jsx)(r.lQT,{className:n||o?"pb-4":void 0,level:1,"data-testid":"page-heading",children:t}):t,l&&(0,i.jsx)("div",{"data-testid":"page-header-right-content",children:l})]}),!!n&&(0,i.jsx)(s.m,{className:o?"pb-4":void 0,items:n,"data-testid":"page-breadcrumb"}),o]})}},70788:function(e,t,n){"use strict";n.d(t,{m:function(){return c}});var i=n(24246),r=n(86920),s=n(79894),a=n.n(s),o=n(27378);let{Text:l}=r.AntTypography,c=e=>{let{items:t,...n}=e,s=(0,o.useMemo)(()=>null==t?void 0:t.map((e,n)=>{let s=n===t.length-1,o={...e},c=o.onClick&&!o.href;return("string"==typeof o.title&&(o.title=(0,i.jsx)(l,{style:{color:"inherit",maxWidth:s?void 0:400},ellipsis:!s,children:o.title})),c)?o.title=(0,i.jsx)(r.wpx,{type:"text",size:"small",icon:o.icon,onClick:o.onClick,className:"ant-breadcrumb-link -mt-px px-1 text-inherit",children:o.title}):(o.icon&&(o.title=(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("span",{className:"anticon align-text-bottom",children:o.icon}),o.title]})),o.href&&o.title&&(o.title=(0,i.jsx)(a(),{href:o.href,className:"ant-breadcrumb-link",children:o.title}),delete o.href)),o}),[t]);return(0,i.jsx)(r.zrq,{items:s,...n})}},67810:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}}),(i=r||(r={})).PRIVACY_REQUEST_REVIEW_APPROVE="privacy_request_review_approve",i.PRIVACY_REQUEST_REVIEW_DENY="privacy_request_review_deny",i.PRIVACY_REQUEST_RECEIPT="privacy_request_receipt",i.PRIVACY_REQUEST_COMPLETE_ACCESS="privacy_request_complete_access",i.PRIVACY_REQUEST_COMPLETE_DELETION="privacy_request_complete_deletion",i.SUBJECT_IDENTITY_VERIFICATION="subject_identity_verification";var i,r,s={[r.PRIVACY_REQUEST_COMPLETE_ACCESS]:"Access request completed",[r.PRIVACY_REQUEST_COMPLETE_DELETION]:"Erasure request completed",[r.PRIVACY_REQUEST_RECEIPT]:"Privacy request received",[r.PRIVACY_REQUEST_REVIEW_APPROVE]:"Privacy request approved",[r.PRIVACY_REQUEST_REVIEW_DENY]:"Privacy request denied",[r.SUBJECT_IDENTITY_VERIFICATION]:"Subject identity verification"}},5058:function(e,t,n){"use strict";n.d(t,{Vw:function(){return s},ms:function(){return i},pS:function(){return r},vm:function(){return a}});let{useGetSummaryMessagingTemplatesQuery:i,usePutMessagingTemplateByIdMutation:r,useCreateMessagingTemplateByTypeMutation:s,usePatchMessagingTemplateByIdMutation:a}=n(78780).u.injectEndpoints({endpoints:e=>({getSummaryMessagingTemplates:e.query({query:e=>({method:"GET",url:"plus/messaging/templates/summary",params:e}),providesTags:()=>["Property-Specific Messaging Templates"]}),putMessagingTemplateById:e.mutation({query:e=>{let{templateId:t,template:n}=e;return{url:"plus/messaging/templates/".concat(t),method:"PUT",body:n}},invalidatesTags:()=>["Property-Specific Messaging Templates"]}),patchMessagingTemplateById:e.mutation({query:e=>{let{templateId:t,template:n}=e;return{url:"plus/messaging/templates/".concat(t),method:"PATCH",body:n}},invalidatesTags:()=>["Property-Specific Messaging Templates"]}),createMessagingTemplateByType:e.mutation({query:e=>{let{templateType:t,template:n}=e;return{url:"plus/messaging/templates/".concat(t),method:"POST",body:n}},invalidatesTags:()=>["Property-Specific Messaging Templates"]})})})},18504:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return M}});var i=n(24246),r=n(92222),s=n(59003),a=n(86920),o=n(95099),l=n.n(o),c=n(86677),u=n(27378),d=n(35287),p=n(71795),g=n(87361),m=n(46238),f=n(77830),x=n(58754),h=n(85422),v=n(42904),j=n(7426),y=n(67810),b=e=>{let{isOpen:t,onClose:n,onAccept:r}=e,[s,o]=(0,u.useState)(void 0),l=Object.keys(y.Z).map(e=>({value:e,label:y.Z[e]}));return(0,i.jsxs)(a.u_l,{isOpen:t,onClose:n,size:"2xl",isCentered:!0,children:[(0,i.jsx)(a.ZAr,{}),(0,i.jsxs)(a.hzk,{"data-testid":"add-messaging-template-modal",children:[(0,i.jsx)(a.xBx,{borderBottomWidth:1,fontWeight:"bold",children:"Select message template"}),(0,i.jsxs)(a.fef,{children:[(0,i.jsx)(a.xvT,{color:"gray.700",fontWeight:"medium",fontSize:"sm",marginBottom:3,marginTop:1,children:"Add a new email message by selecting a template below and clicking accept."}),(0,i.jsx)(a.xvT,{color:"gray.700",fontSize:"sm",fontWeight:"medium",marginBottom:2,children:"Choose template:"}),(0,i.jsx)(a.xuv,{"data-testid":"template-type-selector",children:(0,i.jsx)(a.WPr,{options:l,onChange:e=>{o(e)},className:"w-full"})})]}),(0,i.jsx)(a.mzw,{justifyContent:"flex-start",children:(0,i.jsxs)("div",{className:"flex w-full gap-4",children:[(0,i.jsx)(a.wpx,{onClick:n,"data-testid":"cancel-btn",className:"grow",children:"Cancel"}),(0,i.jsx)(a.wpx,{onClick:()=>r(s),type:"primary","data-testid":"confirm-btn",disabled:!s,className:"grow",children:"Next"})]})})]})]})},_=n(5058),E=n(812),C=n(46628),T=n(31883),w=()=>{let e=(0,a.pmc)(),[t]=(0,_.vm)();return{toggleIsTemplateEnabled:(0,u.useCallback)(async n=>{let{isEnabled:i,templateId:r}=n,s=await t({templateId:r,template:{is_enabled:i}});if((0,T.D4)(s)){e((0,C.Vo)((0,E.e$)(s.error)));return}e((0,C.t5)("Messaging template ".concat(i?"enabled":"disabled")))},[t,e])}},R=n(64826);let P=(0,r.Cl)(),S={items:[],total:0,page:1,size:50,pages:1},I=()=>(0,i.jsx)(a.gCW,{mt:6,p:10,spacing:4,borderRadius:"base",maxW:"70%","data-testid":"no-results-notice",alignSelf:"center",margin:"auto",textAlign:"center",children:(0,i.jsxs)(a.gCW,{children:[(0,i.jsx)(a.xvT,{fontSize:"md",fontWeight:"600",children:"It looks like it’s your first time here!"}),(0,i.jsxs)(a.xvT,{fontSize:"sm",children:["Add new email templates with the ",'"Add message +"'," button.",(0,i.jsx)("br",{})]})]})}),k=()=>{let{isLoading:e,data:t}=(0,R.gz)({page:1,size:100}),n=null==t?void 0:t.items.filter(e=>!e.messaging_templates||0===e.messaging_templates.length),r=!!(!e&&(null==n?void 0:n.length)),s="missing-messages-notice-".concat(null==n?void 0:n.map(e=>e.id).join("-")),[o,l]=(0,p._)("notices.dismissedMessageNoticeId",""),c=s===o;return r&&!c?(0,i.jsx)(a.xuv,{mb:6,"data-testid":"notice-properties-without-messaging-templates",children:(0,i.jsx)(g.Z,{title:"Not all properties have messages configured.",text:(0,i.jsxs)(a.xvT,{as:"span",children:["You have properties that do not have messages configured. Users who submit privacy requests for these properties may not receive the necessary emails regarding their requests."," ",(0,i.jsx)(a.xuv,{as:"span",children:(0,i.jsx)(m.b,{label:null==n?void 0:n.map(e=>e.name).join(", ")})})]}),onClose:()=>{l(s)}})}):null},A=()=>{let{data:e}=(0,j.tB)({api_set:!1});return(null==e?void 0:e.notifications.enable_property_specific_messaging)?null:(0,i.jsx)(a.xuv,{mb:6,"data-testid":"notice-properties-without-messaging-templates",children:(0,i.jsx)(g.Z,{title:"Basic messaging enabled",text:(0,i.jsxs)(a.xvT,{as:"span",children:["In basic messaging mode, you can edit the content of your messages from this screen. Please note that in basic messaging, the “Enable” toggle does not apply. Fides also supports property specific messaging mode. Read our"," ",(0,i.jsx)(a.rUS,{href:"https://fid.es/property-specific-messaging",target:"_blank",rel:"nofollow",textDecoration:"underline",children:"docs"})," ","for more information about property specific mode or contact"," ",(0,i.jsx)(a.rUS,{href:"mailto:support@ethyca.com",textDecoration:"underline",children:"Ethyca support"})," ","to enable this mode on your Fides instance."]})})})};var M=()=>{let e=(0,c.useRouter)(),{toggleIsTemplateEnabled:t}=w(),{PAGE_SIZES:n,pageSize:o,setPageSize:p,onPreviousPageClick:g,isPreviousPageDisabled:m,onNextPageClick:j,isNextPageDisabled:E,startRange:C,endRange:T,pageIndex:R,setTotalPages:M}=(0,h.oi)(),{data:N,isLoading:z,isFetching:V}=(0,_.ms)({page:R,size:o}),{items:q,total:O,pages:U}=(0,u.useMemo)(()=>null!=N?N:S,[N]);(0,u.useEffect)(()=>{M(U)},[U,M]);let[W,B]=(0,u.useState)(!1),Y=(0,u.useMemo)(()=>[P.accessor(e=>e.type,{id:"message",cell:e=>(0,i.jsx)(h.G3,{value:y.Z[e.getValue()]}),header:e=>(0,i.jsx)(h.Rr,{value:"Message",...e}),size:150}),P.accessor(e=>(e.properties||[]).map(e=>e.name),{id:"properties",cell:e=>(0,i.jsx)(h.WP,{suffix:"properties",value:e.getValue(),...e}),header:e=>(0,i.jsx)(h.Rr,{value:"Properties",...e}),meta:{showHeaderMenu:!0},size:250}),P.accessor(e=>e.is_enabled,{id:"is_enabled",cell:e=>(0,i.jsx)(a.kCb,{align:"center",justifyContent:"flex-start",w:"full",h:"full",children:(0,i.jsx)(a.rAg,{checked:e.getValue(),onChange:n=>{t({isEnabled:n,templateId:e.row.original.id})}})}),header:e=>(0,i.jsx)(h.Rr,{value:"Enable",...e}),size:200,meta:{disableRowClick:!0}})],[t]),D=(0,u.useMemo)(()=>l()(q,"id"),[q]),Z=(0,s.b7)({getCoreRowModel:(0,r.sC)(),getFilteredRowModel:(0,r.vL)(),getSortedRowModel:(0,r.tj)(),columns:Y,data:D,columnResizeMode:"onChange"});return(0,i.jsxs)(d.Z,{title:"Messaging",children:[(0,i.jsx)(x.Z,{heading:"Messaging"}),(0,i.jsx)(A,{}),(0,i.jsx)(k,{}),(0,i.jsx)(h.Q$,{children:(0,i.jsx)(a.Ugi,{alignItems:"center",spacing:4,marginLeft:"auto",children:(0,i.jsx)(a.wpx,{type:"primary","data-testid":"add-message-btn",onClick:()=>B(!0),children:"Add message +"})})}),z?(0,i.jsx)(h.I4,{rowHeight:36,numRows:15}):(0,i.jsx)(h.ZK,{tableInstance:Z,onRowClick:t=>{e.push({pathname:f.ax,query:{id:t.id}})},emptyTableNotice:(0,i.jsx)(I,{})}),(0,i.jsx)(v.s8,{totalRows:O||0,pageSizes:n,setPageSize:p,onPreviousPageClick:g,isPreviousPageDisabled:m||V,onNextPageClick:j,isNextPageDisabled:E||V,startRange:C,endRange:T}),(0,i.jsx)(b,{isOpen:W,onClose:()=>B(!1),onAccept:t=>{e.push({pathname:f.sM,query:{templateType:t}})}})]})}},31883:function(e,t,n){"use strict";n.d(t,{Bw:function(){return i.Bw},D4:function(){return i.D4}});var i=n(19043)}},function(e){e.O(0,[2858,2866,9278,2888,9774,179],function(){return e(e.s=24081)}),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2815],{79349:function(e){e.exports=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}},52033:function(e,t,n){var i=n(26194),r=n(26789)(i);e.exports=r},23545:function(e,t,n){var i=n(97141),r=n(72889);e.exports=function e(t,n,s,a,o){var l=-1,c=t.length;for(s||(s=r),o||(o=[]);++l<c;){var u=t[l];n>0&&s(u)?n>1?e(u,n-1,s,a,o):i(o,u):a||(o[o.length]=u)}return o}},49819:function(e,t,n){var i=n(18911)();e.exports=i},26194:function(e,t,n){var i=n(49819),r=n(50098);e.exports=function(e,t){return e&&i(e,t,r)}},67375:function(e,t,n){var i=n(52033),r=n(80068);e.exports=function(e,t){var n=-1,s=r(e)?Array(e.length):[];return i(e,function(e,i,r){s[++n]=t(e,i,r)}),s}},98497:function(e,t,n){var i=n(66070),r=n(79867),s=n(89278),a=n(67375),o=n(73303),l=n(39334),c=n(96348),u=n(31137),d=n(19785);e.exports=function(e,t,n){t=t.length?i(t,function(e){return d(e)?function(t){return r(t,1===e.length?e[0]:e)}:e}):[u];var p=-1;return t=i(t,l(s)),o(a(e,function(e,n,r){return{criteria:i(t,function(t){return t(e)}),index:++p,value:e}}),function(e,t){return c(e,t,n)})}},1197:function(e,t,n){var i=n(31137),r=n(11871),s=n(63132);e.exports=function(e,t){return s(r(e,t,i),e+"")}},54459:function(e,t,n){var i=n(551),r=n(42630),s=n(31137),a=r?function(e,t){return r(e,"toString",{configurable:!0,enumerable:!1,value:i(t),writable:!0})}:s;e.exports=a},73303:function(e){e.exports=function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}},17845:function(e,t,n){var i=n(55193);e.exports=function(e,t){if(e!==t){var n=void 0!==e,r=null===e,s=e==e,a=i(e),o=void 0!==t,l=null===t,c=t==t,u=i(t);if(!l&&!u&&!a&&e>t||a&&o&&c&&!l&&!u||r&&o&&c||!n&&c||!s)return 1;if(!r&&!a&&!u&&e<t||u&&n&&s&&!r&&!a||l&&n&&s||!o&&s||!c)return -1}return 0}},96348:function(e,t,n){var i=n(17845);e.exports=function(e,t,n){for(var r=-1,s=e.criteria,a=t.criteria,o=s.length,l=n.length;++r<o;){var c=i(s[r],a[r]);if(c){if(r>=l)return c;return c*("desc"==n[r]?-1:1)}}return e.index-t.index}},26789:function(e,t,n){var i=n(80068);e.exports=function(e,t){return function(n,r){if(null==n)return n;if(!i(n))return e(n,r);for(var s=n.length,a=t?s:-1,o=Object(n);(t?a--:++a<s)&&!1!==r(o[a],a,o););return n}}},18911:function(e){e.exports=function(e){return function(t,n,i){for(var r=-1,s=Object(t),a=i(t),o=a.length;o--;){var l=a[e?o:++r];if(!1===n(s[l],l,s))break}return t}}},42630:function(e,t,n){var i=n(81822),r=function(){try{var e=i(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=r},72889:function(e,t,n){var i=n(96539),r=n(2900),s=n(19785),a=i?i.isConcatSpreadable:void 0;e.exports=function(e){return s(e)||r(e)||!!(a&&e&&e[a])}},57535:function(e,t,n){var i=n(85638),r=n(80068),s=n(42383),a=n(11611);e.exports=function(e,t,n){if(!a(n))return!1;var o=typeof t;return("number"==o?!!(r(n)&&s(t,n.length)):"string"==o&&t in n)&&i(n[t],e)}},11871:function(e,t,n){var i=n(79349),r=Math.max;e.exports=function(e,t,n){return t=r(void 0===t?e.length-1:t,0),function(){for(var s=arguments,a=-1,o=r(s.length-t,0),l=Array(o);++a<o;)l[a]=s[t+a];a=-1;for(var c=Array(t+1);++a<t;)c[a]=s[a];return c[t]=n(l),i(e,this,c)}}},63132:function(e,t,n){var i=n(54459),r=n(49591)(i);e.exports=r},49591:function(e){var t=Date.now;e.exports=function(e){var n=0,i=0;return function(){var r=t(),s=16-(r-i);if(i=r,s>0){if(++n>=800)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}},551:function(e){e.exports=function(e){return function(){return e}}},95099:function(e,t,n){var i=n(23545),r=n(98497),s=n(1197),a=n(57535),o=s(function(e,t){if(null==e)return[];var n=t.length;return n>1&&a(e,t[0],t[1])?t=[]:n>2&&a(t[0],t[1],t[2])&&(t=[t[0]]),r(e,i(t,1),[])});e.exports=o},24081:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/messaging",function(){return n(18504)}])},35287:function(e,t,n){"use strict";var i=n(24246),r=n(86920),s=n(88038),a=n.n(s);n(27378),t.Z=e=>{let{children:t,title:n,mainProps:s}=e;return(0,i.jsxs)(r.kCb,{"data-testid":n,direction:"column",height:"calc(100vh - 48px)",width:"calc(100vw - 240px)",children:[(0,i.jsxs)(a(),{children:[(0,i.jsxs)("title",{children:["Fides Admin UI - ",n]}),(0,i.jsx)("meta",{name:"description",content:"Privacy Engineering Platform"}),(0,i.jsx)("link",{rel:"icon",href:"/favicon.ico"})]}),(0,i.jsx)(r.kCb,{px:10,py:6,as:"main",overflow:"auto",direction:"column",flex:1,minWidth:0,...s,children:t})]})}},87361:function(e,t,n){"use strict";var i=n(24246),r=n(86920);t.Z=e=>{let{title:t,text:n,onClose:s}=e;return(0,i.jsxs)(r.Ugi,{backgroundColor:"gray.50",border:"1px solid",borderRadius:"md",justifyContent:"space-between",py:4,pr:6,pl:3,"data-testid":"empty-state",gap:2,position:"relative",children:[s&&(0,i.jsx)(r.Two,{boxSize:5,position:"absolute",right:3,top:3,zIndex:1,cursor:"pointer",p:1,onClick:s}),(0,i.jsx)(r.iid,{alignSelf:"start",color:"minos",mt:.5,flexGrow:0}),(0,i.jsxs)(r.kCb,{direction:"column",gap:2,flexGrow:1,children:[(0,i.jsx)(r.X6q,{fontSize:"md",children:t}),(0,i.jsx)(r.xvT,{fontSize:"sm",color:"gray.600",lineHeight:"5",children:n})]})]})}},58754:function(e,t,n){"use strict";var i=n(24246),r=n(86920),s=n(70788);t.Z=e=>{let{heading:t,breadcrumbItems:n,isSticky:a=!0,children:o,rightContent:l,style:c,...u}=e;return(0,i.jsxs)("div",{...u,style:a?{position:"sticky",top:"-24px",paddingTop:"24px",paddingBottom:"24px",paddingLeft:"40px",marginLeft:"-40px",paddingRight:"40px",marginRight:"-40px",marginTop:"-24px",left:0,zIndex:20,backgroundColor:"white",...c}:{paddingBottom:"24px",...c},children:[(0,i.jsxs)(r.jqI,{justify:"space-between",children:["string"==typeof t?(0,i.jsx)(r.lQT,{className:n||o?"pb-4":void 0,level:1,"data-testid":"page-heading",children:t}):t,l&&(0,i.jsx)("div",{"data-testid":"page-header-right-content",children:l})]}),!!n&&(0,i.jsx)(s.m,{className:o?"pb-4":void 0,items:n,"data-testid":"page-breadcrumb"}),o]})}},70788:function(e,t,n){"use strict";n.d(t,{m:function(){return c}});var i=n(24246),r=n(86920),s=n(79894),a=n.n(s),o=n(27378);let{Text:l}=r.AntTypography,c=e=>{let{items:t,...n}=e,s=(0,o.useMemo)(()=>null==t?void 0:t.map((e,n)=>{let s=n===t.length-1,o={...e},c=o.onClick&&!o.href;return("string"==typeof o.title&&(o.title=(0,i.jsx)(l,{style:{color:"inherit",maxWidth:s?void 0:400},ellipsis:!s,children:o.title})),c)?o.title=(0,i.jsx)(r.wpx,{type:"text",size:"small",icon:o.icon,onClick:o.onClick,className:"ant-breadcrumb-link -mt-px px-1 text-inherit",children:o.title}):(o.icon&&(o.title=(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("span",{className:"anticon align-text-bottom",children:o.icon}),o.title]})),o.href&&o.title&&(o.title=(0,i.jsx)(a(),{href:o.href,className:"ant-breadcrumb-link",children:o.title}),delete o.href)),o}),[t]);return(0,i.jsx)(r.zrq,{items:s,...n})}},67810:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}}),(i=r||(r={})).PRIVACY_REQUEST_REVIEW_APPROVE="privacy_request_review_approve",i.PRIVACY_REQUEST_REVIEW_DENY="privacy_request_review_deny",i.PRIVACY_REQUEST_RECEIPT="privacy_request_receipt",i.PRIVACY_REQUEST_COMPLETE_ACCESS="privacy_request_complete_access",i.PRIVACY_REQUEST_COMPLETE_DELETION="privacy_request_complete_deletion",i.SUBJECT_IDENTITY_VERIFICATION="subject_identity_verification";var i,r,s={[r.PRIVACY_REQUEST_COMPLETE_ACCESS]:"Access request completed",[r.PRIVACY_REQUEST_COMPLETE_DELETION]:"Erasure request completed",[r.PRIVACY_REQUEST_RECEIPT]:"Privacy request received",[r.PRIVACY_REQUEST_REVIEW_APPROVE]:"Privacy request approved",[r.PRIVACY_REQUEST_REVIEW_DENY]:"Privacy request denied",[r.SUBJECT_IDENTITY_VERIFICATION]:"Subject identity verification"}},5058:function(e,t,n){"use strict";n.d(t,{Vw:function(){return s},ms:function(){return i},pS:function(){return r},vm:function(){return a}});let{useGetSummaryMessagingTemplatesQuery:i,usePutMessagingTemplateByIdMutation:r,useCreateMessagingTemplateByTypeMutation:s,usePatchMessagingTemplateByIdMutation:a}=n(78780).u.injectEndpoints({endpoints:e=>({getSummaryMessagingTemplates:e.query({query:e=>({method:"GET",url:"plus/messaging/templates/summary",params:e}),providesTags:()=>["Property-Specific Messaging Templates"]}),putMessagingTemplateById:e.mutation({query:e=>{let{templateId:t,template:n}=e;return{url:"plus/messaging/templates/".concat(t),method:"PUT",body:n}},invalidatesTags:()=>["Property-Specific Messaging Templates"]}),patchMessagingTemplateById:e.mutation({query:e=>{let{templateId:t,template:n}=e;return{url:"plus/messaging/templates/".concat(t),method:"PATCH",body:n}},invalidatesTags:()=>["Property-Specific Messaging Templates"]}),createMessagingTemplateByType:e.mutation({query:e=>{let{templateType:t,template:n}=e;return{url:"plus/messaging/templates/".concat(t),method:"POST",body:n}},invalidatesTags:()=>["Property-Specific Messaging Templates"]})})})},18504:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return M}});var i=n(24246),r=n(92222),s=n(59003),a=n(86920),o=n(95099),l=n.n(o),c=n(86677),u=n(27378),d=n(35287),p=n(71795),g=n(87361),m=n(46238),f=n(77830),x=n(58754),h=n(47935),v=n(42904),j=n(7426),y=n(67810),b=e=>{let{isOpen:t,onClose:n,onAccept:r}=e,[s,o]=(0,u.useState)(void 0),l=Object.keys(y.Z).map(e=>({value:e,label:y.Z[e]}));return(0,i.jsxs)(a.u_l,{isOpen:t,onClose:n,size:"2xl",isCentered:!0,children:[(0,i.jsx)(a.ZAr,{}),(0,i.jsxs)(a.hzk,{"data-testid":"add-messaging-template-modal",children:[(0,i.jsx)(a.xBx,{borderBottomWidth:1,fontWeight:"bold",children:"Select message template"}),(0,i.jsxs)(a.fef,{children:[(0,i.jsx)(a.xvT,{color:"gray.700",fontWeight:"medium",fontSize:"sm",marginBottom:3,marginTop:1,children:"Add a new email message by selecting a template below and clicking accept."}),(0,i.jsx)(a.xvT,{color:"gray.700",fontSize:"sm",fontWeight:"medium",marginBottom:2,children:"Choose template:"}),(0,i.jsx)(a.xuv,{"data-testid":"template-type-selector",children:(0,i.jsx)(a.WPr,{options:l,onChange:e=>{o(e)},className:"w-full"})})]}),(0,i.jsx)(a.mzw,{justifyContent:"flex-start",children:(0,i.jsxs)("div",{className:"flex w-full gap-4",children:[(0,i.jsx)(a.wpx,{onClick:n,"data-testid":"cancel-btn",className:"grow",children:"Cancel"}),(0,i.jsx)(a.wpx,{onClick:()=>r(s),type:"primary","data-testid":"confirm-btn",disabled:!s,className:"grow",children:"Next"})]})})]})]})},_=n(5058),E=n(812),C=n(46628),T=n(31883),w=()=>{let e=(0,a.pmc)(),[t]=(0,_.vm)();return{toggleIsTemplateEnabled:(0,u.useCallback)(async n=>{let{isEnabled:i,templateId:r}=n,s=await t({templateId:r,template:{is_enabled:i}});if((0,T.D4)(s)){e((0,C.Vo)((0,E.e$)(s.error)));return}e((0,C.t5)("Messaging template ".concat(i?"enabled":"disabled")))},[t,e])}},R=n(64826);let P=(0,r.Cl)(),S={items:[],total:0,page:1,size:50,pages:1},I=()=>(0,i.jsx)(a.gCW,{mt:6,p:10,spacing:4,borderRadius:"base",maxW:"70%","data-testid":"no-results-notice",alignSelf:"center",margin:"auto",textAlign:"center",children:(0,i.jsxs)(a.gCW,{children:[(0,i.jsx)(a.xvT,{fontSize:"md",fontWeight:"600",children:"It looks like it’s your first time here!"}),(0,i.jsxs)(a.xvT,{fontSize:"sm",children:["Add new email templates with the ",'"Add message +"'," button.",(0,i.jsx)("br",{})]})]})}),k=()=>{let{isLoading:e,data:t}=(0,R.gz)({page:1,size:100}),n=null==t?void 0:t.items.filter(e=>!e.messaging_templates||0===e.messaging_templates.length),r=!!(!e&&(null==n?void 0:n.length)),s="missing-messages-notice-".concat(null==n?void 0:n.map(e=>e.id).join("-")),[o,l]=(0,p._)("notices.dismissedMessageNoticeId",""),c=s===o;return r&&!c?(0,i.jsx)(a.xuv,{mb:6,"data-testid":"notice-properties-without-messaging-templates",children:(0,i.jsx)(g.Z,{title:"Not all properties have messages configured.",text:(0,i.jsxs)(a.xvT,{as:"span",children:["You have properties that do not have messages configured. Users who submit privacy requests for these properties may not receive the necessary emails regarding their requests."," ",(0,i.jsx)(a.xuv,{as:"span",children:(0,i.jsx)(m.b,{label:null==n?void 0:n.map(e=>e.name).join(", ")})})]}),onClose:()=>{l(s)}})}):null},A=()=>{let{data:e}=(0,j.tB)({api_set:!1});return(null==e?void 0:e.notifications.enable_property_specific_messaging)?null:(0,i.jsx)(a.xuv,{mb:6,"data-testid":"notice-properties-without-messaging-templates",children:(0,i.jsx)(g.Z,{title:"Basic messaging enabled",text:(0,i.jsxs)(a.xvT,{as:"span",children:["In basic messaging mode, you can edit the content of your messages from this screen. Please note that in basic messaging, the “Enable” toggle does not apply. Fides also supports property specific messaging mode. Read our"," ",(0,i.jsx)(a.rUS,{href:"https://fid.es/property-specific-messaging",target:"_blank",rel:"nofollow",textDecoration:"underline",children:"docs"})," ","for more information about property specific mode or contact"," ",(0,i.jsx)(a.rUS,{href:"mailto:support@ethyca.com",textDecoration:"underline",children:"Ethyca support"})," ","to enable this mode on your Fides instance."]})})})};var M=()=>{let e=(0,c.useRouter)(),{toggleIsTemplateEnabled:t}=w(),{PAGE_SIZES:n,pageSize:o,setPageSize:p,onPreviousPageClick:g,isPreviousPageDisabled:m,onNextPageClick:j,isNextPageDisabled:E,startRange:C,endRange:T,pageIndex:R,setTotalPages:M}=(0,h.oi)(),{data:N,isLoading:z,isFetching:V}=(0,_.ms)({page:R,size:o}),{items:q,total:O,pages:U}=(0,u.useMemo)(()=>null!=N?N:S,[N]);(0,u.useEffect)(()=>{M(U)},[U,M]);let[W,B]=(0,u.useState)(!1),Y=(0,u.useMemo)(()=>[P.accessor(e=>e.type,{id:"message",cell:e=>(0,i.jsx)(h.G3,{value:y.Z[e.getValue()]}),header:e=>(0,i.jsx)(h.Rr,{value:"Message",...e}),size:150}),P.accessor(e=>(e.properties||[]).map(e=>e.name),{id:"properties",cell:e=>(0,i.jsx)(h.WP,{suffix:"properties",value:e.getValue(),...e}),header:e=>(0,i.jsx)(h.Rr,{value:"Properties",...e}),meta:{showHeaderMenu:!0},size:250}),P.accessor(e=>e.is_enabled,{id:"is_enabled",cell:e=>(0,i.jsx)(a.kCb,{align:"center",justifyContent:"flex-start",w:"full",h:"full",children:(0,i.jsx)(a.rAg,{checked:e.getValue(),onChange:n=>{t({isEnabled:n,templateId:e.row.original.id})}})}),header:e=>(0,i.jsx)(h.Rr,{value:"Enable",...e}),size:200,meta:{disableRowClick:!0}})],[t]),D=(0,u.useMemo)(()=>l()(q,"id"),[q]),Z=(0,s.b7)({getCoreRowModel:(0,r.sC)(),getFilteredRowModel:(0,r.vL)(),getSortedRowModel:(0,r.tj)(),columns:Y,data:D,columnResizeMode:"onChange"});return(0,i.jsxs)(d.Z,{title:"Messaging",children:[(0,i.jsx)(x.Z,{heading:"Messaging"}),(0,i.jsx)(A,{}),(0,i.jsx)(k,{}),(0,i.jsx)(h.Q$,{children:(0,i.jsx)(a.Ugi,{alignItems:"center",spacing:4,marginLeft:"auto",children:(0,i.jsx)(a.wpx,{type:"primary","data-testid":"add-message-btn",onClick:()=>B(!0),children:"Add message +"})})}),z?(0,i.jsx)(h.I4,{rowHeight:36,numRows:15}):(0,i.jsx)(h.ZK,{tableInstance:Z,onRowClick:t=>{e.push({pathname:f.ax,query:{id:t.id}})},emptyTableNotice:(0,i.jsx)(I,{})}),(0,i.jsx)(v.s8,{totalRows:O||0,pageSizes:n,setPageSize:p,onPreviousPageClick:g,isPreviousPageDisabled:m||V,onNextPageClick:j,isNextPageDisabled:E||V,startRange:C,endRange:T}),(0,i.jsx)(b,{isOpen:W,onClose:()=>B(!1),onAccept:t=>{e.push({pathname:f.sM,query:{templateType:t}})}})]})}},31883:function(e,t,n){"use strict";n.d(t,{Bw:function(){return i.Bw},D4:function(){return i.D4}});var i=n(19043)}},function(e){e.O(0,[2858,2866,9278,2888,9774,179],function(){return e(e.s=24081)}),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9650],{6554:function(e,t,i){(window.__NEXT_P=window.__NEXT_P||[]).push(["/privacy-requests/[id]",function(){return i(19774)}])},77213:function(e,t,i){"use strict";i.d(t,{Z:function(){return p}});var n=i(24246),s=i(86920),a=i(88038),l=i.n(a),r=i(86677);i(27378);var o=i(25980),c=i(90867),d=i(77830),u=()=>{let e=(0,r.useRouter)();return(0,n.jsx)(s.xuv,{bg:"gray.50",border:"1px solid",borderColor:"blue.400",borderRadius:"md",justifyContent:"space-between",p:5,mb:5,mt:5,children:(0,n.jsxs)(s.xuv,{children:[(0,n.jsxs)(s.Kqy,{direction:{base:"column",sm:"row"},justifyContent:"space-between",children:[(0,n.jsx)(s.xvT,{fontWeight:"semibold",children:"Configure your storage and messaging provider"}),(0,n.jsx)(s.wpx,{onClick:()=>{e.push(d.fz)},children:"Configure"})]}),(0,n.jsxs)(s.xvT,{children:["Before Fides can process your privacy requests we need two simple steps to configure your storage and email client."," "]})]})})},p=e=>{let{children:t,title:i,padded:a=!0,mainProps:d}=e,p=(0,o.hz)(),m=(0,r.useRouter)(),h="/privacy-requests"===m.pathname||"/datastore-connection"===m.pathname,x=!(p.flags.privacyRequestsConfiguration&&h),{data:g}=(0,c.JE)(void 0,{skip:x}),{data:j}=(0,c.PW)(void 0,{skip:x}),y=p.flags.privacyRequestsConfiguration&&(!g||!j)&&h;return(0,n.jsxs)(s.kCb,{"data-testid":i,direction:"column",h:"100vh",children:[(0,n.jsxs)(l(),{children:[(0,n.jsxs)("title",{children:["Fides Admin UI - ",i]}),(0,n.jsx)("meta",{name:"description",content:"Privacy Engineering Platform"}),(0,n.jsx)("link",{rel:"icon",href:"/favicon.ico"})]}),(0,n.jsxs)(s.kCb,{as:"main",direction:"column",py:a?6:0,px:a?10:0,h:a?"calc(100% - 48px)":"full",flex:1,minWidth:0,overflow:"auto",...d,children:[y?(0,n.jsx)(u,{}):null,t]})]})}},19774:function(e,t,i){"use strict";i.r(t),i.d(t,{default:function(){return eD}});var n,s,a,l,r=i(24246),o=i(86920),c=i(86677),d=i(77213),u=i(77830),p=i(58754),m=i(99716),h=i(27378),x=i(68309),g=i(19904);(n=a||(a={})).IN_PROCESSING="in_processing",n.PENDING="pending",n.COMPLETE="complete",n.ERROR="error",n.PAUSED="paused",n.AWAITING_PROCESSING="awaiting_processing",n.RETRYING="retrying",n.SKIPPED="skipped";let j={in_processing:"In processing",pending:"Pending",complete:"Complete",error:"Error",paused:"Paused",awaiting_processing:"Awaiting input",retrying:"Retrying",skipped:"Skipped"},y={error:"error",skipped:"warning",awaiting_processing:"minos",in_processing:void 0,pending:void 0,complete:void 0,paused:void 0,retrying:void 0};(s=l||(l={})).REQUEST_UPDATE="Request update",s.INTERNAL_COMMENT="Internal comment";let v={"Request update":"sandstone","Internal comment":"marble"};var f=i(90005),_=i.n(f),b=i(16394),w=i(38450),T=i.n(w),R=e=>{let{item:t}=e,{author:i,title:n,date:s,type:a,onClick:c,isError:d,isSkipped:u,isAwaitingInput:p,description:m}=t,h=(0,b.p6)(s),x=!!c,g=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:T().header,children:[(0,r.jsxs)("span",{className:T().author,"data-testid":"activity-timeline-author",children:[i,":"]}),n&&(0,r.jsxs)("span",{className:_()(T().title,{[T()["title--error"]]:d,[T()["title--awaiting-input"]]:p}),"data-testid":"activity-timeline-title",children:[n,d&&" failed"]}),(0,r.jsx)("span",{className:T().timestamp,"data-testid":"activity-timeline-timestamp",children:h}),(0,r.jsx)(o.j8w,{className:T().type,color:v[a],"data-testid":"activity-timeline-type",children:a}),(d||u||p)&&(0,r.jsx)("span",{className:T().viewLogs,"data-testid":"activity-timeline-view-logs",children:"View Log"})]}),m&&(0,r.jsx)("div",{className:"mt-2 pl-2.5",children:(0,r.jsx)(o.AntTypography.Paragraph,{className:"!mb-0 whitespace-pre-wrap",children:m})})]}),j={className:_()(T().itemButton,{[T()["itemButton--error"]]:d,[T()["itemButton--awaiting-input"]]:p,[T()["itemButton--clickable"]]:x,[T()["itemButton--comment"]]:a===l.INTERNAL_COMMENT}),"data-testid":"activity-timeline-item"};return x?(0,r.jsx)("button",{type:"button",onClick:c,...j,children:g}):(0,r.jsx)("div",{...j,children:g})},q=i(25980),C=i(54427),E=i(78780);let{useGetCommentsQuery:A,useCreateCommentMutation:k,useGetCommentDetailsQuery:S,useLazyGetCommentDetailsQuery:N}=E.u.injectEndpoints({endpoints:e=>({getComments:e.query({query:e=>{let{privacy_request_id:t,page:i=1,size:n}=e;return{url:"plus/privacy-request/".concat(t,"/comment"),method:"GET",params:{page:i,size:n}}},providesTags:["Privacy Request Comments"]}),createComment:e.mutation({query:e=>{let{privacy_request_id:t,comment_text:i,comment_type:n}=e,s=new FormData;return s.append("comment_text",i),s.append("comment_type",n),{url:"plus/privacy-request/".concat(t,"/comment"),method:"POST",body:s,formData:!0}},invalidatesTags:["Privacy Request Comments","Request"]}),getCommentDetails:e.query({query:e=>{let{privacy_request_id:t,comment_id:i}=e;return{url:"plus/privacy-request/".concat(t,"/comment/").concat(i),method:"GET"}}})})}),{reducer:P}=(0,C.oM)({name:"privacyRequestComments",initialState:{},reducers:{}}),I=e=>{let{plus:t}=(0,q.hz)(),{data:i,isLoading:n,error:s}=A({privacy_request_id:e,size:100},{skip:!t});return(0,h.useEffect)(()=>{s&&o.Pg3.error("Failed to fetch the request comments")},[s]),{commentItems:(null==i?void 0:i.items)?i.items.map(e=>({author:e.user_first_name&&e.user_last_name?"".concat(e.user_first_name," ").concat(e.user_last_name):e.username||"Unknown",date:new Date(e.created_at),type:l.INTERNAL_COMMENT,showViewLog:!1,description:e.comment_text,isError:!1,isSkipped:!1,isAwaitingInput:!1,id:"comment-".concat(e.id)})):[],isLoading:n}},O=e=>{let t=!e;return{eventItems:e?Object.entries(e).map(e=>{let[t,i]=e,n=i.some(e=>e.status===a.ERROR),s=i.some(e=>e.status===a.SKIPPED),r=i.some(e=>e.status===a.AWAITING_PROCESSING);return{author:"Fides",title:t,date:new Date(i[0].updated_at),type:l.REQUEST_UPDATE,showViewLog:n||s||r,onClick:()=>{},isError:n,isSkipped:s,isAwaitingInput:r,id:"request-".concat(t)}}):[],isLoading:t}};var D=i(88340),U=e=>{let{errorMessage:t,status:i=a.ERROR}=e;return(0,r.jsxs)(o.xuv,{height:"100%",id:"outer",children:[(0,r.jsxs)(o.kCb,{alignItems:"center",children:[(0,r.jsx)(o.xvT,{size:"sm",color:"gray.700",fontWeight:"medium",marginRight:"8px",lineHeight:"20px",children:"Status"}),(0,r.jsx)(o.j8w,{color:y[i],children:j[i]}),(0,r.jsx)(o.xuv,{padding:"0px",marginBottom:"3px",children:(0,r.jsx)(D.Z,{copyText:t})})]}),(0,r.jsx)(o.izJ,{marginTop:"4px",marginBottom:"6px"}),(0,r.jsx)(o.xuv,{id:"errorWrapper",overflow:"auto",height:"100%",children:(0,r.jsx)(o.xvT,{children:t})})]})},M=i(3124),z=i.n(M);let W=e=>{switch(e){case x.Us.ACCESS:return"Data Retrieval";case x.Us.ERASURE:return"Data Deletion";case x.Us.CONSENT:return"Consent";case x.Us.UPDATE:return"Data Update";default:return e}};var L=e=>{let{eventLogs:t,onDetailPanel:i}=e,n=null==t?void 0:t.map(e=>(0,r.jsxs)(o.Tr,{backgroundColor:e.status===a.ERROR||e.status===a.SKIPPED&&e.message||e.status===a.AWAITING_PROCESSING?z().FIDESUI_NEUTRAL_50:"unset",onClick:()=>{(e.status===a.ERROR||e.status===a.SKIPPED&&e.message||e.status===a.AWAITING_PROCESSING)&&i(e.message,e.status)},style:{cursor:e.message?"pointer":"unset"},_hover:{backgroundColor:z().FIDESUI_NEUTRAL_50},children:[(0,r.jsx)(o.Td,{children:(0,r.jsx)(o.xvT,{color:"gray.600",fontSize:"xs",lineHeight:"4",fontWeight:"medium",children:(0,b.p6)(e.updated_at)})}),(0,r.jsx)(o.Td,{children:(0,r.jsx)(o.xvT,{color:"gray.600",fontSize:"xs",lineHeight:"4",fontWeight:"medium",children:W(e.action_type)})}),(0,r.jsx)(o.Td,{children:(0,r.jsx)(o.j8w,{color:y[e.status],children:j[e.status]})}),(0,r.jsx)(o.Td,{children:(0,r.jsx)(o.xvT,{color:"gray.600",fontSize:"xs",lineHeight:"4",fontWeight:"medium",children:e.collection_name})})]},e.updated_at));return(0,r.jsx)(o.xuv,{width:"100%",paddingTop:"0px",height:"100%",children:(0,r.jsx)(o.xJi,{id:"tableContainer",height:"100%",style:{overflowY:"auto"},children:(0,r.jsxs)(o.iA_,{size:"sm",id:"table",position:"relative",children:[(0,r.jsx)(o.hrZ,{id:"tableHeader",position:"sticky",top:"0px",backgroundColor:"white",children:(0,r.jsxs)(o.Tr,{children:[(0,r.jsx)(o.Th,{children:(0,r.jsx)(o.xvT,{color:"black",fontSize:"xs",lineHeight:"4",fontWeight:"medium",children:"Time"})}),(0,r.jsx)(o.Th,{children:(0,r.jsx)(o.xvT,{color:"black",fontSize:"xs",lineHeight:"4",fontWeight:"medium",children:"Action Type"})}),(0,r.jsx)(o.Th,{children:(0,r.jsx)(o.xvT,{color:"black",fontSize:"xs",lineHeight:"4",fontWeight:"medium",children:"Status"})}),(0,r.jsx)(o.Th,{children:(0,r.jsx)(o.xvT,{color:"black",fontSize:"xs",lineHeight:"4",fontWeight:"medium",children:"Collection"})})]})}),(0,r.jsx)(o.p3B,{id:"tableBody",children:n})]})})})},B=e=>{let{isOpen:t,onClose:i,currentLogs:n,isViewingError:s,errorMessage:l,currentStatus:c=a.ERROR,onCloseErrorPanel:d,onOpenErrorPanel:u}=e;return(0,r.jsxs)(o.dys,{isOpen:t,placement:"right",onClose:i,size:"full",autoFocus:!1,"data-testid":"log-drawer",children:[(0,r.jsx)(o.P1B,{}),(0,r.jsxs)(o.scA,{style:{width:"50%"},"data-testid":"log-drawer",children:[(0,r.jsx)(o.OXI,{style:{paddingBottom:"0px"},children:(0,r.jsxs)(o.kCb,{justifyContent:"space-between",alignItems:"center",height:"40px",children:[(0,r.jsxs)(o.kCb,{alignItems:"center",children:[s&&(0,r.jsx)(o.wpx,{icon:(0,r.jsx)(o.Rpv,{}),"aria-label":"Close error logs",size:"small",onClick:d}),(0,r.jsx)(o.xvT,{color:"gray.900",fontSize:"md",lineHeight:"6",fontWeight:"medium",ml:1,children:s?"Event detail":"Event log"})]}),(0,r.jsx)(o.wpx,{icon:(0,r.jsx)(o.LGN,{width:"17px"}),"aria-label":"Stop viewing error message",size:"small",onClick:i,"data-testid":"log-drawer-close"})]})}),(0,r.jsxs)(o.Ng0,{id:"drawerBody",overflow:"hidden",children:[n&&!s?(0,r.jsx)(L,{eventLogs:n,onDetailPanel:u}):null,s?(0,r.jsx)(U,{errorMessage:l,status:c}):null]})]})]})},F=e=>{let{subjectRequest:t}=e,{isOpen:i,onOpen:n,onClose:s}=(0,o.qY0)(),[c,d]=(0,h.useState)([]),[u,p]=(0,h.useState)(""),[m,x]=(0,h.useState)(!1),[g,j]=(0,h.useState)(""),[y,v]=(0,h.useState)(a.ERROR),{results:f,id:_}=t,{commentItems:b,isLoading:w}=I(_),{eventItems:q,isLoading:C}=O(f);(0,h.useEffect)(()=>{u&&f&&f[u]&&d(f[u])},[f,u]);let E=()=>{x(!1)},A=(0,h.useCallback)((e,t)=>{p(e),d(t),n()},[n]),k=(0,h.useMemo)(()=>{let e=q.map(e=>{if("Request update"===e.type&&e.title&&f){let t=e.title;if(f[t])return{...e,onClick:()=>A(t,f[t])}}return e});return[{author:"Fides",title:"Access request received",date:new Date(t.created_at),type:l.REQUEST_UPDATE,showViewLog:!1,isError:!1,isSkipped:!1,isAwaitingInput:!1,id:"initial-request"},...e,...b].sort((e,t)=>new Date(e.date).getTime()-new Date(t.date).getTime())},[q,b,f,A,t.created_at]);return(0,r.jsxs)(o.xuv,{width:"100%",children:[(0,r.jsx)(o.krs,{className:"!border-none",bordered:!1,split:!1,"data-testid":"activity-timeline-list",children:(0,r.jsx)("ul",{className:"!list-none",children:w||C?(0,r.jsx)("div",{className:T().itemButton,"data-testid":"timeline-skeleton",children:(0,r.jsx)(o.N_L,{paragraph:{rows:2},active:!0})}):k.map(e=>(0,r.jsx)("li",{children:(0,r.jsx)(R,{item:e})},e.id))})}),(0,r.jsx)(B,{isOpen:i,onClose:()=>{m&&E(),p(""),s()},currentLogs:c,isViewingError:m,errorMessage:g,currentStatus:y,onOpenErrorPanel:(e,t)=>{j(e),t&&v(t),x(!0)},onCloseErrorPanel:E})]})},G=i(66187);let Z=e=>{let{privacyRequestId:t,onCancel:i}=e,[n,s]=(0,h.useState)(""),a=(0,h.useRef)(null),[l,{isLoading:c}]=k();(0,h.useEffect)(()=>{a.current&&a.current.focus()},[]);let d=async()=>{if(n.trim())try{await l({privacy_request_id:t,comment_text:n,comment_type:G.i.NOTE}).unwrap(),s(""),i()}catch(e){console.error("Failed to add comment:",e),o.Pg3.error({content:"Failed to add comment",duration:5})}},u=[{key:"internal",label:"Internal comment",children:(0,r.jsx)(o.uFc.TextArea,{ref:a,value:n,onChange:e=>s(e.target.value),rows:3,className:"mb-3 h-[150px] w-full !resize-none","data-testid":"comment-input"})}];return(0,r.jsxs)("div",{children:[(0,r.jsx)(o.A5g,{items:u}),(0,r.jsxs)(o.jqI,{justify:"flex-end",className:"gap-2",children:[(0,r.jsx)(o.wpx,{onClick:i,"data-testid":"cancel-comment-button",children:"Cancel"}),(0,r.jsx)(o.wpx,{onClick:d,loading:c,disabled:!n.trim(),type:"primary",htmlType:"button","data-testid":"submit-comment-button",children:"Save"})]})]})};var J=e=>{let{subjectRequest:t}=e,[i,n]=(0,h.useState)(!1);return(0,r.jsxs)("div",{className:"w-full",children:[(0,r.jsx)(F,{subjectRequest:t}),i?(0,r.jsx)(Z,{privacyRequestId:t.id,onCancel:()=>n(!1)}):(0,r.jsx)(g.ZP,{scopes:[x.Sh.COMMENT_CREATE],children:(0,r.jsx)(o.jqI,{justify:"flex-start",className:"mt-2",children:(0,r.jsxs)(o.wpx,{type:"default",onClick:()=>n(!0),className:"flex items-center","data-testid":"add-comment-button",children:["Add comment ",(0,r.jsx)("span",{className:"ml-1",children:"+"})]})})})]})},H=i(14207),V=i(46238),Y=i(45116),K=i(72281),Q=i(14047),X=i(90867),$=i(16134);let ee=e=>Array.from(new Set(e.filter(e=>Object.values(x.Us).includes(e.action_type)).map(e=>e.action_type)));var et=e=>{let{rules:t}=e,i=ee(t).map(e=>(0,b.kC)(e)).map(e=>e);return(0,r.jsx)(o.AntTypography.Text,{children:i.join(" - ")})},ei=i(34090),en=i(55484),es=e=>{let{connectorName:t,data:i,isSubmitting:n=!1,onSaveClick:s}=e,{isOpen:a,onOpen:l,onClose:c}=(0,o.qY0)(),d=(0,h.useRef)(null),u=async(e,t)=>{s({connection_key:i.connection_key,privacy_request_id:i.privacy_request_id,body:{...e}}),c()};return(0,r.jsxs)(r.Fragment,{children:[(null==i?void 0:i.checked)&&(0,r.jsx)(o.wpx,{onClick:l,size:"small",children:"Review"}),!(null==i?void 0:i.checked)&&(0,r.jsx)(o.wpx,{onClick:l,size:"small",type:"primary",children:"Begin manual input"}),(0,r.jsx)(ei.J9,{enableReinitialize:!0,initialValues:{...i.fields},onSubmit:u,validateOnBlur:!1,validateOnChange:!1,validationSchema:en.Ry().shape({}),children:e=>(0,r.jsxs)(o.dys,{isOpen:a,placement:"right",initialFocusRef:d,onClose:c,size:"lg",children:[(0,r.jsx)(o.P1B,{}),(0,r.jsxs)(o.scA,{children:[(0,r.jsx)(o.cCv,{}),(0,r.jsxs)(o.OXI,{color:"gray.900",children:[(0,r.jsx)(o.xvT,{fontSize:"xl",mb:8,children:t}),(0,r.jsx)(o.izJ,{}),(0,r.jsx)(o.xvT,{fontSize:"md",mt:"4",children:"Manual access"}),(0,r.jsx)(o.xuv,{mt:"8px",children:(0,r.jsx)(o.xvT,{color:"gray.700",fontSize:"sm",fontWeight:"normal",children:"Please complete the following PII fields that have been collected for the selected subject."})})]}),(0,r.jsx)(o.Ng0,{children:(0,r.jsx)(ei.l0,{id:"manual-detail-form",noValidate:!0,children:(0,r.jsx)(o.gCW,{align:"stretch",gap:"16px",children:Object.entries(i.fields).map((e,t)=>{let[i]=e;return(0,r.jsx)(o.Ugi,{children:(0,r.jsx)(ei.gN,{id:i,name:i,children:e=>{let{field:n}=e;return(0,r.jsxs)(o.NIc,{alignItems:"baseline",display:"inline-flex",children:[(0,r.jsx)(o.lXp,{color:"gray.900",fontSize:"14px",fontWeight:"semibold",htmlFor:i,w:"50%",children:i}),(0,r.jsx)(o.IIB,{...n,autoComplete:"off",color:"gray.700",placeholder:"Please enter ".concat(i),ref:0===t?d:void 0,size:"sm"})]})}})},i)})})})}),(0,r.jsx)(o.zeN,{justifyContent:"flex-start",children:(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(o.wpx,{onClick:c,children:"Cancel"}),(0,r.jsx)(o.wpx,{form:"manual-detail-form",loading:n,htmlType:"submit",children:"Save"})]})})]})]})})]})},ea=e=>{let{connectorName:t,data:i,isSubmitting:n=!1,onSaveClick:s}=e,{isOpen:a,onOpen:l,onClose:c}=(0,o.qY0)(),d=(0,h.useRef)(null),u=async(e,t)=>{s({connection_key:i.connection_key,privacy_request_id:i.privacy_request_id,body:{...e}}),c()};return(0,r.jsxs)(r.Fragment,{children:[(null==i?void 0:i.checked)&&(0,r.jsx)(o.wpx,{onClick:l,size:"small",children:"Review"}),!(null==i?void 0:i.checked)&&(0,r.jsx)(o.wpx,{onClick:l,size:"small",type:"primary",children:"Begin manual input"}),(0,r.jsx)(ei.J9,{enableReinitialize:!0,initialValues:{...i.fields},onSubmit:u,validateOnBlur:!1,validateOnChange:!1,validationSchema:en.Ry().shape({}),children:e=>(0,r.jsxs)(o.dys,{isOpen:a,placement:"right",initialFocusRef:d,onClose:c,size:"lg",children:[(0,r.jsx)(o.P1B,{}),(0,r.jsxs)(o.scA,{children:[(0,r.jsx)(o.cCv,{}),(0,r.jsxs)(o.OXI,{color:"gray.900",children:[(0,r.jsx)(o.xvT,{fontSize:"xl",mb:8,children:t}),(0,r.jsx)(o.izJ,{}),(0,r.jsx)(o.xvT,{fontSize:"md",mt:"4",children:"Manual erasure"}),(0,r.jsx)(o.xuv,{mt:"8px",children:(0,r.jsx)(o.xvT,{color:"gray.700",fontSize:"sm",fontWeight:"normal",children:"Please delete the following PII fields associated with the selected subject if they are available. Once deleted, check the box to confirm the deletion."})})]}),(0,r.jsx)(o.Ng0,{children:(0,r.jsx)(ei.l0,{id:"manual-detail-form",noValidate:!0,children:(0,r.jsx)(o.gCW,{align:"stretch",gap:"16px",children:Object.entries(i.fields).map(e=>{let[t]=e;return(0,r.jsx)(o.Ugi,{children:(0,r.jsx)(ei.gN,{id:t,name:t,children:e=>{let{field:i}=e;return(0,r.jsxs)(o.NIc,{alignItems:"baseline",display:"inline-flex",children:[(0,r.jsx)(o.lXp,{color:"gray.900",fontSize:"14px",fontWeight:"semibold",htmlFor:t,w:"50%",children:t}),(0,r.jsx)(o.XZJ,{...i,isChecked:!!i.value,onChange:i.onChange,name:t,id:t})]})}})},t)})})})}),(0,r.jsx)(o.zeN,{justifyContent:"flex-start",children:(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(o.wpx,{onClick:c,children:"Cancel"}),(0,r.jsx)(o.wpx,{form:"manual-detail-form",loading:n,htmlType:"submit",children:"Save"})]})})]})]})})]})};let el=(e,t,i)=>e.includes(x.Us.ACCESS)?{ProcessingDetailComponent:es,uploadMutation:t,getUploadedWebhookDataEndpoint:X.$I.endpoints.getUploadedManualAccessWebhookData}:e.includes(x.Us.ERASURE)?{ProcessingDetailComponent:ea,uploadMutation:i,getUploadedWebhookDataEndpoint:X.$I.endpoints.getUploadedManualErasureWebhookData}:null;var er=e=>{let{subjectRequest:t,onComplete:i}=e,n=(0,$.T)(),{errorAlert:s,successAlert:a}=(0,Q.V)(),{handleError:l}=(0,Q.H)(),[c,d]=(0,h.useState)([]),[u,p]=(0,h.useState)(!1),[m,g]=(0,h.useState)(!1),{data:j,isFetching:y,isLoading:v,isSuccess:f}=(0,H.W6)(),[_]=(0,X.w3)(),b=ee(t.policy.rules),[w]=(0,X.nL)(),[T]=(0,X.UR)(),{ProcessingDetailComponent:R,uploadMutation:q,getUploadedWebhookDataEndpoint:C}=el(b,w,T),E=async()=>{try{p(!0),await _(t.id).unwrap(),a("Manual request has been received. Request now processing."),i()}catch(e){l(e)}finally{p(!1)}},A=async e=>{try{g(!0),await q(e).unwrap();let t={connection_key:e.connection_key,fields:{}};Object.entries(e.body).forEach(e=>{let[i,n]=e;t.fields[i]=n||""});let i=c.map(e=>e.connection_key===t.connection_key?{...e,checked:!0,fields:{...t.fields}}:e);d(i),a("Manual input successfully saved!")}catch(e){l(e)}finally{g(!1)}};return((0,h.useEffect)(()=>(f&&j.length>0&&0===c.length&&(()=>{if(c.length>0)return;let e=[],i=null==j?void 0:j.map(e=>e.connection_config.key);null==i||i.every(i=>e.push(n(C.initiate({connection_key:i,privacy_request_id:t.id})))),Promise.allSettled(e).then(e=>{let t=[];e.forEach((e,i)=>{if("fulfilled"===e.status&&e.value.isSuccess&&e.value.data){let i={checked:e.value.data.checked,fields:{},connection_key:e.value.originalArgs.connection_key,privacy_request_id:e.value.originalArgs.privacy_request_id};Object.entries(e.value.data.fields).forEach(e=>{let[t,n]=e;i.fields[t]=n||""}),t.push(i)}else s("An error occurred while loading manual input data for ".concat(j[i].connection_config.name))}),d(t)})})(),()=>{}),[j,c.length,n,s,f,t.id,C]),b.includes(x.Us.ACCESS)||b.includes(x.Us.ERASURE))?(0,r.jsxs)(o.gCW,{align:"stretch",spacing:8,children:[(0,r.jsx)(o.xuv,{children:(0,r.jsx)(o.xvT,{color:"gray.700",fontSize:"sm",children:"The following table details the integrations that require manual input from you."})}),(0,r.jsxs)(o.xuv,{children:[(y||v)&&(0,r.jsx)(o.M5Y,{children:(0,r.jsx)(o.$jN,{})}),f&&j?(0,r.jsx)(o.xJi,{children:(0,r.jsxs)(o.iA_,{size:"sm",variant:"unstyled",children:[(0,r.jsx)(o.hrZ,{children:(0,r.jsxs)(o.Tr,{children:[(0,r.jsx)(o.Th,{fontSize:"sm",fontWeight:"semibold",pl:"0",textTransform:"none",children:"Integration Identifier"}),(0,r.jsx)(o.Th,{})]})}),(0,r.jsxs)(o.p3B,{children:[j.length>0&&j.map(e=>(0,r.jsxs)(o.Tr,{display:"block",children:[(0,r.jsx)(o.Td,{pl:"0",children:e.connection_config.key}),(0,r.jsx)(o.Td,{children:c.length>0?(0,r.jsx)(R,{connectorName:e.connection_config.name,data:c.find(t=>t.connection_key===e.connection_config.key),isSubmitting:m,onSaveClick:A}):null})]},e.id)),0===j.length&&(0,r.jsx)(o.Tr,{children:(0,r.jsx)(o.Td,{colSpan:3,pl:"0",children:(0,r.jsx)(o.M5Y,{children:(0,r.jsx)(o.xvT,{children:"You don‘t have any Manual Process connections set up yet."})})})})]}),c.length>0&&c.every(e=>e.checked)?(0,r.jsx)(o.$RU,{children:(0,r.jsx)(o.Tr,{children:(0,r.jsx)(o.Th,{pl:"0px",children:(0,r.jsx)(o.wpx,{type:"primary",loading:u,onClick:E,className:"mt-2",children:"Complete DSR"})})})}):null]})}):null]})]}):null},eo=e=>{let{subjectRequest:t,onComplete:i}=e,n=(0,c.useRouter)(),{data:s}=(0,H.AZ)({}),a=(0,h.useMemo)(()=>{var e;return(null==s?void 0:null===(e=s.items)||void 0===e?void 0:e.filter(e=>e.connection_type===x.Rj.MANUAL_TASK))||[]},[s]),{data:l}=(0,H.W6)(),d=(l||[]).length>0,{data:p}=(0,Y.Ym)({page:1,size:100,privacyRequestId:t.id}),m=(null==p?void 0:p.items)||[],g=m.length,j=m.filter(e=>e.status===x.OS.NEW).length,y=a.length>0;return y||d?(0,r.jsxs)(o.Kqy,{spacing:6,children:[y&&(0,r.jsxs)(o.xuv,{children:[(0,r.jsx)(o.AntTypography.Title,{level:4,style:{marginBottom:12},children:"Manual tasks"}),(0,r.jsxs)(o.Kqy,{spacing:2,children:[(0,r.jsxs)(o.AntTypography.Text,{children:[(0,r.jsx)("strong",{children:g})," task",1!==g?"s":""," ","linked to this privacy request"]}),(0,r.jsxs)(o.AntTypography.Text,{children:[(0,r.jsx)("strong",{children:j})," pending task",1!==j?"s":""]}),g>0&&(0,r.jsx)("div",{className:"mt-2",children:(0,r.jsx)(o.wpx,{type:"primary",onClick:()=>{n.push({pathname:u.Jw,query:{privacy_request_id:t.id,tab:K.G.MANUAL_TASK}})},children:"View all tasks for this request →"})})]})]}),d&&(0,r.jsxs)(o.xuv,{children:[(0,r.jsxs)(o.kCb,{alignItems:"center",style:{marginBottom:12},children:[(0,r.jsx)(o.AntTypography.Title,{level:4,style:{margin:0,marginRight:8},children:"Manual steps (legacy)"}),(0,r.jsx)(V.b,{label:"This is the legacy manual steps feature. The new manual tasks feature provides more advanced capabilities and better user experience."})]}),(0,r.jsx)(er,{subjectRequest:t,onComplete:i||(()=>{})})]})]}):(0,r.jsx)(o.xuv,{p:4,children:(0,r.jsx)(o.AntTypography.Text,{type:"secondary",children:"No manual tasks or legacy manual steps configured for this request."})})},ec=i(59969);let ed={approved:{color:"success",label:"Approved"},complete:{color:"success",label:"Completed"},awaiting_email_send:{color:"marble",label:"Awaiting Email Send"},denied:{color:"warning",label:"Denied"},canceled:{color:"marble",label:"Canceled"},error:{color:"error",label:"Error"},in_processing:{color:"caution",label:"In Progress"},paused:{color:"marble",label:"Paused"},pending:{color:"info",label:"New"},identity_unverified:{color:"marble",label:"Unverified"},requires_input:{color:"minos",label:"Requires Input"}};var eu=e=>{let{status:t}=e;return(0,r.jsx)(o.j8w,{color:ed[t].color,className:"justify-center","data-testid":"request-status-badge",children:ed[t].label})},ep=i(18225),em=i(812),eh=i(7842);let{useGetAttachmentsQuery:ex,useUploadAttachmentMutation:eg,useGetAttachmentDetailsQuery:ej,useLazyGetAttachmentDetailsQuery:ey}=E.u.injectEndpoints({endpoints:e=>({getAttachments:e.query({query:e=>{let{privacy_request_id:t,page:i=1,size:n}=e;return{url:"plus/privacy-request/".concat(t,"/attachment"),method:"GET",params:{page:i,size:n}}},providesTags:["Privacy Request Attachments"]}),uploadAttachment:e.mutation({query:e=>{let{privacy_request_id:t,attachment_type:i,attachment_file:n}=e,s=new FormData;return s.append("attachment_type",i),s.append("attachment_file",n),{url:"plus/privacy-request/".concat(t,"/attachment"),method:"POST",body:s,params:{}}},invalidatesTags:["Privacy Request Attachments"]}),getAttachmentDetails:e.query({query:e=>{let{privacy_request_id:t,attachment_id:i}=e;return{url:"plus/privacy-request/".concat(t,"/attachment/").concat(i),method:"GET"}}})})}),{reducer:ev}=(0,C.oM)({name:"privacyRequestAttachments",initialState:{},reducers:{}}),ef=e=>{let{file:t}=e,[i,n]=(0,h.useState)(!1),[s]=ey(),a=async()=>{var e,i,a;if((null===(e=t.customData)||void 0===e?void 0:e.attachment_id)&&(null===(i=t.customData)||void 0===i?void 0:i.privacy_request_id)){n(!0);try{let e=await s({privacy_request_id:t.customData.privacy_request_id,attachment_id:t.customData.attachment_id}),i=null===(a=e.data)||void 0===a?void 0:a.retrieved_attachment_url,n=null==i?void 0:i.startsWith("http");i&&n?window.open(i,"_blank"):i&&!n?o.Pg3.info("Download is not available when using local storage methods."):o.Pg3.error("No download URL available for ".concat(t.name))}catch(e){o.Pg3.error("Failed to fetch attachment download URL")}finally{n(!1)}}};return(0,r.jsxs)(o.jqI,{align:"center",gap:8,children:[(0,r.jsx)(o.PJP.PgN,{className:"shrink-0"}),(0,r.jsx)(o.lKn,{ellipsis:{tooltip:t.name},className:"grow",children:t.name}),(0,r.jsx)(o.wpx,{type:"text",icon:(0,r.jsx)(o.PJP.UWx,{}),onClick:a,loading:i,className:"shrink-0"})]})},e_=(e,t)=>(0,r.jsx)(ef,{file:t});var eb=e=>{let{subjectRequest:t}=e,[i,n]=(0,h.useState)(!1),s=(0,g.Tg)([x.Sh.ATTACHMENT_READ]),a=(0,g.Tg)([x.Sh.ATTACHMENT_CREATE]),[l]=eg(),{data:c,isLoading:d,error:u}=(0,X.PW)(),{data:p,isLoading:m}=ex({privacy_request_id:t.id}),{refetch:j}=ex({privacy_request_id:t.id}),y=(null==p?void 0:p.items.map(e=>({uid:e.id,name:e.file_name,status:"done",customData:{attachment_id:e.id,privacy_request_id:t.id}})))||[],v=(0,h.useCallback)(()=>(0,r.jsx)(o.PJP.PgN,{}),[]);if(!s)return null;let f=a&&(null==c?void 0:c.key),_=[".pdf",".doc",".docx",".xls",".xlsx",".txt",".csv",".jpg",".jpeg",".png",".zip"];return(0,r.jsx)("div",{children:(0,r.jsxs)("div",{className:"mt-6",children:[(0,r.jsx)("div",{className:"mb-6",children:(0,r.jsx)(o.lQT,{level:3,children:"Attachments"})}),d||m?(0,r.jsx)(ep.Z,{size:"md",alignment:"start"}):(0,r.jsx)(o.pMK,{name:"attachment_file",fileList:y,iconRender:v,showUploadList:{showRemoveIcon:!1,showDownloadIcon:!1},itemRender:e_,accept:_.join(","),customRequest:async e=>{let{file:i,onSuccess:s,onError:a}=e,r=i.name;try{n(!0),await l({privacy_request_id:t.id,attachment_file:i,attachment_type:eh.s.INTERNAL_USE_ONLY}).unwrap(),o.Pg3.success("".concat(r," file uploaded successfully")),j(),null==s||s(i)}catch(e){o.Pg3.error("".concat(r," file upload failed.")),null==a||a(e)}finally{n(!1)}},disabled:!f,children:a&&(0,r.jsx)(o.esZ,{title:u&&"Add attachment not available: ".concat((0,em.e$)(u)),placement:"top",children:(0,r.jsxs)(o.jqI,{align:"center",gap:12,className:"mb-4",children:[(0,r.jsx)(o.wpx,{icon:(0,r.jsx)(o.PJP.mm_,{}),iconPosition:"end",disabled:!f||i,loading:i,children:i?"Uploading":"Add"}),(0,r.jsx)(V.b,{label:"Uploaded attachments are for internal use and won't be send as part of the request package.\n Accepted filetypes: ".concat(_.join(", ")),placement:"top"})]})})})]})})},ew=i(15709),eT=i.n(ew),eR=e=>{let{label:t,children:i}=e;return(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)("div",{className:"shrink-0 grow-0 basis-1/2 pr-2 ".concat(eT().label),children:(0,r.jsxs)(o.AntTypography.Text,{children:[t,":"]})}),(0,r.jsx)("div",{className:"min-w-0 shrink grow ".concat(eT().value),"data-testid":"request-detail-value-".concat(t),children:i})]})},eq=e=>{let{subjectRequest:t}=e,{custom_privacy_request_fields:i}=t;return(0,r.jsx)("div",{className:"flex flex-col gap-2",children:i&&Object.keys(i).length>0&&Object.entries(i).filter(e=>{let[,t]=e;return t.value}).map(e=>{let[t,i]=e;return(0,r.jsx)(eR,{label:i.label,children:(0,r.jsx)(o.AntTypography.Text,{children:Array.isArray(i.value)?i.value.join(", "):i.value})},t)})})},eC=e=>{let{subjectRequest:t}=e,{plus:i}=(0,q.hz)(),{id:n,status:s,policy:a,identity:l,identity_verified_at:c}=t;return(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"mb-6",children:(0,r.jsx)(o.AntTypography.Title,{level:2,children:"Request details"})}),(0,r.jsxs)(o.jqI,{vertical:!0,gap:12,className:"mb-6",children:[(0,r.jsx)(eR,{label:"Status",children:(0,r.jsx)(eu,{status:s})}),(0,r.jsx)(eR,{label:"Time remaining",children:(0,r.jsx)(ec.Z,{daysLeft:t.days_left,includeText:!0,status:t.status})}),(0,r.jsx)(eR,{label:"Request type",children:(0,r.jsx)(et,{rules:a.rules})}),(0,r.jsx)(eR,{label:"Source",children:i&&(0,r.jsx)(o.AntTypography.Text,{children:t.source||"-"})}),Object.entries(l).filter(e=>{let[,{value:t}]=e;return null!==t}).map(e=>{let[t,{value:i="",label:n}]=e,s="".concat(i).concat(c?"":" (Unverified)");return(0,r.jsx)(eR,{label:"Subject ".concat(n.toLocaleLowerCase()),children:(0,r.jsx)(o.esZ,{title:s,trigger:"click",children:(0,r.jsx)(o.AntTypography.Text,{ellipsis:!0,children:s})})},t)}),(0,r.jsx)(eq,{subjectRequest:t})]}),(0,r.jsxs)(o.PPS,{layout:"vertical",children:[(0,r.jsx)(o.PPS.Item,{label:"Request ID:",className:"mb-4",children:(0,r.jsx)(o.jqI,{gap:1,children:(0,r.jsxs)(o.vyj.Compact,{style:{width:"100%"},children:[(0,r.jsx)(o.uFc,{readOnly:!0,value:n,"data-testid":"request-detail-value-id"}),(0,r.jsx)(o.wpx,{icon:(0,r.jsx)(D.Z,{copyText:n})})]})})}),(0,r.jsx)(o.PPS.Item,{label:"Policy key:",className:"mb-4",children:(0,r.jsx)(o.uFc,{readOnly:!0,value:t.policy.key,"data-testid":"request-detail-value-policy"})})]}),(0,r.jsx)(eb,{subjectRequest:t})]})},eE=e=>{var t;let{data:i}=e,n=(0,h.useMemo)(()=>({id:i.id,verbose:!0}),[i.id]),{data:s}=(0,m.QA)(n,{pollingInterval:i.status===x.q2.APPROVED||i.status===x.q2.IN_PROCESSING?2e3:0,skip:!i.id}),a=null!==(t=null==s?void 0:s.items[0])&&void 0!==t?t:i,l=a.status===x.q2.REQUIRES_INPUT,[c,d]=(0,h.useState)("activity"),u=(0,h.useMemo)(()=>[{key:"activity",label:"Activity",children:(0,r.jsx)(J,{subjectRequest:a})},{key:"manual-tasks",label:"Manual tasks",children:(0,r.jsx)(eo,{subjectRequest:a,onComplete:()=>d("activity")}),disabled:!l}],[l,a]);return(0,r.jsxs)("div",{className:"flex gap-8",children:[(0,r.jsx)("div",{className:"flex-1",children:(0,r.jsx)(o.A5g,{items:u,activeKey:c,onChange:d})}),(0,r.jsx)("div",{className:"w-1/3 2xl:w-[432px]","data-testid":"privacy-request-details",children:(0,r.jsx)(eC,{subjectRequest:a})})]})},eA=i(57526),ek=i(66548),eS=i(45489),eN=e=>{let{privacyRequest:t,action:i}=e,{handleApproveRequest:n,handleDenyRequest:s}=(0,eS.Z)({subjectRequest:t}),a=t.status===x.q2.PENDING,l=(0,o.qY0)(),r=async e=>{let{reason:t}=e,a=o.Pg3.loading({content:"approve"===i?"Approving request...":"Denying request..."});"deny"===i&&await s(t),"approve"===i&&await n(),a()};return{showAction:a,closeModal:l.onClose,performAction:r,openConfirmationModal:l.onOpen,isModalOpen:l.isOpen}},eP=e=>{var t,i,n;let{privacyRequest:s}=e,a=null===(i=(0,q.hz)())||void 0===i?void 0:null===(t=i.flags)||void 0===t?void 0:t.downloadAccessRequestResults,l=s.status===x.q2.COMPLETE,r=ee(s.policy.rules).includes(x.Us.ACCESS),o=(0,g.Tg)([x.Sh.PRIVACY_REQUEST_ACCESS_RESULTS_READ]),{data:c,isLoading:d,isError:u,error:p}=(0,X.br)({privacy_request_id:s.id}),m=null!==(n=null==c?void 0:c.access_result_urls[0])&&void 0!==n?n:"",h=!!m&&"your local fides_uploads folder"!==m,j=null;return u?j=(0,em.e$)(p,"Unable to resolve download URL"):h||(j="Requests stored locally cannot be downloaded"),{showDownloadResults:a&&o&&r&&l,downloadResults:()=>{let e=document.createElement("a");e.href=m,e.target="_blank",e.rel="noopener noreferrer",e.click(),e.remove()},infoTooltip:j,isLoading:d,isDisabled:!h}},eI=e=>{let{privacyRequest:t}=e,{errorAlert:i,successAlert:n}=(0,Q.V)(),s=t.status===x.q2.ERROR,[a]=(0,X.Fq)();return{reprocessPrivacyRequest:async()=>{if(!t)return;let e=o.Pg3.loading("Reprocessing privacy request...",0),s=await a(t);"error"in s?i((0,em.e$)(s.error),"DSR automation has failed for this privacy request due to the following:",{duration:null}):n("Privacy request is now being reprocessed."),e()},showReprocess:s}},eO=e=>{let{privacyRequest:t}=e,{showDownloadResults:i,downloadResults:n,infoTooltip:s,isDisabled:a}=eP({privacyRequest:t}),{isModalOpen:l,closeModal:c,performAction:d,openConfirmationModal:u,showAction:p}=eN({privacyRequest:t,action:"approve"}),{isModalOpen:m,closeModal:x,performAction:g,openConfirmationModal:j,showAction:y}=eN({privacyRequest:t,action:"deny"}),{reprocessPrivacyRequest:v,showReprocess:f}=eI({privacyRequest:t}),_=(0,h.useMemo)(()=>{let e=[];return e.push({key:"approve",label:(0,r.jsx)("span",{"data-testid":"privacy-request-approve-btn",children:"Approve"}),onClick:u,disabled:!p}),e.push({key:"deny",label:(0,r.jsx)("span",{"data-testid":"privacy-request-deny-btn",children:"Deny"}),onClick:j,disabled:!y}),e.push({key:"reprocess",label:(0,r.jsx)("span",{"data-testid":"privacy-request-action-reprocess",children:"Reprocess"}),onClick:v,disabled:!f}),i&&e.push({key:"download",label:(0,r.jsx)(o.esZ,{title:a?s:null,placement:"bottom",children:(0,r.jsx)("span",{"data-testid":"download-results-btn",children:"Download request results"})}),onClick:n,disabled:a}),e},[i,n,s,a,p,y,u,j,f,v]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(o.S0p,{menu:{items:_},trigger:["click"],overlayStyle:{minWidth:"160px"},children:(0,r.jsx)(o.wpx,{icon:(0,r.jsx)(o.PJP.pO,{}),"data-testid":"privacy-request-actions-dropdown-btn",iconPosition:"end",type:"primary",disabled:!_.length,size:"large",children:"Actions"})}),(0,r.jsx)(eA.Z,{isOpen:l,isLoading:!1,onClose:c,onApproveRequest:()=>d({reason:""}),subjectRequest:t}),(0,r.jsx)(ek.Z,{isOpen:m,onClose:x,onDenyRequest:e=>g({reason:e})})]})},eD=()=>{let e=(0,c.useRouter)().query.id,{data:t,isLoading:i}=(0,m.QA)({id:e,verbose:!0},{skip:!e}),n=(null==t?void 0:t.items[0])||null;return(0,r.jsxs)(d.Z,{title:"Privacy Request - ".concat(e),children:[(0,r.jsx)(p.Z,{heading:"Privacy Requests",breadcrumbItems:[{title:"All requests",href:u.Jw},{title:"Request details"}],rightContent:!!n&&(0,r.jsx)(eO,{privacyRequest:n})}),i&&(0,r.jsx)(o.M5Y,{children:(0,r.jsx)(o.$jN,{})}),!i&&!n&&(0,r.jsx)(o.xvT,{children:"404 no privacy request found"}),!i&&n&&(0,r.jsx)(eE,{data:n})]})}},15709:function(e){e.exports={value:"RequestDetailsRow_value__WMXn3",label:"RequestDetailsRow_label__dn3CQ"}},38450:function(e){e.exports={container:"ActivityTimelineEntry_container__tCva0","container--open":"ActivityTimelineEntry_container--open__1d9mA",itemButton:"ActivityTimelineEntry_itemButton__MlmWS","itemButton--error":"ActivityTimelineEntry_itemButton--error__UizD2","itemButton--comment":"ActivityTimelineEntry_itemButton--comment__g98SH","itemButton--awaiting-input":"ActivityTimelineEntry_itemButton--awaiting-input__6lB5t",header:"ActivityTimelineEntry_header__GYibj",title:"ActivityTimelineEntry_title__rm_g0","title--error":"ActivityTimelineEntry_title--error__fOi0s","title--awaiting-input":"ActivityTimelineEntry_title--awaiting-input__3sPAo",timestamp:"ActivityTimelineEntry_timestamp__uMEMT",viewLogs:"ActivityTimelineEntry_viewLogs___T4jN",logs:"ActivityTimelineEntry_logs__T7R0J","logs--open":"ActivityTimelineEntry_logs--open__o_9Io"}}},function(e){e.O(0,[3988,2888,9774,179],function(){return e(e.s=6554)}),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2369],{1565:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/privacy-requests",function(){return s(27822)}])},35287:function(e,t,s){"use strict";var l=s(24246),i=s(86920),a=s(88038),r=s.n(a);s(27378),t.Z=e=>{let{children:t,title:s,mainProps:a}=e;return(0,l.jsxs)(i.kCb,{"data-testid":s,direction:"column",height:"calc(100vh - 48px)",width:"calc(100vw - 240px)",children:[(0,l.jsxs)(r(),{children:[(0,l.jsxs)("title",{children:["Fides Admin UI - ",s]}),(0,l.jsx)("meta",{name:"description",content:"Privacy Engineering Platform"}),(0,l.jsx)("link",{rel:"icon",href:"/favicon.ico"})]}),(0,l.jsx)(i.kCb,{px:10,py:6,as:"main",overflow:"auto",direction:"column",flex:1,minWidth:0,...a,children:t})]})}},87361:function(e,t,s){"use strict";var l=s(24246),i=s(86920);t.Z=e=>{let{title:t,text:s,onClose:a}=e;return(0,l.jsxs)(i.Ugi,{backgroundColor:"gray.50",border:"1px solid",borderRadius:"md",justifyContent:"space-between",py:4,pr:6,pl:3,"data-testid":"empty-state",gap:2,position:"relative",children:[a&&(0,l.jsx)(i.Two,{boxSize:5,position:"absolute",right:3,top:3,zIndex:1,cursor:"pointer",p:1,onClick:a}),(0,l.jsx)(i.iid,{alignSelf:"start",color:"minos",mt:.5,flexGrow:0}),(0,l.jsxs)(i.kCb,{direction:"column",gap:2,flexGrow:1,children:[(0,l.jsx)(i.X6q,{fontSize:"md",children:t}),(0,l.jsx)(i.xvT,{fontSize:"sm",color:"gray.600",lineHeight:"5",children:s})]})]})}},96718:function(e,t,s){"use strict";s.d(t,{z:function(){return a}});var l=s(24246),i=s(86920);let a=e=>{let{...t}=e,s="multiple"===t.mode;return(0,l.jsx)(i.WPr,{defaultActiveFirstOption:!1,maxTagCount:"responsive",allowClear:!0,dropdownStyle:s?void 0:{width:"auto",minWidth:"200px"},className:"w-auto","data-testid":"filter-select",...t})}},97181:function(e,t,s){"use strict";s.d(t,{d:function(){return o}});var l=s(24246),i=s(86920),a=s(34090),r=s(27378),n=s(46238),d=s(40324);let o=e=>{let{name:t,label:s,labelProps:o,tooltip:u,isRequired:c,layout:p="inline",helperText:m,...h}=e,[x,y,{setValue:v}]=(0,a.U$)(t),j=!!(y.touched&&y.error),[f,_]=(0,r.useState)("");x.value||"tags"!==h.mode&&"multiple"!==h.mode||(x.value=[]),"tags"===h.mode&&"string"==typeof x.value&&(x.value=[x.value]);let g="tags"===h.mode?(e,t)=>e?e.value!==f||x.value.includes(f)?h.optionRender?h.optionRender(e,t):e.label:'Create "'.concat(f,'"'):void 0:h.optionRender||void 0,b=e=>{_(e),h.onSearch&&h.onSearch(e)},C=(e,t)=>{v(e),h.onChange&&h.onChange(e,t)};return"inline"===p?(0,l.jsx)(i.NIc,{isInvalid:j,isRequired:c,children:(0,l.jsxs)(i.rjZ,{templateColumns:s?"1fr 3fr":"1fr",children:[s?(0,l.jsx)(d.__,{htmlFor:h.id||t,...o,children:s}):null,(0,l.jsxs)(i.jqI,{align:"center",children:[(0,l.jsxs)(i.jqI,{vertical:!0,flex:1,className:"mr-2",children:[(0,l.jsx)(i.WPr,{...x,id:h.id||t,"data-testid":"controlled-select-".concat(x.name),...h,optionRender:g,onSearch:"tags"===h.mode?b:void 0,onChange:C,value:x.value||void 0,status:j?"error":void 0}),m&&(0,l.jsx)(i.Q6r,{children:m}),(0,l.jsx)(d.Bc,{isInvalid:j,message:y.error,fieldName:x.name})]}),(0,l.jsx)(n.b,{label:u,className:j?"mt-2 self-start":void 0})]})]})}):(0,l.jsx)(i.NIc,{isInvalid:j,isRequired:c,children:(0,l.jsxs)(i.gCW,{alignItems:"start",children:[(0,l.jsxs)(i.jqI,{align:"center",children:[s?(0,l.jsx)(d.__,{htmlFor:h.id||t,fontSize:"xs",my:0,mr:1,...o,children:s}):null,(0,l.jsx)(n.b,{label:u})]}),(0,l.jsx)(i.WPr,{...x,id:h.id||t,"data-testid":"controlled-select-".concat(x.name),...h,optionRender:g,onSearch:"tags"===h.mode?b:void 0,onChange:C,value:x.value||void 0,status:j?"error":void 0}),m&&(0,l.jsx)(i.Q6r,{style:{marginTop:0},children:m}),(0,l.jsx)(d.Bc,{isInvalid:j,message:y.error,fieldName:x.name})]})})}},71784:function(e,t,s){"use strict";s.d(t,{DE:function(){return d},I3:function(){return i},kN:function(){return r},qX:function(){return n},rE:function(){return a}});var l=s(68309);let i=[...new Map([[l.q2.APPROVED,"Approved"],[l.q2.AWAITING_EMAIL_SEND,"Awaiting email send"],[l.q2.CANCELED,"Canceled"],[l.q2.COMPLETE,"Completed"],[l.q2.DENIED,"Denied"],[l.q2.ERROR,"Error"],[l.q2.IN_PROCESSING,"In progress"],[l.q2.PENDING,"New"],[l.q2.PAUSED,"Paused"],[l.q2.IDENTITY_UNVERIFIED,"Unverified"],[l.q2.REQUIRES_INPUT,"Requires input"]])].map(e=>{let[t,s]=e;return{label:s,value:t}}),a=new Map([[l.Us.ACCESS,"Access"],[l.Us.ERASURE,"Erasure"],[l.Us.CONSENT,"Consent"],[l.Us.UPDATE,"Update"]]),r=[...a].map(e=>{let[t,s]=e;return{label:s,value:t}}),n={mailgun:"mailgun",twilio_email:"twilio_email",twilio_text:"twilio_text"},d={local:"local",s3:"s3",gcs:"gcs"}},27822:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return eq}});var l,i,a=s(24246),r=s(35287),n=s(86920),d=s(65218),o=s.n(d),u=s(27378),c=s(25980),p=s(19904),m=s(86677),h=s(59969),x=s(18225),y=s(77830),v=s(28407),j=s(42904),f=s(16394),_=s(71784),g=s(68309),b=s(45116);let C=e=>{let{label:t,children:s}=e;return(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)("div",{className:"shrink-0 grow-0 basis-1/3 pr-2",children:(0,a.jsxs)(n.AntTypography.Text,{className:"text-gray-700",children:[t,":"]})}),(0,a.jsx)("div",{className:"min-w-0 shrink grow text-gray-600",children:s})]})},q=e=>{let{task:t}=e,s=t.request_type===g.k6.ACCESS?g.Us.ACCESS:g.Us.ERASURE,l=_.rE.get(s)||t.request_type;return(0,a.jsxs)("div",{className:"flex flex-col space-y-3","data-testid":"task-details-container",children:[(0,a.jsx)(C,{label:"Name",children:(0,a.jsx)(n.AntTypography.Text,{children:t.name})}),(0,a.jsx)(C,{label:"Description",children:(0,a.jsx)(n.AntTypography.Text,{children:t.description||"-"})}),(0,a.jsx)(C,{label:"Request Type",children:(0,a.jsx)(n.AntTypography.Text,{children:l})}),(0,a.jsx)(C,{label:"Assigned To",children:t.assigned_users&&t.assigned_users.length>0?(0,a.jsx)("div",{className:"flex flex-wrap gap-1","data-testid":"assigned-users-tags",children:t.assigned_users.map(e=>(0,a.jsx)(n.j8w,{"data-testid":"assigned-user-tag-".concat(e.id),children:"".concat(e.first_name||""," ").concat(e.last_name||"").trim()||e.email_address||"Unknown User"},e.id))}):(0,a.jsx)(n.AntTypography.Text,{children:"No one assigned"})}),t.privacy_request.subject_identities&&Object.keys(t.privacy_request.subject_identities).length>0?(0,a.jsx)(C,{label:"Subject identities",children:(0,a.jsx)("div",{className:"flex flex-wrap gap-1",children:Object.entries(t.privacy_request.subject_identities).map(e=>{let[t,s]=e;return(0,a.jsxs)(n.j8w,{children:[t,": ",String(s)]},t)})})}):null,t.privacy_request.custom_fields&&Object.keys(t.privacy_request.custom_fields).length>0?(0,a.jsx)(C,{label:"Custom fields",children:(0,a.jsx)("div",{className:"flex flex-wrap gap-1",children:Object.entries(t.privacy_request.custom_fields).filter(e=>{let[,t]=e;return t}).map(e=>{let[t,s]=e;return(0,a.jsxs)(n.j8w,{children:[t,": ",s]},t)})})}):null]})},k=e=>{let{isOpen:t,onClose:s,task:l}=e,[i,{isLoading:r}]=(0,b.HP)(),[d,o]=(0,u.useState)(""),[c,p]=(0,u.useState)(!1),[m,h]=(0,u.useState)(""),[x,y]=(0,u.useState)([]),v=async()=>{try{await i({privacy_request_id:l.privacy_request.id,manual_field_id:l.manual_field_id,field_key:l.manual_field_id,field_value:l.input_type===g.PF.TEXT?d:l.input_type===g.PF.CHECKBOX?c.toString():void 0,comment_text:m||void 0,attachment:x.length>0?x[0].originFileObj:void 0}).unwrap(),o(""),p(!1),h(""),y([]),s()}catch(e){n.Pg3.error("Failed to complete task. Please try again.")}};return(0,a.jsxs)(n.u_l,{isOpen:t,onClose:s,size:"700px",isCentered:!0,children:[(0,a.jsx)(n.ZAr,{}),(0,a.jsxs)(n.hzk,{maxWidth:"700px","data-testid":"complete-task-modal",children:[(0,a.jsx)(n.xBx,{children:(0,a.jsx)(n.AntTypography.Title,{level:4,children:"Complete Task"})}),(0,a.jsx)(n.fef,{children:(0,a.jsxs)("div",{className:"flex flex-col space-y-6",children:[(0,a.jsx)("div",{children:(0,a.jsx)(q,{task:l})}),(0,a.jsx)(n.htM,{}),(0,a.jsx)("div",{children:(0,a.jsxs)("div",{className:"flex flex-col space-y-4",children:[(()=>{switch(l.input_type){case g.PF.TEXT:return(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("div",{className:"text-sm font-medium text-gray-700",children:"Subject data"}),(0,a.jsx)(n.uFc.TextArea,{value:d,onChange:e=>o(e.target.value),placeholder:"Enter your response...",rows:4,"data-testid":"complete-modal-text-input"})]});case g.PF.CHECKBOX:return(0,a.jsx)("div",{className:"space-y-2",children:(0,a.jsx)(n.E_O,{checked:c,onChange:e=>p(e.target.checked),"data-testid":"complete-modal-checkbox",children:"The task has been completed"})});default:return(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("div",{className:"text-sm font-medium text-gray-700",children:"Upload File"}),(0,a.jsx)("div",{children:(0,a.jsx)(n.pMK,{fileList:x,onChange:e=>{let{fileList:t}=e;return y(t)},beforeUpload:()=>!1,"data-testid":"complete-modal-file-upload",children:(0,a.jsx)(n.wpx,{"data-testid":"complete-modal-upload-button",children:"Click to Upload"})})})]})}})(),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("div",{className:"text-sm font-medium text-gray-700",children:"Internal comment"}),(0,a.jsx)(n.uFc.TextArea,{value:m,onChange:e=>h(e.target.value),placeholder:"Add any additional comments...",rows:3,"data-testid":"complete-modal-comment-input"})]})]})})]})}),(0,a.jsx)(n.mzw,{children:(0,a.jsxs)(n.vyj,{children:[(0,a.jsx)(n.wpx,{onClick:()=>{o(""),p(!1),h(""),y([]),s()},disabled:r,"data-testid":"complete-modal-cancel-button",children:"Cancel"}),(0,a.jsx)(n.wpx,{type:"primary",onClick:v,loading:r,disabled:!(()=>{switch(l.input_type){case g.PF.TEXT:return d.trim().length>0;case g.PF.CHECKBOX:return c;default:return x.length>0}})(),"data-testid":"complete-modal-save-button",children:"Save"})]})})]})]})},S=e=>{let{isOpen:t,onClose:s,task:l}=e,[i,{isLoading:r}]=(0,b.DA)(),[d,o]=(0,u.useState)(""),c=async()=>{try{await i({privacy_request_id:l.privacy_request.id,manual_field_id:l.manual_field_id,field_key:l.manual_field_id,skip_reason:d}).unwrap(),o(""),s()}catch(e){n.Pg3.error("Failed to skip task. Please try again.")}};return(0,a.jsxs)(n.u_l,{isOpen:t,onClose:s,size:"700px",isCentered:!0,children:[(0,a.jsx)(n.ZAr,{}),(0,a.jsxs)(n.hzk,{maxWidth:"700px","data-testid":"skip-task-modal",children:[(0,a.jsx)(n.xBx,{children:(0,a.jsx)(n.AntTypography.Title,{level:4,children:"Skip Task"})}),(0,a.jsx)(n.fef,{children:(0,a.jsxs)("div",{className:"flex flex-col space-y-6",children:[(0,a.jsx)("div",{children:(0,a.jsx)(q,{task:l})}),(0,a.jsx)(n.htM,{}),(0,a.jsx)("div",{children:(0,a.jsx)("div",{className:"flex flex-col space-y-4",children:(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("div",{className:"text-sm font-medium text-gray-700",children:"Reason for skipping (Required)"}),(0,a.jsx)(n.uFc.TextArea,{value:d,onChange:e=>o(e.target.value),placeholder:"Please provide a reason for skipping this task...",rows:4,"data-testid":"skip-modal-comment-input"})]})})})]})}),(0,a.jsx)(n.mzw,{children:(0,a.jsxs)(n.vyj,{children:[(0,a.jsx)(n.wpx,{onClick:()=>{o(""),s()},disabled:r,"data-testid":"skip-modal-cancel-button",children:"Cancel"}),(0,a.jsx)(n.wpx,{type:"primary",onClick:c,loading:r,disabled:!d.trim(),danger:!0,"data-testid":"skip-modal-skip-button",children:"Skip Task"})]})})]})]})},E=e=>{let{task:t}=e,s=(0,m.useRouter)(),{isOpen:l,onOpen:i,onClose:r}=(0,n.qY0)(),{isOpen:d,onOpen:o,onClose:u}=(0,n.qY0)();if(t.status!==g.OS.NEW)return null;let c=[{key:"skip",label:"Skip task",onClick:o},{key:"go-to-request",label:"Go to request",onClick:()=>{s.push({pathname:y.ld,query:{id:t.privacy_request.id}})}}];return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(n.vyj,{size:"small",children:[(0,a.jsx)(n.wpx,{type:"default",onClick:i,size:"small",children:"Complete"}),(0,a.jsx)(n.S0p,{menu:{items:c},trigger:["click"],placement:"bottomRight",overlayStyle:{minWidth:120},children:(0,a.jsx)(n.wpx,{size:"small",icon:(0,a.jsx)(n.PJP.r43,{}),"aria-label":"More actions"})})]}),(0,a.jsx)(k,{isOpen:l,onClose:r,task:t}),(0,a.jsx)(S,{isOpen:d,onClose:u,task:t})]})},w={[g.OS.NEW]:{color:"info",label:"New"},[g.OS.COMPLETED]:{color:"success",label:"Completed"},[g.OS.SKIPPED]:{color:"marble",label:"Skipped"}},R=[{text:"New",value:g.OS.NEW},{text:"Completed",value:g.OS.COMPLETED},{text:"Skipped",value:g.OS.SKIPPED}],T=[{text:"Access",value:g.k6.ACCESS},{text:"Erasure",value:g.k6.ERASURE}],I=(e,t,s)=>[{title:"Task name",dataIndex:"name",key:"name",width:300,render:e=>(0,a.jsx)(n.AntTypography.Text,{ellipsis:{tooltip:e},children:e})},{title:"Status",dataIndex:"status",key:"status",width:120,render:e=>(0,a.jsx)(n.j8w,{color:w[e].color,"data-testid":"manual-task-status-tag",children:w[e].label}),filters:R,filterMultiple:!1},{title:"System",dataIndex:["system","name"],key:"system_name",width:210,filters:e,filterMultiple:!1},{title:"Type",dataIndex:"request_type",key:"request_type",width:150,render:e=>{let t=e===g.k6.ACCESS?g.Us.ACCESS:g.Us.ERASURE,s=_.rE.get(t)||e;return(0,a.jsx)(n.AntTypography.Text,{children:s})},filters:T,filterMultiple:!1},{title:"Assigned to",dataIndex:"assigned_users",key:"assigned_users",width:380,render:e=>{if(!e||0===e.length)return(0,a.jsx)(n.AntTypography.Text,{children:"-"});let t=e.map(e=>({label:(0,f.gJ)(e),value:e.id})),l=e.map(e=>e.id);return(0,a.jsx)(n.d3V,{value:l,options:t,readonly:!0,onTagClick:e=>s(String(e))})},filters:t,filterMultiple:!1},{title:"Days left",dataIndex:["privacy_request","days_left"],key:"days_left",width:140,render:e=>(0,a.jsx)(h.Z,{daysLeft:e||0,includeText:!1,status:g.q2.PENDING})},{title:"Subject identity",dataIndex:["privacy_request","subject_identities"],key:"subject_identities",width:200,render:e=>{if(!e)return(0,a.jsx)(n.AntTypography.Text,{children:"-"});let t=e.email||e.phone_number||"";return(0,a.jsx)(n.AntTypography.Text,{ellipsis:{tooltip:t},children:t})}},{title:"Actions",key:"actions",width:120,render:(e,t)=>(0,a.jsx)(E,{task:t})}],P=()=>{let e=(0,m.useRouter)(),[t,s]=(0,u.useState)(1),[l,i]=(0,u.useState)(25),[r,d]=(0,u.useState)({}),[o,c]=(0,u.useState)(e.query.privacy_request_id||"");(0,u.useEffect)(()=>{let{privacy_request_id:t}=e.query;t&&"string"==typeof t&&(c(t),d(e=>({...e,privacyRequestId:t})))},[e.query]);let{data:p,isLoading:h,isFetching:_}=(0,b.Ym)({page:t,size:l,status:r.status,systemName:r.systemName,requestType:r.requestType,assignedUserId:r.assignedUsers,privacyRequestId:r.privacyRequestId}),{items:g,total:C,filter_options:q}=(0,u.useMemo)(()=>p||{items:[],total:0,pages:0,filter_options:{assigned_users:[],systems:[]}},[p]),k=(0,u.useMemo)(()=>{var e;return(null==q?void 0:null===(e=q.systems)||void 0===e?void 0:e.map(e=>({text:e.name,value:e.name})))||[]},[null==q?void 0:q.systems]),S=(0,u.useMemo)(()=>{var e;return(null==q?void 0:null===(e=q.assigned_users)||void 0===e?void 0:e.map(e=>({text:(0,f.gJ)(e),value:e.id})))||[]},[null==q?void 0:q.assigned_users]),E=(0,u.useMemo)(()=>I(k,S,t=>{e.push({pathname:y.fw,query:{id:t}})}),[k,S,e]);return h?(0,a.jsx)(x.Z,{}):(0,a.jsxs)("div",{className:"mt-2 space-y-4",children:[(0,a.jsx)(n.kCb,{gap:3,align:"center",className:"mb-4",children:(0,a.jsx)(v.H,{globalFilter:o,setGlobalFilter:e=>{c(e||"");let t={...r};e&&e.trim()?t.privacyRequestId=e.trim():delete t.privacyRequestId,d(t),s(1)},placeholder:"Search by privacy request ID",testid:"privacy-request-id-filter"})}),(0,a.jsx)(n.V5H,{columns:E,dataSource:g,rowKey:e=>"".concat(e.privacy_request.id,"-").concat(e.manual_field_id),pagination:{current:t,pageSize:l,total:C||0,showSizeChanger:!0,pageSizeOptions:j.W3,showTotal:(e,t)=>"".concat(t[0],"-").concat(t[1]," of ").concat(e," items"),onChange:(e,t)=>{s(e),t!==l&&(i(t),s(1))}},onChange:(e,t)=>{let l={privacyRequestId:r.privacyRequestId};t.status&&([l.status]=t.status),t.system_name&&([l.systemName]=t.system_name),t.request_type&&([l.requestType]=t.request_type),t.assigned_users&&([l.assignedUsers]=t.assigned_users),d(l),s(1)},locale:{emptyText:(0,a.jsx)("div",{"data-testid":"empty-state",children:"No manual tasks available."})},loading:h||_})]})};var A=s(59003),N=s(92222),O=s(16125),D=s(91317),U=s(14048),F=s(47935),z=s(90867);let M={approved:{colorScheme:"success",label:"Approved"},complete:{label:"Completed",colorScheme:"success"},awaiting_email_send:{label:"Awaiting Email Send",colorScheme:"marble"},denied:{label:"Denied",colorScheme:"warning"},canceled:{label:"Canceled",colorScheme:"marble"},error:{label:"Error",colorScheme:"error"},in_processing:{label:"In Progress",colorScheme:"caution"},paused:{label:"Paused",colorScheme:"marble"},pending:{label:"New",colorScheme:"info"},identity_unverified:{label:"Unverified",colorScheme:"marble"},requires_input:{colorScheme:"minos",label:"Requires Input"}},Z=e=>{let{value:t}=e;return(0,a.jsx)(F.A4,{color:M[t].colorScheme,value:M[t].label,"data-testid":"request-status-badge"})},L=e=>{let t,{daysLeft:s,timeframe:l=45,status:i,includeText:r=!1}=e;if(null==s||i===g.q2.COMPLETE||i===g.q2.CANCELED||i===g.q2.DENIED||i===g.q2.IDENTITY_UNVERIFIED)return null;let n=100*s/l;return n<25?t="error":n>=75?t="success":n>=25&&(t="warning"),(0,a.jsx)(F.A4,{value:r?"".concat(s," days left"):s.toString(),color:t})},W=e=>Array.from(new Set(e.filter(e=>Object.values(g.Us).includes(e.action_type)).map(e=>e.action_type))),Y=e=>{let{value:t}=e,s=W(t).map(e=>_.rE.get(e));return(0,a.jsx)(F.WP,{value:s,cellState:{isExpanded:!0}})};var G=s(58452),V=s(57526),B=s(66548),K=s(45489);let X=e=>{let{subjectRequest:t,...s}=e,l=(0,n.qY0)(),i=(0,n.qY0)(),r=(0,n.qY0)(),{handleApproveRequest:d,handleDenyRequest:o,handleDeleteRequest:u,isLoading:c}=(0,K.Z)({subjectRequest:t});return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(n.Ugi,{...s,children:["pending"!==t.status?null:(0,a.jsx)(n.wpx,{title:"Approve","aria-label":"Approve",icon:(0,a.jsx)(n.PJP.MCw,{}),onClick:l.onOpen,loading:c,disabled:c,"data-testid":"privacy-request-approve-btn",size:"small"}),"pending"!==t.status?null:(0,a.jsx)(n.wpx,{title:"Deny","aria-label":"Deny",icon:(0,a.jsx)(n.PJP.x8P,{}),onClick:i.onOpen,loading:c,disabled:c,"data-testid":"privacy-request-deny-btn",size:"small"}),(0,a.jsx)(p.ZP,{scopes:[g.Sh.PRIVACY_REQUEST_DELETE],children:(0,a.jsx)(n.wpx,{title:"Delete","aria-label":"Delete",icon:(0,a.jsx)(n.PJP.ZNm,{size:14}),onClick:r.onOpen,loading:c,disabled:c,"data-testid":"privacy-request-delete-btn",size:"small"})})]}),(0,a.jsx)(n.h_i,{children:(0,a.jsx)(V.Z,{isOpen:l.isOpen,isLoading:c,onClose:l.onClose,onApproveRequest:d,subjectRequest:t})}),(0,a.jsx)(n.h_i,{children:(0,a.jsx)(B.Z,{isOpen:i.isOpen,onClose:i.onClose,onDenyRequest:o})}),(0,a.jsx)(G.Z,{isOpen:r.isOpen,onClose:r.onClose,onConfirm:u,message:(0,a.jsx)(n.xvT,{children:"You are about to permanently delete the privacy request. Are you sure you would like to continue?"})})]})};(l=i||(i={})).STATUS="status",l.DAYS_LEFT="due_date",l.SOURCE="source",l.REQUEST_TYPE="request_type",l.SUBJECT_IDENTITY="subject_identity",l.TIME_RECEIVED="created_at",l.CREATED_BY="created_by",l.REVIEWER="reviewer",l.ID="id",l.ACTIONS="actions";let H=(0,N.Cl)(),Q=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return[H.accessor(e=>e.status,{id:"status",cell:e=>{let{getValue:t}=e;return(0,a.jsx)(Z,{value:t()})},header:e=>(0,a.jsx)(F.Rr,{value:"Status",...e})}),H.accessor(e=>e.days_left,{id:"due_date",cell:e=>{let{row:t,getValue:s}=e;return(0,a.jsx)(L,{daysLeft:s(),timeframe:t.original.policy.execution_timeframe,status:t.original.status})},header:e=>(0,a.jsx)(F.Rr,{value:"Days left",...e})}),...e?[H.accessor(e=>e.source,{id:"source",cell:e=>e.getValue()?(0,a.jsx)(F.A4,{value:e.getValue()}):(0,a.jsx)(F.G3,{value:void 0}),header:e=>(0,a.jsx)(F.Rr,{value:"Source",...e}),enableSorting:!1})]:[],H.accessor(e=>e.policy.rules,{id:"request_type",cell:e=>{let{getValue:t}=e;return(0,a.jsx)(Y,{value:t()})},header:e=>(0,a.jsx)(F.Rr,{value:"Request type",...e}),enableSorting:!1}),H.accessor(e=>{var t,s;return(null===(t=e.identity)||void 0===t?void 0:t.email.value)||(null===(s=e.identity)||void 0===s?void 0:s.phone_number.value)||""},{id:"subject_identity",cell:e=>{let{getValue:t}=e;return(0,a.jsx)(F.G3,{value:t()})},header:e=>(0,a.jsx)(F.Rr,{value:"Subject identity",...e}),enableSorting:!1}),H.accessor(e=>e.created_at,{id:"created_at",cell:e=>{let{getValue:t}=e;return(0,a.jsx)(F.G3,{value:(0,f.p6)(t())})},header:e=>(0,a.jsx)(F.Rr,{value:"Time received",...e})}),H.accessor(e=>{var t;return(null===(t=e.reviewer)||void 0===t?void 0:t.username)||""},{id:"reviewer",cell:e=>{let{getValue:t}=e;return(0,a.jsx)(F.G3,{value:t()})},header:e=>(0,a.jsx)(F.Rr,{value:"Reviewed by",...e}),enableSorting:!1}),H.accessor(e=>e.id,{id:"id",cell:e=>{let{getValue:t}=e;return(0,a.jsx)(F.G3,{value:t()})},header:e=>(0,a.jsx)(F.Rr,{value:"Request ID",...e}),enableSorting:!1}),H.display({id:"actions",cell:e=>{let{row:t}=e;return(0,a.jsx)(X,{subjectRequest:t.original})},header:e=>(0,a.jsx)(F.Rr,{value:"Actions",...e}),meta:{disableRowClick:!0}})]},J=e=>{let t=(0,O.v9)(z.dp),s=(0,O.I0)();return{handleStatusChange:t=>{s((0,z.CI)(t)),e()},handleActionTypeChange:t=>{s((0,z.aM)(t)),e()},handleFromChange:t=>{s((0,z.su)(null==t?void 0:t.target.value)),e()},handleToChange:t=>{s((0,z.Ue)(null==t?void 0:t.target.value)),e()},handleClearAllFilters:()=>{s((0,z.Mk)()),e()},...t}};var $=s(96718);let ee=e=>{let{onClose:t,onFilterChange:s,...l}=e,{handleStatusChange:i,handleActionTypeChange:r,handleFromChange:d,handleToChange:o,handleClearAllFilters:u,from:c,to:p,status:m,action_type:h}=J(s);return(0,a.jsxs)(n.u_l,{onClose:t,size:"xl",...l,children:[(0,a.jsx)(n.ZAr,{}),(0,a.jsxs)(n.hzk,{children:[(0,a.jsx)(n.xBx,{borderBottomWidth:1,borderBottomColor:"gray.200",children:"All Filters"}),(0,a.jsx)(n.olH,{}),(0,a.jsx)(n.fef,{py:4,sx:{"& label":{mb:0}},children:(0,a.jsxs)(n.Kqy,{gap:4,children:[(0,a.jsxs)(n.Kqy,{children:[(0,a.jsx)(n.lXp,{size:"md",id:"request-date-range-label",children:"Date range"}),(0,a.jsxs)(n.Ugi,{gap:3,children:[(0,a.jsxs)(n.BZy,{size:"sm",flex:1,children:[(0,a.jsx)(n.UiE,{as:"label",htmlFor:"from-date",borderRadius:"md",children:"From"}),(0,a.jsx)(n.IIB,{type:"date",name:"From",value:c,max:p||void 0,onChange:d,borderRadius:"md",id:"from-date","aria-describedby":"request-date-range-label"})]}),(0,a.jsxs)(n.BZy,{size:"sm",flex:1,children:[(0,a.jsx)(n.UiE,{as:"label",htmlFor:"to-date",borderRadius:"md",children:"To"}),(0,a.jsx)(n.IIB,{type:"date",borderRadius:"md",name:"To",value:p,min:c||void 0,onChange:o,id:"to-date","aria-describedby":"request-date-range-label"})]})]})]}),(0,a.jsxs)(n.Kqy,{children:[(0,a.jsx)(n.lXp,{size:"md",htmlFor:"request-status",children:"Status"}),(0,a.jsx)($.z,{id:"request-status",mode:"multiple",options:_.I3,value:m,onChange:i,"data-testid":"request-status-filter"})]}),(0,a.jsxs)(n.Kqy,{children:[(0,a.jsx)(n.lXp,{size:"md",htmlFor:"request-action-type",children:"Request Type"}),(0,a.jsx)($.z,{id:"request-action-type",mode:"multiple",options:_.kN,value:h,onChange:r,"data-testid":"request-action-type-filter"})]})]})}),(0,a.jsxs)(n.mzw,{justifyContent:"space-between",children:[(0,a.jsx)(n.wpx,{type:"text",onClick:u,children:"Clear all"}),(0,a.jsx)(n.wpx,{type:"primary",onClick:t,children:"Done"})]})]})]})},et=e=>{let{...t}=e,{plus:s}=(0,c.hz)(),[l,i]=(0,u.useState)(""),r=(0,O.v9)(z.dp),d=(0,O.v9)(D.rK),o=(0,n.pmc)(),p=(0,m.useRouter)(),h=(0,O.I0)(),{PAGE_SIZES:x,pageSize:y,setPageSize:v,onPreviousPageClick:j,isPreviousPageDisabled:f,onNextPageClick:_,isNextPageDisabled:g,startRange:b,endRange:C,pageIndex:q,setTotalPages:k,resetPageIndexToDefault:S}=(0,F.oi)(),{isOpen:E,onOpen:w,onClose:R}=(0,n.qY0)(),{data:T,isLoading:I,isFetching:P}=(0,z.QA)({...r,page:q,size:y}),{items:M,total:Z}=(0,u.useMemo)(()=>{let e=T||{items:[],total:0,pages:0};return k(e.pages),e},[T,k]),L=(0,u.useCallback)(e=>{h((0,z.mU)(e)),i(e),S()},[h,S,i]),W=async()=>{let e;try{await (0,z.py)({...r,token:d})}catch(t){e=t instanceof Error?t.message:"Unknown error occurred"}e&&o({description:"".concat(e),duration:5e3,status:"error"})},Y=e=>{p.push("/privacy-requests/".concat(e))},G=(0,A.b7)({getCoreRowModel:(0,N.sC)(),data:M,columns:(0,u.useMemo)(()=>Q(s),[s]),getRowId:e=>"".concat(e.status,"-").concat(e.id),manualPagination:!0,columnResizeMode:"onChange"});return(0,a.jsxs)(n.xuv,{...t,children:[(0,a.jsxs)(F.Q$,{children:[(0,a.jsx)(F.HO,{globalFilter:l,setGlobalFilter:L,placeholder:"Search by request ID or identity value"}),(0,a.jsxs)(n.Ugi,{alignItems:"center",spacing:2,children:[(0,a.jsx)(n.wpx,{"data-testid":"filter-btn",onClick:w,children:"Filter"}),(0,a.jsx)(n.wpx,{"aria-label":"Export report","data-testid":"export-btn",icon:(0,a.jsx)(U.nM,{ml:"1.5px"}),onClick:W})]}),(0,a.jsx)(n.h_i,{children:(0,a.jsx)(ee,{isOpen:E,onClose:R,onFilterChange:S})})]}),I?(0,a.jsx)(n.xuv,{p:2,borderWidth:1,children:(0,a.jsx)(F.I4,{rowHeight:26,numRows:10})}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(F.ZK,{tableInstance:G,onRowClick:e=>Y(e.id),onSort:e=>{if(!e){h((0,z.p2)()),S();return}let{id:t,desc:s}=e;h((0,z.PU)(t)),h((0,z.iX)(s?"desc":"asc")),S()}}),(0,a.jsx)(F.s8,{totalRows:Z||0,pageSizes:x,setPageSize:v,onPreviousPageClick:j,isPreviousPageDisabled:f||P,onNextPageClick:_,isNextPageDisabled:g||P,startRange:b,endRange:C})]})]})};var es=s(812),el=s(87361),ei=s(46628),ea=s(34090),er=s(55484),en=s(40324);let ed=(e,t)=>null==t?void 0:t.find(t=>t.policy_key===e),eo=e=>{var t,s;if(!e)return er.Ry().shape({policy_key:er.Z_().required().label("Request type")});let l=e.custom_privacy_request_fields?Object.entries(e.custom_privacy_request_fields).map(e=>{let[t,s]=e;return{[t]:er.Ry().shape({value:s.required&&!s.hidden?er.Z_().required().label(s.label):er.Z_().nullable()})}}).reduce((e,t)=>({...e,...t}),{}):{};return er.Ry().shape({policy_key:er.Z_().required().label("Request type"),identity:er.Ry().shape({email:(null===(t=e.identity_inputs)||void 0===t?void 0:t.email)==="required"?er.Z_().email().required().label("Email address"):er.Z_().nullable(),phone_number:(null===(s=e.identity_inputs)||void 0===s?void 0:s.phone)==="required"?er.Z_().matches(/^\+?[1-9]\d{1,14}$/,"Phone number must be formatted correctly (e.g. 15555555555)").required().label("Phone number"):er.Z_().matches(/^\+?[1-9]\d{1,14}$/,"Phone number must be formatted correctly (e.g. 15555555555)").nullable()}),custom_privacy_request_fields:er.Ry().shape(l)})};var eu=s(97181);let ec={is_verified:!1,policy_key:"",identity:{}},ep=e=>{let{identityInputs:t}=e;return t?(0,a.jsxs)(a.Fragment,{children:[t.email?(0,a.jsx)(en.j0,{name:"identity.email",label:"User email address",isRequired:"required"===t.email,variant:"stacked"}):null,t.phone?(0,a.jsx)(en.j0,{name:"identity.phone_number",label:"User phone number",isRequired:"required"===t.phone,variant:"stacked"}):null]}):null},em=e=>{let{customFieldInputs:t}=e;if(!t)return null;let s=Object.entries(t);return(0,a.jsx)(a.Fragment,{children:s.map(e=>{let[t,s]=e;return(0,a.jsx)(en.j0,{name:"custom_privacy_request_fields.".concat(t,".value"),label:s.label,isRequired:!!s.required,variant:"stacked"},t)})})};var eh=e=>{let{onSubmit:t,onCancel:s}=e,{data:l}=(0,z.xv)();return(0,a.jsx)(ea.J9,{initialValues:ec,onSubmit:t,validationSchema:()=>(0,er.Vo)(e=>eo(ed(e.policy_key,null==l?void 0:l.actions))),children:e=>{var t;let{values:i,dirty:r,isValid:d,isSubmitting:o,setFieldValue:u}=e,c=ed(i.policy_key,null==l?void 0:l.actions);return(0,a.jsx)(ea.l0,{children:(0,a.jsxs)(n.Kqy,{spacing:6,mb:2,children:[(0,a.jsx)(eu.d,{name:"policy_key",label:"Request type",options:null!==(t=null==l?void 0:l.actions.map(e=>({label:e.title,value:e.policy_key})))&&void 0!==t?t:[],onChange:e=>{let t=ed(e,null==l?void 0:l.actions);if(!(null==t?void 0:t.custom_privacy_request_fields)){u("custom_privacy_request_fields",void 0);return}u("custom_privacy_request_fields",Object.entries(t.custom_privacy_request_fields).map(e=>{let[t,s]=e;return{[t]:{label:s.label,value:s.default_value}}}).reduce((e,t)=>({...e,...t}),{}))},layout:"stacked",isRequired:!0}),(0,a.jsx)(ep,{identityInputs:null==c?void 0:c.identity_inputs}),(0,a.jsx)(em,{customFieldInputs:null==c?void 0:c.custom_privacy_request_fields}),(0,a.jsx)(en.Xl,{name:"is_verified",label:"I confirm that I have verified this user information"}),(0,a.jsxs)("div",{className:"flex gap-4 self-end",children:[(0,a.jsx)(n.wpx,{onClick:s,children:"Cancel"}),(0,a.jsx)(n.wpx,{htmlType:"submit",type:"primary",disabled:!i.is_verified||!r||!d,loading:o,"data-testid":"submit-btn",children:"Create"})]})]})})}})},ex=s(31883);let ey=e=>{let{isOpen:t,onClose:s}=e,[l]=(0,z.M6)(),i=(0,n.pmc)(),r=async e=>{let{is_verified:t,...a}=e,r=a.custom_privacy_request_fields?Object.entries(a.custom_privacy_request_fields).map(e=>{let[t,s]=e;return s.value?{[t]:s}:{}}).reduce((e,t)=>({...e,...t}),{}):void 0,n={...a,custom_privacy_request_fields:r},d=await l([n]);(0,ex.D4)(d)?i((0,ei.Vo)((0,es.e$)(d.error,"An error occurred while creating this privacy request. Please try again"))):i((0,ei.t5)("Privacy request created")),s()};return(0,a.jsxs)(n.u_l,{isOpen:t,onClose:s,size:"2xl",isCentered:!0,children:[(0,a.jsx)(n.ZAr,{}),(0,a.jsxs)(n.hzk,{"data-testid":"submit-request-modal",maxHeight:"80%",overflowY:"auto",children:[(0,a.jsx)(n.xBx,{children:"Create privacy request"}),(0,a.jsx)(n.fef,{children:(0,a.jsxs)(n.Kqy,{spacing:4,children:[(0,a.jsx)(el.Z,{title:"Warning: You are bypassing identity verification",text:"You are bypassing Fides' built-in identity verification step. Please ensure that you are only entering information on behalf of a verified and approved user's privacy request."}),(0,a.jsx)(eh,{onSubmit:r,onCancel:()=>s()})]})})]})]})};var ev=()=>{let{onOpen:e,isOpen:t,onClose:s}=(0,n.qY0)();return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(ey,{isOpen:t,onClose:s}),(0,a.jsx)(n.wpx,{type:"primary",onClick:e,"data-testid":"submit-request-btn",children:"Create request"})]})},ej=s(58754),ef=s(14047);let e_=()=>{let{errorAlert:e}=(0,ef.V)(),[t,s]=(0,u.useState)(!1),[l,i]=(0,u.useState)({count:0,total:0}),[r,d]=(0,u.useState)(!0),o=g.q2.ERROR,{data:c}=(0,z.tE)(),{data:p}=(0,z.QA)({status:[o]},{pollingInterval:15e3,skip:r});return(0,u.useEffect)(()=>{d(!(c&&c.notify_after_failures>0))},[c]),(0,u.useEffect)(()=>{let e=(null==p?void 0:p.total)||0;e>=((null==c?void 0:c.notify_after_failures)||0)&&e>l.total?(i({count:e-l.total,total:e}),s(!0)):s(!1)},[null==p?void 0:p.total,null==c?void 0:c.notify_after_failures,l.total]),{processing:()=>{t&&e((0,a.jsxs)(n.xuv,{children:["DSR automation has failed for"," ",(0,a.jsx)(n.xvT,{as:"span",fontWeight:"semibold",children:l.count})," ","privacy request(s). Please review the event log for further details."]}),void 0,{containerStyle:{maxWidth:"max-content"},duration:null,id:"dsrErrorAlert"})}}};var eg=s(72281);let eb=o()(()=>s.e(9676).then(s.bind(s,59676)),{loadableGenerated:{webpack:()=>[59676]},loading:()=>(0,a.jsx)("div",{children:"Loading..."})});var eC=()=>{let{processing:e}=e_(),{plus:t}=(0,c.hz)(),{activeTab:s,handleTabChange:l,availableTabs:i}=(0,eg.d)();(0,u.useEffect)(()=>{e()},[e]);let r=(0,u.useMemo)(()=>{let e=[{key:eg.G.REQUEST,label:"Request",children:(0,a.jsx)(et,{})}];return i.manualTask&&e.push({key:eg.G.MANUAL_TASK,label:"Manual tasks",children:(0,a.jsx)(P,{})}),e},[i.manualTask]);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(ej.Z,{heading:"Privacy Requests",breadcrumbItems:[{title:"All requests"}],rightContent:(0,a.jsxs)(n.vyj,{children:[t&&(0,a.jsx)(p.ZP,{scopes:[g.Sh.PRIVACY_REQUEST_CREATE],children:(0,a.jsx)(ev,{})}),(0,a.jsx)(eb,{})]}),"data-testid":"privacy-requests"}),(0,a.jsx)(n.A5g,{activeKey:s,onChange:l,items:r})]})},eq=()=>(0,a.jsx)(r.Z,{title:"Privacy Requests",children:(0,a.jsx)(eC,{})})},31883:function(e,t,s){"use strict";s.d(t,{Bw:function(){return l.Bw},D4:function(){return l.D4}});var l=s(19043)},76737:function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var s in t)Object.defineProperty(e,s,{enumerable:!0,get:t[s]})}(t,{default:function(){return n},noSSR:function(){return r}});let l=s(51538);s(24246),s(27378);let i=l._(s(21887));function a(e){return{default:(null==e?void 0:e.default)||e}}function r(e,t){return delete t.webpack,delete t.modules,e(t)}function n(e,t){let s=i.default,l={loading:e=>{let{error:t,isLoading:s,pastDelay:l}=e;return null}};e instanceof Promise?l.loader=()=>e:"function"==typeof e?l.loader=e:"object"==typeof e&&(l={...l,...e});let n=(l={...l,...t}).loader;return(l.loadableGenerated&&(l={...l,...l.loadableGenerated},delete l.loadableGenerated),"boolean"!=typeof l.ssr||l.ssr)?s({...l,loader:()=>null!=n?n().then(a):Promise.resolve(a(()=>null))}):(delete l.webpack,delete l.modules,r(s,l))}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},28438:function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"LoadableContext",{enumerable:!0,get:function(){return l}});let l=s(51538)._(s(27378)).default.createContext(null)},21887:function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return p}});let l=s(51538)._(s(27378)),i=s(28438),a=[],r=[],n=!1;function d(e){let t=e(),s={loading:!0,loaded:null,error:null};return s.promise=t.then(e=>(s.loading=!1,s.loaded=e,e)).catch(e=>{throw s.loading=!1,s.error=e,e}),s}class o{promise(){return this._res.promise}retry(){this._clearTimeouts(),this._res=this._loadFn(this._opts.loader),this._state={pastDelay:!1,timedOut:!1};let{_res:e,_opts:t}=this;e.loading&&("number"==typeof t.delay&&(0===t.delay?this._state.pastDelay=!0:this._delay=setTimeout(()=>{this._update({pastDelay:!0})},t.delay)),"number"==typeof t.timeout&&(this._timeout=setTimeout(()=>{this._update({timedOut:!0})},t.timeout))),this._res.promise.then(()=>{this._update({}),this._clearTimeouts()}).catch(e=>{this._update({}),this._clearTimeouts()}),this._update({})}_update(e){this._state={...this._state,error:this._res.error,loaded:this._res.loaded,loading:this._res.loading,...e},this._callbacks.forEach(e=>e())}_clearTimeouts(){clearTimeout(this._delay),clearTimeout(this._timeout)}getCurrentValue(){return this._state}subscribe(e){return this._callbacks.add(e),()=>{this._callbacks.delete(e)}}constructor(e,t){this._loadFn=e,this._opts=t,this._callbacks=new Set,this._delay=null,this._timeout=null,this.retry()}}function u(e){return function(e,t){let s=Object.assign({loader:null,loading:null,delay:200,timeout:null,webpack:null,modules:null},t),a=null;function d(){if(!a){let t=new o(e,s);a={getCurrentValue:t.getCurrentValue.bind(t),subscribe:t.subscribe.bind(t),retry:t.retry.bind(t),promise:t.promise.bind(t)}}return a.promise()}if(!n){let e=s.webpack?s.webpack():s.modules;e&&r.push(t=>{for(let s of e)if(t.includes(s))return d()})}function u(e,t){!function(){d();let e=l.default.useContext(i.LoadableContext);e&&Array.isArray(s.modules)&&s.modules.forEach(t=>{e(t)})}();let r=l.default.useSyncExternalStore(a.subscribe,a.getCurrentValue,a.getCurrentValue);return l.default.useImperativeHandle(t,()=>({retry:a.retry}),[]),l.default.useMemo(()=>{var t;return r.loading||r.error?l.default.createElement(s.loading,{isLoading:r.loading,pastDelay:r.pastDelay,timedOut:r.timedOut,error:r.error,retry:a.retry}):r.loaded?l.default.createElement((t=r.loaded)&&t.default?t.default:t,e):null},[e,r])}return u.preload=()=>d(),u.displayName="LoadableComponent",l.default.forwardRef(u)}(d,e)}function c(e,t){let s=[];for(;e.length;){let l=e.pop();s.push(l(t))}return Promise.all(s).then(()=>{if(e.length)return c(e,t)})}u.preloadAll=()=>new Promise((e,t)=>{c(a).then(e,t)}),u.preloadReady=e=>(void 0===e&&(e=[]),new Promise(t=>{let s=()=>(n=!0,t());c(r,e).then(s,s)})),window.__NEXT_PRELOADREADY=u.preloadReady;let p=u},65218:function(e,t,s){e.exports=s(76737)}},function(e){e.O(0,[3988,2888,9774,179],function(){return e(e.s=1565)}),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9196],{67375:function(e,t,s){var a=s(52033),r=s(80068);e.exports=function(e,t){var s=-1,i=r(e)?Array(e.length):[];return a(e,function(e,a,r){i[++s]=t(e,a,r)}),i}},55807:function(e,t,s){var a=s(66070),r=s(89278),i=s(67375),o=s(19785);e.exports=function(e,t){return(o(e)?a:i)(e,r(t,3))}},32526:function(e,t,s){var a=s(68267)(function(e,t,s){return e+(s?"_":"")+t.toLowerCase()});e.exports=a},86548:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/reporting/datamap",function(){return s(27901)}])},624:function(e,t,s){"use strict";var a=s(24246),r=s(86920),i=s(27378);let o=e=>{let t=e.split("."),s=[];return t.forEach(e=>{let t=s.length>0?s[s.length-1]:null;t?s.push("".concat(t,".").concat(e)):s.push(e)}),s},n=(e,t)=>{let s=o(t).filter(e=>e!==t);return e.filter(e=>s.includes(e)).length>0},l=(e,t)=>!!(e===t||e.startsWith("".concat(t,"."))),c=(e,t,s)=>{let a=null!=s?s:[];return e.forEach(e=>{e.children&&c(e.children,t,a),l(e.value,t)&&a.push(e)}),a},d=e=>{let{node:t,isChecked:s,onChecked:i,isExpanded:o,onExpanded:n,isIndeterminate:l,isDisabled:c,children:d}=e,{value:u,label:_}=t,p=!!t.children&&t.children.length>0;return(0,a.jsxs)(r.xuv,{children:[(0,a.jsxs)(r.xuv,{display:"flex",justifyContent:"space-between",_hover:{backgroundColor:"gray.100",cursor:"pointer"},onClick:()=>n(t),minHeight:8,children:[(0,a.jsx)(r.XZJ,{colorScheme:"complimentary",value:u,isChecked:!l&&s,isIndeterminate:l,isDisabled:c,onChange:()=>i(t),mx:2,"data-testid":"checkbox-".concat(_),children:_}),p?(0,a.jsx)(r.wpx,{"data-testid":"expand-".concat(_),"aria-label":o?"collapse":"expand",icon:(0,a.jsx)(r.v4q,{boxSize:5}),type:"text",onClick:()=>n(t),className:o?"rotate-180":void 0}):null]}),d&&(0,a.jsx)(r.xuv,{ml:5,children:d})]})};t.ZP=e=>{let{nodes:t,selected:s,onSelected:u,..._}=e,[p,m]=(0,i.useState)([]),[E,S]=(0,i.useState)([]);(0,i.useEffect)(()=>{let e=Array.from(new Set([...s.map(e=>o(e)).reduce((e,t)=>e.concat(t),[]),...s.map(e=>c(t,e)).reduce((e,t)=>e.concat(t),[]).map(e=>e.value)]));S(e),m(e)},[s,t]);let h=e=>{let a=[],r=[];p.indexOf(e.value)>=0?(a=p.filter(t=>!l(t,e.value)),r=s.filter(t=>!l(t,e.value))):(a=[...p,...c(t,e.value).map(e=>e.value)],r=[...s,e.value]),m(a),u(r)},A=e=>{E.indexOf(e.value)>=0?S(E.filter(t=>!l(t,e.value))):S([...E,e.value])},g=e=>{if(e.children){let r=p.indexOf(e.value)>=0,o=E.indexOf(e.value)>=0,l=c(t,e.value),u=r&&e.children.length>0&&p.filter(t=>t.startsWith("".concat(e.value,"."))).length+1!==l.length,_=n(s,e.value);return(0,a.jsx)(d,{node:e,isChecked:r,onChecked:h,isExpanded:o,onExpanded:A,isDisabled:_,isIndeterminate:u,children:o?e.children.map(e=>(0,a.jsx)(i.Fragment,{children:g(e)},e.value)):void 0})}return null};return(0,a.jsx)(r.xuv,{..._,children:t.map(e=>(0,a.jsx)(r.xuv,{children:g(e)},e.value))})}},35287:function(e,t,s){"use strict";var a=s(24246),r=s(86920),i=s(88038),o=s.n(i);s(27378),t.Z=e=>{let{children:t,title:s,mainProps:i}=e;return(0,a.jsxs)(r.kCb,{"data-testid":s,direction:"column",height:"calc(100vh - 48px)",width:"calc(100vw - 240px)",children:[(0,a.jsxs)(o(),{children:[(0,a.jsxs)("title",{children:["Fides Admin UI - ",s]}),(0,a.jsx)("meta",{name:"description",content:"Privacy Engineering Platform"}),(0,a.jsx)("link",{rel:"icon",href:"/favicon.ico"})]}),(0,a.jsx)(r.kCb,{px:10,py:6,as:"main",overflow:"auto",direction:"column",flex:1,minWidth:0,...i,children:t})]})}},56358:function(e,t,s){"use strict";s.d(t,{q:function(){return r}});var a=s(24246);let r=(0,s(86920).IUT)({displayName:"TrashCanOutlineIcon",viewBox:"0 0 11 12",path:(0,a.jsx)("path",{d:"M4.5166 1.60859L4.1084 2.21875H7.22363L6.81543 1.60859C6.7832 1.56133 6.72949 1.53125 6.67148 1.53125H4.6584C4.60039 1.53125 4.54668 1.55918 4.51445 1.60859H4.5166ZM7.6748 1.03711L8.46328 2.21875H8.75977H9.79102H9.96289C10.2486 2.21875 10.4785 2.44863 10.4785 2.73438C10.4785 3.02012 10.2486 3.25 9.96289 3.25H9.79102V9.78125C9.79102 10.7309 9.02188 11.5 8.07227 11.5H3.25977C2.31016 11.5 1.54102 10.7309 1.54102 9.78125V3.25H1.36914C1.0834 3.25 0.853516 3.02012 0.853516 2.73438C0.853516 2.44863 1.0834 2.21875 1.36914 2.21875H1.54102H2.57227H2.86875L3.65723 1.03496C3.88066 0.701953 4.25664 0.5 4.6584 0.5H6.67148C7.07324 0.5 7.44922 0.701953 7.67266 1.03496L7.6748 1.03711ZM2.57227 3.25V9.78125C2.57227 10.1615 2.87949 10.4688 3.25977 10.4688H8.07227C8.45254 10.4688 8.75977 10.1615 8.75977 9.78125V3.25H2.57227ZM4.29102 4.625V9.09375C4.29102 9.28281 4.13633 9.4375 3.94727 9.4375C3.7582 9.4375 3.60352 9.28281 3.60352 9.09375V4.625C3.60352 4.43594 3.7582 4.28125 3.94727 4.28125C4.13633 4.28125 4.29102 4.43594 4.29102 4.625ZM6.00977 4.625V9.09375C6.00977 9.28281 5.85508 9.4375 5.66602 9.4375C5.47695 9.4375 5.32227 9.28281 5.32227 9.09375V4.625C5.32227 4.43594 5.47695 4.28125 5.66602 4.28125C5.85508 4.28125 6.00977 4.43594 6.00977 4.625ZM7.72852 4.625V9.09375C7.72852 9.28281 7.57383 9.4375 7.38477 9.4375C7.1957 9.4375 7.04102 9.28281 7.04102 9.09375V4.625C7.04102 4.43594 7.1957 4.28125 7.38477 4.28125C7.57383 4.28125 7.72852 4.43594 7.72852 4.625Z",fill:"currentColor"})})},19904:function(e,t,s){"use strict";s.d(t,{Tg:function(){return o}});var a=s(24246),r=s(16134),i=s(31793);let o=e=>(0,r.C)(i.uu).filter(t=>e.includes(t)).length>0;t.ZP=e=>{let{scopes:t,children:s}=e;return o(t)?(0,a.jsx)(a.Fragment,{children:s}):null}},70416:function(e,t,s){"use strict";s.d(t,{d:function(){return r}});var a=s(24246);let r=(0,s(86920).IUT)({displayName:"AddIcon",viewBox:"0 0 10 10",path:(0,a.jsx)("path",{d:"M4.33331 4.33398V0.333984H5.66665V4.33398H9.66665V5.66732H5.66665V9.66732H4.33331V5.66732H0.333313V4.33398H4.33331Z",fill:"currentColor"})})},34929:function(e,t,s){"use strict";var a=s(24246),r=s(64925),i=s.n(r),o=s(27378),n=s(16134),l=s(30002),c=s(28079),d=s(57072);let u=()=>{let{isLoading:e}=(0,c.fd)(),t=(0,n.C)(c.U3),{isLoading:s}=(0,d.MO)(),a=(0,n.C)(d.qb),{isLoading:r}=(0,l.te)();return{dataUses:t,dataSubjects:(0,n.C)(l.ZL),dataCategories:a,isLoading:e||s||r}};t.Z=()=>{let{dataUses:e,dataCategories:t,dataSubjects:s,isLoading:r}=u(),n=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return e.split(".").slice(0,t).join(".")},l=function(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=t(e);if(!a)return{};let r=t(n(e,s)),i=!!a.parent_key;return{name:a.name||void 0,primaryName:i&&(null==r?void 0:r.name)!==a.name&&(null==r?void 0:r.name)||void 0}},c=function(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,{name:r,primaryName:i}=l(e,t,s);return r?i?(0,a.jsxs)(o.Fragment,{children:[(0,a.jsxs)("strong",{children:[i,":"]})," ",r]},e):(0,a.jsx)("strong",{children:r},e):e},d=t=>i()(e,{fides_key:t}),_=e=>i()(t,{fides_key:e}),p=e=>i()(s,{fides_key:e});return{getDataUses:()=>e,getDataUseByKey:d,getDataUseDisplayName:e=>c(e,d,1),getDataUseDisplayNameProps:e=>l(e,d,1),getDataCategories:()=>t,getDataCategoryByKey:_,getDataCategoryDisplayName:e=>c(e,_,2),getDataCategoryDisplayNameProps:e=>l(e,_,2),getDataSubjects:()=>s,getDataSubjectByKey:p,getDataSubjectDisplayName:e=>{let t=p(e);return t?t.name:e},getPrimaryKey:n,isLoading:r}}},59001:function(e,t,s){"use strict";s.d(t,{Ch:function(){return o},Hy:function(){return n},Lo:function(){return r}});var a,r,i=s(68309);let o="root";(a=r||(r={})).DATA_CATEGORIES="Data categories",a.DATA_USES="Data uses",a.DATA_SUBJECTS="Data subjects";let n=e=>{switch(e){case"Data categories":return{UPDATE:i.Sh.DATA_CATEGORY_UPDATE,CREATE:i.Sh.DATA_CATEGORY_CREATE,DELETE:i.Sh.DATA_CATEGORY_DELETE,READ:i.Sh.DATA_CATEGORY_READ};case"Data uses":return{UPDATE:i.Sh.DATA_USE_UPDATE,CREATE:i.Sh.DATA_USE_CREATE,DELETE:i.Sh.DATA_USE_DELETE,READ:i.Sh.DATA_USE_READ};case"Data subjects":return{UPDATE:i.Sh.DATA_SUBJECT_UPDATE,CREATE:i.Sh.DATA_SUBJECT_CREATE,DELETE:i.Sh.DATA_SUBJECT_DELETE,READ:i.Sh.DATA_SUBJECT_READ};default:throw Error("Unknown taxonomy type: ".concat(e))}}},90673:function(e,t,s){"use strict";s.d(t,{Cd:function(){return i},Xl:function(){return o}});var a=s(68309),r=s(59001);let i=(e,t)=>{let s;if(null==t&&e.every(e=>void 0===e.parent_key))s=e;else{let a=null!=t?t:null;s=e.filter(e=>e.parent_key===a)}return s.map(t=>{var s,a;let r=t.fides_key;return{value:t.fides_key,label:""===t.name||null==t.name?t.fides_key:t.name,description:t.description,children:i(e,r),is_default:null!==(s=t.is_default)&&void 0!==s&&s,active:null!==(a=t.active)&&void 0!==a&&a}})},o=e=>{switch(e){case r.Lo.DATA_CATEGORIES:return a.P6.DATA_CATEGORY;case r.Lo.DATA_SUBJECTS:return a.P6.DATA_SUBJECT;case r.Lo.DATA_USES:return a.P6.DATA_USE;default:return}}},27901:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return eC}});var a,r,i,o,n=s(24246),l=s(27378),c=s(35287),d=s(58754),u=s(71795),_=s(68309);(a=i||(i={})).COLUMN_EXPANSION_STATE="datamap-column-expansion-state",a.COLUMN_NAMES="datamap-column-names",a.COLUMN_ORDER="datamap-column-order",a.COLUMN_SIZING="datamap-column-sizing",a.COLUMN_VISIBILITY="datamap-column-visibility",a.CUSTOM_REPORT_ID="datamap-custom-report-id",a.FILTERS="datamap-filters",a.GROUP_BY="datamap-group-by",a.SORTING_STATE="datamap-sorting-state",a.WRAPPING_COLUMNS="datamap-wrapping-columns",(r=o||(o={})).SYSTEM_NAME="system_name",r.DATA_USE="data_uses",r.DATA_CATEGORY="data_categories",r.DATA_SUBJECT="data_subjects",r.LEGAL_NAME="legal_name",r.DPO="dpo",r.LEGAL_BASIS_FOR_PROCESSING="legal_basis_for_processing",r.ADMINISTRATING_DEPARTMENT="administrating_department",r.COOKIE_MAX_AGE_SECONDS="cookie_max_age_seconds",r.PRIVACY_POLICY="privacy_policy",r.LEGAL_ADDRESS="legal_address",r.COOKIE_REFRESH="cookie_refresh",r.DATA_SECURITY_PRACTICES="data_security_practices",r.DATA_SHARED_WITH_THIRD_PARTIES="data_shared_with_third_parties",r.DATA_STEWARDS="data_stewards",r.DECLARATION_NAME="declaration_name",r.DOES_INTERNATIONAL_TRANSFERS="does_international_transfers",r.DPA_LOCATION="dpa_location",r.DESTINATIONS="egress",r.EXEMPT_FROM_PRIVACY_REGULATIONS="exempt_from_privacy_regulations",r.FEATURES="features",r.FIDES_KEY="fides_key",r.FLEXIBLE_LEGAL_BASIS_FOR_PROCESSING="flexible_legal_basis_for_processing",r.IMPACT_ASSESSMENT_LOCATION="impact_assessment_location",r.SOURCES="ingress",r.JOINT_CONTROLLER_INFO="joint_controller_info",r.LEGAL_BASIS_FOR_PROFILING="legal_basis_for_profiling",r.LEGAL_BASIS_FOR_TRANSFERS="legal_basis_for_transfers",r.LEGITIMATE_INTEREST_DISCLOSURE_URL="legitimate_interest_disclosure_url",r.PROCESSES_PERSONAL_DATA="processes_personal_data",r.REASON_FOR_EXEMPTION="reason_for_exemption",r.REQUIRES_DATA_PROTECTION_ASSESSMENTS="requires_data_protection_assessments",r.RESPONSIBILITY="responsibility",r.RETENTION_PERIOD="retention_period",r.SHARED_CATEGORIES="shared_categories",r.SPECIAL_CATEGORY_LEGAL_BASIS="special_category_legal_basis",r.THIRD_PARTIES="third_parties",r.COOKIES="cookies",r.USES_COOKIES="uses_cookies",r.USES_NON_COOKIE_ACCESS="uses_non_cookie_access",r.USES_PROFILING="uses_profiling",r.SYSTEM_UNDECLARED_DATA_CATEGORIES="system_undeclared_data_categories",r.DATA_USE_UNDECLARED_DATA_CATEGORIES="data_use_undeclared_data_categories",r.PROCESSES_SPECIAL_CATEGORY_DATA="processes_special_category_data";let p={system_name:"System",data_uses:"Data use",data_categories:"Data categories",data_subjects:"Data subject",legal_name:"Legal name",dpo:"Data privacy officer",legal_basis_for_processing:"Legal basis for processing",administrating_department:"Administrating department",cookie_max_age_seconds:"Cookie max age seconds",privacy_policy:"Privacy policy",legal_address:"Legal address",cookie_refresh:"Cookie refresh",data_security_practices:"Data security practices",data_shared_with_third_parties:"Data shared with third parties",data_stewards:"Data stewards",declaration_name:"Declaration name",does_international_transfers:"Does international transfers",dpa_location:"DPA location",egress:"Destination",exempt_from_privacy_regulations:"Exempt from privacy regulations",features:"Features",fides_key:"Fides key",flexible_legal_basis_for_processing:"Flexible legal basis for processing",impact_assessment_location:"Impact assessment location",ingress:"Source",joint_controller_info:"Joint controller info",legal_basis_for_profiling:"Legal basis for profiling",legal_basis_for_transfers:"Legal basis for transfers",legitimate_interest_disclosure_url:"Legitimate interest disclosure URL",processes_personal_data:"Processes personal data",reason_for_exemption:"Reason for exemption",requires_data_protection_assessments:"Requires data protection assessments",responsibility:"Responsibility",retention_period:"Retention period",shared_categories:"Shared categories",special_category_legal_basis:"Special category legal basis",third_parties:"Third parties",system_undeclared_data_categories:"System undeclared data categories",data_use_undeclared_data_categories:"Data use undeclared data categories",cookies:"Cookies",uses_cookies:"Uses cookies",uses_non_cookie_access:"Uses non-cookie access",uses_profiling:"Uses profiling",processes_special_category_data:"Processes special category data"},m={[o.SYSTEM_UNDECLARED_DATA_CATEGORIES]:!1,[o.DATA_USE_UNDECLARED_DATA_CATEGORIES]:!1},E={dataUses:[],dataSubjects:[],dataCategories:[]},S=(0,l.createContext)({}),h=e=>{let{children:t}=e,[s,a]=(0,u._)(i.CUSTOM_REPORT_ID,""),[r,o]=(0,u._)(i.GROUP_BY,_.fI.SYSTEM_DATA_USE),[c,d]=(0,u._)(i.FILTERS,E),[p,h]=(0,u._)(i.COLUMN_ORDER,[]),[A,g]=(0,u._)(i.COLUMN_VISIBILITY,m),[f,x]=(0,u._)(i.COLUMN_SIZING,{}),[C,T]=(0,u._)(i.COLUMN_NAMES,{}),R=(0,l.useMemo)(()=>({savedCustomReportId:s,setSavedCustomReportId:a,groupBy:r,setGroupBy:o,selectedFilters:c,setSelectedFilters:d,columnOrder:p,setColumnOrder:h,columnVisibility:A,setColumnVisibility:g,columnSizing:f,setColumnSizing:x,columnNameMapOverrides:C,setColumnNameMapOverrides:T}),[s,a,r,o,c,d,p,h,A,g,f,x,C,T]);return(0,n.jsx)(S.Provider,{value:R,children:t})},A=()=>{let e=(0,l.useContext)(S);if(!e||0===Object.keys(e).length)throw Error("useDatamapReport must be used within a DatamapReportProvider");return e};var g=s(59003),f=s(92222),x=s(85422),C=s(86920),T=s(34090),R=s(66726),O=s.n(R),j=s(16134),v=s(34929),b=s(14048),D=s(19904),y=s(16394),I=s(38943),N=s(35258),L=e=>{let{children:t,heading:s,onCancel:a,onConfirm:r,isLoading:i,cancelButtonText:o,continueButtonText:l,"data-testid":c="standard-dialog",...d}=e,{onClose:u}=d;return(0,n.jsxs)(C.u_l,{closeOnOverlayClick:i,...d,children:[(0,n.jsx)(C.ZAr,{}),(0,n.jsxs)(C.hzk,{"data-testid":c,children:[s&&(0,n.jsx)(C.xBx,{children:s}),(0,n.jsx)(C.olH,{isDisabled:i,"data-testid":"standard-dialog-close-btn"}),t&&(0,n.jsx)(C.fef,{children:t}),(0,n.jsxs)(C.mzw,{gap:3,width:"100%",sx:{"& button":{width:"100%"}},children:[(0,n.jsx)(C.wpx,{onClick:()=>{a&&a(),u()},"data-testid":"".concat(c?"".concat(c,"-"):"","cancel-btn"),disabled:i,children:o||"Cancel"}),(0,n.jsx)(C.wpx,{onClick:r,type:"primary","data-testid":"".concat(c?"".concat(c,"-"):"","continue-btn"),loading:i,children:l||"Continue"})]})]})]})},w=s(22968),M=e=>{let[t,s]=(0,l.useState)(w.T2.csv),{onConfirm:a}=e;return(0,n.jsx)(L,{heading:"Export report",continueButtonText:"Download",size:"xl",...e,onConfirm:()=>a(t),"data-testid":"export-modal",children:(0,n.jsxs)(C.kCb,{direction:"column",gap:3,pb:3,children:[(0,n.jsx)(C.xvT,{textAlign:"left",children:"Export your data map report using the options below. Depending on the number of rows, the file may take a few minutes to process."}),(0,n.jsxs)(C.NIc,{children:[(0,n.jsx)(C.lXp,{htmlFor:"format",children:"Choose Format"}),(0,n.jsx)(C.WPr,{id:"format",value:t,onChange:s,"data-testid":"export-format-select",options:[{value:w.T2.csv,label:"CSV"},{value:w.T2.xlsx,label:"XLSX"}],className:"w-full"})]})]})})},P=s(624),U=s(30002),k=s(28079),G=s(90673),H=s(39864);let Y=e=>{let{label:t,children:s,...a}=e;return(0,n.jsxs)(C.Qdk,{...a,children:[(0,n.jsx)(C.X6q,{children:(0,n.jsxs)(C.KFZ,{height:"100%","data-testid":"filter-modal-accordion-button",textAlign:"left",fontWeight:600,children:[(0,n.jsx)(C.xuv,{flex:1,children:t}),(0,n.jsx)(C.XEm,{boxSize:7})]})}),(0,n.jsx)(C.Hk3,{children:s})]})},F=e=>{let{columnNameMap:t,selectedFilters:s,onFilterChange:a,onClose:r,...i}=e;(0,k.fd)(),(0,U.te)(),(0,H.MO)();let{dataUses:o,dataSubjects:c,dataCategories:d}=s,u=(0,j.C)(k.U3),_=(0,j.C)(U.ZL),p=(0,j.C)(H.qb),[m,E]=(0,l.useState)(o),[S,h]=(0,l.useState)(c),[A,g]=(0,l.useState)(d);(0,l.useEffect)(()=>{E(o)},[o]),(0,l.useEffect)(()=>{h(c)},[c]),(0,l.useEffect)(()=>{g(d)},[d]);let f=(0,l.useMemo)(()=>(0,G.Cd)(u),[u]),x=(0,l.useMemo)(()=>(0,G.Cd)(_),[_]),T=(0,l.useMemo)(()=>(0,G.Cd)(p),[p]);return(0,n.jsx)(L,{heading:"Filter Datamap Report",...i,onCancel:()=>{E([]),h([]),g([]),a({dataUses:[],dataSubjects:[],dataCategories:[]}),r()},onConfirm:()=>{a({dataUses:m,dataSubjects:S,dataCategories:A}),r()},onClose:r,cancelButtonText:"Reset filters",continueButtonText:"Done","data-testid":"datamap-report-filter-modal",children:(0,n.jsxs)(C.UQy,{allowToggle:!0,children:[(0,n.jsx)(Y,{label:t.data_uses,children:(0,n.jsx)(P.ZP,{nodes:f,selected:m,onSelected:E,"data-testid":"filter-modal-checkbox-tree-uses"})}),(0,n.jsx)(Y,{label:t.data_categories,children:(0,n.jsx)(P.ZP,{nodes:T,selected:A,onSelected:g,"data-testid":"filter-modal-checkbox-tree-categories"})}),(0,n.jsx)(Y,{label:t.data_subjects,children:(0,n.jsx)(P.ZP,{nodes:x,selected:S,onSelected:h,"data-testid":"filter-modal-checkbox-tree-subjects"})})]})})};var V=s(32885),Z=s(70416),B=s(812),z=s(56358);let{useGetMinimalCustomReportsQuery:W,useLazyGetCustomReportByIdQuery:q,usePostCustomReportMutation:X,useDeleteCustomReportMutation:J}=s(78780).u.injectEndpoints({endpoints:e=>({getMinimalCustomReports:e.query({query:e=>{let{pageIndex:t=1,pageSize:s=50,report_type:a=_.C2.DATAMAP}=e,r="page=".concat(t,"&size=").concat(s,"&report_type=").concat(a);return{url:"plus/custom-report/minimal?".concat(r)}},providesTags:["Custom Reports"]}),getCustomReportById:e.query({query:e=>({url:"plus/custom-report/".concat(e)}),providesTags:(e,t,s)=>[{type:"Custom Reports",id:s}]}),postCustomReport:e.mutation({query:e=>({method:"POST",url:"plus/custom-report",body:e}),invalidatesTags:["Custom Reports"]}),deleteCustomReport:e.mutation({query:e=>({method:"DELETE",url:"plus/custom-report/".concat(e)}),invalidatesTags:["Custom Reports"]})})});var K=s(55484),Q=s(40324);let $="Report name",ee=e=>{let{isOpen:t,handleClose:s,tableStateToSave:a,columnMapToSave:r={},unavailableNames:i,onCreateCustomReport:o}=e,c=(0,C.pmc)(),[d]=X(),u=(0,l.useMemo)(()=>K.Ry().shape({reportName:K.Z_().label($).required("Please provide a name for this report").test("is-unique","",async(e,t)=>null==i||!i.includes(e)||t.createError({message:"This name already exists"})).max(80,"Report name is too long (max 80 characters)")}),[i]),p=async e=>{var t;let i={};Object.entries(r).forEach(e=>{let[t,s]=e;i[t]={label:s,enabled:!0}}),Object.entries(null!==(t=null==a?void 0:a.columnVisibility)&&void 0!==t?t:{}).forEach(e=>{let[t,s]=e;i[t]||(i[t]={}),i[t].enabled=s});try{let t={name:e.trim(),type:_.C2.DATAMAP,config:{column_map:i,table_state:a}},r=await d(t);if((0,B.D4)(r))throw r.error;o(r.data),s()}catch(e){c({status:"error",description:(0,B.e$)(e,"A problem occurred while creating the report.")})}};return(0,n.jsxs)(C.u_l,{size:"lg",isOpen:t,onClose:s,motionPreset:"none",children:[(0,n.jsx)(C.ZAr,{}),(0,n.jsxs)(C.hzk,{children:[(0,n.jsx)(C.xBx,{pb:0,children:"Create a report"}),(0,n.jsx)(T.J9,{initialValues:{reportName:""},onSubmit:e=>p(e.reportName),onReset:s,validateOnBlur:!1,validationSchema:u,children:e=>{let{dirty:t,isValid:s}=e;return(0,n.jsxs)(T.l0,{"data-testid":"custom-report-form",children:[(0,n.jsxs)(C.fef,{children:[(0,n.jsx)(C.xvT,{fontSize:"sm",color:"gray.600",pb:6,children:"Customize and save your current filter settings for easy access in the future. This saved report will include the column layout and currently applied filter settings."}),(0,n.jsx)(Q.j0,{id:"reportName",name:"reportName",isRequired:!0,label:$,placeholder:"Enter a name for the report...",variant:"stacked",maxLength:80})]}),(0,n.jsxs)(C.mzw,{gap:2,children:[(0,n.jsx)(C.wpx,{size:"small",htmlType:"reset",children:"Cancel"}),(0,n.jsx)(C.wpx,{size:"small",disabled:!t||!s,type:"primary","data-testid":"custom-report-form-submit",htmlType:"submit",children:"Save"})]})]})}})]})]})},et="Report",es="Reports",ea=e=>{var t;let{reportType:s,savedReportId:a,tableStateToSave:r,currentColumnMap:i,onCustomReportSaved:o,onSavedReportDeleted:c}=e,d=(0,D.Tg)([_.Sh.CUSTOM_REPORT_CREATE]),u=(0,D.Tg)([_.Sh.CUSTOM_REPORT_DELETE]),p=(0,C.pmc)({id:"custom-report-toast"}),{data:m,isLoading:E}=W({report_type:s}),[S,h]=(0,l.useState)(),[A]=q(),[g]=J(),{isOpen:f,onToggle:x,onOpen:R,onClose:O}=(0,C.qY0)(),{isOpen:j,onOpen:v,onClose:b}=(0,C.qY0)(),{isOpen:y,onOpen:I,onClose:N}=(0,C.qY0)(),[L,w]=(0,l.useState)(),[M,P]=(0,l.useState)(),[U,k]=(0,l.useState)(),[G,H]=(0,l.useState)(!1),{resetForm:Y}=(0,T.u6)(),F=(0,l.useMemo)(()=>{var e;let t=null==m?void 0:null===(e=m.items.find(e=>e.id===a))||void 0===e?void 0:e.name;return null!=t?t:es},[null==m?void 0:m.items,a]),V=!E&&!(null==m?void 0:null===(t=m.items)||void 0===t?void 0:t.length),X=e=>{h(null==m?void 0:m.items.filter(t=>t.name.toLowerCase().includes(e.toLowerCase())))},K=async e=>{w(e);let{data:t,isError:s,error:a}=await A(e);if(s){let e=(0,B.e$)(a,"A problem occurred while fetching the ".concat(et,"."));e.includes("not found")&&c(),p({status:"error",description:e})}else P(t)},Q=()=>{w(""),P(void 0),H(!1)},$=()=>{M?(H(!1),M.id!==a&&o(M,Y),O()):L?H(!0):(o(null,Y),O())},ea=async e=>{e===(null==M?void 0:M.id)&&(Q(),c()),g(e)};(0,l.useEffect)(()=>{m&&h(m.items)},[m]),(0,l.useEffect)(()=>{G&&(H(!1),$())},[M]),(0,l.useEffect)(()=>{a?K(a):Q()},[a]),(0,l.useEffect)(()=>{U&&I()},[I,U]);let er=!M&&!a||(null==M?void 0:M.id)===a;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(C.J2e,{placement:"bottom-end",isOpen:f,onClose:$,id:"custom-reports-selection",children:[(0,n.jsx)(C.xol,{children:(0,n.jsx)(C.wpx,{className:"max-w-40",icon:(0,n.jsx)(C.v4q,{}),iconPosition:"end","data-testid":"custom-reports-trigger",onClick:x,children:(0,n.jsx)(C.xvT,{noOfLines:1,display:"inline-block",children:F})})}),(0,n.jsx)(C.h_i,{children:(0,n.jsxs)(C.yky,{"data-testid":"custom-reports-popover",children:[(0,n.jsx)(C.QHN,{}),(0,n.jsx)(T.J9,{initialValues:{},onSubmit:$,onReset:Q,children:(0,n.jsxs)(T.l0,{children:[(0,n.jsx)(C.wpx,{size:"small",disabled:V,htmlType:"reset",className:"absolute left-2 top-2","data-testid":"custom-reports-reset-button",children:"Reset"}),(0,n.jsxs)(C.Ytg,{textAlign:"center",children:[(0,n.jsx)(C.xvT,{fontSize:"sm",children:es}),(0,n.jsx)(C.BZy,{size:"sm",mt:3,children:(0,n.jsx)(C.IIB,{type:"text",borderRadius:"md",placeholder:"Search...",onChange:e=>X(e.target.value)})})]}),(0,n.jsx)(C.usR,{top:2,onClick:()=>{a?K(a):Q(),O()},"data-testid":"custom-report-popover-cancel"}),(0,n.jsxs)(C.baG,{px:6,pt:5,pb:1,children:[V&&(0,n.jsxs)(C.gCW,{px:2,pt:6,pb:3,"data-testid":"custom-reports-empty-state",children:[(0,n.jsx)(C.wpx,{type:"primary",size:"small","aria-label":"add ".concat(et),icon:(0,n.jsx)(Z.d,{}),onClick:v,className:"rounded-full","data-testid":"add-report-button"}),(0,n.jsxs)(C.xvT,{fontSize:"sm",textAlign:"center",color:"gray.500",children:["No ",es.toLowerCase()," have been created. Start by applying your preferred filter and column settings, then create a"," ",et.toLowerCase()," for easy access later."]})]}),!V&&(E?(0,n.jsxs)(C.gCW,{pb:2,children:[(0,n.jsx)(C.OdW,{width:"100%",height:C.rSc.space[4]}),(0,n.jsx)(C.OdW,{width:"100%",height:C.rSc.space[4]}),(0,n.jsx)(C.OdW,{width:"100%",height:C.rSc.space[4]})]}):(0,n.jsx)(C.y02.Group,{onChange:e=>K(e.target.value),value:L,className:"flex flex-col gap-2",children:null==S?void 0:S.map(e=>(0,n.jsxs)(C.jqI,{className:u?"justify-between":"justify-start",children:[(0,n.jsx)(C.y02,{value:e.id,name:"custom-report-id","data-testid":"custom-report-item",children:(0,n.jsx)(C.xvT,{fontSize:"sm",children:e.name})}),u&&(0,n.jsx)(C.wpx,{type:"text",size:"small",icon:(0,n.jsx)(z.q,{fontSize:16}),onClick:()=>k(e),"data-testid":"delete-report-button"})]},e.id))}))]}),(0,n.jsx)(C.DT9,{border:"none",px:6,pb:4,pt:4,children:(0,n.jsxs)(C.Ugi,{children:[d&&r&&(0,n.jsxs)(C.wpx,{size:"small",onClick:v,className:"w-full","data-testid":"create-report-button",htmlType:"button",children:["+ Create ",et.toLowerCase()]}),(0,n.jsx)(C.wpx,{size:"small",type:"primary",loading:G,disabled:er,className:"w-full","data-testid":"apply-report-button",htmlType:"submit",children:"Apply"})]})})]})})]})})]}),(0,n.jsx)(ee,{isOpen:j,handleClose:()=>{b(),setTimeout(()=>{R()},100)},tableStateToSave:r,columnMapToSave:i,unavailableNames:null==m?void 0:m.items.map(e=>e.name),onCreateCustomReport:e=>o(e,Y)}),(0,n.jsx)(C.cVQ,{isOpen:y,onClose:()=>{k(void 0),N()},onConfirm:()=>{U&&ea(U.id),N()},title:"Delete ".concat(et),message:(0,n.jsxs)(C.xvT,{children:["You are about to permanently delete the"," ",et.toLowerCase()," named"," ",(0,n.jsx)("strong",{children:null==U?void 0:U.name}),". Are you sure you would like to continue?"]})})]})};var er=s(19785),ei=s.n(er),eo=s(55807),en=s.n(eo),el=s(32526),ec=s.n(el),ed=s(72625),eu=s(43862);let e_=(0,f.Cl)(),ep=(e,t)=>({cell:e=>(0,n.jsx)(x.G3,{value:e.getValue()}),header:s=>{let a={};return Object.keys(e).forEach(t=>{"string"==typeof e[t]?a[t]=e[t]:e[t].label&&(a[t]=e[t].label||"")}),(0,n.jsx)(ed.Hm,{value:(0,eu.AH)({columnId:s.column.id,columnNameMap:a}),defaultValue:p[s.column.id]||(0,eu.AH)({columnId:s.column.id}),isEditing:t,...s})}}),em=(e,t)=>{var s;let a=(null==e?void 0:null===(s=e.items)||void 0===s?void 0:s.length)?Object.keys(e.items[0]):[],r=Object.values(o);return a.filter(e=>!r.includes(e)).filter(e=>e.startsWith("privacy_declaration_")||e.startsWith("system_")).map(e=>{let s=t.find(t=>e.includes(ec()(t.name)));return e_.accessor(t=>t[e],{id:e,cell:e=>Array.isArray(e.getValue())?(0,n.jsx)(x.WP,{value:e.getValue(),ignoreZero:!0,...e}):(0,n.jsx)(x.G3,{value:e.getValue()}),meta:{showHeaderMenu:(null==s?void 0:s.field_type)==="string[]"}})})},eE=e=>{let{onSelectRow:t,getDataUseDisplayName:s,getDataCategoryDisplayName:a,getDataSubjectDisplayName:r,datamapReport:i,customFields:l,isRenaming:c=!1}=e,d=em(i,l);return[e_.accessor(e=>e.system_name,{enableGrouping:!0,id:o.SYSTEM_NAME,meta:{onCellClick:t}}),e_.accessor(e=>e.data_uses,{id:o.DATA_USE,cell:e=>{let t=e.getValue();return(0,n.jsx)(x.WP,{suffix:"data uses",ignoreZero:!0,value:ei()(t)?en()(t,s):s(t||""),tagProps:{color:"white"},...e})},meta:{width:"auto"}}),e_.accessor(e=>e.data_categories,{id:o.DATA_CATEGORY,cell:e=>{let t=e.getValue();if(!t||0===t.length)return null;let s=ei()(t)?t.map(e=>({label:a(e),key:e})):[{label:a(t),key:t}];return(0,n.jsx)(ed.mb,{values:s,cellProps:e})},meta:{showHeaderMenu:!c,showHeaderMenuWrapOption:!0,width:"auto",overflow:"hidden"}}),e_.accessor(e=>e.data_subjects,{id:o.DATA_SUBJECT,cell:e=>{let t=e.getValue();return(0,n.jsx)(x.WP,{suffix:"data subjects",ignoreZero:!0,value:ei()(t)?en()(t,r):r(t||""),tagProps:{color:"white"},...e})},meta:{showHeaderMenu:!c}}),e_.accessor(e=>e.legal_name,{id:o.LEGAL_NAME}),e_.accessor(e=>e.dpo,{id:o.DPO}),e_.accessor(e=>e.legal_basis_for_processing,{id:o.LEGAL_BASIS_FOR_PROCESSING}),e_.accessor(e=>e.administrating_department,{id:o.ADMINISTRATING_DEPARTMENT}),e_.accessor(e=>e.cookie_max_age_seconds,{id:o.COOKIE_MAX_AGE_SECONDS}),e_.accessor(e=>e.privacy_policy,{id:o.PRIVACY_POLICY}),e_.accessor(e=>e.legal_address,{id:o.LEGAL_ADDRESS}),e_.accessor(e=>e.cookie_refresh,{id:o.COOKIE_REFRESH}),e_.accessor(e=>e.data_security_practices,{id:o.DATA_SECURITY_PRACTICES}),e_.accessor(e=>e.data_shared_with_third_parties,{id:o.DATA_SHARED_WITH_THIRD_PARTIES}),e_.accessor(e=>e.processes_special_category_data,{id:o.PROCESSES_SPECIAL_CATEGORY_DATA}),e_.accessor(e=>e.data_stewards,{id:o.DATA_STEWARDS,cell:e=>(0,n.jsx)(x.WP,{suffix:"data stewards",ignoreZero:!0,value:e.getValue(),...e}),meta:{showHeaderMenu:!c,width:"auto"}}),e_.accessor(e=>e.declaration_name,{id:o.DECLARATION_NAME}),e_.accessor(e=>e.does_international_transfers,{id:o.DOES_INTERNATIONAL_TRANSFERS}),e_.accessor(e=>e.dpa_location,{id:o.DPA_LOCATION}),e_.accessor(e=>e.egress,{id:o.DESTINATIONS,cell:e=>(0,n.jsx)(x.WP,{suffix:"destinations",ignoreZero:!0,value:e.getValue(),...e}),meta:{showHeaderMenu:!c,width:"auto"}}),e_.accessor(e=>e.exempt_from_privacy_regulations,{id:o.EXEMPT_FROM_PRIVACY_REGULATIONS}),e_.accessor(e=>e.features,{id:o.FEATURES,cell:e=>(0,n.jsx)(x.WP,{suffix:"features",ignoreZero:!0,value:e.getValue(),...e}),meta:{showHeaderMenu:!c,width:"auto"}}),e_.accessor(e=>e.fides_key,{id:o.FIDES_KEY}),e_.accessor(e=>e.flexible_legal_basis_for_processing,{id:o.FLEXIBLE_LEGAL_BASIS_FOR_PROCESSING}),e_.accessor(e=>e.impact_assessment_location,{id:o.IMPACT_ASSESSMENT_LOCATION}),e_.accessor(e=>e.ingress,{id:o.SOURCES,cell:e=>(0,n.jsx)(x.WP,{suffix:"sources",ignoreZero:!0,value:e.getValue(),...e}),meta:{showHeaderMenu:!c,width:"auto"}}),e_.accessor(e=>e.joint_controller_info,{id:o.JOINT_CONTROLLER_INFO}),e_.accessor(e=>e.legal_basis_for_profiling,{id:o.LEGAL_BASIS_FOR_PROFILING,cell:e=>(0,n.jsx)(x.WP,{suffix:"profiles",ignoreZero:!0,value:e.getValue(),...e}),meta:{showHeaderMenu:!c,width:"auto"}}),e_.accessor(e=>e.legal_basis_for_transfers,{id:o.LEGAL_BASIS_FOR_TRANSFERS,cell:e=>(0,n.jsx)(x.WP,{suffix:"transfers",ignoreZero:!0,value:e.getValue(),...e}),meta:{showHeaderMenu:!c,width:"auto"}}),e_.accessor(e=>e.legitimate_interest_disclosure_url,{id:o.LEGITIMATE_INTEREST_DISCLOSURE_URL}),e_.accessor(e=>e.processes_personal_data,{id:o.PROCESSES_PERSONAL_DATA}),e_.accessor(e=>e.reason_for_exemption,{id:o.REASON_FOR_EXEMPTION}),e_.accessor(e=>e.requires_data_protection_assessments,{id:o.REQUIRES_DATA_PROTECTION_ASSESSMENTS}),e_.accessor(e=>e.responsibility,{id:o.RESPONSIBILITY,cell:e=>(0,n.jsx)(x.WP,{suffix:"responsibilities",ignoreZero:!0,value:e.getValue(),...e}),meta:{showHeaderMenu:!c,width:"auto"}}),e_.accessor(e=>e.retention_period,{id:o.RETENTION_PERIOD}),e_.accessor(e=>e.shared_categories,{id:o.SHARED_CATEGORIES,cell:e=>(0,n.jsx)(x.WP,{suffix:"shared categories",ignoreZero:!0,value:e.getValue(),tagProps:{color:"white"},...e}),meta:{showHeaderMenu:!c,width:"auto"}}),e_.accessor(e=>e.special_category_legal_basis,{id:o.SPECIAL_CATEGORY_LEGAL_BASIS}),e_.accessor(e=>e.third_parties,{id:o.THIRD_PARTIES}),e_.accessor(e=>e.system_undeclared_data_categories,{id:o.SYSTEM_UNDECLARED_DATA_CATEGORIES,cell:e=>{let t=e.getValue();if(!t||0===t.length)return null;let s=ei()(t)?t.map(e=>({label:a(e),key:e})):[{label:a(t),key:t}];return(0,n.jsx)(ed.mb,{values:s,cellProps:e})},meta:{showHeaderMenu:!c,showHeaderMenuWrapOption:!0,width:"auto",overflow:"hidden"}}),e_.accessor(e=>e.data_use_undeclared_data_categories,{id:o.DATA_USE_UNDECLARED_DATA_CATEGORIES,cell:e=>{let t=e.getValue();if(!t||0===t.length)return null;let s=ei()(t)?t.map(e=>({label:a(e),key:e})):[{label:a(t),key:t}];return(0,n.jsx)(ed.mb,{values:s,cellProps:e})},meta:{showHeaderMenu:!c,showHeaderMenuWrapOption:!0,width:"auto",overflow:"hidden"}}),e_.accessor(e=>e.cookies,{id:o.COOKIES,cell:e=>(0,n.jsx)(x.WP,{ignoreZero:!0,suffix:"cookies",value:e.getValue(),...e}),meta:{showHeaderMenu:!c,width:"auto"}}),e_.accessor(e=>e.uses_cookies,{id:o.USES_COOKIES}),e_.accessor(e=>e.uses_non_cookie_access,{id:o.USES_NON_COOKIE_ACCESS}),e_.accessor(e=>e.uses_profiling,{id:o.USES_PROFILING}),...d]},eS=e=>{let{columnNameMapOverrides:t,setColumnNameMapOverrides:s,setSavedCustomReportId:a,setIsRenamingColumns:r}=e,{submitForm:i,resetForm:o}=(0,T.u6)();return(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsx)(C.wpx,{size:"small","data-testid":"rename-columns-reset-btn",onClick:()=>{s({}),a(""),o({values:{}}),r(!1)},children:"Reset all"}),(0,n.jsx)(C.wpx,{size:"small","data-testid":"rename-columns-cancel-btn",onClick:()=>{o({values:t}),r(!1)},children:"Cancel"}),(0,n.jsx)(C.wpx,{size:"small",type:"primary",htmlType:"submit","data-testid":"rename-columns-apply-btn",onClick:i,children:"Apply"})]})},eh=e=>e===_.fI.DATA_USE_SYSTEM?[o.DATA_USE]:[o.SYSTEM_NAME],eA=e=>{let t=[];return _.fI.SYSTEM_DATA_USE===e&&(t=[o.SYSTEM_NAME,o.DATA_USE]),_.fI.DATA_USE_SYSTEM===e&&(t=[o.DATA_USE,o.SYSTEM_NAME]),t},eg=(e,t)=>eA(e).concat(t.filter(e=>e!==o.SYSTEM_NAME&&e!==o.DATA_USE)),ef={items:[],total:0,page:1,size:25,pages:1},ex=()=>{let e=(0,D.Tg)([_.Sh.CUSTOM_REPORT_READ]),{isLoading:t}=(0,V.x8)(),{PAGE_SIZES:s,pageSize:a,setPageSize:r,onPreviousPageClick:o,isPreviousPageDisabled:c,onNextPageClick:d,isNextPageDisabled:u,startRange:S,endRange:h,pageIndex:R,setTotalPages:L,resetPageIndexToDefault:w}=(0,x.oi)(),P=(0,C.pmc)({id:"datamap-report-toast"}),{isOpen:U,onClose:k,onOpen:G}=(0,C.qY0)(),{getDataUseDisplayName:H,getDataCategoryDisplayName:Y,getDataSubjectDisplayName:Z,isLoading:B}=(0,v.Z)(),[z,W]=(0,l.useState)(),{savedCustomReportId:q,setSavedCustomReportId:X,groupBy:J,setGroupBy:K,selectedFilters:Q,setSelectedFilters:$,columnOrder:ee,setColumnOrder:et,columnVisibility:es,setColumnVisibility:er,columnSizing:ei,setColumnSizing:eo,columnNameMapOverrides:en,setColumnNameMapOverrides:el}=A(),[ec,ed]=(0,l.useState)(!1),eu=e=>{X(""),K(e),ed(!0),w()},[e_,em]=(0,l.useState)(""),ex=(0,l.useCallback)(e=>{w(),em(e)},[w,em]),eC={pageIndex:R,pageSize:a,groupBy:J,search:e_,dataUses:(0,y.du)(Q.dataUses,"data_uses"),dataSubjects:(0,y.du)(Q.dataSubjects,"data_subjects"),dataCategories:(0,y.du)(Q.dataCategories,"data_categories")},{data:eT,isLoading:eR,isFetching:eO}=(0,I.tH)(eC),[ej,{isLoading:ev,isError:eb}]=(0,I.Eo)(),{data:eD,totalRows:ey}=(0,l.useMemo)(()=>{let e=eT||ef,t=e.items;return ec&&ed(!1),L(e.pages),{totalRows:e.total,data:t}},[eT]);(0,V.GH)();let eI=(0,j.C)(V.fN),[eN,eL]=(0,l.useState)(!1),ew=(0,l.useMemo)(()=>eT?eE({onSelectRow:e=>W(e.fides_key),getDataUseDisplayName:H,getDataCategoryDisplayName:Y,getDataSubjectDisplayName:Z,datamapReport:eT,customFields:eI,isRenaming:eN}):[],[H,Z,Y,eT,eI,eN]),{isOpen:eM,onOpen:eP,onClose:eU}=(0,C.qY0)(),{isOpen:ek,onOpen:eG,onClose:eH}=(0,C.qY0)(),eY=(0,g.b7)({getCoreRowModel:(0,f.sC)(),getGroupedRowModel:(0,f.qe)(),getExpandedRowModel:(0,f.rV)(),manualPagination:!0,enableColumnResizing:!0,columnResizeMode:"onChange",columns:ew,defaultColumn:ep({...p,...en},eN),data:eD,initialState:{expanded:!0,columnSizing:ei,columnOrder:ee,columnVisibility:es,grouping:eh(J)}});(0,l.useEffect)(()=>{J&&eY&&eT&&(0===eY.getState().columnOrder.length?et(eg(J,eY.getAllColumns().map(e=>e.id))):et(eg(J,eY.getState().columnOrder)))},[J,eY,eT]),(0,l.useEffect)(()=>{let e=eh(J);eT&&eY.setGrouping(e)},[eT]);let eF=(0,l.useMemo)(()=>O()(eo,300),[eo]);(0,l.useEffect)(()=>{let e=eY.getState().columnSizing;e&&eF(e)},[eY.getState().columnSizing]);let eV=(e,t)=>{if(e||q){if(!e){try{X(""),er(m),eY.toggleAllColumnsVisible(!0),eY.setColumnVisibility(m),et([]),eY.setColumnOrder([]),K(_.fI.SYSTEM_DATA_USE),$(E),el({}),t({values:{}})}catch(e){P({status:"error",description:"There was a problem resetting the report."})}return}try{var s,a,r,i;if(null===(s=e.config)||void 0===s?void 0:s.table_state){let{groupBy:t,filters:s,columnOrder:a}=e.config.table_state,i={};Object.entries(null!==(r=e.config.column_map)&&void 0!==r?r:{}).forEach(e=>{let[t,s]=e;i[t]=s.enabled||!1}),t&&K(t),s&&$(s),a&&(et(a),eY.setColumnOrder(a)),i&&(er(i),eY.setColumnVisibility(i))}if(null===(a=e.config)||void 0===a?void 0:a.column_map){let s={};Object.entries(null!==(i=e.config.column_map)&&void 0!==i?i:{}).forEach(e=>{let[t,a]=e;a.label&&(s[t]=a.label)}),el(s),t({values:s})}X(e.id),P({status:"success",description:"Report applied successfully."})}catch(e){P({status:"error",description:"There was a problem applying report."})}}};return eR||t||B?(0,n.jsx)(x.I4,{rowHeight:36,numRows:15}):(0,n.jsxs)(C.kCb,{flex:1,direction:"column",overflow:"auto",children:[(0,n.jsx)(F,{columnNameMap:{...p,...en},selectedFilters:Q,isOpen:U,onClose:k,onFilterChange:e=>{X(""),$(e)}}),(0,n.jsx)(x.F1,{isOpen:eM,onClose:eU,headerText:"Data map settings",columnNameMap:{...p,...en},prefixColumns:eA(J),tableInstance:eY,savedCustomReportId:q,onColumnOrderChange:e=>{X(""),eY.setColumnOrder(e),et(e)},onColumnVisibilityChange:e=>{X(""),eY.setColumnVisibility(e),er(e)}}),(0,n.jsx)(M,{isOpen:ek,onClose:eH,onConfirm:e=>{let t={};Object.entries(es).forEach(e=>{let[s,a]=e;t[s]={enabled:a}}),Object.entries(en).forEach(e=>{let[s,a]=e;if(t[s])t[s].label=a;else{var r;t[s]={label:a,enabled:null===(r=es[s])||void 0===r||r}}}),ej({...eC,format:e,report_id:q,report:{name:"",type:"datamap",config:{column_map:t,table_state:{groupBy:J,filters:Q,columnOrder:ee}}}}).then(()=>{eb||eH()})},isLoading:ev}),(0,n.jsx)(T.J9,{initialValues:en,onSubmit:e=>{X(""),el(e),eL(!1)},children:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(x.Q$,{children:[(0,n.jsx)(x.HO,{globalFilter:e_,setGlobalFilter:ex,placeholder:"System name, Fides key, or ID"}),(0,n.jsxs)(C.kCb,{alignItems:"center",gap:2,children:[e&&(0,n.jsx)(ea,{reportType:_.C2.DATAMAP,savedReportId:q,tableStateToSave:{groupBy:J,filters:Q,columnOrder:ee,columnVisibility:es},currentColumnMap:en,onCustomReportSaved:(e,t)=>eV(e,t),onSavedReportDeleted:()=>{X("")}}),(0,n.jsxs)(C.v2r,{children:[(0,n.jsxs)(C.j2t,{as:C.wpx,icon:(0,n.jsx)(C.v4q,{}),iconPosition:"end",loading:ec,"data-testid":"group-by-menu",children:["Group by ",(()=>{switch(J){case _.fI.SYSTEM_DATA_USE:return"system";case _.fI.DATA_USE_SYSTEM:return"data use";default:return"system"}})()]}),(0,n.jsxs)(C.qyq,{zIndex:11,"data-testid":"group-by-menu-list",children:[(0,n.jsx)(C.iiZ,{onClick:()=>{eu(_.fI.SYSTEM_DATA_USE)},isChecked:_.fI.SYSTEM_DATA_USE===J,value:_.fI.SYSTEM_DATA_USE,"data-testid":"group-by-system-data-use",children:"System"}),(0,n.jsx)(C.iiZ,{onClick:()=>{eu(_.fI.DATA_USE_SYSTEM)},isChecked:_.fI.DATA_USE_SYSTEM===J,value:_.fI.DATA_USE_SYSTEM,"data-testid":"group-by-data-use-system",children:"Data use"})]})]}),(0,n.jsx)(C.wpx,{"data-testid":"filter-multiple-systems-btn",onClick:G,children:"Filter"}),(0,n.jsx)(C.wpx,{"aria-label":"Export report","data-testid":"export-btn",onClick:eG,icon:(0,n.jsx)(b.nM,{ml:"1.5px"})}),(0,n.jsxs)(C.v2r,{placement:"bottom-end",children:[(0,n.jsx)(C.j2t,{as:C.wpx,icon:(0,n.jsx)(C.nXP,{className:"rotate-90"}),"data-testid":"more-menu","aria-label":"More options",className:"w-6 gap-0"}),(0,n.jsxs)(C.qyq,{"data-testid":"more-menu-list",children:[(0,n.jsx)(C.sNh,{onClick:eP,"data-testid":"edit-columns-btn",children:"Edit columns"}),(0,n.jsx)(C.sNh,{onClick:()=>eL(!0),"data-testid":"rename-columns-btn",children:"Rename columns"})]})]}),eN&&(0,n.jsx)(eS,{columnNameMapOverrides:en,setColumnNameMapOverrides:el,setSavedCustomReportId:X,setIsRenamingColumns:eL})]})]}),(0,n.jsx)(T.l0,{children:(0,n.jsx)(x.ZK,{tableInstance:eY,columnExpandStorageKey:i.COLUMN_EXPANSION_STATE,columnWrapStorageKey:i.WRAPPING_COLUMNS})})]})}),(0,n.jsx)(x.s8,{totalRows:ey||0,pageSizes:s,setPageSize:r,onPreviousPageClick:o,isPreviousPageDisabled:c||eO,onNextPageClick:d,isNextPageDisabled:u||eO,startRange:S,endRange:h}),(0,n.jsx)(N.Z,{selectedSystemId:z,resetSelectedSystemId:()=>W(void 0)})]})};var eC=()=>(0,n.jsxs)(c.Z,{title:"Datamap Report",children:[(0,n.jsx)(d.Z,{"data-testid":"datamap-report-heading",heading:"Data map report"}),(0,n.jsx)(h,{children:(0,n.jsx)(ex,{})})]})}},function(e){e.O(0,[2858,2866,9278,2599,9951,4230,2888,9774,179],function(){return e(e.s=86548)}),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9196],{67375:function(e,t,s){var a=s(52033),r=s(80068);e.exports=function(e,t){var s=-1,i=r(e)?Array(e.length):[];return a(e,function(e,a,r){i[++s]=t(e,a,r)}),i}},55807:function(e,t,s){var a=s(66070),r=s(89278),i=s(67375),o=s(19785);e.exports=function(e,t){return(o(e)?a:i)(e,r(t,3))}},32526:function(e,t,s){var a=s(68267)(function(e,t,s){return e+(s?"_":"")+t.toLowerCase()});e.exports=a},86548:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/reporting/datamap",function(){return s(27901)}])},624:function(e,t,s){"use strict";var a=s(24246),r=s(86920),i=s(27378);let o=e=>{let t=e.split("."),s=[];return t.forEach(e=>{let t=s.length>0?s[s.length-1]:null;t?s.push("".concat(t,".").concat(e)):s.push(e)}),s},n=(e,t)=>{let s=o(t).filter(e=>e!==t);return e.filter(e=>s.includes(e)).length>0},l=(e,t)=>!!(e===t||e.startsWith("".concat(t,"."))),c=(e,t,s)=>{let a=null!=s?s:[];return e.forEach(e=>{e.children&&c(e.children,t,a),l(e.value,t)&&a.push(e)}),a},d=e=>{let{node:t,isChecked:s,onChecked:i,isExpanded:o,onExpanded:n,isIndeterminate:l,isDisabled:c,children:d}=e,{value:u,label:_}=t,p=!!t.children&&t.children.length>0;return(0,a.jsxs)(r.xuv,{children:[(0,a.jsxs)(r.xuv,{display:"flex",justifyContent:"space-between",_hover:{backgroundColor:"gray.100",cursor:"pointer"},onClick:()=>n(t),minHeight:8,children:[(0,a.jsx)(r.XZJ,{colorScheme:"complimentary",value:u,isChecked:!l&&s,isIndeterminate:l,isDisabled:c,onChange:()=>i(t),mx:2,"data-testid":"checkbox-".concat(_),children:_}),p?(0,a.jsx)(r.wpx,{"data-testid":"expand-".concat(_),"aria-label":o?"collapse":"expand",icon:(0,a.jsx)(r.v4q,{boxSize:5}),type:"text",onClick:()=>n(t),className:o?"rotate-180":void 0}):null]}),d&&(0,a.jsx)(r.xuv,{ml:5,children:d})]})};t.ZP=e=>{let{nodes:t,selected:s,onSelected:u,..._}=e,[p,m]=(0,i.useState)([]),[E,S]=(0,i.useState)([]);(0,i.useEffect)(()=>{let e=Array.from(new Set([...s.map(e=>o(e)).reduce((e,t)=>e.concat(t),[]),...s.map(e=>c(t,e)).reduce((e,t)=>e.concat(t),[]).map(e=>e.value)]));S(e),m(e)},[s,t]);let h=e=>{let a=[],r=[];p.indexOf(e.value)>=0?(a=p.filter(t=>!l(t,e.value)),r=s.filter(t=>!l(t,e.value))):(a=[...p,...c(t,e.value).map(e=>e.value)],r=[...s,e.value]),m(a),u(r)},A=e=>{E.indexOf(e.value)>=0?S(E.filter(t=>!l(t,e.value))):S([...E,e.value])},g=e=>{if(e.children){let r=p.indexOf(e.value)>=0,o=E.indexOf(e.value)>=0,l=c(t,e.value),u=r&&e.children.length>0&&p.filter(t=>t.startsWith("".concat(e.value,"."))).length+1!==l.length,_=n(s,e.value);return(0,a.jsx)(d,{node:e,isChecked:r,onChecked:h,isExpanded:o,onExpanded:A,isDisabled:_,isIndeterminate:u,children:o?e.children.map(e=>(0,a.jsx)(i.Fragment,{children:g(e)},e.value)):void 0})}return null};return(0,a.jsx)(r.xuv,{..._,children:t.map(e=>(0,a.jsx)(r.xuv,{children:g(e)},e.value))})}},35287:function(e,t,s){"use strict";var a=s(24246),r=s(86920),i=s(88038),o=s.n(i);s(27378),t.Z=e=>{let{children:t,title:s,mainProps:i}=e;return(0,a.jsxs)(r.kCb,{"data-testid":s,direction:"column",height:"calc(100vh - 48px)",width:"calc(100vw - 240px)",children:[(0,a.jsxs)(o(),{children:[(0,a.jsxs)("title",{children:["Fides Admin UI - ",s]}),(0,a.jsx)("meta",{name:"description",content:"Privacy Engineering Platform"}),(0,a.jsx)("link",{rel:"icon",href:"/favicon.ico"})]}),(0,a.jsx)(r.kCb,{px:10,py:6,as:"main",overflow:"auto",direction:"column",flex:1,minWidth:0,...i,children:t})]})}},56358:function(e,t,s){"use strict";s.d(t,{q:function(){return r}});var a=s(24246);let r=(0,s(86920).IUT)({displayName:"TrashCanOutlineIcon",viewBox:"0 0 11 12",path:(0,a.jsx)("path",{d:"M4.5166 1.60859L4.1084 2.21875H7.22363L6.81543 1.60859C6.7832 1.56133 6.72949 1.53125 6.67148 1.53125H4.6584C4.60039 1.53125 4.54668 1.55918 4.51445 1.60859H4.5166ZM7.6748 1.03711L8.46328 2.21875H8.75977H9.79102H9.96289C10.2486 2.21875 10.4785 2.44863 10.4785 2.73438C10.4785 3.02012 10.2486 3.25 9.96289 3.25H9.79102V9.78125C9.79102 10.7309 9.02188 11.5 8.07227 11.5H3.25977C2.31016 11.5 1.54102 10.7309 1.54102 9.78125V3.25H1.36914C1.0834 3.25 0.853516 3.02012 0.853516 2.73438C0.853516 2.44863 1.0834 2.21875 1.36914 2.21875H1.54102H2.57227H2.86875L3.65723 1.03496C3.88066 0.701953 4.25664 0.5 4.6584 0.5H6.67148C7.07324 0.5 7.44922 0.701953 7.67266 1.03496L7.6748 1.03711ZM2.57227 3.25V9.78125C2.57227 10.1615 2.87949 10.4688 3.25977 10.4688H8.07227C8.45254 10.4688 8.75977 10.1615 8.75977 9.78125V3.25H2.57227ZM4.29102 4.625V9.09375C4.29102 9.28281 4.13633 9.4375 3.94727 9.4375C3.7582 9.4375 3.60352 9.28281 3.60352 9.09375V4.625C3.60352 4.43594 3.7582 4.28125 3.94727 4.28125C4.13633 4.28125 4.29102 4.43594 4.29102 4.625ZM6.00977 4.625V9.09375C6.00977 9.28281 5.85508 9.4375 5.66602 9.4375C5.47695 9.4375 5.32227 9.28281 5.32227 9.09375V4.625C5.32227 4.43594 5.47695 4.28125 5.66602 4.28125C5.85508 4.28125 6.00977 4.43594 6.00977 4.625ZM7.72852 4.625V9.09375C7.72852 9.28281 7.57383 9.4375 7.38477 9.4375C7.1957 9.4375 7.04102 9.28281 7.04102 9.09375V4.625C7.04102 4.43594 7.1957 4.28125 7.38477 4.28125C7.57383 4.28125 7.72852 4.43594 7.72852 4.625Z",fill:"currentColor"})})},19904:function(e,t,s){"use strict";s.d(t,{Tg:function(){return o}});var a=s(24246),r=s(16134),i=s(31793);let o=e=>(0,r.C)(i.uu).filter(t=>e.includes(t)).length>0;t.ZP=e=>{let{scopes:t,children:s}=e;return o(t)?(0,a.jsx)(a.Fragment,{children:s}):null}},70416:function(e,t,s){"use strict";s.d(t,{d:function(){return r}});var a=s(24246);let r=(0,s(86920).IUT)({displayName:"AddIcon",viewBox:"0 0 10 10",path:(0,a.jsx)("path",{d:"M4.33331 4.33398V0.333984H5.66665V4.33398H9.66665V5.66732H5.66665V9.66732H4.33331V5.66732H0.333313V4.33398H4.33331Z",fill:"currentColor"})})},34929:function(e,t,s){"use strict";var a=s(24246),r=s(64925),i=s.n(r),o=s(27378),n=s(16134),l=s(30002),c=s(28079),d=s(57072);let u=()=>{let{isLoading:e}=(0,c.fd)(),t=(0,n.C)(c.U3),{isLoading:s}=(0,d.MO)(),a=(0,n.C)(d.qb),{isLoading:r}=(0,l.te)();return{dataUses:t,dataSubjects:(0,n.C)(l.ZL),dataCategories:a,isLoading:e||s||r}};t.Z=()=>{let{dataUses:e,dataCategories:t,dataSubjects:s,isLoading:r}=u(),n=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return e.split(".").slice(0,t).join(".")},l=function(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=t(e);if(!a)return{};let r=t(n(e,s)),i=!!a.parent_key;return{name:a.name||void 0,primaryName:i&&(null==r?void 0:r.name)!==a.name&&(null==r?void 0:r.name)||void 0}},c=function(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,{name:r,primaryName:i}=l(e,t,s);return r?i?(0,a.jsxs)(o.Fragment,{children:[(0,a.jsxs)("strong",{children:[i,":"]})," ",r]},e):(0,a.jsx)("strong",{children:r},e):e},d=t=>i()(e,{fides_key:t}),_=e=>i()(t,{fides_key:e}),p=e=>i()(s,{fides_key:e});return{getDataUses:()=>e,getDataUseByKey:d,getDataUseDisplayName:e=>c(e,d,1),getDataUseDisplayNameProps:e=>l(e,d,1),getDataCategories:()=>t,getDataCategoryByKey:_,getDataCategoryDisplayName:e=>c(e,_,2),getDataCategoryDisplayNameProps:e=>l(e,_,2),getDataSubjects:()=>s,getDataSubjectByKey:p,getDataSubjectDisplayName:e=>{let t=p(e);return t?t.name:e},getPrimaryKey:n,isLoading:r}}},59001:function(e,t,s){"use strict";s.d(t,{Ch:function(){return o},Hy:function(){return n},Lo:function(){return r}});var a,r,i=s(68309);let o="root";(a=r||(r={})).DATA_CATEGORIES="Data categories",a.DATA_USES="Data uses",a.DATA_SUBJECTS="Data subjects";let n=e=>{switch(e){case"Data categories":return{UPDATE:i.Sh.DATA_CATEGORY_UPDATE,CREATE:i.Sh.DATA_CATEGORY_CREATE,DELETE:i.Sh.DATA_CATEGORY_DELETE,READ:i.Sh.DATA_CATEGORY_READ};case"Data uses":return{UPDATE:i.Sh.DATA_USE_UPDATE,CREATE:i.Sh.DATA_USE_CREATE,DELETE:i.Sh.DATA_USE_DELETE,READ:i.Sh.DATA_USE_READ};case"Data subjects":return{UPDATE:i.Sh.DATA_SUBJECT_UPDATE,CREATE:i.Sh.DATA_SUBJECT_CREATE,DELETE:i.Sh.DATA_SUBJECT_DELETE,READ:i.Sh.DATA_SUBJECT_READ};default:throw Error("Unknown taxonomy type: ".concat(e))}}},90673:function(e,t,s){"use strict";s.d(t,{Cd:function(){return i},Xl:function(){return o}});var a=s(68309),r=s(59001);let i=(e,t)=>{let s;if(null==t&&e.every(e=>void 0===e.parent_key))s=e;else{let a=null!=t?t:null;s=e.filter(e=>e.parent_key===a)}return s.map(t=>{var s,a;let r=t.fides_key;return{value:t.fides_key,label:""===t.name||null==t.name?t.fides_key:t.name,description:t.description,children:i(e,r),is_default:null!==(s=t.is_default)&&void 0!==s&&s,active:null!==(a=t.active)&&void 0!==a&&a}})},o=e=>{switch(e){case r.Lo.DATA_CATEGORIES:return a.P6.DATA_CATEGORY;case r.Lo.DATA_SUBJECTS:return a.P6.DATA_SUBJECT;case r.Lo.DATA_USES:return a.P6.DATA_USE;default:return}}},27901:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return eC}});var a,r,i,o,n=s(24246),l=s(27378),c=s(35287),d=s(58754),u=s(71795),_=s(68309);(a=i||(i={})).COLUMN_EXPANSION_STATE="datamap-column-expansion-state",a.COLUMN_NAMES="datamap-column-names",a.COLUMN_ORDER="datamap-column-order",a.COLUMN_SIZING="datamap-column-sizing",a.COLUMN_VISIBILITY="datamap-column-visibility",a.CUSTOM_REPORT_ID="datamap-custom-report-id",a.FILTERS="datamap-filters",a.GROUP_BY="datamap-group-by",a.SORTING_STATE="datamap-sorting-state",a.WRAPPING_COLUMNS="datamap-wrapping-columns",(r=o||(o={})).SYSTEM_NAME="system_name",r.DATA_USE="data_uses",r.DATA_CATEGORY="data_categories",r.DATA_SUBJECT="data_subjects",r.LEGAL_NAME="legal_name",r.DPO="dpo",r.LEGAL_BASIS_FOR_PROCESSING="legal_basis_for_processing",r.ADMINISTRATING_DEPARTMENT="administrating_department",r.COOKIE_MAX_AGE_SECONDS="cookie_max_age_seconds",r.PRIVACY_POLICY="privacy_policy",r.LEGAL_ADDRESS="legal_address",r.COOKIE_REFRESH="cookie_refresh",r.DATA_SECURITY_PRACTICES="data_security_practices",r.DATA_SHARED_WITH_THIRD_PARTIES="data_shared_with_third_parties",r.DATA_STEWARDS="data_stewards",r.DECLARATION_NAME="declaration_name",r.DOES_INTERNATIONAL_TRANSFERS="does_international_transfers",r.DPA_LOCATION="dpa_location",r.DESTINATIONS="egress",r.EXEMPT_FROM_PRIVACY_REGULATIONS="exempt_from_privacy_regulations",r.FEATURES="features",r.FIDES_KEY="fides_key",r.FLEXIBLE_LEGAL_BASIS_FOR_PROCESSING="flexible_legal_basis_for_processing",r.IMPACT_ASSESSMENT_LOCATION="impact_assessment_location",r.SOURCES="ingress",r.JOINT_CONTROLLER_INFO="joint_controller_info",r.LEGAL_BASIS_FOR_PROFILING="legal_basis_for_profiling",r.LEGAL_BASIS_FOR_TRANSFERS="legal_basis_for_transfers",r.LEGITIMATE_INTEREST_DISCLOSURE_URL="legitimate_interest_disclosure_url",r.PROCESSES_PERSONAL_DATA="processes_personal_data",r.REASON_FOR_EXEMPTION="reason_for_exemption",r.REQUIRES_DATA_PROTECTION_ASSESSMENTS="requires_data_protection_assessments",r.RESPONSIBILITY="responsibility",r.RETENTION_PERIOD="retention_period",r.SHARED_CATEGORIES="shared_categories",r.SPECIAL_CATEGORY_LEGAL_BASIS="special_category_legal_basis",r.THIRD_PARTIES="third_parties",r.COOKIES="cookies",r.USES_COOKIES="uses_cookies",r.USES_NON_COOKIE_ACCESS="uses_non_cookie_access",r.USES_PROFILING="uses_profiling",r.SYSTEM_UNDECLARED_DATA_CATEGORIES="system_undeclared_data_categories",r.DATA_USE_UNDECLARED_DATA_CATEGORIES="data_use_undeclared_data_categories",r.PROCESSES_SPECIAL_CATEGORY_DATA="processes_special_category_data";let p={system_name:"System",data_uses:"Data use",data_categories:"Data categories",data_subjects:"Data subject",legal_name:"Legal name",dpo:"Data privacy officer",legal_basis_for_processing:"Legal basis for processing",administrating_department:"Administrating department",cookie_max_age_seconds:"Cookie max age seconds",privacy_policy:"Privacy policy",legal_address:"Legal address",cookie_refresh:"Cookie refresh",data_security_practices:"Data security practices",data_shared_with_third_parties:"Data shared with third parties",data_stewards:"Data stewards",declaration_name:"Declaration name",does_international_transfers:"Does international transfers",dpa_location:"DPA location",egress:"Destination",exempt_from_privacy_regulations:"Exempt from privacy regulations",features:"Features",fides_key:"Fides key",flexible_legal_basis_for_processing:"Flexible legal basis for processing",impact_assessment_location:"Impact assessment location",ingress:"Source",joint_controller_info:"Joint controller info",legal_basis_for_profiling:"Legal basis for profiling",legal_basis_for_transfers:"Legal basis for transfers",legitimate_interest_disclosure_url:"Legitimate interest disclosure URL",processes_personal_data:"Processes personal data",reason_for_exemption:"Reason for exemption",requires_data_protection_assessments:"Requires data protection assessments",responsibility:"Responsibility",retention_period:"Retention period",shared_categories:"Shared categories",special_category_legal_basis:"Special category legal basis",third_parties:"Third parties",system_undeclared_data_categories:"System undeclared data categories",data_use_undeclared_data_categories:"Data use undeclared data categories",cookies:"Cookies",uses_cookies:"Uses cookies",uses_non_cookie_access:"Uses non-cookie access",uses_profiling:"Uses profiling",processes_special_category_data:"Processes special category data"},m={[o.SYSTEM_UNDECLARED_DATA_CATEGORIES]:!1,[o.DATA_USE_UNDECLARED_DATA_CATEGORIES]:!1},E={dataUses:[],dataSubjects:[],dataCategories:[]},S=(0,l.createContext)({}),h=e=>{let{children:t}=e,[s,a]=(0,u._)(i.CUSTOM_REPORT_ID,""),[r,o]=(0,u._)(i.GROUP_BY,_.fI.SYSTEM_DATA_USE),[c,d]=(0,u._)(i.FILTERS,E),[p,h]=(0,u._)(i.COLUMN_ORDER,[]),[A,g]=(0,u._)(i.COLUMN_VISIBILITY,m),[f,x]=(0,u._)(i.COLUMN_SIZING,{}),[C,T]=(0,u._)(i.COLUMN_NAMES,{}),R=(0,l.useMemo)(()=>({savedCustomReportId:s,setSavedCustomReportId:a,groupBy:r,setGroupBy:o,selectedFilters:c,setSelectedFilters:d,columnOrder:p,setColumnOrder:h,columnVisibility:A,setColumnVisibility:g,columnSizing:f,setColumnSizing:x,columnNameMapOverrides:C,setColumnNameMapOverrides:T}),[s,a,r,o,c,d,p,h,A,g,f,x,C,T]);return(0,n.jsx)(S.Provider,{value:R,children:t})},A=()=>{let e=(0,l.useContext)(S);if(!e||0===Object.keys(e).length)throw Error("useDatamapReport must be used within a DatamapReportProvider");return e};var g=s(59003),f=s(92222),x=s(47935),C=s(86920),T=s(34090),R=s(66726),O=s.n(R),j=s(16134),v=s(34929),b=s(14048),D=s(19904),y=s(16394),I=s(38943),N=s(35258),L=e=>{let{children:t,heading:s,onCancel:a,onConfirm:r,isLoading:i,cancelButtonText:o,continueButtonText:l,"data-testid":c="standard-dialog",...d}=e,{onClose:u}=d;return(0,n.jsxs)(C.u_l,{closeOnOverlayClick:i,...d,children:[(0,n.jsx)(C.ZAr,{}),(0,n.jsxs)(C.hzk,{"data-testid":c,children:[s&&(0,n.jsx)(C.xBx,{children:s}),(0,n.jsx)(C.olH,{isDisabled:i,"data-testid":"standard-dialog-close-btn"}),t&&(0,n.jsx)(C.fef,{children:t}),(0,n.jsxs)(C.mzw,{gap:3,width:"100%",sx:{"& button":{width:"100%"}},children:[(0,n.jsx)(C.wpx,{onClick:()=>{a&&a(),u()},"data-testid":"".concat(c?"".concat(c,"-"):"","cancel-btn"),disabled:i,children:o||"Cancel"}),(0,n.jsx)(C.wpx,{onClick:r,type:"primary","data-testid":"".concat(c?"".concat(c,"-"):"","continue-btn"),loading:i,children:l||"Continue"})]})]})]})},w=s(22968),M=e=>{let[t,s]=(0,l.useState)(w.T2.csv),{onConfirm:a}=e;return(0,n.jsx)(L,{heading:"Export report",continueButtonText:"Download",size:"xl",...e,onConfirm:()=>a(t),"data-testid":"export-modal",children:(0,n.jsxs)(C.kCb,{direction:"column",gap:3,pb:3,children:[(0,n.jsx)(C.xvT,{textAlign:"left",children:"Export your data map report using the options below. Depending on the number of rows, the file may take a few minutes to process."}),(0,n.jsxs)(C.NIc,{children:[(0,n.jsx)(C.lXp,{htmlFor:"format",children:"Choose Format"}),(0,n.jsx)(C.WPr,{id:"format",value:t,onChange:s,"data-testid":"export-format-select",options:[{value:w.T2.csv,label:"CSV"},{value:w.T2.xlsx,label:"XLSX"}],className:"w-full"})]})]})})},P=s(624),U=s(30002),k=s(28079),G=s(90673),H=s(39864);let Y=e=>{let{label:t,children:s,...a}=e;return(0,n.jsxs)(C.Qdk,{...a,children:[(0,n.jsx)(C.X6q,{children:(0,n.jsxs)(C.KFZ,{height:"100%","data-testid":"filter-modal-accordion-button",textAlign:"left",fontWeight:600,children:[(0,n.jsx)(C.xuv,{flex:1,children:t}),(0,n.jsx)(C.XEm,{boxSize:7})]})}),(0,n.jsx)(C.Hk3,{children:s})]})},F=e=>{let{columnNameMap:t,selectedFilters:s,onFilterChange:a,onClose:r,...i}=e;(0,k.fd)(),(0,U.te)(),(0,H.MO)();let{dataUses:o,dataSubjects:c,dataCategories:d}=s,u=(0,j.C)(k.U3),_=(0,j.C)(U.ZL),p=(0,j.C)(H.qb),[m,E]=(0,l.useState)(o),[S,h]=(0,l.useState)(c),[A,g]=(0,l.useState)(d);(0,l.useEffect)(()=>{E(o)},[o]),(0,l.useEffect)(()=>{h(c)},[c]),(0,l.useEffect)(()=>{g(d)},[d]);let f=(0,l.useMemo)(()=>(0,G.Cd)(u),[u]),x=(0,l.useMemo)(()=>(0,G.Cd)(_),[_]),T=(0,l.useMemo)(()=>(0,G.Cd)(p),[p]);return(0,n.jsx)(L,{heading:"Filter Datamap Report",...i,onCancel:()=>{E([]),h([]),g([]),a({dataUses:[],dataSubjects:[],dataCategories:[]}),r()},onConfirm:()=>{a({dataUses:m,dataSubjects:S,dataCategories:A}),r()},onClose:r,cancelButtonText:"Reset filters",continueButtonText:"Done","data-testid":"datamap-report-filter-modal",children:(0,n.jsxs)(C.UQy,{allowToggle:!0,children:[(0,n.jsx)(Y,{label:t.data_uses,children:(0,n.jsx)(P.ZP,{nodes:f,selected:m,onSelected:E,"data-testid":"filter-modal-checkbox-tree-uses"})}),(0,n.jsx)(Y,{label:t.data_categories,children:(0,n.jsx)(P.ZP,{nodes:T,selected:A,onSelected:g,"data-testid":"filter-modal-checkbox-tree-categories"})}),(0,n.jsx)(Y,{label:t.data_subjects,children:(0,n.jsx)(P.ZP,{nodes:x,selected:S,onSelected:h,"data-testid":"filter-modal-checkbox-tree-subjects"})})]})})};var V=s(32885),Z=s(70416),B=s(812),z=s(56358);let{useGetMinimalCustomReportsQuery:W,useLazyGetCustomReportByIdQuery:q,usePostCustomReportMutation:X,useDeleteCustomReportMutation:J}=s(78780).u.injectEndpoints({endpoints:e=>({getMinimalCustomReports:e.query({query:e=>{let{pageIndex:t=1,pageSize:s=50,report_type:a=_.C2.DATAMAP}=e,r="page=".concat(t,"&size=").concat(s,"&report_type=").concat(a);return{url:"plus/custom-report/minimal?".concat(r)}},providesTags:["Custom Reports"]}),getCustomReportById:e.query({query:e=>({url:"plus/custom-report/".concat(e)}),providesTags:(e,t,s)=>[{type:"Custom Reports",id:s}]}),postCustomReport:e.mutation({query:e=>({method:"POST",url:"plus/custom-report",body:e}),invalidatesTags:["Custom Reports"]}),deleteCustomReport:e.mutation({query:e=>({method:"DELETE",url:"plus/custom-report/".concat(e)}),invalidatesTags:["Custom Reports"]})})});var K=s(55484),Q=s(40324);let $="Report name",ee=e=>{let{isOpen:t,handleClose:s,tableStateToSave:a,columnMapToSave:r={},unavailableNames:i,onCreateCustomReport:o}=e,c=(0,C.pmc)(),[d]=X(),u=(0,l.useMemo)(()=>K.Ry().shape({reportName:K.Z_().label($).required("Please provide a name for this report").test("is-unique","",async(e,t)=>null==i||!i.includes(e)||t.createError({message:"This name already exists"})).max(80,"Report name is too long (max 80 characters)")}),[i]),p=async e=>{var t;let i={};Object.entries(r).forEach(e=>{let[t,s]=e;i[t]={label:s,enabled:!0}}),Object.entries(null!==(t=null==a?void 0:a.columnVisibility)&&void 0!==t?t:{}).forEach(e=>{let[t,s]=e;i[t]||(i[t]={}),i[t].enabled=s});try{let t={name:e.trim(),type:_.C2.DATAMAP,config:{column_map:i,table_state:a}},r=await d(t);if((0,B.D4)(r))throw r.error;o(r.data),s()}catch(e){c({status:"error",description:(0,B.e$)(e,"A problem occurred while creating the report.")})}};return(0,n.jsxs)(C.u_l,{size:"lg",isOpen:t,onClose:s,motionPreset:"none",children:[(0,n.jsx)(C.ZAr,{}),(0,n.jsxs)(C.hzk,{children:[(0,n.jsx)(C.xBx,{pb:0,children:"Create a report"}),(0,n.jsx)(T.J9,{initialValues:{reportName:""},onSubmit:e=>p(e.reportName),onReset:s,validateOnBlur:!1,validationSchema:u,children:e=>{let{dirty:t,isValid:s}=e;return(0,n.jsxs)(T.l0,{"data-testid":"custom-report-form",children:[(0,n.jsxs)(C.fef,{children:[(0,n.jsx)(C.xvT,{fontSize:"sm",color:"gray.600",pb:6,children:"Customize and save your current filter settings for easy access in the future. This saved report will include the column layout and currently applied filter settings."}),(0,n.jsx)(Q.j0,{id:"reportName",name:"reportName",isRequired:!0,label:$,placeholder:"Enter a name for the report...",variant:"stacked",maxLength:80})]}),(0,n.jsxs)(C.mzw,{gap:2,children:[(0,n.jsx)(C.wpx,{size:"small",htmlType:"reset",children:"Cancel"}),(0,n.jsx)(C.wpx,{size:"small",disabled:!t||!s,type:"primary","data-testid":"custom-report-form-submit",htmlType:"submit",children:"Save"})]})]})}})]})]})},et="Report",es="Reports",ea=e=>{var t;let{reportType:s,savedReportId:a,tableStateToSave:r,currentColumnMap:i,onCustomReportSaved:o,onSavedReportDeleted:c}=e,d=(0,D.Tg)([_.Sh.CUSTOM_REPORT_CREATE]),u=(0,D.Tg)([_.Sh.CUSTOM_REPORT_DELETE]),p=(0,C.pmc)({id:"custom-report-toast"}),{data:m,isLoading:E}=W({report_type:s}),[S,h]=(0,l.useState)(),[A]=q(),[g]=J(),{isOpen:f,onToggle:x,onOpen:R,onClose:O}=(0,C.qY0)(),{isOpen:j,onOpen:v,onClose:b}=(0,C.qY0)(),{isOpen:y,onOpen:I,onClose:N}=(0,C.qY0)(),[L,w]=(0,l.useState)(),[M,P]=(0,l.useState)(),[U,k]=(0,l.useState)(),[G,H]=(0,l.useState)(!1),{resetForm:Y}=(0,T.u6)(),F=(0,l.useMemo)(()=>{var e;let t=null==m?void 0:null===(e=m.items.find(e=>e.id===a))||void 0===e?void 0:e.name;return null!=t?t:es},[null==m?void 0:m.items,a]),V=!E&&!(null==m?void 0:null===(t=m.items)||void 0===t?void 0:t.length),X=e=>{h(null==m?void 0:m.items.filter(t=>t.name.toLowerCase().includes(e.toLowerCase())))},K=async e=>{w(e);let{data:t,isError:s,error:a}=await A(e);if(s){let e=(0,B.e$)(a,"A problem occurred while fetching the ".concat(et,"."));e.includes("not found")&&c(),p({status:"error",description:e})}else P(t)},Q=()=>{w(""),P(void 0),H(!1)},$=()=>{M?(H(!1),M.id!==a&&o(M,Y),O()):L?H(!0):(o(null,Y),O())},ea=async e=>{e===(null==M?void 0:M.id)&&(Q(),c()),g(e)};(0,l.useEffect)(()=>{m&&h(m.items)},[m]),(0,l.useEffect)(()=>{G&&(H(!1),$())},[M]),(0,l.useEffect)(()=>{a?K(a):Q()},[a]),(0,l.useEffect)(()=>{U&&I()},[I,U]);let er=!M&&!a||(null==M?void 0:M.id)===a;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(C.J2e,{placement:"bottom-end",isOpen:f,onClose:$,id:"custom-reports-selection",children:[(0,n.jsx)(C.xol,{children:(0,n.jsx)(C.wpx,{className:"max-w-40",icon:(0,n.jsx)(C.v4q,{}),iconPosition:"end","data-testid":"custom-reports-trigger",onClick:x,children:(0,n.jsx)(C.xvT,{noOfLines:1,display:"inline-block",children:F})})}),(0,n.jsx)(C.h_i,{children:(0,n.jsxs)(C.yky,{"data-testid":"custom-reports-popover",children:[(0,n.jsx)(C.QHN,{}),(0,n.jsx)(T.J9,{initialValues:{},onSubmit:$,onReset:Q,children:(0,n.jsxs)(T.l0,{children:[(0,n.jsx)(C.wpx,{size:"small",disabled:V,htmlType:"reset",className:"absolute left-2 top-2","data-testid":"custom-reports-reset-button",children:"Reset"}),(0,n.jsxs)(C.Ytg,{textAlign:"center",children:[(0,n.jsx)(C.xvT,{fontSize:"sm",children:es}),(0,n.jsx)(C.BZy,{size:"sm",mt:3,children:(0,n.jsx)(C.IIB,{type:"text",borderRadius:"md",placeholder:"Search...",onChange:e=>X(e.target.value)})})]}),(0,n.jsx)(C.usR,{top:2,onClick:()=>{a?K(a):Q(),O()},"data-testid":"custom-report-popover-cancel"}),(0,n.jsxs)(C.baG,{px:6,pt:5,pb:1,children:[V&&(0,n.jsxs)(C.gCW,{px:2,pt:6,pb:3,"data-testid":"custom-reports-empty-state",children:[(0,n.jsx)(C.wpx,{type:"primary",size:"small","aria-label":"add ".concat(et),icon:(0,n.jsx)(Z.d,{}),onClick:v,className:"rounded-full","data-testid":"add-report-button"}),(0,n.jsxs)(C.xvT,{fontSize:"sm",textAlign:"center",color:"gray.500",children:["No ",es.toLowerCase()," have been created. Start by applying your preferred filter and column settings, then create a"," ",et.toLowerCase()," for easy access later."]})]}),!V&&(E?(0,n.jsxs)(C.gCW,{pb:2,children:[(0,n.jsx)(C.OdW,{width:"100%",height:C.rSc.space[4]}),(0,n.jsx)(C.OdW,{width:"100%",height:C.rSc.space[4]}),(0,n.jsx)(C.OdW,{width:"100%",height:C.rSc.space[4]})]}):(0,n.jsx)(C.y02.Group,{onChange:e=>K(e.target.value),value:L,className:"flex flex-col gap-2",children:null==S?void 0:S.map(e=>(0,n.jsxs)(C.jqI,{className:u?"justify-between":"justify-start",children:[(0,n.jsx)(C.y02,{value:e.id,name:"custom-report-id","data-testid":"custom-report-item",children:(0,n.jsx)(C.xvT,{fontSize:"sm",children:e.name})}),u&&(0,n.jsx)(C.wpx,{type:"text",size:"small",icon:(0,n.jsx)(z.q,{fontSize:16}),onClick:()=>k(e),"data-testid":"delete-report-button"})]},e.id))}))]}),(0,n.jsx)(C.DT9,{border:"none",px:6,pb:4,pt:4,children:(0,n.jsxs)(C.Ugi,{children:[d&&r&&(0,n.jsxs)(C.wpx,{size:"small",onClick:v,className:"w-full","data-testid":"create-report-button",htmlType:"button",children:["+ Create ",et.toLowerCase()]}),(0,n.jsx)(C.wpx,{size:"small",type:"primary",loading:G,disabled:er,className:"w-full","data-testid":"apply-report-button",htmlType:"submit",children:"Apply"})]})})]})})]})})]}),(0,n.jsx)(ee,{isOpen:j,handleClose:()=>{b(),setTimeout(()=>{R()},100)},tableStateToSave:r,columnMapToSave:i,unavailableNames:null==m?void 0:m.items.map(e=>e.name),onCreateCustomReport:e=>o(e,Y)}),(0,n.jsx)(C.cVQ,{isOpen:y,onClose:()=>{k(void 0),N()},onConfirm:()=>{U&&ea(U.id),N()},title:"Delete ".concat(et),message:(0,n.jsxs)(C.xvT,{children:["You are about to permanently delete the"," ",et.toLowerCase()," named"," ",(0,n.jsx)("strong",{children:null==U?void 0:U.name}),". Are you sure you would like to continue?"]})})]})};var er=s(19785),ei=s.n(er),eo=s(55807),en=s.n(eo),el=s(32526),ec=s.n(el),ed=s(72625),eu=s(43862);let e_=(0,f.Cl)(),ep=(e,t)=>({cell:e=>(0,n.jsx)(x.G3,{value:e.getValue()}),header:s=>{let a={};return Object.keys(e).forEach(t=>{"string"==typeof e[t]?a[t]=e[t]:e[t].label&&(a[t]=e[t].label||"")}),(0,n.jsx)(ed.Hm,{value:(0,eu.AH)({columnId:s.column.id,columnNameMap:a}),defaultValue:p[s.column.id]||(0,eu.AH)({columnId:s.column.id}),isEditing:t,...s})}}),em=(e,t)=>{var s;let a=(null==e?void 0:null===(s=e.items)||void 0===s?void 0:s.length)?Object.keys(e.items[0]):[],r=Object.values(o);return a.filter(e=>!r.includes(e)).filter(e=>e.startsWith("privacy_declaration_")||e.startsWith("system_")).map(e=>{let s=t.find(t=>e.includes(ec()(t.name)));return e_.accessor(t=>t[e],{id:e,cell:e=>Array.isArray(e.getValue())?(0,n.jsx)(x.WP,{value:e.getValue(),ignoreZero:!0,...e}):(0,n.jsx)(x.G3,{value:e.getValue()}),meta:{showHeaderMenu:(null==s?void 0:s.field_type)==="string[]"}})})},eE=e=>{let{onSelectRow:t,getDataUseDisplayName:s,getDataCategoryDisplayName:a,getDataSubjectDisplayName:r,datamapReport:i,customFields:l,isRenaming:c=!1}=e,d=em(i,l);return[e_.accessor(e=>e.system_name,{enableGrouping:!0,id:o.SYSTEM_NAME,meta:{onCellClick:t}}),e_.accessor(e=>e.data_uses,{id:o.DATA_USE,cell:e=>{let t=e.getValue();return(0,n.jsx)(x.WP,{suffix:"data uses",ignoreZero:!0,value:ei()(t)?en()(t,s):s(t||""),tagProps:{color:"white"},...e})},meta:{width:"auto"}}),e_.accessor(e=>e.data_categories,{id:o.DATA_CATEGORY,cell:e=>{let t=e.getValue();if(!t||0===t.length)return null;let s=ei()(t)?t.map(e=>({label:a(e),key:e})):[{label:a(t),key:t}];return(0,n.jsx)(ed.mb,{values:s,cellProps:e})},meta:{showHeaderMenu:!c,showHeaderMenuWrapOption:!0,width:"auto",overflow:"hidden"}}),e_.accessor(e=>e.data_subjects,{id:o.DATA_SUBJECT,cell:e=>{let t=e.getValue();return(0,n.jsx)(x.WP,{suffix:"data subjects",ignoreZero:!0,value:ei()(t)?en()(t,r):r(t||""),tagProps:{color:"white"},...e})},meta:{showHeaderMenu:!c}}),e_.accessor(e=>e.legal_name,{id:o.LEGAL_NAME}),e_.accessor(e=>e.dpo,{id:o.DPO}),e_.accessor(e=>e.legal_basis_for_processing,{id:o.LEGAL_BASIS_FOR_PROCESSING}),e_.accessor(e=>e.administrating_department,{id:o.ADMINISTRATING_DEPARTMENT}),e_.accessor(e=>e.cookie_max_age_seconds,{id:o.COOKIE_MAX_AGE_SECONDS}),e_.accessor(e=>e.privacy_policy,{id:o.PRIVACY_POLICY}),e_.accessor(e=>e.legal_address,{id:o.LEGAL_ADDRESS}),e_.accessor(e=>e.cookie_refresh,{id:o.COOKIE_REFRESH}),e_.accessor(e=>e.data_security_practices,{id:o.DATA_SECURITY_PRACTICES}),e_.accessor(e=>e.data_shared_with_third_parties,{id:o.DATA_SHARED_WITH_THIRD_PARTIES}),e_.accessor(e=>e.processes_special_category_data,{id:o.PROCESSES_SPECIAL_CATEGORY_DATA}),e_.accessor(e=>e.data_stewards,{id:o.DATA_STEWARDS,cell:e=>(0,n.jsx)(x.WP,{suffix:"data stewards",ignoreZero:!0,value:e.getValue(),...e}),meta:{showHeaderMenu:!c,width:"auto"}}),e_.accessor(e=>e.declaration_name,{id:o.DECLARATION_NAME}),e_.accessor(e=>e.does_international_transfers,{id:o.DOES_INTERNATIONAL_TRANSFERS}),e_.accessor(e=>e.dpa_location,{id:o.DPA_LOCATION}),e_.accessor(e=>e.egress,{id:o.DESTINATIONS,cell:e=>(0,n.jsx)(x.WP,{suffix:"destinations",ignoreZero:!0,value:e.getValue(),...e}),meta:{showHeaderMenu:!c,width:"auto"}}),e_.accessor(e=>e.exempt_from_privacy_regulations,{id:o.EXEMPT_FROM_PRIVACY_REGULATIONS}),e_.accessor(e=>e.features,{id:o.FEATURES,cell:e=>(0,n.jsx)(x.WP,{suffix:"features",ignoreZero:!0,value:e.getValue(),...e}),meta:{showHeaderMenu:!c,width:"auto"}}),e_.accessor(e=>e.fides_key,{id:o.FIDES_KEY}),e_.accessor(e=>e.flexible_legal_basis_for_processing,{id:o.FLEXIBLE_LEGAL_BASIS_FOR_PROCESSING}),e_.accessor(e=>e.impact_assessment_location,{id:o.IMPACT_ASSESSMENT_LOCATION}),e_.accessor(e=>e.ingress,{id:o.SOURCES,cell:e=>(0,n.jsx)(x.WP,{suffix:"sources",ignoreZero:!0,value:e.getValue(),...e}),meta:{showHeaderMenu:!c,width:"auto"}}),e_.accessor(e=>e.joint_controller_info,{id:o.JOINT_CONTROLLER_INFO}),e_.accessor(e=>e.legal_basis_for_profiling,{id:o.LEGAL_BASIS_FOR_PROFILING,cell:e=>(0,n.jsx)(x.WP,{suffix:"profiles",ignoreZero:!0,value:e.getValue(),...e}),meta:{showHeaderMenu:!c,width:"auto"}}),e_.accessor(e=>e.legal_basis_for_transfers,{id:o.LEGAL_BASIS_FOR_TRANSFERS,cell:e=>(0,n.jsx)(x.WP,{suffix:"transfers",ignoreZero:!0,value:e.getValue(),...e}),meta:{showHeaderMenu:!c,width:"auto"}}),e_.accessor(e=>e.legitimate_interest_disclosure_url,{id:o.LEGITIMATE_INTEREST_DISCLOSURE_URL}),e_.accessor(e=>e.processes_personal_data,{id:o.PROCESSES_PERSONAL_DATA}),e_.accessor(e=>e.reason_for_exemption,{id:o.REASON_FOR_EXEMPTION}),e_.accessor(e=>e.requires_data_protection_assessments,{id:o.REQUIRES_DATA_PROTECTION_ASSESSMENTS}),e_.accessor(e=>e.responsibility,{id:o.RESPONSIBILITY,cell:e=>(0,n.jsx)(x.WP,{suffix:"responsibilities",ignoreZero:!0,value:e.getValue(),...e}),meta:{showHeaderMenu:!c,width:"auto"}}),e_.accessor(e=>e.retention_period,{id:o.RETENTION_PERIOD}),e_.accessor(e=>e.shared_categories,{id:o.SHARED_CATEGORIES,cell:e=>(0,n.jsx)(x.WP,{suffix:"shared categories",ignoreZero:!0,value:e.getValue(),tagProps:{color:"white"},...e}),meta:{showHeaderMenu:!c,width:"auto"}}),e_.accessor(e=>e.special_category_legal_basis,{id:o.SPECIAL_CATEGORY_LEGAL_BASIS}),e_.accessor(e=>e.third_parties,{id:o.THIRD_PARTIES}),e_.accessor(e=>e.system_undeclared_data_categories,{id:o.SYSTEM_UNDECLARED_DATA_CATEGORIES,cell:e=>{let t=e.getValue();if(!t||0===t.length)return null;let s=ei()(t)?t.map(e=>({label:a(e),key:e})):[{label:a(t),key:t}];return(0,n.jsx)(ed.mb,{values:s,cellProps:e})},meta:{showHeaderMenu:!c,showHeaderMenuWrapOption:!0,width:"auto",overflow:"hidden"}}),e_.accessor(e=>e.data_use_undeclared_data_categories,{id:o.DATA_USE_UNDECLARED_DATA_CATEGORIES,cell:e=>{let t=e.getValue();if(!t||0===t.length)return null;let s=ei()(t)?t.map(e=>({label:a(e),key:e})):[{label:a(t),key:t}];return(0,n.jsx)(ed.mb,{values:s,cellProps:e})},meta:{showHeaderMenu:!c,showHeaderMenuWrapOption:!0,width:"auto",overflow:"hidden"}}),e_.accessor(e=>e.cookies,{id:o.COOKIES,cell:e=>(0,n.jsx)(x.WP,{ignoreZero:!0,suffix:"cookies",value:e.getValue(),...e}),meta:{showHeaderMenu:!c,width:"auto"}}),e_.accessor(e=>e.uses_cookies,{id:o.USES_COOKIES}),e_.accessor(e=>e.uses_non_cookie_access,{id:o.USES_NON_COOKIE_ACCESS}),e_.accessor(e=>e.uses_profiling,{id:o.USES_PROFILING}),...d]},eS=e=>{let{columnNameMapOverrides:t,setColumnNameMapOverrides:s,setSavedCustomReportId:a,setIsRenamingColumns:r}=e,{submitForm:i,resetForm:o}=(0,T.u6)();return(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsx)(C.wpx,{size:"small","data-testid":"rename-columns-reset-btn",onClick:()=>{s({}),a(""),o({values:{}}),r(!1)},children:"Reset all"}),(0,n.jsx)(C.wpx,{size:"small","data-testid":"rename-columns-cancel-btn",onClick:()=>{o({values:t}),r(!1)},children:"Cancel"}),(0,n.jsx)(C.wpx,{size:"small",type:"primary",htmlType:"submit","data-testid":"rename-columns-apply-btn",onClick:i,children:"Apply"})]})},eh=e=>e===_.fI.DATA_USE_SYSTEM?[o.DATA_USE]:[o.SYSTEM_NAME],eA=e=>{let t=[];return _.fI.SYSTEM_DATA_USE===e&&(t=[o.SYSTEM_NAME,o.DATA_USE]),_.fI.DATA_USE_SYSTEM===e&&(t=[o.DATA_USE,o.SYSTEM_NAME]),t},eg=(e,t)=>eA(e).concat(t.filter(e=>e!==o.SYSTEM_NAME&&e!==o.DATA_USE)),ef={items:[],total:0,page:1,size:25,pages:1},ex=()=>{let e=(0,D.Tg)([_.Sh.CUSTOM_REPORT_READ]),{isLoading:t}=(0,V.x8)(),{PAGE_SIZES:s,pageSize:a,setPageSize:r,onPreviousPageClick:o,isPreviousPageDisabled:c,onNextPageClick:d,isNextPageDisabled:u,startRange:S,endRange:h,pageIndex:R,setTotalPages:L,resetPageIndexToDefault:w}=(0,x.oi)(),P=(0,C.pmc)({id:"datamap-report-toast"}),{isOpen:U,onClose:k,onOpen:G}=(0,C.qY0)(),{getDataUseDisplayName:H,getDataCategoryDisplayName:Y,getDataSubjectDisplayName:Z,isLoading:B}=(0,v.Z)(),[z,W]=(0,l.useState)(),{savedCustomReportId:q,setSavedCustomReportId:X,groupBy:J,setGroupBy:K,selectedFilters:Q,setSelectedFilters:$,columnOrder:ee,setColumnOrder:et,columnVisibility:es,setColumnVisibility:er,columnSizing:ei,setColumnSizing:eo,columnNameMapOverrides:en,setColumnNameMapOverrides:el}=A(),[ec,ed]=(0,l.useState)(!1),eu=e=>{X(""),K(e),ed(!0),w()},[e_,em]=(0,l.useState)(""),ex=(0,l.useCallback)(e=>{w(),em(e)},[w,em]),eC={pageIndex:R,pageSize:a,groupBy:J,search:e_,dataUses:(0,y.du)(Q.dataUses,"data_uses"),dataSubjects:(0,y.du)(Q.dataSubjects,"data_subjects"),dataCategories:(0,y.du)(Q.dataCategories,"data_categories")},{data:eT,isLoading:eR,isFetching:eO}=(0,I.tH)(eC),[ej,{isLoading:ev,isError:eb}]=(0,I.Eo)(),{data:eD,totalRows:ey}=(0,l.useMemo)(()=>{let e=eT||ef,t=e.items;return ec&&ed(!1),L(e.pages),{totalRows:e.total,data:t}},[eT]);(0,V.GH)();let eI=(0,j.C)(V.fN),[eN,eL]=(0,l.useState)(!1),ew=(0,l.useMemo)(()=>eT?eE({onSelectRow:e=>W(e.fides_key),getDataUseDisplayName:H,getDataCategoryDisplayName:Y,getDataSubjectDisplayName:Z,datamapReport:eT,customFields:eI,isRenaming:eN}):[],[H,Z,Y,eT,eI,eN]),{isOpen:eM,onOpen:eP,onClose:eU}=(0,C.qY0)(),{isOpen:ek,onOpen:eG,onClose:eH}=(0,C.qY0)(),eY=(0,g.b7)({getCoreRowModel:(0,f.sC)(),getGroupedRowModel:(0,f.qe)(),getExpandedRowModel:(0,f.rV)(),manualPagination:!0,enableColumnResizing:!0,columnResizeMode:"onChange",columns:ew,defaultColumn:ep({...p,...en},eN),data:eD,initialState:{expanded:!0,columnSizing:ei,columnOrder:ee,columnVisibility:es,grouping:eh(J)}});(0,l.useEffect)(()=>{J&&eY&&eT&&(0===eY.getState().columnOrder.length?et(eg(J,eY.getAllColumns().map(e=>e.id))):et(eg(J,eY.getState().columnOrder)))},[J,eY,eT]),(0,l.useEffect)(()=>{let e=eh(J);eT&&eY.setGrouping(e)},[eT]);let eF=(0,l.useMemo)(()=>O()(eo,300),[eo]);(0,l.useEffect)(()=>{let e=eY.getState().columnSizing;e&&eF(e)},[eY.getState().columnSizing]);let eV=(e,t)=>{if(e||q){if(!e){try{X(""),er(m),eY.toggleAllColumnsVisible(!0),eY.setColumnVisibility(m),et([]),eY.setColumnOrder([]),K(_.fI.SYSTEM_DATA_USE),$(E),el({}),t({values:{}})}catch(e){P({status:"error",description:"There was a problem resetting the report."})}return}try{var s,a,r,i;if(null===(s=e.config)||void 0===s?void 0:s.table_state){let{groupBy:t,filters:s,columnOrder:a}=e.config.table_state,i={};Object.entries(null!==(r=e.config.column_map)&&void 0!==r?r:{}).forEach(e=>{let[t,s]=e;i[t]=s.enabled||!1}),t&&K(t),s&&$(s),a&&(et(a),eY.setColumnOrder(a)),i&&(er(i),eY.setColumnVisibility(i))}if(null===(a=e.config)||void 0===a?void 0:a.column_map){let s={};Object.entries(null!==(i=e.config.column_map)&&void 0!==i?i:{}).forEach(e=>{let[t,a]=e;a.label&&(s[t]=a.label)}),el(s),t({values:s})}X(e.id),P({status:"success",description:"Report applied successfully."})}catch(e){P({status:"error",description:"There was a problem applying report."})}}};return eR||t||B?(0,n.jsx)(x.I4,{rowHeight:36,numRows:15}):(0,n.jsxs)(C.kCb,{flex:1,direction:"column",overflow:"auto",children:[(0,n.jsx)(F,{columnNameMap:{...p,...en},selectedFilters:Q,isOpen:U,onClose:k,onFilterChange:e=>{X(""),$(e)}}),(0,n.jsx)(x.F1,{isOpen:eM,onClose:eU,headerText:"Data map settings",columnNameMap:{...p,...en},prefixColumns:eA(J),tableInstance:eY,savedCustomReportId:q,onColumnOrderChange:e=>{X(""),eY.setColumnOrder(e),et(e)},onColumnVisibilityChange:e=>{X(""),eY.setColumnVisibility(e),er(e)}}),(0,n.jsx)(M,{isOpen:ek,onClose:eH,onConfirm:e=>{let t={};Object.entries(es).forEach(e=>{let[s,a]=e;t[s]={enabled:a}}),Object.entries(en).forEach(e=>{let[s,a]=e;if(t[s])t[s].label=a;else{var r;t[s]={label:a,enabled:null===(r=es[s])||void 0===r||r}}}),ej({...eC,format:e,report_id:q,report:{name:"",type:"datamap",config:{column_map:t,table_state:{groupBy:J,filters:Q,columnOrder:ee}}}}).then(()=>{eb||eH()})},isLoading:ev}),(0,n.jsx)(T.J9,{initialValues:en,onSubmit:e=>{X(""),el(e),eL(!1)},children:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(x.Q$,{children:[(0,n.jsx)(x.HO,{globalFilter:e_,setGlobalFilter:ex,placeholder:"System name, Fides key, or ID"}),(0,n.jsxs)(C.kCb,{alignItems:"center",gap:2,children:[e&&(0,n.jsx)(ea,{reportType:_.C2.DATAMAP,savedReportId:q,tableStateToSave:{groupBy:J,filters:Q,columnOrder:ee,columnVisibility:es},currentColumnMap:en,onCustomReportSaved:(e,t)=>eV(e,t),onSavedReportDeleted:()=>{X("")}}),(0,n.jsxs)(C.v2r,{children:[(0,n.jsxs)(C.j2t,{as:C.wpx,icon:(0,n.jsx)(C.v4q,{}),iconPosition:"end",loading:ec,"data-testid":"group-by-menu",children:["Group by ",(()=>{switch(J){case _.fI.SYSTEM_DATA_USE:return"system";case _.fI.DATA_USE_SYSTEM:return"data use";default:return"system"}})()]}),(0,n.jsxs)(C.qyq,{zIndex:11,"data-testid":"group-by-menu-list",children:[(0,n.jsx)(C.iiZ,{onClick:()=>{eu(_.fI.SYSTEM_DATA_USE)},isChecked:_.fI.SYSTEM_DATA_USE===J,value:_.fI.SYSTEM_DATA_USE,"data-testid":"group-by-system-data-use",children:"System"}),(0,n.jsx)(C.iiZ,{onClick:()=>{eu(_.fI.DATA_USE_SYSTEM)},isChecked:_.fI.DATA_USE_SYSTEM===J,value:_.fI.DATA_USE_SYSTEM,"data-testid":"group-by-data-use-system",children:"Data use"})]})]}),(0,n.jsx)(C.wpx,{"data-testid":"filter-multiple-systems-btn",onClick:G,children:"Filter"}),(0,n.jsx)(C.wpx,{"aria-label":"Export report","data-testid":"export-btn",onClick:eG,icon:(0,n.jsx)(b.nM,{ml:"1.5px"})}),(0,n.jsxs)(C.v2r,{placement:"bottom-end",children:[(0,n.jsx)(C.j2t,{as:C.wpx,icon:(0,n.jsx)(C.nXP,{className:"rotate-90"}),"data-testid":"more-menu","aria-label":"More options",className:"w-6 gap-0"}),(0,n.jsxs)(C.qyq,{"data-testid":"more-menu-list",children:[(0,n.jsx)(C.sNh,{onClick:eP,"data-testid":"edit-columns-btn",children:"Edit columns"}),(0,n.jsx)(C.sNh,{onClick:()=>eL(!0),"data-testid":"rename-columns-btn",children:"Rename columns"})]})]}),eN&&(0,n.jsx)(eS,{columnNameMapOverrides:en,setColumnNameMapOverrides:el,setSavedCustomReportId:X,setIsRenamingColumns:eL})]})]}),(0,n.jsx)(T.l0,{children:(0,n.jsx)(x.ZK,{tableInstance:eY,columnExpandStorageKey:i.COLUMN_EXPANSION_STATE,columnWrapStorageKey:i.WRAPPING_COLUMNS})})]})}),(0,n.jsx)(x.s8,{totalRows:ey||0,pageSizes:s,setPageSize:r,onPreviousPageClick:o,isPreviousPageDisabled:c||eO,onNextPageClick:d,isNextPageDisabled:u||eO,startRange:S,endRange:h}),(0,n.jsx)(N.Z,{selectedSystemId:z,resetSelectedSystemId:()=>W(void 0)})]})};var eC=()=>(0,n.jsxs)(c.Z,{title:"Datamap Report",children:[(0,n.jsx)(d.Z,{"data-testid":"datamap-report-heading",heading:"Data map report"}),(0,n.jsx)(h,{children:(0,n.jsx)(ex,{})})]})}},function(e){e.O(0,[2858,2866,9278,2599,9951,4230,2888,9774,179],function(){return e(e.s=86548)}),_N_E=e.O()}]);