@baasix/baasix 0.1.0
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.
- package/LICENSE.MD +85 -0
- package/README.md +526 -0
- package/assets/banner.jpg +0 -0
- package/assets/banner_small.jpg +0 -0
- package/assets/logo_icon.svg +20 -0
- package/assets/logo_icon_rounded.svg +20 -0
- package/dist/LICENSE.MD +85 -0
- package/dist/README.md +526 -0
- package/dist/app/404/index.html +1 -0
- package/dist/app/404.html +1 -0
- package/dist/app/_next/static/chunks/041e1f03-56ae8a902a7f2fe6.js +24 -0
- package/dist/app/_next/static/chunks/1117-05479929a8da73e3.js +1 -0
- package/dist/app/_next/static/chunks/1299.77cc7b7b76b75cba.js +1 -0
- package/dist/app/_next/static/chunks/1303-35a96e9c9cdeab9d.js +1 -0
- package/dist/app/_next/static/chunks/1509-56ac00cdaaecdf53.js +1 -0
- package/dist/app/_next/static/chunks/1668-e3eabd0f6753c780.js +1 -0
- package/dist/app/_next/static/chunks/1783-d9fb550fd324300c.js +1 -0
- package/dist/app/_next/static/chunks/2117-29b5fa47421595ad.js +2 -0
- package/dist/app/_next/static/chunks/2344.35b46d2179a765b5.js +1 -0
- package/dist/app/_next/static/chunks/257.990da16794a31292.js +1 -0
- package/dist/app/_next/static/chunks/2676-73b0ee7c80073a84.js +1 -0
- package/dist/app/_next/static/chunks/3563-b8842744384391fe.js +1 -0
- package/dist/app/_next/static/chunks/363642f4-933b579ed3c85f60.js +1 -0
- package/dist/app/_next/static/chunks/3817-e20c8f0a0810fc95.js +1 -0
- package/dist/app/_next/static/chunks/3834.84944e390d902509.js +2 -0
- package/dist/app/_next/static/chunks/4043-3a30c8a75896f241.js +1 -0
- package/dist/app/_next/static/chunks/4225-14090c7c0cd9dec6.js +1 -0
- package/dist/app/_next/static/chunks/4438-c9a12ca15b6e9160.js +1 -0
- package/dist/app/_next/static/chunks/4458-679fd0c6884f456a.js +1 -0
- package/dist/app/_next/static/chunks/4475-8bdfbd536fba8c48.js +1 -0
- package/dist/app/_next/static/chunks/4883-8a924721bb21b3b0.js +1 -0
- package/dist/app/_next/static/chunks/489-683ab07188f9df2b.js +1 -0
- package/dist/app/_next/static/chunks/4952-1b97320cf61f3f21.js +1 -0
- package/dist/app/_next/static/chunks/5094-8d53e403235d4ca6.js +1 -0
- package/dist/app/_next/static/chunks/5101-3a146e0625747ad1.js +1 -0
- package/dist/app/_next/static/chunks/54a60aa6-d9747982e0a81f58.js +79 -0
- package/dist/app/_next/static/chunks/5650-f096291df402bfc2.js +1 -0
- package/dist/app/_next/static/chunks/600-539045311240f579.js +1 -0
- package/dist/app/_next/static/chunks/6170-803b82e19d3ade6d.js +89 -0
- package/dist/app/_next/static/chunks/6241-30d7169d1010e5a4.js +1 -0
- package/dist/app/_next/static/chunks/6530-a91e10cffa4200c4.js +1 -0
- package/dist/app/_next/static/chunks/6547-4bbbdb5c399aef1e.js +1 -0
- package/dist/app/_next/static/chunks/6712-781937c53a2c49da.js +1 -0
- package/dist/app/_next/static/chunks/6fcbdc68-90be1a5480b8d353.js +1 -0
- package/dist/app/_next/static/chunks/70e0d97a-aeaf0cdc26ba1a58.js +1 -0
- package/dist/app/_next/static/chunks/7214-5154a89d08d24dde.js +1 -0
- package/dist/app/_next/static/chunks/7324-b53229c59a640880.js +10 -0
- package/dist/app/_next/static/chunks/7636-66424f0b51d350e9.js +1 -0
- package/dist/app/_next/static/chunks/7874-39a3f2541165a675.js +1 -0
- package/dist/app/_next/static/chunks/7982-9da12b83f11e3f5f.js +1 -0
- package/dist/app/_next/static/chunks/8213a2eb-da25a3b3c5521b2b.js +1 -0
- package/dist/app/_next/static/chunks/8473-6598318371eca31b.js +1 -0
- package/dist/app/_next/static/chunks/8640fa6b-72e43370f68e5587.js +1 -0
- package/dist/app/_next/static/chunks/9090-3ef676f29c95f1c7.js +1 -0
- package/dist/app/_next/static/chunks/9124-a02f9e209e6e3cce.js +1 -0
- package/dist/app/_next/static/chunks/926-156f32067d111d6b.js +1 -0
- package/dist/app/_next/static/chunks/9487-b17481605e513b83.js +1 -0
- package/dist/app/_next/static/chunks/9599-a7e572bb88c3392b.js +1 -0
- package/dist/app/_next/static/chunks/9881-419697138376e755.js +1 -0
- package/dist/app/_next/static/chunks/app/(authenticated)/activity-log/all-activity/page-8917930b4d663405.js +1 -0
- package/dist/app/_next/static/chunks/app/(authenticated)/activity-log/email-log/page-b27a6ee32782d7df.js +1 -0
- package/dist/app/_next/static/chunks/app/(authenticated)/activity-log/notifications/page-b7eda523ede2702c.js +1 -0
- package/dist/app/_next/static/chunks/app/(authenticated)/activity-log/page-1cfa62d1caedaed0.js +1 -0
- package/dist/app/_next/static/chunks/app/(authenticated)/activity-log/sessions/page-3e21e20db90aeff7.js +1 -0
- package/dist/app/_next/static/chunks/app/(authenticated)/activity-log/workflow-executions/page-27bcc26b747fb29b.js +1 -0
- package/dist/app/_next/static/chunks/app/(authenticated)/activity-log/workflow-logs/page-9f9e9e952aef436e.js +1 -0
- package/dist/app/_next/static/chunks/app/(authenticated)/change-password/page-8d61aa499eabb127.js +1 -0
- package/dist/app/_next/static/chunks/app/(authenticated)/dashboard/page-1ceeac9e72997a8a.js +1 -0
- package/dist/app/_next/static/chunks/app/(authenticated)/data-browser/page-8cda2b57759dd670.js +1 -0
- package/dist/app/_next/static/chunks/app/(authenticated)/file-manager/page-8c6f1b1da66ad7e4.js +1 -0
- package/dist/app/_next/static/chunks/app/(authenticated)/layout-f70d225b2759c998.js +1 -0
- package/dist/app/_next/static/chunks/app/(authenticated)/settings/migrations/page-aacec8f7cfb40ab2.js +1 -0
- package/dist/app/_next/static/chunks/app/(authenticated)/settings/permissions/page-828110cfcde429c6.js +1 -0
- package/dist/app/_next/static/chunks/app/(authenticated)/settings/project/page-420e794bb76bd204.js +1 -0
- package/dist/app/_next/static/chunks/app/(authenticated)/settings/roles/page-9001d02b28f70708.js +1 -0
- package/dist/app/_next/static/chunks/app/(authenticated)/settings/schema/page-899574f35091dd58.js +1 -0
- package/dist/app/_next/static/chunks/app/(authenticated)/settings/tasks/page-ad7ab3e27c83f44f.js +1 -0
- package/dist/app/_next/static/chunks/app/(authenticated)/settings/templates/edit/page-bd83414cb8c4cb04.js +1 -0
- package/dist/app/_next/static/chunks/app/(authenticated)/settings/templates/page-3181447f8772b1d3.js +1 -0
- package/dist/app/_next/static/chunks/app/(authenticated)/settings/tenants/page-ef9bfbacef5a1d73.js +1 -0
- package/dist/app/_next/static/chunks/app/(authenticated)/users/invites/page-480306b7b2bbac7e.js +1 -0
- package/dist/app/_next/static/chunks/app/(authenticated)/users/list/page-74da51254c2606b3.js +1 -0
- package/dist/app/_next/static/chunks/app/(authenticated)/users/page-e99c6f0b915001b2.js +1 -0
- package/dist/app/_next/static/chunks/app/(authenticated)/users/preferences/page-1a935630ce8f2b12.js +1 -0
- package/dist/app/_next/static/chunks/app/(authenticated)/users/user-roles/page-901dfb8ea1f39ca8.js +1 -0
- package/dist/app/_next/static/chunks/app/(authenticated)/workflows/detail/page-9a6b839aea688ca4.js +1 -0
- package/dist/app/_next/static/chunks/app/(authenticated)/workflows/edit/page-11774efbc2fecae2.js +1 -0
- package/dist/app/_next/static/chunks/app/(authenticated)/workflows/execution/page-8ec1aea90412c03d.js +1 -0
- package/dist/app/_next/static/chunks/app/(authenticated)/workflows/page-88bc5b36ccb0a1f7.js +1 -0
- package/dist/app/_next/static/chunks/app/(public)/forgot-password/page-ed263fd46ef81c20.js +1 -0
- package/dist/app/_next/static/chunks/app/(public)/layout-f538977545844af8.js +1 -0
- package/dist/app/_next/static/chunks/app/(public)/login/page-c0a10b137f346096.js +1 -0
- package/dist/app/_next/static/chunks/app/(public)/register/page-4cb7644893efd9b3.js +1 -0
- package/dist/app/_next/static/chunks/app/_not-found/page-653f8815b78256cc.js +1 -0
- package/dist/app/_next/static/chunks/app/layout-591ca7a3e16528a1.js +1 -0
- package/dist/app/_next/static/chunks/app/page-dd19d124b5fa2577.js +1 -0
- package/dist/app/_next/static/chunks/c37d3baf.c2ff165f5b02c692.js +1 -0
- package/dist/app/_next/static/chunks/d0deef33.0379166a4ec23470.js +1 -0
- package/dist/app/_next/static/chunks/fd9d1056-54169f07cd680d6c.js +1 -0
- package/dist/app/_next/static/chunks/framework-8e0e0f4a6b83a956.js +1 -0
- package/dist/app/_next/static/chunks/main-324e91f5a430cddf.js +1 -0
- package/dist/app/_next/static/chunks/main-app-55bcae20c77aaf0e.js +1 -0
- package/dist/app/_next/static/chunks/pages/_app-3c9ca398d360b709.js +1 -0
- package/dist/app/_next/static/chunks/pages/_error-cf5ca766ac8f493f.js +1 -0
- package/dist/app/_next/static/chunks/polyfills-42372ed130431b0a.js +1 -0
- package/dist/app/_next/static/chunks/webpack-2c306566f7ee1b63.js +1 -0
- package/dist/app/_next/static/css/6c4002bae4e236b2.css +3 -0
- package/dist/app/_next/static/css/a275cc2b185e04f8.css +1 -0
- package/dist/app/_next/static/eCWhKA8XHqmB1zgFcEtN2/_buildManifest.js +1 -0
- package/dist/app/_next/static/eCWhKA8XHqmB1zgFcEtN2/_ssgManifest.js +1 -0
- package/dist/app/activity-log/all-activity/index.html +1 -0
- package/dist/app/activity-log/all-activity/index.txt +14 -0
- package/dist/app/activity-log/email-log/index.html +1 -0
- package/dist/app/activity-log/email-log/index.txt +14 -0
- package/dist/app/activity-log/index.html +1 -0
- package/dist/app/activity-log/index.txt +14 -0
- package/dist/app/activity-log/notifications/index.html +1 -0
- package/dist/app/activity-log/notifications/index.txt +14 -0
- package/dist/app/activity-log/sessions/index.html +1 -0
- package/dist/app/activity-log/sessions/index.txt +14 -0
- package/dist/app/activity-log/workflow-executions/index.html +1 -0
- package/dist/app/activity-log/workflow-executions/index.txt +14 -0
- package/dist/app/activity-log/workflow-logs/index.html +1 -0
- package/dist/app/activity-log/workflow-logs/index.txt +14 -0
- package/dist/app/change-password/index.html +1 -0
- package/dist/app/change-password/index.txt +14 -0
- package/dist/app/dashboard/index.html +1 -0
- package/dist/app/dashboard/index.txt +14 -0
- package/dist/app/data-browser/index.html +1 -0
- package/dist/app/data-browser/index.txt +14 -0
- package/dist/app/file-manager/index.html +1 -0
- package/dist/app/file-manager/index.txt +14 -0
- package/dist/app/forgot-password/index.html +1 -0
- package/dist/app/forgot-password/index.txt +13 -0
- package/dist/app/index.html +1 -0
- package/dist/app/index.txt +9 -0
- package/dist/app/login/index.html +1 -0
- package/dist/app/login/index.txt +13 -0
- package/dist/app/logo-dark.png +0 -0
- package/dist/app/logo-icon.svg +81 -0
- package/dist/app/logo-light.png +0 -0
- package/dist/app/register/index.html +1 -0
- package/dist/app/register/index.txt +13 -0
- package/dist/app/settings/migrations/index.html +1 -0
- package/dist/app/settings/migrations/index.txt +14 -0
- package/dist/app/settings/permissions/index.html +1 -0
- package/dist/app/settings/permissions/index.txt +14 -0
- package/dist/app/settings/project/index.html +1 -0
- package/dist/app/settings/project/index.txt +14 -0
- package/dist/app/settings/roles/index.html +1 -0
- package/dist/app/settings/roles/index.txt +14 -0
- package/dist/app/settings/schema/index.html +1 -0
- package/dist/app/settings/schema/index.txt +14 -0
- package/dist/app/settings/tasks/index.html +1 -0
- package/dist/app/settings/tasks/index.txt +14 -0
- package/dist/app/settings/templates/edit/index.html +1 -0
- package/dist/app/settings/templates/edit/index.txt +14 -0
- package/dist/app/settings/templates/index.html +1 -0
- package/dist/app/settings/templates/index.txt +14 -0
- package/dist/app/settings/tenants/index.html +1 -0
- package/dist/app/settings/tenants/index.txt +14 -0
- package/dist/app/users/index.html +1 -0
- package/dist/app/users/index.txt +14 -0
- package/dist/app/users/invites/index.html +1 -0
- package/dist/app/users/invites/index.txt +14 -0
- package/dist/app/users/list/index.html +1 -0
- package/dist/app/users/list/index.txt +14 -0
- package/dist/app/users/preferences/index.html +1 -0
- package/dist/app/users/preferences/index.txt +14 -0
- package/dist/app/users/user-roles/index.html +1 -0
- package/dist/app/users/user-roles/index.txt +14 -0
- package/dist/app/workflows/detail/index.html +1 -0
- package/dist/app/workflows/detail/index.txt +14 -0
- package/dist/app/workflows/edit/index.html +1 -0
- package/dist/app/workflows/edit/index.txt +14 -0
- package/dist/app/workflows/execution/index.html +1 -0
- package/dist/app/workflows/execution/index.txt +14 -0
- package/dist/app/workflows/index.html +1 -0
- package/dist/app/workflows/index.txt +14 -0
- package/dist/app.d.ts +36 -0
- package/dist/app.d.ts.map +1 -0
- package/dist/app.js +546 -0
- package/dist/app.js.map +1 -0
- package/dist/auth/adapters/baasix-adapter.d.ts +12 -0
- package/dist/auth/adapters/baasix-adapter.d.ts.map +1 -0
- package/dist/auth/adapters/baasix-adapter.js +318 -0
- package/dist/auth/adapters/baasix-adapter.js.map +1 -0
- package/dist/auth/adapters/index.d.ts +6 -0
- package/dist/auth/adapters/index.d.ts.map +1 -0
- package/dist/auth/adapters/index.js +5 -0
- package/dist/auth/adapters/index.js.map +1 -0
- package/dist/auth/core.d.ts +73 -0
- package/dist/auth/core.d.ts.map +1 -0
- package/dist/auth/core.js +528 -0
- package/dist/auth/core.js.map +1 -0
- package/dist/auth/index.d.ts +56 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +58 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/auth/oauth2/index.d.ts +5 -0
- package/dist/auth/oauth2/index.d.ts.map +1 -0
- package/dist/auth/oauth2/index.js +5 -0
- package/dist/auth/oauth2/index.js.map +1 -0
- package/dist/auth/oauth2/utils.d.ts +90 -0
- package/dist/auth/oauth2/utils.d.ts.map +1 -0
- package/dist/auth/oauth2/utils.js +167 -0
- package/dist/auth/oauth2/utils.js.map +1 -0
- package/dist/auth/providers/apple.d.ts +28 -0
- package/dist/auth/providers/apple.d.ts.map +1 -0
- package/dist/auth/providers/apple.js +192 -0
- package/dist/auth/providers/apple.js.map +1 -0
- package/dist/auth/providers/credential.d.ts +87 -0
- package/dist/auth/providers/credential.d.ts.map +1 -0
- package/dist/auth/providers/credential.js +162 -0
- package/dist/auth/providers/credential.js.map +1 -0
- package/dist/auth/providers/facebook.d.ts +26 -0
- package/dist/auth/providers/facebook.d.ts.map +1 -0
- package/dist/auth/providers/facebook.js +112 -0
- package/dist/auth/providers/facebook.js.map +1 -0
- package/dist/auth/providers/github.d.ts +29 -0
- package/dist/auth/providers/github.d.ts.map +1 -0
- package/dist/auth/providers/github.js +144 -0
- package/dist/auth/providers/github.js.map +1 -0
- package/dist/auth/providers/google.d.ts +32 -0
- package/dist/auth/providers/google.d.ts.map +1 -0
- package/dist/auth/providers/google.js +145 -0
- package/dist/auth/providers/google.js.map +1 -0
- package/dist/auth/providers/index.d.ts +22 -0
- package/dist/auth/providers/index.d.ts.map +1 -0
- package/dist/auth/providers/index.js +17 -0
- package/dist/auth/providers/index.js.map +1 -0
- package/dist/auth/routes.d.ts +63 -0
- package/dist/auth/routes.d.ts.map +1 -0
- package/dist/auth/routes.js +827 -0
- package/dist/auth/routes.js.map +1 -0
- package/dist/auth/services/index.d.ts +10 -0
- package/dist/auth/services/index.d.ts.map +1 -0
- package/dist/auth/services/index.js +7 -0
- package/dist/auth/services/index.js.map +1 -0
- package/dist/auth/services/session.d.ts +81 -0
- package/dist/auth/services/session.d.ts.map +1 -0
- package/dist/auth/services/session.js +186 -0
- package/dist/auth/services/session.js.map +1 -0
- package/dist/auth/services/token.d.ts +41 -0
- package/dist/auth/services/token.d.ts.map +1 -0
- package/dist/auth/services/token.js +44 -0
- package/dist/auth/services/token.js.map +1 -0
- package/dist/auth/services/verification.d.ts +77 -0
- package/dist/auth/services/verification.d.ts.map +1 -0
- package/dist/auth/services/verification.js +143 -0
- package/dist/auth/services/verification.js.map +1 -0
- package/dist/auth/types.d.ts +318 -0
- package/dist/auth/types.d.ts.map +1 -0
- package/dist/auth/types.js +6 -0
- package/dist/auth/types.js.map +1 -0
- package/dist/customTypes/arrays.d.ts +200 -0
- package/dist/customTypes/arrays.d.ts.map +1 -0
- package/dist/customTypes/arrays.js +309 -0
- package/dist/customTypes/arrays.js.map +1 -0
- package/dist/customTypes/index.d.ts +8 -0
- package/dist/customTypes/index.d.ts.map +1 -0
- package/dist/customTypes/index.js +11 -0
- package/dist/customTypes/index.js.map +1 -0
- package/dist/customTypes/postgis.d.ts +146 -0
- package/dist/customTypes/postgis.d.ts.map +1 -0
- package/dist/customTypes/postgis.js +315 -0
- package/dist/customTypes/postgis.js.map +1 -0
- package/dist/customTypes/ranges.d.ts +128 -0
- package/dist/customTypes/ranges.d.ts.map +1 -0
- package/dist/customTypes/ranges.js +257 -0
- package/dist/customTypes/ranges.js.map +1 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +42 -0
- package/dist/index.js.map +1 -0
- package/dist/migrations/0.1.0-alpha.0_initial_setup.d.ts +29 -0
- package/dist/migrations/0.1.0-alpha.0_initial_setup.d.ts.map +1 -0
- package/dist/migrations/0.1.0-alpha.0_initial_setup.js +72 -0
- package/dist/migrations/0.1.0-alpha.0_initial_setup.js.map +1 -0
- package/dist/migrations/_example_migration.d.ts +31 -0
- package/dist/migrations/_example_migration.d.ts.map +1 -0
- package/dist/migrations/_example_migration.js +75 -0
- package/dist/migrations/_example_migration.js.map +1 -0
- package/dist/plugins/definePlugin.d.ts +49 -0
- package/dist/plugins/definePlugin.d.ts.map +1 -0
- package/dist/plugins/definePlugin.js +131 -0
- package/dist/plugins/definePlugin.js.map +1 -0
- package/dist/plugins/softDelete.d.ts +179 -0
- package/dist/plugins/softDelete.d.ts.map +1 -0
- package/dist/plugins/softDelete.js +235 -0
- package/dist/plugins/softDelete.js.map +1 -0
- package/dist/routes/auth.route.d.ts +14 -0
- package/dist/routes/auth.route.d.ts.map +1 -0
- package/dist/routes/auth.route.js +421 -0
- package/dist/routes/auth.route.js.map +1 -0
- package/dist/routes/file.route.d.ts +7 -0
- package/dist/routes/file.route.d.ts.map +1 -0
- package/dist/routes/file.route.js +274 -0
- package/dist/routes/file.route.js.map +1 -0
- package/dist/routes/items.route.d.ts +7 -0
- package/dist/routes/items.route.d.ts.map +1 -0
- package/dist/routes/items.route.js +369 -0
- package/dist/routes/items.route.js.map +1 -0
- package/dist/routes/migration.route.d.ts +7 -0
- package/dist/routes/migration.route.d.ts.map +1 -0
- package/dist/routes/migration.route.js +225 -0
- package/dist/routes/migration.route.js.map +1 -0
- package/dist/routes/notification.route.d.ts +7 -0
- package/dist/routes/notification.route.d.ts.map +1 -0
- package/dist/routes/notification.route.js +124 -0
- package/dist/routes/notification.route.js.map +1 -0
- package/dist/routes/openapi.route.d.ts +7 -0
- package/dist/routes/openapi.route.d.ts.map +1 -0
- package/dist/routes/openapi.route.js +2169 -0
- package/dist/routes/openapi.route.js.map +1 -0
- package/dist/routes/permission.route.d.ts +7 -0
- package/dist/routes/permission.route.d.ts.map +1 -0
- package/dist/routes/permission.route.js +158 -0
- package/dist/routes/permission.route.js.map +1 -0
- package/dist/routes/realtime.route.d.ts +21 -0
- package/dist/routes/realtime.route.d.ts.map +1 -0
- package/dist/routes/realtime.route.js +243 -0
- package/dist/routes/realtime.route.js.map +1 -0
- package/dist/routes/reports.route.d.ts +7 -0
- package/dist/routes/reports.route.d.ts.map +1 -0
- package/dist/routes/reports.route.js +95 -0
- package/dist/routes/reports.route.js.map +1 -0
- package/dist/routes/schema.route.d.ts +7 -0
- package/dist/routes/schema.route.d.ts.map +1 -0
- package/dist/routes/schema.route.js +1780 -0
- package/dist/routes/schema.route.js.map +1 -0
- package/dist/routes/settings.route.d.ts +7 -0
- package/dist/routes/settings.route.d.ts.map +1 -0
- package/dist/routes/settings.route.js +154 -0
- package/dist/routes/settings.route.js.map +1 -0
- package/dist/routes/templates.route.d.ts +7 -0
- package/dist/routes/templates.route.d.ts.map +1 -0
- package/dist/routes/templates.route.js +91 -0
- package/dist/routes/templates.route.js.map +1 -0
- package/dist/routes/utils.route.d.ts +7 -0
- package/dist/routes/utils.route.d.ts.map +1 -0
- package/dist/routes/utils.route.js +33 -0
- package/dist/routes/utils.route.js.map +1 -0
- package/dist/routes/workflow.route.d.ts +7 -0
- package/dist/routes/workflow.route.d.ts.map +1 -0
- package/dist/routes/workflow.route.js +787 -0
- package/dist/routes/workflow.route.js.map +1 -0
- package/dist/services/AssetsService.d.ts +39 -0
- package/dist/services/AssetsService.d.ts.map +1 -0
- package/dist/services/AssetsService.js +255 -0
- package/dist/services/AssetsService.js.map +1 -0
- package/dist/services/CacheService.d.ts +169 -0
- package/dist/services/CacheService.d.ts.map +1 -0
- package/dist/services/CacheService.js +722 -0
- package/dist/services/CacheService.js.map +1 -0
- package/dist/services/FilesService.d.ts +30 -0
- package/dist/services/FilesService.d.ts.map +1 -0
- package/dist/services/FilesService.js +268 -0
- package/dist/services/FilesService.js.map +1 -0
- package/dist/services/HooksManager.d.ts +38 -0
- package/dist/services/HooksManager.d.ts.map +1 -0
- package/dist/services/HooksManager.js +165 -0
- package/dist/services/HooksManager.js.map +1 -0
- package/dist/services/ItemsService.d.ts +273 -0
- package/dist/services/ItemsService.d.ts.map +1 -0
- package/dist/services/ItemsService.js +2458 -0
- package/dist/services/ItemsService.js.map +1 -0
- package/dist/services/MailService.d.ts +76 -0
- package/dist/services/MailService.d.ts.map +1 -0
- package/dist/services/MailService.js +585 -0
- package/dist/services/MailService.js.map +1 -0
- package/dist/services/MigrationService.d.ts +243 -0
- package/dist/services/MigrationService.d.ts.map +1 -0
- package/dist/services/MigrationService.js +914 -0
- package/dist/services/MigrationService.js.map +1 -0
- package/dist/services/NotificationService.d.ts +35 -0
- package/dist/services/NotificationService.d.ts.map +1 -0
- package/dist/services/NotificationService.js +159 -0
- package/dist/services/NotificationService.js.map +1 -0
- package/dist/services/PermissionService.d.ts +128 -0
- package/dist/services/PermissionService.d.ts.map +1 -0
- package/dist/services/PermissionService.js +373 -0
- package/dist/services/PermissionService.js.map +1 -0
- package/dist/services/PluginManager.d.ts +138 -0
- package/dist/services/PluginManager.d.ts.map +1 -0
- package/dist/services/PluginManager.js +463 -0
- package/dist/services/PluginManager.js.map +1 -0
- package/dist/services/RealtimeService.d.ts +209 -0
- package/dist/services/RealtimeService.d.ts.map +1 -0
- package/dist/services/RealtimeService.js +978 -0
- package/dist/services/RealtimeService.js.map +1 -0
- package/dist/services/ReportService.d.ts +13 -0
- package/dist/services/ReportService.d.ts.map +1 -0
- package/dist/services/ReportService.js +91 -0
- package/dist/services/ReportService.js.map +1 -0
- package/dist/services/SettingsService.d.ts +60 -0
- package/dist/services/SettingsService.d.ts.map +1 -0
- package/dist/services/SettingsService.js +474 -0
- package/dist/services/SettingsService.js.map +1 -0
- package/dist/services/SocketService.d.ts +129 -0
- package/dist/services/SocketService.d.ts.map +1 -0
- package/dist/services/SocketService.js +600 -0
- package/dist/services/SocketService.js.map +1 -0
- package/dist/services/StatsService.d.ts +10 -0
- package/dist/services/StatsService.d.ts.map +1 -0
- package/dist/services/StatsService.js +40 -0
- package/dist/services/StatsService.js.map +1 -0
- package/dist/services/StorageService.d.ts +20 -0
- package/dist/services/StorageService.d.ts.map +1 -0
- package/dist/services/StorageService.js +164 -0
- package/dist/services/StorageService.js.map +1 -0
- package/dist/services/TasksService.d.ts +74 -0
- package/dist/services/TasksService.d.ts.map +1 -0
- package/dist/services/TasksService.js +404 -0
- package/dist/services/TasksService.js.map +1 -0
- package/dist/services/WorkflowService.d.ts +305 -0
- package/dist/services/WorkflowService.d.ts.map +1 -0
- package/dist/services/WorkflowService.js +1811 -0
- package/dist/services/WorkflowService.js.map +1 -0
- package/dist/templates/logo/logo.png +0 -0
- package/dist/templates/mails/default.liquid +23 -0
- package/dist/types/aggregation.d.ts +40 -0
- package/dist/types/aggregation.d.ts.map +1 -0
- package/dist/types/aggregation.js +6 -0
- package/dist/types/aggregation.js.map +1 -0
- package/dist/types/assets.d.ts +32 -0
- package/dist/types/assets.d.ts.map +1 -0
- package/dist/types/assets.js +6 -0
- package/dist/types/assets.js.map +1 -0
- package/dist/types/auth.d.ts +50 -0
- package/dist/types/auth.d.ts.map +1 -0
- package/dist/types/auth.js +6 -0
- package/dist/types/auth.js.map +1 -0
- package/dist/types/cache.d.ts +47 -0
- package/dist/types/cache.d.ts.map +1 -0
- package/dist/types/cache.js +6 -0
- package/dist/types/cache.js.map +1 -0
- package/dist/types/database.d.ts +16 -0
- package/dist/types/database.d.ts.map +1 -0
- package/dist/types/database.js +6 -0
- package/dist/types/database.js.map +1 -0
- package/dist/types/fields.d.ts +71 -0
- package/dist/types/fields.d.ts.map +1 -0
- package/dist/types/fields.js +6 -0
- package/dist/types/fields.js.map +1 -0
- package/dist/types/files.d.ts +33 -0
- package/dist/types/files.d.ts.map +1 -0
- package/dist/types/files.js +6 -0
- package/dist/types/files.js.map +1 -0
- package/dist/types/hooks.d.ts +29 -0
- package/dist/types/hooks.d.ts.map +1 -0
- package/dist/types/hooks.js +6 -0
- package/dist/types/hooks.js.map +1 -0
- package/dist/types/import-export.d.ts +62 -0
- package/dist/types/import-export.d.ts.map +1 -0
- package/dist/types/import-export.js +6 -0
- package/dist/types/import-export.js.map +1 -0
- package/dist/types/index.d.ts +31 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +58 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/mail.d.ts +34 -0
- package/dist/types/mail.d.ts.map +1 -0
- package/dist/types/mail.js +6 -0
- package/dist/types/mail.js.map +1 -0
- package/dist/types/notifications.d.ts +16 -0
- package/dist/types/notifications.d.ts.map +1 -0
- package/dist/types/notifications.js +6 -0
- package/dist/types/notifications.js.map +1 -0
- package/dist/types/plugin.d.ts +351 -0
- package/dist/types/plugin.d.ts.map +1 -0
- package/dist/types/plugin.js +8 -0
- package/dist/types/plugin.js.map +1 -0
- package/dist/types/query.d.ts +71 -0
- package/dist/types/query.d.ts.map +1 -0
- package/dist/types/query.js +6 -0
- package/dist/types/query.js.map +1 -0
- package/dist/types/relations.d.ts +111 -0
- package/dist/types/relations.d.ts.map +1 -0
- package/dist/types/relations.js +6 -0
- package/dist/types/relations.js.map +1 -0
- package/dist/types/reports.d.ts +17 -0
- package/dist/types/reports.d.ts.map +1 -0
- package/dist/types/reports.js +6 -0
- package/dist/types/reports.js.map +1 -0
- package/dist/types/schema.d.ts +26 -0
- package/dist/types/schema.d.ts.map +1 -0
- package/dist/types/schema.js +6 -0
- package/dist/types/schema.js.map +1 -0
- package/dist/types/seed.d.ts +27 -0
- package/dist/types/seed.d.ts.map +1 -0
- package/dist/types/seed.js +6 -0
- package/dist/types/seed.js.map +1 -0
- package/dist/types/services.d.ts +68 -0
- package/dist/types/services.d.ts.map +1 -0
- package/dist/types/services.js +6 -0
- package/dist/types/services.js.map +1 -0
- package/dist/types/settings.d.ts +36 -0
- package/dist/types/settings.d.ts.map +1 -0
- package/dist/types/settings.js +6 -0
- package/dist/types/settings.js.map +1 -0
- package/dist/types/sockets.d.ts +26 -0
- package/dist/types/sockets.d.ts.map +1 -0
- package/dist/types/sockets.js +6 -0
- package/dist/types/sockets.js.map +1 -0
- package/dist/types/sort.d.ts +25 -0
- package/dist/types/sort.d.ts.map +1 -0
- package/dist/types/sort.js +6 -0
- package/dist/types/sort.js.map +1 -0
- package/dist/types/spatial.d.ts +19 -0
- package/dist/types/spatial.d.ts.map +1 -0
- package/dist/types/spatial.js +6 -0
- package/dist/types/spatial.js.map +1 -0
- package/dist/types/stats.d.ts +21 -0
- package/dist/types/stats.d.ts.map +1 -0
- package/dist/types/stats.js +6 -0
- package/dist/types/stats.js.map +1 -0
- package/dist/types/storage.d.ts +19 -0
- package/dist/types/storage.d.ts.map +1 -0
- package/dist/types/storage.js +6 -0
- package/dist/types/storage.js.map +1 -0
- package/dist/types/tasks.d.ts +14 -0
- package/dist/types/tasks.d.ts.map +1 -0
- package/dist/types/tasks.js +6 -0
- package/dist/types/tasks.js.map +1 -0
- package/dist/types/utils.d.ts +54 -0
- package/dist/types/utils.d.ts.map +1 -0
- package/dist/types/utils.js +6 -0
- package/dist/types/utils.js.map +1 -0
- package/dist/types/workflow.d.ts +17 -0
- package/dist/types/workflow.d.ts.map +1 -0
- package/dist/types/workflow.js +6 -0
- package/dist/types/workflow.js.map +1 -0
- package/dist/utils/aggregationUtils.d.ts +192 -0
- package/dist/utils/aggregationUtils.d.ts.map +1 -0
- package/dist/utils/aggregationUtils.js +450 -0
- package/dist/utils/aggregationUtils.js.map +1 -0
- package/dist/utils/auth.d.ts +93 -0
- package/dist/utils/auth.d.ts.map +1 -0
- package/dist/utils/auth.js +557 -0
- package/dist/utils/auth.js.map +1 -0
- package/dist/utils/cache.d.ts +64 -0
- package/dist/utils/cache.d.ts.map +1 -0
- package/dist/utils/cache.js +464 -0
- package/dist/utils/cache.js.map +1 -0
- package/dist/utils/common.d.ts +53 -0
- package/dist/utils/common.d.ts.map +1 -0
- package/dist/utils/common.js +162 -0
- package/dist/utils/common.js.map +1 -0
- package/dist/utils/db.d.ts +101 -0
- package/dist/utils/db.d.ts.map +1 -0
- package/dist/utils/db.js +413 -0
- package/dist/utils/db.js.map +1 -0
- package/dist/utils/dirname.d.ts +30 -0
- package/dist/utils/dirname.d.ts.map +1 -0
- package/dist/utils/dirname.js +95 -0
- package/dist/utils/dirname.js.map +1 -0
- package/dist/utils/dynamicVariableResolver.d.ts +17 -0
- package/dist/utils/dynamicVariableResolver.d.ts.map +1 -0
- package/dist/utils/dynamicVariableResolver.js +262 -0
- package/dist/utils/dynamicVariableResolver.js.map +1 -0
- package/dist/utils/env.d.ts +38 -0
- package/dist/utils/env.d.ts.map +1 -0
- package/dist/utils/env.js +80 -0
- package/dist/utils/env.js.map +1 -0
- package/dist/utils/errorHandler.d.ts +14 -0
- package/dist/utils/errorHandler.d.ts.map +1 -0
- package/dist/utils/errorHandler.js +79 -0
- package/dist/utils/errorHandler.js.map +1 -0
- package/dist/utils/fieldExpansion.d.ts +30 -0
- package/dist/utils/fieldExpansion.d.ts.map +1 -0
- package/dist/utils/fieldExpansion.js +145 -0
- package/dist/utils/fieldExpansion.js.map +1 -0
- package/dist/utils/fieldUtils.d.ts +179 -0
- package/dist/utils/fieldUtils.d.ts.map +1 -0
- package/dist/utils/fieldUtils.js +424 -0
- package/dist/utils/fieldUtils.js.map +1 -0
- package/dist/utils/filterOperators.d.ts +472 -0
- package/dist/utils/filterOperators.d.ts.map +1 -0
- package/dist/utils/filterOperators.js +1229 -0
- package/dist/utils/filterOperators.js.map +1 -0
- package/dist/utils/importUtils.d.ts +127 -0
- package/dist/utils/importUtils.d.ts.map +1 -0
- package/dist/utils/importUtils.js +437 -0
- package/dist/utils/importUtils.js.map +1 -0
- package/dist/utils/index.d.ts +75 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +101 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/logger.d.ts +41 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +217 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/orderUtils.d.ts +117 -0
- package/dist/utils/orderUtils.d.ts.map +1 -0
- package/dist/utils/orderUtils.js +249 -0
- package/dist/utils/orderUtils.js.map +1 -0
- package/dist/utils/queryBuilder.d.ts +118 -0
- package/dist/utils/queryBuilder.d.ts.map +1 -0
- package/dist/utils/queryBuilder.js +489 -0
- package/dist/utils/queryBuilder.js.map +1 -0
- package/dist/utils/relationLoader.d.ts +65 -0
- package/dist/utils/relationLoader.d.ts.map +1 -0
- package/dist/utils/relationLoader.js +1081 -0
- package/dist/utils/relationLoader.js.map +1 -0
- package/dist/utils/relationPathResolver.d.ts +30 -0
- package/dist/utils/relationPathResolver.d.ts.map +1 -0
- package/dist/utils/relationPathResolver.js +173 -0
- package/dist/utils/relationPathResolver.js.map +1 -0
- package/dist/utils/relationUtils.d.ts +139 -0
- package/dist/utils/relationUtils.d.ts.map +1 -0
- package/dist/utils/relationUtils.js +711 -0
- package/dist/utils/relationUtils.js.map +1 -0
- package/dist/utils/router.d.ts +6 -0
- package/dist/utils/router.d.ts.map +1 -0
- package/dist/utils/router.js +95 -0
- package/dist/utils/router.js.map +1 -0
- package/dist/utils/schema.d.ts +88 -0
- package/dist/utils/schema.d.ts.map +1 -0
- package/dist/utils/schema.js +24 -0
- package/dist/utils/schema.js.map +1 -0
- package/dist/utils/schemaManager.d.ts +238 -0
- package/dist/utils/schemaManager.d.ts.map +1 -0
- package/dist/utils/schemaManager.js +1992 -0
- package/dist/utils/schemaManager.js.map +1 -0
- package/dist/utils/schemaValidator.d.ts +83 -0
- package/dist/utils/schemaValidator.d.ts.map +1 -0
- package/dist/utils/schemaValidator.js +491 -0
- package/dist/utils/schemaValidator.js.map +1 -0
- package/dist/utils/seed.d.ts +45 -0
- package/dist/utils/seed.d.ts.map +1 -0
- package/dist/utils/seed.js +248 -0
- package/dist/utils/seed.js.map +1 -0
- package/dist/utils/sessionCleanup.d.ts +10 -0
- package/dist/utils/sessionCleanup.d.ts.map +1 -0
- package/dist/utils/sessionCleanup.js +49 -0
- package/dist/utils/sessionCleanup.js.map +1 -0
- package/dist/utils/sortUtils.d.ts +117 -0
- package/dist/utils/sortUtils.d.ts.map +1 -0
- package/dist/utils/sortUtils.js +232 -0
- package/dist/utils/sortUtils.js.map +1 -0
- package/dist/utils/spatialUtils.d.ts +244 -0
- package/dist/utils/spatialUtils.d.ts.map +1 -0
- package/dist/utils/spatialUtils.js +359 -0
- package/dist/utils/spatialUtils.js.map +1 -0
- package/dist/utils/systemschema.d.ts +11040 -0
- package/dist/utils/systemschema.d.ts.map +1 -0
- package/dist/utils/systemschema.js +1777 -0
- package/dist/utils/systemschema.js.map +1 -0
- package/dist/utils/tenantUtils.d.ts +34 -0
- package/dist/utils/tenantUtils.d.ts.map +1 -0
- package/dist/utils/tenantUtils.js +124 -0
- package/dist/utils/tenantUtils.js.map +1 -0
- package/dist/utils/typeMapper.d.ts +25 -0
- package/dist/utils/typeMapper.d.ts.map +1 -0
- package/dist/utils/typeMapper.js +282 -0
- package/dist/utils/typeMapper.js.map +1 -0
- package/dist/utils/valueValidator.d.ts +60 -0
- package/dist/utils/valueValidator.d.ts.map +1 -0
- package/dist/utils/valueValidator.js +303 -0
- package/dist/utils/valueValidator.js.map +1 -0
- package/dist/utils/workflow.d.ts +87 -0
- package/dist/utils/workflow.d.ts.map +1 -0
- package/dist/utils/workflow.js +205 -0
- package/dist/utils/workflow.js.map +1 -0
- package/package.json +115 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3817],{92322:function(e,l,s){s.d(l,{j:function(){return y}});var t=s(57437),a=s(2265),n=s(29501),r=s(12381),i=s(40279),o=s(75060),c=s(23675),d=s(94589),u=s(51817),m=s(90641),h=s(54572),x=s(5101),p=s(24065);let f=["createdAt","updatedAt","deletedAt","userCreated_Id","userUpdated_Id","userDeleted_Id","userCreated","userUpdated","userDeleted"],g=["UUIDV4","SUID","AUTOINCREMENT","NOW"],v=e=>!!e.defaultValue&&"object"==typeof e.defaultValue&&!!e.defaultValue.type&&g.includes(e.defaultValue.type),j=["createdAt","updatedAt","deletedAt"],y=e=>{let{fields:l,initialValues:s,onSubmit:g,isLoading:y,onCancel:N,disabledFields:b=[]}=e,{register:w,handleSubmit:C,setValue:S,watch:T,reset:k,formState:{errors:D}}=(0,n.cI)({defaultValues:s||{}}),[A,_]=(0,a.useState)(!1),[I,E]=(0,a.useState)(null),[O,F]=(0,a.useState)({});(0,a.useEffect)(()=>{if(s){k(s);let e=l.filter(e=>e.relType),t={};e.forEach(e=>{let l=s[e.name];if(("BelongsTo"===e.relType||"HasOne"===e.relType)&&!l&&e.foreignKey){let t=s[e.foreignKey];t&&(l={id:t})}("BelongsTo"===e.relType||"HasOne"===e.relType)&&l?t[e.name]=l:["HasMany","BelongsToMany","M2M","M2A"].includes(e.relType)&&l&&(t[e.name]=Array.isArray(l)?l:[l])}),F(t)}},[s,k,l]);let Z=s&&Object.keys(s).length>0,z=l.filter(e=>e.relType&&e.foreignKey).map(e=>e.foreignKey),M=l.filter(e=>!(z.includes(e.name)||f.includes(e.name))&&(!e.primaryKey||!Z&&!v(e))),P=M.filter(e=>!e.relType),L=M.filter(e=>e.relType),B=(e,l)=>{if("BelongsTo"===e.relType||"HasOne"===e.relType){let s=l?"string"==typeof l?{id:l}:l:null;if(F(l=>({...l,[e.name]:s})),e.foreignKey){let s="string"==typeof l?l:null==l?void 0:l.id;S(e.foreignKey,s)}}else{let s=(Array.isArray(l)?l:[l]).map(e=>"string"==typeof e?{id:e}:e);F(l=>({...l,[e.name]:s}))}},U=(e,l)=>{"BelongsTo"===e.relType||"HasOne"===e.relType?(F(l=>{let s={...l};return delete s[e.name],s}),e.foreignKey&&S(e.foreignKey,null)):F(s=>({...s,[e.name]:(s[e.name]||[]).filter(e=>e.id!==l)}))},R=e=>{E(e),_(!0)};return(0,t.jsxs)("form",{onSubmit:C(e=>{let s={...e};j.forEach(e=>{delete s[e]}),l.filter(e=>e.relType).forEach(e=>{if("BelongsTo"===e.relType||"HasOne"===e.relType){let l=O[e.name];if(l&&e.foreignKey){let t="string"==typeof l?l:l.id;s[e.foreignKey]=t}delete s[e.name]}else if(["HasMany","BelongsToMany","M2M","M2A"].includes(e.relType)){let l=O[e.name];l&&Array.isArray(l)?s[e.name]=l.map(e=>({id:"string"==typeof e?e:e.id})):delete s[e.name]}}),g(s)}),children:[(0,t.jsx)(m.x,{className:"h-[calc(100vh-200px)] pr-4",children:(0,t.jsxs)("div",{className:"space-y-4",children:[P.map(e=>{let l=T(e.name),s=e.name,a=e.label||s.replace(/_/g," "),n=b.includes(s);switch(e.type){case"Boolean":return(0,t.jsxs)("div",{className:"flex items-center justify-between space-x-2",children:[(0,t.jsx)(o._,{htmlFor:s,children:a}),(0,t.jsx)(d.r,{id:s,checked:l||!1,onCheckedChange:e=>S(s,e),disabled:n})]},s);case"Number":case"Integer":case"Float":case"Decimal":case"BigInt":return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(o._,{htmlFor:s,children:a}),(0,t.jsx)(i.I,{id:s,type:"number",step:"Integer"===e.type||"BigInt"===e.type?"1":"any",disabled:n,...w(s,{valueAsNumber:!0})})]},s);case"Date":return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(o._,{htmlFor:s,children:a}),(0,t.jsx)(i.I,{id:s,type:"date",value:(e=>{if(!e)return"";let l=new Date(e),s=l.getFullYear(),t=String(l.getMonth()+1).padStart(2,"0"),a=String(l.getDate()).padStart(2,"0");return"".concat(s,"-").concat(t,"-").concat(a)})(l),disabled:n,onChange:e=>{S(s,e.target.value||null)}})]},s);case"DateTime":case"DateTime_NO_TZ":case"DATETIME":case"TIMESTAMP":return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(o._,{htmlFor:s,children:a}),(0,t.jsx)(i.I,{id:s,type:"datetime-local",value:(e=>{if(!e)return"";let l=new Date(e),s=l.getFullYear(),t=String(l.getMonth()+1).padStart(2,"0"),a=String(l.getDate()).padStart(2,"0"),n=String(l.getHours()).padStart(2,"0"),r=String(l.getMinutes()).padStart(2,"0");return"".concat(s,"-").concat(t,"-").concat(a,"T").concat(n,":").concat(r)})(l),disabled:n,onChange:e=>{S(s,e.target.value?new Date(e.target.value).toISOString():null)}})]},s);case"Time":case"Time_NO_TZ":return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(o._,{htmlFor:s,children:a}),(0,t.jsx)(i.I,{id:s,type:"time",value:(e=>{if(!e)return"";if("string"==typeof e){let l=e.match(/^(\d{2}):(\d{2})/);if(l)return"".concat(l[1],":").concat(l[2]);if(e.includes("T")){let l=new Date(e),s=String(l.getHours()).padStart(2,"0"),t=String(l.getMinutes()).padStart(2,"0");return"".concat(s,":").concat(t)}}return e})(l),disabled:n,onChange:e=>{S(s,e.target.value||null)}})]},s);case"Text":case"LONGTEXT":case"MEDIUMTEXT":return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(o._,{htmlFor:s,children:a}),(0,t.jsx)(c.g,{id:s,rows:4,disabled:n,...w(s)})]},s);case"JSON":case"JSONB":return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(o._,{htmlFor:s,children:a}),(0,t.jsx)(h.mq,{value:l,onChange:e=>S(s,e),disabled:n})]},s);case"Enum":case"ENUM":return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(o._,{htmlFor:s,children:a}),(0,t.jsx)(h.o_,{value:l||"",onChange:e=>S(s,e),options:e.values||[],placeholder:"Select an option",allowNull:e.allowNull,disabled:n})]},s);case"Email":return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(o._,{htmlFor:s,children:a}),(0,t.jsx)(i.I,{id:s,type:"email",disabled:n,...w(s)})]},s);case"URL":return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(o._,{htmlFor:s,children:a}),(0,t.jsx)(i.I,{id:s,type:"url",placeholder:"https://",disabled:n,...w(s)})]},s);case"Phone":return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(o._,{htmlFor:s,children:a}),(0,t.jsx)(i.I,{id:s,type:"tel",disabled:n,...w(s)})]},s);case"Password":return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(o._,{htmlFor:s,children:a}),(0,t.jsx)(i.I,{id:s,type:"password",disabled:n,...w(s)})]},s);case"Array_Integer":return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(o._,{htmlFor:s,children:a}),(0,t.jsx)(h.OF,{value:l||[],onChange:e=>S(s,e,{shouldDirty:!0,shouldTouch:!0}),itemType:"number"})]},s);case"Array_String":return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(o._,{htmlFor:s,children:a}),(0,t.jsx)(h.OF,{value:l||[],onChange:e=>S(s,e,{shouldDirty:!0,shouldTouch:!0}),itemType:"string"})]},s);case"Array_Double":case"Array_Decimal":return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(o._,{htmlFor:s,children:a}),(0,t.jsx)(h.OF,{value:l||[],onChange:e=>S(s,e,{shouldDirty:!0,shouldTouch:!0}),itemType:"number"})]},s);case"Array_UUID":return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(o._,{htmlFor:s,children:a}),(0,t.jsx)(h.OF,{value:l||[],onChange:e=>S(s,e,{shouldDirty:!0,shouldTouch:!0}),itemType:"string",placeholder:"Enter UUID values"})]},s);case"Array_Date":return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(o._,{htmlFor:s,children:a}),(0,t.jsx)(h.OF,{value:l||[],onChange:e=>S(s,e,{shouldDirty:!0,shouldTouch:!0}),itemType:"date"})]},s);case"Array_DateTime":case"Array_DateTime_NO_TZ":return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(o._,{htmlFor:s,children:a}),(0,t.jsx)(h.OF,{value:l||[],onChange:e=>S(s,e,{shouldDirty:!0,shouldTouch:!0}),itemType:"datetime"})]},s);case"Array_Time":case"Array_Time_NO_TZ":return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(o._,{htmlFor:s,children:a}),(0,t.jsx)(h.OF,{value:l||[],onChange:e=>S(s,e,{shouldDirty:!0,shouldTouch:!0}),itemType:"time"})]},s);case"Array_Boolean":return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(o._,{htmlFor:s,children:a}),(0,t.jsx)(h.OF,{value:l||[],onChange:e=>S(s,e,{shouldDirty:!0,shouldTouch:!0}),itemType:"boolean"})]},s);case"Range_Integer":return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(o._,{htmlFor:s,children:a}),(0,t.jsx)(h.sU,{value:l,onChange:e=>S(s,e,{shouldDirty:!0,shouldTouch:!0}),rangeType:"integer"})]},s);case"Range_Double":return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(o._,{htmlFor:s,children:a}),(0,t.jsx)(h.sU,{value:l,onChange:e=>S(s,e,{shouldDirty:!0,shouldTouch:!0}),rangeType:"double"})]},s);case"Range_Decimal":return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(o._,{htmlFor:s,children:a}),(0,t.jsx)(h.sU,{value:l,onChange:e=>S(s,e,{shouldDirty:!0,shouldTouch:!0}),rangeType:"decimal"})]},s);case"Range_Date":return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(o._,{htmlFor:s,children:a}),(0,t.jsx)(h.sU,{value:l,onChange:e=>S(s,e,{shouldDirty:!0,shouldTouch:!0}),rangeType:"date"})]},s);case"Range_DateTime":case"Range_DateTime_NO_TZ":return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(o._,{htmlFor:s,children:a}),(0,t.jsx)(h.sU,{value:l,onChange:e=>S(s,e,{shouldDirty:!0,shouldTouch:!0}),rangeType:"datetime"})]},s);case"Range_Time":case"Range_Time_NO_TZ":return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(o._,{htmlFor:s,children:a}),(0,t.jsx)(h.sU,{value:l,onChange:e=>S(s,e,{shouldDirty:!0,shouldTouch:!0}),rangeType:"time"})]},s);case"Point":return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(o._,{htmlFor:s,children:a}),(0,t.jsx)(h.XG,{value:l,onChange:e=>S(s,e,{shouldDirty:!0,shouldTouch:!0}),geometryType:"Point",fieldName:a})]},s);case"Polygon":return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(o._,{htmlFor:s,children:a}),(0,t.jsx)(h.XG,{value:l,onChange:e=>S(s,e,{shouldDirty:!0,shouldTouch:!0}),geometryType:"Polygon",fieldName:a})]},s);case"LineString":return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(o._,{htmlFor:s,children:a}),(0,t.jsx)(h.XG,{value:l,onChange:e=>S(s,e,{shouldDirty:!0,shouldTouch:!0}),geometryType:"LineString",fieldName:a})]},s);case"MultiPoint":return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(o._,{htmlFor:s,children:a}),(0,t.jsx)(h.XG,{value:l,onChange:e=>S(s,e,{shouldDirty:!0,shouldTouch:!0}),geometryType:"MultiPoint",fieldName:a})]},s);case"MultiPolygon":return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(o._,{htmlFor:s,children:a}),(0,t.jsx)(h.XG,{value:l,onChange:e=>S(s,e,{shouldDirty:!0,shouldTouch:!0}),geometryType:"MultiPolygon",fieldName:a})]},s);case"MultiLineString":return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(o._,{htmlFor:s,children:a}),(0,t.jsx)(h.XG,{value:l,onChange:e=>S(s,e,{shouldDirty:!0,shouldTouch:!0}),geometryType:"MultiLineString",fieldName:a})]},s);default:return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(o._,{htmlFor:s,children:a}),(0,t.jsx)(i.I,{id:s,type:"text",disabled:n,...w(s)})]},s)}}),L.length>0&&(0,t.jsxs)("div",{className:"space-y-4 pt-4 border-t",children:[(0,t.jsx)("h4",{className:"text-sm font-medium text-muted-foreground",children:"Relationships"}),L.map(e=>{let l="BelongsTo"===e.relType||"HasOne"===e.relType?O[e.name]:O[e.name]||[];return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(o._,{children:e.label||e.name.replace(/_/g," ")}),(0,t.jsx)(x.q,{value:l,field:e,onClick:()=>R(e),onRemove:l=>U(e,l)})]},e.name)})]})]})}),(0,t.jsxs)("div",{className:"flex justify-end gap-2 pt-4 border-t mt-4",children:[(0,t.jsx)(r.z,{type:"button",variant:"outline",onClick:N,disabled:y,children:"Cancel"}),(0,t.jsxs)(r.z,{type:"submit",disabled:y,children:[y&&(0,t.jsx)(u.Z,{className:"mr-2 h-4 w-4 animate-spin"}),s?"Update":"Create"]})]}),I&&(0,t.jsx)(p.x,{open:A,onClose:()=>{_(!1),setTimeout(()=>E(null),100)},onSelect:e=>{B(I,e)},target:I.target,field:I,selectedItems:"BelongsTo"===I.relType||"HasOne"===I.relType?O[I.name]?[O[I.name]]:[]:O[I.name]||[]})]})}},24065:function(e,l,s){s.d(l,{x:function(){return N}});var t=s(57437),a=s(2265),n=s(29696),r=s(91032),i=s(12381),o=s(69174),c=s(75060),d=s(17168),u=s(99397),m=s(32489),h=s(69658),x=s(17689),p=s(51817),f=s(72337),g=s(92322),v=s(72135),j=s(14438);let y=e=>{if(0===e)return"0 B";let l=Math.floor(Math.log(e)/Math.log(1024));return parseFloat((e/Math.pow(1024,l)).toFixed(2))+" "+["B","KB","MB","GB"][l]},N=e=>{var l;let{open:s,onClose:N,onSelect:b,target:w,field:C,selectedItems:S=[]}=e,[T,k]=(0,a.useState)(S),[D,A]=(0,a.useState)(!1),[_,I]=(0,a.useState)("select"),[E,O]=(0,a.useState)([]),[F,Z]=(0,a.useState)(!1),[z,M]=(0,a.useState)(0),P=(0,a.useRef)(null),{getFieldsByCollection:L,schemas:B}=(0,n.I_)();(0,v.Ji)();let U="files"===w||"baasix_File"===w,R="HasMany"===C.relType||"BelongsToMany"===C.relType||"M2M"===C.relType||"M2A"===C.relType;(0,a.useEffect)(()=>{s&&(k(S||[]),I("select"),O([]))},[s,S]);let V=L(w),J=null==B?void 0:B.find(e=>e.collectionName===w),q=(0,a.useMemo)(()=>V?Object.entries(V).map(e=>{let[l,s]=e;return{name:l,...s,label:l.replace(/_/g," ").replace(/([A-Z])/g," $1").trim()}}):[],[V]),{mutate:K,isLoading:W}=(0,v.RO)(),G=(0,a.useCallback)(e=>{e.preventDefault(),O(Array.from(e.dataTransfer.files))},[]),H=(0,a.useCallback)(e=>{e.preventDefault()},[]),Y=e=>{O(E.filter((l,s)=>s!==e))},X=async()=>{if(0===E.length)return;Z(!0);let e=[];try{for(let l of E){let s=new FormData;s.append("file",l),await new Promise((t,a)=>{K({resource:"files",values:s},{onSuccess:l=>{let s=null==l?void 0:l.data;s&&e.push(s),t()},onError:e=>{j.Am.error("Failed to upload ".concat(l.name,": ").concat(e.message)),a(e)}})})}if(j.Am.success("".concat(E.length," file(s) uploaded successfully")),Z(!1),e.length>0){if(R){let l=[...T,...e];k(l),b(l),O([]),I("select"),M(e=>e+1)}else{b(e[0]),setTimeout(()=>{N()},50);return}}}catch(e){console.error("Upload error:",e),Z(!1)}},Q=(0,a.useCallback)(e=>{k(e),!R&&e.length>0&&(b(e[0]),N())},[R,b,N]),$=()=>{b(T),N()};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r.yo,{open:s,onOpenChange:e=>!e&&N(),children:(0,t.jsx)(r.ue,{className:"w-full sm:w-[900px] sm:max-w-[900px] flex flex-col p-0",hideDefaultClose:!0,children:U?(0,t.jsxs)(d.mQ,{value:_,onValueChange:e=>I(e),className:"flex-1 flex flex-col min-h-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 border-b shrink-0",children:[(0,t.jsx)(r.sw,{asChild:!0,children:(0,t.jsxs)(i.z,{variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0",children:[(0,t.jsx)(m.Z,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"sr-only",children:"Close"})]})}),(0,t.jsxs)("span",{className:"font-medium truncate text-sm",children:["Select ",(null==C?void 0:C.label)||(null==C?void 0:C.name)]}),R&&T.length>0&&(0,t.jsx)(o.C,{variant:"secondary",className:"shrink-0",children:T.length}),(0,t.jsxs)(d.dr,{className:"grid grid-cols-2 ml-auto",children:[(0,t.jsxs)(d.SP,{value:"select",className:"text-xs px-3",children:[(0,t.jsx)(h.Z,{className:"mr-1.5 h-3.5 w-3.5"}),"Select"]}),(0,t.jsxs)(d.SP,{value:"upload",className:"text-xs px-3",children:[(0,t.jsx)(x.Z,{className:"mr-1.5 h-3.5 w-3.5"}),"Upload"]})]}),R&&(0,t.jsxs)(i.z,{onClick:$,children:["Done (",T.length,")"]})]}),(0,t.jsx)(d.nU,{value:"select",className:"flex-1 flex flex-col min-h-0 mt-0 data-[state=inactive]:hidden",children:(0,t.jsx)("div",{className:"flex-1 flex flex-col min-h-0 px-3 pb-3",children:w&&(0,t.jsx)(f.DataBrowserInner,{selectedCollection:w,hideTitle:!0,enableSearch:!0,enableFilters:!0,enableCreate:!1,enableView:!1,enableEdit:!1,enableDelete:!1,enableExport:!1,enableImport:!1,enableBulkSelect:!1,enableColumnSettings:!1,showSelectionColumn:!0,selectionMode:R?"multiple":"single",externalSelectedRows:T,onExternalSelectionChange:Q,highlightSelectedRows:!0},z)})}),(0,t.jsx)(d.nU,{value:"upload",className:"flex-1 overflow-auto p-4 mt-0 data-[state=inactive]:hidden",children:(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"border-2 border-dashed rounded-lg p-12 text-center cursor-pointer hover:border-primary transition-colors",onClick:()=>{var e;return null===(e=P.current)||void 0===e?void 0:e.click()},onDrop:G,onDragOver:H,children:[(0,t.jsx)(x.Z,{className:"h-12 w-12 mx-auto mb-4 text-muted-foreground"}),(0,t.jsx)("p",{className:"text-lg font-medium",children:"Drag and drop files here"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"or click to browse"}),(0,t.jsx)("input",{ref:P,type:"file",multiple:R,className:"hidden",onChange:e=>{e.target.files&&O(Array.from(e.target.files))}})]}),E.length>0&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(c._,{children:"Selected Files"}),(0,t.jsx)("div",{className:"space-y-2 max-h-60 overflow-y-auto",children:E.map((e,l)=>(0,t.jsxs)("div",{className:"flex items-center justify-between p-3 bg-muted rounded-lg",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 truncate",children:[(0,t.jsx)(h.Z,{className:"h-5 w-5 shrink-0 text-muted-foreground"}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("span",{className:"text-sm font-medium truncate block",children:e.name}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:y(e.size)})]})]}),(0,t.jsx)(i.z,{variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0",onClick:()=>Y(l),children:(0,t.jsx)(m.Z,{className:"h-4 w-4"})})]},l))}),(0,t.jsxs)(i.z,{onClick:X,disabled:F||0===E.length,className:"w-full",children:[F?(0,t.jsx)(p.Z,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(x.Z,{className:"mr-2 h-4 w-4"}),"Upload & Select"]})]})]})})]}):(0,t.jsx)("div",{className:"flex-1 flex flex-col min-h-0 px-3 pb-3 pt-2",children:w&&(0,t.jsx)(f.DataBrowserInner,{selectedCollection:w,hideTitle:!0,enableSearch:!0,enableFilters:!0,enableCreate:!1,enableView:!1,enableEdit:!1,enableDelete:!1,enableExport:!1,enableImport:!1,enableBulkSelect:!1,enableColumnSettings:!1,showSelectionColumn:!0,selectionMode:R?"multiple":"single",externalSelectedRows:T,onExternalSelectionChange:Q,highlightSelectedRows:!0,quickFilters:(0,t.jsxs)("div",{className:"flex items-center gap-2 mr-auto",children:[(0,t.jsx)(r.sw,{asChild:!0,children:(0,t.jsxs)(i.z,{variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0",children:[(0,t.jsx)(m.Z,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"sr-only",children:"Close"})]})}),(0,t.jsxs)("span",{className:"font-medium truncate text-sm",children:["Select ",(null==C?void 0:C.label)||(null==C?void 0:C.name)]}),R&&T.length>0&&(0,t.jsx)(o.C,{variant:"secondary",className:"shrink-0",children:T.length})]}),headerActions:(0,t.jsxs)(t.Fragment,{children:[!U&&(0,t.jsx)(i.z,{size:"icon",onClick:()=>A(!0),title:"Create New",children:(0,t.jsx)(u.Z,{className:"h-4 w-4"})}),R&&(0,t.jsxs)(i.z,{onClick:$,children:["Done (",T.length,")"]})]})})})})}),(0,t.jsx)(r.yo,{open:D,onOpenChange:A,children:(0,t.jsxs)(r.ue,{className:"w-full sm:w-[600px] sm:max-w-[600px] overflow-y-auto",children:[(0,t.jsx)(r.Tu,{children:(0,t.jsxs)(r.bC,{children:["Create New ",(null==J?void 0:null===(l=J.schema)||void 0===l?void 0:l.name)||w]})}),(0,t.jsx)("div",{className:"mt-4",children:(0,t.jsx)(g.j,{fields:q,onSubmit:e=>{K({resource:w,values:e},{onSuccess:e=>{j.Am.success("Item created successfully"),A(!1),R?k([...T,e.data]):(b(e.data),N())},onError:e=>{j.Am.error("Failed to create: ".concat(e.message))}})},isLoading:W,onCancel:()=>A(!1)})})]})})]})}},5101:function(e,l,s){s.d(l,{q:function(){return o}});var t=s(57437);s(2265);var a=s(12381),n=s(69174),r=s(32489),i=s(73247);let o=e=>{let{value:l,field:s,onClick:o,onRemove:c,placeholder:d}=e,u=e=>{if(!e||"object"!=typeof e)return!1;let l=Object.keys(e);return 0===l.length||l.every(l=>null===e[l]||void 0===e[l])},m=e=>{if(!e||"object"==typeof e&&u(e))return"";if("string"==typeof e||"number"==typeof e)return String(e);if(s.showAs&&Array.isArray(s.showAs)){let l=["-"," ",",","_"," and "," or "],t=[];s.showAs.forEach(s=>{if(l.includes(s))t.push(s);else{let l;if(s.includes(".")){let t=s.split("."),a=e;for(let e of t)if(null==(a=null==a?void 0:a[e]))break;l=a}else l=e[s];null!=l&&""!==l&&t.push(String(l))}});let a=t.filter((e,s)=>{let a=l.includes(e),n=s>0&&l.includes(t[s-1]),r=s===t.length-1;return!a||0!==s&&!r&&!n});return a.length>0?a.join(""):e.id||e.name||""}return e.name||e.title||e.label||e.email||e.id||""};if(Array.isArray(l))return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("div",{onClick:o,className:"cursor-pointer",children:l.length>0?(0,t.jsx)("div",{className:"flex flex-wrap gap-1 p-2 border rounded-md min-h-10 bg-background",children:l.map((e,l)=>(0,t.jsxs)(n.C,{variant:"secondary",className:"flex items-center gap-1",children:[m(e),(0,t.jsx)("button",{type:"button",onClick:l=>{l.stopPropagation(),null==c||c(e)},className:"ml-1 ring-offset-background rounded-full outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",children:(0,t.jsx)(r.Z,{className:"h-3 w-3"})})]},e.id||l))}):(0,t.jsxs)("div",{className:"flex items-center gap-2 p-2 border rounded-md min-h-10 bg-background text-muted-foreground cursor-pointer hover:bg-accent",children:[(0,t.jsx)(i.Z,{className:"h-4 w-4"}),(0,t.jsx)("span",{children:d||"Select ".concat(s.label||s.name)})]})}),l.length>0&&(0,t.jsxs)(a.z,{type:"button",variant:"outline",size:"sm",onClick:o,className:"flex items-center gap-1",children:[(0,t.jsx)(i.Z,{className:"h-3 w-3"}),"Add More"]})]});let h=l&&!u(l);return(0,t.jsx)("div",{onClick:o,className:"cursor-pointer",children:(0,t.jsx)("div",{className:"flex items-center gap-2",children:(0,t.jsx)("div",{className:"flex-1",children:h?(0,t.jsxs)("div",{className:"flex items-center gap-2 p-2 border rounded-md min-h-10 bg-background",children:[(0,t.jsx)("span",{className:"flex-1",children:m(l)}),(0,t.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),null==c||c(l)},className:"text-muted-foreground hover:text-foreground",children:(0,t.jsx)(r.Z,{className:"h-4 w-4"})})]}):(0,t.jsxs)("div",{className:"flex items-center gap-2 p-2 border rounded-md min-h-10 bg-background text-muted-foreground hover:bg-accent",children:[(0,t.jsx)(i.Z,{className:"h-4 w-4"}),(0,t.jsx)("span",{children:d||"Select ".concat(s.label||s.name)})]})})})})}},72337:function(e,l,s){s.r(l),s.d(l,{DataBrowser:function(){return eG},DataBrowserInner:function(){return eW},default:function(){return eH}});var t=s(57437),a=s(2265),n=s(99376),r=s(72135),i=s(10795),o=s(93662),c=s(84314),d=s(29696),u=s(63751),m=s(28757),h=s(83434),x=s(54572),p=s(12381),f=s(43368),g=s(79820),v=s(33804),j=s(69174),y=s(91032),N=s(74291),b=s(32060),w=s(15291),C=s(68245),S=s(90740),T=s(98728),k=s(82431),D=s(67782),A=s(92735),_=s(17689),I=s(99397),E=s(41905),O=s(20265),F=s(15051),Z=s(28842),z=s(51817),M=s(42208),P=s(15868),L=s(18930),B=s(92451),U=s(10407),R=s(83774),V=s(40875),J=s(82284),q=s(13781),K=s(7586),W=s(64935),G=s(17168),H=s(23675),Y=s(12749),X=s(90641),Q=s(71096),$=s.n(Q),ee=s(40279),el=s(94589),es=s(46291),et=s(31047),ea=s(91723),en=s(93448),er=s(27107);let ei={text:[{label:"Equals",value:"eq"},{label:"Not Equals",value:"ne"},{label:"Contains",value:"contains"},{label:"Not Contains",value:"ncontains"},{label:"Starts With",value:"startswith"},{label:"Ends With",value:"endswith"},{label:"Is Empty",value:"null"},{label:"Is Not Empty",value:"nnull"}],number:[{label:"Equals",value:"eq"},{label:"Not Equals",value:"ne"},{label:"Greater Than",value:"gt"},{label:"Greater Than or Equal",value:"gte"},{label:"Less Than",value:"lt"},{label:"Less Than or Equal",value:"lte"},{label:"Between",value:"between"},{label:"Is Empty",value:"null"},{label:"Is Not Empty",value:"nnull"}],date:[{label:"Equals",value:"eq"},{label:"Not Equals",value:"ne"},{label:"Greater Than",value:"gt"},{label:"Greater Than or Equal",value:"gte"},{label:"Less Than",value:"lt"},{label:"Less Than or Equal",value:"lte"},{label:"Between",value:"between"},{label:"Is Empty",value:"null"},{label:"Is Not Empty",value:"nnull"}],boolean:[{label:"Is True",value:"true"},{label:"Is False",value:"false"},{label:"Is Empty",value:"null"},{label:"Is Not Empty",value:"nnull"}],relation:[{label:"Equals",value:"eq"},{label:"Not Equals",value:"ne"},{label:"Is Empty",value:"null"},{label:"Is Not Empty",value:"nnull"}],array:[{label:"Contains",value:"contains"},{label:"Not Contains",value:"ncontains"},{label:"Is Empty",value:"null"},{label:"Is Not Empty",value:"nnull"}],json:[{label:"Contains Key",value:"contains"},{label:"Not Contains Key",value:"ncontains"},{label:"Is Empty",value:"null"},{label:"Is Not Empty",value:"nnull"}],geospatial:[{label:"Within",value:"within"},{label:"Contains",value:"containsGEO"},{label:"Intersects",value:"intersects"},{label:"Distance Within",value:"dwithin"},{label:"Is Empty",value:"null"},{label:"Is Not Empty",value:"nnull"}]},eo=e=>{var l;if(!e)return ei.text;if(e.relType)return ei.relation;if(null===(l=e.type)||void 0===l?void 0:l.startsWith("Array_"))return ei.array;switch(e.type){case"Number":case"Integer":case"Float":case"Decimal":case"BigInt":return ei.number;case"Date":case"DateTime":case"DateTime_NO_TZ":case"Time":case"Time_NO_TZ":return ei.date;case"Boolean":return ei.boolean;case"JSON":case"JSONB":return ei.json;case"Point":case"Polygon":case"LineString":return ei.geospatial;default:return ei.text}},ec=(e,l,s)=>{if(null==e)return e;if("null"===l||"nnull"===l||"true"===l)return!0;if("false"===l)return!1;if(s){var t;if("Date"===s.type||"DateTime"===s.type||"DateTime_NO_TZ"===s.type)return"between"===l&&Array.isArray(e)?e.map(e=>e?$()(e).toISOString():null):e?$()(e).toISOString():null;if("Time"===s.type||"Time_NO_TZ"===s.type)return"between"===l&&Array.isArray(e)?e.map(e=>e||null):e||null;if("Number"===s.type||"Integer"===s.type||"Float"===s.type||"Decimal"===s.type||"BigInt"===s.type)return"between"===l&&Array.isArray(e)?e.map(e=>void 0!==e&&""!==e?Number(e):null):void 0!==e&&""!==e?Number(e):null;if("Boolean"===s.type)return!!e;if(null===(t=s.type)||void 0===t?void 0:t.startsWith("Array_"))return Array.isArray(e)?e:[e];if("Point"===s.type||"Polygon"===s.type||"LineString"===s.type)try{return"string"==typeof e?JSON.parse(e):e}catch(e){}}return e},ed=e=>{let{value:l,onChange:s,placeholder:a}=e;return(0,t.jsxs)(Y.J2,{children:[(0,t.jsx)(Y.xo,{asChild:!0,children:(0,t.jsxs)(p.z,{variant:"outline",className:(0,en.cn)("w-full justify-start text-left font-normal",!l&&"text-muted-foreground"),children:[(0,t.jsx)(et.Z,{className:"mr-2 h-4 w-4"}),l?(0,er.WU)(l,"PPP"):a||"Pick a date"]})}),(0,t.jsx)(Y.yk,{className:"w-auto p-0",align:"start",children:(0,t.jsx)(es.f,{mode:"single",selected:l,onSelect:s,initialFocus:!0})})]})},eu=e=>{let{value:l,onChange:s,placeholder:a}=e,n=l?"".concat(String(l.getHours()).padStart(2,"0"),":").concat(String(l.getMinutes()).padStart(2,"0")):"",r=e=>{if(!e)return;let[t,a]=e.split(":").map(Number),n=l?new Date(l):new Date;n.setHours(t,a,0,0),s(n)};return(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)(Y.J2,{children:[(0,t.jsx)(Y.xo,{asChild:!0,children:(0,t.jsxs)(p.z,{variant:"outline",className:(0,en.cn)("justify-start text-left font-normal",!l&&"text-muted-foreground"),children:[(0,t.jsx)(et.Z,{className:"mr-2 h-4 w-4"}),l?(0,er.WU)(l,"PPP"):a||"Pick a date"]})}),(0,t.jsx)(Y.yk,{className:"w-auto p-0",align:"start",children:(0,t.jsx)(es.f,{mode:"single",selected:l,onSelect:e=>{if(!e){s(void 0);return}l&&e.setHours(l.getHours(),l.getMinutes(),0,0),s(e)},initialFocus:!0})})]}),(0,t.jsx)(ee.I,{type:"time",value:n,onChange:e=>r(e.target.value),className:"w-28"})]})},em=e=>{let{value:l,onChange:s,placeholder:a}=e;return(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(ea.Z,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)(ee.I,{type:"time",value:(e=>{if(!e)return"";if(e.includes("T")){let l=new Date(e);if(!isNaN(l.getTime()))return"".concat(String(l.getHours()).padStart(2,"0"),":").concat(String(l.getMinutes()).padStart(2,"0"))}return/^\d{2}:\d{2}/.test(e)?e.substring(0,5):e})(l),onChange:e=>s(e.target.value||void 0),placeholder:a||"Select time",className:"w-full"})]})},eh=(e,l,s,a)=>{var n,r,i,o;if("null"===l||"nnull"===l)return null;if(!e)return(0,t.jsx)(ee.I,{placeholder:"Enter value",value:s||"",onChange:e=>a(e.target.value)});if(e.relType)return(0,t.jsxs)(w.Ph,{value:s||"",onValueChange:a,children:[(0,t.jsx)(w.i4,{className:"w-full",children:(0,t.jsx)(w.ki,{placeholder:"Select value"})}),(0,t.jsx)(w.Bw,{})]});if(null===(n=e.type)||void 0===n?void 0:n.startsWith("Array_"))return(0,t.jsx)(ee.I,{placeholder:"Enter values (comma-separated)",value:Array.isArray(s)?s.join(", "):s||"",onChange:e=>{let l=e.target.value.split(",").map(e=>e.trim()).filter(Boolean);a(l.length>0?l:void 0)}});switch(e.type){case"Number":case"Integer":case"Float":case"Decimal":case"BigInt":if("between"===l)return(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(ee.I,{type:"number",className:"w-24",value:null!==(r=null==s?void 0:s[0])&&void 0!==r?r:"",onChange:e=>a([e.target.value?Number(e.target.value):void 0,null==s?void 0:s[1]]),placeholder:"Min"}),(0,t.jsx)("span",{className:"text-muted-foreground",children:"to"}),(0,t.jsx)(ee.I,{type:"number",className:"w-24",value:null!==(i=null==s?void 0:s[1])&&void 0!==i?i:"",onChange:e=>a([null==s?void 0:s[0],e.target.value?Number(e.target.value):void 0]),placeholder:"Max"})]});return(0,t.jsx)(ee.I,{type:"number",value:null!=s?s:"",onChange:e=>a(e.target.value?Number(e.target.value):void 0),className:"w-full"});case"Boolean":return(0,t.jsx)(el.r,{checked:!0===s,onCheckedChange:a});case"Date":if("between"===l)return(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(ed,{value:(null==s?void 0:s[0])?new Date(s[0]):void 0,onChange:e=>a([null==e?void 0:e.toISOString(),null==s?void 0:s[1]]),placeholder:"From"}),(0,t.jsx)("span",{className:"text-muted-foreground",children:"to"}),(0,t.jsx)(ed,{value:(null==s?void 0:s[1])?new Date(s[1]):void 0,onChange:e=>a([null==s?void 0:s[0],null==e?void 0:e.toISOString()]),placeholder:"To"})]});return(0,t.jsx)(ed,{value:s?new Date(s):void 0,onChange:e=>a(null==e?void 0:e.toISOString())});case"DateTime":case"DateTime_NO_TZ":if("between"===l)return(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)(eu,{value:(null==s?void 0:s[0])?new Date(s[0]):void 0,onChange:e=>a([null==e?void 0:e.toISOString(),null==s?void 0:s[1]]),placeholder:"From"}),(0,t.jsx)("span",{className:"text-muted-foreground text-center",children:"to"}),(0,t.jsx)(eu,{value:(null==s?void 0:s[1])?new Date(s[1]):void 0,onChange:e=>a([null==s?void 0:s[0],null==e?void 0:e.toISOString()]),placeholder:"To"})]});return(0,t.jsx)(eu,{value:s?new Date(s):void 0,onChange:e=>a(null==e?void 0:e.toISOString())});case"Time":case"Time_NO_TZ":if("between"===l)return(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(em,{value:null==s?void 0:s[0],onChange:e=>a([e,null==s?void 0:s[1]]),placeholder:"From"}),(0,t.jsx)("span",{className:"text-muted-foreground",children:"to"}),(0,t.jsx)(em,{value:null==s?void 0:s[1],onChange:e=>a([null==s?void 0:s[0],e]),placeholder:"To"})]});return(0,t.jsx)(em,{value:s,onChange:a});case"Enum":case"ENUM":return(0,t.jsxs)(w.Ph,{value:s||"",onValueChange:a,children:[(0,t.jsx)(w.i4,{className:"w-full",children:(0,t.jsx)(w.ki,{placeholder:"Select value"})}),(0,t.jsx)(w.Bw,{children:null===(o=e.values)||void 0===o?void 0:o.map(e=>(0,t.jsx)(w.Ql,{value:e,children:e},e))})]});case"Point":case"Polygon":case"LineString":return(0,t.jsx)(H.g,{placeholder:"Enter GeoJSON",value:"object"==typeof s?JSON.stringify(s):s||"",onChange:e=>a(e.target.value)});default:return(0,t.jsx)(ee.I,{placeholder:"Enter value",value:s||"",onChange:e=>a(e.target.value)})}},ex=e=>e&&"object"==typeof e&&"field"in e&&"operator"in e,ep=e=>{let{fields:l,value:s,onChange:n}=e,{getFieldsByCollection:r}=(0,d.I_)(),[i,o]=(0,a.useState)(new Set),[c,u]=(0,a.useState)(!1),m=(0,a.useCallback)(function(e){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3;return 0===s?[]:e.map(e=>{let t=l?"".concat(l,".").concat(e.name):e.name,a={name:e.name,path:t,label:e.label||e.name,type:e.type,relType:e.relType,target:e.target};if(e.relType&&e.target){let l=r(e.target);if(l){let e=Object.entries(l).map(e=>{let[l,s]=e;return{name:l,...s,label:l.replace(/_/g," ").replace(/([A-Z])/g," $1").trim()}});a.children=m(e,t,s-1)}}return a})},[r]),h=(0,a.useMemo)(()=>m(l),[l,m]),x=(e,l)=>{l.stopPropagation();let s=new Set(i);s.has(e)?s.delete(e):s.add(e),o(s)},f=e=>{n(e),u(!1)},g=function(e){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=e.children&&e.children.length>0,n=i.has(e.path),r=s===e.path;return(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-1 py-1.5 px-2 cursor-pointer hover:bg-accent rounded-sm ".concat(r?"bg-accent":""),style:{paddingLeft:"".concat(16*l+8,"px")},onClick:()=>f(e.path),children:[a?(0,t.jsx)("button",{type:"button",onClick:l=>x(e.path,l),className:"p-0.5 hover:bg-muted rounded",children:n?(0,t.jsx)(V.Z,{className:"h-3 w-3"}):(0,t.jsx)(U.Z,{className:"h-3 w-3"})}):(0,t.jsx)("span",{className:"w-4"}),(0,t.jsxs)("span",{className:"text-sm truncate flex-1",children:[e.label,e.relType&&(0,t.jsxs)("span",{className:"text-xs text-muted-foreground ml-1",children:["(",e.relType,")"]})]})]}),a&&n&&(0,t.jsx)("div",{children:e.children.map(e=>g(e,l+1))})]},e.path)};return(0,t.jsxs)(Y.J2,{open:c,onOpenChange:u,children:[(0,t.jsx)(Y.xo,{asChild:!0,children:(0,t.jsxs)(p.z,{variant:"outline",role:"combobox","aria-expanded":c,className:"w-full sm:w-[180px] justify-between text-left font-normal",children:[(0,t.jsx)("span",{className:"truncate",children:s?s.split(".").join(" → "):"Select field"}),(0,t.jsx)(V.Z,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,t.jsx)(Y.yk,{className:"w-[280px] p-1",align:"start",onWheel:e=>{e.stopPropagation()},children:(0,t.jsx)(X.x,{className:"h-[300px]",children:h.map(e=>g(e))})})]})},ef=e=>{let{fields:l,onApply:s,initialFilters:n=[],collectionName:r}=e,{getFieldsByCollection:i}=(0,d.I_)(),[o,c]=(0,a.useState)(r),[u,h]=(0,a.useState)("builder"),[x,f]=(0,a.useState)("{}"),[v,j]=(0,a.useState)(""),[y,N]=(0,a.useState)({logic:"and",conditions:[{field:"",operator:"",value:void 0}]});(0,a.useEffect)(()=>{r&&r!==o&&(N({logic:"and",conditions:[{field:"",operator:"",value:void 0}]}),c(r))},[r,o]);let b=(0,a.useCallback)(e=>{if(!e)return null;if(e.includes(".")){let s=e.split("."),t=l,a=null;for(let e=0;e<s.length;e++){let l=s[e];if(!(a=t.find(e=>e.name===l)))return null;if(a.relType&&a.target&&e<s.length-1){let e=i(a.target);if(!e)return null;t=Object.entries(e).map(e=>{let[l,s]=e;return{name:l,...s}})}}return a}return l.find(l=>l.name===e)},[l,i]),C=(0,a.useCallback)(e=>e&&0!==e.length?1===e.length&&"operator"in e[0]&&("and"===e[0].operator||"or"===e[0].operator)&&Array.isArray(e[0].value)?{logic:e[0].operator,conditions:e[0].value.map(e=>"field"in e?{field:e.field,operator:e.operator,value:e.value}:"operator"in e&&("and"===e.operator||"or"===e.operator)&&Array.isArray(e.value)?{logic:e.operator,conditions:e.value.map(e=>"field"in e?{field:e.field,operator:e.operator,value:e.value}:"operator"in e&&("and"===e.operator||"or"===e.operator)&&Array.isArray(e.value)?C([e]):{field:"",operator:"",value:void 0})}:{field:"",operator:"",value:void 0})}:{logic:"and",conditions:e.map(e=>"field"in e?{field:e.field,operator:e.operator,value:e.value}:{field:"",operator:"",value:void 0})}:{logic:"and",conditions:[{field:"",operator:"",value:void 0}]},[]);(0,a.useEffect)(()=>{n.length>0?N(C(n)):N({logic:"and",conditions:[{field:"",operator:"",value:void 0}]})},[n,C]);let S=(0,a.useCallback)(e=>{if(!e||!e.conditions||0===e.conditions.length)return[];let l=e.conditions.filter(e=>ex(e)?e.field&&e.operator&&("null"===e.operator||"nnull"===e.operator||void 0!==e.value):S(e).length>0);if(0===l.length)return[];if(1===l.length&&ex(l[0])){let e=l[0],s=b(e.field);return[{field:e.field,operator:e.operator,value:ec(e.value,e.operator,s)}]}return[{operator:e.logic,value:l.map(e=>{if(ex(e)){let l=b(e.field);return{field:e.field,operator:e.operator,value:ec(e.value,e.operator,l)}}{let l=S(e);return 1===l.length?l[0]:{operator:"and",value:[]}}})}]},[b]);(0,a.useEffect)(()=>{if("json"===u){let e=S(y);f(JSON.stringify((0,m.gm)(e),null,2)),j("")}},[y,u,S]);let T=e=>{f(e);try{JSON.parse(e),j("")}catch(e){j("Invalid JSON format")}},k=()=>{try{let e=JSON.parse(x),l=(0,m.LR)(e);j(""),s(l)}catch(e){j("Invalid JSON format")}},D=e=>JSON.parse(JSON.stringify(e)),A=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],l=D(y),s=l;for(let l=0;l<e.length;l++){let t=e[l];if(ex(s.conditions[t])){console.error("Invalid path: expected a group but found a condition");return}s=s.conditions[t]}s.conditions.push({field:"",operator:"",value:void 0}),N(l)},_=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],l=D(y),s=l;for(let l=0;l<e.length;l++){let t=e[l];if(ex(s.conditions[t])){console.error("Invalid path: expected a group but found a condition");return}s=s.conditions[t]}s.conditions.push({logic:"and",conditions:[{field:"",operator:"",value:void 0}]}),N(l)},E=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],l=arguments.length>1?arguments[1]:void 0,s=D(y),t=s;for(let l=0;l<e.length;l++){let s=e[l];if(ex(t.conditions[s])){console.error("Invalid path: expected a group but found a condition");return}t=t.conditions[s]}if(t.conditions.splice(l,1),0===t.conditions.length){if(0===e.length)t.conditions.push({field:"",operator:"",value:void 0});else{let l=s;for(let s=0;s<e.length-1;s++){let t=e[s];ex(l.conditions[t])||(l=l.conditions[t])}l.conditions.splice(e[e.length-1],1),0===l.conditions.length&&l.conditions.push({field:"",operator:"",value:void 0})}}N(s)},O=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(0===e.length)return;let l=D(y),s=l;for(let l=0;l<e.length-1;l++){let t=e[l];if(ex(s.conditions[t])){console.error("Invalid path: expected a group but found a condition");return}s=s.conditions[t]}s.conditions.splice(e[e.length-1],1),0===s.conditions.length&&s.conditions.push({field:"",operator:"",value:void 0}),N(l)},F=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],l=arguments.length>1?arguments[1]:void 0,s=D(y),t=s;for(let l=0;l<e.length;l++){let s=e[l];if(ex(t.conditions[s])){console.error("Invalid path: expected a group but found a condition");return}t=t.conditions[s]}t.logic=l,N(s)},Z=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],l=arguments.length>1?arguments[1]:void 0,s=arguments.length>2?arguments[2]:void 0,t=D(y),a=t;for(let l=0;l<e.length;l++){let s=e[l];if(ex(a.conditions[s])){console.error("Invalid path: expected a group but found a condition");return}a=a.conditions[s]}let n=a.conditions[l];ex(n)&&(n.field=s,n.operator="",n.value=void 0),N(t)},z=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],l=arguments.length>1?arguments[1]:void 0,s=arguments.length>2?arguments[2]:void 0,t=D(y),a=t;for(let l=0;l<e.length;l++){let s=e[l];if(ex(a.conditions[s])){console.error("Invalid path: expected a group but found a condition");return}a=a.conditions[s]}let n=a.conditions[l];ex(n)&&(n.operator=s,"null"===s||"nnull"===s||"true"===s||"false"===s?n.value=!0:n.value=void 0),N(t)},M=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],l=arguments.length>1?arguments[1]:void 0,s=arguments.length>2?arguments[2]:void 0,t=D(y),a=t;for(let l=0;l<e.length;l++){let s=e[l];if(ex(a.conditions[s])){console.error("Invalid path: expected a group but found a condition");return}a=a.conditions[s]}let n=a.conditions[l];ex(n)&&(n.value=s),N(t)},P=function(e,s){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n=b(e.field),i=n?eo(n):[];return(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2 mb-2 p-2 sm:p-0 bg-muted/30 sm:bg-transparent rounded-lg",children:[(0,t.jsx)("div",{className:"relative w-full sm:w-auto",children:(0,t.jsx)(ep,{fields:l,value:e.field||"",onChange:e=>Z(a,s,e),collectionName:r})}),(0,t.jsxs)(w.Ph,{value:e.operator||"",onValueChange:e=>z(a,s,e),disabled:!e.field,children:[(0,t.jsx)(w.i4,{className:"w-full sm:w-[180px]",children:(0,t.jsx)(w.ki,{placeholder:"Select operator"})}),(0,t.jsx)(w.Bw,{children:i.map(e=>(0,t.jsx)(w.Ql,{value:e.value,children:e.label},e.value))})]}),e.field&&e.operator&&"null"!==e.operator&&"nnull"!==e.operator&&(0,t.jsx)("div",{className:"w-full sm:w-auto sm:min-w-[180px]",children:eh(n,e.operator,e.value,e=>M(a,s,e))}),(0,t.jsx)(p.z,{type:"button",variant:"ghost",size:"icon",onClick:()=>E(a,s),className:"text-muted-foreground hover:text-destructive self-end sm:self-auto",children:(0,t.jsx)(J.Z,{className:"h-4 w-4"})})]},"condition-".concat(a.join("-"),"-").concat(s))},B=function(e){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],s=0===l.length;return(0,t.jsxs)(g.Zb,{className:"".concat(s?"":"ml-4 border-l-2 border-l-primary/30"),children:[(0,t.jsx)(g.Ol,{className:"py-3 px-4",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(g.ll,{className:"text-sm font-medium",children:s?"Filter Conditions":"Nested Group"}),(0,t.jsxs)(w.Ph,{value:e.logic,onValueChange:e=>F(l,e),children:[(0,t.jsx)(w.i4,{className:"w-[80px] h-8",children:(0,t.jsx)(w.ki,{})}),(0,t.jsxs)(w.Bw,{children:[(0,t.jsx)(w.Ql,{value:"and",children:"AND"}),(0,t.jsx)(w.Ql,{value:"or",children:"OR"})]})]}),!s&&(0,t.jsx)(p.z,{type:"button",variant:"ghost",size:"icon",onClick:()=>O(l),className:"text-destructive hover:text-destructive",children:(0,t.jsx)(L.Z,{className:"h-4 w-4"})})]})}),(0,t.jsxs)(g.aY,{className:"py-2 px-4",children:[e.conditions.map((e,s)=>ex(e)?P(e,s,l):B(e,[...l,s])),(0,t.jsxs)("div",{className:"flex items-center gap-2 mt-2",children:[(0,t.jsxs)(p.z,{type:"button",variant:"outline",size:"sm",onClick:()=>A(l),children:[(0,t.jsx)(I.Z,{className:"h-4 w-4 mr-1"}),"Add Condition"]}),(0,t.jsxs)(p.z,{type:"button",variant:"outline",size:"sm",onClick:()=>_(l),children:[(0,t.jsx)(q.Z,{className:"h-4 w-4 mr-1"}),"Add Nested Group"]})]})]})]},"group-".concat(l.join("-")))};return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)(G.mQ,{value:u,onValueChange:e=>{if("json"===e&&"builder"===u){let e=S(y);f(JSON.stringify((0,m.gm)(e),null,2)),j("")}else if("builder"===e&&"json"===u)try{let e=JSON.parse(x),l=(0,m.LR)(e),s=C(l);N(s),j("")}catch(e){}h(e)},children:[(0,t.jsxs)(G.dr,{className:"grid w-full grid-cols-2 max-w-[300px]",children:[(0,t.jsxs)(G.SP,{value:"builder",className:"flex items-center gap-2",children:[(0,t.jsx)(K.Z,{className:"h-4 w-4"}),"Builder"]}),(0,t.jsxs)(G.SP,{value:"json",className:"flex items-center gap-2",children:[(0,t.jsx)(W.Z,{className:"h-4 w-4"}),"JSON"]})]}),(0,t.jsx)(G.nU,{value:"builder",className:"mt-4",children:B(y)}),(0,t.jsx)(G.nU,{value:"json",className:"mt-4",children:(0,t.jsxs)(g.Zb,{children:[(0,t.jsx)(g.Ol,{className:"py-3 px-4",children:(0,t.jsx)(g.ll,{className:"text-sm font-medium",children:"JSON Filter Editor (Baasix Format)"})}),(0,t.jsxs)(g.aY,{className:"py-2 px-4",children:[(0,t.jsx)(H.g,{value:x,onChange:e=>T(e.target.value),placeholder:'{"fieldName": {"eq": "value"}}',className:"font-mono text-sm min-h-[300px]"}),v&&(0,t.jsx)("p",{className:"text-sm text-destructive mt-2",children:v}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground mt-2",children:["Edit filters in Baasix format. Example: ",'{"status": {"eq": "active"}, "AND": [{"price": {"gte": 10}}]}']})]})]})})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(p.z,{type:"button",onClick:()=>{"json"===u?k():s(S(y))},children:"Apply Filters"}),(0,t.jsx)(p.z,{type:"button",variant:"outline",onClick:()=>{N({logic:"and",conditions:[{field:"",operator:"",value:void 0}]}),f("{}"),j(""),s([])},children:"Reset"})]})]})},eg=e=>{let{visible:l,onClose:s,formFields:a,onApply:n,initialFilters:r,collectionName:i}=e;return(0,t.jsx)(y.yo,{open:l,onOpenChange:e=>!e&&s(),children:(0,t.jsxs)(y.ue,{className:"w-full sm:w-[600px] sm:max-w-[600px] md:w-[700px] md:max-w-[700px] lg:w-[800px] lg:max-w-[800px] overflow-y-auto",side:"right",children:[(0,t.jsx)(y.Tu,{children:(0,t.jsx)(y.bC,{children:"Advanced Filters"})}),(0,t.jsx)("div",{className:"mt-4",children:(0,t.jsx)(ef,{fields:a,onApply:e=>{n(e),s()},initialFilters:r,collectionName:i})})]})})};var ev=s(75060);let ej=e=>{let{nodes:l,selectedColumns:s,onSelectionChange:a,level:n=0,expandedNodes:r,onToggleExpand:i}=e,o=e=>e.children&&0!==e.children.length?e.children.flatMap(o):e.disabled?[]:[e.value],c=e=>{if(!e.disabled){if(e.children&&e.children.length>0){let l=o(e);l.every(e=>s.includes(e))?a(s.filter(e=>!l.includes(e))):a(Array.from(new Set([...s,...l])))}else s.includes(e.value)?a(s.filter(l=>l!==e.value)):a([...s,e.value])}},d=e=>{let l=e.split(".");return l[l.length-1].replace(/_/g," ").replace(/([A-Z])/g," $1").trim()};return(0,t.jsx)("div",{className:"space-y-0.5 ".concat(n>0?"ml-4 pl-2 border-l border-muted":""),children:l.map(e=>{let l=e.children&&e.children.length>0,u=r.has(e.key),m=o(e),h=l?m.length>0&&m.every(e=>s.includes(e)):s.includes(e.value),x=l&&m.some(e=>s.includes(e))&&!m.every(e=>s.includes(e));return(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-1 py-1 hover:bg-muted/50 rounded px-1",children:[l&&(0,t.jsx)("button",{type:"button",onClick:()=>i(e.key),className:"p-0.5 hover:bg-muted rounded",children:u?(0,t.jsx)(V.Z,{className:"h-3.5 w-3.5"}):(0,t.jsx)(U.Z,{className:"h-3.5 w-3.5"})}),!l&&(0,t.jsx)("span",{className:"w-4"}),(0,t.jsx)(C.X,{id:"export-".concat(e.key),checked:h,disabled:e.disabled&&!l,onCheckedChange:()=>c(e),className:(0,en.cn)(x&&"data-[state=unchecked]:bg-primary/30")}),(0,t.jsxs)(ev._,{htmlFor:"export-".concat(e.key),className:(0,en.cn)("text-sm cursor-pointer flex-1",e.disabled&&!l&&"text-muted-foreground"),children:[d(e.title),l&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground ml-1",children:"(relation)"})]})]}),l&&u&&(0,t.jsx)(ej,{nodes:e.children,selectedColumns:s,onSelectionChange:a,level:n+1,expandedNodes:r,onToggleExpand:i})]},e.key)})})},ey=e=>{let{visible:l,onClose:s,exportColumns:n,onExportColumnsChange:r,exportLimit:i,onExportLimitChange:o,exportPage:c,onExportPageChange:d,isExporting:u,onExport:m,columnTreeData:h}=e,[f,v]=(0,a.useState)(new Set),[j,N]=(0,a.useState)("tree");return(0,t.jsx)(y.yo,{open:l,onOpenChange:e=>!e&&s(),children:(0,t.jsxs)(y.ue,{className:"w-[600px] sm:max-w-[600px] overflow-y-auto flex flex-col",side:"right",children:[(0,t.jsx)(y.Tu,{children:(0,t.jsx)(y.bC,{children:"Export Data"})}),(0,t.jsxs)("div",{className:"flex-1 overflow-y-auto py-4 space-y-6",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(ev._,{className:"text-base font-semibold",children:"Select Columns to Export:"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"Choose which columns to include in the export. Expand relational fields to access nested columns."}),(0,t.jsxs)(G.mQ,{value:j,onValueChange:e=>N(e),children:[(0,t.jsxs)(G.dr,{className:"grid w-full grid-cols-2",children:[(0,t.jsx)(G.SP,{value:"tree",children:"Tree Selection"}),(0,t.jsx)(G.SP,{value:"json",children:"JSON"})]}),(0,t.jsx)(G.nU,{value:"tree",className:"mt-2",children:(0,t.jsx)(g.Zb,{className:"max-h-[300px] overflow-y-auto",children:(0,t.jsx)(g.aY,{className:"p-3",children:h.length>0?(0,t.jsx)(ej,{nodes:h,selectedColumns:n,onSelectionChange:r,expandedNodes:f,onToggleExpand:e=>{v(l=>{let s=new Set(l);return s.has(e)?s.delete(e):s.add(e),s})}}):(0,t.jsx)("p",{className:"text-sm text-muted-foreground py-2",children:"No columns available"})})})}),(0,t.jsxs)(G.nU,{value:"json",className:"mt-2",children:[(0,t.jsx)(x.mq,{value:n,onChange:e=>{Array.isArray(e)&&e.every(e=>"string"==typeof e)?r(e):null===e&&r([])},placeholder:'["id", "name", "user.email"]'}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:'Enter column names as a JSON array. Use dot notation for nested fields (e.g., "user.name").'})]})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(ev._,{className:"text-base font-semibold",children:"Export Limits:"}),(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(ev._,{htmlFor:"exportLimit",children:"Number of Records"}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(ee.I,{id:"exportLimit",type:"number",value:-1===i?"":i,onChange:e=>{let l=e.target.value;o(""===l?-1:parseInt(l)||0),(""===l||-1===parseInt(l))&&d(1)},placeholder:"Enter number of records",className:"flex-1"}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(C.X,{id:"allRecords",checked:-1===i,onCheckedChange:e=>{e&&(o(-1),d(1))}}),(0,t.jsx)(ev._,{htmlFor:"allRecords",className:"text-sm",children:"All Records"})]})]})]}),-1!==i&&i>0&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(ev._,{htmlFor:"exportPage",children:"Page Number"}),(0,t.jsx)(ee.I,{id:"exportPage",type:"number",min:1,value:c,onChange:e=>d(parseInt(e.target.value)||1),placeholder:"Enter page number"}),(0,t.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Records ",(c-1)*i+1," to ",c*i," will be exported"]})]})]})]}),(0,t.jsx)(g.Zb,{children:(0,t.jsxs)(g.aY,{className:"p-4",children:[(0,t.jsx)(ev._,{className:"text-base font-semibold",children:"Export Summary:"}),(0,t.jsxs)("div",{className:"mt-2 space-y-1 text-sm",children:[(0,t.jsxs)("p",{children:["• Columns: ",n.length," selected"]}),(0,t.jsxs)("p",{children:["• Records: ",-1===i?"All records":"".concat(i," records from page ").concat(c)]}),(0,t.jsx)("p",{children:"• Format: CSV"})]})]})})]}),(0,t.jsxs)(y.FF,{className:"pt-4 border-t",children:[(0,t.jsx)(p.z,{variant:"outline",onClick:s,children:"Cancel"}),(0,t.jsx)(p.z,{onClick:m,disabled:0===n.length||u,children:u?"Exporting...":"Export"})]})]})})};var eN=s(48736),eb=s(49322),ew=s(32489),eC=s(14438),eS=s(95937);let eT=e=>{var l,s,n,i,o,c;let{visible:d,onClose:u,selectedCollection:m,onImportComplete:h}=e,[x,f]=(0,a.useState)("csv"),[v,j]=(0,a.useState)([]),[N,b]=(0,a.useState)(void 0),[C,S]=(0,a.useState)(!1),T=(0,r.Ji)(),{mutate:k,isLoading:D}=(0,r.uC)(),{data:A}=(0,r.kS)(),I=(null==A?void 0:null===(l=A.role)||void 0===l?void 0:l.name)==="administrator",{data:E,isLoading:O}=(0,r.sm)({resource:"baasix_Tenant",queryOptions:{enabled:I}}),F=(0,a.useCallback)(e=>{f(e),j([])},[]),Z=(0,a.useCallback)(e=>("csv"===x?"text/csv"===e.type||e.name.toLowerCase().endsWith(".csv"):"application/json"===e.type||e.name.toLowerCase().endsWith(".json"))?e.size/1024/1024<50||(eC.Am.error("File must be smaller than 50MB"),!1):(eC.Am.error("Please upload a valid ".concat(x.toUpperCase()," file")),!1),[x]),z=(0,a.useCallback)(e=>{if(!e||0===e.length)return;let l=e[0];Z(l)&&j([l])},[Z]),M=(0,a.useCallback)(e=>{e.preventDefault(),S(!1),z(e.dataTransfer.files)},[z]),P=(0,a.useCallback)(e=>{e.preventDefault(),S(!0)},[]),L=(0,a.useCallback)(e=>{e.preventDefault(),S(!1)},[]),B=(0,a.useCallback)(()=>{if(0===v.length){eC.Am.error("Please select a file to import");return}let e=v[0],l=new FormData;"csv"===x?l.append("csvFile",e):l.append("jsonFile",e),I&&N&&l.append("tenant",N);let s="csv"===x?"items/".concat(m,"/import-csv"):"items/".concat(m,"/import-json");k({url:"".concat(T,"/").concat(s),method:"post",values:l},{onSuccess:e=>{var l;eC.Am.success("Successfully imported ".concat((null==e?void 0:null===(l=e.results)||void 0===l?void 0:l.imported)||0," items")),h(),u(),j([])},onError:e=>{var l,s,t,a,n,r,i,o,c;console.error("Import error:",e);let d="Import failed";if((null==e?void 0:null===(t=e.response)||void 0===t?void 0:null===(s=t.data)||void 0===s?void 0:null===(l=s.error)||void 0===l?void 0:l.message)?d=e.response.data.error.message:(null==e?void 0:e.message)&&(d=e.message),(null==e?void 0:null===(c=e.response)||void 0===c?void 0:null===(o=c.data)||void 0===o?void 0:null===(i=o.error)||void 0===i?void 0:null===(r=i.details)||void 0===r?void 0:null===(n=r.results)||void 0===n?void 0:null===(a=n.errors)||void 0===a?void 0:a.length)>0){let l=e.response.data.error.details.results.errors.length;d+=". ".concat(l," rows had errors.")}eC.Am.error(d)}})},[v,x,m,h,u,T,k,I,N]),U=(0,a.useCallback)(()=>{j([])},[]),R=(0,a.useCallback)(()=>"csv"===x?{title:"CSV Example",content:'name,email,age,tags,metadata\n"John Doe","john@example.com",30,"[""admin"", ""user""]","{""department"": ""IT""}"\n"Jane Smith","jane@example.com",25,"[""user""]","{""department"": ""HR""}"',description:"CSV files should have headers in the first row. JSON fields should be properly escaped strings."}:{title:"JSON Example",content:'[\n {\n "name": "John Doe",\n "email": "john@example.com", \n "age": 30,\n "tags": ["admin", "user"],\n "metadata": {"department": "IT"}\n },\n {\n "name": "Jane Smith",\n "email": "jane@example.com",\n "age": 25, \n "tags": ["user"],\n "metadata": {"department": "HR"}\n }\n]',description:"JSON files should contain an array of objects. Each object represents a record to import."},[x])();return(0,t.jsx)(y.yo,{open:d,onOpenChange:e=>!e&&u(),children:(0,t.jsxs)(y.ue,{className:"w-[700px] sm:max-w-[700px] overflow-y-auto flex flex-col",side:"right",children:[(0,t.jsx)(y.Tu,{children:(0,t.jsx)(y.bC,{children:"Import Data"})}),(0,t.jsxs)("div",{className:"flex-1 overflow-y-auto py-4 space-y-6",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(ev._,{className:"text-base font-semibold",children:"Select Import Format:"}),(0,t.jsx)(G.mQ,{value:x,onValueChange:F,children:(0,t.jsxs)(G.dr,{className:"grid w-full grid-cols-2",children:[(0,t.jsxs)(G.SP,{value:"csv",className:"flex items-center gap-2",children:[(0,t.jsx)(eN.Z,{className:"h-4 w-4"}),"CSV File"]}),(0,t.jsxs)(G.SP,{value:"json",className:"flex items-center gap-2",children:[(0,t.jsx)(W.Z,{className:"h-4 w-4"}),"JSON File"]})]})})]}),I&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(ev._,{className:"text-base font-semibold",children:"Select Tenant (Optional):"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"Leave empty to import into your current tenant context. Select a specific tenant to import data into that tenant."}),(0,t.jsxs)(w.Ph,{value:N||"",onValueChange:e=>b(e||void 0),children:[(0,t.jsx)(w.i4,{children:(0,t.jsx)(w.ki,{placeholder:O?"Loading...":"Select tenant (optional)"})}),(0,t.jsx)(w.Bw,{children:null==E?void 0:null===(s=E.data)||void 0===s?void 0:s.map(e=>(0,t.jsx)(w.Ql,{value:e.id,children:e.name},e.id))})]})]}),(0,t.jsxs)(eS.bZ,{children:[(0,t.jsx)(eb.Z,{className:"h-4 w-4"}),(0,t.jsx)(eS.Cd,{children:"Important Notes"}),(0,t.jsx)(eS.X,{children:(0,t.jsxs)("ul",{className:"list-disc list-inside mt-2 space-y-1 text-sm",children:[(0,t.jsx)("li",{children:"The import will create new records in the selected collection"}),(0,t.jsx)("li",{children:"If any record fails validation, the entire import will be rolled back"}),(0,t.jsx)("li",{children:"JSON fields should be properly formatted (arrays and objects)"}),(0,t.jsx)("li",{children:"Relational data can be created by providing nested objects"}),(0,t.jsx)("li",{children:"Maximum file size: 50MB"})]})})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)(ev._,{className:"text-base font-semibold",children:["Upload ",x.toUpperCase()," File:"]}),0===v.length?(0,t.jsxs)("div",{className:"border-2 border-dashed rounded-lg p-8 text-center cursor-pointer transition-colors ".concat(C?"border-primary bg-primary/5":"border-muted-foreground/25 hover:border-primary/50"),onDrop:M,onDragOver:P,onDragLeave:L,onClick:()=>{let e=document.createElement("input");e.type="file",e.accept="csv"===x?".csv,text/csv":".json,application/json",e.onchange=e=>{z(e.target.files)},e.click()},children:[(0,t.jsx)(_.Z,{className:"h-10 w-10 mx-auto text-muted-foreground mb-4"}),(0,t.jsxs)("p",{className:"text-sm font-medium",children:["Click or drag ",x.toUpperCase()," file to this area to upload"]}),(0,t.jsxs)("p",{className:"text-sm text-muted-foreground mt-1",children:["Support for single ",x.toUpperCase()," file upload"]})]}):(0,t.jsx)(g.Zb,{children:(0,t.jsxs)(g.aY,{className:"p-4 flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:["csv"===x?(0,t.jsx)(eN.Z,{className:"h-8 w-8 text-green-600"}):(0,t.jsx)(W.Z,{className:"h-8 w-8 text-blue-600"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"font-medium text-sm",children:v[0].name}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:[(v[0].size/1024/1024).toFixed(2)," MB"]})]})]}),(0,t.jsx)(p.z,{variant:"ghost",size:"icon",onClick:U,children:(0,t.jsx)(ew.Z,{className:"h-4 w-4"})})]})})]}),(0,t.jsx)(g.Zb,{children:(0,t.jsxs)(g.aY,{className:"p-4",children:[(0,t.jsx)("h4",{className:"font-semibold mb-2",children:R.title}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground mb-3",children:R.description}),(0,t.jsx)("pre",{className:"bg-muted p-3 rounded text-xs overflow-x-auto max-h-[200px]",children:R.content})]})}),v.length>0&&(0,t.jsx)(g.Zb,{children:(0,t.jsxs)(g.aY,{className:"p-4",children:[(0,t.jsx)(ev._,{className:"text-base font-semibold",children:"Import Summary:"}),(0,t.jsxs)("div",{className:"mt-2 space-y-1 text-sm",children:[(0,t.jsxs)("p",{children:["• Collection: ",m]}),(0,t.jsxs)("p",{children:["• File: ",null===(n=v[0])||void 0===n?void 0:n.name]}),(0,t.jsxs)("p",{children:["• Size: ",((null===(i=v[0])||void 0===i?void 0:i.size)/1024/1024).toFixed(2)," MB"]}),(0,t.jsxs)("p",{children:["• Format: ",x.toUpperCase()]}),I&&(0,t.jsxs)("p",{children:["• Tenant:"," ",N?(null==E?void 0:null===(c=E.data)||void 0===c?void 0:null===(o=c.find(e=>e.id===N))||void 0===o?void 0:o.name)||N:"Current tenant context"]})]})]})})]}),(0,t.jsxs)(y.FF,{className:"pt-4 border-t",children:[(0,t.jsx)(p.z,{variant:"outline",onClick:u,children:"Cancel"}),(0,t.jsx)(p.z,{onClick:B,disabled:0===v.length||D,children:D?"Importing...":"Import Data"})]})]})})};var ek=s(45675),eD=s(29501),eA=s(33245),e_=s(30401),eI=s(71488);let eE=["id","createdAt","updatedAt","deletedAt","userCreated_Id","userUpdated_Id","userDeleted_Id","userCreated","userUpdated","userDeleted"],eO=e=>{let{visible:l,onClose:s,selectedRows:n,selectedCollection:i,onSuccess:o}=e,{getFieldsByCollection:c}=(0,d.I_)(),[u,m]=(0,a.useState)([]),[h,f]=(0,a.useState)(!1),{mutate:g}=(0,r.e)(),{register:v,handleSubmit:j,setValue:y,watch:b,reset:w,formState:{errors:S}}=(0,eD.cI)({defaultValues:{}}),T=(0,a.useMemo)(()=>{let e=c(i);return e?Object.entries(e).filter(e=>{var l,s;let[t,a]=e;return!eE.includes(t)&&!a.primaryKey&&(null===(l=a.defaultValue)||void 0===l?void 0:l.type)!=="AUTOINCREMENT"&&(null===(s=a.defaultValue)||void 0===s?void 0:s.type)!=="UUIDV4"&&!a.virtual&&!a.relType}).map(e=>{let[l,s]=e;return{name:l,...s}}):[]},[i,c]);(0,a.useEffect)(()=>{l||(m([]),w({}))},[l,w]);let k=(e,l)=>{l?m(l=>[...l,e]):(m(l=>l.filter(l=>l!==e)),y(e,void 0))},D=async e=>{if(0===u.length){eC.Am.error("Please select at least one field to update");return}f(!0);let l=n.map(e=>e.id),t={};for(let l of u)void 0!==e[l]&&(t[l]=e[l]);if(0===Object.keys(t).length){eC.Am.error("Please provide values for the selected fields"),f(!1);return}try{await new Promise((e,s)=>{g({resource:i,ids:l,values:t},{onSuccess:()=>e(),onError:e=>s(e)})}),eC.Am.success("".concat(n.length," items updated successfully")),o(),s()}catch(e){console.error("Bulk update error:",e),eC.Am.error((null==e?void 0:e.message)||"Failed to update items")}finally{f(!1)}},A=e=>{var l,s;let a=e.name,n=b(a),r=(null===(l=e.type)||void 0===l?void 0:l.toLowerCase())||"string",i=!u.includes(a);if("enum"===r){let l=e.values||[];return(0,t.jsx)(x.o_,{value:n,onChange:e=>y(a,e),options:l,allowNull:!1!==e.allowNull,disabled:i,placeholder:"Select ".concat(e.name,"...")})}return"boolean"===r?(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(el.r,{checked:n||!1,onCheckedChange:e=>y(a,e),disabled:i}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:n?"True":"False"})]}):["integer","bigint","float","decimal","double","real"].includes(r)?(0,t.jsx)(ee.I,{type:"number",...v(a,{valueAsNumber:!0}),disabled:i,placeholder:"Enter ".concat(e.name,"..."),step:["float","decimal","double","real"].includes(r)?"0.01":"1"}):["json","jsonb"].includes(r)?(0,t.jsx)(x.mq,{value:n,onChange:e=>y(a,e),disabled:i}):"array"===r?(0,t.jsx)(x.OF,{value:n||[],onChange:e=>y(a,e),itemType:(null===(s=e.values)||void 0===s?void 0:s.type)||"String",disabled:i}):"text"===r?(0,t.jsx)(H.g,{...v(a),disabled:i,placeholder:"Enter ".concat(e.name,"..."),rows:3}):["date","datetime"].includes(r)?(0,t.jsx)(ee.I,{type:"date"===r?"date":"datetime-local",...v(a),disabled:i}):(0,t.jsx)(ee.I,{...v(a),disabled:i,placeholder:"Enter ".concat(e.name,"...")})};return(0,t.jsx)(N.Vq,{open:l,onOpenChange:e=>!e&&s(),children:(0,t.jsxs)(N.cZ,{className:"sm:max-w-[600px] max-h-[80vh]",children:[(0,t.jsxs)(N.fK,{children:[(0,t.jsx)(N.$N,{children:"Bulk Edit"}),(0,t.jsxs)(N.Be,{children:["Update ",n.length," selected items. Only the fields you select and fill in will be updated."]})]}),(0,t.jsxs)("form",{onSubmit:j(D),children:[(0,t.jsx)(X.x,{className:"h-[400px] pr-4",children:(0,t.jsxs)("div",{className:"space-y-4 py-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-muted rounded-lg",children:[(0,t.jsx)(eA.Z,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"Select the fields you want to update by checking the checkbox next to each field."})]}),0===T.length?(0,t.jsx)("div",{className:"text-center py-8 text-muted-foreground",children:"No editable fields found for this collection."}):T.map(e=>(0,t.jsx)("div",{className:"p-3 border rounded-lg transition-colors ".concat(u.includes(e.name)?"border-primary bg-primary/5":"border-border"),children:(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)(C.X,{id:"field-".concat(e.name),checked:u.includes(e.name),onCheckedChange:l=>k(e.name,l),className:"mt-1"}),(0,t.jsxs)("div",{className:"flex-1 space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(ev._,{htmlFor:"field-".concat(e.name),className:"font-medium cursor-pointer",children:e.name}),(0,t.jsx)(eI.pn,{children:(0,t.jsxs)(eI.u,{children:[(0,t.jsx)(eI.aJ,{asChild:!0,children:(0,t.jsxs)("span",{className:"text-xs px-2 py-0.5 bg-muted rounded text-muted-foreground",children:[e.type,e.relType&&" (".concat(e.relType,")")]})}),(0,t.jsxs)(eI._v,{children:[(0,t.jsxs)("p",{children:["Field type: ",e.type]}),e.relType&&(0,t.jsxs)("p",{children:["Relation: ",e.relType]}),!1===e.allowNull&&(0,t.jsx)("p",{children:"Required field"})]})]})})]}),(0,t.jsx)("div",{className:u.includes(e.name)?"":"opacity-50",children:A(e)})]})]})},e.name))]})}),(0,t.jsx)(N.cN,{className:"mt-4",children:(0,t.jsxs)("div",{className:"flex items-center justify-between w-full",children:[(0,t.jsxs)("span",{className:"text-sm text-muted-foreground",children:[u.length," field(s) selected"]}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(p.z,{type:"button",variant:"outline",onClick:s,disabled:h,children:"Cancel"}),(0,t.jsx)(p.z,{type:"submit",disabled:h||0===u.length,children:h?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(z.Z,{className:"mr-2 h-4 w-4 animate-spin"}),"Updating..."]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(e_.Z,{className:"mr-2 h-4 w-4"}),"Update ",n.length," Items"]})})]})]})})]})]})})},eF=e=>{let{visible:l,onClose:s,selectedRows:n,selectedCollection:i,onClearSelection:o}=e,[c,d]=(0,a.useState)(!1),[u,m]=(0,a.useState)(!1),[h,x]=(0,a.useState)(!1),{mutate:f}=(0,r.F2)();(0,a.useEffect)(()=>{l||(d(!1),m(!1),x(!1))},[l]);let g=async()=>{x(!0);let e=n.length,l=n.map(e=>e.id);try{await new Promise((e,s)=>{f({resource:i,ids:l},{onSuccess:()=>e(),onError:e=>s(e)})}),eC.Am.success("".concat(e," items deleted successfully")),x(!1),d(!1),o(),s()}catch(e){console.error("Bulk delete error:",e),eC.Am.error((null==e?void 0:e.message)||"Failed to delete items"),x(!1)}};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(N.Vq,{open:l,onOpenChange:e=>!e&&s(),children:(0,t.jsxs)(N.cZ,{className:"sm:max-w-[500px]",children:[(0,t.jsxs)(N.fK,{children:[(0,t.jsx)(N.$N,{children:"Bulk Actions"}),(0,t.jsxs)(N.Be,{children:[n.length," items selected. Choose an action to perform on all selected items."]})]}),(0,t.jsxs)("div",{className:"space-y-3 py-4",children:[(0,t.jsxs)(p.z,{variant:"destructive",className:"w-full justify-start gap-2",onClick:()=>d(!0),children:[(0,t.jsx)(L.Z,{className:"h-4 w-4"}),"Delete Selected (",n.length,")"]}),(0,t.jsxs)(p.z,{variant:"outline",className:"w-full justify-start gap-2",onClick:()=>{m(!0)},children:[(0,t.jsx)(ek.Z,{className:"h-4 w-4"}),"Edit Selected (",n.length,")"]})]}),(0,t.jsx)(N.cN,{children:(0,t.jsx)(p.z,{variant:"outline",onClick:s,children:"Cancel"})})]})}),(0,t.jsx)(N.Vq,{open:c,onOpenChange:e=>{h||e||d(!1)},children:(0,t.jsxs)(N.cZ,{children:[(0,t.jsxs)(N.fK,{children:[(0,t.jsx)(N.$N,{children:"Delete Selected Items"}),(0,t.jsxs)(N.Be,{children:["Are you sure you want to delete ",n.length," items? This action cannot be undone."]})]}),(0,t.jsxs)(N.cN,{children:[(0,t.jsx)(p.z,{type:"button",variant:"outline",onClick:()=>d(!1),disabled:h,children:"Cancel"}),(0,t.jsx)(p.z,{type:"button",variant:"destructive",onClick:g,disabled:h,children:h?"Deleting...":"Delete"})]})]})}),(0,t.jsx)(eO,{visible:u,onClose:()=>m(!1),selectedRows:n,selectedCollection:i,onSuccess:()=>{o(),s()}})]})},eZ=e=>{let{nodes:l,selectedColumns:s,onSelectionChange:a,level:n=0,expandedNodes:r,onToggleExpand:i}=e,o=e=>{if(!e.disabled){if(s.includes(e.value)){let l=e.value+".";a(s.filter(s=>s!==e.value&&!s.startsWith(l)))}else a([...s,e.value])}},c=e=>e.children&&0!==e.children.length?e.children.flatMap(c):e.disabled?[]:[e.value],d=e=>{let l=e.split(".");return l[l.length-1].replace(/_/g," ").replace(/([A-Z])/g," $1").trim()};return(0,t.jsx)("div",{className:"space-y-0.5 ".concat(n>0?"ml-4 pl-2 border-l border-muted":""),children:l.map(e=>{let l=e.children&&e.children.length>0,c=r.has(e.key),u=s.includes(e.value),m=e.value+".",h=l&&s.some(e=>e.startsWith(m)),x=l&&h&&!u;return(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-1 py-1 hover:bg-muted/50 rounded px-1",children:[l&&(0,t.jsx)("button",{type:"button",onClick:()=>i(e.key),className:"p-0.5 hover:bg-muted rounded",children:c?(0,t.jsx)(V.Z,{className:"h-3.5 w-3.5"}):(0,t.jsx)(U.Z,{className:"h-3.5 w-3.5"})}),!l&&(0,t.jsx)("span",{className:"w-4"}),(0,t.jsx)(C.X,{id:"col-".concat(e.key),checked:u,disabled:e.disabled,onCheckedChange:()=>o(e),className:(0,en.cn)(x&&"data-[state=unchecked]:bg-primary/30")}),(0,t.jsxs)(ev._,{htmlFor:"col-".concat(e.key),className:(0,en.cn)("text-sm cursor-pointer flex-1",e.disabled&&"text-muted-foreground"),children:[d(e.title),l&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground ml-1",children:"(relation)"})]})]}),l&&c&&(0,t.jsx)(eZ,{nodes:e.children,selectedColumns:s,onSelectionChange:a,level:n+1,expandedNodes:r,onToggleExpand:i})]},e.key)})})},ez=e=>{let{visible:l,onClose:s,tableDensity:n,onTableDensityChange:r,visibleColumns:i,onVisibleColumnsChange:o,columnTreeData:c}=e,[d,u]=(0,a.useState)(new Set),[m,h]=(0,a.useState)("tree");return(0,t.jsx)(N.Vq,{open:l,onOpenChange:e=>!e&&s(),children:(0,t.jsxs)(N.cZ,{className:"sm:max-w-[500px] max-h-[80vh] flex flex-col",children:[(0,t.jsxs)(N.fK,{children:[(0,t.jsx)(N.$N,{children:"Column Settings"}),(0,t.jsx)(N.Be,{children:"Customize your table display preferences."})]}),(0,t.jsxs)("div",{className:"space-y-6 py-4 flex-1 overflow-y-auto",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(ev._,{className:"text-sm font-semibold",children:"Table Density"}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(p.z,{size:"sm",variant:"small"===n?"default":"outline",onClick:()=>r("small"),className:(0,en.cn)("small"===n&&"bg-primary text-primary-foreground"),children:"Compact"}),(0,t.jsx)(p.z,{size:"default",variant:"middle"===n?"default":"outline",onClick:()=>r("middle"),className:(0,en.cn)("middle"===n&&"bg-primary text-primary-foreground"),children:"Default"}),(0,t.jsx)(p.z,{size:"lg",variant:"large"===n?"default":"outline",onClick:()=>r("large"),className:(0,en.cn)("large"===n&&"bg-primary text-primary-foreground"),children:"Comfortable"})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(ev._,{className:"text-sm font-semibold",children:"Visible Columns"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"Select columns to display. Expand relational fields to access nested columns."}),(0,t.jsxs)(G.mQ,{value:m,onValueChange:e=>h(e),children:[(0,t.jsxs)(G.dr,{className:"grid w-full grid-cols-2",children:[(0,t.jsx)(G.SP,{value:"tree",children:"Tree Selection"}),(0,t.jsx)(G.SP,{value:"json",children:"JSON"})]}),(0,t.jsx)(G.nU,{value:"tree",className:"mt-2",children:(0,t.jsx)(g.Zb,{className:"max-h-[250px] overflow-y-auto",children:(0,t.jsx)(g.aY,{className:"p-3",children:c.length>0?(0,t.jsx)(eZ,{nodes:c,selectedColumns:i,onSelectionChange:o,expandedNodes:d,onToggleExpand:e=>{u(l=>{let s=new Set(l);return s.has(e)?s.delete(e):s.add(e),s})}}):(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"No columns available"})})})}),(0,t.jsxs)(G.nU,{value:"json",className:"mt-2",children:[(0,t.jsx)(x.mq,{value:i,onChange:e=>{Array.isArray(e)&&e.every(e=>"string"==typeof e)?o(e):null===e&&o([])},placeholder:'["id", "name", "user.email"]'}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Enter column names as a JSON array. Use dot notation for nested fields."})]})]})]})]}),(0,t.jsx)(N.cN,{children:(0,t.jsx)(p.z,{variant:"outline",onClick:s,children:"Close"})})]})})};var eM=s(92322),eP=s(2596),eL=s(24156);let eB=e=>{let{value:l,field:s,onSave:n,onCancel:r,isLoading:i=!1}=e,[o,c]=(0,a.useState)(l),[d,u]=(0,a.useState)(""),m=(0,a.useRef)(null),h=(0,a.useRef)(null),x=(0,a.useRef)(l);(0,a.useEffect)(()=>{m.current&&(m.current.focus(),m.current.select())},[]);let f=(0,a.useCallback)(e=>null===x.current||void 0===x.current?null!=e&&""!==e:null==e||""===e?null!==x.current&&void 0!==x.current&&""!==x.current:String(x.current)!==String(e),[]),g=(0,a.useCallback)(e=>{f(e)?n(e):r()},[f,n,r]),v=(0,a.useCallback)(e=>{"Enter"!==e.key||e.shiftKey?"Escape"===e.key?(e.preventDefault(),r()):"Tab"===e.key&&(e.preventDefault(),g(o)):(e.preventDefault(),g(o))},[o,g,r]),j=(0,a.useCallback)(e=>{var l;null!==(l=h.current)&&void 0!==l&&l.contains(e.relatedTarget)||g(o)},[o,g]);if("Boolean"===s.type||"BOOLEAN"===s.type)return(0,t.jsx)("div",{ref:h,className:"flex items-center justify-center h-full",onKeyDown:v,tabIndex:0,onBlur:j,children:i?(0,t.jsx)(z.Z,{className:"h-4 w-4 animate-spin"}):(0,t.jsx)(C.X,{checked:!!o,onCheckedChange:e=>{c(e),!!x.current!=!!e?n(e):r()},autoFocus:!0})});if(("Enum"===s.type||"ENUM"===s.type)&&s.values&&s.values.length>0){let e=s.values||[],l=d.trim()?e.filter(e=>e.toLowerCase().includes(d.toLowerCase())):e,a=d.trim()&&!e.some(e=>e.toLowerCase()===d.trim().toLowerCase()),m=e=>{c(e),u(""),String(x.current||"")!==String(e||"")?n(e):r()},f=()=>{if(d.trim()){let e=d.trim();c(e),u(""),String(x.current||"")!==String(e||"")?n(e):r()}};return(0,t.jsx)("div",{ref:h,className:"w-full",onKeyDown:v,children:i?(0,t.jsx)("div",{className:"flex items-center justify-center h-8",children:(0,t.jsx)(z.Z,{className:"h-4 w-4 animate-spin"})}):(0,t.jsxs)(Y.J2,{open:!0,onOpenChange:e=>!e&&r(),children:[(0,t.jsx)(Y.xo,{asChild:!0,children:(0,t.jsxs)(p.z,{variant:"outline",role:"combobox",className:"h-8 w-full justify-between text-sm font-normal",children:[o||"Select...",(0,t.jsx)(eL.Z,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,t.jsx)(Y.yk,{className:"w-[200px] p-0",align:"start",children:(0,t.jsxs)(eP.mY,{shouldFilter:!1,children:[(0,t.jsx)(eP.sZ,{placeholder:"Search or type custom...",value:d,onValueChange:u}),(0,t.jsxs)(eP.e8,{children:[(0,t.jsx)(eP.rb,{children:d.trim()?(0,t.jsxs)("button",{onClick:f,className:"flex w-full items-center gap-2 px-2 py-1.5 text-sm hover:bg-accent rounded cursor-pointer",children:[(0,t.jsx)(I.Z,{className:"h-4 w-4"}),'Add "',d.trim(),'"']}):"No options found."}),(0,t.jsxs)(eP.fu,{children:[s.allowNull&&(0,t.jsxs)(eP.di,{value:"",onSelect:()=>m(""),children:[(0,t.jsx)(e_.Z,{className:(0,en.cn)("mr-2 h-4 w-4",o?"opacity-0":"opacity-100")}),(0,t.jsx)("span",{className:"text-muted-foreground italic",children:"None"})]}),l.map(e=>(0,t.jsxs)(eP.di,{value:e,onSelect:()=>m(e),children:[(0,t.jsx)(e_.Z,{className:(0,en.cn)("mr-2 h-4 w-4",o===e?"opacity-100":"opacity-0")}),e]},e))]}),a&&l.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eP.zz,{}),(0,t.jsx)(eP.fu,{children:(0,t.jsxs)(eP.di,{value:"add-custom-".concat(d),onSelect:f,children:[(0,t.jsx)(I.Z,{className:"mr-2 h-4 w-4"}),'Add "',d.trim(),'"']})})]})]})]})})]})})}return"Number"===s.type||"Integer"===s.type||"INTEGER"===s.type||"INT"===s.type||"BigInt"===s.type||"BIGINT"===s.type||"SMALLINT"===s.type||"TINYINT"===s.type||"Float"===s.type||"FLOAT"===s.type||"Double"===s.type||"DOUBLE"===s.type||"Decimal"===s.type||"DECIMAL"===s.type?(0,t.jsxs)("div",{ref:h,className:"relative w-full",children:[i&&(0,t.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-background/50 z-10",children:(0,t.jsx)(z.Z,{className:"h-4 w-4 animate-spin"})}),(0,t.jsx)(ee.I,{ref:m,type:"number",value:null!=o?o:"",onChange:e=>{let l=e.target.value;c(""===l?null:Number(l))},onKeyDown:v,onBlur:j,className:"h-8 text-sm",disabled:i})]}):"Date"===s.type||"DATEONLY"===s.type?(0,t.jsxs)("div",{ref:h,className:"relative w-full",children:[i&&(0,t.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-background/50 z-10",children:(0,t.jsx)(z.Z,{className:"h-4 w-4 animate-spin"})}),(0,t.jsx)(ee.I,{ref:m,type:"date",value:(e=>{if(!e)return"";let l=new Date(e),s=l.getFullYear(),t=String(l.getMonth()+1).padStart(2,"0"),a=String(l.getDate()).padStart(2,"0");return"".concat(s,"-").concat(t,"-").concat(a)})(o),onChange:e=>c(e.target.value||null),onKeyDown:v,onBlur:j,className:"h-8 text-sm",disabled:i})]}):"DateTime"===s.type||"DateTime_NO_TZ"===s.type||"DATETIME"===s.type||"TIMESTAMP"===s.type?(0,t.jsxs)("div",{ref:h,className:"relative w-full",children:[i&&(0,t.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-background/50 z-10",children:(0,t.jsx)(z.Z,{className:"h-4 w-4 animate-spin"})}),(0,t.jsx)(ee.I,{ref:m,type:"datetime-local",value:(e=>{if(!e)return"";let l=new Date(e),s=l.getFullYear(),t=String(l.getMonth()+1).padStart(2,"0"),a=String(l.getDate()).padStart(2,"0"),n=String(l.getHours()).padStart(2,"0"),r=String(l.getMinutes()).padStart(2,"0");return"".concat(s,"-").concat(t,"-").concat(a,"T").concat(n,":").concat(r)})(o),onChange:e=>{c(e.target.value?new Date(e.target.value).toISOString():null)},onKeyDown:v,onBlur:j,className:"h-8 text-sm",disabled:i})]}):"Time"===s.type||"Time_NO_TZ"===s.type?(0,t.jsxs)("div",{ref:h,className:"relative w-full",children:[i&&(0,t.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-background/50 z-10",children:(0,t.jsx)(z.Z,{className:"h-4 w-4 animate-spin"})}),(0,t.jsx)(ee.I,{ref:m,type:"time",value:(e=>{if(!e)return"";if("string"==typeof e){let l=e.match(/^(\d{2}):(\d{2})/);if(l)return"".concat(l[1],":").concat(l[2]);if(e.includes("T")){let l=new Date(e),s=String(l.getHours()).padStart(2,"0"),t=String(l.getMinutes()).padStart(2,"0");return"".concat(s,":").concat(t)}}return e})(o),onChange:e=>c(e.target.value||null),onKeyDown:v,onBlur:j,className:"h-8 text-sm",disabled:i})]}):(0,t.jsxs)("div",{ref:h,className:"relative w-full",children:[i&&(0,t.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-background/50 z-10",children:(0,t.jsx)(z.Z,{className:"h-4 w-4 animate-spin"})}),(0,t.jsx)(ee.I,{ref:m,type:"text",value:null!=o?o:"",onChange:e=>c(e.target.value||null),onKeyDown:v,onBlur:j,className:"h-8 text-sm",disabled:i})]})},eU=["String","VARCHAR","CHAR","Number","Integer","INTEGER","INT","BigInt","BIGINT","SMALLINT","TINYINT","Float","FLOAT","Double","DOUBLE","Decimal","DECIMAL","Boolean","BOOLEAN","Date","Date_NO_TZ","DATEONLY","DateTime","DateTime_NO_TZ","DATETIME","TIMESTAMP","Time","Time_NO_TZ","Enum","ENUM","Email","URL","Phone"],eR=e=>!e.relType&&!e.primaryKey&&!["createdAt","updatedAt","deletedAt","userCreated","userUpdated","userDeleted","userCreated_Id","userUpdated_Id","userDeleted_Id"].includes(e.name)&&eU.includes(e.type);var eV=s(59892);let eJ=e=>{let{id:l,children:s,className:a,onClick:n,disabled:r=!1}=e,{attributes:i,listeners:c,setNodeRef:d,transform:u,transition:m,isDragging:h}=(0,o.nB)({id:l,disabled:r}),x={transform:eV.ux.Transform.toString(u),transition:m,opacity:h?.5:1,zIndex:h?1e3:void 0};return r?(0,t.jsx)(v.SC,{className:a,onClick:n,children:s}):(0,t.jsxs)(v.SC,{ref:d,style:x,className:(0,en.cn)(a,h&&"bg-muted shadow-lg"),onClick:n,children:[(0,t.jsx)(v.pj,{className:"w-8 px-2 cursor-grab active:cursor-grabbing",...i,...c,onClick:e=>e.stopPropagation(),children:(0,t.jsx)(E.Z,{className:"h-4 w-4 text-muted-foreground hover:text-foreground"})}),s]})};var eq=s(83724);let eK=e=>{let l=e.replace(/\./g," → ").replace(/_/g," ").replace(/([A-Z])/g," $1").trim();return l.charAt(0).toUpperCase()+l.slice(1)},eW=e=>{let{selectedCollection:l,schemaName:s,title:n,hideTitle:V=!1,enableSearch:J=!0,enableFilters:q=!0,enableCreate:K=!0,enableView:W=!1,enableEdit:G=!0,enableDelete:H=!0,enableExport:Y=!0,enableImport:X=!0,enableBulkSelect:Q=!0,enableColumnSettings:$=!0,enableFilePreview:ee=!1,enableInlineEdit:el=!0,headerActions:es,renderRowActions:et,quickFilters:ea,customColumnRenderers:er,defaultVisibleColumns:ei,getDisabledFields:eo,defaultMeta:ec,defaultFilters:ed,permanentFilters:eu,defaultSorters:em,onRecordClick:eh,onRefresh:ex,showSelectionColumn:ep=!1,selectionMode:ef="single",externalSelectedRows:ev,onExternalSelectionChange:ej,highlightSelectedRows:eN=!1}=e,[eb,ew]=(0,a.useState)(""),[eS,ek]=(0,a.useState)(!1),[eD,eA]=(0,a.useState)(!1),[e_,eI]=(0,a.useState)(!1),[eE,eO]=(0,a.useState)(!1),[eZ,eP]=(0,a.useState)(!1),[eL,eU]=(0,a.useState)(null),[eV,eW]=(0,a.useState)(1),[eG,eH]=(0,a.useState)(10),[eY,eX]=(0,a.useState)([]),[eQ,e$]=(0,a.useState)(ed||[]),e0=(0,a.useCallback)(()=>em&&em.length>0?em:[],[em]),[e1,e2]=(0,a.useState)(e0()),[e4,e5]=(0,a.useState)(!1),[e3,e8]=(0,a.useState)(null),[e7,e6]=(0,a.useState)(""),[e9,le]=(0,a.useState)(""),[ll,ls]=(0,a.useState)(!1),[lt,la]=(0,a.useState)(!1),[ln,lr]=(0,a.useState)(!1),[li,lo]=(0,a.useState)(!1),[lc,ld]=(0,a.useState)([]),[lu,lm]=(0,a.useState)(-1),[lh,lx]=(0,a.useState)(1),[lp,lf]=(0,a.useState)(!1),[lg,lv]=(0,a.useState)("middle"),[lj,ly]=(0,a.useState)(null),[lN,lb]=(0,a.useState)(null),[lw,lC]=(0,a.useState)({}),[lS,lT]=(0,a.useState)(null),[lk,lD]=(0,a.useState)(0),[lA,l_]=(0,a.useState)(0),[lI,lE]=(0,a.useState)(null),[lO,lF]=(0,a.useState)(!1),lZ=(0,r.Ji)(),lz=localStorage.getItem("token"),{getFieldsByCollection:lM,getNestedFields:lP,isSortEnabled:lL}=(0,d.I_)(),lB=lL(l),[lU,lR]=(0,a.useState)(!1),{getColumnPreferences:lV,saveColumnPreferences:lJ,getFilterPreferences:lq,saveFilterPreferences:lK,isInitialized:lW}=(0,u.Gn)(),lG=(0,a.useMemo)(()=>lM(l),[l,lM]),lH=(0,a.useMemo)(()=>{if(!l||!lG)return[];if(ei&&ei.length>0){let e=lV(l);return e&&e.visibleColumns&&e.visibleColumns.length>0?e.visibleColumns:ei}let e=lV(l);if(e&&e.visibleColumns&&e.visibleColumns.length>0)return e.visibleColumns;let s=["userCreated_Id","userCreated","userUpdated_Id","userUpdated","userDeleted","userDeleted_Id","createdAt","updatedAt","deletedAt"];return Object.keys(lG).filter(e=>{let l=lG[e];return!s.includes(e)&&!l.relType}).slice(0,5)},[l,lG,lV,ei]);(0,a.useEffect)(()=>{if(l&&lW){let e=lV(l);(null==e?void 0:e.columnWidths)?lC(e.columnWidths):lC({})}},[l,lW,lV]),(0,a.useEffect)(()=>{if(l&&lW&&!ed){let e=lq(l);(null==e?void 0:e.filters)?e$(e.filters):e$([])}},[l,lW,ed]),(0,a.useEffect)(()=>{!lB||(null==em?void 0:em.length)||0!==e1.length||e2([{field:"sort",order:"asc"}])},[lB,em,e1.length]);let lY=(0,a.useMemo)(()=>{if(!lG||!l)return["*"];let e=["id"];return lH.forEach(l=>{if("id"!==l){if(l.includes("."))e.push(l);else{let s=lG[l];s&&(s.relType&&s.showAs?e.push(l+".*"):e.push(l))}}}),e.length>0?e:["*"]},[lG,l,lH]),lX=(0,a.useMemo)(()=>eb?[{field:"search",operator:"contains",value:eb}]:[],[eb]),lQ=(0,a.useMemo)(()=>[...eu||[],...eQ,...lX],[eu,eQ,lX]),l$=!!l&&lY.length>0&&lW,{data:l0,isLoading:l1,refetch:l2}=(0,r.sm)({resource:l,meta:{fields:lY,...ec},queryOptions:{enabled:l$},pagination:{current:eV,pageSize:eG,mode:"server"},filters:lQ,sorters:e1}),l4=(0,a.useCallback)(()=>{l2(),null==ex||ex()},[l2,ex]),l5=(null==l0?void 0:l0.data)||[],l3=(null==l0?void 0:l0.total)||0,l8=Math.ceil(l3/eG),{mutate:l7,isLoading:l6}=(0,r.R2)(),{mutate:l9,isLoading:se}=(0,r.RO)(),{mutate:sl,isLoading:ss}=(0,r.PQ)(),st=null==eL?void 0:eL.id,sa=(0,a.useMemo)(()=>{if(!lG)return["*"];let e=["*"];return Object.entries(lG).forEach(l=>{let[s,t]=l;t.relType&&e.push("".concat(s,".*"))}),e},[lG]),{data:sn,isLoading:sr,isFetching:si}=(0,r.rD)({resource:l,id:st||"",queryOptions:{enabled:!!(st&&(e_||eE))},meta:{fields:sa}}),so=null==sn?void 0:sn.data,sc=(0,a.useMemo)(()=>Object.entries(lG||{}).map(e=>{let[l,s]=e;return{name:l,...s,label:l.replace(/_/g," ").replace(/([A-Z])/g," $1").trim()}}),[lG]),sd=(0,a.useCallback)((e,l)=>{if(!e)return"-";if("string"==typeof e||"number"==typeof e)return String(e);if(l.showAs&&Array.isArray(l.showAs)){let s=["-"," ",",","_"," and "," or "],t=[];l.showAs.forEach(l=>{if(s.includes(l))t.push(l);else{let s;if(l.includes(".")){let t=l.split("."),a=e;for(let e of t)if(null==(a=null==a?void 0:a[e]))break;s=a}else s=e[l];null!=s&&""!==s&&t.push(String(s))}});let a=t.filter((e,l)=>{let a=s.includes(e),n=l>0&&s.includes(t[l-1]),r=l===t.length-1;return!a||0!==l&&!r&&!n});if(a.length>0)return a.join("")}return e.name||e.title||e.label||e.email||e.id||JSON.stringify(e)},[]);(0,a.useMemo)(()=>lG?Object.keys(lG):[],[lG]);let su=(0,a.useMemo)(()=>lG?lP(l):[],[lG,l,lP]);(0,a.useEffect)(()=>{l&&lG&&ld(Object.keys(lG).filter(e=>!["userCreated_Id","userCreated","userUpdated_Id","userUpdated","userDeleted","userDeleted_Id","createdAt","updatedAt","deletedAt"].includes(e)))},[l,lG]);let sm=(0,r.x5)(),sh=(0,a.useCallback)((e,l,s)=>{let t=new Blob([[l.map(e=>e.includes(",")||e.includes('"')||e.includes("\n")?'"'.concat(e.replace(/"/g,'""'),'"'):e).join(","),...e.map(e=>l.map(l=>{let s=e;for(let e of l.split("."))s=null==s?void 0:s[e];if(null==s)return"";if("object"==typeof s){let e=JSON.stringify(s);return'"'.concat(e.replace(/"/g,'""'),'"')}return"string"==typeof s&&(s.includes(",")||s.includes('"')||s.includes("\n"))?'"'.concat(s.replace(/"/g,'""'),'"'):s}).join(","))].join("\n")],{type:"text/csv;charset=utf-8;"}),a=document.createElement("a"),n=URL.createObjectURL(t);a.setAttribute("href",n),a.setAttribute("download","".concat(s,"_export_").concat(new Date().toISOString().split("T")[0],".csv")),a.style.visibility="hidden",document.body.appendChild(a),a.click(),document.body.removeChild(a)},[]),sx=(0,a.useCallback)(async()=>{lf(!0);try{let e={resource:l,meta:{fields:lc},filters:lQ,dataProviderName:void 0};-1!==lu&&lu>0&&(e.pagination={current:lh,pageSize:lu,mode:"server"});let{data:s}=await sm().getList(e);sh(s,lc,l),ls(!1),eC.Am.success("Export completed successfully")}catch(e){console.error("Export error:",e),eC.Am.error("Export failed")}finally{lf(!1)}},[lc,lu,lh,l,lQ,sm,sh]),sp=(0,a.useCallback)(()=>{l4()},[l4]),sf=(0,a.useMemo)(()=>new Set(["JSON","JSONB","VIRTUAL","Array_Integer","Array_String","Array_Double","Array_Decimal","Array_UUID","Array_Date","Array_DateTime","Array_Boolean","Point","Polygon","LineString"]),[]),sg=(0,a.useCallback)((e,l)=>!e||!sf.has(e)&&(null==l?void 0:l.relType)!=="M2A"&&(null==l||!l.alias),[sf]),sv=(0,a.useMemo)(()=>lG?lH.map(e=>{if(e.includes(".")){let[l,...s]=e.split("."),t=lG[l];if(t&&t.relType){let l="BelongsTo"===t.relType||"HasOne"===t.relType||"M2O"===t.relType||"O2O"===t.relType;return{key:e,title:eK(e),field:{name:e,type:"String",relType:null,isNested:!0},sortable:l,isNested:!0}}return null}let l=lG[e];if(!l)return null;let s=!("HasMany"===l.relType||"BelongsToMany"===l.relType)&&sg(l.type,l);return{key:e,title:eK(e),field:{name:e,type:l.type||"String",relType:l.relType,showAs:Array.isArray(l.showAs)?l.showAs:l.showAs?[l.showAs]:void 0,displayFormat:l.displayFormat,displayOptions:l.displayOptions,values:l.values,allowNull:l.allowNull},sortable:s,isNested:!1}}).filter(Boolean):[],[lG,lH,sg]),sj=(0,a.useCallback)(e=>{e2(l=>{let s=l.find(l=>l.field===e);return s?"asc"===s.order?[{field:e,order:"desc"}]:[]:[{field:e,order:"asc"}]})},[]),sy=(0,i.Dy)((0,i.VT)(i.we,{activationConstraint:{distance:8}}),(0,i.VT)(i.Lg,{coordinateGetter:o.is})),sN=(0,a.useCallback)(async e=>{let{active:s,over:t}=e;if(lR(!1),!t||s.id===t.id)return;let a=String(s.id),n=String(t.id),r=l5.findIndex(e=>String(e.id)===a),i=l5.findIndex(e=>String(e.id)===n);if(-1!==r&&-1!==i)try{let e=(0,m.fO)(h.G);await e(l,a,n,r<i?"after":"before"),eC.Am.success("Order updated successfully"),l4()}catch(e){eC.Am.error((null==e?void 0:e.message)||"Failed to update order")}},[l,l4,l5]),sb=(0,a.useCallback)(()=>{lR(!0)},[]),sw=(0,a.useCallback)(e=>{let l=e1.find(l=>l.field===e);return(null==l?void 0:l.order)||null},[e1]),sC=(0,a.useCallback)(async e=>{e$(e),await lK(l,{filters:e,sorters:[]}),eW(1)},[l,lK]);(0,a.useCallback)(async(e,s)=>{let t=s?[...lH,e]:lH.filter(l=>l!==e);await lJ(l,{visibleColumns:t,tableDensity:lg,columnWidths:lw})},[l,lH,lJ,lg,lw]);let sS=(0,a.useCallback)(async e=>{await lJ(l,{visibleColumns:e,tableDensity:lg,columnWidths:lw})},[l,lJ,lg,lw]),sT=(0,a.useCallback)(async e=>{lv(e),await lJ(l,{visibleColumns:lH,tableDensity:e,columnWidths:lw})},[l,lH,lJ,lw]),sk=(0,a.useCallback)((e,l)=>{ly(l),e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",l);let s=e.currentTarget;setTimeout(()=>{s.style.opacity="0.5"},0)},[]),sD=(0,a.useCallback)(e=>{e.currentTarget.style.opacity="1",ly(null),lb(null)},[]),sA=(0,a.useCallback)((e,l)=>{e.preventDefault(),e.dataTransfer.dropEffect="move",lj&&l!==lj&&lb(l)},[lj]),s_=(0,a.useCallback)(()=>{lb(null)},[]),sI=(0,a.useCallback)(async(e,s)=>{if(e.preventDefault(),!lj||lj===s){ly(null),lb(null);return}let t=[...lH],a=t.indexOf(lj),n=t.indexOf(s);-1!==a&&-1!==n&&(t.splice(a,1),t.splice(n,0,lj),await lJ(l,{visibleColumns:t,tableDensity:lg,columnWidths:lw})),ly(null),lb(null)},[lj,lH,l,lJ,lg,lw]),sE=(0,a.useCallback)((e,l)=>{e.preventDefault(),e.stopPropagation(),lT(l),lD(e.clientX),l_(lw[l]||150)},[lw]),sO=(0,a.useCallback)(e=>{if(!lS)return;let l=Math.max(80,lA+(e.clientX-lk));lC(e=>({...e,[lS]:l}))},[lS,lk,lA]),sF=(0,a.useCallback)(async()=>{lS&&(await lJ(l,{visibleColumns:lH,tableDensity:lg,columnWidths:lw}),lT(null))},[lS,l,lH,lg,lw,lJ]);(0,a.useEffect)(()=>(lS&&(document.addEventListener("mousemove",sO),document.addEventListener("mouseup",sF),document.body.style.cursor="col-resize",document.body.style.userSelect="none"),()=>{document.removeEventListener("mousemove",sO),document.removeEventListener("mouseup",sF),document.body.style.cursor="",document.body.style.userSelect=""}),[lS,sO,sF]);let sZ=(0,a.useCallback)(()=>{eL&&l7({resource:l,id:eL.id},{onSuccess:()=>{eC.Am.success("Record deleted successfully"),eP(!1),eU(null),l4()},onError:e=>{eC.Am.error("Failed to delete record"),console.error(e)}})},[eL,l,l7,l4]),sz=(0,a.useCallback)(e=>{l9({resource:l,values:e},{onSuccess:()=>{eC.Am.success("Record created successfully"),eA(!1),l4()},onError:e=>{eC.Am.error("Failed to create record"),console.error(e)}})},[l,l9,l4]),sM=(0,a.useCallback)(e=>{eL&&sl({resource:l,id:eL.id,values:e},{onSuccess:()=>{eC.Am.success("Record updated successfully"),eO(!1),eU(null),l4()},onError:e=>{eC.Am.error("Failed to update record"),console.error(e)}})},[eL,l,sl,l4]),sP=(0,a.useCallback)(async(e,s,t)=>(lF(!0),new Promise((a,n)=>{sl({resource:l,id:e,values:{[s]:t}},{onSuccess:()=>{eC.Am.success("Field updated"),lE(null),lF(!1),l4(),a()},onError:e=>{eC.Am.error("Failed to update field"),console.error(e),lF(!1),n(e)}})})),[l,sl,l4]),sL=(0,a.useCallback)(()=>{lE(null)},[]),sB=(0,a.useCallback)(()=>{eY.length===l5.length?eX([]):eX(l5.map(e=>e.id))},[eY,l5]),sU=(0,a.useCallback)(e=>{eX(l=>l.includes(e)?l.filter(l=>l!==e):[...l,e])},[]);return l?(0,t.jsxs)("div",{className:"flex flex-col h-full gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between flex-wrap gap-2",children:[!V&&(0,t.jsx)("h1",{className:"text-lg font-semibold",children:n||s||l}),(0,t.jsxs)("div",{className:(0,en.cn)("flex items-center gap-2 flex-wrap",V&&"flex-1 justify-end"),children:[ea,J&&(0,t.jsx)(f.t,{value:eb,onChange:ew,placeholder:"Search...",expandedWidth:"w-64"}),q&&(0,t.jsxs)(p.z,{variant:eQ.length>0?"default":"outline",size:"icon",onClick:()=>ek(!0),title:"Filters",className:"relative",children:[(0,t.jsx)(S.Z,{className:"h-4 w-4"}),eQ.length>0&&(0,t.jsx)(j.C,{variant:"secondary",className:"absolute -top-1 -right-1 h-4 w-4 p-0 flex items-center justify-center text-xs",children:eQ.length})]}),$&&(0,t.jsx)(p.z,{variant:"outline",size:"icon",onClick:()=>lo(!0),title:"Settings",children:(0,t.jsx)(T.Z,{className:"h-4 w-4"})}),(0,t.jsx)(p.z,{variant:"outline",size:"icon",onClick:()=>l4(),title:"Refresh",children:(0,t.jsx)(k.Z,{className:"h-4 w-4"})}),(Y||X)&&(0,t.jsxs)(b.h_,{children:[(0,t.jsx)(b.$F,{asChild:!0,children:(0,t.jsx)(p.z,{variant:"outline",size:"icon",title:"More",children:(0,t.jsx)(D.Z,{className:"h-4 w-4"})})}),(0,t.jsxs)(b.AW,{align:"end",children:[(0,t.jsx)(b.Ju,{children:"Data Actions"}),(0,t.jsx)(b.VD,{}),Y&&(0,t.jsxs)(b.Xi,{onClick:()=>ls(!0),children:[(0,t.jsx)(A.Z,{className:"mr-2 h-4 w-4"}),"Export"]}),X&&(0,t.jsxs)(b.Xi,{onClick:()=>la(!0),children:[(0,t.jsx)(_.Z,{className:"mr-2 h-4 w-4"}),"Import"]})]})]}),es,K&&(0,t.jsx)(p.z,{size:"icon",onClick:()=>eA(!0),title:"Create",children:(0,t.jsx)(I.Z,{className:"h-4 w-4"})})]})]}),Q&&eY.length>0&&(0,t.jsxs)("div",{className:"flex items-center gap-2 p-2 bg-muted rounded-md",children:[(0,t.jsxs)("span",{className:"text-sm font-medium",children:[eY.length," row(s) selected"]}),(0,t.jsx)(p.z,{variant:"outline",size:"sm",onClick:()=>lr(!0),children:"Bulk Actions"}),(0,t.jsx)(p.z,{variant:"outline",size:"sm",onClick:()=>eX([]),children:"Clear"})]}),(0,t.jsxs)(g.Zb,{className:"flex-1 flex flex-col overflow-hidden min-h-0",children:[(0,t.jsx)("div",{className:"flex-1 overflow-auto relative",children:(0,t.jsxs)("table",{className:"w-full caption-bottom text-sm min-w-max",children:[(0,t.jsx)("thead",{className:"sticky top-0 z-10 bg-background",children:(0,t.jsxs)(v.SC,{className:"border-b",children:[lB&&(0,t.jsx)(v.ss,{className:"w-8 px-2",children:(0,t.jsx)(E.Z,{className:"h-4 w-4 text-muted-foreground"})}),ep&&(0,t.jsx)(v.ss,{className:"w-12 sticky left-0 bg-background z-20",children:"multiple"===ef?"Select":""}),Q&&(0,t.jsx)(v.ss,{className:"w-12 sticky left-0 bg-background z-20",children:(0,t.jsx)(C.X,{checked:l5.length>0&&eY.length===l5.length,onCheckedChange:sB})}),sv.map(e=>{let l=sw(e.key),s=lj===e.key,a=lN===e.key,n=lw[e.key];return(0,t.jsxs)(v.ss,{draggable:!0,onDragStart:l=>sk(l,e.key),onDragEnd:sD,onDragOver:l=>sA(l,e.key),onDragLeave:s_,onDrop:l=>sI(l,e.key),style:{width:n?"".concat(n,"px"):void 0,minWidth:n?"".concat(n,"px"):void 0},className:(0,en.cn)("whitespace-nowrap cursor-grab active:cursor-grabbing relative group/header",e.sortable&&"cursor-pointer select-none",s&&"opacity-50",a&&"border-l-2 border-l-primary"),onClick:()=>e.sortable&&sj(e.key),children:[(0,t.jsxs)("div",{className:"flex items-center gap-1 pr-2",children:[(0,t.jsx)(E.Z,{className:"h-4 w-4 text-muted-foreground opacity-40 hover:opacity-100 cursor-grab flex-shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:e.title}),e.sortable&&(0,t.jsx)("span",{className:"ml-1 flex-shrink-0",children:"asc"===l?(0,t.jsx)(O.Z,{className:"h-4 w-4"}):"desc"===l?(0,t.jsx)(F.Z,{className:"h-4 w-4"}):(0,t.jsx)(Z.Z,{className:"h-4 w-4 text-muted-foreground"})})]}),(0,t.jsx)("div",{className:(0,en.cn)("absolute right-0 top-0 bottom-0 w-[3px] cursor-col-resize","border-r border-border hover:border-primary hover:bg-primary/20",lS===e.key&&"border-primary bg-primary/30"),onMouseDown:l=>sE(l,e.key),onClick:e=>e.stopPropagation()})]},e.key)}),(et||W||G||H)&&(0,t.jsx)(v.ss,{className:"w-24",children:"Actions"})]})}),(0,t.jsx)(i.LB,{sensors:sy,collisionDetection:i.pE,onDragStart:sb,onDragEnd:sN,modifiers:[c.DL],children:(0,t.jsx)(o.Fo,{items:l5.map(e=>e.id),strategy:o.qw,disabled:!lB,children:(0,t.jsx)("tbody",{className:(0,en.cn)("[&_tr:last-child]:border-0","small"===lg&&"[&_tr]:h-8 [&_td]:py-1 [&_td]:text-xs","middle"===lg&&"[&_tr]:h-12 [&_td]:py-2 [&_td]:text-sm","large"===lg&&"[&_tr]:h-16 [&_td]:py-4"),children:l1?(0,t.jsx)(v.SC,{children:(0,t.jsx)(v.pj,{colSpan:sv.length+(lB?1:0)+(ep?1:0)+(Q?1:0)+(et||W||G||H?1:0),className:"h-48 text-center",children:(0,t.jsx)(z.Z,{className:"h-8 w-8 animate-spin mx-auto"})})}):0===l5.length?(0,t.jsx)(v.SC,{children:(0,t.jsx)(v.pj,{colSpan:sv.length+(lB?1:0)+(ep?1:0)+(Q?1:0)+(et||W||G||H?1:0),className:"h-48 text-center text-muted-foreground",children:"No data available"})}):l5.map((e,l)=>{let s=null==ev?void 0:ev.some(l=>l.id===e.id);return(0,t.jsxs)(eJ,{id:e.id,disabled:!lB,className:(0,en.cn)(eh&&"cursor-pointer hover:bg-muted/50",eN&&s&&"bg-primary/10 hover:bg-primary/15"),onClick:()=>null==eh?void 0:eh(e),children:[ep&&(0,t.jsx)(v.pj,{onClick:e=>e.stopPropagation(),className:"sticky left-0 bg-background z-10",children:"multiple"===ef?(0,t.jsx)(C.X,{checked:s||!1,onCheckedChange:l=>{l?null==ej||ej([...ev||[],e]):null==ej||ej((ev||[]).filter(l=>l.id!==e.id))}}):(0,t.jsx)("input",{type:"radio",name:"external-selection",checked:s||!1,onChange:()=>{null==ej||ej([e])},className:"h-4 w-4 text-primary border-border focus:ring-primary"})}),Q&&(0,t.jsx)(v.pj,{onClick:e=>e.stopPropagation(),children:(0,t.jsx)(C.X,{checked:eY.includes(e.id),onCheckedChange:()=>sU(e.id)})}),sv.map(l=>{let s=e;if(l.isNested){for(let e of l.key.split(".")){if(null==s)break;if(Array.isArray(s)){if(0===(s=s.map(l=>null==l?void 0:l[e]).filter(e=>null!=e)).length){s=null;break}}else s=null==s?void 0:s[e]}Array.isArray(s)&&(s=s.join(", "))}else s=e[l.key];if(er&&er[l.key]){let a=lw[l.key];return(0,t.jsx)(v.pj,{style:{width:a?"".concat(a,"px"):void 0,maxWidth:a?"".concat(a,"px"):void 0},className:a?"overflow-hidden":"",children:(0,t.jsx)("div",{className:a?"truncate":"",children:er[l.key](s,e,l.field)})},l.key)}let a=lw[l.key],n=l.isNested&&null!=s&&"object"==typeof s?null:s,r=(null==lI?void 0:lI.recordId)===e.id&&(null==lI?void 0:lI.columnKey)===l.key,i=el&&!l.isNested&&l.field&&eR(l.field);return(0,t.jsx)(v.pj,{style:{width:a?"".concat(a,"px"):void 0,maxWidth:a?"".concat(a,"px"):void 0},className:(0,en.cn)(a?"overflow-hidden":"",i&&!r&&"cursor-cell"),onDoubleClick:s=>{i&&!r&&(s.stopPropagation(),lE({recordId:e.id,columnKey:l.key}))},children:r?(0,t.jsx)(eB,{value:s,field:l.field,onSave:s=>sP(e.id,l.key,s),onCancel:sL,isLoading:lO}):(0,t.jsx)("div",{className:a?"truncate":"",children:l.isNested?(0,t.jsx)("span",{className:"text-sm",children:null!=n?String(n):"-"}):(0,t.jsx)(x.Zl,{field:l.field,value:s,readOnly:!0,size:"small"})})},l.key)}),(et||W||G||H)&&(0,t.jsx)(v.pj,{onClick:e=>e.stopPropagation(),children:et?et({record:e,onView:()=>{eU(e),eI(!0)},onEdit:()=>{eU(e),eO(!0)},onDelete:()=>{eU(e),eP(!0)}}):(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[W&&(0,t.jsx)(p.z,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>{eU(e),eI(!0)},children:(0,t.jsx)(M.Z,{className:"h-4 w-4"})}),G&&(0,t.jsx)(p.z,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>{eU(e),eO(!0)},children:(0,t.jsx)(P.Z,{className:"h-4 w-4"})}),H&&(0,t.jsx)(p.z,{variant:"ghost",size:"icon",className:"h-8 w-8 text-destructive",onClick:()=>{eU(e),eP(!0)},children:(0,t.jsx)(L.Z,{className:"h-4 w-4"})})]})})]},e.id||l)})})})})]})}),(0,t.jsxs)("div",{className:"flex items-center justify-between border-t px-3 py-2 gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)("p",{className:"text-sm text-muted-foreground hidden sm:block",children:["Showing ",(eV-1)*eG+1," to"," ",Math.min(eV*eG,l3)," of ",l3," ","records"]}),(0,t.jsxs)(w.Ph,{value:eG.toString(),onValueChange:e=>{eH(Number(e)),eW(1)},children:[(0,t.jsx)(w.i4,{className:"w-[70px] sm:w-[100px]",children:(0,t.jsx)(w.ki,{})}),(0,t.jsxs)(w.Bw,{children:[(0,t.jsxs)(w.Ql,{value:"10",children:[(0,t.jsx)("span",{className:"sm:hidden",children:"10"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:"10 / page"})]}),(0,t.jsxs)(w.Ql,{value:"25",children:[(0,t.jsx)("span",{className:"sm:hidden",children:"25"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:"25 / page"})]}),(0,t.jsxs)(w.Ql,{value:"50",children:[(0,t.jsx)("span",{className:"sm:hidden",children:"50"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:"50 / page"})]}),(0,t.jsxs)(w.Ql,{value:"100",children:[(0,t.jsx)("span",{className:"sm:hidden",children:"100"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:"100 / page"})]})]})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1 sm:gap-2",children:[(0,t.jsxs)(p.z,{variant:"outline",size:"sm",onClick:()=>eW(e=>Math.max(1,e-1)),disabled:1===eV,children:[(0,t.jsx)(B.Z,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:"Previous"})]}),(0,t.jsxs)("span",{className:"text-sm whitespace-nowrap",children:[(0,t.jsxs)("span",{className:"sm:hidden",children:[eV,"/",l8||1]}),(0,t.jsxs)("span",{className:"hidden sm:inline",children:["Page ",eV," of ",l8||1]})]}),(0,t.jsxs)(p.z,{variant:"outline",size:"sm",onClick:()=>eW(e=>Math.min(l8,e+1)),disabled:eV>=l8,children:[(0,t.jsx)("span",{className:"hidden sm:inline",children:"Next"}),(0,t.jsx)(U.Z,{className:"h-4 w-4"})]})]})]})]}),q&&(0,t.jsx)(eg,{visible:eS,onClose:()=>ek(!1),formFields:sc,onApply:sC,initialFilters:eQ,collectionName:l}),K&&(0,t.jsx)(y.yo,{open:eD,onOpenChange:eA,children:(0,t.jsxs)(y.ue,{className:"w-[600px] sm:max-w-[600px] overflow-y-auto",children:[(0,t.jsx)(y.Tu,{children:(0,t.jsx)(y.bC,{children:"Create New Record"})}),(0,t.jsx)("div",{className:"mt-4",children:(0,t.jsx)(eM.j,{fields:sc,onSubmit:sz,isLoading:se,onCancel:()=>eA(!1)})})]})}),W&&(0,t.jsx)(y.yo,{open:e_,onOpenChange:e=>{eI(e),e||eU(null)},children:(0,t.jsxs)(y.ue,{className:"w-[600px] sm:max-w-[600px] overflow-y-auto",children:[(0,t.jsx)(y.Tu,{children:(0,t.jsx)(y.bC,{children:"View Record"})}),(0,t.jsx)("div",{className:"mt-4 space-y-4",children:sr||si?(0,t.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,t.jsx)(z.Z,{className:"h-8 w-8 animate-spin"})}):so?(()=>{let e,l;let s=sc.filter(e=>e.relType&&e.foreignKey).map(e=>e.foreignKey),a=ee&&so.type&&so.id?(0,t.jsxs)("div",{className:"mb-4 space-y-2",children:[(0,t.jsx)("label",{className:"text-sm font-medium text-muted-foreground",children:"Preview"}),(0,t.jsx)("div",{className:"p-3 bg-muted/50 rounded-md flex items-center justify-center",children:(null==(e=so.type)?void 0:e.startsWith("image/"))?(0,t.jsx)("img",{src:"".concat(lZ,"/assets/").concat(so.id,"?access_token=").concat(lz),alt:so.title||"Image preview",className:"max-w-full max-h-64 object-contain rounded",onError:e=>{e.target.style.display="none"}}):(null==(l=so.type)?void 0:l.startsWith("video/"))?(0,t.jsx)("video",{src:"".concat(lZ,"/assets/").concat(so.id,"?access_token=").concat(lz),controls:!0,className:"max-w-full max-h-64 rounded"}):(0,t.jsx)("div",{className:"text-center text-muted-foreground py-4",children:(0,t.jsx)("span",{className:"text-sm",children:"No preview available for this file type"})})})]}):null,n=sc.filter(e=>!s.includes(e.name)).map(e=>{var l,s;let a=so[e.name],n=e=>!e||"object"==typeof e&&(null===e.id||void 0===e.id);return(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("label",{className:"text-sm font-medium text-muted-foreground capitalize",children:e.label||e.name.replace(/_/g," ")}),["Point","LineString","Polygon","MultiPoint","MultiLineString","MultiPolygon"].includes(e.type)&&a&&(0,t.jsxs)(p.z,{variant:"ghost",size:"sm",className:"h-6 text-xs gap-1",onClick:()=>{e8(a),e6(e.label||e.name),le(e.type),e5(!0)},children:[(0,t.jsx)(R.Z,{className:"h-3 w-3"}),"View in Map"]})]}),(0,t.jsx)("div",{className:"p-3 bg-muted/50 rounded-md min-h-[40px]",children:(null==er?void 0:er[e.name])?er[e.name](a,so,e):e.relType?(()=>{if(!a||n(a))return(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"-"});if(Array.isArray(a)){let l=a.filter(e=>!n(e));return 0===l.length?(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"-"}):(0,t.jsx)("div",{className:"flex flex-wrap gap-1",children:l.map((l,s)=>(0,t.jsx)(j.C,{variant:"secondary",className:"text-xs",children:sd(l,e)},(null==l?void 0:l.id)||s))})}return"object"==typeof a?(0,t.jsx)(j.C,{variant:"secondary",className:"text-xs",children:sd(a,e)}):(0,t.jsx)("span",{className:"text-sm",children:String(a)})})():null!=a?["DateTime","DateTime_NO_TZ","DATETIME","TIMESTAMP"].includes(e.type)?(0,t.jsxs)("span",{className:"text-sm",children:[new Date(a).toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}),(0,t.jsxs)("span",{className:"text-muted-foreground ml-1",children:["(",Intl.DateTimeFormat().resolvedOptions().timeZone,")"]})]}):"Date"===e.type?(0,t.jsx)("span",{className:"text-sm",children:new Date(a).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}):["Time","Time_NO_TZ"].includes(e.type)?(0,t.jsx)("span",{className:"text-sm",children:a}):["Point","LineString","Polygon","MultiPoint","MultiLineString","MultiPolygon"].includes(e.type)?(0,t.jsx)("pre",{className:"text-sm whitespace-pre-wrap break-all max-h-24 overflow-auto",children:JSON.stringify(a,null,2)}):(null===(l=e.type)||void 0===l?void 0:l.startsWith("Array_"))?(0,t.jsxs)("div",{className:"flex flex-wrap gap-1",children:[Array.isArray(a)&&a.length>0?a.slice(0,10).map((l,s)=>{let a=String(l);if(e.type.includes("Date")||e.type.includes("DateTime")){let s=new Date(l);a=e.type.includes("DateTime")?s.toLocaleString():s.toLocaleDateString()}else e.type.includes("Boolean")&&(a=l?"true":"false");return(0,t.jsx)(j.C,{variant:"secondary",className:"text-xs",children:a},s)}):(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"Empty array"}),Array.isArray(a)&&a.length>10&&(0,t.jsxs)(j.C,{variant:"outline",className:"text-xs",children:["+",a.length-10," more"]})]}):(null===(s=e.type)||void 0===s?void 0:s.startsWith("Range_"))?(()=>{var l,s;if(!a||"object"!=typeof a)return(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"-"});let n=!1!==a.lowerInclusive?"[":"(",r=!1!==a.upperInclusive?"]":")",i=String(null!==(l=a.lower)&&void 0!==l?l:""),o=String(null!==(s=a.upper)&&void 0!==s?s:"");if(e.type.includes("Date")||e.type.includes("DateTime")){if(a.lower){let l=new Date(a.lower);i=e.type.includes("DateTime")?l.toLocaleString():l.toLocaleDateString()}if(a.upper){let l=new Date(a.upper);o=e.type.includes("DateTime")?l.toLocaleString():l.toLocaleDateString()}}return(0,t.jsxs)(j.C,{variant:"secondary",className:"font-mono text-xs",children:[n,i," – ",o,r]})})():"object"==typeof a?(0,t.jsx)("pre",{className:"text-sm whitespace-pre-wrap break-all",children:JSON.stringify(a,null,2)}):(0,t.jsx)("span",{className:"text-sm",children:String(a)}):(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"-"})})]},e.name)});return(0,t.jsxs)(t.Fragment,{children:[a,n]})})():(0,t.jsx)("div",{className:"text-center py-8 text-muted-foreground",children:"No data available"})})]})}),G&&(0,t.jsx)(y.yo,{open:eE,onOpenChange:e=>{eO(e),e||eU(null)},children:(0,t.jsxs)(y.ue,{className:"w-[600px] sm:max-w-[600px] overflow-y-auto",children:[(0,t.jsx)(y.Tu,{children:(0,t.jsx)(y.bC,{children:"Edit Record"})}),(0,t.jsx)("div",{className:"mt-4",children:sr||si?(0,t.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,t.jsx)(z.Z,{className:"h-8 w-8 animate-spin"})}):so?(0,t.jsx)(eM.j,{fields:sc,initialValues:so,onSubmit:sM,isLoading:ss,disabledFields:(null==eo?void 0:eo(so))||[],onCancel:()=>{eO(!1),eU(null)}}):(0,t.jsx)("div",{className:"text-center py-8 text-muted-foreground",children:"No data available"})})]})}),H&&(0,t.jsx)(N.Vq,{open:eZ,onOpenChange:eP,children:(0,t.jsxs)(N.cZ,{children:[(0,t.jsxs)(N.fK,{children:[(0,t.jsx)(N.$N,{children:"Delete Record"}),(0,t.jsx)(N.Be,{children:"Are you sure you want to delete this record? This action cannot be undone."})]}),(0,t.jsxs)(N.cN,{children:[(0,t.jsx)(p.z,{variant:"outline",onClick:()=>{eP(!1),eU(null)},children:"Cancel"}),(0,t.jsxs)(p.z,{variant:"destructive",onClick:sZ,disabled:l6,children:[l6&&(0,t.jsx)(z.Z,{className:"mr-2 h-4 w-4 animate-spin"}),"Delete"]})]})]})}),Y&&(0,t.jsx)(ey,{visible:ll,onClose:()=>ls(!1),exportColumns:lc,onExportColumnsChange:ld,exportLimit:lu,onExportLimitChange:lm,exportPage:lh,onExportPageChange:lx,isExporting:lp,onExport:sx,columnTreeData:su}),X&&(0,t.jsx)(eT,{visible:lt,onClose:()=>la(!1),selectedCollection:l,onImportComplete:sp}),Q&&(0,t.jsx)(eF,{visible:ln,onClose:()=>lr(!1),selectedRows:l5.filter(e=>eY.includes(e.id)),selectedCollection:l,onClearSelection:()=>{eX([]),l4()}}),$&&(0,t.jsx)(ez,{visible:li,onClose:()=>lo(!1),tableDensity:lg,onTableDensityChange:sT,visibleColumns:lH,onVisibleColumnsChange:sS,columnTreeData:su}),(0,t.jsx)(eq.Z,{open:e4,onOpenChange:e5,value:e3,fieldName:e7,fieldType:e9})]}):(0,t.jsx)(g.Zb,{children:(0,t.jsxs)(g.aY,{className:"p-8 text-center",children:[(0,t.jsx)("h3",{className:"text-lg font-medium",children:"Please select a collection"}),(0,t.jsx)("p",{className:"text-muted-foreground mt-2",children:"Choose a collection from the sidebar to view and manage its data."})]})})},eG=()=>{let e=(0,n.useSearchParams)(),l=e.get("collection")||"",s=e.get("schema")||"",{isLoading:a}=(0,d.I_)(),{isInitialized:r,isLoading:i}=(0,u.Gn)();return a||i||!r?(0,t.jsx)(g.Zb,{children:(0,t.jsxs)(g.aY,{className:"p-8 text-center",children:[(0,t.jsx)(z.Z,{className:"h-8 w-8 animate-spin mx-auto"}),(0,t.jsx)("p",{className:"text-muted-foreground mt-2",children:"Loading..."})]})}):(0,t.jsx)(eW,{selectedCollection:l,schemaName:s,enableView:!0},l)};var eH=eG},32060:function(e,l,s){s.d(l,{$F:function(){return u},AW:function(){return m},Ju:function(){return x},VD:function(){return p},Xi:function(){return h},h_:function(){return d}});var t=s(57437),a=s(2265),n=s(28119),r=s(10407),i=s(30401),o=s(40519),c=s(93448);let d=n.fC,u=n.xz;n.ZA,n.Uv,n.Tr,n.Ee,a.forwardRef((e,l)=>{let{className:s,inset:a,children:i,...o}=e;return(0,t.jsxs)(n.fF,{ref:l,className:(0,c.cn)("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",a&&"pl-8",s),...o,children:[i,(0,t.jsx)(r.Z,{className:"ml-auto h-4 w-4"})]})}).displayName=n.fF.displayName,a.forwardRef((e,l)=>{let{className:s,...a}=e;return(0,t.jsx)(n.tu,{ref:l,className:(0,c.cn)("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",s),...a})}).displayName=n.tu.displayName;let m=a.forwardRef((e,l)=>{let{className:s,sideOffset:a=4,...r}=e;return(0,t.jsx)(n.Uv,{children:(0,t.jsx)(n.VY,{ref:l,sideOffset:a,className:(0,c.cn)("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",s),...r})})});m.displayName=n.VY.displayName;let h=a.forwardRef((e,l)=>{let{className:s,inset:a,...r}=e;return(0,t.jsx)(n.ck,{ref:l,className:(0,c.cn)("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a&&"pl-8",s),...r})});h.displayName=n.ck.displayName,a.forwardRef((e,l)=>{let{className:s,children:a,checked:r,...o}=e;return(0,t.jsxs)(n.oC,{ref:l,className:(0,c.cn)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),checked:r,...o,children:[(0,t.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,t.jsx)(n.wU,{children:(0,t.jsx)(i.Z,{className:"h-4 w-4"})})}),a]})}).displayName=n.oC.displayName,a.forwardRef((e,l)=>{let{className:s,children:a,...r}=e;return(0,t.jsxs)(n.Rk,{ref:l,className:(0,c.cn)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),...r,children:[(0,t.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,t.jsx)(n.wU,{children:(0,t.jsx)(o.Z,{className:"h-2 w-2 fill-current"})})}),a]})}).displayName=n.Rk.displayName;let x=a.forwardRef((e,l)=>{let{className:s,inset:a,...r}=e;return(0,t.jsx)(n.__,{ref:l,className:(0,c.cn)("px-2 py-1.5 text-sm font-semibold",a&&"pl-8",s),...r})});x.displayName=n.__.displayName;let p=a.forwardRef((e,l)=>{let{className:s,...a}=e;return(0,t.jsx)(n.Z0,{ref:l,className:(0,c.cn)("-mx-1 my-1 h-px bg-muted",s),...a})});p.displayName=n.Z0.displayName},17168:function(e,l,s){s.d(l,{SP:function(){return c},dr:function(){return o},mQ:function(){return i},nU:function(){return d}});var t=s(57437),a=s(2265),n=s(20271),r=s(93448);let i=n.fC,o=a.forwardRef((e,l)=>{let{className:s,...a}=e;return(0,t.jsx)(n.aV,{ref:l,className:(0,r.cn)("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",s),...a})});o.displayName=n.aV.displayName;let c=a.forwardRef((e,l)=>{let{className:s,...a}=e;return(0,t.jsx)(n.xz,{ref:l,className:(0,r.cn)("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",s),...a})});c.displayName=n.xz.displayName;let d=a.forwardRef((e,l)=>{let{className:s,...a}=e;return(0,t.jsx)(n.VY,{ref:l,className:(0,r.cn)("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s),...a})});d.displayName=n.VY.displayName},63751:function(e,l,s){s.d(l,{CE:function(){return c},Gn:function(){return o}});var t=s(57437),a=s(2265),n=s(72135),r=s(14438);let i=(0,a.createContext)(void 0),o=()=>{let e=(0,a.useContext)(i);if(!e)throw Error("usePreferences must be used within a PreferencesProvider");return e};function c(e){var l;let{children:s}=e,[o,c]=(0,a.useState)([]),[d,u]=(0,a.useState)(!1),{data:m}=(0,n.kS)(),h=(null==m?void 0:m.id)||(null==m?void 0:null===(l=m.user)||void 0===l?void 0:l.id)||null,{data:x,isLoading:p,refetch:f}=(0,n.sm)({resource:"baasix_UserPreference",queryOptions:{enabled:!!h},filters:h?[{field:"userId",operator:"eq",value:h}]:[],pagination:{pageSize:-1,mode:"off"}}),{mutate:g}=(0,n.RO)({resource:"baasix_UserPreference"}),{mutate:v}=(0,n.PQ)({resource:"baasix_UserPreference"});(0,a.useEffect)(()=>{(null==x?void 0:x.data)?(c(x.data),u(!0)):h&&!p&&(c([]),u(!0))},[x,h,p]);let j=(0,a.useMemo)(()=>{let e={};return o.forEach(l=>{l.isDefault&&(e[l.collectionName]||(e[l.collectionName]={}),e[l.collectionName][l.preferenceType]=l)}),e},[o]),y=(0,a.useCallback)((e,l)=>{var s;return(null===(s=j[e])||void 0===s?void 0:s[l])||null},[j]),N=(0,a.useCallback)(async(e,l,s)=>{if(!h){console.warn("No user ID available for saving preferences");return}let t=y(e,l),a={userId:h,collectionName:e,preferenceType:l,preferenceData:s,isDefault:!0};try{(null==t?void 0:t.id)?await new Promise((e,l)=>{v({id:t.id,values:a,successNotification:!1},{onSuccess:()=>{f(),e()},onError:e=>{console.error("Error updating preference:",e),l(e)}})}):await new Promise((e,l)=>{g({values:a,successNotification:!1},{onSuccess:()=>{f(),e()},onError:e=>{console.error("Error creating preference:",e),l(e)}})})}catch(e){throw r.Am.error("Failed to save preferences"),e}},[h,y,g,v,f]),b=(0,a.useCallback)(e=>{var l;let s=null===(l=j[e])||void 0===l?void 0:l.columns;return s?s.preferenceData:null},[j]),w=(0,a.useCallback)(async(e,l)=>{await N(e,"columns",l)},[N]),C=(0,a.useCallback)(e=>{var l;let s=null===(l=j[e])||void 0===l?void 0:l.filters;return s?s.preferenceData:null},[j]),S=(0,a.useCallback)(async(e,l)=>{await N(e,"filters",l)},[N]),T=(0,a.useCallback)(e=>{var l;let s=null===(l=j[e])||void 0===l?void 0:l.sorting;return s?s.preferenceData:null},[j]),k=(0,a.useCallback)(async(e,l)=>{await N(e,"sorting",l)},[N]),D=(0,a.useCallback)(e=>{var l;let s=null===(l=j[e])||void 0===l?void 0:l.pagination;return s?s.preferenceData:null},[j]),A=(0,a.useCallback)(async(e,l)=>{await N(e,"pagination",l)},[N]);return(0,t.jsx)(i.Provider,{value:{getColumnPreferences:b,saveColumnPreferences:w,getFilterPreferences:C,saveFilterPreferences:S,getSortingPreferences:T,saveSortingPreferences:k,getPaginationPreferences:D,savePaginationPreferences:A,isLoading:p,isInitialized:d,refetchPreferences:f},children:s})}}}]);
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3834],{94766:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});let r=(0,n(79205).Z)("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]])},96215:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});let r=(0,n(79205).Z)("ChartColumn",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]])},81596:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});let r=(0,n(79205).Z)("ChartLine",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"m19 9-5 5-4-4-3 3",key:"2osh9i"}]])},41671:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});let r=(0,n(79205).Z)("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]])},99388:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});let r=(0,n(79205).Z)("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},91723:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});let r=(0,n(79205).Z)("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]])},48736:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});let r=(0,n(79205).Z)("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]])},90740:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});let r=(0,n(79205).Z)("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]])},13781:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});let r=(0,n(79205).Z)("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]])},3414:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});let r=(0,n(79205).Z)("GitFork",[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]])},29202:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});let r=(0,n(79205).Z)("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]])},33276:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});let r=(0,n(79205).Z)("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]])},99397:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});let r=(0,n(79205).Z)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},82431:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});let r=(0,n(79205).Z)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},22047:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});let r=(0,n(79205).Z)("SquareFunction",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["path",{d:"M9 17c2 0 2.8-1 2.8-2.8V10c0-2 1-3.3 3.2-3",key:"m1af9g"}],["path",{d:"M9 11.2h5.7",key:"3zgcl2"}]])},76865:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});let r=(0,n(79205).Z)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},11239:function(t,e,n){"use strict";n.d(e,{Z:function(){return r}});let r=(0,n(79205).Z)("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]])},36556:function(){},90759:function(t,e,n){"use strict";n.d(e,{f:function(){return c}});var r=n(2265);n(54887);var i=n(37053),o=n(57437),a=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,e)=>{let n=(0,i.Z8)(`Primitive.${e}`),a=r.forwardRef((t,r)=>{let{asChild:i,...a}=t,u=i?n:e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,o.jsx)(u,{...a,ref:r})});return a.displayName=`Primitive.${e}`,{...t,[e]:a}},{}),u="horizontal",s=["horizontal","vertical"],l=r.forwardRef((t,e)=>{let{decorative:n,orientation:r=u,...i}=t,l=s.includes(r)?r:u;return(0,o.jsx)(a.div,{"data-orientation":l,...n?{role:"none"}:{"aria-orientation":"vertical"===l?l:void 0,role:"separator"},...i,ref:e})});l.displayName="Separator";var c=l},54281:function(t,e,n){"use strict";n.d(e,{A:function(){return m}});var r,i,o=n(2265),a=n(83568),u=n(97082),s=n(85854);function l({color:t,dimensions:e,lineWidth:n}){return o.createElement("path",{stroke:t,strokeWidth:n,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`})}function c({color:t,radius:e}){return o.createElement("circle",{cx:e,cy:e,r:e,fill:t})}(r=i||(i={})).Lines="lines",r.Dots="dots",r.Cross="cross";let h={[i.Dots]:"#91919a",[i.Lines]:"#eee",[i.Cross]:"#e2e2e2"},f={[i.Dots]:1,[i.Lines]:1,[i.Cross]:6},p=t=>({transform:t.transform,patternId:`pattern-${t.rfId}`});function d({id:t,variant:e=i.Dots,gap:n=20,size:r,lineWidth:d=1,offset:m=2,color:v,style:y,className:g}){let _=(0,o.useRef)(null),{transform:w,patternId:b}=(0,u.oR)(p,s.X),x=v||h[e],k=r||f[e],Z=e===i.Dots,M=e===i.Cross,E=Array.isArray(n)?n:[n,n],z=[E[0]*w[2]||1,E[1]*w[2]||1],A=k*w[2],N=M?[A,A]:z,$=Z?[A/m,A/m]:[N[0]/m,N[1]/m];return o.createElement("svg",{className:(0,a.Z)(["react-flow__background",g]),style:{...y,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:_,"data-testid":"rf__background"},o.createElement("pattern",{id:b+t,x:w[0]%z[0],y:w[1]%z[1],width:z[0],height:z[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${$[0]},-${$[1]})`},Z?o.createElement(c,{color:x,radius:A/m}):o.createElement(l,{dimensions:N,color:x,lineWidth:d})),o.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${b+t})`}))}d.displayName="Background";var m=(0,o.memo)(d)},26554:function(t,e,n){"use strict";n.d(e,{Z:function(){return m}});var r=n(2265),i=n(83568),o=n(85854),a=n(97082);function u(){return r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},r.createElement("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"}))}function s(){return r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},r.createElement("path",{d:"M0 0h32v4.2H0z"}))}function l(){return r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},r.createElement("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"}))}function c(){return r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},r.createElement("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"}))}function h(){return r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},r.createElement("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"}))}let f=({children:t,className:e,...n})=>r.createElement("button",{type:"button",className:(0,i.Z)(["react-flow__controls-button",e]),...n},t);f.displayName="ControlButton";let p=t=>({isInteractive:t.nodesDraggable||t.nodesConnectable||t.elementsSelectable,minZoomReached:t.transform[2]<=t.minZoom,maxZoomReached:t.transform[2]>=t.maxZoom}),d=({style:t,showZoom:e=!0,showFitView:n=!0,showInteractive:d=!0,fitViewOptions:m,onZoomIn:v,onZoomOut:y,onFitView:g,onInteractiveChange:_,className:w,children:b,position:x="bottom-left"})=>{let k=(0,a.AC)(),[Z,M]=(0,r.useState)(!1),{isInteractive:E,minZoomReached:z,maxZoomReached:A}=(0,a.oR)(p,o.X),{zoomIn:N,zoomOut:$,fitView:S}=(0,a._K)();return((0,r.useEffect)(()=>{M(!0)},[]),Z)?r.createElement(a.s_,{className:(0,i.Z)(["react-flow__controls",w]),position:x,style:t,"data-testid":"rf__controls"},e&&r.createElement(r.Fragment,null,r.createElement(f,{onClick:()=>{N(),v?.()},className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:A},r.createElement(u,null)),r.createElement(f,{onClick:()=>{$(),y?.()},className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:z},r.createElement(s,null))),n&&r.createElement(f,{className:"react-flow__controls-fitview",onClick:()=>{S(m),g?.()},title:"fit view","aria-label":"fit view"},r.createElement(l,null)),d&&r.createElement(f,{className:"react-flow__controls-interactive",onClick:()=>{k.setState({nodesDraggable:!E,nodesConnectable:!E,elementsSelectable:!E}),_?.(!E)},title:"toggle interactivity","aria-label":"toggle interactivity"},E?r.createElement(h,null):r.createElement(c,null)),b):null};d.displayName="Controls";var m=(0,r.memo)(d)},78440:function(t,e,n){"use strict";n.d(e,{a:function(){return g}});var r=n(2265),i=n(83568),o=n(85854),a=n(59877),u=n(68244),s=n(61068),l=n(97082);let c=({id:t,x:e,y:n,width:o,height:a,style:u,color:s,strokeColor:l,strokeWidth:c,className:h,borderRadius:f,shapeRendering:p,onClick:d,selected:m})=>{let{background:v,backgroundColor:y}=u||{};return r.createElement("rect",{className:(0,i.Z)(["react-flow__minimap-node",{selected:m},h]),x:e,y:n,rx:f,ry:f,width:o,height:a,fill:s||v||y,stroke:l,strokeWidth:c,shapeRendering:p,onClick:d?e=>d(e,t):void 0})};c.displayName="MiniMapNode";var h=(0,r.memo)(c);let f=t=>t.nodeOrigin,p=t=>t.getNodes().filter(t=>!t.hidden&&t.width&&t.height),d=t=>t instanceof Function?t:()=>t;var m=(0,r.memo)(function({nodeStrokeColor:t="transparent",nodeColor:e="#e2e2e2",nodeClassName:n="",nodeBorderRadius:i=5,nodeStrokeWidth:a=2,nodeComponent:u=h,onClick:s}){let c=(0,l.oR)(p,o.X),m=(0,l.oR)(f),v=d(e),y=d(t),g=d(n),_="undefined"==typeof window||window.chrome?"crispEdges":"geometricPrecision";return r.createElement(r.Fragment,null,c.map(t=>{let{x:e,y:n}=(0,l.VP)(t,m).positionAbsolute;return r.createElement(u,{key:t.id,x:e,y:n,width:t.width,height:t.height,style:t.style,selected:t.selected,className:g(t),color:v(t),borderRadius:i,strokeColor:y(t),strokeWidth:a,shapeRendering:_,onClick:s,id:t.id})}))});let v=t=>{let e=t.getNodes(),n={x:-t.transform[0]/t.transform[2],y:-t.transform[1]/t.transform[2],width:t.width/t.transform[2],height:t.height/t.transform[2]};return{viewBB:n,boundingRect:e.length>0?(0,l.oI)((0,l.RX)(e,t.nodeOrigin),n):n,rfId:t.rfId}};function y({style:t,className:e,nodeStrokeColor:n="transparent",nodeColor:c="#e2e2e2",nodeClassName:h="",nodeBorderRadius:f=5,nodeStrokeWidth:p=2,nodeComponent:d,maskColor:y="rgb(240, 240, 240, 0.6)",maskStrokeColor:g="none",maskStrokeWidth:_=1,position:w="bottom-right",onClick:b,onNodeClick:x,pannable:k=!1,zoomable:Z=!1,ariaLabel:M="React Flow mini map",inversePan:E=!1,zoomStep:z=10,offsetScale:A=5}){let N=(0,l.AC)(),$=(0,r.useRef)(null),{boundingRect:S,viewBB:C,rfId:P}=(0,l.oR)(v,o.X),T=t?.width??200,R=t?.height??150,q=Math.max(S.width/T,S.height/R),X=q*T,H=q*R,D=A*q,V=S.x-(X-S.width)/2-D,j=S.y-(H-S.height)/2-D,O=X+2*D,B=H+2*D,Y=`react-flow__minimap-desc-${P}`,I=(0,r.useRef)(0);I.current=q,(0,r.useEffect)(()=>{if($.current){let t=(0,u.Z)($.current),e=(0,a.sP)().on("zoom",k?t=>{let{transform:e,d3Selection:n,d3Zoom:r,translateExtent:i,width:o,height:u}=N.getState();if("mousemove"!==t.sourceEvent.type||!n||!r)return;let s=I.current*Math.max(1,e[2])*(E?-1:1),l={x:e[0]-t.sourceEvent.movementX*s,y:e[1]-t.sourceEvent.movementY*s},c=a.CR.translate(l.x,l.y).scale(e[2]),h=r.constrain()(c,[[0,0],[o,u]],i);r.transform(n,h)}:null).on("zoom.wheel",Z?t=>{let{transform:e,d3Selection:n,d3Zoom:r}=N.getState();if("wheel"!==t.sourceEvent.type||!n||!r)return;let i=-t.sourceEvent.deltaY*(1===t.sourceEvent.deltaMode?.05:t.sourceEvent.deltaMode?1:.002)*z,o=e[2]*Math.pow(2,i);r.scaleTo(n,o)}:null);return t.call(e),()=>{t.on("zoom",null)}}},[k,Z,E,z]);let L=b?t=>{let e=(0,s.Z)(t);b(t,{x:e[0],y:e[1]})}:void 0;return r.createElement(l.s_,{position:w,style:t,className:(0,i.Z)(["react-flow__minimap",e]),"data-testid":"rf__minimap"},r.createElement("svg",{width:T,height:R,viewBox:`${V} ${j} ${O} ${B}`,role:"img","aria-labelledby":Y,ref:$,onClick:L},M&&r.createElement("title",{id:Y},M),r.createElement(m,{onClick:x?(t,e)=>{x(t,N.getState().nodeInternals.get(e))}:void 0,nodeColor:c,nodeStrokeColor:n,nodeBorderRadius:f,nodeClassName:h,nodeStrokeWidth:p,nodeComponent:d}),r.createElement("path",{className:"react-flow__minimap-mask",d:`M${V-D},${j-D}h${O+2*D}v${B+2*D}h${-O-2*D}z
|
|
2
|
+
M${C.x},${C.y}h${C.width}v${C.height}h${-C.width}z`,fill:y,fillRule:"evenodd",stroke:g,strokeWidth:_,pointerEvents:"none"})))}y.displayName="MiniMap";var g=(0,r.memo)(y)},83568:function(t,e,n){"use strict";n.d(e,{Z:function(){return function t(e){if("string"==typeof e||"number"==typeof e)return""+e;let n="";if(Array.isArray(e))for(let r=0,i;r<e.length;r++)""!==(i=t(e[r]))&&(n+=(n&&" ")+i);else for(let t in e)e[t]&&(n+=(n&&" ")+t);return n}}})},26910:function(t,e,n){"use strict";function r(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function i(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function o(){}n.d(e,{ZP:function(){return _},B8:function(){return x}});var a="\\s*([+-]?\\d+)\\s*",u="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",s="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",l=/^#([0-9a-f]{3,8})$/,c=RegExp(`^rgb\\(${a},${a},${a}\\)$`),h=RegExp(`^rgb\\(${s},${s},${s}\\)$`),f=RegExp(`^rgba\\(${a},${a},${a},${u}\\)$`),p=RegExp(`^rgba\\(${s},${s},${s},${u}\\)$`),d=RegExp(`^hsl\\(${u},${s},${s}\\)$`),m=RegExp(`^hsla\\(${u},${s},${s},${u}\\)$`),v={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function y(){return this.rgb().formatHex()}function g(){return this.rgb().formatRgb()}function _(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=l.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?w(e):3===n?new k(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?b(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?b(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=c.exec(t))?new k(e[1],e[2],e[3],1):(e=h.exec(t))?new k(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=f.exec(t))?b(e[1],e[2],e[3],e[4]):(e=p.exec(t))?b(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=d.exec(t))?N(e[1],e[2]/100,e[3]/100,1):(e=m.exec(t))?N(e[1],e[2]/100,e[3]/100,e[4]):v.hasOwnProperty(t)?w(v[t]):"transparent"===t?new k(NaN,NaN,NaN,0):null}function w(t){return new k(t>>16&255,t>>8&255,255&t,1)}function b(t,e,n,r){return r<=0&&(t=e=n=NaN),new k(t,e,n,r)}function x(t,e,n,r){var i;return 1==arguments.length?((i=t)instanceof o||(i=_(i)),i)?new k((i=i.rgb()).r,i.g,i.b,i.opacity):new k:new k(t,e,n,null==r?1:r)}function k(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function Z(){return`#${A(this.r)}${A(this.g)}${A(this.b)}`}function M(){let t=E(this.opacity);return`${1===t?"rgb(":"rgba("}${z(this.r)}, ${z(this.g)}, ${z(this.b)}${1===t?")":`, ${t})`}`}function E(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function z(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function A(t){return((t=z(t))<16?"0":"")+t.toString(16)}function N(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new S(t,e,n,r)}function $(t){if(t instanceof S)return new S(t.h,t.s,t.l,t.opacity);if(t instanceof o||(t=_(t)),!t)return new S;if(t instanceof S)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),u=NaN,s=a-i,l=(a+i)/2;return s?(u=e===a?(n-r)/s+(n<r)*6:n===a?(r-e)/s+2:(e-n)/s+4,s/=l<.5?a+i:2-a-i,u*=60):s=l>0&&l<1?0:u,new S(u,s,l,t.opacity)}function S(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function C(t){return(t=(t||0)%360)<0?t+360:t}function P(t){return Math.max(0,Math.min(1,t||0))}function T(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}r(o,_,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:y,formatHex:y,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return $(this).formatHsl()},formatRgb:g,toString:g}),r(k,x,i(o,{brighter(t){return t=null==t?1.4285714285714286:Math.pow(1.4285714285714286,t),new k(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new k(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new k(z(this.r),z(this.g),z(this.b),E(this.opacity))},displayable(){return -.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Z,formatHex:Z,formatHex8:function(){return`#${A(this.r)}${A(this.g)}${A(this.b)}${A((isNaN(this.opacity)?1:this.opacity)*255)}`},formatRgb:M,toString:M})),r(S,function(t,e,n,r){return 1==arguments.length?$(t):new S(t,e,n,null==r?1:r)},i(o,{brighter(t){return t=null==t?1.4285714285714286:Math.pow(1.4285714285714286,t),new S(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new S(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new k(T(t>=240?t-240:t+120,i,r),T(t,i,r),T(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new S(C(this.h),P(this.s),P(this.l),E(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let t=E(this.opacity);return`${1===t?"hsl(":"hsla("}${C(this.h)}, ${100*P(this.s)}%, ${100*P(this.l)}%${1===t?")":`, ${t})`}`}}))},39172:function(t,e){"use strict";var n={value:()=>{}};function r(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r||/[\s.]/.test(t))throw Error("illegal type: "+t);r[t]=[]}return new i(r)}function i(t){this._=t}function o(t,e,r){for(var i=0,o=t.length;i<o;++i)if(t[i].name===e){t[i]=n,t=t.slice(0,i).concat(t.slice(i+1));break}return null!=r&&t.push({name:e,value:r}),t}i.prototype=r.prototype={constructor:i,on:function(t,e){var n,r=this._,i=(t+"").trim().split(/^|\s+/).map(function(t){var e="",n=t.indexOf(".");if(n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!r.hasOwnProperty(t))throw Error("unknown type: "+t);return{type:t,name:e}}),a=-1,u=i.length;if(arguments.length<2){for(;++a<u;)if((n=(t=i[a]).type)&&(n=function(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}(r[n],t.name)))return n;return}if(null!=e&&"function"!=typeof e)throw Error("invalid callback: "+e);for(;++a<u;)if(n=(t=i[a]).type)r[n]=o(r[n],t.name,e);else if(null==e)for(n in r)r[n]=o(r[n],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new i(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,r,i=Array(n),o=0;o<n;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw Error("unknown type: "+t);for(r=this._[t],o=0,n=r.length;o<n;++o)r[o].value.apply(e,i)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}},e.Z=r},40679:function(t,e,n){"use strict";n.d(e,{Z:function(){return d}});var r=n(39172),i=n(68244),o=n(61068),a=n(69482),u=n(81784),s=t=>()=>t;function l(t,{sourceEvent:e,subject:n,target:r,identifier:i,active:o,x:a,y:u,dx:s,dy:l,dispatch:c}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:u,enumerable:!0,configurable:!0},dx:{value:s,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:c}})}function c(t){return!t.ctrlKey&&!t.button}function h(){return this.parentNode}function f(t,e){return null==e?{x:t.x,y:t.y}:e}function p(){return navigator.maxTouchPoints||"ontouchstart"in this}function d(){var t,e,n,d,m=c,v=h,y=f,g=p,_={},w=(0,r.Z)("start","drag","end"),b=0,x=0;function k(t){t.on("mousedown.drag",Z).filter(g).on("touchstart.drag",z).on("touchmove.drag",A,u.Q7).on("touchend.drag touchcancel.drag",N).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function Z(r,o){if(!d&&m.call(this,r,o)){var s=$(this,v.call(this,r,o),r,o,"mouse");s&&((0,i.Z)(r.view).on("mousemove.drag",M,u.Dd).on("mouseup.drag",E,u.Dd),(0,a.Z)(r.view),(0,u.rG)(r),n=!1,t=r.clientX,e=r.clientY,s("start",r))}}function M(r){if((0,u.ZP)(r),!n){var i=r.clientX-t,o=r.clientY-e;n=i*i+o*o>x}_.mouse("drag",r)}function E(t){(0,i.Z)(t.view).on("mousemove.drag mouseup.drag",null),(0,a.D)(t.view,n),(0,u.ZP)(t),_.mouse("end",t)}function z(t,e){if(m.call(this,t,e)){var n,r,i=t.changedTouches,o=v.call(this,t,e),a=i.length;for(n=0;n<a;++n)(r=$(this,o,t,e,i[n].identifier,i[n]))&&((0,u.rG)(t),r("start",t,i[n]))}}function A(t){var e,n,r=t.changedTouches,i=r.length;for(e=0;e<i;++e)(n=_[r[e].identifier])&&((0,u.ZP)(t),n("drag",t,r[e]))}function N(t){var e,n,r=t.changedTouches,i=r.length;for(d&&clearTimeout(d),d=setTimeout(function(){d=null},500),e=0;e<i;++e)(n=_[r[e].identifier])&&((0,u.rG)(t),n("end",t,r[e]))}function $(t,e,n,r,i,a){var u,s,c,h=w.copy(),f=(0,o.Z)(a||n,e);if(null!=(c=y.call(t,new l("beforestart",{sourceEvent:n,target:k,identifier:i,active:b,x:f[0],y:f[1],dx:0,dy:0,dispatch:h}),r)))return u=c.x-f[0]||0,s=c.y-f[1]||0,function n(a,p,d){var m,v=f;switch(a){case"start":_[i]=n,m=b++;break;case"end":delete _[i],--b;case"drag":f=(0,o.Z)(d||p,e),m=b}h.call(a,t,new l(a,{sourceEvent:p,subject:c,target:k,identifier:i,active:m,x:f[0]+u,y:f[1]+s,dx:f[0]-v[0],dy:f[1]-v[1],dispatch:h}),r)}}return k.filter=function(t){return arguments.length?(m="function"==typeof t?t:s(!!t),k):m},k.container=function(t){return arguments.length?(v="function"==typeof t?t:s(t),k):v},k.subject=function(t){return arguments.length?(y="function"==typeof t?t:s(t),k):y},k.touchable=function(t){return arguments.length?(g="function"==typeof t?t:s(!!t),k):g},k.on=function(){var t=w.on.apply(w,arguments);return t===w?k:t},k.clickDistance=function(t){return arguments.length?(x=(t=+t)*t,k):Math.sqrt(x)},k}l.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t}},69482:function(t,e,n){"use strict";n.d(e,{D:function(){return a},Z:function(){return o}});var r=n(68244),i=n(81784);function o(t){var e=t.document.documentElement,n=(0,r.Z)(t).on("dragstart.drag",i.ZP,i.Dd);"onselectstart"in e?n.on("selectstart.drag",i.ZP,i.Dd):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function a(t,e){var n=t.document.documentElement,o=(0,r.Z)(t).on("dragstart.drag",null);e&&(o.on("click.drag",i.ZP,i.Dd),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}},81784:function(t,e,n){"use strict";n.d(e,{Dd:function(){return i},Q7:function(){return r},ZP:function(){return a},rG:function(){return o}});let r={passive:!1},i={capture:!0,passive:!1};function o(t){t.stopImmediatePropagation()}function a(t){t.preventDefault(),t.stopImmediatePropagation()}},7097:function(t,e){"use strict";e.Z=t=>()=>t},44193:function(t,e,n){"use strict";function r(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}n.d(e,{Z:function(){return r}})},16064:function(t,e,n){"use strict";n.d(e,{ZP:function(){return u}});var r=n(26910);function i(t,e,n,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*n+(1+3*t+3*o-3*a)*r+a*i)/6}var o=n(7097);function a(t,e){var n=e-t;return n?function(e){return t+e*n}:(0,o.Z)(isNaN(t)?e:t)}var u=function t(e){var n,i=1==(n=+(n=e))?a:function(t,e){var r,i,a;return e-t?(r=t,i=e,r=Math.pow(r,a=n),i=Math.pow(i,a)-r,a=1/a,function(t){return Math.pow(r+t*i,a)}):(0,o.Z)(isNaN(t)?e:t)};function u(t,e){var n=i((t=(0,r.B8)(t)).r,(e=(0,r.B8)(e)).r),o=i(t.g,e.g),u=i(t.b,e.b),s=a(t.opacity,e.opacity);return function(e){return t.r=n(e),t.g=o(e),t.b=u(e),t.opacity=s(e),t+""}}return u.gamma=t,u}(1);function s(t){return function(e){var n,i,o=e.length,a=Array(o),u=Array(o),s=Array(o);for(n=0;n<o;++n)i=(0,r.B8)(e[n]),a[n]=i.r||0,u[n]=i.g||0,s[n]=i.b||0;return a=t(a),u=t(u),s=t(s),i.opacity=1,function(t){return i.r=a(t),i.g=u(t),i.b=s(t),i+""}}}s(function(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),o=t[r],a=t[r+1],u=r>0?t[r-1]:2*o-a,s=r<e-1?t[r+2]:2*a-o;return i((n-r/e)*e,u,o,a,s)}}),s(function(t){var e=t.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*e),o=t[(r+e-1)%e],a=t[r%e],u=t[(r+1)%e],s=t[(r+2)%e];return i((n-r/e)*e,o,a,u,s)}})},19729:function(t,e,n){"use strict";n.d(e,{Z:function(){return a}});var r=n(44193),i=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,o=RegExp(i.source,"g");function a(t,e){var n,a,u,s,l,c=i.lastIndex=o.lastIndex=0,h=-1,f=[],p=[];for(t+="",e+="";(u=i.exec(t))&&(s=o.exec(e));)(l=s.index)>c&&(l=e.slice(c,l),f[h]?f[h]+=l:f[++h]=l),(u=u[0])===(s=s[0])?f[h]?f[h]+=s:f[++h]=s:(f[++h]=null,p.push({i:h,x:(0,r.Z)(u,s)})),c=o.lastIndex;return c<e.length&&(l=e.slice(c),f[h]?f[h]+=l:f[++h]=l),f.length<2?p[0]?(n=p[0].x,function(t){return n(t)+""}):(a=e,function(){return a}):(e=p.length,function(t){for(var n,r=0;r<e;++r)f[(n=p[r]).i]=n.x(t);return f.join("")})}},63593:function(t,e,n){"use strict";function r(t){return function(){return this.matches(t)}}function i(t){return function(e){return e.matches(t)}}n.d(e,{P:function(){return i},Z:function(){return r}})},74178:function(t,e,n){"use strict";n.d(e,{Z:function(){return i}});var r=n(9446);function i(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),r.Z.hasOwnProperty(e)?{space:r.Z[e],local:t}:t}},9446:function(t,e,n){"use strict";n.d(e,{P:function(){return r}});var r="http://www.w3.org/1999/xhtml";e.Z={svg:"http://www.w3.org/2000/svg",xhtml:r,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"}},61068:function(t,e,n){"use strict";function r(t,e){if(t=function(t){let e;for(;e=t.sourceEvent;)t=e;return t}(t),void 0===e&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,[(r=r.matrixTransform(e.getScreenCTM().inverse())).x,r.y]}if(e.getBoundingClientRect){var i=e.getBoundingClientRect();return[t.clientX-i.left-e.clientLeft,t.clientY-i.top-e.clientTop]}}return[t.pageX,t.pageY]}n.d(e,{Z:function(){return r}})},68244:function(t,e,n){"use strict";n.d(e,{Z:function(){return i}});var r=n(37557);function i(t){return"string"==typeof t?new r.Y1([[document.querySelector(t)]],[document.documentElement]):new r.Y1([[t]],r.Jz)}},37557:function(t,e,n){"use strict";n.d(e,{Y1:function(){return H},ZP:function(){return V},Jz:function(){return X}});var r=n(78500),i=n(50360),o=n(63593),a=Array.prototype.find;function u(){return this.firstElementChild}var s=Array.prototype.filter;function l(){return Array.from(this.children)}function c(t){return Array(t.length)}function h(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}function f(t,e,n,r,i,o){for(var a,u=0,s=e.length,l=o.length;u<l;++u)(a=e[u])?(a.__data__=o[u],r[u]=a):n[u]=new h(t,o[u]);for(;u<s;++u)(a=e[u])&&(i[u]=a)}function p(t,e,n,r,i,o,a){var u,s,l,c=new Map,f=e.length,p=o.length,d=Array(f);for(u=0;u<f;++u)(s=e[u])&&(d[u]=l=a.call(s,s.__data__,u,e)+"",c.has(l)?i[u]=s:c.set(l,s));for(u=0;u<p;++u)l=a.call(t,o[u],u,o)+"",(s=c.get(l))?(r[u]=s,s.__data__=o[u],c.delete(l)):n[u]=new h(t,o[u]);for(u=0;u<f;++u)(s=e[u])&&c.get(d[u])===s&&(i[u]=s)}function d(t){return t.__data__}function m(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}h.prototype={constructor:h,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var v=n(74178),y=n(53777);function g(t){return t.trim().split(/^|\s+/)}function _(t){return t.classList||new w(t)}function w(t){this._node=t,this._names=g(t.getAttribute("class")||"")}function b(t,e){for(var n=_(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function x(t,e){for(var n=_(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function k(){this.textContent=""}function Z(){this.innerHTML=""}function M(){this.nextSibling&&this.parentNode.appendChild(this)}function E(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}w.prototype={add:function(t){0>this._names.indexOf(t)&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var z=n(9446);function A(t){var e=(0,v.Z)(t);return(e.local?function(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}:function(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===z.P&&e.documentElement.namespaceURI===z.P?e.createElement(t):e.createElementNS(n,t)}})(e)}function N(){return null}function $(){var t=this.parentNode;t&&t.removeChild(this)}function S(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function C(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function P(t){return function(){var e=this.__on;if(e){for(var n,r=0,i=-1,o=e.length;r<o;++r)(n=e[r],t.type&&n.type!==t.type||n.name!==t.name)?e[++i]=n:this.removeEventListener(n.type,n.listener,n.options);++i?e.length=i:delete this.__on}}}function T(t,e,n){return function(){var r,i=this.__on,o=function(t){e.call(this,t,this.__data__)};if(i){for(var a=0,u=i.length;a<u;++a)if((r=i[a]).type===t.type&&r.name===t.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=o,r.options=n),r.value=e;return}}this.addEventListener(t.type,o,n),r={type:t.type,name:t.name,value:e,listener:o,options:n},i?i.push(r):this.__on=[r]}}var R=n(90884);function q(t,e,n){var r=(0,R.Z)(t),i=r.CustomEvent;"function"==typeof i?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}var X=[null];function H(t,e){this._groups=t,this._parents=e}function D(){return new H([[document.documentElement]],X)}H.prototype=D.prototype={constructor:H,select:function(t){"function"!=typeof t&&(t=(0,r.Z)(t));for(var e=this._groups,n=e.length,i=Array(n),o=0;o<n;++o)for(var a,u,s=e[o],l=s.length,c=i[o]=Array(l),h=0;h<l;++h)(a=s[h])&&(u=t.call(a,a.__data__,h,s))&&("__data__"in a&&(u.__data__=a.__data__),c[h]=u);return new H(i,this._parents)},selectAll:function(t){if("function"==typeof t){var e;e=t,t=function(){var t;return t=e.apply(this,arguments),null==t?[]:Array.isArray(t)?t:Array.from(t)}}else t=(0,i.Z)(t);for(var n=this._groups,r=n.length,o=[],a=[],u=0;u<r;++u)for(var s,l=n[u],c=l.length,h=0;h<c;++h)(s=l[h])&&(o.push(t.call(s,s.__data__,h,l)),a.push(s));return new H(o,a)},selectChild:function(t){var e;return this.select(null==t?u:(e="function"==typeof t?t:(0,o.P)(t),function(){return a.call(this.children,e)}))},selectChildren:function(t){var e;return this.selectAll(null==t?l:(e="function"==typeof t?t:(0,o.P)(t),function(){return s.call(this.children,e)}))},filter:function(t){"function"!=typeof t&&(t=(0,o.Z)(t));for(var e=this._groups,n=e.length,r=Array(n),i=0;i<n;++i)for(var a,u=e[i],s=u.length,l=r[i]=[],c=0;c<s;++c)(a=u[c])&&t.call(a,a.__data__,c,u)&&l.push(a);return new H(r,this._parents)},data:function(t,e){if(!arguments.length)return Array.from(this,d);var n=e?p:f,r=this._parents,i=this._groups;"function"!=typeof t&&(b=t,t=function(){return b});for(var o=i.length,a=Array(o),u=Array(o),s=Array(o),l=0;l<o;++l){var c=r[l],h=i[l],m=h.length,v="object"==typeof(w=t.call(c,c&&c.__data__,l,r))&&"length"in w?w:Array.from(w),y=v.length,g=u[l]=Array(y),_=a[l]=Array(y);n(c,h,g,_,s[l]=Array(m),v,e);for(var w,b,x,k,Z=0,M=0;Z<y;++Z)if(x=g[Z]){for(Z>=M&&(M=Z+1);!(k=_[M])&&++M<y;);x._next=k||null}}return(a=new H(a,r))._enter=u,a._exit=s,a},enter:function(){return new H(this._enter||this._groups.map(c),this._parents)},exit:function(){return new H(this._exit||this._groups.map(c),this._parents)},join:function(t,e,n){var r=this.enter(),i=this,o=this.exit();return"function"==typeof t?(r=t(r))&&(r=r.selection()):r=r.append(t+""),null!=e&&(i=e(i))&&(i=i.selection()),null==n?o.remove():n(o),r&&i?r.merge(i).order():i},merge:function(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,i=n.length,o=r.length,a=Math.min(i,o),u=Array(i),s=0;s<a;++s)for(var l,c=n[s],h=r[s],f=c.length,p=u[s]=Array(f),d=0;d<f;++d)(l=c[d]||h[d])&&(p[d]=l);for(;s<i;++s)u[s]=n[s];return new H(u,this._parents)},selection:function(){return this},order:function(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r,i=t[e],o=i.length-1,a=i[o];--o>=0;)(r=i[o])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=m);for(var n=this._groups,r=n.length,i=Array(r),o=0;o<r;++o){for(var a,u=n[o],s=u.length,l=i[o]=Array(s),c=0;c<s;++c)(a=u[c])&&(l[c]=a);l.sort(e)}return new H(i,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length;i<o;++i){var a=r[i];if(a)return a}return null},size:function(){let t=0;for(let e of this)++t;return t},empty:function(){return!this.node()},each:function(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i,o=e[n],a=0,u=o.length;a<u;++a)(i=o[a])&&t.call(i,i.__data__,a,o);return this},attr:function(t,e){var n=(0,v.Z)(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((null==e?n.local?function(t){return function(){this.removeAttributeNS(t.space,t.local)}}:function(t){return function(){this.removeAttribute(t)}}:"function"==typeof e?n.local?function(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}:function(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}:n.local?function(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}:function(t,e){return function(){this.setAttribute(t,e)}})(n,e))},style:y.Z,property:function(t,e){return arguments.length>1?this.each((null==e?function(t){return function(){delete this[t]}}:"function"==typeof e?function(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}:function(t,e){return function(){this[t]=e}})(t,e)):this.node()[t]},classed:function(t,e){var n=g(t+"");if(arguments.length<2){for(var r=_(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each(("function"==typeof e?function(t,e){return function(){(e.apply(this,arguments)?b:x)(this,t)}}:e?function(t){return function(){b(this,t)}}:function(t){return function(){x(this,t)}})(n,e))},text:function(t){return arguments.length?this.each(null==t?k:("function"==typeof t?function(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}:function(t){return function(){this.textContent=t}})(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?Z:("function"==typeof t?function(t){return function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}}:function(t){return function(){this.innerHTML=t}})(t)):this.node().innerHTML},raise:function(){return this.each(M)},lower:function(){return this.each(E)},append:function(t){var e="function"==typeof t?t:A(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})},insert:function(t,e){var n="function"==typeof t?t:A(t),i=null==e?N:"function"==typeof e?e:(0,r.Z)(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),i.apply(this,arguments)||null)})},remove:function(){return this.each($)},clone:function(t){return this.select(t?C:S)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,e,n){var r,i,o=(t+"").trim().split(/^|\s+/).map(function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}),a=o.length;if(arguments.length<2){var u=this.node().__on;if(u){for(var s,l=0,c=u.length;l<c;++l)for(r=0,s=u[l];r<a;++r)if((i=o[r]).type===s.type&&i.name===s.name)return s.value}return}for(r=0,u=e?T:P;r<a;++r)this.each(u(o[r],e,n));return this},dispatch:function(t,e){return this.each(("function"==typeof e?function(t,e){return function(){return q(this,t,e.apply(this,arguments))}}:function(t,e){return function(){return q(this,t,e)}})(t,e))},[Symbol.iterator]:function*(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r,i=t[e],o=0,a=i.length;o<a;++o)(r=i[o])&&(yield r)}};var V=D},53777:function(t,e,n){"use strict";n.d(e,{S:function(){return o},Z:function(){return i}});var r=n(90884);function i(t,e,n){return arguments.length>1?this.each((null==e?function(t){return function(){this.style.removeProperty(t)}}:"function"==typeof e?function(t,e,n){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}:function(t,e,n){return function(){this.style.setProperty(t,e,n)}})(t,e,null==n?"":n)):o(this.node(),t)}function o(t,e){return t.style.getPropertyValue(e)||(0,r.Z)(t).getComputedStyle(t,null).getPropertyValue(e)}},78500:function(t,e,n){"use strict";function r(){}function i(t){return null==t?r:function(){return this.querySelector(t)}}n.d(e,{Z:function(){return i}})},50360:function(t,e,n){"use strict";function r(){return[]}function i(t){return null==t?r:function(){return this.querySelectorAll(t)}}n.d(e,{Z:function(){return i}})},90884:function(t,e,n){"use strict";function r(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}n.d(e,{Z:function(){return r}})},59877:function(t,e,n){"use strict";n.d(e,{sP:function(){return ty},CR:function(){return ts}});var r,i=n(39172),o=n(69482);function a(t){return((t=Math.exp(t))+1/t)/2}var u,s,l=function t(e,n,r){function i(t,i){var o,u,s=t[0],l=t[1],c=t[2],h=i[0],f=i[1],p=i[2],d=h-s,m=f-l,v=d*d+m*m;if(v<1e-12)u=Math.log(p/c)/e,o=function(t){return[s+t*d,l+t*m,c*Math.exp(e*t*u)]};else{var y=Math.sqrt(v),g=(p*p-c*c+r*v)/(2*c*n*y),_=(p*p-c*c-r*v)/(2*p*n*y),w=Math.log(Math.sqrt(g*g+1)-g);u=(Math.log(Math.sqrt(_*_+1)-_)-w)/e,o=function(t){var r,i,o=t*u,h=a(w),f=c/(n*y)*(((r=Math.exp(2*(r=e*o+w)))-1)/(r+1)*h-((i=Math.exp(i=w))-1/i)/2);return[s+f*d,l+f*m,c*h/a(e*o+w)]}}return o.duration=1e3*u*e/Math.SQRT2,o}return i.rho=function(e){var n=Math.max(.001,+e),r=n*n;return t(n,r,r*r)},i}(Math.SQRT2,2,4),c=n(68244),h=n(61068),f=n(37557),p=0,d=0,m=0,v=0,y=0,g=0,_="object"==typeof performance&&performance.now?performance:Date,w="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function b(){return y||(w(x),y=_.now()+g)}function x(){y=0}function k(){this._call=this._time=this._next=null}function Z(t,e,n){var r=new k;return r.restart(t,e,n),r}function M(){y=(v=_.now())+g,p=d=0;try{!function(){b(),++p;for(var t,e=u;e;)(t=y-e._time)>=0&&e._call.call(void 0,t),e=e._next;--p}()}finally{p=0,function(){for(var t,e,n=u,r=1/0;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:u=e);s=t,z(r)}(),y=0}}function E(){var t=_.now(),e=t-v;e>1e3&&(g-=e,v=t)}function z(t){!p&&(d&&(d=clearTimeout(d)),t-y>24?(t<1/0&&(d=setTimeout(M,t-_.now()-g)),m&&(m=clearInterval(m))):(m||(v=_.now(),m=setInterval(E,1e3)),p=1,w(M)))}function A(t,e,n){var r=new k;return e=null==e?0:+e,r.restart(n=>{r.stop(),t(n+e)},e,n),r}k.prototype=Z.prototype={constructor:k,restart:function(t,e,n){if("function"!=typeof t)throw TypeError("callback is not a function");n=(null==n?b():+n)+(null==e?0:+e),this._next||s===this||(s?s._next=this:u=this,s=this),this._call=t,this._time=n,z()},stop:function(){this._call&&(this._call=null,this._time=1/0,z())}};var N=(0,i.Z)("start","end","cancel","interrupt"),$=[];function S(t,e,n,r,i,o){var a=t.__transition;if(a){if(n in a)return}else t.__transition={};!function(t,e,n){var r,i=t.__transition;function o(s){var l,c,h,f;if(1!==n.state)return u();for(l in i)if((f=i[l]).name===n.name){if(3===f.state)return A(o);4===f.state?(f.state=6,f.timer.stop(),f.on.call("interrupt",t,t.__data__,f.index,f.group),delete i[l]):+l<e&&(f.state=6,f.timer.stop(),f.on.call("cancel",t,t.__data__,f.index,f.group),delete i[l])}if(A(function(){3===n.state&&(n.state=4,n.timer.restart(a,n.delay,n.time),a(s))}),n.state=2,n.on.call("start",t,t.__data__,n.index,n.group),2===n.state){for(l=0,n.state=3,r=Array(h=n.tween.length),c=-1;l<h;++l)(f=n.tween[l].value.call(t,t.__data__,n.index,n.group))&&(r[++c]=f);r.length=c+1}}function a(e){for(var i=e<n.duration?n.ease.call(null,e/n.duration):(n.timer.restart(u),n.state=5,1),o=-1,a=r.length;++o<a;)r[o].call(t,i);5===n.state&&(n.on.call("end",t,t.__data__,n.index,n.group),u())}function u(){for(var r in n.state=6,n.timer.stop(),delete i[e],i)return;delete t.__transition}i[e]=n,n.timer=Z(function(t){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=t&&o(t-n.delay)},0,n.time)}(t,n,{name:e,index:r,group:i,on:N,tween:$,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:0})}function C(t,e){var n=T(t,e);if(n.state>0)throw Error("too late; already scheduled");return n}function P(t,e){var n=T(t,e);if(n.state>3)throw Error("too late; already running");return n}function T(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw Error("transition not found");return n}function R(t,e){var n,r,i,o=t.__transition,a=!0;if(o){for(i in e=null==e?null:e+"",o){if((n=o[i]).name!==e){a=!1;continue}r=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(r?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete o[i]}a&&delete t.__transition}}var q=n(44193),X=180/Math.PI,H={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function D(t,e,n,r,i,o){var a,u,s;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(s=t*n+e*r)&&(n-=t*s,r-=e*s),(u=Math.sqrt(n*n+r*r))&&(n/=u,r/=u,s/=u),t*r<e*n&&(t=-t,e=-e,s=-s,a=-a),{translateX:i,translateY:o,rotate:Math.atan2(e,t)*X,skewX:Math.atan(s)*X,scaleX:a,scaleY:u}}function V(t,e,n,r){function i(t){return t.length?t.pop()+" ":""}return function(o,a){var u,s,l,c,h=[],f=[];return o=t(o),a=t(a),!function(t,r,i,o,a,u){if(t!==i||r!==o){var s=a.push("translate(",null,e,null,n);u.push({i:s-4,x:(0,q.Z)(t,i)},{i:s-2,x:(0,q.Z)(r,o)})}else(i||o)&&a.push("translate("+i+e+o+n)}(o.translateX,o.translateY,a.translateX,a.translateY,h,f),(u=o.rotate)!==(s=a.rotate)?(u-s>180?s+=360:s-u>180&&(u+=360),f.push({i:h.push(i(h)+"rotate(",null,r)-2,x:(0,q.Z)(u,s)})):s&&h.push(i(h)+"rotate("+s+r),(l=o.skewX)!==(c=a.skewX)?f.push({i:h.push(i(h)+"skewX(",null,r)-2,x:(0,q.Z)(l,c)}):c&&h.push(i(h)+"skewX("+c+r),!function(t,e,n,r,o,a){if(t!==n||e!==r){var u=o.push(i(o)+"scale(",null,",",null,")");a.push({i:u-4,x:(0,q.Z)(t,n)},{i:u-2,x:(0,q.Z)(e,r)})}else(1!==n||1!==r)&&o.push(i(o)+"scale("+n+","+r+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,h,f),o=a=null,function(t){for(var e,n=-1,r=f.length;++n<r;)h[(e=f[n]).i]=e.x(t);return h.join("")}}}var j=V(function(t){let e=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?H:D(e.a,e.b,e.c,e.d,e.e,e.f)},"px, ","px)","deg)"),O=V(function(t){return null==t?H:(r||(r=document.createElementNS("http://www.w3.org/2000/svg","g")),r.setAttribute("transform",t),t=r.transform.baseVal.consolidate())?D((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):H},", ",")",")"),B=n(74178);function Y(t,e,n){var r=t._id;return t.each(function(){var t=P(this,r);(t.value||(t.value={}))[e]=n.apply(this,arguments)}),function(t){return T(t,r).value[e]}}var I=n(26910),L=n(16064),G=n(19729);function F(t,e){var n;return("number"==typeof e?q.Z:e instanceof I.ZP?L.ZP:(n=(0,I.ZP)(e))?(e=n,L.ZP):G.Z)(t,e)}var U=n(63593),W=n(78500),K=n(50360),Q=f.ZP.prototype.constructor,J=n(53777);function tt(t){return function(){this.style.removeProperty(t)}}var te=0;function tn(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}var tr=f.ZP.prototype;tn.prototype=(function(t){return(0,f.ZP)().transition(t)}).prototype={constructor:tn,select:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=(0,W.Z)(t));for(var r=this._groups,i=r.length,o=Array(i),a=0;a<i;++a)for(var u,s,l=r[a],c=l.length,h=o[a]=Array(c),f=0;f<c;++f)(u=l[f])&&(s=t.call(u,u.__data__,f,l))&&("__data__"in u&&(s.__data__=u.__data__),h[f]=s,S(h[f],e,n,f,h,T(u,n)));return new tn(o,this._parents,e,n)},selectAll:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=(0,K.Z)(t));for(var r=this._groups,i=r.length,o=[],a=[],u=0;u<i;++u)for(var s,l=r[u],c=l.length,h=0;h<c;++h)if(s=l[h]){for(var f,p=t.call(s,s.__data__,h,l),d=T(s,n),m=0,v=p.length;m<v;++m)(f=p[m])&&S(f,e,n,m,p,d);o.push(p),a.push(s)}return new tn(o,a,e,n)},selectChild:tr.selectChild,selectChildren:tr.selectChildren,filter:function(t){"function"!=typeof t&&(t=(0,U.Z)(t));for(var e=this._groups,n=e.length,r=Array(n),i=0;i<n;++i)for(var o,a=e[i],u=a.length,s=r[i]=[],l=0;l<u;++l)(o=a[l])&&t.call(o,o.__data__,l,a)&&s.push(o);return new tn(r,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw Error();for(var e=this._groups,n=t._groups,r=e.length,i=n.length,o=Math.min(r,i),a=Array(r),u=0;u<o;++u)for(var s,l=e[u],c=n[u],h=l.length,f=a[u]=Array(h),p=0;p<h;++p)(s=l[p]||c[p])&&(f[p]=s);for(;u<r;++u)a[u]=e[u];return new tn(a,this._parents,this._name,this._id)},selection:function(){return new Q(this._groups,this._parents)},transition:function(){for(var t=this._name,e=this._id,n=++te,r=this._groups,i=r.length,o=0;o<i;++o)for(var a,u=r[o],s=u.length,l=0;l<s;++l)if(a=u[l]){var c=T(a,e);S(a,t,n,l,u,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new tn(r,this._parents,t,n)},call:tr.call,nodes:tr.nodes,node:tr.node,size:tr.size,empty:tr.empty,each:tr.each,on:function(t,e){var n,r,i,o=this._id;return arguments.length<2?T(this.node(),o).on.on(t):this.each((i=(t+"").trim().split(/^|\s+/).every(function(t){var e=t.indexOf(".");return e>=0&&(t=t.slice(0,e)),!t||"start"===t})?C:P,function(){var a=i(this,o),u=a.on;u!==n&&(r=(n=u).copy()).on(t,e),a.on=r}))},attr:function(t,e){var n=(0,B.Z)(t),r="transform"===n?O:F;return this.attrTween(t,"function"==typeof e?(n.local?function(t,e,n){var r,i,o;return function(){var a,u,s=n(this);return null==s?void this.removeAttributeNS(t.space,t.local):(a=this.getAttributeNS(t.space,t.local))===(u=s+"")?null:a===r&&u===i?o:(i=u,o=e(r=a,s))}}:function(t,e,n){var r,i,o;return function(){var a,u,s=n(this);return null==s?void this.removeAttribute(t):(a=this.getAttribute(t))===(u=s+"")?null:a===r&&u===i?o:(i=u,o=e(r=a,s))}})(n,r,Y(this,"attr."+t,e)):null==e?(n.local?function(t){return function(){this.removeAttributeNS(t.space,t.local)}}:function(t){return function(){this.removeAttribute(t)}})(n):(n.local?function(t,e,n){var r,i,o=n+"";return function(){var a=this.getAttributeNS(t.space,t.local);return a===o?null:a===r?i:i=e(r=a,n)}}:function(t,e,n){var r,i,o=n+"";return function(){var a=this.getAttribute(t);return a===o?null:a===r?i:i=e(r=a,n)}})(n,r,e))},attrTween:function(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==e)return this.tween(n,null);if("function"!=typeof e)throw Error();var r=(0,B.Z)(t);return this.tween(n,(r.local?function(t,e){var n,r;function i(){var i=e.apply(this,arguments);return i!==r&&(n=(r=i)&&function(e){this.setAttributeNS(t.space,t.local,i.call(this,e))}),n}return i._value=e,i}:function(t,e){var n,r;function i(){var i=e.apply(this,arguments);return i!==r&&(n=(r=i)&&function(e){this.setAttribute(t,i.call(this,e))}),n}return i._value=e,i})(r,e))},style:function(t,e,n){var r,i,o,a,u,s,l,c,h,f,p,d,m,v,y,g,_,w,b,x,k,Z="transform"==(t+="")?j:F;return null==e?this.styleTween(t,(r=t,function(){var t=(0,J.S)(this,r),e=(this.style.removeProperty(r),(0,J.S)(this,r));return t===e?null:t===i&&e===o?a:a=Z(i=t,o=e)})).on("end.style."+t,tt(t)):"function"==typeof e?this.styleTween(t,(u=t,s=Y(this,"style."+t,e),function(){var t=(0,J.S)(this,u),e=s(this),n=e+"";return null==e&&(this.style.removeProperty(u),n=e=(0,J.S)(this,u)),t===n?null:t===l&&n===c?h:(c=n,h=Z(l=t,e))})).each((f=this._id,_="end."+(g="style."+(p=t)),function(){var t=P(this,f),e=t.on,n=null==t.value[g]?y||(y=tt(p)):void 0;(e!==d||v!==n)&&(m=(d=e).copy()).on(_,v=n),t.on=m})):this.styleTween(t,(w=t,k=e+"",function(){var t=(0,J.S)(this,w);return t===k?null:t===b?x:x=Z(b=t,e)}),n).on("end.style."+t,null)},styleTween:function(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==e)return this.tween(r,null);if("function"!=typeof e)throw Error();return this.tween(r,function(t,e,n){var r,i;function o(){var o=e.apply(this,arguments);return o!==i&&(r=(i=o)&&function(e){this.style.setProperty(t,o.call(this,e),n)}),r}return o._value=e,o}(t,e,null==n?"":n))},text:function(t){var e,n;return this.tween("text","function"==typeof t?(e=Y(this,"text",t),function(){var t=e(this);this.textContent=null==t?"":t}):(n=null==t?"":t+"",function(){this.textContent=n}))},textTween:function(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw Error();return this.tween(e,function(t){var e,n;function r(){var r=t.apply(this,arguments);return r!==n&&(e=(n=r)&&function(t){this.textContent=r.call(this,t)}),e}return r._value=t,r}(t))},remove:function(){var t;return this.on("end.remove",(t=this._id,function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}))},tween:function(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r,i=T(this.node(),n).tween,o=0,a=i.length;o<a;++o)if((r=i[o]).name===t)return r.value;return null}return this.each((null==e?function(t,e){var n,r;return function(){var i=P(this,t),o=i.tween;if(o!==n){r=n=o;for(var a=0,u=r.length;a<u;++a)if(r[a].name===e){(r=r.slice()).splice(a,1);break}}i.tween=r}}:function(t,e,n){var r,i;if("function"!=typeof n)throw Error();return function(){var o=P(this,t),a=o.tween;if(a!==r){i=(r=a).slice();for(var u={name:e,value:n},s=0,l=i.length;s<l;++s)if(i[s].name===e){i[s]=u;break}s===l&&i.push(u)}o.tween=i}})(n,t,e))},delay:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?function(t,e){return function(){C(this,t).delay=+e.apply(this,arguments)}}:function(t,e){return e=+e,function(){C(this,t).delay=e}})(e,t)):T(this.node(),e).delay},duration:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?function(t,e){return function(){P(this,t).duration=+e.apply(this,arguments)}}:function(t,e){return e=+e,function(){P(this,t).duration=e}})(e,t)):T(this.node(),e).duration},ease:function(t){var e=this._id;return arguments.length?this.each(function(t,e){if("function"!=typeof e)throw Error();return function(){P(this,t).ease=e}}(e,t)):T(this.node(),e).ease},easeVarying:function(t){var e;if("function"!=typeof t)throw Error();return this.each((e=this._id,function(){var n=t.apply(this,arguments);if("function"!=typeof n)throw Error();P(this,e).ease=n}))},end:function(){var t,e,n=this,r=n._id,i=n.size();return new Promise(function(o,a){var u={value:a},s={value:function(){0==--i&&o()}};n.each(function(){var n=P(this,r),i=n.on;i!==t&&((e=(t=i).copy())._.cancel.push(u),e._.interrupt.push(u),e._.end.push(s)),n.on=e}),0===i&&o()})},[Symbol.iterator]:tr[Symbol.iterator]};var ti={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};f.ZP.prototype.interrupt=function(t){return this.each(function(){R(this,t)})},f.ZP.prototype.transition=function(t){var e,n;t instanceof tn?(e=t._id,t=t._name):(e=++te,(n=ti).time=b(),t=null==t?null:t+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var a,u=r[o],s=u.length,l=0;l<s;++l)(a=u[l])&&S(a,t,e,l,u,n||function(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw Error(`transition ${e} not found`);return n}(a,e));return new tn(r,this._parents,t,e)};var to=t=>()=>t;function ta(t,{sourceEvent:e,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function tu(t,e,n){this.k=t,this.x=e,this.y=n}tu.prototype={constructor:tu,scale:function(t){return 1===t?this:new tu(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new tu(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var ts=new tu(1,0,0);function tl(t){t.stopImmediatePropagation()}function tc(t){t.preventDefault(),t.stopImmediatePropagation()}function th(t){return(!t.ctrlKey||"wheel"===t.type)&&!t.button}function tf(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t).hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]:[[0,0],[t.clientWidth,t.clientHeight]]}function tp(){return this.__zoom||ts}function td(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function tm(){return navigator.maxTouchPoints||"ontouchstart"in this}function tv(t,e,n){var r=t.invertX(e[0][0])-n[0][0],i=t.invertX(e[1][0])-n[1][0],o=t.invertY(e[0][1])-n[0][1],a=t.invertY(e[1][1])-n[1][1];return t.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),a>o?(o+a)/2:Math.min(0,o)||Math.max(0,a))}function ty(){var t,e,n,r=th,a=tf,u=tv,s=td,f=tm,p=[0,1/0],d=[[-1/0,-1/0],[1/0,1/0]],m=250,v=l,y=(0,i.Z)("start","zoom","end"),g=0,_=10;function w(t){t.property("__zoom",tp).on("wheel.zoom",z,{passive:!1}).on("mousedown.zoom",A).on("dblclick.zoom",N).filter(f).on("touchstart.zoom",$).on("touchmove.zoom",S).on("touchend.zoom touchcancel.zoom",C).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function b(t,e){return(e=Math.max(p[0],Math.min(p[1],e)))===t.k?t:new tu(e,t.x,t.y)}function x(t,e,n){var r=e[0]-n[0]*t.k,i=e[1]-n[1]*t.k;return r===t.x&&i===t.y?t:new tu(t.k,r,i)}function k(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function Z(t,e,n,r){t.on("start.zoom",function(){M(this,arguments).event(r).start()}).on("interrupt.zoom end.zoom",function(){M(this,arguments).event(r).end()}).tween("zoom",function(){var t=arguments,i=M(this,t).event(r),o=a.apply(this,t),u=null==n?k(o):"function"==typeof n?n.apply(this,t):n,s=Math.max(o[1][0]-o[0][0],o[1][1]-o[0][1]),l=this.__zoom,c="function"==typeof e?e.apply(this,t):e,h=v(l.invert(u).concat(s/l.k),c.invert(u).concat(s/c.k));return function(t){if(1===t)t=c;else{var e=h(t),n=s/e[2];t=new tu(n,u[0]-e[0]*n,u[1]-e[1]*n)}i.zoom(null,t)}})}function M(t,e,n){return!n&&t.__zooming||new E(t,e)}function E(t,e){this.that=t,this.args=e,this.active=0,this.sourceEvent=null,this.extent=a.apply(t,e),this.taps=0}function z(t,...e){if(r.apply(this,arguments)){var n=M(this,e).event(t),i=this.__zoom,o=Math.max(p[0],Math.min(p[1],i.k*Math.pow(2,s.apply(this,arguments)))),a=(0,h.Z)(t);if(n.wheel)(n.mouse[0][0]!==a[0]||n.mouse[0][1]!==a[1])&&(n.mouse[1]=i.invert(n.mouse[0]=a)),clearTimeout(n.wheel);else{if(i.k===o)return;n.mouse=[a,i.invert(a)],R(this),n.start()}tc(t),n.wheel=setTimeout(function(){n.wheel=null,n.end()},150),n.zoom("mouse",u(x(b(i,o),n.mouse[0],n.mouse[1]),n.extent,d))}}function A(t,...e){if(!n&&r.apply(this,arguments)){var i=t.currentTarget,a=M(this,e,!0).event(t),s=(0,c.Z)(t.view).on("mousemove.zoom",function(t){if(tc(t),!a.moved){var e=t.clientX-f,n=t.clientY-p;a.moved=e*e+n*n>g}a.event(t).zoom("mouse",u(x(a.that.__zoom,a.mouse[0]=(0,h.Z)(t,i),a.mouse[1]),a.extent,d))},!0).on("mouseup.zoom",function(t){s.on("mousemove.zoom mouseup.zoom",null),(0,o.D)(t.view,a.moved),tc(t),a.event(t).end()},!0),l=(0,h.Z)(t,i),f=t.clientX,p=t.clientY;(0,o.Z)(t.view),tl(t),a.mouse=[l,this.__zoom.invert(l)],R(this),a.start()}}function N(t,...e){if(r.apply(this,arguments)){var n=this.__zoom,i=(0,h.Z)(t.changedTouches?t.changedTouches[0]:t,this),o=n.invert(i),s=n.k*(t.shiftKey?.5:2),l=u(x(b(n,s),i,o),a.apply(this,e),d);tc(t),m>0?(0,c.Z)(this).transition().duration(m).call(Z,l,i,t):(0,c.Z)(this).call(w.transform,l,i,t)}}function $(n,...i){if(r.apply(this,arguments)){var o,a,u,s,l=n.touches,c=l.length,f=M(this,i,n.changedTouches.length===c).event(n);for(tl(n),a=0;a<c;++a)u=l[a],s=[s=(0,h.Z)(u,this),this.__zoom.invert(s),u.identifier],f.touch0?f.touch1||f.touch0[2]===s[2]||(f.touch1=s,f.taps=0):(f.touch0=s,o=!0,f.taps=1+!!t);t&&(t=clearTimeout(t)),o&&(f.taps<2&&(e=s[0],t=setTimeout(function(){t=null},500)),R(this),f.start())}}function S(t,...e){if(this.__zooming){var n,r,i,o,a=M(this,e).event(t),s=t.changedTouches,l=s.length;for(tc(t),n=0;n<l;++n)r=s[n],i=(0,h.Z)(r,this),a.touch0&&a.touch0[2]===r.identifier?a.touch0[0]=i:a.touch1&&a.touch1[2]===r.identifier&&(a.touch1[0]=i);if(r=a.that.__zoom,a.touch1){var c=a.touch0[0],f=a.touch0[1],p=a.touch1[0],m=a.touch1[1],v=(v=p[0]-c[0])*v+(v=p[1]-c[1])*v,y=(y=m[0]-f[0])*y+(y=m[1]-f[1])*y;r=b(r,Math.sqrt(v/y)),i=[(c[0]+p[0])/2,(c[1]+p[1])/2],o=[(f[0]+m[0])/2,(f[1]+m[1])/2]}else{if(!a.touch0)return;i=a.touch0[0],o=a.touch0[1]}a.zoom("touch",u(x(r,i,o),a.extent,d))}}function C(t,...r){if(this.__zooming){var i,o,a=M(this,r).event(t),u=t.changedTouches,s=u.length;for(tl(t),n&&clearTimeout(n),n=setTimeout(function(){n=null},500),i=0;i<s;++i)o=u[i],a.touch0&&a.touch0[2]===o.identifier?delete a.touch0:a.touch1&&a.touch1[2]===o.identifier&&delete a.touch1;if(a.touch1&&!a.touch0&&(a.touch0=a.touch1,delete a.touch1),a.touch0)a.touch0[1]=this.__zoom.invert(a.touch0[0]);else if(a.end(),2===a.taps&&(o=(0,h.Z)(o,this),Math.hypot(e[0]-o[0],e[1]-o[1])<_)){var l=(0,c.Z)(this).on("dblclick.zoom");l&&l.apply(this,arguments)}}}return w.transform=function(t,e,n,r){var i=t.selection?t.selection():t;i.property("__zoom",tp),t!==i?Z(t,e,n,r):i.interrupt().each(function(){M(this,arguments).event(r).start().zoom(null,"function"==typeof e?e.apply(this,arguments):e).end()})},w.scaleBy=function(t,e,n,r){w.scaleTo(t,function(){var t=this.__zoom.k,n="function"==typeof e?e.apply(this,arguments):e;return t*n},n,r)},w.scaleTo=function(t,e,n,r){w.transform(t,function(){var t=a.apply(this,arguments),r=this.__zoom,i=null==n?k(t):"function"==typeof n?n.apply(this,arguments):n,o=r.invert(i),s="function"==typeof e?e.apply(this,arguments):e;return u(x(b(r,s),i,o),t,d)},n,r)},w.translateBy=function(t,e,n,r){w.transform(t,function(){return u(this.__zoom.translate("function"==typeof e?e.apply(this,arguments):e,"function"==typeof n?n.apply(this,arguments):n),a.apply(this,arguments),d)},null,r)},w.translateTo=function(t,e,n,r,i){w.transform(t,function(){var t=a.apply(this,arguments),i=this.__zoom,o=null==r?k(t):"function"==typeof r?r.apply(this,arguments):r;return u(ts.translate(o[0],o[1]).scale(i.k).translate("function"==typeof e?-e.apply(this,arguments):-e,"function"==typeof n?-n.apply(this,arguments):-n),t,d)},r,i)},E.prototype={event:function(t){return t&&(this.sourceEvent=t),this},start:function(){return 1==++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(t,e){return this.mouse&&"mouse"!==t&&(this.mouse[1]=e.invert(this.mouse[0])),this.touch0&&"touch"!==t&&(this.touch0[1]=e.invert(this.touch0[0])),this.touch1&&"touch"!==t&&(this.touch1[1]=e.invert(this.touch1[0])),this.that.__zoom=e,this.emit("zoom"),this},end:function(){return 0==--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(t){var e=(0,c.Z)(this.that).datum();y.call(t,this.that,new ta(t,{sourceEvent:this.sourceEvent,target:w,type:t,transform:this.that.__zoom,dispatch:y}),e)}},w.wheelDelta=function(t){return arguments.length?(s="function"==typeof t?t:to(+t),w):s},w.filter=function(t){return arguments.length?(r="function"==typeof t?t:to(!!t),w):r},w.touchable=function(t){return arguments.length?(f="function"==typeof t?t:to(!!t),w):f},w.extent=function(t){return arguments.length?(a="function"==typeof t?t:to([[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]]),w):a},w.scaleExtent=function(t){return arguments.length?(p[0]=+t[0],p[1]=+t[1],w):[p[0],p[1]]},w.translateExtent=function(t){return arguments.length?(d[0][0]=+t[0][0],d[1][0]=+t[1][0],d[0][1]=+t[0][1],d[1][1]=+t[1][1],w):[[d[0][0],d[0][1]],[d[1][0],d[1][1]]]},w.constrain=function(t){return arguments.length?(u=t,w):u},w.duration=function(t){return arguments.length?(m=+t,w):m},w.interpolate=function(t){return arguments.length?(v=t,w):v},w.on=function(){var t=y.on.apply(y,arguments);return t===y?w:t},w.clickDistance=function(t){return arguments.length?(g=(t=+t)*t,w):Math.sqrt(g)},w.tapDistance=function(t){return arguments.length?(_=+t,w):_},w}tu.prototype},85854:function(t,e,n){"use strict";function r(t,e){if(Object.is(t,e))return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return!1;if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(let[n,r]of t)if(!Object.is(r,e.get(n)))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(let n of t)if(!e.has(n))return!1;return!0}let n=Object.keys(t);if(n.length!==Object.keys(e).length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(e,r)||!Object.is(t[r],e[r]))return!1;return!0}n.d(e,{X:function(){return r}})},69829:function(t,e,n){"use strict";n.d(e,{F:function(){return f},s:function(){return c}});var r=n(2265),i=n(35195);let o=t=>{let e;let n=new Set,r=(t,r)=>{let i="function"==typeof t?t(e):t;if(!Object.is(i,e)){let t=e;e=(null!=r?r:"object"!=typeof i||null===i)?i:Object.assign({},e,i),n.forEach(n=>n(e,t))}},i=()=>e,o={setState:r,getState:i,getInitialState:()=>a,subscribe:t=>(n.add(t),()=>n.delete(t)),destroy:()=>{console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},a=e=t(r,i,o);return o},a=t=>t?o(t):o,{useDebugValue:u}=r,{useSyncExternalStoreWithSelector:s}=i,l=t=>t;function c(t,e=l,n){let r=s(t.subscribe,t.getState,t.getServerState||t.getInitialState,e,n);return u(r),r}let h=(t,e)=>{let n=a(t),r=(t,r=e)=>c(n,t,r);return Object.assign(r,n),r},f=(t,e)=>t?h(t,e):h}}]);
|