recce-nightly 0.57.0.20250306__tar.gz → 0.57.0.20250310__tar.gz
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.
- {recce_nightly-0.57.0.20250306/recce_nightly.egg-info → recce_nightly-0.57.0.20250310}/PKG-INFO +1 -1
- recce_nightly-0.57.0.20250310/recce/VERSION +1 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/data/404.html +1 -1
- recce_nightly-0.57.0.20250310/recce/data/_next/static/chunks/app/page-6ff79de000e5b4bd.js +1 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/data/index.html +2 -2
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/data/index.txt +2 -2
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310/recce_nightly.egg-info}/PKG-INFO +1 -1
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce_nightly.egg-info/SOURCES.txt +3 -3
- recce_nightly-0.57.0.20250306/recce/VERSION +0 -1
- recce_nightly-0.57.0.20250306/recce/data/_next/static/chunks/app/page-60e62c1c6f419625.js +0 -1
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/LICENSE +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/README.md +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/__init__.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/adapter/__init__.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/adapter/base.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/adapter/dbt_adapter/__init__.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/adapter/dbt_adapter/dbt_version.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/adapter/sqlmesh_adapter.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/apis/__init__.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/apis/check_api.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/apis/check_func.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/apis/run_api.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/apis/run_func.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/artifact.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/cli.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/config.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/core.py +0 -0
- {recce_nightly-0.57.0.20250306/recce/data/_next/static/Nk4rGHMTXAowrxVjr1CK0 → recce_nightly-0.57.0.20250310/recce/data/_next/static/KZBcKj-BHQq_dqlxZTfGX}/_buildManifest.js +0 -0
- {recce_nightly-0.57.0.20250306/recce/data/_next/static/Nk4rGHMTXAowrxVjr1CK0 → recce_nightly-0.57.0.20250310/recce/data/_next/static/KZBcKj-BHQq_dqlxZTfGX}/_ssgManifest.js +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/data/_next/static/chunks/29e3cc0d-b9131230fdb267e7.js +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/data/_next/static/chunks/36e1c10d-440dfddfa8195fa6.js +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/data/_next/static/chunks/3998a672-18454f939c052b39.js +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/data/_next/static/chunks/450c323b-ff537c106edf3f59.js +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/data/_next/static/chunks/47d8844f-cac2989cb39ba350.js +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/data/_next/static/chunks/523b8219-cd28a6efac8e1cf1.js +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/data/_next/static/chunks/6dc81886-d45acadb4b6674c7.js +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/data/_next/static/chunks/764-350e6bbb8a63c229.js +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/data/_next/static/chunks/7a8a3e83-1a4edb77e4d0142d.js +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/data/_next/static/chunks/7f27ae6c-9c6bdf82ccd2f646.js +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/data/_next/static/chunks/921-4158ef2dc23e4a01.js +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/data/_next/static/chunks/9746af58-344daabf5df08121.js +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/data/_next/static/chunks/a30376cd-0e2abcaded0e4cfc.js +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/data/_next/static/chunks/app/_not-found/page-8fb2dd95da4548ae.js +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/data/_next/static/chunks/app/layout-2ba8d6f3664176aa.js +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/data/_next/static/chunks/b63b1b3f-fbe2ac2c00b4eb2f.js +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/data/_next/static/chunks/c132bf7d-3375ff4277eceb81.js +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/data/_next/static/chunks/c1ceaa8b-c4f0232ef5c2c9ba.js +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/data/_next/static/chunks/cd9f8d63-ba9b342f3d5e92ac.js +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/data/_next/static/chunks/ce84277d-3cee88b51629d895.js +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/data/_next/static/chunks/e24bf851-38fffe87a7b8784a.js +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/data/_next/static/chunks/fee69bc6-4490eb47d2aaaa72.js +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/data/_next/static/chunks/framework-ded83d71b51ce901.js +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/data/_next/static/chunks/main-535eacaa53931854.js +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/data/_next/static/chunks/main-app-6f45568a6a7cd7b0.js +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/data/_next/static/chunks/pages/_app-bbd1966052cb1e5d.js +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/data/_next/static/chunks/pages/_error-2456b9a2e0600a52.js +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/data/_next/static/chunks/polyfills-42372ed130431b0a.js +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/data/_next/static/chunks/webpack-5ab3237140d2c0f8.js +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/data/_next/static/css/c9ecb46a4b21c126.css +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/data/_next/static/media/montserrat-cyrillic-800-normal.22628180.woff2 +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/data/_next/static/media/montserrat-cyrillic-800-normal.31d693bb.woff +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/data/_next/static/media/montserrat-cyrillic-ext-800-normal.7e2c1e62.woff +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/data/_next/static/media/montserrat-cyrillic-ext-800-normal.94a63aea.woff2 +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/data/_next/static/media/montserrat-latin-800-normal.6f8fa298.woff2 +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/data/_next/static/media/montserrat-latin-800-normal.97e20d5e.woff +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/data/_next/static/media/montserrat-latin-ext-800-normal.013b84f9.woff2 +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/data/_next/static/media/montserrat-latin-ext-800-normal.aff52ab0.woff +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/data/_next/static/media/montserrat-vietnamese-800-normal.5f21869b.woff +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/data/_next/static/media/montserrat-vietnamese-800-normal.c0035377.woff2 +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/data/favicon.ico +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/data/imgs/feedback/thumbs-down.png +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/data/imgs/feedback/thumbs-up.png +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/data/logo/recce-logo-white.png +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/diff.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/event/CONFIG +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/event/SENTRY_DNS +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/event/__init__.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/event/collector.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/event/track.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/exceptions.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/git.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/github.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/models/__init__.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/models/check.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/models/run.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/models/types.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/pull_request.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/run.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/server.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/state.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/summary.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/tasks/__init__.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/tasks/core.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/tasks/dataframe.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/tasks/histogram.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/tasks/lineage.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/tasks/profile.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/tasks/query.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/tasks/rowcount.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/tasks/schema.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/tasks/top_k.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/tasks/valuediff.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/util/__init__.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/util/breaking.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/util/cache.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/util/cll.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/util/io.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/util/logger.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/util/pydantic_model.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/util/recce_cloud.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/util/singleton.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce/yaml/__init__.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce_nightly.egg-info/dependency_links.txt +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce_nightly.egg-info/entry_points.txt +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce_nightly.egg-info/requires.txt +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/recce_nightly.egg-info/top_level.txt +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/setup.cfg +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/setup.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/tests/__init__.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/tests/adapter/__init__.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/tests/adapter/dbt_adapter/__init__.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/tests/adapter/dbt_adapter/conftest.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/tests/adapter/dbt_adapter/dbt_test_helper.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/tests/adapter/dbt_adapter/test_dbt_adapter.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/tests/adapter/dbt_adapter/test_selector.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/tests/tasks/__init__.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/tests/tasks/conftest.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/tests/tasks/test_histogram.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/tests/tasks/test_lineage.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/tests/tasks/test_preset_checks.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/tests/tasks/test_profile.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/tests/tasks/test_query.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/tests/tasks/test_row_count.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/tests/tasks/test_schema.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/tests/tasks/test_top_k.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/tests/tasks/test_valuediff.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/tests/test_cli.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/tests/test_config.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/tests/test_core.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/tests/test_dbt.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/tests/test_pull_request.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/tests/test_server.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/tests/test_state.py +0 -0
- {recce_nightly-0.57.0.20250306 → recce_nightly-0.57.0.20250310}/tests/test_summary.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.57.0.20250310
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-5ab3237140d2c0f8.js"/><script src="/_next/static/chunks/523b8219-cd28a6efac8e1cf1.js" async=""></script><script src="/_next/static/chunks/921-4158ef2dc23e4a01.js" async=""></script><script src="/_next/static/chunks/main-app-6f45568a6a7cd7b0.js" async=""></script><meta name="robots" content="noindex"/><title>404: This page could not be found.</title><title>recce</title><meta name="description" content="Recce: Data validation toolkit for comprehensive PR review"/><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><script src="/_next/static/chunks/webpack-5ab3237140d2c0f8.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:I[65035,[],\"\"]\n3:I[49712,[],\"\"]\n4:I[30691,[],\"\"]\na:I[36979,[],\"\"]\n5:{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"}\n6:{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"}\n7:{\"display\":\"inline-block\"}\n8:{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0}\nb:[]\n"])</script><script>self.__next_f.push([1,"0:[\"$\",\"$L1\",null,{\"buildId\":\"
|
|
1
|
+
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-5ab3237140d2c0f8.js"/><script src="/_next/static/chunks/523b8219-cd28a6efac8e1cf1.js" async=""></script><script src="/_next/static/chunks/921-4158ef2dc23e4a01.js" async=""></script><script src="/_next/static/chunks/main-app-6f45568a6a7cd7b0.js" async=""></script><meta name="robots" content="noindex"/><title>404: This page could not be found.</title><title>recce</title><meta name="description" content="Recce: Data validation toolkit for comprehensive PR review"/><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><script src="/_next/static/chunks/webpack-5ab3237140d2c0f8.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:I[65035,[],\"\"]\n3:I[49712,[],\"\"]\n4:I[30691,[],\"\"]\na:I[36979,[],\"\"]\n5:{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"}\n6:{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"}\n7:{\"display\":\"inline-block\"}\n8:{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0}\nb:[]\n"])</script><script>self.__next_f.push([1,"0:[\"$\",\"$L1\",null,{\"buildId\":\"KZBcKj-BHQq_dqlxZTfGX\",\"assetPrefix\":\"\",\"urlParts\":[\"\",\"_not-found\"],\"initialTree\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{},[[\"$L2\",[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],null],null],null]},[null,[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"/_not-found\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\"}]],null]},[[null,[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[\"$\",\"body\",null,{\"suppressHydrationWarning\":true,\"children\":[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$5\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$6\",\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":\"$7\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$8\",\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyles\":[]}]}]}]],null],null],\"couldBeIntercepted\":false,\"initialHead\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],\"$L9\"],\"globalErrorComponent\":\"$a\",\"missingSlots\":\"$Wb\"}]\n"])</script><script>self.__next_f.push([1,"9:[[\"$\",\"meta\",\"0\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"1\",{\"charSet\":\"utf-8\"}],[\"$\",\"title\",\"2\",{\"children\":\"recce\"}],[\"$\",\"meta\",\"3\",{\"name\":\"description\",\"content\":\"Recce: Data validation toolkit for comprehensive PR review\"}]]\n2:null\n"])</script></body></html>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[931],{16185:function(e,n,t){Promise.resolve().then(t.bind(t,39890))},39890:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return lU}});var i=t(35775),r=t(91348),l=t(56156),s=t(89377),o=t(8698),a=t(20086),c=t(96743),d=t(33344),u=t(21260),h=t(13290),x=t(29609),m=t(20476),p=t(33413),f=t(92814),g=t(57454),j=t(47121),v=t(8035),y=t(46612),b=t(42693);let w='select * from {{ ref("mymodel") }}',k=(0,v.createContext)({sqlQuery:w,setSqlQuery:()=>{},primaryKeys:void 0,setPrimaryKeys:()=>{},isCustomQueries:!1,setCustomQueries:()=>{},baseSqlQuery:w,setBaseSqlQuery:()=>{}});function C(e){let{children:n}=e,[t,r]=v.useState(w),[l,s]=v.useState(w),[o,a]=v.useState(!1),[c,d]=v.useState();return(0,i.jsx)(k.Provider,{value:{setSqlQuery:r,sqlQuery:t,setPrimaryKeys:d,primaryKeys:c,isCustomQueries:o,setCustomQueries:a,baseSqlQuery:l,setBaseSqlQuery:s},children:n})}let _=()=>(0,v.useContext)(k),S=(0,v.createContext)({isNodesFetching:[],setIsNodesFetching:()=>{}});function z(e){let{children:n}=e,[t,r]=v.useState([]);return(0,i.jsx)(S.Provider,{value:{isNodesFetching:t,setIsNodesFetching:r},children:n})}var R=t(11410);function T(e,n){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e3,i=new Set,r={},l=(e,t)=>{if(!(t<0)&&(void 0===r[e]||!(r[e]>=t))){for(let i of(r[e]=t,n(e)))l(i,t-1);i.add(e)}};for(let n of e)l(n,t);return i}function L(){for(var e=arguments.length,n=Array(e),t=0;t<e;t++)n[t]=arguments[t];let i=new Set;return n.forEach(e=>{e.forEach(e=>{i.add(e)})}),i}var I=t(36573),E=t.n(I);function D(e,n){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e3;return T(n,n=>void 0===e.nodes[n]?[]:Object.keys(e.nodes[n].parents),t)}function O(e,n){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e3;return T(n,n=>void 0===e.nodes[n]?[]:Object.keys(e.nodes[n].children),t)}function A(e){return new Set(Object.values(e.nodes).map(e=>e.id))}function M(e,n){return n?e.impactedSet:O(e,e.modifiedSet)}function F(e,n,t){let i=[],r=[],l=t?function(e,n,t){let i={},r={},l="".concat(n,"_").concat(t);for(let[,n]of Object.entries(e)){var s,o;let e=null===(s=n.data.current)||void 0===s?void 0:s.id;if(e)for(let[,t]of Object.entries((null===(o=n.data.current)||void 0===o?void 0:o.columns)||{})){let n="".concat(e,"_").concat(t.name);for(let e of(i[n]=[],t.depends_on||[])){let t="".concat(e.node,"_").concat(e.column);i[n].push(t),t in r||(r[t]=[]),r[t].push(n)}}}return L(function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;return T(e,e=>e in r?r[e]:[],n)}([l]),function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;return T(e,e=>e in i?i[e]:[],n)}([l]))}(e.nodes,t.node,t.column):new Set;function s(e){return"base"===e?0:"current"===e?2:1}function o(e,n){let t=s(e.from),i=s(n.from);return t<i?-1:t>i?1:0}let a=void 0!==n?new Set(n):void 0;for(let n of Object.values(e.nodes).sort(o)){var c;if(a&&!a.has(n.id))continue;let e=new Set,t=0;if(null===(c=n.data.current)||void 0===c?void 0:c.columns)for(let s of Object.values(n.data.current.columns)){let o="".concat(n.id,"_").concat(s.name);if(l.has(o)){for(let e of(i.push({id:o,position:{x:10,y:70+15*t},parentId:n.id,extent:"parent",draggable:!1,data:{node:n,column:s.name,type:s.type,transformationType:s.transformation_type},style:{zIndex:9999},type:"customColumnNode",targetPosition:R.Ly.Left,sourcePosition:R.Ly.Right}),s.depends_on||[])){let n="".concat(e.node,"_").concat(e.column);l.has(n)&&r.push({id:"".concat(n,"_").concat(o),source:n,target:o,style:{zIndex:9999}})}t++,e.add(o)}}i.push({id:n.id,position:{x:0,y:0},width:300,height:36+15*t,data:{...n,columnSet:e},type:"customNode",targetPosition:R.Ly.Left,sourcePosition:R.Ly.Right})}for(let n of Object.values(e.edges).sort(o))(!a||a.has(n.parent.id)&&a.has(n.child.id))&&r.push({id:n.id,type:"customEdge",source:n.parent.id,target:n.child.id,data:n});return N(i,r),[i,r]}let N=function(e,n){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"LR",i=new(E()).graphlib.Graph;i.setDefaultEdgeLabel(()=>({})),i.setGraph({rankdir:t}),e.forEach(e=>{"customNode"===e.type&&i.setNode(e.id,{width:e.width,height:e.height})}),n.forEach(e=>{i.setEdge(e.source,e.target)}),E().layout(i),e.forEach(e=>{if("customNode"!==e.type)return;let n=e.width||300,t=e.height||36,r=i.node(e.id);return e.position={x:r.x-n/2,y:r.y-t/2},e})};function q(e,n,t){let i=new Set(e),r=new Set(t.filter(e=>i.has(e.source)&&i.has(e.target)).map(e=>e.id));return[n.map(e=>({...e,data:{...e.data,isHighlighted:i.has(e.id)}})),t.map(e=>({...e,data:{...e.data,isHighlighted:r.has(e.id)}}))]}function H(e,n){return n.map(n=>{let t=n.id===e;return{...n,data:{...n.data,isSelected:t}}})}function V(e,n){return n.map(n=>{let t=n.id===e;return{...n,data:{...n.data,isSelected:n.data.isSelected!==t}}})}function P(e,n){let t=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return n.map(n=>{let i=e.includes(n.id);return{...n,data:{...n.data,isSelected:t?i:n.data.isSelected||i}}})}function W(e){return e.map(e=>({...e,data:{...e.data,isSelected:!1}}))}function K(e,n){return e.map(e=>({...e,data:{...e.data,isActionMode:n,action:void 0}}))}let B={lineage:()=>["lineage"],checks:()=>["checks","list"],check:e=>["checks",e],runs:()=>["runs"],run:e=>["runs",e],runsAggregated:()=>["runs_aggregated"],flag:()=>["flag"]};var J=t(90663),U=t(53624);let Q=U.env.NEXT_PUBLIC_API_URL?U.env.NEXT_PUBLIC_API_URL:window.location.origin;var Z=t(42974);let X=J.default.create({baseURL:Q}),G=new Z.S;async function Y(){return(await X.get("/api/info")).data}async function $(e){return(await X.get("/api/model/".concat(e))).data}var ee=t(39186),en=t(9308),et=t(92404),ei=t(73353),er=t(30495),el=t(63932),es=t(2691),eo=t(42892),ea=t(40474),ec=t(98838),ed=t(93175),eu=t.n(ed),eh=t(26573);function ex(e){eh.j("[Web] multi_nodes_action",e)}function em(e){eh.j("[Web] history_action",e)}function ep(e){eh.j("[Experiment] preview_change",e)}function ef(e){eh.j("[Experiment] preview_change",e)}function eg(e){eh.j("[Experiment] single_environment",e)}function ej(e){eh.j("[Experiment] recommend_preset_check",e)}let ev=!1;async function ey(e,n,t){let i=ev?{breaking_change_analysis:!0}:{};return(await X.post("/api/runs",{type:e,params:n,nowait:null==t?void 0:t.nowait,track_props:i})).data}async function eb(e,n){return(await X.get("/api/runs/".concat(e,"/wait"),{params:{timeout:n}})).data}async function ew(e){return await X.post("/api/runs/".concat(e,"/cancel"))}async function ek(e,n){return(await X.post("/api/checks/".concat(e,"/run"),{nowait:null==n?void 0:n.nowait})).data}async function eC(e,n,t){return(await X.post("/api/runs/search",{type:e,params:n,limit:t})).data}async function e_(){return(await X.get("/api/runs")).data}async function eS(){return(await X.post("/api/runs/aggregate",{})).data}async function ez(){return(await X.get("/api/flag")).data}async function eR(){try{await X.post("/api/onboarding/completed")}catch(e){}}async function eT(){try{await X.post("/api/relaunch-hint/completed")}catch(e){}}let eL=()=>(0,y.a)({queryKey:B.flag(),queryFn:ez}),eI=(0,v.createContext)({isActionAvailable:()=>!0});function eE(e){var n;let{children:t}=e,r=(0,y.a)({queryKey:B.lineage(),queryFn:Y}),l=(0,y.a)({queryKey:B.runsAggregated(),queryFn:eS}),s=(0,v.useMemo)(()=>{var e;let n=null===(e=r.data)||void 0===e?void 0:e.lineage;if((null==n?void 0:n.base)&&n.current)return function(e,n,t){let i={},r={},l=(e,n)=>({id:e,name:e,data:{},from:n,parents:{},children:{},isSelected:!1});for(let[n,t]of Object.entries(e.nodes))i[n]=l(n,"base"),t&&(i[n].data.base=t,i[n].name=t.name,i[n].resourceType=t.resource_type,i[n].packageName=t.package_name);for(let[e,t]of Object.entries(n.nodes))i[e]?i[e].from="both":i[e]=l(e,"current"),t&&(i[e].data.current=n.nodes&&n.nodes[e],i[e].name=t.name,i[e].resourceType=t.resource_type,i[e].packageName=t.package_name);for(let[n,t]of Object.entries(e.parent_map))for(let e of t){let t=i[n],l=i[e],s="".concat(e,"_").concat(n);if(!t||!l)continue;r[s]={id:s,from:"base",parent:l,child:t};let o=r[s];t.parents[e]=o,l.children[n]=o}for(let[e,t]of Object.entries(n.parent_map))for(let n of t){let t=i[e],l=i[n],s="".concat(n,"_").concat(e);if(!t||!l)continue;r[s]?r[s].from="both":r[s]={id:s,from:"current",parent:l,child:t};let o=r[s];t.parents[n]=o,l.children[e]=o}let s=[],o=[],a=[];for(let[e,n]of Object.entries(i))if(t){let i=t[e];i&&(n.changeStatus=i.change_status,s.push(e),"non-breaking"===i.change_category?o.push(e):a.push(e))}else if("base"===n.from)n.changeStatus="removed",s.push(n.id);else if("current"===n.from)n.changeStatus="added",s.push(n.id);else{var c,d,u,h;let t=null===(d=n.data.base)||void 0===d?void 0:null===(c=d.checksum)||void 0===c?void 0:c.checksum,i=null===(h=n.data.current)||void 0===h?void 0:null===(u=h.checksum)||void 0===u?void 0:u.checksum;t&&i&&t!==i&&(n.changeStatus="modified",s.push(n.id),a.push(e))}for(let[e,n]of Object.entries(r))"base"===n.from?n.changeStatus="removed":"current"===n.from&&(n.changeStatus="added");let x=L(new Set(s),T(a,e=>void 0===i[e]?[]:Object.keys(i[e].children)));return{nodes:i,edges:r,modifiedSet:s,nonBreakingSet:new Set(o),impactedSet:x,manifestMetadata:{base:e.manifest_metadata||void 0,current:n.manifest_metadata||void 0},catalogMetadata:{base:e.catalog_metadata||void 0,current:n.catalog_metadata||void 0}}}(n.base,n.current,n.diff)},[r.data]),o=null===(n=r.error)||void 0===n?void 0:n.message,{lineage:a,sqlmesh:c,demo:d,review_mode:u,cloud_mode:h,file_mode:x,filename:m,adapter_type:p,git:f,pull_request:g,support_tasks:j}=r.data||{},w=null==a?void 0:a.base.manifest_metadata,k=null==a?void 0:a.current.manifest_metadata,{connectionStatus:C,connect:_,envStatus:S}=function(){let e=(0,ee.p)(),n=(0,v.useRef)({ws:void 0,status:"pending"}),[t,i]=(0,v.useState)("pending"),[r,l]=(0,v.useState)(void 0);n.current.status=t;let s=(0,b.NL)(),o=()=>{s.invalidateQueries({queryKey:B.lineage()}),s.invalidateQueries({queryKey:B.checks()}),s.invalidateQueries({queryKey:B.runs()})},a=()=>{let t=new WebSocket("".concat(Q.replace(/(http)(s)?:\/\//,"ws$2://"),"/api/ws"));n.current.ws=t,t.onopen=()=>{t.send("ping")},t.onmessage=t=>{if("pong"===t.data){"disconnected"===n.current.status&&o(),i("connected");return}try{let n=JSON.parse(t.data);if("refresh"===n.command){let{eventType:t,srcPath:i}=n.event,[r,l]=i.split("/").slice(-2),s=eu().parse(l).name,a="".concat(r,"-").concat(s,"-").concat(t);e.isActive(a)||e({id:a,description:"Detected ".concat(r," ").concat(s," ").concat(t),status:"info",variant:"left-accent",position:"bottom-right",duration:5e3,isClosable:!0}),o()}else"relaunch"===n.command&&l("relaunch")}catch(e){console.error(e)}},t.onerror=e=>{console.error(e)},t.onclose=()=>{i(e=>"connected"===e?"disconnected":e),n.current.ws=void 0}};return(0,v.useEffect)(()=>{let e=n.current;return a(),()=>{e.ws&&e.ws.close()}},[]),{connectionStatus:t,connect:a,envStatus:r}}(),{data:z,isLoading:R}=eL(),{onClose:I}=(0,en.q)(),[E,D]=(0,v.useState)(!1),O=(0,b.NL)(),A=(0,v.useCallback)(e=>{if(j){var n;return null===(n=j[e])||void 0===n||n}return!0},[j]);return(0,v.useEffect)(()=>{R||("relaunch"===S&&(null==z?void 0:z.single_env_onboarding)&&z.show_relaunch_hint?(D(!0),eg({action:"target_base_added"})):D(!1))},[z,S,R]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(eI.Provider,{value:{lineageGraph:s,retchLineageGraph:()=>{l.refetch()},envInfo:{adapterType:p,git:f,pullRequest:g,dbt:{base:w,current:k},sqlmesh:c},reviewMode:u,cloudMode:h,fileMode:x,fileName:m,isDemoSite:d,error:o,supportTasks:j,isActionAvailable:A,isLoading:r.isLoading,runsAggregated:l.data,refetchRunsAggregated:()=>{l.refetch()}},children:t}),(0,i.jsxs)(et.u_,{isOpen:"disconnected"===C,onClose:()=>{},isCentered:!0,children:[(0,i.jsx)(ei.Z,{}),(0,i.jsxs)(er.h,{children:[(0,i.jsx)(el.x,{children:"Server Disconnected"}),(0,i.jsx)(es.f,{children:(0,i.jsx)(eo.x,{children:"The server connection has been lost. Please restart the Recce server and try again."})}),(0,i.jsx)(ea.m,{children:(0,i.jsx)(ec.z,{colorScheme:"blue",onClick:()=>{_()},children:"Retry"})})]})]}),(null==z?void 0:z.single_env_onboarding)&&(0,i.jsxs)(et.u_,{isOpen:E,onClose:()=>{I(),eT(),O.invalidateQueries({queryKey:B.flag()})},isCentered:!0,children:[(0,i.jsx)(ei.Z,{}),(0,i.jsxs)(er.h,{children:[(0,i.jsx)(el.x,{children:"Target-base Added"}),(0,i.jsx)(es.f,{children:(0,i.jsx)(eo.x,{children:"Please restart the Recce server."})}),(0,i.jsx)(ea.m,{children:(0,i.jsx)(ec.z,{colorScheme:"blue",onClick:()=>{I(),eT(),O.invalidateQueries({queryKey:B.flag()})},children:"Got it!"})})]})]})]})}let eD=()=>(0,v.useContext)(eI),eO=()=>{let{runsAggregated:e,refetchRunsAggregated:n}=eD();return[e,n]};var eA=t(8108);let eM=e=>{let{isOpen:n,onClose:t,onExecute:l,type:s,title:a,params:c,RunForm:d}=e,[u,h]=(0,v.useState)(c),[x,m]=(0,v.useState)(!1);return(0,i.jsxs)(et.u_,{isOpen:n,onClose:t,size:"6xl",scrollBehavior:"inside",children:[(0,i.jsx)(ei.Z,{}),(0,i.jsxs)(er.h,{overflowY:"auto",height:"75%",minHeight:"400px",children:[(0,i.jsx)(el.x,{children:a}),(0,i.jsx)(eA.o,{}),(0,i.jsx)(es.f,{p:"0px",h:"100%",overflow:"auto",borderY:"1px solid lightgray",children:(0,i.jsx)(r.x,{style:{contain:"layout"},children:d&&(0,i.jsx)(d,{params:u,onParamsChanged:h,setIsReadyToExecute:m})})}),(0,i.jsx)(ea.m,{children:(0,i.jsx)(o.k,{gap:"10px",children:(0,i.jsx)(ec.z,{isDisabled:!x,colorScheme:"blue",onClick:()=>{l(s,u)},children:"Execute"})})})]})]})};var eF=t(84805),eN=t(51374),eq=t(90389),eH=t(35337),eV=t(89039),eP=t(28626),eW=t.n(eP);function eK(e,n){let t=[];return e.forEach(e=>{t.some(n=>n.name===e.name)||t.push(e)}),n.forEach(e=>{t.some(n=>n.name===e.name)||t.push(e)}),t}var eB=e=>{var n;let{lineageGraph:t}=eD(),[i,r]=(0,v.useState)([]),[l,s]=(0,v.useState)(),[o,a]=(0,v.useState)(!0),[c,d]=(0,v.useState)(null),u=eW().find(null==t?void 0:t.nodes,{name:e}),h=(0,v.useMemo)(()=>u?function(e){function n(e){return(null==e?void 0:e.columns)?Object.values(e.columns):[]}return eK(n(e.data.base),n(e.data.current))}(u):[],[u]),x=u?null===(n=u.data.current)||void 0===n?void 0:n.primary_key:void 0;return(0,v.useEffect)(()=>{let e=async()=>{try{let e=(await $(null==u?void 0:u.id)).model;if(!e.base.columns||!e.current.columns){r([]);return}s(e.current.primary_key);let n=Object.values(e.base.columns),t=Object.values(e.current.columns);r(eK(n,t))}catch(e){d(e)}};h.length>0?(r(h),s(x)):(null==u?void 0:u.id)===void 0?r([]):e(),a(!1)},[null==u?void 0:u.id,h,x]),{columns:i,primaryKey:l,isLoading:o,error:c}};function eJ(e){let n=e.trim().toUpperCase();return!!["CHAR","VARCHAR","TINYTEXT","TEXT","MEDIUMTEXT","LONGTEXT","NCHAR","NVARCHAR","VARCHAR2","NVARCHAR2","CLOB","NCLOB","VARCHAR(MAX)","XML","JSON"].includes(n)||/^(VARCHAR|NVARCHAR|VARCHAR2|NVARCHAR2|CHAR|NCHAR)\(\d+\)$/.test(n)}function eU(e){return["BOOLEAN","TINYINT(1)","BIT","NUMBER(1)","BOOL"].includes(e.toUpperCase())}function eQ(e){return["DATE","DATETIME","TIMESTAMP","TIME","YEAR","DATETIME2","SMALLDATETIME","DATETIMEOFFSET","INTERVAL","TIMESTAMPTZ","TIMETZ","TIMESTAMP WITH TIME ZONE","TIMESTAMP WITH LOCAL TIME ZONE","TIMESTAMP_LTZ","TIMESTAMP_NTZ","TIMESTAMP_TZ"].includes(e.toUpperCase())}var eZ=t(74240),eX=t(93056),eG=t(97346);function eY(e){let n=e>0&&e<=.001,t=e<1&&e>=.999,i=function(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e;return function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en-US",t=arguments.length>2?arguments[2]:void 0;return"number"!=typeof e?e:new Intl.NumberFormat(n,t).format(e)}(n,"en-US",{style:"percent",minimumFractionDigits:1})};if(n){let e=i(.001);return"<".concat(e)}if(t){let e=i(.999);return">".concat(e)}return i()}function e$(e){if("number"!=typeof e)return e;{let n=Math.abs(e),t=n>=.01,i=n>=1e6,r=n>=1e9,l=n>=1e15;if(l||n>=1e12)return new Intl.NumberFormat("en-US",{style:"unit",unit:"liter",unitDisplay:"narrow",maximumFractionDigits:l?0:2}).format(e/1e12).replace("L","T");if(r||i||n>=1e3){let n={base:r?1e9:i?1e6:1e3,unit:r?"B":i?"M":"K"};return new Intl.NumberFormat("en-US",{style:"unit",unit:"liter",unitDisplay:"narrow",maximumFractionDigits:1}).format(e/n.base).replace("L",n.unit)}return n>=1?new Intl.NumberFormat("en-US",{maximumFractionDigits:2}).format(e):new Intl.NumberFormat("en-US",{maximumFractionDigits:t?3:2,notation:t||0===n?"standard":"scientific"}).format(e)}}let e0="#63B3ED",e1="#F6AD55",e5="".concat(e0,"A5"),e2="".concat(e1,"A5");function e4(e){let{color:n}=e;return(0,i.jsx)(r.x,{display:"inline-block",w:"10px",h:"10px",bgColor:n,mr:"2",borderRadius:"sm"})}function e6(e){let{data:n,hideAxis:t=!1,animation:r=!1}=e;eX.kL.register(eX.ZL,eX.RM,eX.f$,eX.uw,eX.Dx,eX.De,eX.u);let l=function(e){let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],{...t}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{title:i,datasets:r,type:l,samples:s=0,binEdges:o}=e,[a,c]=r,d="datetime"===l;return{responsive:!0,maintainAspectRatio:!1,plugins:{legend:{reverse:!0},title:{display:!0,text:i,font:{size:20}},tooltip:{mode:"index",intersect:!1,callbacks:{title(e){let[{dataIndex:n,datasetIndex:t}]=e,i=e9(o,n);return"".concat(d?"Date Range":"string"===l?"Text Length":"Value Range","\n").concat(i)},label(e){let{datasetIndex:n,dataIndex:t,dataset:{label:i}}=e,r=0===n?c.counts:a.counts,l=eY(r[t]/s),o=r[t];return"".concat(i,": ").concat(o," (").concat(l,")")}}}},scales:function(e){let{datasets:n,min:t=0,max:i=0,type:r,binEdges:l}=e,s=arguments.length>1&&void 0!==arguments[1]&&arguments[1],[o,a]=n,c=Math.max(...a.counts,...o.counts),d=l.map((e,n)=>e9(l,n)).slice(0,-1);return{x:"datetime"===r?{display:!s,type:"timeseries",min:t,max:i,adapters:{date:{}},time:{minUnit:"day"},grid:{display:!1},ticks:{minRotation:30,maxRotation:30,maxTicksLimit:8}}:{display:!s,type:"category",grid:{display:!1},ticks:{callback:(e,n)=>d[n]},stacked:!0},y:{display:!s,type:"linear",max:c,border:{dash:[2,2]},grid:{color:"lightgray"},ticks:{maxTicksLimit:8,callback:function(e,n){return e$(e)}},beginAtZero:!0}}}(e,n),...t}}(n,t,{animation:r}),s=function(e){let{datasets:n,type:t,binEdges:i}=e,[r,l]=n,s=e3(t,i,"Current",e5,l),o=e3(t,i,"Base",e2,r);return{labels:i.map((e,n)=>e9(i,n)).slice(0,-1),datasets:[s,o]}}(n);return(0,i.jsx)(eG.kL,{type:"bar",options:l,data:s,plugins:[]})}function e3(e,n,t,i,r){let{counts:l=[]}=r;return{label:t,data:"datetime"===e?l.map((e,t)=>({x:n[t],y:e})):l,backgroundColor:i,borderColor:i,hoverBackgroundColor:i,borderWidth:0,categoryPercentage:1,barPercentage:1,xAxisID:"x"}}function e9(e,n){let t=e[n],i=e[n+1],r=e$(t),l=e$(i);return"".concat(r," - ").concat(l)}let e8=(0,eZ.G)((e,n)=>{let{backgroundColor:t="white",blockSize:l,children:s,...o}=e;return(0,i.jsx)(r.x,{ref:n,...o,overflowY:"auto",overflowX:"hidden",children:(0,i.jsx)(r.x,{backgroundColor:t,height:"100%",blockSize:l,children:s})})}),e7=(0,eZ.G)(function(e,n){var t,l,s,a,c,d;let{run:x}=e,m=x.params,p=null===(t=x.result)||void 0===t?void 0:t.base,f=null===(l=x.result)||void 0===l?void 0:l.current,g=null===(s=x.result)||void 0===s?void 0:s.min,j=null===(a=x.result)||void 0===a?void 0:a.max,v=null===(c=x.result)||void 0===c?void 0:c.bin_edges;return p&&f?(0,i.jsx)(o.k,{direction:"column",height:"100%",children:(0,i.jsx)(e8,{ref:n,height:"100%",children:(0,i.jsxs)(u.U,{children:[(0,i.jsx)(h.L,{}),(0,i.jsx)(r.x,{w:"80%",h:"35vh",m:"4",children:(0,i.jsx)(e6,{data:{title:"Model ".concat(m.model,".").concat(m.column_name),type:(null===(d=x.params)||void 0===d?void 0:d.column_type)||"",datasets:[p,f],min:g,max:j,samples:p.total,binEdges:v}})}),(0,i.jsx)(h.L,{})]})})}):(0,i.jsx)("div",{children:"Loading..."})});var ne=t(23131);t(22040);var nn=t(69495);let nt=(0,eZ.G)((e,n)=>{let{...t}=e;return(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(nn.ZP,{ref:n,...t})})});function ni(){return(0,i.jsx)(o.k,{h:"35px",alignItems:"center",justifyContent:"center",bg:"gray.100",style:{textAlign:"center",gridColumn:"1/-1"},children:(0,i.jsx)(eo.x,{fontWeight:"600",children:" No rows"})})}t(12874);var nr=t(96616);function nl(e,n){let t=function(e,n){let t=[...e],i=[...n],r=[];for(;t.length>0&&i.length>0;)if(r.includes(t[0]))t.shift();else if(r.includes(i[0]))i.shift();else if(t[0]===i[0])r.push(t[0]),t.shift(),i.shift();else if(i.includes(t[0])){let e=i.indexOf(t[0]);for(let n=0;n<e;n++)r.includes(i[n])||r.push(i[n]);r.push(t[0]),t.shift(),i.splice(0,e+1)}else r.push(t[0]),t.shift();return t.forEach(e=>{r.includes(e)||r.push(e)}),i.forEach(e=>{r.includes(e)||r.push(e)}),r}(e,n),i={};for(let r of t)e.includes(r)?n.includes(r)?i[r]=void 0:i[r]="removed":i[r]="added";let r={};e.forEach((e,n)=>{r[e]=n});let l=-1;for(let e of t){let n=r[e];void 0!==n&&(n>l?l=n:i[e]="reordered")}return i}function ns(e,n){let t=[];for(let i of n){let n=e.findIndex(e=>e.name===i);if(n<0)throw Error("Column ".concat(i," not found"));t.push(n)}return t}function no(e,n,t){let i={};if(0===n.length)return JSON.stringify({_index:t._index});for(let r of n)i[e[r].name]=t[r];return JSON.stringify(i)}function na(e){let{name:n,columnStatus:t,onPrimaryKeyChange:l,onPinnedColumnsChange:a,...c}=e,d=c.primaryKeys||[],u=c.pinnedColumns||[],h=d.includes(n),x=u.includes(n);return"index"===n?(0,i.jsx)(i.Fragment,{}):(0,i.jsxs)(o.k,{alignItems:"center",gap:"10px",className:"grid-header",children:[(0,i.jsx)(r.x,{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",children:n}),"added"!==t&&"removed"!==t&&l&&(0,i.jsx)(s.J,{className:h?"close-icon":"key-icon",display:h?"block":"none",cursor:"pointer",as:h?nr.ven:nr.MhP,onClick:h?()=>{let e=d.filter(e=>e!==n);l&&l(e)}:()=>{let e=[...d.filter(e=>"index"!==e),n];l&&l(e)}}),!h&&a&&(0,i.jsx)(s.J,{className:x?"unpin-icon":"pin-icon",display:x?"block":"none",cursor:"pointer",as:x?nr.$kI:nr.oJP,onClick:x?()=>{let e=u.filter(e=>e!==n);a&&a(e)}:()=>{let e=[...u,n];a&&a(e)}})]})}let nc=e=>{let n;let t=!1;return"boolean"==typeof e?n=e.toString():""===e?(n="(empty)",t=!0):null==e?(n="(null)",t=!0):n=e,[n,t]},nd=e=>{let{row:n,column:t}=e;if(!Object.hasOwn(n,t.key))return(0,i.jsx)(eo.x,{style:{color:"gray"},children:"-"});let[r,l]=nc(n[t.key]);return(0,i.jsx)(eo.x,{style:{color:l?"gray":"inherit"},children:r})};function nu(e,n,t){let r=e||{columns:[],data:[]},l=n||{columns:[],data:[]},s=(null==t?void 0:t.primaryKeys)||[],o=(null==t?void 0:t.pinnedColumns)||[],a=(null==t?void 0:t.changedOnly)||!1,c=[],d=function(e,n){let t={};return Object.entries(nl(e.columns.map(e=>e.name),n.columns.map(e=>e.name))).map(i=>{let[r,l]=i;t[r]={status:l,baseColumnIndex:e.columns.findIndex(e=>e.name===r),currentColumnIndex:n.columns.findIndex(e=>e.name===r)}}),t}(r,l),u={},h={},x=!1,m=!1;if(0===s.length)r.data.forEach((e,n)=>{e._index=n+1,u[JSON.stringify({_index:n+1})]=e}),l.data.forEach((e,n)=>{e._index=n+1,h[JSON.stringify({_index:n+1})]=e});else{let e=ns(r.columns,s);r.data.forEach((n,t)=>{let i=no(r.columns,e,n);i in u&&(x=!0),u[i]=n}),e=ns(l.columns,s),l.data.forEach((n,t)=>{let i=no(l.columns,e,n);i in h&&(m=!0),h[i]=n})}let p=nl(Object.keys(u),Object.keys(h)),f={added:0,removed:0,modified:0},g=Object.entries(p).map(e=>{let[n,t]=e,i=u[n],o=h[n],a=JSON.parse(n);if(i&&r.columns.forEach((e,n)=>{s.includes(e.name)||(a["base__".concat(e.name)]=i[n])}),o&&l.columns.forEach((e,n)=>{s.includes(e.name)||(a["current__".concat(e.name)]=o[n])}),i){if(o){for(let[e,n]of Object.entries(d))"index"===e||s.includes(e)||n.baseColumnIndex<0||n.currentColumnIndex<0||eW().isEqual(i[n.baseColumnIndex],o[n.currentColumnIndex])||(a.__status="modified",n.status="modified");"modified"===a.__status&&f.modified++}else a.__status="removed",f.removed++}else a.__status="added",f.added++;return a});a&&(g=g.filter(e=>"added"===e.__status||"removed"===e.__status||"modified"===e.__status));let j=(e,n)=>{let r="added"===n?"diff-header-added":"removed"===n?"diff-header-removed":void 0,l=t=>{let i=t.__status;if("removed"===i)return"diff-cell-removed";if("added"===i)return"diff-cell-added";if("added"===n);else if("removed"===n);else if(!eW().isEqual(t["base__".concat(e)],t["current__".concat(e)]))return"diff-cell-modified"};return{headerCellClass:r,name:(0,i.jsx)(na,{name:e,columnStatus:n,...t}),children:[{key:"base__".concat(e),name:(null==t?void 0:t.baseTitle)||"Base",renderEditCell:nn.Ug,headerCellClass:r,cellClass:l,renderCell:nd,size:"auto"},{key:"current__".concat(e),name:(null==t?void 0:t.currentTitle)||"Current",renderEditCell:nn.Ug,headerCellClass:r,cellClass:l,renderCell:nd,size:"auto"}]}};return 0===s.length?c.push({key:"_index",width:50,maxWidth:100,name:"",cellClass:"index-column"}):s.forEach(e=>{let n=d[e].status||"";c.push({key:e,name:(0,i.jsx)(na,{name:e,columnStatus:n,...t}),frozen:!0,cellClass:e=>{if(e.__status)return"diff-header-".concat(e.__status)},renderCell:nd})}),o.forEach(e=>{let n=d[e].status||"";"index"===e||s.includes(e)||c.push(j(e,n))}),Object.entries(d).forEach(e=>{let[n,t]=e,i=t.status||"";"index"===n||s.includes(n)||o.includes(n)||a&&f.modified>0&&"added"!==i&&"removed"!==i&&"modified"!==i||c.push(j(n,i))}),{columns:c,rows:g,invalidPKeyBase:x,invalidPKeyCurrent:m}}let nh=(0,eZ.G)((e,n)=>{var t;let{run:r,viewOptions:l,onViewOptionsChanged:s}=e,o=r.result;r.params;let a=(0,v.useMemo)(()=>(null==l?void 0:l.pinned_columns)||[],[l]),c=((null==o?void 0:null===(t=o.current)||void 0===t?void 0:t.columns)||[]).find(e=>"column_name"===e.name.toLowerCase()),d=(null==c?void 0:c.name)||"column_name",u=(0,v.useMemo)(()=>nu(null==o?void 0:o.base,null==o?void 0:o.current,{primaryKeys:[d],pinnedColumns:a,onPinnedColumnsChange:e=>{s&&s({...l,pinned_columns:e})}}),[o,d,a,l,s]);return 0===u.columns.length?(0,i.jsx)(ne.M,{height:"100%",children:"No data"}):(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(nt,{ref:n,style:{blockSize:"auto",maxHeight:"100%",overflow:"auto"},columns:u.columns,rows:u.rows,defaultColumnOptions:{resizable:!0,maxWidth:800,minWidth:35},className:"rdg-light",enableScreenshot:!0})})});function nx(e){let{name:n,columnStatus:t,onPrimaryKeyChange:l,onPinnedColumnsChange:a,...c}=e,d=c.primaryKeys||[],u=c.pinnedColumns||[],h=d.includes(n),x=u.includes(n);return"index"===n?(0,i.jsx)(i.Fragment,{}):(0,i.jsxs)(o.k,{alignItems:"center",gap:"10px",className:"grid-header",children:[(0,i.jsx)(r.x,{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",children:n}),!h&&a&&(0,i.jsx)(s.J,{className:x?"unpin-icon":"pin-icon",display:x?"block":"none",cursor:"pointer",as:x?nr.$kI:nr.oJP,onClick:x?()=>{let e=u.filter(e=>e!==n);a&&a(e)}:()=>{let e=[...u,n];a&&a(e)}})]})}function nm(e,n,t){let r=(null==t?void 0:t.pinnedColumns)||[],l=(null==t?void 0:t.changedOnly)||!1,s=[],o=function(e){let n={};return e.columns.map((e,t)=>{n[e.name]={index:t}}),n}(e),a={},c={};if(0===n.length)throw Error("Primary keys are required");let d=function(e,n){let t=[];for(let i of n){let n=e.findIndex(e=>e.name===i);if(n<0)throw Error("Column ".concat(i," not found"));t.push(n)}return t}(e.columns,n),u=(o.in_a||o.IN_A).index,h=(o.in_b||o.IN_B).index;e.data.forEach((n,t)=>{let i=function(e,n,t){let i={};if(0===n.length)return JSON.stringify({_index:t._index});for(let r of n)i[e[r].name]=t[r];return JSON.stringify(i)}(e.columns,d,n);n[u]&&(a[i]=n),n[h]&&(c[i]=n)});let x=nl(Object.keys(a),Object.keys(c)),m={added:0,removed:0,modified:0},p=Object.entries(x).map(t=>{let[i,r]=t,l=a[i],s=c[i],d=JSON.parse(i);if(l&&e.columns.forEach((e,t)=>{n.includes(e.name)||(d["base__".concat(e.name)]=l[t])}),s&&e.columns.forEach((e,t)=>{n.includes(e.name)||(d["current__".concat(e.name)]=s[t])}),l){if(s)for(let[e,t]of Object.entries(o))!("index"===e||n.includes(e))&&(eW().isEqual(l[t.index],s[t.index])||(d.__status="modified",t.status="modified"));else d.__status="removed",m.removed++}else d.__status="added",m.added++;return"modified"===d.__status&&m.modified++,d});l&&(p=p.filter(e=>"added"===e.__status||"removed"===e.__status||"modified"===e.__status));let f=(e,n)=>{let r="added"===n?"diff-header-added":"removed"===n?"diff-header-removed":void 0,l=t=>{let i=t.__status;if("removed"===i)return"diff-cell-removed";if("added"===i)return"diff-cell-added";if("added"===n);else if("removed"===n);else if(!eW().isEqual(t["base__".concat(e)],t["current__".concat(e)]))return"diff-cell-modified"};return{headerCellClass:r,name:(0,i.jsx)(nx,{name:e,columnStatus:n,...t}),children:[{key:"base__".concat(e),name:(null==t?void 0:t.baseTitle)||"Base",renderEditCell:nn.Ug,headerCellClass:r,cellClass:l,renderCell:nd,size:"auto"},{key:"current__".concat(e),name:(null==t?void 0:t.currentTitle)||"Current",renderEditCell:nn.Ug,headerCellClass:r,cellClass:l,renderCell:nd,size:"auto"}]}};return n.forEach(e=>{let n=o[e].status||"";s.push({key:e,name:(0,i.jsx)(nx,{name:e,columnStatus:n,...t}),frozen:!0,cellClass:e=>{if(e.__status)return"diff-header-".concat(e.__status)},renderCell:nd})}),r.forEach(e=>{let t=o[e].status||"";n.includes(e)||s.push(f(e,t))}),Object.entries(o).forEach(e=>{let[t,i]=e,o=i.status||"";"in_a"===t||"in_b"===t||n.includes(t)||r.includes(t)||l&&m.modified>0&&"added"!==o&&"removed"!==o&&"modified"!==o||s.push(f(t,o))}),{columns:s,rows:p}}var np=t(94139),nf=t(76569),ng=t(62454);let nj=e=>{let{run:n,warnings:t,viewOptions:l,onAddToChecklist:s,onViewOptionsChanged:a}=e;return(0,i.jsxs)(o.k,{borderBottom:"1px solid lightgray",justifyContent:"flex-end",gap:"5px",alignItems:"center",px:"10px",bg:t&&t.length>0?"orange.100":"inherit",children:[(0,i.jsx)(nf.g,{alignItems:"flex-start",spacing:0,children:null==t?void 0:t.map((e,n)=>(0,i.jsxs)(r.x,{children:[(0,i.jsx)(np.a,{color:"orange.600"})," ",e]},n))}),(0,i.jsx)(h.L,{minHeight:"32px"}),(0,i.jsx)(ng.X,{isChecked:null==l?void 0:l.changed_only,onChange:()=>{let e=!(null==l?void 0:l.changed_only);a&&a({...l,changed_only:e})},children:"Changed only"}),s&&(0,i.jsx)(ec.z,{marginBlock:"5px",size:"sm",colorScheme:"blue",onClick:()=>{s(n)},children:"Add to Checklist"})]})},nv=(e,n)=>{var t,r,l,s,a,c;let{run:d,onAddToChecklist:u,viewOptions:h,onViewOptionsChanged:x,baseTitle:m,currentTitle:p}=e,f=(0,v.useMemo)(()=>(null==h?void 0:h.primary_keys)||[],[h]),g=(0,v.useMemo)(()=>(null==h?void 0:h.changed_only)||!1,[h]),j=(0,v.useMemo)(()=>(null==h?void 0:h.pinned_columns)||[],[h]),y=(0,v.useMemo)(()=>{var e,n;return nu(null===(e=d.result)||void 0===e?void 0:e.base,null===(n=d.result)||void 0===n?void 0:n.current,{changedOnly:g,primaryKeys:f,onPrimaryKeyChange:e=>{x&&x({...h,primary_keys:e})},pinnedColumns:j,onPinnedColumnsChange:e=>{x&&x({...h,pinned_columns:e})},baseTitle:m,currentTitle:p})},[d,h,g,f,j,x,m,p]),b=(0,v.useMemo)(()=>{let e=f.join(", ");return y.invalidPKeyBase&&y.invalidPKeyCurrent?"Warning: The primary key '".concat(e,"' is not unique in the base and current environments"):y.invalidPKeyBase?"Warning: The primary key '".concat(e,"' is not unique in the base environment"):y.invalidPKeyCurrent?"Warning: The primary key '".concat(e,"' is not unique in the current environment"):void 0},[y.invalidPKeyBase,y.invalidPKeyCurrent,f]),w=(null===(r=d.result)||void 0===r?void 0:null===(t=r.current)||void 0===t?void 0:t.limit)||0,k=w>0&&((null===(s=d.result)||void 0===s?void 0:null===(l=s.current)||void 0===l?void 0:l.more)||(null===(c=d.result)||void 0===c?void 0:null===(a=c.base)||void 0===a?void 0:a.more))?"Warning: Displayed results are limited to ".concat(w.toLocaleString()," records. To ensure complete data retrieval, consider applying a LIMIT or WHERE clause to constrain the result set."):null,C=[];return(b&&C.push(b),k&&C.push(k),0===y.columns.length)?(0,i.jsx)(ne.M,{height:"100%",children:"No data"}):g&&0===y.rows.length?(0,i.jsxs)(o.k,{direction:"column",backgroundColor:"rgb(249, 249, 249)",height:"100%",children:[(0,i.jsx)(nj,{run:d,viewOptions:h,onAddToChecklist:u,onViewOptionsChanged:x,warnings:C}),(0,i.jsx)(ne.M,{height:"100%",children:"No change"}),";"]}):(0,i.jsxs)(o.k,{direction:"column",backgroundColor:"rgb(249, 249, 249)",height:"100%",children:[(0,i.jsx)(nj,{run:d,viewOptions:h,onAddToChecklist:u,onViewOptionsChanged:x,warnings:C}),(0,i.jsx)(nt,{ref:n,style:{blockSize:"auto",maxHeight:"100%",overflow:"auto"},columns:y.columns,rows:y.rows,renderers:{noRowsFallback:(0,i.jsx)(ni,{})},defaultColumnOptions:{resizable:!0,maxWidth:800,minWidth:35},className:"rdg-light",enableScreenshot:!0})]})},ny=(e,n)=>{var t,r,l,s;let{run:a,onAddToChecklist:c,viewOptions:d,onViewOptionsChanged:u,baseTitle:h,currentTitle:x}=e,m=(0,v.useMemo)(()=>(null==d?void 0:d.changed_only)||!1,[d]),p=(0,v.useMemo)(()=>(null==d?void 0:d.pinned_columns)||[],[d]),f=(0,v.useMemo)(()=>{var e,n;if(!(null===(e=a.result)||void 0===e?void 0:e.diff)||!(null===(n=a.params)||void 0===n?void 0:n.primary_keys))return{columns:[],rows:[]};let t=a.params.primary_keys;return nm(a.result.diff,t,{changedOnly:m,pinnedColumns:p,onPinnedColumnsChange:e=>{u&&u({...d,pinned_columns:e})},baseTitle:h,currentTitle:x})},[a,d,m,p,u,h,x]),g=(null===(r=a.result)||void 0===r?void 0:null===(t=r.diff)||void 0===t?void 0:t.limit)||0,j=g>0&&(null===(s=a.result)||void 0===s?void 0:null===(l=s.diff)||void 0===l?void 0:l.more)?"Warning: Displayed results are limited to ".concat(g.toLocaleString()," records. To ensure complete data retrieval, consider applying a LIMIT or WHERE clause to constrain the result set."):null,y=[];return(j&&y.push(j),0===f.columns.length)?(0,i.jsx)(ne.M,{height:"100%",children:"No data"}):m&&0===f.rows.length?(0,i.jsxs)(o.k,{direction:"column",backgroundColor:"rgb(249, 249, 249)",height:"100%",children:[(0,i.jsx)(nj,{run:a,viewOptions:d,onAddToChecklist:c,onViewOptionsChanged:u,warnings:y}),(0,i.jsx)(ne.M,{height:"100%",children:"No change"})]}):(0,i.jsxs)(o.k,{direction:"column",backgroundColor:"rgb(249, 249, 249)",height:"100%",children:[(0,i.jsx)(nj,{run:a,viewOptions:d,onAddToChecklist:c,onViewOptionsChanged:u,warnings:y}),(0,i.jsx)(nt,{ref:n,style:{blockSize:"auto",maxHeight:"100%",overflow:"auto"},columns:f.columns,rows:f.rows,renderers:{noRowsFallback:(0,i.jsx)(ni,{})},defaultColumnOptions:{resizable:!0,maxWidth:800,minWidth:35},className:"rdg-light",enableScreenshot:!0})]})},nb=(0,eZ.G)((e,n)=>{let t,r;if(e.run.params&&e.run.params.current_model&&(t="Original",r="Editor"),void 0!==e.run.result&&null!==e.run.result.diff&&void 0!==e.run.result.diff){let l=(0,eZ.G)(ny);return(0,i.jsx)(l,{...e,ref:n,baseTitle:t,currentTitle:r})}{let l=(0,eZ.G)(nv);return(0,i.jsx)(l,{...e,ref:n,baseTitle:t,currentTitle:r})}});function nw(e){let{name:n,pinnedColumns:t=[],onPinnedColumnsChange:l=()=>{}}=e,a=t.includes(n);return(0,i.jsxs)(o.k,{className:"grid-header",alignItems:"center",children:[(0,i.jsx)(r.x,{flex:1,children:n}),(0,i.jsx)(s.J,{className:a?"unpin-icon":"pin-icon",display:a?"block":"none",cursor:"pointer",as:a?nr.$kI:nr.oJP,onClick:a?()=>{l(t.filter(e=>e!==n))}:()=>{l([...t,n])}})]})}let nk=(0,eZ.G)((e,n)=>{let{run:t,viewOptions:l,onViewOptionsChanged:s,onAddToChecklist:a}=e,c=(0,v.useMemo)(()=>(null==l?void 0:l.pinned_columns)||[],[l]),d=t.result,u=(0,v.useMemo)(()=>d?function(e,n){let t=[],r=n.pinnedColumns||[],l=(e,t)=>({key:String(e),name:(0,i.jsx)(nw,{name:t,...n}),width:"auto",renderCell:nd});return t.push({key:"_index",name:"",width:50,cellClass:"index-column"}),r.forEach(n=>{let i=eW().findIndex(e.columns,e=>e.name===n);i<0||t.push(l(i,n))}),e.columns.forEach((e,n)=>{r.includes(e.name)||t.push(l(n,e.name))}),e.data.forEach((e,n)=>{e._index=n+1}),{columns:t,rows:e.data}}(d,{pinnedColumns:c,onPinnedColumnsChange:e=>{s&&s({...l,pinned_columns:e})}}):{rows:[],columns:[]},[d,c,l,s]);if(0===u.columns.length)return(0,i.jsx)(ne.M,{height:"100%",children:"No data"});let x=d.limit||0,m=x>0&&d.more?"Warning: Displayed results are limited to ".concat(x.toLocaleString()," records. To ensure complete data retrieval, consider applying a LIMIT or WHERE clause to constrain the result set."):null,p=a||m;return(0,i.jsxs)(o.k,{direction:"column",backgroundColor:"rgb(249, 249, 249)",height:"100%",children:[p&&(0,i.jsxs)(o.k,{borderBottom:"1px solid lightgray",alignItems:"center",gap:"5px",px:"10px",bg:m?"orange.100":"inherit",children:[m&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(np.a,{color:"orange.600",alignSelf:"center"})," ",(0,i.jsx)(r.x,{children:m})]}),(0,i.jsx)(h.L,{minHeight:"32px"}),a&&(0,i.jsx)(ec.z,{marginBlock:"5px",size:"sm",colorScheme:"blue",onClick:()=>{a(t)},children:"Add to Checklist"})]}),(0,i.jsx)(nt,{ref:n,style:{blockSize:"auto",maxHeight:"100%",overflow:"auto"},columns:u.columns,rows:u.rows,renderers:{noRowsFallback:(0,i.jsx)(ni,{})},defaultColumnOptions:{resizable:!0,maxWidth:800,minWidth:35},className:"rdg-light",enableScreenshot:!0})]})});function nC(e,n){if(e<n){let t=(n-e)/e*100;return"+".concat(t>=.1?t.toFixed(1):" <0.1 ","%")}if(!(e>n))return"0 %";{let t=(e-n)/e*100;return"-".concat(t>=.1?t.toFixed(1):" <0.1 ","%")}}var n_=t(1284),nS=t.n(n_);let nz=(0,eZ.G)(function(e,n){let{run:t}=e;function r(e){if(e.base===e.current);else if(e.base<e.current||"N/A"===e.base)return"column-body-added";else if(e.base>e.current||"N/A"===e.current)return"column-body-removed";return"column-body-normal"}let l=t.result||{},s=Object.keys(t.result||{}).map(e=>{let n=l[e],t=nS()(n.base)?n.base:null,i=nS()(n.curr)?n.curr:null,r="=";return null!==t&&null!==i?r=t!==i?nC(t,i):"=":t===i?r="N/A":null===t?r="Added":null===i&&(r="Removed"),{name:e,base:null===t?"N/A":Number(t),current:null===i?"N/A":Number(i),delta:r}});return 0===s.length?(0,i.jsx)(ne.M,{bg:"rgb(249,249,249)",height:"100%",children:"No nodes matched"}):(0,i.jsx)(o.k,{direction:"column",children:Object.keys(l).length>0&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(nt,{ref:n,style:{blockSize:"auto",maxHeight:"100%",overflow:"auto",fontSize:"10pt",borderWidth:1},columns:[{key:"name",name:"Name",cellClass:r},{key:"base",name:"Base Rows",cellClass:r},{key:"current",name:"Current Rows",cellClass:r},{key:"delta",name:"Delta",cellClass:r}],rows:s,renderers:{noRowsFallback:(0,i.jsx)(ni,{})},className:"rdg-light",enableScreenshot:!0})})})}),nR=(0,eZ.G)(function(e,n){let{run:t}=e,r=t.result||{},l=Object.keys(t.result||{}).map(e=>{let n=r[e],t=nS()(n.curr)?n.curr:null;return{name:e,current:null===t?"N/A":Number(t)}});return 0===l.length?(0,i.jsx)(ne.M,{bg:"rgb(249,249,249)",height:"100%",children:"No nodes matched"}):(0,i.jsx)(o.k,{direction:"column",children:Object.keys(r).length>0&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(nt,{ref:n,style:{blockSize:"auto",maxHeight:"100%",overflow:"auto",fontSize:"10pt",borderWidth:1},columns:[{key:"name",name:"Name"},{key:"current",name:"Row Count"}],rows:l,renderers:{noRowsFallback:(0,i.jsx)(ni,{})},className:"rdg-light",enableScreenshot:!0})})})});var nT=t(13651),nL=t(96590);let nI="#63B3ED";function nE(e,n){let t=n?10:e.counts.length,i=e.counts.slice(0,t),r=e.valids-i.reduce((e,n)=>e+n,0);return e.values.slice(0,t).concat([r]).map((n,t)=>{let l;let s=t===i.length,o=s?r:i[t],a=!1;return s?(l="(others)",a=!0):null==n?(l="(null)",a=!0):"string"==typeof n&&0===n.length?(l="(empty)",a=!0):l=String(n),{isLastItemOthers:s,isSpecialLabel:a,label:l,count:o,displayCount:e$(o),displayRatio:eY(o/e.valids)||"N/A"}})}function nD(e){let{base:n,current:t,children:l}=e;return(0,i.jsx)(nT.u,{label:(0,i.jsxs)(r.x,{children:[(0,i.jsxs)(eo.x,{children:[(0,i.jsx)(e4,{color:e0}),"Current: ",t.count," (",t.displayRatio,")"]}),(0,i.jsxs)(eo.x,{children:[(0,i.jsx)(e4,{color:e1}),"Base: ",n.count," (",n.displayRatio,")"]})]}),placement:"auto",hasArrow:!0,children:l})}function nO(e){let{topKDiff:n,isDisplayTopTen:t}=e,l=nE(n.current,t),s=nE(n.base,t);return(0,i.jsxs)(r.x,{w:"100%",px:20,py:4,children:[(0,i.jsxs)(o.k,{alignItems:"center",direction:"row",children:[(0,i.jsx)(h.L,{}),(0,i.jsxs)(eo.x,{as:"h3",size:"sm",p:"2",color:"gray",children:[(0,i.jsx)(e4,{color:e1})," Base"]}),(0,i.jsxs)(eo.x,{as:"h3",size:"sm",p:"2",color:"gray",children:[(0,i.jsx)(e4,{color:e0})," Current"]}),(0,i.jsx)(h.L,{})]}),l.map((e,t)=>{let r=s[t];return e.isLastItemOthers&&0===e.count&&0===r.count?(0,i.jsx)(i.Fragment,{}):(0,i.jsxs)(v.Fragment,{children:[(0,i.jsx)(nD,{base:r,current:e,children:(0,i.jsxs)(o.k,{alignItems:"center",width:"100%",_hover:{bg:"blackAlpha.300"},px:4,children:[(0,i.jsx)(eo.x,{noOfLines:1,width:"10em",fontSize:"sm",color:e.isSpecialLabel?"gray.400":"inherit",children:e.label}),(0,i.jsxs)(o.k,{width:"70%",direction:"column",children:[(0,i.jsxs)(o.k,{height:"1em",children:[(0,i.jsx)(nA,{topkCount:e.count,topkLabel:e.label,valids:n.current.valids,color:e0}),(0,i.jsx)(eo.x,{ml:5,mr:2,fontSize:"sm",width:"6em",children:e.displayCount}),(0,i.jsx)(eo.x,{color:"gray.400",fontSize:"sm",width:"4em",children:e.displayRatio})]}),(0,i.jsxs)(o.k,{height:"1em",children:[(0,i.jsx)(nA,{topkCount:r.count,topkLabel:r.label,valids:n.base.valids,color:e1}),(0,i.jsx)(eo.x,{ml:5,mr:2,fontSize:"sm",width:"6em",children:r.displayCount}),(0,i.jsx)(eo.x,{color:"gray.400",fontSize:"sm",width:"4em",children:r.displayRatio})]})]})]})}),(0,i.jsx)(nL.i,{})]},t)})]})}function nA(e){let{topkCount:n,topkLabel:t,valids:r,animation:l=!1,color:s=nI}=e;eX.kL.register(eX.uw,eX.ZL,eX.f$);let o=function(e,n){let{...t}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return{responsive:!0,maintainAspectRatio:!1,indexAxis:"y",scales:{x:{display:!1,max:n,grid:{display:!1}},y:{display:!1}},plugins:{tooltip:{enabled:!1}},...t}}(n,r,{animation:l}),a=function(e){let{topkLabel:n,topkCount:t,color:i=nI}=e;return{labels:[n],datasets:[{indexAxis:"y",data:[t],backgroundColor:i,hoverBackgroundColor:i,borderWidth:0,borderColor:i,barPercentage:1,categoryPercentage:.6}]}}({topkCount:n,topkLabel:t,color:s});return(0,i.jsx)(eG.$Q,{data:a,options:o,plugins:[]})}let nM=(0,eZ.G)((e,n)=>{let{run:t}=e,[r,s]=(0,v.useState)(!0),a=t.result,d=t.params,x=a.base,m=a.current;return(0,i.jsxs)(o.k,{direction:"column",height:"100%",children:[(0,i.jsxs)(e8,{ref:n,blockSize:"auto",children:[(0,i.jsxs)(c.X,{as:"h1",size:"md",paddingTop:4,textAlign:"center",color:"gray.600",children:["Model ",d.model,".",d.column_name]}),(0,i.jsxs)(u.U,{children:[(0,i.jsx)(h.L,{}),(0,i.jsx)(nO,{topKDiff:a,valids:m.valids||0,isDisplayTopTen:r}),(0,i.jsx)(h.L,{})]})]}),(0,i.jsx)(h.L,{}),(x.values.length>10||m.values.length>10)&&(0,i.jsx)(o.k,{p:5,justify:"start",children:(0,i.jsx)(l.r,{onClick:()=>{s(e=>!e)},textColor:"blue.500",children:r?"View More Items":"View Only Top-10"})})]})}),nF=(0,eZ.G)((e,n)=>{var t,r;let{run:l,onAddToChecklist:s,viewOptions:a,onViewOptionsChanged:c}=e,d=(0,v.useMemo)(()=>(null==a?void 0:a.changed_only)||!1,[a]),u=(0,v.useMemo)(()=>(null==a?void 0:a.pinned_columns)||[],[a]),h=(0,v.useMemo)(()=>{var e;if(!l.result||!(null===(e=l.params)||void 0===e?void 0:e.primary_key))return{columns:[],rows:[]};let n=l.params.primary_key,t=Array.isArray(n)?n:[n];return nm(l.result,t,{changedOnly:d,pinnedColumns:u,onPinnedColumnsChange:e=>{c&&c({...a,pinned_columns:e})}})},[l,a,d,u,c]),x=(null===(t=l.result)||void 0===t?void 0:t.limit)||0,m=x>0&&(null===(r=l.result)||void 0===r?void 0:r.more)?"Warning: Displayed results are limited to ".concat(x.toLocaleString()," records. To ensure complete data retrieval, consider applying a LIMIT or WHERE clause to constrain the result set."):null,p=[];return(m&&p.push(m),0===h.columns.length)?(0,i.jsx)(ne.M,{height:"100%",children:"No data"}):d&&0===h.rows.length?(0,i.jsxs)(o.k,{direction:"column",backgroundColor:"rgb(249, 249, 249)",height:"100%",children:[(0,i.jsx)(nj,{run:l,viewOptions:a,onAddToChecklist:s,onViewOptionsChanged:c,warnings:p}),(0,i.jsx)(ne.M,{height:"100%",children:"No change"}),";"]}):(0,i.jsxs)(o.k,{direction:"column",backgroundColor:"rgb(249, 249, 249)",height:"100%",children:[(0,i.jsx)(nj,{run:l,viewOptions:a,onAddToChecklist:s,onViewOptionsChanged:c,warnings:p}),(0,i.jsx)(nt,{ref:n,style:{blockSize:"auto",maxHeight:"100%",overflow:"auto"},columns:h.columns,rows:h.rows,renderers:{noRowsFallback:(0,i.jsx)(ni,{})},defaultColumnOptions:{resizable:!0,maxWidth:800,minWidth:35},className:"rdg-light",enableScreenshot:!0})]})});var nN=t(70080),nq=t(41866);function nH(e){let{params:n,onParamsChanged:t,setIsReadyToExecute:l}=e,[s,o]=(0,v.useState)(!n.columns||0===n.columns.length),a=n.model,c=n.primary_key,{columns:d,primaryKey:u,isLoading:h,error:x}=eB(n.model);(0,v.useEffect)(()=>{!c&&u&&t({...n,primary_key:u})},[c,u,n,t]),(0,v.useEffect)(()=>{l(!!c&&!!a)},[c,a,l]);let m=d.map(e=>e.name),p=Array.isArray(c)?c:c?[c]:void 0;return h?(0,i.jsx)(r.x,{children:"Loading..."}):0===m.length||x?(0,i.jsx)(r.x,{children:"Error: Please provide the 'catalog.json' to list column candidates"}):(0,i.jsxs)(nf.g,{gap:5,m:"8px 24px",paddingBottom:"200px",children:[(0,i.jsxs)(eq.NI,{children:[(0,i.jsx)(eH.l,{children:"Model"}),(0,i.jsx)(nN.I,{isReadOnly:!0,value:n.model})]}),(0,i.jsxs)(eq.NI,{children:[(0,i.jsx)(eH.l,{children:"Primary key"}),(0,i.jsx)(nq.Ph,{placeholder:"Select primary key",isMulti:!0,closeMenuOnSelect:!1,options:(m||[]).map(e=>({label:e,value:e})),value:(p||[]).map(e=>({label:e,value:e})),onChange:e=>{t({...n,primary_key:1==e.length?e[0].value:e.map(e=>e.value)})}})]}),(0,i.jsxs)(eq.NI,{children:[(0,i.jsx)(eH.l,{children:"Columns"}),(0,i.jsx)(ng.X,{marginBottom:"10px",isChecked:s,onChange:e=>{o(e.target.checked),t({...n,columns:void 0})},children:"All columns"}),!s&&(0,i.jsx)(nq.Ph,{isMulti:!0,closeMenuOnSelect:!1,options:(m||[]).map(e=>({label:e,value:e})),value:(n.columns||[]).map(e=>({label:e,value:e})),onChange:e=>{t({...n,columns:(e||[]).map(e=>e.value)})}})]})]})}var nV=t(41452),nP=t(62955),nW=t(50981),nK=t(41944),nB=t(90218),nJ=t(15825),nU=t(87412);function nQ(e){let{params:n,column:t}=e,{runAction:l}=n2(),a=(e,t)=>{l("value_diff_detail",{...n,...e},t)};return(0,i.jsxs)(o.k,{children:[(0,i.jsx)(r.x,{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",children:t}),(0,i.jsx)(h.L,{}),(0,i.jsx)(nV.v,{isLazy:!0,children:e=>{let{isOpen:n}=e;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(nP.j,{className:"row-context-menu",visibility:n?"visible":"hidden",width:n?"auto":"0px",minWidth:n?"auto":"0px",as:nW.h,icon:(0,i.jsx)(s.J,{as:nr.D_A}),variant:"unstyled",size:"sm"}),(0,i.jsx)(nK.h,{children:(0,i.jsx)(nB.q,{lineHeight:"20px",children:(0,i.jsxs)(nJ.k,{title:"Action",as:r.x,fontSize:"8pt",children:[(0,i.jsx)(nU.s,{fontSize:"10pt",onClick:()=>{a({},{showForm:!0})},children:"Show mismatched values..."}),(0,i.jsxs)(nU.s,{fontSize:"10pt",onClick:()=>{a({columns:[t]},{showForm:!1})},children:["Show mismatched values for '",t,"'"]})]})})})]})}})]})}let nZ=(0,eZ.G)(function(e,n){let{run:t}=e,l=t.result,a=t.params,c=e=>{let n=e[2];return null!=n&&n<1?"diff-cell-modified":""},d=Array.isArray(a.primary_key)?a.primary_key:[a.primary_key],u=[{key:"__is_pk__",name:"",width:30,maxWidth:30,renderCell:e=>{let{row:n}=e;return(0,i.jsx)(ne.M,{height:"100%",children:d.includes(n[0])&&(0,i.jsx)(s.J,{as:nr.MhP})})}},{key:"0",name:"Column",resizable:!0,renderCell:e=>{let{row:n,column:t}=e;return(0,i.jsx)(nQ,{column:n[t.key],params:a})},cellClass:"cell-show-context-menu"},{key:"1",name:"Matched",resizable:!0,cellClass:c},{key:"2",name:"Matched %",resizable:!0,renderCell:e=>{let{column:n,row:t}=e,l=t[n.key];return(0,i.jsx)(r.x,{textAlign:"end",children:void 0!=l&&null!==l?"".concat((100*l).toFixed(2)," %"):"N/A"})},cellClass:c}];return(0,i.jsxs)(o.k,{direction:"column",gap:"5px",pt:"5px",height:"100%",children:[(0,i.jsxs)(r.x,{px:"16px",children:["Model: ",a.model,", ",l.summary.total," total (",l.summary.total-l.summary.added-l.summary.removed," common,"," ",l.summary.added," added, ",l.summary.removed," removed)"]}),(0,i.jsx)(nt,{ref:n,style:{blockSize:"auto",maxHeight:"100%",overflow:"auto",borderBlock:"1px solid lightgray"},columns:u,rows:l.data.data,renderers:{noRowsFallback:(0,i.jsx)(ni,{})},defaultColumnOptions:{resizable:!0},className:"rdg-light",enableScreenshot:!0})]})});var nX=t(69047),nG=t(23394);let nY={lineage_diff:{title:"Lineage Diff",icon:eN.Ks7},schema_diff:{title:"Schema Diff",icon:nG.C8A},query:{title:"Query",icon:eN.r2i,RunResultView:nk},query_base:{title:"Query Base",icon:eN.r2i,RunResultView:nk},query_diff:{title:"Query Diff",icon:eN.r2i,RunResultView:nb},row_count:{title:"Row Count",icon:nG.QUK,RunResultView:nR},row_count_diff:{title:"Row Count Diff",icon:nG.QUK,RunResultView:nz},profile_diff:{title:"Profile Diff",icon:eN.KA6,RunResultView:nh,RunForm:function(e){var n;let{params:t,onParamsChanged:l,setIsReadyToExecute:s}=e,[o,a]=(0,v.useState)(!t.columns||0===t.columns.length),c=t.model,{columns:d,isLoading:u,error:h}=eB(t.model);(0,v.useEffect)(()=>{s(!!c)},[c,s]);let x=d.map(e=>e.name);return u?(0,i.jsx)(r.x,{children:"Loading..."}):0===x.length||h?(0,i.jsx)(r.x,{children:"Error: Please provide the 'catalog.json' to list column candidates"}):(0,i.jsxs)(nf.g,{gap:5,m:"8px 24px",paddingBottom:"200px",children:[(0,i.jsxs)(eq.NI,{children:[(0,i.jsx)(eH.l,{children:"Model"}),(0,i.jsx)(nN.I,{isReadOnly:!0,value:t.model})]}),(0,i.jsxs)(eq.NI,{children:[(0,i.jsx)(eH.l,{children:"Columns"}),(0,i.jsx)(ng.X,{marginBottom:"10px",isChecked:o,onChange:e=>{a(e.target.checked),l({...t,columns:void 0})},children:"All columns"}),!o&&(0,i.jsx)(nq.Ph,{isMulti:!0,closeMenuOnSelect:!1,options:(x||[]).map(e=>({label:e,value:e})),value:(null!==(n=t.columns)&&void 0!==n?n:[]).map(e=>({label:e,value:e})),onChange:e=>{l({...t,columns:(e||[]).map(e=>e.value)})}})]})]})}},value_diff:{title:"Value Diff",icon:eN.pRi,RunResultView:nZ,RunForm:nH},value_diff_detail:{title:"Value Diff Detail",icon:eN.pRi,RunResultView:nF,RunForm:nH},top_k_diff:{title:"Top-K Diff",icon:nX.Pkc,RunResultView:nM,RunForm:function(e){let{params:n,onParamsChanged:t,setIsReadyToExecute:l}=e,{columns:s,isLoading:o,error:a}=eB(n.model),c=s.map(e=>e.name);return((0,v.useEffect)(()=>{l(!!n.column_name)},[n,l]),o)?(0,i.jsx)(r.x,{children:"Loading..."}):0===c.length||a?(0,i.jsx)(r.x,{children:"Error: Please provide the 'catalog.json' to list column candidates"}):(0,i.jsx)(r.x,{m:"16px",children:(0,i.jsxs)(eq.NI,{children:[(0,i.jsx)(eH.l,{children:"Pick a column to show top-k"}),(0,i.jsx)(eV.P,{placeholder:"Select column",value:n.column_name,onChange:e=>{let i=e.target.value;t({...n,column_name:i})},children:c.map(e=>(0,i.jsx)("option",{value:e,children:e},e))})]})})}},histogram_diff:{title:"Histogram Diff",icon:eN.dku,RunResultView:e7,RunForm:function(e){let{params:n,onParamsChanged:t,setIsReadyToExecute:l}=e,{columns:s,isLoading:o,error:a}=eB(n.model),c=s.filter(e=>!eJ(e.type)&&!eU(e.type)&&!eQ(e.type));return o?(0,i.jsx)(r.x,{children:"Loading..."}):0===s.length||a?(0,i.jsx)(r.x,{children:"Error: Please provide the 'catalog.json' to list column candidates"}):(0,i.jsx)(r.x,{m:"16px",children:(0,i.jsxs)(eq.NI,{children:[(0,i.jsx)(eH.l,{children:"Pick a column to show Histogram Diff"}),(0,i.jsx)(eV.P,{placeholder:0!==c.length?"Select column":"No numeric column is available",isDisabled:0===c.length,value:n.column_name,onChange:e=>{var i;let r=e.target.value;l(!!r);let s=(null===(i=c.find(e=>e.name===r))||void 0===i?void 0:i.type)||"";t({...n,column_name:r,column_type:s})},children:c.map(e=>(0,i.jsxs)("option",{value:e.name,children:[e.name," : ",e.type]},e.name))})]})})}},sandbox:{title:"Sandbox",icon:eN.iQd}},n$=e=>nY[e],n0=(0,v.createContext)({runAction:()=>{},showRunId:e=>{},isRunResultOpen:!1,closeRunResult:()=>{},isHistoryOpen:!1,closeHistory:()=>{},showHistory:()=>{},clearRunResult:()=>{}}),n1=e=>{let[n]=(0,eF.TH)();(0,v.useEffect)(()=>{e()},[e,n])};function n5(e){var n;let{children:t}=e,[r,l]=(0,v.useState)(),{isOpen:s,onOpen:o,onClose:a}=(0,en.q)(),{isOpen:c,onOpen:d,onClose:u}=(0,en.q)(),{isOpen:h,onOpen:x,onClose:m}=(0,en.q)(),p=(0,ee.p)(),[f,g]=(0,v.useState)(),[j,y]=(0,eF.TH)(),w=(0,b.NL)(),k=(0,v.useCallback)((e,n)=>{g(e),d(),!1!==n&&w.invalidateQueries({queryKey:B.runs()})},[g,d,w]),C=(0,v.useCallback)(()=>{g(void 0),u()},[u,g]),_=(0,v.useCallback)(async(e,n,t)=>{try{let i;let r=new Date().getTime().toString();if(null==t?void 0:t.showLast){let t=await eC(e,n,1);1===t.length&&(i=t[0])}let s=n$(e);if(void 0===s)throw Error("Unknown run type: ".concat(e));let{title:a,RunResultView:c,RunForm:d}=s;if(void 0===c)throw Error("Run type ".concat(e," does not have a result view"));if(void 0!==d&&(null==t?void 0:t.showForm))l({session:r,title:a,type:e,params:n,lastRun:i,options:t,RunForm:d}),o();else{let{run_id:t}=await ey(e,n,{nowait:!0});k(t),w.invalidateQueries({queryKey:B.runs()}),j.startsWith("/lineage")&&y("/lineage")}}catch(e){p({title:"Failed to submit a run",description:null==e?void 0:e.message,position:"bottom-right",status:"error",duration:5e3,isClosable:!0})}},[l,o,k,p,j,y,w]);n1(a);let S=async(e,n)=>{try{a();let{run_id:t}=await ey(e,n,{nowait:!0});k(t)}catch(e){p({title:"Failed to submit a run",description:null==e?void 0:e.message,position:"bottom-right",status:"error",duration:5e3,isClosable:!0})}};return(0,i.jsxs)(n0.Provider,{value:{runAction:_,runId:f,showRunId:k,isRunResultOpen:c,closeRunResult:u,isHistoryOpen:h,closeHistory:m,showHistory:x,clearRunResult:C},children:[r&&(0,i.jsx)(eM,{isOpen:s,onClose:a,onExecute:S,title:r.title,type:r.type,params:r.params,initialRun:r.lastRun,RunForm:(null===(n=r.options)||void 0===n?void 0:n.showForm)&&r.RunForm?r.RunForm:void 0},r.session),t]})}let n2=()=>(0,v.useContext)(n0),n4=(0,v.createContext)({latestSelectedCheckId:"",setLatestSelectedCheckId:()=>{}});function n6(e){let{children:n}=e,[t,r]=v.useState("");return(0,i.jsx)(n4.Provider,{value:{setLatestSelectedCheckId:r,latestSelectedCheckId:t},children:n})}let n3=()=>(0,v.useContext)(n4);function n9(e){let{children:n}=e;return(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(C,{children:(0,i.jsx)(eE,{children:(0,i.jsx)(z,{children:(0,i.jsx)(n5,{children:(0,i.jsx)(n6,{children:n})})})})})})}async function n8(){return(await X.post("/api/checks",{type:"simple"})).data}async function n7(e,n){let t=ev?{breaking_change_analysis:!0}:{};return(await X.post("/api/checks",{run_id:e,view_options:n,track_props:t})).data}async function te(){return(await X.get("/api/checks")).data}async function tn(e){return(await X.get("/api/checks/".concat(e))).data}async function tt(e,n){return(await X.patch("/api/checks/".concat(e),n)).data}async function ti(e){return(await X.delete("/api/checks/".concat(e))).data}async function tr(e){return await X.post("/api/checks/reorder",e)}var tl=t(26117),ts=t(17368),to=t(66253),ta=t(18406),tc=t(27657),td=t(40027),tu=t(34790),th=t(37957),tx=t(58286),tm=t(78203),tp=t(73830),tf=t(61036),tg=t(55677),tj=t(6717),tv=t(45382);function ty(e){let{name:n,setName:t}=e,[l,s]=(0,v.useState)(!1),[o,a]=(0,v.useState)(n),c=(0,v.useRef)(null),d=(0,v.useCallback)(()=>{t(o),s(!1)},[t,s,o]);return(0,v.useEffect)(()=>{let e=e=>{c.current&&!c.current.contains(e.target)&&d()};return l&&document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[l,c,d]),(0,i.jsx)(tg.a,{flex:"0 1 auto",fontSize:"12pt",fontWeight:"500",separator:(0,i.jsx)(tv.X,{color:"gray.500"}),overflow:"hidden",children:(0,i.jsx)(tj.g,{cursor:"pointer",flex:"0 1 auto",overflow:"hidden",children:l?(0,i.jsx)(nN.I,{ref:c,value:o,onChange:e=>{a(e.target.value)},onKeyDown:e=>{"Enter"===e.key?(t(o),s(!1)):"Escape"===e.key&&(a(n),s(!1))},size:"sm",w:"100%"}):(0,i.jsx)(r.x,{flex:"0 1 auto",onClick:()=>{a(n),s(!0)},textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",children:n})})})}var tb=t(41337);t(57728);let tw=(0,v.createContext)(void 0),tk=()=>{let e=(0,v.useContext)(tw);if(!e)throw Error("useLineageViewContext must be used within a LineageViewProvider");return e},tC=()=>(0,v.useContext)(tw);function t_(e){let{model:n,name:t,baseType:l,currentType:a,singleEnv:c}=e,{runAction:d}=n2(),u=tC(),{isActionAvailable:x}=eD(),m=null!=a?a:l,p=()=>{d("profile_diff",{model:n.name,columns:[t]},{showForm:!1})},f=()=>{d("histogram_diff",{model:n.name,column_name:t,column_type:m},{showForm:!1})},g=()=>{d("top_k_diff",{model:n.name,column_name:t,k:50},{showForm:!1})},j=!l||!a;return(0,i.jsxs)(o.k,{alignItems:"center",gap:"3px",children:[(0,i.jsx)(r.x,{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",children:t}),(0,i.jsx)(h.L,{}),u&&(0,i.jsx)(nW.h,{icon:(0,i.jsx)(nX.Lr9,{}),"aria-label":"",className:"row-context-menu",visibility:"hidden",width:"0px",minWidth:"0px",variant:"unstyled",size:"sm",color:"gray",_hover:{color:"black"},onClick:()=>{var e;e={action:"view"},eh.j("Column level lineage",e),null==u||u.showColumnLevelLineage(n.id,t)}}),!c&&"source"!==n.resource_type&&(0,i.jsx)(nV.v,{children:e=>{let{isOpen:n}=e;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(nP.j,{className:"row-context-menu",visibility:n?"visible":"hidden",width:n?"auto":"0px",minWidth:n?"auto":"0px",as:nW.h,icon:(0,i.jsx)(s.J,{as:nr.D_A}),variant:"unstyled",size:"sm",color:"gray",_hover:{color:"black"}}),(0,i.jsx)(nK.h,{children:(0,i.jsx)(nB.q,{lineHeight:"20px",children:(0,i.jsxs)(nJ.k,{title:"Diff",m:"0",p:"4px 12px",children:[(0,i.jsx)(nU.s,{fontSize:"10pt",onClick:p,isDisabled:j||!x("profile_diff"),children:"Profile Diff"}),(0,i.jsx)(nU.s,{fontSize:"10pt",onClick:f,isDisabled:j||!m||!(!eJ(m)&&!eU(m)&&!eQ(m)),children:"Histogram Diff"}),(0,i.jsx)(nU.s,{fontSize:"10pt",onClick:g,isDisabled:j,children:"Top-k Diff"})]})})})]})}})]})}function tS(e,n){function t(e){return void 0===e.baseIndex?"column-index-added":void 0===e.currentIndex?"column-index-removed":!0===e.reordered?"column-index-reordered":"column-index-normal"}function r(e){return void 0===e.baseIndex?"column-body-added":void 0===e.currentIndex?"column-body-removed":e.baseType!==e.currentType?"column-body-type-changed":!0===e.reordered?"column-body-reordered":"column-body-normal"}return{columns:[{key:"baseIndex",name:"",resizable:!0,minWidth:35,width:35,cellClass:t},{key:"currentIndex",name:"",resizable:!0,minWidth:35,width:35,cellClass:t},{key:"name",name:"Name",resizable:!0,renderCell:e=>{let{row:t,column:r}=e;return n?(0,i.jsx)(t_,{model:n,name:t.name,baseType:t.baseType,currentType:t.currentType}):t.name},cellClass:function(e){return void 0===e.baseIndex?"column-body-added":void 0===e.currentIndex?"column-body-removed":!0===e.reordered?"column-body-reordered":"column-body-normal"}},{key:"baseType",name:"Base Type",resizable:!0,cellClass:r},{key:"currentType",name:"Current Type",resizable:!0,cellClass:r}],rows:Object.values(e)}}var tz=t(77787),tR=t(24127);let tT=(0,v.forwardRef)(function(e,n){let t,r,{base:l,current:s,enableScreenshot:a=!1}=e,{columns:c,rows:d}=(0,v.useMemo)(()=>{let e=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t={};return Object.entries(nl(Object.keys(e),Object.keys(n))).forEach(e=>{let[n,i]=e;t[n]={name:n,reordered:"reordered"===i}}),Object.entries(e).map((e,n)=>{let[i,r]=e;t[i].baseIndex=n+1,t[i].baseType=r.type}),Object.entries(n).map((e,n)=>{let[i,r]=e;t[i].currentIndex=n+1,t[i].currentType=r.type}),t}(null==l?void 0:l.columns,null==s?void 0:s.columns),n=(null==s?void 0:s.resource_type)||(null==l?void 0:l.resource_type);return n&&["model","seed","snapshot","source"].includes(n)?tS(e,null!=s?s:l):tS(e)},[l,s]),{lineageGraph:u}=eD(),h=!(null==u?void 0:u.catalogMetadata.base),x=!(null==u?void 0:u.catalogMetadata.current);h&&x?t="catalog.json is missing on both current and base environments.":h?t="catalog.json is missing on base environment.":x&&(t="catalog.json is missing on current environment.");let m=l&&void 0===l.columns,p=s&&void 0===s.columns;return m&&p?r="Schema information is missing on both current and base environments.":m?r="Schema information is missing on base environment.":p&&(r="Schema information is missing on current environment."),(0,i.jsxs)(o.k,{direction:"column",children:[t?(0,i.jsxs)(tz.b,{status:"warning",fontSize:"12px",p:"8px",children:[(0,i.jsx)(tR.z,{}),t]}):r?(0,i.jsxs)(tz.b,{status:"warning",fontSize:"12px",p:"8px",children:[(0,i.jsx)(tR.z,{}),r]}):(0,i.jsx)(i.Fragment,{}),d.length>0&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(nt,{style:{blockSize:"auto",maxHeight:"100%",overflow:"auto",fontSize:"10pt",borderWidth:1},columns:c,rows:d,renderers:{noRowsFallback:(0,i.jsx)(ni,{})},className:"rdg-light",enableScreenshot:a,ref:n})})]})}),tL=(0,v.forwardRef)(function(e,n){let t,r,{current:l}=e,{columns:s,rows:a}=(0,v.useMemo)(()=>(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return{columns:[{key:"index",name:"",resizable:!0,minWidth:35,width:35,cellClass:"column-index-normal"},{key:"name",name:"Name",resizable:!0,renderCell:e=>{let{row:t,column:r}=e;return n?(0,i.jsx)(t_,{model:n,name:t.name,singleEnv:!0}):t.name},cellClass:"column-body-normal"},{key:"type",name:"Type",resizable:!0,cellClass:"column-body-normal"}],rows:Object.entries(e).map((e,n)=>{let[t,i]=e;return{name:t,index:n+1,type:i.type}})}})(null==l?void 0:l.columns,l),[l]),{lineageGraph:c}=eD();return(null==c?void 0:c.catalogMetadata.current)||(t="catalog.json is missing."),l&&void 0===l.columns&&(r="Schema information is missing."),(0,i.jsxs)(o.k,{direction:"column",children:[t?(0,i.jsxs)(tz.b,{status:"warning",fontSize:"12px",p:"8px",children:[(0,i.jsx)(tR.z,{}),t]}):r?(0,i.jsxs)(tz.b,{status:"warning",fontSize:"12px",p:"8px",children:[(0,i.jsx)(tR.z,{}),r]}):(0,i.jsx)(i.Fragment,{}),a.length>0&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(nt,{style:{blockSize:"auto",maxHeight:"100%",overflow:"auto",fontSize:"10pt",borderWidth:1},columns:s,rows:a,renderers:{noRowsFallback:(0,i.jsx)(ni,{})},className:"rdg-light",enableScreenshot:!1,ref:n})})]})});async function tI(e){return(await X.post("/api/select",e)).data}var tE=t(84626);t(39399);let tD=e=>{let{style:n,children:t,gutterSize:r=5,...l}=e;return(0,i.jsx)(tE.Z,{style:{display:"flex",flexDirection:"row",...n},direction:"horizontal",gutterSize:r,...l,children:t})},tO=e=>{let{style:n,children:t,gutterSize:r=5,...l}=e;return(0,i.jsx)(tE.Z,{style:{display:"flex",flexDirection:"column",...n},gutterSize:r,direction:"vertical",...l,children:t})};var tA=t(48832),tM=t(75435),tF=t(51973);let tN=nr.Nbv,tq=nr.sFB,tH=nr.UGs;function tV(e){return"added"===e?{color:"#1dce00",backgroundColor:"#e8fce5",icon:tN}:"removed"===e?{color:"#ff4444",backgroundColor:"#ffdbdb",icon:tq}:"modified"===e?{color:"#ffa502",backgroundColor:"#fff2dd",icon:tH}:{color:"inherit",backgroundColor:"white",icon:void 0}}function tP(e){if("model"===e)return{color:"#c0eafd",icon:tM.Fn3};if("metric"===e)return{color:"#ffe6ee",icon:tF._MV};if("source"===e)return{color:"#a6dda6",icon:tM.i1q};if("exposure"===e)return{color:"#ffe6ee",icon:tF.n8P};if("semantic_model"===e)return{color:"#fb8caf",icon:tF.R1C};if("seed"===e)return{color:"#a6dda6",icon:tM.tWi};if("snapshot"===e)return{color:"#a6dda6",icon:tM.Dmm};else return{color:"inherit",icon:void 0}}function tW(e,n){if(!e||!n)return;let t=Object.keys(e),i=Object.keys(n);if(t.length!==i.length)return!0;for(let e=0;e<t.length;e++)if(t[e]!==i[e])return!0;for(let t of i)if(!e[t]||e[t].type!==n[t].type)return!0;return!1}let tK=e=>{let n,t,{node:l,selected:a,onSelect:c,schemaChanged:d}=e,{icon:u}=tP(l.resourceType),{base:h,current:x}=l.data;if(d){var m;n=null===(m=n$("schema_diff"))||void 0===m?void 0:m.icon,t=tV("modified").color}else!h&&x?(n=tV("added").icon,t=tV("added").color):h&&!x&&(n=tV("removed").icon,t=tV("removed").color);return(0,i.jsxs)(o.k,{width:"100%",fontSize:"10pt",p:"5px 8px",cursor:"pointer",_hover:{bg:"gray.200"},bg:a?"gray.100":"inherit",onClick:()=>{c(l.id)},alignItems:"center",gap:"5px",children:[(0,i.jsx)(s.J,{as:u}),(0,i.jsx)(r.x,{flex:"1",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",children:l.name}),n&&t&&(0,i.jsx)(s.J,{as:n,color:t})]})},tB=(0,v.forwardRef)(function(e,n){let{check:t}=e,{lineageGraph:r}=eD(),l=t.params,s=[...B.check(t.check_id),"select"],{isLoading:o,error:a,refetch:c,data:d}=(0,y.a)({queryKey:s,queryFn:async()=>tI({select:l.select,exclude:l.exclude,packages:l.packages,view_mode:l.view_mode}),refetchOnMount:!0,enabled:!l.node_id}),[u,h]=(0,v.useMemo)(()=>{let e=[],n=[],t=[],i=[];if(l.node_id)for(let n of l.node_id instanceof Array?l.node_id:[l.node_id]){let t=null==r?void 0:r.nodes[n];t&&e.push(t)}else for(let n of(null==d?void 0:d.nodes)||[]){let t=null==r?void 0:r.nodes[n];t&&e.push(t)}let s=e.filter(e=>"model"===e.resourceType||"seed"===e.resourceType||"source"===e.resourceType||"snapshot"===e.resourceType);for(let e of s){var o,a;tW(null===(o=e.data.base)||void 0===o?void 0:o.columns,null===(a=e.data.current)||void 0===a?void 0:a.columns)?n.push(e.id):!e.data.base&&e.data.current?t.push(e.id):e.data.base&&!e.data.current&&i.push(e.id)}function c(e){return n.includes(e.id)?3:t.includes(e.id)?2:i.includes(e.id)?1:0}return s.sort((e,n)=>{let t=c(e),i=c(n);return t!==i?i-t:e.name.localeCompare(n.name)}),[s,n]},[l.node_id,null==d?void 0:d.nodes,r]),[x,m]=(0,v.useState)(0);if(o)return(0,i.jsx)(ne.M,{bg:"rgb(249,249,249)",height:"100%",children:"Loading..."});if(a)return(0,i.jsxs)(ne.M,{bg:"rgb(249,249,249)",height:"100%",children:["Error: ",a.message]});if(0==u.length)return(0,i.jsx)(ne.M,{bg:"rgb(249,249,249)",height:"100%",children:"No nodes matched"});if(x<u.length){let e=u[x];return(0,i.jsxs)(tD,{sizes:[80,20],minSize:30,style:{height:"100%"},children:[(0,i.jsx)(tT,{base:e.data.base,current:e.data.current,enableScreenshot:!0,ref:n}),(0,i.jsx)(tA.aV,{overflow:"auto",backgroundColor:"white",children:u.map((e,n)=>(0,i.jsx)(tK,{node:e,schemaChanged:h.includes(e.id),selected:n===x,onSelect:()=>{m(n)}},n))})]})}return(0,i.jsx)(i.Fragment,{})});var tJ=t(39);function tU(e){let{value:n,onChange:t}=e,[r,s]=(0,v.useState)(!1),[a,c]=(0,v.useState)(),d=(0,v.useRef)(null),u=()=>{t&&(t(a),s(!1))};return((0,v.useEffect)(()=>{if(r&&d.current){let e=d.current;e.focus(),e.setSelectionRange(e.value.length,e.value.length)}},[r]),r)?(0,i.jsxs)(o.k,{direction:"column",align:"flex-end",height:"100%",children:[(0,i.jsx)(tJ.g,{value:a,onChange:e=>{c(e.target.value)},onKeyDown:e=>{"Escape"===e.key&&s(!1),(e.metaKey||e.ctrlKey)&&"Enter"===e.key&&(e.preventDefault(),u())},ref:d,flex:1}),(0,i.jsxs)(o.k,{gap:"12px",alignItems:"flex-end",children:[(0,i.jsx)(l.r,{onClick:()=>{setTimeout(()=>{s(!1)},100)},colorScheme:"blue",children:"cancel"}),(0,i.jsx)(ec.z,{mt:"8px",size:"sm",colorScheme:"blue",onClick:u,children:"Update"})]})]}):(0,i.jsx)(eo.x,{height:"100%",overflow:"auto",fontSize:"11pt",onClick:()=>{c(n||""),s(!0)},whiteSpace:"pre-wrap",wordBreak:"break-word",color:n?"inherit":"lightgray",children:n||"Add description here"})}var tQ=t(43040);function tZ(){let e=(0,ee.p)();return{successToast:function(n){e({description:n,status:"info",variant:"left-accent",position:"bottom",duration:5e3,isClosable:!0})},failToast:function(n,t){e({title:n,description:"".concat(t),status:"error",variant:"left-accent",position:"bottom",duration:5e3,isClosable:!0})}}}function tX(){let e=(0,tl._)(["\n **SQL**\n ```sql\n ","\n ```\n "],["\n **SQL**\n \\`\\`\\`sql\n ","\n \\`\\`\\`\n "]);return tX=function(){return e},e}function tG(e){return e.description?e.description:"_(no description)_"}var tY=t(61701),t$=t(4872);let t0=e=>{let{value:n,onChange:t,onRun:r,onRunBase:l,onRunDiff:a,label:c,CustomEditor:d,options:u={},...x}=e;return(0,i.jsxs)(i.Fragment,{children:[(c||r||l)&&(0,i.jsxs)(o.k,{backgroundColor:"#EDF2F880",height:"40px",minH:"40px",fontSize:"14px",align:"center",margin:"0",padding:"0px 16px",children:[(0,i.jsx)(eo.x,{as:"b",children:c?c.toUpperCase():""}),(0,i.jsx)(h.L,{}),(r||l)&&(0,i.jsx)(ec.z,{size:"sm",variant:"outline",onClick:r||l,backgroundColor:"white",leftIcon:(0,i.jsx)(s.J,{as:tF.gmG}),padding:"6px 12px",children:"Run Query"})]}),d||(0,i.jsx)(t$.ML,{language:"sql",theme:"vs",value:n,onChange:e=>{void 0!==e&&t&&t(e)},onMount:(e,n)=>{r&&e.addCommand(n.KeyMod.CtrlCmd|n.KeyCode.Enter,r),l&&e.addCommand(n.KeyMod.Alt|n.KeyCode.Enter,l),a&&e.addCommand(n.KeyMod.CtrlCmd|n.KeyMod.Shift|n.KeyCode.Enter,a)},options:{tabSize:2,fontSize:16,lineNumbers:"on",automaticLayout:!0,minimap:{enabled:!1},wordWrap:"on",wrappingIndent:"indent",...u}})]})},t1=e=>{let{value:n,baseValue:t,onChange:r,onChangeBase:l,onRun:s,onRunBase:a,onRunDiff:c,options:d={},labels:u,BaseEnvironmentSetupGuide:h,...x}=e,m=u?u[0]:"Base",p=u?u[1]:"Current";return(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(o.k,{height:"100%",gap:0,children:[(0,i.jsx)(tY.K,{height:"100%",width:"50%",gap:0,borderRight:"1px",borderColor:"#D4DBE4",children:(0,i.jsx)(t0,{label:m,value:t||"",onChange:l,onRunBase:a,options:d,CustomEditor:h||void 0,...x})}),(0,i.jsx)(tY.K,{height:"100%",width:"50%",gap:0,children:(0,i.jsx)(t0,{label:p,value:n,onChange:r,onRun:s,options:d,...x})})]})})};var t5=t(16168),t2=t(99303);let t4=(0,eZ.G)((e,n)=>{var t,l,s;let{isRunning:a,isAborting:c,progress:d,error:u,run:h,onCancel:x,viewOptions:m,onViewOptionsChanged:p,RunResultView:f,children:g,onExecuteRun:j}=e,v=(null==u?void 0:null===(l=u.response)||void 0===l?void 0:null===(t=l.data)||void 0===t?void 0:t.detail)||(null==h?void 0:h.error);if(v)return(0,i.jsxs)(tz.b,{status:"error",children:[(0,i.jsx)(tR.z,{}),"Error: ",v]});if(void 0!==a?a:(null==h?void 0:h.status)==="running"){let e=(null==d?void 0:d.message)?d.message:(null==h?void 0:null===(s=h.progress)||void 0===s?void 0:s.message)?h.progress.message:"Loading...";return(0,i.jsx)(ne.M,{p:"16px",height:"100%",bg:"rgb(249,249,249)",children:(0,i.jsxs)(nf.g,{children:[(0,i.jsxs)(o.k,{alignItems:"center",children:[(null==d?void 0:d.percentage)===void 0||null===d.percentage?(0,i.jsx)(t5.D,{isIndeterminate:!0,size:"20px",mr:"8px"}):(0,i.jsx)(t5.D,{size:"20px",value:100*d.percentage,mr:"8px"}),c?(0,i.jsx)(i.Fragment,{children:"Aborting..."}):(0,i.jsx)(i.Fragment,{children:e})]}),!c&&(0,i.jsx)(ec.z,{onClick:x,colorScheme:"blue",size:"sm",children:"Cancel"})]})})}if(!h)return(0,i.jsx)(ne.M,{bg:"rgb(249,249,249)",height:"100%",children:"Loading..."});if(g&&f)throw Error("RunView requires either a children or a RunResultView prop, but not both.");if(!g&&!f)throw Error("RunView requires at least one of children or RunResultView prop.");return(0,i.jsxs)(r.x,{h:"100%",style:{contain:"size layout"},overflow:"auto",children:[f&&(h.error||h.result)&&(0,i.jsx)(t2.SV,{children:(0,i.jsx)(f,{ref:n,run:h,viewOptions:m,onViewOptionsChanged:p})}),null==g?void 0:g({run:h,viewOptions:m,onViewOptionsChanged:p})]})});var t6=t(12032),t3=t(30282),t9=t(26189),t8=t(4549),t7=t(21897),ie=t(15254);t(72229),t(86257);var it=t(43390),ii=t(81882),ir=t(61953),il=t(26165);function is(e){let{node:n}=e,{icon:t}=tP(n.resourceType);return(0,i.jsx)(nT.u,{hasArrow:!0,label:"Type of resource",children:(0,i.jsxs)(ts.Vp,{children:[(0,i.jsx)(ts.AD,{as:t}),(0,i.jsx)(ts.Sn,{children:n.resourceType})]})})}function io(e){let{rowCount:n}=e,t=n.base,r=n.curr,l=null===n.base?"N/A":"".concat(n.base," rows"),o=null===n.curr?"N/A":"".concat(n.curr," rows");return null===t&&null===r?(0,i.jsx)(i.Fragment,{children:" Failed to load"}):null===t||null===r?(0,i.jsxs)(u.U,{children:[(0,i.jsx)(eo.x,{children:l}),(0,i.jsx)(s.J,{as:ir.Rgz}),(0,i.jsx)(eo.x,{children:o})]}):t===r?(0,i.jsxs)(u.U,{children:[(0,i.jsx)(eo.x,{children:o}),(0,i.jsx)(s.J,{as:il.lxc,color:"gray.500"}),(0,i.jsx)(eo.x,{color:"gray.500",children:"No Change"})]}):t<r?(0,i.jsxs)(u.U,{children:[(0,i.jsx)(eo.x,{children:o}),(0,i.jsx)(s.J,{as:il.Tvk,color:"green.500"}),(0,i.jsx)(eo.x,{color:"green.500",children:nC(t,r)})]}):(0,i.jsxs)(u.U,{children:[(0,i.jsx)(eo.x,{children:o}),(0,i.jsx)(s.J,{as:il.ebp,color:"red.500"}),(0,i.jsx)(eo.x,{color:"red.500",children:nC(t,r)})]})}function ia(e){var n,t;let r,{rowCount:l,node:s,onRefresh:o,isFetching:a}=e,{runsAggregated:c,refetchRunsAggregated:d}=eD(),u=null==c?void 0:null===(n=c[s.id])||void 0===n?void 0:n.row_count_diff.result,h=null===(t=n$("row_count_diff"))||void 0===t?void 0:t.icon,x=l||u;if(x){let e=null===x.base?"N/A":x.base,n=null===x.curr?"N/A":x.curr;r="".concat(e," -> ").concat(n," rows")}return(0,i.jsx)(nT.u,{label:r,children:(0,i.jsxs)(ts.Vp,{children:[(0,i.jsx)(ts.AD,{as:h}),(0,i.jsx)(ts.Sn,{children:x||a?(0,i.jsx)(ii.N,{isLoaded:!a,noOfLines:1,skeletonHeight:2,minWidth:"30px",children:x?(0,i.jsx)(io,{rowCount:x}):"row count"}):(0,i.jsx)(i.Fragment,{children:"row count"})}),o&&(0,i.jsx)(ts.bq,{as:nW.h,isLoading:a,"aria-label":"Query Row Count",icon:(0,i.jsx)(tm.n,{}),size:"xs",onClick:o})]})})}function ic(e){var n,t;let r,{rowCount:l,node:s,onRefresh:o,isFetching:a}=e,{runsAggregated:c,refetchRunsAggregated:d}=eD(),u=null==c?void 0:null===(n=c[s.id])||void 0===n?void 0:n.row_count.result,h=null===(t=n$("row_count"))||void 0===t?void 0:t.icon,x=l||u;if(x){let e=null===x.curr?"N/A":x.curr;r="".concat(e," rows")}return(0,i.jsxs)(ts.Vp,{children:[(0,i.jsx)(ts.AD,{as:h}),(0,i.jsx)(ts.Sn,{children:x||a?(0,i.jsx)(ii.N,{isLoaded:!a,noOfLines:1,skeletonHeight:2,minWidth:"30px",children:x?"".concat(r):"row count"}):(0,i.jsx)(i.Fragment,{children:"row count"})}),o&&(0,i.jsx)(ts.bq,{as:nW.h,isLoading:a,"aria-label":"Query Row Count",icon:(0,i.jsx)(tm.n,{}),size:"xs",onClick:o,disabled:"base"===s.from})]})}let id=e=>{let{node:n,action:t}=e,{status:l,skipReason:s,run:a}=t;if("pending"===l)return(0,i.jsx)(t5.D,{size:"20px",value:0});if("skipped"===l)return(0,i.jsx)(ts.Vp,{backgroundColor:"gray.100",children:(0,i.jsxs)(o.k,{fontSize:"10pt",color:"gray.500",alignItems:"center",gap:"3px",children:[(0,i.jsx)(r.x,{children:"Skipped"}),s&&(0,i.jsx)(nT.u,{label:s,children:(0,i.jsx)(it.s,{})})]})});if(!a)return(0,i.jsx)(t5.D,{isIndeterminate:!0,size:"20px"});let{error:c,result:d,run_id:u,progress:h}=a;if("running"===l)return(null==h?void 0:h.percentage)===void 0?(0,i.jsx)(t5.D,{isIndeterminate:!0,size:"20px"}):(0,i.jsx)(t5.D,{size:"20px",value:100*h.percentage});if(c)return(0,i.jsxs)(o.k,{fontSize:"10pt",color:"gray",children:[(0,i.jsx)(r.x,{children:"Error"}),s&&(0,i.jsx)(nT.u,{label:c,children:(0,i.jsx)(np.a,{})})]});if("value_diff"===a.type){let e=0;for(let n of d.data.data)n[2]<1&&e++;return(0,i.jsx)(ts.Vp,{backgroundColor:e>0?"red.100":"green.100",children:(0,i.jsx)(ts.Sn,{children:(0,i.jsx)(o.k,{fontSize:"10pt",color:e>0?"red":"green",alignItems:"center",gap:"3px",children:e>0?"".concat(e," columns mismatched"):"All columns match"})})})}if("row_count_diff"===a.type){let e=a.result;return(0,i.jsx)(ia,{rowCount:e[n.name],node:n})}if("row_count"===a.type){let e=a.result;return(0,i.jsx)(ic,{rowCount:e[n.name],node:n})}return(0,i.jsx)(i.Fragment,{children:u})};function iu(e){var n;let t,r,{rowCount:l}=e,s=l.base,o=l.curr,a=null===l.base?"N/A":"".concat(l.base," Rows"),c=null===l.curr?"N/A":"".concat(l.curr," Rows");return null===s&&null===o?(t="Failed to load",r="gray"):null===s||null===o?(t="".concat(a," -> ").concat(c),r=null===s?"green":"red"):s===o?(t="=",r="gray"):s!==o&&(t="".concat(nC(s,o)," Rows"),r=s<o?"green":"red"),(0,i.jsxs)(ts.Vp,{colorScheme:r,children:[(0,i.jsx)(ts.AD,{as:null===(n=n$("row_count_diff"))||void 0===n?void 0:n.icon}),(0,i.jsx)(ts.Sn,{children:t})]})}let ih=e=>{var n;let t,l,{id:a,inverted:c}=e,{lineageGraph:d,runsAggregated:u}=eD(),x=null==u?void 0:u[a],m=null==d?void 0:d.nodes[a];if(!x&&!m)return(0,i.jsx)(i.Fragment,{});if((null==m?void 0:m.data.base)&&m.data.current&&(t=tW(m.data.base.columns,m.data.current.columns)),null==x?void 0:x.row_count_diff){let e=x.row_count_diff;l=e.result.curr!==e.result.base}let p=c?"white":tV("modified").color;return(0,i.jsxs)(o.k,{flex:"1",children:[void 0!==t&&(0,i.jsx)(nT.u,{label:"Schema (".concat(t?"changed":"no change",")"),openDelay:500,children:(0,i.jsx)(r.x,{height:"16px",children:(0,i.jsx)(s.J,{as:null===(n=n$("schema_diff"))||void 0===n?void 0:n.icon,color:t?p:c?"gray":"lightgray"})})}),(0,i.jsx)(h.L,{}),(null==x?void 0:x.row_count_diff)&&void 0!==l&&(0,i.jsx)(nT.u,{label:"Row count (".concat(l?"changed":"=",")"),openDelay:500,children:(0,i.jsx)(r.x,{children:(0,i.jsx)(iu,{rowCount:x.row_count_diff.result})})})]})},ix=e=>{let{checked:n,onClick:t}=e;return(0,i.jsx)(o.k,{onClick:t,alignSelf:"center",alignItems:"center",children:n?(0,i.jsx)(s.J,{boxSize:"20px",as:tM.xik}):(0,i.jsx)(s.J,{boxSize:"20px",as:tM.hGI})})};var im=t(19655),ip=t(81420),ig=t(95625);function ij(e){let{base:n,current:t}=e;return(0,i.jsx)(t$.SV,{height:"100%",language:"sql",theme:"vs",original:null==n?void 0:n.raw_code,modified:null==t?void 0:t.raw_code,options:{readOnly:!0,fontSize:14,lineNumbers:"on",automaticLayout:!0,minimap:{enabled:!1},wordWrap:"on",wrappingIndent:"same"}})}function iv(e){let{current:n,onChange:t}=e,l=function(e,n){let t=(0,v.useRef)(null);return(0,v.useEffect)(()=>{t.current&&e!==t.current.getValue()&&t.current.setValue(e)},[e]),{onMount(e){let i=e.getModifiedEditor();t.current=i,i.onDidChangeModelContent(()=>{n(i.getValue())})}}}((null==n?void 0:n.raw_code)||"",t);return(0,i.jsx)(r.x,{flex:1,overflowY:"auto",children:(0,i.jsx)(t$.SV,{language:"sql",theme:"vs",original:null==n?void 0:n.raw_code,modified:null==n?void 0:n.raw_code,options:{readOnly:!1,fontSize:14,lineNumbers:"on",automaticLayout:!0,wordWrap:"on",wrappingIndent:"same",renderOverviewRuler:!1,minimap:{enabled:!0}},onMount:l.onMount})})}async function iy(e){return(await X.post("/api/checks",{type:"schema_diff",params:e})).data}let ib={audit_helper:"Require the dbt package 'dbt-labs/audit_helper'. Please install it and re-run dbt to activate this feature.",dbt_profiler:"Require the dbt package 'data-mie/dbt_profiler'. Please install it and re-run dbt to activate this feature.",add_or_remove:"Unavailable for added or removed resources."},iw=e=>{var n;let[t,i]=(0,v.useState)(!1),[r,l]=(0,v.useState)(!1),[,s]=eO(),{error:o,data:a}=(0,y.a)({queryKey:B.run(e||""),queryFn:async()=>eb(e||"",t?2:0),enabled:!!e,refetchInterval:!!t&&50,retry:!1});(0,v.useEffect)(()=>{(o||(null==a?void 0:a.result)||(null==a?void 0:a.error))&&(t&&i(!1),((null==a?void 0:a.type)==="row_count_diff"||(null==a?void 0:a.type)==="row_count")&&s()),(null==a?void 0:a.status)==="running"&&i(!0)},[a,o,t,s]);let c=(0,v.useCallback)(async()=>{if(l(!0),e)return await ew(e)},[e,l]),d=(null==a?void 0:a.type)?null===(n=n$(a.type))||void 0===n?void 0:n.RunResultView:void 0;return{run:a,isRunning:t,aborting:r,error:o,onCancel:c,RunResultView:d}};var ik=t(69524),iC=t(19895),i_=t(38299),iS=t.n(i_),iz=t(71262),iR=t(87699),iT=t(20982),iL=t.n(iT);let iI="ignore-screenshot";function iE(e){let{renderLibrary:n="html2canvas",imageType:t="png",backgroundColor:r=null,boardEffect:l=!0,shadowEffect:s=!1,borderStyle:c="solid 1px #ccc",borderRadius:d="10px",onSuccess:u,onError:h,ignoreElements:x}=e,[m,p]=(0,v.useState)("idle"),f=(0,v.useRef)(null),{onOpen:g,setImgBlob:j,ImageDownloadModal:y}=function(){let{isOpen:e,onOpen:n,onClose:t}=(0,en.q)(),[r,l]=(0,v.useState)();return{onOpen:n,setImgBlob:l,ImageDownloadModal:function(){let[n,l]=(0,v.useState)();return(0,v.useEffect)(()=>{if(!r)return;let e=new FileReader;e.readAsDataURL(r),e.onloadend=e=>{var n;(null===(n=e.target)||void 0===n?void 0:n.result)&&null!==e.target.result&&l(e.target.result)}},[l]),(0,i.jsxs)(et.u_,{size:"3xl",isOpen:e,onClose:t,children:[(0,i.jsx)(ei.Z,{}),(0,i.jsxs)(er.h,{children:[(0,i.jsx)(el.x,{children:"Screenshot Preview"}),(0,i.jsx)(eA.o,{}),(0,i.jsxs)(es.f,{children:[(0,i.jsxs)(o.k,{px:"10px",gap:"10px",direction:"column",children:[(0,i.jsxs)(o.k,{alignItems:"center",gap:"5px",children:[(0,i.jsx)(it.s,{color:"red.600"}),(0,i.jsx)(eo.x,{fontWeight:"500",display:"inline",children:"Copy to the Clipboard"})," ","is not supported in the current browser"]}),(0,i.jsx)(eo.x,{children:"Please download it directly"})]}),(0,i.jsx)(a.E,{src:n,alt:"screenshot"})]}),(0,i.jsxs)(ea.m,{children:[(0,i.jsx)(ec.z,{mr:3,onClick:t,children:"Close"}),(0,i.jsx)(ec.z,{colorScheme:"blue",onClick:()=>{if(!r)return;let e=new Date,n="recce-screenshot-".concat((0,iR.WU)(e,"yyyy-MM-dd-HH-mm-ss"),".png");iL()(r,n),t()},children:"Download"})]})]})]})}}}(),b=async()=>{if(!f.current)throw console.error("No node to use for screenshot"),Error("No node to use for screenshot");let e=f.current.element||f.current,t=e.style.overflow,i=e.style.border,o=e.style.borderRadius,a=e.style.backgroundColor,u=e.style.height;try{var h;e.style.overflow="hidden",e.style.border=l?c:"",e.style.borderRadius=l?d:"",e.style.backgroundColor=r||"",e.style.height=e.offsetHeight+"px";let t=document.createElement("style");document.head.appendChild(t),null===(h=t.sheet)||void 0===h||h.insertRule("body > div:last-child img { display: inline-block; }"),p("loading");let i="html2canvas"===n?await iS()(e,{logging:!1,backgroundColor:null,ignoreElements:x}):await (0,iz.rT)(e,{filter:x?e=>!x(e):void 0});t.remove();let o=s?document.createElement("canvas"):i;if(s){o.width=i.width+80,o.height=i.height+80;let e=o.getContext("2d");if(e)e.shadowColor="rgba(0, 0, 0, 0.5)",e.shadowBlur=20,e.shadowOffsetX=10,e.shadowOffsetY=10,e.drawImage(i,40,40);else throw console.error("Error getting canvas context"),Error("Error getting canvas context to add shadow effect")}let a=await fetch(o.toDataURL());return await a.blob()}catch(e){throw console.error("Error converting to image",e),e}finally{e.style.overflow=t,e.style.border=i,e.style.borderRadius=o,e.style.backgroundColor=a,e.style.height=u}};return{status:m,isLoading:"loading"===m,isErrored:"error"===m,isSuccess:"success"===m,copyToClipboard:async()=>{try{await navigator.clipboard.write([new ClipboardItem({["image/".concat(t)]:b()})]),p("success"),u&&u()}catch(e){"ClipboardItem is not defined"===e.message?(j(await b()),g(),p("success")):(p("error"),console.error("Error copying to clipboard",e),h&&h(e))}},ImageDownloadModal:y,ref:f}}function iD(e){let{successToast:n,failToast:t}=tZ(),{isLoading:r,copyToClipboard:l,ImageDownloadModal:s,ref:o}=iE({imageType:"png",shadowEffect:!0,backgroundColor:(null==e?void 0:e.backgroundColor)||null,onSuccess:()=>{n("Copied the query result as an image to clipboard")},onError:e=>{console.error("Error taking screenshot",e),t("Failed to copy image to clipboard",e)}}),a=(0,v.useCallback)(()=>{if(o.current){let e=o.current.element||o.current;e.style.boxShadow="rgba(0, 0, 0, 0.25) 0px 54px 55px, rgba(0, 0, 0, 0.12) 0px -12px 30px, rgba(0, 0, 0, 0.12) 0px 4px 6px, rgba(0, 0, 0, 0.17) 0px 12px 13px, rgba(0, 0, 0, 0.09) 0px -3px 5px",e.style.transition="box-shadow 0.5s ease-in-out"}},[o]),c=(0,v.useCallback)(()=>{o.current&&((o.current.element||o.current).style.boxShadow="")},[o]),d=(0,v.useCallback)(async()=>{o.current?(await l(),(o.current.element||o.current).style.boxShadow=""):t("Failed to copy image to clipboard","No content to copy")},[o,l,t]);return{ref:o,CopyToClipboardButton:function(e){let{imageType:n="png",...t}=e;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ec.z,{size:"sm",leftIcon:(0,i.jsx)(tu.T,{}),style:{position:"absolute",bottom:"16px",right:"16px"},isLoading:r,onMouseEnter:a,onMouseLeave:c,onClick:d,children:"Copy to Clipboard"}),(0,i.jsx)(s,{})]})},onMouseEnter:a,onMouseLeave:c,onCopyToClipboard:d}}let iO=e=>{let{run:n}=e,t="running"===n.status,r=n.status;!r&&(n.result?r="finished":n.error&&(r="failed"));let l="",s="";"successful"===r||"finished"===r?(l="green",s="Finished"):"failed"===r?(l="red",s="Failed"):"cancelled"===r?(l="gray",s="Cancelled"):"running"===r?(l="blue",s="Running"):(l="green",s="Finished");let a=n.run_at?function(e){let n=new Date,t=new Date;return(t.setDate(n.getDate()-1),null==e)?null:n.toDateString()===e.toDateString()?"Today, "+(0,iR.WU)(e,"HH:mm"):t.toDateString()===e.toDateString()?"Yesterday, "+(0,iR.WU)(e,"HH:mm"):(0,iR.WU)(e,"MMM d, HH:mm")}(new Date(n.run_at)):null;return(0,i.jsxs)(o.k,{justifyContent:"start",fontSize:"11pt",color:"gray.500",gap:"3px",alignItems:"center",overflow:"hidden",children:[t&&(0,i.jsx)(t3.$,{size:"xs",color:"".concat(l,".400")}),(0,i.jsx)(eo.x,{fontWeight:500,color:"".concat(l,".400"),children:s}),(0,i.jsx)(eo.x,{children:"•"}),(0,i.jsx)(eo.x,{textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",children:a})]})},iA=e=>{let n=ik.ZP.stringify(e,null,2);return(0,i.jsx)(t$.ML,{height:"100%",language:"yaml",theme:"vs",value:n,options:{readOnly:!0,fontSize:14,lineNumbers:"off",automaticLayout:!0,minimap:{enabled:!1},wordWrap:"on",wrappingIndent:"same",scrollBeyondLastLine:!1}})},iM=e=>{var n,t,r;let{runId:l,onClose:s,disableAddToChecklist:a}=e,{runAction:c}=n2(),{error:d,run:f,onCancel:g,isRunning:j}=iw(l),[y,w]=(0,v.useState)(),k=(0,b.NL)(),[,C]=(0,eF.TH)(),[_,S]=(0,v.useState)(0),z=(null==f?void 0:f.type)?null===(n=n$(f.type))||void 0===n?void 0:n.RunResultView:void 0,R=(0,v.useCallback)(()=>{c((null==f?void 0:f.type)||"",null==f?void 0:f.params)},[f,c]),T=null==f?void 0:f.check_id,L=(0,v.useCallback)(async()=>{T&&C("/checks/".concat(T))},[T,C]),I=(0,v.useCallback)(async()=>{if(!l)return;let e=await n7(l,y);k.invalidateQueries({queryKey:B.checks()}),C("/checks/".concat(e.check_id))},[l,C,k,y]),E=(null==f?void 0:f.type)==="query"||(null==f?void 0:f.type)==="query_diff"||(null==f?void 0:f.type)==="query_base",{ref:D,onCopyToClipboard:O,onMouseEnter:A,onMouseLeave:M}=iD();return(0,i.jsxs)(o.k,{direction:"column",children:[(0,i.jsx)(x.m,{tabIndex:_,onChange:S,flexDirection:"column",mb:"1px",children:(0,i.jsxs)(m.t,{height:"50px",children:[(0,i.jsx)(p.O,{children:"Result"}),(0,i.jsx)(p.O,{children:"Params"}),E&&(0,i.jsx)(p.O,{children:"Query"}),(0,i.jsx)(h.L,{}),(0,i.jsxs)(u.U,{overflow:"hidden",children:[f&&(0,i.jsx)(iO,{run:f}),(0,i.jsx)(ec.z,{leftIcon:(0,i.jsx)(tm.n,{}),variant:"outline",isDisabled:!l||j,size:"sm",onClick:R,children:"Rerun"}),(0,i.jsx)(ec.z,{leftIcon:(0,i.jsx)(tu.T,{}),variant:"outline",isDisabled:!l||!(null==f?void 0:f.result)||!!d||0!==_,onMouseEnter:A,onMouseLeave:M,size:"sm",onClick:O,children:"Copy to Clipboard"}),(0,i.jsx)(function(){return a?(0,i.jsx)(i.Fragment,{}):(null==f?void 0:f.check_id)?(0,i.jsx)(ec.z,{leftIcon:(0,i.jsx)(iC.n,{}),isDisabled:!l||!f.result||!!d,size:"sm",colorScheme:"blue",onClick:L,children:"Go to Check"}):(0,i.jsx)(ec.z,{leftIcon:(0,i.jsx)(iC.n,{}),isDisabled:!l||!(null==f?void 0:f.result)||!!d,size:"sm",colorScheme:"blue",onClick:I,children:"Add to Checklist"})},{}),(0,i.jsx)(ig.P,{onClick:()=>{s&&s()}})]})]})}),0===_&&(0,i.jsx)(t4,{ref:D,error:d,run:f,onCancel:g,viewOptions:y,onViewOptionsChanged:w,RunResultView:z}),1===_&&f&&(0,i.jsx)(iA,{type:f.type,params:f.params}),2===_&&f&&((null===(t=f.params)||void 0===t?void 0:t.base_sql_template)?(0,i.jsx)(t1,{value:f.params.sql_template,baseValue:f.params.base_sql_template,options:{readOnly:!0}}):(0,i.jsx)(t0,{value:(null===(r=f.params)||void 0===r?void 0:r.sql_template)||"",options:{readOnly:!0}}))]})},iF=e=>{let{onClose:n,disableAddToChecklist:t}=e,{runId:r}=n2();return(0,i.jsx)(iM,{runId:r,onClose:n,disableAddToChecklist:t})};var iN=t(60922);async function iq(e,n){return await ey("query",e,n)}async function iH(e,n){return await ey("query_base",e,n)}async function iV(e,n){return await ey("query_diff",e,n)}function iP(){return(0,i.jsx)(r.x,{height:"100%",children:(0,i.jsxs)(tY.K,{spacing:4,p:4,m:"32px",fontSize:"sm",children:[(0,i.jsx)(c.X,{as:"h1",size:"md",children:"Config the Base Environment to run query diff"}),(0,i.jsx)(eo.x,{children:"To diff the model by SQL, you need to setup two environments. Currently, only the target environment is setup."}),(0,i.jsx)(eo.x,{children:"Please configure the base environment before running the query diff."}),(0,i.jsx)(l.r,{textDecor:"underline",isExternal:!0,color:"blue.500",href:"https://datarecce.io/docs/get-started/#prepare-dbt-artifacts",children:"Learn how"})]})})}function iW(e){let{current:n}=e;return(0,i.jsxs)(o.k,{justifyContent:"right",alignItems:"center",padding:"4pt 8pt",gap:"5px",height:"54px",borderBottom:"1px solid lightgray",flex:"0 0 54px",children:[(0,i.jsxs)(r.x,{children:[(0,i.jsxs)(c.X,{as:"h2",size:"md",display:"flex",alignItems:"center",gap:"5px",children:[(0,i.jsx)(s.J,{as:iN.vc4,boxSize:"1.2em"}),"Query"]}),(0,i.jsx)(eo.x,{fontSize:"xs",color:"gray.500",children:"Query model by SQL"})]}),(0,i.jsx)(h.L,{}),(0,i.jsx)(nT.u,{label:"Please configure the base environment before running the diff",children:(0,i.jsx)(ec.z,{colorScheme:"blue",isDisabled:!0,size:"xs",fontSize:"14px",marginTop:"16px",children:"Run Diff"})})]})}function iK(e){let{isOpen:n,onClose:t,current:l}=e,{isOpen:s,onClose:u,onOpen:h}=(0,en.q)(),[x,m]=(0,v.useState)('SELECT * FROM {{ ref("'.concat(null==l?void 0:l.name,'")}}')),{showRunId:p,clearRunResult:f}=n2(),{lineageGraph:g}=eD(),j="N/A";if(null==g?void 0:g.nodes[(null==l?void 0:l.id)||""]){var y;let e=g.nodes[(null==l?void 0:l.id)||""];(null===(y=e.data.current)||void 0===y?void 0:y.schema)&&(j=e.data.current.schema)}(0,v.useEffect)(()=>{m('SELECT * FROM {{ ref("'.concat(null==l?void 0:l.name,'")}}'))},[l]);let b=async()=>{let{run_id:e}=await iq({sql_template:x},{nowait:!0});return p(e),await eb(e)},{mutate:w,isPending:k}=(0,tb.D)({mutationFn:b});return(0,i.jsx)(et.u_,{isOpen:n,size:"full",onClose:()=>{t(),u(),f()},children:(0,i.jsxs)(er.h,{height:"100%",children:[(0,i.jsx)(el.x,{height:"40px",bg:"rgb(77, 209, 176)",px:0,py:4,children:(0,i.jsxs)(o.k,{alignItems:"center",height:"100%",gap:"10px",children:[(0,i.jsx)(a.E,{boxSize:"20px",ml:"18px",src:"/logo/recce-logo-white.png",alt:"recce-logo-white"}),(0,i.jsx)(c.X,{as:"h1",fontFamily:'"Montserrat", sans-serif',fontSize:"lg",color:"white",children:"RECCE"}),(0,i.jsx)(d.C,{fontSize:"sm",color:"white",colorScheme:"whiteAlpha",variant:"outline",children:"Experiment"})]})}),(0,i.jsx)(eA.o,{}),(0,i.jsx)(es.f,{p:0,children:(0,i.jsxs)(tO,{sizes:s?[50,50]:[100,0],minSize:s?100:0,gutterSize:s?5:0,style:{flex:"1",contain:"size",height:"100%"},children:[(0,i.jsx)(r.x,{p:0,style:{contain:"content"},children:(0,i.jsxs)(o.k,{direction:"column",height:"100%",m:0,p:0,children:[(0,i.jsx)(iW,{current:l}),(0,i.jsx)(t1,{value:x,onChange:m,onRun:()=>{w(),h()},labels:["base (production)","current (".concat(j,")")],BaseEnvironmentSetupGuide:(0,i.jsx)(iP,{})})]})}),s?(0,i.jsx)(iF,{onClose:u,disableAddToChecklist:!0}):(0,i.jsx)(r.x,{})]})})]})})}var iB=t(95591),iJ=t(39516),iU=t(43746);let iQ=e=>{let{defaultValues:n,suggestionList:t,onValuesChange:l,isDisabled:o}=e,[a,c]=(0,v.useState)(n||[]),[d,u]=(0,v.useState)(""),[h,x]=(0,v.useState)(!1),m=(0,v.useRef)(null),p=e=>{a.includes(e)||(u(""),c([...a,e]),l([...a,e]))};if(o)return(0,i.jsx)(nT.u,{label:ib.audit_helper,children:(0,i.jsx)(nN.I,{size:"xs",disabled:!0,placeholder:"Unavailable"})});let f=(null==t?void 0:t.filter(e=>""===d||e.includes(d)).filter(e=>!a.includes(e)))||[];return(0,i.jsxs)(iB.B,{size:e.size,width:e.width,children:[(0,i.jsxs)(nV.v,{isLazy:!0,closeOnSelect:!1,onOpen:()=>{var e;return null===(e=m.current)||void 0===e?void 0:e.focus()},children:[(0,i.jsxs)(nP.j,{width:"100%",children:[(0,i.jsx)(nN.I,{placeholder:e.placeholder,size:e.size,borderRadius:"4px",value:a.length>1?"".concat(a.length," ").concat(e.unitName,"s selected"):1===a.length?a[0]:"",onChange:()=>{},backgroundColor:"white"}),0===a.length&&(0,i.jsx)(iJ.x,{children:(0,i.jsx)(s.J,{as:tF.RiI,color:"blue.500",fontSize:e.size,mt:"1",mr:"6"})})]}),(0,i.jsx)(nK.h,{children:(0,i.jsxs)(nB.q,{zIndex:"popover",fontSize:e.size,width:e.width,children:[(0,i.jsx)(nJ.k,{children:(0,i.jsxs)(iU.E,{border:"1px solid #e2e8f0",borderRadius:"4px",width:"calc(100% - 8px)",marginX:"4px",padding:"4px",children:[a.map((n,t)=>(0,i.jsx)(iU.U,{children:(0,i.jsxs)(ts.Vp,{size:e.size,children:[(0,i.jsx)(ts.Sn,{paddingLeft:"8px",children:n}),(0,i.jsx)(ts.SD,{paddingRight:"8px",onClick:()=>{c(a.filter(e=>e!==n)),l(a.filter(e=>e!==n))}})]},n)},"tag-".concat(t))),(0,i.jsx)(iU.U,{width:"100%",children:(0,i.jsx)(nN.I,{ref:m,placeholder:"Filter or add custom keys",variant:"unstyled",size:e.size,value:d,onChange:e=>{u(e.target.value),x(!0)},onKeyDown:e=>{let n=e.currentTarget.value.trim().replace(",","");switch(e.key){case",":case"Enter":p(n),u("");break;case"Backspace":""===e.currentTarget.value&&a.length>0&&(c(a.slice(0,-1)),l(a.slice(0,-1)))}},onBlur:()=>{var e;m&&h&&(null===(e=m.current)||void 0===e||e.focus())}})})]})}),(0,i.jsx)(to.R,{}),(0,i.jsxs)(nJ.k,{children:[""!==d&&!(null==t?void 0:t.includes(d))&&(0,i.jsxs)(nU.s,{onClick:()=>{p(d),x(!1)},children:["Add '",d,"' to the list"]},"custom-value-by-filter"),f.map((e,n)=>(0,i.jsx)(nU.s,{onClick:()=>{p(e)},children:e},"option-".concat(n))).slice(0,10),f.length>10&&(0,i.jsx)(nT.u,{label:"Please use filter to find more items",placement:"top",children:(0,i.jsxs)(r.x,{px:"12px",color:"gray",fontSize:"8pt",children:["and ",f.length-10," more items..."]})})]})]})})]}),a.length>0&&(0,i.jsx)(iJ.x,{children:(0,i.jsx)(ec.z,{variant:"link",color:"#3182CE",fontSize:e.size,paddingTop:"4px",paddingRight:"24px",onClick:()=>{u(""),c([]),l([])},children:"Clear"})})]})},iZ=e=>{let{defaultPrimaryKeys:n,onPrimaryKeysChange:t,...r}=e,{lineageGraph:l,isActionAvailable:s}=eD(),a=(0,v.useMemo)(()=>{if(!l)return[];let e=new Set;for(let i in l.nodes){var n,t;let r=l.nodes[i],s=null===(n=r.data.base)||void 0===n?void 0:n.columns,o=null===(t=r.data.current)||void 0===t?void 0:t.columns;for(let n in s)e.add(n);for(let n in o)e.add(n)}return Array.from(e).sort()},[l]);return(0,i.jsx)(o.k,{...r,children:(0,i.jsxs)(eq.NI,{m:"4px 8px",children:[(0,i.jsxs)(eH.l,{fontSize:"8pt",margin:"0",children:["Diff with Primary Key(s) (suggested)"," ",(0,i.jsx)(nT.u,{label:"Provide a primary key to perform query diff in data warehouse and only return changed rows.",placement:"bottom-end",children:(0,i.jsx)(it.s,{color:"gray.600",boxSize:"3"})})]}),(0,i.jsx)(iQ,{unitName:"key",defaultValues:n,suggestionList:a,onValuesChange:t,size:"xs",width:"240px",placeholder:"Select or type to add keys",isDisabled:!s("query_diff_with_primary_key")})]})})};var iX=t(38542);function iG(e){let{description:n,onLike:t,onDislike:r,onClickLink:s,externalLink:c,externalLinkText:d}=e;return(0,i.jsxs)(o.k,{gap:4,justifyContent:"center",alignContent:"center",alignItems:"center",children:[n,(0,i.jsx)(nW.h,{"aria-label":"thumbs up",variant:"ghost",icon:(0,i.jsx)(a.E,{src:"/imgs/feedback/thumbs-up.png",alt:"like"}),width:"32px",height:"32px",onClick:t}),(0,i.jsx)(nW.h,{"aria-label":"thumbs down",variant:"ghost",icon:(0,i.jsx)(a.E,{src:"/imgs/feedback/thumbs-down.png",alt:"dislike"}),width:"32px",height:"32px",onClick:r}),c&&d&&(0,i.jsx)(l.r,{href:c,isExternal:!0,textDecoration:"underline",onClick:s,children:d})]})}let iY="recce-",i$={bypassSaveOverwrite:"".concat(iY,"-bypass-save-overwrite"),previewChangeFeedbackID:"".concat(iY,"-preview-change-feedback"),prepareEnvGuideID:"".concat(iY,"-prepare-env")};var i0=t(13888),i1=t(89875),i5=t(43510),i2=t(15799),i4=t(49676),i6=t(38600),i3=t(19531),i9=t(85160);let i8=e=>(0,i.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,i.jsx)("g",{clipPath:"url(#clip0_1479_25070)",children:(0,i.jsx)("path",{d:"M15.625 0.25H14.759C14.5484 0.25 14.3791 0.423375 14.3841 0.633937L14.4575 3.71441C13.0691 1.62634 10.6955 0.25 8 0.25C4.21291 0.25 1.06041 2.96638 0.38425 6.557C0.340875 6.78728 0.518875 7 0.753219 7H1.64622C1.82353 7 1.97566 6.87556 2.013 6.70222C2.60753 3.9415 5.05991 1.875 8 1.875C10.4858 1.875 12.6232 3.35256 13.5836 5.47819L9.63394 5.38416C9.42341 5.37916 9.25 5.54844 9.25 5.75906V6.625C9.25 6.83209 9.41791 7 9.625 7H15.625C15.8321 7 16 6.83209 16 6.625V0.625C16 0.417906 15.8321 0.25 15.625 0.25ZM15.2468 9H14.3538C14.1765 9 14.0243 9.12444 13.987 9.29778C13.3925 12.0585 10.9401 14.125 8 14.125C5.51419 14.125 3.37681 12.6474 2.41637 10.5218L6.36606 10.6158C6.57659 10.6208 6.75 10.4516 6.75 10.2409V9.375C6.75 9.16791 6.58209 9 6.375 9H0.375C0.167906 9 0 9.16791 0 9.375V15.375C0 15.5821 0.167906 15.75 0.375 15.75H1.24097C1.45156 15.75 1.62088 15.5766 1.61588 15.3661L1.54253 12.2856C2.93087 14.3737 5.3045 15.75 8 15.75C11.7871 15.75 14.9396 13.0336 15.6158 9.443C15.6591 9.21272 15.4811 9 15.2468 9Z",fill:"currentColor"})}),(0,i.jsx)("defs",{children:(0,i.jsx)("clipPath",{id:"clip0_1479_25070",children:(0,i.jsx)("rect",{width:"16",height:"16",fill:"white"})})})]}),i7=e=>(0,i.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,i.jsx)("g",{clipPath:"url(#clip0_1479_25102)",children:(0,i.jsx)("path",{d:"M-1.88399 8.72062L0.358816 6.46094C0.594752 6.22344 1.00006 6.39031 1.00006 6.725V8.2525H4.00005V4.12438C4.00005 3.7275 4.16161 3.34313 4.44286 3.06219L7.06441 0.440625C7.34566 0.159375 7.72691 0 8.12347 0H14.5003C15.3281 0.003125 16 0.675 16 1.50281V14.5003C16 15.3281 15.3281 16 14.5003 16H5.50223C4.67411 16 4.00005 15.3281 4.00005 14.5003V11.2522H5.50005V14.5003H14.5003V1.50281H9.50128V4.75219C9.50128 5.16781 9.1669 5.50187 8.75128 5.50187H5.50005V8.25219H10.625C10.8322 8.25219 11 8.42 11 8.62719V9.37719C11 9.58438 10.8322 9.75219 10.625 9.75219H1.00006V11.2797C1.00006 11.6144 0.594752 11.7813 0.358816 11.5438L-1.88399 9.28406C-2.03867 9.12813 -2.03867 8.87656 -1.88399 8.72062ZM8.0016 4.00219V1.62469L5.62379 4.00219H8.0016Z",fill:"currentColor"})}),(0,i.jsx)("g",{clipPath:"url(#clip1_1479_25102)",children:(0,i.jsx)("path",{d:"M0.103056 8.72062L2.09667 6.46094C2.30639 6.22344 2.66667 6.39031 2.66667 6.725V8.2525H5.33333V4.12438C5.33333 3.7275 5.47694 3.34313 5.72694 3.06219L8.05722 0.440625C8.30722 0.159375 8.64611 0 8.99861 0H14.6669C15.4028 0.003125 16 0.675 16 1.50281V14.5003C16 15.3281 15.4028 16 14.6669 16H6.66861C5.9325 16 5.33333 15.3281 5.33333 14.5003V11.2522H6.66667V14.5003H14.6669V1.50281H10.2233V4.75219C10.2233 5.16781 9.92611 5.50187 9.55667 5.50187H6.66667V8.25219H11.2222C11.4064 8.25219 11.5556 8.42 11.5556 8.62719V9.37719C11.5556 9.58438 11.4064 9.75219 11.2222 9.75219H2.66667V11.2797C2.66667 11.6144 2.30639 11.7813 2.09667 11.5438L0.103056 9.28406C-0.0344448 9.12813 -0.0344448 8.87656 0.103056 8.72062ZM8.89028 4.00219V1.62469L6.77666 4.00219H8.89028Z",fill:"currentColor"})}),(0,i.jsxs)("defs",{children:[(0,i.jsx)("clipPath",{id:"clip0_1479_25102",children:(0,i.jsx)("rect",{width:"13",height:"16",fill:"white",transform:"matrix(-1 0 0 1 16 0)"})}),(0,i.jsx)("clipPath",{id:"clip1_1479_25102",children:(0,i.jsx)("rect",{width:"3",height:"16",fill:"white"})})]})]}),re=e=>(0,i.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,i.jsx)("g",{clipPath:"url(#clip0_1426_8619)",children:(0,i.jsx)("path",{d:"M15.5572 3.06188L12.9356 0.440625C12.6544 0.159375 12.2731 0 11.8766 0H5.49969C4.67188 0.003125 4 0.675 4 1.50281V8.25219H0.375C0.167812 8.25219 0 8.42 0 8.62719V9.37719C0 9.58438 0.167812 9.75219 0.375 9.75219H9V11.2797C9 11.6144 9.40531 11.7812 9.64125 11.5437L11.8841 9.28406C12.0388 9.12813 12.0388 8.87656 11.8841 8.72062L9.64125 6.46094C9.40531 6.22344 9 6.39031 9 6.725V8.2525H5.49969V1.50281H10.4987V4.75219C10.4987 5.16781 10.8331 5.50187 11.2487 5.50187H14.5V14.5003H5.49969V11.2522H4V14.5003C4 15.3281 4.67188 16 5.49969 16H14.4978C15.3259 16 16 15.3281 16 14.5003V4.12406C16 3.7275 15.8384 3.34313 15.5572 3.06188ZM11.9984 4.00219V1.62469L14.3763 4.00219H11.9984Z",fill:"black"})}),(0,i.jsx)("defs",{children:(0,i.jsx)("clipPath",{id:"clip0_1426_8619",children:(0,i.jsx)("rect",{width:"16",height:"16",fill:"white"})})})]}),rn=e=>(0,i.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,i.jsx)("path",{d:"M14.5607 4.06066L11.9393 1.43934C11.658 1.15804 11.2765 1 10.8787 1H2.5C1.67156 1 1 1.67156 1 2.5V13.5C1 14.3284 1.67156 15 2.5 15H13.5C14.3284 15 15 14.3284 15 13.5V5.12131C15 4.72349 14.842 4.34196 14.5607 4.06066ZM9.5 2.5V5H5.5V2.5H9.5ZM13.3125 13.5H2.6875C2.63777 13.5 2.59008 13.4802 2.55492 13.4451C2.51975 13.4099 2.5 13.3622 2.5 13.3125V2.6875C2.5 2.63777 2.51975 2.59008 2.55492 2.55492C2.59008 2.51975 2.63777 2.5 2.6875 2.5H4V5.75C4 6.16422 4.33578 6.5 4.75 6.5H10.25C10.6642 6.5 11 6.16422 11 5.75V2.62131L13.4451 5.06641C13.4625 5.08382 13.4763 5.10449 13.4857 5.12724C13.4952 5.14999 13.5 5.17438 13.5 5.199V13.3125C13.5 13.3622 13.4802 13.4099 13.4451 13.4451C13.4099 13.4802 13.3622 13.5 13.3125 13.5ZM8 7.25C6.48366 7.25 5.25 8.48366 5.25 10C5.25 11.5163 6.48366 12.75 8 12.75C9.51634 12.75 10.75 11.5163 10.75 10C10.75 8.48366 9.51634 7.25 8 7.25ZM8 11.25C7.31075 11.25 6.75 10.6892 6.75 10C6.75 9.31075 7.31075 8.75 8 8.75C8.68925 8.75 9.25 9.31075 9.25 10C9.25 10.6892 8.68925 11.25 8 11.25Z",fill:"currentColor"})}),rt=e=>(0,i.jsx)("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,i.jsx)("path",{d:"M15.9143 1.75812L14.7422 0.585938C14.3515 0.195312 13.8397 0 13.3278 0C12.8159 0 12.304 0.195312 11.9137 0.585625L9.58593 2.91344L8.5 3.99938L0.901592 11.5975L0.504719 15.1669C0.454719 15.6163 0.80878 16 1.24847 16C1.27628 16 1.3044 15.9984 1.33253 15.9953L4.89939 15.6012L12.5006 8L13.5862 6.91437L15.914 4.58656C16.6953 3.80531 16.6953 2.53906 15.9143 1.75812ZM4.21095 14.1684L2.09909 14.4016L2.3344 12.2863L9.56062 5.06L10.53 4.09062L12.4094 5.97L11.44 6.93937L4.21095 14.1684ZM14.8534 3.52562L13.4697 4.90938L11.5906 3.03L12.9744 1.64625C13.1019 1.51875 13.2506 1.49969 13.3278 1.49969C13.405 1.49969 13.554 1.51875 13.6812 1.64625L14.8534 2.81844C15.0484 3.01375 15.0484 3.33094 14.8534 3.52562Z",fill:"currentColor"})}),ri=e=>(0,i.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,i.jsx)("path",{d:"M7.26326 6.5462H8.71794V12.3642H7.26326V6.5462ZM7.9906 3.1102C7.43278 3.1102 6.97888 3.5641 6.97888 4.12192C6.97888 4.67974 7.43278 5.13364 7.9906 5.13364C8.54842 5.13364 9.00232 4.67974 9.00232 4.12192C9.00232 3.5641 8.54842 3.1102 7.9906 3.1102ZM16 8C16 12.411 12.411 16 8 16C3.589 16 0 12.411 0 8C0 3.589 3.589 0 8 0C12.411 0 16 3.589 16 8ZM14.5453 8C14.5453 4.3906 11.6093 1.4546 7.99992 1.4546C4.39052 1.4546 1.45452 4.3914 1.45452 8.0006C1.45452 11.6098 4.39052 14.546 7.99992 14.546C11.6093 14.546 14.5453 11.6092 14.5453 8.0006V8Z",fill:"currentColor"})});function rr(e){let n=(0,i9.D)(e);return(0,iR.WU)(n,"yyyy-MM-dd'T'HH:mm:ss")}function rl(e){return Object.values(e).every(e=>null===e)?[(0,i.jsx)(o.k,{ml:"10px",children:"No information"},"no info")]:Object.entries(e).filter(e=>{let[n,t]=e;return"url"!==n&&null!=t}).map(e=>{let[n,t]=e;return(0,i.jsxs)(tA.HC,{ml:"10px",children:[n,": ",t]},n)})}function rs(){var e,n,t,r,a,d;let{envInfo:u,reviewMode:h,lineageGraph:x}=eD(),{isOpen:m,onOpen:p,onClose:f}=(0,en.q)(),g=null==u?void 0:u.git,j=null==u?void 0:u.pullRequest,v={...g,...j},y=null==u?void 0:null===(e=u.dbt)||void 0===e?void 0:e.base,b=null==u?void 0:null===(n=u.dbt)||void 0===n?void 0:n.current,w=(null==y?void 0:y.generated_at)?rr(y.generated_at):"",k=(null==b?void 0:b.generated_at)?rr(b.generated_at):"",C=new Set,_=new Set;if(null==x?void 0:x.nodes)for(let e of Object.values(x.nodes))(null===(a=e.data.base)||void 0===a?void 0:a.schema)&&C.add(e.data.base.schema),(null===(d=e.data.current)||void 0===d?void 0:d.schema)&&_.add(e.data.current.schema);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(nT.u,{label:"Environment Info",placement:"bottom-end",children:(0,i.jsx)(nW.h,{size:"sm",variant:"unstyled","aria-label":"Export state",onClick:p,icon:(0,i.jsx)(s.J,{verticalAlign:"middle",as:ri,boxSize:"16px"})})}),(0,i.jsxs)(et.u_,{isOpen:m,onClose:f,size:"3xl",children:[(0,i.jsx)(ei.Z,{}),(0,i.jsxs)(er.h,{children:[(0,i.jsx)(el.x,{children:"Environment Information"}),(0,i.jsx)(eA.o,{}),(0,i.jsx)(es.f,{children:(0,i.jsxs)(o.k,{direction:"column",gap:"5px",children:[h?(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(o.k,{justifyContent:"left",gap:"5px",direction:"column",children:[(0,i.jsx)(c.X,{size:"sm",children:"Review Information"}),(0,i.jsxs)(tA.QI,{spacing:1,children:[v.url&&(0,i.jsxs)(tA.HC,{ml:"10px",children:["url:"," ",(0,i.jsx)(l.r,{href:v.url,color:"blue.500",isExternal:!0,children:v.url})]}),v&&rl(v)]})]})}):(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(o.k,{justifyContent:"left",gap:"5px",direction:"column",children:[(0,i.jsx)(c.X,{size:"sm",children:"Dev Information"}),(0,i.jsx)(tA.QI,{spacing:1,children:g&&rl(g)})]})}),(0,i.jsx)(nL.i,{}),(null==u?void 0:u.adapterType)==="dbt"&&(0,i.jsxs)(o.k,{justifyContent:"left",gap:"5px",direction:"column",children:[(0,i.jsx)(c.X,{size:"sm",children:"DBT"}),(0,i.jsx)(i0.x,{children:(0,i.jsxs)(i1.i,{variant:"simple",children:[(0,i.jsx)(i5.h,{children:(0,i.jsxs)(i2.Tr,{children:[(0,i.jsx)(i4.Th,{}),(0,i.jsx)(i4.Th,{children:"base"}),(0,i.jsx)(i4.Th,{children:"current"})]})}),(0,i.jsxs)(i6.p,{children:[(0,i.jsxs)(i2.Tr,{children:[(0,i.jsx)(i3.Td,{children:"schema"}),(0,i.jsx)(i3.Td,{children:JSON.stringify(Array.from(C))}),(0,i.jsx)(i3.Td,{children:JSON.stringify(Array.from(_))})]}),(0,i.jsxs)(i2.Tr,{children:[(0,i.jsx)(i3.Td,{children:"version"}),(0,i.jsx)(i3.Td,{children:null==y?void 0:y.dbt_version}),(0,i.jsx)(i3.Td,{children:null==b?void 0:b.dbt_version})]}),(0,i.jsxs)(i2.Tr,{children:[(0,i.jsx)(i3.Td,{children:"timestamp"}),(0,i.jsx)(i3.Td,{children:w}),(0,i.jsx)(i3.Td,{children:k})]})]})]})})]}),(null==u?void 0:u.adapterType)==="sqlmesh"&&(0,i.jsxs)(o.k,{justifyContent:"left",gap:"5px",direction:"column",children:[(0,i.jsx)(c.X,{size:"sm",children:"SQLMesh"}),(0,i.jsx)(i0.x,{children:(0,i.jsxs)(i1.i,{variant:"simple",children:[(0,i.jsx)(i5.h,{children:(0,i.jsxs)(i2.Tr,{children:[(0,i.jsx)(i4.Th,{}),(0,i.jsx)(i4.Th,{children:"base"}),(0,i.jsx)(i4.Th,{children:"current"})]})}),(0,i.jsx)(i6.p,{children:(0,i.jsxs)(i2.Tr,{children:[(0,i.jsx)(i3.Td,{children:"Environment"}),(0,i.jsx)(i3.Td,{children:null===(t=u.sqlmesh)||void 0===t?void 0:t.base_env}),(0,i.jsx)(i3.Td,{children:null===(r=u.sqlmesh)||void 0===r?void 0:r.current_env})]})})]})})]})]})}),(0,i.jsx)(ea.m,{children:(0,i.jsx)(ec.z,{colorScheme:"blue",mr:3,onClick:f,children:"Close"})})]})]})]})}function ro(e){let{current:n,primaryKeys:t,setPrimaryKeys:l,onRunResultOpen:a,runQuery:d,isPending:u}=e;return(0,i.jsxs)(o.k,{justifyContent:"right",alignItems:"center",padding:"4pt 8pt",gap:"5px",height:"54px",borderBottom:"1px solid lightgray",flex:"0 0 54px",children:[(0,i.jsxs)(r.x,{children:[(0,i.jsxs)(c.X,{as:"h2",size:"md",display:"flex",alignItems:"center",gap:"5px",children:[(0,i.jsx)(s.J,{as:iN.vc4,boxSize:"1.2em"}),"Sandbox"]}),(0,i.jsxs)(eo.x,{fontSize:"xs",color:"gray.500",children:["Compare the run results based on the modified SQL code of model ",(0,i.jsx)("b",{children:null==n?void 0:n.name})]})]}),(0,i.jsx)(h.L,{}),(0,i.jsx)(iZ,{defaultPrimaryKeys:t,onPrimaryKeysChange:l}),(0,i.jsx)(nT.u,{label:"Run diff to see the changes",children:(0,i.jsx)(ec.z,{size:"xs",marginTop:"16px",fontSize:"14px",onClick:()=>{a(),d()},colorScheme:"blue",isLoading:u,children:"Run Diff"})})]})}function ra(e){var n,t,r;let{currentModelID:l,height:s="32px",flex:a="0 0 auto"}=e,{lineageGraph:c,envInfo:d}=eD(),u="0 16px",h=rr((null==d?void 0:null===(t=d.dbt)||void 0===t?void 0:null===(n=t.current)||void 0===n?void 0:n.generated_at)||""),x=(0,t6.Q)(h,{addSuffix:!0}),m="N/A";if(null==c?void 0:c.nodes[l]){let e=c.nodes[l];(null===(r=e.data.current)||void 0===r?void 0:r.schema)&&(m=e.data.current.schema)}return(0,i.jsxs)(o.k,{gap:0,height:s,flex:a,fontSize:"14px",align:"center",margin:"0",backgroundColor:"#EDF2F880",children:[(0,i.jsx)(tY.K,{width:"50%",children:(0,i.jsxs)(eo.x,{as:"b",margin:u,children:["ORIGINAL (Schema: ",m,", Last Updated: ",x,")"]})}),(0,i.jsx)(tY.K,{width:"50%",children:(0,i.jsx)(eo.x,{as:"b",margin:u,children:"SANDBOX EDITOR"})})]})}function rc(e){let{isOpen:n,onClose:t,current:s}=e,{isOpen:h,onClose:x,onOpen:m}=(0,en.q)(),[p,f]=(0,v.useState)((null==s?void 0:s.raw_code)||""),{showRunId:g,clearRunResult:j}=n2(),{primaryKeys:y,setPrimaryKeys:b}=_(),{data:w,isLoading:k}=eL(),C=async()=>{let e={current_model:(null==s?void 0:s.name)||"",primary_keys:y,sql_template:p},{run_id:n}=await iV(e,{nowait:!0});return g(n),await eb(n)},{mutate:S,isPending:z}=(0,tb.D)({mutationFn:C,onSuccess(e,n){e.error?ep({action:"run",node:null==s?void 0:s.name,status:"failure"}):(ep({action:"run",node:null==s?void 0:s.name,status:"success"}),setTimeout(()=>{R()},1e3),!k&&(null==w?void 0:w.single_env_onboarding)&&setTimeout(()=>{L()},2e3))}}),{feedbackToast:R,closeToast:T}=function(e){let n=(0,ee.p)(),{feedbackId:t,description:r,onFeedbackSubmit:l,externalLink:s,externalLinkText:o}=e;return{feedbackToast:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],a=localStorage.getItem(t);!n.isActive(t)&&("true"!==a||e)&&n({id:t,position:"bottom-right",duration:null,render:e=>{let{id:n,onClose:a}=e;return(0,i.jsx)(tz.b,{status:"success",variant:"subtle",zIndex:"toast",borderColor:"gray.200",borderWidth:3,borderRadius:"md",backgroundColor:"white",opacity:1,children:(0,i.jsx)(iX.X,{fontSize:"md",children:(0,i.jsxs)(u.U,{children:[(0,i.jsx)(iG,{description:r,onLike:()=>{l("like"),a(),localStorage.setItem(t,"true")},onDislike:()=>{l("dislike"),a(),localStorage.setItem(t,"true")},externalLink:s,externalLinkText:o,onClickLink:()=>{l("link")}}),(0,i.jsx)(ig.P,{onClick:()=>{a()}})]})})})}})},closeToast:()=>{n.closeAll()}}}({feedbackId:i$.previewChangeFeedbackID,description:"Enjoy preview change?",onFeedbackSubmit:e=>{switch(e){case"like":ef({feedback:"like",node:null==s?void 0:s.name});break;case"dislike":ef({feedback:"dislike",node:null==s?void 0:s.name});break;case"link":ef({feedback:"form",node:null==s?void 0:s.name});break;default:console.log("Not support feedback type")}},externalLink:"https://docs.google.com/forms/d/e/1FAIpQLSd7Lei7Ijwo7MinWaI0K6rzZi_21gV1BKetmiNEX254kDziDA/viewform?usp=header",externalLinkText:"Give us feedback"}),{guideToast:L,closeGuideToast:I}=function(e){let n=(0,ee.p)(),{guideId:t,description:r,externalLink:s,externalLinkText:o,onExternalLinkClick:a}=e;return{guideToast:function(){n.isActive(t)||n({id:t,position:"bottom-right",duration:3e3,description:"some text",render:e=>{let{id:n,onClose:t}=e;return(0,i.jsx)(tz.b,{status:"success",variant:"subtle",zIndex:"toast",borderColor:"gray.200",borderWidth:3,borderRadius:"md",backgroundColor:"white",opacity:1,children:(0,i.jsx)(iX.X,{fontSize:"md",children:(0,i.jsxs)(u.U,{children:[(0,i.jsxs)(eo.x,{children:[r," ",(0,i.jsx)(l.r,{textDecor:"underline",isExternal:!0,href:s,onClick:()=>{a&&a(),t()},children:o})]}),(0,i.jsx)(ig.P,{onClick:()=>{t()}})]})})})}})},closeGuideToast:()=>{n.closeAll()}}}({guideId:i$.prepareEnvGuideID,description:"Want to compare data changes with production data?",externalLink:"https://datarecce.io/docs/get-started/#prepare-dbt-artifacts",externalLinkText:"Learn how.",onExternalLinkClick:()=>{eg({action:"external_link",from:"preview_changes",node:null==s?void 0:s.name})}});return(0,v.useEffect)(()=>{n&&f((null==s?void 0:s.raw_code)||"")},[n,s]),(0,i.jsx)(et.u_,{isOpen:n,size:"full",onClose:()=>{t(),x(),j(),T(),I(),ep({action:"close",node:null==s?void 0:s.name})},children:(0,i.jsxs)(er.h,{height:"100%",children:[(0,i.jsx)(el.x,{height:"40px",bg:"rgb(77, 209, 176)",px:0,py:4,children:(0,i.jsxs)(o.k,{alignItems:"center",height:"100%",gap:"10px",children:[(0,i.jsx)(a.E,{boxSize:"20px",ml:"18px",src:"/logo/recce-logo-white.png",alt:"recce-logo-white"}),(0,i.jsx)(c.X,{as:"h1",fontFamily:'"Montserrat", sans-serif',fontSize:"lg",color:"white",children:"RECCE"}),(0,i.jsx)(d.C,{fontSize:"sm",color:"white",colorScheme:"whiteAlpha",variant:"outline",children:"Experiment"})]})}),(0,i.jsx)(eA.o,{}),(0,i.jsx)(es.f,{p:0,children:(0,i.jsxs)(tO,{sizes:h?[50,50]:[100,0],minSize:h?100:0,gutterSize:h?5:0,style:{flex:"1",contain:"size",height:"100%"},children:[(0,i.jsxs)(o.k,{direction:"column",height:"100%",m:0,p:0,children:[(0,i.jsx)(ro,{current:s,primaryKeys:null!=y?y:[],setPrimaryKeys:b,onRunResultOpen:m,runQuery:S,isPending:z}),(0,i.jsx)(ra,{height:"32pxs",flex:"0 0 auto",currentModelID:(null==s?void 0:s.id)||""}),(0,i.jsx)(iv,{current:s,onChange:f})]}),h?(0,i.jsx)(iF,{onClose:x,disableAddToChecklist:!0}):(0,i.jsx)(r.x,{})]})}),(0,i.jsx)(r.x,{position:"fixed",bottom:"4",right:"4",opacity:.5,children:(0,i.jsx)(nT.u,{label:"Give us feedback",children:(0,i.jsx)(nW.h,{"aria-label":"feedback",icon:(0,i.jsx)(nr.xJq,{}),variant:"ghost",size:"md",onClick:()=>{R(!0)}})})})]})})}var rd=t(3677);function ru(e){let{node:n,onCloseNode:t}=e,[,l]=(0,eF.TH)(),{setSqlQuery:a,setPrimaryKeys:d}=_(),f="model"===n.resourceType||"seed"===n.resourceType||"source"===n.resourceType||"snapshot"===n.resourceType,{isOpen:g,onOpen:j,onClose:y}=(0,en.q)(),{isOpen:b,onOpen:w,onClose:k}=(0,en.q)(),{isOpen:C,onOpen:S,onClose:z}=(0,en.q)(),{runAction:R}=n2(),{envInfo:T,isActionAvailable:L}=eD(),{primaryKey:I}=eB(n.name),E=()=>{R("row_count_diff",{node_names:[n.name]},{showForm:!1,showLast:!1})},{data:D}=eL(),O=null==D?void 0:D.single_env_onboarding,A=(0,v.useCallback)(async()=>{let e=n.id,t=await iy({node_id:e});l("/checks/".concat(t.check_id))},[n,l]),M=(e,n)=>e?ib.add_or_remove:L(n)?"":"value_diff"===n?ib.audit_helper:"profile_diff"===n?ib.dbt_profiler:"This action is not supported yet.",F="added"===n.changeStatus||"removed"===n.changeStatus;return(0,i.jsxs)(ip.r,{height:"100%",templateRows:"auto auto 1fr",children:[(0,i.jsxs)(u.U,{children:[(0,i.jsx)(r.x,{flex:"0 1 20%",p:"16px",children:(0,i.jsx)(c.X,{size:"sm",children:n.name})}),(0,i.jsx)(h.L,{}),O?(0,i.jsx)(function(){return(0,i.jsx)(ec.z,{as:ec.z,size:"xs",colorScheme:"blue",onClick:()=>{w()},disabled:"base"===n.from,children:"Query"})},{}):(0,i.jsx)(function(){var e,t,r,o,c,u,h,x;return"model"!==n.resourceType&&"seed"!==n.resourceType&&"snapshot"!==n.resourceType?(0,i.jsx)(i.Fragment,{}):(0,i.jsxs)(nV.v,{children:[(0,i.jsx)(nP.j,{as:ec.z,size:"xs",variant:"outline",rightIcon:(0,i.jsx)(rd.v,{}),children:"Explore"}),(0,i.jsxs)(nB.q,{children:[(0,i.jsx)(nU.s,{icon:(0,i.jsx)(s.J,{as:null===(e=n$("query_diff"))||void 0===e?void 0:e.icon}),fontSize:"14px",onClick:()=>{(null==T?void 0:T.adapterType)==="dbt"?a('select * from {{ ref("'.concat(n.name,'") }}')):(null==T?void 0:T.adapterType)==="sqlmesh"&&a("select * from ".concat(n.name)),L("query_diff_with_primary_key")&&d(void 0!==I?[I]:void 0),l("/query")},children:"Query"}),(0,i.jsx)(nU.s,{fontSize:"14px",icon:(0,i.jsx)(s.J,{as:null===(t=n$("sandbox"))||void 0===t?void 0:t.icon}),onClick:()=>{L("query_diff_with_primary_key")&&d(void 0!==I?[I]:void 0),S(),ep({action:"explore",node:n.name})},children:"Sandbox (Experiment)"}),(0,i.jsx)(to.R,{}),(0,i.jsxs)(nJ.k,{title:"Diff",m:"0",p:"4px 12px",children:[("model"===n.resourceType||"snapshot"===n.resourceType)&&(0,i.jsx)(nU.s,{onClick:j,icon:(0,i.jsx)(tM.tvD,{}),fontSize:"14px",children:"Code Diff"}),(0,i.jsx)(nU.s,{icon:(0,i.jsx)(s.J,{as:null===(r=n$("row_count_diff"))||void 0===r?void 0:r.icon}),fontSize:"14px",onClick:()=>{E()},children:"Row Count Diff"}),(0,i.jsx)(nT.u,{label:M(F,"profile_diff"),placement:"left",children:(0,i.jsx)(nU.s,{icon:(0,i.jsx)(s.J,{as:null===(o=n$("profile_diff"))||void 0===o?void 0:o.icon}),fontSize:"14px",isDisabled:F||!L("profile_diff"),onClick:()=>{R("profile_diff",{model:n.name},{showForm:!0,showLast:!1})},children:"Profile Diff"})}),(0,i.jsx)(nT.u,{label:M(F,"value_diff"),placement:"left",children:(0,i.jsx)(nU.s,{icon:(0,i.jsx)(s.J,{as:null===(c=n$("value_diff"))||void 0===c?void 0:c.icon}),fontSize:"14px",isDisabled:F||!L("value_diff"),onClick:()=>{R("value_diff",{model:n.name},{showForm:!0,showLast:!1})},children:"Value Diff"})}),(0,i.jsx)(nT.u,{label:M(F,"top_k_diff"),placement:"left",children:(0,i.jsx)(nU.s,{icon:(0,i.jsx)(s.J,{as:null===(u=n$("top_k_diff"))||void 0===u?void 0:u.icon}),fontSize:"14px",isDisabled:F,onClick:()=>{R("top_k_diff",{model:n.name,column_name:"",k:50},{showForm:!0})},children:"Top-K Diff"})}),(0,i.jsx)(nT.u,{label:M(F,"histogram_diff"),placement:"left",children:(0,i.jsx)(nU.s,{icon:(0,i.jsx)(s.J,{as:null===(h=n$("histogram_diff"))||void 0===h?void 0:h.icon}),fontSize:"14px",isDisabled:F,onClick:()=>{R("histogram_diff",{model:n.name,column_name:"",column_type:""},{showForm:!0})},children:"Histogram Diff"})})]}),(0,i.jsx)(to.R,{}),(0,i.jsx)(nJ.k,{title:"Add to Checklist",m:"0",p:"4px 12px",children:(0,i.jsx)(nU.s,{icon:(0,i.jsx)(s.J,{as:null===(x=n$("schema_diff"))||void 0===x?void 0:x.icon}),fontSize:"14px",onClick:A,children:"Schema Diff"})})]})]})},{}),(0,i.jsx)(r.x,{flex:"0 1 1%",children:(0,i.jsx)(ig.P,{onClick:t})})]}),(0,i.jsx)(r.x,{color:"gray",paddingLeft:"16px",children:(0,i.jsxs)(u.U,{spacing:"8px",children:[(0,i.jsx)(is,{node:n}),("model"===n.resourceType||"snapshot"===n.resourceType||"seed"===n.resourceType)&&(O?(0,i.jsx)(ic,{node:n,onRefresh:()=>{R("row_count",{node_names:[n.name]},{showForm:!1,showLast:!1})}}):(0,i.jsx)(ia,{node:n,onRefresh:E}))]})}),f&&(0,i.jsxs)(x.m,{overflow:"auto",as:o.k,children:[(0,i.jsx)(m.t,{children:(0,i.jsx)(p.O,{children:"Columns"})}),(0,i.jsx)(ta.n,{overflow:"auto",height:"calc(100% - 42px)",children:(0,i.jsx)(tc.x,{p:0,overflowY:"auto",height:"100%",children:O?(0,i.jsx)(tL,{current:n.data.current}):(0,i.jsx)(tT,{base:n.data.base,current:n.data.current})})})]}),(0,i.jsxs)(et.u_,{isOpen:g,onClose:y,size:"6xl",children:[(0,i.jsx)(ei.Z,{}),(0,i.jsxs)(er.h,{overflowY:"auto",height:"75%",children:[(0,i.jsx)(el.x,{children:"Model Raw Code Diff"}),(0,i.jsx)(eA.o,{}),(0,i.jsx)(es.f,{children:(0,i.jsx)(ij,{base:n.data.base,current:n.data.current})})]})]}),(0,i.jsx)(iK,{isOpen:b,onClose:k,current:n.data.current}),(0,i.jsx)(rc,{isOpen:C,onClose:z,current:n.data.current})]})}function rh(e){var n,t;let{onClose:l}=e,{cancel:s,actionState:o}=tk();return(0,i.jsx)(r.x,{bg:"white",rounded:"md",shadow:"dark-lg",children:(0,i.jsxs)(u.U,{p:"5px 15px",mt:"4",divider:(0,i.jsx)(t9.c,{borderColor:"gray.200"}),spacing:4,children:[(0,i.jsxs)(r.x,{fontSize:"10pt",children:["Progress: ","per_node"===o.mode?"".concat(o.completed," / ").concat(o.total):(null===(t=o.currentRun)||void 0===t?void 0:null===(n=t.progress)||void 0===n?void 0:n.percentage)?"".concat(100*o.currentRun.progress.percentage,"%"):"completed"===o.status?"100%":"0%"," ","canceled"===o.status?" (canceled)":""]}),"running"===o.status||"canceling"===o.status?(0,i.jsx)(ec.z,{size:"xs",variant:"outline",onClick:s,isLoading:"canceling"===o.status,loadingText:"Canceling",children:"Cancel"}):(0,i.jsx)(u.U,{children:(0,i.jsx)(ec.z,{size:"xs",variant:"outline",onClick:l,children:"Close"})})]})})}var rx=t(31921),rm=t(3887);let rp=()=>(0,i.jsxs)(nf.g,{align:"start",spacing:0,children:[(0,i.jsx)(eo.x,{fontSize:"10pt",color:"gray.500",pb:1,children:"Select nodes by dbt node selector syntax"}),(0,i.jsxs)(eo.x,{fontSize:"8pt",children:[(0,i.jsx)(rx.E,{fontSize:"8pt",children:"model_name"})," Select a node"]}),(0,i.jsxs)(eo.x,{fontSize:"8pt",children:[(0,i.jsx)(rx.E,{fontSize:"8pt",children:"model_name+"})," Select downstream nodes"]}),(0,i.jsxs)(eo.x,{fontSize:"8pt",children:[(0,i.jsx)(rx.E,{fontSize:"8pt",children:"+model_name"})," Select upstream nodes"]}),(0,i.jsxs)(eo.x,{fontSize:"8pt",children:[(0,i.jsx)(rx.E,{fontSize:"8pt",children:"model*"})," Select by wildcard"]})]}),rf=()=>{let{isHistoryOpen:e,showHistory:n,closeHistory:t}=n2();return(0,i.jsx)(ec.z,{leftIcon:(0,i.jsx)(s.J,{as:nr.M1Q}),size:"xs",variant:"outline",onClick:()=>{e?(em({name:"hide"}),t()):(em({name:"show"}),n())},children:e?"Hide":"Show"})},rg=e=>{let{isDisabled:n}=e,{viewOptions:t,onViewOptionsChanged:r,selectMode:l}=tk(),o=t.view_mode||"changed_models",a=e=>{r({...t,view_mode:e})};return(0,i.jsxs)(nV.v,{children:[(0,i.jsx)(nP.j,{as:ec.z,minWidth:"100px",leftIcon:(0,i.jsx)(s.J,{as:tP("model").icon}),size:"xs",variant:"outline",isDisabled:n,rightIcon:(0,i.jsx)(rd.v,{}),children:"changed_models"===o?"Changed Models":"All"}),(0,i.jsxs)(nB.q,{title:"packages",children:[(0,i.jsx)(nU.s,{as:ng.X,size:"sm",isChecked:"changed_models"===o,onChange:()=>{a("changed_models")},children:"Changed Models"}),(0,i.jsx)(nU.s,{as:ng.X,size:"sm",isChecked:"all"===o,onChange:()=>{a("all")},children:"All"})]})]})},rj=e=>{var n;let{isDisabled:t}=e,{lineageGraph:r}=eD(),{viewOptions:l,onViewOptionsChanged:o}=tk(),a=new Set;for(let e of Object.values((null==r?void 0:r.nodes)||{}))e.packageName&&a.add(e.packageName);let c=null==r?void 0:null===(n=r.manifestMetadata.current)||void 0===n?void 0:n.project_name,d=l.packages?new Set(l.packages):c?new Set([c]):a,u=d.size===a.size,h=0===d.size,x=1===d.size?Array.from(d)[0]:u?"All Packages":h?"No Package":"".concat(d.size," Packages"),m=e=>{let n=new Set(d);n.has(e)?n.delete(e):n.add(e),o({...l,packages:Array.from(n)})};return(0,i.jsxs)(nV.v,{closeOnSelect:!1,children:[(0,i.jsx)(nP.j,{as:ec.z,minWidth:"100px",leftIcon:(0,i.jsx)(s.J,{as:ir.zFh}),size:"xs",variant:"outline",isDisabled:t,rightIcon:(0,i.jsx)(rd.v,{}),children:x}),(0,i.jsx)(nB.q,{title:"packages",children:(0,i.jsxs)(nJ.k,{title:"Select Packages",children:[(0,i.jsx)(nU.s,{as:ng.X,size:"sm",isIndeterminate:!u&&!h,isChecked:u,onChange:()=>{u?o({...l,packages:[]}):o({...l,packages:Array.from(a)})},children:"Select All"}),(0,i.jsx)(to.R,{}),Array.from(a).map(e=>(0,i.jsx)(nU.s,{as:ng.X,size:"sm",isChecked:d.has(e),onChange:()=>{m(e)},children:e},e))]})})]})},rv=e=>{let[n,t]=(0,v.useState)(e.value),{data:r}=eL(),l=(0,v.useRef)(null);return(0,v.useEffect)(()=>{l.current&&(l.current.value=e.value)},[e.value]),(0,i.jsx)(nT.u,{width:"300px",padding:2,shadow:"md",borderWidth:1,rounded:"md",styleConfig:{zIndex:"dropdown"},label:e.tooltipComponent,placement:"bottom-start",defaultIsOpen:!0,color:"black",backgroundColor:"white",closeOnClick:!1,isDisabled:!(null==r?void 0:r.single_env_onboarding),children:(0,i.jsx)(nN.I,{ref:l,height:"24px",fontSize:"10pt",placeholder:"with selectors",isDisabled:e.isDisabled,value:n,onChange:e=>{t(e.target.value)},onKeyUp:i=>{"Enter"===i.key?e.onChange(n):"Escape"===i.key&&(i.preventDefault(),t(e.value),l.current&&l.current.blur())},onBlur:()=>{t(e.value)}})})},ry=e=>{let{isDisabled:n}=e,{viewOptions:t,onViewOptionsChanged:r}=tk();return(0,i.jsx)(rv,{isDisabled:n,value:t.select||"",onChange:e=>{r({...t,select:e||void 0})},tooltipComponent:(0,i.jsx)(rp,{})})},rb=e=>{let{isDisabled:n}=e,{viewOptions:t,onViewOptionsChanged:r}=tk();return(0,i.jsx)(rv,{isDisabled:n,value:t.exclude||"",onChange:e=>{r({...t,exclude:e||void 0})}})},rw=e=>(0,i.jsxs)(r.x,{style:e.style,maxWidth:"300px",children:[(0,i.jsx)(r.x,{fontSize:"8pt",children:e.label||(0,i.jsx)(i.Fragment,{children:"\xa0"})}),e.children]}),rk=()=>{var e,n,t,r,l;let{nodes:o,deselect:a,selectMode:c,...d}=tk(),{isActionAvailable:x}=eD(),m=(0,v.useMemo)(()=>o.filter(e=>e.data.isSelected),[o]),{data:p}=eL(),f=null==p?void 0:p.single_env_onboarding,g="single"===c&&1===m.length,j="multi"===c&&m.length>=1,y="single"===c&&0===m.length,b="single"!==c;return(0,i.jsx)(u.U,{width:"100%",padding:"4pt 8pt",children:(0,i.jsxs)(u.U,{flex:"1",children:[(0,i.jsx)(rw,{label:"History",style:{flexShrink:"1"},children:(0,i.jsx)(rf,{})}),(0,i.jsx)(rw,{label:"Mode",style:{flexShrink:"1"},children:(0,i.jsx)(rg,{isDisabled:b})}),(0,i.jsx)(rw,{label:"Package",style:{flexShrink:"1"},children:(0,i.jsx)(rj,{isDisabled:b})}),(0,i.jsx)(rw,{label:"Select",style:{flex:"100 1 auto"},children:(0,i.jsx)(ry,{isDisabled:b})}),(0,i.jsx)(rw,{label:"Exclude",style:{flex:"100 1 auto"},children:(0,i.jsx)(rb,{isDisabled:b})}),(0,i.jsx)(h.L,{}),"multi"===c&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(rw,{label:"",style:{flexShrink:"0"},children:(0,i.jsx)(eo.x,{fontSize:"9pt",color:"gray.500",children:m.length>1?"".concat(m.length," nodes selected"):"".concat(m.length," node selected")})}),(0,i.jsx)(rw,{label:"",children:(0,i.jsx)(ec.z,{variant:"outline",size:"xs",fontSize:"9pt",isDisabled:"multi"!==c,onClick:()=>{a()},children:"Deselect"})}),f&&(0,i.jsx)(rw,{label:"Explore",children:(0,i.jsx)(rm.h,{isAttached:!0,variant:"outline",children:(0,i.jsxs)(nV.v,{placement:"bottom-end",children:[(0,i.jsx)(nP.j,{as:ec.z,size:"xs",rightIcon:(0,i.jsx)(rd.v,{}),children:"Actions"}),(0,i.jsx)(nB.q,{children:(0,i.jsx)(nU.s,{as:eo.x,size:"sm",fontSize:"10pt",isDisabled:!(y||g||j),icon:(0,i.jsx)(s.J,{as:null===(e=n$("row_count_diff"))||void 0===e?void 0:e.icon}),onClick:()=>{d.runRowCount()},children:"Row Count"})})]})})})]}),!f&&(0,i.jsx)(rw,{label:"Explore",children:(0,i.jsx)(rm.h,{isAttached:!0,variant:"outline",children:(0,i.jsxs)(nV.v,{placement:"bottom-end",children:[(0,i.jsx)(nP.j,{as:ec.z,size:"xs",rightIcon:(0,i.jsx)(rd.v,{}),children:"Actions"}),(0,i.jsxs)(nB.q,{children:[(0,i.jsxs)(nJ.k,{title:"Diff",m:"0",p:"4px 12px",children:[(0,i.jsx)(nU.s,{as:eo.x,size:"sm",fontSize:"10pt",isDisabled:!(y||g||j),icon:(0,i.jsx)(s.J,{as:null===(n=n$("row_count_diff"))||void 0===n?void 0:n.icon}),onClick:()=>{d.runRowCountDiff()},children:"Row Count Diff"}),(0,i.jsx)(nT.u,{label:x("value_diff")?null:ib.audit_helper,placement:"left",children:(0,i.jsx)(nU.s,{as:eo.x,size:"sm",fontSize:"10pt",isDisabled:!(y||g||j)||!x("value_diff"),icon:(0,i.jsx)(s.J,{as:null===(t=n$("value_diff"))||void 0===t?void 0:t.icon}),onClick:()=>{d.runValueDiff()},children:"Value Diff"})})]}),(0,i.jsx)(to.R,{}),(0,i.jsxs)(nJ.k,{title:"Add to Checklist",m:"0",px:"12px",children:[(0,i.jsx)(nU.s,{as:eo.x,size:"sm",fontSize:"10pt",isDisabled:!(y||j&&m.length>1),icon:(0,i.jsx)(s.J,{as:null===(r=n$("lineage_diff"))||void 0===r?void 0:r.icon}),onClick:()=>{d.addLineageDiffCheck(d.viewOptions.view_mode)},children:"Lineage Diff"}),(0,i.jsx)(nU.s,{as:eo.x,size:"sm",fontSize:"10pt",isDisabled:!(y||g||j),icon:(0,i.jsx)(s.J,{as:null===(l=n$("schema_diff"))||void 0===l?void 0:l.icon}),onClick:()=>{d.addSchemaDiffCheck()},children:"Schema Diff"})]})]})]})})})]})})};async function rC(e){return(await X.post("/api/checks",{type:"lineage_diff",params:{},view_options:e})).data}function r_(){return(0,i.jsx)(r.x,{bg:"white",padding:"12px",borderWidth:"1px",borderColor:"gray.200",fontSize:"sm",children:Object.entries({added:["Added","Added resource"],removed:["Removed","Removed resource"],modified:["Modified","Modified resource"]}).map(e=>{let[n,[t,r]]=e,{icon:l,color:a}=tV(n);return(0,i.jsx)(nT.u,{label:r,placement:"right",children:(0,i.jsxs)(o.k,{alignItems:"center",gap:"6px",marginBottom:"2px",children:[(0,i.jsx)(s.J,{color:a,as:l})," ",t]})},n)})})}var rS=t(34379);let rz={mode:"per_node",status:"pending",completed:0,total:0},rR=(e,n)=>{let{onActionStarted:t,onActionNodeUpdated:i,onActionCompleted:r}=n,l=(0,v.useRef)({...rz}).current,{showRunId:s}=n2(),o=async(n,o,a)=>{let c="multi_nodes";l.mode=c,t(),l.status="running";let d=[];for(let n of e){let e=o(n);n.isActionMode=!0,e?(n.action={mode:c,status:"skipped",skipReason:e},i(n)):(n.action={mode:c,status:"pending"},d.push(n))}let u=a(d);try{let{run_id:e}=await ey(n,u,{nowait:!0});for(s(e),l.currentRun={run_id:e},l.total=1;;){let n=await eb(e,2);l.currentRun=n;let t=n.error?"failure":n.result?"success":"running";for(let e of d)e.action={mode:c,status:t,run:n},i(e);if(n.error||n.result)break}}catch(e){}if(l.completed=1,"canceling"===l.status){l.status="canceled",r();return}l.status="completed",r()},a=async(n,s)=>{let o="per_node";for(let n of(l.mode=o,t(),l.status="running",e))n.action={mode:o,status:"pending"},i(n);for(let t of(l.completed=0,l.total=e.length,e)){let{params:e,skipReason:a}=s(t);if(t.isActionMode=!0,a)t.action={mode:o,status:"skipped",skipReason:a},i(t);else try{let{run_id:r}=await ey(n,e,{nowait:!0});for(l.currentRun={run_id:r},t.action={mode:o,status:"running"},i(t);;){let e=await eb(r,2);l.currentRun=e;let n=e.error?"failure":e.result?"success":"running";if(t.action={mode:o,status:n,run:e},i(t),e.error||e.result)break}}catch(e){}finally{l.currentRun=void 0}if(l.completed++,"canceling"===l.status){l.status="canceled",r();return}}l.status="completed",r()},c=async()=>{var e;l.status="canceling",(null===(e=l.currentRun)||void 0===e?void 0:e.run_id)&&await ew(l.currentRun.run_id)};return{actionState:l,runRowCount:async()=>{let n=[];for(let t of e)"model"!==t.resourceType?(t.action={mode:"multi_nodes",status:"skipped",skipReason:"Not a model"},i(t)):n.push(t.name);await o("row_count",e=>{if("model"!==e.resourceType)return"Not a model"},e=>({node_names:e.map(e=>e.name)}))},runRowCountDiff:async()=>{let n=[];for(let t of e)"model"!==t.resourceType?(t.action={mode:"multi_nodes",status:"skipped",skipReason:"Not a model"},i(t)):n.push(t.name);await o("row_count_diff",e=>{if("model"!==e.resourceType)return"Not a model"},e=>({node_names:e.map(e=>e.name)}))},runValueDiff:async()=>{a("value_diff",e=>{var n;let t=null===(n=e.data.current)||void 0===n?void 0:n.primary_key;return t?{params:{model:e.name,primary_key:t}}:{skipReason:"No primary key found. The first unique column is used as primary key."}})},addLineageDiffCheck:async()=>{let n=e.map(e=>e.id);return await rC({node_ids:n})},addSchemaDiffCheck:async()=>{let n;if(1===e.length)n=await iy({node_id:e[0].id});else{let t=e.map(e=>e.id);n=await iy({node_id:t})}return n},cancel:c,reset:()=>{Object.assign(l,rz)}}};var rT=t(53306),rL=function(){let{isOpen:e,onOpen:n,onClose:t}=(0,en.q)(),[l,s]=(0,v.useState)(0),[a,c]=(0,v.useState)(),d=(0,v.useRef)(),u=(0,v.useCallback)(e=>(s(e),new Promise(e=>{c(()=>e),n()})),[n]),h=()=>{null==a||a(!1),t()};return{confirm:u,AlertDialog:(0,i.jsx)(rT.aR,{size:"xl",isOpen:e,leastDestructiveRef:d,onClose:h,children:(0,i.jsx)(ei.Z,{children:(0,i.jsxs)(rT._T,{children:[(0,i.jsxs)(el.x,{fontSize:"lg",fontWeight:"bold",children:["Value Diff on ",l," nodes"]}),(0,i.jsx)(es.f,{gap:"20px",as:o.k,direction:"column",children:(0,i.jsxs)(r.x,{children:["Value diff will be executed on ",l," nodes in the Lineage, which can add extra costs to your bill."]})}),(0,i.jsxs)(ea.m,{children:[(0,i.jsx)(ec.z,{ref:d,onClick:h,children:"Cancel"}),(0,i.jsx)(ec.z,{colorScheme:"blue",onClick:()=>{null==a||a(!0),t()},ml:3,children:"Execute"})]})]})})})}},rI=t(79049),rE=t(65912);let rD="recce",rO={recommendationIgnored:"".concat(rD,"-recommendation-ignored"),recommendationShowed:"".concat(rD,"-recommendation-showed"),prevRefreshTimeStamp:"".concat(rD,"-prev-refresh-timestamp")},rA=()=>{var e;let n=(0,y.a)({queryKey:B.checks(),queryFn:te}),t=(0,v.useMemo)(()=>{if("success"===n.status&&n.data.length>0){let e=n.data.filter(e=>e.is_preset).findLast(e=>"row_count_diff"===e.type);if(e)return e}},[n]),i=(0,y.a)({queryKey:(null==t?void 0:t.check_id)?B.check(t.check_id):[],queryFn:async()=>{if(null==t?void 0:t.check_id)return tn(t.check_id)},enabled:!!(null==t?void 0:t.check_id)}),r=(0,y.a)({queryKey:(null==t?void 0:t.check_id)?[...B.check(t.check_id),"select"]:[],queryFn:async()=>{var e,n;return tI({select:null==t?void 0:null===(e=t.params)||void 0===e?void 0:e.select,exclude:null==t?void 0:null===(n=t.params)||void 0===n?void 0:n.exclude})},enabled:!!(null==t?void 0:null===(e=t.params)||void 0===e?void 0:e.select)}),l=(0,v.useMemo)(()=>{if(t){var e,n;if(null===(e=t.params)||void 0===e?void 0:e.node_names)return t.params.node_names;if(null===(n=t.params)||void 0===n?void 0:n.node_ids)return t.params.node_ids}if("success"===r.status&&r.data)return r.data.nodes},[t,r]);return{recommendedCheck:i.data,selectedNodes:l}},rM=()=>{let{lineageGraph:e,envInfo:n}=eD(),{showRunId:t}=n2(),{data:r}=eL(),l=(0,b.NL)(),{recommendedCheck:s,selectedNodes:a}=rA(),[c,d]=(0,v.useState)(),[x,m]=(0,v.useState)(!1),[p,f]=(0,v.useState)(!1),[g,j]=(0,v.useState)(!1),{isOpen:y,onOpen:w,onClose:k}=(0,en.q)(),C=rO.recommendationIgnored,_=rO.recommendationShowed,S=rO.prevRefreshTimeStamp;(0,v.useEffect)(()=>{sessionStorage.getItem(C)&&f(!0)},[C]),(0,v.useEffect)(()=>{var t,i,r,l,o,c,u,h,x,p;if(!s||!a)return;if(null===(t=s.last_run)||void 0===t?void 0:t.run_id){let e=new Date(s.last_run.run_at).getTime(),t=null==n?void 0:n.dbt,i=Math.max((null==t?void 0:null===(l=t.current)||void 0===l?void 0:l.generated_at)?new Date(t.current.generated_at).getTime():0,(null==t?void 0:null===(o=t.base)||void 0===o?void 0:o.generated_at)?new Date(t.base.generated_at).getTime():0);if(e>=i){m(!0);return}m(!1),j(!0);let r=sessionStorage.getItem(S);(null===r||parseInt(r)!==i)&&(sessionStorage.setItem(S,i.toString()),sessionStorage.removeItem(C),sessionStorage.removeItem(_),f(!1))}let g=n=>n.map(n=>{var t;return null==e?void 0:null===(t=e.nodes[n])||void 0===t?void 0:t.name}).join(", ");if(a.length>0&&a.length<=3){if(null===(c=s.params)||void 0===c?void 0:c.node_names){let e=null===(h=s.params)||void 0===h?void 0:h.node_names.join(", ");d("'".concat(e,"'"))}else if(null===(u=s.params)||void 0===u?void 0:u.node_ids){let e=g(null===(x=s.params)||void 0===x?void 0:x.node_ids);d("'".concat(e,"'"))}else if(a){let e=g(a);d("'".concat(e,"'"))}}else(null==e?void 0:e.modifiedSet.length)===a.length?d("modified and potentially impacted models"):(null===(i=s.params)||void 0===i?void 0:i.select)&&!(null===(r=s.params)||void 0===r?void 0:r.exclude)?d("'".concat(null===(p=s.params)||void 0===p?void 0:p.select,"'")):d("".concat(a.length," models"));if(!sessionStorage.getItem(_)){let e=sessionStorage.getItem(S);sessionStorage.setItem(_,"true"),ej({action:"recommend",from:null===e?"initial":"rerun"})}},[s,a,e,C,_,S,n]);let z=(0,v.useCallback)(async()=>{s&&(t((await ek(s.check_id,{nowait:!0})).run_id),l.invalidateQueries({queryKey:B.check(s.check_id)}))},[s,t,l]);if(!s||!a||(null==r?void 0:r.single_env_onboarding))return(0,i.jsx)(i.Fragment,{});let R=a.length;return!p&&!x&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(u.U,{width:"100%",padding:"2pt 8pt",backgroundColor:"blue.50",children:(0,i.jsxs)(u.U,{flex:"1",fontSize:"10pt",color:"blue.600",children:[g?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(rE.i,{}),(0,i.jsx)(eo.x,{children:"New dbt build detected - Re-run row count checks to maintain result accuracy"})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(rI.h,{}),(0,i.jsxs)(eo.x,{children:["First Check: Perform a row count diff of ",c," for basic impact assessment"]})]}),(0,i.jsx)(h.L,{}),(0,i.jsx)(ec.z,{size:"xs",onClick:()=>{f(!0),sessionStorage.setItem(C,"true"),ej({action:"ignore",from:g?"rerun":"initial",nodes:R})},children:"Ignore"}),(0,i.jsx)(ec.z,{colorScheme:"blue",size:"xs",onClick:()=>{w(),ej({action:"perform",from:g?"rerun":"initial",nodes:R})},children:"Perform"})]})}),(0,i.jsxs)(et.u_,{isOpen:y,onClose:()=>{k(),ej({action:"close",from:g?"rerun":"initial",nodes:R})},isCentered:!0,children:[(0,i.jsx)(ei.Z,{}),(0,i.jsxs)(er.h,{children:[(0,i.jsx)(el.x,{children:"Row Count Check"}),(0,i.jsx)(es.f,{children:(0,i.jsxs)(tY.K,{spacing:"4",children:[(0,i.jsxs)(eo.x,{children:["Perform a row count check of the ",R," node(s) displayed in the lineage diff DAG."]}),(0,i.jsxs)(o.k,{bg:"blue.100",color:"blue.700",children:[(0,i.jsx)(rI.h,{mt:"10px",ml:"5px"}),(0,i.jsx)(eo.x,{margin:"5px",paddingX:"3px",children:"This is a recommended first check based on the preset checks defined in your recce.yml file."})]})]})}),(0,i.jsxs)(ea.m,{gap:"5px",children:[(0,i.jsx)(ec.z,{onClick:()=>{k(),ej({action:"close",from:g?"rerun":"initial",nodes:R})},children:"Cancel"}),(0,i.jsxs)(ec.z,{colorScheme:"blue",onClick:()=>{k(),z(),m(!0),ej({action:"execute",from:g?"rerun":"initial",nodes:R})},children:["Execute on ",R," models"]})]})]})]})]})};var rF=t(20714),rN=t(81030),rq=t(75861),rH=t(14979),rV=t(21986);let rP=e=>{let{enabled:n,onChanged:t}=e,r=eL();return!r.data||r.data.single_env_onboarding?(0,i.jsx)(i.Fragment,{}):(0,i.jsxs)(o.k,{direction:"row",alignItems:"center",gap:"5px",p:"5px 10px",borderRadius:"md",boxShadow:"md",border:"1px solid",borderColor:"gray.200",bg:"white",alignSelf:"flex-start",children:[(0,i.jsx)(rF.r,{isChecked:n,onChange:e=>{t(e.target.checked)},alignItems:"center"}),(0,i.jsx)(o.k,{alignItems:"center",children:(0,i.jsx)(eo.x,{fontSize:"10pt",lineHeight:"1",children:"Breaking Change Analysis"})}),(0,i.jsxs)(rN.J,{trigger:"hover",placement:"top-start",children:[(0,i.jsx)(rq.x,{children:(0,i.jsx)(s.J,{boxSize:"10px",as:rI.h,color:"gray.500",cursor:"pointer"})}),(0,i.jsx)(rH.y,{bg:"black",color:"white",children:(0,i.jsxs)(rV.b,{fontSize:"sm",children:["Breaking changes are determined by analyzing SQL for changes that may impact downstream models."," ",(0,i.jsx)(l.r,{href:"https://datarecce.io/docs/features/breaking-change-analysis/",target:"_blank",textDecoration:"underline",children:"Learn more"}),"."]})})]})]})},rW=e=>{let{transformationType:n,legend:t}=e,r="U",l="red";return"passthrough"===n?(r="P",l="gray"):"renamed"===n?(r="R",l="orange"):"derived"===n?(r="D",l="orange"):"source"===n?(r="S",l="blue"):(r="U",l="red"),(0,i.jsx)(i.Fragment,{children:t?(0,i.jsx)(ts.Vp,{fontSize:"8pt",size:"xs",colorScheme:l,borderRadius:"full",paddingX:"4px",children:(0,i.jsx)(ts.Sn,{children:r})}):(0,i.jsx)(ts.Vp,{fontSize:"6pt",size:"xs",colorScheme:l,borderRadius:"full",paddingX:"2px",children:(0,i.jsx)(ts.Sn,{children:r})})})};var rK=t(99946);let rB=e=>{let{node:n,column:t,reset:r}=e;return(0,i.jsxs)(o.k,{direction:"row",alignItems:"center",gap:"5px",p:"5px 10px",borderRadius:"md",boxShadow:"md",border:"1px solid",borderColor:"gray.200",bg:"white",fontSize:"10pt",children:[(0,i.jsx)(eo.x,{children:"Column Lineage for"}),(0,i.jsxs)(rx.E,{children:[n,".",t]}),(0,i.jsxs)(rN.J,{trigger:"hover",placement:"top-start",children:[(0,i.jsx)(rq.x,{children:(0,i.jsx)(s.J,{boxSize:"10px",as:rI.h,color:"gray.500",cursor:"pointer"})}),(0,i.jsx)(rH.y,{bg:"black",color:"white",children:(0,i.jsxs)(rV.b,{fontSize:"sm",children:["Column-Level Lineage provides visibility into the upstream and downstream relationships of a column."," ",(0,i.jsx)(l.r,{href:"https://datarecce.io/docs/features/column-level-lineage/",target:"_blank",textDecoration:"underline",children:"Learn more"}),"."]})})]}),(0,i.jsx)(nW.h,{icon:(0,i.jsx)(rK.T,{}),"aria-label":"",onClick:r,size:"xs"})]})};function rJ(){return(0,i.jsx)(r.x,{bg:"white",padding:"12px",borderWidth:"1px",borderColor:"gray.200",fontSize:"sm",children:Object.entries({passthrough:["Pass Through","The column is directly selected from the upstream table."],renamed:["Renamed","The column is selected from the upstream table but with a different name."],derived:["Derived","The column is created through transformations applied to upstream columns, such as calculations, conditions, functions, or aggregations."],source:["Source","The column is not derived from any upstream data. It may originate from a seed/source node, literal value, or data generation function."],unknown:["Unknown","We have no information about the transformation type. This could be due to a parse error, or other unknown reason."]}).map(e=>{let[n,[t,r]]=e;return(0,i.jsx)(nT.u,{label:r,placement:"right",children:(0,i.jsxs)(o.k,{alignItems:"center",gap:"6px",marginBottom:"2px",children:[(0,i.jsx)(rW,{legend:!0,transformationType:n})," ",t]})},n)})})}let rU={customNode:function(e){var n,t;let{data:l}=e,{id:a,isHighlighted:c,isSelected:d,resourceType:x,changeStatus:m}=l,p=(0,R.oR)(e=>e.transform[2]>.3),{icon:f}=tP(x),[g,j]=(0,v.useState)(!1),{interactive:y,selectNodeMulti:b,selectMode:w,advancedImpactRadius:k,viewOptions:C}=tk(),{lineageGraph:_}=eD(),S=k&&"modified"===m&&(null==_?void 0:_.nonBreakingSet.has(a)),{icon:z,color:T,backgroundColor:L}=m?tV(m):{icon:void 0,color:"gray.400",backgroundColor:"gray.100"},I=S?"dashed":"solid",E=l.name,D=l.columnSet&&l.columnSet.size>0;return(0,i.jsxs)(o.k,{direction:"column",width:"300px",transition:"box-shadow 0.2s ease-in-out",padding:0,filter:"action_result"===w?l.action?"none":"opacity(0.2) grayscale(50%)":c||d||g?"none":"opacity(0.2) grayscale(50%)",onMouseEnter:()=>{j(!0)},onMouseLeave:()=>{j(!1)},children:[(0,i.jsxs)(o.k,{borderColor:T,borderWidth:"2px",borderStyle:I,borderTopRadius:8,borderBottomRadius:D?0:8,backgroundColor:p?"multi"===w?d?T:"white":"action_result"!==w?d||g?L:"white":l.action?d||g?L:T:"white":d||g?T:L,height:"60px",children:[(0,i.jsx)(o.k,{bg:T,padding:y?"8px":"2px",borderRightWidth:"2px",borderColor:"multi"===w?"#00000020":T,borderStyle:I,alignItems:"top",visibility:p?"inherit":"hidden",children:y&&(0,i.jsx)(ix,{checked:"multi"===w&&d||"action_result"===w&&!!l.action,onClick:e=>{"action_result"!==w&&(e.stopPropagation(),b(l.id))}})}),(0,i.jsxs)(o.k,{flex:"1 0 auto",mx:"1",width:"100px",direction:"column",children:[(0,i.jsxs)(o.k,{width:"100%",textAlign:"left",fontWeight:"600",flex:"1",p:1,gap:"5px",alignItems:"center",visibility:p?"inherit":"hidden",children:[(0,i.jsx)(r.x,{flex:"1",color:"multi"===w?d?"white":"inherit":"action_result"===w&&l.action&&!d?"white":"inherit",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",children:(0,i.jsx)(nT.u,{label:"model"===x?E:"".concat(E," (").concat(x,")"),placement:"top",children:E})}),(0,i.jsx)(s.J,{boxSize:"16px",color:"multi"===w?d?"white":"inherit":"action_result"===w&&l.action&&!d?"white":"inherit",as:f}),z&&(0,i.jsx)(s.J,{color:"multi"===w?d?"white":T:"action_result"===w?l.action&&!d?"white":"inherit":T,as:z})]}),(0,i.jsx)(o.k,{flex:"1 0 auto",mx:"1",direction:"column",paddingBottom:"1",visibility:p?"inherit":"hidden",children:(0,i.jsxs)(u.U,{spacing:"8px",children:["action_result"!==w&&"model"===l.resourceType&&(0,i.jsx)(ih,{id:l.id,inverted:"multi"===w&&!!d}),l.isActionMode&&(l.action?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(h.L,{}),(0,i.jsx)(id,{node:l,action:l.action})]}):(0,i.jsx)(i.Fragment,{}))]})})]})]}),l.columnSet&&l.columnSet.size>0&&(0,i.jsx)(r.x,{p:"10px 20px",borderColor:T,borderWidth:"2px",borderTopWidth:0,borderStyle:I,borderBottomRadius:8,children:(0,i.jsx)(r.x,{height:"".concat(15*l.columnSet.size,"px"),overflow:"auto"})}),Object.keys(null!==(n=l.parents)&&void 0!==n?n:{}).length>0&&(0,i.jsx)(R.HH,{type:"target",position:R.Ly.Left,isConnectable:!1}),Object.keys(null!==(t=l.children)&&void 0!==t?t:{}).length>0&&(0,i.jsx)(R.HH,{type:"source",position:R.Ly.Right,isConnectable:!1})]})},customColumnNode:function(e){var n,t;let{data:l}=e,{name:s}=l.node,{column:a,type:c,transformationType:d}=l,u=(0,R.oR)(e=>e.transform[2]>.3),{viewOptions:x}=tk(),m=null===(n=x.column_level_lineage)||void 0===n?void 0:n.node,p=a===(null===(t=x.column_level_lineage)||void 0===t?void 0:t.column)&&s===m;return u?(0,i.jsxs)(o.k,{width:"280px",height:"16px",padding:"0px 10px",border:"1px solid lightgray",backgroundColor:p?"#f0f0f0":"inherit",_hover:{backgroundColor:"#f0f0f0"},children:[(0,i.jsxs)(o.k,{fontSize:"10px",color:"gray",width:"100%",gap:"3px",alignItems:"center",children:[(0,i.jsx)(rW,{transformationType:d}),(0,i.jsx)(r.x,{children:a}),(0,i.jsx)(h.L,{}),(0,i.jsx)(r.x,{children:c})]}),(0,i.jsx)(R.HH,{type:"target",position:R.Ly.Left,isConnectable:!1,style:{left:0,visibility:"hidden"}}),(0,i.jsx)(R.HH,{type:"source",position:R.Ly.Right,isConnectable:!1,style:{right:0,visibility:"hidden"}})]}):(0,i.jsx)(i.Fragment,{})}},rQ=[],rZ={customEdge:function(e){let{sourceX:n,sourceY:t,targetX:r,targetY:l,sourcePosition:s,targetPosition:o,style:a={},markerEnd:c,data:d}=e,u={...a};(null==d?void 0:d.changeStatus)&&(u.stroke=tV(d.changeStatus).color,u.strokeDasharray="5"),(null==d?void 0:d.isHighlighted)===!1&&(u.filter="opacity(0.2) grayscale(50%)");let[h]=(0,R.OQ)({sourceX:n,sourceY:t,sourcePosition:s,targetX:r,targetY:l,targetPosition:o});return(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(R.u5,{path:h,markerEnd:c,style:{...u,...a}})})}},rX=e=>{var n,t;return(null===(n=e.data)||void 0===n?void 0:n.changeStatus)?tV(null===(t=e.data)||void 0===t?void 0:t.changeStatus).color:"lightgray"},rG=(e,n)=>{let t=e.current,i=(0,v.useRef)({width:0,height:0});(0,v.useEffect)(()=>{let e=new ResizeObserver(e=>{for(let t of e){let e=t.contentRect.width,r=t.contentRect.height;(Math.abs(r-i.current.height)>10||Math.abs(e-i.current.width)>10)&&i.current.height>0&&r>0&&i.current.width>0&&e>0&&n(),i.current={width:e,height:r}}});return t&&e.observe(t),()=>{t&&e.unobserve(t)}},[t,i,n])},rY=()=>{let[,e]=(0,eF.TH)();return(0,v.useCallback)(n=>{n.check_id&&e("/checks/".concat(n.check_id))},[e])},r$=(0,v.forwardRef)(function(e,n){var t,l;let{interactive:a=!1,...c}=e,d=(0,R._K)(),u=(0,v.useRef)(null),{successToast:h,failToast:x}=tZ(),{copyToClipboard:m,ImageDownloadModal:p,ref:f}=iE({renderLibrary:"html-to-image",imageType:"png",shadowEffect:!0,backgroundColor:"white",ignoreElements:e=>{let n=e.className;return!!("string"==typeof n&&n.includes(iI))},onSuccess:()=>{h("Copied the Lineage View as an image to clipboard")},onError:e=>{console.error("Error taking screenshot",e),x("Failed to copy image to clipboard",e)}}),[g,j,y]=(0,R.Rr)(rQ),[b,w,k]=(0,R.ll)([]),{lineageGraph:C,retchLineageGraph:_,isLoading:S,error:z,refetchRunsAggregated:T}=eD(),{runId:I,showRunId:E,closeRunResult:B,runAction:J,isRunResultOpen:U}=n2(),{run:Q}=iw(I),[Z,X]=(0,v.useState)({...c.viewOptions}),G=e=>g.find(n=>n.data.name===e);(0,v.useImperativeHandle)(n,()=>({copyToClipboard:m}));let Y=(0,v.useMemo)(()=>!!C&&C.modifiedSet.length>0,[C]),$=Z.view_mode||"changed_models",[en,et]=(0,v.useState)("single"),ei=(0,v.useMemo)(()=>{var e;if("single"===en)return null===(e=g.find(e=>e.data.isSelected))||void 0===e?void 0:e.data},[en,g]),er=(0,v.useMemo)(()=>g.filter(e=>e.data.isSelected).map(e=>e.data),[g]),el=(0,v.useMemo)(()=>g.map(e=>e.data),[g]),[es,ea]=(0,v.useState)(!1),[ed,eu]=(0,v.useState)({x:0,y:0}),[em,ep]=(0,v.useState)(!1),ef=(0,ee.p)();(0,v.useLayoutEffect)(()=>{(async()=>{let e;if(!C)return;if(Z.node_ids)e=Z.node_ids;else{var n;let t=null===(n=C.manifestMetadata.current)||void 0===n?void 0:n.project_name,i={view_mode:Z.view_mode?Z.view_mode:Y?"changed_models":"all",packages:t?[t]:void 0,...c.viewOptions};X(i),e=(await tI({select:i.select,exclude:i.exclude,packages:i.packages,view_mode:i.view_mode})).nodes}let[t,i]=F(C,e,Z.column_level_lineage),r=A(C);Y&&(r=M(C,em)),[t,i]=q(Array.from(r),t,i),N(t,i),j(t),w(i)})()},[C]);let eg=e=>{let{deselect:n=!1,breakingChangeEnabled:t=!1}=null!=e?e:{},{nodes:i=g,edges:r=b}=null!=e?e:{};if(!C)return;let l=M(C,t);[i,r]=q(Array.from(l),i,r),n&&(i=W(i)),j(i=K(i)),w(r)},ej=e=>{let{deselect:n=!1}=null!=e?e:{},{nodes:t=g,edges:i=b}=null!=e?e:{};if(!C)return;let r=A(C);[t,i]=q(Array.from(r),t,i),n&&(t=W(t)),j(t=K(t)),w(i)},ey=()=>{Y?eg({deselect:!0}):ej({deselect:!0})},eb=async e=>{if(e.width&&e.height){let n=e.position.x+e.width/2,t=e.position.y+e.height/2,i=d.getZoom();d.setCenter(n,t,{zoom:i,duration:200})}},ew=rY();rG(u,async()=>{if("single"===en||"action_result"===en){let e=g.find(e=>e.data.isSelected);e?eb(e):d.fitView({nodes:g,duration:200})}});let ek=(e,n)=>{eS({...Z,column_level_lineage:{node:n.data.node.id,column:n.data.column}},!1)},eC=(e,n)=>{if(a&&C){if("customColumnNode"===n.type){ek(e,n);return}if(eI(),"single"===en){ei||eb(n);let[e,t]=q(Array.from(L(D(C,[n.id]),O(C,[n.id]))),g,b);j(H(n.id,e)),w(t),eb(n)}else if("action_result"===en){var t,i,r,l;(null===(i=n.data.action)||void 0===i?void 0:null===(t=i.run)||void 0===t?void 0:t.run_id)&&E(null===(l=n.data.action)||void 0===l?void 0:null===(r=l.run)||void 0===r?void 0:r.run_id),eb(n),j(H(n.id,g))}else{let e=V(n.id,g);e.find(e=>e.data.isSelected)||(et("single"),e=K(e)),j(e)}}},e_=(0,v.useCallback)(e=>{j(n=>n.map(n=>n.id===e.id?{...n,data:e}:n))},[j]),eS=async function(e){var n,t,i;let r;let l=!(arguments.length>1)||void 0===arguments[1]||arguments[1];if(!C)return;if(Z.select!==e.select||Z.exclude!==e.exclude||Z.packages!==e.packages||Z.view_mode!==e.view_mode)try{r=(await tI({select:e.select,exclude:e.exclude,packages:e.packages,view_mode:e.view_mode})).nodes}catch(e){e instanceof rS.d7&&ef({title:"Select node error",description:(null===(i=e.response)||void 0===i?void 0:null===(t=i.data)||void 0===t?void 0:t.detail)||e.message,status:"error",isClosable:!0,position:"bottom-right"});return}else r=g.map(e=>e.id);let[s,o]=F(C,r,e.column_level_lineage);if("single"===en&&ei){let e=s.find(e=>e.id==ei.id);e&&(e.data.isSelected=!0)}j(s),w(o),X(e),Y?eg({nodes:s,edges:o}):ej({nodes:s,edges:o}),(null==Q?void 0:null===(n=Q.params)||void 0===n?void 0:n.model)&&!G(Q.params.model)&&B(),l&&(await new Promise(e=>setTimeout(e,1)),await (async()=>{d.fitView({nodes:s,duration:200})})())},ez=rR("multi"===en?er:el,{onActionStarted:()=>{et("action_result")},onActionNodeUpdated:e_,onActionCompleted:()=>{}}),eR=rL();if((0,v.useEffect)(()=>{let e=null==Q?void 0:Q.type;if(!(!a||!U||!e||["query_diff","query","row_count"].includes(e))&&"single"===en){var n;let e=null===(n=Q.params)||void 0===n?void 0:n.model,t=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window});if(e){let n=G(e);n?ei!==n.data&&eC(t,n):eS({...Z,view_mode:"all"})}else ey()}},[Q,Z,U,en]),S)return(0,i.jsx)(o.k,{width:"100%",height:"100%",alignItems:"center",justifyContent:"center",children:(0,i.jsx)(t3.$,{size:"xl"})});let eT=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e3,n=ed.selectedNode;"action_result"!==en&&void 0!==n&&void 0!==C&&("single"===en&&(j(K(g,!0)),et("multi"),ez.reset()),j(P([...D(C,[n.id],e)],g,"single"===en)))},eL=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e3,n=ed.selectedNode;"action_result"!==en&&void 0!==n&&void 0!==C&&("single"===en&&(j(K(g,!0)),et("multi"),ez.reset()),j(P([...O(C,[n.id],e)],g,"single"===en)))},eI=()=>{ea(!1),eu({x:0,y:0})};if(z)return(0,i.jsx)(ne.M,{h:"100%",children:(0,i.jsxs)(nf.g,{children:[(0,i.jsx)(r.x,{children:"Failed to load lineage data. This could be because the server has been terminated or there is a network error."}),(0,i.jsxs)(r.x,{children:["[Reason: ",z,"]"]}),(0,i.jsx)(ec.z,{colorScheme:"blue",onClick:()=>{_&&_()},children:"Retry"})]})});if("changed_models"===$&&!(null==C?void 0:C.modifiedSet.length))return(0,i.jsx)(ne.M,{h:"100%",children:(0,i.jsxs)(nf.g,{children:[(0,i.jsx)(i.Fragment,{children:"No change detected"}),(0,i.jsx)(ec.z,{colorScheme:"blue",onClick:()=>{eS({...Z,view_mode:"all"})},children:"Show all nodes"})]})});let eE=()=>{et("single"),Y?eg({deselect:!0}):ej({deselect:!0}),B(),null==T||T()},eO={interactive:a,selectMode:en,nodes:g,viewOptions:Z,onViewOptionsChanged:eS,selectNodeMulti:e=>{if("multi"!==en)C&&(Y?eg({deselect:!0}):ej({deselect:!0}),j(n=>H(e,n)),et("multi"),ez.reset());else{let n=V(e,g);n.find(e=>e.data.isSelected)?j(n):eE()}},deselect:eE,advancedImpactRadius:em,setAdvancedImpactRadius:ep,runRowCount:async()=>{"multi"===en?(await ez.runRowCount(),ex({type:"row_count",selected:"multi"})):ei?(await J("row_count",{node_names:[ei.name]},{showForm:!1,showLast:!1}),ex({type:"row_count",selected:"single"})):(await J("row_count",{select:Z.select,exclude:Z.exclude,packages:Z.packages,view_mode:Z.view_mode}),ex({type:"row_count",selected:"none"}))},runRowCountDiff:async()=>{"multi"===en?(await ez.runRowCountDiff(),ex({type:"row_count_diff",selected:"multi"})):ei?(await J("row_count_diff",{node_names:[ei.name]},{showForm:!1,showLast:!1}),ex({type:"row_count_diff",selected:"single"})):(await J("row_count_diff",{select:Z.select,exclude:Z.exclude,packages:Z.packages,view_mode:Z.view_mode}),ex({type:"row_count_diff",selected:"none"}))},runValueDiff:async()=>{if(ei)await J("value_diff",{model:ei.name},{showForm:!0,showLast:!1}),ex({type:"value_diff",selected:"single"});else{let e="multi"===en?er.length:el.length;await eR.confirm(e)&&(await ez.runValueDiff(),ex({type:"value_diff",selected:"multi"===en?"multi":"none"}))}},addLineageDiffCheck:async()=>{let e;"multi"===en?(e=await ez.addLineageDiffCheck(),eE(),ex({type:"lineage_diff",selected:"multi"})):ei||(e=await rC(Z),ex({type:"lineage_diff",selected:"none"})),e&&ew(e)},addSchemaDiffCheck:async()=>{let e;"multi"===en?er.length>0&&(e=await ez.addSchemaDiffCheck(),eE(),ex({type:"schema_diff",selected:"multi"})):ei?(e=await iy({node_id:ei.id}),ex({type:"schema_diff",selected:"single"})):(e=await iy({select:Z.select,exclude:Z.exclude,packages:Z.packages,view_mode:Z.view_mode}),ex({type:"schema_diff",selected:"none"})),e&&ew(e)},cancel:ez.cancel,actionState:ez.actionState,showColumnLevelLineage:(e,n)=>{eS({...Z,column_level_lineage:{node:e,column:n}},!1)},resetColumnLevelLinage:()=>{eS({...Z,column_level_lineage:void 0},!1)}};return C&&g!=rQ?(0,i.jsxs)(tw.Provider,{value:eO,children:[(0,i.jsxs)(tD,{sizes:ei?[70,30]:[100,0],minSize:ei?400:0,gutterSize:ei?5:0,style:{height:"100%",width:"100%"},children:[(0,i.jsxs)(nf.g,{ref:u,divider:(0,i.jsx)(t9.c,{borderColor:"gray.200"}),spacing:0,style:{contain:"strict"},position:"relative",children:[a&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(rk,{}),(0,i.jsx)(rM,{})]}),(0,i.jsxs)(R.x$,{nodeTypes:rU,edgeTypes:rZ,nodes:g,edges:b,onNodesChange:y,onEdgesChange:k,onNodeClick:eC,onNodeContextMenu:(e,n)=>{if(!a||"action_result"===en)return;e.preventDefault();let t=f.current.getBoundingClientRect(),i=f.current.offsetTop;eu({x:e.clientX-t.left,y:e.clientY-t.top+i,selectedNode:n}),ea(!0)},onClick:eI,onInit:()=>{if(Y)d.fitView();else{let e=(0,R.RX)(g);d.setCenter(e.x+e.width/2,e.y+e.height/2,{zoom:1})}},maxZoom:1,minZoom:.1,nodesDraggable:a,ref:f,children:[(0,i.jsx)(t8.A,{color:"#ccc"}),(0,i.jsx)(t7.Z,{showInteractive:!1,position:"top-right",className:iI,children:(0,i.jsx)(t7.B,{title:"copy image",onClick:async()=>{m()},children:(0,i.jsx)(s.J,{as:ir.C3L})})}),(0,i.jsx)(p,{}),(0,i.jsx)(R.s_,{position:"bottom-left",children:(0,i.jsxs)(o.k,{direction:"column",gap:"5px",children:[Y&&(0,i.jsx)(r_,{}),Z.column_level_lineage&&(0,i.jsx)(rJ,{})]})}),(0,i.jsx)(R.s_,{position:"top-left",children:(0,i.jsxs)(o.k,{direction:"column",gap:"5px",children:[(0,i.jsx)(rP,{enabled:em,onChanged:e=>{var n;ep(e),eg({breakingChangeEnabled:e}),n={enabled:e},eh.j("[Experiment] breaking_change_analysis",n),ev=n.enabled}}),Z.column_level_lineage&&(0,i.jsx)(rB,{node:null!==(l=null===(t=g.find(e=>Z.column_level_lineage&&e.data.id===Z.column_level_lineage.node))||void 0===t?void 0:t.data.name)&&void 0!==l?l:"",column:Z.column_level_lineage.column,reset:()=>{eS({...Z,column_level_lineage:void 0})}}),0==g.length&&(0,i.jsx)(eo.x,{fontSize:"xl",color:"grey",opacity:.5,children:"No nodes"})]})}),(0,i.jsx)(ie.a,{nodeColor:rX,nodeStrokeWidth:3,zoomable:!0,pannable:!0}),"action_result"===en&&(0,i.jsx)(R.s_,{position:"bottom-center",className:iI,children:(0,i.jsx)(rh,{onClose:()=>{eE()}})})]}),es&&(0,i.jsx)(nV.v,{isOpen:!0,onClose:eI,children:(0,i.jsxs)(nB.q,{fontSize:"11pt",position:"absolute",width:"250px",style:{left:"".concat(ed.x,"px"),top:"".concat(ed.y,"px")},children:[(0,i.jsx)(nU.s,{icon:(0,i.jsx)(im.Cv2,{}),onClick:()=>{eT(1)},children:"Select parent nodes"}),(0,i.jsx)(nU.s,{icon:(0,i.jsx)(im.IMj,{}),onClick:()=>{eL(1)},children:"Select child nodes"}),(0,i.jsx)(to.R,{}),(0,i.jsx)(nU.s,{icon:(0,i.jsx)(im.Cv2,{}),onClick:()=>{eT()},children:"Select all upstream nodes"}),(0,i.jsx)(nU.s,{icon:(0,i.jsx)(im.IMj,{}),onClick:()=>{eL()},children:"Select all downstream nodes"})]})})]}),"single"===en&&ei?(0,i.jsx)(r.x,{borderLeft:"solid 1px lightgray",height:"100%",children:(0,i.jsx)(ru,{node:ei,onCloseNode:ey})}):(0,i.jsx)(r.x,{})]}),eR.AlertDialog]}):(0,i.jsx)(i.Fragment,{})}),r0=(0,v.forwardRef)(function(e,n){let{check:t}=e,r={...t.params,...t.view_options};return(0,i.jsx)(o.k,{direction:"column",height:"100%",children:(0,i.jsx)(R.tV,{children:(0,i.jsx)(r$,{viewOptions:r,interactive:!1,ref:n})})})});function r1(e){let{yamlTemplate:n}=e;return(0,i.jsx)(t$.ML,{height:"300px",language:"yaml",theme:"vs",value:n,options:{readOnly:!0,fontSize:14,lineNumbers:"off",automaticLayout:!0,minimap:{enabled:!1},wordWrap:"on",wrappingIndent:"same",scrollBeyondLastLine:!1}})}function r5(){let e=(0,ee.p)();return{markedAsApprovedToast:function(){e({title:"Marked as approved",position:"bottom-right",status:"success",containerStyle:{fontSize:"sm"},duration:2e3})}}}function r2(){let e=(0,tl._)(["\n <details><summary>","</summary>\n\n ","\n\n </details>"]);return r2=function(){return e},e}let r4=(e,n)=>"schema_diff"!==e&&"lineage_diff"!==e&&(!(null==n?void 0:n.result)||!!n.error),r6=e=>{var n,t,l,a,d,f,g,j;let{checkId:w,refreshCheckList:k}=e,C=(0,b.NL)(),[,_]=(0,eF.TH)(),{successToast:S,failToast:z}=tZ(),{markedAsApprovedToast:R}=r5(),[T,L]=(0,v.useState)(),[I,E]=(0,v.useState)(),[D,O]=(0,v.useState)(!1),[A,M]=(0,v.useState)(""),{isOpen:F,onOpen:N,onClose:q}=(0,en.q)(),H=()=>(0,i.jsx)(ei.Z,{bg:"blackAlpha.300",backdropFilter:"blur(10px) "}),[V,P]=(0,v.useState)((0,i.jsx)(H,{})),{isLoading:W,error:K,data:J}=(0,y.a)({queryKey:B.check(w),queryFn:async()=>tn(w),refetchOnMount:!0}),U=T||(null==J?void 0:null===(n=J.last_run)||void 0===n?void 0:n.run_id),{run:Q,error:Z}=iw(U),X=T?!Q||"running"===Q.status:(null==Q?void 0:Q.status)==="running",G=(null==J?void 0:J.type)?n$(J.type):void 0,Y=(null==J?void 0:J.is_preset)||!1,$=(0,v.useRef)(null),{mutate:ee}=(0,tb.D)({mutationFn:e=>tt(w,e),onSuccess:()=>{C.invalidateQueries({queryKey:B.check(w)}),C.invalidateQueries({queryKey:B.checks()})}}),{mutate:ea}=(0,tb.D)({mutationFn:()=>ti(w),onSuccess:()=>{C.invalidateQueries({queryKey:B.checks()}),_("/checks")}}),ed=(0,v.useCallback)(async()=>{(null==J?void 0:J.type)&&(L((await ek(w,{nowait:!0})).run_id),C.invalidateQueries({queryKey:B.check(w)}),k&&k())},[J,w,L,C,k]),eu=(0,v.useCallback)(async()=>{if(O(!0),U)return await ew(U)},[U]),eh=async()=>{var e;if(!J)return;let n=(e=J,(0,tQ.RI)(r2(),"".concat(e.is_checked?"✅ ":"").concat(e.name),function(e){if("query"===e.type||"query_diff"===e.type){var n;return"".concat(tG(e),"\n\n").concat((0,tQ.Pn)(tX(),null===(n=e.params)||void 0===n?void 0:n.sql_template))}return tG(e)}(e)));if(!navigator.clipboard){z("Failed to copy the check to clipboard",Error("Copy to clipboard is available only in secure contexts (HTTPS)"));return}try{await navigator.clipboard.writeText(n),S("Copied the check to the clipboard")}catch(e){z("Failed to copy the check to clipboard",e)}},ex=(0,v.useCallback)(()=>{let e=null==J?void 0:J.is_checked;ee({is_checked:!e}),e||R()},[null==J?void 0:J.is_checked,ee,R]),[em,ep]=(0,v.useState)(0),{ref:ef,onCopyToClipboard:eg,onMouseEnter:ej,onMouseLeave:ev}=iD();if((0,v.useEffect)(()=>{M(function(e){let{name:n,description:t,type:i,params:r,viewOptions:l}=e,s={name:n,description:t,type:i,params:r};return l&&(s.view_options=l),ik.ZP.stringify({checks:[s]})}({name:(null==J?void 0:J.name)||"",description:(null==J?void 0:J.description)||"",type:(null==J?void 0:J.type)||"",params:null==J?void 0:J.params,viewOptions:null==J?void 0:J.view_options}))},[J]),W)return(0,i.jsx)(ne.M,{h:"100%",children:"Loading"});if(K)return(0,i.jsxs)(ne.M,{h:"100%",children:["Error: ",K.message]});let ey=(null==Q?void 0:Q.run_at)?(0,t6.Q)(new Date(Q.run_at),{addSuffix:!0}):null;return(0,i.jsxs)(tO,{minSize:100,sizes:[30,70],style:{height:"100%",width:"100%",maxHeight:"100%"},children:[(0,i.jsxs)(r.x,{style:{contain:"strict"},display:"flex",flexDirection:"column",children:[(0,i.jsxs)(o.k,{p:"0px 16px",alignItems:"center",h:"40px",children:[(0,i.jsx)(ty,{name:(null==J?void 0:J.name)||"",setName:e=>{ee({name:e})}}),Y&&(0,i.jsx)(nT.u,{label:"Preset Check defined in recce config",children:(0,i.jsxs)(ts.Vp,{size:"sm",flex:"0 0 auto",ml:"2",children:[(0,i.jsx)(ts.AD,{boxSize:"14px",as:tp.bX4}),"Preset"]})}),(0,i.jsx)(h.L,{}),(0,i.jsxs)(u.U,{mr:"10px",children:[ey&&(0,i.jsx)(r.x,{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",fontSize:"10pt",children:ey}),(0,i.jsxs)(nV.v,{children:[(0,i.jsx)(nP.j,{isRound:!0,as:nW.h,icon:(0,i.jsx)(s.J,{as:nr.D_A}),variant:"ghost",size:"sm"}),(0,i.jsxs)(nB.q,{children:[(0,i.jsx)(nU.s,{as:eo.x,fontSize:"10pt",icon:(0,i.jsx)(tf.ovA,{}),onClick:()=>{P((0,i.jsx)(H,{})),N()},children:"Get Preset Check Template"}),(0,i.jsx)(nU.s,{as:eo.x,fontSize:"10pt",icon:(0,i.jsx)(tu.T,{}),onClick:()=>eh(),children:"Copy Markdown"}),(0,i.jsx)(to.R,{}),(0,i.jsx)(nU.s,{as:eo.x,fontSize:"10pt",icon:(0,i.jsx)(th.p,{}),color:"red",onClick:()=>{ea()},children:"Delete"})]})]}),(0,i.jsx)(nT.u,{label:r4(null!==(f=null==J?void 0:J.type)&&void 0!==f?f:"",Q)?"Run the check first":(null==J?void 0:J.is_checked)?"Mark as Pending":"Mark as Approved",placement:"bottom-end",children:(0,i.jsx)(ec.z,{flex:"0 0 auto",size:"sm",colorScheme:(null==J?void 0:J.is_checked)?"green":"gray",variant:(null==J?void 0:J.is_checked)?"solid":"outline",leftIcon:(null==J?void 0:J.is_checked)?(0,i.jsx)(tx.r,{}):(0,i.jsx)(s.J,{as:nr.Rbx,color:"lightgray"}),onClick:()=>{ex()},isDisabled:r4(null!==(g=null==J?void 0:J.type)&&void 0!==g?g:"",Q),children:(null==J?void 0:J.is_checked)?"Approved":"Mark as Approved"})})]})]}),(0,i.jsx)(r.x,{flex:"1",p:"8px 16px",minHeight:"100px",children:(0,i.jsx)(tU,{value:null==J?void 0:J.description,onChange:e=>{ee({description:e})}},null==J?void 0:J.check_id)})]}),(0,i.jsx)(r.x,{style:{contain:"strict"},children:(0,i.jsxs)(x.m,{height:"100%",display:"flex",flexDirection:"column",tabIndex:em,onChange:ep,children:[(0,i.jsxs)(m.t,{height:"50px",children:[(0,i.jsx)(p.O,{fontSize:"10pt",children:"Result"}),((null==J?void 0:J.type)==="query"||(null==J?void 0:J.type)==="query_diff")&&(0,i.jsx)(p.O,{fontSize:"10pt",children:"Query"}),(0,i.jsx)(h.L,{}),(0,i.jsxs)(u.U,{mr:"10px",children:[(null==G?void 0:G.RunResultView)&&(0,i.jsx)(nT.u,{label:"Rerun",children:(0,i.jsx)(ec.z,{leftIcon:(0,i.jsx)(tm.n,{}),variant:"outline",isLoading:X,size:"sm",onClick:()=>ed(),children:"Rerun"})}),(0,i.jsx)(ec.z,{leftIcon:(0,i.jsx)(tu.T,{}),variant:"outline",isDisabled:r4(null!==(j=null==J?void 0:J.type)&&void 0!==j?j:"",Q)||0!==em,onMouseEnter:ej,onMouseLeave:ev,size:"sm",onClick:()=>{if((null==J?void 0:J.type)==="lineage_diff"){var e;null===(e=$.current)||void 0===e||e.copyToClipboard()}else eg()},children:"Copy to Clipboard"})]})]}),(0,i.jsxs)(ta.n,{height:"100%",flex:"1",style:{contain:"strict"},children:[(0,i.jsxs)(tc.x,{p:0,width:"100%",height:"100%",children:[(null==G?void 0:G.RunResultView)&&((null==J?void 0:J.last_run)||U?(0,i.jsx)(t4,{ref:ef,isRunning:X,isAborting:D,run:U?Q:null==J?void 0:J.last_run,error:Z,progress:I,RunResultView:G.RunResultView,viewOptions:null==J?void 0:J.view_options,onViewOptionsChanged:e=>{ee({view_options:e})},onCancel:eu,onExecuteRun:ed}):(0,i.jsx)(ne.M,{bg:"rgb(249,249,249)",height:"100%",children:(0,i.jsxs)(nf.g,{spacing:4,children:[(0,i.jsx)(r.x,{children:"This action is part of the initial preset and has not been performed yet. Once performed, the result will be shown here."}),(0,i.jsx)(ec.z,{onClick:ed,colorScheme:"blue",size:"sm",children:"Run Query"})]})})),J&&"schema_diff"===J.type&&(0,i.jsx)(tB,{check:J,ref:ef}),J&&"lineage_diff"===J.type&&(0,i.jsx)(r0,{check:J,ref:$})]}),((null==J?void 0:J.type)==="query"||(null==J?void 0:J.type)==="query_diff"||(null==J?void 0:J.type)==="query_base")&&(0,i.jsx)(tc.x,{p:0,height:"100%",width:"100%",children:(null===(t=J.params)||void 0===t?void 0:t.base_sql_template)?(0,i.jsx)(t1,{value:(null===(l=J.params)||void 0===l?void 0:l.sql_template)||"",baseValue:(null===(a=J.params)||void 0===a?void 0:a.base_sql_template)||"",options:{readOnly:!0}}):(0,i.jsx)(t0,{value:(null===(d=J.params)||void 0===d?void 0:d.sql_template)||"",options:{readOnly:!0}})})]})]})}),(0,i.jsxs)(et.u_,{isOpen:F,onClose:q,isCentered:!0,size:"6xl",children:[V,(0,i.jsxs)(er.h,{overflowY:"auto",height:"40%",width:"60%",children:[(0,i.jsx)(el.x,{children:"Preset Check Template"}),(0,i.jsx)(eA.o,{}),(0,i.jsxs)(es.f,{children:[(0,i.jsxs)(c.X,{size:"sm",fontWeight:"bold",children:["Please"," ",(0,i.jsx)(eo.x,{as:"span",cursor:"pointer",_hover:{textDecoration:"underline"},color:"blue.500",onClick:async()=>{await navigator.clipboard.writeText(A),S("Copied the template to the clipboard")},children:"copy"})," ","the following template and paste it into the"," ",(0,i.jsx)(td.y,{query:"recce.yml",styles:{px:"1",py:"0",bg:"red.100"},children:"recce.yml"})," ","file."]}),(0,i.jsx)("br",{}),(0,i.jsx)(r1,{yamlTemplate:A})]})]})]})]})};var r3=t(77170);let r9=e=>{var n,t,l;let{check:a,selected:c,onSelect:d,onMarkAsApproved:u}=e,h=(0,b.NL)(),x=a.check_id,{mutate:m}=(0,tb.D)({mutationFn:e=>tt(x,e),onSuccess:()=>{h.invalidateQueries({queryKey:B.check(x)}),h.invalidateQueries({queryKey:B.checks()})}}),{run:p}=iw(null===(n=a.last_run)||void 0===n?void 0:n.run_id),f=(null===(t=n$(a.type))||void 0===t?void 0:t.icon)||eN.WzH,g=r4(null!==(l=a.type)&&void 0!==l?l:"",p);return(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(o.k,{width:"100%",p:"10px 20px",cursor:"pointer",_hover:{bg:"Cornsilk"},bg:c?"Floralwhite":"inherit",borderBlockEndWidth:"1px",borderLeftWidth:"3px",borderLeftColor:c?"orange":"transparent",onClick:()=>{d(a.check_id)},alignItems:"center",gap:"5px",children:[(0,i.jsx)(s.J,{as:f}),(0,i.jsx)(r.x,{flex:"1",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",children:a.name}),(0,i.jsx)(nT.u,{label:g?"Run the check first":"Click to mark as approved",placement:"top",hasArrow:!0,children:(0,i.jsx)(o.k,{children:(0,i.jsx)(ng.X,{isChecked:a.is_checked,variant:"circular",colorScheme:"green",size:"xs",onChange:e=>{let n=e.target.checked;n?u():m({is_checked:n})},disabled:g})})})]})})},r8=e=>{let{checks:n,selectedItem:t,onCheckSelected:l,onChecksReordered:s}=e,[a,c]=(0,v.useState)(!1),d=(0,b.NL)(),{mutate:u}=(0,tb.D)({mutationFn:e=>tt(e,{is_checked:!0}),onSuccess:(e,n)=>{d.invalidateQueries({queryKey:B.check(n)}),d.invalidateQueries({queryKey:B.checks()})}}),{isOpen:h,onOpen:x,onClose:m}=(0,en.q)(),{markedAsApprovedToast:p}=r5(),f=()=>{"true"===localStorage.getItem("bypassMarkAsApprovedWarning")?(u(t),p()):x()};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r3.Z5,{onDragEnd:e=>{e.destination&&s(e.source.index,e.destination.index)},children:(0,i.jsx)(r3.bK,{droppableId:"checklist",children:e=>(0,i.jsxs)(nf.g,{...e.droppableProps,ref:e.innerRef,w:"full",spacing:"0",flex:"1",overflow:"auto",children:[n.map((e,n)=>(0,i.jsx)(r3._l,{draggableId:e.check_id,index:n,children:(n,r)=>{if(r.isDragging){let e=n.draggableProps,t={x:0,y:80},i=e.style.left-t.x,r=e.style.top-t.y;e.style.left=i,e.style.top=r}return(0,i.jsx)(o.k,{ref:n.innerRef,...n.draggableProps,...n.dragHandleProps,w:"full",children:(0,i.jsx)(r9,{check:e,selected:e.check_id===t,onSelect:l,onMarkAsApproved:f},e.check_id)})}},e.check_id)),e.placeholder]})})}),(0,i.jsxs)(et.u_,{isOpen:h,onClose:m,isCentered:!0,children:[(0,i.jsx)(ei.Z,{}),(0,i.jsxs)(er.h,{width:"400px",children:[(0,i.jsx)(el.x,{children:"Mark as Approved?"}),(0,i.jsx)(eA.o,{}),(0,i.jsx)(nL.i,{}),(0,i.jsxs)(r.x,{p:"16px",fontSize:"sm",gap:"16px",children:[(0,i.jsx)("p",{children:"Please ensure you have reviewed the contents of this check before marking it as approved."}),(0,i.jsx)(ng.X,{isChecked:a,onChange:e=>{c(e.target.checked)},fontWeight:"bold",size:"sm",pt:"8px",children:"Don't show this again"})]}),(0,i.jsx)(nL.i,{}),(0,i.jsxs)(ea.m,{children:[(0,i.jsx)(ec.z,{variant:"outline",size:"xs",mr:2,onClick:m,children:"Cancel"}),(0,i.jsx)(ec.z,{colorScheme:"blue",size:"xs",onClick:()=>{u(t),a&&localStorage.setItem("bypassMarkAsApprovedWarning","true"),p(),m()},children:"Mark as approved"})]})]})]})]})};async function r7(e){return(await X.post("/api/save-as",e)).data}async function le(e){return(await X.post("/api/rename",e)).data}async function ln(){return(await X.post("/api/export")).data}async function lt(e,n){let t=new FormData;return t.append("file",e),t.append("checks_only",(!!n).toString()),(await X.post("/api/import",t)).data}async function li(){return 208===(await X.get("/api/sync")).status}async function lr(e){try{let n=await X.post("/api/sync",e);if(202===n.status)return{status:"accepted"};if(208===n.status)return{status:"syncing"}}catch(e){if((0,rS.IZ)(e)&&e.response&&409===e.response.status)return{status:"conflict"}}throw Error("Failed to sync state")}function ll(e){let{checksOnly:n=!0}=e,t=(0,ee.p)(),r=(0,b.NL)(),l=(0,v.useRef)(null),a=(0,v.useRef)(null),[c,d]=(0,v.useState)(null),{isOpen:u,onOpen:h,onClose:x}=(0,en.q)(),[m,p]=(0,eF.TH)(),[,f]=eO(),g=(0,v.useCallback)(async()=>{if(c){try{let{runs:e,checks:i}=await lt(c,n);f(),await r.invalidateQueries({queryKey:B.checks()}),await r.invalidateQueries({queryKey:B.runs()}),m.includes("/checks")&&p("/checks");let l=n?"".concat(i," checks imported successfully"):"".concat(e," runs and ").concat(i," checks imported successfully");t({description:l,status:"info",variant:"left-accent",position:"bottom",duration:5e3,isClosable:!0})}catch(e){console.error("Import failed",e),t({title:"Import failed",description:"".concat(e),status:"error",variant:"left-accent",position:"bottom",duration:5e3,isClosable:!0})}x()}},[r,c,t,x,m,p,f,n]),j=n?"checks":"runs and checks",{isDemoSite:y}=eD();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(nT.u,{label:"Import Checklist from State File"+(y?" (Disabled in the demo site)":""),children:(0,i.jsx)(nW.h,{pt:"6px",variant:"unstyled","aria-label":"Import state",onClick:()=>{l.current&&l.current.click()},icon:(0,i.jsx)(s.J,{as:re}),isDisabled:y})}),(0,i.jsx)("input",{type:"file",style:{display:"none"},ref:l,onChange:e=>{var n;(null===(n=e.target.files)||void 0===n?void 0:n.length)===1&&(d(e.target.files[0]),h()),l.current&&(l.current.value="")}}),(0,i.jsx)(rT.aR,{isOpen:u,leastDestructiveRef:a,onClose:x,size:"xl",children:(0,i.jsx)(ei.Z,{children:(0,i.jsxs)(rT._T,{children:[(0,i.jsx)(el.x,{fontSize:"lg",fontWeight:"bold",children:"Import state"}),(0,i.jsx)(es.f,{children:(0,i.jsxs)(o.k,{px:"5px",gap:"5px",rounded:"md",direction:"column",children:[(0,i.jsxs)(o.k,{alignItems:"center",gap:"5px",children:[(0,i.jsx)(it.s,{color:"red.600"}),(0,i.jsx)(eo.x,{as:"span",fontWeight:"500",color:"red.600",children:"Caution!"})]}),(0,i.jsx)(o.k,{children:(0,i.jsxs)(eo.x,{children:["The current ",j," will be"," ",(0,i.jsx)(eo.x,{as:"span",fontWeight:"600",children:"merged"})," ","with the imported state"]})})]})}),(0,i.jsxs)(ea.m,{children:[(0,i.jsx)(ec.z,{ref:a,onClick:x,children:"Cancel"}),(0,i.jsx)(ec.z,{colorScheme:"blue",onClick:g,ml:"5px",children:"Import"})]})]})})})]})}let ls=()=>{let[,e]=(0,eF.TH)(),[,n]=(0,eF.yj)("/checks/:checkId"),{latestSelectedCheckId:t,setLatestSelectedCheckId:l}=n3(),s=(0,b.NL)(),a=null==n?void 0:n.checkId;a&&l(a);let{isLoading:c,error:d,data:u,status:h,refetch:x}=(0,y.a)({queryKey:B.checks(),queryFn:te,refetchOnMount:!0}),m=(0,v.useCallback)(n=>{e("/checks/".concat(n))},[e]),[p,f]=(0,v.useState)(u||[]),{mutate:g}=(0,tb.D)({mutationFn:e=>tr(e),onSuccess:()=>{s.invalidateQueries({queryKey:B.checks()})}}),j=(0,v.useCallback)((e,n)=>{let t=[...p],[i]=t.splice(e,1);t.splice(n,0,i),g({source:e,destination:n}),f(t)},[p,f,g]);return((0,v.useCallback)(async()=>{let e=await n8();s.invalidateQueries({queryKey:B.checks()}),m(e.check_id)},[s,m]),(0,v.useEffect)(()=>{"success"===h&&(!a&&u.length>0&&(t?e("/checks/".concat(t)):e("/checks/".concat(u[0].check_id))),f(u))},[h,a,u,f,e,t]),c)?(0,i.jsx)(i.Fragment,{}):d?(0,i.jsxs)(i.Fragment,{children:["Error: ",d.message]}):(null==u?void 0:u.length)?(0,i.jsxs)(tD,{style:{height:"100%"},minSize:50,sizes:[20,80],children:[(0,i.jsx)(r.x,{borderRight:"lightgray solid 1px",height:"100%",style:{contain:"size"},children:(0,i.jsxs)(nf.g,{spacing:0,h:"100%",style:{contain:"strict"},alignItems:"stretch",children:[(0,i.jsx)(o.k,{justifyContent:"right",padding:"0px 10px",children:(0,i.jsx)(ll,{checksOnly:!0})}),(0,i.jsx)(nL.i,{}),(0,i.jsx)(r8,{checks:p,selectedItem:a,onCheckSelected:m,onChecksReordered:j})]})}),(0,i.jsx)(r.x,{height:"100%",children:(0,i.jsx)(eF.rs,{children:(0,i.jsx)(eF.AW,{path:"/checks/:checkId",children:e=>(0,i.jsx)(r6,{checkId:e.checkId,refreshCheckList:x},e.checkId)})})})]}):(0,i.jsx)(ne.M,{h:"100%",children:(0,i.jsx)(r.x,{children:"No checks"})})},lo=()=>{let{isHistoryOpen:e,showHistory:n,closeHistory:t}=n2();return(0,i.jsxs)(r.x,{children:[(0,i.jsx)(r.x,{fontSize:"8pt",children:"History"}),(0,i.jsx)(ec.z,{leftIcon:(0,i.jsx)(s.J,{as:nr.M1Q}),size:"xs",variant:"outline",onClick:()=>{e?(em({name:"hide"}),t()):(em({name:"show"}),n())},children:e?"Hide":"Show"})]})},la=()=>{let{isCustomQueries:e,setCustomQueries:n,sqlQuery:t,setBaseSqlQuery:l}=_();return(0,i.jsxs)(r.x,{children:[(0,i.jsxs)(r.x,{fontSize:"8pt",children:["Custom Queries ","",(0,i.jsx)(nT.u,{label:"Custom queries allow you to use two SQL queries to compare results between current and base environments.",children:(0,i.jsx)(it.s,{color:"gray.600",boxSize:"3"})})]}),(0,i.jsx)(rF.r,{size:"sm",isChecked:e,onChange:()=>{!e&&l&&l(t),n(!e)}})]})},lc=()=>{let{sqlQuery:e,baseSqlQuery:n,setSqlQuery:t,setBaseSqlQuery:l,primaryKeys:s,setPrimaryKeys:a,isCustomQueries:c}=_(),{envInfo:d}=eD(),u=e;(null==d?void 0:d.adapterType)==="sqlmesh"&&e===w&&(u="select * from db.mymodel");let{showRunId:x}=n2(),m=async e=>{let t="query_base"===e?n||"":u,i=function(e){switch(e){case"query":return iq;case"query_base":return iH;case"query_diff":return iV;default:throw Error("Unknown query type: ".concat(e))}}(e),r={sql_template:t};"query_diff"===e&&(r.primary_keys=s,c&&(r.base_sql_template=n));let{run_id:l}=await i(r,{nowait:!0});return x(l),await eb(l)},{mutate:p,isPending:f}=(0,tb.D)({mutationFn:m});return(0,i.jsxs)(o.k,{direction:"column",height:"100%",children:[(0,i.jsxs)(o.k,{justifyContent:"right",alignItems:"center",padding:"4pt 8pt",gap:"5px",height:"54px",borderBottom:"1px solid lightgray",flex:"0 0 54px",children:[(0,i.jsx)(lo,{}),(0,i.jsx)(la,{}),(0,i.jsx)(h.L,{}),(0,i.jsx)(iZ,{defaultPrimaryKeys:s,onPrimaryKeysChange:a}),(0,i.jsx)(ec.z,{colorScheme:"blue",onClick:()=>{p("query_diff")},isDisabled:f,size:"xs",fontSize:"14px",marginTop:"16px",children:"Run Diff"})]}),(0,i.jsx)(r.x,{width:"100%",flex:"1",children:c?(0,i.jsx)(t1,{value:u,baseValue:n,onChange:t,onChangeBase:l,onRun:()=>{p("query")},onRunBase:()=>{p("query_base")},onRunDiff:()=>{p("query_diff")}}):(0,i.jsx)(t0,{value:u,onChange:t,onRun:()=>{p("query")},onRunDiff:()=>{p("query_diff")}})})]})};var ld=t(39907);let lu=e=>{(0,ld.c4)("#!"+e)},lh=()=>[(0,ld.LD)(()=>window.location.hash.replace(/^#!/,"")||"/",()=>"/ssr"),lu];var lx=t(89716),lm=t(14992);let lp=e=>{var n;let{runId:t}=e,{isPending:r,error:l,data:s}=(0,y.a)({queryKey:B.run(t),queryFn:async()=>eb(t)}),o=(null==s?void 0:s.type)?null===(n=n$(s.type))||void 0===n?void 0:n.RunResultView:void 0;return(0,i.jsx)(t4,{isPending:r,error:l,run:s,RunResultView:o})},lf=e=>{let{error:n,resetError:t}=e;return(0,i.jsx)(ne.M,{height:"100%",backgroundColor:"gray.50",children:(0,i.jsxs)(o.k,{p:4,direction:"column",justifyContent:"flex-start",backgroundColor:"white",border:"solid lightgray 1px",minHeight:"200px",children:[(0,i.jsx)(c.X,{width:"800px",size:"md",children:"You have encountered an error"}),(0,i.jsx)(r.x,{flex:"1",fontSize:"10pt",children:n.toString()}),(0,i.jsx)(ec.z,{justifySelf:"center",alignSelf:"center",mt:"20px",colorScheme:"blue",size:"sm",onClick:()=>{t()},children:"Reset"})]})})},lg=e=>{let{children:n}=e;return(0,i.jsx)(t2.SV,{fallback:lf,children:n})};function lj(){let e=(0,ee.p)(),n=async()=>{try{let e=await ln(),n=JSON.stringify(e,null,2),t=new Blob([n],{type:"application/json"}),i=new Date,r="recce-state-".concat((0,iR.WU)(i,"yyyy-MM-dd-HH-mm-ss"),".json");iL()(t,r)}catch(n){console.error("Export failed",n),e({title:"Export failed",description:"".concat(n),status:"error",variant:"left-accent",position:"bottom",duration:5e3,isClosable:!0})}};return(0,i.jsx)(nT.u,{label:"Export",children:(0,i.jsx)(nW.h,{size:"sm",variant:"unstyled","aria-label":"Export state",onClick:n,icon:(0,i.jsx)(s.J,{as:i7,verticalAlign:"middle",boxSize:"16px"})})})}function lv(){return(0,i.jsx)(R.tV,{children:(0,i.jsx)(r$,{interactive:!0})})}t(7917);let ly=e=>{let{isGuideOpen:n,closeGuide:t}=e;return(0,i.jsxs)(et.u_,{isOpen:n,onClose:t,scrollBehavior:"inside",children:[(0,i.jsx)(ei.Z,{}),(0,i.jsxs)(er.h,{maxW:"80vw",h:"80vh",children:[(0,i.jsx)(el.x,{children:"Welcome to Recce: 3 Steps to Begin"}),(0,i.jsx)(eA.o,{}),(0,i.jsx)(es.f,{children:(0,i.jsxs)(tY.K,{spacing:4,children:[(0,i.jsxs)(tA.aV,{spacing:2,children:[(0,i.jsx)(tA.HC,{children:"Step 1: Click the model you want to check"}),(0,i.jsx)(tA.HC,{children:'Step 2: Click "Explore Change"'}),(0,i.jsx)(tA.HC,{children:'Step 3: Click "Add to Checklist"'})]}),(0,i.jsx)(nL.i,{}),(0,i.jsx)(a.E,{src:"https://datarecce.io/assets/images/onboarding/material.svg",alt:"placeholder"})]})}),(0,i.jsx)(ea.m,{children:(0,i.jsx)(ec.z,{colorScheme:"blue",onClick:t,children:"Got it!"})})]})]})};var lb=()=>{let[e,n]=(0,v.useState)(!1),{data:t,isLoading:r}=eL();return((0,v.useEffect)(()=>{if(!r&&t){let e=t.show_onboarding_guide;!localStorage.getItem("hasVisited")&&e&&(n(!0),localStorage.setItem("hasVisited","true"))}},[t,r]),r)?(0,i.jsx)(i.Fragment,{}):(0,i.jsx)(ly,{isGuideOpen:e,closeGuide:()=>{n(!1),eR()}})},lw=t(10065);t(36130);let lk=e=>{var n;let{run:t,isSelected:l,onSelectRun:a,onAddToChecklist:c,onGoToCheck:d}=e,{data:u}=(0,y.a)({queryKey:B.run(t.run_id),queryFn:async()=>await eb(t.run_id),enabled:"running"===t.status,retry:!1}),h=(null===(n=n$(t.type))||void 0===n?void 0:n.icon)||eN.WzH,x=t.check_id;return(0,i.jsxs)(o.k,{minWidth:"200px",direction:"column",width:"100%",p:"5px 20px",cursor:"pointer",borderBottom:"solid 1px lightgray",borderLeft:"4px",borderLeftColor:l?"orange.400":"transparent",backgroundColor:l?"orange.50":"transparent",onClick:()=>{a(t.run_id)},_hover:{bg:l?"orange.50":"gray.200"},children:[(0,i.jsxs)(o.k,{onClick:()=>{},alignItems:"center",gap:"12px",children:[(0,i.jsx)(s.J,{as:h}),(0,i.jsx)(r.x,{flex:"1",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",color:t.name?"inherit":"gray.500",fontSize:"11pt",fontWeight:"500",children:t.name||"<no name>"}),x?(0,i.jsx)(nT.u,{label:"Go to Check","aria-label":"Go to Check",children:(0,i.jsx)(eo.x,{onClick:e=>{e.preventDefault(),e.stopPropagation(),d(x)},children:(0,i.jsx)(s.J,{color:"green",as:tM.FJM})})}):(0,i.jsx)(nT.u,{label:"Add to Checklist","aria-label":"Add to Checklist",children:(0,i.jsx)(eo.x,{onClick:e=>{e.preventDefault(),e.stopPropagation(),em({name:"add_to_checklist"}),c(t.run_id)},children:(0,i.jsx)(s.J,{as:tM.wO})})})]}),(0,i.jsx)(o.k,{justifyContent:"start",fontSize:"11pt",color:"gray.500",gap:"3px",alignItems:"center",children:(0,i.jsx)(iO,{run:u||t})})]})},lC=e=>{let{runAt:n}=e,t=n?function(e){let n=new Date,t=new Date;return(t.setDate(n.getDate()-1),null==e)?null:n.toDateString()===e.toDateString()?"Today":t.toDateString()===e.toDateString()?"Yesterday":(0,iR.WU)(e,"MMM d")}(new Date(n)):null;return(0,i.jsx)(o.k,{minWidth:"200px",width:"100%",p:"5px 20px",borderBottom:"solid 1px lightgray",color:"gray.500",fontSize:"11pt",children:t})},l_=()=>{let{data:e,isLoading:n,isFetching:t,error:l,refetch:s}=(0,y.a)({queryKey:B.runs(),queryFn:async()=>await e_(),retry:!1}),{showRunId:a,runId:d}=n2(),x=e=>{em({name:"click_run"}),a(e,!1)},[,m]=(0,eF.TH)(),p=(0,b.NL)(),f=(0,v.useCallback)(async()=>{if(!d)return;let e=await n7(d);p.invalidateQueries({queryKey:B.checks()}),m("/checks/".concat(e.check_id))},[d,m,p]),g=(0,v.useCallback)(e=>{em({name:"go_to_check"}),m("/checks/".concat(e))},[m]),j=null;return(0,i.jsxs)(o.k,{direction:"column",height:"100%",children:[(0,i.jsxs)(u.U,{width:"100%",flex:"0 0 54px",paddingInline:"24px 8px",borderBottom:"solid 1px lightgray",children:[(0,i.jsx)(c.X,{size:"md",children:"History"}),(0,i.jsx)(h.L,{}),(0,i.jsx)(nW.h,{variant:"unstyled",icon:(0,i.jsx)(tm.n,{}),"aria-label":"Search database",onClick:()=>{s()}})]}),(0,i.jsx)(r.x,{flex:"1 1 auto",children:n?"Loading...":(null==e?void 0:e.length)===0?(0,i.jsx)(ne.M,{height:"100%",color:"gray.400",children:"No runs"}):(0,i.jsx)(lw.Z,{style:{minHeight:"100%",height:0},children:(e||[]).map((e,n)=>{let t=new Date(e.run_at).toDateString(),r=null!=j&&j!==t;return j=t,(0,i.jsxs)(i.Fragment,{children:[r&&(0,i.jsx)(lC,{runAt:e.run_at},t),(0,i.jsx)(lk,{run:e,isSelected:e.run_id===d,onSelectRun:x,onGoToCheck:g,onAddToChecklist:f},e.run_id)]})})})})]})};var lS=t(84546),lz=t(64439);let{definePartsStyle:lR,defineMultiStyleConfig:lT}=(0,lz.D)(lS.TB.keys),lL=lT({variants:{circular:lR({control:(0,lz.k0)({rounded:"full"})})},sizes:{xs:lR({icon:(0,lz.k0)({fontSize:"8px"}),control:(0,lz.k0)({boxSize:"16px",padding:"4px"}),label:(0,lz.k0)({fontSize:"xs"})})}}),lI=(0,t(21210).fj)({baseStyle:{borderRadius:"4px"}});var lE=t(26375);let lD=()=>{let e=(0,ee.p)();return{toastSuccess:n=>{e({description:n,status:"success",variant:"left-accent",position:"bottom-right",duration:5e3,isClosable:!0})},toastError:(n,t)=>{var i,r;e({description:t?t instanceof rS.d7?"".concat(n,". ").concat(null===(r=t.response)||void 0===r?void 0:null===(i=r.data)||void 0===i?void 0:i.detail):"".concat(n,". ").concat(t):n,status:"error",variant:"left-accent",position:"bottom-right",duration:5e3,isClosable:!0})}}},lO=e=>{(0,v.useEffect)(()=>{let n=e=>{e.preventDefault()};return e&&window.addEventListener("beforeunload",n),()=>{e&&window.removeEventListener("beforeunload",n)}},[e])},lA=()=>{let{fileName:e,cloudMode:n,isDemoSite:t,isLoading:l}=eD(),a=(0,en.q)(),c=(0,en.q)(),d=!e&&!n&&!t,{data:u}=(0,y.a)({queryKey:B.checks(),queryFn:te,enabled:d}),h=void 0!=u&&u.filter(e=>!e.is_preset).length>0;lO(d&&h);let[{newFileName:x,errorMessage:m,modified:p,overwriteWithMethod:f,bypass:g},j]=(0,v.useState)({newFileName:e||"recce_state.json"}),w=(0,v.useRef)(null),{toastSuccess:k,toastError:C}=lD(),_=(0,b.NL)(),S=async(e,n)=>{if(!x)return;let t="true"===localStorage.getItem(i$.bypassSaveOverwrite);try{"save"===e?await r7({filename:x,overwrite:n||t}):await le({filename:x,overwrite:n||t}),k("save"===e?"Save file successfully":"Rename file successfully"),_.invalidateQueries({queryKey:B.lineage()}),g&&localStorage.setItem(i$.bypassSaveOverwrite,"true")}catch(n){if(n instanceof rS.d7){var i;if((null===(i=n.response)||void 0===i?void 0:i.status)===409){j(n=>({...n,overwriteWithMethod:e})),c.onOpen();return}}C("save"===e?"Save file failed":"Rename file failed",n)}finally{a.onClose()}};return n||t?(0,i.jsx)(i.Fragment,{}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(o.k,{flex:"1",justifyContent:"center",alignItems:"center",children:[(0,i.jsx)(r.x,{fontWeight:"600",children:e||(n?"cloud":"New Instance"+(h?" (unsaved)":""))}),(0,i.jsx)(nT.u,{label:e?"Change Filename":"Save",openDelay:1e3,children:(0,i.jsx)(nW.h,{onClick:()=>{j({newFileName:e||"recce_state.json",modified:!e}),a.onOpen()},"aria-label":"",variant:"unstyled",size:"sm",children:(0,i.jsx)(s.J,{as:e?rt:rn,boxSize:"16px",verticalAlign:"middle"})})})]}),(0,i.jsxs)(et.u_,{isOpen:a.isOpen,onClose:a.onClose,isCentered:!0,children:[(0,i.jsx)(ei.Z,{}),(0,i.jsxs)(er.h,{children:[(0,i.jsx)(el.x,{children:e?"Change Filename":"Save File"}),(0,i.jsx)(eA.o,{}),(0,i.jsx)(es.f,{onKeyDown:e=>{e.stopPropagation()},children:(0,i.jsxs)(eq.NI,{isInvalid:!!m,children:[(0,i.jsx)(eH.l,{children:"File name:"}),(0,i.jsx)(nN.I,{ref:w,value:x,placeholder:"Enter filename",onChange:n=>{let t;let i=n.target.value;i?i.endsWith(".json")?/^[a-zA-Z0-9 _-]+\.json$/.test(i)?e&&i===e&&(t="Filename is the same as the current one."):t="Invalid filename. Only alphanumeric, space, _ and - are allowed.":t="Filename must end with .json.":t="Filename cannot be empty.",j(e=>({...e,modified:!0,newFileName:i,errorMessage:t}))},onKeyDown:n=>{"Enter"===n.key?m||(e?S("rename"):S("save")):"Escape"===n.key&&a.onClose()}}),(0,i.jsx)(lE.J1,{children:m})]})}),(0,i.jsxs)(ea.m,{gap:"5px",children:[(0,i.jsx)(ec.z,{size:"sm",colorScheme:e?void 0:"blue",onClick:()=>{S("save")},isDisabled:!x||!!m||!p,children:e?"Save as New File":"Confirm"}),e&&(0,i.jsx)(ec.z,{size:"sm",colorScheme:"blue",onClick:()=>{S("rename")},isDisabled:!x||!!m||!p,children:"Rename"})]})]})]}),(0,i.jsxs)(et.u_,{isOpen:c.isOpen,onClose:c.onClose,initialFocusRef:w,isCentered:!0,children:[(0,i.jsx)(ei.Z,{}),(0,i.jsxs)(er.h,{children:[(0,i.jsx)(el.x,{children:"Overwrite File?"}),(0,i.jsx)(eA.o,{}),(0,i.jsxs)(es.f,{borderTop:"solid 1px lightgray",borderBottom:"solid 1px lightgray",onKeyDown:e=>{e.stopPropagation()},children:[(0,i.jsx)(r.x,{fontSize:"12pt",children:"save"===f?"Saving a file with this name will overwrite the existing file. Are you sure you wish to continue?":"Renaming the file with this name will overwrite the existing file. Are you sure you wish to continue?"}),(0,i.jsx)(ng.X,{isChecked:g,onChange:e=>{j(n=>({...n,bypass:e.target.checked}))},fontWeight:"bold",size:"sm",pt:"8px",children:"Don't show this again"})]}),(0,i.jsxs)(ea.m,{gap:"5px",children:[(0,i.jsx)(ec.z,{variant:"outline",onClick:()=>{c.onClose(),a.onOpen(),j(e=>({...e,overwriteWithMethod:void 0}))},size:"sm",children:"Back"}),(0,i.jsx)(ec.z,{size:"sm",colorScheme:"blue",onClick:()=>{f&&(S(f,!0),c.onClose())},children:"Overwrite"})]})]})]})]})};var lM=t(36440),lF=t(52149);function lN(){return(0,i.jsx)(nT.u,{label:"Syncing",children:(0,i.jsx)(ec.z,{pt:"6px",variant:"unstyled",boxSize:"1em",children:(0,i.jsx)(t3.$,{})})})}function lq(){let[e,n]=(0,v.useState)(!1),t=(0,b.NL)(),[l,o]=(0,eF.TH)(),{isOpen:a,onOpen:c,onClose:d}=(0,en.q)(),[u,h]=(0,v.useState)(""),x=(0,ee.p)(),m=(0,v.useCallback)(async e=>{if(d(),n(!0),"conflict"===(await lr(e)).status){c(),n(!1);return}for(;await li();)await new Promise(e=>setTimeout(e,1e3));x({description:"Sync Completed",status:"success",variant:"left-accent",position:"bottom",duration:5e3,isClosable:!0}),n(!1),h(""),t.invalidateQueries({queryKey:B.lineage()}),t.invalidateQueries({queryKey:B.checks()}),t.invalidateQueries({queryKey:B.runs()}),/^\/checks\/([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/.test(l)&&o("/checks")},[t,l,o,x,c,d]);return e?(0,i.jsx)(lN,{}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(nT.u,{label:"Sync with Cloud",children:(0,i.jsx)(nW.h,{size:"sm",variant:"unstyled","aria-label":"Sync state",onClick:()=>m({}),icon:(0,i.jsx)(s.J,{as:i8,verticalAlign:"middle",boxSize:"16px"})})}),(0,i.jsxs)(et.u_,{isOpen:a,onClose:d,children:[(0,i.jsx)(ei.Z,{}),(0,i.jsxs)(er.h,{children:[(0,i.jsx)(el.x,{fontSize:"lg",fontWeight:"bold",children:"Sync with Cloud"}),(0,i.jsxs)(es.f,{children:[(0,i.jsx)(r.x,{children:"New changes have been detected in the cloud. Please choose a method to sync your state"}),(0,i.jsx)(r.x,{mt:"5px",children:(0,i.jsx)(lM.E,{onChange:h,value:u,children:(0,i.jsxs)(tY.K,{direction:"column",children:[(0,i.jsxs)(lF.Y,{value:"merge",children:["Merge",(0,i.jsx)(nT.u,{label:"This will merge the local and remote states.",children:(0,i.jsx)("span",{children:(0,i.jsx)(s.J,{as:rI.h,ml:2,cursor:"pointer"})})})]}),(0,i.jsxs)(lF.Y,{value:"overwrite",children:["Overwrite",(0,i.jsx)(nT.u,{label:"This will overwrite the remote state file with the local state.",children:(0,i.jsx)("span",{children:(0,i.jsx)(s.J,{as:rI.h,ml:2,cursor:"pointer"})})})]}),(0,i.jsxs)(lF.Y,{value:"revert",children:["Revert",(0,i.jsx)(nT.u,{label:"This will discard local changes and revert to the cloud state.",children:(0,i.jsx)("span",{children:(0,i.jsx)(s.J,{as:rI.h,ml:2,cursor:"pointer"})})})]})]})})})]}),(0,i.jsxs)(ea.m,{children:[(0,i.jsx)(ec.z,{onClick:d,mr:3,children:"Cancel"}),(0,i.jsx)(ec.z,{colorScheme:"blue",onClick:()=>m({method:u}),isDisabled:!u,children:"Sync"})]})]})]})]})}let lH=e=>{let{children:n,path:t}=e,[l]=(0,eF.yj)(t);return(0,i.jsx)(r.x,{display:l?"block":"none",height:"100%",children:n})};function lV(e){let{icon:n,href:t,...r}=e;return(0,i.jsx)(l.r,{height:"20px",color:"white",href:t,isExternal:!0,...r,children:(0,i.jsx)(s.J,{color:"white",boxSize:"20px",as:n})})}function lP(){let{reviewMode:e,isDemoSite:n,envInfo:t,cloudMode:x,isLoading:m}=eD(),p=function(){let[e,n]=(0,v.useState)("");return(0,v.useEffect)(()=>{(async function(){try{let e=await X.get("/api/version");n(e.data)}catch(e){console.error("Error fetching version number:",e)}})()},[]),e}(),{url:f,id:g}=(null==t?void 0:t.pullRequest)||{},j=f?f.split("/").pop():null;return(0,i.jsxs)(o.k,{gap:"10px",minHeight:"40px",alignItems:"center",bg:"rgb(255, 110, 66)",children:[(0,i.jsx)(a.E,{boxSize:"20px",ml:"18px",src:"/logo/recce-logo-white.png",alt:"recce-logo-white"}),(0,i.jsx)(c.X,{as:"h1",fontFamily:'"Montserrat", sans-serif',fontSize:"lg",color:"white",children:"RECCE"}),(0,i.jsx)(d.C,{fontSize:"sm",color:"white",colorScheme:"whiteAlpha",variant:"outline",children:p}),e&&(0,i.jsx)(d.C,{fontSize:"sm",color:"white",colorScheme:"whiteAlpha",variant:"outline",children:"review mode"}),x&&(0,i.jsx)(d.C,{fontSize:"sm",color:"white",colorScheme:"whiteAlpha",variant:"outline",children:(0,i.jsxs)(u.U,{children:[(0,i.jsx)(r.x,{children:"cloud mode"}),(0,i.jsx)(r.x,{borderLeft:"1px",borderLeftColor:"whiteAlpha.500",paddingLeft:"8px",children:(0,i.jsxs)(l.r,{href:f,_hover:{textDecoration:"none"},isExternal:!0,children:[(0,i.jsx)(s.J,{as:nr.X9P,boxSize:"3",fontWeight:"extrabold",strokeWidth:"1"})," #".concat(g)]})})]})}),n&&f&&(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(d.C,{fontSize:"sm",color:"white",colorScheme:"whiteAlpha",variant:"outline",children:(0,i.jsxs)(u.U,{children:[(0,i.jsx)(r.x,{children:"demo mode"}),(0,i.jsx)(r.x,{borderLeft:"1px",borderLeftColor:"whiteAlpha.500",paddingLeft:"8px",children:(0,i.jsxs)(l.r,{href:f,_hover:{textDecoration:"none"},isExternal:!0,children:[(0,i.jsx)(s.J,{as:nr.X9P,boxSize:"3",fontWeight:"extrabold",strokeWidth:"1"})," #".concat(j)]})})]})})}),(0,i.jsx)(h.L,{}),(0,i.jsx)(lV,{icon:tM.hJX,href:"https://github.com/DataRecce/recce"}),(0,i.jsx)(lV,{icon:tM.w5k,href:"https://getdbt.slack.com/archives/C05C28V7CPP"}),(0,i.jsx)(lV,{mr:"18px",icon:tM.MXt,href:"https://datarecce.io/docs"})]})}function lW(e){let{queryKey:n,fetchCallback:t,selectCallback:l}=e,{data:s,isLoading:o,error:a}=(0,y.a)({queryKey:n,queryFn:t,select:l});return o||a||0===s?(0,i.jsx)(i.Fragment,{}):(0,i.jsx)(r.x,{ml:"2px",height:"80%",aspectRatio:1,borderRadius:"full",bg:"tomato",alignContent:"center",color:"white",fontSize:"xs",children:s})}function lK(){let{isDemoSite:e,reviewMode:n,fileMode:t,cloudMode:l,isLoading:s}=eD(),[a,c]=(0,eF.TH)(),{data:d,isLoading:u}=eL(),h=(0,i.jsx)(lW,{queryKey:B.checks(),fetchCallback:te,selectCallback:e=>e.filter(e=>!e.is_checked).length}),f=[{name:"Lineage",href:"/lineage"},{name:"Query",href:"/query",disable:(null==d?void 0:d.single_env_onboarding)===!0},{name:"Checklist",href:"/checks",badge:h,disable:(null==d?void 0:d.single_env_onboarding)===!0}],g=eW().findIndex(f,e=>{let{href:n}=e;return a.startsWith(n)});return(0,i.jsx)(x.m,{index:g,children:(0,i.jsxs)(m.t,{children:[(0,i.jsx)(r.x,{flex:"1",display:"flex",children:f.map(e=>{let{name:n,href:t,badge:r,disable:l}=e;return(0,i.jsxs)(p.O,{onClick:()=>{c(t)},isDisabled:s||u||l,hidden:l,children:[n,r]},n)})}),!s&&!e&&(0,i.jsx)(lA,{}),!s&&(0,i.jsxs)(o.k,{flex:"1",justifyContent:"right",alignItems:"center",mr:"8px",children:[l&&(0,i.jsx)(lq,{}),(0,i.jsx)(lj,{}),(0,i.jsx)(rs,{})]})]})})}function lB(){let{isRunResultOpen:e,isHistoryOpen:n,closeRunResult:t}=n2(),{data:l}=eL(),[s]=(0,eF.TH)(),o=n&&!s.startsWith("/checks");return(0,i.jsxs)(tD,{sizes:[0,100],minSize:o?300:0,gutterSize:o?5:0,style:{height:"100%"},children:[(0,i.jsx)(r.x,{style:{contain:"size"},children:o&&(0,i.jsx)(l_,{})}),(0,i.jsxs)(tO,{sizes:e?[50,50]:[100,0],minSize:e?100:0,gutterSize:e?5:0,style:{flex:"1",contain:"size"},children:[(0,i.jsx)(r.x,{p:0,style:{contain:"content"},children:(0,i.jsxs)(lg,{children:[(0,i.jsx)(lH,{path:"/lineage",children:(0,i.jsx)(lv,{})}),(0,i.jsxs)(eF.rs,{children:[(0,i.jsx)(eF.AW,{path:"/query",children:(0,i.jsx)(lc,{})}),(0,i.jsx)(eF.AW,{path:"/checks/:slug*",children:(0,i.jsx)(ls,{})}),(0,i.jsx)(eF.AW,{path:"/runs/:runId",children:e=>{let{runId:n}=e;return(0,i.jsx)(lp,{runId:n})}}),(0,i.jsx)(eF.AW,{path:"/ssr",children:(0,i.jsx)(f.E,{size:"xs",isIndeterminate:!0})}),(0,i.jsx)(eF.AW,{children:(0,i.jsx)(eF.l_,{to:"/lineage"})})]})]})}),e?(0,i.jsx)(iF,{onClose:t,disableAddToChecklist:null!=l&&!!l.single_env_onboarding}):(0,i.jsx)(r.x,{})]})]})}let lJ=(0,g.B1)({components:{Checkbox:lL,Tooltip:lI}});function lU(){(0,v.useLayoutEffect)(()=>{!function(){let e=function(e){let n=document.cookie.match("(^|;)\\s*"+e+"\\s*=\\s*([^;]+)");return n?n.pop():""}("recce_user_id"),n="b1ea2155354b7e1e41981715f16599f2";if(e&&n)try{eh.S1(n,e,{defaultTracking:!0})}catch(e){console.error(e)}}()},[]);let e=(0,lx.Z)({components:{MuiTooltip:{styleOverrides:{tooltip:{zIndex:1500}}}}});return(0,i.jsx)(lm.Z,{theme:e,children:(0,i.jsx)(j.x,{theme:lJ,children:(0,i.jsx)(b.aH,{client:G,children:(0,i.jsx)(eF.F0,{hook:lh,children:(0,i.jsx)(n9,{children:(0,i.jsxs)(o.k,{direction:"column",height:"100vh",overflow:"hidden",children:[(0,i.jsx)(lP,{}),(0,i.jsx)(lK,{}),(0,i.jsx)(lb,{}),(0,i.jsx)(lB,{})]})})})})})})}},86257:function(){},12874:function(){},57728:function(){},39399:function(){}},function(e){e.O(0,[869,266,517,678,509,895,989,147,995,739,283,303,22,25,355,495,599,971,764,648,921,744],function(){return e(e.s=16185)}),_N_E=e.O()}]);
|