pycharter 0.0.25__py3-none-any.whl → 0.0.26__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (462) hide show
  1. pycharter/__init__.py +6 -0
  2. pycharter/api/README.md +1 -1
  3. pycharter/api/dependencies/auth.py +158 -0
  4. pycharter/api/main.py +30 -2
  5. pycharter/api/models/etl.py +66 -0
  6. pycharter/api/routes/v1/__init__.py +4 -0
  7. pycharter/api/routes/v1/auth.py +97 -0
  8. pycharter/api/routes/v1/contracts.py +10 -8
  9. pycharter/api/routes/v1/etl.py +131 -0
  10. pycharter/cli.py +1 -1
  11. pycharter/config.py +69 -0
  12. pycharter/contract_builder/builder.py +32 -37
  13. pycharter/data/seed/compliance_frameworks.yaml +22 -0
  14. pycharter/data/seed/contracts.yaml +130 -0
  15. pycharter/data/seed/data_feeds.yaml +22 -0
  16. pycharter/data/seed/domains.yaml +13 -0
  17. pycharter/data/seed/environments.yaml +19 -0
  18. pycharter/data/seed/owners.yaml +21 -0
  19. pycharter/data/seed/systems.yaml +13 -0
  20. pycharter/data/seed/tags.yaml +25 -0
  21. pycharter/data/templates/contract/README.md +31 -14
  22. pycharter/data/templates/contract/template_contract.yaml +37 -0
  23. pycharter/data/templates/etl/README.md +1 -1
  24. pycharter/data/templates/etl/extract_with_validation.yaml +86 -0
  25. pycharter/data/templates/etl/load_with_validation.yaml +111 -0
  26. pycharter/data/templates/etl/settings.yaml +55 -0
  27. pycharter/db/cli.py +126 -4
  28. pycharter/db/migrations/versions/20260122000000_change_artifact_unique_constraints_to_title_version.py +2 -2
  29. pycharter/etl_generator/INTERFACES.md +6 -7
  30. pycharter/etl_generator/__init__.py +47 -11
  31. pycharter/etl_generator/config_models.py +673 -0
  32. pycharter/etl_generator/config_validator.py +133 -157
  33. pycharter/etl_generator/context.py +3 -0
  34. pycharter/etl_generator/database.py +5 -1
  35. pycharter/etl_generator/extractors/__init__.py +4 -2
  36. pycharter/etl_generator/extractors/cloud_storage.py +9 -9
  37. pycharter/etl_generator/extractors/database.py +2 -2
  38. pycharter/etl_generator/extractors/factory.py +15 -33
  39. pycharter/etl_generator/extractors/file.py +2 -2
  40. pycharter/etl_generator/extractors/http.py +2 -2
  41. pycharter/etl_generator/extractors/mongodb.py +393 -0
  42. pycharter/etl_generator/extractors/streaming.py +2 -2
  43. pycharter/etl_generator/loaders/__init__.py +15 -9
  44. pycharter/etl_generator/loaders/{cloud_storage_loader.py → cloud_storage.py} +95 -2
  45. pycharter/etl_generator/loaders/factory.py +16 -29
  46. pycharter/etl_generator/loaders/file.py +135 -1
  47. pycharter/etl_generator/loaders/mongodb.py +416 -0
  48. pycharter/etl_generator/pipeline.py +283 -164
  49. pycharter/etl_generator/result.py +16 -0
  50. pycharter/etl_generator/schemas/__init__.py +71 -42
  51. pycharter/etl_generator/transformers/config.py +3 -2
  52. pycharter/etl_generator/transformers/simple_operations.py +57 -4
  53. pycharter/etl_generator/validation.py +551 -0
  54. pycharter/runtime_validator/__init__.py +7 -0
  55. pycharter/runtime_validator/utils.py +33 -0
  56. pycharter/runtime_validator/validator.py +13 -10
  57. pycharter/ui/package-lock.json +50 -41
  58. pycharter/ui/package.json +2 -1
  59. pycharter/ui/static/404/index.html +1 -1
  60. pycharter/ui/static/404.html +1 -1
  61. pycharter/ui/static/__next.__PAGE__.txt +2 -2
  62. pycharter/ui/static/__next._full.txt +7 -7
  63. pycharter/ui/static/__next._head.txt +1 -1
  64. pycharter/ui/static/__next._index.txt +6 -6
  65. pycharter/ui/static/__next._tree.txt +2 -2
  66. pycharter/ui/static/_next/static/chunks/0fc1f70b787b8845.js +1 -0
  67. pycharter/ui/static/_next/static/chunks/17bb8075d7b75663.css +1 -0
  68. pycharter/ui/static/_next/static/chunks/381932864dcbfdb8.js +1 -0
  69. pycharter/ui/static/_next/static/chunks/4c951b8e4507e2b3.js +1 -0
  70. pycharter/ui/static/_next/static/chunks/68b87a6f65abd3ed.js +1 -0
  71. pycharter/ui/static/_next/static/chunks/78572617b8fae189.js +1 -0
  72. pycharter/ui/static/_next/static/chunks/8b7be2803e3fe184.js +1 -0
  73. pycharter/ui/static/_next/static/chunks/a8e529fd1e67f121.js +1 -0
  74. pycharter/ui/static/_next/static/chunks/c35d998f80be3ff5.js +1 -0
  75. pycharter/ui/static/_next/static/chunks/e453aa5d01c32c17.js +1 -0
  76. pycharter/ui/static/_next/static/chunks/f2d240eb057f898a.js +970 -0
  77. pycharter/ui/static/_next/static/chunks/f7722448f6040846.js +1 -0
  78. pycharter/ui/static/_not-found/__next._full.txt +12 -12
  79. pycharter/ui/static/_not-found/__next._head.txt +3 -3
  80. pycharter/ui/static/_not-found/__next._index.txt +8 -8
  81. pycharter/ui/static/_not-found/__next._not-found.__PAGE__.txt +2 -2
  82. pycharter/ui/static/_not-found/__next._not-found.txt +3 -3
  83. pycharter/ui/static/_not-found/__next._tree.txt +2 -2
  84. pycharter/ui/static/_not-found/index.html +1 -1
  85. pycharter/ui/static/_not-found/index.txt +12 -12
  86. pycharter/ui/static/contracts/__next._full.txt +7 -7
  87. pycharter/ui/static/contracts/__next._head.txt +1 -1
  88. pycharter/ui/static/contracts/__next._index.txt +6 -6
  89. pycharter/ui/static/contracts/__next._tree.txt +2 -2
  90. pycharter/ui/static/contracts/__next.contracts.__PAGE__.txt +2 -2
  91. pycharter/ui/static/contracts/__next.contracts.txt +1 -1
  92. pycharter/ui/static/contracts/index.html +1 -1
  93. pycharter/ui/static/contracts/index.txt +7 -7
  94. pycharter/ui/static/documentation/__next._full.txt +7 -7
  95. pycharter/ui/static/documentation/__next._head.txt +1 -1
  96. pycharter/ui/static/documentation/__next._index.txt +6 -6
  97. pycharter/ui/static/documentation/__next._tree.txt +2 -2
  98. pycharter/ui/static/documentation/__next.documentation.__PAGE__.txt +2 -2
  99. pycharter/ui/static/documentation/__next.documentation.txt +1 -1
  100. pycharter/ui/static/documentation/index.html +3 -3
  101. pycharter/ui/static/documentation/index.txt +7 -7
  102. pycharter/ui/static/etl/__next._full.txt +21 -0
  103. pycharter/ui/static/etl/__next._head.txt +7 -0
  104. pycharter/ui/static/etl/__next._index.txt +9 -0
  105. pycharter/ui/static/etl/__next._tree.txt +2 -0
  106. pycharter/ui/static/etl/__next.etl.__PAGE__.txt +9 -0
  107. pycharter/ui/static/etl/__next.etl.txt +4 -0
  108. pycharter/ui/static/etl/index.html +2 -0
  109. pycharter/ui/static/etl/index.txt +21 -0
  110. pycharter/ui/static/index.html +1 -1
  111. pycharter/ui/static/index.txt +7 -7
  112. pycharter/ui/static/metadata/__next._full.txt +7 -7
  113. pycharter/ui/static/metadata/__next._head.txt +1 -1
  114. pycharter/ui/static/metadata/__next._index.txt +6 -6
  115. pycharter/ui/static/metadata/__next._tree.txt +2 -2
  116. pycharter/ui/static/metadata/__next.metadata.__PAGE__.txt +2 -2
  117. pycharter/ui/static/metadata/__next.metadata.txt +1 -1
  118. pycharter/ui/static/metadata/index.html +1 -1
  119. pycharter/ui/static/metadata/index.txt +7 -7
  120. pycharter/ui/static/quality/__next._full.txt +7 -7
  121. pycharter/ui/static/quality/__next._head.txt +1 -1
  122. pycharter/ui/static/quality/__next._index.txt +6 -6
  123. pycharter/ui/static/quality/__next._tree.txt +2 -2
  124. pycharter/ui/static/quality/__next.quality.__PAGE__.txt +2 -2
  125. pycharter/ui/static/quality/__next.quality.txt +1 -1
  126. pycharter/ui/static/quality/index.html +2 -2
  127. pycharter/ui/static/quality/index.txt +7 -7
  128. pycharter/ui/static/rules/__next._full.txt +7 -7
  129. pycharter/ui/static/rules/__next._head.txt +1 -1
  130. pycharter/ui/static/rules/__next._index.txt +6 -6
  131. pycharter/ui/static/rules/__next._tree.txt +2 -2
  132. pycharter/ui/static/rules/__next.rules.__PAGE__.txt +2 -2
  133. pycharter/ui/static/rules/__next.rules.txt +1 -1
  134. pycharter/ui/static/rules/index.html +1 -1
  135. pycharter/ui/static/rules/index.txt +7 -7
  136. pycharter/ui/static/schemas/__next._full.txt +7 -7
  137. pycharter/ui/static/schemas/__next._head.txt +1 -1
  138. pycharter/ui/static/schemas/__next._index.txt +6 -6
  139. pycharter/ui/static/schemas/__next._tree.txt +2 -2
  140. pycharter/ui/static/schemas/__next.schemas.__PAGE__.txt +2 -2
  141. pycharter/ui/static/schemas/__next.schemas.txt +1 -1
  142. pycharter/ui/static/schemas/index.html +1 -1
  143. pycharter/ui/static/schemas/index.txt +7 -7
  144. pycharter/ui/static/settings/__next._full.txt +7 -7
  145. pycharter/ui/static/settings/__next._head.txt +1 -1
  146. pycharter/ui/static/settings/__next._index.txt +6 -6
  147. pycharter/ui/static/settings/__next._tree.txt +2 -2
  148. pycharter/ui/static/settings/__next.settings.__PAGE__.txt +2 -2
  149. pycharter/ui/static/settings/__next.settings.txt +1 -1
  150. pycharter/ui/static/settings/index.html +1 -1
  151. pycharter/ui/static/settings/index.txt +7 -7
  152. pycharter/ui/static/static/404/index.html +1 -1
  153. pycharter/ui/static/static/404.html +1 -1
  154. pycharter/ui/static/static/__next.__PAGE__.txt +1 -1
  155. pycharter/ui/static/static/__next._full.txt +1 -1
  156. pycharter/ui/static/static/__next._head.txt +1 -1
  157. pycharter/ui/static/static/__next._index.txt +1 -1
  158. pycharter/ui/static/static/__next._tree.txt +1 -1
  159. pycharter/ui/static/static/_not-found/__next._full.txt +1 -1
  160. pycharter/ui/static/static/_not-found/__next._head.txt +1 -1
  161. pycharter/ui/static/static/_not-found/__next._index.txt +1 -1
  162. pycharter/ui/static/static/_not-found/__next._not-found.__PAGE__.txt +1 -1
  163. pycharter/ui/static/static/_not-found/__next._not-found.txt +1 -1
  164. pycharter/ui/static/static/_not-found/__next._tree.txt +1 -1
  165. pycharter/ui/static/static/_not-found/index.html +1 -1
  166. pycharter/ui/static/static/_not-found/index.txt +1 -1
  167. pycharter/ui/static/static/contracts/__next._full.txt +2 -2
  168. pycharter/ui/static/static/contracts/__next._head.txt +1 -1
  169. pycharter/ui/static/static/contracts/__next._index.txt +1 -1
  170. pycharter/ui/static/static/contracts/__next._tree.txt +1 -1
  171. pycharter/ui/static/static/contracts/__next.contracts.__PAGE__.txt +2 -2
  172. pycharter/ui/static/static/contracts/__next.contracts.txt +1 -1
  173. pycharter/ui/static/static/contracts/index.html +1 -1
  174. pycharter/ui/static/static/contracts/index.txt +2 -2
  175. pycharter/ui/static/static/documentation/__next._full.txt +1 -1
  176. pycharter/ui/static/static/documentation/__next._head.txt +1 -1
  177. pycharter/ui/static/static/documentation/__next._index.txt +1 -1
  178. pycharter/ui/static/static/documentation/__next._tree.txt +1 -1
  179. pycharter/ui/static/static/documentation/__next.documentation.__PAGE__.txt +1 -1
  180. pycharter/ui/static/static/documentation/__next.documentation.txt +1 -1
  181. pycharter/ui/static/static/documentation/index.html +2 -2
  182. pycharter/ui/static/static/documentation/index.txt +1 -1
  183. pycharter/ui/static/static/index.html +1 -1
  184. pycharter/ui/static/static/index.txt +1 -1
  185. pycharter/ui/static/static/metadata/__next._full.txt +1 -1
  186. pycharter/ui/static/static/metadata/__next._head.txt +1 -1
  187. pycharter/ui/static/static/metadata/__next._index.txt +1 -1
  188. pycharter/ui/static/static/metadata/__next._tree.txt +1 -1
  189. pycharter/ui/static/static/metadata/__next.metadata.__PAGE__.txt +1 -1
  190. pycharter/ui/static/static/metadata/__next.metadata.txt +1 -1
  191. pycharter/ui/static/static/metadata/index.html +1 -1
  192. pycharter/ui/static/static/metadata/index.txt +1 -1
  193. pycharter/ui/static/static/quality/__next._full.txt +2 -2
  194. pycharter/ui/static/static/quality/__next._head.txt +1 -1
  195. pycharter/ui/static/static/quality/__next._index.txt +1 -1
  196. pycharter/ui/static/static/quality/__next._tree.txt +1 -1
  197. pycharter/ui/static/static/quality/__next.quality.__PAGE__.txt +2 -2
  198. pycharter/ui/static/static/quality/__next.quality.txt +1 -1
  199. pycharter/ui/static/static/quality/index.html +2 -2
  200. pycharter/ui/static/static/quality/index.txt +2 -2
  201. pycharter/ui/static/static/rules/__next._full.txt +1 -1
  202. pycharter/ui/static/static/rules/__next._head.txt +1 -1
  203. pycharter/ui/static/static/rules/__next._index.txt +1 -1
  204. pycharter/ui/static/static/rules/__next._tree.txt +1 -1
  205. pycharter/ui/static/static/rules/__next.rules.__PAGE__.txt +1 -1
  206. pycharter/ui/static/static/rules/__next.rules.txt +1 -1
  207. pycharter/ui/static/static/rules/index.html +1 -1
  208. pycharter/ui/static/static/rules/index.txt +1 -1
  209. pycharter/ui/static/static/schemas/__next._full.txt +1 -1
  210. pycharter/ui/static/static/schemas/__next._head.txt +1 -1
  211. pycharter/ui/static/static/schemas/__next._index.txt +1 -1
  212. pycharter/ui/static/static/schemas/__next._tree.txt +1 -1
  213. pycharter/ui/static/static/schemas/__next.schemas.__PAGE__.txt +1 -1
  214. pycharter/ui/static/static/schemas/__next.schemas.txt +1 -1
  215. pycharter/ui/static/static/schemas/index.html +1 -1
  216. pycharter/ui/static/static/schemas/index.txt +1 -1
  217. pycharter/ui/static/static/settings/__next._full.txt +1 -1
  218. pycharter/ui/static/static/settings/__next._head.txt +1 -1
  219. pycharter/ui/static/static/settings/__next._index.txt +1 -1
  220. pycharter/ui/static/static/settings/__next._tree.txt +1 -1
  221. pycharter/ui/static/static/settings/__next.settings.__PAGE__.txt +1 -1
  222. pycharter/ui/static/static/settings/__next.settings.txt +1 -1
  223. pycharter/ui/static/static/settings/index.html +1 -1
  224. pycharter/ui/static/static/settings/index.txt +1 -1
  225. pycharter/ui/static/static/static/404/index.html +1 -1
  226. pycharter/ui/static/static/static/404.html +1 -1
  227. pycharter/ui/static/static/static/__next.__PAGE__.txt +1 -1
  228. pycharter/ui/static/static/static/__next._full.txt +2 -2
  229. pycharter/ui/static/static/static/__next._head.txt +1 -1
  230. pycharter/ui/static/static/static/__next._index.txt +2 -2
  231. pycharter/ui/static/static/static/__next._tree.txt +2 -2
  232. pycharter/ui/static/static/static/_next/static/chunks/f7d1a90dd75d2572.js +1 -0
  233. pycharter/ui/static/static/static/_not-found/__next._full.txt +2 -2
  234. pycharter/ui/static/static/static/_not-found/__next._head.txt +1 -1
  235. pycharter/ui/static/static/static/_not-found/__next._index.txt +2 -2
  236. pycharter/ui/static/static/static/_not-found/__next._not-found.__PAGE__.txt +1 -1
  237. pycharter/ui/static/static/static/_not-found/__next._not-found.txt +1 -1
  238. pycharter/ui/static/static/static/_not-found/__next._tree.txt +2 -2
  239. pycharter/ui/static/static/static/_not-found/index.html +1 -1
  240. pycharter/ui/static/static/static/_not-found/index.txt +2 -2
  241. pycharter/ui/static/static/static/contracts/__next._full.txt +3 -3
  242. pycharter/ui/static/static/static/contracts/__next._head.txt +1 -1
  243. pycharter/ui/static/static/static/contracts/__next._index.txt +2 -2
  244. pycharter/ui/static/static/static/contracts/__next._tree.txt +2 -2
  245. pycharter/ui/static/static/static/contracts/__next.contracts.__PAGE__.txt +2 -2
  246. pycharter/ui/static/static/static/contracts/__next.contracts.txt +1 -1
  247. pycharter/ui/static/static/static/contracts/index.html +1 -1
  248. pycharter/ui/static/static/static/contracts/index.txt +3 -3
  249. pycharter/ui/static/static/static/documentation/__next._full.txt +3 -3
  250. pycharter/ui/static/static/static/documentation/__next._head.txt +1 -1
  251. pycharter/ui/static/static/static/documentation/__next._index.txt +2 -2
  252. pycharter/ui/static/static/static/documentation/__next._tree.txt +2 -2
  253. pycharter/ui/static/static/static/documentation/__next.documentation.__PAGE__.txt +2 -2
  254. pycharter/ui/static/static/static/documentation/__next.documentation.txt +1 -1
  255. pycharter/ui/static/static/static/documentation/index.html +2 -2
  256. pycharter/ui/static/static/static/documentation/index.txt +3 -3
  257. pycharter/ui/static/static/static/index.html +1 -1
  258. pycharter/ui/static/static/static/index.txt +2 -2
  259. pycharter/ui/static/static/static/metadata/__next._full.txt +2 -2
  260. pycharter/ui/static/static/static/metadata/__next._head.txt +1 -1
  261. pycharter/ui/static/static/static/metadata/__next._index.txt +2 -2
  262. pycharter/ui/static/static/static/metadata/__next._tree.txt +2 -2
  263. pycharter/ui/static/static/static/metadata/__next.metadata.__PAGE__.txt +1 -1
  264. pycharter/ui/static/static/static/metadata/__next.metadata.txt +1 -1
  265. pycharter/ui/static/static/static/metadata/index.html +1 -1
  266. pycharter/ui/static/static/static/metadata/index.txt +2 -2
  267. pycharter/ui/static/static/static/quality/__next._full.txt +2 -2
  268. pycharter/ui/static/static/static/quality/__next._head.txt +1 -1
  269. pycharter/ui/static/static/static/quality/__next._index.txt +2 -2
  270. pycharter/ui/static/static/static/quality/__next._tree.txt +2 -2
  271. pycharter/ui/static/static/static/quality/__next.quality.__PAGE__.txt +1 -1
  272. pycharter/ui/static/static/static/quality/__next.quality.txt +1 -1
  273. pycharter/ui/static/static/static/quality/index.html +2 -2
  274. pycharter/ui/static/static/static/quality/index.txt +2 -2
  275. pycharter/ui/static/static/static/rules/__next._full.txt +2 -2
  276. pycharter/ui/static/static/static/rules/__next._head.txt +1 -1
  277. pycharter/ui/static/static/static/rules/__next._index.txt +2 -2
  278. pycharter/ui/static/static/static/rules/__next._tree.txt +2 -2
  279. pycharter/ui/static/static/static/rules/__next.rules.__PAGE__.txt +1 -1
  280. pycharter/ui/static/static/static/rules/__next.rules.txt +1 -1
  281. pycharter/ui/static/static/static/rules/index.html +1 -1
  282. pycharter/ui/static/static/static/rules/index.txt +2 -2
  283. pycharter/ui/static/static/static/schemas/__next._full.txt +2 -2
  284. pycharter/ui/static/static/static/schemas/__next._head.txt +1 -1
  285. pycharter/ui/static/static/static/schemas/__next._index.txt +2 -2
  286. pycharter/ui/static/static/static/schemas/__next._tree.txt +2 -2
  287. pycharter/ui/static/static/static/schemas/__next.schemas.__PAGE__.txt +1 -1
  288. pycharter/ui/static/static/static/schemas/__next.schemas.txt +1 -1
  289. pycharter/ui/static/static/static/schemas/index.html +1 -1
  290. pycharter/ui/static/static/static/schemas/index.txt +2 -2
  291. pycharter/ui/static/static/static/settings/__next._full.txt +2 -2
  292. pycharter/ui/static/static/static/settings/__next._head.txt +1 -1
  293. pycharter/ui/static/static/static/settings/__next._index.txt +2 -2
  294. pycharter/ui/static/static/static/settings/__next._tree.txt +2 -2
  295. pycharter/ui/static/static/static/settings/__next.settings.__PAGE__.txt +1 -1
  296. pycharter/ui/static/static/static/settings/__next.settings.txt +1 -1
  297. pycharter/ui/static/static/static/settings/index.html +1 -1
  298. pycharter/ui/static/static/static/settings/index.txt +2 -2
  299. pycharter/ui/static/static/static/static/.gitkeep +0 -0
  300. pycharter/ui/static/static/static/static/404/index.html +1 -0
  301. pycharter/ui/static/static/static/static/404.html +1 -0
  302. pycharter/ui/static/static/static/static/__next.__PAGE__.txt +10 -0
  303. pycharter/ui/static/static/static/static/__next._full.txt +30 -0
  304. pycharter/ui/static/static/static/static/__next._head.txt +7 -0
  305. pycharter/ui/static/static/static/static/__next._index.txt +9 -0
  306. pycharter/ui/static/static/static/static/__next._tree.txt +2 -0
  307. pycharter/ui/static/static/static/static/_next/static/chunks/222442f6da32302a.js +1 -0
  308. pycharter/ui/static/static/static/static/_next/static/chunks/247eb132b7f7b574.js +1 -0
  309. pycharter/ui/static/static/static/static/_next/static/chunks/297d55555b71baba.js +1 -0
  310. pycharter/ui/static/static/static/static/_next/static/chunks/414e77373f8ff61c.js +1 -0
  311. pycharter/ui/static/static/static/static/_next/static/chunks/652ad0aa26265c47.js +2 -0
  312. pycharter/ui/static/static/static/static/_next/static/chunks/9c23f44fff36548a.js +1 -0
  313. pycharter/ui/static/static/static/static/_next/static/chunks/a6dad97d9634a72d.js +1 -0
  314. pycharter/ui/static/static/static/static/_next/static/chunks/b32a0963684b9933.js +4 -0
  315. pycharter/ui/static/static/static/static/_next/static/chunks/db913959c675cea6.js +1 -0
  316. pycharter/ui/static/static/static/static/_next/static/chunks/f2e7afeab1178138.js +1 -0
  317. pycharter/ui/static/static/static/static/_next/static/chunks/ff1a16fafef87110.js +1 -0
  318. pycharter/ui/static/static/static/static/_next/static/chunks/turbopack-ffcb7ab6794027ef.js +3 -0
  319. pycharter/ui/static/static/static/static/_next/static/tNTkVW6puVXC4bAm4WrHl/_buildManifest.js +11 -0
  320. pycharter/ui/static/static/static/static/_next/static/tNTkVW6puVXC4bAm4WrHl/_clientMiddlewareManifest.json +1 -0
  321. pycharter/ui/static/static/static/static/_next/static/tNTkVW6puVXC4bAm4WrHl/_ssgManifest.js +1 -0
  322. pycharter/ui/static/static/static/static/_not-found/__next._full.txt +17 -0
  323. pycharter/ui/static/static/static/static/_not-found/__next._head.txt +7 -0
  324. pycharter/ui/static/static/static/static/_not-found/__next._index.txt +9 -0
  325. pycharter/ui/static/static/static/static/_not-found/__next._not-found.__PAGE__.txt +5 -0
  326. pycharter/ui/static/static/static/static/_not-found/__next._not-found.txt +4 -0
  327. pycharter/ui/static/static/static/static/_not-found/__next._tree.txt +2 -0
  328. pycharter/ui/static/static/static/static/_not-found/index.html +1 -0
  329. pycharter/ui/static/static/static/static/_not-found/index.txt +17 -0
  330. pycharter/ui/static/static/static/static/contracts/__next._full.txt +21 -0
  331. pycharter/ui/static/static/static/static/contracts/__next._head.txt +7 -0
  332. pycharter/ui/static/static/static/static/contracts/__next._index.txt +9 -0
  333. pycharter/ui/static/static/static/static/contracts/__next._tree.txt +2 -0
  334. pycharter/ui/static/static/static/static/contracts/__next.contracts.__PAGE__.txt +9 -0
  335. pycharter/ui/static/static/static/static/contracts/__next.contracts.txt +4 -0
  336. pycharter/ui/static/static/static/static/contracts/index.html +1 -0
  337. pycharter/ui/static/static/static/static/contracts/index.txt +21 -0
  338. pycharter/ui/static/static/static/static/documentation/__next._full.txt +21 -0
  339. pycharter/ui/static/static/static/static/documentation/__next._head.txt +7 -0
  340. pycharter/ui/static/static/static/static/documentation/__next._index.txt +9 -0
  341. pycharter/ui/static/static/static/static/documentation/__next._tree.txt +2 -0
  342. pycharter/ui/static/static/static/static/documentation/__next.documentation.__PAGE__.txt +9 -0
  343. pycharter/ui/static/static/static/static/documentation/__next.documentation.txt +4 -0
  344. pycharter/ui/static/static/static/static/documentation/index.html +93 -0
  345. pycharter/ui/static/static/static/static/documentation/index.txt +21 -0
  346. pycharter/ui/static/static/static/static/index.html +1 -0
  347. pycharter/ui/static/static/static/static/index.txt +30 -0
  348. pycharter/ui/static/static/static/static/metadata/__next._full.txt +21 -0
  349. pycharter/ui/static/static/static/static/metadata/__next._head.txt +7 -0
  350. pycharter/ui/static/static/static/static/metadata/__next._index.txt +9 -0
  351. pycharter/ui/static/static/static/static/metadata/__next._tree.txt +2 -0
  352. pycharter/ui/static/static/static/static/metadata/__next.metadata.__PAGE__.txt +9 -0
  353. pycharter/ui/static/static/static/static/metadata/__next.metadata.txt +4 -0
  354. pycharter/ui/static/static/static/static/metadata/index.html +1 -0
  355. pycharter/ui/static/static/static/static/metadata/index.txt +21 -0
  356. pycharter/ui/static/static/static/static/quality/__next._full.txt +21 -0
  357. pycharter/ui/static/static/static/static/quality/__next._head.txt +7 -0
  358. pycharter/ui/static/static/static/static/quality/__next._index.txt +9 -0
  359. pycharter/ui/static/static/static/static/quality/__next._tree.txt +2 -0
  360. pycharter/ui/static/static/static/static/quality/__next.quality.__PAGE__.txt +9 -0
  361. pycharter/ui/static/static/static/static/quality/__next.quality.txt +4 -0
  362. pycharter/ui/static/static/static/static/quality/index.html +2 -0
  363. pycharter/ui/static/static/static/static/quality/index.txt +21 -0
  364. pycharter/ui/static/static/static/static/rules/__next._full.txt +21 -0
  365. pycharter/ui/static/static/static/static/rules/__next._head.txt +7 -0
  366. pycharter/ui/static/static/static/static/rules/__next._index.txt +9 -0
  367. pycharter/ui/static/static/static/static/rules/__next._tree.txt +2 -0
  368. pycharter/ui/static/static/static/static/rules/__next.rules.__PAGE__.txt +9 -0
  369. pycharter/ui/static/static/static/static/rules/__next.rules.txt +4 -0
  370. pycharter/ui/static/static/static/static/rules/index.html +1 -0
  371. pycharter/ui/static/static/static/static/rules/index.txt +21 -0
  372. pycharter/ui/static/static/static/static/schemas/__next._full.txt +21 -0
  373. pycharter/ui/static/static/static/static/schemas/__next._head.txt +7 -0
  374. pycharter/ui/static/static/static/static/schemas/__next._index.txt +9 -0
  375. pycharter/ui/static/static/static/static/schemas/__next._tree.txt +2 -0
  376. pycharter/ui/static/static/static/static/schemas/__next.schemas.__PAGE__.txt +9 -0
  377. pycharter/ui/static/static/static/static/schemas/__next.schemas.txt +4 -0
  378. pycharter/ui/static/static/static/static/schemas/index.html +1 -0
  379. pycharter/ui/static/static/static/static/schemas/index.txt +21 -0
  380. pycharter/ui/static/static/static/static/settings/__next._full.txt +21 -0
  381. pycharter/ui/static/static/static/static/settings/__next._head.txt +7 -0
  382. pycharter/ui/static/static/static/static/settings/__next._index.txt +9 -0
  383. pycharter/ui/static/static/static/static/settings/__next._tree.txt +2 -0
  384. pycharter/ui/static/static/static/static/settings/__next.settings.__PAGE__.txt +9 -0
  385. pycharter/ui/static/static/static/static/settings/__next.settings.txt +4 -0
  386. pycharter/ui/static/static/static/static/settings/index.html +1 -0
  387. pycharter/ui/static/static/static/static/settings/index.txt +21 -0
  388. pycharter/ui/static/static/static/static/validation/__next._full.txt +21 -0
  389. pycharter/ui/static/static/static/static/validation/__next._head.txt +7 -0
  390. pycharter/ui/static/static/static/static/validation/__next._index.txt +9 -0
  391. pycharter/ui/static/static/static/static/validation/__next._tree.txt +2 -0
  392. pycharter/ui/static/static/static/static/validation/__next.validation.__PAGE__.txt +9 -0
  393. pycharter/ui/static/static/static/static/validation/__next.validation.txt +4 -0
  394. pycharter/ui/static/static/static/static/validation/index.html +1 -0
  395. pycharter/ui/static/static/static/static/validation/index.txt +21 -0
  396. pycharter/ui/static/static/static/validation/__next._full.txt +2 -2
  397. pycharter/ui/static/static/static/validation/__next._head.txt +1 -1
  398. pycharter/ui/static/static/static/validation/__next._index.txt +2 -2
  399. pycharter/ui/static/static/static/validation/__next._tree.txt +2 -2
  400. pycharter/ui/static/static/static/validation/__next.validation.__PAGE__.txt +1 -1
  401. pycharter/ui/static/static/static/validation/__next.validation.txt +1 -1
  402. pycharter/ui/static/static/static/validation/index.html +1 -1
  403. pycharter/ui/static/static/static/validation/index.txt +2 -2
  404. pycharter/ui/static/static/validation/__next._full.txt +2 -2
  405. pycharter/ui/static/static/validation/__next._head.txt +1 -1
  406. pycharter/ui/static/static/validation/__next._index.txt +1 -1
  407. pycharter/ui/static/static/validation/__next._tree.txt +1 -1
  408. pycharter/ui/static/static/validation/__next.validation.__PAGE__.txt +2 -2
  409. pycharter/ui/static/static/validation/__next.validation.txt +1 -1
  410. pycharter/ui/static/static/validation/index.html +1 -1
  411. pycharter/ui/static/static/validation/index.txt +2 -2
  412. pycharter/ui/static/validation/__next._full.txt +7 -7
  413. pycharter/ui/static/validation/__next._head.txt +1 -1
  414. pycharter/ui/static/validation/__next._index.txt +6 -6
  415. pycharter/ui/static/validation/__next._tree.txt +2 -2
  416. pycharter/ui/static/validation/__next.validation.__PAGE__.txt +2 -2
  417. pycharter/ui/static/validation/__next.validation.txt +1 -1
  418. pycharter/ui/static/validation/index.html +1 -1
  419. pycharter/ui/static/validation/index.txt +7 -7
  420. {pycharter-0.0.25.dist-info → pycharter-0.0.26.dist-info}/METADATA +57 -26
  421. pycharter-0.0.26.dist-info/RECORD +702 -0
  422. pycharter/etl_generator/config_loader.py +0 -394
  423. pycharter/etl_generator/loaders/cloud.py +0 -87
  424. pycharter/etl_generator/loaders/file_loader.py +0 -130
  425. pycharter/etl_generator/schemas/extract.json +0 -234
  426. pycharter/etl_generator/schemas/load.json +0 -202
  427. pycharter/etl_generator/schemas/pipeline.json +0 -94
  428. pycharter/etl_generator/schemas/transform.json +0 -171
  429. pycharter-0.0.25.dist-info/RECORD +0 -572
  430. /pycharter/ui/static/_next/static/{2gKjNv6YvE6BcIdFthBLs → YCnlK66gA7FV5vvcixspB}/_buildManifest.js +0 -0
  431. /pycharter/ui/static/_next/static/{2gKjNv6YvE6BcIdFthBLs → YCnlK66gA7FV5vvcixspB}/_clientMiddlewareManifest.json +0 -0
  432. /pycharter/ui/static/_next/static/{2gKjNv6YvE6BcIdFthBLs → YCnlK66gA7FV5vvcixspB}/_ssgManifest.js +0 -0
  433. /pycharter/ui/static/static/_next/static/{0rYA78L88aUyD2Uh38hhX → 2gKjNv6YvE6BcIdFthBLs}/_buildManifest.js +0 -0
  434. /pycharter/ui/static/static/_next/static/{0rYA78L88aUyD2Uh38hhX → 2gKjNv6YvE6BcIdFthBLs}/_clientMiddlewareManifest.json +0 -0
  435. /pycharter/ui/static/static/_next/static/{0rYA78L88aUyD2Uh38hhX → 2gKjNv6YvE6BcIdFthBLs}/_ssgManifest.js +0 -0
  436. /pycharter/ui/static/{_next → static/_next}/static/chunks/26dfc590f7714c03.js +0 -0
  437. /pycharter/ui/static/{_next → static/_next}/static/chunks/34d289e6db2ef551.js +0 -0
  438. /pycharter/ui/static/{_next → static/_next}/static/chunks/99508d9d5869cc27.js +0 -0
  439. /pycharter/ui/static/{_next → static/_next}/static/chunks/b313c35a6ba76574.js +0 -0
  440. /pycharter/ui/static/static/static/_next/static/{tNTkVW6puVXC4bAm4WrHl → 0rYA78L88aUyD2Uh38hhX}/_buildManifest.js +0 -0
  441. /pycharter/ui/static/static/static/_next/static/{tNTkVW6puVXC4bAm4WrHl → 0rYA78L88aUyD2Uh38hhX}/_clientMiddlewareManifest.json +0 -0
  442. /pycharter/ui/static/static/static/_next/static/{tNTkVW6puVXC4bAm4WrHl → 0rYA78L88aUyD2Uh38hhX}/_ssgManifest.js +0 -0
  443. /pycharter/ui/static/{_next → static/static/_next}/static/chunks/13d4a0fbd74c1ee4.js +0 -0
  444. /pycharter/ui/static/{_next → static/static/_next}/static/chunks/2edb43b48432ac04.js +0 -0
  445. /pycharter/ui/static/static/{_next → static/_next}/static/chunks/c4fa4f4114b7c352.js +0 -0
  446. /pycharter/ui/static/{_next → static/static/_next}/static/chunks/d2363397e1b2bcab.css +0 -0
  447. /pycharter/ui/static/{_next → static/static/static/_next}/static/chunks/2ab439ce003cd691.js +0 -0
  448. /pycharter/ui/static/{_next → static/static/static/_next}/static/chunks/49ca65abd26ae49e.js +0 -0
  449. /pycharter/ui/static/static/static/{_next → static/_next}/static/chunks/4e310fe5005770a3.css +0 -0
  450. /pycharter/ui/static/static/{_next → static/static/_next}/static/chunks/5e04d10c4a7b58a3.js +0 -0
  451. /pycharter/ui/static/static/static/{_next → static/_next}/static/chunks/5fc14c00a2779dc5.js +0 -0
  452. /pycharter/ui/static/static/{_next → static/static/_next}/static/chunks/75d88a058d8ffaa6.js +0 -0
  453. /pycharter/ui/static/static/{_next → static/static/_next}/static/chunks/8c89634cf6bad76f.js +0 -0
  454. /pycharter/ui/static/{_next → static/static/static/_next}/static/chunks/9667e7a3d359eb39.js +0 -0
  455. /pycharter/ui/static/static/static/{_next → static/_next}/static/chunks/b584574fdc8ab13e.js +0 -0
  456. /pycharter/ui/static/{_next → static/static/static/_next}/static/chunks/c69f6cba366bd988.js +0 -0
  457. /pycharter/ui/static/static/static/{_next → static/_next}/static/chunks/d5989c94d3614b3a.js +0 -0
  458. /pycharter/ui/static/{_next → static/static/static/_next}/static/chunks/f061a4be97bfc3b3.js +0 -0
  459. {pycharter-0.0.25.dist-info → pycharter-0.0.26.dist-info}/WHEEL +0 -0
  460. {pycharter-0.0.25.dist-info → pycharter-0.0.26.dist-info}/entry_points.txt +0 -0
  461. {pycharter-0.0.25.dist-info → pycharter-0.0.26.dist-info}/licenses/LICENSE +0 -0
  462. {pycharter-0.0.25.dist-info → pycharter-0.0.26.dist-info}/top_level.txt +0 -0
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,43668,e=>{"use strict";var t=e.i(47167);let a="pycharter_settings",n={apiServer:{url:t.default.env.NEXT_PUBLIC_API_URL||"http://localhost:8000"},database:{enabled:!1},dlq:{enabled:!1}};function r(){try{let e=localStorage.getItem(a);if(e){let t=JSON.parse(e);return{...n,...t,apiServer:{...n.apiServer,...t.apiServer},database:{...n.database,...t.database},dlq:{...n.dlq,...t.dlq}}}}catch(e){console.error("Failed to load settings:",e)}return n}function i(e){try{localStorage.setItem(a,JSON.stringify(e))}catch(e){throw console.error("Failed to save settings:",e),e}}function o(){return r().apiServer.url||n.apiServer.url}e.s(["getApiBaseUrl",()=>o,"getSettings",()=>r,"saveSettings",()=>i])},9165,e=>{"use strict";var t=e.i(43668);class a extends Error{status;response;constructor(e,t,a){super(e),this.status=t,this.response=a,this.name="ApiError"}}async function n(e,n){let r=`${(0,t.getApiBaseUrl)()}${e}`;try{let e=await fetch(r,{...n,headers:{"Content-Type":"application/json",...n?.headers}});if(!e.ok){let t;try{t=await e.json()}catch{t={detail:e.statusText}}let n=t.detail||`API request failed: ${e.statusText}`;throw 422===e.status&&t.details&&Array.isArray(t.details)&&(n=t.details.map(e=>{let t=e.loc?.join(".")||e.field||"field",a=e.msg||e.message||"validation error";return`${t}: ${a}`}).join("; ")||n),new a(n,e.status,t)}let t=e.headers.get("content-type");if(t&&t.includes("application/json"))return e.json();return e.text()}catch(n){if(n instanceof TypeError&&"Failed to fetch"===n.message){let n=(0,t.getApiBaseUrl)();throw new a(`Unable to connect to API server at ${n}. Please ensure the API server is running and the URL is correct.`,0,{originalError:"NetworkError",apiUrl:n,endpoint:e,suggestion:"Check your API server settings in the Settings page"})}throw n}}async function r(e){return n(e,{method:"GET"})}async function i(e,t){return n(e,{method:"POST",body:t?JSON.stringify(t):void 0})}async function o(e,t){return n(e,{method:"PUT",body:t?JSON.stringify(t):void 0})}async function l(e,n){let r=`${(0,t.getApiBaseUrl)()}${e}`,i=await fetch(r,{method:"POST",body:n});if(!i.ok){let e;try{e=await i.json()}catch{e={detail:i.statusText}}throw new a(e.detail||`API request failed: ${i.statusText}`,i.status,e)}let o=i.headers.get("content-type");return o&&o.includes("application/json")?i.json():i.text()}async function s(e){let n=`${(0,t.getApiBaseUrl)()}${e}`,r=await fetch(n,{method:"GET"});if(!r.ok){let e;try{e=await r.json()}catch{e={detail:r.statusText}}throw new a(e.detail||`API request failed: ${r.statusText}`,r.status,e)}return r.blob()}e.s(["ApiError",()=>a,"api",0,{contracts:{list:()=>r("/api/v1/contracts"),get:e=>r(`/api/v1/contracts/${e}`),parse:e=>i("/api/v1/contracts/parse",{contract:e}),parseFile:(e,t)=>{let a=new FormData;return a.append("file",e),void 0!==t&&a.append("validate",String(t)),l("/api/v1/contracts/parse/upload",a)},build:e=>i("/api/v1/contracts/build",e),buildFromId:(e,t)=>{let a=new URLSearchParams;t?.include_metadata!==void 0&&a.append("include_metadata",String(t.include_metadata)),t?.include_ownership!==void 0&&a.append("include_ownership",String(t.include_ownership)),t?.include_governance!==void 0&&a.append("include_governance",String(t.include_governance));let n=a.toString();return i(`/api/v1/contracts/${e}/build${n?`?${n}`:""}`,{})},createFromArtifacts:e=>i("/api/v1/contracts/create-from-artifacts",e),createMixed:e=>i("/api/v1/contracts/create-mixed",e),update:(e,t)=>o(`/api/v1/contracts/${e}`,t)},metadata:{listSchemas:()=>r("/api/v1/metadata/schemas"),getSchema:(e,t)=>{let a=t?`?version=${t}`:"";return r(`/api/v1/metadata/schemas/${e}${a}`)},getCompleteSchema:(e,t)=>{let a=t?`?version=${t}`:"";return r(`/api/v1/metadata/schemas/${e}/complete${a}`)},storeSchema:e=>i("/api/v1/metadata/schemas",e),getMetadata:(e,t)=>{let a=t?`?version=${t}`:"";return r(`/api/v1/metadata/metadata/${e}${a}`)},storeMetadata:e=>i("/api/v1/metadata/metadata",e),getCoercionRules:(e,t)=>{let a=t?`?version=${t}`:"";return r(`/api/v1/metadata/coercion-rules/${e}${a}`)},storeCoercionRules:e=>i("/api/v1/metadata/coercion-rules",e),getValidationRules:(e,t)=>{let a=t?`?version=${t}`:"";return r(`/api/v1/metadata/validation-rules/${e}${a}`)},storeValidationRules:e=>i("/api/v1/metadata/validation-rules",e),getEntityList:e=>r(`/api/v1/metadata/${e}`),createEntity:(e,t)=>i(`/api/v1/metadata/${e}`,t),updateEntity:(e,t,a)=>o(`/api/v1/metadata/${e}/${t}`,a),listArtifacts:()=>r("/api/v1/metadata/artifacts")},validation:{validate:e=>i("/api/v1/validation/validate",e),validateBatch:e=>i("/api/v1/validation/validate-batch",e)},schemas:{generate:e=>i("/api/v1/schemas/generate",e),convert:e=>i("/api/v1/schemas/convert",e)},quality:{listMetrics:e=>{let t=new URLSearchParams;e?.schema_id&&t.append("schema_id",e.schema_id),e?.limit&&t.append("limit",e.limit.toString()),e?.offset&&t.append("offset",e.offset.toString());let a=t.toString();return r(`/api/v1/quality/metrics${a?`?${a}`:""}`)},getMetric:e=>r(`/api/v1/quality/metrics/${e}`),getReport:(e,t)=>{let a=new URLSearchParams;t?.data_source&&a.append("data_source",t.data_source),t?.limit&&a.append("limit",t.limit.toString());let n=a.toString();return r(`/api/v1/quality/reports/${e}${n?`?${n}`:""}`)},check:e=>i("/api/v1/quality/check",e),checkUpload:(e,t)=>{let a=new FormData;return a.append("file",e),t.schema_id&&a.append("schema_id",t.schema_id),t.contract&&a.append("contract",t.contract),void 0!==t.record_violations&&a.append("record_violations",String(t.record_violations)),void 0!==t.calculate_metrics&&a.append("calculate_metrics",String(t.calculate_metrics)),void 0!==t.check_thresholds&&a.append("check_thresholds",String(t.check_thresholds)),t.thresholds&&a.append("thresholds",t.thresholds),void 0!==t.include_field_metrics&&a.append("include_field_metrics",String(t.include_field_metrics)),void 0!==t.sample_size&&a.append("sample_size",String(t.sample_size)),t.data_source&&a.append("data_source",t.data_source),t.data_version&&a.append("data_version",t.data_version),l("/api/v1/quality/check/upload",a)},queryViolations:e=>i("/api/v1/quality/violations",e)},templates:{downloadSchema:()=>s("/api/v1/templates/schema"),downloadContractArtifacts:()=>s("/api/v1/templates/contract-artifacts"),listEtlTemplates:()=>n("/api/v1/templates/etl"),downloadEtlTemplate:async e=>{let n=(0,t.getApiBaseUrl)().replace(/\/$/,""),r=await fetch(`${n}/api/v1/templates/etl/${encodeURIComponent(e)}`);if(!r.ok)throw new a(await r.text()||r.statusText,r.status);return r.text()}},settings:{testDatabase:e=>i("/api/v1/settings/test-database",e),testDlq:e=>i("/api/v1/settings/test-dlq",e),getDlqStats:e=>i("/api/v1/settings/dlq-stats",e)}}])},78583,e=>{"use strict";let t=(0,e.i(75254).default)("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"}]]);e.s(["FileText",()=>t],78583)},69074,e=>{"use strict";let t=(0,e.i(75254).default)("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);e.s(["Upload",()=>t],69074)},71921,e=>{"use strict";let t;var a=e.i(43476),n=e.i(71645);function r(e,t="Assertion error"){if(!e)throw Error(t)}function i({group:e}){let{orientation:t,panels:a}=e;return a.reduce((e,a)=>e+="horizontal"===t?a.element.offsetWidth:a.element.offsetHeight,0)}function o(e,t){return t.sort("horizontal"===e?l:s)}function l(e,t){let a=e.element.offsetLeft-t.element.offsetLeft;return 0!==a?a:e.element.offsetWidth-t.element.offsetWidth}function s(e,t){let a=e.element.offsetTop-t.element.offsetTop;return 0!==a?a:e.element.offsetHeight-t.element.offsetHeight}function d(e){return null!==e&&"object"==typeof e&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function u(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function c(e){let{element:t,orientation:a,panels:n,separators:l}=e,s=o(a,Array.from(t.children).filter(d).map(e=>({element:e}))).map(({element:e})=>e),c=[],p=!1,f,h=[];for(let t of s)if(t.hasAttribute("data-panel")){let o=n.find(e=>e.element===t);if(o){if(f){let n,l=f.element.getBoundingClientRect(),s=t.getBoundingClientRect();if(p){let e="horizontal"===a?new DOMRect(l.right,l.top,0,l.height):new DOMRect(l.left,l.bottom,l.width,0),t="horizontal"===a?new DOMRect(s.left,s.top,0,s.height):new DOMRect(s.left,s.top,s.width,0);switch(h.length){case 0:n=[e,t];break;case 1:{let i=h[0],o=function({orientation:e,rects:t,targetRect:a}){let n={x:a.x+a.width/2,y:a.y+a.height/2},i,o=Number.MAX_VALUE;for(let a of t){let{x:t,y:r}=u(n,a),l="horizontal"===e?t:r;l<o&&(o=l,i=a)}return r(i,"No rect found"),i}({orientation:a,rects:[l,s],targetRect:i.element.getBoundingClientRect()});n=[i,o===l?t:e];break}default:n=h}}else n=h.length?h:["horizontal"===a?new DOMRect(l.right,s.top,s.left-l.right,s.height):new DOMRect(s.left,l.bottom,s.width,s.top-l.bottom)];for(let t of n)c.push({group:e,groupSize:i({group:e}),panels:[f,o],separator:"width"in t?void 0:t,rect:"width"in t?t:t.element.getBoundingClientRect()})}p=!1,f=o,h=[]}}else if(t.hasAttribute("data-separator")){let e=l.find(e=>e.element===t);e?h.push(e):(f=void 0,h=[])}else p=!0;return c}function p({groupSize:e,panelElement:t,styleProp:a}){let n,[r,i]=function(e){switch(typeof e){case"number":return[e,"px"];case"string":{let t=parseFloat(e);return e.endsWith("%")?[t,"%"]:e.endsWith("px")?[t,"px"]:e.endsWith("rem")?[t,"rem"]:e.endsWith("em")?[t,"em"]:e.endsWith("vh")?[t,"vh"]:e.endsWith("vw")?[t,"vw"]:[t,"%"]}}}(a);switch(i){case"%":n=r/100*e;break;case"px":n=r;break;case"rem":n=r*parseFloat(getComputedStyle(t.ownerDocument.body).fontSize);break;case"em":n=r*parseFloat(getComputedStyle(t).fontSize);break;case"vh":n=r/100*window.innerHeight;break;case"vw":n=r/100*window.innerWidth}return n}function f(e){return parseFloat(e.toFixed(3))}function h(e){let{panels:t}=e,a=i({group:e});return 0===a?t.map(e=>({collapsedSize:0,collapsible:!0===e.panelConstraints.collapsible,defaultSize:void 0,minSize:0,maxSize:100,panelId:e.id})):t.map(e=>{let t,{element:n,panelConstraints:r}=e,i=0;void 0!==r.collapsedSize&&(i=f(p({groupSize:a,panelElement:n,styleProp:r.collapsedSize})/a*100)),void 0!==r.defaultSize&&(t=f(p({groupSize:a,panelElement:n,styleProp:r.defaultSize})/a*100));let o=0;void 0!==r.minSize&&(o=f(p({groupSize:a,panelElement:n,styleProp:r.minSize})/a*100));let l=100;return void 0!==r.maxSize&&(l=f(p({groupSize:a,panelElement:n,styleProp:r.maxSize})/a*100)),{collapsedSize:i,collapsible:!0===r.collapsible,defaultSize:t,minSize:o,maxSize:l,panelId:e.id}})}function m(e,t,a=0){return Math.abs(f(e)-f(t))<=a}let g={cursorFlags:0,interactionState:{state:"inactive"},mountedGroups:new Map},v=new class{#e={};addListener(e,t){let a=this.#e[e];return void 0===a?this.#e[e]=[t]:a.includes(t)||a.push(t),()=>{this.removeListener(e,t)}}emit(e,t){let a=this.#e[e];if(void 0!==a)if(1===a.length)a[0].call(null,t);else{let e=!1,n=null,r=Array.from(a);for(let a=0;a<r.length;a++){let i=r[a];try{i.call(null,t)}catch(t){null===n&&(e=!0,n=t)}}if(e)throw n}}removeAllListeners(){this.#e={}}removeListener(e,t){let a=this.#e[e];if(void 0!==a){let e=a.indexOf(t);e>=0&&a.splice(e,1)}}};function y(e){let t="function"==typeof e?e(g):e;if(g===t)return g;let a=g;return g={...g,...t},void 0!==t.cursorFlags&&v.emit("cursorFlagsChange",g.cursorFlags),void 0!==t.interactionState&&v.emit("interactionStateChange",g.interactionState),void 0!==t.mountedGroups&&(g.mountedGroups.forEach((e,t)=>{e.derivedPanelConstraints.forEach(n=>{if(n.collapsible){let{layout:r}=a.mountedGroups.get(t)??{};if(r){let a=m(n.collapsedSize,e.layout[n.panelId]),i=m(n.collapsedSize,r[n.panelId]);a&&!i&&(t.inMemoryLastExpandedPanelSizes[n.panelId]=r[n.panelId])}}})}),v.emit("mountedGroupsChange",g.mountedGroups)),g}function b(e,t){return m(e,t)?0:e>t?1:-1}function x({panelConstraints:e,size:t}){let{collapsedSize:a=0,collapsible:n,maxSize:r=100,minSize:i=0}=e;return 0>b(t,i)&&(t=n&&0>b(t,(a+i)/2)?a:i),f(t=Math.min(r,t))}function S({delta:e,initialLayout:t,panelConstraints:a,pivotIndices:n,prevLayout:i,trigger:o}){if(m(e,0))return t;let l=Object.values(t),s=Object.values(i),d=[...l],[u,c]=n;r(null!=u,"Invalid first pivot index"),r(null!=c,"Invalid second pivot index");let p=0;if("keyboard"===o){{let t=e<0?c:u,n=a[t];r(n,`Panel constraints not found for index ${t}`);let{collapsedSize:i=0,collapsible:o,minSize:s=0}=n;if(o){let a=l[t];if(r(null!=a,`Previous layout not found for panel index ${t}`),m(a,i)){let t=s-a;b(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}{let t=e<0?u:c,n=a[t];r(n,`No panel constraints found for index ${t}`);let{collapsedSize:i=0,collapsible:o,minSize:s=0}=n;if(o){let a=l[t];if(r(null!=a,`Previous layout not found for panel index ${t}`),m(a,s)){let t=a-i;b(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}}{let t=e<0?1:-1,n=e<0?c:u,i=0;for(;;){let e=l[n];if(r(null!=e,`Previous layout not found for panel index ${n}`),i+=x({panelConstraints:a[n],size:100})-e,(n+=t)<0||n>=a.length)break}let o=Math.min(Math.abs(e),Math.abs(i));e=e<0?0-o:o}{let t=e<0?u:c;for(;t>=0&&t<a.length;){let n=Math.abs(e)-Math.abs(p),i=l[t];r(null!=i,`Previous layout not found for panel index ${t}`);let o=i-n,s=x({panelConstraints:a[t],size:o});if(!m(i,s)&&(p+=i-s,d[t]=s,p.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?t--:t++}}if(function(e,t){if(e.length!==t.length)return!1;for(let a=0;a<e.length;a++)if(e[a]!=t[a])return!1;return!0}(s,d))return i;{let t=e<0?c:u,n=l[t];r(null!=n,`Previous layout not found for panel index ${t}`);let i=n+p,o=x({panelConstraints:a[t],size:i});if(d[t]=o,!m(o,i)){let t=i-o,n=e<0?c:u;for(;n>=0&&n<a.length;){let i=d[n];r(null!=i,`Previous layout not found for panel index ${n}`);let o=i+t,l=x({panelConstraints:a[n],size:o});if(m(i,l)||(t-=l-i,d[n]=l),m(t,0))break;e>0?n--:n++}}}if(!m(Object.values(d).reduce((e,t)=>t+e,0),100,.1))return i;let f=Object.keys(i);return d.reduce((e,t,a)=>(e[f[a]]=t,e),{})}function w(e){let{mountedGroups:t}=g;for(let[a]of t)if(a.separators.some(t=>t.element===e))return a;throw Error("Could not find parent Group for separator element")}function z(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let a in e)if(void 0===t[a]||0!==b(e[a],t[a]))return!1;return!0}function C({layout:e,panelConstraints:t}){let a=[...Object.values(e)],n=a.reduce((e,t)=>e+t,0);if(a.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${a.map(e=>`${e}%`).join(", ")}`);if(!m(n,100)&&a.length>0)for(let e=0;e<t.length;e++){let t=a[e];r(null!=t,`No layout data found for index ${e}`);let i=100/n*t;a[e]=i}let i=0;for(let e=0;e<t.length;e++){let n=a[e];r(null!=n,`No layout data found for index ${e}`);let o=x({panelConstraints:t[e],size:n});n!=o&&(i+=n-o,a[e]=o)}if(!m(i,0))for(let e=0;e<t.length;e++){let n=a[e];r(null!=n,`No layout data found for index ${e}`);let o=n+i,l=x({panelConstraints:t[e],size:o});if(n!==l&&(i-=l-n,a[e]=l,m(i,0)))break}let o=Object.keys(e);return a.reduce((e,t,a)=>(e[o[a]]=t,e),{})}function L({groupId:e}){let t=()=>{let{mountedGroups:t}=g;for(let[a,n]of t)if(a.id===e)return{group:a,...n};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){let{defaultLayoutDeferred:e,layout:a}=t();return e?{}:a},setLayout(e){let{defaultLayoutDeferred:a,derivedPanelConstraints:n,group:r,layout:i,separatorToPanels:o}=t(),l=C({layout:e,panelConstraints:n});return a?i:(z(i,l)||y(e=>({mountedGroups:new Map(e.mountedGroups).set(r,{defaultLayoutDeferred:a,derivedPanelConstraints:n,layout:l,separatorToPanels:o})})),l)}}}function P(e){let{mountedGroups:t}=g,a=t.get(e);return r(a,`Mounted Group ${e.id} not found`),a}function k(e,t){let a=w(e),n=P(a),i=a.separators.find(t=>t.element===e);r(i,"Matching separator not found");let o=n.separatorToPanels.get(i);r(o,"Matching panels not found");let l=o.map(e=>a.panels.indexOf(e)),s=L({groupId:a.id}).getLayout(),d=C({layout:S({delta:t,initialLayout:s,panelConstraints:n.derivedPanelConstraints,pivotIndices:l,prevLayout:s,trigger:"keyboard"}),panelConstraints:n.derivedPanelConstraints});z(s,d)||y(e=>({mountedGroups:new Map(e.mountedGroups).set(a,{defaultLayoutDeferred:n.defaultLayoutDeferred,derivedPanelConstraints:n.derivedPanelConstraints,layout:d,separatorToPanels:n.separatorToPanels})}))}function E(e){if(e.defaultPrevented)return;let t=e.currentTarget,a=w(t);if(!a.disabled)switch(e.key){case"ArrowDown":e.preventDefault(),"vertical"===a.orientation&&k(t,5);break;case"ArrowLeft":e.preventDefault(),"horizontal"===a.orientation&&k(t,-5);break;case"ArrowRight":e.preventDefault(),"horizontal"===a.orientation&&k(t,5);break;case"ArrowUp":e.preventDefault(),"vertical"===a.orientation&&k(t,-5);break;case"End":e.preventDefault(),k(t,100);break;case"Enter":{e.preventDefault();let a=w(t),{derivedPanelConstraints:n,layout:i,separatorToPanels:o}=P(a),l=a.separators.find(e=>e.element===t);r(l,"Matching separator not found");let s=o.get(l);r(s,"Matching panels not found");let d=s[0],u=n.find(e=>e.panelId===d.id);if(r(u,"Panel metadata not found"),u.collapsible){let e=i[d.id];k(t,(u.collapsedSize===e?a.inMemoryLastExpandedPanelSizes[d.id]??u.minSize:u.collapsedSize)-e)}break}case"F6":{e.preventDefault();let a=w(t).separators.map(e=>e.element),n=Array.from(a).findIndex(t=>t===e.currentTarget);r(null!==n,"Index not found");let i=e.shiftKey?n>0?n-1:a.length-1:n+1<a.length?n+1:0;a[i].focus();break}case"Home":e.preventDefault(),k(t,-100)}}let M=e=>e,R=()=>{},T=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function j(e){let t=e.length;for(;t--;){let a=e[t];if(r(a,"Missing node"),function(e){let t,a=getComputedStyle(e);return!!("fixed"===a.position||"auto"!==a.zIndex&&("static"!==a.position||"flex"===(t=getComputedStyle(I(e)??e).display)||"inline-flex"===t)||1>+a.opacity||"transform"in a&&"none"!==a.transform||"webkitTransform"in a&&"none"!==a.webkitTransform||"mixBlendMode"in a&&"normal"!==a.mixBlendMode||"filter"in a&&"none"!==a.filter||"webkitFilter"in a&&"none"!==a.webkitFilter||"isolation"in a&&"isolate"===a.isolation||T.test(a.willChange)||"touch"===a.webkitOverflowScrolling)}(a))return a}return null}function $(e){return e&&Number(getComputedStyle(e).zIndex)||0}function _(e){let t=[];for(;e;)t.push(e),e=I(e);return t}function I(e){let{parentNode:t}=e;return null!==t&&"object"==typeof t&&"nodeType"in t&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE?t.host:t}function G(e,a){let n=[];return a.forEach((a,i)=>{if(i.disabled)return;let o=(void 0===t&&(t="function"==typeof matchMedia&&!!matchMedia("(pointer:coarse)").matches),t)?10:5,l=c(i),s=function(e,t,a){let n,r={x:1/0,y:1/0};for(let i of t){let t=u(a,i.rect);switch(e){case"horizontal":t.x<=r.x&&(n=i,r=t);break;case"vertical":t.y<=r.y&&(n=i,r=t)}}return n?{distance:r,hitRegion:n}:void 0}(i.orientation,l,{x:e.clientX,y:e.clientY});s&&s.distance.x<=o&&s.distance.y<=o&&function({groupElement:e,hitRegion:t,pointerEventTarget:a}){if(!d(a)||a.contains(e)||e.contains(a))return!0;if(function(e,t){let a;if(e===t)throw Error("Cannot compare node with itself");let n={a:_(e),b:_(t)};for(;n.a.at(-1)===n.b.at(-1);)e=n.a.pop(),t=n.b.pop(),a=e;r(a,"Stacking order can only be calculated for elements with a common ancestor");let i={a:$(j(n.a)),b:$(j(n.b))};if(i.a===i.b){let e=a.childNodes,t={a:n.a.at(-1),b:n.b.at(-1)},r=e.length;for(;r--;){let a=e[r];if(a===t.a)return 1;if(a===t.b)return -1}}return Math.sign(i.a-i.b)}(a,e)>0){let r=a;for(;r;){var n;if(r.contains(e))break;if(n=r.getBoundingClientRect(),n.x<t.x+t.width&&n.x+n.width>t.x&&n.y<t.y+t.height&&n.y+n.height>t.y)return!1;r=r.parentElement}}return!0}({groupElement:i.element,hitRegion:s.hitRegion.rect,pointerEventTarget:e.target})&&n.push(s.hitRegion)}),n}function D(e){if(e.defaultPrevented||"mouse"===e.pointerType&&e.button>0)return;let{mountedGroups:t}=g,a=G(e,t),n=new Set,r=new Set,i=new Set,o=new Map,l=!1;a.forEach(e=>{n.add(e.group),e.panels.forEach(e=>{r.add(e)}),e.separator&&(i.add(e.separator),l||(l=!0,e.separator.element.focus()));let a=t.get(e.group);a&&o.set(e.group,a.layout)}),y({interactionState:{hitRegions:a,initialLayoutMap:o,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:"active"}}),a.length&&e.preventDefault()}let N=new WeakMap;function A(e){if(null===e.defaultView||void 0===e.defaultView)return;let{prevStyle:t,styleSheet:a}=N.get(e)??{};void 0===a&&(a=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets=[a]);let{cursorFlags:n,interactionState:r}=g;switch(r.state){case"active":case"hover":{let e=function({cursorFlags:e,groups:t,state:a}){let n=0,r=0;switch(a){case"active":case"hover":t.forEach(e=>{if(!e.disableCursor)switch(e.orientation){case"horizontal":n++;break;case"vertical":r++}})}if(0===n&&0===r)return null;if("active"===a){let t=(4&e)!=0,a=(8&e)!=0;if(e){if((1&e)!=0)return t?"se-resize":a?"ne-resize":"e-resize";if((2&e)!=0)return t?"sw-resize":a?"nw-resize":"w-resize";if(t)return"s-resize";if(a)return"n-resize"}}return n>0&&r>0?"move":n>0?"ew-resize":"ns-resize"}({cursorFlags:n,groups:r.hitRegions.map(e=>e.group),state:r.state}),i=`*{cursor: ${e} !important; ${"active"===r.state?"touch-action: none;":""} }`;if(t===i)return;t=i,e?0===a.cssRules.length?a.insertRule(i):a.replaceSync(i):1===a.cssRules.length&&a.deleteRule(0);break}case"inactive":t=void 0,1===a.cssRules.length&&a.deleteRule(0)}N.set(e,{prevStyle:t,styleSheet:a})}function O({document:e,event:t,hitRegions:a,initialLayoutMap:n,mountedGroups:r,pointerDownAtPoint:i}){let o=0,l=new Map(r);a.forEach(e=>{let{group:a,groupSize:s}=e,{disableCursor:d,orientation:u,panels:c}=a,p=0;p=i?"horizontal"===u?(t.clientX-i.x)/s*100:(t.clientY-i.y)/s*100:"horizontal"===u?t.clientX<0?-100:100:t.clientY<0?-100:100;let f=n.get(a),{defaultLayoutDeferred:h,derivedPanelConstraints:m,layout:g,separatorToPanels:v}=r.get(a)??{defaultLayoutDeferred:!1};if(m&&f&&g&&v){let t=S({delta:p,initialLayout:f,panelConstraints:m,pivotIndices:e.panels.map(e=>c.indexOf(e)),prevLayout:g,trigger:"mouse-or-touch"});if(z(t,g)){if(0!==p&&!d)switch(u){case"horizontal":o|=p<0?1:2;break;case"vertical":o|=p<0?4:8}}else{l.set(e.group,{defaultLayoutDeferred:h,derivedPanelConstraints:m,layout:t,separatorToPanels:v});let a=e.group.panels.map(({id:e})=>e).join(",");e.group.inMemoryLayouts[a]=t}}}),y({cursorFlags:o,mountedGroups:l}),A(e)}function F(e){let{interactionState:t,mountedGroups:a}=g;"active"===t.state&&O({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:a})}function W(e){if(e.defaultPrevented)return;let{interactionState:t,mountedGroups:a}=g;if("active"===t.state){if(0===e.buttons){y(e=>"inactive"===e.interactionState.state?e:{cursorFlags:0,interactionState:{state:"inactive"}}),y(e=>({mountedGroups:new Map(e.mountedGroups)}));return}O({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:a,pointerDownAtPoint:t.pointerDownAtPoint})}else{let n=G(e,a);0===n.length?"inactive"!==t.state&&y({interactionState:{state:"inactive"}}):y({interactionState:{hitRegions:n,state:"hover"}}),A(e.currentTarget)}}function U(e){if(e.defaultPrevented||"mouse"===e.pointerType&&e.button>0)return;let{interactionState:t}=g;"active"===t.state&&(y({cursorFlags:0,interactionState:{state:"inactive"}}),t.hitRegions.length>0&&(A(e.currentTarget),y(e=>({mountedGroups:new Map(e.mountedGroups)})),e.preventDefault()))}function q(e){let t=0,a=0,n={};for(let r of e)if(void 0!==r.defaultSize){t++;let e=f(r.defaultSize);a+=e,n[r.panelId]=e}else n[r.panelId]=void 0;let r=e.length-t;if(0!==r){let t=f((100-a)/r);for(let a of e)void 0===a.defaultSize&&(n[a.panelId]=t)}return n}let B=new Map;function H(){let[e,t]=(0,n.useState)({});return[e,(0,n.useCallback)(()=>t({}),[])]}function V(e){let t=(0,n.useId)();return`${e??t}`}let Y=n.useLayoutEffect;function X(e){let t=(0,n.useRef)(e);return Y(()=>{t.current=e},[e]),(0,n.useCallback)((...e)=>t.current?.(...e),[t])}function J(...e){return X(t=>{e.forEach(e=>{if(e)switch(typeof e){case"function":e(t);break;case"object":e.current=t}})})}let K=(0,n.createContext)(null);function Z({children:e,className:t,defaultLayout:l,disableCursor:s,disabled:d,elementRef:u,groupRef:p,id:m,onLayoutChange:b,onLayoutChanged:x,orientation:S="horizontal",style:w,...P}){var k;let R,T,j=(0,n.useRef)({onLayoutChange:{},onLayoutChanged:{}}),$=X(e=>{z(j.current.onLayoutChange,e)||(j.current.onLayoutChange=e,b?.(e))}),_=X(e=>{z(j.current.onLayoutChanged,e)||(j.current.onLayoutChanged=e,x?.(e))}),I=V(m),G=(0,n.useRef)(null),[N,A]=H(),O=(0,n.useRef)({lastExpandedPanelSizes:{},layouts:{},panels:[],separators:[]}),Z=J(G,u);R=(0,n.useRef)({getLayout:()=>({}),setLayout:M}),(0,n.useImperativeHandle)(p,()=>R.current,[]),Y(()=>{Object.assign(R.current,L({groupId:I}))});let Q=X((e,t)=>{let{interactionState:a,mountedGroups:n}=g;for(let r of n.keys())if(r.id===e){let e=n.get(r);if(e){let n=!1;return"active"===a.state&&(n=a.hitRegions.some(e=>e.group===r)),{flexGrow:e.layout[t]??1,pointerEvents:n?"none":void 0}}}return{flexGrow:l?.[t]??1}}),ee=(0,n.useMemo)(()=>({getPanelStyles:Q,id:I,orientation:S,registerPanel:e=>{let t=O.current;return t.panels=o(S,[...t.panels,e]),A(),()=>{t.panels=t.panels.filter(t=>t!==e),A()}},registerSeparator:e=>{let t=O.current;return t.separators=o(S,[...t.separators,e]),A(),()=>{t.separators=t.separators.filter(t=>t!==e),A()}}}),[Q,I,A,S]),et=(k={defaultLayout:l,disableCursor:s},T=(0,n.useRef)({...k}),Y(()=>{for(let e in k)T.current[e]=k[e]},[k]),T.current),ea=(0,n.useRef)(null);return Y(()=>{let e,t,a,n,o,l,s,u,p,m,b,x,w=G.current;if(null===w)return;let L=O.current,P={defaultLayout:et.defaultLayout,disableCursor:!!et.disableCursor,disabled:!!d,element:w,id:I,inMemoryLastExpandedPanelSizes:O.current.lastExpandedPanelSizes,inMemoryLayouts:O.current.layouts,orientation:S,panels:L.panels,separators:L.separators};ea.current=P;let k=(e=!0,r(P.element.ownerDocument.defaultView,"Cannot register an unmounted Group"),t=P.element.ownerDocument.defaultView.ResizeObserver,a=new Set,n=new Set,(o=new t(t=>{for(let a of t){let{borderBoxSize:t,target:n}=a;if(n===P.element){if(e){if(0===i({group:P}))return;y(e=>{let t=e.mountedGroups.get(P);if(t){let a=h(P),n=t.defaultLayoutDeferred?q(a):t.layout,r=C({layout:n,panelConstraints:a});return!t.defaultLayoutDeferred&&z(n,r)&&function(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let a in e)if(e[a]!==t[a])return!1;return!0}(t.derivedPanelConstraints,a)?e:{mountedGroups:new Map(e.mountedGroups).set(P,{defaultLayoutDeferred:!1,derivedPanelConstraints:a,layout:r,separatorToPanels:t.separatorToPanels})}}return e})}}else!function(e,t,a){if(!a[0])return;let n=e.panels.find(e=>e.element===t);if(!n||!n.onResize)return;let r=i({group:e}),o="horizontal"===e.orientation?n.element.offsetWidth:n.element.offsetHeight,l=n.mutableValues.prevSize,s={asPercentage:f(o/r*100),inPixels:o};n.mutableValues.prevSize=s,n.onResize(s,n.id,l)}(P,n,t)}})).observe(P.element),P.panels.forEach(e=>{r(!a.has(e.id),`Panel ids must be unique; id "${e.id}" was used more than once`),a.add(e.id),e.onResize&&o.observe(e.element)}),l=i({group:P}),s=h(P),u=P.panels.map(({id:e})=>e).join(","),(p=P.defaultLayout)&&(function(e,t){let a=e.map(e=>e.id),n=Object.keys(t);if(a.length!==n.length)return!1;for(let e of a)if(!n.includes(e))return!1;return!0}(P.panels,p)||(p=void 0)),m=C({layout:P.inMemoryLayouts[u]??p??q(s),panelConstraints:s}),b=c(P),x=P.element.ownerDocument,y(e=>{let t=new Map;return B.set(x,(B.get(x)??0)+1),b.forEach(e=>{e.separator&&t.set(e.separator,e.panels)}),{mountedGroups:new Map(e.mountedGroups).set(P,{defaultLayoutDeferred:0===l,derivedPanelConstraints:s,layout:m,separatorToPanels:t})}}),P.separators.forEach(e=>{r(!n.has(e.id),`Separator ids must be unique; id "${e.id}" was used more than once`),n.add(e.id),e.element.addEventListener("keydown",E)}),1===B.get(x)&&(x.addEventListener("pointerdown",D,!0),x.addEventListener("pointerleave",F),x.addEventListener("pointermove",W),x.addEventListener("pointerup",U,!0)),function(){e=!1,B.set(x,Math.max(0,(B.get(x)??0)-1)),y(e=>{let t=new Map(e.mountedGroups);return t.delete(P),{mountedGroups:t}}),P.separators.forEach(e=>{e.element.removeEventListener("keydown",E)}),B.get(x)||(x.removeEventListener("pointerdown",D,!0),x.removeEventListener("pointerleave",F),x.removeEventListener("pointermove",W),x.removeEventListener("pointerup",U,!0)),o.disconnect()}),M=g.mountedGroups.get(P);if(M){let{defaultLayoutDeferred:e,derivedPanelConstraints:t,layout:a}=M;!e&&t.length>0&&($(a),_(a),L.panels.forEach(e=>{e.scheduleUpdate()}))}let R=v.addListener("interactionStateChange",()=>{L.panels.forEach(e=>{e.scheduleUpdate()})}),T=v.addListener("mountedGroupsChange",e=>{let t=e.get(P);if(t){let{defaultLayoutDeferred:e,derivedPanelConstraints:a,layout:n}=t;if(e||0===a.length)return;let{interactionState:r}=g,i="active"!==r.state;$(n),i&&_(n),L.panels.forEach(e=>{e.scheduleUpdate()})}});return()=>{ea.current=null,k(),R(),T()}},[d,I,_,$,S,N,et]),(0,n.useEffect)(()=>{let e=ea.current;e&&(e.defaultLayout=l,e.disableCursor=!!s)}),(0,a.jsx)(K.Provider,{value:ee,children:(0,a.jsx)("div",{...P,"aria-orientation":S,className:t,"data-group":!0,"data-testid":I,id:I,ref:Z,style:{height:"100%",width:"100%",overflow:"hidden",...w,display:"flex",flexDirection:"horizontal"===S?"row":"column",flexWrap:"nowrap"},children:e})})}function Q(){let e=(0,n.useContext)(K);return r(e,"Group Context not found; did you render a Panel or Separator outside of a Group?"),e}function ee({children:e,className:t,collapsedSize:r="0%",collapsible:o=!1,defaultSize:l,elementRef:s,id:d,maxSize:u="100%",minSize:c="0%",onResize:p,panelRef:h,style:v,...b}){let x=!!d,w=V(d),L=(0,n.useRef)(null),P=J(L,s),[,k]=H(),{getPanelStyles:E,id:M,registerPanel:T}=Q(),j=null!==p,$=X((e,t,a)=>{p?.(e,d,a)});Y(()=>{let e=L.current;if(null!==e)return T({element:e,id:w,idIsStable:x,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:j?$:void 0,panelConstraints:{collapsedSize:r,collapsible:o,defaultSize:l,maxSize:u,minSize:c},scheduleUpdate:k})},[r,o,l,k,j,w,x,u,c,$,T]),function(e,t){let{id:a}=Q(),r=(0,n.useRef)({collapse:R,expand:R,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:R});(0,n.useImperativeHandle)(t,()=>r.current,[]),Y(()=>{Object.assign(r.current,function({groupId:e,panelId:t}){let a=()=>{let{mountedGroups:t}=g;for(let[a,{defaultLayoutDeferred:n,derivedPanelConstraints:r,layout:i,separatorToPanels:o}]of t)if(a.id===e)return{defaultLayoutDeferred:n,derivedPanelConstraints:r,group:a,layout:i,separatorToPanels:o};throw Error(`Group ${e} not found`)},n=()=>{let e=a().derivedPanelConstraints.find(e=>e.panelId===t);if(void 0!==e)return e;throw Error(`Panel constraints not found for Panel ${t}`)},r=()=>{let e=a().group.panels.find(e=>e.id===t);if(void 0!==e)return e;throw Error(`Layout not found for Panel ${t}`)},o=()=>{let e=a().layout[t];if(void 0!==e)return e;throw Error(`Layout not found for Panel ${t}`)},l=e=>{let n=o();if(e===n)return;let{defaultLayoutDeferred:r,derivedPanelConstraints:i,group:l,layout:s,separatorToPanels:d}=a(),u=l.panels.findIndex(e=>e.id===t),c=u===l.panels.length-1,p=C({layout:S({delta:c?n-e:e-n,initialLayout:s,panelConstraints:i,pivotIndices:c?[u-1,u]:[u,u+1],prevLayout:s,trigger:"imperative-api"}),panelConstraints:i});z(s,p)||y(e=>({mountedGroups:new Map(e.mountedGroups).set(l,{defaultLayoutDeferred:r,derivedPanelConstraints:i,layout:p,separatorToPanels:d})}))};return{collapse:()=>{let{collapsible:e,collapsedSize:t}=n(),{mutableValues:a}=r(),i=o();e&&i!==t&&(a.expandToSize=i,l(t))},expand:()=>{let{collapsible:e,collapsedSize:t,minSize:a}=n(),{mutableValues:i}=r(),s=o();if(e&&s===t){let e=i.expandToSize??a;0===e&&(e=1),l(e)}},getSize:()=>{let{group:e}=a(),t=o(),{element:n}=r();return{asPercentage:t,inPixels:"horizontal"===e.orientation?n.offsetWidth:n.offsetHeight}},isCollapsed:()=>{let{collapsible:e,collapsedSize:t}=n(),a=o();return e&&m(t,a)},resize:e=>{if(o()!==e){let t;switch(typeof e){case"number":{let{group:n}=a();t=f(e/i({group:n})*100);break}case"string":t=parseFloat(e)}l(t)}}}}({groupId:a,panelId:e}))})}(w,h);let _=E(M,w);return(0,a.jsx)("div",{...b,"data-panel":!0,"data-testid":w,id:w,ref:P,style:{...et,flexBasis:0,flexShrink:1,overflow:"hidden",..._},children:(0,a.jsx)("div",{className:t,style:{width:"100%",height:"100%",...v},children:e})})}Z.displayName="Group",ee.displayName="Panel";let et={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function ea({children:e,className:t,elementRef:r,id:i,style:o,...l}){let s=V(i),[d,u]=(0,n.useState)({}),[c,p]=(0,n.useState)("inactive"),f=(0,n.useRef)(null),h=J(f,r),{id:m,orientation:g,registerSeparator:y}=Q();return Y(()=>{let e=f.current;if(null!==e){let t={element:e,id:s},a=y(t),n=v.addListener("interactionStateChange",e=>{p("inactive"!==e.state&&e.hitRegions.some(e=>e.separator===t)?e.state:"inactive")}),r=v.addListener("mountedGroupsChange",e=>{e.forEach(({derivedPanelConstraints:e,layout:a,separatorToPanels:n},r)=>{if(r.id===m){let i=n.get(t);if(i){let t=i[0],n=r.panels.indexOf(t);u(function({layout:e,panelConstraints:t,panelId:a,panelIndex:n}){let r,i,o=e[a],l=t.find(e=>e.panelId===a);if(l){let s=l.maxSize,d=i=l.collapsible?l.collapsedSize:l.minSize,u=[n,n+1];i=C({layout:S({delta:d-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e,trigger:"keyboard"}),panelConstraints:t})[a],r=C({layout:S({delta:s-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e,trigger:"keyboard"}),panelConstraints:t})[a]}return{valueControls:a,valueMax:r,valueMin:i,valueNow:o}}({layout:a,panelConstraints:e,panelId:t.id,panelIndex:n}))}}})});return()=>{n(),r(),a()}}},[m,s,y]),(0,a.jsx)("div",{...l,"aria-controls":d.valueControls,"aria-orientation":"horizontal"===g?"vertical":"horizontal","aria-valuemax":d.valueMax,"aria-valuemin":d.valueMin,"aria-valuenow":d.valueNow,children:e,className:t,"data-separator":c,"data-testid":s,id:s,ref:h,role:"separator",style:{flexBasis:"auto",...o,flexGrow:0,flexShrink:0},tabIndex:0})}ea.displayName="Separator",e.s(["Group",()=>Z,"Panel",()=>ee,"Separator",()=>ea])},21713,e=>{"use strict";var t=e.i(43476),a=e.i(71645),n=e.i(71921),r=e.i(69074),i=e.i(78583);function o({title:e,value:n,onChange:o,templateOptions:l,onLoadTemplate:s,placeholder:d="# YAML configuration..."}){let u=(0,a.useRef)(null),[c,p]=(0,a.useState)(!1),[f,h]=(0,a.useState)(null),m=(0,a.useCallback)(async e=>{let t=e.target.value;if(t){p(!0),h(null);try{await s(t)}catch(e){h(e instanceof Error?e.message:"Failed to load template")}finally{p(!1),e.target.value=""}}},[s]),g=(0,a.useCallback)(e=>{let t=e.target.files?.[0];if(!t)return;let a=new FileReader;a.onload=e=>{o(e.target?.result??"")},a.readAsText(t),e.target.value=""},[o]);return(0,t.jsxs)("div",{style:{width:"100%",height:"100%",display:"flex",flexDirection:"column",minWidth:0,minHeight:0,overflow:"hidden"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 1rem",height:"3rem",borderBottom:"1px solid #e5e7eb",flexShrink:0,minWidth:0,gap:"0.5rem"},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem",minWidth:0},children:[(0,t.jsx)(i.FileText,{style:{height:"1rem",width:"1rem",color:"#6b7280",flexShrink:0}}),(0,t.jsx)("span",{style:{fontSize:"0.875rem",fontWeight:500},children:e}),c&&(0,t.jsx)("span",{style:{fontSize:"0.75rem",color:"#6b7280"},children:"Loading..."}),f&&(0,t.jsx)("span",{style:{fontSize:"0.75rem",color:"#dc2626",overflow:"hidden",textOverflow:"ellipsis"},children:f})]}),(0,t.jsxs)("div",{style:{display:"flex",gap:"0.5rem",flexShrink:0},children:[(0,t.jsxs)("select",{onChange:m,disabled:c||0===l.length,style:{height:"1.75rem",fontSize:"0.75rem",padding:"0 0.5rem",border:"1px solid #e5e7eb",borderRadius:"0.375rem",backgroundColor:"transparent",cursor:c||0===l.length?"not-allowed":"pointer",maxWidth:"12rem"},defaultValue:"",title:"Load from template",children:[(0,t.jsx)("option",{value:"",children:"Load template..."}),l.map(e=>(0,t.jsx)("option",{value:e,children:e},e))]}),(0,t.jsxs)("button",{type:"button",onClick:()=>u.current?.click(),style:{height:"1.75rem",fontSize:"0.75rem",padding:"0 0.5rem",border:"1px solid #e5e7eb",borderRadius:"0.375rem",backgroundColor:"transparent",cursor:"pointer",display:"flex",alignItems:"center"},children:[(0,t.jsx)(r.Upload,{style:{height:"0.75rem",width:"0.75rem",marginRight:"0.25rem"}}),"Load from file"]}),(0,t.jsx)("input",{ref:u,type:"file",accept:".yaml,.yml,.json",onChange:g,style:{display:"none"}})]})]}),(0,t.jsx)("div",{style:{flex:1,overflow:"hidden",position:"relative",minWidth:0,minHeight:0},children:(0,t.jsx)("textarea",{value:n,onChange:e=>o(e.target.value),style:{width:"100%",height:"100%",padding:"1rem",fontFamily:"monospace",fontSize:"0.875rem",border:"none",outline:"none",resize:"none",backgroundColor:"transparent",color:"inherit",boxSizing:"border-box"},placeholder:d,spellCheck:!1})})]})}var l=e.i(9165);function s(){let[e,r]=(0,a.useState)(""),[i,s]=(0,a.useState)(""),[d,u]=(0,a.useState)(""),[c,p]=(0,a.useState)([]),[f,h]=(0,a.useState)(null);(0,a.useEffect)(()=>{let e=!1;return l.api.templates.listEtlTemplates().then(t=>{!e&&t.templates&&(p(t.templates),h(null))}).catch(t=>{e||(p([]),h(t instanceof Error?t.message:"Failed to load template list"))}),()=>{e=!0}},[]);let m=c.filter(e=>e.startsWith("extract_")&&(e.endsWith(".yaml")||e.endsWith(".yml"))),g=c.filter(e=>e.startsWith("transform_")&&(e.endsWith(".yaml")||e.endsWith(".yml"))),v=c.filter(e=>e.startsWith("load_")&&(e.endsWith(".yaml")||e.endsWith(".yml"))),y=(0,a.useCallback)(async e=>{r(await l.api.templates.downloadEtlTemplate(e))},[]),b=(0,a.useCallback)(async e=>{s(await l.api.templates.downloadEtlTemplate(e))},[]),x=(0,a.useCallback)(async e=>{u(await l.api.templates.downloadEtlTemplate(e))},[]);return(0,t.jsxs)("div",{className:"flex flex-col h-full bg-background",children:[f&&0===c.length&&(0,t.jsxs)("div",{className:"border-b border-amber-200 bg-amber-50 dark:bg-amber-950/20 dark:border-amber-800 px-4 py-1.5 text-sm text-amber-800 dark:text-amber-200 flex-shrink-0",role:"status",children:["Templates could not be loaded (",f,"). You can still type or paste YAML, or load from a local file."]}),(0,t.jsxs)(n.Group,{orientation:"horizontal",className:"flex-1 min-h-0",children:[(0,t.jsx)(n.Panel,{defaultSize:33,minSize:15,children:(0,t.jsx)("div",{className:"flex flex-col h-full",children:(0,t.jsx)(o,{title:"Extract",value:e,onChange:r,templateOptions:m,onLoadTemplate:y,placeholder:"# extract.yaml — source_type, base_url, api_endpoint, file_path, etc."})})}),(0,t.jsx)(n.Separator,{className:"w-1 bg-gray-300 hover:bg-blue-500 transition-colors"}),(0,t.jsx)(n.Panel,{defaultSize:34,minSize:15,children:(0,t.jsx)("div",{className:"flex flex-col h-full",children:(0,t.jsx)(o,{title:"Transform",value:i,onChange:s,templateOptions:g,onLoadTemplate:b,placeholder:"# transform.yaml — transform, jsonata, custom_function"})})}),(0,t.jsx)(n.Separator,{className:"w-1 bg-gray-300 hover:bg-blue-500 transition-colors"}),(0,t.jsx)(n.Panel,{defaultSize:33,minSize:15,children:(0,t.jsx)("div",{className:"flex flex-col h-full",children:(0,t.jsx)(o,{title:"Load",value:d,onChange:u,templateOptions:v,onLoadTemplate:x,placeholder:"# load.yaml — destination_type, target_table, file_path, storage, etc."})})})]})]})}function d(){return(0,t.jsxs)("div",{className:"min-h-screen bg-background",children:[(0,t.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 pt-6 pb-1",children:(0,t.jsxs)("div",{className:"mb-1",children:[(0,t.jsx)("h1",{className:"text-2xl font-bold text-foreground mb-1",children:"ETL"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"Specify or load extraction, transformation, and load configuration (extract.yaml, transform.yaml, load.yaml)"})]})}),(0,t.jsx)("div",{className:"w-full px-2",style:{height:"calc(100vh - 6rem)"},children:(0,t.jsx)(s,{})})]})}e.s(["default",()=>d],21713)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,55824,16370,e=>{"use strict";var t=e.i(43476);function a({title:e,description:a,actions:s}){return(0,t.jsxs)("div",{className:"mb-4 flex justify-between items-center",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"text-2xl font-bold text-foreground mb-1",children:e}),a&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:a})]}),s&&(0,t.jsx)("div",{className:"flex gap-2",children:s})]})}e.s(["PageHeader",()=>a],16370),e.s([],55824)},61246,e=>{"use strict";var t=e.i(43476),a=e.i(75157);function s({className:e,...s}){return(0,t.jsx)("div",{className:(0,a.cn)("animate-pulse rounded-md bg-muted",e),...s})}function i({size:e="md",className:s}){return(0,t.jsx)("div",{className:(0,a.cn)("flex items-center justify-center",s),children:(0,t.jsx)("div",{className:(0,a.cn)("animate-spin rounded-full border-2 border-muted border-t-primary",{sm:"h-4 w-4",md:"h-8 w-8",lg:"h-12 w-12"}[e])})})}function r({message:e="Loading..."}){return(0,t.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-background",children:(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)(i,{size:"lg",className:"mb-4"}),(0,t.jsx)("p",{className:"text-muted-foreground",children:e})]})})}function l(){return(0,t.jsxs)("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[(0,t.jsx)(s,{className:"h-6 w-3/4"}),(0,t.jsx)(s,{className:"h-4 w-full"}),(0,t.jsx)(s,{className:"h-4 w-5/6"}),(0,t.jsxs)("div",{className:"flex gap-2 mt-4",children:[(0,t.jsx)(s,{className:"h-9 w-20"}),(0,t.jsx)(s,{className:"h-9 w-20"})]})]})}function n({rows:e=5}){return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(s,{className:"h-10 w-full"}),Array.from({length:e}).map((e,a)=>(0,t.jsx)(s,{className:"h-12 w-full"},a))]})}e.s(["CardSkeleton",()=>l,"PageLoading",()=>r,"TableSkeleton",()=>n,"default",()=>i],61246)},43668,e=>{"use strict";var t=e.i(47167);let a="pycharter_settings",s={apiServer:{url:t.default.env.NEXT_PUBLIC_API_URL||"http://localhost:8000"},database:{enabled:!1},dlq:{enabled:!1}};function i(){try{let e=localStorage.getItem(a);if(e){let t=JSON.parse(e);return{...s,...t,apiServer:{...s.apiServer,...t.apiServer},database:{...s.database,...t.database},dlq:{...s.dlq,...t.dlq}}}}catch(e){console.error("Failed to load settings:",e)}return s}function r(e){try{localStorage.setItem(a,JSON.stringify(e))}catch(e){throw console.error("Failed to save settings:",e),e}}function l(){return i().apiServer.url||s.apiServer.url}e.s(["getApiBaseUrl",()=>l,"getSettings",()=>i,"saveSettings",()=>r])},9165,e=>{"use strict";var t=e.i(43668);class a extends Error{status;response;constructor(e,t,a){super(e),this.status=t,this.response=a,this.name="ApiError"}}async function s(e,s){let i=`${(0,t.getApiBaseUrl)()}${e}`;try{let e=await fetch(i,{...s,headers:{"Content-Type":"application/json",...s?.headers}});if(!e.ok){let t;try{t=await e.json()}catch{t={detail:e.statusText}}let s=t.detail||`API request failed: ${e.statusText}`;throw 422===e.status&&t.details&&Array.isArray(t.details)&&(s=t.details.map(e=>{let t=e.loc?.join(".")||e.field||"field",a=e.msg||e.message||"validation error";return`${t}: ${a}`}).join("; ")||s),new a(s,e.status,t)}let t=e.headers.get("content-type");if(t&&t.includes("application/json"))return e.json();return e.text()}catch(s){if(s instanceof TypeError&&"Failed to fetch"===s.message){let s=(0,t.getApiBaseUrl)();throw new a(`Unable to connect to API server at ${s}. Please ensure the API server is running and the URL is correct.`,0,{originalError:"NetworkError",apiUrl:s,endpoint:e,suggestion:"Check your API server settings in the Settings page"})}throw s}}async function i(e){return s(e,{method:"GET"})}async function r(e,t){return s(e,{method:"POST",body:t?JSON.stringify(t):void 0})}async function l(e,t){return s(e,{method:"PUT",body:t?JSON.stringify(t):void 0})}async function n(e,s){let i=`${(0,t.getApiBaseUrl)()}${e}`,r=await fetch(i,{method:"POST",body:s});if(!r.ok){let e;try{e=await r.json()}catch{e={detail:r.statusText}}throw new a(e.detail||`API request failed: ${r.statusText}`,r.status,e)}let l=r.headers.get("content-type");return l&&l.includes("application/json")?r.json():r.text()}async function d(e){let s=`${(0,t.getApiBaseUrl)()}${e}`,i=await fetch(s,{method:"GET"});if(!i.ok){let e;try{e=await i.json()}catch{e={detail:i.statusText}}throw new a(e.detail||`API request failed: ${i.statusText}`,i.status,e)}return i.blob()}e.s(["ApiError",()=>a,"api",0,{contracts:{list:()=>i("/api/v1/contracts"),get:e=>i(`/api/v1/contracts/${e}`),parse:e=>r("/api/v1/contracts/parse",{contract:e}),parseFile:(e,t)=>{let a=new FormData;return a.append("file",e),void 0!==t&&a.append("validate",String(t)),n("/api/v1/contracts/parse/upload",a)},build:e=>r("/api/v1/contracts/build",e),buildFromId:(e,t)=>{let a=new URLSearchParams;t?.include_metadata!==void 0&&a.append("include_metadata",String(t.include_metadata)),t?.include_ownership!==void 0&&a.append("include_ownership",String(t.include_ownership)),t?.include_governance!==void 0&&a.append("include_governance",String(t.include_governance));let s=a.toString();return r(`/api/v1/contracts/${e}/build${s?`?${s}`:""}`,{})},createFromArtifacts:e=>r("/api/v1/contracts/create-from-artifacts",e),createMixed:e=>r("/api/v1/contracts/create-mixed",e),update:(e,t)=>l(`/api/v1/contracts/${e}`,t)},metadata:{listSchemas:()=>i("/api/v1/metadata/schemas"),getSchema:(e,t)=>{let a=t?`?version=${t}`:"";return i(`/api/v1/metadata/schemas/${e}${a}`)},getCompleteSchema:(e,t)=>{let a=t?`?version=${t}`:"";return i(`/api/v1/metadata/schemas/${e}/complete${a}`)},storeSchema:e=>r("/api/v1/metadata/schemas",e),getMetadata:(e,t)=>{let a=t?`?version=${t}`:"";return i(`/api/v1/metadata/metadata/${e}${a}`)},storeMetadata:e=>r("/api/v1/metadata/metadata",e),getCoercionRules:(e,t)=>{let a=t?`?version=${t}`:"";return i(`/api/v1/metadata/coercion-rules/${e}${a}`)},storeCoercionRules:e=>r("/api/v1/metadata/coercion-rules",e),getValidationRules:(e,t)=>{let a=t?`?version=${t}`:"";return i(`/api/v1/metadata/validation-rules/${e}${a}`)},storeValidationRules:e=>r("/api/v1/metadata/validation-rules",e),getEntityList:e=>i(`/api/v1/metadata/${e}`),createEntity:(e,t)=>r(`/api/v1/metadata/${e}`,t),updateEntity:(e,t,a)=>l(`/api/v1/metadata/${e}/${t}`,a),listArtifacts:()=>i("/api/v1/metadata/artifacts")},validation:{validate:e=>r("/api/v1/validation/validate",e),validateBatch:e=>r("/api/v1/validation/validate-batch",e)},schemas:{generate:e=>r("/api/v1/schemas/generate",e),convert:e=>r("/api/v1/schemas/convert",e)},quality:{listMetrics:e=>{let t=new URLSearchParams;e?.schema_id&&t.append("schema_id",e.schema_id),e?.limit&&t.append("limit",e.limit.toString()),e?.offset&&t.append("offset",e.offset.toString());let a=t.toString();return i(`/api/v1/quality/metrics${a?`?${a}`:""}`)},getMetric:e=>i(`/api/v1/quality/metrics/${e}`),getReport:(e,t)=>{let a=new URLSearchParams;t?.data_source&&a.append("data_source",t.data_source),t?.limit&&a.append("limit",t.limit.toString());let s=a.toString();return i(`/api/v1/quality/reports/${e}${s?`?${s}`:""}`)},check:e=>r("/api/v1/quality/check",e),checkUpload:(e,t)=>{let a=new FormData;return a.append("file",e),t.schema_id&&a.append("schema_id",t.schema_id),t.contract&&a.append("contract",t.contract),void 0!==t.record_violations&&a.append("record_violations",String(t.record_violations)),void 0!==t.calculate_metrics&&a.append("calculate_metrics",String(t.calculate_metrics)),void 0!==t.check_thresholds&&a.append("check_thresholds",String(t.check_thresholds)),t.thresholds&&a.append("thresholds",t.thresholds),void 0!==t.include_field_metrics&&a.append("include_field_metrics",String(t.include_field_metrics)),void 0!==t.sample_size&&a.append("sample_size",String(t.sample_size)),t.data_source&&a.append("data_source",t.data_source),t.data_version&&a.append("data_version",t.data_version),n("/api/v1/quality/check/upload",a)},queryViolations:e=>r("/api/v1/quality/violations",e)},templates:{downloadSchema:()=>d("/api/v1/templates/schema"),downloadContractArtifacts:()=>d("/api/v1/templates/contract-artifacts"),listEtlTemplates:()=>s("/api/v1/templates/etl"),downloadEtlTemplate:async e=>{let s=(0,t.getApiBaseUrl)().replace(/\/$/,""),i=await fetch(`${s}/api/v1/templates/etl/${encodeURIComponent(e)}`);if(!i.ok)throw new a(await i.text()||i.statusText,i.status);return i.text()}},settings:{testDatabase:e=>r("/api/v1/settings/test-database",e),testDlq:e=>r("/api/v1/settings/test-dlq",e),getDlqStats:e=>r("/api/v1/settings/dlq-stats",e)}}])},63209,e=>{"use strict";let t=(0,e.i(75254).default)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);e.s(["AlertCircle",()=>t],63209)},95113,e=>{"use strict";var t=e.i(43476),a=e.i(63209),s=e.i(9165),i=e.i(75157);function r({error:e,title:r="Error",className:l}){if(!e)return null;let n=e instanceof s.ApiError,d=n?e.message:e.message||"An unexpected error occurred";return(0,t.jsx)("div",{className:(0,i.cn)("rounded-lg border border-destructive/50 bg-destructive/10 p-4",l),children:(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)(a.AlertCircle,{className:"h-5 w-5 text-destructive flex-shrink-0 mt-0.5"}),(0,t.jsxs)("div",{className:"ml-3",children:[(0,t.jsx)("h3",{className:"text-sm font-medium text-destructive",children:r}),(0,t.jsxs)("div",{className:"mt-2 text-sm text-destructive/90",children:[(0,t.jsx)("p",{children:d}),n&&e.status&&(0,t.jsxs)("p",{className:"mt-1 text-xs opacity-75",children:["Status: ",e.status]})]})]})]})})}e.s(["default",()=>r])},88511,e=>{"use strict";let t=(0,e.i(75254).default)("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);e.s(["Edit",()=>t],88511)},56909,e=>{"use strict";let t=(0,e.i(75254).default)("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);e.s(["Save",()=>t],56909)},37727,7233,e=>{"use strict";var t=e.i(75254);let a=(0,t.default)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);e.s(["X",()=>a],37727);let s=(0,t.default)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);e.s(["Plus",()=>s],7233)},66597,e=>{"use strict";var t=e.i(43476),a=e.i(71645),s=e.i(15288),i=e.i(19455),r=e.i(61246),l=e.i(95113);e.i(55824);var n=e.i(16370),d=e.i(37727),c=e.i(56909),o=e.i(9165);function m({isOpen:e,entityType:s,entityData:n,onClose:m,onSuccess:p}){var u;let[h,y]=(0,a.useState)({}),[x,v]=(0,a.useState)(!1),[g,f]=(0,a.useState)(null);(0,a.useEffect)(()=>{e&&(n?y(n):y(b(s)),f(null))},[e,n,s]);let b=e=>({owners:{id:"",name:"",email:"",team:""},domains:{name:"",description:""},systems:{name:"",app_id:"",description:""},environments:{name:"",description:"",environment_type:"",is_production:!1},storage_locations:{name:"",location_type:"",database:"",table_name:"",schema_name:""},tags:{name:"",description:"",category:"",color:""}})[e]||{},j=(e,t)=>{y(a=>({...a,[e]:t}))},k=async e=>{e.preventDefault(),v(!0),f(null);try{if(n){let e=n.id;await o.api.metadata.updateEntity(s,e,h)}else await o.api.metadata.createEntity(s,h);p(),m()}catch(e){f(e.message||"Failed to save entity")}finally{v(!1)}};if(!e)return null;let N={owners:[{key:"id",label:"ID",type:"text",required:!0},{key:"name",label:"Name",type:"text"},{key:"email",label:"Email",type:"email"},{key:"team",label:"Team",type:"text"}],domains:[{key:"name",label:"Name",type:"text",required:!0},{key:"description",label:"Description",type:"textarea"}],systems:[{key:"name",label:"Name",type:"text",required:!0},{key:"app_id",label:"App ID",type:"text"},{key:"description",label:"Description",type:"textarea"}],environments:[{key:"name",label:"Name",type:"text",required:!0},{key:"description",label:"Description",type:"textarea"},{key:"environment_type",label:"Type",type:"text"},{key:"is_production",label:"Is Production",type:"checkbox"}],storage_locations:[{key:"name",label:"Name",type:"text",required:!0},{key:"location_type",label:"Location Type",type:"text"},{key:"database",label:"Database",type:"text"},{key:"table_name",label:"Table Name",type:"text"},{key:"schema_name",label:"Schema Name",type:"text"},{key:"cluster",label:"Cluster",type:"text"}],tags:[{key:"name",label:"Name",type:"text",required:!0},{key:"description",label:"Description",type:"textarea"},{key:"category",label:"Category",type:"text"},{key:"color",label:"Color (Hex)",type:"text"}]}[s]||[],w=!!n;return(0,t.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:(0,t.jsxs)("div",{className:"bg-background border rounded-lg shadow-lg w-full max-w-2xl max-h-[90vh] overflow-hidden flex flex-col",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between p-4 border-b",children:[(0,t.jsxs)("h2",{className:"text-xl font-semibold",children:[w?"Edit":"Create"," ",{owners:"Owner",domains:"Domain",systems:"System",environments:"Environment",storage_locations:"Storage Location",tags:"Tag"}[u=s]||u]}),(0,t.jsx)("button",{onClick:m,className:"p-1 rounded-md hover:bg-muted","aria-label":"Close",children:(0,t.jsx)(d.X,{className:"h-5 w-5"})})]}),(0,t.jsxs)("form",{onSubmit:k,className:"flex-1 overflow-y-auto p-4",children:[g&&(0,t.jsx)("div",{className:"mb-4",children:(0,t.jsx)(l.default,{error:Error(g),title:"Error saving entity"})}),(0,t.jsx)("div",{className:"space-y-4",children:N.map(e=>w&&"id"===e.key&&"owners"===s?(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-sm font-medium mb-1",children:e.label}),(0,t.jsx)("input",{type:"text",value:h[e.key]||"",disabled:!0,className:"w-full px-3 py-2 border rounded-md bg-muted"})]},e.key):"textarea"===e.type?(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"block text-sm font-medium mb-1",children:[e.label,e.required&&(0,t.jsx)("span",{className:"text-red-500 ml-1",children:"*"})]}),(0,t.jsx)("textarea",{value:h[e.key]||"",onChange:t=>j(e.key,t.target.value),required:e.required,rows:3,className:"w-full px-3 py-2 border rounded-md"})]},e.key):"checkbox"===e.type?(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("input",{type:"checkbox",checked:h[e.key]||!1,onChange:t=>j(e.key,t.target.checked),className:"h-4 w-4"}),(0,t.jsxs)("label",{className:"text-sm font-medium",children:[e.label,e.required&&(0,t.jsx)("span",{className:"text-red-500 ml-1",children:"*"})]})]},e.key):(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"block text-sm font-medium mb-1",children:[e.label,e.required&&(0,t.jsx)("span",{className:"text-red-500 ml-1",children:"*"})]}),(0,t.jsx)("input",{type:e.type,value:h[e.key]||"",onChange:t=>j(e.key,t.target.value),required:e.required,className:"w-full px-3 py-2 border rounded-md"})]},e.key))}),(0,t.jsxs)("div",{className:"flex justify-end gap-2 mt-6 pt-4 border-t",children:[(0,t.jsx)(i.Button,{type:"button",variant:"outline",onClick:m,disabled:x,children:"Cancel"}),(0,t.jsx)(i.Button,{type:"submit",disabled:x,children:x?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"mr-2",children:(0,t.jsx)(r.default,{size:"sm"})}),"Saving..."]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(c.Save,{className:"mr-2 h-4 w-4"}),w?"Update":"Create"]})})]})]})]})})}var p=e.i(75254);let u=(0,p.default)("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]),h=(0,p.default)("Building2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]),y=(0,p.default)("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"}]]),x=(0,p.default)("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]),v=(0,p.default)("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]),g=(0,p.default)("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]);var f=e.i(88511),b=e.i(7233),j=e.i(75157);let k=[{id:"owners",name:"Owners",icon:u},{id:"domains",name:"Domains",icon:y},{id:"systems",name:"Systems",icon:x},{id:"environments",name:"Environments",icon:h},{id:"storage_locations",name:"Storage Locations",icon:g},{id:"tags",name:"Tags",icon:v}];function N(){let[e,d]=(0,a.useState)(null),[c,p]=(0,a.useState)([]),[u,h]=(0,a.useState)(!1),[y,x]=(0,a.useState)(null),[v,g]=(0,a.useState)(null),[N,w]=(0,a.useState)(!1),_=async e=>{h(!0),x(null);try{let t=await o.api.metadata.getEntityList(e);p(Array.isArray(t)?t:[])}catch(e){404===e.status?(p([]),x(null)):(x(e.message||"Failed to load data"),p([]))}finally{h(!1)}};(0,a.useEffect)(()=>{e?_(e):p([])},[e]);let S=(e,t)=>{if(t.length>0){let a=Object.keys(t[0]),s={owners:["id","name","email","team"],domains:["id","name","description"],systems:["id","name","app_id","description"],environments:["id","name","environment_type","is_production"],storage_locations:["id","name","location_type","database","table_name","system_name","environment_name"],tags:["id","name","category","color","description"]}[e]||[],i=a.filter(e=>!s.includes(e)&&"created_at"!==e&&"updated_at"!==e&&"additional_metadata"!==e);return[...s.filter(e=>a.includes(e)),...i]}return({owners:["id","name","email","team"],domains:["id","name","description"],systems:["id","name","app_id","description"],environments:["id","name","environment_type","is_production"],storage_locations:["id","name","location_type","database","table_name"],tags:["id","name","category","color"]})[e]||[]};return(0,t.jsx)("div",{className:"min-h-screen bg-background",children:(0,t.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-6",children:[(0,t.jsx)(n.PageHeader,{title:"Metadata",description:"Manage metadata entities and relationships"}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2 mb-6",children:k.map(a=>{let s=a.icon,i=e===a.id;return(0,t.jsxs)("button",{onClick:()=>{var t;e===(t=a.id)?d(null):d(t)},className:(0,j.cn)("flex items-center gap-2 px-4 py-2 rounded-md border transition-colors","hover:bg-muted focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2",i?"bg-primary text-primary-foreground border-primary":"bg-background text-foreground border-border"),children:[(0,t.jsx)(s,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"text-sm font-medium",children:a.name})]},a.id)})}),e&&(0,t.jsxs)(s.Card,{children:[(0,t.jsx)(s.CardHeader,{children:(0,t.jsxs)("div",{className:"flex justify-between items-center",children:[(0,t.jsxs)(s.CardTitle,{className:"text-lg",children:[k.find(t=>t.id===e)?.name," Data"]}),(0,t.jsxs)(i.Button,{onClick:()=>{g(null),w(!0)},size:"sm",children:[(0,t.jsx)(b.Plus,{className:"h-4 w-4 mr-2"}),"Create"]})]})}),(0,t.jsxs)(s.CardContent,{children:[u&&(0,t.jsx)(r.PageLoading,{message:"Loading data..."}),y&&(0,t.jsx)("div",{className:"mb-4",children:(0,t.jsx)(l.default,{error:Error(y),title:"Failed to load data"})}),!u&&!y&&0===c.length&&(0,t.jsxs)("div",{className:"text-center py-8 text-muted-foreground",children:[(0,t.jsxs)("p",{children:["No data available for ",k.find(t=>t.id===e)?.name,"."]}),(0,t.jsx)("p",{className:"text-xs mt-2",children:"API endpoint may not be implemented yet."})]}),!u&&!y&&c.length>0&&(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)("table",{className:"w-full border-collapse",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{className:"border-b bg-muted/50",children:[S(e,c).map(e=>(0,t.jsx)("th",{className:"px-4 py-2 text-left text-sm font-semibold text-foreground",children:e.split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")},e)),(0,t.jsx)("th",{className:"px-4 py-2 text-left text-sm font-semibold text-foreground w-16",children:"Actions"})]})}),(0,t.jsx)("tbody",{children:c.map((a,s)=>(0,t.jsxs)("tr",{className:"hover:bg-muted/50",children:[S(e,c).map(e=>{let s=a[e];return(0,t.jsx)("td",{className:"px-4 py-2 text-sm border-b",children:null==s?"-":"boolean"==typeof s?s?"Yes":"No":"object"==typeof s?JSON.stringify(s):String(s)},e)}),(0,t.jsx)("td",{className:"px-4 py-2 text-sm border-b",children:(0,t.jsx)(i.Button,{variant:"ghost",size:"sm",onClick:()=>{g(a)},className:"h-8 w-8 p-0",title:"Edit",children:(0,t.jsx)(f.Edit,{className:"h-4 w-4"})})})]},s))})]})})]})]}),(v||N)&&e&&(0,t.jsx)(m,{isOpen:!0,entityType:e,entityData:v,onClose:()=>{g(null),w(!1)},onSuccess:()=>{e&&_(e)}})]})})}e.s(["default",()=>N],66597)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,43668,e=>{"use strict";var a=e.i(47167);let t="pycharter_settings",s={apiServer:{url:a.default.env.NEXT_PUBLIC_API_URL||"http://localhost:8000"},database:{enabled:!1},dlq:{enabled:!1}};function r(){try{let e=localStorage.getItem(t);if(e){let a=JSON.parse(e);return{...s,...a,apiServer:{...s.apiServer,...a.apiServer},database:{...s.database,...a.database},dlq:{...s.dlq,...a.dlq}}}}catch(e){console.error("Failed to load settings:",e)}return s}function i(e){try{localStorage.setItem(t,JSON.stringify(e))}catch(e){throw console.error("Failed to save settings:",e),e}}function l(){return r().apiServer.url||s.apiServer.url}e.s(["getApiBaseUrl",()=>l,"getSettings",()=>r,"saveSettings",()=>i])},9165,e=>{"use strict";var a=e.i(43668);class t extends Error{status;response;constructor(e,a,t){super(e),this.status=a,this.response=t,this.name="ApiError"}}async function s(e,s){let r=`${(0,a.getApiBaseUrl)()}${e}`;try{let e=await fetch(r,{...s,headers:{"Content-Type":"application/json",...s?.headers}});if(!e.ok){let a;try{a=await e.json()}catch{a={detail:e.statusText}}let s=a.detail||`API request failed: ${e.statusText}`;throw 422===e.status&&a.details&&Array.isArray(a.details)&&(s=a.details.map(e=>{let a=e.loc?.join(".")||e.field||"field",t=e.msg||e.message||"validation error";return`${a}: ${t}`}).join("; ")||s),new t(s,e.status,a)}let a=e.headers.get("content-type");if(a&&a.includes("application/json"))return e.json();return e.text()}catch(s){if(s instanceof TypeError&&"Failed to fetch"===s.message){let s=(0,a.getApiBaseUrl)();throw new t(`Unable to connect to API server at ${s}. Please ensure the API server is running and the URL is correct.`,0,{originalError:"NetworkError",apiUrl:s,endpoint:e,suggestion:"Check your API server settings in the Settings page"})}throw s}}async function r(e){return s(e,{method:"GET"})}async function i(e,a){return s(e,{method:"POST",body:a?JSON.stringify(a):void 0})}async function l(e,a){return s(e,{method:"PUT",body:a?JSON.stringify(a):void 0})}async function n(e,s){let r=`${(0,a.getApiBaseUrl)()}${e}`,i=await fetch(r,{method:"POST",body:s});if(!i.ok){let e;try{e=await i.json()}catch{e={detail:i.statusText}}throw new t(e.detail||`API request failed: ${i.statusText}`,i.status,e)}let l=i.headers.get("content-type");return l&&l.includes("application/json")?i.json():i.text()}async function d(e){let s=`${(0,a.getApiBaseUrl)()}${e}`,r=await fetch(s,{method:"GET"});if(!r.ok){let e;try{e=await r.json()}catch{e={detail:r.statusText}}throw new t(e.detail||`API request failed: ${r.statusText}`,r.status,e)}return r.blob()}e.s(["ApiError",()=>t,"api",0,{contracts:{list:()=>r("/api/v1/contracts"),get:e=>r(`/api/v1/contracts/${e}`),parse:e=>i("/api/v1/contracts/parse",{contract:e}),parseFile:(e,a)=>{let t=new FormData;return t.append("file",e),void 0!==a&&t.append("validate",String(a)),n("/api/v1/contracts/parse/upload",t)},build:e=>i("/api/v1/contracts/build",e),buildFromId:(e,a)=>{let t=new URLSearchParams;a?.include_metadata!==void 0&&t.append("include_metadata",String(a.include_metadata)),a?.include_ownership!==void 0&&t.append("include_ownership",String(a.include_ownership)),a?.include_governance!==void 0&&t.append("include_governance",String(a.include_governance));let s=t.toString();return i(`/api/v1/contracts/${e}/build${s?`?${s}`:""}`,{})},createFromArtifacts:e=>i("/api/v1/contracts/create-from-artifacts",e),createMixed:e=>i("/api/v1/contracts/create-mixed",e),update:(e,a)=>l(`/api/v1/contracts/${e}`,a)},metadata:{listSchemas:()=>r("/api/v1/metadata/schemas"),getSchema:(e,a)=>{let t=a?`?version=${a}`:"";return r(`/api/v1/metadata/schemas/${e}${t}`)},getCompleteSchema:(e,a)=>{let t=a?`?version=${a}`:"";return r(`/api/v1/metadata/schemas/${e}/complete${t}`)},storeSchema:e=>i("/api/v1/metadata/schemas",e),getMetadata:(e,a)=>{let t=a?`?version=${a}`:"";return r(`/api/v1/metadata/metadata/${e}${t}`)},storeMetadata:e=>i("/api/v1/metadata/metadata",e),getCoercionRules:(e,a)=>{let t=a?`?version=${a}`:"";return r(`/api/v1/metadata/coercion-rules/${e}${t}`)},storeCoercionRules:e=>i("/api/v1/metadata/coercion-rules",e),getValidationRules:(e,a)=>{let t=a?`?version=${a}`:"";return r(`/api/v1/metadata/validation-rules/${e}${t}`)},storeValidationRules:e=>i("/api/v1/metadata/validation-rules",e),getEntityList:e=>r(`/api/v1/metadata/${e}`),createEntity:(e,a)=>i(`/api/v1/metadata/${e}`,a),updateEntity:(e,a,t)=>l(`/api/v1/metadata/${e}/${a}`,t),listArtifacts:()=>r("/api/v1/metadata/artifacts")},validation:{validate:e=>i("/api/v1/validation/validate",e),validateBatch:e=>i("/api/v1/validation/validate-batch",e)},schemas:{generate:e=>i("/api/v1/schemas/generate",e),convert:e=>i("/api/v1/schemas/convert",e)},quality:{listMetrics:e=>{let a=new URLSearchParams;e?.schema_id&&a.append("schema_id",e.schema_id),e?.limit&&a.append("limit",e.limit.toString()),e?.offset&&a.append("offset",e.offset.toString());let t=a.toString();return r(`/api/v1/quality/metrics${t?`?${t}`:""}`)},getMetric:e=>r(`/api/v1/quality/metrics/${e}`),getReport:(e,a)=>{let t=new URLSearchParams;a?.data_source&&t.append("data_source",a.data_source),a?.limit&&t.append("limit",a.limit.toString());let s=t.toString();return r(`/api/v1/quality/reports/${e}${s?`?${s}`:""}`)},check:e=>i("/api/v1/quality/check",e),checkUpload:(e,a)=>{let t=new FormData;return t.append("file",e),a.schema_id&&t.append("schema_id",a.schema_id),a.contract&&t.append("contract",a.contract),void 0!==a.record_violations&&t.append("record_violations",String(a.record_violations)),void 0!==a.calculate_metrics&&t.append("calculate_metrics",String(a.calculate_metrics)),void 0!==a.check_thresholds&&t.append("check_thresholds",String(a.check_thresholds)),a.thresholds&&t.append("thresholds",a.thresholds),void 0!==a.include_field_metrics&&t.append("include_field_metrics",String(a.include_field_metrics)),void 0!==a.sample_size&&t.append("sample_size",String(a.sample_size)),a.data_source&&t.append("data_source",a.data_source),a.data_version&&t.append("data_version",a.data_version),n("/api/v1/quality/check/upload",t)},queryViolations:e=>i("/api/v1/quality/violations",e)},templates:{downloadSchema:()=>d("/api/v1/templates/schema"),downloadContractArtifacts:()=>d("/api/v1/templates/contract-artifacts"),listEtlTemplates:()=>s("/api/v1/templates/etl"),downloadEtlTemplate:async e=>{let s=(0,a.getApiBaseUrl)().replace(/\/$/,""),r=await fetch(`${s}/api/v1/templates/etl/${encodeURIComponent(e)}`);if(!r.ok)throw new t(await r.text()||r.statusText,r.status);return r.text()}},settings:{testDatabase:e=>i("/api/v1/settings/test-database",e),testDlq:e=>i("/api/v1/settings/test-dlq",e),getDlqStats:e=>i("/api/v1/settings/dlq-stats",e)}}])},55824,16370,e=>{"use strict";var a=e.i(43476);function t({title:e,description:t,actions:s}){return(0,a.jsxs)("div",{className:"mb-4 flex justify-between items-center",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-2xl font-bold text-foreground mb-1",children:e}),t&&(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:t})]}),s&&(0,a.jsx)("div",{className:"flex gap-2",children:s})]})}e.s(["PageHeader",()=>t],16370),e.s([],55824)},95468,e=>{"use strict";let a=(0,e.i(75254).default)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);e.s(["CheckCircle2",()=>a],95468)},73884,e=>{"use strict";let a=(0,e.i(75254).default)("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"}]]);e.s(["XCircle",()=>a],73884)},13399,e=>{"use strict";var a=e.i(43476),t=e.i(71645);e.i(55824);var s=e.i(16370),r=e.i(43668),i=e.i(9165),l=e.i(19455),n=e.i(75157);let d=t.forwardRef(({className:e,type:t,...s},r)=>(0,a.jsx)("input",{type:t,className:(0,n.cn)("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...s}));d.displayName="Input";let c=t.forwardRef(({className:e,...t},s)=>(0,a.jsx)("label",{ref:s,className:(0,n.cn)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...t}));c.displayName="Label";let o=t.forwardRef(({className:e,checked:t,onCheckedChange:s,onChange:r,...i},l)=>(0,a.jsxs)("label",{className:"relative inline-flex items-center cursor-pointer",children:[(0,a.jsx)("input",{type:"checkbox",className:"sr-only peer",checked:t,onChange:e=>{s&&s(e.target.checked),r&&r(e)},ref:l,...i}),(0,a.jsx)("div",{className:(0,n.cn)("relative w-11 h-6 bg-input peer-focus:outline-none peer-focus:ring-2 peer-focus:ring-ring peer-focus:ring-offset-2 peer-focus:ring-offset-background rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-background after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-primary",e)})]}));o.displayName="Switch";var p=e.i(15288);let h=(0,e.i(25913).cva)("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),m=t.forwardRef(({className:e,variant:t,...s},r)=>(0,a.jsx)("div",{ref:r,role:"alert",className:(0,n.cn)(h({variant:t}),e),...s}));m.displayName="Alert",t.forwardRef(({className:e,...t},s)=>(0,a.jsx)("h5",{ref:s,className:(0,n.cn)("mb-1 font-medium leading-none tracking-tight",e),...t})).displayName="AlertTitle";let u=t.forwardRef(({className:e,...t},s)=>(0,a.jsx)("div",{ref:s,className:(0,n.cn)("text-sm [&_p]:leading-relaxed",e),...t}));u.displayName="AlertDescription";var g=e.i(95468),x=e.i(73884);let v=(0,e.i(75254).default)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);function b(){let[e,n]=(0,t.useState)((0,r.getSettings)()),[h,b]=(0,t.useState)(!1),[f,j]=(0,t.useState)(null),[y,w]=(0,t.useState)(!1),[N,q]=(0,t.useState)(null),[S,C]=(0,t.useState)(!1),[_,k]=(0,t.useState)(null),[$,F]=(0,t.useState)(!1),[T,A]=(0,t.useState)(null),P=async()=>{b(!0),j(null);try{(0,r.saveSettings)(e),j({type:"success",text:"Settings saved successfully!"}),setTimeout(()=>{window.location.reload()},1e3)}catch(e){j({type:"error",text:`Failed to save settings: ${e instanceof Error?e.message:"Unknown error"}`})}finally{b(!1)}},U=async()=>{w(!0),q(null);try{let a=await i.api.settings.testDatabase({connection_string:e.database.connectionString,host:e.database.host,port:e.database.port,database:e.database.database,username:e.database.username,password:e.database.password});q(a)}catch(e){q({success:!1,message:e?.response?.detail||e?.message||"Failed to test database connection"})}finally{w(!1)}},D=async()=>{C(!0),k(null);try{let a=await i.api.settings.testDlq({connection_string:e.dlq.connectionString,host:e.dlq.host,port:e.dlq.port,database:e.dlq.database,username:e.dlq.username,password:e.dlq.password,table_name:e.dlq.tableName});k(a)}catch(e){k({success:!1,message:e?.response?.detail||e?.message||"Failed to test DLQ connection"})}finally{C(!1)}},L=async()=>{F(!0);try{let a=await i.api.settings.getDlqStats({connection_string:e.dlq.connectionString,host:e.dlq.host,port:e.dlq.port,database:e.dlq.database,username:e.dlq.username,password:e.dlq.password,table_name:e.dlq.tableName});A(a)}catch(e){A(null),alert(`Failed to load DLQ statistics: ${e?.response?.detail||e?.message||"Unknown error"}`)}finally{F(!1)}};return(0,a.jsx)("div",{className:"min-h-screen bg-background",children:(0,a.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-6",children:[(0,a.jsx)(s.PageHeader,{title:"Settings",description:"Configure PyCharter UI settings, database connections, and DLQ connections"}),f&&(0,a.jsx)(m,{className:`mt-4 ${"success"===f.type?"bg-green-50 border-green-200":"bg-red-50 border-red-200"}`,children:(0,a.jsx)(u,{className:"success"===f.type?"text-green-800":"text-red-800",children:f.text})}),(0,a.jsxs)("div",{className:"mt-8 space-y-6",children:[(0,a.jsxs)(p.Card,{children:[(0,a.jsxs)(p.CardHeader,{children:[(0,a.jsx)(p.CardTitle,{children:"API Server"}),(0,a.jsx)(p.CardDescription,{children:"Configure the PyCharter API server URL that this UI will connect to"})]}),(0,a.jsx)(p.CardContent,{className:"space-y-4",children:(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(c,{htmlFor:"api-url",children:"API Server URL"}),(0,a.jsx)(d,{id:"api-url",type:"text",value:e.apiServer.url,onChange:a=>n({...e,apiServer:{...e.apiServer,url:a.target.value}}),placeholder:"http://localhost:8000"})]})})]}),(0,a.jsxs)(p.Card,{children:[(0,a.jsxs)(p.CardHeader,{children:[(0,a.jsx)(p.CardTitle,{children:"Database Configuration"}),(0,a.jsx)(p.CardDescription,{children:"Configure database connection for quality checks and data validation"})]}),(0,a.jsxs)(p.CardContent,{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"space-y-0.5",children:[(0,a.jsx)(c,{children:"Enable Database"}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:"Enable database connection for quality checks"})]}),(0,a.jsx)(o,{checked:e.database.enabled,onCheckedChange:a=>n({...e,database:{...e.database,enabled:a}})})]}),e.database.enabled&&(0,a.jsxs)("div",{className:"space-y-4 pt-4 border-t",children:[(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(c,{htmlFor:"db-connection-string",children:"Connection String (optional)"}),(0,a.jsx)(d,{id:"db-connection-string",type:"text",value:e.database.connectionString||"",onChange:a=>n({...e,database:{...e.database,connectionString:a.target.value}}),placeholder:"postgresql://user:password@host:port/database"})]}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(c,{htmlFor:"db-host",children:"Host"}),(0,a.jsx)(d,{id:"db-host",type:"text",value:e.database.host||"",onChange:a=>n({...e,database:{...e.database,host:a.target.value}}),placeholder:"localhost"})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(c,{htmlFor:"db-port",children:"Port"}),(0,a.jsx)(d,{id:"db-port",type:"number",value:e.database.port||"",onChange:a=>n({...e,database:{...e.database,port:a.target.value?parseInt(a.target.value):void 0}}),placeholder:"5432"})]})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(c,{htmlFor:"db-database",children:"Database Name"}),(0,a.jsx)(d,{id:"db-database",type:"text",value:e.database.database||"",onChange:a=>n({...e,database:{...e.database,database:a.target.value}}),placeholder:"mydatabase"})]}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(c,{htmlFor:"db-username",children:"Username"}),(0,a.jsx)(d,{id:"db-username",type:"text",value:e.database.username||"",onChange:a=>n({...e,database:{...e.database,username:a.target.value}}),placeholder:"username"})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(c,{htmlFor:"db-password",children:"Password"}),(0,a.jsx)(d,{id:"db-password",type:"password",value:e.database.password||"",onChange:a=>n({...e,database:{...e.database,password:a.target.value}}),placeholder:"password"})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(l.Button,{onClick:U,disabled:y,variant:"outline",children:y?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(v,{className:"mr-2 h-4 w-4 animate-spin"}),"Testing..."]}):"Test Connection"}),N&&(0,a.jsx)("div",{className:"flex items-center gap-2 text-sm",children:N.success?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(g.CheckCircle2,{className:"h-4 w-4 text-green-600"}),(0,a.jsx)("span",{className:"text-green-600",children:N.message})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(x.XCircle,{className:"h-4 w-4 text-red-600"}),(0,a.jsx)("span",{className:"text-red-600",children:N.message})]})})]})]})]})]}),(0,a.jsxs)(p.Card,{children:[(0,a.jsxs)(p.CardHeader,{children:[(0,a.jsx)(p.CardTitle,{children:"Dead Letter Queue (DLQ) Configuration"}),(0,a.jsx)(p.CardDescription,{children:"Configure DLQ connection to collect statistics on error messages and poison messages"})]}),(0,a.jsxs)(p.CardContent,{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"space-y-0.5",children:[(0,a.jsx)(c,{children:"Enable DLQ"}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:"Enable DLQ connection for statistics collection"})]}),(0,a.jsx)(o,{checked:e.dlq.enabled,onCheckedChange:a=>n({...e,dlq:{...e.dlq,enabled:a}})})]}),e.dlq.enabled&&(0,a.jsxs)("div",{className:"space-y-4 pt-4 border-t",children:[(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(c,{htmlFor:"dlq-connection-string",children:"Connection String (optional)"}),(0,a.jsx)(d,{id:"dlq-connection-string",type:"text",value:e.dlq.connectionString||"",onChange:a=>n({...e,dlq:{...e.dlq,connectionString:a.target.value}}),placeholder:"postgresql://user:password@host:port/database"})]}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(c,{htmlFor:"dlq-host",children:"Host"}),(0,a.jsx)(d,{id:"dlq-host",type:"text",value:e.dlq.host||"",onChange:a=>n({...e,dlq:{...e.dlq,host:a.target.value}}),placeholder:"localhost"})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(c,{htmlFor:"dlq-port",children:"Port"}),(0,a.jsx)(d,{id:"dlq-port",type:"number",value:e.dlq.port||"",onChange:a=>n({...e,dlq:{...e.dlq,port:a.target.value?parseInt(a.target.value):void 0}}),placeholder:"5432"})]})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(c,{htmlFor:"dlq-database",children:"Database Name"}),(0,a.jsx)(d,{id:"dlq-database",type:"text",value:e.dlq.database||"",onChange:a=>n({...e,dlq:{...e.dlq,database:a.target.value}}),placeholder:"mydatabase"})]}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(c,{htmlFor:"dlq-username",children:"Username"}),(0,a.jsx)(d,{id:"dlq-username",type:"text",value:e.dlq.username||"",onChange:a=>n({...e,dlq:{...e.dlq,username:a.target.value}}),placeholder:"username"})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(c,{htmlFor:"dlq-password",children:"Password"}),(0,a.jsx)(d,{id:"dlq-password",type:"password",value:e.dlq.password||"",onChange:a=>n({...e,dlq:{...e.dlq,password:a.target.value}}),placeholder:"password"})]})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(c,{htmlFor:"dlq-table",children:"Table Name"}),(0,a.jsx)(d,{id:"dlq-table",type:"text",value:e.dlq.tableName||"",onChange:a=>n({...e,dlq:{...e.dlq,tableName:a.target.value}}),placeholder:"dead_letter_queue"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(l.Button,{onClick:D,disabled:S,variant:"outline",children:S?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(v,{className:"mr-2 h-4 w-4 animate-spin"}),"Testing..."]}):"Test Connection"}),_&&(0,a.jsx)("div",{className:"flex items-center gap-2 text-sm",children:_.success?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(g.CheckCircle2,{className:"h-4 w-4 text-green-600"}),(0,a.jsx)("span",{className:"text-green-600",children:_.message})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(x.XCircle,{className:"h-4 w-4 text-red-600"}),(0,a.jsx)("span",{className:"text-red-600",children:_.message})]})})]}),T&&(0,a.jsxs)("div",{className:"mt-4 p-4 bg-muted rounded-lg",children:[(0,a.jsx)("h4",{className:"font-semibold mb-2",children:"DLQ Statistics"}),(0,a.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("strong",{children:"Total Messages:"})," ",T.total_messages]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("strong",{children:"By Reason:"}),(0,a.jsx)("ul",{className:"list-disc list-inside ml-4",children:Object.entries(T.by_reason).map(([e,t])=>(0,a.jsxs)("li",{children:[e,": ",t]},e))})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("strong",{children:"By Stage:"}),(0,a.jsx)("ul",{className:"list-disc list-inside ml-4",children:Object.entries(T.by_stage).map(([e,t])=>(0,a.jsxs)("li",{children:[e,": ",t]},e))})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("strong",{children:"By Status:"}),(0,a.jsx)("ul",{className:"list-disc list-inside ml-4",children:Object.entries(T.by_status).map(([e,t])=>(0,a.jsxs)("li",{children:[e,": ",t]},e))})]})]})]}),(0,a.jsx)(l.Button,{onClick:L,disabled:$||!e.dlq.enabled,variant:"outline",children:$?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(v,{className:"mr-2 h-4 w-4 animate-spin"}),"Loading..."]}):"Load Statistics"})]})]})]}),(0,a.jsx)("div",{className:"flex justify-end",children:(0,a.jsx)(l.Button,{onClick:P,disabled:h,size:"lg",children:h?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(v,{className:"mr-2 h-4 w-4 animate-spin"}),"Saving..."]}):"Save Settings"})})]})]})})}e.s(["default",()=>b],13399)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,55824,16370,e=>{"use strict";var t=e.i(43476);function a({title:e,description:a,actions:s}){return(0,t.jsxs)("div",{className:"mb-4 flex justify-between items-center",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"text-2xl font-bold text-foreground mb-1",children:e}),a&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:a})]}),s&&(0,t.jsx)("div",{className:"flex gap-2",children:s})]})}e.s(["PageHeader",()=>a],16370),e.s([],55824)},61246,e=>{"use strict";var t=e.i(43476),a=e.i(75157);function s({className:e,...s}){return(0,t.jsx)("div",{className:(0,a.cn)("animate-pulse rounded-md bg-muted",e),...s})}function i({size:e="md",className:s}){return(0,t.jsx)("div",{className:(0,a.cn)("flex items-center justify-center",s),children:(0,t.jsx)("div",{className:(0,a.cn)("animate-spin rounded-full border-2 border-muted border-t-primary",{sm:"h-4 w-4",md:"h-8 w-8",lg:"h-12 w-12"}[e])})})}function r({message:e="Loading..."}){return(0,t.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-background",children:(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)(i,{size:"lg",className:"mb-4"}),(0,t.jsx)("p",{className:"text-muted-foreground",children:e})]})})}function l(){return(0,t.jsxs)("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[(0,t.jsx)(s,{className:"h-6 w-3/4"}),(0,t.jsx)(s,{className:"h-4 w-full"}),(0,t.jsx)(s,{className:"h-4 w-5/6"}),(0,t.jsxs)("div",{className:"flex gap-2 mt-4",children:[(0,t.jsx)(s,{className:"h-9 w-20"}),(0,t.jsx)(s,{className:"h-9 w-20"})]})]})}function d({rows:e=5}){return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(s,{className:"h-10 w-full"}),Array.from({length:e}).map((e,a)=>(0,t.jsx)(s,{className:"h-12 w-full"},a))]})}e.s(["CardSkeleton",()=>l,"PageLoading",()=>r,"TableSkeleton",()=>d,"default",()=>i],61246)},43668,e=>{"use strict";var t=e.i(47167);let a="pycharter_settings",s={apiServer:{url:t.default.env.NEXT_PUBLIC_API_URL||"http://localhost:8000"},database:{enabled:!1},dlq:{enabled:!1}};function i(){try{let e=localStorage.getItem(a);if(e){let t=JSON.parse(e);return{...s,...t,apiServer:{...s.apiServer,...t.apiServer},database:{...s.database,...t.database},dlq:{...s.dlq,...t.dlq}}}}catch(e){console.error("Failed to load settings:",e)}return s}function r(e){try{localStorage.setItem(a,JSON.stringify(e))}catch(e){throw console.error("Failed to save settings:",e),e}}function l(){return i().apiServer.url||s.apiServer.url}e.s(["getApiBaseUrl",()=>l,"getSettings",()=>i,"saveSettings",()=>r])},9165,e=>{"use strict";var t=e.i(43668);class a extends Error{status;response;constructor(e,t,a){super(e),this.status=t,this.response=a,this.name="ApiError"}}async function s(e,s){let i=`${(0,t.getApiBaseUrl)()}${e}`;try{let e=await fetch(i,{...s,headers:{"Content-Type":"application/json",...s?.headers}});if(!e.ok){let t;try{t=await e.json()}catch{t={detail:e.statusText}}let s=t.detail||`API request failed: ${e.statusText}`;throw 422===e.status&&t.details&&Array.isArray(t.details)&&(s=t.details.map(e=>{let t=e.loc?.join(".")||e.field||"field",a=e.msg||e.message||"validation error";return`${t}: ${a}`}).join("; ")||s),new a(s,e.status,t)}let t=e.headers.get("content-type");if(t&&t.includes("application/json"))return e.json();return e.text()}catch(s){if(s instanceof TypeError&&"Failed to fetch"===s.message){let s=(0,t.getApiBaseUrl)();throw new a(`Unable to connect to API server at ${s}. Please ensure the API server is running and the URL is correct.`,0,{originalError:"NetworkError",apiUrl:s,endpoint:e,suggestion:"Check your API server settings in the Settings page"})}throw s}}async function i(e){return s(e,{method:"GET"})}async function r(e,t){return s(e,{method:"POST",body:t?JSON.stringify(t):void 0})}async function l(e,t){return s(e,{method:"PUT",body:t?JSON.stringify(t):void 0})}async function d(e,s){let i=`${(0,t.getApiBaseUrl)()}${e}`,r=await fetch(i,{method:"POST",body:s});if(!r.ok){let e;try{e=await r.json()}catch{e={detail:r.statusText}}throw new a(e.detail||`API request failed: ${r.statusText}`,r.status,e)}let l=r.headers.get("content-type");return l&&l.includes("application/json")?r.json():r.text()}async function n(e){let s=`${(0,t.getApiBaseUrl)()}${e}`,i=await fetch(s,{method:"GET"});if(!i.ok){let e;try{e=await i.json()}catch{e={detail:i.statusText}}throw new a(e.detail||`API request failed: ${i.statusText}`,i.status,e)}return i.blob()}e.s(["ApiError",()=>a,"api",0,{contracts:{list:()=>i("/api/v1/contracts"),get:e=>i(`/api/v1/contracts/${e}`),parse:e=>r("/api/v1/contracts/parse",{contract:e}),parseFile:(e,t)=>{let a=new FormData;return a.append("file",e),void 0!==t&&a.append("validate",String(t)),d("/api/v1/contracts/parse/upload",a)},build:e=>r("/api/v1/contracts/build",e),buildFromId:(e,t)=>{let a=new URLSearchParams;t?.include_metadata!==void 0&&a.append("include_metadata",String(t.include_metadata)),t?.include_ownership!==void 0&&a.append("include_ownership",String(t.include_ownership)),t?.include_governance!==void 0&&a.append("include_governance",String(t.include_governance));let s=a.toString();return r(`/api/v1/contracts/${e}/build${s?`?${s}`:""}`,{})},createFromArtifacts:e=>r("/api/v1/contracts/create-from-artifacts",e),createMixed:e=>r("/api/v1/contracts/create-mixed",e),update:(e,t)=>l(`/api/v1/contracts/${e}`,t)},metadata:{listSchemas:()=>i("/api/v1/metadata/schemas"),getSchema:(e,t)=>{let a=t?`?version=${t}`:"";return i(`/api/v1/metadata/schemas/${e}${a}`)},getCompleteSchema:(e,t)=>{let a=t?`?version=${t}`:"";return i(`/api/v1/metadata/schemas/${e}/complete${a}`)},storeSchema:e=>r("/api/v1/metadata/schemas",e),getMetadata:(e,t)=>{let a=t?`?version=${t}`:"";return i(`/api/v1/metadata/metadata/${e}${a}`)},storeMetadata:e=>r("/api/v1/metadata/metadata",e),getCoercionRules:(e,t)=>{let a=t?`?version=${t}`:"";return i(`/api/v1/metadata/coercion-rules/${e}${a}`)},storeCoercionRules:e=>r("/api/v1/metadata/coercion-rules",e),getValidationRules:(e,t)=>{let a=t?`?version=${t}`:"";return i(`/api/v1/metadata/validation-rules/${e}${a}`)},storeValidationRules:e=>r("/api/v1/metadata/validation-rules",e),getEntityList:e=>i(`/api/v1/metadata/${e}`),createEntity:(e,t)=>r(`/api/v1/metadata/${e}`,t),updateEntity:(e,t,a)=>l(`/api/v1/metadata/${e}/${t}`,a),listArtifacts:()=>i("/api/v1/metadata/artifacts")},validation:{validate:e=>r("/api/v1/validation/validate",e),validateBatch:e=>r("/api/v1/validation/validate-batch",e)},schemas:{generate:e=>r("/api/v1/schemas/generate",e),convert:e=>r("/api/v1/schemas/convert",e)},quality:{listMetrics:e=>{let t=new URLSearchParams;e?.schema_id&&t.append("schema_id",e.schema_id),e?.limit&&t.append("limit",e.limit.toString()),e?.offset&&t.append("offset",e.offset.toString());let a=t.toString();return i(`/api/v1/quality/metrics${a?`?${a}`:""}`)},getMetric:e=>i(`/api/v1/quality/metrics/${e}`),getReport:(e,t)=>{let a=new URLSearchParams;t?.data_source&&a.append("data_source",t.data_source),t?.limit&&a.append("limit",t.limit.toString());let s=a.toString();return i(`/api/v1/quality/reports/${e}${s?`?${s}`:""}`)},check:e=>r("/api/v1/quality/check",e),checkUpload:(e,t)=>{let a=new FormData;return a.append("file",e),t.schema_id&&a.append("schema_id",t.schema_id),t.contract&&a.append("contract",t.contract),void 0!==t.record_violations&&a.append("record_violations",String(t.record_violations)),void 0!==t.calculate_metrics&&a.append("calculate_metrics",String(t.calculate_metrics)),void 0!==t.check_thresholds&&a.append("check_thresholds",String(t.check_thresholds)),t.thresholds&&a.append("thresholds",t.thresholds),void 0!==t.include_field_metrics&&a.append("include_field_metrics",String(t.include_field_metrics)),void 0!==t.sample_size&&a.append("sample_size",String(t.sample_size)),t.data_source&&a.append("data_source",t.data_source),t.data_version&&a.append("data_version",t.data_version),d("/api/v1/quality/check/upload",a)},queryViolations:e=>r("/api/v1/quality/violations",e)},templates:{downloadSchema:()=>n("/api/v1/templates/schema"),downloadContractArtifacts:()=>n("/api/v1/templates/contract-artifacts"),listEtlTemplates:()=>s("/api/v1/templates/etl"),downloadEtlTemplate:async e=>{let s=(0,t.getApiBaseUrl)().replace(/\/$/,""),i=await fetch(`${s}/api/v1/templates/etl/${encodeURIComponent(e)}`);if(!i.ok)throw new a(await i.text()||i.statusText,i.status);return i.text()}},settings:{testDatabase:e=>r("/api/v1/settings/test-database",e),testDlq:e=>r("/api/v1/settings/test-dlq",e),getDlqStats:e=>r("/api/v1/settings/dlq-stats",e)}}])},63209,e=>{"use strict";let t=(0,e.i(75254).default)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);e.s(["AlertCircle",()=>t],63209)},95113,e=>{"use strict";var t=e.i(43476),a=e.i(63209),s=e.i(9165),i=e.i(75157);function r({error:e,title:r="Error",className:l}){if(!e)return null;let d=e instanceof s.ApiError,n=d?e.message:e.message||"An unexpected error occurred";return(0,t.jsx)("div",{className:(0,i.cn)("rounded-lg border border-destructive/50 bg-destructive/10 p-4",l),children:(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)(a.AlertCircle,{className:"h-5 w-5 text-destructive flex-shrink-0 mt-0.5"}),(0,t.jsxs)("div",{className:"ml-3",children:[(0,t.jsx)("h3",{className:"text-sm font-medium text-destructive",children:r}),(0,t.jsxs)("div",{className:"mt-2 text-sm text-destructive/90",children:[(0,t.jsx)("p",{children:n}),d&&e.status&&(0,t.jsxs)("p",{className:"mt-1 text-xs opacity-75",children:["Status: ",e.status]})]})]})]})})}e.s(["default",()=>r])},46652,e=>{"use strict";var t=e.i(71645),a=e.i(9165);function s(){let[e,s]=(0,t.useState)([]),[i,r]=(0,t.useState)(!0),[l,d]=(0,t.useState)(null),n=(0,t.useCallback)(async()=>{try{r(!0),d(null);let e=await a.api.contracts.list();s(e.contracts)}catch(t){let e="Failed to load contracts";t instanceof a.ApiError&&(e=0===t.status||t.message.includes("Unable to connect")?"API server is not running. Please start it with: pycharter api":t.message),d(e),console.error("Error loading contracts:",t)}finally{r(!1)}},[]);return(0,t.useEffect)(()=>{n()},[n]),{contracts:e,loading:i,error:l,refetch:n}}e.s(["useContracts",()=>s])},78583,e=>{"use strict";let t=(0,e.i(75254).default)("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"}]]);e.s(["FileText",()=>t],78583)},69074,e=>{"use strict";let t=(0,e.i(75254).default)("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);e.s(["Upload",()=>t],69074)},42009,50398,80428,e=>{"use strict";var t=e.i(75254);let a=(0,t.default)("Award",[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]]);e.s(["Award",()=>a],42009);var s=e.i(43476),i=e.i(71645);let r=(0,t.default)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]),l=(0,t.default)("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);var d=e.i(64659);let n=(0,t.default)("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);function c({sections:e,defaultCollapsed:t=!1,onItemClick:a,onSectionClick:c,selectedSection:o,headerTitle:m="Navigation"}){let[u,h]=(0,i.useState)(t),[x,p]=(0,i.useState)(new Set(e.map(e=>e.id)));return(0,s.jsxs)("div",{className:`flex flex-col bg-background border-r border-border/50 shadow-sm transition-all duration-300 ${u?"w-16":"w-64"}`,style:{height:"100%",overflow:"hidden"},children:[(0,s.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border/50 bg-muted/30",children:[!u&&(0,s.jsx)("h2",{className:"text-sm font-semibold text-foreground tracking-wide",children:m}),(0,s.jsx)("button",{onClick:()=>{h(!u)},className:"p-1.5 rounded-md hover:bg-muted transition-all duration-200 hover:scale-105 active:scale-95","aria-label":u?"Expand sidebar":"Collapse sidebar",children:u?(0,s.jsx)(l,{className:"h-4 w-4 text-muted-foreground"}):(0,s.jsx)(r,{className:"h-4 w-4 text-muted-foreground"})})]}),(0,s.jsx)("div",{className:"flex-1 overflow-y-auto overflow-x-hidden px-2 py-3",style:{maxHeight:"100%"},children:(0,s.jsx)("div",{className:"space-y-1",children:e.map(e=>{let t=x.has(e.id);return(0,s.jsxs)("div",{className:"mb-1",children:[(0,s.jsx)("button",{onClick:()=>{var t;c&&c(e.id),t=e.id,p(e=>{let a=new Set(e);return a.has(t)?a.delete(t):a.add(t),a})},className:`w-full flex items-center justify-between px-3 py-2.5 rounded-lg transition-all duration-200 ${u?"justify-center hover:bg-muted/50":o===e.id?"bg-primary/10 text-primary hover:bg-primary/15":"hover:bg-muted/50 hover:shadow-sm"}`,title:u?e.title:void 0,children:u?e.icon?(0,s.jsx)(e.icon,{className:`h-5 w-5 transition-colors ${o===e.id?"text-primary":"text-muted-foreground"}`}):(0,s.jsx)("span",{className:`text-xs font-semibold ${o===e.id?"text-primary":"text-muted-foreground"}`,children:e.title.charAt(0).toUpperCase()}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex items-center gap-2.5",children:[e.icon&&(0,s.jsx)(e.icon,{className:`h-4 w-4 transition-colors ${o===e.id?"text-primary":"text-muted-foreground"}`}),(0,s.jsx)("span",{className:`text-sm font-medium ${o===e.id?"text-primary":"text-foreground"}`,children:e.title})]}),t?(0,s.jsx)(n,{className:"h-3.5 w-3.5 text-muted-foreground transition-transform duration-200"}):(0,s.jsx)(d.ChevronDown,{className:"h-3.5 w-3.5 text-muted-foreground transition-transform duration-200"})]})}),!u&&t&&(0,s.jsx)("div",{className:"ml-1 mt-1 space-y-0.5 pl-2 border-l-2 border-muted",children:e.items.map(t=>(0,s.jsx)("button",{onClick:()=>{var s,i;return s=e.id,i=t.id,void(t.onClick&&t.onClick(),a&&a(s,i))},className:"w-full text-left px-3 py-2 text-sm text-muted-foreground hover:text-foreground hover:bg-muted/50 rounded-md transition-all duration-200 hover:translate-x-0.5",children:t.label},t.id))})]},e.id)})})})]})}e.s(["CollapsibleSidebar",()=>c],50398),e.s([],80428)},42033,e=>{"use strict";var t=e.i(43476),a=e.i(71645),s=e.i(15288),i=e.i(19455);e.i(55824);var r=e.i(16370),l=e.i(9165),d=e.i(61246),n=e.i(95113),c=e.i(46652),o=e.i(69074),m=e.i(78583),u=e.i(42009),h=e.i(75254);let x=(0,h.default)("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"}]]),p=(0,h.default)("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"}]]),v=(0,h.default)("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);var g=e.i(39616);e.i(80428);var f=e.i(50398);function j(){let[e,h]=(0,a.useState)([]),[j,y]=(0,a.useState)(!0),[b,N]=(0,a.useState)(null),[k,w]=(0,a.useState)(0),[_,C]=(0,a.useState)(null),[S,$]=(0,a.useState)([]),[q,A]=(0,a.useState)(!1),[T,F]=(0,a.useState)(!1),[R,U]=(0,a.useState)(null),[E,P]=(0,a.useState)("json"),[B,V]=(0,a.useState)(null),[D,O]=(0,a.useState)(""),[M,I]=(0,a.useState)(!1),[L,H]=(0,a.useState)("metrics"),{contracts:z,loading:J}=(0,c.useContracts)(),Q=[{id:"metrics",title:"Quality Metrics",icon:x,items:[{id:"overview",label:"Overview",onClick:()=>H("metrics")},{id:"by_schema",label:"By Schema",onClick:()=>H("metrics")},{id:"by_source",label:"By Data Source",onClick:()=>H("metrics")},{id:"trends",label:"Trends",onClick:()=>H("metrics")}]},{id:"violations",title:"Violations",icon:p,items:[{id:"all_violations",label:"All Violations",onClick:()=>H("violations")},{id:"open_violations",label:"Open Violations",onClick:()=>H("violations")},{id:"resolved_violations",label:"Resolved Violations",onClick:()=>H("violations")},{id:"by_severity",label:"By Severity",onClick:()=>H("violations")}]},{id:"checks",title:"Quality Checks",icon:u.Award,items:[{id:"run_check",label:"Run Quality Check",onClick:()=>H("checks")},{id:"check_history",label:"Check History",onClick:()=>H("checks")},{id:"scheduled_checks",label:"Scheduled Checks",onClick:()=>H("checks")}]},{id:"thresholds",title:"Thresholds",icon:v,items:[{id:"configure_thresholds",label:"Configure Thresholds",onClick:()=>H("thresholds")},{id:"threshold_breaches",label:"Threshold Breaches",onClick:()=>H("thresholds")}]},{id:"settings",title:"Settings",icon:g.Settings,items:[{id:"quality_config",label:"Quality Configuration",onClick:()=>H("settings")},{id:"notification_settings",label:"Notification Settings",onClick:()=>H("settings")}]}];(0,a.useEffect)(()=>{K()},[]);let K=async()=>{try{y(!0),N(null);let e=await l.api.quality.listMetrics({limit:100});h(e.metrics),w(e.total)}catch(e){N(e.message||"Failed to load quality metrics"),console.error("Error loading quality metrics:",e)}finally{y(!1)}},G=async e=>{try{A(!0),N(null);let t=await l.api.quality.queryViolations({schema_id:e});$(t.violations||[])}catch(e){N(e.message||"Failed to load violations"),console.error("Error loading violations:",e)}finally{A(!1)}},X=async e=>{if(e.preventDefault(),"file"===E){if(!B)return void N("Please select a file to upload");if(!D)return void N("Please select a contract");try{N(null),I(!0);let e=z.find(e=>e.id===D);if(!e)return void N("Selected contract not found");let t=e.schema_id;if(t||(t=(await l.api.contracts.get(D)).schema_id),!t)return void N("Contract does not have an associated schema");let a=await l.api.quality.checkUpload(B,{schema_id:t,record_violations:!0,calculate_metrics:!0,include_field_metrics:!0,data_source:B.name});U(a),F(!1),V(null),O(""),await K()}catch(e){N(e.message||"Failed to run quality check"),console.error("Error running quality check:",e)}finally{I(!1)}}else{let t=new FormData(e.currentTarget),a=t.get("schema_id"),s=t.get("data");try{N(null);let e=JSON.parse(s),t=await l.api.quality.check({schema_id:a,data:Array.isArray(e)?e:[e],record_violations:!0,calculate_metrics:!0,include_field_metrics:!0});U(t),F(!1),await K()}catch(e){N(e.message||"Failed to run quality check"),console.error("Error running quality check:",e)}}},Y=e=>{if(!e)return"N/A";try{return new Date(e).toLocaleString()}catch{return e}},Z=e=>`${(100*e).toFixed(2)}%`,W=e=>e>=90?"text-green-600 dark:text-green-400":e>=75?"text-yellow-600 dark:text-yellow-400":"text-red-600 dark:text-red-400",ee=Object.values(e.reduce((e,t)=>{let a=`${t.schema_id}::${t.data_source||"unknown"}`;return(!e[a]||new Date(t.check_timestamp||0)>new Date(e[a].check_timestamp||0))&&(e[a]=t),e},{}));return(0,t.jsxs)("div",{className:"flex h-full bg-background",style:{height:"calc(100vh - 4rem)",overflow:"hidden"},children:[(0,t.jsx)("div",{className:"flex-shrink-0",style:{height:"100%",overflow:"hidden"},children:(0,t.jsx)(f.CollapsibleSidebar,{sections:Q,defaultCollapsed:!1,headerTitle:"Quality",selectedSection:L,onSectionClick:H})}),(0,t.jsx)("div",{className:"flex-1 min-w-0",style:{height:"100%",overflowY:"auto",overflowX:"hidden"},"data-content-area":!0,children:(0,t.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-6",children:[(0,t.jsx)(r.PageHeader,{title:"Quality Reports",description:"View quality metrics and reports for different data feeds",actions:(0,t.jsx)(i.Button,{onClick:()=>F(!T),children:T?"Cancel":"Run Quality Check"})}),j&&(0,t.jsx)("div",{className:"flex justify-center items-center py-12",children:(0,t.jsx)(d.default,{})}),b&&(0,t.jsxs)("div",{className:"mb-4",children:[(0,t.jsx)(n.default,{error:Error(b),title:"Error"}),(0,t.jsx)(i.Button,{onClick:K,variant:"outline",className:"mt-4",children:"Retry"})]}),T&&(0,t.jsxs)(s.Card,{className:"mb-6",children:[(0,t.jsxs)(s.CardHeader,{children:[(0,t.jsx)(s.CardTitle,{children:"Run Quality Check"}),(0,t.jsx)(s.CardDescription,{children:"Run a quality check against a data contract. Upload a file (CSV/JSON) or provide JSON data directly."})]}),(0,t.jsx)(s.CardContent,{children:(0,t.jsxs)("form",{onSubmit:X,className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex gap-2 mb-4",children:[(0,t.jsxs)(i.Button,{type:"button",variant:"json"===E?"default":"outline",onClick:()=>P("json"),className:"flex items-center gap-2",children:[(0,t.jsx)(m.FileText,{className:"h-4 w-4"}),"JSON Data"]}),(0,t.jsxs)(i.Button,{type:"button",variant:"file"===E?"default":"outline",onClick:()=>P("file"),className:"flex items-center gap-2",children:[(0,t.jsx)(o.Upload,{className:"h-4 w-4"}),"Upload File"]})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{htmlFor:"contract_id",className:"block text-sm font-medium mb-2",children:["Data Contract ","file"===E&&"*"]}),J?(0,t.jsx)("div",{className:"text-sm text-muted-foreground",children:"Loading contracts..."}):(0,t.jsxs)("select",{id:"contract_id",value:D,onChange:e=>O(e.target.value),className:"w-full px-3 py-2 border rounded-md",required:"file"===E,children:[(0,t.jsx)("option",{value:"",children:"Select a contract..."}),z.map(e=>(0,t.jsxs)("option",{value:e.id,children:[e.name," (v",e.version,")"]},e.id))]}),"json"===E&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Or enter schema_id directly in the field below"})]}),"file"===E?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{htmlFor:"file",className:"block text-sm font-medium mb-2",children:"Data File (CSV or JSON) *"}),(0,t.jsx)("input",{type:"file",id:"file",accept:".json,.csv",onChange:e=>{let t=e.target.files?.[0];if(t){let e=t.name.split(".").pop()?.toLowerCase();if("json"!==e&&"csv"!==e)return void N("Please select a JSON or CSV file");V(t),N(null)}},className:"w-full px-3 py-2 border rounded-md",required:!0}),B&&(0,t.jsxs)("p",{className:"text-sm text-muted-foreground mt-1",children:["Selected: ",B.name," (",(B.size/1024).toFixed(2)," KB)"]})]}),(0,t.jsx)(i.Button,{type:"submit",disabled:M||!B||!D,children:M?"Running Check...":"Run Quality Check"})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{htmlFor:"schema_id",className:"block text-sm font-medium mb-2",children:"Schema ID"}),(0,t.jsx)("input",{type:"text",id:"schema_id",name:"schema_id",className:"w-full px-3 py-2 border rounded-md",placeholder:"schema_id",required:!0})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{htmlFor:"data",className:"block text-sm font-medium mb-2",children:"Data (JSON array or object)"}),(0,t.jsx)("textarea",{id:"data",name:"data",rows:8,className:"w-full px-3 py-2 border rounded-md font-mono text-sm",placeholder:'[{"field1": "value1"}, {"field1": "value2"}]',required:!0})]}),(0,t.jsx)(i.Button,{type:"submit",children:"Run Check"})]})]})})]}),R&&(0,t.jsxs)(s.Card,{className:"mb-6",children:[(0,t.jsxs)(s.CardHeader,{children:[(0,t.jsx)(s.CardTitle,{children:"Quality Check Result"}),(0,t.jsxs)(s.CardDescription,{children:["Schema: ",R.schema_id," •",R.passed?" ✓ Passed":" ✗ Failed"]})]}),(0,t.jsxs)(s.CardContent,{children:[R.quality_score&&(0,t.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mb-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-sm text-muted-foreground",children:"Overall Score"}),(0,t.jsx)("div",{className:`text-2xl font-bold ${W(R.quality_score.overall_score)}`,children:R.quality_score.overall_score.toFixed(1)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-sm text-muted-foreground",children:"Valid Records"}),(0,t.jsxs)("div",{className:"text-lg font-semibold text-green-600 dark:text-green-400",children:[R.valid_count," / ",R.record_count]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-sm text-muted-foreground",children:"Violations"}),(0,t.jsx)("div",{className:"text-lg font-semibold text-red-600 dark:text-red-400",children:R.violation_count})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-sm text-muted-foreground",children:"Completeness"}),(0,t.jsx)("div",{className:"text-lg font-semibold",children:Z(R.quality_score.completeness)})]})]}),(0,t.jsx)("pre",{className:"bg-muted p-4 rounded-md overflow-auto text-sm max-h-96",children:JSON.stringify(R,null,2)})]})]}),!j&&!b&&(0,t.jsx)(t.Fragment,{children:0===ee.length?(0,t.jsxs)(s.Card,{children:[(0,t.jsxs)(s.CardHeader,{children:[(0,t.jsx)(s.CardTitle,{children:"No Quality Metrics Found"}),(0,t.jsx)(s.CardDescription,{children:"No quality check results are currently available. Run quality checks to see metrics here."})]}),(0,t.jsx)(s.CardContent,{children:(0,t.jsx)(i.Button,{onClick:()=>F(!0),children:"Run Quality Check"})})]}):(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center",children:[(0,t.jsxs)("p",{className:"text-sm text-muted-foreground",children:[ee.length," data feed",1!==ee.length?"s":""," with quality metrics",k>ee.length&&` (${k} total checks)`]}),(0,t.jsx)(i.Button,{onClick:K,variant:"outline",children:"Refresh"})]}),(0,t.jsx)("div",{className:"grid gap-6",children:ee.map(e=>(0,t.jsxs)(s.Card,{children:[(0,t.jsx)(s.CardHeader,{children:(0,t.jsxs)("div",{className:"flex justify-between items-start",children:[(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsxs)(s.CardTitle,{className:"text-lg",children:[e.schema_id,e.schema_version&&(0,t.jsxs)("span",{className:"text-sm text-muted-foreground ml-2",children:["v",e.schema_version]})]}),(0,t.jsxs)(s.CardDescription,{children:[e.data_source||"Unknown source",e.data_version&&` • Version: ${e.data_version}`]})]}),e.passed?(0,t.jsx)("span",{className:"px-2 py-1 rounded text-xs bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",children:"✓ Passed"}):(0,t.jsx)("span",{className:"px-2 py-1 rounded text-xs bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200",children:"✗ Failed"})]})}),(0,t.jsxs)(s.CardContent,{children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mb-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-sm text-muted-foreground",children:"Overall Score"}),(0,t.jsx)("div",{className:`text-2xl font-bold ${W(e.overall_score)}`,children:e.overall_score.toFixed(1)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-sm text-muted-foreground",children:"Accuracy"}),(0,t.jsx)("div",{className:"text-lg font-semibold",children:Z(e.accuracy)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-sm text-muted-foreground",children:"Completeness"}),(0,t.jsx)("div",{className:"text-lg font-semibold",children:Z(e.completeness)})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-sm text-muted-foreground",children:"Violation Rate"}),(0,t.jsx)("div",{className:"text-lg font-semibold",children:Z(e.violation_rate)})]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mb-4 pt-4 border-t",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-sm text-muted-foreground",children:"Total Records"}),(0,t.jsx)("div",{className:"text-lg font-semibold",children:e.record_count})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-sm text-muted-foreground",children:"Valid"}),(0,t.jsx)("div",{className:"text-lg font-semibold text-green-600 dark:text-green-400",children:e.valid_count})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-sm text-muted-foreground",children:"Invalid"}),(0,t.jsx)("div",{className:"text-lg font-semibold text-red-600 dark:text-red-400",children:e.invalid_count})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-sm text-muted-foreground",children:"Violations"}),(0,t.jsx)("div",{className:"text-lg font-semibold text-orange-600 dark:text-orange-400",children:e.violation_count})]})]}),e.threshold_breaches&&e.threshold_breaches.length>0&&(0,t.jsxs)("div",{className:"mt-4 pt-4 border-t",children:[(0,t.jsx)("div",{className:"text-sm font-semibold text-orange-600 dark:text-orange-400 mb-2",children:"Threshold Breaches:"}),(0,t.jsx)("ul",{className:"list-disc list-inside text-sm text-muted-foreground space-y-1",children:e.threshold_breaches.map((e,a)=>(0,t.jsx)("li",{children:e},a))})]}),(0,t.jsx)("div",{className:"mt-4 pt-4 border-t flex gap-2",children:(0,t.jsx)(i.Button,{variant:"outline",size:"sm",onClick:()=>{C(e),G(e.schema_id)},disabled:q,children:q&&_?.id===e.id?"Loading...":"View Violations"})}),(0,t.jsxs)("div",{className:"mt-4 pt-4 border-t text-xs text-muted-foreground",children:[(0,t.jsxs)("div",{children:["Last Check: ",Y(e.check_timestamp)]}),e.data_fingerprint&&(0,t.jsxs)("div",{className:"mt-1",children:["Fingerprint: ",e.data_fingerprint.substring(0,16),"..."]})]})]})]},e.id))})]})}),_&&S.length>0&&(0,t.jsxs)(s.Card,{className:"mt-6",children:[(0,t.jsx)(s.CardHeader,{children:(0,t.jsxs)("div",{className:"flex justify-between items-start",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)(s.CardTitle,{children:["Violations for ",_.schema_id]}),(0,t.jsxs)(s.CardDescription,{children:[S.length," violation",1!==S.length?"s":""," found"]})]}),(0,t.jsx)(i.Button,{variant:"outline",size:"sm",onClick:()=>{C(null),$([])},children:"Close"})]})}),(0,t.jsx)(s.CardContent,{children:(0,t.jsx)("div",{className:"space-y-4 max-h-96 overflow-auto",children:S.map(e=>(0,t.jsxs)("div",{className:"border rounded-md p-4",children:[(0,t.jsxs)("div",{className:"flex justify-between items-start mb-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"font-semibold",children:["Record ID: ",e.record_id]}),(0,t.jsx)("div",{className:"text-sm text-muted-foreground",children:Y(e.timestamp)})]}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)("span",{className:`px-2 py-1 rounded text-xs ${"critical"===e.severity?"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200":"warning"===e.severity?"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200":"bg-gray-100 text-gray-800 dark:bg-gray-800 dark:text-gray-200"}`,children:e.severity}),(0,t.jsx)("span",{className:`px-2 py-1 rounded text-xs ${"resolved"===e.status?"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200":"bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200"}`,children:e.status})]})]}),(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsx)("div",{className:"text-sm font-semibold mb-1",children:"Field Violations:"}),(0,t.jsx)("ul",{className:"list-disc list-inside text-sm text-muted-foreground space-y-1",children:e.field_violations.map((e,a)=>(0,t.jsxs)("li",{children:[(0,t.jsx)("span",{className:"font-medium",children:e.field||"unknown"}),": ",e.message||e.error||"Validation error"]},a))})]})]},e.id))})})]})]})})]})}e.s(["default",()=>j],42033)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,33525,(e,r,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"warnOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},75254,e=>{"use strict";var r=e.i(71645);let t=(...e)=>e.filter((e,r,t)=>!!e&&""!==e.trim()&&t.indexOf(e)===r).join(" ").trim();var n={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let o=(0,r.forwardRef)(({color:e="currentColor",size:o=24,strokeWidth:a=2,absoluteStrokeWidth:s,className:i="",children:l,iconNode:u,...c},d)=>(0,r.createElement)("svg",{ref:d,...n,width:o,height:o,stroke:e,strokeWidth:s?24*Number(a)/Number(o):a,className:t("lucide",i),...c},[...u.map(([e,t])=>(0,r.createElement)(e,t)),...Array.isArray(l)?l:[l]])),a=(e,n)=>{let a=(0,r.forwardRef)(({className:a,...s},i)=>(0,r.createElement)(o,{ref:i,iconNode:n,className:t(`lucide-${e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,a),...s}));return a.displayName=`${e}`,a};e.s(["default",()=>a],75254)},19455,25913,e=>{"use strict";var r=e.i(43476),t=e.i(71645),n=e.i(7670);let o=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,a=n.clsx,s=(e,r)=>t=>{var n;if((null==r?void 0:r.variants)==null)return a(e,null==t?void 0:t.class,null==t?void 0:t.className);let{variants:s,defaultVariants:i}=r,l=Object.keys(s).map(e=>{let r=null==t?void 0:t[e],n=null==i?void 0:i[e];if(null===r)return null;let a=o(r)||o(n);return s[e][a]}),u=t&&Object.entries(t).reduce((e,r)=>{let[t,n]=r;return void 0===n||(e[t]=n),e},{});return a(e,l,null==r||null==(n=r.compoundVariants)?void 0:n.reduce((e,r)=>{let{class:t,className:n,...o}=r;return Object.entries(o).every(e=>{let[r,t]=e;return Array.isArray(t)?t.includes({...i,...u}[r]):({...i,...u})[r]===t})?[...e,t,n]:e},[]),null==t?void 0:t.class,null==t?void 0:t.className)};e.s(["cva",0,s],25913);var i=e.i(75157);let l=s("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),u=t.forwardRef(({className:e,variant:t,size:n,...o},a)=>(0,r.jsx)("button",{className:(0,i.cn)(l({variant:t,size:n,className:e})),ref:a,...o}));u.displayName="Button",e.s(["Button",()=>u],19455)},15288,e=>{"use strict";var r=e.i(43476),t=e.i(71645),n=e.i(75157);let o=t.forwardRef(({className:e,...t},o)=>(0,r.jsx)("div",{ref:o,className:(0,n.cn)("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));o.displayName="Card";let a=t.forwardRef(({className:e,...t},o)=>(0,r.jsx)("div",{ref:o,className:(0,n.cn)("flex flex-col space-y-1.5 p-6",e),...t}));a.displayName="CardHeader";let s=t.forwardRef(({className:e,...t},o)=>(0,r.jsx)("h3",{ref:o,className:(0,n.cn)("text-2xl font-semibold leading-none tracking-tight",e),...t}));s.displayName="CardTitle";let i=t.forwardRef(({className:e,...t},o)=>(0,r.jsx)("p",{ref:o,className:(0,n.cn)("text-sm text-muted-foreground",e),...t}));i.displayName="CardDescription";let l=t.forwardRef(({className:e,...t},o)=>(0,r.jsx)("div",{ref:o,className:(0,n.cn)("p-6 pt-0",e),...t}));l.displayName="CardContent",t.forwardRef(({className:e,...t},o)=>(0,r.jsx)("div",{ref:o,className:(0,n.cn)("flex items-center p-6 pt-0",e),...t})).displayName="CardFooter",e.s(["Card",()=>o,"CardContent",()=>l,"CardDescription",()=>i,"CardHeader",()=>a,"CardTitle",()=>s])},39616,e=>{"use strict";let r=(0,e.i(75254).default)("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);e.s(["Settings",()=>r],39616)},64659,e=>{"use strict";let r=(0,e.i(75254).default)("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);e.s(["ChevronDown",()=>r],64659)},98183,(e,r,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={assign:function(){return l},searchParamsToUrlQuery:function(){return a},urlQueryToSearchParams:function(){return i}};for(var o in n)Object.defineProperty(t,o,{enumerable:!0,get:n[o]});function a(e){let r={};for(let[t,n]of e.entries()){let e=r[t];void 0===e?r[t]=n:Array.isArray(e)?e.push(n):r[t]=[e,n]}return r}function s(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function i(e){let r=new URLSearchParams;for(let[t,n]of Object.entries(e))if(Array.isArray(n))for(let e of n)r.append(t,s(e));else r.set(t,s(n));return r}function l(e,...r){for(let t of r){for(let r of t.keys())e.delete(r);for(let[r,n]of t.entries())e.append(r,n)}return e}},95057,(e,r,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={formatUrl:function(){return i},formatWithValidation:function(){return u},urlObjectKeys:function(){return l}};for(var o in n)Object.defineProperty(t,o,{enumerable:!0,get:n[o]});let a=e.r(90809)._(e.r(98183)),s=/https?|ftp|gopher|file/;function i(e){let{auth:r,hostname:t}=e,n=e.protocol||"",o=e.pathname||"",i=e.hash||"",l=e.query||"",u=!1;r=r?encodeURIComponent(r).replace(/%3A/i,":")+"@":"",e.host?u=r+e.host:t&&(u=r+(~t.indexOf(":")?`[${t}]`:t),e.port&&(u+=":"+e.port)),l&&"object"==typeof l&&(l=String(a.urlQueryToSearchParams(l)));let c=e.search||l&&`?${l}`||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||s.test(n))&&!1!==u?(u="//"+(u||""),o&&"/"!==o[0]&&(o="/"+o)):u||(u=""),i&&"#"!==i[0]&&(i="#"+i),c&&"?"!==c[0]&&(c="?"+c),o=o.replace(/[?#]/g,encodeURIComponent),c=c.replace("#","%23"),`${n}${u}${o}${c}${i}`}let l=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function u(e){return i(e)}},18581,(e,r,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"useMergedRef",{enumerable:!0,get:function(){return o}});let n=e.r(71645);function o(e,r){let t=(0,n.useRef)(null),o=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=t.current;e&&(t.current=null,e());let r=o.current;r&&(o.current=null,r())}else e&&(t.current=a(e,n)),r&&(o.current=a(r,n))},[e,r])}function a(e,r){if("function"!=typeof e)return e.current=r,()=>{e.current=null};{let t=e(r);return"function"==typeof t?t:()=>e(null)}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),r.exports=t.default)},18967,(e,r,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={DecodeError:function(){return x},MiddlewareNotFoundError:function(){return j},MissingStaticPage:function(){return b},NormalizeError:function(){return v},PageNotFoundError:function(){return y},SP:function(){return h},ST:function(){return g},WEB_VITALS:function(){return a},execOnce:function(){return s},getDisplayName:function(){return d},getLocationOrigin:function(){return u},getURL:function(){return c},isAbsoluteUrl:function(){return l},isResSent:function(){return f},loadGetInitialProps:function(){return p},normalizeRepeatedSlashes:function(){return m},stringifyError:function(){return N}};for(var o in n)Object.defineProperty(t,o,{enumerable:!0,get:n[o]});let a=["CLS","FCP","FID","INP","LCP","TTFB"];function s(e){let r,t=!1;return(...n)=>(t||(t=!0,r=e(...n)),r)}let i=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,l=e=>i.test(e);function u(){let{protocol:e,hostname:r,port:t}=window.location;return`${e}//${r}${t?":"+t:""}`}function c(){let{href:e}=window.location,r=u();return e.substring(r.length)}function d(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function f(e){return e.finished||e.headersSent}function m(e){let r=e.split("?");return r[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(r[1]?`?${r.slice(1).join("?")}`:"")}async function p(e,r){let t=r.res||r.ctx&&r.ctx.res;if(!e.getInitialProps)return r.ctx&&r.Component?{pageProps:await p(r.Component,r.ctx)}:{};let n=await e.getInitialProps(r);if(t&&f(t))return n;if(!n)throw Object.defineProperty(Error(`"${d(e)}.getInitialProps()" should resolve to an object. But found "${n}" instead.`),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return n}let h="undefined"!=typeof performance,g=h&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class x extends Error{}class v extends Error{}class y extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class b extends Error{constructor(e,r){super(),this.message=`Failed to load static file for page: ${e} ${r}`}}class j extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function N(e){return JSON.stringify({message:e.message,stack:e.stack})}},73668,(e,r,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isLocalURL",{enumerable:!0,get:function(){return a}});let n=e.r(18967),o=e.r(52817);function a(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let r=(0,n.getLocationOrigin)(),t=new URL(e,r);return t.origin===r&&(0,o.hasBasePath)(t.pathname)}catch(e){return!1}}},84508,(e,r,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"errorOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},22016,(e,r,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={default:function(){return x},useLinkStatus:function(){return y}};for(var o in n)Object.defineProperty(t,o,{enumerable:!0,get:n[o]});let a=e.r(90809),s=e.r(43476),i=a._(e.r(71645)),l=e.r(95057),u=e.r(8372),c=e.r(18581),d=e.r(18967),f=e.r(5550);e.r(33525);let m=e.r(91949),p=e.r(73668),h=e.r(9396);function g(e){return"string"==typeof e?e:(0,l.formatUrl)(e)}function x(r){var t;let n,o,a,[l,x]=(0,i.useOptimistic)(m.IDLE_LINK_STATUS),y=(0,i.useRef)(null),{href:b,as:j,children:N,prefetch:w=null,passHref:C,replace:k,shallow:P,scroll:E,onClick:O,onMouseEnter:S,onTouchStart:_,legacyBehavior:R=!1,onNavigate:T,ref:L,unstable_dynamicOnHover:M,...A}=r;n=N,R&&("string"==typeof n||"number"==typeof n)&&(n=(0,s.jsx)("a",{children:n}));let $=i.default.useContext(u.AppRouterContext),U=!1!==w,D=!1!==w?null===(t=w)||"auto"===t?h.FetchStrategy.PPR:h.FetchStrategy.Full:h.FetchStrategy.PPR,{href:B,as:I}=i.default.useMemo(()=>{let e=g(b);return{href:e,as:j?g(j):e}},[b,j]);if(R){if(n?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`<Link legacyBehavior>` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `<a>` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});o=i.default.Children.only(n)}let F=R?o&&"object"==typeof o&&o.ref:L,z=i.default.useCallback(e=>(null!==$&&(y.current=(0,m.mountLinkInstance)(e,B,$,D,U,x)),()=>{y.current&&((0,m.unmountLinkForCurrentNavigation)(y.current),y.current=null),(0,m.unmountPrefetchableInstance)(e)}),[U,B,$,D,x]),K={ref:(0,c.useMergedRef)(z,F),onClick(r){R||"function"!=typeof O||O(r),R&&o.props&&"function"==typeof o.props.onClick&&o.props.onClick(r),!$||r.defaultPrevented||function(r,t,n,o,a,s,l){if("undefined"!=typeof window){let u,{nodeName:c}=r.currentTarget;if("A"===c.toUpperCase()&&((u=r.currentTarget.getAttribute("target"))&&"_self"!==u||r.metaKey||r.ctrlKey||r.shiftKey||r.altKey||r.nativeEvent&&2===r.nativeEvent.which)||r.currentTarget.hasAttribute("download"))return;if(!(0,p.isLocalURL)(t)){a&&(r.preventDefault(),location.replace(t));return}if(r.preventDefault(),l){let e=!1;if(l({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:d}=e.r(99781);i.default.startTransition(()=>{d(n||t,a?"replace":"push",s??!0,o.current)})}}(r,B,I,y,k,E,T)},onMouseEnter(e){R||"function"!=typeof S||S(e),R&&o.props&&"function"==typeof o.props.onMouseEnter&&o.props.onMouseEnter(e),$&&U&&(0,m.onNavigationIntent)(e.currentTarget,!0===M)},onTouchStart:function(e){R||"function"!=typeof _||_(e),R&&o.props&&"function"==typeof o.props.onTouchStart&&o.props.onTouchStart(e),$&&U&&(0,m.onNavigationIntent)(e.currentTarget,!0===M)}};return(0,d.isAbsoluteUrl)(I)?K.href=I:R&&!C&&("a"!==o.type||"href"in o.props)||(K.href=(0,f.addBasePath)(I)),a=R?i.default.cloneElement(o,K):(0,s.jsx)("a",{...A,...K,children:n}),(0,s.jsx)(v.Provider,{value:l,children:a})}e.r(84508);let v=(0,i.createContext)(m.IDLE_LINK_STATUS),y=()=>(0,i.useContext)(v);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),r.exports=t.default)},46417,e=>{"use strict";var r=e.i(43476),t=e.i(71645),n=e.i(19455),o=e.i(15288);class a extends t.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,r){console.error("ErrorBoundary caught an error:",e,r)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:(0,r.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-background p-4",children:(0,r.jsxs)(o.Card,{className:"max-w-md w-full",children:[(0,r.jsx)(o.CardHeader,{children:(0,r.jsx)(o.CardTitle,{className:"text-destructive",children:"Something went wrong"})}),(0,r.jsxs)(o.CardContent,{children:[(0,r.jsx)("p",{className:"text-muted-foreground mb-4",children:this.state.error?.message||"An unexpected error occurred"}),(0,r.jsx)(n.Button,{onClick:()=>{this.setState({hasError:!1,error:void 0}),window.location.reload()},children:"Reload Page"})]})]})}):this.props.children}}e.s(["default",()=>a])},18566,(e,r,t)=>{r.exports=e.r(76562)},88589,e=>{"use strict";var r=e.i(43476),t=e.i(71645),n=e.i(22016),o=e.i(18566),a=e.i(75157);let s="/settings",i=(0,e.i(75254).default)("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);var l=e.i(39616),u=e.i(64659);let c=[{name:"Contracts",href:"/contracts"},{name:"Schemas",href:"/schemas"},{name:"Metadata",href:"/metadata"},{name:"Rules",href:"/rules"},{name:"Validation",href:"/validation"},{name:"ETL",href:"/etl"},{name:"Quality",href:"/quality"},{name:"Documentation",href:"/documentation"}];function d(){let e=(0,o.usePathname)(),[d,f]=(0,t.useState)(!1),[m,p]=(0,t.useState)(!1),h=(0,t.useRef)(null);return(0,t.useEffect)(()=>{let e=e=>{h.current&&!h.current.contains(e.target)&&p(!1)};return m&&document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[m]),(0,r.jsxs)("nav",{className:"border-b bg-background sticky top-0 z-50",children:[(0,r.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,r.jsxs)("div",{className:"flex justify-between h-16",children:[(0,r.jsxs)("div",{className:"flex",children:[(0,r.jsx)(n.default,{href:"/",className:"flex items-center",children:(0,r.jsx)("span",{className:"text-xl font-bold text-primary",children:"PyCharter"})}),(0,r.jsx)("div",{className:"hidden sm:ml-6 sm:flex sm:space-x-8",children:c.map(t=>{let o=e===t.href;return(0,r.jsx)(n.default,{href:t.href,className:(0,a.cn)("inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium transition-colors",o?"border-primary text-foreground":"border-transparent text-muted-foreground hover:border-gray-300 hover:text-foreground"),children:t.name},t.name)})})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsxs)("div",{className:"hidden sm:block relative",ref:h,children:[(0,r.jsxs)("button",{type:"button",onClick:()=>p(!m),className:"inline-flex items-center gap-2 px-3 py-2 rounded-md text-sm font-medium text-muted-foreground hover:text-foreground hover:bg-muted focus:outline-none focus:ring-2 focus:ring-inset focus:ring-primary transition-colors","aria-expanded":m,"aria-haspopup":"true",children:[(0,r.jsx)(i,{className:"h-5 w-5"}),(0,r.jsx)(u.ChevronDown,{className:(0,a.cn)("h-4 w-4 transition-transform",m&&"rotate-180")})]}),m&&(0,r.jsx)("div",{className:"absolute right-0 mt-2 w-48 rounded-md shadow-lg bg-background border border-border ring-1 ring-black ring-opacity-5 z-50",children:(0,r.jsxs)("div",{className:"py-1",role:"menu","aria-orientation":"vertical",children:[(0,r.jsxs)(n.default,{href:"/profile",onClick:()=>p(!1),className:"flex items-center gap-2 px-4 py-2 text-sm text-foreground hover:bg-muted transition-colors",role:"menuitem",children:[(0,r.jsx)(i,{className:"h-4 w-4"}),"User Profile"]}),(0,r.jsxs)(n.default,{href:s,onClick:()=>p(!1),className:"flex items-center gap-2 px-4 py-2 text-sm text-foreground hover:bg-muted transition-colors",role:"menuitem",children:[(0,r.jsx)(l.Settings,{className:"h-4 w-4"}),"Settings"]})]})})]}),(0,r.jsx)("div",{className:"flex items-center sm:hidden",children:(0,r.jsxs)("button",{type:"button",className:"inline-flex items-center justify-center p-2 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted focus:outline-none focus:ring-2 focus:ring-inset focus:ring-primary","aria-controls":"mobile-menu","aria-expanded":"false",onClick:()=>f(!d),children:[(0,r.jsx)("span",{className:"sr-only",children:"Open main menu"}),d?(0,r.jsx)("svg",{className:"block h-6 w-6",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}):(0,r.jsx)("svg",{className:"block h-6 w-6",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})]})})]})]})}),d&&(0,r.jsx)("div",{className:"sm:hidden",id:"mobile-menu",children:(0,r.jsxs)("div",{className:"pt-2 pb-3 space-y-1 px-4 border-t",children:[c.map(t=>{let o=e===t.href;return(0,r.jsx)(n.default,{href:t.href,onClick:()=>f(!1),className:(0,a.cn)("block px-3 py-2 rounded-md text-base font-medium transition-colors",o?"bg-primary/10 text-primary border-l-4 border-primary":"text-muted-foreground hover:bg-muted hover:text-foreground"),children:t.name},t.name)}),(0,r.jsxs)("div",{className:"border-t border-border mt-2 pt-2",children:[(0,r.jsxs)(n.default,{href:"/profile",onClick:()=>f(!1),className:"flex items-center gap-2 px-3 py-2 rounded-md text-base font-medium text-muted-foreground hover:bg-muted hover:text-foreground transition-colors",children:[(0,r.jsx)(i,{className:"h-5 w-5"}),"User Profile"]}),(0,r.jsxs)(n.default,{href:s,onClick:()=>f(!1),className:"flex items-center gap-2 px-3 py-2 rounded-md text-base font-medium text-muted-foreground hover:bg-muted hover:text-foreground transition-colors",children:[(0,r.jsx)(l.Settings,{className:"h-5 w-5"}),"Settings"]})]})]})})]})}e.s(["default",()=>d],88589)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,55824,16370,e=>{"use strict";var t=e.i(43476);function a({title:e,description:a,actions:s}){return(0,t.jsxs)("div",{className:"mb-4 flex justify-between items-center",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"text-2xl font-bold text-foreground mb-1",children:e}),a&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:a})]}),s&&(0,t.jsx)("div",{className:"flex gap-2",children:s})]})}e.s(["PageHeader",()=>a],16370),e.s([],55824)},61246,e=>{"use strict";var t=e.i(43476),a=e.i(75157);function s({className:e,...s}){return(0,t.jsx)("div",{className:(0,a.cn)("animate-pulse rounded-md bg-muted",e),...s})}function r({size:e="md",className:s}){return(0,t.jsx)("div",{className:(0,a.cn)("flex items-center justify-center",s),children:(0,t.jsx)("div",{className:(0,a.cn)("animate-spin rounded-full border-2 border-muted border-t-primary",{sm:"h-4 w-4",md:"h-8 w-8",lg:"h-12 w-12"}[e])})})}function i({message:e="Loading..."}){return(0,t.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-background",children:(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)(r,{size:"lg",className:"mb-4"}),(0,t.jsx)("p",{className:"text-muted-foreground",children:e})]})})}function l(){return(0,t.jsxs)("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[(0,t.jsx)(s,{className:"h-6 w-3/4"}),(0,t.jsx)(s,{className:"h-4 w-full"}),(0,t.jsx)(s,{className:"h-4 w-5/6"}),(0,t.jsxs)("div",{className:"flex gap-2 mt-4",children:[(0,t.jsx)(s,{className:"h-9 w-20"}),(0,t.jsx)(s,{className:"h-9 w-20"})]})]})}function n({rows:e=5}){return(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(s,{className:"h-10 w-full"}),Array.from({length:e}).map((e,a)=>(0,t.jsx)(s,{className:"h-12 w-full"},a))]})}e.s(["CardSkeleton",()=>l,"PageLoading",()=>i,"TableSkeleton",()=>n,"default",()=>r],61246)},43668,e=>{"use strict";var t=e.i(47167);let a="pycharter_settings",s={apiServer:{url:t.default.env.NEXT_PUBLIC_API_URL||"http://localhost:8000"},database:{enabled:!1},dlq:{enabled:!1}};function r(){try{let e=localStorage.getItem(a);if(e){let t=JSON.parse(e);return{...s,...t,apiServer:{...s.apiServer,...t.apiServer},database:{...s.database,...t.database},dlq:{...s.dlq,...t.dlq}}}}catch(e){console.error("Failed to load settings:",e)}return s}function i(e){try{localStorage.setItem(a,JSON.stringify(e))}catch(e){throw console.error("Failed to save settings:",e),e}}function l(){return r().apiServer.url||s.apiServer.url}e.s(["getApiBaseUrl",()=>l,"getSettings",()=>r,"saveSettings",()=>i])},9165,e=>{"use strict";var t=e.i(43668);class a extends Error{status;response;constructor(e,t,a){super(e),this.status=t,this.response=a,this.name="ApiError"}}async function s(e,s){let r=`${(0,t.getApiBaseUrl)()}${e}`;try{let e=await fetch(r,{...s,headers:{"Content-Type":"application/json",...s?.headers}});if(!e.ok){let t;try{t=await e.json()}catch{t={detail:e.statusText}}let s=t.detail||`API request failed: ${e.statusText}`;throw 422===e.status&&t.details&&Array.isArray(t.details)&&(s=t.details.map(e=>{let t=e.loc?.join(".")||e.field||"field",a=e.msg||e.message||"validation error";return`${t}: ${a}`}).join("; ")||s),new a(s,e.status,t)}let t=e.headers.get("content-type");if(t&&t.includes("application/json"))return e.json();return e.text()}catch(s){if(s instanceof TypeError&&"Failed to fetch"===s.message){let s=(0,t.getApiBaseUrl)();throw new a(`Unable to connect to API server at ${s}. Please ensure the API server is running and the URL is correct.`,0,{originalError:"NetworkError",apiUrl:s,endpoint:e,suggestion:"Check your API server settings in the Settings page"})}throw s}}async function r(e){return s(e,{method:"GET"})}async function i(e,t){return s(e,{method:"POST",body:t?JSON.stringify(t):void 0})}async function l(e,t){return s(e,{method:"PUT",body:t?JSON.stringify(t):void 0})}async function n(e,s){let r=`${(0,t.getApiBaseUrl)()}${e}`,i=await fetch(r,{method:"POST",body:s});if(!i.ok){let e;try{e=await i.json()}catch{e={detail:i.statusText}}throw new a(e.detail||`API request failed: ${i.statusText}`,i.status,e)}let l=i.headers.get("content-type");return l&&l.includes("application/json")?i.json():i.text()}async function c(e){let s=`${(0,t.getApiBaseUrl)()}${e}`,r=await fetch(s,{method:"GET"});if(!r.ok){let e;try{e=await r.json()}catch{e={detail:r.statusText}}throw new a(e.detail||`API request failed: ${r.statusText}`,r.status,e)}return r.blob()}e.s(["ApiError",()=>a,"api",0,{contracts:{list:()=>r("/api/v1/contracts"),get:e=>r(`/api/v1/contracts/${e}`),parse:e=>i("/api/v1/contracts/parse",{contract:e}),parseFile:(e,t)=>{let a=new FormData;return a.append("file",e),void 0!==t&&a.append("validate",String(t)),n("/api/v1/contracts/parse/upload",a)},build:e=>i("/api/v1/contracts/build",e),buildFromId:(e,t)=>{let a=new URLSearchParams;t?.include_metadata!==void 0&&a.append("include_metadata",String(t.include_metadata)),t?.include_ownership!==void 0&&a.append("include_ownership",String(t.include_ownership)),t?.include_governance!==void 0&&a.append("include_governance",String(t.include_governance));let s=a.toString();return i(`/api/v1/contracts/${e}/build${s?`?${s}`:""}`,{})},createFromArtifacts:e=>i("/api/v1/contracts/create-from-artifacts",e),createMixed:e=>i("/api/v1/contracts/create-mixed",e),update:(e,t)=>l(`/api/v1/contracts/${e}`,t)},metadata:{listSchemas:()=>r("/api/v1/metadata/schemas"),getSchema:(e,t)=>{let a=t?`?version=${t}`:"";return r(`/api/v1/metadata/schemas/${e}${a}`)},getCompleteSchema:(e,t)=>{let a=t?`?version=${t}`:"";return r(`/api/v1/metadata/schemas/${e}/complete${a}`)},storeSchema:e=>i("/api/v1/metadata/schemas",e),getMetadata:(e,t)=>{let a=t?`?version=${t}`:"";return r(`/api/v1/metadata/metadata/${e}${a}`)},storeMetadata:e=>i("/api/v1/metadata/metadata",e),getCoercionRules:(e,t)=>{let a=t?`?version=${t}`:"";return r(`/api/v1/metadata/coercion-rules/${e}${a}`)},storeCoercionRules:e=>i("/api/v1/metadata/coercion-rules",e),getValidationRules:(e,t)=>{let a=t?`?version=${t}`:"";return r(`/api/v1/metadata/validation-rules/${e}${a}`)},storeValidationRules:e=>i("/api/v1/metadata/validation-rules",e),getEntityList:e=>r(`/api/v1/metadata/${e}`),createEntity:(e,t)=>i(`/api/v1/metadata/${e}`,t),updateEntity:(e,t,a)=>l(`/api/v1/metadata/${e}/${t}`,a),listArtifacts:()=>r("/api/v1/metadata/artifacts")},validation:{validate:e=>i("/api/v1/validation/validate",e),validateBatch:e=>i("/api/v1/validation/validate-batch",e)},schemas:{generate:e=>i("/api/v1/schemas/generate",e),convert:e=>i("/api/v1/schemas/convert",e)},quality:{listMetrics:e=>{let t=new URLSearchParams;e?.schema_id&&t.append("schema_id",e.schema_id),e?.limit&&t.append("limit",e.limit.toString()),e?.offset&&t.append("offset",e.offset.toString());let a=t.toString();return r(`/api/v1/quality/metrics${a?`?${a}`:""}`)},getMetric:e=>r(`/api/v1/quality/metrics/${e}`),getReport:(e,t)=>{let a=new URLSearchParams;t?.data_source&&a.append("data_source",t.data_source),t?.limit&&a.append("limit",t.limit.toString());let s=a.toString();return r(`/api/v1/quality/reports/${e}${s?`?${s}`:""}`)},check:e=>i("/api/v1/quality/check",e),checkUpload:(e,t)=>{let a=new FormData;return a.append("file",e),t.schema_id&&a.append("schema_id",t.schema_id),t.contract&&a.append("contract",t.contract),void 0!==t.record_violations&&a.append("record_violations",String(t.record_violations)),void 0!==t.calculate_metrics&&a.append("calculate_metrics",String(t.calculate_metrics)),void 0!==t.check_thresholds&&a.append("check_thresholds",String(t.check_thresholds)),t.thresholds&&a.append("thresholds",t.thresholds),void 0!==t.include_field_metrics&&a.append("include_field_metrics",String(t.include_field_metrics)),void 0!==t.sample_size&&a.append("sample_size",String(t.sample_size)),t.data_source&&a.append("data_source",t.data_source),t.data_version&&a.append("data_version",t.data_version),n("/api/v1/quality/check/upload",a)},queryViolations:e=>i("/api/v1/quality/violations",e)},templates:{downloadSchema:()=>c("/api/v1/templates/schema"),downloadContractArtifacts:()=>c("/api/v1/templates/contract-artifacts"),listEtlTemplates:()=>s("/api/v1/templates/etl"),downloadEtlTemplate:async e=>{let s=(0,t.getApiBaseUrl)().replace(/\/$/,""),r=await fetch(`${s}/api/v1/templates/etl/${encodeURIComponent(e)}`);if(!r.ok)throw new a(await r.text()||r.statusText,r.status);return r.text()}},settings:{testDatabase:e=>i("/api/v1/settings/test-database",e),testDlq:e=>i("/api/v1/settings/test-dlq",e),getDlqStats:e=>i("/api/v1/settings/dlq-stats",e)}}])},63209,e=>{"use strict";let t=(0,e.i(75254).default)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);e.s(["AlertCircle",()=>t],63209)},95113,e=>{"use strict";var t=e.i(43476),a=e.i(63209),s=e.i(9165),r=e.i(75157);function i({error:e,title:i="Error",className:l}){if(!e)return null;let n=e instanceof s.ApiError,c=n?e.message:e.message||"An unexpected error occurred";return(0,t.jsx)("div",{className:(0,r.cn)("rounded-lg border border-destructive/50 bg-destructive/10 p-4",l),children:(0,t.jsxs)("div",{className:"flex",children:[(0,t.jsx)(a.AlertCircle,{className:"h-5 w-5 text-destructive flex-shrink-0 mt-0.5"}),(0,t.jsxs)("div",{className:"ml-3",children:[(0,t.jsx)("h3",{className:"text-sm font-medium text-destructive",children:i}),(0,t.jsxs)("div",{className:"mt-2 text-sm text-destructive/90",children:[(0,t.jsx)("p",{children:c}),n&&e.status&&(0,t.jsxs)("p",{className:"mt-1 text-xs opacity-75",children:["Status: ",e.status]})]})]})]})})}e.s(["default",()=>i])},88511,e=>{"use strict";let t=(0,e.i(75254).default)("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);e.s(["Edit",()=>t],88511)},40160,e=>{"use strict";let t=(0,e.i(75254).default)("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);e.s(["Download",()=>t],40160)},65937,e=>{"use strict";var t=e.i(43476),a=e.i(71645),s=e.i(15288),r=e.i(19455),i=e.i(61246),l=e.i(95113);e.i(55824);var n=e.i(16370),c=e.i(9165),d=e.i(75157),o=e.i(40160),m=e.i(88511);let h=(0,e.i(75254).default)("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);function u(){let{schemas:e,loading:u,error:p,refetch:x}=function(){let[e,t]=(0,a.useState)([]),[s,r]=(0,a.useState)(!0),[i,l]=(0,a.useState)(null),n=(0,a.useCallback)(async()=>{try{r(!0),l(null);let e=await c.api.metadata.listSchemas();t(e.schemas||[])}catch(t){let e=t instanceof c.ApiError||t instanceof Error?t.message:"Failed to load schemas";l(e),console.error("Error loading schemas:",t),t instanceof c.ApiError&&0===t.status&&console.warn("API server connection issue:",e)}finally{r(!1)}},[]);return(0,a.useEffect)(()=>{n()},[n]),{schemas:e,loading:s,error:i,refetch:n}}(),[v,g]=(0,a.useState)(null),[f,j]=(0,a.useState)(null),[y,b]=(0,a.useState)(!1),[N,w]=(0,a.useState)(null),[S,_]=(0,a.useState)(!1),[C,$]=(0,a.useState)(null),[k,A]=(0,a.useState)(!1);if(u)return(0,t.jsx)(i.PageLoading,{message:"Loading schemas..."});let E=async e=>{try{b(!0),w(null);let t=await c.api.metadata.getSchema(e.id,e.version);j(t),g(e)}catch(e){w(e.message||"Failed to load schema details"),console.error("Error loading schema details:",e)}finally{b(!1)}},T=async e=>{e.preventDefault();let t=new FormData(e.currentTarget),a=t.get("schema_json"),s=t.get("model_name")||"DynamicModel";try{let e=JSON.parse(a),t=await c.api.schemas.generate({schema:e,model_name:s});$(t),_(!1),await x()}catch(e){console.error("Error generating schema:",e),alert(e.message||"Failed to generate schema")}},P=async()=>{try{A(!0);let e=await c.api.templates.downloadSchema();(0,d.downloadBlob)(e,"template_schema.yaml")}catch(e){console.error("Error downloading schema template:",e),alert(e.message||"Failed to download schema template")}finally{A(!1)}};return u?(0,t.jsx)(i.PageLoading,{message:"Loading schemas..."}):(0,t.jsx)("div",{className:"min-h-screen bg-background",children:(0,t.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-6",children:[(0,t.jsx)(n.PageHeader,{title:"Schemas",description:"Manage your data schemas",actions:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(r.Button,{variant:"outline",onClick:P,disabled:k,title:"Download schema template",children:[(0,t.jsx)(o.Download,{className:`h-4 w-4 mr-2 ${k?"animate-pulse":""}`}),k?"Downloading...":"Download Template"]}),(0,t.jsx)(r.Button,{onClick:()=>_(!S),children:S?"Cancel":"Generate Schema"})]})}),p&&(0,t.jsxs)("div",{className:"mb-6",children:[(0,t.jsx)(l.default,{error:Error(p),title:"Failed to load schemas"}),(0,t.jsx)(r.Button,{onClick:x,variant:"outline",className:"mt-4",children:"Retry"})]}),S&&(0,t.jsxs)(s.Card,{className:"mb-6",children:[(0,t.jsxs)(s.CardHeader,{children:[(0,t.jsx)(s.CardTitle,{children:"Generate Schema from JSON Schema"}),(0,t.jsx)(s.CardDescription,{children:"Provide a JSON Schema definition to generate a Pydantic model"})]}),(0,t.jsx)(s.CardContent,{children:(0,t.jsxs)("form",{onSubmit:T,className:"space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{htmlFor:"model_name",className:"block text-sm font-medium mb-2",children:"Model Name"}),(0,t.jsx)("input",{type:"text",id:"model_name",name:"model_name",defaultValue:"DynamicModel",className:"w-full px-3 py-2 border rounded-md",placeholder:"DynamicModel"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{htmlFor:"schema_json",className:"block text-sm font-medium mb-2",children:"JSON Schema"}),(0,t.jsx)("textarea",{id:"schema_json",name:"schema_json",rows:10,className:"w-full px-3 py-2 border rounded-md font-mono text-sm",placeholder:'{"type": "object", "properties": {"name": {"type": "string"}}}',required:!0})]}),(0,t.jsx)(r.Button,{type:"submit",children:"Generate"})]})})]}),C&&(0,t.jsxs)(s.Card,{className:"mb-6",children:[(0,t.jsxs)(s.CardHeader,{children:[(0,t.jsxs)(s.CardTitle,{children:["Generated Model: ",C.model_name]}),(0,t.jsx)(s.CardDescription,{children:C.message})]}),(0,t.jsx)(s.CardContent,{children:(0,t.jsx)("pre",{className:"bg-muted p-4 rounded-md overflow-auto text-sm",children:JSON.stringify(C.schema_json,null,2)})})]}),0===e.length&&!u&&!p&&(0,t.jsx)(s.Card,{children:(0,t.jsxs)(s.CardContent,{className:"text-center py-12",children:[(0,t.jsx)("p",{className:"text-muted-foreground mb-4",children:"No schemas found"}),(0,t.jsx)(r.Button,{onClick:()=>_(!0),children:"Generate Schema"})]})}),e.length>0&&(0,t.jsxs)(s.Card,{children:[(0,t.jsx)(s.CardHeader,{children:(0,t.jsxs)("div",{className:"flex justify-between items-center",children:[(0,t.jsx)(s.CardTitle,{children:"Schemas"}),(0,t.jsx)(r.Button,{onClick:()=>_(!S),size:"sm",children:"Generate Schema"})]})}),(0,t.jsx)(s.CardContent,{children:(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)("table",{className:"w-full border-collapse",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{className:"border-b bg-muted/50",children:[(0,t.jsx)("th",{className:"px-4 py-2 text-left text-sm font-semibold text-foreground",children:"ID"}),(0,t.jsx)("th",{className:"px-4 py-2 text-left text-sm font-semibold text-foreground",children:"Title"}),(0,t.jsx)("th",{className:"px-4 py-2 text-left text-sm font-semibold text-foreground",children:"Version"}),(0,t.jsx)("th",{className:"px-4 py-2 text-left text-sm font-semibold text-foreground w-32",children:"Actions"})]})}),(0,t.jsx)("tbody",{children:e.map(e=>(0,t.jsxs)("tr",{className:"hover:bg-muted/50",children:[(0,t.jsx)("td",{className:"px-4 py-2 text-sm border-b",children:(0,t.jsx)("span",{className:"font-mono text-xs",children:e.id})}),(0,t.jsx)("td",{className:"px-4 py-2 text-sm border-b",children:e.title||e.id}),(0,t.jsx)("td",{className:"px-4 py-2 text-sm border-b",children:e.version||"N/A"}),(0,t.jsx)("td",{className:"px-4 py-2 text-sm border-b",children:(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(r.Button,{variant:"ghost",size:"sm",onClick:()=>E(e),disabled:y&&v?.id===e.id,className:"h-8 w-8 p-0",title:"View Details",children:(0,t.jsx)(h,{className:"h-4 w-4"})}),(0,t.jsx)(r.Button,{variant:"ghost",size:"sm",onClick:()=>{console.log("Edit schema:",e)},className:"h-8 w-8 p-0",title:"Edit",children:(0,t.jsx)(m.Edit,{className:"h-4 w-4"})})]})})]},e.id))})]})})})]}),v&&(0,t.jsxs)(s.Card,{children:[(0,t.jsx)(s.CardHeader,{children:(0,t.jsxs)("div",{className:"flex justify-between items-start",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)(s.CardTitle,{children:["Schema Details: ",v.title||v.id]}),(0,t.jsxs)(s.CardDescription,{children:["Version: ",v.version||"N/A"]})]}),(0,t.jsx)(r.Button,{variant:"outline",size:"sm",onClick:()=>{g(null),j(null),w(null)},children:"Close"})]})}),(0,t.jsxs)(s.CardContent,{children:[N&&(0,t.jsxs)("div",{className:"mb-4",children:[(0,t.jsx)(l.default,{error:Error(N),title:"Failed to load schema details"}),(0,t.jsx)(r.Button,{onClick:()=>E(v),variant:"outline",className:"mt-4",children:"Retry"})]}),y&&(0,t.jsx)("div",{className:"flex justify-center items-center py-8",children:(0,t.jsx)(i.PageLoading,{message:"Loading schema details..."})}),f&&!y&&!N&&(0,t.jsx)("div",{className:"space-y-4",children:(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold mb-2",children:"Schema Definition"}),(0,t.jsx)("pre",{className:"bg-muted p-4 rounded-md overflow-auto text-sm max-h-96",children:JSON.stringify(f.schema,null,2)})]})})]})]})]})})}e.s(["default",()=>u],65937)}]);