ethyca-fides 2.58.2b1__py2.py3-none-any.whl → 2.58.2b3__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.
Files changed (109) hide show
  1. {ethyca_fides-2.58.2b1.dist-info → ethyca_fides-2.58.2b3.dist-info}/METADATA +1 -1
  2. {ethyca_fides-2.58.2b1.dist-info → ethyca_fides-2.58.2b3.dist-info}/RECORD +103 -100
  3. fides/_version.py +3 -3
  4. fides/api/alembic/migrations/versions/99c603c1b8f9_add_password_login_enabled_and_totp_secret_to_fidesuser.py +45 -0
  5. fides/api/api/v1/endpoints/user_endpoints.py +8 -12
  6. fides/api/models/detection_discovery.py +31 -0
  7. fides/api/models/fides_user.py +26 -9
  8. fides/api/models/fides_user_invite.py +2 -0
  9. fides/api/models/tcf_publisher_restrictions.py +83 -9
  10. fides/api/schemas/user.py +5 -1
  11. fides/api/service/deps.py +9 -0
  12. fides/service/user/__init__.py +0 -0
  13. fides/service/user/user_service.py +140 -0
  14. fides/ui-build/static/admin/404.html +1 -1
  15. fides/ui-build/static/admin/_next/static/S7gURhIaHGAv7MFBTEOOS/_buildManifest.js +1 -0
  16. fides/ui-build/static/admin/_next/static/chunks/146-0ae2d30ec71fce09.js +1 -0
  17. fides/ui-build/static/admin/_next/static/chunks/3938-6a1c07d06a80cf4c.js +1 -0
  18. fides/ui-build/static/admin/_next/static/chunks/4481-275aa9f4c10bce53.js +1 -0
  19. fides/ui-build/static/admin/_next/static/chunks/pages/{_app-c78f915bdd81b032.js → _app-fbe3db87623c87a0.js} +1 -1
  20. fides/ui-build/static/admin/_next/static/chunks/pages/add-systems/{manual-9acaab973dfe86e2.js → manual-9f9500c639362aa6.js} +1 -1
  21. fides/ui-build/static/admin/_next/static/chunks/pages/consent/privacy-notices-ef31c181cac86c64.js +1 -0
  22. fides/ui-build/static/admin/_next/static/chunks/pages/data-discovery/action-center/[monitorId]/{[systemId]-7dcf1b4c5e068b2d.js → [systemId]-727f1f5d06be674b.js} +1 -1
  23. fides/ui-build/static/admin/_next/static/chunks/pages/data-discovery/action-center/[monitorId]-53efbed54d230f07.js +1 -0
  24. fides/ui-build/static/admin/_next/static/chunks/pages/data-discovery/{action-center-8d46ceb362cad22e.js → action-center-719949074f10bd6e.js} +1 -1
  25. fides/ui-build/static/admin/_next/static/chunks/pages/integrations/{[id]-9ef6b422ae7bc2a8.js → [id]-b75ab4ee677f118d.js} +1 -1
  26. fides/ui-build/static/admin/_next/static/chunks/pages/systems/configure/{[id]-8aae66669bdc0883.js → [id]-a158fa77df288523.js} +1 -1
  27. fides/ui-build/static/admin/_next/static/css/{8b40346f8536b444.css → cf2744a40308fc4a.css} +1 -1
  28. fides/ui-build/static/admin/add-systems/manual.html +1 -1
  29. fides/ui-build/static/admin/add-systems/multiple.html +1 -1
  30. fides/ui-build/static/admin/add-systems.html +1 -1
  31. fides/ui-build/static/admin/ant-poc.html +1 -1
  32. fides/ui-build/static/admin/consent/configure/add-vendors.html +1 -1
  33. fides/ui-build/static/admin/consent/configure.html +1 -1
  34. fides/ui-build/static/admin/consent/privacy-experience/[id].html +1 -1
  35. fides/ui-build/static/admin/consent/privacy-experience/new.html +1 -1
  36. fides/ui-build/static/admin/consent/privacy-experience.html +1 -1
  37. fides/ui-build/static/admin/consent/privacy-notices/[id].html +1 -1
  38. fides/ui-build/static/admin/consent/privacy-notices/new.html +1 -1
  39. fides/ui-build/static/admin/consent/privacy-notices.html +1 -1
  40. fides/ui-build/static/admin/consent/properties.html +1 -1
  41. fides/ui-build/static/admin/consent/reporting.html +1 -1
  42. fides/ui-build/static/admin/consent.html +1 -1
  43. fides/ui-build/static/admin/data-catalog/[systemId]/projects/[projectUrn]/[resourceUrn].html +1 -1
  44. fides/ui-build/static/admin/data-catalog/[systemId]/projects/[projectUrn].html +1 -1
  45. fides/ui-build/static/admin/data-catalog/[systemId]/projects.html +1 -1
  46. fides/ui-build/static/admin/data-catalog/[systemId]/resources/[resourceUrn].html +1 -1
  47. fides/ui-build/static/admin/data-catalog/[systemId]/resources.html +1 -1
  48. fides/ui-build/static/admin/data-catalog.html +1 -1
  49. fides/ui-build/static/admin/data-discovery/action-center/[monitorId]/[systemId].html +1 -1
  50. fides/ui-build/static/admin/data-discovery/action-center/[monitorId].html +1 -1
  51. fides/ui-build/static/admin/data-discovery/action-center.html +1 -1
  52. fides/ui-build/static/admin/data-discovery/activity.html +1 -1
  53. fides/ui-build/static/admin/data-discovery/detection/[resourceUrn].html +1 -1
  54. fides/ui-build/static/admin/data-discovery/detection.html +1 -1
  55. fides/ui-build/static/admin/data-discovery/discovery/[resourceUrn].html +1 -1
  56. fides/ui-build/static/admin/data-discovery/discovery.html +1 -1
  57. fides/ui-build/static/admin/datamap.html +1 -1
  58. fides/ui-build/static/admin/dataset/[datasetId]/[collectionName]/[...subfieldNames].html +1 -1
  59. fides/ui-build/static/admin/dataset/[datasetId]/[collectionName].html +1 -1
  60. fides/ui-build/static/admin/dataset/[datasetId].html +1 -1
  61. fides/ui-build/static/admin/dataset/new.html +1 -1
  62. fides/ui-build/static/admin/dataset.html +1 -1
  63. fides/ui-build/static/admin/datastore-connection/[id].html +1 -1
  64. fides/ui-build/static/admin/datastore-connection/new.html +1 -1
  65. fides/ui-build/static/admin/datastore-connection.html +1 -1
  66. fides/ui-build/static/admin/index.html +1 -1
  67. fides/ui-build/static/admin/integrations/[id].html +1 -1
  68. fides/ui-build/static/admin/integrations.html +1 -1
  69. fides/ui-build/static/admin/login/[provider].html +1 -1
  70. fides/ui-build/static/admin/login.html +1 -1
  71. fides/ui-build/static/admin/messaging/[id].html +1 -1
  72. fides/ui-build/static/admin/messaging/add-template.html +1 -1
  73. fides/ui-build/static/admin/messaging.html +1 -1
  74. fides/ui-build/static/admin/privacy-requests/[id].html +1 -1
  75. fides/ui-build/static/admin/privacy-requests/configure/messaging.html +1 -1
  76. fides/ui-build/static/admin/privacy-requests/configure/storage.html +1 -1
  77. fides/ui-build/static/admin/privacy-requests/configure.html +1 -1
  78. fides/ui-build/static/admin/privacy-requests.html +1 -1
  79. fides/ui-build/static/admin/properties/[id].html +1 -1
  80. fides/ui-build/static/admin/properties/add-property.html +1 -1
  81. fides/ui-build/static/admin/properties.html +1 -1
  82. fides/ui-build/static/admin/reporting/datamap.html +1 -1
  83. fides/ui-build/static/admin/settings/about.html +1 -1
  84. fides/ui-build/static/admin/settings/consent.html +1 -1
  85. fides/ui-build/static/admin/settings/custom-fields.html +1 -1
  86. fides/ui-build/static/admin/settings/domain-records.html +1 -1
  87. fides/ui-build/static/admin/settings/domains.html +1 -1
  88. fides/ui-build/static/admin/settings/email-templates.html +1 -1
  89. fides/ui-build/static/admin/settings/locations.html +1 -1
  90. fides/ui-build/static/admin/settings/organization.html +1 -1
  91. fides/ui-build/static/admin/settings/regulations.html +1 -1
  92. fides/ui-build/static/admin/systems/configure/[id]/test-datasets.html +1 -1
  93. fides/ui-build/static/admin/systems/configure/[id].html +1 -1
  94. fides/ui-build/static/admin/systems.html +1 -1
  95. fides/ui-build/static/admin/taxonomy.html +1 -1
  96. fides/ui-build/static/admin/user-management/new.html +1 -1
  97. fides/ui-build/static/admin/user-management/profile/[id].html +1 -1
  98. fides/ui-build/static/admin/user-management.html +1 -1
  99. fides/api/service/user/fides_user_service.py +0 -128
  100. fides/ui-build/static/admin/_next/static/RGES1F3H00vDTIPgp8u2B/_buildManifest.js +0 -1
  101. fides/ui-build/static/admin/_next/static/chunks/4481-bf0e8da93e3cd9bc.js +0 -1
  102. fides/ui-build/static/admin/_next/static/chunks/7453-a223b7cd00524461.js +0 -1
  103. fides/ui-build/static/admin/_next/static/chunks/pages/consent/privacy-notices-9afb4420bc1128fc.js +0 -1
  104. fides/ui-build/static/admin/_next/static/chunks/pages/data-discovery/action-center/[monitorId]-8d89f50e8498ee8a.js +0 -1
  105. {ethyca_fides-2.58.2b1.dist-info → ethyca_fides-2.58.2b3.dist-info}/LICENSE +0 -0
  106. {ethyca_fides-2.58.2b1.dist-info → ethyca_fides-2.58.2b3.dist-info}/WHEEL +0 -0
  107. {ethyca_fides-2.58.2b1.dist-info → ethyca_fides-2.58.2b3.dist-info}/entry_points.txt +0 -0
  108. {ethyca_fides-2.58.2b1.dist-info → ethyca_fides-2.58.2b3.dist-info}/top_level.txt +0 -0
  109. /fides/ui-build/static/admin/_next/static/{RGES1F3H00vDTIPgp8u2B → S7gURhIaHGAv7MFBTEOOS}/_ssgManifest.js +0 -0
@@ -1,7 +1,6 @@
1
1
  # pylint: disable=unused-import
2
2
  from __future__ import annotations
3
3
 
4
- import uuid
5
4
  from datetime import datetime
6
5
  from typing import TYPE_CHECKING, Any, List
7
6
 
@@ -10,6 +9,10 @@ from sqlalchemy import Boolean, Column, DateTime
10
9
  from sqlalchemy import Enum as EnumColumn
11
10
  from sqlalchemy import String
12
11
  from sqlalchemy.orm import Session, relationship
12
+ from sqlalchemy_utils.types.encrypted.encrypted_type import (
13
+ AesGcmEngine,
14
+ StringEncryptedType,
15
+ )
13
16
 
14
17
  from fides.api.common_exceptions import SystemManagerException
15
18
  from fides.api.cryptography.cryptographic_util import (
@@ -20,8 +23,8 @@ from fides.api.db.base_class import Base
20
23
  from fides.api.models.audit_log import AuditLog
21
24
 
22
25
  # Intentionally importing SystemManager here to build the FidesUser.systems relationship
23
- from fides.api.models.system_manager import SystemManager # type: ignore[unused-import]
24
26
  from fides.api.schemas.user import DisabledReason
27
+ from fides.config import CONFIG
25
28
 
26
29
  if TYPE_CHECKING:
27
30
  from fides.api.models.sql_models import System # type: ignore[attr-defined]
@@ -34,12 +37,22 @@ class FidesUser(Base):
34
37
  email_address = Column(CIText, unique=True, nullable=True)
35
38
  first_name = Column(String, nullable=True)
36
39
  last_name = Column(String, nullable=True)
37
- hashed_password = Column(String, nullable=False)
38
- salt = Column(String, nullable=False)
40
+ hashed_password = Column(String, nullable=True)
41
+ salt = Column(String, nullable=True)
39
42
  disabled = Column(Boolean, nullable=False, server_default="f")
40
43
  disabled_reason = Column(EnumColumn(DisabledReason), nullable=True)
41
44
  last_login_at = Column(DateTime(timezone=True), nullable=True)
42
45
  password_reset_at = Column(DateTime(timezone=True), nullable=True)
46
+ password_login_enabled = Column(Boolean, nullable=True)
47
+ totp_secret = Column(
48
+ StringEncryptedType(
49
+ type_in=String(),
50
+ key=CONFIG.security.app_encryption_key,
51
+ engine=AesGcmEngine,
52
+ padding="pkcs5",
53
+ ),
54
+ nullable=True,
55
+ )
43
56
 
44
57
  # passive_deletes="all" prevents audit logs from having their
45
58
  # privacy_request_id set to null when a privacy_request is deleted.
@@ -79,11 +92,11 @@ class FidesUser(Base):
79
92
  """Create a FidesUser by hashing the password with a generated salt
80
93
  and storing the hashed password and the salt"""
81
94
 
82
- # we set a dummy password if one isn't provided because this means it's part of the user
83
- # invite flow and the password will be set by the user after they accept their invite
84
- hashed_password, salt = FidesUser.hash_password(
85
- data.get("password") or str(uuid.uuid4())
86
- )
95
+ if password := data.get("password"):
96
+ hashed_password, salt = FidesUser.hash_password(password)
97
+ else:
98
+ hashed_password = None
99
+ salt = None
87
100
 
88
101
  user = super().create(
89
102
  db,
@@ -96,6 +109,7 @@ class FidesUser(Base):
96
109
  "last_name": data.get("last_name"),
97
110
  "disabled": data.get("disabled") or False,
98
111
  "disabled_reason": data.get("disabled_reason"),
112
+ "password_login_enabled": data.get("password_login_enabled"),
99
113
  },
100
114
  check_name=check_name,
101
115
  )
@@ -104,6 +118,9 @@ class FidesUser(Base):
104
118
 
105
119
  def credentials_valid(self, password: str, encoding: str = "UTF-8") -> bool:
106
120
  """Verifies that the provided password is correct."""
