ethyca-fides 2.64.1rc0__py2.py3-none-any.whl → 2.64.2b0__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.
- {ethyca_fides-2.64.1rc0.dist-info → ethyca_fides-2.64.2b0.dist-info}/METADATA +2 -2
- {ethyca_fides-2.64.1rc0.dist-info → ethyca_fides-2.64.2b0.dist-info}/RECORD +235 -235
- fides/_version.py +3 -3
- fides/api/alembic/migrations/versions/6a76a1fa4f3f_add_manual_task_instance_table.py +256 -0
- fides/api/alembic/migrations/versions/aadfe83c5644_add_manual_task_to_connectiontype_enum.py +46 -0
- fides/api/db/base.py +4 -0
- fides/api/db/database.py +27 -2
- fides/api/models/attachment.py +15 -3
- fides/api/models/comment.py +22 -5
- fides/api/models/connectionconfig.py +11 -0
- fides/api/models/db_cache.py +1 -1
- fides/api/models/detection_discovery/core.py +15 -15
- fides/api/models/fides_user_respondent_email_verification.py +27 -2
- fides/api/models/manual_tasks/__init__.py +7 -1
- fides/api/models/manual_tasks/manual_task.py +68 -4
- fides/api/models/manual_tasks/manual_task_config.py +123 -12
- fides/api/models/manual_tasks/manual_task_instance.py +294 -0
- fides/api/models/manual_tasks/manual_task_log.py +48 -10
- fides/api/models/tcf_publisher_restrictions.py +16 -4
- fides/api/schemas/manual_tasks/manual_task_schemas.py +42 -0
- fides/api/schemas/manual_tasks/manual_task_status.py +107 -46
- fides/common/api/v1/urn_registry.py +4 -0
- fides/service/manual_tasks/manual_task_config_service.py +17 -5
- fides/service/manual_tasks/manual_task_instance_service.py +285 -0
- fides/service/manual_tasks/manual_task_service.py +66 -10
- fides/ui-build/static/admin/404.html +1 -1
- fides/ui-build/static/admin/_next/static/chunks/{1040-630c7f4284dc6f70.js → 1040-fa06cd3b94d97493.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/1169-f75d7958fbe6e136.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/1807-3beab149351d5ded.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/{1817-b4688ba5042ec687.js → 1817-a3813209d7a6d28d.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/{2921-aabf41bf3d7573f9.js → 2921-81a48418f77bc9a7.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/{3450-bdaeb35442d810b4.js → 3450-2bb9f1b5a23fb520.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/3615-5e2d062d684b8fa1.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/{3855-0dec3e7d9e886550.js → 3855-b85ad4e52433d519.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/{3872-ffa16c2df7ef0ab6.js → 3872-09f81435f7905d76.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/{3923-5d580fbb1dd6ae01.js → 3923-2565d952c662555c.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/{401-fceaae662cfca5a5.js → 401-8ea41700c5437d38.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/{409-037cfc3f096150f0.js → 409-e0d39af1d9ce8ff2.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/4121-55f5b0bcb5ba41fb.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/{4230-1cdb7ea1be370ed3.js → 4230-b3fe52af1035dff5.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/{431-f72599f01b98f07d.js → 431-c74dab231c8ac968.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/{5309-4511df9708d5a63c.js → 5309-0e44dbd914896514.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/{5574-3cd33b3a6c937899.js → 5574-917c5ff63d222308.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/570-c99f07161bd339cd.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/6084-57446e3c99078be8.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/6662-45b8977f48a219f5.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/{6853-a4097260e402980e.js → 6853-8d0a099f61c758d1.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/{6882-3cc73d407a088d7d.js → 6882-13d6f8d95b1e404f.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/{6954-13a25cef3a8fdd76.js → 6954-4e106b3f7097fe6e.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/7476-b5fb1c0cf4ad8f63.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/7630-e3d06546f9dfeb91.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/787-381156db4e81dbe8.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/{79-5670e31eb65d0a53.js → 79-3f742fe4efd9893f.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/{796-9a6b13c838e25538.js → 796-83a8bbdcdb67f2ba.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/827-c6fe34fb336467ae.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/9014-eeae6f581158e645.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/{9046-fdf53cc7e926a8c1.js → 9046-6995482a030e323c.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/{905-742074a074be1055.js → 905-ffdbd0b14167e8bd.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/{9226-ba6587e46ec7659a.js → 9226-2be3a6efb127148f.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/{9392.25024e070026343d.js → 9392.9a948112de74781b.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/{9676.e60a53f1f5890847.js → 9676.cc515c853b8cf578.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/9767-980699a4d0f56acc.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/9826-303b14ef4fc7ab4a.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/{9951-f9ab5cac7e2c05ab.js → 9951-57c0a671463e0ebb.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/{404-ac2f0844e5c4b4cd.js → 404-488f8f03fe0ffbc7.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/{_app-8ec6e466f3373ac0.js → _app-5e6fbbf17a62ac76.js} +68 -65
- fides/ui-build/static/admin/_next/static/chunks/pages/add-systems/{manual-0a5f2310ce6b1059.js → manual-1e88ac28bc7a41b6.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/add-systems/{multiple-00cb904825aad7e3.js → multiple-f2c9451fffaaa529.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/add-systems-40a6b572d49c2b68.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/pages/consent/configure/{add-vendors-fa7305b88c1afd20.js → add-vendors-b17d160147365cf3.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/consent/{configure-f140ec9d8e8a0f7a.js → configure-8e168d78acdf0cfe.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/consent/privacy-experience/{[id]-0edb7c92518e7d21.js → [id]-5ca2467de7986929.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/consent/privacy-experience/{new-a0039f216fb3eb93.js → new-06bb3b0bf097fcdb.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/consent/{privacy-experience-d8d926f0735a2546.js → privacy-experience-3c11fecc2797ab68.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/consent/privacy-notices/{[id]-5c949f2e3cef2398.js → [id]-92bc6c7b82a679b4.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/consent/privacy-notices/{new-130155cfb4a0bcc7.js → new-a3da3243526b7ecb.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/consent/{privacy-notices-1135ad8924d32c36.js → privacy-notices-b7d82386e7521041.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/consent/{properties-776855e370414beb.js → properties-20a2029b7e7fc895.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/consent/{reporting-21c23f75ff1135d9.js → reporting-0ce299131db4c3e5.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/{consent-4d5ea70a77df1bb8.js → consent-9f6a7a231bba17b7.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/data-catalog/[systemId]/projects/[projectUrn]/{[resourceUrn]-c623d6f1a61c8ea9.js → [resourceUrn]-11d52f1570759c4d.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/data-catalog/[systemId]/projects/{[projectUrn]-030ee304cbe5e530.js → [projectUrn]-fd705968b357e99a.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/data-catalog/[systemId]/{projects-cfac259a30641e68.js → projects-45b585deee0b2371.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/data-catalog/[systemId]/resources/{[resourceUrn]-57bd5cdf784f059f.js → [resourceUrn]-b83afa5565d0c84e.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/data-catalog/[systemId]/{resources-51d99174c8006eb5.js → resources-d8db234a44a2ddf4.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/{data-catalog-7b5aec33da578745.js → data-catalog-4fd60a74c0369e3e.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/data-discovery/action-center/[monitorId]/{[systemId]-c948f93c833d4358.js → [systemId]-e861699a8866c64b.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/data-discovery/action-center/{[monitorId]-333f53caab751428.js → [monitorId]-5dd2fbf33e228f9c.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/data-discovery/{action-center-27205f8457a1ecb0.js → action-center-806cae6bc128cd38.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/data-discovery/{activity-20a1043f6a06198f.js → activity-487285bd5eca2595.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/data-discovery/detection/{[resourceUrn]-06edce289876dea1.js → [resourceUrn]-393e20924c83373e.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/data-discovery/{detection-faf326a6200637d0.js → detection-8733807dad4bc96e.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/data-discovery/discovery/{[resourceUrn]-64acf269256ee74f.js → [resourceUrn]-14bd7500362ff224.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/data-discovery/{discovery-8c3e4be6d36da66d.js → discovery-9e7dfd5a6acc2e8f.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/{datamap-fb50de22f83edd4a.js → datamap-c9509d72c538d22b.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/dataset/[datasetId]/[collectionName]/{[...subfieldNames]-41ab27c4195cfa93.js → [...subfieldNames]-4e8a436297a055b2.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/dataset/[datasetId]/{[collectionName]-6e2caba24b3e78c2.js → [collectionName]-6ce02295bb7f5b6d.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/dataset/{[datasetId]-904d43e31157aa55.js → [datasetId]-9eaa907437fde063.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/dataset/new-de5e9ccfecdf31b1.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/pages/{dataset-8f7d16bc5e9229c8.js → dataset-dcdec3644f05188d.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/datastore-connection/{[id]-4a33dd0371dbaebc.js → [id]-81ab412e337d2888.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/datastore-connection/{new-e88509346b2d2851.js → new-34dfc172165dbb1c.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/datastore-connection-cdb77886d7fd4f44.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/pages/{index-1adb6bcb71701ac2.js → index-de954b741cbca022.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/integrations/{[id]-fdc2964fa7d1d8fd.js → [id]-dba625eddca48f69.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/integrations-40a3cd14264796e2.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/pages/messaging/{[id]-9b4d1d61c7c97509.js → [id]-42edcab11e8b5c3c.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/messaging/{add-template-f8fd4795e260887c.js → add-template-333e54ac8c3ad57a.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/{messaging-aa744ae8b61e5ff2.js → messaging-8e1e6f3782983225.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/poc/{ant-components-3407158757fb3627.js → ant-components-25c74d51a49b2403.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/poc/form-experiments/{AntForm-47e947c02ae90fd0.js → AntForm-920338760f5a71b5.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/poc/form-experiments/{FormikAntFormItem-24f9a44512ce8827.js → FormikAntFormItem-7462fb387a9de3f8.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/poc/form-experiments/{FormikControlled-e567a69f8c37fb9a.js → FormikControlled-6148fce7a4e2e9ca.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/poc/form-experiments/{FormikField-35a33f9c7def2220.js → FormikField-30efd8c937bf19e4.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/poc/{forms-780e18dde8e38099.js → forms-c44de83e0952d1e0.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/poc/table-migration-7852aa60090c8c9a.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/pages/privacy-requests/[id]-11dd6152bf6607cc.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/pages/privacy-requests/configure/messaging-83a548813fec4f90.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/pages/privacy-requests/configure/storage-a087847d6cbccc65.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/pages/privacy-requests/{configure-1a1aa83a3f88844c.js → configure-1d981663e1a84166.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/privacy-requests-6a5794999a1cc0b6.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/pages/properties/{[id]-19737d4f21aadbee.js → [id]-b08a69b1c460c7fe.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/properties/{add-property-9ccb295110feee20.js → add-property-a5d1c65ec21df69d.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/{properties-3a1037a2e036212a.js → properties-3a75c6ed8308d126.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/reporting/{datamap-4cdbbb8cd1d8698e.js → datamap-911996819aa16e04.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/settings/about/{alpha-965cc21889b25e44.js → alpha-6773158ba6ccf4b0.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/settings/{about-0e1c381d488a7ada.js → about-2e046d177d52465c.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/settings/consent/[configuration_id]/{[purpose_id]-d0e350d2a2667883.js → [purpose_id]-a5420c3ba02fe6a5.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/settings/consent-2a95eb36aa2b47a6.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/pages/settings/{custom-fields-6f866bc799a5f67f.js → custom-fields-06075fbf122c98d0.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/settings/{domain-records-0b44b2b224077dcd.js → domain-records-2c7ecff0a8a74c42.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/settings/domains-afed8ba5498a9f93.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/pages/settings/email-templates-c1d3f3cb9c6ca463.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/pages/settings/{locations-811dadb489f23d7d.js → locations-8d4383584c72eb5a.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/settings/organization-aae79a344a96a367.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/pages/settings/{regulations-54f142bc3e4c95ba.js → regulations-29892065d99ff113.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/systems/configure/[id]/test-datasets-9669fa6b20545530.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/pages/systems/configure/{[id]-6eb886e7b7e6785b.js → [id]-8fa8a2f238e08791.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/{systems-7b71274334c559a4.js → systems-acdbdd3dfd21162f.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/taxonomy-9b4d28f02df3a238.js +1 -0
- fides/ui-build/static/admin/_next/static/chunks/pages/user-management/{new-b124cc24b930c9e1.js → new-a2524414e968f862.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/user-management/profile/{[id]-75d41fde668b9025.js → [id]-87ed17fa1d9f8f72.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/{user-management-dd43755b687c09a7.js → user-management-6b4e0764bb8816b8.js} +1 -1
- fides/ui-build/static/admin/_next/static/chunks/webpack-da78c536f3d86d06.js +1 -0
- fides/ui-build/static/admin/_next/static/css/{c693338e3bc8dcc6.css → 67ac3d00a5f134a2.css} +1 -1
- fides/ui-build/static/admin/_next/static/jg8bMUMFAG7KlEnEbTRct/_buildManifest.js +1 -0
- fides/ui-build/static/admin/add-systems/manual.html +1 -1
- fides/ui-build/static/admin/add-systems/multiple.html +1 -1
- fides/ui-build/static/admin/add-systems.html +1 -1
- fides/ui-build/static/admin/consent/configure/add-vendors.html +1 -1
- fides/ui-build/static/admin/consent/configure.html +1 -1
- fides/ui-build/static/admin/consent/privacy-experience/[id].html +1 -1
- fides/ui-build/static/admin/consent/privacy-experience/new.html +1 -1
- fides/ui-build/static/admin/consent/privacy-experience.html +1 -1
- fides/ui-build/static/admin/consent/privacy-notices/[id].html +1 -1
- fides/ui-build/static/admin/consent/privacy-notices/new.html +1 -1
- fides/ui-build/static/admin/consent/privacy-notices.html +1 -1
- fides/ui-build/static/admin/consent/properties.html +1 -1
- fides/ui-build/static/admin/consent/reporting.html +1 -1
- fides/ui-build/static/admin/consent.html +1 -1
- fides/ui-build/static/admin/data-catalog/[systemId]/projects/[projectUrn]/[resourceUrn].html +1 -1
- fides/ui-build/static/admin/data-catalog/[systemId]/projects/[projectUrn].html +1 -1
- fides/ui-build/static/admin/data-catalog/[systemId]/projects.html +1 -1
- fides/ui-build/static/admin/data-catalog/[systemId]/resources/[resourceUrn].html +1 -1
- fides/ui-build/static/admin/data-catalog/[systemId]/resources.html +1 -1
- fides/ui-build/static/admin/data-catalog.html +1 -1
- fides/ui-build/static/admin/data-discovery/action-center/[monitorId]/[systemId].html +1 -1
- fides/ui-build/static/admin/data-discovery/action-center/[monitorId].html +1 -1
- fides/ui-build/static/admin/data-discovery/action-center.html +1 -1
- fides/ui-build/static/admin/data-discovery/activity.html +1 -1
- fides/ui-build/static/admin/data-discovery/detection/[resourceUrn].html +1 -1
- fides/ui-build/static/admin/data-discovery/detection.html +1 -1
- fides/ui-build/static/admin/data-discovery/discovery/[resourceUrn].html +1 -1
- fides/ui-build/static/admin/data-discovery/discovery.html +1 -1
- fides/ui-build/static/admin/datamap.html +1 -1
- fides/ui-build/static/admin/dataset/[datasetId]/[collectionName]/[...subfieldNames].html +1 -1
- fides/ui-build/static/admin/dataset/[datasetId]/[collectionName].html +1 -1
- fides/ui-build/static/admin/dataset/[datasetId].html +1 -1
- fides/ui-build/static/admin/dataset/new.html +1 -1
- fides/ui-build/static/admin/dataset.html +1 -1
- fides/ui-build/static/admin/datastore-connection/[id].html +1 -1
- fides/ui-build/static/admin/datastore-connection/new.html +1 -1
- fides/ui-build/static/admin/datastore-connection.html +1 -1
- fides/ui-build/static/admin/index.html +1 -1
- fides/ui-build/static/admin/integrations/[id].html +1 -1
- fides/ui-build/static/admin/integrations.html +1 -1
- fides/ui-build/static/admin/lib/fides-headless.js +1 -1
- fides/ui-build/static/admin/lib/fides-preview.js +1 -1
- fides/ui-build/static/admin/lib/fides-tcf.js +2 -2
- fides/ui-build/static/admin/lib/fides.js +2 -2
- fides/ui-build/static/admin/login/[provider].html +1 -1
- fides/ui-build/static/admin/login.html +1 -1
- fides/ui-build/static/admin/messaging/[id].html +1 -1
- fides/ui-build/static/admin/messaging/add-template.html +1 -1
- fides/ui-build/static/admin/messaging.html +1 -1
- fides/ui-build/static/admin/poc/ant-components.html +1 -1
- fides/ui-build/static/admin/poc/form-experiments/AntForm.html +1 -1
- fides/ui-build/static/admin/poc/form-experiments/FormikAntFormItem.html +1 -1
- fides/ui-build/static/admin/poc/form-experiments/FormikControlled.html +1 -1
- fides/ui-build/static/admin/poc/form-experiments/FormikField.html +1 -1
- fides/ui-build/static/admin/poc/form-experiments/FormikSpreadField.html +1 -1
- fides/ui-build/static/admin/poc/forms.html +1 -1
- fides/ui-build/static/admin/poc/table-migration.html +1 -1
- fides/ui-build/static/admin/privacy-requests/[id].html +1 -1
- fides/ui-build/static/admin/privacy-requests/configure/messaging.html +1 -1
- fides/ui-build/static/admin/privacy-requests/configure/storage.html +1 -1
- fides/ui-build/static/admin/privacy-requests/configure.html +1 -1
- fides/ui-build/static/admin/privacy-requests.html +1 -1
- fides/ui-build/static/admin/properties/[id].html +1 -1
- fides/ui-build/static/admin/properties/add-property.html +1 -1
- fides/ui-build/static/admin/properties.html +1 -1
- fides/ui-build/static/admin/reporting/datamap.html +1 -1
- fides/ui-build/static/admin/settings/about/alpha.html +1 -1
- fides/ui-build/static/admin/settings/about.html +1 -1
- fides/ui-build/static/admin/settings/consent/[configuration_id]/[purpose_id].html +1 -1
- fides/ui-build/static/admin/settings/consent.html +1 -1
- fides/ui-build/static/admin/settings/custom-fields.html +1 -1
- fides/ui-build/static/admin/settings/domain-records.html +1 -1
- fides/ui-build/static/admin/settings/domains.html +1 -1
- fides/ui-build/static/admin/settings/email-templates.html +1 -1
- fides/ui-build/static/admin/settings/locations.html +1 -1
- fides/ui-build/static/admin/settings/organization.html +1 -1
- fides/ui-build/static/admin/settings/regulations.html +1 -1
- fides/ui-build/static/admin/systems/configure/[id]/test-datasets.html +1 -1
- fides/ui-build/static/admin/systems/configure/[id].html +1 -1
- fides/ui-build/static/admin/systems.html +1 -1
- fides/ui-build/static/admin/taxonomy.html +1 -1
- fides/ui-build/static/admin/user-management/new.html +1 -1
- fides/ui-build/static/admin/user-management/profile/[id].html +1 -1
- fides/ui-build/static/admin/user-management.html +1 -1
- fides/ui-build/static/admin/_next/static/chunks/1100-d43cb04522a6505c.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/2430-b480401d44c55416.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/3505-a79256cd851dfab4.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/3513-8677ee280eaef0da.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/3670-2abd9b2f17770872.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/3983-17ae9c232bddc413.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/4060-71cd041e5a57ca5a.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/4121-78a76e980acbd539.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/4481-f597a7cf03f8c9e1.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/6060-cb1ab5be7067bf7b.js +0 -4
- fides/ui-build/static/admin/_next/static/chunks/6277-3fb4c7fc790a6d20.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/6659-b2088f525bf13c17.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/6662-6a6b90fc8f11558f.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/69-6889d6674c95e7b5.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/7553-a95939c32d54b5b7.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/8433-adb1fcb29d82f1b7.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/9767-e49b065d03ce4e80.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/c78d26b1-88a3e1bacb2a03c2.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/add-systems-587e21d14e0a5196.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/dataset/new-d4e31a1c4a58800e.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/datastore-connection-8f9b8890018e1ea5.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/integrations-adc286ff254e7f41.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/poc/table-migration-7a17dffa515e5560.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/privacy-requests/[id]-91dd0039cc2b70bc.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/privacy-requests/configure/messaging-b01cbbaac34dadbc.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/privacy-requests/configure/storage-a15410de7f1d0f84.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/privacy-requests-c4e1b69fb5bab61a.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/settings/consent-7796fbf458f8f159.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/settings/domains-5d00e1155bd11178.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/settings/email-templates-d2cdbe770683e9df.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/settings/organization-24108f615ff5e1e7.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/systems/configure/[id]/test-datasets-fef247a87baeb080.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/pages/taxonomy-18534d2a79a3850b.js +0 -1
- fides/ui-build/static/admin/_next/static/chunks/webpack-0a61b5bd21a41fe6.js +0 -1
- fides/ui-build/static/admin/_next/static/hCJxUAFBWobWrps6RkP0K/_buildManifest.js +0 -1
- {ethyca_fides-2.64.1rc0.dist-info → ethyca_fides-2.64.2b0.dist-info}/WHEEL +0 -0
- {ethyca_fides-2.64.1rc0.dist-info → ethyca_fides-2.64.2b0.dist-info}/entry_points.txt +0 -0
- {ethyca_fides-2.64.1rc0.dist-info → ethyca_fides-2.64.2b0.dist-info}/licenses/LICENSE +0 -0
- {ethyca_fides-2.64.1rc0.dist-info → ethyca_fides-2.64.2b0.dist-info}/top_level.txt +0 -0
- /fides/ui-build/static/admin/_next/static/{hCJxUAFBWobWrps6RkP0K → jg8bMUMFAG7KlEnEbTRct}/_ssgManifest.js +0 -0
@@ -1 +1 @@
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3450],{30454:function(e,s,t){var a=t(40699);e.exports=function(e){return a(e,5)}},77867:function(e,s,t){"use strict";var a=t(24246),i=t(62051);s.Z=e=>{let{connected:s,...t}=e,n="red.500";return null==s?n="gray.300":s&&(n="green.500"),(0,a.jsx)(i.xuv,{width:"12px",height:"12px",borderRadius:"6px",backgroundColor:n,...t})}},59301:function(e,s,t){"use strict";var a=t(24246);let{Link:i}=t(62051).AntTypography;s.Z=e=>(0,a.jsx)(i,{target:"_blank",rel:"noopener noreferrer",...e})},77213:function(e,s,t){"use strict";t.d(s,{Z:function(){return p}});var a=t(24246),i=t(62051),n=t(88038),r=t.n(n),l=t(86677);t(27378);var o=t(25980),d=t(90867),c=t(77830),u=()=>{let e=(0,l.useRouter)();return(0,a.jsx)(i.xuv,{bg:"gray.50",border:"1px solid",borderColor:"blue.400",borderRadius:"md",justifyContent:"space-between",p:5,mb:5,mt:5,children:(0,a.jsxs)(i.xuv,{children:[(0,a.jsxs)(i.Kqy,{direction:{base:"column",sm:"row"},justifyContent:"space-between",children:[(0,a.jsx)(i.xvT,{fontWeight:"semibold",children:"Configure your storage and messaging provider"}),(0,a.jsx)(i.wpx,{onClick:()=>{e.push(c.fz)},children:"Configure"})]}),(0,a.jsxs)(i.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:s,title:t,padded:n=!0,mainProps:c}=e,p=(0,o.hz)(),m=(0,l.useRouter)(),h="/privacy-requests"===m.pathname||"/datastore-connection"===m.pathname,x=!(p.flags.privacyRequestsConfiguration&&h),{data:g}=(0,d.JE)(void 0,{skip:x}),{data:y}=(0,d.PW)(void 0,{skip:x}),f=p.flags.privacyRequestsConfiguration&&(!g||!y)&&h;return(0,a.jsxs)(i.kCb,{"data-testid":t,direction:"column",h:"100vh",children:[(0,a.jsxs)(r(),{children:[(0,a.jsxs)("title",{children:["Fides Admin UI - ",t]}),(0,a.jsx)("meta",{name:"description",content:"Privacy Engineering Platform"}),(0,a.jsx)("link",{rel:"icon",href:"/favicon.ico"})]}),(0,a.jsxs)(i.kCb,{as:"main",direction:"column",py:n?6:0,px:n?10:0,h:n?"calc(100% - 48px)":"full",flex:1,minWidth:0,overflow:"auto",...c,children:[f?(0,a.jsx)(u,{}):null,s]})]})}},19904:function(e,s,t){"use strict";t.d(s,{Tg:function(){return r}});var a=t(24246),i=t(16134),n=t(31793);let r=e=>(0,i.C)(n.uu).filter(s=>e.includes(s)).length>0;s.ZP=e=>{let{scopes:s,children:t}=e;return r(s)?(0,a.jsx)(a.Fragment,{children:t}):null}},83099:function(e,s,t){"use strict";var a=t(24246),i=t(79283),n=t(34929);s.Z=e=>{let{selectedTaxonomies:s,showDisabled:t=!1,...r}=e,{getDataUseDisplayNameProps:l,getDataUses:o}=(0,n.Z)(),d=(t?o():o().filter(e=>e.active)).filter(e=>!s.includes(e.fides_key)).map(e=>{let{name:s,primaryName:t}=l(e.fides_key);return{value:e.fides_key,name:s,primaryName:t,description:e.description||""}});return(0,a.jsx)(i.l,{options:d,...r})}},71248:function(e,s,t){"use strict";t.d(s,{A:function(){return o}});var a=t(24246),i=t(34090),n=t(46782),r=t(97181),l=t(40324);let o=e=>{var s,t;let{name:o,fieldSchema:d,isRequired:c,layout:u="stacked",secretsSchema:p,validate:m}=e,h=(null===(t=d.allOf)||void 0===t?void 0:null===(s=t[0])||void 0===s?void 0:s.$ref)&&d.allOf[0].$ref!==n.j?null==p?void 0:p.definitions[d.allOf[0].$ref.replace("#/definitions/","")]:void 0,x=!!(null==h?void 0:h.enum)||d.options,g="boolean"===d.type,y="integer"===d.type,f=()=>{var e;if((null===(e=d.allOf)||void 0===e?void 0:e[0].$ref)===n.j)return"Enter dataset.collection.field"};return(0,a.jsx)(i.gN,{id:o,name:o,validate:m,children:e=>{let{field:s}=e;if(x){var t,i,n;let e=null!==(n=null==h?void 0:null===(t=h.enum)||void 0===t?void 0:t.map(e=>({label:e,value:e})))&&void 0!==n?n:null===(i=d.options)||void 0===i?void 0:i.map(e=>({label:e,value:e}));return(0,a.jsx)(r.d,{name:s.name,id:s.name,label:d.title,isRequired:c,tooltip:d.description,layout:u,options:e,mode:d.multiselect?"multiple":void 0},s.name)}return g?(0,a.jsx)(r.d,{name:s.name,id:s.name,label:d.title,isRequired:c,tooltip:d.description,layout:u,options:[{label:"False",value:"false"},{label:"True",value:"true"}]},s.name):y?(0,a.jsx)(l.aJ,{...s,label:d.title,tooltip:d.description,isRequired:c,placeholder:f(),variant:u}):(0,a.jsx)(l.j0,{...s,label:d.title,tooltip:d.description,isRequired:c,type:d.sensitive?"password":"text",placeholder:f(),autoComplete:"off",color:"gray.700",variant:u})}},o)}},46782:function(e,s,t){"use strict";t.d(s,{j:function(){return n},l:function(){return r}});var a=t(30454),i=t.n(a);let n="#/definitions/FidesDatasetReference",r=e=>{let s=(e,s,t)=>{let a;return(void 0===s||""===s||void 0===s)&&(a="".concat(e," is required")),t===n&&((null==s?void 0:s.includes("."))?s.split(".").length<3&&(a="Dataset reference must include at least three parts"):a="Dataset reference must be dot delimited"),a},t=s=>{var t,a;return(null==e?void 0:null===(t=e.required)||void 0===t?void 0:t.includes(s))||(null==e?void 0:null===(a=e.properties)||void 0===a?void 0:a[s])!==void 0&&"default"in e.properties[s]};return{validateField:s,isRequiredField:t,getFieldValidation:(e,a)=>{if(t(e)||"integer"===a.type)return e=>{var t;return s(a.title,e,null===(t=a.allOf)||void 0===t?void 0:t[0].$ref)}},preprocessValues:s=>{let t=i()(s);return e&&Object.keys(e.properties).forEach(s=>{var a,i;if((null===(a=e.properties[s].allOf)||void 0===a?void 0:a[0].$ref)===n){let e=null===(i=t.secrets[s])||void 0===i?void 0:i.split(".");e&&(t.secrets[s]={dataset:e.shift(),field:e.join("."),direction:"from"})}"WebsiteSchema"!==e.title||"URL"!==e.properties[s].title||t.secrets[s].startsWith("http://")||t.secrets[s].startsWith("https://")||(t.secrets[s]="https://".concat(t.secrets[s]))}),t}}}},16220:function(e,s,t){"use strict";t.d(s,{V:function(){return n}});var a=t(25980),i=t(77830);let n=()=>({systemOrDatamapRoute:(0,a.hz)().plus?i.oG:i.So})},90111:function(e,s,t){"use strict";var a=t(24246),i=t(62051);s.Z=e=>{let{children:s,...t}=e;return(0,a.jsx)(i.xuv,{p:4,mb:4,border:"1px solid",borderColor:"gray.200",bgColor:"gray.50",borderRadius:"md",...t,children:s})}},44553:function(e,s,t){"use strict";t.d(s,{Z:function(){return g}});var a=t(24246),i=t(62051),n=t(27378),r=t(45277),l=t(16125),o=t(812),d=t(46628),c=t(20682),u=t(54427),p=t(52253),m=t(78780);let{reducer:h}=(0,u.oM)({name:"connectorTemplate",initialState:{},reducers:{}}),{useRegisterConnectorTemplateMutation:x}=m.u.injectEndpoints({endpoints:e=>({registerConnectorTemplate:e.mutation({query:e=>{let s=new FormData;return s.append("file",e),{url:"".concat(p.o4,"/register"),method:"POST",body:s}},invalidatesTags:()=>["Connection Type"]})})});var g=e=>{let{isOpen:s,onClose:t,testId:u="connector-template-modal"}=e,p=(0,l.I0)(),[m,h]=(0,n.useState)(null),g=(0,i.pmc)(),{getRootProps:y,getInputProps:f,isDragActive:_}=(0,r.uI)({onDrop:e=>{var s;if("zip"!==(null===(s=e[0].name.split(".").pop())||void 0===s?void 0:s.toLowerCase())){g((0,d.Vo)("Only zip files are allowed."));return}h(e[0])}}),[v,{isLoading:b}]=x(),{refetch:j}=(0,c.$I)({search:""},{skip:!1}),k=async()=>{if(m)try{var e;await v(m).unwrap(),g((0,d.t5)("Integration template uploaded successfully."));let{data:s}=await j();p((0,c.fP)(null!==(e=null==s?void 0:s.items)&&void 0!==e?e:[])),t()}catch(e){g((0,d.Vo)((0,o.e$)(e)))}finally{h(null)}};return(0,a.jsxs)(i.u_l,{isOpen:s,onClose:t,size:"2xl",children:[(0,a.jsx)(i.ZAr,{}),(0,a.jsxs)(i.hzk,{textAlign:"left",p:2,"data-testid":u,children:[(0,a.jsx)(i.xBx,{children:"Upload integration template"}),(0,a.jsxs)(i.fef,{children:[(0,a.jsx)(i.xvT,{fontSize:"sm",mb:4,children:"Drag and drop your integration template zip file here, or click to browse your files."}),(0,a.jsxs)(i.xuv,{...y(),bg:_?"gray.100":"gray.50",border:"2px dashed",borderColor:_?"gray.300":"gray.200",borderRadius:"md",cursor:"pointer",minHeight:"150px",display:"flex",alignItems:"center",justifyContent:"center",textAlign:"center",children:[(0,a.jsx)("input",{...f()}),m?(0,a.jsx)(i.xvT,{children:m.name}):_?(0,a.jsx)(i.xvT,{children:"Drop the file here..."}):(0,a.jsx)(i.xvT,{children:"Click or drag and drop your file here."})]}),(0,a.jsx)(i.xvT,{fontSize:"sm",mt:4,children:"An integration template zip file must include a SaaS config and dataset, but may also contain an icon (.svg) as an optional file."})]}),(0,a.jsxs)(i.mzw,{className:"flex w-full justify-end gap-2",children:[(0,a.jsx)(i.wpx,{onClick:t,"data-testid":"cancel-btn",disabled:b,children:"Cancel"}),(0,a.jsx)(i.wpx,{type:"primary",htmlType:"submit",disabled:!m||b,onClick:k,"data-testid":"submit-btn",children:"Submit"})]})]})]})}},3765:function(e,s,t){"use strict";var a=t(62051),i=t(812),n=t(46628),r=t(1315),l=t(31883);s.Z=e=>{let s=(0,a.pmc)(),[t]=(0,r.qQ)(),o=t=>!!e.privacy_declarations.find(e=>e.data_use===t.data_use&&e.name===t.name)&&(s((0,n.Vo)("A declaration already exists with that data use in this system. Please supply a different data use.")),!0),d=(e,t)=>{if((0,l.D4)(e)){let t=(0,i.e$)(e.error,"An unexpected error occurred while updating the system. Please try again.");s((0,n.Vo)(t));return}return s.closeAll(),s((0,n.t5)(t?"Data use deleted":"Data use saved")),e.data.privacy_declarations},c=async(s,a)=>{let i=s.map(e=>{var s;return{...e,name:null!==(s=e.name)&&void 0!==s?s:""}}),n={...e,privacy_declarations:i};return d(await t(n),a)};return{createDataUse:async t=>{if(!o(t))return s.closeAll(),c([...e.privacy_declarations,t])},updateDataUse:async(s,t)=>{if(!(t.id!==s.id&&o(t)))return c(e.privacy_declarations.map(e=>e.id===s.id?t:e))},deleteDataUse:async s=>c(e.privacy_declarations.filter(e=>e.id!==s.id),!0),deleteDeclarationByDataUse:async s=>c(e.privacy_declarations.filter(e=>e.data_use!==s),!0)}}},41337:function(e,s,t){"use strict";var a=t(24246),i=t(62051);t(27378);var n=t(88337),r=t(16394),l=t(14746);let o=l.Ny+l.iW.get(n.R.WEBSITE),d=e=>void 0!==e.connection_type,c=e=>void 0!==e.encoded_icon,u=e=>(null==e?void 0:e.connection_type)===n.R.WEBSITE,p=e=>(null==e?void 0:e.connection_type)===n.R.SAAS;s.Z=e=>{let{data:s,...t}=e;return(0,a.jsx)(i.Eep,{boxSize:"32px",objectFit:"cover",src:(()=>{var e,t;let a;if(c(s)&&s.encoded_icon)return"data:image/svg+xml;base64,".concat(s.encoded_icon);if(u(s)){let t=null===(e=s.secrets)||void 0===e?void 0:e.url;if(!t)return o;let a=(0,r.ge)(t);return(0,r.tl)(a,100)}if(d(s)){if(p(s)&&(null===(t=s.saas_config)||void 0===t?void 0:t.type)){let e=s.saas_config.type,t=l.LN.get(e);return t?l.Ny+t:l.Ny+l.iW.get(n.R.SAAS)}a=[...l.iW].find(e=>{let[t]=e;return s.connection_type.toString()===t.toString()})}else if(c(s)){let{identifier:e}=s;a=[...l.iW].find(s=>{let[t]=s;return t.toLowerCase()===e.toLowerCase()})}return a?l.Ny+a[1]:l.VD})(),fallbackSrc:u(s)?o:l.VD,alt:(()=>{if(d(s)){var e;return null!==(e=s.name)&&void 0!==e?e:s.key}return c(s)?s.human_readable:s})(),...t})}},73183:function(e,s,t){"use strict";var a=t(24246),i=t(62051);t(27378);var n=t(14207);s.Z=e=>{let{connection_key:s,disabled:t,name:r,access_type:l,connection_type:o,isSwitch:d}=e,{isOpen:c,onOpen:u,onClose:p}=(0,i.qY0)(),[m,h]=(0,n.XX)(),x=async()=>{await m({key:s,name:r,disabled:!t,access:l,connection_type:o}),p()},g=()=>{h.isLoading||p()};return(0,a.jsxs)(a.Fragment,{children:[d?(0,a.jsxs)(i.kCb,{justifyContent:"space-between",alignItems:"center",children:[(0,a.jsx)(i.xvT,{fontSize:"sm",children:"Enable integration"}),(0,a.jsx)(i.rAg,{className:"ml-2",checked:!t,onChange:()=>u()})]}):(0,a.jsx)(i.sNh,{_focus:{color:"complimentary.500",bg:"gray.100"},onClick:u,children:(0,a.jsx)(i.xvT,{fontSize:"sm",children:t?"Enable":"Disable"})}),(0,a.jsxs)(i.u_l,{isCentered:!0,isOpen:c,onClose:g,children:[(0,a.jsx)(i.ZAr,{}),(0,a.jsxs)(i.hzk,{children:[(0,a.jsxs)(i.xBx,{children:[t?"Enable":"Disable"," Connection"]}),(0,a.jsx)(i.olH,{}),(0,a.jsx)(i.fef,{pb:6,children:(0,a.jsx)(i.Kqy,{direction:"column",spacing:"15px",children:(0,a.jsxs)(i.xvT,{color:"gray.600",fontSize:"sm",fontWeight:"sm",lineHeight:"20px",children:[t?"Enabling":"Disabling"," a connection may impact any privacy request that is currently in progress. Do you wish to proceed?"]})})}),(0,a.jsxs)(i.mzw,{className:"flex gap-4",children:[(0,a.jsx)(i.wpx,{onClick:g,className:"w-1/2",children:"Cancel"}),(0,a.jsxs)(i.wpx,{onClick:x,loading:h.isLoading,className:"w-1/2",children:[t?"Enable":"Disable"," Connection"]})]})]})]})]})}},8627:function(e,s,t){"use strict";t.d(s,{s:function(){return l}});var a=t(24246),i=t(62051),n=t(77867),r=t(16394);let l=e=>{let{succeeded:s,timestamp:t}=e,l=t?(0,r.p6)(t):"";return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.Z,{connected:s}),(0,a.jsx)(i.xvT,{color:"gray.500",fontSize:"xs",fontWeight:"semibold",lineHeight:"16px",ml:"10px",children:t?"Last tested on ".concat(l):"This connection has not been tested yet"})]})}},27259:function(e,s,t){"use strict";var a=t(24246),i=t(62051),n=t(34090);s.Z=e=>{let{disabled:s=!1,isRequired:t=!1,label:r,placeholder:l,type:o="text",...d}=e,{id:c,autoFocus:u}=d,[p,m]=(0,n.U$)(d);return(0,a.jsxs)(i.NIc,{display:"flex",isRequired:t,isInvalid:!!(m.error&&m.touched),children:[r&&(0,a.jsx)(i.lXp,{color:"gray.900",fontSize:"14px",fontWeight:"semibold",htmlFor:c,minWidth:"150px",children:r}),(0,a.jsxs)(i.gCW,{align:"flex-start",w:"inherit",children:["number"===o&&(0,a.jsxs)(i.Y2U,{allowMouseWheel:!0,color:"gray.700",defaultValue:0,min:0,size:"sm",children:[(0,a.jsx)(i.zuI,{...p,autoComplete:"off",autoFocus:u}),(0,a.jsxs)(i.FiK,{children:[(0,a.jsx)(i.WQu,{}),(0,a.jsx)(i.Y_d,{})]})]}),"text"===o&&(0,a.jsx)(i.IIB,{...p,autoComplete:"off",autoFocus:u,color:"gray.700",isDisabled:s,placeholder:l,size:"sm"}),"textarea"===o&&(0,a.jsx)(i.gxH,{...p,autoComplete:"off",autoFocus:u,color:"gray.700",placeholder:l,resize:"none",size:"sm",value:p.value||""}),(0,a.jsx)(i.J1D,{children:m.error})]})]})}},19812:function(e,s,t){"use strict";t.d(s,{t:function(){return l}});var a=t(14047),i=t(14207),n=t(27378),r=t(41966);let l=e=>{var s,t,l;let{connectionConfig:o}=e,[d]=(0,i.S6)(),{data:c}=(0,i.Eg)(null!==(t=null==o?void 0:o.key)&&void 0!==t?t:""),u=null!==(l=null==c?void 0:null===(s=c.items)||void 0===s?void 0:s.map(e=>e.fides_key))&&void 0!==l?l:[],p=u.map(e=>({label:e,value:e})),{data:m}=(0,r.LH)({onlyUnlinkedDatasets:!0}),h=(0,n.useMemo)(()=>{var e;return null!==(e=null==m?void 0:m.map(e=>({value:e.fides_key,label:"".concat(e.name," (").concat(e.fides_key,")")||0})))&&void 0!==e?e:[]},[m]),{errorAlert:x,successAlert:g}=(0,a.V)();return{dropdownOptions:[...p,...h],initialDatasets:u,patchConnectionDatasetConfig:async function(e,s){var t,a,i;let{showSuccessAlert:n=!0}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=null!==(i=null===(t=e.dataset)||void 0===t?void 0:t.map(e=>({fides_key:e,ctl_dataset_fides_key:e})))&&void 0!==i?i:[],l=await d({connection_key:s,dataset_pairs:r}).unwrap();(null===(a=l.failed)||void 0===a?void 0:a.length)>0?x(l.failed[0].message):n&&g("Dataset successfully updated!")}}}},72774:function(e,s,t){"use strict";t.d(s,{Z:function(){return r}});var a=t(24246),i=t(62051),n=e=>{let{title:s,description:t,button:n}=e;return(0,a.jsxs)(i.Ugi,{backgroundColor:"gray.50",border:"1px solid",borderColor:"blue.400",borderRadius:"md",justifyContent:"space-between",py:4,px:6,"data-testid":"empty-state",children:[(0,a.jsx)(i.iid,{alignSelf:"start",color:"blue.400",mt:.5}),(0,a.jsxs)(i.xuv,{flexGrow:1,children:[(0,a.jsx)(i.xvT,{fontWeight:"bold",fontSize:"sm",mb:1,children:s}),(0,a.jsx)(i.xvT,{fontSize:"sm",color:"gray.600",lineHeight:"5",children:t})]}),n]})},r=()=>(0,a.jsx)(i.xuv,{mb:"6",maxW:"720px","data-testid":"locked-for-GVL-notice",children:(0,a.jsx)(n,{title:"This system is part of the TCF Global Vendor List (GVL)",description:(0,a.jsxs)(a.Fragment,{children:["As a result, the system fields are not editable as they come directly from Fides Compass and the Global Vendor List (GVL). In some cases where the legal basis has been declared to be flexible, you may update the legal basis for particular data uses."," ",(0,a.jsx)(i.rUS,{href:"https://fid.es/tcf_gvl",isExternal:!0,color:"complimentary.500",children:"For more information on the Global Vendor List, click here."})]})})})},69525:function(e,s,t){"use strict";t.d(s,{U:function(){return a}});let a=e=>{let s=e.data_categories.flatMap(e=>e.split(","));return{data_use:e.data_use,data_categories:s,features:e.features,legal_basis_for_processing:e.legal_basis_for_processing,flexible_legal_basis_for_processing:e.flexible_legal_basis_for_processing,retention_period:e.retention_period?e.retention_period:""}}},72250:function(e,s,t){"use strict";t.d(s,{Z:function(){return sH}});var a,i,n=t(24246),r=t(84720),l=t(62051),o=t(79894),d=t.n(o),c=t(86677),u=t.n(c),p=t(27378),m=t(16134),h=t(25980),x=t(45938),g=t(16220),y=t(77830),f=t(46628),_=t(26089),v=t(19904),b=t(16394),j=t(20682),k=t(41337);let w=e=>{let{connectionConfig:s}=e,t=(0,m.C)(j.pw),{data:a}=(0,j.$I)(t),i=(0,p.useMemo)(()=>(null==a?void 0:a.items)||[],[a]),[n,r]=(0,p.useState)(),l=(0,p.useMemo)(()=>[...i].sort((e,s)=>e.human_readable>s.human_readable?1:-1),[i]),o=(0,p.useMemo)(()=>{let e=new Map;return null==l||l.map(s=>e.set(s.human_readable,{value:s})),e},[l]),d=(0,p.useMemo)(()=>{var e;return(null===(e=i.find(e=>e.identifier===(null==s?void 0:s.connection_type)||(null==s?void 0:s.saas_config)&&e.identifier===(null==s?void 0:s.saas_config.type)))||void 0===e?void 0:e.type)||"ethyca"},[s,i]);return(0,p.useMemo)(()=>{let e=i.find(e=>(null==s?void 0:s.saas_config)&&e.identifier===(null==s?void 0:s.saas_config.type)||e.identifier===(null==s?void 0:s.connection_type));e&&r(e)},[s,i]),{dropDownOptions:o,selectedValue:n,setSelectedValue:r,systemType:d}};var C=e=>{var s;let{disabled:t,hasClear:a=!0,label:i,list:r,onChange:o,selectedValue:d}=e,c=(0,p.useRef)(null),[u,m]=(0,p.useState)(!1),[h,x]=(0,p.useState)(""),g=()=>{m(!1)},y=null===(s=[...r].find(e=>{let[,s]=e;return s.value.identifier===(null==d?void 0:d.identifier)}))||void 0===s?void 0:s[0],f=(0,p.useCallback)(e=>{(0===e.target.value.length||e.target.value.length>1)&&(x(e.target.value),setTimeout(()=>{var e;return null===(e=c.current)||void 0===e?void 0:e.focus()},0))},[]),_=(0,p.useMemo)(()=>(0,b.Ds)(f,100),[f]),v=(0,p.useMemo)(()=>[...r].filter(e=>e[0].toLowerCase().includes(h.toLowerCase())),[r,h]);return(0,n.jsxs)(l.v2r,{isLazy:!0,onClose:g,onOpen:()=>{m(!0)},strategy:"fixed",matchWidth:!0,children:[(0,n.jsx)(l.j2t,{"aria-label":null!=y?y:i,as:l.wpx,color:y?"complimentary.500":void 0,disabled:t,icon:(0,n.jsx)(l.mCO,{}),iconPosition:"end",className:"!bg-transparent text-left hover:bg-transparent active:bg-transparent","data-testid":"select-dropdown-btn",width:"272px",children:(0,n.jsx)(l.xvT,{noOfLines:1,style:{wordBreak:"break-all"},children:null!=y?y:i})}),u?(0,n.jsxs)(l.qyq,{id:"MENU_LIST",lineHeight:"1rem",p:"0",maxHeight:"400px",overflow:"hidden","data-testid":"select-dropdown-list",width:"272px",children:[(0,n.jsx)(l.xuv,{px:"8px",mt:2,children:(0,n.jsxs)(l.BZy,{size:"sm",children:[(0,n.jsx)(l.Z8_,{pointerEvents:"none",children:(0,n.jsx)(l.PTu,{color:"gray.300",h:"17px",w:"17px"})}),(0,n.jsx)(l.IIB,{"data-testid":"input-search-integrations",ref:c,autoComplete:"off",autoFocus:!0,borderRadius:"md",name:"search",onChange:_,placeholder:"Search integrations",size:"sm",type:"search"})]})}),a&&(0,n.jsx)(l.kCb,{borderBottom:"1px",borderColor:"gray.200",cursor:"auto",p:"8px",children:(0,n.jsx)(l.wpx,{onClick:()=>{o(void 0),x(""),g()},size:"small",children:"Clear"})}),(0,n.jsx)(l.xuv,{overflowY:"auto",maxHeight:"272px",children:v.map(e=>{let[s,t]=e;return(0,n.jsx)(l.esZ,{title:t.toolTip,placement:"rightTop",mouseEnterDelay:.5,children:(0,n.jsxs)(l.sNh,{color:d===t.value?"complimentary.500":void 0,isDisabled:t.isDisabled,onClick:()=>o(t.value),paddingTop:"10px",paddingRight:"8.5px",paddingBottom:"10px",paddingLeft:"8.5px",_focus:{bg:"gray.100"},children:[(0,n.jsx)(k.Z,{data:t.value}),(0,n.jsx)(l.xvT,{ml:2,fontSize:"0.75rem",noOfLines:1,wordBreak:"break-all",children:s})]})},s)})})]}):null]})},S=t(14047),D=t(1315),T=t(46420),A=t(84306),E=t(14207),R=t(59301),q=(0,l.IUT)({displayName:"RightArrow",viewBox:"0 0 16 16",d:"M10.7814 7.33312L7.20541 3.75712L8.14808 2.81445L13.3334 7.99979L8.14808 13.1851L7.20541 12.2425L10.7814 8.66645H2.66675V7.33312H10.7814Z"}),I=t(19812),z=e=>{let{status:s,failure_reason:t}=e;if("error"===s){let e="Connection test failed.";return t&&(e+=" ".concat(t)),(0,n.jsx)(l.xvT,{"data-testid":"toast-error-msg",children:e})}return(0,n.jsx)(l.xvT,{"data-testid":"toast-success-msg",children:"Connection test was successful"})},F=t(8627),L=t(32885),O=t(65450),Z=t(40324),W=t(34090),P=t(55484),N=t(97181),U=t(57072),V=t(39864),M=t(27259);let B=e=>{let{isSubmitting:s=!1,onCancelClick:t}=e;return(0,n.jsxs)(l.hE2,{size:"sm",spacing:"8px",variant:"outline",children:[(0,n.jsx)(l.zxk,{onClick:t,variant:"outline",children:"Cancel"}),(0,n.jsx)(l.zxk,{bg:"primary.800",color:"white",isDisabled:s,isLoading:s,loadingText:"Submitting",size:"sm",variant:"solid",type:"submit",_active:{bg:"primary.500"},_disabled:{opacity:"inherit"},_hover:{bg:"primary.400"},children:"Save"})]})};var K=e=>{let{data:s=[],isSubmitting:t=!1,onSaveClick:a,onCancel:i}=e,{isLoading:r}=(0,U.MO)(),o=(0,m.C)(V.qb),{errorAlert:d}=(0,S.V)();return r?null:(0,n.jsx)(W.J9,{enableReinitialize:!0,initialValues:{fields:s.length>0?s:[{pii_field:"",dsr_package_label:"",data_categories:[]}]},onSubmit:(e,s)=>{if(new Set(e.fields.map(e=>e.pii_field)).size<e.fields.length){d("PII Field must be unique");return}a(e,s)},validateOnBlur:!1,validateOnChange:!1,validationSchema:P.Ry({fields:P.IX().of(P.Ry().shape({pii_field:P.Z_().required("PII Field is required").min(1,"PII Field must have at least one character").max(200,"PII Field has a maximum of 200 characters").label("PII Field"),dsr_package_label:P.Z_().required("DSR Package Label is required").min(1,"DSR Package Label must have at least one character").max(200,"DSR Package Label has a maximum of 200 characters").label("DSR Package Label"),data_categories:P.IX(P.Z_()).label("Data Categories")}))}),children:e=>(0,n.jsx)(W.l0,{style:{marginTop:0},noValidate:!0,children:(0,n.jsx)(l.gCW,{align:"stretch",children:(0,n.jsx)(W.F2,{name:"fields",render:s=>{let{fields:a}=e.values;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(l.Ugi,{color:"gray.900",flex:"1",fontSize:"14px",fontWeight:"semibold",lineHeight:"20px",mb:"6px",spacing:"24px",children:[(0,n.jsx)(l.xuv,{w:"416px",children:"PII Field"}),(0,n.jsx)(l.xuv,{w:"416px",children:"DSR Package Label"}),(0,n.jsx)(l.xuv,{w:"416px",children:"Data Categories"}),(0,n.jsx)(l.xuv,{visibility:"hidden",children:(0,n.jsx)(l.lr0,{})})]}),(0,n.jsx)(l.xuv,{children:a&&a.length>0?a.map((e,t)=>(0,n.jsxs)(l.Ugi,{mt:t>0?"12px":void 0,spacing:"24px",align:"flex-start",children:[(0,n.jsx)(l.xuv,{minH:"57px",w:"416px",children:(0,n.jsx)(M.Z,{autoFocus:0===t,isRequired:!0,name:"fields.".concat(t,".pii_field")})}),(0,n.jsx)(l.xuv,{minH:"57px",w:"416px",children:(0,n.jsx)(M.Z,{isRequired:!0,name:"fields.".concat(t,".dsr_package_label")})}),(0,n.jsx)(l.xuv,{minH:"57px",w:"416px",children:(0,n.jsx)(N.d,{name:"fields.".concat(t,".data_categories"),options:o.map(e=>({value:e.fides_key,label:e.fides_key})),isRequired:!0,mode:"multiple"})}),(0,n.jsx)(l.xuv,{h:"57px",visibility:t>0?"visible":"hidden",children:(0,n.jsx)(l.lr0,{onClick:()=>s.remove(t),_hover:{cursor:"pointer"}})})]},t)):null}),(0,n.jsx)(l.xvT,{color:"complimentary.500",fontWeight:"medium",fontSize:"sm",mb:"24px !important",mt:"24px !important",onClick:()=>{s.push({pii_field:"",dsr_package_label:"",data_categories:[]})},_hover:{cursor:"pointer"},children:"Add new PII field"}),(0,n.jsx)(B,{isSubmitting:t,onCancelClick:i})]})}})})})})},H=e=>{let{connectionConfig:s}=e,t=(0,p.useRef)(!1),{successAlert:a}=(0,S.V)(),{handleError:i}=(0,S.H)(),[r,o]=(0,p.useState)(!1),[d,c]=(0,p.useState)([]),{isOpen:u,onOpen:m,onClose:h}=(0,l.qY0)(),{data:x,isFetching:g,isLoading:y,isSuccess:f}=(0,E.QV)(s?s.key:"",{skip:!s}),[_]=(0,E.jF)(),[v]=(0,E._d)(),b=async(e,t)=>{try{o(!0);let t={connection_key:s.key,body:{...e}};d.length>0?await v(t).unwrap():await _(t).unwrap(),a("DSR customization ".concat(d.length>0?"updated":"added","!"))}catch(e){i(e)}finally{o(!1)}};(0,p.useEffect)(()=>(t.current=!0,f&&x&&c(x.fields),()=>{t.current=!1}),[x,f]);let j=(0,n.jsx)(l.wpx,{disabled:!s||r,loading:r,onClick:m,children:"Customize DSR"});return(0,n.jsxs)(n.Fragment,{children:[s?j:(0,n.jsx)(l.esZ,{title:"Save an Integration first to customize the DSR",placement:"top",children:j}),(0,n.jsxs)(l.u_l,{isCentered:!0,isOpen:u,size:"lg",onClose:h,children:[(0,n.jsx)(l.ZAr,{}),(0,n.jsxs)(l.hzk,{minWidth:"775px",children:[(0,n.jsx)(l.xBx,{children:"Customize DSR"}),(0,n.jsx)(l.olH,{}),(0,n.jsx)(l.fef,{pb:6,children:(0,n.jsxs)(l.gCW,{align:"stretch",gap:"16px",children:[(0,n.jsx)(l.xuv,{color:"gray.700",fontSize:"14px",children:'Customize your PII fields to create a friendly label name for your privacy request packages. This "Package Label" is the label your user will see in their downloaded package.'}),(g||y)&&(0,n.jsx)(l.M5Y,{children:(0,n.jsx)(l.$jN,{})}),t.current&&!y?(0,n.jsx)(K,{data:d,isSubmitting:r,onSaveClick:b,onCancel:h}):null]})})]})]})]})},Y=t(98784),G=t.n(Y),$=t(71248),Q=t(46782),J=t(73183),X=t(95492),ee=e=>{let{onDelete:s,deleteResult:t}=e,{isOpen:a,onOpen:i,onClose:r}=(0,l.qY0)(),o=()=>{(!t.isLoading&&t.isSuccess||!t.isLoading&&t.isUninitialized)&&r()};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(l.LZC,{}),(0,n.jsxs)(l.kCb,{alignItems:"center",children:[(0,n.jsx)(l.xvT,{fontSize:"sm",children:"Delete integration"}),(0,n.jsx)(l.wpx,{"aria-label":"Delete integration",icon:(0,n.jsx)(X.l,{}),disabled:t.isLoading,onClick:i,className:"ml-2"})]})]}),(0,n.jsxs)(l.u_l,{isCentered:!0,isOpen:a,onClose:o,children:[(0,n.jsx)(l.ZAr,{}),(0,n.jsxs)(l.hzk,{children:[(0,n.jsx)(l.xBx,{children:"Delete integration"}),(0,n.jsx)(l.olH,{}),(0,n.jsx)(l.fef,{pb:6,children:(0,n.jsx)(l.Kqy,{direction:"column",spacing:"15px",children:(0,n.jsx)(l.xvT,{color:"gray.600",fontSize:"sm",fontWeight:"sm",lineHeight:"20px",children:"Deleting an integration may impact any privacy request that is currently in progress. Do you wish to proceed?"})})}),(0,n.jsxs)(l.mzw,{children:[(0,n.jsx)(l.wpx,{onClick:o,className:"w-1/2",children:"Cancel"}),(0,n.jsx)(l.wpx,{onClick:()=>{s()},loading:t.isLoading,type:"primary",className:"w-1/2",children:"Delete integration"})]})]})]})]})},es=t(99792);let et=(e,s)=>{let t={...e};return s&&Object.entries(s.properties).forEach(e=>{let[s,a]=e;if("secrets"in t||(t.secrets={}),"integer"===a.type)t.secrets[s]=a.default?Number(a.default):0;else{var i;t.secrets[s]=null!==(i=a.default)&&void 0!==i?i:""}}),t},ea=(e,s)=>{let t=e.replace(/[^A-Za-z0-9\-_]/g,"");return t.includes(s.identifier)||(t+="_".concat(s.identifier)),s.type===es.Z.SAAS&&(t+="_api"),t},ei=e=>{let{secretsSchema:s,defaultValues:t,isSubmitting:a=!1,isAuthorizing:i=!1,onSaveClick:r,onTestConnectionClick:o,onTestDatasetsClick:d,onAuthorizeConnectionClick:c,testButtonLabel:u="Test integration",connectionOption:p,connectionConfig:m,initialDatasets:x,datasetDropdownOptions:g,isCreatingConnectionConfig:y,onDelete:f,deleteResult:_}=e,[v,{isLoading:b,isFetching:j}]=(0,E.h2)(),{plus:k}=(0,h.hz)(),{getFieldValidation:w,preprocessValues:C}=(0,Q.l)(s),S=async(e,s)=>{Object.keys(await s.validateForm()).length>0||c(C(e))},D=async e=>{Object.keys(await e.validateForm()).length>0||o(await v(m.key))},A=(null==m?void 0:m.disabled)||!1;return(0,n.jsx)(W.J9,{enableReinitialize:!0,initialValues:(()=>{let e={...t};if(null==m?void 0:m.key){var a,i;return e.name=null!==(i=m.name)&&void 0!==i?i:"",e.description=m.description,e.instance_key=m.connection_type===T.Rj.SAAS?null===(a=m.saas_config)||void 0===a?void 0:a.fides_key:m.key,e.enabled_actions=(m.enabled_actions||[]).map(e=>e.toString()),e.secrets=m.secrets?G().cloneDeep(m.secrets):{},e.dataset=x,(null==s?void 0:s.properties)&&Object.entries(s.properties).forEach(s=>{var t;let[a,i]=s;if((null===(t=i.allOf)||void 0===t?void 0:t[0].$ref)===Q.j){let s=e.secrets[a];s&&(e.secrets[a]="".concat(s.dataset,".").concat(s.field))}}),e}return G().isEmpty(e.enabled_actions)&&(e.enabled_actions=p.supported_actions.map(e=>e.toString())),et(e,s)})(),onSubmit:(e,s)=>{r(C(e),s)},validateOnBlur:!0,children:e=>{var t;let r=!e.dirty&&(null==m?void 0:m.authorized);return(0,n.jsx)(W.l0,{children:(0,n.jsxs)(l.gCW,{align:"stretch",gap:"16px",children:[(0,n.jsxs)("div",{className:"flex flex-row",children:[m?(0,n.jsx)(J.Z,{connection_key:null==m?void 0:m.key,disabled:A,connection_type:null==m?void 0:m.connection_type,access_type:null==m?void 0:m.access,name:null!==(t=null==m?void 0:m.name)&&void 0!==t?t:m.key,isSwitch:!0}):null,m?(0,n.jsx)(ee,{onDelete:f,deleteResult:_}):null]}),!!(null==m?void 0:m.key)&&(0,n.jsx)(Z.j0,{name:"instance_key",id:"instance_key",label:"Integration identifier",isRequired:!0,disabled:!!(null==m?void 0:m.key),tooltip:"The fides_key will allow fidesops to associate dataset field references appropriately. Must be a unique alphanumeric value with no spaces (underscores allowed) to represent this integration."},"instance_key"),s?Object.entries(s.properties).map(e=>{var t;let[a,i]=e;return"advanced_settings"===a?null:(0,n.jsx)($.A,{name:"secrets.".concat(a),fieldSchema:i,isRequired:null===(t=s.required)||void 0===t?void 0:t.includes(a),secretsSchema:s,validate:w(a,i),layout:"inline"},"secrets.".concat(a))}):null,k&&(0,n.jsx)(N.d,{name:"enabled_actions",id:"enabled_actions",label:"Request types",isRequired:!0,layout:"inline",mode:"multiple",tooltip:"The request types that are supported for this integration",options:p.supported_actions.map(e=>({label:G().upperFirst(e),value:e}))},"enabled_actions"),T.Zi.DATABASE===p.type&&!y&&(0,n.jsx)(N.d,{name:"dataset",id:"dataset",tooltip:"Select datasets to associate with this integration",label:"Datasets",options:g,layout:"inline",mode:"multiple"}),(0,n.jsxs)("div",{className:"flex gap-4",children:[!p.authorization_required||r?(0,n.jsx)(l.wpx,{disabled:!(null==m?void 0:m.key)||a||_.isLoading,loading:b||j,onClick:()=>D(e),"data-testid":"test-connection-button",children:u}):null,k&&T.Zi.DATABASE===p.type&&!G().isEmpty(x)&&(0,n.jsx)(l.wpx,{onClick:()=>d(),children:"Test datasets"}),p.authorization_required&&!r?(0,n.jsx)(l.wpx,{loading:i,onClick:()=>S(e.values,e),children:"Authorize integration"}):null,p.type===T.Zi.MANUAL?(0,n.jsx)(H,{connectionConfig:m}):null,(0,n.jsx)(l.LZC,{}),(0,n.jsx)(l.wpx,{type:"primary",disabled:_.isLoading||a,loading:a,htmlType:"submit","data-testid":"save-btn",children:"Save"})]})]})})}})},en=async(e,s,t,a,i)=>{let n={description:e.description||"",instance_key:ea(a,t),saas_connector_type:t.identifier,secrets:{},...e.enabled_actions?{enabled_actions:e.enabled_actions}:{}},r={systemFidesKey:a,connectionConfig:n};return Object.entries(s.properties).forEach(s=>{r.connectionConfig.secrets[s[0]]=e.secrets[s[0]]}),await i(r).unwrap()},er=async(e,s,t,a,i)=>{var n;let r=a?a.key:ea(t,s),l={access:T.uv.WRITE,connection_type:s.type===T.Zi.SAAS?s.type:s.identifier,description:e.description,key:r,...e.enabled_actions?{enabled_actions:e.enabled_actions}:{}},o=await i({systemFidesKey:t,connectionConfigs:[l]}).unwrap();if((null===(n=o.failed)||void 0===n?void 0:n.length)>0){let e=o.failed[0].message;throw Object.assign(Error(e),{data:{detail:e}})}return o},el=async(e,s,t,a,i)=>{let n={systemFidesKey:t,secrets:{}};return(Object.entries(s.properties).forEach(s=>{s[0]in a&&e.secrets[s[0]]===a[s[0]]||(n.secrets[s[0]]=e.secrets[s[0]])}),0===Object.keys(n.secrets).length)?Promise.resolve():await i(n).unwrap()},eo=e=>{let{secretsSchema:s,systemFidesKey:t,connectionOption:a,connectionConfig:i,setSelectedConnectionOption:n}=e,{successAlert:r}=(0,A.V)(),{handleError:l}=(0,S.H)(),o=(0,m.T)(),[d,c]=(0,p.useState)(!1),[u,x]=(0,p.useState)(!1),{dropdownOptions:g,patchConnectionDatasetConfig:y,initialDatasets:f}=(0,I.t)({connectionConfig:i}),[_]=(0,E.NG)(),[v]=(0,L.IB)(),[b]=(0,E.rO)(),[j]=(0,O.Zh)(),[k]=(0,O.qd)(),[w]=(0,L.kg)(),[C,D]=(0,O._w)(),{plus:R}=(0,h.hz)(),q=(0,p.useMemo)(()=>{var e;return null!==(e=null==i?void 0:i.secrets)&&void 0!==e?e:{}},[i]),z=(0,m.C)(O.NC);return{isSubmitting:d,isAuthorizing:u,handleSubmit:async e=>{let n=!i;try{if(c(!0),a.type===T.Zi.SAAS&&n)i=(await en(e,s,a,t,R?v:_)).connection;else{let n=await er(e,a,t,i,R?w:k);i||a.type!==T.Zi.DATABASE||(i=n.succeeded[0]),a.type!==T.Zi.MANUAL&&await el(e,s,t,q,j)}i&&e.dataset&&a.type===T.Zi.DATABASE&&await y(e,i.key,{showSuccessAlert:!1}),r("Integration successfully ".concat(n?"added":"updated","!"))}catch(e){l(e)}finally{c(!1)}},handleAuthorization:async e=>{let n=!i;try{x(!0),n?i=(await en(e,s,a,t,_)).connection:await el(e,s,t,q,j);let r=await b(i.key).unwrap();x(!1),setTimeout(()=>{window.location.href=r},0)}catch(e){l(e)}finally{x(!1)}},datasetDropdownOptions:g,initialDatasets:f,handleDelete:async()=>{try{await C(t),o((0,O.db)({...z,connection_configs:null})),n(void 0),r("Integration successfully deleted!")}catch(e){l(e)}},deleteDatastoreConnectionResult:D}},ed=e=>{let{systemFidesKey:s,connectionOption:t,connectionConfig:a,setSelectedConnectionOption:i}=e,[r,o]=(0,p.useState)(),d=(0,l.pmc)(),c=t.type===T.Zi.MANUAL,{data:m}=(0,j.n3)(t.identifier,{skip:c}),{isSubmitting:h,isAuthorizing:x,handleSubmit:g,handleAuthorization:y,datasetDropdownOptions:_,initialDatasets:v,handleDelete:b,deleteDatastoreConnectionResult:k}=eo({secretsSchema:m,systemFidesKey:s,connectionOption:t,connectionConfig:a,setSelectedConnectionOption:i});return m||t.type===T.Zi.MANUAL?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(l.xuv,{borderRadius:"6px",border:"1px",borderColor:"gray.200",backgroundColor:"gray.50",fontSize:"14px",p:4,mb:4,children:[(0,n.jsxs)("div",{children:["Connect to your ",t.human_readable," environment by providing the information below. Once you have saved the form, you may test the integration to confirm that it's working correctly."]}),t.user_guide&&(0,n.jsx)("div",{style:{marginTop:"12px"},children:(0,n.jsxs)(R.Z,{href:t.user_guide,children:["View docs for help with this integration ",(0,n.jsx)(q,{})]})})]}),(0,n.jsx)(ei,{secretsSchema:m,defaultValues:{description:"",instance_key:"",name:"",dataset:[]},isSubmitting:h,isAuthorizing:x,onSaveClick:g,onTestConnectionClick:e=>{var s,t;o(e);let a=(null===(s=e.data)||void 0===s?void 0:s.test_status)==="succeeded"?"success":"error";d({...f.MA,status:a,description:(0,n.jsx)(z,{status:a,failure_reason:null===(t=e.data)||void 0===t?void 0:t.failure_reason})})},onTestDatasetsClick:()=>{u().push("/systems/configure/".concat(s,"/test-datasets"))},onAuthorizeConnectionClick:y,connectionOption:t,connectionConfig:a,datasetDropdownOptions:_,initialDatasets:v,isCreatingConnectionConfig:!a,onDelete:b,deleteResult:k}),a?(0,n.jsxs)(l.kCb,{mt:"4",justifyContent:"between",alignItems:"center",children:[r&&r.data&&void 0!==r.fulfilledTimeStamp?(0,n.jsx)(F.s,{succeeded:"succeeded"===r.data.test_status,timestamp:r.fulfilledTimeStamp}):(0,n.jsx)(F.s,{succeeded:null==a?void 0:a.last_test_succeeded,timestamp:(null==a?void 0:a.last_test_timestamp)||""}),(0,n.jsx)(l.LZC,{})]}):null]}):null};var ec=e=>{let{connectionConfigs:s,systemFidesKey:t}=e,{isOpen:a,onOpen:i,onClose:r}=(0,l.qY0)(),[o,d]=(0,p.useState)(null),{successAlert:c}=(0,S.V)(),[u,{isLoading:h}]=(0,D.qd)(),x=(0,m.C)(j.pw),{data:g}=(0,j.$I)(x),y=(0,p.useMemo)(()=>(null==g?void 0:g.items)||[],[g]),{handleError:f}=(0,S.H)(),_=()=>{h||(o&&d(null),r())},v=async()=>{try{if(o){var e;let s={...o,instance_key:o.connection_type===T.Rj.SAAS?null===(e=o.saas_config)||void 0===e?void 0:e.fides_key:o.key},a=y.find(e=>(null==o?void 0:o.saas_config)&&e.identifier===(null==o?void 0:o.saas_config.type)||e.identifier===(null==o?void 0:o.connection_type));(await er(s,a,t,o,u)).succeeded[0]&&c("Integration successfully linked!"),d(null),r()}}catch(e){f(e)}};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(l.wpx,{onClick:i,children:"Link integration"}),(0,n.jsxs)(l.u_l,{isCentered:!0,isOpen:a,size:"lg",onClose:_,children:[(0,n.jsx)(l.ZAr,{}),(0,n.jsxs)(l.hzk,{children:[(0,n.jsx)(l.xBx,{children:"Unlinked Integrations"}),(0,n.jsx)(l.olH,{}),(0,n.jsx)(l.fef,{pb:6,children:(0,n.jsxs)(l.Kqy,{direction:"column",spacing:"15px",children:[(0,n.jsx)(l.xvT,{color:"gray.600",fontSize:"sm",fontWeight:"sm",lineHeight:"20px",children:"These are all the integrations that are not linked to a system. Please select an integration to link to a system."}),(0,n.jsx)(l.xuv,{maxHeight:"350px",height:"100%",overflowY:"auto",children:s.map(e=>(0,n.jsxs)(l.kCb,{flexDirection:"row",alignItems:"center",_hover:{bg:"gray.100",color:"gray.600"},bg:(null==o?void 0:o.key)===e.key?"gray.100":"unset",color:(null==o?void 0:o.key)===e.key?"gray.600":"unset",cursor:"pointer",onClick:()=>{d(e)},className:"mb-2",children:[(0,n.jsx)(k.Z,{data:e,className:"mr-2"}),(0,n.jsx)(l.xvT,{children:e.name})]},e.key))})]})}),(0,n.jsxs)(l.mzw,{className:"flex gap-4",children:[(0,n.jsx)(l.wpx,{onClick:_,className:"w-1/2",children:"Cancel"}),(0,n.jsx)(l.wpx,{onClick:v,loading:h,disabled:!o||h,className:"w-1/2",children:"Link integration"})]})]})]})]})},eu=t(44553),ep=e=>{let{connectionConfig:s,systemFidesKey:t}=e,{dropDownOptions:a,selectedValue:i,setSelectedValue:r}=w({connectionConfig:s}),o=(0,m.C)(E.dR),{data:d}=(0,E.AZ)({...o,orphaned_from_system:!0}),[c,u]=(0,p.useState)([]);(0,p.useEffect)(()=>{d&&u(d.items)},[d]);let h=(0,l.qY0)();return(0,n.jsxs)(l.xuv,{id:"con-wrapper",px:6,children:[(0,n.jsxs)(l.kCb,{py:5,children:[(0,n.jsxs)(l.Kqy,{direction:{base:"column",lg:"row"},children:[(0,n.jsx)(C,{list:a,label:"Integration type",selectedValue:i,onChange:r,disabled:!!(s&&null!==s)}),!s&&c.length>0?(0,n.jsx)(ec,{connectionConfigs:c,systemFidesKey:t}):null,(0,n.jsx)(v.ZP,{scopes:[T.Sh.CONNECTOR_TEMPLATE_REGISTER],children:(0,n.jsx)(l.wpx,{htmlType:"submit","data-testid":"upload-btn",onClick:h.onOpen,className:"ml-2",children:"Upload integration"})})]}),(0,n.jsx)(eu.Z,{isOpen:h.isOpen,onClose:h.onClose})]}),(null==i?void 0:i.type)&&[T.Zi.DATABASE,T.Zi.DATA_CATALOG,T.Zi.SAAS,T.Zi.MANUAL,T.Zi.EMAIL].includes(i.type)?(0,n.jsx)(ed,{connectionConfig:s,connectionOption:i,setSelectedConnectionOption:r,systemFidesKey:t}):null]})},em=t(71922),eh=t(31883);let ex=e=>{let{item:s,options:t=[],onNoticeChange:a,isChild:i}=e,{external_id:r,name:o}=s,d="".concat(r,"-notice_id"),[c,,u]=(0,W.U$)(d),{setValue:p}=u;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(l.Ugi,{flexGrow:1,children:[i&&(0,n.jsx)(l.LqM,{}),(0,n.jsx)(l.lXp,{htmlFor:d,"data-testid":"consentable-item-label".concat(i?"-child":""),m:0,fontSize:"14px",fontWeight:i?"normal":"semibold",children:o})]}),(0,n.jsx)(l.WPr,{...c,id:d,allowClear:!0,placeholder:"None",options:t,onChange:e=>{p(e),a(s={...s,notice_id:e})},className:"w-full","data-testid":"consentable-item-select"})]})},eg=e=>{let{connectionKey:s,...t}=e,a=(0,l.pmc)(),{data:i,isLoading:r}=(0,L.EQ)(s),[o,{isLoading:d}]=(0,L.Am)(),c=(0,m.C)(em.Zp),u=(0,m.C)(em.G1),{data:h,isLoading:x}=(0,em.J6)({page:c,size:u}),[g,y]=(0,p.useState)(),[_,v]=(0,p.useState)([]),b=(0,p.useMemo)(()=>null==g?void 0:g.reduce((e,s)=>{var t;return s.notice_id&&(e["".concat(s.external_id,"-notice_id")]=s.notice_id),(null===(t=s.children)||void 0===t?void 0:t.length)&&s.children.forEach(s=>{s.notice_id&&(e["".concat(s.external_id,"-notice_id")]=s.notice_id)}),e},{}),[g]),j=e=>{let s=e.notice_id;if(s){let e=null==h?void 0:h.items.filter(e=>e.id===s);if(null==e?void 0:e.length){var t;let s=(null===(t=e[0].children)||void 0===t?void 0:t.map(e=>e.id))||[];return _.filter(e=>s.includes(e.value))}}return _},k=async()=>{let e=await o({connectionKey:s,consentableItems:g});(0,eh.D4)(e)?a((0,f.Vo)("Failed to save consent automation")):a({variant:"subtle",position:"top",duration:3e3,status:"success",isClosable:!0,description:(0,n.jsx)(l.xvT,{"data-testid":"toast-success-msg",children:"Your consent automation settings have been successfully saved and applied."}),title:"Settings updated"})};if((0,p.useEffect)(()=>{i&&y(i)},[i]),(0,p.useEffect)(()=>{h&&v(h.items.map(e=>({label:e.name,value:e.id})))},[h]),r||x)return(0,n.jsx)(l.xuv,{borderWidth:"1px",borderRadius:"md",...t,children:(0,n.jsx)(l.OdW,{height:"35px"})});if(!g||!g.length||!h)return null;let w=(e,s)=>{y(g.map(t=>{if(s?t.external_id===s.external_id:t.external_id===e.external_id){if(s){var a;return{...t,children:null===(a=t.children)||void 0===a?void 0:a.map(s=>s.external_id===e.external_id?e:s)}}return e}return t}))};return(0,n.jsx)(l.xuv,{borderWidth:"1px",borderRadius:"md",...t,children:(0,n.jsx)(l.UQy,{allowMultiple:!0,"data-testid":"accordion-consent-automation",children:(0,n.jsxs)(l.Qdk,{border:"none",children:[(0,n.jsxs)(l.KFZ,{children:[(0,n.jsx)(l.xuv,{as:"span",flex:"1",textAlign:"left",children:(0,n.jsx)(l.xvT,{as:"h2",fontWeight:"semibold",fontSize:"sm",children:"Consent automation"})}),(0,n.jsx)(l.XEm,{})]}),(0,n.jsxs)(l.Hk3,{p:5,fontSize:"sm","data-testid":"accordion-panel-consent-automation",children:[(0,n.jsx)(l.xvT,{mb:7,children:"Map consentable items, such as channels and subscriptions, from your integration to Fides privacy notices. This ensures that updates to consent preferences in either location remain accurate and up-to-date."}),(0,n.jsx)(W.J9,{initialValues:b||{},onSubmit:k,children:(0,n.jsxs)(W.l0,{children:[(0,n.jsx)(l.MIq,{columns:2,spacing:3,children:g.map(e=>{var s;return(0,n.jsxs)(p.Fragment,{children:[(0,n.jsx)(ex,{item:e,options:_,onNoticeChange:w}),null===(s=e.children)||void 0===s?void 0:s.map(s=>(0,n.jsx)(ex,{item:s,options:j(e),isChild:!0,onNoticeChange:s=>w(s,e)},s.external_id))]},e.external_id)})}),(0,n.jsx)(l.Ugi,{justifyContent:"flex-end",mt:3,children:(0,n.jsx)(l.wpx,{disabled:d,loading:d,type:"primary",htmlType:"submit","data-testid":"save-consent-automation",children:"Save"})})]})})]})]})})})};var ey=t(57865),ef=t(3124),e_=t.n(ef),ev=(0,l.IUT)({displayName:"NextArrow",viewBox:"0 0 12 12",d:"M6.58584 5.99999L4.11084 3.52499L4.81784 2.81799L7.99984 5.99999L4.81784 9.18199L4.11084 8.47499L6.58584 5.99999Z"}),eb=(0,l.IUT)({displayName:"PrevArrow",viewBox:"0 0 12 12",d:"M5.414 5.99999L7.889 8.47499L7.182 9.18199L4 5.99999L7.182 2.81799L7.889 3.52499L5.414 5.99999Z"});let ej=e=>{let s=new Date(e),t=navigator.language;return{formattedTime:s.toLocaleTimeString(t,{hour:"2-digit",minute:"2-digit",hour12:!0,timeZoneName:"short"}),formattedDate:s.toLocaleDateString(t,{year:"numeric",month:"long",day:"numeric"})}},ek=e=>({privacy_declarations:"data uses",ingress:"sources",egress:"destinations"})[e]||e,ew=(e,s)=>{let t=new Set([...Object.keys(e),...Object.keys(s)]),a=[],i=[],n=[];return Array.from(t).forEach(t=>{let r=ek(t),l=e[t],o=s[t];if("boolean"==typeof l||"boolean"==typeof o||"number"==typeof l||"number"==typeof o){l!==o&&n.push(r);return}!((G().isNil(l)||G().isEmpty(l))&&(G().isNil(o)||G().isEmpty(o)))&&(G().isEqual(l,o)||(G().isNil(l)||G().isEmpty(l)?a.push(r):G().isNil(o)||G().isEmpty(o)?i.push(r):n.push(r)))}),{addedFields:a,removedFields:i,changedFields:n}},eC=e=>{let{edited_by:s,before:t,after:a,created_at:i}=e,r=[],l=[],o=[];t.custom_fields||a.custom_fields?{addedFields:r,removedFields:l,changedFields:o}=ew(t.custom_fields,a.custom_fields):{addedFields:r,removedFields:l,changedFields:o}=ew(t,a);let d=[];if(r.length>0&&d.push(["added ",(0,n.jsx)("b",{children:r.join(", ")})]),l.length>0&&d.push(["removed ",(0,n.jsx)("b",{children:l.join(", ")})]),o.length>0&&d.push(["changed ",(0,n.jsx)("b",{children:o.join(", ")})]),0===d.length)return null;let c=d.pop(),u=d.length>0?(0,n.jsxs)(n.Fragment,{children:[d.map((e,s)=>(0,n.jsxs)(p.Fragment,{children:[e,s<d.length-1?", ":""]},s)),d.length>=2?", and ":" and ",c]}):c,{formattedTime:m,formattedDate:h}=ej(i);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("b",{children:s})," ",u," on ",h," at ",m]})},eS=(e,s)=>{let t=e=>e.map(e=>{let t=s.find(s=>s.fides_key===e.fides_key);return t&&t.name?t.name:e.fides_key}),a={...e.before},i={...e.after};return a.ingress&&(a.ingress=t(a.ingress)),a.egress&&(a.egress=t(a.egress)),i.ingress&&(i.ingress=t(i.ingress)),i&&i.egress&&(i.egress=t(i.egress)),{...e,before:a,after:i}},eD=(e,s)=>{if(G().isEmpty(s))return e;let t=(e,s)=>{var t,a;return null!==(a=null===(t=s.find(s=>s.value===e))||void 0===t?void 0:t.label)&&void 0!==a?a:e};return{...e,before:{...e.before,vendor_id:t(e.before.vendor_id,s)},after:{...e.after,vendor_id:t(e.after.vendor_id,s)}}},eT=e=>{let s=e.before.privacy_declarations||[],t=e.after.privacy_declarations||[],a=new Set([...s,...t].map(e=>e.data_use)),i=[],n=[];return a.forEach(e=>{let a=s.find(s=>s.data_use===e)||{data_use:"",data_categories:[]},r=t.find(s=>s.data_use===e)||{data_use:"",data_categories:[]};i.push(a),n.push(r)}),{...e,before:{...e.before,privacy_declarations:i},after:{...e.after,privacy_declarations:n}}},eA=e=>{let s={...e.before.custom_fields},t={...e.after.custom_fields};return new Set([...Object.keys(s),...Object.keys(t)]).forEach(e=>{e in s||(s[e]=null),e in t||(t[e]=null)}),{...e,before:{...e.before,custom_fields:s},after:{...e.after,custom_fields:t}}},eE=e=>{if(!e.before.privacy_declarations||!e.before.privacy_declarations[0]||!e.before.privacy_declarations[0].custom_fields)return e;let s={...e.before.privacy_declarations[0].custom_fields},t=e.after.privacy_declarations&&e.after.privacy_declarations[0]?{...e.after.privacy_declarations[0].custom_fields}:{};return new Set([...Object.keys(s),...Object.keys(t)]).forEach(e=>{e in s||(s[e]=null),e in t||(t[e]=null)}),{...e,before:{...e.before,privacy_declarations:[{...e.before.privacy_declarations[0],custom_fields:s}]},after:{...e.after,privacy_declarations:[{...e.after.privacy_declarations[0],custom_fields:t}]}}},eR=(0,p.createContext)(null),eq=()=>(0,p.useContext)(eR);var eI=e=>{let{children:s,selectedHistory:t,formType:a}=e,i=(0,p.useMemo)(()=>({selectedHistory:t,formType:a}),[t,a]);return(0,n.jsx)(eR.Provider,{value:i,children:s})},ez=t(62165),eF=t(30320),eL=e=>{let{heading:s,children:t}=e,{selectedHistory:a}=eq(),i=p.Children.toArray(t).filter(e=>{if(p.isValidElement(e)&&e.props.name){let{name:s}=e.props,t=G().get(null==a?void 0:a.before,s),i=G().get(null==a?void 0:a.after,s),n="boolean"!=typeof t&&"number"!=typeof t&&G().isEmpty(t),r="boolean"!=typeof i&&"number"!=typeof i&&G().isEmpty(i);return!n||!r}return!1});return 0===i.length?null:(0,n.jsx)(l.Kqy,{marginTop:"0px !important",children:(0,n.jsxs)(l.xuv,{maxWidth:"720px",border:"1px",borderColor:"gray.200",borderRadius:6,overflow:"visible",mt:6,children:[(0,n.jsx)(l.xuv,{backgroundColor:"gray.50",px:6,py:4,display:"flex",flexDirection:"row",alignItems:"center",borderBottom:"1px",borderColor:"gray.200",borderTopRadius:6,children:(0,n.jsx)(l.X6q,{as:"h3",size:"xs",children:s})}),(0,n.jsx)(l.Kqy,{children:i})]})})},eO=t(46238),eZ=e=>{var s;let{label:t,tooltip:a,...i}=e,{selectedHistory:r,formType:o}=eq(),[d]=(0,W.U$)(i.name),c={...d,value:null!==(s=d.value)&&void 0!==s?s:[]},u=(0,p.useRef)(null),[m,h]=(0,p.useState)(null),[x,g]=(0,p.useState)([]),[y,f]=(0,p.useState)(!1);(0,p.useEffect)(()=>{let e=G().get(null==r?void 0:r.before,i.name)||[],s=G().get(null==r?void 0:r.after,i.name)||[];f(!G().isEqual(e,s)),g(e.length>s.length?e:s)},[r,i.name]),(0,p.useEffect)(()=>{u.current&&h(u.current.offsetHeight)},[x]);let _={};return y&&(_="before"===o?{backgroundColor:"#FFF5F5",borderColor:"#E53E3E",borderTop:"1px dashed #E53E3E",borderBottom:"1px dashed #E53E3E"}:{backgroundColor:"#F0FFF4",borderColor:"#38A169",borderTop:"1px dashed #38A169",borderBottom:"1px dashed #38A169"}),(0,n.jsx)(l.NIc,{style:_,paddingLeft:4,paddingRight:4,paddingTop:3,paddingBottom:3,marginTop:"-1px !important",children:(0,n.jsxs)(l.gCW,{alignItems:"start",children:[(0,n.jsxs)(l.kCb,{alignItems:"center",children:[(0,n.jsx)(Z.__,{htmlFor:i.name,fontSize:"xs",my:0,mr:1,children:t}),(0,n.jsx)(eO.b,{label:a})]}),(0,n.jsx)(l.kCb,{wrap:"wrap",alignItems:"flex-start",ref:u,style:{minHeight:"".concat(m,"px")},children:(m?c.value:x).map((e,s)=>(0,n.jsx)(l.j8w,{color:"marble",className:"m-1",children:"object"==typeof e?e.fides_key:e},s))}),"before"===o&&y&&(0,n.jsx)("div",{style:{position:"absolute",right:"-22px",top:"50%",transform:"translateY(-50%)"},children:"→"})]})})},eW=e=>{var s;let{label:t,tooltip:a,...i}=e,{selectedHistory:r,formType:o}=eq(),[d]=(0,W.U$)(i),c={...d,value:null!==(s=d.value)&&void 0!==s?s:""},u=(0,p.useRef)(null),[m,h]=(0,p.useState)(null),[x,g]=(0,p.useState)(!1);(0,p.useEffect)(()=>{let e=G().get(null==r?void 0:r.before,i.name)||"",s=G().get(null==r?void 0:r.after,i.name)||"";g(!G().isEqual(e,s));let t=e.length>s.length?e:s;u.current&&(u.current.textContent=t,h(u.current.offsetHeight),u.current.textContent=c.value)},[r,i.name,c.value]);let y={};return x&&(y="before"===o?{backgroundColor:"#FFF5F5",borderColor:"#E53E3E",borderTop:"1px dashed #E53E3E",borderBottom:"1px dashed #E53E3E"}:{backgroundColor:"#F0FFF4",borderColor:"#38A169",borderTop:"1px dashed #38A169",borderBottom:"1px dashed #38A169"}),(0,n.jsx)(l.NIc,{style:y,paddingLeft:4,paddingRight:4,paddingTop:3,paddingBottom:3,marginTop:"-1px !important",children:(0,n.jsxs)(l.gCW,{alignItems:"start",children:[(0,n.jsxs)(l.kCb,{alignItems:"center",children:[(0,n.jsx)(Z.__,{htmlFor:i.id||i.name,fontSize:"xs",my:0,mr:1,children:t}),(0,n.jsx)(eO.b,{label:a})]}),(0,n.jsx)(l.xvT,{fontSize:"14px",ref:u,style:{height:"".concat(m,"px")},children:c.value}),"before"===o&&x&&(0,n.jsx)("div",{style:{position:"absolute",right:"-22px",top:"50%",transform:"translateY(-50%)"},children:"→"})]})})},eP=e=>{let{customFields:s={},resourceType:t}=e,{idToCustomFieldDefinition:a}=(0,eF.m)({resourceType:t}),i=e=>Array.from(a.values()).some(s=>s.name===e&&!!s.allow_list_id),r=t===T.P6.SYSTEM?"custom_fields":"privacy_declarations[0].custom_fields",l=Object.keys(s).sort();return(0,n.jsx)(eL,{heading:"Custom fields",children:l.map(e=>i(e)?(0,n.jsx)(eZ,{label:e,name:"".concat(r,".").concat(e)},e):(0,n.jsx)(eW,{label:e,name:"".concat(r,".").concat(e)},e))})},eN=e=>{let{label:s,tooltip:t,...a}=e,{selectedHistory:i,formType:r}=eq(),[o]=(0,W.U$)(a),d={...o,value:o.value},[c,u]=(0,p.useState)(!1);(0,p.useEffect)(()=>{u(G().get(null==i?void 0:i.before,a.name)!==G().get(null==i?void 0:i.after,a.name))},[i,a.name,d.value]);let m={};return c&&(m="before"===r?{backgroundColor:"#FFF5F5",borderColor:"#E53E3E",borderTop:"1px dashed #E53E3E",borderBottom:"1px dashed #E53E3E"}:{backgroundColor:"#F0FFF4",borderColor:"#38A169",borderTop:"1px dashed #38A169",borderBottom:"1px dashed #38A169"}),(0,n.jsx)(l.NIc,{style:m,paddingLeft:4,paddingRight:4,paddingTop:3,paddingBottom:3,marginTop:"-1px !important",children:(0,n.jsxs)(l.gCW,{alignItems:"start",minHeight:"46px",children:[(0,n.jsxs)(l.kCb,{alignItems:"center",children:[(0,n.jsx)(Z.__,{htmlFor:a.id||a.name,fontSize:"xs",my:0,mr:1,children:s}),(0,n.jsx)(eO.b,{label:t})]}),void 0!==d.value&&(0,n.jsx)(l.j8w,{color:"marble",className:"m-1",children:d.value?"YES":"NO"}),"before"===r&&c&&(0,n.jsx)("div",{style:{position:"absolute",right:"-22px",top:"50%",transform:"translateY(-50%)"},children:"→"})]})})},eU=e=>{let{initialValues:s}=e,t=(0,ez.hz)();return(0,n.jsx)(W.J9,{enableReinitialize:!0,initialValues:s,onSubmit:()=>{},children:()=>(0,n.jsx)(W.l0,{children:(0,n.jsxs)(l.Kqy,{children:[(0,n.jsxs)(eL,{heading:"System details",children:[t.dictionaryService?(0,n.jsx)(eW,{name:"vendor_id",label:"Vendor",tooltip:"Select the vendor that matches the system"}):null,(0,n.jsx)(eW,{name:"name",label:"System name",tooltip:"Give the system a unique, and relevant name for reporting purposes. e.g. “Email Data Warehouse”"}),(0,n.jsx)(eW,{name:"fides_key",label:"Unique ID",disabled:!0,tooltip:"An auto-generated unique ID based on the system name"}),(0,n.jsx)(eW,{name:"description",label:"Description",tooltip:"Give the system a unique, and relevant name for reporting purposes. e.g. “Email Data Warehouse”"}),(0,n.jsx)(eZ,{name:"tags",label:"System Tags",tooltip:"Are there any tags to associate with this system?"})]}),(0,n.jsx)(eL,{heading:"Dataset reference",children:(0,n.jsx)(eZ,{name:"dataset_references",label:"Dataset references",tooltip:"Is there a dataset configured for this system"})}),(0,n.jsxs)(eL,{heading:"Data processing properties",children:[(0,n.jsx)(eN,{name:"processes_personal_data",label:"This system processes personal data",tooltip:"Does this system process personal data?"}),(0,n.jsx)(eN,{name:"exempt_from_privacy_regulations",label:"This system is exempt from privacy regulations",tooltip:"Is this system exempt from privacy regulations?"}),(0,n.jsx)(eW,{name:"reason_for_exemption",label:"Reason for exemption",tooltip:"Why is this system exempt from privacy regulation?"}),(0,n.jsx)(eN,{name:"uses_profiling",label:"This system performs profiling",tooltip:"Does this system perform profiling that could have a legal effect?"}),(0,n.jsx)(eZ,{name:"legal_basis_for_profiling",label:"Legal basis for profiling",tooltip:"What is the legal basis under which profiling is performed?"}),(0,n.jsx)(eN,{name:"does_international_transfers",label:"This system transfers data",tooltip:"Does this system transfer data to other countries or international organizations?"}),(0,n.jsx)(eZ,{name:"legal_basis_for_transfers",label:"Legal basis for transfer",tooltip:"What is the legal basis under which the data is transferred?"}),(0,n.jsx)(eN,{name:"requires_data_protection_assessments",label:"This system requires Data Privacy Assessments",tooltip:"Does this system require (DPA/DPIA) assessments?"}),(0,n.jsx)(eW,{label:"DPIA/DPA location",name:"dpa_location",tooltip:"Where is the DPA/DPIA stored?"})]}),(0,n.jsxs)(eL,{heading:"Administrative properties",children:[(0,n.jsx)(eW,{label:"Data stewards",name:"data_stewards",tooltip:"Who are the stewards assigned to the system?"}),(0,n.jsx)(eW,{name:"privacy_policy",label:"Privacy policy URL",tooltip:"Where can the privacy policy be located?"}),(0,n.jsx)(eW,{name:"legal_name",label:"Legal name",tooltip:"What is the legal name of the business?"}),(0,n.jsx)(eW,{name:"legal_address",label:"Legal address",tooltip:"What is the legal address for the business?"}),(0,n.jsx)(eW,{label:"Department",name:"administrating_department",tooltip:"Which department is concerned with this system?"}),(0,n.jsx)(eZ,{label:"Responsibility",name:"responsibility",tooltip:"What is the role of the business with regard to data processing?"}),(0,n.jsx)(eW,{name:"dpo",label:"Legal contact (DPO)",tooltip:"What is the official privacy contact information?"}),(0,n.jsx)(eW,{label:"Joint controller",name:"joint_controller_info",tooltip:"Who are the party or parties that share responsibility for processing data?"}),(0,n.jsx)(eW,{label:"Data security practices",name:"data_security_practices",tooltip:"Which data security practices are employed to keep the data safe?"})]}),(0,n.jsx)(eP,{customFields:s.custom_fields,resourceType:T.P6.SYSTEM}),s.privacy_declarations&&s.privacy_declarations.map((e,t)=>(0,n.jsxs)(p.Fragment,{children:[(0,n.jsxs)(eL,{heading:"Data use",children:[(0,n.jsx)(eW,{label:"Declaration name (optional)",name:"privacy_declarations[".concat(t,"].name"),tooltip:"Would you like to append anything to the system name?"}),(0,n.jsx)(eW,{name:"privacy_declarations[".concat(t,"].data_use"),label:"Data use",tooltip:"For which business purposes is this data used?"}),(0,n.jsx)(eZ,{name:"privacy_declarations[".concat(t,"].data_categories"),label:"Data categories",tooltip:"Which categories of personal data are collected for this purpose?"}),(0,n.jsx)(eZ,{name:"privacy_declarations[".concat(t,"].data_subjects"),label:"Data subjects",tooltip:"Who are the subjects for this personal data?"}),(0,n.jsx)(eW,{name:"privacy_declarations[".concat(t,"].legal_basis_for_processing"),label:"Legal basis for processing",tooltip:"What is the legal basis under which personal data is processed for this purpose?"}),(0,n.jsx)(eW,{name:"privacy_declarations[".concat(t,"].impact_assessment_location"),label:"Impact assessment location",tooltip:"Where is the legitimate interest impact assessment stored?"}),(0,n.jsx)(eW,{name:"privacy_declarations[".concat(t,"].retention_period"),label:"Retention period (days)",tooltip:"How long is personal data retained for this purpose?"})]}),(0,n.jsx)(eL,{heading:"Features",children:(0,n.jsx)(eZ,{name:"privacy_declarations[".concat(t,"].features"),label:"Features",tooltip:"What are some features of how data is processed?"})}),(0,n.jsx)(eL,{heading:"Dataset reference",children:(0,n.jsx)(eZ,{name:"privacy_declarations[".concat(t,"].dataset_references"),label:"Dataset references",tooltip:"Is there a dataset configured for this system?"})}),(0,n.jsxs)(eL,{heading:"Special category data",children:[(0,n.jsx)(eN,{name:"privacy_declarations[".concat(t,"].processes_special_category_data"),label:"This system processes special category data",tooltip:"Is this system processing special category data as defined by GDPR Article 9?"}),(0,n.jsx)(eW,{name:"privacy_declarations[".concat(t,"].special_category_legal_basis"),label:"Legal basis for processing",tooltip:"What is the legal basis under which the special category data is processed?"})]}),(0,n.jsxs)(eL,{heading:"Third parties",children:[(0,n.jsx)(eN,{name:"privacy_declarations[".concat(t,"].data_shared_with_third_parties"),label:"This system shares data with 3rd parties for this purpose",tooltip:"Does this system disclose, sell, or share personal data collected for this business use with 3rd parties?"}),(0,n.jsx)(eW,{name:"privacy_declarations[".concat(t,"].third_parties"),label:"Third parties",tooltip:"Which type of third parties is the data shared with?"}),(0,n.jsx)(eZ,{name:"privacy_declarations[".concat(t,"].shared_categories"),label:"Shared categories",tooltip:"Which categories of personal data does this system share with third parties?"})]}),(0,n.jsx)(eP,{customFields:s.privacy_declarations[0].custom_fields,resourceType:T.P6.PRIVACY_DECLARATION})]},t)),(0,n.jsxs)(eL,{heading:"Data flow",children:[(0,n.jsx)(eZ,{name:"ingress",label:"Sources"}),(0,n.jsx)(eZ,{name:"egress",label:"Destinations"})]})]})})})};let eV=(e,s)=>{let t=[],a=new Set(["egress","ingress","privacy_declarations","vendor_id"]);(e.egress||s.egress||e.ingress||s.ingress)&&t.push("Data Flow");let i=e.privacy_declarations&&e.privacy_declarations.length>0||s.privacy_declarations&&s.privacy_declarations.length>0;i&&t.push("Data Uses");let n=[...Object.keys(e),...Object.keys(s)].some(e=>!a.has(e));return!i&&n&&t.unshift("System Information"),t};var eM=e=>{let{selectedHistory:s,isOpen:t,onClose:a}=e;return(0,n.jsxs)(l.u_l,{isOpen:t,onClose:a,size:"4xl",children:[(0,n.jsx)(l.ZAr,{}),(0,n.jsxs)(l.hzk,{children:[(0,n.jsxs)(l.xBx,{backgroundColor:e_().FIDESUI_NEUTRAL_50,borderTopLeftRadius:"8px",borderTopRightRadius:"8px",borderBottom:"1px solid #E2E8F0",children:[(0,n.jsxs)(l.X6q,{size:"xs",children:[(0,n.jsx)("span",{style:{verticalAlign:"middle"},children:"Change detail"}),s&&(0,n.jsx)(n.Fragment,{children:eV(s.before,s.after).map((e,s)=>(0,n.jsx)(l.j8w,{color:"minos",className:"ml-2",children:e},s))})]}),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(l.LZC,{}),(0,n.jsx)(l.olH,{})]})]}),(0,n.jsx)(l.fef,{paddingTop:0,paddingBottom:6,children:(0,n.jsxs)(l.kCb,{justifyContent:"space-between",children:[(0,n.jsx)("div",{style:{flex:"0 50%",marginRight:"12px"},children:(0,n.jsx)(eI,{selectedHistory:s,formType:"before",children:(0,n.jsx)(eU,{initialValues:null==s?void 0:s.before})})}),(0,n.jsx)("div",{style:{flex:"0 50%",marginLeft:"12px"},children:(0,n.jsx)(eI,{selectedHistory:s,formType:"after",children:(0,n.jsx)(eU,{initialValues:null==s?void 0:s.after})})})]})})]})]})},eB=e=>{let{system:s}=e,[t,a]=(0,p.useState)(1),{data:i}=(0,L.Xc)({system_key:s.fides_key,page:t,size:10}),[r,o]=(0,p.useState)(!1),[d,c]=(0,p.useState)(null),u=(0,m.C)(L.o),{data:h=[]}=(0,O.K3)(),x=(null==i?void 0:i.items)||[],g=e=>{c(e=eE(e=eA(e=eS(e=eD(e=eT(e),u),h)))),o(!0)},{formattedTime:y,formattedDate:f}=ej(s.created_at),_=i&&i.total?Math.ceil(i.total/10):0;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(l.iA_,{ml:"24px",children:[(0,n.jsx)(l.hrZ,{children:(0,n.jsx)(l.Tr,{children:(0,n.jsxs)(l.Td,{p:"16px",fontSize:"12px",border:"1px solid #E2E8F0",background:e_().FIDESUI_NEUTRAL_50,children:["System created on ",f," at ",y]})})}),(0,n.jsx)(l.p3B,{children:x.map((e,s)=>{let t=eC(e);return t?(0,n.jsx)(l.Tr,{onClick:()=>g(e),style:{cursor:"pointer"},children:(0,n.jsx)(l.Td,{pt:"10px",pb:"10px",pl:"16px",fontSize:"12px",border:"1px solid #E2E8F0",children:t})},s):null})})]}),((null==i?void 0:i.total)||0)>10&&(0,n.jsxs)(l.kCb,{alignItems:"center",justifyContent:"flex-start",marginTop:"12px",marginLeft:"24px",children:[(0,n.jsxs)(l.xvT,{fontSize:"xs",lineHeight:4,fontWeight:"600",paddingX:2,children:[(t-1)*10+1," -"," ",Math.min(10*t,(null==i?void 0:i.total)||0)," of"," ",(null==i?void 0:i.total)||0]}),(0,n.jsx)(l.wpx,{size:"small",className:"mr-2",onClick:()=>{t>1&&a(t-1)},disabled:1===t,icon:(0,n.jsx)(eb,{})}),(0,n.jsx)(l.wpx,{size:"small",onClick:()=>{t<_&&a(t+1)},disabled:t===_||0===_,icon:(0,n.jsx)(ev,{})})]}),(0,n.jsx)(eM,{selectedHistory:d,isOpen:r,onClose:()=>{o(!1),c(null)}})]})},eK=t(52368),eH=t(3765),eY=e=>{let{title:s,description:t,handleAdd:a}=e;return(0,n.jsx)(l.Kqy,{backgroundColor:"gray.50",border:"1px solid",borderColor:"blue.500",borderRadius:"md",justifyContent:"space-between",py:4,px:6,"data-testid":"empty-state",children:(0,n.jsxs)(l.Ugi,{children:[(0,n.jsx)(l.iid,{alignSelf:"start",color:"blue.400",mt:.5}),(0,n.jsxs)(l.xuv,{children:[(0,n.jsx)(l.xvT,{fontWeight:"bold",fontSize:"sm",mb:1,children:s}),(0,n.jsx)(l.xvT,{fontSize:"sm",color:"gray.800",lineHeight:"5",children:t}),(0,n.jsx)(l.Ugi,{mt:4,children:(0,n.jsx)(l.wpx,{size:"small",type:"primary","data-testid":"add-btn",onClick:a,icon:(0,n.jsx)(l.jBn,{boxSize:4}),iconPosition:"end",children:"Add data use"})})]})]})})},eG=t(58452);let e$=e=>{let{declaration:s,title:t,handleDelete:a,handleEdit:i}=e,{isOpen:r,onOpen:o,onClose:d}=(0,l.qY0)();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(l.fGe,{w:"100%",h:"100%",cursor:"pointer",_hover:{backgroundColor:"gray.50"},children:(0,n.jsx)(l.xuv,{px:6,py:4,"data-testid":"row-".concat(s.data_use),children:(0,n.jsxs)(l.Ugi,{children:[(0,n.jsx)(l.AB5,{onClick:()=>i(s),role:"button",tabIndex:0,children:(0,n.jsx)(l.xvT,{children:t||s.data_use})}),(0,n.jsx)(l.LZC,{}),a?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(l.wpx,{"aria-label":"delete-declaration",className:"z-[2]",onClick:o,"data-testid":"delete-btn",children:(0,n.jsx)(l.pJl,{})}),(0,n.jsx)(eG.Z,{isOpen:r,onClose:d,onConfirm:()=>a(s),title:"Delete data use declaration",message:(0,n.jsxs)(l.xvT,{children:["You are about to delete the data use declaration"," ",(0,n.jsx)(l.xvT,{color:"complimentary.500",as:"span",fontWeight:"bold",children:t||s.data_use}),", including all its cookies. Are you sure you want to continue?"]}),isCentered:!0})]}):null]})})}),(0,n.jsx)(l.izJ,{})]})},eQ=e=>{let{heading:s,children:t,headerButton:a,footerButton:i}=e;return(0,n.jsx)(l.Kqy,{spacing:4,"data-testid":"privacy-declarations-table",children:(0,n.jsxs)(l.xuv,{maxWidth:"720px",border:"1px",borderColor:"gray.200",borderRadius:6,children:[(0,n.jsxs)(l.Ugi,{backgroundColor:"gray.50",px:6,py:4,borderBottom:"1px",borderColor:"gray.200",borderTopRadius:6,children:[(0,n.jsx)(l.X6q,{as:"h3",size:"xs",children:s}),(0,n.jsx)(l.LZC,{}),a||null]}),(0,n.jsx)(l.Kqy,{spacing:0,children:t}),(0,n.jsx)(l.xuv,{backgroundColor:"gray.50",px:6,py:4,borderBottomRadius:6,children:i||null})]})})},eJ=e=>{let{heading:s,declarations:t,handleAdd:a,handleDelete:i,handleEdit:r,allDataUses:o}=e,d=e=>{let s=o.filter(s=>s.fides_key===e.data_use)[0];return s?e.name?"".concat(s.name," - ").concat(e.name):s.name:""},c=(0,m.C)(ey.gU);return(0,n.jsx)(eQ,{heading:s,footerButton:c?null:(0,n.jsx)(l.wpx,{onClick:a,size:"small",icon:(0,n.jsx)(l.jBn,{boxSize:4}),iconPosition:"end","data-testid":"add-btn",children:"Add data use"}),children:t.map(e=>(0,n.jsx)(e$,{declaration:e,title:d(e),handleDelete:c?void 0:i,handleEdit:r},e.id))})};var eX=t(95346),e0=t(54748),e1=t(28325),e2=t(30234);let e4=P.Ry().shape({data_categories:P.IX(P.Z_()).min(1,"Must assign at least one data category").label("Data categories"),data_use:P.Z_().required().label("Data use")}),e5={name:"",data_categories:[],data_use:"",data_subjects:[],egress:void 0,ingress:void 0,features:[],legal_basis_for_processing:void 0,flexible_legal_basis_for_processing:!0,impact_assessment_location:"",retention_period:"",processes_special_category_data:!1,special_category_legal_basis:void 0,data_shared_with_third_parties:!1,third_parties:"",shared_categories:[],customFieldValues:{},id:""},e6=e=>{var s;return{...e,name:null!==(s=e.name)&&void 0!==s?s:"",special_category_legal_basis:e.processes_special_category_data?e.special_category_legal_basis:void 0,third_parties:e.data_shared_with_third_parties?e.third_parties:void 0,shared_categories:e.data_shared_with_third_parties?e.shared_categories:void 0}},e3=e=>{let{allDataUses:s,allDataCategories:t,allDataSubjects:a,allDatasets:i,values:r,includeCustomFields:o,privacyDeclarationId:d,lockedForGVL:c}=e,u=!!d,{legalBasisOptions:m}=(0,e0.Z)(),{specialCategoryLegalBasisOptions:h}=(0,e1.Z)(),x=(0,p.useMemo)(()=>i?i.map(e=>({value:e.fides_key,label:e.name?e.name:e.fides_key})):[],[i]);return(0,n.jsxs)(l.Kqy,{spacing:4,children:[(0,n.jsxs)(e2.Z,{heading:"Data use declaration",children:[(0,n.jsx)(Z.j0,{id:"name",label:"Declaration name (optional)",name:"name",tooltip:"Would you like to append anything to the system name?",disabled:u||c,variant:"stacked"}),(0,n.jsx)(N.d,{id:"data_use",label:"Data use",name:"data_use",options:s.map(e=>({value:e.fides_key,label:e.fides_key})),tooltip:"For which business purposes is this data processed?",layout:"stacked",isRequired:!0,disabled:u||c}),(0,n.jsx)(N.d,{name:"data_categories",label:"Data categories",options:t.map(e=>({value:e.fides_key,label:e.fides_key})),tooltip:"Which categories of personal data are collected for this purpose?",mode:"multiple",isRequired:!0,disabled:c,layout:"stacked"}),(0,n.jsx)(N.d,{name:"data_subjects",label:"Data subjects",options:a.map(e=>({value:e.fides_key,label:e.fides_key})),tooltip:"Who are the subjects for this personal data?",mode:"multiple",disabled:c,layout:"stacked"}),(0,n.jsxs)(l.Kqy,{spacing:0,children:[(0,n.jsx)(N.d,{name:"legal_basis_for_processing",label:"Legal basis for processing",options:m,tooltip:"What is the legal basis under which personal data is processed for this purpose?",layout:"stacked",disabled:c}),(0,n.jsx)(l.UO1,{in:"Legitimate interests"===r.legal_basis_for_processing,animateOpacity:!0,style:{overflow:"visible"},children:(0,n.jsx)(l.xuv,{mt:4,children:(0,n.jsx)(Z.j0,{name:"impact_assessment_location",label:"Impact assessment location",tooltip:"Where is the legitimate interest impact assessment stored?",variant:"stacked",disabled:c})})})]}),(0,n.jsx)(l.xuv,{mt:5,pl:4,children:(0,n.jsx)(Z.w8,{name:"flexible_legal_basis_for_processing",label:"This legal basis is flexible",tooltip:"Has the vendor declared that the legal basis may be overridden?",variant:"stacked",isDisabled:c})}),(0,n.jsx)(Z.j0,{name:"retention_period",label:"Retention period (days)",tooltip:"How long is personal data retained for this purpose?",variant:"stacked",disabled:c})]}),(0,n.jsx)(e2.Z,{heading:"Features",children:(0,n.jsx)(N.d,{name:"features",label:"Features",placeholder:"Describe features...",tooltip:"What are some features of how data is processed?",layout:"stacked",disabled:c,mode:"tags"})}),(0,n.jsx)(e2.Z,{heading:"Dataset reference",children:(0,n.jsx)(N.d,{name:"dataset_references",label:"Dataset references",options:x,tooltip:"Is there a dataset configured for this system?",mode:"multiple",layout:"stacked",disabled:c})}),(0,n.jsx)(e2.Z,{heading:"Special category data",children:(0,n.jsxs)(l.Kqy,{spacing:0,children:[(0,n.jsx)(Z.w8,{name:"processes_special_category_data",label:"This system processes special category data",tooltip:"Is this system processing special category data as defined by GDPR Article 9?",variant:"stacked",isDisabled:c}),(0,n.jsx)(l.UO1,{in:r.processes_special_category_data,animateOpacity:!0,style:{overflow:"visible"},children:(0,n.jsx)(l.xuv,{mt:4,children:(0,n.jsx)(N.d,{name:"special_category_legal_basis",label:"Legal basis for processing",options:h,isRequired:r.processes_special_category_data,tooltip:"What is the legal basis under which the special category data is processed?",layout:"stacked",disabled:c})})})]})}),(0,n.jsx)(e2.Z,{heading:"Third parties",children:(0,n.jsxs)(l.Kqy,{spacing:0,children:[(0,n.jsx)(Z.w8,{name:"data_shared_with_third_parties",label:"This system shares data with 3rd parties for this purpose",tooltip:"Does this system disclose, sell, or share personal data collected for this business use with 3rd parties?",variant:"stacked",isDisabled:c}),(0,n.jsx)(l.UO1,{in:r.data_shared_with_third_parties,animateOpacity:!0,style:{overflow:"visible"},children:(0,n.jsxs)(l.Kqy,{mt:4,spacing:4,children:[(0,n.jsx)(Z.j0,{name:"third_parties",label:"Third parties",tooltip:"Which type of third parties is the data shared with?",variant:"stacked",disabled:c}),(0,n.jsx)(N.d,{name:"shared_categories",label:"Shared categories",options:t.map(e=>({value:e.fides_key,label:e.fides_key})),tooltip:"Which categories of personal data does this system share with third parties?",layout:"stacked",mode:"multiple",disabled:c})]})})]})}),o?(0,n.jsx)(eX.uc,{resourceType:T.P6.PRIVACY_DECLARATION,resourceFidesKey:d}):null]})},e8=(e,s)=>e?{...e,customFieldValues:s||{}}:e5,e7=e=>{let{onSubmit:s,initialValues:t,privacyDeclarationId:a}=e,{customFieldValues:i,upsertCustomFields:n}=(0,eX.mZ)({resourceType:T.P6.PRIVACY_DECLARATION,resourceFidesKey:a});return{handleSubmit:async(e,t)=>{let{customFieldValues:a}=e,i=e6(e),r=await s(i,t);if(r){let s=r.filter(s=>s.data_use===e.data_use&&(!s.name||s.name===e.name));s.length>0&&await n({customFieldValues:a,fides_key:s[0].id})}},initialValues:(0,p.useMemo)(()=>e8(t,i),[t,i])}},e9=e=>{let{onSubmit:s,onCancel:t,initialValues:a,...i}=e,r=null==a?void 0:a.id,{handleSubmit:o,initialValues:d}=e7({onSubmit:s,onCancel:t,initialValues:a,allDataUses:i.allDataUses,privacyDeclarationId:r}),c=(0,m.C)(ey.gU);return(0,n.jsx)(W.J9,{enableReinitialize:!0,initialValues:d,onSubmit:o,validationSchema:e4,children:e=>{let{dirty:s,values:a}=e;return(0,n.jsxs)(W.l0,{"data-testid":"declaration-form",children:[(0,n.jsx)(x.Gt,{id:"PrivacyDeclaration",name:"New Privacy Declaration"}),(0,n.jsxs)(l.Kqy,{spacing:4,children:[(0,n.jsx)(e3,{values:a,lockedForGVL:c,privacyDeclarationId:r,...i}),(0,n.jsxs)(l.kCb,{w:"100%",children:[(0,n.jsx)(l.wpx,{onClick:t,"data-testid":"cancel-btn",children:"Cancel"}),c?null:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(l.LZC,{}),(0,n.jsx)(l.wpx,{type:"primary",htmlType:"submit",disabled:!s,"data-testid":"save-btn",children:"Save"})]})]})]})]})}})},se=e=>{let{isOpen:s,onClose:t,heading:a,isCentered:i=!1,testId:r="privacy-declaration-modal",children:o}=e;return(0,n.jsxs)(l.u_l,{isOpen:s,onClose:t,isCentered:i,scrollBehavior:"inside",size:"3xl",children:[(0,n.jsx)(l.ZAr,{}),(0,n.jsxs)(l.hzk,{textAlign:"left",p:0,"data-testid":r,children:[(0,n.jsx)(l.xBx,{p:0,children:(0,n.jsx)(l.xuv,{backgroundColor:"gray.50",px:6,py:4,border:"1px",borderColor:"gray.200",borderTopRadius:6,children:(0,n.jsx)(l.X6q,{as:"h3",size:"sm",children:a})})}),(0,n.jsx)(l.fef,{pb:4,children:o})]})]})};var ss=e=>{let{system:s,includeCustomFields:t,...a}=e,{isOpen:i,onClose:r,onOpen:o}=(0,l.qY0)(),[d,c]=(0,p.useState)(void 0),{createDataUse:u,updateDataUse:m,deleteDataUse:h}=(0,eH.Z)(s),x=()=>{r(),c(void 0)},g=()=>{o(),c(void 0)},y=async e=>(x(),d)?m(d,e):u(e);return(0,p.useEffect)(()=>{r()},[r,s.fides_key]),(0,n.jsxs)(l.Kqy,{spacing:6,"data-testid":"data-use-tab",children:[0===s.privacy_declarations.length?(0,n.jsx)(eY,{title:"You don't have a data use set up for this system yet.",description:'A Data Use is the purpose for which data is used in a system. In Fides, a system may have more than one Data Use. For example, a CRM system may be used both for "Customer Support" and also for "Email Marketing", each of these is a Data Use.',handleAdd:g}):(0,n.jsx)(eJ,{heading:"Data use",declarations:s.privacy_declarations,handleAdd:g,handleEdit:e=>{o(),c(e)},handleDelete:h,allDataUses:a.allDataUses}),(0,n.jsx)(se,{isOpen:i,onClose:x,heading:"Configure data use",children:(0,n.jsx)(e9,{initialValues:d,onSubmit:y,onCancel:x,includeCustomFields:t,...a})})]})},st=e=>{let{system:s}=e,{isLoading:t,...a}=(0,eK.f)({includeDatasets:!0,includeDisabled:!1}),i=a.allDataCategories.filter(e=>e.active),r=a.allDataUses.filter(e=>e.active),o=a.allDataSubjects.filter(e=>e.active),c={...a,allDataCategories:i,allDataUses:r,allDataSubject:o};return(0,n.jsxs)(l.Kqy,{spacing:3,"data-testid":"privacy-declaration-step",minWidth:580,children:[(0,n.jsx)(l.X6q,{as:"h3",size:"md",children:"Data uses"}),(0,n.jsxs)(l.xvT,{fontSize:"sm",fontWeight:"medium",children:["Data Uses describe the business purpose for which the personal data is processed or collected. Within a Data Use, you assign which categories of personal information are collected for this purpose and for which categories of data subjects. To update the available categories and uses, please visit"," ",(0,n.jsx)(l.rUS,{as:d(),href:"/taxonomy",color:"link.900",children:"Manage taxonomy"}),"."]}),t?(0,n.jsx)(l.$jN,{}):(0,n.jsx)(ss,{system:s,includeCustomFields:!0,...c})]})},sa=t(812),si=t(93237),sn=t(69525),sr=t(33335);let sl={system_type:"",fides_key:"",tags:[],name:"",description:"",dataset_references:[],processes_personal_data:!0,exempt_from_privacy_regulations:!1,reason_for_exemption:"",uses_profiling:!1,does_international_transfers:!1,requires_data_protection_assessments:!1,privacy_policy:"",legal_name:"",legal_address:"",administrating_department:"",responsibility:[],joint_controller_info:"",data_security_practices:"",privacy_declarations:[],data_stewards:"",dpo:"",cookie_max_age_seconds:void 0,uses_cookies:!1,cookie_refresh:!1,uses_non_cookie_access:!1,legitimate_interest_disclosure_url:""},so=(e,s)=>{var t;let a=null==e?void 0:null===(t=e.data_stewards)||void 0===t?void 0:t.map(e=>e.username).join(", ");return{...e,customFieldValues:s,description:e.description?e.description:"",legal_address:e.legal_address?e.legal_address:"",dpo:e.dpo?e.dpo:"",cookie_max_age_seconds:e.cookie_max_age_seconds?e.cookie_max_age_seconds:"",legitimate_interest_disclosure_url:e.legitimate_interest_disclosure_url?e.legitimate_interest_disclosure_url:"",vendor_deleted_date:e.vendor_deleted_date?e.vendor_deleted_date:void 0,privacy_policy:e.privacy_policy?e.privacy_policy:"",data_security_practices:e.data_security_practices?e.data_security_practices:"",legal_basis_for_profiling:e.legal_basis_for_profiling?e.legal_basis_for_profiling:"",legal_basis_for_transfers:e.legal_basis_for_transfers?e.legal_basis_for_transfers:"",data_stewards:a}},sd=e=>{let s=e.fides_key?e.fides_key:(0,sr.E)(e.name),t=""===e.privacy_policy?void 0:e.privacy_policy,a={system_type:e.system_type,fides_key:s,name:e.name,description:e.description?e.description:"",dataset_references:e.dataset_references,tags:e.tags,processes_personal_data:e.processes_personal_data,exempt_from_privacy_regulations:e.exempt_from_privacy_regulations,reason_for_exemption:e.exempt_from_privacy_regulations?e.reason_for_exemption:void 0,privacy_declarations:e.processes_personal_data?e.privacy_declarations:[],vendor_id:e.vendor_id,ingress:e.ingress,egress:e.egress,meta:e.meta,fidesctl_meta:e.fidesctl_meta,organization_fides_key:e.organization_fides_key,dpa_progress:e.dpa_progress,previous_vendor_id:e.previous_vendor_id,cookie_max_age_seconds:e.cookie_max_age_seconds?e.cookie_max_age_seconds:void 0,uses_cookies:e.uses_cookies,cookie_refresh:e.cookie_refresh,uses_non_cookie_access:e.uses_non_cookie_access,legitimate_interest_disclosure_url:e.legitimate_interest_disclosure_url?e.legitimate_interest_disclosure_url:void 0,vendor_deleted_date:e.vendor_deleted_date?e.vendor_deleted_date:void 0};return e.processes_personal_data&&(a={...a,dataset_references:e.dataset_references,uses_profiling:e.uses_profiling,legal_basis_for_profiling:e.uses_profiling?e.legal_basis_for_profiling:void 0,does_international_transfers:e.does_international_transfers,legal_basis_for_transfers:e.does_international_transfers?e.legal_basis_for_transfers:void 0,requires_data_protection_assessments:e.requires_data_protection_assessments,dpa_location:e.requires_data_protection_assessments?e.dpa_location:void 0,privacy_policy:t,legal_name:e.legal_name,legal_address:e.legal_address,responsibility:e.responsibility,dpo:e.dpo,data_security_practices:e.data_security_practices},e.administrating_department&&(a.administrating_department=e.administrating_department),e.joint_controller_info&&(a.joint_controller_info=e.joint_controller_info)),a},{useGetSystemAssetsQuery:sc,useAddSystemAssetMutation:su,useUpdateSystemAssetsMutation:sp,useDeleteSystemAssetsMutation:sm,usePopulateSystemAssetsMutation:sh}=t(78780).u.injectEndpoints({endpoints:e=>({getSystemAssets:e.query({query:e=>{let{fides_key:s,...t}=e;return{method:"GET",url:"/plus/system-assets/".concat(s),params:t}},providesTags:["System Assets"]}),addSystemAsset:e.mutation({query:e=>{let{systemKey:s,asset:t}=e;return{method:"POST",url:"/plus/system-assets/".concat(s,"/assets"),body:t}},invalidatesTags:["System Assets"]}),updateSystemAssets:e.mutation({query:e=>{let{systemKey:s,assets:t}=e;return{method:"PUT",url:"/plus/system-assets/".concat(s,"/assets/"),body:t}},invalidatesTags:["System Assets"]}),deleteSystemAssets:e.mutation({query:e=>{let{systemKey:s,asset_ids:t}=e;return{method:"DELETE",url:"/plus/system-assets/".concat(s,"/assets?").concat((0,b.du)(t,"asset_ids"))}},invalidatesTags:["System Assets"]}),populateSystemAssets:e.mutation({query:e=>{let{systemKey:s}=e;return{method:"POST",url:"/plus/dictionary/system-vendors/cookie-assets",body:[s]}}})})});var sx=t(36345);let sg=["Explicit consent","Contract","Authorised by law"].map(e=>({value:e,label:e})),sy=[{value:"Adequacy Decision",label:"Adequacy decision"},{value:"Supplementary measures",label:"Supplementary measures"},{value:"SCCs",label:"Standard contractual clauses"},{value:"BCRs",label:"Binding corporate rules"},{value:"Other",label:"Other"}],sf=["Controller","Processor","Sub-Processor"].map(e=>({value:e,label:e})),s_=e=>{var s;let{system:t}=e,a=t?null!==(s=t.name)&&void 0!==s?s:"this system":"your new system";return(0,n.jsxs)(l.X6q,{as:"h3",size:"lg",children:["Describe ",a]})};var sv=e=>{let{onSuccess:s,system:t,withHeader:a,children:i}=e,{data:r=[]}=(0,O.K3)(),o=(0,m.T)(),d=(0,eX.mZ)({resourceType:T.P6.SYSTEM,resourceFidesKey:null==t?void 0:t.fides_key}),{...c}=(0,eK.f)({includeDatasets:!0,includeDisabled:!1}),u=(0,p.useMemo)(()=>t?so(t,d.customFieldValues):sl,[t,d.customFieldValues]),[h]=(0,O.in)(),g=(0,p.useMemo)(()=>P.Ry().shape({name:P.Z_().required().label("System name").test("is-unique","",async(e,s)=>{let{data:t}=await h({page:1,size:10,search:e});return!((null==t?void 0:t.items)||[]).filter(e=>e.name!==u.name).some(s=>s.name===e)||s.createError({message:'You already have a system called "'.concat(e,'". Please specify a unique name for this system.')})}),privacy_policy:P.Z_().min(1).url().nullable()}),[h,u.name]),y=(0,ez.hz)(),[_,v]=(0,O.f7)(),[b,j]=(0,O.qQ)(),[k]=sh();(0,L.Rd)(void 0,{skip:!y.dictionaryService});let[w]=(0,L.qz)(),C=(0,m.C)(L.o),S=(0,m.C)(ey.gU),D=(0,p.useMemo)(()=>!!(t&&(null==r?void 0:r.some(e=>e.fides_key===(null==t?void 0:t.fides_key)))),[t,r]),A=(0,p.useMemo)(()=>c.allDatasets?c.allDatasets.map(e=>({value:e.fides_key,label:e.name?e.name:e.fides_key})):[],[c.allDatasets]),E=(0,l.pmc)(),R=async(e,t)=>{var a;let i,n;if(e.vendor_id&&0===e.privacy_declarations.length){let s=await w({vendor_id:e.vendor_id});if(s.isError){if(!((0,sa.fn)(s.error)&&404===s.error.status)){let e=(0,sa.e$)(s.error,"A problem occurred while fetching data uses from Fides Compass for your system. Please try again.");E((0,f.Vo)(e))}}else s.data&&s.data.items.length>0&&(i=s.data.items.map(e=>{var s;return{...(0,sn.U)(e),name:null!==(s=e.name)&&void 0!==s?s:""}}))}let r=sd({...e,privacy_declarations:null!=i?i:e.privacy_declarations});if(n=D?await b(r):await _(r),await d.upsertCustomFields(e),!D&&e.vendor_id&&(null===(a=n.data)||void 0===a?void 0:a.fides_key)){let e=await k({systemKey:n.data.fides_key});(0,sa.D4)(e)&&E((0,f.Vo)("An unexpected error occurred while populating the system assets from Compass. Please try again."))}(0,sa.D4)(n)?E({status:"error",description:(0,sa.e$)(n.error,"An unexpected error occurred while ".concat(D?"editing":"creating"," the system. Please try again."))}):(E.closeAll(),t.resetForm({values:e}),s(n.data),o((0,ey.b3)("initial")))},q=e=>{if(y.dictionaryService){if(!e){o((0,ey.b3)("hiding")),o((0,ey.gQ)(!1));return}o((0,ey.b3)("showing")),y.tcf&&(0,sa.cj)(e)===sa.c6.GVL?o((0,ey.gQ)(!0)):o((0,ey.gQ)(!1))}},I=j.isLoading||v.isLoading||d.isLoading;return(0,n.jsx)(W.J9,{initialValues:u,enableReinitialize:!0,onSubmit:R,validationSchema:g,children:e=>{let{dirty:s,values:r,isValid:o}=e;return(0,n.jsxs)(W.l0,{children:[(0,n.jsx)(x.Gt,{id:"SystemInfoTab",name:"System Info"}),(0,n.jsxs)(l.Kqy,{spacing:0,maxWidth:{base:"100%",lg:"70%"},children:[a?(0,n.jsx)(s_,{system:t}):null,(0,n.jsx)(l.xvT,{fontSize:"sm",fontWeight:"medium",children:"By providing a small amount of additional context for each system we can make reporting and understanding our tech stack much easier for everyone from engineering to legal teams. So let’s do this now."}),a?(0,n.jsx)(s_,{system:t}):null,(0,n.jsxs)(e2.Z,{heading:"System details",children:[y.dictionaryService?(0,n.jsx)(sx.Z,{label:"System name",options:C,onVendorSelected:q,isCreate:!t,lockedForGVL:S}):(0,n.jsx)(Z.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}),(null==t?void 0:t.fides_key)&&(0,n.jsx)(Z.j0,{id:"fides_key",name:"fides_key",label:"Unique ID",disabled:!0,variant:"stacked",tooltip:"An auto-generated unique ID based on the system name"}),(0,n.jsx)(si.Sv,{id:"description",name:"description",label:"Description",tooltip:"What services does this system perform?",disabled:S}),(0,n.jsx)(N.d,{mode:"tags",id:"tags",name:"tags",label:"System Tags",options:u.tags?u.tags.map(e=>({value:e,label:e})):[],layout:"stacked",tooltip:"Are there any tags to associate with this system?",disabled:S})]}),(0,n.jsx)(e2.Z,{heading:"Dataset reference",children:(0,n.jsx)(N.d,{name:"dataset_references",label:"Dataset references",options:A,tooltip:"Is there a dataset configured for this system?",mode:"multiple",layout:"stacked",disabled:S})}),(0,n.jsx)(e2.Z,{heading:"Data processing properties",children:(0,n.jsxs)(l.Kqy,{spacing:0,children:[(0,n.jsx)(l.xuv,{mb:4,children:(0,n.jsx)(si.dQ,{name:"processes_personal_data",label:"This system processes personal data",tooltip:"Does this system process personal data?",disabled:S})}),(0,n.jsx)(l.xuv,{padding:4,borderRadius:4,backgroundColor:"gray.50",children:(0,n.jsxs)(l.Kqy,{spacing:0,children:[(0,n.jsx)(si.dQ,{name:"exempt_from_privacy_regulations",label:"This system is exempt from privacy regulations",tooltip:"Is this system exempt from privacy regulations?",disabled:!r.processes_personal_data||S}),(0,n.jsx)(l.UO1,{in:r.exempt_from_privacy_regulations,animateOpacity:!0,children:(0,n.jsx)(l.xuv,{mt:4,children:(0,n.jsx)(Z.j0,{name:"reason_for_exemption",label:"Reason for exemption",tooltip:"Why is this system exempt from privacy regulation?",variant:"stacked",isRequired:r.exempt_from_privacy_regulations,disabled:S})})})]})}),(0,n.jsx)(l.UO1,{in:r.processes_personal_data&&!r.exempt_from_privacy_regulations,style:{overflow:"visible"},animateOpacity:!0,children:(0,n.jsxs)(l.Kqy,{spacing:4,mt:4,children:[(0,n.jsxs)(l.Kqy,{spacing:0,children:[(0,n.jsx)(si.dQ,{name:"uses_profiling",label:"This system performs profiling",tooltip:"Does this system perform profiling that could have a legal effect?",disabled:S}),(0,n.jsx)(l.UO1,{in:r.uses_profiling,animateOpacity:!0,style:{overflow:"visible"},children:(0,n.jsx)(l.xuv,{mt:4,children:(0,n.jsx)(N.d,{mode:"multiple",layout:"stacked",name:"legal_basis_for_profiling",label:"Legal basis for profiling",options:sg,tooltip:"What is the legal basis under which profiling is performed?",disabled:S,isRequired:r.uses_profiling})})})]}),(0,n.jsxs)(l.Kqy,{spacing:0,children:[(0,n.jsx)(si.dQ,{name:"does_international_transfers",label:"This system transfers data",tooltip:"Does this system transfer data to other countries or international organizations?",disabled:S}),(0,n.jsx)(l.UO1,{in:r.does_international_transfers,animateOpacity:!0,style:{overflow:"visible"},children:(0,n.jsx)(l.xuv,{mt:4,children:(0,n.jsx)(N.d,{mode:"multiple",layout:"stacked",name:"legal_basis_for_transfers",label:"Legal basis for transfer",options:sy,tooltip:"What is the legal basis under which the data is transferred?",isRequired:r.does_international_transfers,disabled:S})})})]}),(0,n.jsxs)(l.Kqy,{spacing:0,children:[(0,n.jsx)(Z.w8,{name:"requires_data_protection_assessments",label:"This system requires Data Privacy Assessments",tooltip:"Does this system require (DPA/DPIA) assessments?",variant:"stacked",isDisabled:S}),(0,n.jsx)(l.UO1,{in:r.requires_data_protection_assessments,animateOpacity:!0,children:(0,n.jsx)(l.xuv,{mt:4,children:(0,n.jsx)(Z.j0,{label:"DPIA/DPA location",name:"dpa_location",tooltip:"Where is the DPA/DPIA stored?",variant:"stacked",disabled:S,isRequired:r.requires_data_protection_assessments})})})]})]})})]})}),(0,n.jsxs)(l.UO1,{in:r.processes_personal_data&&!r.exempt_from_privacy_regulations,animateOpacity:!0,children:[(0,n.jsxs)(e2.Z,{heading:"Cookie properties",children:[(0,n.jsx)(si.dQ,{name:"uses_cookies",label:"This system uses cookies",tooltip:"Does this system use cookies?",disabled:S}),(0,n.jsx)(si.dQ,{name:"cookie_refresh",label:"This system refreshes cookies",tooltip:"Does this system automatically refresh cookies?",disabled:S}),(0,n.jsx)(si.dQ,{name:"uses_non_cookie_access",label:"This system uses non-cookie trackers",tooltip:"Does this system use other types of trackers?",disabled:S}),(0,n.jsx)(si.lm,{name:"cookie_max_age_seconds",label:"Maximum duration (seconds)",tooltip:"What is the maximum amount of time a cookie will live?",disabled:S})]}),(0,n.jsxs)(e2.Z,{heading:"Administrative properties",children:[(0,n.jsx)(Z.j0,{label:"Data stewards",name:"data_stewards",tooltip:"Who are the stewards assigned to the system?",variant:"stacked",disabled:!0}),(0,n.jsx)(si.Yb,{id:"privacy_policy",name:"privacy_policy",label:"Privacy policy URL",tooltip:"Where can the privacy policy be located?",disabled:S}),(0,n.jsx)(si.Yb,{id:"legal_name",name:"legal_name",label:"Legal name",tooltip:"What is the legal name of the business?",disabled:S}),(0,n.jsx)(si.Sv,{id:"legal_address",name:"legal_address",label:"Legal address",tooltip:"What is the legal address for the business?",disabled:S}),(0,n.jsx)(Z.j0,{label:"Department",name:"administrating_department",tooltip:"Which department is concerned with this system?",variant:"stacked",disabled:!r.processes_personal_data||r.exempt_from_privacy_regulations||S}),(0,n.jsx)(N.d,{mode:"multiple",layout:"stacked",label:"Responsibility",name:"responsibility",options:sf,tooltip:"What is the role of the business with regard to data processing?",disabled:!r.processes_personal_data||r.exempt_from_privacy_regulations||S}),(0,n.jsx)(si.Yb,{name:"dpo",id:"dpo",label:"Legal contact (DPO)",tooltip:"What is the official privacy contact information?",disabled:S}),(0,n.jsx)(Z.j0,{label:"Joint controller",name:"joint_controller_info",tooltip:"Who are the party or parties that share responsibility for processing data?",variant:"stacked",disabled:!r.processes_personal_data||r.exempt_from_privacy_regulations||S}),(0,n.jsx)(si.Yb,{label:"Data security practices",name:"data_security_practices",id:"data_security_practices",tooltip:"Which data security practices are employed to keep the data safe?",disabled:S}),(0,n.jsx)(si.Yb,{label:"Legitimate interest disclosure URL",name:"legitimate_interest_disclosure_url",id:"legitimate_interest_disclosure_url",disabled:S}),(0,n.jsx)(si.Yb,{label:"Vendor deleted date",name:"vendor_deleted_date",id:"vendor_deleted_date",tooltip:"If this vendor is no longer active, it will be 'soft' deleted. When that occurs, it's deleted date will be recorded here for reporting.",disabled:!0})]}),r.fides_key?(0,n.jsx)(eX.uc,{resourceType:T.P6.SYSTEM,resourceFidesKey:r.fides_key}):null]})]}),(0,n.jsx)(l.xuv,{mt:6,children:(0,n.jsx)(l.wpx,{htmlType:"submit",type:"primary",disabled:I||!s||!o,loading:I,"data-testid":"save-btn",children:"Save"})}),i]})}})},sb=t(59003),sj=t(92222),sk=t(30952),sw=t(14481),sC=t(90111),sS=t(8133),sD=t(83099),sT=e=>{let{name:s,label:t,labelProps:a,tooltip:i}=e,[r,o,{setValue:d,setTouched:c}]=(0,W.U$)(s),u=!!(o.touched&&o.error);return(0,n.jsx)(l.NIc,{isInvalid:u,isRequired:!0,children:(0,n.jsxs)(l.jqI,{vertical:!0,children:[(0,n.jsxs)(l.jqI,{align:"center",children:[t&&(0,n.jsx)(Z.__,{htmlFor:s,fontSize:"xs",mr:1,...a,children:t}),i&&(0,n.jsx)(eO.b,{label:i})]}),(0,n.jsx)(sD.Z,{...r,mode:"multiple",selectedTaxonomies:[],onChange:e=>{d(e)},onBlur:()=>c(!0),variant:"outlined",autoFocus:!1,status:u?"error":void 0,"data-testid":"controlled-select-".concat(s)}),(0,n.jsx)(Z.Bc,{isInvalid:u,message:o.error,fieldName:s})]})})};(a=i||(i={})).COOKIE="Cookie",a.BROWSER_REQUEST="Browser Request",a.I_FRAME="iFrame",a.JAVASCRIPT_TAG="Javascript tag",a.IMAGE="Image";let sA=P.Ry().shape({name:P.Z_().required("Enter a name for this asset"),domain:P.Z_().required("Enter a valid domain for this asset"),asset_type:P.Z_().required("Select an asset type"),data_uses:P.IX().min(1,"Select at least one data use"),base_url:P.Z_().when("asset_type",{is:e=>"Cookie"!==e,then:e=>e.required("Base URL is required"),otherwise:e=>e.notRequired()})}),sE={name:"",description:"",data_uses:[],domain:"",asset_type:"",id:"",system_id:""};var sR=e=>{let{isOpen:s,onClose:t,systemKey:a,asset:r,...o}=e,d=!r,[c,{isLoading:u}]=su(),[p,{isLoading:m}]=sp(),h=(0,l.pmc)(),x=async e=>{let s=await c({systemKey:a,asset:e});if((0,sa.D4)(s)){let e=(0,sa.e$)(s.error,"An unexpected error occurred while saving this asset. Please try again.");h((0,f.Vo)(e))}else h((0,f.t5)("Asset added successfully")),t()},g=async e=>{let s=await p({systemKey:a,assets:[e]});if((0,sa.D4)(s)){let e=(0,sa.e$)(s.error,"An unexpected error occurred while saving this asset. Please try again.");h((0,f.Vo)(e))}else h((0,f.t5)("Asset updated successfully")),t()};return(0,n.jsx)(sS.Z,{title:d?"Add asset":"Edit asset",onClose:t,isOpen:s,...o,children:(0,n.jsx)(W.J9,{initialValues:null!=r?r:sE,onSubmit:e=>{d?x(e):g(e)},validationSchema:sA,children:e=>{let{values:s,isValid:a,dirty:r}=e;return(0,n.jsxs)(W.l0,{children:[(0,n.jsxs)(l.jqI,{vertical:!0,className:"pb-6 pt-4",children:[(0,n.jsx)(sC.Z,{children:(0,n.jsx)(l.xvT,{fontSize:"sm",children:"Create and configure assets (e.g. cookies, pixels, tags) for this system to ensure proper consent enforcement. Adding assets manually allows you to define key attributes, assign categories, and align them with compliance requirements."})}),(0,n.jsxs)(l.jqI,{vertical:!0,gap:20,children:[(0,n.jsx)(Z.j0,{id:"name",name:"name",label:"Name",variant:"stacked",isRequired:!0,disabled:!d}),(0,n.jsx)(N.d,{isRequired:!0,id:"asset_type",name:"asset_type",label:"Asset type",options:(0,sa.MM)(i),layout:"stacked",disabled:!d}),(0,n.jsx)(sT,{name:"data_uses",label:"Data uses",layout:"stacked"}),(0,n.jsx)(Z.j0,{id:"domain",name:"domain",label:"Domain",variant:"stacked",isRequired:!0,disabled:!d}),(0,n.jsx)(Z.Ks,{id:"description",name:"description",label:"Description",variant:"stacked"}),(0,n.jsx)(l.UO1,{in:!!s.asset_type&&"Cookie"!==s.asset_type,children:(0,n.jsx)(Z.j0,{id:"base_url",name:"base_url",label:"Base URL",variant:"stacked",isRequired:!!s.asset_type&&"Cookie"!==s.asset_type})})]})]}),(0,n.jsxs)(l.jqI,{justify:"space-between",children:[(0,n.jsx)(l.wpx,{onClick:t,children:"Cancel"}),(0,n.jsx)(l.wpx,{type:"primary",htmlType:"submit",loading:u||m,disabled:!a||!r,"data-testid":"save-btn",children:"Save"})]})]})}})})},sq=t(8411),sI=t(72625),sz=t(29850),sF=t(77685),sL=e=>{let{systemKey:s,systemName:t,asset:a,readonly:i}=e,[r,o]=(0,p.useState)(!1),[d,c]=(0,p.useState)(),[u,m]=(0,p.useState)(!1),[h,{isLoading:x}]=sp(),{successAlert:g,errorAlert:y}=(0,S.V)(),f=(0,l.qY0)(),{asset_type:_,name:v}=a,b=(0,p.useCallback)(e=>{e.preventDefault(),m(!0)},[]),j=async e=>{if(!e)return;let{newSystemKey:t,newSystemName:i,isNewSystem:n}=e,r=await h({systemKey:s,assets:[{id:a.id,system_key:t}]});(0,eh.D4)(r)?y((0,sa.e$)(r.error)):g(n?"".concat(i," has been added to your system inventory and the ").concat(_,' "').concat(v,'" has been assigned to that system.'):"".concat(_," ").concat(v," has been assigned to ").concat(i)),o(!1),c(void 0)},k=e=>{c(e),f.onOpen()};return i?(0,n.jsx)(l.j8w,{"data-testid":"system-badge",color:"white",children:t}):(0,n.jsxs)(n.Fragment,{children:[!r&&(0,n.jsxs)(l.j8w,{"data-testid":"system-badge",color:"white",onClick:()=>o(!0),children:[t," ",(0,n.jsx)(l.PJP.I8b,{})]}),!!r&&(0,n.jsx)(sz.R,{variant:"borderless",className:"w-full",autoFocus:!0,defaultOpen:!0,defaultValue:s,onBlur:e=>{var s;(null===(s=e.relatedTarget)||void 0===s?void 0:s.getAttribute("id"))!=="add-new-system"&&o(!1)},onAddSystem:b,onSelect:(e,s)=>k({newSystemKey:e,newSystemName:s.label}),loading:x}),u&&(0,n.jsx)(sF.i,{isOpen:!0,onClose:()=>m(!1),onSuccessfulSubmit:(e,s)=>k({newSystemKey:e,newSystemName:s,isNewSystem:!0})}),(0,n.jsx)(l.cVQ,{isOpen:f.isOpen,onClose:f.onClose,onConfirm:()=>{j(d)},title:"Reassign asset",message:"Are you sure you want to reassign this asset to ".concat(null==d?void 0:d.newSystemName,"?"),isCentered:!0})]})},sO=e=>{let{asset:s,systemKey:t,onEditClick:a}=e,[i,{isLoading:r}]=sm(),o=(0,l.pmc)(),{isOpen:d,onClose:c,onOpen:u}=(0,l.qY0)(),p=async()=>{let e=await i({systemKey:t,asset_ids:[s.id]});(0,eh.D4)(e)?o((0,f.Vo)((0,sa.e$)(e.error,"A problem occurred removing this asset. Please try again"))):o((0,f.t5)("Asset removed successfully"))};return(0,n.jsxs)(l.jqI,{className:"gap-1",children:[(0,n.jsx)(l.wpx,{size:"small",onClick:a,"data-testid":"edit-btn",children:"Edit"}),(0,n.jsx)(l.wpx,{size:"small",onClick:u,loading:r,"data-testid":"remove-btn",children:"Remove"}),(0,n.jsx)(l.cVQ,{isOpen:d,onClose:c,onConfirm:p,title:"Remove asset",message:"Are you sure you want to ignore the selected assets? This action cannot be undone and may impact consent automation.",isCentered:!0})]})},sZ=t(34929),sW=t(26183),sP=e=>{var s,t;let{asset:a,systemId:i,readonly:r}=e,{getDataUseDisplayName:o}=(0,sZ.Z)(),[d]=sp(),{errorAlert:c,successAlert:u}=(0,A.V)(),[m,h]=(0,p.useState)(!1),x=async e=>{let s=[...a.data_uses||[],e],t=await d({systemKey:i,assets:[{id:a.id,data_uses:s}]});(0,eh.D4)(t)?c((0,sa.e$)(t.error)):u("Consent category added to ".concat(a.asset_type,' "').concat(a.name,'".'),"Confirmed")},g=async e=>{var s;let t=null===(s=a.data_uses)||void 0===s?void 0:s.filter(s=>s!==e),n=await d({systemKey:i,assets:[{id:a.id,data_uses:t}]});(0,eh.D4)(n)?c((0,sa.e$)(n.error)):u("Consent category removed from ".concat(a.asset_type,' "').concat(a.name,'".'),"Confirmed")},y=null!==(t=null===(s=a.data_uses)||void 0===s?void 0:s.map(e=>({label:o(e),key:e})))&&void 0!==t?t:[];return r?(0,n.jsx)(sW.Z,{children:y.map(e=>(0,n.jsx)(l.j8w,{"data-testid":"data-use-".concat(e.key),color:"white",children:e.label},e.key))}):(0,n.jsxs)(sW.Z,{children:[!m&&(0,n.jsxs)(n.Fragment,{children:[y.map(e=>(0,n.jsx)(l.j8w,{"data-testid":"data-use-".concat(e.key),color:"white",closable:!0,onClose:()=>g(e.key),closeButtonLabel:"Remove data use",children:e.label},e.key)),(0,n.jsx)(l.j8w,{onClick:()=>h(!0),"data-testid":"taxonomy-add-btn",addable:!0,"aria-label":"Add data use"})]}),m&&(0,n.jsx)(l.xuv,{className:"select-wrapper",position:"absolute",zIndex:10,top:"0",left:"0",width:"100%",height:"max",bgColor:"#fff",children:(0,n.jsx)(sD.Z,{selectedTaxonomies:a.data_uses||[],onSelect:x,onBlur:()=>h(!1),open:!0})})]})},sN=e=>{let{systemKey:s,systemName:t,lockedForGVL:a,onEditClick:i}=e,r=(0,sj.Cl)(),l=r.display({id:"select",cell:e=>{let{row:s}=e;return(0,n.jsx)(sI.k,{isChecked:s.getIsSelected(),onChange:s.getToggleSelectedHandler(),dataTestId:"select-".concat(s.original.name||s.id)})},header:e=>{let{table:s}=e;return(0,n.jsx)(sI.k,{isChecked:s.getIsAllPageRowsSelected(),isIndeterminate:s.getIsSomeRowsSelected(),onChange:s.getToggleAllRowsSelectedHandler(),dataTestId:"select-all-rows"})},maxSize:40,meta:{cellProps:{borderRight:"none",paddingRight:0}}}),o=r.accessor(e=>e.name,{id:"name",cell:e=>(0,n.jsx)(sw.G3,{value:e.getValue()}),header:"Asset"}),d=r.accessor(e=>e.asset_type,{id:"resource_type",cell:e=>(0,n.jsx)(sw.G3,{value:e.getValue()}),header:"Type"}),c=r.display({id:"system",cell:e=>(0,n.jsx)(sL,{systemKey:s,systemName:t,asset:e.row.original,readonly:a}),header:"System"}),u=r.accessor(e=>e.data_uses,{id:"data_uses",cell:e=>(0,n.jsx)(sP,{asset:e.row.original,systemId:s,readonly:a}),header:"Categories of consent",size:200}),p=r.accessor(e=>e.locations,{id:"locations",cell:e=>(0,n.jsx)(sI.mb,{values:e.getValue().map(e=>({label:sq.Z8[e],key:e}))}),header:"Locations",size:300}),m=r.accessor(e=>e.domain,{id:"domain",cell:e=>(0,n.jsx)(sw.G3,{value:e.getValue()}),header:"Domain"}),h=r.accessor(e=>e.page,{id:"page",cell:e=>(0,n.jsx)(sI.tc,{values:e.getValue(),valueSuffix:"pages",cellProps:e}),header:e=>(0,n.jsx)(sI.Rr,{value:"Detected on",...e}),meta:{showHeaderMenu:!0,disableRowClick:!0}}),x=r.display({id:"actions",cell:e=>{let{row:t}=e;return(0,n.jsx)(sO,{asset:t.original,systemKey:s,onEditClick:()=>i(t.original)})},header:"Actions"}),g=[o,d,c,u,p,m,h];return a?g:[l,...g,x]},sU=e=>{var s;let{system:t}=e,{PAGE_SIZES:a,pageSize:i,setPageSize:r,onPreviousPageClick:o,isPreviousPageDisabled:d,onNextPageClick:c,isNextPageDisabled:u,startRange:h,endRange:x,pageIndex:g,setTotalPages:y,resetPageIndexToDefault:_}=(0,sw.oi)(),[v,b]=(0,p.useState)(""),[j,k]=(0,p.useState)(void 0),[w,C]=(0,p.useState)({}),[S]=sm(),D=(0,m.C)(ey.gU),T=(0,l.pmc)(),{data:A,isLoading:E,isFetching:R}=sc({fides_key:t.fides_key,search:v,page:g,size:i}),{isOpen:q,onClose:I,onOpen:z}=(0,l.qY0)(),{isOpen:F,onClose:L,onOpen:O}=(0,l.qY0)();(0,p.useEffect)(()=>{_()},[v,_]),(0,p.useEffect)(()=>{y(null==A?void 0:A.pages)},[A,y]);let Z=sN({systemName:null!==(s=t.name)&&void 0!==s?s:t.fides_key,systemKey:t.fides_key,onEditClick:e=>{k(e),z()},lockedForGVL:D}),W=(0,sb.b7)({getCoreRowModel:(0,sj.sC)(),columns:Z,manualPagination:!0,data:(null==A?void 0:A.items)||[],columnResizeMode:"onChange",onRowSelectionChange:C,state:{rowSelection:w}}),P=W.getSelectedRowModel().rows.map(e=>e.original.id),N=async()=>{let e=await S({systemKey:t.fides_key,asset_ids:P});(0,eh.D4)(e)?T((0,f.Vo)((0,sa.e$)(e.error,"A problem occurred removing these assets. Please try again."))):(W.resetRowSelection(),T((0,f.t5)("Assets removed successfully"))),L()};return t?E?(0,n.jsx)(sw.I4,{rowHeight:36,numRows:36}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(l.xvT,{fontSize:"sm",mb:4,children:D?"This page displays all assets associated with this system. Use the table below to review these technologies for compliance and detailed insights.":"This page displays all assets associated with this system. Use the table below to review and manage these technologies for compliance and detailed insights."}),(0,n.jsxs)(sw.Q$,{children:[(0,n.jsx)(sk.f,{value:v,onChange:b}),!D&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(l.LZC,{}),(0,n.jsx)(l.wpx,{icon:(0,n.jsx)(l.PJP.mm_,{}),iconPosition:"end",onClick:z,"data-testid":"add-asset-btn",children:"Add asset"}),(0,n.jsx)(sR,{isOpen:q,onClose:()=>{k(void 0),I()},systemKey:t.fides_key,asset:j}),(0,n.jsx)(l.wpx,{icon:(0,n.jsx)(l.PJP.ZNm,{}),iconPosition:"end",onClick:O,disabled:!P.length,"data-testid":"bulk-delete-btn",children:"Remove"}),(0,n.jsx)(l.cVQ,{isOpen:F,onClose:L,onConfirm:N,title:"Remove assets",message:"Are you sure you want to remove the selected assets? This action cannot be undone and may impact consent automation.",isCentered:!0})]})]}),(0,n.jsx)(sw.ZK,{tableInstance:W,emptyTableNotice:(0,n.jsx)(l.oj8,{image:l.oj8.PRESENTED_IMAGE_SIMPLE,description:"No assets found","data-testid":"empty-state"})}),(0,n.jsx)(sw.s8,{totalRows:(null==A?void 0:A.total)||0,pageSizes:a,setPageSize:r,onPreviousPageClick:o,isPreviousPageDisabled:d||R,onNextPageClick:c,isNextPageDisabled:u||R,startRange:h,endRange:x})]}):null};let sV={INFORMATION:{index:0,hash:"#information"},DATA_USES:{index:1,hash:"#data-uses"},DATA_FLOW:{index:2,hash:"#data-flow"},INTEGRATIONS:{index:3,hash:"#integrations"},ASSETS:{index:4,hash:"#assets"},HISTORY:{index:5,hash:"#history"}},sM=e=>{let s=e.startsWith("#")?e:"#".concat(e);return Object.values(sV).find(e=>e.hash===s)},sB=e=>Object.values(sV).find(s=>s.index===e),sK=e=>{let{onViewDatamap:s,onAddPrivacyDeclaration:t}=e;return(0,n.jsxs)(l.xuv,{children:[(0,n.jsx)(l.xvT,{fontWeight:"700",children:"System has been saved successfully"}),(0,n.jsxs)(l.xvT,{textColor:"gray.700",whiteSpace:"inherit",children:["Your system has been added to your data map. You can"," ",(0,n.jsx)(_.Z,{onClick:s,children:"view it now"})," or"," ",(0,n.jsx)(_.Z,{onClick:t,children:"add privacy declarations in the next tab"}),"."]})]})};var sH=e=>{var s,t;let{isCreate:a}=e,i=(0,c.useRouter)(),[o,u]=(0,p.useState)((()=>{var e,s;let t=i.asPath.split("#")[1];return t&&null!==(s=null===(e=sM(t))||void 0===e?void 0:e.index)&&void 0!==s?s:sV.INFORMATION.index})()),[_,v]=(0,p.useState)(!1),{systemOrDatamapRoute:b}=(0,g.V)(),j=(0,l.pmc)(),k=(0,m.T)(),w=(0,m.C)(O.NC),[C,S]=(0,p.useState)(void 0),{plus:D}=(0,h.hz)(),{plus:T}=(0,h.hz)(),{data:A}=(0,O.rn)(null==w?void 0:w.fides_key,{skip:!w});(0,p.useEffect)(()=>{k((0,O.db)(A))},[A,k]),(0,p.useEffect)(()=>{w&&S(w.processes_personal_data)},[w]);let E=(0,p.useCallback)(e=>{void 0===w&&v(!0),k((0,O.db)(e)),i.push({pathname:y.Dv,query:{id:e.fides_key}});let s={...f.MA,description:(0,n.jsx)(sK,{onViewDatamap:()=>{i.push(b).then(()=>{j.closeAll()})},onAddPrivacyDeclaration:()=>{u(1),j.closeAll()}})};j({...s})},[w,k,i,b,j]);(0,p.useEffect)(()=>(a&&(k((0,O.db)(void 0)),k((0,ey.b3)("initial")),k((0,ey.gQ)(!1))),()=>{k((0,O.db)(void 0))}),[k,a]);let{attemptAction:R}=(0,x.oI)(),q=(0,p.useCallback)(e=>{R().then(async s=>{if(s){let{status:s}=i.query;if(s&&("succeeded"===s?j((0,f.t5)("Integration successfully authorized.")):j((0,f.Vo)("Failed to authorize integration."))),u(e),i.isReady){let s=sB(e);if(s){let e={...i.query};delete e.status,await i.replace({pathname:i.pathname,query:e,hash:s.hash},void 0,{shallow:!0})}}}})},[R,i,j]);(0,p.useEffect)(()=>{let{status:e}=i.query;e&&q(sV.INTEGRATIONS.index)},[i.query,q]);let I=[{label:"Information",content:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(l.xuv,{px:6,mb:9,children:[(0,n.jsx)(x.eB,{}),(0,n.jsx)(sv,{onSuccess:E,system:w})]}),_?(0,n.jsx)(l.xuv,{backgroundColor:"gray.100",px:6,py:3,children:(0,n.jsxs)(l.xvT,{color:"primary.900",fontSize:"sm","data-testid":"save-help-message",children:["Now that you have saved this new system it is"," ",(0,n.jsx)(l.rUS,{as:d(),href:b,textDecor:"underline",children:"ready to view in your data map"}),". You can return to this setup at any time to add privacy declarations to this system."]})}):null]})},{label:"Data uses",content:w?(0,n.jsx)(l.xuv,{px:6,width:{base:"100%",lg:"70%"},children:(0,n.jsx)(st,{system:w})}):null,isDisabled:!w||!C},{label:"Data flow",content:w?(0,n.jsxs)(l.xuv,{width:{base:"100%",lg:"70%"},children:[(0,n.jsxs)(l.xuv,{px:6,paddingBottom:2,children:[(0,n.jsx)(l.xvT,{fontSize:"md",lineHeight:6,fontWeight:"bold",marginBottom:3,children:"Data flow"}),(0,n.jsx)(l.xvT,{fontSize:"sm",lineHeight:5,fontWeight:"medium",children:"Data flow describes the flow of data between systems in your Data Map. Below, you can configure Source and Destination systems and the corresponding links will be drawn in the Data Map graph. Source systems are systems that send data to this system while Destination systems receive data from this system."})]}),(0,n.jsx)(r.q,{system:w,isSystemTab:!0})]}):null,isDisabled:!w},{label:"Integrations",content:w?(0,n.jsxs)(l.xuv,{width:{base:"100%",lg:"70%"},children:[(0,n.jsx)(l.xuv,{px:6,paddingBottom:2,children:(0,n.jsx)(l.xvT,{fontSize:"sm",lineHeight:5,children:T?(0,n.jsxs)(n.Fragment,{children:["Add an integration to start managing privacy requests and consent. Visit"," ",(0,n.jsx)(l.rUS,{href:y.KH,color:"link.900",children:"Integration Management"})," ","to set up monitoring on databases."]}):"Integrations are used to process privacy requests for access erasure, portability, rectification, and consent."})}),(0,n.jsx)(ep,{connectionConfig:w.connection_configs,systemFidesKey:w.fides_key}),(null===(s=w.connection_configs)||void 0===s?void 0:s.key)&&(0,n.jsx)(eg,{m:6,connectionKey:null===(t=w.connection_configs)||void 0===t?void 0:t.key})]}):null,isDisabled:!w}];return D&&I.push({label:"Assets",content:w?(0,n.jsx)(sU,{system:w}):null,isDisabled:!w}),D&&I.push({label:"History",content:w?(0,n.jsxs)(l.xuv,{width:{base:"100%",lg:"70%"},children:[(0,n.jsx)(l.xuv,{px:6,paddingBottom:6,children:(0,n.jsx)(l.xvT,{fontSize:"sm",lineHeight:5,fontWeight:"medium",children:"All changes to this system are tracked here in this audit table by date and by user. You can inspect the changes by selecting any of the events listed."})}),(0,n.jsx)(eB,{system:w})]}):null,isDisabled:!w}),{tabData:I,tabIndex:o,onTabChange:q}}},54748:function(e,s,t){"use strict";var a=t(27378),i=t(46420);s.Z=()=>({legalBasisOptions:(0,a.useMemo)(()=>Object.keys(i.gP).map(e=>({value:i.gP[e],label:i.gP[e]})),[])})},28325:function(e,s,t){"use strict";var a=t(27378),i=t(46420);s.Z=()=>({specialCategoryLegalBasisOptions:(0,a.useMemo)(()=>Object.keys(i.nV).map(e=>({value:i.nV[e],label:i.nV[e]})),[])})}}]);
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3450],{30454:function(e,s,t){var a=t(40699);e.exports=function(e){return a(e,5)}},77867:function(e,s,t){"use strict";var a=t(24246),i=t(38355);s.Z=e=>{let{connected:s,...t}=e,n="red.500";return null==s?n="gray.300":s&&(n="green.500"),(0,a.jsx)(i.xuv,{width:"12px",height:"12px",borderRadius:"6px",backgroundColor:n,...t})}},59301:function(e,s,t){"use strict";var a=t(24246);let{Link:i}=t(38355).AntTypography;s.Z=e=>(0,a.jsx)(i,{target:"_blank",rel:"noopener noreferrer",...e})},77213:function(e,s,t){"use strict";t.d(s,{Z:function(){return p}});var a=t(24246),i=t(38355),n=t(88038),r=t.n(n),l=t(86677);t(27378);var o=t(25980),d=t(90867),c=t(77830),u=()=>{let e=(0,l.useRouter)();return(0,a.jsx)(i.xuv,{bg:"gray.50",border:"1px solid",borderColor:"blue.400",borderRadius:"md",justifyContent:"space-between",p:5,mb:5,mt:5,children:(0,a.jsxs)(i.xuv,{children:[(0,a.jsxs)(i.Kqy,{direction:{base:"column",sm:"row"},justifyContent:"space-between",children:[(0,a.jsx)(i.xvT,{fontWeight:"semibold",children:"Configure your storage and messaging provider"}),(0,a.jsx)(i.wpx,{onClick:()=>{e.push(c.fz)},children:"Configure"})]}),(0,a.jsxs)(i.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:s,title:t,padded:n=!0,mainProps:c}=e,p=(0,o.hz)(),m=(0,l.useRouter)(),h="/privacy-requests"===m.pathname||"/datastore-connection"===m.pathname,x=!(p.flags.privacyRequestsConfiguration&&h),{data:g}=(0,d.JE)(void 0,{skip:x}),{data:y}=(0,d.PW)(void 0,{skip:x}),f=p.flags.privacyRequestsConfiguration&&(!g||!y)&&h;return(0,a.jsxs)(i.kCb,{"data-testid":t,direction:"column",h:"100vh",children:[(0,a.jsxs)(r(),{children:[(0,a.jsxs)("title",{children:["Fides Admin UI - ",t]}),(0,a.jsx)("meta",{name:"description",content:"Privacy Engineering Platform"}),(0,a.jsx)("link",{rel:"icon",href:"/favicon.ico"})]}),(0,a.jsxs)(i.kCb,{as:"main",direction:"column",py:n?6:0,px:n?10:0,h:n?"calc(100% - 48px)":"full",flex:1,minWidth:0,overflow:"auto",...c,children:[f?(0,a.jsx)(u,{}):null,s]})]})}},19904:function(e,s,t){"use strict";t.d(s,{Tg:function(){return r}});var a=t(24246),i=t(16134),n=t(31793);let r=e=>(0,i.C)(n.uu).filter(s=>e.includes(s)).length>0;s.ZP=e=>{let{scopes:s,children:t}=e;return r(s)?(0,a.jsx)(a.Fragment,{children:t}):null}},83099:function(e,s,t){"use strict";var a=t(24246),i=t(79283),n=t(34929);s.Z=e=>{let{selectedTaxonomies:s,showDisabled:t=!1,...r}=e,{getDataUseDisplayNameProps:l,getDataUses:o}=(0,n.Z)(),d=(t?o():o().filter(e=>e.active)).filter(e=>!s.includes(e.fides_key)).map(e=>{let{name:s,primaryName:t}=l(e.fides_key);return{value:e.fides_key,name:s,primaryName:t,description:e.description||""}});return(0,a.jsx)(i.l,{options:d,...r})}},71248:function(e,s,t){"use strict";t.d(s,{A:function(){return o}});var a=t(24246),i=t(34090),n=t(46782),r=t(97181),l=t(40324);let o=e=>{var s,t;let{name:o,fieldSchema:d,isRequired:c,layout:u="stacked",secretsSchema:p,validate:m}=e,h=(null===(t=d.allOf)||void 0===t?void 0:null===(s=t[0])||void 0===s?void 0:s.$ref)&&d.allOf[0].$ref!==n.j?null==p?void 0:p.definitions[d.allOf[0].$ref.replace("#/definitions/","")]:void 0,x=!!(null==h?void 0:h.enum)||d.options,g="boolean"===d.type,y="integer"===d.type,f=()=>{var e;if((null===(e=d.allOf)||void 0===e?void 0:e[0].$ref)===n.j)return"Enter dataset.collection.field"};return(0,a.jsx)(i.gN,{id:o,name:o,validate:m,children:e=>{let{field:s}=e;if(x){var t,i,n;let e=null!==(n=null==h?void 0:null===(t=h.enum)||void 0===t?void 0:t.map(e=>({label:e,value:e})))&&void 0!==n?n:null===(i=d.options)||void 0===i?void 0:i.map(e=>({label:e,value:e}));return(0,a.jsx)(r.d,{name:s.name,id:s.name,label:d.title,isRequired:c,tooltip:d.description,layout:u,options:e,mode:d.multiselect?"multiple":void 0},s.name)}return g?(0,a.jsx)(r.d,{name:s.name,id:s.name,label:d.title,isRequired:c,tooltip:d.description,layout:u,options:[{label:"False",value:"false"},{label:"True",value:"true"}]},s.name):y?(0,a.jsx)(l.aJ,{...s,label:d.title,tooltip:d.description,isRequired:c,placeholder:f(),variant:u}):(0,a.jsx)(l.j0,{...s,label:d.title,tooltip:d.description,isRequired:c,type:d.sensitive?"password":"text",placeholder:f(),autoComplete:"off",color:"gray.700",variant:u})}},o)}},46782:function(e,s,t){"use strict";t.d(s,{j:function(){return n},l:function(){return r}});var a=t(30454),i=t.n(a);let n="#/definitions/FidesDatasetReference",r=e=>{let s=(e,s,t)=>{let a;return(void 0===s||""===s||void 0===s)&&(a="".concat(e," is required")),t===n&&((null==s?void 0:s.includes("."))?s.split(".").length<3&&(a="Dataset reference must include at least three parts"):a="Dataset reference must be dot delimited"),a},t=s=>{var t,a;return(null==e?void 0:null===(t=e.required)||void 0===t?void 0:t.includes(s))||(null==e?void 0:null===(a=e.properties)||void 0===a?void 0:a[s])!==void 0&&"default"in e.properties[s]};return{validateField:s,isRequiredField:t,getFieldValidation:(e,a)=>{if(t(e)||"integer"===a.type)return e=>{var t;return s(a.title,e,null===(t=a.allOf)||void 0===t?void 0:t[0].$ref)}},preprocessValues:s=>{let t=i()(s);return e&&Object.keys(e.properties).forEach(s=>{var a,i;if((null===(a=e.properties[s].allOf)||void 0===a?void 0:a[0].$ref)===n){let e=null===(i=t.secrets[s])||void 0===i?void 0:i.split(".");e&&(t.secrets[s]={dataset:e.shift(),field:e.join("."),direction:"from"})}"WebsiteSchema"!==e.title||"URL"!==e.properties[s].title||t.secrets[s].startsWith("http://")||t.secrets[s].startsWith("https://")||(t.secrets[s]="https://".concat(t.secrets[s]))}),t}}}},16220:function(e,s,t){"use strict";t.d(s,{V:function(){return n}});var a=t(25980),i=t(77830);let n=()=>({systemOrDatamapRoute:(0,a.hz)().plus?i.oG:i.So})},90111:function(e,s,t){"use strict";var a=t(24246),i=t(38355);s.Z=e=>{let{children:s,...t}=e;return(0,a.jsx)(i.xuv,{p:4,mb:4,border:"1px solid",borderColor:"gray.200",bgColor:"gray.50",borderRadius:"md",...t,children:s})}},44553:function(e,s,t){"use strict";t.d(s,{Z:function(){return g}});var a=t(24246),i=t(38355),n=t(27378),r=t(45277),l=t(16125),o=t(812),d=t(46628),c=t(20682),u=t(54427),p=t(52253),m=t(78780);let{reducer:h}=(0,u.oM)({name:"connectorTemplate",initialState:{},reducers:{}}),{useRegisterConnectorTemplateMutation:x}=m.u.injectEndpoints({endpoints:e=>({registerConnectorTemplate:e.mutation({query:e=>{let s=new FormData;return s.append("file",e),{url:"".concat(p.o4,"/register"),method:"POST",body:s}},invalidatesTags:()=>["Connection Type"]})})});var g=e=>{let{isOpen:s,onClose:t,testId:u="connector-template-modal"}=e,p=(0,l.I0)(),[m,h]=(0,n.useState)(null),g=(0,i.pmc)(),{getRootProps:y,getInputProps:f,isDragActive:_}=(0,r.uI)({onDrop:e=>{var s;if("zip"!==(null===(s=e[0].name.split(".").pop())||void 0===s?void 0:s.toLowerCase())){g((0,d.Vo)("Only zip files are allowed."));return}h(e[0])}}),[v,{isLoading:b}]=x(),{refetch:j}=(0,c.$I)({search:""},{skip:!1}),k=async()=>{if(m)try{var e;await v(m).unwrap(),g((0,d.t5)("Integration template uploaded successfully."));let{data:s}=await j();p((0,c.fP)(null!==(e=null==s?void 0:s.items)&&void 0!==e?e:[])),t()}catch(e){g((0,d.Vo)((0,o.e$)(e)))}finally{h(null)}};return(0,a.jsxs)(i.u_l,{isOpen:s,onClose:t,size:"2xl",children:[(0,a.jsx)(i.ZAr,{}),(0,a.jsxs)(i.hzk,{textAlign:"left",p:2,"data-testid":u,children:[(0,a.jsx)(i.xBx,{children:"Upload integration template"}),(0,a.jsxs)(i.fef,{children:[(0,a.jsx)(i.xvT,{fontSize:"sm",mb:4,children:"Drag and drop your integration template zip file here, or click to browse your files."}),(0,a.jsxs)(i.xuv,{...y(),bg:_?"gray.100":"gray.50",border:"2px dashed",borderColor:_?"gray.300":"gray.200",borderRadius:"md",cursor:"pointer",minHeight:"150px",display:"flex",alignItems:"center",justifyContent:"center",textAlign:"center",children:[(0,a.jsx)("input",{...f()}),m?(0,a.jsx)(i.xvT,{children:m.name}):_?(0,a.jsx)(i.xvT,{children:"Drop the file here..."}):(0,a.jsx)(i.xvT,{children:"Click or drag and drop your file here."})]}),(0,a.jsx)(i.xvT,{fontSize:"sm",mt:4,children:"An integration template zip file must include a SaaS config and dataset, but may also contain an icon (.svg) as an optional file."})]}),(0,a.jsxs)(i.mzw,{className:"flex w-full justify-end gap-2",children:[(0,a.jsx)(i.wpx,{onClick:t,"data-testid":"cancel-btn",disabled:b,children:"Cancel"}),(0,a.jsx)(i.wpx,{type:"primary",htmlType:"submit",disabled:!m||b,onClick:k,"data-testid":"submit-btn",children:"Submit"})]})]})]})}},3765:function(e,s,t){"use strict";var a=t(38355),i=t(812),n=t(46628),r=t(1315),l=t(31883);s.Z=e=>{let s=(0,a.pmc)(),[t]=(0,r.qQ)(),o=t=>!!e.privacy_declarations.find(e=>e.data_use===t.data_use&&e.name===t.name)&&(s((0,n.Vo)("A declaration already exists with that data use in this system. Please supply a different data use.")),!0),d=(e,t)=>{if((0,l.D4)(e)){let t=(0,i.e$)(e.error,"An unexpected error occurred while updating the system. Please try again.");s((0,n.Vo)(t));return}return s.closeAll(),s((0,n.t5)(t?"Data use deleted":"Data use saved")),e.data.privacy_declarations},c=async(s,a)=>{let i=s.map(e=>{var s;return{...e,name:null!==(s=e.name)&&void 0!==s?s:""}}),n={...e,privacy_declarations:i};return d(await t(n),a)};return{createDataUse:async t=>{if(!o(t))return s.closeAll(),c([...e.privacy_declarations,t])},updateDataUse:async(s,t)=>{if(!(t.id!==s.id&&o(t)))return c(e.privacy_declarations.map(e=>e.id===s.id?t:e))},deleteDataUse:async s=>c(e.privacy_declarations.filter(e=>e.id!==s.id),!0),deleteDeclarationByDataUse:async s=>c(e.privacy_declarations.filter(e=>e.data_use!==s),!0)}}},41337:function(e,s,t){"use strict";var a=t(24246),i=t(38355);t(27378);var n=t(88337),r=t(16394),l=t(14746);let o=l.Ny+l.iW.get(n.R.WEBSITE),d=e=>void 0!==e.connection_type,c=e=>void 0!==e.encoded_icon,u=e=>(null==e?void 0:e.connection_type)===n.R.WEBSITE,p=e=>(null==e?void 0:e.connection_type)===n.R.SAAS;s.Z=e=>{let{data:s,...t}=e;return(0,a.jsx)(i.Eep,{boxSize:"32px",objectFit:"cover",src:(()=>{var e,t;let a;if(c(s)&&s.encoded_icon)return"data:image/svg+xml;base64,".concat(s.encoded_icon);if(u(s)){let t=null===(e=s.secrets)||void 0===e?void 0:e.url;if(!t)return o;let a=(0,r.ge)(t);return(0,r.tl)(a,100)}if(d(s)){if(p(s)&&(null===(t=s.saas_config)||void 0===t?void 0:t.type)){let e=s.saas_config.type,t=l.LN.get(e);return t?l.Ny+t:l.Ny+l.iW.get(n.R.SAAS)}a=[...l.iW].find(e=>{let[t]=e;return s.connection_type.toString()===t.toString()})}else if(c(s)){let{identifier:e}=s;a=[...l.iW].find(s=>{let[t]=s;return t.toLowerCase()===e.toLowerCase()})}return a?l.Ny+a[1]:l.VD})(),fallbackSrc:u(s)?o:l.VD,alt:(()=>{if(d(s)){var e;return null!==(e=s.name)&&void 0!==e?e:s.key}return c(s)?s.human_readable:s})(),...t})}},73183:function(e,s,t){"use strict";var a=t(24246),i=t(38355);t(27378);var n=t(14207);s.Z=e=>{let{connection_key:s,disabled:t,name:r,access_type:l,connection_type:o,isSwitch:d}=e,{isOpen:c,onOpen:u,onClose:p}=(0,i.qY0)(),[m,h]=(0,n.XX)(),x=async()=>{await m({key:s,name:r,disabled:!t,access:l,connection_type:o}),p()},g=()=>{h.isLoading||p()};return(0,a.jsxs)(a.Fragment,{children:[d?(0,a.jsxs)(i.kCb,{justifyContent:"space-between",alignItems:"center",children:[(0,a.jsx)(i.xvT,{fontSize:"sm",children:"Enable integration"}),(0,a.jsx)(i.rAg,{className:"ml-2",checked:!t,onChange:()=>u()})]}):(0,a.jsx)(i.sNh,{_focus:{color:"complimentary.500",bg:"gray.100"},onClick:u,children:(0,a.jsx)(i.xvT,{fontSize:"sm",children:t?"Enable":"Disable"})}),(0,a.jsxs)(i.u_l,{isCentered:!0,isOpen:c,onClose:g,children:[(0,a.jsx)(i.ZAr,{}),(0,a.jsxs)(i.hzk,{children:[(0,a.jsxs)(i.xBx,{children:[t?"Enable":"Disable"," Connection"]}),(0,a.jsx)(i.olH,{}),(0,a.jsx)(i.fef,{pb:6,children:(0,a.jsx)(i.Kqy,{direction:"column",spacing:"15px",children:(0,a.jsxs)(i.xvT,{color:"gray.600",fontSize:"sm",fontWeight:"sm",lineHeight:"20px",children:[t?"Enabling":"Disabling"," a connection may impact any privacy request that is currently in progress. Do you wish to proceed?"]})})}),(0,a.jsxs)(i.mzw,{className:"flex gap-4",children:[(0,a.jsx)(i.wpx,{onClick:g,className:"w-1/2",children:"Cancel"}),(0,a.jsxs)(i.wpx,{onClick:x,loading:h.isLoading,className:"w-1/2",children:[t?"Enable":"Disable"," Connection"]})]})]})]})]})}},8627:function(e,s,t){"use strict";t.d(s,{s:function(){return l}});var a=t(24246),i=t(38355),n=t(77867),r=t(16394);let l=e=>{let{succeeded:s,timestamp:t}=e,l=t?(0,r.p6)(t):"";return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.Z,{connected:s}),(0,a.jsx)(i.xvT,{color:"gray.500",fontSize:"xs",fontWeight:"semibold",lineHeight:"16px",ml:"10px",children:t?"Last tested on ".concat(l):"This connection has not been tested yet"})]})}},27259:function(e,s,t){"use strict";var a=t(24246),i=t(38355),n=t(34090);s.Z=e=>{let{disabled:s=!1,isRequired:t=!1,label:r,placeholder:l,type:o="text",...d}=e,{id:c,autoFocus:u}=d,[p,m]=(0,n.U$)(d);return(0,a.jsxs)(i.NIc,{display:"flex",isRequired:t,isInvalid:!!(m.error&&m.touched),children:[r&&(0,a.jsx)(i.lXp,{color:"gray.900",fontSize:"14px",fontWeight:"semibold",htmlFor:c,minWidth:"150px",children:r}),(0,a.jsxs)(i.gCW,{align:"flex-start",w:"inherit",children:["number"===o&&(0,a.jsxs)(i.Y2U,{allowMouseWheel:!0,color:"gray.700",defaultValue:0,min:0,size:"sm",children:[(0,a.jsx)(i.zuI,{...p,autoComplete:"off",autoFocus:u}),(0,a.jsxs)(i.FiK,{children:[(0,a.jsx)(i.WQu,{}),(0,a.jsx)(i.Y_d,{})]})]}),"text"===o&&(0,a.jsx)(i.IIB,{...p,autoComplete:"off",autoFocus:u,color:"gray.700",isDisabled:s,placeholder:l,size:"sm"}),"textarea"===o&&(0,a.jsx)(i.gxH,{...p,autoComplete:"off",autoFocus:u,color:"gray.700",placeholder:l,resize:"none",size:"sm",value:p.value||""}),(0,a.jsx)(i.J1D,{children:m.error})]})]})}},19812:function(e,s,t){"use strict";t.d(s,{t:function(){return l}});var a=t(14047),i=t(14207),n=t(27378),r=t(41966);let l=e=>{var s,t,l;let{connectionConfig:o}=e,[d]=(0,i.S6)(),{data:c}=(0,i.Eg)(null!==(t=null==o?void 0:o.key)&&void 0!==t?t:""),u=null!==(l=null==c?void 0:null===(s=c.items)||void 0===s?void 0:s.map(e=>e.fides_key))&&void 0!==l?l:[],p=u.map(e=>({label:e,value:e})),{data:m}=(0,r.LH)({onlyUnlinkedDatasets:!0}),h=(0,n.useMemo)(()=>{var e;return null!==(e=null==m?void 0:m.map(e=>({value:e.fides_key,label:"".concat(e.name," (").concat(e.fides_key,")")||0})))&&void 0!==e?e:[]},[m]),{errorAlert:x,successAlert:g}=(0,a.V)();return{dropdownOptions:[...p,...h],initialDatasets:u,patchConnectionDatasetConfig:async function(e,s){var t,a,i;let{showSuccessAlert:n=!0}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=null!==(i=null===(t=e.dataset)||void 0===t?void 0:t.map(e=>({fides_key:e,ctl_dataset_fides_key:e})))&&void 0!==i?i:[],l=await d({connection_key:s,dataset_pairs:r}).unwrap();(null===(a=l.failed)||void 0===a?void 0:a.length)>0?x(l.failed[0].message):n&&g("Dataset successfully updated!")}}}},72774:function(e,s,t){"use strict";t.d(s,{Z:function(){return r}});var a=t(24246),i=t(38355),n=e=>{let{title:s,description:t,button:n}=e;return(0,a.jsxs)(i.Ugi,{backgroundColor:"gray.50",border:"1px solid",borderColor:"blue.400",borderRadius:"md",justifyContent:"space-between",py:4,px:6,"data-testid":"empty-state",children:[(0,a.jsx)(i.iid,{alignSelf:"start",color:"blue.400",mt:.5}),(0,a.jsxs)(i.xuv,{flexGrow:1,children:[(0,a.jsx)(i.xvT,{fontWeight:"bold",fontSize:"sm",mb:1,children:s}),(0,a.jsx)(i.xvT,{fontSize:"sm",color:"gray.600",lineHeight:"5",children:t})]}),n]})},r=()=>(0,a.jsx)(i.xuv,{mb:"6",maxW:"720px","data-testid":"locked-for-GVL-notice",children:(0,a.jsx)(n,{title:"This system is part of the TCF Global Vendor List (GVL)",description:(0,a.jsxs)(a.Fragment,{children:["As a result, the system fields are not editable as they come directly from Fides Compass and the Global Vendor List (GVL). In some cases where the legal basis has been declared to be flexible, you may update the legal basis for particular data uses."," ",(0,a.jsx)(i.rUS,{href:"https://fid.es/tcf_gvl",isExternal:!0,color:"complimentary.500",children:"For more information on the Global Vendor List, click here."})]})})})},69525:function(e,s,t){"use strict";t.d(s,{U:function(){return a}});let a=e=>{let s=e.data_categories.flatMap(e=>e.split(","));return{data_use:e.data_use,data_categories:s,features:e.features,legal_basis_for_processing:e.legal_basis_for_processing,flexible_legal_basis_for_processing:e.flexible_legal_basis_for_processing,retention_period:e.retention_period?e.retention_period:""}}},72250:function(e,s,t){"use strict";t.d(s,{Z:function(){return sH}});var a,i,n=t(24246),r=t(84720),l=t(38355),o=t(79894),d=t.n(o),c=t(86677),u=t.n(c),p=t(27378),m=t(16134),h=t(25980),x=t(45938),g=t(16220),y=t(77830),f=t(46628),_=t(26089),v=t(19904),b=t(16394),j=t(20682),k=t(41337);let w=e=>{let{connectionConfig:s}=e,t=(0,m.C)(j.pw),{data:a}=(0,j.$I)(t),i=(0,p.useMemo)(()=>(null==a?void 0:a.items)||[],[a]),[n,r]=(0,p.useState)(),l=(0,p.useMemo)(()=>[...i].sort((e,s)=>e.human_readable>s.human_readable?1:-1),[i]),o=(0,p.useMemo)(()=>{let e=new Map;return null==l||l.map(s=>e.set(s.human_readable,{value:s})),e},[l]),d=(0,p.useMemo)(()=>{var e;return(null===(e=i.find(e=>e.identifier===(null==s?void 0:s.connection_type)||(null==s?void 0:s.saas_config)&&e.identifier===(null==s?void 0:s.saas_config.type)))||void 0===e?void 0:e.type)||"ethyca"},[s,i]);return(0,p.useMemo)(()=>{let e=i.find(e=>(null==s?void 0:s.saas_config)&&e.identifier===(null==s?void 0:s.saas_config.type)||e.identifier===(null==s?void 0:s.connection_type));e&&r(e)},[s,i]),{dropDownOptions:o,selectedValue:n,setSelectedValue:r,systemType:d}};var C=e=>{var s;let{disabled:t,hasClear:a=!0,label:i,list:r,onChange:o,selectedValue:d}=e,c=(0,p.useRef)(null),[u,m]=(0,p.useState)(!1),[h,x]=(0,p.useState)(""),g=()=>{m(!1)},y=null===(s=[...r].find(e=>{let[,s]=e;return s.value.identifier===(null==d?void 0:d.identifier)}))||void 0===s?void 0:s[0],f=(0,p.useCallback)(e=>{(0===e.target.value.length||e.target.value.length>1)&&(x(e.target.value),setTimeout(()=>{var e;return null===(e=c.current)||void 0===e?void 0:e.focus()},0))},[]),_=(0,p.useMemo)(()=>(0,b.Ds)(f,100),[f]),v=(0,p.useMemo)(()=>[...r].filter(e=>e[0].toLowerCase().includes(h.toLowerCase())),[r,h]);return(0,n.jsxs)(l.v2r,{isLazy:!0,onClose:g,onOpen:()=>{m(!0)},strategy:"fixed",matchWidth:!0,children:[(0,n.jsx)(l.j2t,{"aria-label":null!=y?y:i,as:l.wpx,color:y?"complimentary.500":void 0,disabled:t,icon:(0,n.jsx)(l.mCO,{}),iconPosition:"end",className:"!bg-transparent text-left hover:bg-transparent active:bg-transparent","data-testid":"select-dropdown-btn",width:"272px",children:(0,n.jsx)(l.xvT,{noOfLines:1,style:{wordBreak:"break-all"},children:null!=y?y:i})}),u?(0,n.jsxs)(l.qyq,{id:"MENU_LIST",lineHeight:"1rem",p:"0",maxHeight:"400px",overflow:"hidden","data-testid":"select-dropdown-list",width:"272px",children:[(0,n.jsx)(l.xuv,{px:"8px",mt:2,children:(0,n.jsxs)(l.BZy,{size:"sm",children:[(0,n.jsx)(l.Z8_,{pointerEvents:"none",children:(0,n.jsx)(l.PTu,{color:"gray.300",h:"17px",w:"17px"})}),(0,n.jsx)(l.IIB,{"data-testid":"input-search-integrations",ref:c,autoComplete:"off",autoFocus:!0,borderRadius:"md",name:"search",onChange:_,placeholder:"Search integrations",size:"sm",type:"search"})]})}),a&&(0,n.jsx)(l.kCb,{borderBottom:"1px",borderColor:"gray.200",cursor:"auto",p:"8px",children:(0,n.jsx)(l.wpx,{onClick:()=>{o(void 0),x(""),g()},size:"small",children:"Clear"})}),(0,n.jsx)(l.xuv,{overflowY:"auto",maxHeight:"272px",children:v.map(e=>{let[s,t]=e;return(0,n.jsx)(l.esZ,{title:t.toolTip,placement:"rightTop",mouseEnterDelay:.5,children:(0,n.jsxs)(l.sNh,{color:d===t.value?"complimentary.500":void 0,isDisabled:t.isDisabled,onClick:()=>o(t.value),paddingTop:"10px",paddingRight:"8.5px",paddingBottom:"10px",paddingLeft:"8.5px",_focus:{bg:"gray.100"},children:[(0,n.jsx)(k.Z,{data:t.value}),(0,n.jsx)(l.xvT,{ml:2,fontSize:"0.75rem",noOfLines:1,wordBreak:"break-all",children:s})]})},s)})})]}):null]})},S=t(14047),D=t(1315),T=t(46420),A=t(84306),E=t(14207),R=t(59301),q=(0,l.IUT)({displayName:"RightArrow",viewBox:"0 0 16 16",d:"M10.7814 7.33312L7.20541 3.75712L8.14808 2.81445L13.3334 7.99979L8.14808 13.1851L7.20541 12.2425L10.7814 8.66645H2.66675V7.33312H10.7814Z"}),I=t(19812),z=e=>{let{status:s,failure_reason:t}=e;if("error"===s){let e="Connection test failed.";return t&&(e+=" ".concat(t)),(0,n.jsx)(l.xvT,{"data-testid":"toast-error-msg",children:e})}return(0,n.jsx)(l.xvT,{"data-testid":"toast-success-msg",children:"Connection test was successful"})},F=t(8627),L=t(32885),O=t(65450),Z=t(40324),W=t(34090),P=t(55484),N=t(97181),U=t(57072),V=t(39864),M=t(27259);let B=e=>{let{isSubmitting:s=!1,onCancelClick:t}=e;return(0,n.jsxs)(l.hE2,{size:"sm",spacing:"8px",variant:"outline",children:[(0,n.jsx)(l.zxk,{onClick:t,variant:"outline",children:"Cancel"}),(0,n.jsx)(l.zxk,{bg:"primary.800",color:"white",isDisabled:s,isLoading:s,loadingText:"Submitting",size:"sm",variant:"solid",type:"submit",_active:{bg:"primary.500"},_disabled:{opacity:"inherit"},_hover:{bg:"primary.400"},children:"Save"})]})};var K=e=>{let{data:s=[],isSubmitting:t=!1,onSaveClick:a,onCancel:i}=e,{isLoading:r}=(0,U.MO)(),o=(0,m.C)(V.qb),{errorAlert:d}=(0,S.V)();return r?null:(0,n.jsx)(W.J9,{enableReinitialize:!0,initialValues:{fields:s.length>0?s:[{pii_field:"",dsr_package_label:"",data_categories:[]}]},onSubmit:(e,s)=>{if(new Set(e.fields.map(e=>e.pii_field)).size<e.fields.length){d("PII Field must be unique");return}a(e,s)},validateOnBlur:!1,validateOnChange:!1,validationSchema:P.Ry({fields:P.IX().of(P.Ry().shape({pii_field:P.Z_().required("PII Field is required").min(1,"PII Field must have at least one character").max(200,"PII Field has a maximum of 200 characters").label("PII Field"),dsr_package_label:P.Z_().required("DSR Package Label is required").min(1,"DSR Package Label must have at least one character").max(200,"DSR Package Label has a maximum of 200 characters").label("DSR Package Label"),data_categories:P.IX(P.Z_()).label("Data Categories")}))}),children:e=>(0,n.jsx)(W.l0,{style:{marginTop:0},noValidate:!0,children:(0,n.jsx)(l.gCW,{align:"stretch",children:(0,n.jsx)(W.F2,{name:"fields",render:s=>{let{fields:a}=e.values;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(l.Ugi,{color:"gray.900",flex:"1",fontSize:"14px",fontWeight:"semibold",lineHeight:"20px",mb:"6px",spacing:"24px",children:[(0,n.jsx)(l.xuv,{w:"416px",children:"PII Field"}),(0,n.jsx)(l.xuv,{w:"416px",children:"DSR Package Label"}),(0,n.jsx)(l.xuv,{w:"416px",children:"Data Categories"}),(0,n.jsx)(l.xuv,{visibility:"hidden",children:(0,n.jsx)(l.lr0,{})})]}),(0,n.jsx)(l.xuv,{children:a&&a.length>0?a.map((e,t)=>(0,n.jsxs)(l.Ugi,{mt:t>0?"12px":void 0,spacing:"24px",align:"flex-start",children:[(0,n.jsx)(l.xuv,{minH:"57px",w:"416px",children:(0,n.jsx)(M.Z,{autoFocus:0===t,isRequired:!0,name:"fields.".concat(t,".pii_field")})}),(0,n.jsx)(l.xuv,{minH:"57px",w:"416px",children:(0,n.jsx)(M.Z,{isRequired:!0,name:"fields.".concat(t,".dsr_package_label")})}),(0,n.jsx)(l.xuv,{minH:"57px",w:"416px",children:(0,n.jsx)(N.d,{name:"fields.".concat(t,".data_categories"),options:o.map(e=>({value:e.fides_key,label:e.fides_key})),isRequired:!0,mode:"multiple"})}),(0,n.jsx)(l.xuv,{h:"57px",visibility:t>0?"visible":"hidden",children:(0,n.jsx)(l.lr0,{onClick:()=>s.remove(t),_hover:{cursor:"pointer"}})})]},t)):null}),(0,n.jsx)(l.xvT,{color:"complimentary.500",fontWeight:"medium",fontSize:"sm",mb:"24px !important",mt:"24px !important",onClick:()=>{s.push({pii_field:"",dsr_package_label:"",data_categories:[]})},_hover:{cursor:"pointer"},children:"Add new PII field"}),(0,n.jsx)(B,{isSubmitting:t,onCancelClick:i})]})}})})})})},H=e=>{let{connectionConfig:s}=e,t=(0,p.useRef)(!1),{successAlert:a}=(0,S.V)(),{handleError:i}=(0,S.H)(),[r,o]=(0,p.useState)(!1),[d,c]=(0,p.useState)([]),{isOpen:u,onOpen:m,onClose:h}=(0,l.qY0)(),{data:x,isFetching:g,isLoading:y,isSuccess:f}=(0,E.QV)(s?s.key:"",{skip:!s}),[_]=(0,E.jF)(),[v]=(0,E._d)(),b=async(e,t)=>{try{o(!0);let t={connection_key:s.key,body:{...e}};d.length>0?await v(t).unwrap():await _(t).unwrap(),a("DSR customization ".concat(d.length>0?"updated":"added","!"))}catch(e){i(e)}finally{o(!1)}};(0,p.useEffect)(()=>(t.current=!0,f&&x&&c(x.fields),()=>{t.current=!1}),[x,f]);let j=(0,n.jsx)(l.wpx,{disabled:!s||r,loading:r,onClick:m,children:"Customize DSR"});return(0,n.jsxs)(n.Fragment,{children:[s?j:(0,n.jsx)(l.esZ,{title:"Save an Integration first to customize the DSR",placement:"top",children:j}),(0,n.jsxs)(l.u_l,{isCentered:!0,isOpen:u,size:"lg",onClose:h,children:[(0,n.jsx)(l.ZAr,{}),(0,n.jsxs)(l.hzk,{minWidth:"775px",children:[(0,n.jsx)(l.xBx,{children:"Customize DSR"}),(0,n.jsx)(l.olH,{}),(0,n.jsx)(l.fef,{pb:6,children:(0,n.jsxs)(l.gCW,{align:"stretch",gap:"16px",children:[(0,n.jsx)(l.xuv,{color:"gray.700",fontSize:"14px",children:'Customize your PII fields to create a friendly label name for your privacy request packages. This "Package Label" is the label your user will see in their downloaded package.'}),(g||y)&&(0,n.jsx)(l.M5Y,{children:(0,n.jsx)(l.$jN,{})}),t.current&&!y?(0,n.jsx)(K,{data:d,isSubmitting:r,onSaveClick:b,onCancel:h}):null]})})]})]})]})},Y=t(98784),G=t.n(Y),$=t(71248),Q=t(46782),J=t(73183),X=t(95492),ee=e=>{let{onDelete:s,deleteResult:t}=e,{isOpen:a,onOpen:i,onClose:r}=(0,l.qY0)(),o=()=>{(!t.isLoading&&t.isSuccess||!t.isLoading&&t.isUninitialized)&&r()};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(l.LZC,{}),(0,n.jsxs)(l.kCb,{alignItems:"center",children:[(0,n.jsx)(l.xvT,{fontSize:"sm",children:"Delete integration"}),(0,n.jsx)(l.wpx,{"aria-label":"Delete integration",icon:(0,n.jsx)(X.l,{}),disabled:t.isLoading,onClick:i,className:"ml-2"})]})]}),(0,n.jsxs)(l.u_l,{isCentered:!0,isOpen:a,onClose:o,children:[(0,n.jsx)(l.ZAr,{}),(0,n.jsxs)(l.hzk,{children:[(0,n.jsx)(l.xBx,{children:"Delete integration"}),(0,n.jsx)(l.olH,{}),(0,n.jsx)(l.fef,{pb:6,children:(0,n.jsx)(l.Kqy,{direction:"column",spacing:"15px",children:(0,n.jsx)(l.xvT,{color:"gray.600",fontSize:"sm",fontWeight:"sm",lineHeight:"20px",children:"Deleting an integration may impact any privacy request that is currently in progress. Do you wish to proceed?"})})}),(0,n.jsxs)(l.mzw,{children:[(0,n.jsx)(l.wpx,{onClick:o,className:"w-1/2",children:"Cancel"}),(0,n.jsx)(l.wpx,{onClick:()=>{s()},loading:t.isLoading,type:"primary",className:"w-1/2",children:"Delete integration"})]})]})]})]})},es=t(99792);let et=(e,s)=>{let t={...e};return s&&Object.entries(s.properties).forEach(e=>{let[s,a]=e;if("secrets"in t||(t.secrets={}),"integer"===a.type)t.secrets[s]=a.default?Number(a.default):0;else{var i;t.secrets[s]=null!==(i=a.default)&&void 0!==i?i:""}}),t},ea=(e,s)=>{let t=e.replace(/[^A-Za-z0-9\-_]/g,"");return t.includes(s.identifier)||(t+="_".concat(s.identifier)),s.type===es.Z.SAAS&&(t+="_api"),t},ei=e=>{let{secretsSchema:s,defaultValues:t,isSubmitting:a=!1,isAuthorizing:i=!1,onSaveClick:r,onTestConnectionClick:o,onTestDatasetsClick:d,onAuthorizeConnectionClick:c,testButtonLabel:u="Test integration",connectionOption:p,connectionConfig:m,initialDatasets:x,datasetDropdownOptions:g,isCreatingConnectionConfig:y,onDelete:f,deleteResult:_}=e,[v,{isLoading:b,isFetching:j}]=(0,E.h2)(),{plus:k}=(0,h.hz)(),{getFieldValidation:w,preprocessValues:C}=(0,Q.l)(s),S=async(e,s)=>{Object.keys(await s.validateForm()).length>0||c(C(e))},D=async e=>{Object.keys(await e.validateForm()).length>0||o(await v(m.key))},A=(null==m?void 0:m.disabled)||!1;return(0,n.jsx)(W.J9,{enableReinitialize:!0,initialValues:(()=>{let e={...t};if(null==m?void 0:m.key){var a,i;return e.name=null!==(i=m.name)&&void 0!==i?i:"",e.description=m.description,e.instance_key=m.connection_type===T.Rj.SAAS?null===(a=m.saas_config)||void 0===a?void 0:a.fides_key:m.key,e.enabled_actions=(m.enabled_actions||[]).map(e=>e.toString()),e.secrets=m.secrets?G().cloneDeep(m.secrets):{},e.dataset=x,(null==s?void 0:s.properties)&&Object.entries(s.properties).forEach(s=>{var t;let[a,i]=s;if((null===(t=i.allOf)||void 0===t?void 0:t[0].$ref)===Q.j){let s=e.secrets[a];s&&(e.secrets[a]="".concat(s.dataset,".").concat(s.field))}}),e}return G().isEmpty(e.enabled_actions)&&(e.enabled_actions=p.supported_actions.map(e=>e.toString())),et(e,s)})(),onSubmit:(e,s)=>{r(C(e),s)},validateOnBlur:!0,children:e=>{var t;let r=!e.dirty&&(null==m?void 0:m.authorized);return(0,n.jsx)(W.l0,{children:(0,n.jsxs)(l.gCW,{align:"stretch",gap:"16px",children:[(0,n.jsxs)("div",{className:"flex flex-row",children:[m?(0,n.jsx)(J.Z,{connection_key:null==m?void 0:m.key,disabled:A,connection_type:null==m?void 0:m.connection_type,access_type:null==m?void 0:m.access,name:null!==(t=null==m?void 0:m.name)&&void 0!==t?t:m.key,isSwitch:!0}):null,m?(0,n.jsx)(ee,{onDelete:f,deleteResult:_}):null]}),!!(null==m?void 0:m.key)&&(0,n.jsx)(Z.j0,{name:"instance_key",id:"instance_key",label:"Integration identifier",isRequired:!0,disabled:!!(null==m?void 0:m.key),tooltip:"The fides_key will allow fidesops to associate dataset field references appropriately. Must be a unique alphanumeric value with no spaces (underscores allowed) to represent this integration."},"instance_key"),s?Object.entries(s.properties).map(e=>{var t;let[a,i]=e;return"advanced_settings"===a?null:(0,n.jsx)($.A,{name:"secrets.".concat(a),fieldSchema:i,isRequired:null===(t=s.required)||void 0===t?void 0:t.includes(a),secretsSchema:s,validate:w(a,i),layout:"inline"},"secrets.".concat(a))}):null,k&&(0,n.jsx)(N.d,{name:"enabled_actions",id:"enabled_actions",label:"Request types",isRequired:!0,layout:"inline",mode:"multiple",tooltip:"The request types that are supported for this integration",options:p.supported_actions.map(e=>({label:G().upperFirst(e),value:e}))},"enabled_actions"),T.Zi.DATABASE===p.type&&!y&&(0,n.jsx)(N.d,{name:"dataset",id:"dataset",tooltip:"Select datasets to associate with this integration",label:"Datasets",options:g,layout:"inline",mode:"multiple"}),(0,n.jsxs)("div",{className:"flex gap-4",children:[!p.authorization_required||r?(0,n.jsx)(l.wpx,{disabled:!(null==m?void 0:m.key)||a||_.isLoading,loading:b||j,onClick:()=>D(e),"data-testid":"test-connection-button",children:u}):null,k&&T.Zi.DATABASE===p.type&&!G().isEmpty(x)&&(0,n.jsx)(l.wpx,{onClick:()=>d(),children:"Test datasets"}),p.authorization_required&&!r?(0,n.jsx)(l.wpx,{loading:i,onClick:()=>S(e.values,e),children:"Authorize integration"}):null,p.type===T.Zi.MANUAL?(0,n.jsx)(H,{connectionConfig:m}):null,(0,n.jsx)(l.LZC,{}),(0,n.jsx)(l.wpx,{type:"primary",disabled:_.isLoading||a,loading:a,htmlType:"submit","data-testid":"save-btn",children:"Save"})]})]})})}})},en=async(e,s,t,a,i)=>{let n={description:e.description||"",instance_key:ea(a,t),saas_connector_type:t.identifier,secrets:{},...e.enabled_actions?{enabled_actions:e.enabled_actions}:{}},r={systemFidesKey:a,connectionConfig:n};return Object.entries(s.properties).forEach(s=>{r.connectionConfig.secrets[s[0]]=e.secrets[s[0]]}),await i(r).unwrap()},er=async(e,s,t,a,i)=>{var n;let r=a?a.key:ea(t,s),l={access:T.uv.WRITE,connection_type:s.type===T.Zi.SAAS?s.type:s.identifier,description:e.description,key:r,...e.enabled_actions?{enabled_actions:e.enabled_actions}:{}},o=await i({systemFidesKey:t,connectionConfigs:[l]}).unwrap();if((null===(n=o.failed)||void 0===n?void 0:n.length)>0){let e=o.failed[0].message;throw Object.assign(Error(e),{data:{detail:e}})}return o},el=async(e,s,t,a,i)=>{let n={systemFidesKey:t,secrets:{}};return(Object.entries(s.properties).forEach(s=>{s[0]in a&&e.secrets[s[0]]===a[s[0]]||(n.secrets[s[0]]=e.secrets[s[0]])}),0===Object.keys(n.secrets).length)?Promise.resolve():await i(n).unwrap()},eo=e=>{let{secretsSchema:s,systemFidesKey:t,connectionOption:a,connectionConfig:i,setSelectedConnectionOption:n}=e,{successAlert:r}=(0,A.V)(),{handleError:l}=(0,S.H)(),o=(0,m.T)(),[d,c]=(0,p.useState)(!1),[u,x]=(0,p.useState)(!1),{dropdownOptions:g,patchConnectionDatasetConfig:y,initialDatasets:f}=(0,I.t)({connectionConfig:i}),[_]=(0,E.NG)(),[v]=(0,L.IB)(),[b]=(0,E.rO)(),[j]=(0,O.Zh)(),[k]=(0,O.qd)(),[w]=(0,L.kg)(),[C,D]=(0,O._w)(),{plus:R}=(0,h.hz)(),q=(0,p.useMemo)(()=>{var e;return null!==(e=null==i?void 0:i.secrets)&&void 0!==e?e:{}},[i]),z=(0,m.C)(O.NC);return{isSubmitting:d,isAuthorizing:u,handleSubmit:async e=>{let n=!i;try{if(c(!0),a.type===T.Zi.SAAS&&n)i=(await en(e,s,a,t,R?v:_)).connection;else{let n=await er(e,a,t,i,R?w:k);i||a.type!==T.Zi.DATABASE||(i=n.succeeded[0]),a.type!==T.Zi.MANUAL&&await el(e,s,t,q,j)}i&&e.dataset&&a.type===T.Zi.DATABASE&&await y(e,i.key,{showSuccessAlert:!1}),r("Integration successfully ".concat(n?"added":"updated","!"))}catch(e){l(e)}finally{c(!1)}},handleAuthorization:async e=>{let n=!i;try{x(!0),n?i=(await en(e,s,a,t,_)).connection:await el(e,s,t,q,j);let r=await b(i.key).unwrap();x(!1),setTimeout(()=>{window.location.href=r},0)}catch(e){l(e)}finally{x(!1)}},datasetDropdownOptions:g,initialDatasets:f,handleDelete:async()=>{try{await C(t),o((0,O.db)({...z,connection_configs:null})),n(void 0),r("Integration successfully deleted!")}catch(e){l(e)}},deleteDatastoreConnectionResult:D}},ed=e=>{let{systemFidesKey:s,connectionOption:t,connectionConfig:a,setSelectedConnectionOption:i}=e,[r,o]=(0,p.useState)(),d=(0,l.pmc)(),c=t.type===T.Zi.MANUAL,{data:m}=(0,j.n3)(t.identifier,{skip:c}),{isSubmitting:h,isAuthorizing:x,handleSubmit:g,handleAuthorization:y,datasetDropdownOptions:_,initialDatasets:v,handleDelete:b,deleteDatastoreConnectionResult:k}=eo({secretsSchema:m,systemFidesKey:s,connectionOption:t,connectionConfig:a,setSelectedConnectionOption:i});return m||t.type===T.Zi.MANUAL?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(l.xuv,{borderRadius:"6px",border:"1px",borderColor:"gray.200",backgroundColor:"gray.50",fontSize:"14px",p:4,mb:4,children:[(0,n.jsxs)("div",{children:["Connect to your ",t.human_readable," environment by providing the information below. Once you have saved the form, you may test the integration to confirm that it's working correctly."]}),t.user_guide&&(0,n.jsx)("div",{style:{marginTop:"12px"},children:(0,n.jsxs)(R.Z,{href:t.user_guide,children:["View docs for help with this integration ",(0,n.jsx)(q,{})]})})]}),(0,n.jsx)(ei,{secretsSchema:m,defaultValues:{description:"",instance_key:"",name:"",dataset:[]},isSubmitting:h,isAuthorizing:x,onSaveClick:g,onTestConnectionClick:e=>{var s,t;o(e);let a=(null===(s=e.data)||void 0===s?void 0:s.test_status)==="succeeded"?"success":"error";d({...f.MA,status:a,description:(0,n.jsx)(z,{status:a,failure_reason:null===(t=e.data)||void 0===t?void 0:t.failure_reason})})},onTestDatasetsClick:()=>{u().push("/systems/configure/".concat(s,"/test-datasets"))},onAuthorizeConnectionClick:y,connectionOption:t,connectionConfig:a,datasetDropdownOptions:_,initialDatasets:v,isCreatingConnectionConfig:!a,onDelete:b,deleteResult:k}),a?(0,n.jsxs)(l.kCb,{mt:"4",justifyContent:"between",alignItems:"center",children:[r&&r.data&&void 0!==r.fulfilledTimeStamp?(0,n.jsx)(F.s,{succeeded:"succeeded"===r.data.test_status,timestamp:r.fulfilledTimeStamp}):(0,n.jsx)(F.s,{succeeded:null==a?void 0:a.last_test_succeeded,timestamp:(null==a?void 0:a.last_test_timestamp)||""}),(0,n.jsx)(l.LZC,{})]}):null]}):null};var ec=e=>{let{connectionConfigs:s,systemFidesKey:t}=e,{isOpen:a,onOpen:i,onClose:r}=(0,l.qY0)(),[o,d]=(0,p.useState)(null),{successAlert:c}=(0,S.V)(),[u,{isLoading:h}]=(0,D.qd)(),x=(0,m.C)(j.pw),{data:g}=(0,j.$I)(x),y=(0,p.useMemo)(()=>(null==g?void 0:g.items)||[],[g]),{handleError:f}=(0,S.H)(),_=()=>{h||(o&&d(null),r())},v=async()=>{try{if(o){var e;let s={...o,instance_key:o.connection_type===T.Rj.SAAS?null===(e=o.saas_config)||void 0===e?void 0:e.fides_key:o.key},a=y.find(e=>(null==o?void 0:o.saas_config)&&e.identifier===(null==o?void 0:o.saas_config.type)||e.identifier===(null==o?void 0:o.connection_type));(await er(s,a,t,o,u)).succeeded[0]&&c("Integration successfully linked!"),d(null),r()}}catch(e){f(e)}};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(l.wpx,{onClick:i,children:"Link integration"}),(0,n.jsxs)(l.u_l,{isCentered:!0,isOpen:a,size:"lg",onClose:_,children:[(0,n.jsx)(l.ZAr,{}),(0,n.jsxs)(l.hzk,{children:[(0,n.jsx)(l.xBx,{children:"Unlinked Integrations"}),(0,n.jsx)(l.olH,{}),(0,n.jsx)(l.fef,{pb:6,children:(0,n.jsxs)(l.Kqy,{direction:"column",spacing:"15px",children:[(0,n.jsx)(l.xvT,{color:"gray.600",fontSize:"sm",fontWeight:"sm",lineHeight:"20px",children:"These are all the integrations that are not linked to a system. Please select an integration to link to a system."}),(0,n.jsx)(l.xuv,{maxHeight:"350px",height:"100%",overflowY:"auto",children:s.map(e=>(0,n.jsxs)(l.kCb,{flexDirection:"row",alignItems:"center",_hover:{bg:"gray.100",color:"gray.600"},bg:(null==o?void 0:o.key)===e.key?"gray.100":"unset",color:(null==o?void 0:o.key)===e.key?"gray.600":"unset",cursor:"pointer",onClick:()=>{d(e)},className:"mb-2",children:[(0,n.jsx)(k.Z,{data:e,className:"mr-2"}),(0,n.jsx)(l.xvT,{children:e.name})]},e.key))})]})}),(0,n.jsxs)(l.mzw,{className:"flex gap-4",children:[(0,n.jsx)(l.wpx,{onClick:_,className:"w-1/2",children:"Cancel"}),(0,n.jsx)(l.wpx,{onClick:v,loading:h,disabled:!o||h,className:"w-1/2",children:"Link integration"})]})]})]})]})},eu=t(44553),ep=e=>{let{connectionConfig:s,systemFidesKey:t}=e,{dropDownOptions:a,selectedValue:i,setSelectedValue:r}=w({connectionConfig:s}),o=(0,m.C)(E.dR),{data:d}=(0,E.AZ)({...o,orphaned_from_system:!0}),[c,u]=(0,p.useState)([]);(0,p.useEffect)(()=>{d&&u(d.items)},[d]);let h=(0,l.qY0)();return(0,n.jsxs)(l.xuv,{id:"con-wrapper",px:6,children:[(0,n.jsxs)(l.kCb,{py:5,children:[(0,n.jsxs)(l.Kqy,{direction:{base:"column",lg:"row"},children:[(0,n.jsx)(C,{list:a,label:"Integration type",selectedValue:i,onChange:r,disabled:!!(s&&null!==s)}),!s&&c.length>0?(0,n.jsx)(ec,{connectionConfigs:c,systemFidesKey:t}):null,(0,n.jsx)(v.ZP,{scopes:[T.Sh.CONNECTOR_TEMPLATE_REGISTER],children:(0,n.jsx)(l.wpx,{htmlType:"submit","data-testid":"upload-btn",onClick:h.onOpen,className:"ml-2",children:"Upload integration"})})]}),(0,n.jsx)(eu.Z,{isOpen:h.isOpen,onClose:h.onClose})]}),(null==i?void 0:i.type)&&[T.Zi.DATABASE,T.Zi.DATA_CATALOG,T.Zi.SAAS,T.Zi.MANUAL,T.Zi.EMAIL].includes(i.type)?(0,n.jsx)(ed,{connectionConfig:s,connectionOption:i,setSelectedConnectionOption:r,systemFidesKey:t}):null]})},em=t(71922),eh=t(31883);let ex=e=>{let{item:s,options:t=[],onNoticeChange:a,isChild:i}=e,{external_id:r,name:o}=s,d="".concat(r,"-notice_id"),[c,,u]=(0,W.U$)(d),{setValue:p}=u;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(l.Ugi,{flexGrow:1,children:[i&&(0,n.jsx)(l.LqM,{}),(0,n.jsx)(l.lXp,{htmlFor:d,"data-testid":"consentable-item-label".concat(i?"-child":""),m:0,fontSize:"14px",fontWeight:i?"normal":"semibold",children:o})]}),(0,n.jsx)(l.WPr,{...c,id:d,allowClear:!0,placeholder:"None",options:t,onChange:e=>{p(e),a(s={...s,notice_id:e})},className:"w-full","data-testid":"consentable-item-select"})]})},eg=e=>{let{connectionKey:s,...t}=e,a=(0,l.pmc)(),{data:i,isLoading:r}=(0,L.EQ)(s),[o,{isLoading:d}]=(0,L.Am)(),c=(0,m.C)(em.Zp),u=(0,m.C)(em.G1),{data:h,isLoading:x}=(0,em.J6)({page:c,size:u}),[g,y]=(0,p.useState)(),[_,v]=(0,p.useState)([]),b=(0,p.useMemo)(()=>null==g?void 0:g.reduce((e,s)=>{var t;return s.notice_id&&(e["".concat(s.external_id,"-notice_id")]=s.notice_id),(null===(t=s.children)||void 0===t?void 0:t.length)&&s.children.forEach(s=>{s.notice_id&&(e["".concat(s.external_id,"-notice_id")]=s.notice_id)}),e},{}),[g]),j=e=>{let s=e.notice_id;if(s){let e=null==h?void 0:h.items.filter(e=>e.id===s);if(null==e?void 0:e.length){var t;let s=(null===(t=e[0].children)||void 0===t?void 0:t.map(e=>e.id))||[];return _.filter(e=>s.includes(e.value))}}return _},k=async()=>{let e=await o({connectionKey:s,consentableItems:g});(0,eh.D4)(e)?a((0,f.Vo)("Failed to save consent automation")):a({variant:"subtle",position:"top",duration:3e3,status:"success",isClosable:!0,description:(0,n.jsx)(l.xvT,{"data-testid":"toast-success-msg",children:"Your consent automation settings have been successfully saved and applied."}),title:"Settings updated"})};if((0,p.useEffect)(()=>{i&&y(i)},[i]),(0,p.useEffect)(()=>{h&&v(h.items.map(e=>({label:e.name,value:e.id})))},[h]),r||x)return(0,n.jsx)(l.xuv,{borderWidth:"1px",borderRadius:"md",...t,children:(0,n.jsx)(l.OdW,{height:"35px"})});if(!g||!g.length||!h)return null;let w=(e,s)=>{y(g.map(t=>{if(s?t.external_id===s.external_id:t.external_id===e.external_id){if(s){var a;return{...t,children:null===(a=t.children)||void 0===a?void 0:a.map(s=>s.external_id===e.external_id?e:s)}}return e}return t}))};return(0,n.jsx)(l.xuv,{borderWidth:"1px",borderRadius:"md",...t,children:(0,n.jsx)(l.UQy,{allowMultiple:!0,"data-testid":"accordion-consent-automation",children:(0,n.jsxs)(l.Qdk,{border:"none",children:[(0,n.jsxs)(l.KFZ,{children:[(0,n.jsx)(l.xuv,{as:"span",flex:"1",textAlign:"left",children:(0,n.jsx)(l.xvT,{as:"h2",fontWeight:"semibold",fontSize:"sm",children:"Consent automation"})}),(0,n.jsx)(l.XEm,{})]}),(0,n.jsxs)(l.Hk3,{p:5,fontSize:"sm","data-testid":"accordion-panel-consent-automation",children:[(0,n.jsx)(l.xvT,{mb:7,children:"Map consentable items, such as channels and subscriptions, from your integration to Fides privacy notices. This ensures that updates to consent preferences in either location remain accurate and up-to-date."}),(0,n.jsx)(W.J9,{initialValues:b||{},onSubmit:k,children:(0,n.jsxs)(W.l0,{children:[(0,n.jsx)(l.MIq,{columns:2,spacing:3,children:g.map(e=>{var s;return(0,n.jsxs)(p.Fragment,{children:[(0,n.jsx)(ex,{item:e,options:_,onNoticeChange:w}),null===(s=e.children)||void 0===s?void 0:s.map(s=>(0,n.jsx)(ex,{item:s,options:j(e),isChild:!0,onNoticeChange:s=>w(s,e)},s.external_id))]},e.external_id)})}),(0,n.jsx)(l.Ugi,{justifyContent:"flex-end",mt:3,children:(0,n.jsx)(l.wpx,{disabled:d,loading:d,type:"primary",htmlType:"submit","data-testid":"save-consent-automation",children:"Save"})})]})})]})]})})})};var ey=t(57865),ef=t(3124),e_=t.n(ef),ev=(0,l.IUT)({displayName:"NextArrow",viewBox:"0 0 12 12",d:"M6.58584 5.99999L4.11084 3.52499L4.81784 2.81799L7.99984 5.99999L4.81784 9.18199L4.11084 8.47499L6.58584 5.99999Z"}),eb=(0,l.IUT)({displayName:"PrevArrow",viewBox:"0 0 12 12",d:"M5.414 5.99999L7.889 8.47499L7.182 9.18199L4 5.99999L7.182 2.81799L7.889 3.52499L5.414 5.99999Z"});let ej=e=>{let s=new Date(e),t=navigator.language;return{formattedTime:s.toLocaleTimeString(t,{hour:"2-digit",minute:"2-digit",hour12:!0,timeZoneName:"short"}),formattedDate:s.toLocaleDateString(t,{year:"numeric",month:"long",day:"numeric"})}},ek=e=>({privacy_declarations:"data uses",ingress:"sources",egress:"destinations"})[e]||e,ew=(e,s)=>{let t=new Set([...Object.keys(e),...Object.keys(s)]),a=[],i=[],n=[];return Array.from(t).forEach(t=>{let r=ek(t),l=e[t],o=s[t];if("boolean"==typeof l||"boolean"==typeof o||"number"==typeof l||"number"==typeof o){l!==o&&n.push(r);return}!((G().isNil(l)||G().isEmpty(l))&&(G().isNil(o)||G().isEmpty(o)))&&(G().isEqual(l,o)||(G().isNil(l)||G().isEmpty(l)?a.push(r):G().isNil(o)||G().isEmpty(o)?i.push(r):n.push(r)))}),{addedFields:a,removedFields:i,changedFields:n}},eC=e=>{let{edited_by:s,before:t,after:a,created_at:i}=e,r=[],l=[],o=[];t.custom_fields||a.custom_fields?{addedFields:r,removedFields:l,changedFields:o}=ew(t.custom_fields,a.custom_fields):{addedFields:r,removedFields:l,changedFields:o}=ew(t,a);let d=[];if(r.length>0&&d.push(["added ",(0,n.jsx)("b",{children:r.join(", ")})]),l.length>0&&d.push(["removed ",(0,n.jsx)("b",{children:l.join(", ")})]),o.length>0&&d.push(["changed ",(0,n.jsx)("b",{children:o.join(", ")})]),0===d.length)return null;let c=d.pop(),u=d.length>0?(0,n.jsxs)(n.Fragment,{children:[d.map((e,s)=>(0,n.jsxs)(p.Fragment,{children:[e,s<d.length-1?", ":""]},s)),d.length>=2?", and ":" and ",c]}):c,{formattedTime:m,formattedDate:h}=ej(i);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("b",{children:s})," ",u," on ",h," at ",m]})},eS=(e,s)=>{let t=e=>e.map(e=>{let t=s.find(s=>s.fides_key===e.fides_key);return t&&t.name?t.name:e.fides_key}),a={...e.before},i={...e.after};return a.ingress&&(a.ingress=t(a.ingress)),a.egress&&(a.egress=t(a.egress)),i.ingress&&(i.ingress=t(i.ingress)),i&&i.egress&&(i.egress=t(i.egress)),{...e,before:a,after:i}},eD=(e,s)=>{if(G().isEmpty(s))return e;let t=(e,s)=>{var t,a;return null!==(a=null===(t=s.find(s=>s.value===e))||void 0===t?void 0:t.label)&&void 0!==a?a:e};return{...e,before:{...e.before,vendor_id:t(e.before.vendor_id,s)},after:{...e.after,vendor_id:t(e.after.vendor_id,s)}}},eT=e=>{let s=e.before.privacy_declarations||[],t=e.after.privacy_declarations||[],a=new Set([...s,...t].map(e=>e.data_use)),i=[],n=[];return a.forEach(e=>{let a=s.find(s=>s.data_use===e)||{data_use:"",data_categories:[]},r=t.find(s=>s.data_use===e)||{data_use:"",data_categories:[]};i.push(a),n.push(r)}),{...e,before:{...e.before,privacy_declarations:i},after:{...e.after,privacy_declarations:n}}},eA=e=>{let s={...e.before.custom_fields},t={...e.after.custom_fields};return new Set([...Object.keys(s),...Object.keys(t)]).forEach(e=>{e in s||(s[e]=null),e in t||(t[e]=null)}),{...e,before:{...e.before,custom_fields:s},after:{...e.after,custom_fields:t}}},eE=e=>{if(!e.before.privacy_declarations||!e.before.privacy_declarations[0]||!e.before.privacy_declarations[0].custom_fields)return e;let s={...e.before.privacy_declarations[0].custom_fields},t=e.after.privacy_declarations&&e.after.privacy_declarations[0]?{...e.after.privacy_declarations[0].custom_fields}:{};return new Set([...Object.keys(s),...Object.keys(t)]).forEach(e=>{e in s||(s[e]=null),e in t||(t[e]=null)}),{...e,before:{...e.before,privacy_declarations:[{...e.before.privacy_declarations[0],custom_fields:s}]},after:{...e.after,privacy_declarations:[{...e.after.privacy_declarations[0],custom_fields:t}]}}},eR=(0,p.createContext)(null),eq=()=>(0,p.useContext)(eR);var eI=e=>{let{children:s,selectedHistory:t,formType:a}=e,i=(0,p.useMemo)(()=>({selectedHistory:t,formType:a}),[t,a]);return(0,n.jsx)(eR.Provider,{value:i,children:s})},ez=t(62165),eF=t(30320),eL=e=>{let{heading:s,children:t}=e,{selectedHistory:a}=eq(),i=p.Children.toArray(t).filter(e=>{if(p.isValidElement(e)&&e.props.name){let{name:s}=e.props,t=G().get(null==a?void 0:a.before,s),i=G().get(null==a?void 0:a.after,s),n="boolean"!=typeof t&&"number"!=typeof t&&G().isEmpty(t),r="boolean"!=typeof i&&"number"!=typeof i&&G().isEmpty(i);return!n||!r}return!1});return 0===i.length?null:(0,n.jsx)(l.Kqy,{marginTop:"0px !important",children:(0,n.jsxs)(l.xuv,{maxWidth:"720px",border:"1px",borderColor:"gray.200",borderRadius:6,overflow:"visible",mt:6,children:[(0,n.jsx)(l.xuv,{backgroundColor:"gray.50",px:6,py:4,display:"flex",flexDirection:"row",alignItems:"center",borderBottom:"1px",borderColor:"gray.200",borderTopRadius:6,children:(0,n.jsx)(l.X6q,{as:"h3",size:"xs",children:s})}),(0,n.jsx)(l.Kqy,{children:i})]})})},eO=t(46238),eZ=e=>{var s;let{label:t,tooltip:a,...i}=e,{selectedHistory:r,formType:o}=eq(),[d]=(0,W.U$)(i.name),c={...d,value:null!==(s=d.value)&&void 0!==s?s:[]},u=(0,p.useRef)(null),[m,h]=(0,p.useState)(null),[x,g]=(0,p.useState)([]),[y,f]=(0,p.useState)(!1);(0,p.useEffect)(()=>{let e=G().get(null==r?void 0:r.before,i.name)||[],s=G().get(null==r?void 0:r.after,i.name)||[];f(!G().isEqual(e,s)),g(e.length>s.length?e:s)},[r,i.name]),(0,p.useEffect)(()=>{u.current&&h(u.current.offsetHeight)},[x]);let _={};return y&&(_="before"===o?{backgroundColor:"#FFF5F5",borderColor:"#E53E3E",borderTop:"1px dashed #E53E3E",borderBottom:"1px dashed #E53E3E"}:{backgroundColor:"#F0FFF4",borderColor:"#38A169",borderTop:"1px dashed #38A169",borderBottom:"1px dashed #38A169"}),(0,n.jsx)(l.NIc,{style:_,paddingLeft:4,paddingRight:4,paddingTop:3,paddingBottom:3,marginTop:"-1px !important",children:(0,n.jsxs)(l.gCW,{alignItems:"start",children:[(0,n.jsxs)(l.kCb,{alignItems:"center",children:[(0,n.jsx)(Z.__,{htmlFor:i.name,fontSize:"xs",my:0,mr:1,children:t}),(0,n.jsx)(eO.b,{label:a})]}),(0,n.jsx)(l.kCb,{wrap:"wrap",alignItems:"flex-start",ref:u,style:{minHeight:"".concat(m,"px")},children:(m?c.value:x).map((e,s)=>(0,n.jsx)(l.j8w,{color:"marble",className:"m-1",children:"object"==typeof e?e.fides_key:e},s))}),"before"===o&&y&&(0,n.jsx)("div",{style:{position:"absolute",right:"-22px",top:"50%",transform:"translateY(-50%)"},children:"→"})]})})},eW=e=>{var s;let{label:t,tooltip:a,...i}=e,{selectedHistory:r,formType:o}=eq(),[d]=(0,W.U$)(i),c={...d,value:null!==(s=d.value)&&void 0!==s?s:""},u=(0,p.useRef)(null),[m,h]=(0,p.useState)(null),[x,g]=(0,p.useState)(!1);(0,p.useEffect)(()=>{let e=G().get(null==r?void 0:r.before,i.name)||"",s=G().get(null==r?void 0:r.after,i.name)||"";g(!G().isEqual(e,s));let t=e.length>s.length?e:s;u.current&&(u.current.textContent=t,h(u.current.offsetHeight),u.current.textContent=c.value)},[r,i.name,c.value]);let y={};return x&&(y="before"===o?{backgroundColor:"#FFF5F5",borderColor:"#E53E3E",borderTop:"1px dashed #E53E3E",borderBottom:"1px dashed #E53E3E"}:{backgroundColor:"#F0FFF4",borderColor:"#38A169",borderTop:"1px dashed #38A169",borderBottom:"1px dashed #38A169"}),(0,n.jsx)(l.NIc,{style:y,paddingLeft:4,paddingRight:4,paddingTop:3,paddingBottom:3,marginTop:"-1px !important",children:(0,n.jsxs)(l.gCW,{alignItems:"start",children:[(0,n.jsxs)(l.kCb,{alignItems:"center",children:[(0,n.jsx)(Z.__,{htmlFor:i.id||i.name,fontSize:"xs",my:0,mr:1,children:t}),(0,n.jsx)(eO.b,{label:a})]}),(0,n.jsx)(l.xvT,{fontSize:"14px",ref:u,style:{height:"".concat(m,"px")},children:c.value}),"before"===o&&x&&(0,n.jsx)("div",{style:{position:"absolute",right:"-22px",top:"50%",transform:"translateY(-50%)"},children:"→"})]})})},eP=e=>{let{customFields:s={},resourceType:t}=e,{idToCustomFieldDefinition:a}=(0,eF.m)({resourceType:t}),i=e=>Array.from(a.values()).some(s=>s.name===e&&!!s.allow_list_id),r=t===T.P6.SYSTEM?"custom_fields":"privacy_declarations[0].custom_fields",l=Object.keys(s).sort();return(0,n.jsx)(eL,{heading:"Custom fields",children:l.map(e=>i(e)?(0,n.jsx)(eZ,{label:e,name:"".concat(r,".").concat(e)},e):(0,n.jsx)(eW,{label:e,name:"".concat(r,".").concat(e)},e))})},eN=e=>{let{label:s,tooltip:t,...a}=e,{selectedHistory:i,formType:r}=eq(),[o]=(0,W.U$)(a),d={...o,value:o.value},[c,u]=(0,p.useState)(!1);(0,p.useEffect)(()=>{u(G().get(null==i?void 0:i.before,a.name)!==G().get(null==i?void 0:i.after,a.name))},[i,a.name,d.value]);let m={};return c&&(m="before"===r?{backgroundColor:"#FFF5F5",borderColor:"#E53E3E",borderTop:"1px dashed #E53E3E",borderBottom:"1px dashed #E53E3E"}:{backgroundColor:"#F0FFF4",borderColor:"#38A169",borderTop:"1px dashed #38A169",borderBottom:"1px dashed #38A169"}),(0,n.jsx)(l.NIc,{style:m,paddingLeft:4,paddingRight:4,paddingTop:3,paddingBottom:3,marginTop:"-1px !important",children:(0,n.jsxs)(l.gCW,{alignItems:"start",minHeight:"46px",children:[(0,n.jsxs)(l.kCb,{alignItems:"center",children:[(0,n.jsx)(Z.__,{htmlFor:a.id||a.name,fontSize:"xs",my:0,mr:1,children:s}),(0,n.jsx)(eO.b,{label:t})]}),void 0!==d.value&&(0,n.jsx)(l.j8w,{color:"marble",className:"m-1",children:d.value?"YES":"NO"}),"before"===r&&c&&(0,n.jsx)("div",{style:{position:"absolute",right:"-22px",top:"50%",transform:"translateY(-50%)"},children:"→"})]})})},eU=e=>{let{initialValues:s}=e,t=(0,ez.hz)();return(0,n.jsx)(W.J9,{enableReinitialize:!0,initialValues:s,onSubmit:()=>{},children:()=>(0,n.jsx)(W.l0,{children:(0,n.jsxs)(l.Kqy,{children:[(0,n.jsxs)(eL,{heading:"System details",children:[t.dictionaryService?(0,n.jsx)(eW,{name:"vendor_id",label:"Vendor",tooltip:"Select the vendor that matches the system"}):null,(0,n.jsx)(eW,{name:"name",label:"System name",tooltip:"Give the system a unique, and relevant name for reporting purposes. e.g. “Email Data Warehouse”"}),(0,n.jsx)(eW,{name:"fides_key",label:"Unique ID",disabled:!0,tooltip:"An auto-generated unique ID based on the system name"}),(0,n.jsx)(eW,{name:"description",label:"Description",tooltip:"Give the system a unique, and relevant name for reporting purposes. e.g. “Email Data Warehouse”"}),(0,n.jsx)(eZ,{name:"tags",label:"System Tags",tooltip:"Are there any tags to associate with this system?"})]}),(0,n.jsx)(eL,{heading:"Dataset reference",children:(0,n.jsx)(eZ,{name:"dataset_references",label:"Dataset references",tooltip:"Is there a dataset configured for this system"})}),(0,n.jsxs)(eL,{heading:"Data processing properties",children:[(0,n.jsx)(eN,{name:"processes_personal_data",label:"This system processes personal data",tooltip:"Does this system process personal data?"}),(0,n.jsx)(eN,{name:"exempt_from_privacy_regulations",label:"This system is exempt from privacy regulations",tooltip:"Is this system exempt from privacy regulations?"}),(0,n.jsx)(eW,{name:"reason_for_exemption",label:"Reason for exemption",tooltip:"Why is this system exempt from privacy regulation?"}),(0,n.jsx)(eN,{name:"uses_profiling",label:"This system performs profiling",tooltip:"Does this system perform profiling that could have a legal effect?"}),(0,n.jsx)(eZ,{name:"legal_basis_for_profiling",label:"Legal basis for profiling",tooltip:"What is the legal basis under which profiling is performed?"}),(0,n.jsx)(eN,{name:"does_international_transfers",label:"This system transfers data",tooltip:"Does this system transfer data to other countries or international organizations?"}),(0,n.jsx)(eZ,{name:"legal_basis_for_transfers",label:"Legal basis for transfer",tooltip:"What is the legal basis under which the data is transferred?"}),(0,n.jsx)(eN,{name:"requires_data_protection_assessments",label:"This system requires Data Privacy Assessments",tooltip:"Does this system require (DPA/DPIA) assessments?"}),(0,n.jsx)(eW,{label:"DPIA/DPA location",name:"dpa_location",tooltip:"Where is the DPA/DPIA stored?"})]}),(0,n.jsxs)(eL,{heading:"Administrative properties",children:[(0,n.jsx)(eW,{label:"Data stewards",name:"data_stewards",tooltip:"Who are the stewards assigned to the system?"}),(0,n.jsx)(eW,{name:"privacy_policy",label:"Privacy policy URL",tooltip:"Where can the privacy policy be located?"}),(0,n.jsx)(eW,{name:"legal_name",label:"Legal name",tooltip:"What is the legal name of the business?"}),(0,n.jsx)(eW,{name:"legal_address",label:"Legal address",tooltip:"What is the legal address for the business?"}),(0,n.jsx)(eW,{label:"Department",name:"administrating_department",tooltip:"Which department is concerned with this system?"}),(0,n.jsx)(eZ,{label:"Responsibility",name:"responsibility",tooltip:"What is the role of the business with regard to data processing?"}),(0,n.jsx)(eW,{name:"dpo",label:"Legal contact (DPO)",tooltip:"What is the official privacy contact information?"}),(0,n.jsx)(eW,{label:"Joint controller",name:"joint_controller_info",tooltip:"Who are the party or parties that share responsibility for processing data?"}),(0,n.jsx)(eW,{label:"Data security practices",name:"data_security_practices",tooltip:"Which data security practices are employed to keep the data safe?"})]}),(0,n.jsx)(eP,{customFields:s.custom_fields,resourceType:T.P6.SYSTEM}),s.privacy_declarations&&s.privacy_declarations.map((e,t)=>(0,n.jsxs)(p.Fragment,{children:[(0,n.jsxs)(eL,{heading:"Data use",children:[(0,n.jsx)(eW,{label:"Declaration name (optional)",name:"privacy_declarations[".concat(t,"].name"),tooltip:"Would you like to append anything to the system name?"}),(0,n.jsx)(eW,{name:"privacy_declarations[".concat(t,"].data_use"),label:"Data use",tooltip:"For which business purposes is this data used?"}),(0,n.jsx)(eZ,{name:"privacy_declarations[".concat(t,"].data_categories"),label:"Data categories",tooltip:"Which categories of personal data are collected for this purpose?"}),(0,n.jsx)(eZ,{name:"privacy_declarations[".concat(t,"].data_subjects"),label:"Data subjects",tooltip:"Who are the subjects for this personal data?"}),(0,n.jsx)(eW,{name:"privacy_declarations[".concat(t,"].legal_basis_for_processing"),label:"Legal basis for processing",tooltip:"What is the legal basis under which personal data is processed for this purpose?"}),(0,n.jsx)(eW,{name:"privacy_declarations[".concat(t,"].impact_assessment_location"),label:"Impact assessment location",tooltip:"Where is the legitimate interest impact assessment stored?"}),(0,n.jsx)(eW,{name:"privacy_declarations[".concat(t,"].retention_period"),label:"Retention period (days)",tooltip:"How long is personal data retained for this purpose?"})]}),(0,n.jsx)(eL,{heading:"Features",children:(0,n.jsx)(eZ,{name:"privacy_declarations[".concat(t,"].features"),label:"Features",tooltip:"What are some features of how data is processed?"})}),(0,n.jsx)(eL,{heading:"Dataset reference",children:(0,n.jsx)(eZ,{name:"privacy_declarations[".concat(t,"].dataset_references"),label:"Dataset references",tooltip:"Is there a dataset configured for this system?"})}),(0,n.jsxs)(eL,{heading:"Special category data",children:[(0,n.jsx)(eN,{name:"privacy_declarations[".concat(t,"].processes_special_category_data"),label:"This system processes special category data",tooltip:"Is this system processing special category data as defined by GDPR Article 9?"}),(0,n.jsx)(eW,{name:"privacy_declarations[".concat(t,"].special_category_legal_basis"),label:"Legal basis for processing",tooltip:"What is the legal basis under which the special category data is processed?"})]}),(0,n.jsxs)(eL,{heading:"Third parties",children:[(0,n.jsx)(eN,{name:"privacy_declarations[".concat(t,"].data_shared_with_third_parties"),label:"This system shares data with 3rd parties for this purpose",tooltip:"Does this system disclose, sell, or share personal data collected for this business use with 3rd parties?"}),(0,n.jsx)(eW,{name:"privacy_declarations[".concat(t,"].third_parties"),label:"Third parties",tooltip:"Which type of third parties is the data shared with?"}),(0,n.jsx)(eZ,{name:"privacy_declarations[".concat(t,"].shared_categories"),label:"Shared categories",tooltip:"Which categories of personal data does this system share with third parties?"})]}),(0,n.jsx)(eP,{customFields:s.privacy_declarations[0].custom_fields,resourceType:T.P6.PRIVACY_DECLARATION})]},t)),(0,n.jsxs)(eL,{heading:"Data flow",children:[(0,n.jsx)(eZ,{name:"ingress",label:"Sources"}),(0,n.jsx)(eZ,{name:"egress",label:"Destinations"})]})]})})})};let eV=(e,s)=>{let t=[],a=new Set(["egress","ingress","privacy_declarations","vendor_id"]);(e.egress||s.egress||e.ingress||s.ingress)&&t.push("Data Flow");let i=e.privacy_declarations&&e.privacy_declarations.length>0||s.privacy_declarations&&s.privacy_declarations.length>0;i&&t.push("Data Uses");let n=[...Object.keys(e),...Object.keys(s)].some(e=>!a.has(e));return!i&&n&&t.unshift("System Information"),t};var eM=e=>{let{selectedHistory:s,isOpen:t,onClose:a}=e;return(0,n.jsxs)(l.u_l,{isOpen:t,onClose:a,size:"4xl",children:[(0,n.jsx)(l.ZAr,{}),(0,n.jsxs)(l.hzk,{children:[(0,n.jsxs)(l.xBx,{backgroundColor:e_().FIDESUI_NEUTRAL_50,borderTopLeftRadius:"8px",borderTopRightRadius:"8px",borderBottom:"1px solid #E2E8F0",children:[(0,n.jsxs)(l.X6q,{size:"xs",children:[(0,n.jsx)("span",{style:{verticalAlign:"middle"},children:"Change detail"}),s&&(0,n.jsx)(n.Fragment,{children:eV(s.before,s.after).map((e,s)=>(0,n.jsx)(l.j8w,{color:"minos",className:"ml-2",children:e},s))})]}),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(l.LZC,{}),(0,n.jsx)(l.olH,{})]})]}),(0,n.jsx)(l.fef,{paddingTop:0,paddingBottom:6,children:(0,n.jsxs)(l.kCb,{justifyContent:"space-between",children:[(0,n.jsx)("div",{style:{flex:"0 50%",marginRight:"12px"},children:(0,n.jsx)(eI,{selectedHistory:s,formType:"before",children:(0,n.jsx)(eU,{initialValues:null==s?void 0:s.before})})}),(0,n.jsx)("div",{style:{flex:"0 50%",marginLeft:"12px"},children:(0,n.jsx)(eI,{selectedHistory:s,formType:"after",children:(0,n.jsx)(eU,{initialValues:null==s?void 0:s.after})})})]})})]})]})},eB=e=>{let{system:s}=e,[t,a]=(0,p.useState)(1),{data:i}=(0,L.Xc)({system_key:s.fides_key,page:t,size:10}),[r,o]=(0,p.useState)(!1),[d,c]=(0,p.useState)(null),u=(0,m.C)(L.o),{data:h=[]}=(0,O.K3)(),x=(null==i?void 0:i.items)||[],g=e=>{c(e=eE(e=eA(e=eS(e=eD(e=eT(e),u),h)))),o(!0)},{formattedTime:y,formattedDate:f}=ej(s.created_at),_=i&&i.total?Math.ceil(i.total/10):0;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(l.iA_,{ml:"24px",children:[(0,n.jsx)(l.hrZ,{children:(0,n.jsx)(l.Tr,{children:(0,n.jsxs)(l.Td,{p:"16px",fontSize:"12px",border:"1px solid #E2E8F0",background:e_().FIDESUI_NEUTRAL_50,children:["System created on ",f," at ",y]})})}),(0,n.jsx)(l.p3B,{children:x.map((e,s)=>{let t=eC(e);return t?(0,n.jsx)(l.Tr,{onClick:()=>g(e),style:{cursor:"pointer"},children:(0,n.jsx)(l.Td,{pt:"10px",pb:"10px",pl:"16px",fontSize:"12px",border:"1px solid #E2E8F0",children:t})},s):null})})]}),((null==i?void 0:i.total)||0)>10&&(0,n.jsxs)(l.kCb,{alignItems:"center",justifyContent:"flex-start",marginTop:"12px",marginLeft:"24px",children:[(0,n.jsxs)(l.xvT,{fontSize:"xs",lineHeight:4,fontWeight:"600",paddingX:2,children:[(t-1)*10+1," -"," ",Math.min(10*t,(null==i?void 0:i.total)||0)," of"," ",(null==i?void 0:i.total)||0]}),(0,n.jsx)(l.wpx,{size:"small",className:"mr-2",onClick:()=>{t>1&&a(t-1)},disabled:1===t,icon:(0,n.jsx)(eb,{})}),(0,n.jsx)(l.wpx,{size:"small",onClick:()=>{t<_&&a(t+1)},disabled:t===_||0===_,icon:(0,n.jsx)(ev,{})})]}),(0,n.jsx)(eM,{selectedHistory:d,isOpen:r,onClose:()=>{o(!1),c(null)}})]})},eK=t(52368),eH=t(3765),eY=e=>{let{title:s,description:t,handleAdd:a}=e;return(0,n.jsx)(l.Kqy,{backgroundColor:"gray.50",border:"1px solid",borderColor:"blue.500",borderRadius:"md",justifyContent:"space-between",py:4,px:6,"data-testid":"empty-state",children:(0,n.jsxs)(l.Ugi,{children:[(0,n.jsx)(l.iid,{alignSelf:"start",color:"blue.400",mt:.5}),(0,n.jsxs)(l.xuv,{children:[(0,n.jsx)(l.xvT,{fontWeight:"bold",fontSize:"sm",mb:1,children:s}),(0,n.jsx)(l.xvT,{fontSize:"sm",color:"gray.800",lineHeight:"5",children:t}),(0,n.jsx)(l.Ugi,{mt:4,children:(0,n.jsx)(l.wpx,{size:"small",type:"primary","data-testid":"add-btn",onClick:a,icon:(0,n.jsx)(l.jBn,{boxSize:4}),iconPosition:"end",children:"Add data use"})})]})]})})},eG=t(58452);let e$=e=>{let{declaration:s,title:t,handleDelete:a,handleEdit:i}=e,{isOpen:r,onOpen:o,onClose:d}=(0,l.qY0)();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(l.fGe,{w:"100%",h:"100%",cursor:"pointer",_hover:{backgroundColor:"gray.50"},children:(0,n.jsx)(l.xuv,{px:6,py:4,"data-testid":"row-".concat(s.data_use),children:(0,n.jsxs)(l.Ugi,{children:[(0,n.jsx)(l.AB5,{onClick:()=>i(s),role:"button",tabIndex:0,children:(0,n.jsx)(l.xvT,{children:t||s.data_use})}),(0,n.jsx)(l.LZC,{}),a?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(l.wpx,{"aria-label":"delete-declaration",className:"z-[2]",onClick:o,"data-testid":"delete-btn",children:(0,n.jsx)(l.pJl,{})}),(0,n.jsx)(eG.Z,{isOpen:r,onClose:d,onConfirm:()=>a(s),title:"Delete data use declaration",message:(0,n.jsxs)(l.xvT,{children:["You are about to delete the data use declaration"," ",(0,n.jsx)(l.xvT,{color:"complimentary.500",as:"span",fontWeight:"bold",children:t||s.data_use}),", including all its cookies. Are you sure you want to continue?"]}),isCentered:!0})]}):null]})})}),(0,n.jsx)(l.izJ,{})]})},eQ=e=>{let{heading:s,children:t,headerButton:a,footerButton:i}=e;return(0,n.jsx)(l.Kqy,{spacing:4,"data-testid":"privacy-declarations-table",children:(0,n.jsxs)(l.xuv,{maxWidth:"720px",border:"1px",borderColor:"gray.200",borderRadius:6,children:[(0,n.jsxs)(l.Ugi,{backgroundColor:"gray.50",px:6,py:4,borderBottom:"1px",borderColor:"gray.200",borderTopRadius:6,children:[(0,n.jsx)(l.X6q,{as:"h3",size:"xs",children:s}),(0,n.jsx)(l.LZC,{}),a||null]}),(0,n.jsx)(l.Kqy,{spacing:0,children:t}),(0,n.jsx)(l.xuv,{backgroundColor:"gray.50",px:6,py:4,borderBottomRadius:6,children:i||null})]})})},eJ=e=>{let{heading:s,declarations:t,handleAdd:a,handleDelete:i,handleEdit:r,allDataUses:o}=e,d=e=>{let s=o.filter(s=>s.fides_key===e.data_use)[0];return s?e.name?"".concat(s.name," - ").concat(e.name):s.name:""},c=(0,m.C)(ey.gU);return(0,n.jsx)(eQ,{heading:s,footerButton:c?null:(0,n.jsx)(l.wpx,{onClick:a,size:"small",icon:(0,n.jsx)(l.jBn,{boxSize:4}),iconPosition:"end","data-testid":"add-btn",children:"Add data use"}),children:t.map(e=>(0,n.jsx)(e$,{declaration:e,title:d(e),handleDelete:c?void 0:i,handleEdit:r},e.id))})};var eX=t(95346),e0=t(54748),e1=t(28325),e4=t(30234);let e2=P.Ry().shape({data_categories:P.IX(P.Z_()).min(1,"Must assign at least one data category").label("Data categories"),data_use:P.Z_().required().label("Data use")}),e3={name:"",data_categories:[],data_use:"",data_subjects:[],egress:void 0,ingress:void 0,features:[],legal_basis_for_processing:void 0,flexible_legal_basis_for_processing:!0,impact_assessment_location:"",retention_period:"",processes_special_category_data:!1,special_category_legal_basis:void 0,data_shared_with_third_parties:!1,third_parties:"",shared_categories:[],customFieldValues:{},id:""},e5=e=>{var s;return{...e,name:null!==(s=e.name)&&void 0!==s?s:"",special_category_legal_basis:e.processes_special_category_data?e.special_category_legal_basis:void 0,third_parties:e.data_shared_with_third_parties?e.third_parties:void 0,shared_categories:e.data_shared_with_third_parties?e.shared_categories:void 0}},e8=e=>{let{allDataUses:s,allDataCategories:t,allDataSubjects:a,allDatasets:i,values:r,includeCustomFields:o,privacyDeclarationId:d,lockedForGVL:c}=e,u=!!d,{legalBasisOptions:m}=(0,e0.Z)(),{specialCategoryLegalBasisOptions:h}=(0,e1.Z)(),x=(0,p.useMemo)(()=>i?i.map(e=>({value:e.fides_key,label:e.name?e.name:e.fides_key})):[],[i]);return(0,n.jsxs)(l.Kqy,{spacing:4,children:[(0,n.jsxs)(e4.Z,{heading:"Data use declaration",children:[(0,n.jsx)(Z.j0,{id:"name",label:"Declaration name (optional)",name:"name",tooltip:"Would you like to append anything to the system name?",disabled:u||c,variant:"stacked"}),(0,n.jsx)(N.d,{id:"data_use",label:"Data use",name:"data_use",options:s.map(e=>({value:e.fides_key,label:e.fides_key})),tooltip:"For which business purposes is this data processed?",layout:"stacked",isRequired:!0,disabled:u||c}),(0,n.jsx)(N.d,{name:"data_categories",label:"Data categories",options:t.map(e=>({value:e.fides_key,label:e.fides_key})),tooltip:"Which categories of personal data are collected for this purpose?",mode:"multiple",isRequired:!0,disabled:c,layout:"stacked"}),(0,n.jsx)(N.d,{name:"data_subjects",label:"Data subjects",options:a.map(e=>({value:e.fides_key,label:e.fides_key})),tooltip:"Who are the subjects for this personal data?",mode:"multiple",disabled:c,layout:"stacked"}),(0,n.jsxs)(l.Kqy,{spacing:0,children:[(0,n.jsx)(N.d,{name:"legal_basis_for_processing",label:"Legal basis for processing",options:m,tooltip:"What is the legal basis under which personal data is processed for this purpose?",layout:"stacked",disabled:c}),(0,n.jsx)(l.UO1,{in:"Legitimate interests"===r.legal_basis_for_processing,animateOpacity:!0,style:{overflow:"visible"},children:(0,n.jsx)(l.xuv,{mt:4,children:(0,n.jsx)(Z.j0,{name:"impact_assessment_location",label:"Impact assessment location",tooltip:"Where is the legitimate interest impact assessment stored?",variant:"stacked",disabled:c})})})]}),(0,n.jsx)(l.xuv,{mt:5,pl:4,children:(0,n.jsx)(Z.w8,{name:"flexible_legal_basis_for_processing",label:"This legal basis is flexible",tooltip:"Has the vendor declared that the legal basis may be overridden?",variant:"stacked",isDisabled:c})}),(0,n.jsx)(Z.j0,{name:"retention_period",label:"Retention period (days)",tooltip:"How long is personal data retained for this purpose?",variant:"stacked",disabled:c})]}),(0,n.jsx)(e4.Z,{heading:"Features",children:(0,n.jsx)(N.d,{name:"features",label:"Features",placeholder:"Describe features...",tooltip:"What are some features of how data is processed?",layout:"stacked",disabled:c,mode:"tags"})}),(0,n.jsx)(e4.Z,{heading:"Dataset reference",children:(0,n.jsx)(N.d,{name:"dataset_references",label:"Dataset references",options:x,tooltip:"Is there a dataset configured for this system?",mode:"multiple",layout:"stacked",disabled:c})}),(0,n.jsx)(e4.Z,{heading:"Special category data",children:(0,n.jsxs)(l.Kqy,{spacing:0,children:[(0,n.jsx)(Z.w8,{name:"processes_special_category_data",label:"This system processes special category data",tooltip:"Is this system processing special category data as defined by GDPR Article 9?",variant:"stacked",isDisabled:c}),(0,n.jsx)(l.UO1,{in:r.processes_special_category_data,animateOpacity:!0,style:{overflow:"visible"},children:(0,n.jsx)(l.xuv,{mt:4,children:(0,n.jsx)(N.d,{name:"special_category_legal_basis",label:"Legal basis for processing",options:h,isRequired:r.processes_special_category_data,tooltip:"What is the legal basis under which the special category data is processed?",layout:"stacked",disabled:c})})})]})}),(0,n.jsx)(e4.Z,{heading:"Third parties",children:(0,n.jsxs)(l.Kqy,{spacing:0,children:[(0,n.jsx)(Z.w8,{name:"data_shared_with_third_parties",label:"This system shares data with 3rd parties for this purpose",tooltip:"Does this system disclose, sell, or share personal data collected for this business use with 3rd parties?",variant:"stacked",isDisabled:c}),(0,n.jsx)(l.UO1,{in:r.data_shared_with_third_parties,animateOpacity:!0,style:{overflow:"visible"},children:(0,n.jsxs)(l.Kqy,{mt:4,spacing:4,children:[(0,n.jsx)(Z.j0,{name:"third_parties",label:"Third parties",tooltip:"Which type of third parties is the data shared with?",variant:"stacked",disabled:c}),(0,n.jsx)(N.d,{name:"shared_categories",label:"Shared categories",options:t.map(e=>({value:e.fides_key,label:e.fides_key})),tooltip:"Which categories of personal data does this system share with third parties?",layout:"stacked",mode:"multiple",disabled:c})]})})]})}),o?(0,n.jsx)(eX.uc,{resourceType:T.P6.PRIVACY_DECLARATION,resourceFidesKey:d}):null]})},e6=(e,s)=>e?{...e,customFieldValues:s||{}}:e3,e7=e=>{let{onSubmit:s,initialValues:t,privacyDeclarationId:a}=e,{customFieldValues:i,upsertCustomFields:n}=(0,eX.mZ)({resourceType:T.P6.PRIVACY_DECLARATION,resourceFidesKey:a});return{handleSubmit:async(e,t)=>{let{customFieldValues:a}=e,i=e5(e),r=await s(i,t);if(r){let s=r.filter(s=>s.data_use===e.data_use&&(!s.name||s.name===e.name));s.length>0&&await n({customFieldValues:a,fides_key:s[0].id})}},initialValues:(0,p.useMemo)(()=>e6(t,i),[t,i])}},e9=e=>{let{onSubmit:s,onCancel:t,initialValues:a,...i}=e,r=null==a?void 0:a.id,{handleSubmit:o,initialValues:d}=e7({onSubmit:s,onCancel:t,initialValues:a,allDataUses:i.allDataUses,privacyDeclarationId:r}),c=(0,m.C)(ey.gU);return(0,n.jsx)(W.J9,{enableReinitialize:!0,initialValues:d,onSubmit:o,validationSchema:e2,children:e=>{let{dirty:s,values:a}=e;return(0,n.jsxs)(W.l0,{"data-testid":"declaration-form",children:[(0,n.jsx)(x.Gt,{id:"PrivacyDeclaration",name:"New Privacy Declaration"}),(0,n.jsxs)(l.Kqy,{spacing:4,children:[(0,n.jsx)(e8,{values:a,lockedForGVL:c,privacyDeclarationId:r,...i}),(0,n.jsxs)(l.kCb,{w:"100%",children:[(0,n.jsx)(l.wpx,{onClick:t,"data-testid":"cancel-btn",children:"Cancel"}),c?null:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(l.LZC,{}),(0,n.jsx)(l.wpx,{type:"primary",htmlType:"submit",disabled:!s,"data-testid":"save-btn",children:"Save"})]})]})]})]})}})},se=e=>{let{isOpen:s,onClose:t,heading:a,isCentered:i=!1,testId:r="privacy-declaration-modal",children:o}=e;return(0,n.jsxs)(l.u_l,{isOpen:s,onClose:t,isCentered:i,scrollBehavior:"inside",size:"3xl",children:[(0,n.jsx)(l.ZAr,{}),(0,n.jsxs)(l.hzk,{textAlign:"left",p:0,"data-testid":r,children:[(0,n.jsx)(l.xBx,{p:0,children:(0,n.jsx)(l.xuv,{backgroundColor:"gray.50",px:6,py:4,border:"1px",borderColor:"gray.200",borderTopRadius:6,children:(0,n.jsx)(l.X6q,{as:"h3",size:"sm",children:a})})}),(0,n.jsx)(l.fef,{pb:4,children:o})]})]})};var ss=e=>{let{system:s,includeCustomFields:t,...a}=e,{isOpen:i,onClose:r,onOpen:o}=(0,l.qY0)(),[d,c]=(0,p.useState)(void 0),{createDataUse:u,updateDataUse:m,deleteDataUse:h}=(0,eH.Z)(s),x=()=>{r(),c(void 0)},g=()=>{o(),c(void 0)},y=async e=>(x(),d)?m(d,e):u(e);return(0,p.useEffect)(()=>{r()},[r,s.fides_key]),(0,n.jsxs)(l.Kqy,{spacing:6,"data-testid":"data-use-tab",children:[0===s.privacy_declarations.length?(0,n.jsx)(eY,{title:"You don't have a data use set up for this system yet.",description:'A Data Use is the purpose for which data is used in a system. In Fides, a system may have more than one Data Use. For example, a CRM system may be used both for "Customer Support" and also for "Email Marketing", each of these is a Data Use.',handleAdd:g}):(0,n.jsx)(eJ,{heading:"Data use",declarations:s.privacy_declarations,handleAdd:g,handleEdit:e=>{o(),c(e)},handleDelete:h,allDataUses:a.allDataUses}),(0,n.jsx)(se,{isOpen:i,onClose:x,heading:"Configure data use",children:(0,n.jsx)(e9,{initialValues:d,onSubmit:y,onCancel:x,includeCustomFields:t,...a})})]})},st=e=>{let{system:s}=e,{isLoading:t,...a}=(0,eK.f)({includeDatasets:!0,includeDisabled:!1}),i=a.allDataCategories.filter(e=>e.active),r=a.allDataUses.filter(e=>e.active),o=a.allDataSubjects.filter(e=>e.active),c={...a,allDataCategories:i,allDataUses:r,allDataSubject:o};return(0,n.jsxs)(l.Kqy,{spacing:3,"data-testid":"privacy-declaration-step",minWidth:580,children:[(0,n.jsx)(l.X6q,{as:"h3",size:"md",children:"Data uses"}),(0,n.jsxs)(l.xvT,{fontSize:"sm",fontWeight:"medium",children:["Data Uses describe the business purpose for which the personal data is processed or collected. Within a Data Use, you assign which categories of personal information are collected for this purpose and for which categories of data subjects. To update the available categories and uses, please visit"," ",(0,n.jsx)(l.rUS,{as:d(),href:"/taxonomy",color:"link.900",children:"Manage taxonomy"}),"."]}),t?(0,n.jsx)(l.$jN,{}):(0,n.jsx)(ss,{system:s,includeCustomFields:!0,...c})]})},sa=t(812),si=t(93237),sn=t(69525),sr=t(33335);let sl={system_type:"",fides_key:"",tags:[],name:"",description:"",dataset_references:[],processes_personal_data:!0,exempt_from_privacy_regulations:!1,reason_for_exemption:"",uses_profiling:!1,does_international_transfers:!1,requires_data_protection_assessments:!1,privacy_policy:"",legal_name:"",legal_address:"",administrating_department:"",responsibility:[],joint_controller_info:"",data_security_practices:"",privacy_declarations:[],data_stewards:"",dpo:"",cookie_max_age_seconds:void 0,uses_cookies:!1,cookie_refresh:!1,uses_non_cookie_access:!1,legitimate_interest_disclosure_url:""},so=(e,s)=>{var t;let a=null==e?void 0:null===(t=e.data_stewards)||void 0===t?void 0:t.map(e=>e.username).join(", ");return{...e,customFieldValues:s,description:e.description?e.description:"",legal_address:e.legal_address?e.legal_address:"",dpo:e.dpo?e.dpo:"",cookie_max_age_seconds:e.cookie_max_age_seconds?e.cookie_max_age_seconds:"",legitimate_interest_disclosure_url:e.legitimate_interest_disclosure_url?e.legitimate_interest_disclosure_url:"",vendor_deleted_date:e.vendor_deleted_date?e.vendor_deleted_date:void 0,privacy_policy:e.privacy_policy?e.privacy_policy:"",data_security_practices:e.data_security_practices?e.data_security_practices:"",legal_basis_for_profiling:e.legal_basis_for_profiling?e.legal_basis_for_profiling:"",legal_basis_for_transfers:e.legal_basis_for_transfers?e.legal_basis_for_transfers:"",data_stewards:a}},sd=e=>{let s=e.fides_key?e.fides_key:(0,sr.E)(e.name),t=""===e.privacy_policy?void 0:e.privacy_policy,a={system_type:e.system_type,fides_key:s,name:e.name,description:e.description?e.description:"",dataset_references:e.dataset_references,tags:e.tags,processes_personal_data:e.processes_personal_data,exempt_from_privacy_regulations:e.exempt_from_privacy_regulations,reason_for_exemption:e.exempt_from_privacy_regulations?e.reason_for_exemption:void 0,privacy_declarations:e.processes_personal_data?e.privacy_declarations:[],vendor_id:e.vendor_id,ingress:e.ingress,egress:e.egress,meta:e.meta,fidesctl_meta:e.fidesctl_meta,organization_fides_key:e.organization_fides_key,dpa_progress:e.dpa_progress,previous_vendor_id:e.previous_vendor_id,cookie_max_age_seconds:e.cookie_max_age_seconds?e.cookie_max_age_seconds:void 0,uses_cookies:e.uses_cookies,cookie_refresh:e.cookie_refresh,uses_non_cookie_access:e.uses_non_cookie_access,legitimate_interest_disclosure_url:e.legitimate_interest_disclosure_url?e.legitimate_interest_disclosure_url:void 0,vendor_deleted_date:e.vendor_deleted_date?e.vendor_deleted_date:void 0};return e.processes_personal_data&&(a={...a,dataset_references:e.dataset_references,uses_profiling:e.uses_profiling,legal_basis_for_profiling:e.uses_profiling?e.legal_basis_for_profiling:void 0,does_international_transfers:e.does_international_transfers,legal_basis_for_transfers:e.does_international_transfers?e.legal_basis_for_transfers:void 0,requires_data_protection_assessments:e.requires_data_protection_assessments,dpa_location:e.requires_data_protection_assessments?e.dpa_location:void 0,privacy_policy:t,legal_name:e.legal_name,legal_address:e.legal_address,responsibility:e.responsibility,dpo:e.dpo,data_security_practices:e.data_security_practices},e.administrating_department&&(a.administrating_department=e.administrating_department),e.joint_controller_info&&(a.joint_controller_info=e.joint_controller_info)),a},{useGetSystemAssetsQuery:sc,useAddSystemAssetMutation:su,useUpdateSystemAssetsMutation:sp,useDeleteSystemAssetsMutation:sm,usePopulateSystemAssetsMutation:sh}=t(78780).u.injectEndpoints({endpoints:e=>({getSystemAssets:e.query({query:e=>{let{fides_key:s,...t}=e;return{method:"GET",url:"/plus/system-assets/".concat(s),params:t}},providesTags:["System Assets"]}),addSystemAsset:e.mutation({query:e=>{let{systemKey:s,asset:t}=e;return{method:"POST",url:"/plus/system-assets/".concat(s,"/assets"),body:t}},invalidatesTags:["System Assets"]}),updateSystemAssets:e.mutation({query:e=>{let{systemKey:s,assets:t}=e;return{method:"PUT",url:"/plus/system-assets/".concat(s,"/assets/"),body:t}},invalidatesTags:["System Assets"]}),deleteSystemAssets:e.mutation({query:e=>{let{systemKey:s,asset_ids:t}=e;return{method:"DELETE",url:"/plus/system-assets/".concat(s,"/assets?").concat((0,b.du)(t,"asset_ids"))}},invalidatesTags:["System Assets"]}),populateSystemAssets:e.mutation({query:e=>{let{systemKey:s}=e;return{method:"POST",url:"/plus/dictionary/system-vendors/cookie-assets",body:[s]}}})})});var sx=t(36345);let sg=["Explicit consent","Contract","Authorised by law"].map(e=>({value:e,label:e})),sy=[{value:"Adequacy Decision",label:"Adequacy decision"},{value:"Supplementary measures",label:"Supplementary measures"},{value:"SCCs",label:"Standard contractual clauses"},{value:"BCRs",label:"Binding corporate rules"},{value:"Other",label:"Other"}],sf=["Controller","Processor","Sub-Processor"].map(e=>({value:e,label:e})),s_=e=>{var s;let{system:t}=e,a=t?null!==(s=t.name)&&void 0!==s?s:"this system":"your new system";return(0,n.jsxs)(l.X6q,{as:"h3",size:"lg",children:["Describe ",a]})};var sv=e=>{let{onSuccess:s,system:t,withHeader:a,children:i}=e,{data:r=[]}=(0,O.K3)(),o=(0,m.T)(),d=(0,eX.mZ)({resourceType:T.P6.SYSTEM,resourceFidesKey:null==t?void 0:t.fides_key}),{...c}=(0,eK.f)({includeDatasets:!0,includeDisabled:!1}),u=(0,p.useMemo)(()=>t?so(t,d.customFieldValues):sl,[t,d.customFieldValues]),[h]=(0,O.in)(),g=(0,p.useMemo)(()=>P.Ry().shape({name:P.Z_().required().label("System name").test("is-unique","",async(e,s)=>{let{data:t}=await h({page:1,size:10,search:e});return!((null==t?void 0:t.items)||[]).filter(e=>e.name!==u.name).some(s=>s.name===e)||s.createError({message:'You already have a system called "'.concat(e,'". Please specify a unique name for this system.')})}),privacy_policy:P.Z_().min(1).url().nullable()}),[h,u.name]),y=(0,ez.hz)(),[_,v]=(0,O.f7)(),[b,j]=(0,O.qQ)(),[k]=sh();(0,L.Rd)(void 0,{skip:!y.dictionaryService});let[w]=(0,L.qz)(),C=(0,m.C)(L.o),S=(0,m.C)(ey.gU),D=(0,p.useMemo)(()=>!!(t&&(null==r?void 0:r.some(e=>e.fides_key===(null==t?void 0:t.fides_key)))),[t,r]),A=(0,p.useMemo)(()=>c.allDatasets?c.allDatasets.map(e=>({value:e.fides_key,label:e.name?e.name:e.fides_key})):[],[c.allDatasets]),E=(0,l.pmc)(),R=async(e,t)=>{var a;let i,n;if(e.vendor_id&&0===e.privacy_declarations.length){let s=await w({vendor_id:e.vendor_id});if(s.isError){if(!((0,sa.fn)(s.error)&&404===s.error.status)){let e=(0,sa.e$)(s.error,"A problem occurred while fetching data uses from Fides Compass for your system. Please try again.");E((0,f.Vo)(e))}}else s.data&&s.data.items.length>0&&(i=s.data.items.map(e=>{var s;return{...(0,sn.U)(e),name:null!==(s=e.name)&&void 0!==s?s:""}}))}let r=sd({...e,privacy_declarations:null!=i?i:e.privacy_declarations});if(n=D?await b(r):await _(r),await d.upsertCustomFields(e),!D&&e.vendor_id&&(null===(a=n.data)||void 0===a?void 0:a.fides_key)){let e=await k({systemKey:n.data.fides_key});(0,sa.D4)(e)&&E((0,f.Vo)("An unexpected error occurred while populating the system assets from Compass. Please try again."))}(0,sa.D4)(n)?E({status:"error",description:(0,sa.e$)(n.error,"An unexpected error occurred while ".concat(D?"editing":"creating"," the system. Please try again."))}):(E.closeAll(),t.resetForm({values:e}),s(n.data),o((0,ey.b3)("initial")))},q=e=>{if(y.dictionaryService){if(!e){o((0,ey.b3)("hiding")),o((0,ey.gQ)(!1));return}o((0,ey.b3)("showing")),y.tcf&&(0,sa.cj)(e)===sa.c6.GVL?o((0,ey.gQ)(!0)):o((0,ey.gQ)(!1))}},I=j.isLoading||v.isLoading||d.isLoading;return(0,n.jsx)(W.J9,{initialValues:u,enableReinitialize:!0,onSubmit:R,validationSchema:g,children:e=>{let{dirty:s,values:r,isValid:o}=e;return(0,n.jsxs)(W.l0,{children:[(0,n.jsx)(x.Gt,{id:"SystemInfoTab",name:"System Info"}),(0,n.jsxs)(l.Kqy,{spacing:0,maxWidth:{base:"100%",lg:"70%"},children:[a?(0,n.jsx)(s_,{system:t}):null,(0,n.jsx)(l.xvT,{fontSize:"sm",fontWeight:"medium",children:"By providing a small amount of additional context for each system we can make reporting and understanding our tech stack much easier for everyone from engineering to legal teams. So let’s do this now."}),a?(0,n.jsx)(s_,{system:t}):null,(0,n.jsxs)(e4.Z,{heading:"System details",children:[y.dictionaryService?(0,n.jsx)(sx.Z,{label:"System name",options:C,onVendorSelected:q,isCreate:!t,lockedForGVL:S}):(0,n.jsx)(Z.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}),(null==t?void 0:t.fides_key)&&(0,n.jsx)(Z.j0,{id:"fides_key",name:"fides_key",label:"Unique ID",disabled:!0,variant:"stacked",tooltip:"An auto-generated unique ID based on the system name"}),(0,n.jsx)(si.Sv,{id:"description",name:"description",label:"Description",tooltip:"What services does this system perform?",disabled:S}),(0,n.jsx)(N.d,{mode:"tags",id:"tags",name:"tags",label:"System Tags",options:u.tags?u.tags.map(e=>({value:e,label:e})):[],layout:"stacked",tooltip:"Are there any tags to associate with this system?",disabled:S})]}),(0,n.jsx)(e4.Z,{heading:"Dataset reference",children:(0,n.jsx)(N.d,{name:"dataset_references",label:"Dataset references",options:A,tooltip:"Is there a dataset configured for this system?",mode:"multiple",layout:"stacked",disabled:S})}),(0,n.jsx)(e4.Z,{heading:"Data processing properties",children:(0,n.jsxs)(l.Kqy,{spacing:0,children:[(0,n.jsx)(l.xuv,{mb:4,children:(0,n.jsx)(si.dQ,{name:"processes_personal_data",label:"This system processes personal data",tooltip:"Does this system process personal data?",disabled:S})}),(0,n.jsx)(l.xuv,{padding:4,borderRadius:4,backgroundColor:"gray.50",children:(0,n.jsxs)(l.Kqy,{spacing:0,children:[(0,n.jsx)(si.dQ,{name:"exempt_from_privacy_regulations",label:"This system is exempt from privacy regulations",tooltip:"Is this system exempt from privacy regulations?",disabled:!r.processes_personal_data||S}),(0,n.jsx)(l.UO1,{in:r.exempt_from_privacy_regulations,animateOpacity:!0,children:(0,n.jsx)(l.xuv,{mt:4,children:(0,n.jsx)(Z.j0,{name:"reason_for_exemption",label:"Reason for exemption",tooltip:"Why is this system exempt from privacy regulation?",variant:"stacked",isRequired:r.exempt_from_privacy_regulations,disabled:S})})})]})}),(0,n.jsx)(l.UO1,{in:r.processes_personal_data&&!r.exempt_from_privacy_regulations,style:{overflow:"visible"},animateOpacity:!0,children:(0,n.jsxs)(l.Kqy,{spacing:4,mt:4,children:[(0,n.jsxs)(l.Kqy,{spacing:0,children:[(0,n.jsx)(si.dQ,{name:"uses_profiling",label:"This system performs profiling",tooltip:"Does this system perform profiling that could have a legal effect?",disabled:S}),(0,n.jsx)(l.UO1,{in:r.uses_profiling,animateOpacity:!0,style:{overflow:"visible"},children:(0,n.jsx)(l.xuv,{mt:4,children:(0,n.jsx)(N.d,{mode:"multiple",layout:"stacked",name:"legal_basis_for_profiling",label:"Legal basis for profiling",options:sg,tooltip:"What is the legal basis under which profiling is performed?",disabled:S,isRequired:r.uses_profiling})})})]}),(0,n.jsxs)(l.Kqy,{spacing:0,children:[(0,n.jsx)(si.dQ,{name:"does_international_transfers",label:"This system transfers data",tooltip:"Does this system transfer data to other countries or international organizations?",disabled:S}),(0,n.jsx)(l.UO1,{in:r.does_international_transfers,animateOpacity:!0,style:{overflow:"visible"},children:(0,n.jsx)(l.xuv,{mt:4,children:(0,n.jsx)(N.d,{mode:"multiple",layout:"stacked",name:"legal_basis_for_transfers",label:"Legal basis for transfer",options:sy,tooltip:"What is the legal basis under which the data is transferred?",isRequired:r.does_international_transfers,disabled:S})})})]}),(0,n.jsxs)(l.Kqy,{spacing:0,children:[(0,n.jsx)(Z.w8,{name:"requires_data_protection_assessments",label:"This system requires Data Privacy Assessments",tooltip:"Does this system require (DPA/DPIA) assessments?",variant:"stacked",isDisabled:S}),(0,n.jsx)(l.UO1,{in:r.requires_data_protection_assessments,animateOpacity:!0,children:(0,n.jsx)(l.xuv,{mt:4,children:(0,n.jsx)(Z.j0,{label:"DPIA/DPA location",name:"dpa_location",tooltip:"Where is the DPA/DPIA stored?",variant:"stacked",disabled:S,isRequired:r.requires_data_protection_assessments})})})]})]})})]})}),(0,n.jsxs)(l.UO1,{in:r.processes_personal_data&&!r.exempt_from_privacy_regulations,animateOpacity:!0,children:[(0,n.jsxs)(e4.Z,{heading:"Cookie properties",children:[(0,n.jsx)(si.dQ,{name:"uses_cookies",label:"This system uses cookies",tooltip:"Does this system use cookies?",disabled:S}),(0,n.jsx)(si.dQ,{name:"cookie_refresh",label:"This system refreshes cookies",tooltip:"Does this system automatically refresh cookies?",disabled:S}),(0,n.jsx)(si.dQ,{name:"uses_non_cookie_access",label:"This system uses non-cookie trackers",tooltip:"Does this system use other types of trackers?",disabled:S}),(0,n.jsx)(si.lm,{name:"cookie_max_age_seconds",label:"Maximum duration (seconds)",tooltip:"What is the maximum amount of time a cookie will live?",disabled:S})]}),(0,n.jsxs)(e4.Z,{heading:"Administrative properties",children:[(0,n.jsx)(Z.j0,{label:"Data stewards",name:"data_stewards",tooltip:"Who are the stewards assigned to the system?",variant:"stacked",disabled:!0}),(0,n.jsx)(si.Yb,{id:"privacy_policy",name:"privacy_policy",label:"Privacy policy URL",tooltip:"Where can the privacy policy be located?",disabled:S}),(0,n.jsx)(si.Yb,{id:"legal_name",name:"legal_name",label:"Legal name",tooltip:"What is the legal name of the business?",disabled:S}),(0,n.jsx)(si.Sv,{id:"legal_address",name:"legal_address",label:"Legal address",tooltip:"What is the legal address for the business?",disabled:S}),(0,n.jsx)(Z.j0,{label:"Department",name:"administrating_department",tooltip:"Which department is concerned with this system?",variant:"stacked",disabled:!r.processes_personal_data||r.exempt_from_privacy_regulations||S}),(0,n.jsx)(N.d,{mode:"multiple",layout:"stacked",label:"Responsibility",name:"responsibility",options:sf,tooltip:"What is the role of the business with regard to data processing?",disabled:!r.processes_personal_data||r.exempt_from_privacy_regulations||S}),(0,n.jsx)(si.Yb,{name:"dpo",id:"dpo",label:"Legal contact (DPO)",tooltip:"What is the official privacy contact information?",disabled:S}),(0,n.jsx)(Z.j0,{label:"Joint controller",name:"joint_controller_info",tooltip:"Who are the party or parties that share responsibility for processing data?",variant:"stacked",disabled:!r.processes_personal_data||r.exempt_from_privacy_regulations||S}),(0,n.jsx)(si.Yb,{label:"Data security practices",name:"data_security_practices",id:"data_security_practices",tooltip:"Which data security practices are employed to keep the data safe?",disabled:S}),(0,n.jsx)(si.Yb,{label:"Legitimate interest disclosure URL",name:"legitimate_interest_disclosure_url",id:"legitimate_interest_disclosure_url",disabled:S}),(0,n.jsx)(si.Yb,{label:"Vendor deleted date",name:"vendor_deleted_date",id:"vendor_deleted_date",tooltip:"If this vendor is no longer active, it will be 'soft' deleted. When that occurs, it's deleted date will be recorded here for reporting.",disabled:!0})]}),r.fides_key?(0,n.jsx)(eX.uc,{resourceType:T.P6.SYSTEM,resourceFidesKey:r.fides_key}):null]})]}),(0,n.jsx)(l.xuv,{mt:6,children:(0,n.jsx)(l.wpx,{htmlType:"submit",type:"primary",disabled:I||!s||!o,loading:I,"data-testid":"save-btn",children:"Save"})}),i]})}})},sb=t(59003),sj=t(92222),sk=t(30952),sw=t(85422),sC=t(90111),sS=t(8133),sD=t(83099),sT=e=>{let{name:s,label:t,labelProps:a,tooltip:i}=e,[r,o,{setValue:d,setTouched:c}]=(0,W.U$)(s),u=!!(o.touched&&o.error);return(0,n.jsx)(l.NIc,{isInvalid:u,isRequired:!0,children:(0,n.jsxs)(l.jqI,{vertical:!0,children:[(0,n.jsxs)(l.jqI,{align:"center",children:[t&&(0,n.jsx)(Z.__,{htmlFor:s,fontSize:"xs",mr:1,...a,children:t}),i&&(0,n.jsx)(eO.b,{label:i})]}),(0,n.jsx)(sD.Z,{...r,mode:"multiple",selectedTaxonomies:[],onChange:e=>{d(e)},onBlur:()=>c(!0),variant:"outlined",autoFocus:!1,status:u?"error":void 0,"data-testid":"controlled-select-".concat(s)}),(0,n.jsx)(Z.Bc,{isInvalid:u,message:o.error,fieldName:s})]})})};(a=i||(i={})).COOKIE="Cookie",a.BROWSER_REQUEST="Browser Request",a.I_FRAME="iFrame",a.JAVASCRIPT_TAG="Javascript tag",a.IMAGE="Image";let sA=P.Ry().shape({name:P.Z_().required("Enter a name for this asset"),domain:P.Z_().required("Enter a valid domain for this asset"),asset_type:P.Z_().required("Select an asset type"),data_uses:P.IX().min(1,"Select at least one data use"),base_url:P.Z_().when("asset_type",{is:e=>"Cookie"!==e,then:e=>e.required("Base URL is required"),otherwise:e=>e.notRequired()})}),sE={name:"",description:"",data_uses:[],domain:"",asset_type:"",id:"",system_id:""};var sR=e=>{let{isOpen:s,onClose:t,systemKey:a,asset:r,...o}=e,d=!r,[c,{isLoading:u}]=su(),[p,{isLoading:m}]=sp(),h=(0,l.pmc)(),x=async e=>{let s=await c({systemKey:a,asset:e});if((0,sa.D4)(s)){let e=(0,sa.e$)(s.error,"An unexpected error occurred while saving this asset. Please try again.");h((0,f.Vo)(e))}else h((0,f.t5)("Asset added successfully")),t()},g=async e=>{let s=await p({systemKey:a,assets:[e]});if((0,sa.D4)(s)){let e=(0,sa.e$)(s.error,"An unexpected error occurred while saving this asset. Please try again.");h((0,f.Vo)(e))}else h((0,f.t5)("Asset updated successfully")),t()};return(0,n.jsx)(sS.Z,{title:d?"Add asset":"Edit asset",onClose:t,isOpen:s,...o,children:(0,n.jsx)(W.J9,{initialValues:null!=r?r:sE,onSubmit:e=>{d?x(e):g(e)},validationSchema:sA,children:e=>{let{values:s,isValid:a,dirty:r}=e;return(0,n.jsxs)(W.l0,{children:[(0,n.jsxs)(l.jqI,{vertical:!0,className:"pb-6 pt-4",children:[(0,n.jsx)(sC.Z,{children:(0,n.jsx)(l.xvT,{fontSize:"sm",children:"Create and configure assets (e.g. cookies, pixels, tags) for this system to ensure proper consent enforcement. Adding assets manually allows you to define key attributes, assign categories, and align them with compliance requirements."})}),(0,n.jsxs)(l.jqI,{vertical:!0,gap:20,children:[(0,n.jsx)(Z.j0,{id:"name",name:"name",label:"Name",variant:"stacked",isRequired:!0,disabled:!d}),(0,n.jsx)(N.d,{isRequired:!0,id:"asset_type",name:"asset_type",label:"Asset type",options:(0,sa.MM)(i),layout:"stacked",disabled:!d}),(0,n.jsx)(sT,{name:"data_uses",label:"Data uses",layout:"stacked"}),(0,n.jsx)(Z.j0,{id:"domain",name:"domain",label:"Domain",variant:"stacked",isRequired:!0,disabled:!d}),(0,n.jsx)(Z.Ks,{id:"description",name:"description",label:"Description",variant:"stacked"}),(0,n.jsx)(l.UO1,{in:!!s.asset_type&&"Cookie"!==s.asset_type,children:(0,n.jsx)(Z.j0,{id:"base_url",name:"base_url",label:"Base URL",variant:"stacked",isRequired:!!s.asset_type&&"Cookie"!==s.asset_type})})]})]}),(0,n.jsxs)(l.jqI,{justify:"space-between",children:[(0,n.jsx)(l.wpx,{onClick:t,children:"Cancel"}),(0,n.jsx)(l.wpx,{type:"primary",htmlType:"submit",loading:u||m,disabled:!a||!r,"data-testid":"save-btn",children:"Save"})]})]})}})})},sq=t(8411),sI=t(72625),sz=t(29850),sF=t(77685),sL=e=>{let{systemKey:s,systemName:t,asset:a,readonly:i}=e,[r,o]=(0,p.useState)(!1),[d,c]=(0,p.useState)(),[u,m]=(0,p.useState)(!1),[h,{isLoading:x}]=sp(),{successAlert:g,errorAlert:y}=(0,S.V)(),f=(0,l.qY0)(),{asset_type:_,name:v}=a,b=(0,p.useCallback)(e=>{e.preventDefault(),m(!0)},[]),j=async e=>{if(!e)return;let{newSystemKey:t,newSystemName:i,isNewSystem:n}=e,r=await h({systemKey:s,assets:[{id:a.id,system_key:t}]});(0,eh.D4)(r)?y((0,sa.e$)(r.error)):g(n?"".concat(i," has been added to your system inventory and the ").concat(_,' "').concat(v,'" has been assigned to that system.'):"".concat(_," ").concat(v," has been assigned to ").concat(i)),o(!1),c(void 0)},k=e=>{c(e),f.onOpen()};return i?(0,n.jsx)(l.j8w,{"data-testid":"system-badge",color:"white",children:t}):(0,n.jsxs)(n.Fragment,{children:[!r&&(0,n.jsxs)(l.j8w,{"data-testid":"system-badge",color:"white",onClick:()=>o(!0),children:[t," ",(0,n.jsx)(l.PJP.I8b,{})]}),!!r&&(0,n.jsx)(sz.R,{variant:"borderless",className:"w-full",autoFocus:!0,defaultOpen:!0,defaultValue:s,onBlur:e=>{var s;(null===(s=e.relatedTarget)||void 0===s?void 0:s.getAttribute("id"))!=="add-new-system"&&o(!1)},onAddSystem:b,onSelect:(e,s)=>k({newSystemKey:e,newSystemName:s.label}),loading:x}),u&&(0,n.jsx)(sF.i,{isOpen:!0,onClose:()=>m(!1),onSuccessfulSubmit:(e,s)=>k({newSystemKey:e,newSystemName:s,isNewSystem:!0})}),(0,n.jsx)(l.cVQ,{isOpen:f.isOpen,onClose:f.onClose,onConfirm:()=>{j(d)},title:"Reassign asset",message:"Are you sure you want to reassign this asset to ".concat(null==d?void 0:d.newSystemName,"?"),isCentered:!0})]})},sO=e=>{let{asset:s,systemKey:t,onEditClick:a}=e,[i,{isLoading:r}]=sm(),o=(0,l.pmc)(),{isOpen:d,onClose:c,onOpen:u}=(0,l.qY0)(),p=async()=>{let e=await i({systemKey:t,asset_ids:[s.id]});(0,eh.D4)(e)?o((0,f.Vo)((0,sa.e$)(e.error,"A problem occurred removing this asset. Please try again"))):o((0,f.t5)("Asset removed successfully"))};return(0,n.jsxs)(l.jqI,{className:"gap-1",children:[(0,n.jsx)(l.wpx,{size:"small",onClick:a,"data-testid":"edit-btn",children:"Edit"}),(0,n.jsx)(l.wpx,{size:"small",onClick:u,loading:r,"data-testid":"remove-btn",children:"Remove"}),(0,n.jsx)(l.cVQ,{isOpen:d,onClose:c,onConfirm:p,title:"Remove asset",message:"Are you sure you want to ignore the selected assets? This action cannot be undone and may impact consent automation.",isCentered:!0})]})},sZ=t(34929),sW=t(26183),sP=e=>{var s,t;let{asset:a,systemId:i,readonly:r}=e,{getDataUseDisplayName:o}=(0,sZ.Z)(),[d]=sp(),{errorAlert:c,successAlert:u}=(0,A.V)(),[m,h]=(0,p.useState)(!1),x=async e=>{let s=[...a.data_uses||[],e],t=await d({systemKey:i,assets:[{id:a.id,data_uses:s}]});(0,eh.D4)(t)?c((0,sa.e$)(t.error)):u("Consent category added to ".concat(a.asset_type,' "').concat(a.name,'".'),"Confirmed")},g=async e=>{var s;let t=null===(s=a.data_uses)||void 0===s?void 0:s.filter(s=>s!==e),n=await d({systemKey:i,assets:[{id:a.id,data_uses:t}]});(0,eh.D4)(n)?c((0,sa.e$)(n.error)):u("Consent category removed from ".concat(a.asset_type,' "').concat(a.name,'".'),"Confirmed")},y=null!==(t=null===(s=a.data_uses)||void 0===s?void 0:s.map(e=>({label:o(e),key:e})))&&void 0!==t?t:[];return r?(0,n.jsx)(sW.Z,{children:y.map(e=>(0,n.jsx)(l.j8w,{"data-testid":"data-use-".concat(e.key),color:"white",children:e.label},e.key))}):(0,n.jsxs)(sW.Z,{children:[!m&&(0,n.jsxs)(n.Fragment,{children:[y.map(e=>(0,n.jsx)(l.j8w,{"data-testid":"data-use-".concat(e.key),color:"white",closable:!0,onClose:()=>g(e.key),closeButtonLabel:"Remove data use",children:e.label},e.key)),(0,n.jsx)(l.j8w,{onClick:()=>h(!0),"data-testid":"taxonomy-add-btn",addable:!0,"aria-label":"Add data use"})]}),m&&(0,n.jsx)(l.xuv,{className:"select-wrapper",position:"absolute",zIndex:10,top:"0",left:"0",width:"100%",height:"max",bgColor:"#fff",children:(0,n.jsx)(sD.Z,{selectedTaxonomies:a.data_uses||[],onSelect:x,onBlur:()=>h(!1),open:!0})})]})},sN=e=>{let{systemKey:s,systemName:t,lockedForGVL:a,onEditClick:i}=e,r=(0,sj.Cl)(),l=r.display({id:"select",cell:e=>{let{row:s}=e;return(0,n.jsx)(sI.k,{isChecked:s.getIsSelected(),onChange:s.getToggleSelectedHandler(),dataTestId:"select-".concat(s.original.name||s.id)})},header:e=>{let{table:s}=e;return(0,n.jsx)(sI.k,{isChecked:s.getIsAllPageRowsSelected(),isIndeterminate:s.getIsSomeRowsSelected(),onChange:s.getToggleAllRowsSelectedHandler(),dataTestId:"select-all-rows"})},maxSize:40,meta:{cellProps:{borderRight:"none",paddingRight:0}}}),o=r.accessor(e=>e.name,{id:"name",cell:e=>(0,n.jsx)(sw.G3,{value:e.getValue()}),header:"Asset"}),d=r.accessor(e=>e.asset_type,{id:"resource_type",cell:e=>(0,n.jsx)(sw.G3,{value:e.getValue()}),header:"Type"}),c=r.display({id:"system",cell:e=>(0,n.jsx)(sL,{systemKey:s,systemName:t,asset:e.row.original,readonly:a}),header:"System"}),u=r.accessor(e=>e.data_uses,{id:"data_uses",cell:e=>(0,n.jsx)(sP,{asset:e.row.original,systemId:s,readonly:a}),header:"Categories of consent",size:200}),p=r.accessor(e=>e.locations,{id:"locations",cell:e=>(0,n.jsx)(sI.mb,{values:e.getValue().map(e=>({label:sq.Z8[e],key:e}))}),header:"Locations",size:300}),m=r.accessor(e=>e.domain,{id:"domain",cell:e=>(0,n.jsx)(sw.G3,{value:e.getValue()}),header:"Domain"}),h=r.accessor(e=>e.page,{id:"page",cell:e=>(0,n.jsx)(sI.tc,{values:e.getValue(),valueSuffix:"pages",cellProps:e}),header:e=>(0,n.jsx)(sI.Rr,{value:"Detected on",...e}),meta:{showHeaderMenu:!0,disableRowClick:!0}}),x=r.display({id:"actions",cell:e=>{let{row:t}=e;return(0,n.jsx)(sO,{asset:t.original,systemKey:s,onEditClick:()=>i(t.original)})},header:"Actions"}),g=[o,d,c,u,p,m,h];return a?g:[l,...g,x]},sU=e=>{var s;let{system:t}=e,{PAGE_SIZES:a,pageSize:i,setPageSize:r,onPreviousPageClick:o,isPreviousPageDisabled:d,onNextPageClick:c,isNextPageDisabled:u,startRange:h,endRange:x,pageIndex:g,setTotalPages:y,resetPageIndexToDefault:_}=(0,sw.oi)(),[v,b]=(0,p.useState)(""),[j,k]=(0,p.useState)(void 0),[w,C]=(0,p.useState)({}),[S]=sm(),D=(0,m.C)(ey.gU),T=(0,l.pmc)(),{data:A,isLoading:E,isFetching:R}=sc({fides_key:t.fides_key,search:v,page:g,size:i}),{isOpen:q,onClose:I,onOpen:z}=(0,l.qY0)(),{isOpen:F,onClose:L,onOpen:O}=(0,l.qY0)();(0,p.useEffect)(()=>{_()},[v,_]),(0,p.useEffect)(()=>{y(null==A?void 0:A.pages)},[A,y]);let Z=sN({systemName:null!==(s=t.name)&&void 0!==s?s:t.fides_key,systemKey:t.fides_key,onEditClick:e=>{k(e),z()},lockedForGVL:D}),W=(0,sb.b7)({getCoreRowModel:(0,sj.sC)(),columns:Z,manualPagination:!0,data:(null==A?void 0:A.items)||[],columnResizeMode:"onChange",onRowSelectionChange:C,state:{rowSelection:w}}),P=W.getSelectedRowModel().rows.map(e=>e.original.id),N=async()=>{let e=await S({systemKey:t.fides_key,asset_ids:P});(0,eh.D4)(e)?T((0,f.Vo)((0,sa.e$)(e.error,"A problem occurred removing these assets. Please try again."))):(W.resetRowSelection(),T((0,f.t5)("Assets removed successfully"))),L()};return t?E?(0,n.jsx)(sw.I4,{rowHeight:36,numRows:36}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(l.xvT,{fontSize:"sm",mb:4,children:D?"This page displays all assets associated with this system. Use the table below to review these technologies for compliance and detailed insights.":"This page displays all assets associated with this system. Use the table below to review and manage these technologies for compliance and detailed insights."}),(0,n.jsxs)(sw.Q$,{children:[(0,n.jsx)(sk.f,{value:v,onChange:b}),!D&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(l.LZC,{}),(0,n.jsx)(l.wpx,{icon:(0,n.jsx)(l.PJP.mm_,{}),iconPosition:"end",onClick:z,"data-testid":"add-asset-btn",children:"Add asset"}),(0,n.jsx)(sR,{isOpen:q,onClose:()=>{k(void 0),I()},systemKey:t.fides_key,asset:j}),(0,n.jsx)(l.wpx,{icon:(0,n.jsx)(l.PJP.ZNm,{}),iconPosition:"end",onClick:O,disabled:!P.length,"data-testid":"bulk-delete-btn",children:"Remove"}),(0,n.jsx)(l.cVQ,{isOpen:F,onClose:L,onConfirm:N,title:"Remove assets",message:"Are you sure you want to remove the selected assets? This action cannot be undone and may impact consent automation.",isCentered:!0})]})]}),(0,n.jsx)(sw.ZK,{tableInstance:W,emptyTableNotice:(0,n.jsx)(l.oj8,{image:l.oj8.PRESENTED_IMAGE_SIMPLE,description:"No assets found","data-testid":"empty-state"})}),(0,n.jsx)(sw.s8,{totalRows:(null==A?void 0:A.total)||0,pageSizes:a,setPageSize:r,onPreviousPageClick:o,isPreviousPageDisabled:d||R,onNextPageClick:c,isNextPageDisabled:u||R,startRange:h,endRange:x})]}):null};let sV={INFORMATION:{index:0,hash:"#information"},DATA_USES:{index:1,hash:"#data-uses"},DATA_FLOW:{index:2,hash:"#data-flow"},INTEGRATIONS:{index:3,hash:"#integrations"},ASSETS:{index:4,hash:"#assets"},HISTORY:{index:5,hash:"#history"}},sM=e=>{let s=e.startsWith("#")?e:"#".concat(e);return Object.values(sV).find(e=>e.hash===s)},sB=e=>Object.values(sV).find(s=>s.index===e),sK=e=>{let{onViewDatamap:s,onAddPrivacyDeclaration:t}=e;return(0,n.jsxs)(l.xuv,{children:[(0,n.jsx)(l.xvT,{fontWeight:"700",children:"System has been saved successfully"}),(0,n.jsxs)(l.xvT,{textColor:"gray.700",whiteSpace:"inherit",children:["Your system has been added to your data map. You can"," ",(0,n.jsx)(_.Z,{onClick:s,children:"view it now"})," or"," ",(0,n.jsx)(_.Z,{onClick:t,children:"add privacy declarations in the next tab"}),"."]})]})};var sH=e=>{var s,t;let{isCreate:a}=e,i=(0,c.useRouter)(),[o,u]=(0,p.useState)((()=>{var e,s;let t=i.asPath.split("#")[1];return t&&null!==(s=null===(e=sM(t))||void 0===e?void 0:e.index)&&void 0!==s?s:sV.INFORMATION.index})()),[_,v]=(0,p.useState)(!1),{systemOrDatamapRoute:b}=(0,g.V)(),j=(0,l.pmc)(),k=(0,m.T)(),w=(0,m.C)(O.NC),[C,S]=(0,p.useState)(void 0),{plus:D}=(0,h.hz)(),{plus:T}=(0,h.hz)(),{data:A}=(0,O.rn)(null==w?void 0:w.fides_key,{skip:!w});(0,p.useEffect)(()=>{k((0,O.db)(A))},[A,k]),(0,p.useEffect)(()=>{w&&S(w.processes_personal_data)},[w]);let E=(0,p.useCallback)(e=>{void 0===w&&v(!0),k((0,O.db)(e)),i.push({pathname:y.Dv,query:{id:e.fides_key}});let s={...f.MA,description:(0,n.jsx)(sK,{onViewDatamap:()=>{i.push(b).then(()=>{j.closeAll()})},onAddPrivacyDeclaration:()=>{u(1),j.closeAll()}})};j({...s})},[w,k,i,b,j]);(0,p.useEffect)(()=>(a&&(k((0,O.db)(void 0)),k((0,ey.b3)("initial")),k((0,ey.gQ)(!1))),()=>{k((0,O.db)(void 0))}),[k,a]);let{attemptAction:R}=(0,x.oI)(),q=(0,p.useCallback)(e=>{R().then(async s=>{if(s){let{status:s}=i.query;if(s&&("succeeded"===s?j((0,f.t5)("Integration successfully authorized.")):j((0,f.Vo)("Failed to authorize integration."))),u(e),i.isReady){let s=sB(e);if(s){let e={...i.query};delete e.status,await i.replace({pathname:i.pathname,query:e,hash:s.hash},void 0,{shallow:!0})}}}})},[R,i,j]);(0,p.useEffect)(()=>{let{status:e}=i.query;e&&q(sV.INTEGRATIONS.index)},[i.query,q]);let I=[{label:"Information",content:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(l.xuv,{px:6,mb:9,children:[(0,n.jsx)(x.eB,{}),(0,n.jsx)(sv,{onSuccess:E,system:w})]}),_?(0,n.jsx)(l.xuv,{backgroundColor:"gray.100",px:6,py:3,children:(0,n.jsxs)(l.xvT,{color:"primary.900",fontSize:"sm","data-testid":"save-help-message",children:["Now that you have saved this new system it is"," ",(0,n.jsx)(l.rUS,{as:d(),href:b,textDecor:"underline",children:"ready to view in your data map"}),". You can return to this setup at any time to add privacy declarations to this system."]})}):null]})},{label:"Data uses",content:w?(0,n.jsx)(l.xuv,{px:6,width:{base:"100%",lg:"70%"},children:(0,n.jsx)(st,{system:w})}):null,isDisabled:!w||!C},{label:"Data flow",content:w?(0,n.jsxs)(l.xuv,{width:{base:"100%",lg:"70%"},children:[(0,n.jsxs)(l.xuv,{px:6,paddingBottom:2,children:[(0,n.jsx)(l.xvT,{fontSize:"md",lineHeight:6,fontWeight:"bold",marginBottom:3,children:"Data flow"}),(0,n.jsx)(l.xvT,{fontSize:"sm",lineHeight:5,fontWeight:"medium",children:"Data flow describes the flow of data between systems in your Data Map. Below, you can configure Source and Destination systems and the corresponding links will be drawn in the Data Map graph. Source systems are systems that send data to this system while Destination systems receive data from this system."})]}),(0,n.jsx)(r.q,{system:w,isSystemTab:!0})]}):null,isDisabled:!w},{label:"Integrations",content:w?(0,n.jsxs)(l.xuv,{width:{base:"100%",lg:"70%"},children:[(0,n.jsx)(l.xuv,{px:6,paddingBottom:2,children:(0,n.jsx)(l.xvT,{fontSize:"sm",lineHeight:5,children:T?(0,n.jsxs)(n.Fragment,{children:["Add an integration to start managing privacy requests and consent. Visit"," ",(0,n.jsx)(l.rUS,{href:y.KH,color:"link.900",children:"Integration Management"})," ","to set up monitoring on databases."]}):"Integrations are used to process privacy requests for access erasure, portability, rectification, and consent."})}),(0,n.jsx)(ep,{connectionConfig:w.connection_configs,systemFidesKey:w.fides_key}),(null===(s=w.connection_configs)||void 0===s?void 0:s.key)&&(0,n.jsx)(eg,{m:6,connectionKey:null===(t=w.connection_configs)||void 0===t?void 0:t.key})]}):null,isDisabled:!w}];return D&&I.push({label:"Assets",content:w?(0,n.jsx)(sU,{system:w}):null,isDisabled:!w}),D&&I.push({label:"History",content:w?(0,n.jsxs)(l.xuv,{width:{base:"100%",lg:"70%"},children:[(0,n.jsx)(l.xuv,{px:6,paddingBottom:6,children:(0,n.jsx)(l.xvT,{fontSize:"sm",lineHeight:5,fontWeight:"medium",children:"All changes to this system are tracked here in this audit table by date and by user. You can inspect the changes by selecting any of the events listed."})}),(0,n.jsx)(eB,{system:w})]}):null,isDisabled:!w}),{tabData:I,tabIndex:o,onTabChange:q}}},54748:function(e,s,t){"use strict";var a=t(27378),i=t(46420);s.Z=()=>({legalBasisOptions:(0,a.useMemo)(()=>Object.keys(i.gP).map(e=>({value:i.gP[e],label:i.gP[e]})),[])})},28325:function(e,s,t){"use strict";var a=t(27378),i=t(46420);s.Z=()=>({specialCategoryLegalBasisOptions:(0,a.useMemo)(()=>Object.keys(i.nV).map(e=>({value:i.nV[e],label:i.nV[e]})),[])})}}]);
|
@@ -0,0 +1 @@
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3615],{14441:function(e,t,r){var n,u,o=1/0,f=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,i=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,c="\ud800-\udfff",a="\\u2700-\\u27bf",l="a-z\\xdf-\\xf6\\xf8-\\xff",s="A-Z\\xc0-\\xd6\\xd8-\\xde",d="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",x="['’]",p="["+d+"]",y="[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]",g="["+l+"]",h="[^"+c+d+"\\d+"+a+l+s+"]",v="(?:\ud83c[\udde6-\uddff]){2}",b="[\ud800-\udbff][\udc00-\udfff]",m="["+s+"]",E="(?:"+g+"|"+h+")",j="(?:"+x+"(?:d|ll|m|re|s|t|ve))?",A="(?:"+x+"(?:D|LL|M|RE|S|T|VE))?",O="(?:"+y+"|\ud83c[\udffb-\udfff])?",S="[\\ufe0e\\ufe0f]?",C="(?:\\u200d(?:"+["[^"+c+"]",v,b].join("|")+")"+S+O+")*",I="(?:"+["["+a+"]",v,b].join("|")+")"+(S+O+C),R=RegExp(x,"g"),L=RegExp(y,"g"),U=RegExp([m+"?"+g+"+"+j+"(?="+[p,m,"$"].join("|")+")","(?:"+m+"|"+h+")+"+A+"(?="+[p,m+E,"$"].join("|")+")",m+"?"+E+"+"+j,m+"+"+A,"\\d+",I].join("|"),"g"),z=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Z="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,k="object"==typeof self&&self&&self.Object===Object&&self,w=Z||k||Function("return this")(),N=(n={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"ss"},function(e){return null==n?void 0:n[e]}),G=Object.prototype.toString,T=w.Symbol,Y=T?T.prototype:void 0,_=Y?Y.toString:void 0;function D(e){return null==e?"":function(e){if("string"==typeof e)return e;if("symbol"==typeof(t=e)||t&&"object"==typeof t&&"[object Symbol]"==G.call(t))return _?_.call(e):"";var t,r=e+"";return"0"==r&&1/e==-o?"-0":r}(e)}var M=(u=function(e,t,r){return e+(r?"_":"")+t.toLowerCase()},function(e){var t;return function(e,t,r,n){for(var u=-1,o=e?e.length:0;++u<o;)r=t(r,e[u],u,e);return r}(function(e,t,r){if(e=D(e),void 0===t){var n;return(n=e,z.test(n))?e.match(U)||[]:e.match(f)||[]}return e.match(t)||[]}(((t=D(t=e))&&t.replace(i,N).replace(L,"")).replace(R,"")),u,"")});e.exports=M},56141:function(e,t,r){var n=r(32866);e.exports=function(e,t){return n(e,t)}},11055:function(e,t,r){"use strict";r.d(t,{M:function(){return s}});var n=r(24246),u=r(29427),o=r(27378),f=r(40976),i=r(18397),c=r(42308),a=r(25431),l=r(39556);let s=(0,o.forwardRef)(function({children:e,as:t="ul",axis:r="y",onReorder:s,values:p,...y},g){let h=(0,c.h)(()=>i.E[t]),v=[],b=(0,o.useRef)(!1);return(0,u.k)(!!p,"Reorder.Group must be provided a values prop"),(0,o.useEffect)(()=>{b.current=!1}),(0,n.jsx)(h,{...y,ref:g,ignoreStrict:!0,children:(0,n.jsx)(f.Y.Provider,{value:{axis:r,registerItem:(e,t)=>{let n=v.findIndex(t=>e===t.value);-1!==n?v[n].layout=t[r]:v.push({value:e,layout:t[r]}),v.sort(x)},updateOrder:(e,t,r)=>{if(b.current)return;let n=function(e,t,r,n){if(!n)return e;let u=e.findIndex(e=>e.value===t);if(-1===u)return e;let o=n>0?1:-1,f=e[u+o];if(!f)return e;let i=e[u],c=f.layout,s=(0,l.t)(c.min,c.max,.5);return 1===o&&i.layout.max+r>s||-1===o&&i.layout.min+r<s?(0,a.uo)(e,u,u+o):e}(v,e,t,r);v!==n&&(b.current=!0,s(n.map(d).filter(e=>-1!==p.indexOf(e))))}},children:e})})});function d(e){return e.value}function x(e,t){return e.layout.min-t.layout.min}},7078:function(e,t,r){"use strict";r.d(t,{e:function(){return E}});var n=r(24246),u=r(29427),o=r(27378),f=r(40976),i=r(18397),c=r(42308),a=r(69222),l=r(67412);function s(e){let t=(0,c.h)(()=>(0,a.BX)(e)),{isStatic:r}=(0,o.useContext)(l._);if(r){let[,r]=(0,o.useState)(e);(0,o.useEffect)(()=>t.on("change",r),[])}return t}var d=r(13998);let x=e=>e&&"object"==typeof e&&e.mix,p=e=>x(e)?e.mix:void 0;var y=r(64306),g=r(95984);function h(e,t){let r=s(t()),n=()=>r.set(t());return n(),(0,y.L)(()=>{let t=()=>g.Wi.preRender(n,!1,!0),r=e.map(e=>e.on("change",t));return()=>{r.forEach(e=>e()),(0,g.Pn)(n)}}),r}function v(e,t){let r=(0,c.h)(()=>[]);return h(e,()=>{r.length=0;let n=e.length;for(let t=0;t<n;t++)r[t]=e[t].get();return t(r)})}var b=r(3522);function m(e,t=0){return(0,b.i)(e)?e:s(t)}let E=(0,o.forwardRef)(function({children:e,style:t={},value:r,as:l="li",onDrag:s,layout:x=!0,...y},g){let b=(0,c.h)(()=>i.E[l]),E=(0,o.useContext)(f.Y),j={x:m(t.x),y:m(t.y)},A=function(e,t,r,n){if("function"==typeof e)return function(e){a.S1.current=[],e();let t=h(a.S1.current,e);return a.S1.current=void 0,t}(e);let u="function"==typeof t?t:function(...e){let t=!Array.isArray(e[0]),r=t?0:-1,n=e[0+r],u=e[1+r],o=e[2+r],f=e[3+r],i=(0,d.s)(u,o,{mixer:p(o[0]),...f});return t?i(n):i}(t,void 0,void 0);return Array.isArray(e)?v(e,u):v([e],([e])=>u(e))}([j.x,j.y],([e,t])=>e||t?1:"unset");(0,u.k)(!!E,"Reorder.Item must be a child of Reorder.Group");let{axis:O,registerItem:S,updateOrder:C}=E;return(0,n.jsx)(b,{drag:O,...y,dragSnapToOrigin:!0,style:{...t,x:j.x,y:j.y,zIndex:A},layout:x,onDrag:(e,t)=>{let{velocity:n}=t;n[O]&&C(r,j[O].get(),n[O]),s&&s(e,t)},onLayoutMeasure:e=>S(r,e),ref:g,ignoreStrict:!0,children:e})})},40976:function(e,t,r){"use strict";r.d(t,{Y:function(){return n}});let n=(0,r(27378).createContext)(null)},47397:function(e,t,r){"use strict";r.d(t,{o:function(){return f}});var n=r(42308);class u{constructor(){this.componentControls=new Set}subscribe(e){return this.componentControls.add(e),()=>this.componentControls.delete(e)}start(e,t){this.componentControls.forEach(r=>{r.start(e.nativeEvent||e,t)})}}let o=()=>new u;function f(){return(0,n.h)(o)}}}]);
|