121
+ if self.salt is None:
122
+ return False
123
+
107
124
  provided_password_hash = hash_credential_with_salt(
108
125
  password.encode(encoding),
109
126
  self.salt.encode(encoding),
@@ -67,6 +67,8 @@ class FidesUserInvite(Base):
67
67
 
68
68
  def invite_code_valid(self, invite_code: str, encoding: str = "UTF-8") -> bool:
69
69
  """Verifies that the provided invite code is correct."""
70
+ if self.salt is None:
71
+ return False
70
72
 
71
73
  invite_code_hash = hash_credential_with_salt(
72
74
  invite_code.encode(encoding),
@@ -4,7 +4,7 @@ from typing import Any, Dict, List, Optional
4
4
  from pydantic import BaseModel, Field, ValidationError, model_validator
5
5
  from sqlalchemy import Column
6
6
  from sqlalchemy import Enum as EnumColumn
7
- from sqlalchemy import ForeignKey, Index, Integer, String, insert, select
7
+ from sqlalchemy import ForeignKey, Index, Integer, String, insert, select, update
8
8
  from sqlalchemy.dialects.postgresql import ARRAY, JSONB
9
9
  from sqlalchemy.ext.asyncio import AsyncSession
10
10
  from sqlalchemy.ext.declarative import declared_attr
@@ -185,21 +185,56 @@ class TCFPublisherRestriction(Base):
185
185
 
186
186
  return data
187
187
 
188
+ @classmethod
189
+ async def validate_vendor_overlaps_for_purpose(
190
+ cls,
191
+ async_db: AsyncSession,
192
+ configuration_id: str,
193
+ purpose_id: int,
194
+ new_data: dict,
195
+ ) -> None:
196
+ """
197
+ Validates that the new vendor ranges do not overlap with any existing vendor ranges for the purpose
198
+ in the given configuration.
199
+ Raises a ValueError if any vendor ranges overlap.
200
+ """
201
+ # First, get all the restrictions for the purpose in the given configuration
202
+ query = (
203
+ select(cls) # type: ignore[arg-type]
204
+ .where(cls.tcf_configuration_id == configuration_id)
205
+ .where(cls.purpose_id == purpose_id)
206
+ )
207
+ restrictions = await async_db.execute(query)
208
+ restrictions = restrictions.scalars().all()
209
+
210
+ # If we have an existing id, we need to exclude the current restriction from the list of existing restrictions
211
+ # so that the new_data restrictions don't overlap with themselves
212
+ if "id" in new_data:
213
+ existing_entries = [
214
+ entry
215
+ for r in restrictions
216
+ for entry in r.range_entries
217
+ if r.id != new_data["id"]
218
+ ]
219
+ else:
220
+ existing_entries = [
221
+ entry for r in restrictions for entry in r.range_entries
222
+ ]
223
+
224
+ all_entries = [*existing_entries, *new_data.get("range_entries", [])]
225
+ cls.check_for_overlaps(
226
+ [RangeEntry.model_validate(entry) for entry in all_entries]
227
+ )
228
+
188
229
  @classmethod
189
230
  def create(
190
231
  cls,
191
232
  db: Session,
192
233
  *,
193
234
  data: Dict[str, Any],
194
- check_name: bool = False,
235
+ check_name: bool = True,
195
236
  ) -> "TCFPublisherRestriction":
196
- """
197
- Create a new TCFPublisherRestriction with validated range_entries.
198
- Validates each range entry using the RangeEntry Pydantic model.
199
- """
200
- data = cls.validate_publisher_restriction_data(data)
201
-
202
- return super().create(db=db, data=data, check_name=check_name)
237
+ raise NotImplementedError("Use create_async instead")
203
238
 
204
239
  @classmethod
205
240
  async def create_async(
@@ -222,9 +257,48 @@ class TCFPublisherRestriction(Base):
222
257
  "range_entries": data["range_entries"],
223
258
  }
224
259
 
260
+ # Validate that the new vendor ranges do not overlap with any existing vendor ranges for the purpose
261
+ await cls.validate_vendor_overlaps_for_purpose(
262
+ async_db=async_db,
263
+ configuration_id=data["tcf_configuration_id"],
264
+ purpose_id=data["purpose_id"],
265
+ new_data=values,
266
+ )
267
+
268
+ # Insert the new restriction
225
269
  insert_stmt = insert(cls).values(values) # type: ignore[arg-type]
226
270
  result = await async_db.execute(insert_stmt)
227
271
  record_id = result.inserted_primary_key.id
228
272
 
229
273
  created_record = await async_db.execute(select(cls).where(cls.id == record_id)) # type: ignore[arg-type]
230
274
  return created_record.scalars().first()
275
+
276
+ async def update_async(
277
+ self, async_db: AsyncSession, data: Dict[str, Any]
278
+ ) -> "TCFPublisherRestriction":
279
+ """
280
+ Update a TCFPublisherRestriction with the data.
281
+ Validates the data and checks for vendor overlaps.
282
+ """
283
+ # Validate the data on its own
284
+ data = self.validate_publisher_restriction_data(data)
285
+
286
+ # Validate that the new vendor ranges do not overlap with any existing vendor ranges for the purpose
287
+ await self.validate_vendor_overlaps_for_purpose(
288
+ async_db=async_db,
289
+ configuration_id=self.tcf_configuration_id,
290
+ purpose_id=self.purpose_id,
291
+ new_data={**data, "id": self.id}, # Pass in id explicitly
292
+ )
293
+
294
+ # Finally, make the update
295
+ update_query = (
296
+ update(TCFPublisherRestriction) # type: ignore[arg-type]
297
+ .where(TCFPublisherRestriction.id == self.id)
298
+ .values(**data)
299
+ )
300
+ await async_db.execute(update_query)
301
+ await async_db.commit()
302
+ await async_db.refresh(self)
303
+
304
+ return self
fides/api/schemas/user.py CHANGED
@@ -3,7 +3,7 @@ from datetime import datetime
3
3
  from enum import Enum
4
4
  from typing import Optional
5
5
 
6
- from pydantic import EmailStr, field_validator
6
+ from pydantic import ConfigDict, EmailStr, field_validator
7
7
 
8
8
  from fides.api.cryptography.cryptographic_util import decode_password
9
9
  from fides.api.schemas.base_class import FidesSchema
@@ -27,6 +27,8 @@ class UserCreate(FidesSchema):
27
27
  last_name: Optional[str] = None
28
28
  disabled: bool = False
29
29
 
30
+ model_config = ConfigDict(extra="ignore")
31
+
30
32
  @field_validator("username")
31
33
  @classmethod
32
34
  def validate_username(cls, username: str) -> str:
@@ -140,6 +142,8 @@ class UserUpdate(FidesSchema):
140
142
  first_name: Optional[str] = None
141
143
  last_name: Optional[str] = None
142
144
 
145
+ model_config = ConfigDict(extra="ignore")
146
+
143
147
 
144
148
  class DisabledReason(Enum):
145
149
  """Reasons for why a user is disabled"""
fides/api/service/deps.py CHANGED
@@ -8,6 +8,7 @@ from fides.service.dataset.dataset_config_service import DatasetConfigService
8
8
  from fides.service.dataset.dataset_service import DatasetService
9
9
  from fides.service.messaging.messaging_service import MessagingService
10
10
  from fides.service.privacy_request.privacy_request_service import PrivacyRequestService
11
+ from fides.service.user.user_service import UserService
11
12
 
12
13
 
13
14
  def get_messaging_service(
@@ -32,3 +33,11 @@ def get_dataset_service(db: Session = Depends(get_db)) -> DatasetService:
32
33
 
33
34
  def get_dataset_config_service(db: Session = Depends(get_db)) -> DatasetConfigService:
34
35
  return DatasetConfigService(db)
36
+
37
+
38
+ def get_user_service(
39
+ db: Session = Depends(get_db),
40
+ config: FidesConfig = Depends(get_config),
41
+ config_proxy: ConfigProxy = Depends(get_config_proxy),
42
+ ) -> UserService:
43
+ return UserService(db, config, config_proxy)
File without changes
@@ -0,0 +1,140 @@
1
+ import uuid
2
+ from datetime import datetime
3
+ from typing import Optional, Tuple
4
+
5
+ from loguru import logger
6
+ from sqlalchemy.orm import Session
7
+
8
+ from fides.api.api.v1.endpoints.messaging_endpoints import user_email_invite_status
9
+ from fides.api.common_exceptions import AuthorizationError
10
+ from fides.api.models.client import ClientDetail
11
+ from fides.api.models.fides_user import FidesUser
12
+ from fides.api.models.fides_user_invite import FidesUserInvite
13
+ from fides.api.schemas.messaging.messaging import (
14
+ MessagingActionType,
15
+ UserInviteBodyParams,
16
+ )
17
+ from fides.api.schemas.redis_cache import Identity
18
+ from fides.api.service.messaging.message_dispatch_service import dispatch_message
19
+ from fides.config import FidesConfig
20
+ from fides.config.config_proxy import ConfigProxy
21
+
22
+
23
+ class UserService:
24
+ def __init__(self, db: Session, config: FidesConfig, config_proxy: ConfigProxy):
25
+ self.db = db
26
+ self.config = config
27
+ self.config_proxy = config_proxy
28
+
29
+ def invite_user(self, user: FidesUser) -> None:
30
+ """
31
+ Generates a user invite and sends the invite code to the user via email.
32
+
33
+ This is a no-op if email messaging isn't configured.
34
+ """
35
+
36
+ # invite user via email if email messaging is enabled and the Admin UI URL is defined
37
+ if user_email_invite_status(db=self.db, config_proxy=self.config_proxy).enabled:
38
+ invite_code = str(uuid.uuid4())
39
+ FidesUserInvite.create(
40
+ db=self.db, data={"username": user.username, "invite_code": invite_code}
41
+ )
42
+ user.update(self.db, data={"disabled": True})
43
+ # TODO: refactor to use MessagingService
44
+ dispatch_message(
45
+ self.db,
46
+ action_type=MessagingActionType.USER_INVITE,
47
+ to_identity=Identity(email=user.email_address),
48
+ service_type=self.config_proxy.notifications.notification_service_type,
49
+ message_body_params=UserInviteBodyParams(
50
+ username=user.username, invite_code=invite_code
51
+ ),
52
+ )
53
+ else:
54
+ logger.debug(
55
+ "Skipping invitation email, an email messaging provider is not enabled",
56
+ )
57
+
58
+ def perform_login(
59
+ self,
60
+ client_id_byte_length: int,
61
+ client_secret_byte_length: int,
62
+ user: FidesUser,
63
+ skip_save: Optional[bool] = False,
64
+ ) -> ClientDetail:
65
+ """Performs a login by updating the FidesUser instance and creating and returning
66
+ an associated ClientDetail.
67
+
68
+ If the username or password was bad, skip_save should be True. We still run through
69
+ parallel operations to keep the timing of operations similar, but should skip
70
+ saving to the database.
71
+ """
72
+
73
+ client = user.client
74
+ if not client:
75
+ logger.info("Creating client for login")
76
+ client, _ = ClientDetail.create_client_and_secret(
77
+ self.db,
78
+ client_id_byte_length,
79
+ client_secret_byte_length,
80
+ scopes=[], # type: ignore
81
+ roles=user.permissions.roles, # type: ignore
82
+ systems=user.system_ids, # type: ignore
83
+ user_id=user.id,
84
+ in_memory=skip_save, # If login flow has already errored, don't persist this to the database
85
+ )
86
+ else:
87
+ # Refresh the client just in case - for example, scopes and roles were added via the db directly.
88
+ client.roles = user.permissions.roles # type: ignore
89
+ client.systems = user.system_ids # type: ignore
90
+ if not skip_save:
91
+ client.save(self.db)
92
+
93
+ if user.permissions and (not user.permissions.roles and not user.systems): # type: ignore
94
+ logger.warning("User {} needs roles or systems to login.", user.id)
95
+ raise AuthorizationError(detail="Not Authorized for this action")
96
+
97
+ if not skip_save:
98
+ user.last_login_at = datetime.utcnow()
99
+ user.save(self.db)
100
+
101
+ return client
102
+
103
+ def accept_invite(
104
+ self, user: FidesUser, new_password: str
105
+ ) -> Tuple[FidesUser, str]:
106
+ """
107
+ Updates the user password and enables the user. Also removes the user invite from the database.
108
+ Returns a tuple of the updated user and their access code.
109
+ """
110
+
111
+ # update password and enable
112
+ user.update_password(db=self.db, new_password=new_password)
113
+ user.update(
114
+ self.db,
115
+ data={"disabled": False, "disabled_reason": None},
116
+ )
117
+ self.db.refresh(user)
118
+
119
+ # delete invite
120
+ if user.username:
121
+ invite = FidesUserInvite.get_by(
122
+ db=self.db, field="username", value=user.username
123
+ )
124
+ if invite:
125
+ invite.delete(self.db)
126
+ else:
127
+ logger.warning("Username is missing, skipping invite deletion.")
128
+
129
+ client = self.perform_login(
130
+ self.config.security.oauth_client_id_length_bytes,
131
+ self.config.security.oauth_client_secret_length_bytes,
132
+ user,
133
+ )
134
+
135
+ logger.info("Creating login access token")
136
+ access_code = client.create_access_code_jwe(
137
+ self.config.security.app_encryption_key
138
+ )
139
+
140
+ return user, access_code
@@ -1 +1 @@
1
- <!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link data-next-font="" rel="preconnect" href="/" crossorigin="anonymous"/><link rel="preload" href="/_next/static/css/8b40346f8536b444.css" as="style"/><link rel="stylesheet" href="/_next/static/css/8b40346f8536b444.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-2c7ccac5843c4d8e.js" defer=""></script><script src="/_next/static/chunks/framework-c92fc3344e6fd165.js" defer=""></script><script src="/_next/static/chunks/main-090643377c8254e6.js" defer=""></script><script src="/_next/static/chunks/pages/_app-c78f915bdd81b032.js" defer=""></script><script src="/_next/static/chunks/pages/404-b202c0d8f6fc75c3.js" defer=""></script><script src="/_next/static/RGES1F3H00vDTIPgp8u2B/_buildManifest.js" defer=""></script><script src="/_next/static/RGES1F3H00vDTIPgp8u2B/_ssgManifest.js" defer=""></script><style>.data-ant-cssinjs-cache-path{content:"";}</style></head><body><div id="__next"><div style="height:100%;display:flex"></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{}},"page":"/404","query":{},"buildId":"RGES1F3H00vDTIPgp8u2B","nextExport":true,"autoExport":true,"isFallback":false,"scriptLoader":[]}</script></body></html>
1
+ <!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><meta name="next-head-count" content="2"/><link data-next-font="" rel="preconnect" href="/" crossorigin="anonymous"/><link rel="preload" href="/_next/static/css/cf2744a40308fc4a.css" as="style"/><link rel="stylesheet" href="/_next/static/css/cf2744a40308fc4a.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-2c7ccac5843c4d8e.js" defer=""></script><script src="/_next/static/chunks/framework-c92fc3344e6fd165.js" defer=""></script><script src="/_next/static/chunks/main-090643377c8254e6.js" defer=""></script><script src="/_next/static/chunks/pages/_app-fbe3db87623c87a0.js" defer=""></script><script src="/_next/static/chunks/pages/404-b202c0d8f6fc75c3.js" defer=""></script><script src="/_next/static/S7gURhIaHGAv7MFBTEOOS/_buildManifest.js" defer=""></script><script src="/_next/static/S7gURhIaHGAv7MFBTEOOS/_ssgManifest.js" defer=""></script><style>.data-ant-cssinjs-cache-path{content:"";}</style></head><body><div id="__next"><div style="height:100%;display:flex"></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{}},"page":"/404","query":{},"buildId":"S7gURhIaHGAv7MFBTEOOS","nextExport":true,"autoExport":true,"isFallback":false,"scriptLoader":[]}</script></body></html>
@@ -0,0 +1 @@
1
+ self.__BUILD_MANIFEST=function(s,a,e,t,c,n,i,d,o,r,u,g,p,f,j,b,k,h,m,y,l,v,I,U,_,w,q,x,N,B,F,z,A,D,E,L,M,S,T,C,P,G,H,J,K,O,Q,R){return{__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},"/":[q,"static/chunks/pages/index-b70def65e264270e.js"],"/404":["static/chunks/pages/404-b202c0d8f6fc75c3.js"],"/_error":["static/chunks/pages/_error-bede3a8288930dcf.js"],"/add-systems":[q,"static/chunks/pages/add-systems-fac606150b65d494.js"],"/add-systems/manual":[s,a,t,c,n,b,e,o,g,k,h,y,x,i,"static/chunks/pages/add-systems/manual-9f9500c639362aa6.js"],"/add-systems/multiple":[s,a,e,g,l,N,"static/chunks/pages/add-systems/multiple-ba975134a85588f8.js"],"/ant-poc":["static/chunks/pages/ant-poc-b9932971a479f3a7.js"],"/consent":["static/chunks/pages/consent-39d65f13cc8f1cf8.js"],"/consent/configure":[s,a,e,g,l,"static/chunks/pages/consent/configure-a4e636eecaba5324.js"],"/consent/configure/add-vendors":[s,a,e,g,l,N,"static/chunks/pages/consent/configure/add-vendors-b34e5324461d0c87.js"],"/consent/privacy-experience":[s,a,b,e,B,"static/chunks/pages/consent/privacy-experience-ba5325035c71a97e.js"],"/consent/privacy-experience/new":[t,c,p,F,d,m,z,"static/chunks/pages/consent/privacy-experience/new-c02b14c50b19bd91.js"],"/consent/privacy-experience/[id]":[t,c,p,F,d,m,z,"static/chunks/pages/consent/privacy-experience/[id]-ab3ef485f6101697.js"],"/consent/privacy-notices":[s,a,e,B,"static/chunks/pages/consent/privacy-notices-ef31c181cac86c64.js"],"/consent/privacy-notices/new":[t,c,p,A,d,m,D,"static/chunks/pages/consent/privacy-notices/new-9611dd42856d6062.js"],"/consent/privacy-notices/[id]":[t,c,p,A,d,m,D,"static/chunks/pages/consent/privacy-notices/[id]-606457ef5bd1eb04.js"],"/consent/properties":[s,a,e,E,"static/chunks/pages/consent/properties-e5748812ba055a56.js"],"/consent/reporting":[s,a,t,e,"static/chunks/pages/consent/reporting-100234c23a85d235.js"],"/data-catalog":[s,a,t,c,n,e,"static/css/95ac327e5d70148d.css","static/chunks/pages/data-catalog-49bffaf07973fead.js"],"/data-catalog/[systemId]/projects":[s,a,t,c,n,e,f,v,i,"static/chunks/pages/data-catalog/[systemId]/projects-c44ce244122e96d5.js"],"/data-catalog/[systemId]/projects/[projectUrn]":[s,a,e,L,"static/chunks/pages/data-catalog/[systemId]/projects/[projectUrn]-a29850536c85d4b8.js"],"/data-catalog/[systemId]/projects/[projectUrn]/[resourceUrn]":[s,a,t,c,n,e,f,v,M,i,"static/chunks/pages/data-catalog/[systemId]/projects/[projectUrn]/[resourceUrn]-ac033a16f043e6f9.js"],"/data-catalog/[systemId]/resources":[s,a,e,L,"static/chunks/pages/data-catalog/[systemId]/resources-305555b74c357bf2.js"],"/data-catalog/[systemId]/resources/[resourceUrn]":[s,a,t,c,n,e,f,v,M,i,"static/chunks/pages/data-catalog/[systemId]/resources/[resourceUrn]-71e26d262afcaea5.js"],"/data-discovery/action-center":[s,a,e,"static/chunks/pages/data-discovery/action-center-719949074f10bd6e.js"],"/data-discovery/action-center/[monitorId]":[s,a,t,c,n,e,r,h,"static/chunks/pages/data-discovery/action-center/[monitorId]-53efbed54d230f07.js"],"/data-discovery/action-center/[monitorId]/[systemId]":[s,a,t,c,n,e,h,y,i,"static/chunks/pages/data-discovery/action-center/[monitorId]/[systemId]-727f1f5d06be674b.js"],"/data-discovery/activity":[s,a,e,r,I,"static/chunks/pages/data-discovery/activity-4892603e743cd6ab.js"],"/data-discovery/detection":[s,a,e,r,I,S,"static/chunks/pages/data-discovery/detection-b75dd3e4306ac18e.js"],"/data-discovery/detection/[resourceUrn]":[s,a,e,r,I,S,"static/chunks/pages/data-discovery/detection/[resourceUrn]-054ca46a782e99a5.js"],"/data-discovery/discovery":[s,a,t,c,n,e,r,f,T,i,"static/chunks/pages/data-discovery/discovery-cad50b0cc6d1050c.js"],"/data-discovery/discovery/[resourceUrn]":[s,a,t,c,n,e,r,f,T,i,"static/chunks/pages/data-discovery/discovery/[resourceUrn]-1da20aeb6fc995e4.js"],"/datamap":[s,a,"static/chunks/255-7db55b0e3a0f9dea.js",e,o,k,C,"static/chunks/pages/datamap-8cb714cdd44ac40e.js"],"/dataset":[s,a,u,e,j,"static/chunks/pages/dataset-29317d18ce34adfe.js"],"/dataset/new":[u,j,"static/chunks/pages/dataset/new-4d4a31d0186a4a5b.js"],"/dataset/[datasetId]":[s,a,"static/chunks/9729-fcf6ff4e3534e4a8.js",e,U,"static/chunks/pages/dataset/[datasetId]-6ba18f92ba561114.js"],"/dataset/[datasetId]/[collectionName]":[s,a,t,c,n,_,e,U,i,"static/chunks/pages/dataset/[datasetId]/[collectionName]-7e5df4a0de7540bb.js"],"/dataset/[datasetId]/[collectionName]/[...subfieldNames]":[s,a,t,c,n,_,e,U,i,"static/chunks/pages/dataset/[datasetId]/[collectionName]/[...subfieldNames]-d79551d4c64c398c.js"],"/datastore-connection":["static/css/5f393dea1c0d031c.css","static/chunks/pages/datastore-connection-d2f88a8fc68944db.js"],"/datastore-connection/new":[u,b,j,P,"static/chunks/pages/datastore-connection/new-f0a4e385c1ad8fee.js"],"/datastore-connection/[id]":[u,j,P,"static/chunks/pages/datastore-connection/[id]-14c57e5069e9cccd.js"],"/fides-js-docs":["static/chunks/2fbcc6de-a6c61724c327e9fa.js","static/chunks/e3251fe7-5777b5d778e6fffa.js",t,c,n,u,_,G,"static/css/ab65b8cc3144bfc8.css","static/chunks/905-8ab919e7b274ed50.js","static/chunks/pages/fides-js-docs-80b241bf6cddb72e.js"],"/integrations":[t,c,n,"static/chunks/6834-dcda0a8ed484775e.js",H,"static/chunks/pages/integrations-ef8000d7388dc915.js"],"/integrations/[id]":[s,a,t,c,n,"static/chunks/9255-336a890ada321f89.js",e,H,"static/chunks/pages/integrations/[id]-b75ab4ee677f118d.js"],"/login":["static/chunks/pages/login-0cb0eb44bf2dd24c.js"],"/login/[provider]":["static/chunks/pages/login/[provider]-c58beef131c3a82d.js"],"/messaging":[s,a,t,c,n,e,"static/chunks/pages/messaging-1e60754abec1ee6b.js"],"/messaging/add-template":[d,J,"static/chunks/pages/messaging/add-template-f9693cb6a0b7ded8.js"],"/messaging/[id]":[d,J,"static/chunks/pages/messaging/[id]-ad02e019b2467958.js"],"/privacy-requests":[s,a,e,K,"static/chunks/pages/privacy-requests-b0f801d66e79a31a.js"],"/privacy-requests/configure":["static/chunks/pages/privacy-requests/configure-2987edc77388e85a.js"],"/privacy-requests/configure/messaging":["static/chunks/pages/privacy-requests/configure/messaging-5e2687ab5ab10275.js"],"/privacy-requests/configure/storage":["static/chunks/pages/privacy-requests/configure/storage-2914aade73dcaecc.js"],"/privacy-requests/[id]":[K,"static/css/15fb7d4837a1de34.css","static/chunks/pages/privacy-requests/[id]-72d64a02b7ef175e.js"],"/properties":[s,a,e,E,"static/chunks/pages/properties-20ca2f963906674b.js"],"/properties/add-property":[d,O,"static/chunks/pages/properties/add-property-630a6a3dd6502ba6.js"],"/properties/[id]":[d,O,"static/chunks/pages/properties/[id]-94e2faa73dd6a3e6.js"],"/reporting/datamap":[s,a,t,c,n,G,e,o,k,C,"static/chunks/pages/reporting/datamap-f035cddf17f4d898.js"],"/settings/about":["static/chunks/pages/settings/about-2ae030f3a28f057a.js"],"/settings/consent":["static/chunks/pages/settings/consent-3ac1e5d3de5dd4a7.js"],"/settings/custom-fields":[s,a,e,o,"static/chunks/pages/settings/custom-fields-dfcd7a4b6aa773bd.js"],"/settings/domain-records":[s,a,e,"static/chunks/pages/settings/domain-records-72ec54ee8755a503.js"],"/settings/domains":["static/chunks/pages/settings/domains-24cba38685dc872c.js"],"/settings/email-templates":["static/chunks/pages/settings/email-templates-6fd6071e2009b8f2.js"],"/settings/locations":[s,Q,"static/chunks/pages/settings/locations-66c757325cb58467.js"],"/settings/organization":["static/chunks/pages/settings/organization-0e0aa552f520f913.js"],"/settings/regulations":[s,Q,"static/chunks/pages/settings/regulations-c6c239996cfa6ae8.js"],"/systems":[s,a,e,"static/chunks/pages/systems-8490aaaee9d76a4a.js"],"/systems/configure/[id]":[s,a,t,c,n,b,e,o,g,k,h,y,x,i,"static/chunks/pages/systems/configure/[id]-a158fa77df288523.js"],"/systems/configure/[id]/test-datasets":[u,j,"static/chunks/pages/systems/configure/[id]/test-datasets-1d83d5178b3eb216.js"],"/taxonomy":["static/chunks/678d4732-50255cc09048e643.js",t,c,n,p,"static/chunks/570-c99f07161bd339cd.js",o,"static/css/34a7eb08b86ddb57.css","static/chunks/pages/taxonomy-be1ffe267b1602e1.js"],"/user-management":[w,"static/chunks/pages/user-management-3ca3c687e72d1364.js"],"/user-management/new":[w,R,"static/chunks/pages/user-management/new-f8bca2e322ddf252.js"],"/user-management/profile/[id]":[w,R,"static/chunks/pages/user-management/profile/[id]-c0378fd1a26a71da.js"],sortedPages:["/","/404","/_app","/_error","/add-systems","/add-systems/manual","/add-systems/multiple","/ant-poc","/consent","/consent/configure","/consent/configure/add-vendors","/consent/privacy-experience","/consent/privacy-experience/new","/consent/privacy-experience/[id]","/consent/privacy-notices","/consent/privacy-notices/new","/consent/privacy-notices/[id]","/consent/properties","/consent/reporting","/data-catalog","/data-catalog/[systemId]/projects","/data-catalog/[systemId]/projects/[projectUrn]","/data-catalog/[systemId]/projects/[projectUrn]/[resourceUrn]","/data-catalog/[systemId]/resources","/data-catalog/[systemId]/resources/[resourceUrn]","/data-discovery/action-center","/data-discovery/action-center/[monitorId]","/data-discovery/action-center/[monitorId]/[systemId]","/data-discovery/activity","/data-discovery/detection","/data-discovery/detection/[resourceUrn]","/data-discovery/discovery","/data-discovery/discovery/[resourceUrn]","/datamap","/dataset","/dataset/new","/dataset/[datasetId]","/dataset/[datasetId]/[collectionName]","/dataset/[datasetId]/[collectionName]/[...subfieldNames]","/datastore-connection","/datastore-connection/new","/datastore-connection/[id]","/fides-js-docs","/integrations","/integrations/[id]","/login","/login/[provider]","/messaging","/messaging/add-template","/messaging/[id]","/privacy-requests","/privacy-requests/configure","/privacy-requests/configure/messaging","/privacy-requests/configure/storage","/privacy-requests/[id]","/properties","/properties/add-property","/properties/[id]","/reporting/datamap","/settings/about","/settings/consent","/settings/custom-fields","/settings/domain-records","/settings/domains","/settings/email-templates","/settings/locations","/settings/organization","/settings/regulations","/systems","/systems/configure/[id]","/systems/configure/[id]/test-datasets","/taxonomy","/user-management","/user-management/new","/user-management/profile/[id]"]}}("static/chunks/c78d26b1-88a3e1bacb2a03c2.js","static/chunks/6060-cb1ab5be7067bf7b.js","static/chunks/4481-275aa9f4c10bce53.js","static/chunks/2858-0b44609b6be7850b.js","static/chunks/2866-a73888c17a195cbe.js","static/chunks/9278-9b1b5970f0702668.js","static/css/d2d4e9a6923e6730.css","static/chunks/9282-2bfbdca45e84e810.js","static/chunks/7980-72f745bff9fabcc9.js","static/chunks/9999-637e0e5341f15f4a.js","static/chunks/6527-0eed08abe252a918.js","static/chunks/355-8a77c9a1cd027f2e.js","static/chunks/4294-5b3aa9d605217915.js","static/chunks/6372-e0bb9f8d07cc3b04.js","static/chunks/9327-2cba327d10586683.js","static/chunks/5277-e8a036319456127f.js","static/chunks/8499-43606100edf42fdf.js","static/chunks/146-0ae2d30ec71fce09.js","static/chunks/1376-03e7f50e708b7589.js","static/chunks/3938-6a1c07d06a80cf4c.js","static/chunks/4723-1dd1d16f404d56a2.js","static/chunks/7751-a70fe0e5f67f5538.js","static/chunks/6315-1adb10a8b98b4a13.js","static/chunks/5487-8678d75ee1d1ef09.js","static/chunks/8702-d1c8296f9f6afc10.js","static/chunks/5480-52dc446be40725f5.js","static/css/972dc7eef106ee7c.css","static/chunks/4450-6a8aa0d7358ac26f.js","static/chunks/5826-ef0aa43ffad83acc.js","static/chunks/6853-09e831e9dff7fd3b.js","static/chunks/9014-eeae6f581158e645.js","static/chunks/1817-f82105a9608bba1a.js","static/chunks/3615-5e2d062d684b8fa1.js","static/chunks/6954-baa1d873abfe8b77.js","static/chunks/79-8e060d36d36c752c.js","static/chunks/3872-472bb47eb34d8fdb.js","static/chunks/3855-63495367531cb776.js","static/chunks/2397-0d1c289b788fcc11.js","static/chunks/9046-8a5fdd335a76d224.js","static/chunks/5258-cf7b27ef51f38392.js","static/chunks/9767-8179ce7336727141.js","static/chunks/9187-851756440f79cd75.js","static/chunks/5973-d3d3872692c1d0fa.js","static/chunks/1100-053fc6b76c65a00f.js","static/chunks/8433-b3008ecaf9834e7f.js","static/chunks/4060-53a5c6347690a8fa.js","static/chunks/3086-b5054ec2c75700b9.js","static/chunks/1150-2642cd9cdc8a52f6.js"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB();
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[146],{95372:function(a){a.exports=function(a,_,n,F){for(var i=a.length,e=n+(F?1:-1);F?e--:++e<i;)if(_(a[e],e,a))return e;return -1}},56632:function(a,_,n){var F=n(89278),i=n(80068),e=n(50098);a.exports=function(a){return function(_,n,r){var t=Object(_);if(!i(_)){var o=F(n,3);_=e(_),n=function(a){return o(t[a],a,t)}}var s=a(_,n,r);return s>-1?t[o?_[s]:s]:void 0}}},64925:function(a,_,n){var F=n(56632)(n(66259));a.exports=F},66259:function(a,_,n){var F=n(95372),i=n(89278),e=n(47991),r=Math.max;a.exports=function(a,_,n){var t=null==a?0:a.length;if(!t)return -1;var o=null==n?0:e(n);return o<0&&(o=r(t+o,0)),F(a,i(_,3),o)}},94919:function(a,_,n){var F=n(91936),i=1/0;a.exports=function(a){return a?(a=F(a))===i||a===-i?(a<0?-1:1)*17976931348623157e292:a==a?a:0:0===a?a:0}},47991:function(a,_,n){var F=n(94919);a.exports=function(a){var _=F(a),n=_%1;return _==_?n?_-n:_:0}},34929:function(a,_,n){"use strict";var F=n(24246),i=n(64925),e=n.n(i),r=n(27378),t=n(16134),o=n(30002),s=n(28079),u=n(57072);let l=()=>{let{isLoading:a}=(0,s.fd)(),_=(0,t.C)(s.U3),{isLoading:n}=(0,u.MO)(),F=(0,t.C)(u.qb),{isLoading:i}=(0,o.te)();return{dataUses:_,dataSubjects:(0,t.C)(o.ZL),dataCategories:F,isLoading:a||n||i}};_.Z=()=>{let{dataUses:a,dataCategories:_,dataSubjects:n,isLoading:i}=l(),t=function(a){let _=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return a.split(".").slice(0,_).join(".")},o=function(a,_){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,F=_(a);if(!F)return{};let i=_(t(a,n)),e=!!F.parent_key;return{name:F.name||void 0,primaryName:e&&(null==i?void 0:i.name)!==F.name&&(null==i?void 0:i.name)||void 0}},s=function(a,_){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,{name:i,primaryName:e}=o(a,_,n);return i?e?(0,F.jsxs)(r.Fragment,{children:[(0,F.jsxs)("strong",{children:[e,":"]})," ",i]},a):(0,F.jsx)("strong",{children:i},a):a},u=_=>e()(a,{fides_key:_}),S=a=>e()(_,{fides_key:a}),d=a=>e()(n,{fides_key:a});return{getDataUses:()=>a,getDataUseByKey:u,getDataUseDisplayName:a=>s(a,u,1),getDataUseDisplayNameProps:a=>o(a,u,1),getDataCategories:()=>_,getDataCategoryByKey:S,getDataCategoryDisplayName:a=>s(a,S,2),getDataCategoryDisplayNameProps:a=>o(a,S,2),getDataSubjects:()=>n,getDataSubjectByKey:d,getDataSubjectDisplayName:a=>{let _=d(a);return _?_.name:a},getPrimaryKey:t,isLoading:i}}},8411:function(a,_,n){"use strict";n.d(_,{NA:function(){return e},Z8:function(){return i}});var F=n(28120);let i={[F._F.ER]:"Eritrea",[F._F.DJ]:"Djibouti",[F._F.MR]:"Mauritania",[F._F.NA]:"Namibia",[F._F.GH]:"Ghana",[F._F.SS]:"South Sudan",[F._F.SC]:"Seychelles",[F._F.IO]:"British Indian Ocean Territory",[F._F.GQ]:"Equatorial Guinea",[F._F.AO]:"Angola",[F._F.CG]:"Republic of the Congo",[F._F.BW]:"Botswana",[F._F.BI]:"Burundi",[F._F.DZ]:"Algeria",[F._F.TD]:"Chad",[F._F.NG]:"Nigeria",[F._F.TZ]:"Tanzania",[F._F.EH]:"Western Sahara",[F._F.SN]:"Senegal",[F._F.LR]:"Liberia",[F._F.ZA]:"South Africa",[F._F.CV]:"Cape Verde",[F._F.GM]:"Gambia",[F._F.SD]:"Sudan",[F._F.KM]:"Comoros",[F._F.SZ]:"Eswatini",[F._F.UG]:"Uganda",[F._F.MG]:"Madagascar",[F._F.RW]:"Rwanda",[F._F.CD]:"DR Congo",[F._F.CM]:"Cameroon",[F._F.SH]:"Saint Helena, Ascension and Tristan da Cunha",[F._F.TG]:"Togo",[F._F.MU]:"Mauritius",[F._F.NE]:"Niger",[F._F.BJ]:"Benin",[F._F.EG]:"Egypt",[F._F.LS]:"Lesotho",[F._F.ET]:"Ethiopia",[F._F.MA]:"Morocco",[F._F.YT]:"Mayotte",[F._F.BF]:"Burkina Faso",[F._F.RE]:"R\xe9union",[F._F.ST]:"S\xe3o Tom\xe9 and Pr\xedncipe",[F._F.CF]:"Central African Republic",[F._F.MZ]:"Mozambique",[F._F.MW]:"Malawi",[F._F.ML]:"Mali",[F._F.ZM]:"Zambia",[F._F.LY]:"Libya",[F._F.GW]:"Guinea-Bissau",[F._F.SO]:"Somalia",[F._F.KE]:"Kenya",[F._F.GN]:"Guinea",[F._F.ZW]:"Zimbabwe",[F._F.TN]:"Tunisia",[F._F.SL]:"Sierra Leone",[F._F.GA]:"Gabon",[F._F.CI]:"Ivory Coast",[F._F.JO]:"Jordan",[F._F.PK]:"Pakistan",[F._F.KP]:"North Korea",[F._F.MO]:"Macau",[F._F.AM]:"Armenia",[F._F.SY]:"Syria",[F._F.TJ]:"Tajikistan",[F._F.SA]:"Saudi Arabia",[F._F.KR]:"South Korea",[F._F.NP]:"Nepal",[F._F.PH]:"Philippines",[F._F.IQ]:"Iraq",[F._F.LB]:"Lebanon",[F._F.MN]:"Mongolia",[F._F.PS]:"Palestine",[F._F.YE]:"Yemen",[F._F.JP]:"Japan",[F._F.KZ]:"Kazakhstan",[F._F.LK]:"Sri Lanka",[F._F.MM]:"Myanmar",[F._F.KG]:"Kyrgyzstan",[F._F.CN]:"China",[F._F.AF]:"Afghanistan",[F._F.OM]:"Oman",[F._F.IN]:"India",[F._F.LA]:"Laos",[F._F.UZ]:"Uzbekistan",[F._F.MV]:"Maldives",[F._F.ID]:"Indonesia",[F._F.VN]:"Vietnam",[F._F.MY]:"Malaysia",[F._F.TW]:"Taiwan",[F._F.KH]:"Cambodia",[F._F.AE]:"United Arab Emirates",[F._F.HK]:"Hong Kong",[F._F.GE]:"Georgia",[F._F.BD]:"Bangladesh",[F._F.KW]:"Kuwait",[F._F.TM]:"Turkmenistan",[F._F.QA]:"Qatar",[F._F.BH]:"Bahrain",[F._F.BN]:"Brunei",[F._F.TH]:"Thailand",[F._F.BT]:"Bhutan",[F._F.SG]:"Singapore",[F._F.IL]:"Israel",[F._F.AZ]:"Azerbaijan",[F._F.TL]:"Timor-Leste",[F._F.IR]:"Iran",[F._F.TR]:"Turkey",[F._F.MK]:"North Macedonia",[F._F.IE]:"Ireland",[F._F.DK]:"Denmark",[F._F.SK]:"Slovakia",[F._F.MD]:"Moldova",[F._F.AX]:"\xc5land Islands",[F._F.PL]:"Poland",[F._F.BA]:"Bosnia and Herzegovina",[F._F.SM]:"San Marino",[F._F.CZ]:"Czechia",[F._F.EE]:"Estonia",[F._F.XK]:"Kosovo",[F._F.FO]:"Faroe Islands",[F._F.SJ]:"Svalbard and Jan Mayen",[F._F.GG]:"Guernsey",[F._F.FR]:"France",[F._F.NL]:"Netherlands",[F._F.FI]:"Finland",[F._F.PT]:"Portugal",[F._F.DE]:"Germany",[F._F.MT]:"Malta",[F._F.JE]:"Jersey",[F._F.IS]:"Iceland",[F._F.ES]:"Spain",[F._F.GI]:"Gibraltar",[F._F.NO]:"Norway",[F._F.CY]:"Cyprus",[F._F.RS]:"Serbia",[F._F.LT]:"Lithuania",[F._F.MC]:"Monaco",[F._F.LU]:"Luxembourg",[F._F.UA]:"Ukraine",[F._F.IM]:"Isle of Man",[F._F.RO]:"Romania",[F._F.BE]:"Belgium",[F._F.SE]:"Sweden",[F._F.ME]:"Montenegro",[F._F.LV]:"Latvia",[F._F.VA]:"Vatican City",[F._F.AT]:"Austria",[F._F.AL]:"Albania",[F._F.LI]:"Liechtenstein",[F._F.GR]:"Greece",[F._F.IT]:"Italy",[F._F.AD]:"Andorra",[F._F.GB]:"United Kingdom",[F._F.RU]:"Russia",[F._F.SI]:"Slovenia",[F._F.BY]:"Belarus",[F._F.CH]:"Switzerland",[F._F.HU]:"Hungary",[F._F.BG]:"Bulgaria",[F._F.HR]:"Croatia",[F._F.TC]:"Turks and Caicos Islands",[F._F.CW]:"Cura\xe7ao",[F._F.GP]:"Guadeloupe",[F._F.UM]:"United States Minor Outlying Islands",[F._F.GT]:"Guatemala",[F._F.PM]:"Saint Pierre and Miquelon",[F._F.BQ]:"Caribbean Netherlands",[F._F.GL]:"Greenland",[F._F.SX]:"Sint Maarten",[F._F.PA]:"Panama",[F._F.AW]:"Aruba",[F._F.MQ]:"Martinique",[F._F.AG]:"Antigua and Barbuda",[F._F.BM]:"Bermuda",[F._F.CU]:"Cuba",[F._F.GD]:"Grenada",[F._F.NI]:"Nicaragua",[F._F.LC]:"Saint Lucia",[F._F.KN]:"Saint Kitts and Nevis",[F._F.DO]:"Dominican Republic",[F._F.VC]:"Saint Vincent and the Grenadines",[F._F.BZ]:"Belize",[F._F.HT]:"Haiti",[F._F.JM]:"Jamaica",[F._F.BS]:"Bahamas",[F._F.MX]:"Mexico",[F._F.MF]:"Saint Martin",[F._F.SV]:"El Salvador",[F._F.BL]:"Saint Barth\xe9lemy",[F._F.AI]:"Anguilla",[F._F.MS]:"Montserrat",[F._F.VG]:"British Virgin Islands",[F._F.BB]:"Barbados",[F._F.HN]:"Honduras",[F._F.KY]:"Cayman Islands",[F._F.DM]:"Dominica",[F._F.TT]:"Trinidad and Tobago",[F._F.CR]:"Costa Rica",[F._F.SR]:"Suriname",[F._F.CX]:"Christmas Island",[F._F.WS]:"Samoa",[F._F.PF]:"French Polynesia",[F._F.AS]:"American Samoa",[F._F.NC]:"New Caledonia",[F._F.TK]:"Tokelau",[F._F.PW]:"Palau",[F._F.KI]:"Kiribati",[F._F.VU]:"Vanuatu",[F._F.PN]:"Pitcairn Islands",[F._F.CK]:"Cook Islands",[F._F.FJ]:"Fiji",[F._F.PG]:"Papua New Guinea",[F._F.MP]:"Northern Mariana Islands",[F._F.NU]:"Niue",[F._F.TV]:"Tuvalu",[F._F.NF]:"Norfolk Island",[F._F.TO]:"Tonga",[F._F.FM]:"Micronesia",[F._F.SB]:"Solomon Islands",[F._F.NR]:"Nauru",[F._F.WF]:"Wallis and Futuna",[F._F.GU]:"Guam",[F._F.AU]:"Australia",[F._F.NZ]:"New Zealand",[F._F.MH]:"Marshall Islands",[F._F.CC]:"Cocos (Keeling) Islands",[F._F.VE]:"Venezuela",[F._F.PY]:"Paraguay",[F._F.BR]:"Brazil",[F._F.CO]:"Colombia",[F._F.PE]:"Peru",[F._F.CL]:"Chile",[F._F.UY]:"Uruguay",[F._F.AR]:"Argentina",[F._F.GY]:"Guyana",[F._F.BO]:"Bolivia",[F._F.GF]:"French Guiana",[F._F.EC]:"Ecuador",[F._F.FK]:"Falkland Islands",[F._F.US_AL]:"Alabama",[F._F.US_AK]:"Alaska",[F._F.US_AZ]:"Arizona",[F._F.US_AR]:"Arkansas",[F._F.US_CA]:"California",[F._F.US_CO]:"Colorado",[F._F.US_CT]:"Connecticut",[F._F.US_DE]:"Delaware",[F._F.US_DC]:"District of Columbia (DC)",[F._F.US_FL]:"Florida",[F._F.US_GA]:"Georgia",[F._F.US_HI]:"Hawaii",[F._F.US_ID]:"Idaho",[F._F.US_IL]:"Illinois",[F._F.US_IN]:"Indiana",[F._F.US_IA]:"Iowa",[F._F.US_KS]:"Kansas",[F._F.US_KY]:"Kentucky",[F._F.US_LA]:"Louisiana",[F._F.US_ME]:"Maine",[F._F.US_MD]:"Maryland",[F._F.US_MA]:"Massachusetts",[F._F.US_MI]:"Michigan",[F._F.US_MN]:"Minnesota",[F._F.US_MS]:"Mississippi",[F._F.US_MO]:"Missouri",[F._F.US_MT]:"Montana",[F._F.US_NE]:"Nebraska",[F._F.US_NV]:"Nevada",[F._F.US_NH]:"New Hampshire",[F._F.US_NJ]:"New Jersey",[F._F.US_NM]:"New Mexico",[F._F.US_NY]:"New York",[F._F.US_NC]:"North Carolina",[F._F.US_ND]:"North Dakota",[F._F.US_OH]:"Ohio",[F._F.US_OK]:"Oklahoma",[F._F.US_OR]:"Oregon",[F._F.US_PA]:"Pennsylvania",[F._F.US_PR]:"Puerto Rico",[F._F.US_RI]:"Rhode Island",[F._F.US_SC]:"South Carolina",[F._F.US_SD]:"San Diego",[F._F.US_TN]:"Tennessee",[F._F.US_TX]:"Texas",[F._F.US_UT]:"Utah",[F._F.US_VA]:"Virginia",[F._F.US_VI]:"United States Virgin Islands",[F._F.US_VT]:"Vermon",[F._F.US_WA]:"Washington",[F._F.US_WV]:"West Virginia",[F._F.US_WI]:"Wisconsin",[F._F.US_WY]:"Wyoming",[F._F.CA_AB]:"Alberta",[F._F.CA_BC]:"British Columbia",[F._F.CA_MB]:"Manitoba",[F._F.CA_NB]:"New Brunswick",[F._F.CA_NL]:"Newfoundland and Labrador",[F._F.CA_NS]:"Nova Scotia",[F._F.CA_ON]:"Ontario",[F._F.CA_PE]:"Prince Edward Island",[F._F.CA_QC]:"Quebec",[F._F.CA_SK]:"Saskatchewan",[F._F.CA_NT]:"Northwest Territories",[F._F.CA_NU]:"Nunavut",[F._F.CA_YT]:"Yukon",[F._F.CA]:"Canada",[F._F.US]:"United States",[F._F.MEXICO_CENTRAL_AMERICA]:"Mexico and Central America",[F._F.CARIBBEAN]:"Caribbean",[F._F.EEA]:"European Economic Area (EEA)",[F._F.NON_EEA]:"Non European Economic Area"},e=new Map(Object.entries(i));Object.entries(i).map(a=>({value:a[0],label:a[1]}))},78238:function(a,_,n){"use strict";n.d(_,{g:function(){return F}});let F=["essential","functional.service.improve","personalize","analytics","marketing.advertising.first_party.targeted","marketing.advertising.third_party.targeted"];_.Z=a=>F.includes(a)}}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3938],{74833:function(e,t,n){var i=n(56127),s=/^\s+/;e.exports=function(e){return e?e.slice(0,i(e)+1).replace(s,""):e}},56127:function(e){var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},66726:function(e,t,n){var i=n(11611),s=n(82846),a=n(91936),r=Math.max,l=Math.min;e.exports=function(e,t,n){var o,c,d,u,m,f,p=0,h=!1,x=!1,v=!0;if("function"!=typeof e)throw TypeError("Expected a function");function y(t){var n=o,i=c;return o=c=void 0,p=t,u=e.apply(i,n)}function g(e){var n=e-f,i=e-p;return void 0===f||n>=t||n<0||x&&i>=d}function j(){var e,n,i,a=s();if(g(a))return b(a);m=setTimeout(j,(e=a-f,n=a-p,i=t-e,x?l(i,d-n):i))}function b(e){return(m=void 0,v&&o)?y(e):(o=c=void 0,u)}function w(){var e,n=s(),i=g(n);if(o=arguments,c=this,f=n,i){if(void 0===m)return p=e=f,m=setTimeout(j,t),h?y(e):u;if(x)return clearTimeout(m),m=setTimeout(j,t),y(f)}return void 0===m&&(m=setTimeout(j,t)),u}return t=a(t)||0,i(n)&&(h=!!n.leading,d=(x="maxWait"in n)?r(a(n.maxWait)||0,t):d,v="trailing"in n?!!n.trailing:v),w.cancel=function(){void 0!==m&&clearTimeout(m),p=0,o=f=c=m=void 0},w.flush=function(){return void 0===m?u:b(s())},w}},82846:function(e,t,n){var i=n(77400);e.exports=function(){return i.Date.now()}},91936:function(e,t,n){var i=n(74833),s=n(11611),a=n(55193),r=0/0,l=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,c=/^0o[0-7]+$/i,d=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(a(e))return r;if(s(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=s(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=i(e);var n=o.test(e);return n||c.test(e)?d(e.slice(2),n?2:8):l.test(e)?r:+e}},7617:function(e,t,n){"use strict";n.d(t,{q:function(){return a}});var i=n(24246),s=n(77181);let a=e=>{let{label:t,isDisabled:n,...a}=e;return(0,i.jsx)(s.OK9,{"data-testid":"tab-".concat(t),_selected:{fontWeight:"600",color:"complimentary.500",borderColor:"complimentary.500"},fontSize:a.fontSize,fontWeight:"500",color:"gray.500",isDisabled:n||!1,children:t})};t.Z=e=>{let{data:t,border:n="partial",...r}=e;return(0,i.jsxs)(s.mQc,{colorScheme:"complimentary",...r,children:[(0,i.jsx)(s.tdY,{width:"partial"===n?"max-content":void 0,children:t.map(e=>(0,i.jsx)(a,{label:e.label,isDisabled:e.isDisabled,fontSize:r.fontSize},e.label))}),(0,i.jsx)(s.nPR,{children:t.map(e=>(0,i.jsx)(s.x45,{px:0,"data-testid":"tab-panel-".concat(e.label),children:e.content},e.label))})]})}},29850:function(e,t,n){"use strict";n.d(t,{R:function(){return d}});var i=n(24246),s=n(77181),a=n(27378),r=n(65450);let l=e=>{let{children:t,className:n,style:a,...r}=e;return(0,i.jsx)(s.wpx,{...r,type:"text",className:"w-full justify-start ".concat(n),style:{fontWeight:600,padding:"var(--ant-select-option-padding)",backgroundColor:"var(--ant-select-option-selected-bg)",...a},children:t})};var o=n(16394);let c=(e,t)=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(l,{onClick:t,"data-testid":"add-new-system",id:"add-new-system",children:"Add new system +"}),e]}),d=e=>{var t;let{onAddSystem:n,...l}=e,[d,u]=(0,a.useState)(),{data:m,isFetching:f}=(0,r.xF)({page:1,size:25,search:d||void 0}),p=null==m?void 0:null===(t=m.items)||void 0===t?void 0:t.map(e=>({value:e.fides_key,label:e.name})),h=(0,a.useCallback)(e=>{(null==e?void 0:e.length)>1&&u(e),(null==e?void 0:e.length)===0&&u(void 0)},[u]),x=(0,a.useMemo)(()=>(0,o.Ds)(h,300),[h]);return(0,i.jsx)(s.WPr,{placeholder:"Search...","aria-label":"Search for a system to select",dropdownStyle:{minWidth:"500px"},dropdownRender:n?e=>c(e,n):void 0,"data-testid":"system-select",...l,filterOption:!1,options:p,onSearch:x,loading:l.loading||f})}},79283:function(e,t,n){"use strict";n.d(t,{l:function(){return o}});var i=n(24246),s=n(77181),a=n(72707),r=n.n(a);let l=e=>{let{data:t}=e;return(0,i.jsxs)(s.jqI,{gap:12,title:"".concat(t.primaryName||"").concat(t.primaryName?": ":"").concat(t.name," - ").concat(t.description),children:[(0,i.jsxs)("div",{children:[(0,i.jsx)("strong",{children:t.primaryName||t.name}),t.primaryName&&": ".concat(t.name)]}),(0,i.jsx)("em",{children:t.description})]})},o=e=>{let{options:t,...n}=e,a=null==t?void 0:t.map(e=>({...e,className:r().option}));return(0,i.jsx)(s.WPr,{options:a,autoFocus:!0,variant:"borderless",optionRender:l,dropdownStyle:{minWidth:"500px"},className:"w-full p-0","data-testid":"taxonomy-select",...n})}},57454:function(e,t,n){"use strict";n.d(t,{M:function(){return o}});var i=n(24246),s=n(66726),a=n.n(s),r=n(27378),l=n(86780);let o=e=>{let{value:t,onChange:n}=e,[s,o]=(0,r.useState)(t),c=a()(n,500),d=(0,r.useCallback)(e=>{o(e),c(e)},[]);return(0,i.jsx)(l.Z,{search:s,onChange:d,onClear:()=>{o(""),n("")}})}},70682:function(e,t,n){"use strict";var i=n(24246),s=n(79283),a=n(34929),r=n(78238);t.Z=e=>{let{selectedTaxonomies:t,...n}=e,{getDataUseDisplayNameProps:l,getDataUses:o}=(0,a.Z)(),c=o().filter(e=>e.active&&r.g.includes(e.fides_key)).map(e=>{let{name:t,primaryName:n}=l(e.fides_key);return{value:e.fides_key,name:t,primaryName:n,description:e.description||""}});return(0,i.jsx)(s.l,{options:c,...n})}},26183:function(e,t,n){"use strict";var i=n(24246);n(27378),t.Z=e=>{let{children:t,className:n,...s}=e;return(0,i.jsx)("div",{className:"relative flex w-full flex-wrap items-center gap-2 overflow-x-auto py-2 ".concat(n||""),...s,children:t})}},77685:function(e,t,n){"use strict";n.d(t,{i:function(){return _}});var i=n(24246),s=n(77181),a=n(34090),r=n(27378),l=n(55484),o=n(16134),c=n(25980),d=n(97181),u=n(40324),m=n(812),f=n(14047),p=n(45938),h=n(8133),x=n(33335),v=n(32885),y=n(57865),g=n(93237),j=n(65450),b=n(36345);let{Text:w}=s.AntTypography,S={name:"",vendor_id:void 0,description:"",tags:[]},_=e=>{let{onSuccessfulSubmit:t,toastOnSuccess:n,..._}=e,[C,k]=(0,r.useState)(!1),N=(0,o.T)(),{tcf:I,dictionaryService:z}=(0,c.hz)(),{isLoading:T}=(0,v.Rd)(void 0,{skip:!z}),W=(0,o.C)(v.o),R=(0,o.C)(y.gU),[q]=(0,j.in)(),[D]=(0,v.Qk)(),[Z]=(0,j.f7)(),{successAlert:F,errorAlert:E}=(0,f.V)(),{setSuggestions:B,setLockedForGVL:A}=y.dictSuggestionsSlice.actions,U=(0,r.useRef)(null),$=(0,r.useMemo)(()=>l.Ry().shape({name:l.Z_().required().label("System name").test("is-unique","",async(e,t)=>{let{data:n}=await q({page:1,size:10,search:e});return!((null==n?void 0:n.items)||[]).filter(t=>t.name===e).some(t=>t.name===e)||t.createError({message:'You already have a system called "'.concat(e,'". Please specify a unique name for this system.')})})}),[q]),M=e=>{if(z){if(!e){N(B("hiding")),N(A(!1));return}N(B("showing")),I&&(0,m.cj)(e)===m.c6.GVL?N(A(!0)):N(A(!1))}},Y=()=>{_.onClose(),N(B("initial")),N(A(!1))},O=async e=>{if(k(!0),e.vendor_id){let i=await D([e.vendor_id]);if((0,m.D4)(i))E((0,m.e$)(i.error));else{let{data:e}=i,s=e.systems[0];null==t||t(s.fides_key,s.name),n&&F("".concat(e.name," has been added to your system inventory."))}}else{let i={...e,fides_key:(0,x.E)(e.name),system_type:"",body:"",privacy_declarations:[]},s=await Z(i);if((0,m.D4)(s))E((0,m.e$)(s.error));else{let{fides_key:i,name:a}=s.data;null==t||t(i,a),n&&F("".concat(e.name," has been added to your system inventory."))}Y()}k(!1)};return(0,i.jsx)(h.Z,{title:"Add New System",..._,onClose:Y,children:(0,i.jsx)(a.J9,{initialValues:S,onSubmit:O,validationSchema:$,innerRef:U,children:e=>{let{dirty:t,isValid:n}=e;return(0,i.jsxs)(a.l0,{children:[(0,i.jsx)(p.Gt,{id:"new-system-modal",name:"Add New System"}),(0,i.jsxs)(s.jqI,{vertical:!0,gap:20,className:"pb-6 pt-4",children:[(0,i.jsx)(w,{children:"Fides will add this system to your inventory and configure it for consent using the categories of consent listed below. Optionally, you can check if this system is listed within the Fides compass library by selecting the compass icon below."}),z?(0,i.jsx)(b.Z,{label:"System name",options:W,onVendorSelected:M,isCreate:!0,lockedForGVL:R,isLoading:T}):(0,i.jsx)(u.j0,{id:"name",name:"name",label:"System name",tooltip:"Give the system a unique, and relevant name for reporting purposes. e.g. “Email Data Warehouse”",variant:"stacked",isRequired:!0}),(0,i.jsx)(g.Sv,{id:"description",name:"description",label:"Description",tooltip:"What services does this system perform?",disabled:R}),(0,i.jsx)(d.d,{mode:"tags",id:"tags",name:"tags",label:"System Tags",options:[],layout:"stacked",tooltip:"Are there any tags to associate with this system?",disabled:R})]}),(0,i.jsxs)(s.jqI,{justify:"space-between",children:[(0,i.jsx)(s.wpx,{htmlType:"reset",onClick:Y,disabled:T||!t||!n,"data-testid":"cancel-btn",children:"Cancel"}),(0,i.jsx)(s.wpx,{htmlType:"submit",type:"primary",disabled:T||!t||!n,loading:C,"data-testid":"save-btn",children:"Save"})]})]})}})})}},93237:function(e,t,n){"use strict";n.d(t,{Sv:function(){return p},Yb:function(){return f},dQ:function(){return h},lm:function(){return x}});var i=n(24246),s=n(77181),a=n(34090),r=n(27378),l=n(16134),o=n(40324),c=n(91613),d=n(32885),u=n(57865);let m=(e,t,n)=>{var i,s;let[o,c,{setValue:m,setTouched:f}]=(0,a.U$)({name:e,type:n||void 0}),p=!!(c.touched&&c.error),{error:h}=c,x={...o,value:null!==(i=o.value)&&void 0!==i?i:""},[v,y]=(0,r.useState)(null!==(s=x.value)&&void 0!==s?s:""),{values:g}=(0,a.u6)(),{vendor_id:j}=g,b=(0,l.C)((0,d.$e)(j||"")),w=(0,l.C)(u.bN),S=(0,r.useRef)();return(0,r.useEffect)(()=>{"showing"===w&&y(x.value)},[w,y]),(0,r.useEffect)(()=>{if("showing"===w&&b){let n=t?t(b):b[e];x.value!==n&&(m(n),setTimeout(()=>{var e;f(!0),null===(e=S.current)||void 0===e||e.blur()},300))}},[w,m,b,S.current]),(0,r.useEffect)(()=>{"hiding"===w&&m(v)},[w,m,v]),{field:x,isInvalid:p,isShowingSuggestions:w,error:h,inputRef:S}},f=e=>{let{label:t,tooltip:n,disabled:a,isRequired:r=!1,dictField:l,name:d,placeholder:u,id:f}=e,{field:p,isInvalid:h,isShowingSuggestions:x,error:v,inputRef:y}=m(d,l);return(0,i.jsx)(s.NIc,{isInvalid:h,isRequired:r,children:(0,i.jsxs)(s.gCW,{alignItems:"start",children:[(0,i.jsxs)(s.kCb,{alignItems:"center",children:[(0,i.jsx)(o.__,{htmlFor:f||d,fontSize:"xs",my:0,mr:1,children:t}),n?(0,i.jsx)(c.Z,{label:n}):null]}),(0,i.jsx)(o.oi,{...p,ref:y,isRequired:r,isDisabled:a,"data-testid":"input-".concat(p.name),placeholder:u,isPassword:!1,color:"showing"===x?"complimentary.500":"gray.800"}),(0,i.jsx)(o.Bc,{isInvalid:h,message:v,fieldName:p.name})]})})},p=e=>{let{label:t,tooltip:n,disabled:a,isRequired:r=!1,dictField:l,name:d,id:u}=e,{field:f,isInvalid:p,isShowingSuggestions:h,error:x}=m(d,l);return(0,i.jsx)(s.NIc,{isInvalid:p,isRequired:r,children:(0,i.jsxs)(s.gCW,{alignItems:"start",children:[(0,i.jsxs)(s.kCb,{alignItems:"center",children:[(0,i.jsx)(o.__,{htmlFor:u||d,fontSize:"xs",my:0,mr:1,children:t}),n?(0,i.jsx)(c.Z,{label:n}):null]}),(0,i.jsx)(s.gxH,{...f,size:"sm","data-testid":"input-".concat(f.name),focusBorderColor:"primary.600",color:"showing"===h?"complimentary.500":"gray.800",isDisabled:a}),(0,i.jsx)(o.Bc,{isInvalid:p,message:x,fieldName:f.name})]})})},h=e=>{let{label:t,tooltip:n,dictField:r,name:l,id:d,disabled:u}=e,{field:f,isInvalid:p,error:h}=m(l,r,"checkbox");return(0,i.jsxs)(s.NIc,{isInvalid:p,width:"full",children:[(0,i.jsxs)(s.xuv,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[(0,i.jsxs)(s.Ugi,{spacing:1,children:[(0,i.jsx)(o.__,{htmlFor:d||l,fontSize:"xs",my:0,mr:0,children:t}),n?(0,i.jsx)(c.Z,{label:n}):null]}),(0,i.jsx)(s.Ugi,{children:(0,i.jsx)(a.gN,{name:f.name,children:e=>{let{form:{setFieldValue:t}}=e;return(0,i.jsx)(s.rAg,{checked:f.checked,onChange:e=>{t(f.name,e)},disabled:u,className:"mr-2","data-testid":"input-".concat(f.name),size:"small"})}})})]}),(0,i.jsx)(o.Bc,{isInvalid:p,message:h,fieldName:f.name})]})},x=e=>{let{label:t,tooltip:n,dictField:r,name:l,id:d,disabled:u}=e,{field:f,isInvalid:p,error:h,isShowingSuggestions:x}=m(l,r,"numeric"),{setFieldValue:v}=(0,a.u6)();return(0,i.jsxs)(s.NIc,{isInvalid:p,width:"full",children:[(0,i.jsxs)(s.xuv,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[(0,i.jsxs)(s.Ugi,{spacing:1,children:[(0,i.jsx)(o.__,{htmlFor:d||l,fontSize:"xs",my:0,mr:0,children:t}),n?(0,i.jsx)(c.Z,{label:n}):null]}),(0,i.jsx)(s.Ugi,{children:(0,i.jsxs)(s.Y2U,{value:f.value,name:f.name,size:"xs",onBlur:f.onBlur,onChange:e=>{v(f.name,e)},w:"100%",colorScheme:"terracotta",inputMode:"numeric","data-testid":"input-".concat(f.name),color:"showing"===x?"complimentary.500":"gray.800",focusBorderColor:"primary.600",isDisabled:u,children:[(0,i.jsx)(s.zuI,{}),(0,i.jsxs)(s.FiK,{children:[(0,i.jsx)(s.WQu,{}),(0,i.jsx)(s.Y_d,{})]})]})})]}),(0,i.jsx)(o.Bc,{isInvalid:p,message:h,fieldName:f.name})]})}},72707:function(e){e.exports={option:"TaxonomySelect_option__vY6v2"}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4481],{86780:function(e,t,n){var l=n(24246),o=n(77181);t.Z=e=>{let{search:t,onChange:n,withIcon:i,onClear:r,placeholder:s,...a}=e;return(0,l.jsxs)(o.vyj.Compact,{className:"w-96","data-testid":"search-bar",children:[(0,l.jsx)(o.uFc,{autoComplete:"off",value:t,onChange:e=>n(e.target.value),placeholder:s||"Search...",prefix:i?(0,l.jsx)(o.PTu,{boxSize:4}):void 0,...a}),r?(0,l.jsx)(o.wpx,{onClick:r,children:"Clear"}):null]})}},812:function(e,t,n){n.d(t,{D4:function(){return i.D4},MM:function(){return g},Ot:function(){return c},c6:function(){return o},cj:function(){return h},e$:function(){return s},fn:function(){return a},iC:function(){return x},nU:function(){return u},tB:function(){return d}});var l,o,i=n(19043);let r="An unexpected error occurred. Please try again.",s=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r;if((0,i.Bw)(e)){if((0,i.hE)(e.data))return e.data.detail;if((0,i.cz)(e.data)){var n;let t=null===(n=e.data.detail)||void 0===n?void 0:n[0];return"".concat(null==t?void 0:t.msg,": ").concat(null==t?void 0:t.loc)}if(409===e.status&&(0,i.Dy)(e.data)||404===e.status&&(0,i.XD)(e.data))return"".concat(e.data.detail.error," (").concat(e.data.detail.fides_key,")")}return t};function a(e){return"object"==typeof e&&null!=e&&"status"in e}function c(e){return"object"==typeof e&&null!=e&&"data"in e&&"string"==typeof e.data.detail}function d(e){return"object"==typeof e&&null!=e&&"data"in e&&Array.isArray(e.data.detail)}let u=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{status:500,message:r};if((0,i.oK)(e))return{status:e.originalStatus,message:e.data};if((0,i.Bw)(e)){let{status:n}=e;return{status:n,message:s(e,t.message)}}return t},g=e=>Object.entries(e).map(e=>({value:e[1],label:e[1]}));(l=o||(o={})).GVL="gvl",l.AC="gacp",l.COMPASS="compass";let x={gvl:{label:"GVL",fullName:"Global Vendor List"},gacp:{label:"AC",fullName:"Google Additional Consent List"},compass:{label:"",fullName:""}},h=e=>{let t=e.split(".")[0];return"gacp"===t?"gacp":"gvl"===t?"gvl":"compass"}},71795:function(e,t,n){n.d(t,{_:function(){return o}});var l=n(27378);function o(e,t){let[n,o]=(0,l.useState)(()=>{if(!e)return t;try{let n=window.localStorage.getItem(e);return n?JSON.parse(n):t}catch(e){return console.error(e),t}});return[n,t=>{try{let l=t instanceof Function?t(n):t;o(l),e&&window.localStorage.setItem(e,JSON.stringify(l))}catch(e){console.error(e)}}]}},58452:function(e,t,n){var l=n(24246),o=n(77181);t.Z=e=>{let{isOpen:t,onClose:n,onConfirm:i,onCancel:r,title:s,message:a,cancelButtonText:c,continueButtonText:d,isLoading:u,returnFocusOnClose:g,isCentered:x,testId:h="confirmation-modal",icon:m}=e;return(0,l.jsxs)(o.u_l,{isOpen:t,onClose:n,size:"lg",returnFocusOnClose:null==g||g,isCentered:x,children:[(0,l.jsx)(o.ZAr,{}),(0,l.jsxs)(o.hzk,{textAlign:"center",p:6,"data-testid":h,children:[m?(0,l.jsx)(o.M5Y,{mb:2,children:m}):null,s?(0,l.jsx)(o.xBx,{fontWeight:"medium",pb:0,children:s}):null,a?(0,l.jsx)(o.fef,{children:a}):null,(0,l.jsx)(o.mzw,{children:(0,l.jsxs)(o.MIq,{columns:2,width:"100%",children:[(0,l.jsx)(o.wpx,{onClick:()=>{r&&r(),n()},size:"large",className:"mr-3","data-testid":"cancel-btn",disabled:u,children:c||"Cancel"}),(0,l.jsx)(o.wpx,{type:"primary",size:"large",onClick:i,"data-testid":"continue-btn",loading:u,children:d||"Continue"})]})})]})]})}},42904:function(e,t,n){n.d(t,{W3:function(){return r},bX:function(){return s},oi:function(){return a},s8:function(){return c}});var l=n(24246),o=n(77181),i=n(27378);let r=[25,50,100],s=e=>{let t=e.getFilteredRowModel().rows.length,{pageIndex:n}=e.getState().pagination,{pageSize:l}=e.getState().pagination,o=e.previousPage,i=!e.getCanPreviousPage(),r=e.nextPage,s=!e.getCanNextPage(),{setPageSize:a}=e;return{totalRows:t,onPreviousPageClick:o,isPreviousPageDisabled:i,onNextPageClick:r,isNextPageDisabled:s,setPageSize:a,startRange:n*l==0?1:n*l,endRange:n*l+l}},a=()=>{let e,t;let[n,l]=(0,i.useState)(r[0]),[o,s]=(0,i.useState)(1),[a,c]=(0,i.useState)(1),d=(0,i.useCallback)(()=>{s(e=>e-1)},[s]),u=(0,i.useMemo)(()=>1===o,[o]),g=(0,i.useCallback)(()=>{s(e=>e+1)},[s]),x=(0,i.useMemo)(()=>{let e=!a,t=!!a&&o===a;return e||t},[o,a]);if(a){let l=(o-1)*n;e=l+1,t=l+n}else e=0,t=0;let h=(0,i.useCallback)(()=>{s(1)},[]);return{onPreviousPageClick:d,isPreviousPageDisabled:u,onNextPageClick:g,isNextPageDisabled:x,pageSize:n,setPageSize:e=>{l(e),h()},PAGE_SIZES:r,startRange:e,endRange:t,pageIndex:o,resetPageIndexToDefault:h,setTotalPages:c}},c=e=>{let{pageSizes:t,totalRows:n,onPreviousPageClick:i,isPreviousPageDisabled:r,onNextPageClick:s,isNextPageDisabled:a,setPageSize:c,startRange:d,endRange:u}=e;return(0,l.jsxs)(o.Ugi,{ml:1,mt:3,mb:1,children:[(0,l.jsxs)(o.v2r,{children:[(0,l.jsx)(o.j2t,{as:o.wpx,size:"small","data-testid":"pagination-btn",children:(0,l.jsxs)(o.xvT,{fontSize:"xs",lineHeight:4,fontWeight:"semibold",userSelect:"none",style:{fontVariantNumeric:"tabular-nums"},children:[d.toLocaleString("en"),"-",u<=n?u.toLocaleString("en"):n.toLocaleString("en")," ","of ",n.toLocaleString("en")]})}),(0,l.jsx)(o.qyq,{minWidth:"0",children:t.map(e=>(0,l.jsxs)(o.sNh,{onClick:()=>{c(e)},"data-testid":"pageSize-".concat(e),fontSize:"xs",children:[e," per view"]},e))})]}),(0,l.jsx)(o.wpx,{icon:(0,l.jsx)(o.wyc,{}),size:"small","aria-label":"previous page",onClick:i,disabled:r}),(0,l.jsx)(o.wpx,{icon:(0,l.jsx)(o.XCv,{}),size:"small","aria-label":"next page",onClick:s,disabled:a})]})}},72625:function(e,t,n){n.d(t,{A4:function(){return f},CI:function(){return v},Cy:function(){return m},G3:function(){return h},Hm:function(){return y},Rr:function(){return S},S1:function(){return k},WP:function(){return w},k:function(){return C},mb:function(){return j},tc:function(){return b}});var l=n(24246),o=n(7195),i=n(77181),r=n(34090),s=n(3819),a=n.n(s),c=n(27378),d=n(812),u=n(58452),g=n(46628),x=n(16394);let h=e=>{var t,n;let{value:o,cellProps:r,...s}=e,c=!!(null==r?void 0:null===(t=r.cell.column.columnDef.meta)||void 0===t?void 0:t.showHeaderMenu)&&!!(null==r?void 0:null===(n=r.cellState)||void 0===n?void 0:n.isExpanded);return(0,l.jsx)(i.xvT,{fontSize:"xs",lineHeight:4,py:1.5,fontWeight:"normal",textOverflow:"ellipsis",overflow:c?void 0:"hidden",whiteSpace:c?"normal":void 0,title:c&&o?void 0:null==o?void 0:o.toString(),...s,children:a()(o)?o.toString():o})},m=e=>{let{time:t}=e;if(!t)return(0,l.jsx)(h,{value:"N/A"});let n=(0,o.B)(new Date(t),new Date,{addSuffix:!0}),r=(0,x.p6)(new Date(t));return(0,l.jsx)(i.kCb,{alignItems:"center",height:"100%",children:(0,l.jsx)(i.esZ,{title:r,children:(0,l.jsx)(i.xvT,{fontSize:"xs",lineHeight:4,fontWeight:"normal",overflow:"hidden",textOverflow:"ellipsis",children:(0,x.G8)(n)})})})},p=e=>{let{children:t,...n}=e;return(0,l.jsx)(i.kCb,{alignItems:"center",height:"100%",mr:2,overflow:"auto",...n,children:t})},f=e=>{let{value:t,suffix:n,...o}=e;return(0,l.jsx)(p,{children:(0,l.jsxs)(i.j8w,{...o,children:[t,n]})})},v=e=>{let{count:t,singSuffix:n,plSuffix:o,...r}=e,s=null;return s=1===t?(0,l.jsxs)(i.j8w,{...r,children:[t,n?" ".concat(n):null]}):(0,l.jsxs)(i.j8w,{...r,children:[t,o?" ".concat(o):null]}),(0,l.jsx)(p,{children:s})},j=e=>{let{values:t,cellProps:n,...o}=e,{isExpanded:r,isWrapped:s,version:a}=(null==n?void 0:n.cellState)||{},[d,u]=(0,c.useState)(!r),[g,x]=(0,c.useState)(!!s),[h,m]=(0,c.useState)(r?t:null==t?void 0:t.slice(0,2));return(0,c.useEffect)(()=>{u(!r)},[r,a]),(0,c.useEffect)(()=>{x(!!s)},[s]),(0,c.useEffect)(()=>{(null==t?void 0:t.length)&&m(d?t.slice(0,2):t)},[d,t]),(0,c.useMemo)(()=>(null==h?void 0:h.length)?(0,l.jsxs)(i.kCb,{alignItems:d?"center":"flex-start",flexDirection:d||g?"row":"column",flexWrap:g?"wrap":"nowrap",gap:1.5,pt:2,pb:2,overflowX:"auto",onClick:e=>{d||(e.stopPropagation(),u(!0))},cursor:d?void 0:"pointer",children:[h.map(e=>(0,l.jsx)(i.j8w,{color:"white","data-testid":e.key,...o,children:e.label},e.key)),d&&t&&t.length>2&&(0,l.jsxs)(i.wpx,{type:"link",size:"small",onClick:()=>u(!1),className:"text-xs font-normal",children:["+",t.length-2," more"]})]}):null,[h,d,g,t,o])},b=e=>{let{values:t,valueSuffix:n,cellProps:o}=e,{isExpanded:r,version:s}=(null==o?void 0:o.cellState)||{},[a,d]=(0,c.useState)(!r);return(0,c.useEffect)(()=>{d(!r)},[r,s]),(0,c.useMemo)(()=>(null==t?void 0:t.length)?1===t.length?(0,l.jsx)(i.xvT,{fontSize:"xs",lineHeight:4,fontWeight:"normal",textOverflow:"ellipsis",overflow:"hidden",children:t[0]}):(0,l.jsxs)(i.kCb,{flexDirection:"row",alignItems:"center",gap:1,pt:2,pb:2,onClick:e=>{a||(e.stopPropagation(),d(!0))},cursor:a?void 0:"pointer",children:[a&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(i.xvT,{fontSize:"xs",lineHeight:4,fontWeight:"normal",children:[t.length," ",n]}),(0,l.jsx)(i.wpx,{type:"link",size:"small",onClick:()=>d(!1),className:"text-xs font-normal",children:"View"})]}),!a&&(0,l.jsx)(i.aVo,{overflow:"hidden",children:t.map(e=>(0,l.jsx)(i.HCh,{fontSize:"xs",lineHeight:4,listStyleType:"none",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",children:e},e))})]}):null,[a,t,n])},w=e=>{let{value:t,suffix:n,cellState:o,ignoreZero:r,tagProps:s}=e,a=null;return t?(a=Array.isArray(t)?1===t.length?(0,l.jsx)(i.j8w,{...s,children:t}):(null==o?void 0:o.isExpanded)&&t.length>0?t.map((e,t)=>(0,l.jsx)(i.j8w,{...s,children:e},(null==e?void 0:e.toString())||t)):(0,l.jsxs)(i.j8w,{...s,children:[t.length,n?" ".concat(n):null]}):(0,l.jsx)(i.j8w,{...s,children:t}),(0,l.jsx)(i.kCb,{alignItems:"center",height:"100%",gap:2,overflowX:"hidden",children:a})):r?null:(0,l.jsxs)(i.j8w,{...s,children:["0",n?" ".concat(n):""]})},C=e=>{let{dataTestId:t,...n}=e;return(0,l.jsx)(i.kCb,{alignItems:"center",justifyContent:"center",onClick:e=>e.stopPropagation(),children:(0,l.jsx)(i.XZJ,{"data-testid":t||void 0,...n})})},S=e=>{let{value:t,...n}=e;return(0,l.jsx)(i.xvT,{fontSize:"xs",lineHeight:9,fontWeight:"medium",flex:1,...n,children:t})},y=e=>{let{value:t,defaultValue:n,isEditing:o,...s}=e,a=s.column.columnDef.id||"",[c]=(0,r.U$)(a),{submitForm:d}=(0,r.u6)();return o?(0,l.jsx)(i.uFc,{...c,maxLength:80,placeholder:n,"aria-label":"Edit column name",size:"small","data-testid":"column-".concat(a,"-input"),onPressEnter:d}):(0,l.jsx)(S,{value:t,...s})},k=e=>{let{enabled:t,onToggle:n,title:o,message:r,isDisabled:s,...a}=e,c=(0,i.qY0)(),x=(0,i.pmc)(),h=async e=>{let{enable:t}=e,l=await n(t);(0,d.D4)(l)&&x((0,g.Vo)((0,d.e$)(l.error)))},m=async e=>{e?await h({enable:!0}):c.onOpen()};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(i.rAg,{checked:t,onChange:m,disabled:s,"data-testid":"toggle-switch",...a}),(0,l.jsx)(u.Z,{isOpen:c.isOpen,onClose:c.onClose,onConfirm:()=>{h({enable:!1}),c.onClose()},title:o,message:(0,l.jsx)(i.xvT,{color:"gray.500",children:r}),continueButtonText:"Confirm",isCentered:!0,icon:(0,l.jsx)(i.aNP,{color:"orange.100"})})]})}},14481:function(e,t,n){n.d(t,{A4:function(){return l.A4},CI:function(){return l.CI},F1:function(){return p},G3:function(){return l.G3},Rr:function(){return l.Rr},vr:function(){return R},ZK:function(){return W},HO:function(){return D},WP:function(){return l.WP},k:function(){return l.k},W3:function(){return A.W3},s8:function(){return A.s8},AA:function(){return _},Q$:function(){return H},I4:function(){return E},bX:function(){return A.bX},oi:function(){return A.oi}});var l=n(72625),o=n(24246),i=n(77181),r=n(27378),s=n(43862),a=n(65201),c=n(75383),d=n(52202);let u="DraggableColumnListItem",g=e=>{let{id:t,index:n,moveColumn:l,setColumnVisible:o}=e,i=(0,r.useRef)(null),[{handlerId:s},a]=(0,c.L)({accept:u,collect:e=>({handlerId:e.getHandlerId()}),hover(e,t){var o;if(!i.current)return;let r=e.index;if(r===n)return;let s=null===(o=i.current)||void 0===o?void 0:o.getBoundingClientRect(),a=(s.bottom-s.top)/2,c=t.getClientOffset().y-s.top;r<n&&c<a||r>n&&c>a||(l(r,n),Object.assign(e,{index:n}))}}),[{isDragging:g},x,h]=(0,d.c)({type:u,item:()=>({id:t,index:n}),collect:e=>({isDragging:!!e.isDragging()})});return x(a(i)),{isDragging:g,ref:i,handlerId:s,preview:h,handleColumnVisibleToggle:e=>{o(n,e)}}},x=e=>{let{id:t,index:n,isVisible:l,moveColumn:r,setColumnVisible:s,text:a}=e,{ref:c,isDragging:d,handlerId:u,preview:x,handleColumnVisibleToggle:h}=g({index:n,id:t,moveColumn:r,setColumnVisible:s});return(0,o.jsxs)(i.HCh,{alignItems:"center",display:"flex",minWidth:0,ref:e=>{x(e)},"data-handler-id":u,opacity:d?.2:1,"data-testid":"column-list-item-".concat(t),children:[(0,o.jsx)(i.xuv,{ref:c,cursor:d?"grabbing":"grab","data-testid":"column-dragger-".concat(t),children:(0,o.jsx)(i.DE2,{as:i.zGR,color:"gray.300",flexShrink:0,height:"20px",width:"20px",_hover:{color:"gray.700"}})}),(0,o.jsxs)(i.NIc,{alignItems:"center",display:"flex",minWidth:0,title:a,children:[(0,o.jsx)(i.lXp,{color:"gray.700",fontSize:"normal",fontWeight:400,htmlFor:"".concat(t),mb:"0",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flexGrow:1,children:a}),(0,o.jsx)(i.rAg,{id:"".concat(t),checked:l,onChange:h})]})]})},h=e=>{let{columns:t}=e,[n,l]=(0,r.useState)(null!=t?t:[]);return(0,r.useEffect)(()=>{l((null==t?void 0:t.map(e=>({...e})))||[])},[t]),{columns:n,moveColumn:(0,r.useCallback)((e,t)=>{l(n=>(0,a.ZP)(n,n=>{let l=n[e];n.splice(e,1),n.splice(t,0,l)}))},[]),setColumnVisible:(0,r.useCallback)((e,t)=>{l(n=>(0,a.ZP)(n,n=>{n[e]&&(n[e].isVisible=t)}))},[])}},m=e=>{let{columns:t,columnEditor:n}=e;return(0,o.jsx)(i.aVo,{spacing:4,children:t.map((e,t)=>(0,o.jsx)(x,{id:e.id,index:t,isVisible:e.isVisible,moveColumn:n.moveColumn,setColumnVisible:n.setColumnVisible,text:e.displayText},e.id))})},p=e=>{let{isOpen:t,onClose:n,headerText:l,tableInstance:a,columnNameMap:c,prefixColumns:d,savedCustomReportId:u,onColumnOrderChange:g,onColumnVisibilityChange:x}=e,p=h({columns:(0,r.useMemo)(()=>a.getAllColumns().filter(e=>!d.includes(e.id)).map(e=>{var t;return{id:e.id,displayText:(0,s.AH)({columnNameMap:c,columnId:e.id}),isVisible:null!==(t=a.getState().columnVisibility[e.id])&&void 0!==t?t:e.getIsVisible()}}).sort((e,t)=>{let{columnOrder:n}=a.getState(),l=n.indexOf(e.id),o=n.indexOf(t.id);return -1===l&&-1===o?0:-1===l?1:-1===o?-1:l-o}),[u,c])}),f=(0,r.useCallback)(()=>{let e=[...d,...p.columns.map(e=>e.id)],t=p.columns.reduce((e,t)=>(e[t.id]=t.isVisible,e),{});g(e),x(t),n()},[n,d,p.columns,g,x]);return(0,o.jsxs)(i.u_l,{isOpen:t,onClose:n,isCentered:!0,size:"2xl",children:[(0,o.jsx)(i.ZAr,{}),(0,o.jsxs)(i.hzk,{children:[(0,o.jsx)(i.xBx,{pb:0,children:l}),(0,o.jsx)(i.olH,{"data-testid":"column-settings-close-button"}),(0,o.jsxs)(i.fef,{children:[(0,o.jsx)(i.xvT,{fontSize:"sm",color:"gray.500",mb:2,children:"You can toggle columns on and off to hide or show them in the table. Additionally, you can drag columns up or down to change the order"}),(0,o.jsxs)(i.mQc,{colorScheme:"complimentary",children:[(0,o.jsx)(i.tdY,{children:(0,o.jsx)(i.OK9,{color:"complimentary.500",children:"Columns"})}),(0,o.jsx)(i.nPR,{children:(0,o.jsx)(i.x45,{p:0,pt:4,maxHeight:"270px",overflowY:"scroll",children:(0,o.jsx)(m,{columns:p.columns,columnEditor:p})})})]})]}),(0,o.jsx)(i.mzw,{children:(0,o.jsxs)(i.xuv,{display:"flex",justifyContent:"space-between",width:"100%",children:[(0,o.jsx)(i.wpx,{onClick:n,className:"mr-3 grow",children:"Cancel"}),(0,o.jsx)(i.wpx,{onClick:f,type:"primary",className:"grow","data-testid":"save-button",children:"Save"})]})})]})]})};var f=n(59003),v=n(71795),j=n(14048);let b=e=>{var t,n,l,r,a,c,d,u;let g,{cell:x,onRowClick:h,cellState:m}=e,p=x.getContext().table.getState().grouping.length>0,v=p?x.getContext().table.getState().grouping[0]:void 0,j=x.column.id===v,b=!1,w=!1,C=!1,S=x.getContext().table.getRowModel().rows.filter(e=>!e.id.includes(":")),y=S[0].id===x.row.id,k=S[S.length-1].id===x.row.id;if(x.getValue()&&j){let e=x.getContext().table.getRow("".concat(x.column.id,":").concat(x.getValue()));C=1===e.subRows.length,b=e.subRows[0].id===x.row.id,w=e.subRows[e.subRows.length-1].id===x.row.id}let z=(!j||b)&&!!(null===(t=x.column.columnDef.meta)||void 0===t?void 0:t.onCellClick);return(null===(n=x.column.columnDef.meta)||void 0===n?void 0:n.disableRowClick)||!h?z&&(g=()=>{var e,t;null===(t=x.column.columnDef.meta)||void 0===t||null===(e=t.onCellClick)||void 0===e||e.call(t,x.row.original)}):g=e=>{h(x.row.original,e)},(0,o.jsx)(i.Td,{width:(null===(l=x.column.columnDef.meta)||void 0===l?void 0:l.width)?x.column.columnDef.meta.width:"unset",overflow:(null===(r=x.column.columnDef.meta)||void 0===r?void 0:r.overflow)?null===(a=x.column.columnDef.meta)||void 0===a?void 0:a.overflow:"auto",borderBottomWidth:k||j?"0px":"1px",borderBottomColor:"gray.200",borderRightWidth:"1px",borderRightColor:"gray.200",sx:{article:{borderTopWidth:"2x",borderTopColor:"red"},...(0,s.J9)("select"===x.column.id||(null===(c=x.column.columnDef.meta)||void 0===c?void 0:c.noPadding)),maxWidth:"calc(var(--col-".concat(x.column.id,"-size) * 1px)"),minWidth:"calc(var(--col-".concat(x.column.id,"-size) * 1px)"),"&:hover":{backgroundColor:z?"gray.50":void 0,cursor:z?"pointer":void 0}},_hover:!h||(null===(d=x.column.columnDef.meta)||void 0===d?void 0:d.disableRowClick)?void 0:{cursor:"pointer"},_first:{borderBottomWidth:(p||k)&&(!w||y||k)&&(!b||!C||k)?"0px":"1px"},_last:{borderRightWidth:0},height:"inherit",onClick:g,"data-testid":"row-".concat(x.row.id,"-col-").concat(x.column.id),...null===(u=x.column.columnDef.meta)||void 0===u?void 0:u.cellProps,children:!x.getIsPlaceholder()||b?(0,f.ie)(x.column.columnDef.cell,{...x.getContext(),cellState:m}):null})},w=e=>{let{row:t,renderRowTooltipLabel:n,onRowClick:l,expandedColumns:r,wrappedColumns:a}=e;if(t.getIsGrouped())return null;let c=(0,o.jsx)(i.Tr,{height:"36px",_hover:l?{backgroundColor:"gray.50"}:void 0,"data-testid":"row-".concat(t.id),backgroundColor:t.getCanSelect()?void 0:"gray.50",children:t.getVisibleCells().map(e=>{let t=(0,s.tt)(e.column.id,r),n={isExpanded:!!t&&t>0,isWrapped:!!a.find(t=>t===e.column.id),version:t};return(0,o.jsx)(b,{cell:e,onRowClick:l,cellState:n},e.id)})},t.id);return n?(0,o.jsx)(i.ua7,{label:n?n(t):void 0,hasArrow:!0,placement:"top",children:c}):c},C={asc:{icon:(0,o.jsx)(i.Hf3,{}),title:"Sort ascending"},desc:{icon:(0,o.jsx)(i.veu,{}),title:"Sort descending"}},S={height:i.rSc.space[9],width:"100%",textAlign:"start","&:focus-visible":{backgroundColor:"gray.100"},"&:focus":{outline:"none"}},y=e=>{var t,n,l,r,a,c,d,u;let{header:g,onGroupAll:x,onExpandAll:h,onWrapToggle:m,isExpandAll:p,isWrapped:v,enableSorting:b}=e,{meta:w}=g.column.columnDef;return(null==w?void 0:w.showHeaderMenu)?(0,o.jsxs)(i.v2r,{placement:"bottom-end",closeOnSelect:!w.showHeaderMenuWrapOption,children:[(0,o.jsx)(i.j2t,{as:i.zxk,rightIcon:(0,o.jsxs)(i.Ugi,{children:[null===(t=C[g.column.getIsSorted()])||void 0===t?void 0:t.icon,(0,o.jsx)(i.nXP,{transform:"rotate(90deg)"})]}),title:"Column options",variant:"ghost",size:"sm",sx:{...(0,s.J9)("select"===g.column.id),...S},"data-testid":"".concat(g.id,"-header-menu"),children:(0,f.ie)(g.column.columnDef.header,g.getContext())}),(0,o.jsx)(i.h_i,{children:(0,o.jsxs)(i.qyq,{fontSize:"xs",minW:"0",w:"158px","data-testid":"".concat(g.id,"-header-menu-list"),children:[(0,o.jsxs)(i.sNh,{gap:2,color:p?"complimentary.500":void 0,onClick:()=>h(g.id),children:[(0,o.jsx)(j.oq,{})," Expand all"]}),(0,o.jsxs)(i.sNh,{gap:2,color:p?void 0:"complimentary.500",onClick:()=>x(g.id),children:[(0,o.jsx)(j.Kc,{})," Collapse all"]}),b&&g.column.getCanSort()&&(0,o.jsxs)(i.sNh,{gap:2,onClick:g.column.getToggleSortingHandler(),children:[null!==(d=null===(n=C[g.column.getNextSortingOrder()])||void 0===n?void 0:n.icon)&&void 0!==d?d:(0,o.jsx)(i.Dbz,{}),null!==(u=null===(l=C[g.column.getNextSortingOrder()])||void 0===l?void 0:l.title)&&void 0!==u?u:"Clear sort"]}),w.showHeaderMenuWrapOption&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(i.RaW,{}),(0,o.jsx)(i.xuv,{px:3,children:(0,o.jsx)(i.XZJ,{size:"sm",isChecked:v,onChange:()=>m(g.id,!v),colorScheme:"complimentary",children:(0,o.jsx)(i.xvT,{fontSize:"xs",children:"Wrap results"})})})]})]})})]}):b&&g.column.getCanSort()?(0,o.jsx)(i.zxk,{"data-testid":"".concat(g.id,"-header-sort"),onClick:g.column.getToggleSortingHandler(),rightIcon:null===(r=C[g.column.getIsSorted()])||void 0===r?void 0:r.icon,title:null!==(c=null===(a=C[g.column.getNextSortingOrder()])||void 0===a?void 0:a.title)&&void 0!==c?c:"Clear sort",variant:"ghost",size:"sm",sx:{...(0,s.J9)("select"===g.column.id),...S},children:(0,f.ie)(g.column.columnDef.header,g.getContext())}):(0,o.jsx)(i.xuv,{"data-testid":"".concat(g.id,"-header"),sx:{...(0,s.J9)("select"===g.column.id)},fontSize:"xs",lineHeight:9,fontWeight:"medium",children:(0,f.ie)(g.column.columnDef.header,g.getContext())})},k=e=>{var t;let{tableInstance:n,rowActionBar:l,onRowClick:r,getRowIsClickable:s,renderRowTooltipLabel:a,expandedColumns:c,wrappedColumns:d,emptyTableNotice:u}=e,g=e=>s?s(e)?r:void 0:r;return(0,o.jsxs)(i.p3B,{"data-testid":"fidesTable-body",children:[l,n.getRowModel().rows.map(e=>(0,o.jsx)(w,{row:e,onRowClick:g(e.original),renderRowTooltipLabel:a,expandedColumns:c,wrappedColumns:d},e.id)),0===n.getRowModel().rows.length&&!(null===(t=n.getState())||void 0===t?void 0:t.globalFilter)&&u&&(0,o.jsx)(i.Tr,{children:(0,o.jsx)(i.Td,{colSpan:100,children:u})})]})},z=r.memo(k,(e,t)=>e.tableInstance.options.data===t.tableInstance.options.data),W=e=>{let{tableInstance:t,rowActionBar:n,footer:l,onRowClick:a,getRowIsClickable:c,renderRowTooltipLabel:d,emptyTableNotice:u,overflow:g="auto",onSort:x,enableSorting:h=!!x,columnExpandStorageKey:m,columnWrapStorageKey:p}=e,[f,j]=(0,r.useState)(1),[b,w]=(0,v._)(m,[]),[C,S]=(0,v._)(p,[]),W=e=>{w([...b.filter(t=>t.split(s.mb)[0]!==e),"".concat(e).concat(s.mb).concat(f)]),j(f+1)},R=e=>{w([...b.filter(t=>t.split(s.mb)[0]!==e),"".concat(e).concat(s.mb).concat(-1*f)]),j(f+1)},I=(e,t)=>{S(t?[...C,e]:C.filter(t=>t!==e))},T=(0,r.useMemo)(()=>{let e=t.getFlatHeaders(),n={};for(let i=0;i<e.length;i+=1){var l,o;let r=e[i],s=!!(null===(l=t.getState().columnSizing)||void 0===l?void 0:l[r.id]),a="auto"===(null===(o=r.column.columnDef.meta)||void 0===o?void 0:o.width);!s&&a?setTimeout(()=>{var e;let l=null===(e=document.getElementById("column-".concat(r.id)))||void 0===e?void 0:e.offsetWidth;l&&(t.setColumnSizing(e=>({...e,[r.id]:l})),n["--header-".concat(r.id,"-size")]=l,n["--col-".concat(r.column.id,"-size")]=l)}):(n["--header-".concat(r.id,"-size")]=r.getSize(),n["--col-".concat(r.column.id,"-size")]=r.column.getSize())}return n},[t.getState().columnSizingInfo]);return(0,r.useEffect)(()=>{x&&x(t.getState().sorting[0])},[t.getState().sorting]),(0,o.jsx)(i.xJi,{"data-testid":"fidesTable",overflowY:g,overflowX:g,borderColor:"gray.200",borderBottomWidth:"1px",borderRightWidth:"1px",borderLeftWidth:"1px",children:(0,o.jsxs)(i.iA_,{variant:"unstyled",style:{borderCollapse:"separate",borderSpacing:0,...T,minWidth:"100%"},children:[(0,o.jsx)(i.hrZ,{position:"sticky",top:"0",height:"36px",zIndex:10,backgroundColor:"gray.50",children:t.getHeaderGroups().map(e=>(0,o.jsx)(i.Tr,{height:"inherit",children:e.headers.map(e=>{var t;let n=(0,s.tt)(e.id,b);return(0,o.jsxs)(i.Th,{borderColor:"gray.200",borderTopWidth:"1px",borderBottomWidth:"1px",borderRightWidth:"1px",_last:{borderRightWidth:0},colSpan:e.colSpan,"data-testid":"column-".concat(e.id),id:"column-".concat(e.id),sx:{padding:0,width:"calc(var(--header-".concat(e.id,"-size) * 1px)"),overflowX:"auto"},textTransform:"unset",position:"relative",_hover:{"& .resizer":{opacity:1}},...null===(t=e.column.columnDef.meta)||void 0===t?void 0:t.cellProps,children:[(0,o.jsx)(y,{header:e,onGroupAll:R,onExpandAll:W,onWrapToggle:I,isExpandAll:!!n&&n>0,isWrapped:!!C.find(t=>e.id===t),enableSorting:h}),e.column.getCanResize()?(0,o.jsx)(i.xuv,{onDoubleClick:()=>e.column.resetSize(),onMouseDown:e.getResizeHandler(),position:"absolute",height:"100%",top:"0",right:"0",width:"5px",cursor:"col-resize",userSelect:"none",className:"resizer",opacity:0,backgroundColor:e.column.getIsResizing()?"complimentary.500":"gray.200"}):null]},e.id)})},e.id))}),t.getState().columnSizingInfo.isResizingColumn?(0,o.jsx)(z,{tableInstance:t,rowActionBar:n,onRowClick:a,getRowIsClickable:c,renderRowTooltipLabel:d,expandedColumns:b,wrappedColumns:C,emptyTableNotice:u}):(0,o.jsx)(k,{tableInstance:t,rowActionBar:n,onRowClick:a,getRowIsClickable:c,renderRowTooltipLabel:d,expandedColumns:b,wrappedColumns:C,emptyTableNotice:u}),l]})})},R=e=>{let{totalColumns:t,children:n}=e;return(0,o.jsx)(i.$RU,{backgroundColor:"gray.50",children:(0,o.jsx)(i.Tr,{children:(0,o.jsx)(i.Td,{colSpan:t,px:4,py:2,borderTop:"1px solid",borderColor:"gray.200",children:n})})})};var I=n(86780),T=n(16394);let D=e=>{let{globalFilter:t,setGlobalFilter:n,placeholder:l,testid:s="global-text-filter"}=e,[a,c]=(0,r.useState)(t),d=(0,r.useMemo)(()=>(0,T.Ds)(n,200),[n]),u=(0,r.useCallback)(()=>{c(void 0),n(void 0)},[c,n]);return(0,r.useEffect)(()=>{a||u()},[a,u]),(0,o.jsx)(i.xuv,{maxWidth:"424px",width:"100%",children:(0,o.jsx)(I.Z,{onChange:e=>{c(e),d(e)},onClear:u,search:a||"",placeholder:l,"data-testid":s})})};var A=n(42904),N=n(3124),O=n.n(N);let _=e=>{let{tableInstance:t,selectedRows:n,isOpen:l}=e;return l?(0,o.jsx)(i.Tr,{position:"sticky",zIndex:"10",top:"36px",backgroundColor:"neutral.100",height:"36px",p:0,boxShadow:"0px 4px 6px -1px rgba(0, 0, 0, 0.05)",children:(0,o.jsx)(i.Td,{borderWidth:"1px",borderColor:"gray.200",height:"inherit",pl:4,pr:2,py:0,colSpan:t.getAllColumns().length,bgColor:O().FIDESUI_FULL_WHITE,children:(0,o.jsxs)(i.Ugi,{children:[(0,o.jsxs)(i.xvT,{"data-testid":"selected-row-count",fontSize:"xs",children:[n.toLocaleString("en")," row(s) selected."]}),t.getIsAllRowsSelected()?null:(0,o.jsxs)(i.wpx,{"data-testid":"select-all-rows-btn",onClick:()=>{t.toggleAllRowsSelected()},type:"link",size:"small",className:"text-xs font-normal text-black underline",children:["Select all ",t.getFilteredRowModel().rows.length," rows."]})]})})}):null},H=e=>{let{children:t,...n}=e;return(0,o.jsx)(i.Ugi,{justifyContent:"space-between",alignItems:"center",p:2,borderWidth:"1px",borderBottomWidth:"0px",borderColor:"gray.200",zIndex:11,...n,children:t})},E=e=>{let{rowHeight:t,numRows:n}=e,l=[];for(let e=0;e<n;e+=1)l.push((0,o.jsx)(i.OdW,{height:"".concat(t,"px")},e));return(0,o.jsx)(i.Kqy,{children:l})}},43862:function(e,t,n){n.d(t,{AH:function(){return c},J9:function(){return s},mb:function(){return r},tt:function(){return a}});var l=n(77181),o=n(98784),i=n.n(o);let r="::",s=e=>e?{padding:"0px"}:{paddingLeft:l.rSc.space[3],paddingRight:"calc(".concat(l.rSc.space[3]," - 5px)"),paddingTop:"0px",paddingBottom:"0px",borderRadius:"0px"},a=(e,t)=>{let n=t.find(t=>t.startsWith(e));return n?parseInt(n.split(r)[1],10):void 0},c=e=>{let{columnId:t,columnNameMap:n}=e;if(!t)return"";let l=t.replace(/^(system_|privacy_declaration_)/,""),o=i().upperFirst(l.replaceAll("_"," "));return(null==n?void 0:n[t])||o}},46628:function(e,t,n){n.d(t,{MA:function(){return s},Vo:function(){return c},t5:function(){return a}});var l=n(24246),o=n(77181);let i=e=>{let{children:t,title:n="Success"}=e;return(0,l.jsxs)(o.xvT,{"data-testid":"toast-success-msg",children:[(0,l.jsxs)("strong",{children:[n,":"]})," ",t]})},r=e=>{let{children:t}=e;return(0,l.jsxs)(o.xvT,{"data-testid":"toast-error-msg",children:[(0,l.jsx)("strong",{children:"Error:"})," ",t]})},s={variant:"subtle",position:"top",description:"",duration:5e3,status:"success",isClosable:!0},a=(e,t)=>{let n=(0,l.jsx)(i,{title:t,children:e});return{...s,description:n}},c=e=>{let t=(0,l.jsx)(r,{children:e});return{...s,description:t,status:"error"}}},19043:function(e,t,n){n.d(t,{Bw:function(){return r},D4:function(){return o},Dy:function(){return a},XD:function(){return c},cz:function(){return d},hE:function(){return s},oK:function(){return i}});var l=n(76649);let o=e=>"error"in e,i=e=>(0,l.Ln)({status:"string"},e)&&"PARSING_ERROR"===e.status,r=e=>(0,l.Ln)({status:"number",data:{}},e),s=e=>(0,l.Ln)({detail:"string"},e),a=e=>(0,l.Ln)({detail:{error:"string",resource_type:"string",fides_key:"string"}},e),c=e=>(0,l.Ln)({detail:{error:"string",resource_type:"string",fides_key:"string"}},e),d=e=>(0,l.Ln)({detail:[{loc:["string","number"],msg:"string",type:"string"}]},e)}}]);