@theobourgeois/ytdb 0.2.8 → 0.2.9

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 (166) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +2 -1
  3. package/.next/build-manifest.json +6 -6
  4. package/.next/prerender-manifest.json +3 -3
  5. package/.next/routes-manifest.json +9 -0
  6. package/.next/server/app/[connectionId]/[schema]/[table]/page.js +1 -1
  7. package/.next/server/app/[connectionId]/[schema]/[table]/page_client-reference-manifest.js +1 -1
  8. package/.next/server/app/[connectionId]/diff/page.js +2 -2
  9. package/.next/server/app/[connectionId]/diff/page_client-reference-manifest.js +1 -1
  10. package/.next/server/app/[connectionId]/migrations/[setId]/page.js +1 -0
  11. package/.next/server/app/[connectionId]/migrations/[setId]/page.js.nft.json +1 -0
  12. package/.next/server/app/[connectionId]/migrations/[setId]/page_client-reference-manifest.js +1 -0
  13. package/.next/server/app/[connectionId]/migrations/page.js +1 -1
  14. package/.next/server/app/[connectionId]/migrations/page.js.nft.json +1 -1
  15. package/.next/server/app/[connectionId]/migrations/page_client-reference-manifest.js +1 -1
  16. package/.next/server/app/[connectionId]/page.js +1 -1
  17. package/.next/server/app/[connectionId]/page_client-reference-manifest.js +1 -1
  18. package/.next/server/app/[connectionId]/query/page.js +1 -1
  19. package/.next/server/app/[connectionId]/query/page_client-reference-manifest.js +1 -1
  20. package/.next/server/app/_global-error/page.js +2 -2
  21. package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  22. package/.next/server/app/_global-error.html +1 -1
  23. package/.next/server/app/_global-error.rsc +1 -1
  24. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  25. package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  26. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  27. package/.next/server/app/_not-found/page.js +1 -1
  28. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  29. package/.next/server/app/_not-found.html +1 -1
  30. package/.next/server/app/_not-found.rsc +5 -5
  31. package/.next/server/app/_not-found.segments/_full.segment.rsc +5 -5
  32. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +5 -5
  33. package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  34. package/.next/server/app/api/activity/route.js +2 -2
  35. package/.next/server/app/api/cell/route.js +1 -1
  36. package/.next/server/app/api/definition/route.js +2 -2
  37. package/.next/server/app/api/delete-rows/route.js +3 -3
  38. package/.next/server/app/api/health/route.js +1 -1
  39. package/.next/server/app/api/insert-row/route.js +1 -1
  40. package/.next/server/app/api/ledger/route.js +1 -1
  41. package/.next/server/app/api/lookup/route.js +2 -2
  42. package/.next/server/app/api/migrate/route.js +1 -1
  43. package/.next/server/app/api/query/route.js +2 -2
  44. package/.next/server/app/api/related/route.js +2 -2
  45. package/.next/server/app/api/rows/route.js +1 -1
  46. package/.next/server/app/api/schema/route.js +2 -2
  47. package/.next/server/app/api/tables/route.js +3 -3
  48. package/.next/server/app/api/update-row/route.js +1 -1
  49. package/.next/server/app/favicon.ico/route.js +1 -1
  50. package/.next/server/app/icon.svg/route.js +1 -1
  51. package/.next/server/app/index.html +1 -1
  52. package/.next/server/app/index.rsc +6 -6
  53. package/.next/server/app/index.segments/__PAGE__.segment.rsc +6 -6
  54. package/.next/server/app/index.segments/_full.segment.rsc +6 -6
  55. package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  56. package/.next/server/app/page.js +2 -2
  57. package/.next/server/app/page_client-reference-manifest.js +1 -1
  58. package/.next/server/app-paths-manifest.json +2 -1
  59. package/.next/server/chunks/25.js +1 -1
  60. package/.next/server/chunks/702.js +1 -0
  61. package/.next/server/chunks/729.js +1 -1
  62. package/.next/server/chunks/792.js +1 -1
  63. package/.next/server/middleware-build-manifest.js +1 -1
  64. package/.next/server/pages/404.html +1 -1
  65. package/.next/server/pages/500.html +1 -1
  66. package/.next/static/{FSwOIUlobain5tMrHGgSI → 4qs91o-9uIcy_ViXwFMl1}/_buildManifest.js +1 -1
  67. package/.next/static/chunks/1528-3257b0cb7a73dd8b.js +1 -0
  68. package/.next/static/chunks/3123-9d121152b53da311.js +1 -0
  69. package/.next/static/chunks/363642f4-681bfd753af22ae9.js +1 -0
  70. package/.next/static/chunks/3794-d7cddff008311ab3.js +52 -0
  71. package/.next/static/chunks/4100-7151c91ac47f0e66.js +1 -0
  72. package/.next/static/chunks/4bd1b696-8a4ab4fdf0ae305a.js +1 -0
  73. package/.next/static/chunks/5541-28b0ead901dee457.js +1 -0
  74. package/.next/static/chunks/{39-3411368bf75bda4b.js → 6039-02dbcff4d4ccf559.js} +1 -1
  75. package/.next/static/chunks/6091-de8d2e51b0196435.js +1 -0
  76. package/.next/static/chunks/6842-c2831fd548ae657c.js +1 -0
  77. package/.next/static/chunks/7449-2b9bc65afb482d61.js +1 -0
  78. package/.next/static/chunks/8322-b1154a96547c860d.js +1 -0
  79. package/.next/static/chunks/8360-5a3ba00eb4ee0720.js +1 -0
  80. package/.next/static/chunks/8500-01a63dafd809e317.js +1 -0
  81. package/.next/static/chunks/8651-f7ba864bc5a5b128.js +1 -0
  82. package/.next/static/chunks/9680-3eeb0b7b44c6cab3.js +1 -0
  83. package/.next/static/chunks/app/[connectionId]/[schema]/[table]/page-f2f42daf21a075f2.js +1 -0
  84. package/.next/static/chunks/app/[connectionId]/diff/page-f3262f6929e005e0.js +10 -0
  85. package/.next/static/chunks/app/[connectionId]/layout-18239a50b43285f6.js +1 -0
  86. package/.next/static/chunks/app/[connectionId]/migrations/[setId]/page-20581d3ca2f1c5b3.js +1 -0
  87. package/.next/static/chunks/app/[connectionId]/migrations/page-20f40d5f232b4607.js +1 -0
  88. package/.next/static/chunks/app/[connectionId]/page-6dcee1a99ffdd27c.js +1 -0
  89. package/.next/static/chunks/app/[connectionId]/query/page-46af4cc6f90448f5.js +1 -0
  90. package/.next/static/chunks/app/_global-error/page-6dcee1a99ffdd27c.js +1 -0
  91. package/.next/static/chunks/app/_not-found/page-57d82169a5493d9f.js +1 -0
  92. package/.next/static/chunks/app/api/activity/route-6dcee1a99ffdd27c.js +1 -0
  93. package/.next/static/chunks/app/api/cell/route-6dcee1a99ffdd27c.js +1 -0
  94. package/.next/static/chunks/app/api/definition/route-6dcee1a99ffdd27c.js +1 -0
  95. package/.next/static/chunks/app/api/delete-rows/route-6dcee1a99ffdd27c.js +1 -0
  96. package/.next/static/chunks/app/api/health/route-6dcee1a99ffdd27c.js +1 -0
  97. package/.next/static/chunks/app/api/insert-row/route-6dcee1a99ffdd27c.js +1 -0
  98. package/.next/static/chunks/app/api/ledger/route-6dcee1a99ffdd27c.js +1 -0
  99. package/.next/static/chunks/app/api/lookup/route-6dcee1a99ffdd27c.js +1 -0
  100. package/.next/static/chunks/app/api/migrate/route-6dcee1a99ffdd27c.js +1 -0
  101. package/.next/static/chunks/app/api/query/route-6dcee1a99ffdd27c.js +1 -0
  102. package/.next/static/chunks/app/api/related/route-6dcee1a99ffdd27c.js +1 -0
  103. package/.next/static/chunks/app/api/rows/route-6dcee1a99ffdd27c.js +1 -0
  104. package/.next/static/chunks/app/api/schema/route-6dcee1a99ffdd27c.js +1 -0
  105. package/.next/static/chunks/app/api/tables/route-6dcee1a99ffdd27c.js +1 -0
  106. package/.next/static/chunks/app/api/update-row/route-6dcee1a99ffdd27c.js +1 -0
  107. package/.next/static/chunks/app/layout-dd332a9583f47cd6.js +1 -0
  108. package/.next/static/chunks/app/{page-b2d6b39a184ee5c7.js → page-b582d36c1b014a02.js} +2 -2
  109. package/.next/static/chunks/framework-666c53740fc261c8.js +1 -0
  110. package/.next/static/chunks/{main-9bf13cd161e78f68.js → main-3446eb75b8e429cb.js} +2 -2
  111. package/.next/static/chunks/main-app-f73ec34e89cb8fdd.js +1 -0
  112. package/.next/static/chunks/next/dist/client/components/builtin/app-error-6dcee1a99ffdd27c.js +1 -0
  113. package/.next/static/chunks/next/dist/client/components/builtin/forbidden-6dcee1a99ffdd27c.js +1 -0
  114. package/.next/static/chunks/next/dist/client/components/builtin/global-error-cbba959419f86022.js +1 -0
  115. package/.next/static/chunks/next/dist/client/components/builtin/not-found-6dcee1a99ffdd27c.js +1 -0
  116. package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-6dcee1a99ffdd27c.js +1 -0
  117. package/.next/static/chunks/{webpack-51196f53e7d6229d.js → webpack-34eb118f56295776.js} +1 -1
  118. package/.next/static/css/993f480f9e0f3e74.css +1 -0
  119. package/README.md +11 -7
  120. package/package.json +1 -1
  121. package/.next/static/chunks/100-867b197be5f4ee51.js +0 -1
  122. package/.next/static/chunks/363642f4-4ee279341b3325ec.js +0 -1
  123. package/.next/static/chunks/444-1a5198873808abcb.js +0 -1
  124. package/.next/static/chunks/469-5223a74e4a332e16.js +0 -1
  125. package/.next/static/chunks/4bd1b696-c9cc1fe3b38e59bb.js +0 -1
  126. package/.next/static/chunks/500-2d1136a2b6ea2d76.js +0 -1
  127. package/.next/static/chunks/541-7100f33afc3f8243.js +0 -1
  128. package/.next/static/chunks/603-4d453706a69687ab.js +0 -1
  129. package/.next/static/chunks/680-15c080c77c182ea3.js +0 -1
  130. package/.next/static/chunks/794-5400405c4012cb77.js +0 -52
  131. package/.next/static/chunks/842-7d4f33472de28bfd.js +0 -1
  132. package/.next/static/chunks/9-34415c4a38da9de1.js +0 -1
  133. package/.next/static/chunks/938-3d7a8b7b2f336e91.js +0 -1
  134. package/.next/static/chunks/app/[connectionId]/[schema]/[table]/page-ef736a4ea9a8fb54.js +0 -1
  135. package/.next/static/chunks/app/[connectionId]/diff/page-1b02df901ab4745d.js +0 -10
  136. package/.next/static/chunks/app/[connectionId]/layout-5ceae464cef50cb0.js +0 -1
  137. package/.next/static/chunks/app/[connectionId]/migrations/page-a5b61ff9ef6a087b.js +0 -1
  138. package/.next/static/chunks/app/[connectionId]/page-8b8a8b371736af96.js +0 -1
  139. package/.next/static/chunks/app/[connectionId]/query/page-13dafbced1a1f739.js +0 -1
  140. package/.next/static/chunks/app/_global-error/page-8b8a8b371736af96.js +0 -1
  141. package/.next/static/chunks/app/_not-found/page-dd605227cfa5bf04.js +0 -1
  142. package/.next/static/chunks/app/api/activity/route-8b8a8b371736af96.js +0 -1
  143. package/.next/static/chunks/app/api/cell/route-8b8a8b371736af96.js +0 -1
  144. package/.next/static/chunks/app/api/definition/route-8b8a8b371736af96.js +0 -1
  145. package/.next/static/chunks/app/api/delete-rows/route-8b8a8b371736af96.js +0 -1
  146. package/.next/static/chunks/app/api/health/route-8b8a8b371736af96.js +0 -1
  147. package/.next/static/chunks/app/api/insert-row/route-8b8a8b371736af96.js +0 -1
  148. package/.next/static/chunks/app/api/ledger/route-8b8a8b371736af96.js +0 -1
  149. package/.next/static/chunks/app/api/lookup/route-8b8a8b371736af96.js +0 -1
  150. package/.next/static/chunks/app/api/migrate/route-8b8a8b371736af96.js +0 -1
  151. package/.next/static/chunks/app/api/query/route-8b8a8b371736af96.js +0 -1
  152. package/.next/static/chunks/app/api/related/route-8b8a8b371736af96.js +0 -1
  153. package/.next/static/chunks/app/api/rows/route-8b8a8b371736af96.js +0 -1
  154. package/.next/static/chunks/app/api/schema/route-8b8a8b371736af96.js +0 -1
  155. package/.next/static/chunks/app/api/tables/route-8b8a8b371736af96.js +0 -1
  156. package/.next/static/chunks/app/api/update-row/route-8b8a8b371736af96.js +0 -1
  157. package/.next/static/chunks/app/layout-6c0fa591484fc6df.js +0 -1
  158. package/.next/static/chunks/framework-b820d88d6bcfde5e.js +0 -1
  159. package/.next/static/chunks/main-app-f0a2b35cb4db2c5e.js +0 -1
  160. package/.next/static/chunks/next/dist/client/components/builtin/app-error-8b8a8b371736af96.js +0 -1
  161. package/.next/static/chunks/next/dist/client/components/builtin/forbidden-8b8a8b371736af96.js +0 -1
  162. package/.next/static/chunks/next/dist/client/components/builtin/global-error-e3e280d85e32fd8d.js +0 -1
  163. package/.next/static/chunks/next/dist/client/components/builtin/not-found-8b8a8b371736af96.js +0 -1
  164. package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-8b8a8b371736af96.js +0 -1
  165. package/.next/static/css/c36a068647b766f7.css +0 -1
  166. /package/.next/static/{FSwOIUlobain5tMrHGgSI → 4qs91o-9uIcy_ViXwFMl1}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (()=>{var a={};a.id=820,a.ids=[820],a.modules={3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12229:(a,b,c)=>{"use strict";c.d(b,{En:()=>m,Pc:()=>j,fx:()=>k,jl:()=>i});var d=c(31417),e=c(300),f=c(14490),g=c(15445);let h="ytdb:queries";(0,g.q)("db-studio:queries",h);let i=144,j=800,k=80;function l(a){return a.trim().replace(/\s+/g," ").slice(0,k)}let m=(0,d.v)()((0,e.Zr)((a,b)=>({drafts:{},editorHeight:224,history:[],folders:[],saved:[],activeSaved:{},setDraft:(b,c)=>a(a=>({drafts:{...a.drafts,[b]:c}})),setEditorHeight:b=>a({editorHeight:Math.min(j,Math.max(i,Math.round(b)))}),record:(b,c)=>a(a=>{let d=c.trim();if(!d)return a;let e=a.history.find(a=>a.connectionId===b&&a.sql===d),g={id:e?.id??(0,f.z)(),connectionId:b,sql:d,executedAt:Date.now()},h=0,i=0;return{history:[g,...a.history.filter(a=>a.id!==g.id)].filter(a=>!(h>=200)&&!(i+a.sql.length>1e6)&&(h+=1,i+=a.sql.length,!0))}}),remove:b=>a(a=>({history:a.history.filter(a=>a.id!==b)})),createFolder:(b,c)=>{let d=(0,f.z)(),e=l(c)||"Untitled folder";return a(a=>({folders:[...a.folders,{id:d,connectionId:b,name:e,collapsed:!1,createdAt:Date.now()}]})),d},renameFolder:(b,c)=>{let d=l(c);d&&a(a=>({folders:a.folders.map(a=>a.id===b?{...a,name:d}:a)}))},toggleFolder:b=>a(a=>({folders:a.folders.map(a=>a.id===b?{...a,collapsed:!a.collapsed}:a)})),removeFolder:b=>a(a=>({folders:a.folders.filter(a=>a.id!==b),saved:a.saved.map(a=>a.folderId===b?{...a,folderId:null}:a)})),saveQuery:(b,c)=>{let d=(0,f.z)(),e=Date.now();return a(a=>({saved:[...a.saved,{id:d,connectionId:b,folderId:c.folderId,name:l(c.name)||"Untitled query",sql:c.sql,createdAt:e,updatedAt:e}],activeSaved:{...a.activeSaved,[b]:d}})),d},updateSaved:(b,c)=>a(a=>({saved:a.saved.map(a=>{if(a.id!==b)return a;let d=void 0===c.name?a.name:l(c.name)||a.name;return{...a,name:d,sql:c.sql??a.sql,folderId:void 0===c.folderId?a.folderId:c.folderId,updatedAt:void 0!==c.sql&&c.sql!==a.sql?Date.now():a.updatedAt}})})),removeSaved:b=>a(a=>({saved:a.saved.filter(a=>a.id!==b),activeSaved:function(a,b){let c={...a};for(let[a,d]of Object.entries(c))b.has(d)&&delete c[a];return c}(a.activeSaved,new Set([b]))})),setActiveSaved:(c,d)=>{let{activeSaved:e}=b();(e[c]??null)!==d&&a(a=>{let b={...a.activeSaved};return null===d?delete b[c]:b[c]=d,{activeSaved:b}})}}),{name:h}))},13367:(a,b,c)=>{"use strict";c.d(b,{os:()=>u,iX:()=>v,mw:()=>t});var d=c(48249),e=c(67484),f=c(35471),g=c(20878),h=c(25297),i=c(13656);let j=new Set(["add","all","alter","always","and","as","asc","authorization","between","by","cascade","case","cast","check","collate","column","concurrently","constraint","create","cross","current","default","deferrable","deferred","delete","desc","distinct","drop","else","end","except","exclude","exists","false","foreign","from","full","generated","grant","group","having","identity","if","ilike","immediate","in","include","index","inherits","inner","instead","intersect","into","is","join","key","lateral","left","like","limit","match","materialized","natural","no","not","null","nulls","of","offset","on","only","or","order","outer","over","partition","primary","references","replace","restrict","returning","right","select","server","set","stored","table","temp","temporary","then","time","to","trigger","true","union","unique","unlogged","update","using","values","view","when","where","window","with","without","zone"]);function k(a){let b=[],c=0;for(;c<a.length;){let d=a[c];if(!d)break;if(n(d)){let d=c;for(c+=1;c<a.length&&n(a[c]);)c+=1;b.push({kind:"text",value:a.slice(d,c)});continue}if("-"===d&&"-"===a[c+1]){let d=c;for(c+=2;c<a.length&&"\n"!==a[c];)c+=1;b.push({kind:"comment",value:a.slice(d,c)});continue}if("/"===d&&"*"===a[c+1]){let d=a.indexOf("*/",c+2),e=-1===d?a.length:d+2;b.push({kind:"comment",value:a.slice(c,e)}),c=e;continue}if("$"===d){let d=function(a,b){if("$"!==a[b])return null;let c=b+1;for(;c<a.length&&q(a[c]);)c+=1;return"$"!==a[c]?null:a.slice(b,c+1)}(a,c);if(d){let e=c+d.length,f=a.indexOf(d,e),g=-1===f?a.length:f+d.length;b.push({kind:"string",value:a.slice(c,g)}),c=g;continue}}if('"'===d){c=m(a,c,'"',"ident",b);continue}if("'"===d){c=m(a,c,"'","string",b);continue}if(o(d)||"."===d&&o(a[c+1])){let d=c;c=function(a,b){let c=b;for("."===a[c]&&(c+=1);c<a.length&&o(a[c]);)c+=1;if("."===a[c]&&o(a[c+1]))for(c+=1;c<a.length&&o(a[c]);)c+=1;if("e"===a[c]||"E"===a[c]){let b=c+1;if(("+"===a[b]||"-"===a[b])&&(b+=1),o(a[b]))for(c=b;c<a.length&&o(a[c]);)c+=1}return c}(a,c),b.push({kind:"number",value:a.slice(d,c)});continue}if(p(d)){let d=c;for(c+=1;c<a.length&&q(a[c]);)c+=1;let e=a.slice(d,c);b.push({kind:function(a,b,c){let d=b.toLowerCase();if(j.has(d))return"keyword";let e=c;for(;e<a.length&&(" "===a[e]||" "===a[e]);)e+=1;return"("===a[e]?"function":"ident"}(a,e,c),value:e});continue}b.push({kind:"text",value:d}),c+=1}return b}function l(a){let b=[[]];for(let c of a){let a=c.value.split("\n");for(let d=0;d<a.length;d+=1){d>0&&b.push([]);let e=a[d],f=b[b.length-1];e&&f&&f.push({kind:c.kind,value:e})}}return b}function m(a,b,c,d,e){let f=b+1;for(;f<a.length;){if(a[f]===c){if(a[f+1]===c){f+=2;continue}f+=1;break}f+=1}return e.push({kind:d,value:a.slice(b,f)}),f}function n(a){return" "===a||" "===a||"\n"===a||"\r"===a}function o(a){return void 0!==a&&a>="0"&&a<="9"}function p(a){return void 0!==a&&(a>="A"&&a<="Z"||a>="a"&&a<="z"||"_"===a)}function q(a){return p(a)||o(a)||"$"===a}var r=c(14490);function s({tokens:a}){return a.map((a,b)=>(0,d.jsx)("span",{className:function(a){switch(a){case"keyword":return"text-sky-700 dark:text-sky-400";case"function":return"text-violet-700 dark:text-fuchsia-400";case"ident":return"text-foreground";case"string":case"number":return"text-amber-700 dark:text-amber-300";case"comment":return"text-muted-foreground";case"text":return"text-foreground/80";default:return a}}(a.kind),children:a.value},b))}async function t(a){try{await navigator.clipboard.writeText(a);return}catch{let b=document.createElement("textarea");b.value=a,b.style.position="fixed",b.style.opacity="0",document.body.appendChild(b),b.select(),document.execCommand("copy"),b.remove()}}function u({sql:a,className:b}){let c=(0,e.useMemo)(()=>l(k(a.trimEnd())),[a]);return(0,d.jsx)("pre",{className:(0,r.cn)("overflow-x-auto font-mono text-[12px] leading-5 whitespace-pre",b),children:(0,d.jsx)("code",{children:c.map((a,b)=>(0,d.jsx)("div",{className:"min-h-5",children:(0,d.jsx)(s,{tokens:a})},b))})})}function v({sql:a,error:b,loading:c,actions:j}){let[m,n]=(0,e.useState)(!1),o=(0,e.useMemo)(()=>a?l(k(a.trimEnd())):[],[a]);if(b)return(0,d.jsx)("p",{className:"flex-1 px-4 py-6 font-mono text-xs text-destructive",children:b});if(!a||c&&0===o.length)return(0,d.jsx)("div",{className:"flex flex-col gap-2 p-4",children:Array.from({length:16},(a,b)=>(0,d.jsx)(i.E,{className:"h-4 w-full"},b))});async function p(){a&&(await t(a),n(!0),window.setTimeout(()=>n(!1),1500))}let q=`${Math.max(String(o.length).length,2)+1}ch`;return(0,d.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col","data-sql-source":"",children:[(0,d.jsxs)("div",{className:"flex shrink-0 items-center justify-end gap-2 px-3 py-1",children:[j,(0,d.jsxs)(h.$,{type:"button",variant:"ghost",size:"sm",onClick:()=>void p(),children:[m?(0,d.jsx)(f.A,{"data-icon":"inline-start"}):(0,d.jsx)(g.A,{"data-icon":"inline-start"}),m?"Copied":"Copy SQL"]})]}),(0,d.jsx)("div",{className:(0,r.cn)("min-h-0 flex-1 overflow-auto",c&&"opacity-60"),children:(0,d.jsx)("pre",{className:"min-w-max px-4 pb-4 font-mono text-[13px] leading-6",children:o.map((a,b)=>(0,d.jsxs)("div",{className:"flex min-h-6",children:[(0,d.jsx)("span",{className:"sticky left-0 shrink-0 bg-background pr-4 text-right text-muted-foreground/45 select-none",style:{width:q},children:b+1}),(0,d.jsx)("code",{className:"pr-8 whitespace-pre",children:(0,d.jsx)(s,{tokens:a})})]},b))})})]})}},18261:(a,b,c)=>{"use strict";c.d(b,{MigrationsView:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call MigrationsView() from the server but MigrationsView is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/theobourgeois/code/db-studio/src/components/migrations/migrations-view.tsx","MigrationsView")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},20878:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d=(0,c(41926).A)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},27993:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d=(0,c(41926).A)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},28354:a=>{"use strict";a.exports=require("util")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},32823:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d=(0,c(41926).A)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]])},33873:a=>{"use strict";a.exports=require("path")},37654:(a,b,c)=>{"use strict";c.d(b,{x:()=>f});var d=c(48249),e=c(14490);function f({value:a,options:b,onChange:c,label:g}){return(0,d.jsx)("div",{role:"group","aria-label":g,className:"flex h-7 items-center rounded-md border bg-muted/50 p-0.5",children:b.map(b=>(0,d.jsx)("button",{type:"button","aria-pressed":b.value===a,onClick:()=>c(b.value),className:(0,e.cn)("h-full rounded-sm px-2 text-xs transition-colors",b.value===a?"bg-background text-foreground shadow-xs":"text-muted-foreground hover:text-foreground"),children:b.label},b.value))})}},38522:a=>{"use strict";a.exports=require("node:zlib")},38632:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>f});var d=c(5735),e=c(18261);function f(){return(0,d.jsx)(e.MigrationsView,{})}},41025:a=>{"use strict";a.exports=require("next/dist/server/app-render/dynamic-access-async-storage.external.js")},46060:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external.js")},50688:(a,b,c)=>{Promise.resolve().then(c.bind(c,75267))},54171:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d=(0,c(41926).A)("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]])},60136:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d=(0,c(41926).A)("ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]])},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},69357:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d=(0,c(41926).A)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},69473:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d=(0,c(41926).A)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},75267:(a,b,c)=>{"use strict";c.d(b,{MigrationsView:()=>aS});var d=c(48249),e=c(2116),f=c.n(e),g=c(19099),h=c(67484),i=c(27993),j=c(41926);let k=(0,j.A)("folder-up",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}],["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"m9 13 3-3 3 3",key:"1pxg3c"}]]);var l=c(60136);let m=(0,j.A)("clipboard-check",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"m9 14 2 2 4-4",key:"df797q"}]]),n=(0,j.A)("undo",[["path",{d:"M3 7v6h6",key:"1v2h90"}],["path",{d:"M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13",key:"1r6uu6"}]]),o=(0,j.A)("table",[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]]);var p=c(54171),q=c(1206),r=c(15386),s=c(69473),t=c(82078);let u=(0,j.A)("triangle-alert",[["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"}]]);var v=c(44231),w=c(25297),x=c(82244),y=c(37654),z=c(53286),A=c(20886),B=c(21883),C=c(14490);let D=/^[ \t]*--+[ \t]*ytdb:[ \t]*no-?transaction\b/im,E=new Set(["begin","start"]),F=new Set(["commit","end"]),G=new Set(["rollback"]);function H(a){return void 0!==a&&(a>="A"&&a<="Z"||a>="a"&&a<="z"||"_"===a)||void 0!==a&&a>="0"&&a<="9"}function I(a){if(D.test(a))return{mode:"unwrapped",sql:a,atomic:!1};let b=function(a){let b=[],c=0,d=0,e=d=>{let e=function(a,b){let c=b;for(;c<a.length;){let b=a[c];if(" "===b||" "===b||"\n"===b||"\r"===b){c+=1;continue}if("-"===b&&"-"===a[c+1]){for(;c<a.length&&"\n"!==a[c];)c+=1;continue}if("/"===b&&"*"===a[c+1]){let b=a.indexOf("*/",c+2);c=-1===b?a.length:b+2;continue}break}return c}(a,c);if(e>=d)return;let f=e;for(;f<a.length&&H(a[f]);)f+=1;b.push({at:e,end:d,keyword:a.slice(e,f).toLowerCase()})};for(;d<a.length;){let b=a[d];if("-"===b&&"-"===a[d+1]){for(;d<a.length&&"\n"!==a[d];)d+=1;continue}if("/"===b&&"*"===a[d+1]){let b=a.indexOf("*/",d+2);d=-1===b?a.length:b+2;continue}if("'"===b||'"'===b){d=function(a,b,c){let d=b+1;for(;d<a.length;){if(a[d]===c){if(a[d+1]===c){d+=2;continue}return d+1}d+=1}return d}(a,d,b);continue}if("$"===b){let b=function(a,b){if("$"!==a[b])return null;let c=b+1;for(;c<a.length&&H(a[c]);)c+=1;return"$"!==a[c]?null:a.slice(b,c+1)}(a,d);if(b){let c=a.indexOf(b,d+b.length);d=-1===c?a.length:c+b.length;continue}}if(";"===b){e(d+1),d+=1,c=d;continue}d+=1}return e(a.length),b}(a),c=b.filter(a=>E.has(a.keyword)||F.has(a.keyword)||G.has(a.keyword));if(0===c.length)return{mode:"wrapped-by-ytdb",sql:a,atomic:!0};let d=b[0],e=b[b.length-1];return 2===c.length&&c[0]===d&&c[1]===e&&E.has(d.keyword)&&F.has(e.keyword)?{mode:"self-wrapped",sql:a.slice(0,d.at)+a.slice(d.end,e.at)+a.slice(e.end),atomic:!0}:{mode:"self-managed",sql:a,atomic:!1}}let J=new Set(["apply","up","forward"]),K=new Set(["revert","down","rollback","undo"]),L=[".up",".apply",".forward"],M=[".down",".revert",".rollback",".undo"];function N(a){return a.split("/").filter(a=>a.length>0)}function O(a){return a.replace(/[-_]+/g," ").trim()}function P(a,b){let c=/(\d+)|(\D+)/g,d=a.match(c)??[],e=b.match(c)??[],f=Math.min(d.length,e.length);for(let a=0;a<f;a+=1){let b=d[a],c=e[a],f=/^\d+$/.test(b)&&/^\d+$/.test(c)?Number(b)-Number(c):b.localeCompare(c);if(0!==f)return f}return d.length-e.length}function Q(a){let b=a.replace(/\r\n/g,"\n").trim(),c=0x811c9dc5,d=0x1000193;for(let a=0;a<b.length;a+=1){let e=b.charCodeAt(a);c=Math.imul(c^e,0x1000193)>>>0,d=Math.imul(d+e,0x85ebca6b)>>>0}return`${c.toString(16).padStart(8,"0")}${d.toString(16).padStart(8,"0")}`}function R(a){return a<1024?`${a} B`:a<1048576?`${Math.round(a/1024)} KB`:`${(a/1048576).toFixed(1)} MB`}let S={steps:[],blockedBy:null};function T(a){let b=new Map;for(let c of a?.entries??[])b.set(c.version,c);return b}function U(a,b){return b?b.entries.find(b=>b.version===a.version)??null:null}function V(a,b){if(!b)return"unknown";let c=U(a,b);return c?c.checksum&&c.checksum!==a.checksum?"drifted":"applied":"pending"}function W(a,b){let c={total:a?.steps.length??0,applied:0,drifted:0,pending:0,foreign:0};if(!a)return c;for(let d of a.steps){let a=V(d,b);"applied"===a?c.applied+=1:"drifted"===a?c.drifted+=1:"pending"===a&&(c.pending+=1)}return c.foreign=X(a,b).length,c}function X(a,b){if(!b)return[];let c=new Set((a?.steps??[]).map(a=>a.version));return b.entries.filter(a=>!c.has(a.version)).sort((a,b)=>P(a.version,b.version))}function Y(a,b,c){if(!a||!b)return S;let d=[];for(let e of a.steps)if("pending"===V(e,b)&&d.push(e),void 0!==c&&e.version===c)break;return{steps:d,blockedBy:null}}function Z(a,b,c){if(!a||!b)return S;let d=T(b),e=[];for(let b of[...a.steps].reverse()){if(void 0!==c&&0>P(b.version,c))break;if(d.has(b.version)){if(!b.revertSql)return{steps:e,blockedBy:b};e.push(b)}}return{steps:e,blockedBy:null}}let $="maintenance",_="ytdb_migrations";function aa(a){return"string"==typeof a&&a.length>0&&a.length<=63&&/^[A-Za-z_][A-Za-z0-9_$]*$/.test(a)}var ab=c(99598),ac=c(31417),ad=c(300),ae=c(4106);let af=(0,ac.v)()((0,ad.Zr)((a,b)=>({sets:[],activeSet:{},history:[],ledgerSchema:$,setLedgerSchema:b=>{aa(b)&&a({ledgerSchema:b})},createSet:b=>{let c={id:(0,C.z)(),name:b.trim().replace(/\s+/g," ").slice(0,80)||"Migrations",importedAt:Date.now(),steps:[],skipped:[]};return a(a=>({sets:[...a.sets,c]})),c.id},addFiles:(c,d)=>{let e=b().sets.find(a=>a.id===c),f=function(a){let b={applies:new Map,reverts:new Map,skipped:[],errors:[]},c=a.filter(a=>{var b;let c=N(b=a.path).at(-1)??b;return!c.startsWith(".")&&/\.sql$/i.test(c)});if(0===c.length)return b.errors.push("No .sql files in there."),b;let d=c.reduce((a,b)=>a+b.text.length,0);if(d>4e6)return b.errors.push(`That is ${R(d)} of SQL, over the ${R(4e6)} limit.`),b;for(let a of c){if(a.text.length>5e5){b.skipped.push(`${a.path} — over ${R(5e5)}`);continue}if(a.text.includes("\0")){b.skipped.push(`${a.path} — not text`);continue}if(!a.text.trim()){b.skipped.push(`${a.path} — empty`);continue}let{direction:c,stem:d}=function(a){let b=N(a),c=(b.at(-1)??a).replace(/\.sql$/i,"");for(let a of b.slice(0,-1)){let b=a.toLowerCase();if(K.has(b))return{direction:"revert",stem:c};if(J.has(b))return{direction:"apply",stem:c}}let d=c.toLowerCase();for(let a of M)if(d.endsWith(a))return{direction:"revert",stem:c.slice(0,-a.length)};for(let a of L)if(d.endsWith(a))return{direction:"apply",stem:c.slice(0,-a.length)};return{direction:"apply",stem:c}}(a.path),{version:e,name:f}=function(a){let b=/^[Vv](\d+(?:[._]\d+)*)__(.*)$/.exec(a);if(b)return{version:b[1].replace(/_/g,"."),name:O(b[2])};let c=/^(\d+)(?:[-_.\s]+(.*))?$/.exec(a);return c?{version:c[1],name:O(c[2]??"")}:{version:a,name:O(a)}}(d),g=("apply"===c?b.applies:b.reverts).get(e);if(g){b.skipped.push(`${a.path} — ${g.path} is already version ${e}`);continue}"apply"===c?b.applies.set(e,{path:a.path,sql:a.text,name:f}):b.reverts.set(e,{path:a.path,sql:a.text})}return 0===b.applies.size&&0===b.reverts.size&&b.errors.push("None of those .sql files could be read as a migration."),b}(d),g=function(a,b){let c=new Map(a.map(a=>[a.version,{...a}])),d=[...b.skipped],e=0,f=0,g=0;for(let[a,g]of b.applies){let b=c.get(a);if(b){b.applySql!==g.sql&&(f+=1),b.name=g.name||b.name,b.applyPath=g.path,b.applySql=g.sql,b.checksum=Q(g.sql),b.transaction=I(g.sql).mode;continue}if(c.size>=500){d.push(`${g.path} — over 500 migrations`);continue}c.set(a,{version:a,name:g.name||a,applyPath:g.path,applySql:g.sql,checksum:Q(g.sql),transaction:I(g.sql).mode}),e+=1}for(let[a,e]of b.reverts){let b=c.get(a);if(!b){d.push(`${e.path} — no migration ${a} to revert`);continue}b.revertPath=e.path,b.revertSql=e.sql,g+=1}return{steps:[...c.values()].sort((a,b)=>P(a.version,b.version)),added:e,updated:f,reverts:g,skipped:d}}(e?.steps??[],f);return e&&a(a=>({sets:a.sets.map(a=>a.id===c?{...a,steps:g.steps,skipped:g.skipped,importedAt:Date.now()}:a)})),(0,ae.L)("migrations.import",{name:e?.name,added:g.added,updated:g.updated,reverts:g.reverts,skipped:g.skipped.length}),g},renameSet:(b,c)=>{let d=c.trim().replace(/\s+/g," ").slice(0,80);d&&a(a=>({sets:a.sets.map(a=>a.id===b?{...a,name:d}:a)}))},removeStep:(b,c)=>a(a=>({sets:a.sets.map(a=>a.id===b?{...a,steps:a.steps.filter(a=>a.version!==c)}:a)})),removeSet:c=>{let d=b().sets.find(a=>a.id===c);a(a=>{let b={...a.activeSet};for(let[a,d]of Object.entries(b))d===c&&delete b[a];return{sets:a.sets.filter(a=>a.id!==c),activeSet:b}}),(0,ae.L)("migrations.remove",{name:d?.name})},setActive:(b,c)=>a(a=>({activeSet:{...a.activeSet,[b]:c}})),record:b=>a(a=>({history:[{...b,id:(0,C.z)(),ranAt:Date.now()},...a.history].slice(0,300)})),clearHistory:b=>a(a=>({history:b?a.history.filter(a=>a.setId!==b):[]}))}),{name:"ytdb:migrations"}));var ag=c(12229),ah=c(24277),ai=c(30770),aj=c(35471),ak=c(32823),al=c(91995);let am=(0,j.A)("clipboard-x",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"m14.5 11.5-5 5",key:"1eaq8h"}],["path",{d:"m9.5 11.5 5 5",key:"1exjew"}]]),an=(0,j.A)("file-up",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"m15 15-3-3-3 3",key:"15xj92"}]]);var ao=c(93217),ap=c(20878),aq=c(13367);let ar="w-24",as="w-[104px]",at={applied:"applied",drifted:"applied, but the file changed since",pending:"not applied",unknown:"not read yet"};function au({status:a}){return"applied"===a?(0,d.jsx)(aj.A,{className:"size-4 text-emerald-600 dark:text-emerald-400"}):"drifted"===a?(0,d.jsx)(u,{className:"size-3.5 text-amber-600 dark:text-amber-400"}):"unknown"===a?(0,d.jsx)("span",{className:"size-1.5 rounded-full bg-muted-foreground/30"}):(0,d.jsx)(ak.A,{className:"size-3.5 text-muted-foreground/40"})}function av({step:a,environments:b,targetId:c,status:e,isNewestApplied:f,expanded:g,busy:i,onToggle:j,actions:k}){var o;let[p,q]=(0,h.useState)("apply"),[r,s]=(0,h.useState)(!1),t="revert"===p?a.revertSql??"":a.applySql,v="unwrapped"===(o=a.transaction)?"no transaction":"self-managed"===o?"self-managed":null,z=function(a){switch(a){case"unwrapped":return"Marked `-- ytdb:no-transaction`, so it runs with no transaction. A failure partway leaves the statements before it applied.";case"self-managed":return"This file commits more than once, so YTDB runs it as written and records it afterwards. A failure partway can leave it half applied and unrecorded.";default:return null}}(a.transaction),A=[];async function B(){await (0,aq.mw)(t),s(!0),window.setTimeout(()=>s(!1),1500)}return"drifted"===e&&A.push("This file changed after it was applied here, so it is no longer the migration that ran."),z&&A.push(z),(0,d.jsxs)("div",{className:"border-b last:border-b-0",children:[(0,d.jsxs)("div",{className:(0,C.cn)("flex h-10 items-center transition-colors hover:bg-muted/40",i&&"opacity-60"),children:[(0,d.jsxs)("button",{type:"button","aria-expanded":g,"aria-label":g?`Hide SQL for ${a.version}`:`Show SQL for ${a.version}`,onClick:j,className:"flex h-8 min-w-0 flex-1 cursor-pointer items-center gap-2 rounded-md px-2 text-left outline-none focus-visible:ring-2 focus-visible:ring-ring/60",children:[(0,d.jsx)(al.A,{className:(0,C.cn)("size-3.5 shrink-0 text-muted-foreground/70 transition-transform",g&&"rotate-90")}),(0,d.jsx)("span",{className:"shrink-0 font-mono text-xs text-muted-foreground",children:a.version}),(0,d.jsx)("span",{className:"min-w-0 truncate text-sm",children:a.name}),v&&(0,d.jsx)("span",{className:"shrink-0 rounded border border-amber-600/25 bg-amber-500/10 px-1.5 text-[10px] text-amber-700 dark:text-amber-400",children:v})]}),b.map(b=>{let e=b.connection.id===c;return(0,d.jsx)("span",{title:b.error?`${b.connection.name}: ${b.error}`:`${a.version} is ${at[b.status]} on ${b.connection.name}${b.entry?` — ${function(a){if(!a)return"";let b=new Date(a.appliedAt);return Number.isNaN(b.getTime())?a.appliedAt:b.toLocaleString()}(b.entry)}`:""}`,className:(0,C.cn)("flex h-10 shrink-0 items-center justify-center",ar,e&&"bg-foreground/[0.04]"),children:(0,d.jsx)(au,{status:b.status})},b.connection.id)}),(0,d.jsxs)("div",{className:(0,C.cn)("flex shrink-0 items-center justify-end gap-1 pr-2 pl-1",as),children:["pending"===e&&(0,d.jsx)(w.$,{size:"xs",variant:"outline",disabled:i,onClick:k.onApplyThrough,children:"Apply"}),f&&a.revertSql&&(0,d.jsxs)(w.$,{size:"xs",variant:"ghost",disabled:i,onClick:k.onRevertThrough,children:[(0,d.jsx)(n,{"data-icon":"inline-start"}),"Revert"]}),(0,d.jsxs)(x.rI,{children:[(0,d.jsx)(x.ty,{render:(0,d.jsx)(w.$,{size:"icon-xs",variant:"ghost","aria-label":`Actions for ${a.version}`}),className:"cursor-pointer",children:(0,d.jsx)(l.A,{})}),(0,d.jsxs)(x.SQ,{align:"end",className:"min-w-56",children:[(0,d.jsx)(x._2,{disabled:i||"applied"===e,onClick:k.onApplyThrough,children:"Apply everything through here"}),(0,d.jsx)(x._2,{disabled:i||"applied"===e,onClick:k.onApplyOne,children:"Apply only this one"}),(0,d.jsx)(x._2,{disabled:i||"pending"===e||!a.revertSql,onClick:k.onRevertThrough,children:"Revert back through here"}),(0,d.jsx)(x.mB,{}),(0,d.jsxs)(x._2,{disabled:i||"applied"===e,onClick:k.onMarkApplied,children:[(0,d.jsx)(m,{}),"Mark as already applied"]}),(0,d.jsxs)(x._2,{disabled:i||"pending"===e,onClick:k.onMarkPending,children:[(0,d.jsx)(am,{}),"Mark as not applied"]}),(0,d.jsx)(x.mB,{}),(0,d.jsxs)(x._2,{onClick:k.onAttachRevert,children:[(0,d.jsx)(an,{}),a.revertSql?"Replace revert file…":"Add a revert file…"]}),(0,d.jsxs)(x._2,{onClick:()=>k.onOpenInEditor(t),children:[(0,d.jsx)(ao.A,{}),"Open ",p," SQL in editor"]}),(0,d.jsxs)(x._2,{onClick:()=>void B(),children:[(0,d.jsx)(ap.A,{}),"Copy ",p," SQL"]}),(0,d.jsx)(x.mB,{}),(0,d.jsx)(x._2,{variant:"destructive",onClick:k.onRemove,children:"Remove from this set"})]})]})]})]}),g&&(0,d.jsxs)("div",{className:"border-t bg-muted/25",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 py-1.5",children:[(0,d.jsx)(y.x,{label:`SQL for ${a.version}`,value:p,onChange:q,options:[{value:"apply",label:"Apply"},{value:"revert",label:"Revert"}]}),(0,d.jsx)("span",{className:"min-w-0 truncate font-mono text-[11px] text-muted-foreground",children:"revert"===p?a.revertPath??"no revert file":a.applyPath}),(0,d.jsxs)(w.$,{size:"xs",variant:"ghost",className:"ml-auto",onClick:()=>void B(),children:[r?(0,d.jsx)(aj.A,{"data-icon":"inline-start"}):(0,d.jsx)(ap.A,{"data-icon":"inline-start"}),r?"Copied":"Copy"]})]}),A.length>0&&(0,d.jsx)("ul",{className:"space-y-1 px-3 pb-2",children:A.map(a=>(0,d.jsxs)("li",{className:"flex gap-1.5 text-[11px] text-amber-700 dark:text-amber-400",children:[(0,d.jsx)(u,{className:"mt-px size-3 shrink-0"}),(0,d.jsx)("span",{children:a})]},a))}),t?(0,d.jsx)(aq.os,{sql:t,className:"max-h-72 overflow-auto px-3 pb-3"}):(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 pb-3 text-xs text-muted-foreground",children:[(0,d.jsx)("span",{children:"No revert file, so this one cannot be undone from here."}),(0,d.jsxs)(w.$,{size:"xs",variant:"outline",onClick:k.onAttachRevert,children:[(0,d.jsx)(an,{"data-icon":"inline-start"}),"Add one"]})]})]})]})}function aw({environments:a,targetId:b,onSelect:c}){let e=a.find(a=>a.connection.id===b);return e?(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsx)("span",{className:"text-xs text-muted-foreground",children:"Running against"}),(0,d.jsxs)(x.rI,{children:[(0,d.jsxs)(x.ty,{disabled:a.length<2,className:"flex h-7 cursor-pointer items-center gap-1.5 rounded-lg border bg-background px-2 text-xs font-medium outline-none hover:bg-muted/60 focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-default data-open:bg-muted/60",children:[(0,d.jsx)(ai.F,{connection:e.connection}),(0,d.jsx)("span",{className:"max-w-32 truncate",children:e.connection.name})]}),(0,d.jsx)(x.SQ,{align:"start",className:"min-w-52",children:a.map(a=>(0,d.jsxs)(x._2,{onClick:()=>c(a.connection.id),className:a.connection.id===b?"font-medium":void 0,children:[(0,d.jsx)(ai.F,{connection:a.connection}),(0,d.jsx)("span",{className:"min-w-0 flex-1 truncate",children:a.connection.name}),(0,d.jsxs)("span",{className:"shrink-0 tabular-nums text-muted-foreground",children:[a.summary.applied,"/",a.summary.total]})]},a.connection.id))})]})]}):null}function ax({environments:a,targetId:b,caption:c,loading:e,onSelect:f,onCompare:g}){return(0,d.jsxs)("div",{className:"flex h-11 shrink-0 items-center border-b bg-muted/20",children:[(0,d.jsx)("span",{className:"min-w-0 flex-1 truncate px-3 text-xs text-muted-foreground",children:c}),a.map(a=>{let{connection:c,summary:g,ledger:h,error:i}=a,j=c.id===b;return(0,d.jsxs)("button",{type:"button",disabled:j,"aria-current":j?"true":void 0,title:j?`${c.name} is what Apply and Revert run against`:`Run against ${c.name} instead`,onClick:()=>f(c.id),className:(0,C.cn)("flex h-11 shrink-0 flex-col items-center justify-center gap-0.5 border-l text-[11px] outline-none",ar,j?"cursor-default bg-foreground/[0.04] font-medium":"cursor-pointer text-muted-foreground hover:bg-muted/60 hover:text-foreground",e&&"opacity-60"),children:[(0,d.jsxs)("span",{className:"flex max-w-full items-center gap-1",children:[(0,d.jsx)(ai.F,{connection:c,className:"size-1.5"}),(0,d.jsx)("span",{className:"truncate",children:c.name})]}),i?(0,d.jsx)("span",{className:"text-destructive",children:"unreachable"}):h?(0,d.jsxs)("span",{className:"tabular-nums text-muted-foreground/80",children:[g.applied,"/",g.total,g.drifted>0&&(0,d.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:" !"})]}):(0,d.jsx)("span",{className:"text-muted-foreground/70",children:"reading…"})]},c.id)}),(0,d.jsx)("div",{className:(0,C.cn)("flex shrink-0 items-center justify-end border-l pr-2 pl-1",as),children:a.length>1&&(0,d.jsx)(w.$,{size:"icon-xs",variant:"ghost",title:"Compare the two schemas","aria-label":"Compare schemas",onClick:()=>{let c=a.find(a=>a.connection.id!==b);c&&g(c.connection.id)},children:(0,d.jsx)(ah.A,{})})})]})}var ay=c(38393),az=c(88877),aA=c(90863);function aB({schema:a,found:b,onOpenChange:c,onSave:e}){let[f,g]=(0,h.useState)(a),i=f.trim(),j=aa(i),k=b.filter(a=>a.schema!==i);function l(){j&&(e(i),c(!1))}return(0,d.jsx)(ay.lG,{open:!0,onOpenChange:c,children:(0,d.jsxs)(ay.Cf,{className:"sm:max-w-md",children:[(0,d.jsxs)(ay.c7,{children:[(0,d.jsx)(ay.L3,{children:"Where the ledger lives"}),(0,d.jsx)(ay.rr,{children:"Each database records what it has run in its own table. This is the schema that table goes in, for every connection — dev and prod have to look in the same place for their columns to mean anything."})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsx)(aA.J,{htmlFor:"ledger-schema",children:"Schema"}),(0,d.jsx)(az.p,{id:"ledger-schema",value:f,spellCheck:!1,autoComplete:"off","aria-invalid":i.length>0&&!j,onChange:a=>g(a.target.value),onKeyDown:a=>"Enter"===a.key&&l()}),(0,d.jsx)("p",{className:"font-mono text-xs text-muted-foreground",children:j?`${i}.${_}`:"\xa0"}),i.length>0&&!j&&(0,d.jsx)("p",{className:"text-xs text-destructive",children:"Letters, digits and underscores only, starting with a letter or underscore."})]}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:"The schema is created on the first apply, so the connection needs permission to create it. Nothing is created just by reading a ledger."}),k.length>0&&(0,d.jsxs)("p",{className:"rounded-md border border-amber-600/25 bg-amber-500/8 px-3 py-2 text-xs",children:[k.map(a=>`${a.name} already keeps its ledger in ${a.schema}`).join("; "),". Those keep being used where they are, so nothing already applied is forgotten."]}),(0,d.jsxs)(ay.Es,{children:[i!==$&&(0,d.jsx)(w.$,{variant:"ghost",onClick:()=>g($),children:"Reset"}),(0,d.jsx)(w.$,{variant:"outline",onClick:()=>c(!1),children:"Cancel"}),(0,d.jsx)(w.$,{disabled:!j,onClick:l,children:"Save"})]})]})})}var aC=c(45535);let aD={applied:"applied",reverted:"reverted",marked:"marked",unmarked:"unmarked",failed:"failed"};function aE({kind:a}){switch(a){case"failed":return(0,d.jsx)(aC.A,{className:"size-3.5 shrink-0 text-destructive"});case"reverted":return(0,d.jsx)(n,{className:"size-3.5 shrink-0 text-amber-600 dark:text-amber-400"});case"marked":return(0,d.jsx)(m,{className:"size-3.5 shrink-0 text-muted-foreground"});case"unmarked":return(0,d.jsx)(am,{className:"size-3.5 shrink-0 text-muted-foreground"});default:return(0,d.jsx)(aj.A,{className:"size-3.5 shrink-0 text-emerald-600 dark:text-emerald-400"})}}function aF({event:a,connection:b}){return(0,d.jsxs)("div",{className:"flex items-start gap-2 border-b px-4 py-2 text-xs last:border-b-0",children:[(0,d.jsx)("span",{className:"mt-0.5",children:(0,d.jsx)(aE,{kind:a.kind})}),(0,d.jsx)("span",{className:(0,C.cn)("mt-px shrink-0 rounded-md px-1.5 text-[11px]","failed"===a.kind?"bg-destructive/10 text-destructive":"reverted"===a.kind?"bg-amber-500/15 text-amber-700 dark:text-amber-400":"bg-muted text-muted-foreground"),children:aD[a.kind]}),(0,d.jsx)("span",{className:"shrink-0 font-mono text-muted-foreground",children:a.version}),(0,d.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,d.jsx)("span",{className:"truncate",children:a.name}),a.error&&(0,d.jsx)("span",{className:"mt-1 block font-mono text-[11px] whitespace-pre-wrap text-destructive",children:a.error})]}),a.setName&&(0,d.jsx)("span",{className:"hidden max-w-32 shrink-0 truncate text-muted-foreground/60 lg:inline",children:a.setName}),(0,d.jsxs)("span",{className:"flex shrink-0 items-center gap-1 text-muted-foreground",children:[b&&(0,d.jsx)(ai.F,{connection:b,className:"size-1.5"}),a.connectionName]}),a.appliedBy&&(0,d.jsx)("span",{className:"hidden shrink-0 text-muted-foreground/60 xl:inline",children:a.appliedBy}),(0,d.jsx)("span",{className:"shrink-0 tabular-nums text-muted-foreground/70",children:null===a.durationMs?"":`${a.durationMs} ms`}),(0,d.jsx)("span",{className:"shrink-0 text-muted-foreground/70",title:a.fromLedger?"Read from the database's own ledger":"Run from this browser",children:new Date(a.at).toLocaleString()})]})}function aG({events:a,connections:b,loading:c}){let e=af(a=>a.clearHistory),f=new Map(b.map(a=>[a.id,a])),g=a.filter(a=>!a.fromLedger).length;return 0===a.length?(0,d.jsx)("p",{className:"px-4 py-6 text-sm text-muted-foreground",children:c?"Reading ledgers…":"Nothing has been applied to these databases yet. Every run shows up here, along with what each database's own ledger already records."}):(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"flex items-center justify-between gap-2 px-4 py-1.5",children:[(0,d.jsxs)("span",{className:"min-w-0 truncate text-xs text-muted-foreground",children:[a.length," event",1===a.length?"":"s",", newest first \xb7 from each database’s ledger and this browser’s own log"]}),g>0&&(0,d.jsx)(w.$,{size:"xs",variant:"ghost",title:"Clears this browser's log. The databases' ledgers are untouched.",onClick:()=>e(),children:"Clear local log"})]}),(0,d.jsx)("div",{className:"border-t",children:a.map(a=>(0,d.jsx)(aF,{event:a,connection:f.get(a.connectionId)},a.id))})]})}var aH=c(69357);let aI=(0,j.A)("folder-open",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);function aJ(a){let b=a.createReader?.();return b?new Promise((a,c)=>{let d=[],e=()=>{b.readEntries(b=>{0===b.length||d.length>=2e3?a(d):(d.push(...b),e())},c)};e()}):Promise.resolve([])}async function aK(a,b,c,d){if(d.length>=2e3||c>6||a.name.startsWith("."))return;let e=b?`${b}/${a.name}`:a.name;if(a.isFile){if(!/\.sql$/i.test(a.name))return;let b=await new Promise((b,c)=>{a.file?a.file(b,c):c(Error(`Could not read ${a.name}`))});d.push({path:e,text:await b.text()});return}if(a.isDirectory)for(let b of(await aJ(a)))await aK(b,e,c+1,d)}async function aL(a){let b=[];for(let c of Array.from(a.items)){if("file"!==c.kind)continue;let a=c.webkitGetAsEntry?.();a&&b.push(a)}if(0===b.length){let b=Array.from(a.files).filter(a=>/\.sql$/i.test(a.name));return 0===b.length?null:{name:"Migrations",files:await Promise.all(b.map(async a=>({path:a.name,text:await a.text()})))}}let c=1===b.length&&b[0].isDirectory?b[0]:null,d=[];if(c){for(let a of(await aJ(c)))await aK(a,"",1,d);return{name:c.name,files:d}}for(let a of b)await aK(a,"",0,d);return d.length>0?{name:"Migrations",files:d}:null}async function aM(a){let b,c=Array.from(a).filter(a=>/\.sql$/i.test(a.name));if(0===c.length)return null;let d=new Set(c.map(a=>(a.webkitRelativePath||a.name).split("/")[0])),e=1===d.size&&((b=c[0]).webkitRelativePath||b.name).includes("/")?[...d][0]:null;return{name:e??"Migrations",files:await Promise.all(c.slice(0,2e3).map(async a=>{let b=a.webkitRelativePath||a.name;return{path:e?b.slice(e.length+1):b,text:await a.text()}}))}}function aN(a){let[b,c]=(0,h.useState)(!1),[d,e]=(0,h.useState)(null);return{importFrom:(0,h.useCallback)(async b=>{c(!0),e(null);try{let c=b instanceof FileList?await aM(b):await aL(b);if(!c||0===c.files.length)return void e("No .sql files in there.");a(c)}catch(a){e(a instanceof Error?a.message:"Couldn’t read that folder.")}finally{c(!1)}},[a]),busy:b,error:d,clearError:()=>e(null)}}function aO({onFiles:a,hint:b,className:c,compact:e=!1}){let{importFrom:f,busy:g,error:i}=aN(a),[j,l]=(0,h.useState)(!1),m=(0,h.useRef)(null),n=(0,h.useRef)(null);return(0,d.jsxs)("div",{onDragOver:a=>{a.preventDefault(),l(!0)},onDragLeave:()=>l(!1),onDrop:a=>{a.preventDefault(),l(!1),f(a.dataTransfer)},className:(0,C.cn)("flex flex-col items-center justify-center gap-3 rounded-lg border border-dashed text-center transition-colors",e?"gap-2 px-4 py-6":"px-6 py-10",j?"border-primary bg-primary/5":"border-border",c),children:[g?(0,d.jsx)(aH.A,{className:"size-5 animate-spin text-muted-foreground"}):(0,d.jsx)(k,{className:"size-5 text-muted-foreground"}),(0,d.jsxs)("div",{className:"space-y-1",children:[(0,d.jsx)("p",{className:"text-sm font-medium",children:"Drop migrations here"}),(0,d.jsx)("p",{className:"max-w-md text-xs text-muted-foreground",children:b??"A folder of .sql files, or one split into apply/ and revert/ (or up/ and down/). Revert files are optional, and you can add more files later."})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsxs)(w.$,{size:"sm",variant:"outline",disabled:g,onClick:()=>m.current?.click(),children:[(0,d.jsx)(aI,{"data-icon":"inline-start"}),"Choose folder"]}),(0,d.jsx)(w.$,{size:"sm",variant:"ghost",disabled:g,onClick:()=>n.current?.click(),children:"Choose files"})]}),i&&(0,d.jsx)("p",{className:"max-w-sm text-xs text-destructive",children:i}),(0,d.jsx)("input",{ref:m,type:"file",multiple:!0,className:"sr-only",onChange:a=>{let{files:b}=a.target;b&&b.length>0&&f(b),a.target.value=""}}),(0,d.jsx)("input",{ref:n,type:"file",multiple:!0,accept:".sql",className:"sr-only",onChange:a=>{let{files:b}=a.target;b&&b.length>0&&f(b),a.target.value=""}})]})}let aP=(0,j.A)("circle-dashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]]);function aQ({status:a}){switch(a){case"running":return(0,d.jsx)(aH.A,{className:"size-3.5 shrink-0 animate-spin text-primary"});case"ok":return(0,d.jsx)(aj.A,{className:"size-3.5 shrink-0 text-emerald-600 dark:text-emerald-400"});case"failed":return(0,d.jsx)(aC.A,{className:"size-3.5 shrink-0 text-destructive"});case"skipped":return(0,d.jsx)(ak.A,{className:"size-3.5 shrink-0 text-muted-foreground/60"});default:return(0,d.jsx)(aP,{className:"size-3.5 shrink-0 text-muted-foreground/60"})}}function aR({open:a,direction:b,connection:c,steps:e,blockedBy:f,progress:g,running:h,recordOnly:i,onRun:j,onStop:k,onClose:l}){let m=i?"apply"===b?"Mark as applied":"Mark as not applied":"apply"===b?"Apply":"Revert",n=i?"Marked":"apply"===b?"Applied":"Reverted",o=e.length,p=e.filter(a=>{var b;return"wrapped-by-ytdb"!==(b=a.transaction)&&"self-wrapped"!==b}),q=g?.find(a=>"failed"===a.status)??null,r=null!==g&&!h,s=g?.filter(a=>"ok"===a.status).length??0,t=g??e.map(a=>({version:a.version,name:a.name,status:"waiting"}));return(0,d.jsx)(ay.lG,{open:a,onOpenChange:a=>!a&&!h&&l(),children:(0,d.jsxs)(ay.Cf,{className:"sm:max-w-lg",children:[(0,d.jsxs)(ay.c7,{children:[(0,d.jsx)(ay.L3,{children:0===o&&f?"Nothing here can be reverted":r?q?`${m} stopped after ${s} of ${o}`:`${n} ${s} migration${1===s?"":"s"}`:i?`${"Mark as applied"===m?"Mark":"Unmark"} ${o} migration${1===o?"":"s"} on ${c.name}?`:`${m} ${o} migration${1===o?"":"s"}?`}),(0,d.jsx)(ay.rr,{children:(0,d.jsxs)("span",{className:"flex flex-wrap items-center gap-1.5",children:[(0,d.jsx)("span",{children:i?r?"Recorded on":"Records on":r?"Ran against":"Runs against"}),(0,d.jsx)(ai.F,{connection:c}),(0,d.jsx)("span",{className:"font-medium text-foreground",children:c.name}),(0,d.jsx)("span",{className:"font-mono text-[11px]",children:function(a){try{let b=new URL(a),c=b.username?`${decodeURIComponent(b.username)}@`:"",d=b.port?`:${b.port}`:"";return`${c}${b.hostname}${d}${b.pathname}`}catch{return"this connection"}}(c.url)})]})})]}),t.length>0&&(0,d.jsx)("div",{className:"max-h-64 overflow-y-auto rounded-md border",children:t.map(a=>(0,d.jsxs)("div",{className:"flex items-center gap-2 border-b px-3 py-1.5 text-xs last:border-b-0",children:[(0,d.jsx)(aQ,{status:a.status}),(0,d.jsx)("span",{className:"shrink-0 font-mono text-muted-foreground",children:a.version}),(0,d.jsx)("span",{className:"min-w-0 flex-1 truncate",children:a.name}),void 0!==a.durationMs&&(0,d.jsxs)("span",{className:"shrink-0 tabular-nums text-muted-foreground",children:[a.durationMs," ms"]})]},a.version))}),q?.error&&(0,d.jsx)("p",{className:"max-h-32 overflow-auto rounded-md border border-destructive/25 bg-destructive/5 px-3 py-2 font-mono text-[11px] whitespace-pre-wrap text-destructive",children:q.error}),!g&&f&&(0,d.jsxs)("p",{className:"flex gap-2 text-xs text-muted-foreground",children:[(0,d.jsx)(u,{className:"mt-px size-3.5 shrink-0 text-amber-600 dark:text-amber-400"}),(0,d.jsx)("span",{children:0===o?`${f.version} ${f.name} is the newest one applied and has no revert file, so nothing below it can be reached.`:`Stops at ${f.version} ${f.name}, which has no revert file.`})]}),!g&&i&&(0,d.jsxs)("p",{className:"rounded-md border border-amber-600/25 bg-amber-500/8 px-3 py-2 text-xs",children:[(0,d.jsx)("span",{className:"font-medium",children:"No SQL runs."})," This only changes what"," ",c.name," says it has already had — use it when the schema is already in place, for instance after migrating by hand."]}),!g&&!i&&p.length>0&&(0,d.jsxs)("p",{className:"flex gap-2 text-xs text-muted-foreground",children:[(0,d.jsx)(u,{className:"mt-px size-3.5 shrink-0 text-amber-600 dark:text-amber-400"}),(0,d.jsx)("span",{children:1===p.length?`${p[0].version} runs outside a transaction, so a failure partway leaves it half applied.`:`${p.length} of these run outside a transaction, so a failure partway leaves them half applied.`})]}),!g&&!i&&"revert"===b&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:"Reverting runs newest first and can drop data the migrations created."}),(0,d.jsx)(ay.Es,{children:h?(0,d.jsx)(w.$,{variant:"outline",onClick:k,children:"Stop after this one"}):r?(0,d.jsx)(w.$,{onClick:l,children:"Close"}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(w.$,{variant:"outline",onClick:l,children:0===o?"Close":"Cancel"}),o>0&&(0,d.jsx)(w.$,{variant:i||"revert"!==b?"default":"destructive",onClick:j,children:i?`${m} (${o})`:`${m} ${1===o?"migration":`${o} migrations`}`})]})})]})})}function aS(){let a=(0,g.useRouter)(),{connection:b,tables:c}=(0,v.k)(),e=af(a=>a.sets),j=af(a=>a.createSet),q=af(a=>a.addFiles),r=af(a=>a.renameSet),s=af(a=>a.removeSet),t=af(a=>a.removeStep),u=af(a=>a.setActive),y=af(a=>a.record),D=af(a=>a.ledgerSchema),E=af(a=>a.setLedgerSchema),F=function(a){let b=af(a=>a.sets),c=af(b=>b.activeSet[a]);if(0===b.length)return null;let d=b.find(a=>a.id===c);return d||([...b].sort((a,b)=>b.importedAt-a.importedAt)[0]??null)}(b.id),G=(0,ab.gz)(b.id),H=(0,ag.En)(a=>a.setDraft),I=(0,ag.En)(a=>a.setActiveSaved),[J,K]=(0,h.useState)("migrations"),[L,M]=(0,h.useState)([]),[N,O]=(0,h.useState)(null),[P,Q]=(0,h.useState)(null),[R,S]=(0,h.useState)(!1),[$,aa]=(0,h.useState)(!1),[ac,ad]=(0,h.useState)(null),[ae,ah]=(0,h.useState)(null),[ai,aj]=(0,h.useState)(!1),ak=(0,h.useRef)(null),al=(0,h.useRef)(!1),am=(0,h.useMemo)(()=>[b,...G],[b,G]),an=am.map(a=>a.url).join("|"),ao=(0,A.Y)(`ledgers:${D}:${an}`,async a=>Object.fromEntries(await Promise.all(am.map(async b=>{try{return[b.id,{ledger:await B.F.ledger(b.url,D,a),error:null}]}catch(c){if(a.aborted)throw c;return[b.id,{ledger:null,error:c instanceof Error?c.message:String(c)}]}})))),ap=ao.data?.[b.id]??null,aq=ap?.ledger??null,ar=(0,h.useMemo)(()=>am.map(a=>{let b=ao.data?.[a.id]??null;return{connection:a,ledger:b?.ledger??null,error:b?.error??null,summary:W(F,b?.ledger??null)}}),[am,ao.data,F]),as=af(a=>a.history),at=(0,h.useMemo)(()=>(function(a,b){let c=new Map(a.map(a=>[a.connection.id,a])),d=b.filter(a=>c.has(a.connectionId)).map(a=>({id:a.id,connectionId:a.connectionId,connectionName:a.connectionName,version:a.version,name:a.name,at:a.ranAt,kind:"failed"===a.status?"failed":a.recorded?"apply"===a.direction?"marked":"unmarked":"apply"===a.direction?"applied":"reverted",durationMs:a.durationMs,error:a.error,setName:a.setName,fromLedger:!1})),e=new Map;for(let a of d){let b=`${a.connectionId}:${a.version}`,c=e.get(b);(!c||a.at>c.at)&&e.set(b,a)}let f=[...d];for(let b of a)for(let a of b.ledger?.entries??[]){let c=`${b.connection.id}:${a.version}`,d=e.get(c);if(d&&("applied"===d.kind||"marked"===d.kind)){d.appliedBy=a.appliedBy;continue}f.push({id:`ledger:${b.connection.id}:${a.version}`,connectionId:b.connection.id,connectionName:b.connection.name,version:a.version,name:a.name||a.version,at:function(a){let b=Date.parse(a);return Number.isNaN(b)?0:b}(a.appliedAt),kind:"applied",durationMs:a.durationMs,setName:a.setName,appliedBy:a.appliedBy,fromLedger:!0})}return f.sort((a,b)=>b.at-a.at)})(ar.map(a=>({connection:a.connection,ledger:a.ledger})),as),[ar,as]),au=W(F,aq),ay=(0,h.useMemo)(()=>X(F,aq),[F,aq]),az=function(a,b){if(!a||!b)return null;let c=T(b);for(let b of[...a.steps].reverse())if(c.has(b.version))return b;return null}(F,aq),aA=(0,h.useCallback)(a=>{let c=F?.id??j(a.name),d=q(c,a.files);u(b.id,c),ad(d),K("migrations")},[F?.id,j,q,u,b.id]),aC=aN(aA);function aD(a,b,c=!1){(0!==b.steps.length||b.blockedBy)&&(Q(null),O({...b,direction:a,recordOnly:c}))}function aE(a){return{steps:a,blockedBy:null}}async function aF(){if(!N||!F)return;al.current=!1,S(!0);let a=N.steps.map(a=>({version:a.version,name:a.name,status:"waiting"}));Q(a);let d=(b,c)=>{Q(a=a.map((a,d)=>d===b?{...a,...c}:a))},e=b=>{Q(a=a.map((a,c)=>c>=b&&"waiting"===a.status?{...a,status:"skipped"}:a))};for(let[a,c]of N.steps.entries()){if(al.current){e(a);break}let f="apply"===N.direction?c.applySql:c.revertSql;if(!f&&!N.recordOnly){d(a,{status:"failed",error:"No revert file for this migration."}),e(a+1);break}d(a,{status:"running"});try{let e=await B.F.migrate(b.url,{direction:N.direction,version:c.version,name:c.name,checksum:c.checksum,setName:F.name,sql:f??"",ledgerSchema:D,recordOnly:N.recordOnly});d(a,{status:"ok",durationMs:e.durationMs}),y({setId:F.id,setName:F.name,connectionId:b.id,connectionName:b.name,direction:N.direction,version:c.version,name:c.name,status:"ok",recorded:N.recordOnly,durationMs:e.durationMs})}catch(g){let f=g instanceof Error?g.message:String(g);d(a,{status:"failed",error:f}),e(a+1),y({setId:F.id,setName:F.name,connectionId:b.id,connectionName:b.name,direction:N.direction,version:c.version,name:c.name,status:"failed",durationMs:0,error:f});break}}S(!1),ao.reload(),c.reload()}function aH(c){H(b.id,c),I(b.id,null),a.push(`/${encodeURIComponent(b.id)}/query`)}function aI(c){c!==b.id&&a.push(`/${encodeURIComponent(c)}/migrations`)}async function aJ(a){let b=a?.[0];ah(null),b&&ae&&F&&ad(q(F.id,[{path:`revert/${ae}_${b.name}`,text:await b.text()}]))}if(0===e.length)return(0,d.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[(0,d.jsx)(aU,{}),"history"===J?(0,d.jsx)(z.F,{className:"min-h-0 flex-1",children:(0,d.jsx)(aG,{events:at,connections:am,loading:ao.loading})}):(0,d.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center gap-4 p-6",children:[(0,d.jsx)(aO,{onFiles:aA,className:"w-full max-w-xl"}),(0,d.jsxs)("p",{className:"max-w-xl text-center text-xs text-muted-foreground",children:["YTDB records every migration it runs in"," ",(0,d.jsxs)("code",{className:"font-mono",children:[D,".",_]})," ","in the database it ran against, so each environment answers for itself what it has and has not had."]})]}),(0,d.jsx)(aT,{caption:"No migrations imported yet",pane:J,onPaneChange:K,historyCount:at.length})]});let aK=Y(F,aq),aL=Z(F,aq),aM=R||ao.loading;return(0,d.jsxs)("div",{className:"relative flex min-h-0 flex-1 flex-col",onDragOver:a=>{a.dataTransfer.types.includes("Files")&&(a.preventDefault(),aa(!0))},children:[(0,d.jsxs)(aU,{children:[(0,d.jsx)(aV,{activeName:F?.name??"No folder",sets:e.map(a=>({id:a.id,name:a.name,steps:a.steps.length})),activeId:F?.id??null,onSelect:a=>u(b.id,a),onCreate:function(){let a=window.prompt("Name this migration set","Migrations");if(null===a)return;let c=j(a.trim()||"Migrations");u(b.id,c),ad(null)},onRename:function(){if(!F)return;let a=window.prompt("Rename this migration set",F.name);null!==a&&r(F.id,a)},onRemove:a=>s(a)}),(0,d.jsx)(aw,{environments:ar,targetId:b.id,onSelect:aI}),(0,d.jsxs)("div",{className:"ml-auto flex items-center gap-2",children:[(0,d.jsxs)(w.$,{size:"sm",variant:"ghost",disabled:ao.loading,title:"Re-read every environment's ledger",onClick:()=>ao.reload(),children:[(0,d.jsx)(i.A,{"data-icon":"inline-start",className:(0,C.cn)(ao.loading&&"animate-spin")}),"Refresh"]}),(0,d.jsxs)(w.$,{size:"sm",variant:"ghost",onClick:()=>aa(!0),children:[(0,d.jsx)(k,{"data-icon":"inline-start"}),"Import"]}),(0,d.jsxs)(x.rI,{children:[(0,d.jsx)(x.ty,{render:(0,d.jsx)(w.$,{size:"icon-sm",variant:"ghost","aria-label":"More migration actions"}),className:"cursor-pointer",children:(0,d.jsx)(l.A,{})}),(0,d.jsxs)(x.SQ,{align:"end",className:"min-w-64",children:[(0,d.jsxs)(x._2,{disabled:aM||0===aK.steps.length,onClick:()=>aD("apply",aE(aK.steps),!0),children:[(0,d.jsx)(m,{}),"Mark ",aK.steps.length," as already applied"]}),(0,d.jsx)(x.mB,{}),(0,d.jsxs)(x._2,{disabled:aM||0===aL.steps.length,onClick:()=>aD("revert",aL),children:[(0,d.jsx)(n,{}),"Revert everything on ",b.name]}),(0,d.jsx)(x.mB,{}),(0,d.jsxs)(x._2,{onClick:()=>aj(!0),children:[(0,d.jsx)(o,{}),"Ledger table: ",D,".",_]})]})]}),(0,d.jsxs)(w.$,{size:"sm",disabled:aM||0===aK.steps.length,onClick:()=>aD("apply",aK),children:[(0,d.jsx)(p.A,{"data-icon":"inline-start"}),0===aK.steps.length?"Nothing pending":`Apply ${aK.steps.length} to ${b.name}`]})]})]}),0===G.length&&(0,d.jsxs)("p",{className:"border-b bg-muted/30 px-4 py-1.5 text-xs text-muted-foreground",children:["Only ",b.name," is tracked here."," ",(0,d.jsx)(f(),{href:"/",className:"text-foreground underline underline-offset-4",children:"Link it to the same database in another environment"})," ","to track both side by side."]}),ac&&(0,d.jsx)(aW,{report:ac,onDismiss:()=>ad(null)}),aC.error&&(0,d.jsx)("p",{className:"border-b bg-destructive/5 px-4 py-1.5 text-xs text-destructive",children:aC.error}),(0,d.jsxs)("div",{className:"relative flex min-h-0 flex-1 flex-col",children:["history"===J?(0,d.jsx)(z.F,{className:"min-h-0 flex-1",children:(0,d.jsx)(aG,{events:at,connections:am,loading:ao.loading})}):ap?.error?(0,d.jsx)("p",{className:"flex-1 px-4 py-6 font-mono text-xs text-destructive",children:ap.error}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(ax,{environments:ar,targetId:b.id,caption:function(a,b){if(b&&0===a.total)return"Reading…";let c=`${a.total} migration${1===a.total?"":"s"}`;return a.foreign>0?`${c} \xb7 ${a.foreign} more applied but missing from this folder`:c}(au,ao.loading),loading:ao.loading,onSelect:aI,onCompare:function(c){ab.lz.getState().setCompareTarget(b.id,c),a.push(`/${encodeURIComponent(b.id)}/diff`)}}),(0,d.jsxs)(z.F,{className:(0,C.cn)("min-h-0 flex-1",ao.loading&&"opacity-70"),children:[(F?.steps.length??0)===0&&(0,d.jsx)("div",{className:"p-6",children:(0,d.jsx)(aO,{onFiles:aA,compact:!0,hint:"Drop .sql files here to fill this set. They can arrive a folder at a time or one at a time."})}),(F?.steps??[]).map(a=>(0,d.jsx)(av,{step:a,targetId:b.id,status:V(a,aq),environments:ar.map(b=>({connection:b.connection,status:V(a,b.ledger),entry:U(a,b.ledger),error:b.error})),isNewestApplied:az?.version===a.version,expanded:L.includes(a.version),busy:aM,onToggle:()=>{var b;return b=a.version,void M(a=>a.includes(b)?a.filter(a=>a!==b):[...a,b])},actions:{onApplyThrough:()=>aD("apply",Y(F,aq,a.version)),onApplyOne:()=>aD("apply",{steps:[a],blockedBy:null}),onRevertThrough:()=>aD("revert",Z(F,aq,a.version)),onMarkApplied:()=>aD("apply",aE([a]),!0),onMarkPending:()=>aD("revert",aE([a]),!0),onAttachRevert:()=>{ah(a.version),window.requestAnimationFrame(()=>ak.current?.click())},onRemove:()=>F&&t(F.id,a.version),onOpenInEditor:aH}},a.version)),ay.length>0&&(0,d.jsx)(aX,{entries:ay,connectionName:b.name})]})]}),$&&(0,d.jsx)("div",{className:"absolute inset-0 z-20 flex items-center justify-center bg-background/85 p-6",onDragOver:a=>a.preventDefault(),onDragLeave:()=>aa(!1),onDrop:a=>{a.preventDefault(),aa(!1),aC.importFrom(a.dataTransfer)},children:(0,d.jsx)(aO,{onFiles:aA,className:"w-full max-w-xl bg-background"})})]}),(0,d.jsx)(aT,{pane:J,onPaneChange:K,historyCount:at.length,caption:function({name:a,connectionName:b,summary:c,initialized:d,loading:e,foundIn:f,configuredSchema:g}){if(e&&null===d)return"Reading ledgers…";if(!1===d)return`${b} has never had a migration run by YTDB, so all ${c.total} are pending`;let h=[];return 0===c.pending?h.push(`${b} is up to date with ${a}`):h.push(`${c.pending} of ${c.total} still to apply to ${b}`),c.drifted>0&&h.push(`${c.drifted} file${1===c.drifted?"":"s"} changed since it ran`),f&&f!==g&&h.push(`ledger kept in ${f}, not ${g}`),h.join(" \xb7 ")}({name:F?.name??"",connectionName:b.name,summary:au,initialized:aq?.initialized??null,loading:ao.loading,foundIn:aq?.initialized?aq.schema:null,configuredSchema:D})}),(0,d.jsx)("input",{ref:ak,type:"file",accept:".sql",className:"sr-only",onChange:a=>{aJ(a.target.files),a.target.value=""}}),ai&&(0,d.jsx)(aB,{schema:D,found:ar.filter(a=>a.ledger?.initialized).map(a=>({name:a.connection.name,schema:a.ledger?.schema??D})),onOpenChange:aj,onSave:a=>{E(a),ao.reload()}}),N&&(0,d.jsx)(aR,{open:!0,direction:N.direction,connection:b,steps:N.steps,blockedBy:N.blockedBy,progress:P,running:R,recordOnly:N.recordOnly??!1,onRun:()=>void aF(),onStop:()=>{al.current=!0},onClose:function(){R||(O(null),Q(null))}})]})}function aT({caption:a,pane:b,onPaneChange:c,historyCount:e}){return(0,d.jsxs)("footer",{className:"flex shrink-0 items-center gap-2 border-t px-4 py-1.5 text-xs text-muted-foreground",children:[(0,d.jsx)("span",{className:"min-w-0 truncate",children:a}),(0,d.jsx)("div",{className:"ml-auto",children:(0,d.jsx)(y.x,{label:"Migrations pane",value:b,onChange:c,options:[{value:"migrations",label:"Migrations"},{value:"history",label:e>0?`History (${e})`:"History"}]})})]})}function aU({children:a}){return(0,d.jsxs)("header",{className:"flex h-11 shrink-0 items-center gap-2 border-b px-3",children:[(0,d.jsx)(q.A,{className:"size-4 shrink-0 text-muted-foreground"}),(0,d.jsx)("span",{className:"font-medium",children:"Migrations"}),a]})}function aV({activeId:a,activeName:b,sets:c,onSelect:e,onCreate:f,onRename:g,onRemove:h}){return(0,d.jsxs)(x.rI,{children:[(0,d.jsxs)(x.ty,{className:"flex h-7 min-w-0 cursor-pointer items-center gap-1.5 rounded-lg bg-muted/70 px-2 text-xs outline-none hover:bg-muted focus-visible:ring-3 focus-visible:ring-ring/50 data-open:bg-muted",children:[(0,d.jsx)("span",{className:"max-w-40 truncate font-medium",children:b}),(0,d.jsx)(r.A,{className:"size-3 shrink-0 text-muted-foreground"})]}),(0,d.jsxs)(x.SQ,{align:"start",className:"min-w-56",children:[c.map(b=>(0,d.jsxs)(x._2,{onClick:()=>e(b.id),className:b.id===a?"font-medium":void 0,children:[(0,d.jsx)("span",{className:"min-w-0 flex-1 truncate",children:b.name}),(0,d.jsx)("span",{className:"shrink-0 tabular-nums text-muted-foreground",children:b.steps})]},b.id)),c.length>0&&(0,d.jsx)(x.mB,{}),(0,d.jsxs)(x._2,{onClick:f,children:[(0,d.jsx)(s.A,{}),"New empty set"]}),a&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(x._2,{onClick:g,children:[(0,d.jsx)(t.A,{}),"Rename"]}),(0,d.jsx)(x._2,{variant:"destructive",onClick:()=>h(a),children:"Forget this set"})]})]})]})}function aW({report:a,onDismiss:b}){let c=[];return a.added>0&&c.push(`added ${a.added}`),a.updated>0&&c.push(`updated ${a.updated}`),a.reverts>0&&c.push(`${a.reverts} revert file${1===a.reverts?"":"s"}`),(0,d.jsxs)("div",{className:"flex items-start gap-2 border-b bg-muted/30 px-4 py-1.5 text-xs",children:[(0,d.jsxs)("span",{className:"min-w-0 flex-1",children:[c.length>0?`Imported: ${c.join(", ")}`:"Nothing new in those files",a.skipped.length>0&&(0,d.jsxs)("span",{className:"text-muted-foreground",children:[" ","\xb7 skipped ",a.skipped.slice(0,2).join(", "),a.skipped.length>2&&` and ${a.skipped.length-2} more`]})]}),(0,d.jsx)(w.$,{size:"xs",variant:"ghost",onClick:b,children:"Dismiss"})]})}function aX({entries:a,connectionName:b}){return(0,d.jsxs)("div",{className:"border-t bg-muted/20",children:[(0,d.jsxs)("p",{className:"flex items-center gap-2 px-4 py-2 text-xs text-muted-foreground",children:[(0,d.jsx)(u,{className:"size-3.5 shrink-0 text-amber-600 dark:text-amber-400"}),"Applied on ",b," but not in this folder — the folder may be out of date."]}),a.map(a=>(0,d.jsxs)("div",{className:"flex items-center gap-2 px-4 py-1.5 text-xs opacity-70",children:[(0,d.jsx)(au,{status:"applied"}),(0,d.jsx)("span",{className:"shrink-0 font-mono text-muted-foreground",children:a.version}),(0,d.jsx)("span",{className:"min-w-0 flex-1 truncate",children:a.name||"—"}),(0,d.jsx)("span",{className:"shrink-0 text-muted-foreground/70",children:new Date(a.appliedAt).toLocaleString()})]},a.version))]})}},80192:(a,b,c)=>{Promise.resolve().then(c.bind(c,18261))},82078:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d=(0,c(41926).A)("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]])},88451:(a,b,c)=>{"use strict";c.r(b),c.d(b,{__next_app__:()=>s,handler:()=>u,routeModule:()=>t});var d=c(21635),e=c(86315),f=c(1020),g=c(61287),h={};for(let a in g)0>["default","__next_app__","routeModule","handler"].indexOf(a)&&(h[a]=()=>g[a]);c.d(b,h);let i=(0,d.p)(()=>Promise.resolve().then(c.bind(c,35780))),j=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),k=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,55091,23))),l=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,45270,23))),m=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,28193,23))),n=(0,d.p)(()=>Promise.resolve().then(c.bind(c,1777))),o=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),p=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),q={children:["",{children:["[connectionId]",{children:["migrations",{children:["__PAGE__",{},{page:[(0,d.p)(()=>Promise.resolve().then(c.bind(c,38632))),"/Users/theobourgeois/code/db-studio/src/app/[connectionId]/migrations/page.tsx"]}]},{"global-error":[p,"next/dist/client/components/builtin/global-error.js"]},[]]},{layout:[n,"/Users/theobourgeois/code/db-studio/src/app/[connectionId]/layout.tsx"],"global-error":[o,"next/dist/client/components/builtin/global-error.js"],metadata:{icon:[async a=>(await (0,d.p)(()=>Promise.resolve().then(c.bind(c,70440)))()).default(a),async a=>(await (0,d.p)(()=>Promise.resolve().then(c.bind(c,59645)))()).default(a)],apple:[],openGraph:[],twitter:[],manifest:void 0}},["_not-found","_global-error","api","favicon.ico","icon.svg"]]},{layout:[i,"/Users/theobourgeois/code/db-studio/src/app/layout.tsx"],"global-error":[j,"next/dist/client/components/builtin/global-error.js"],"not-found":[k,"next/dist/client/components/builtin/not-found.js"],forbidden:[l,"next/dist/client/components/builtin/forbidden.js"],unauthorized:[m,"next/dist/client/components/builtin/unauthorized.js"],metadata:{icon:[async a=>(await (0,d.p)(()=>Promise.resolve().then(c.bind(c,70440)))()).default(a),async a=>(await (0,d.p)(()=>Promise.resolve().then(c.bind(c,59645)))()).default(a)],apple:[],openGraph:[],twitter:[],manifest:void 0}},[]]}.children,r=(0,e.H)({tree:q,page:"/[connectionId]/migrations/page",pathname:"/[connectionId]/migrations",require:c,loadChunk:()=>Promise.resolve(),interopDefault:f.T}),s=r.__next_app__,t=r.routeModule,u=r.handler}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[741,430,458,792,400,391,593,729],()=>b(b.s=88451));module.exports=c})();
1
+ (()=>{var a={};a.id=820,a.ids=[820],a.modules={3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},24358:(a,b,c)=>{Promise.resolve().then(c.bind(c,99432))},28354:a=>{"use strict";a.exports=require("util")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{"use strict";a.exports=require("path")},38522:a=>{"use strict";a.exports=require("node:zlib")},38632:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>f});var d=c(5735),e=c(99432);function f(){return(0,d.jsx)(e.MigrationsIndex,{})}},41025:a=>{"use strict";a.exports=require("next/dist/server/app-render/dynamic-access-async-storage.external.js")},46060:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external.js")},47078:(a,b,c)=>{"use strict";c.d(b,{MigrationsIndex:()=>z});var d=c(48249),e=c(2116),f=c.n(e),g=c(19099),h=c(67484),i=c(1206),j=c(69473),k=c(91995),l=c(30770),m=c(44231),n=c(25297),o=c(53286),p=c(20886),q=c(21883),r=c(453),s=c(78931),t=c(99598),u=c(66280),v=c(14490),w=c(77963),x=c(32278),y=c(76829);function z(){let a=(0,g.useRouter)(),{connection:b}=(0,m.k)(),c=(0,u.j)(a=>a.sets),e=(0,u.j)(a=>a.createSet),f=(0,u.j)(a=>a.addFiles),k=(0,u.j)(a=>a.ledgerSchema),l=(0,u.j)(a=>a.history),v=(0,t.gz)(b.id),[z,B]=(0,h.useState)("migrations"),C=(0,h.useMemo)(()=>[b,...v],[b,v]),D=C.map(a=>a.url).join("|"),E=(0,p.Y)(`ledgers:${k}:${D}`,async a=>Object.fromEntries(await Promise.all(C.map(async b=>{try{return[b.id,{ledger:await q.F.ledger(b.url,k,a),error:null}]}catch(c){if(a.aborted)throw c;return[b.id,{ledger:null,error:c instanceof Error?c.message:String(c)}]}})))),F=(0,h.useMemo)(()=>(0,r.x)(C.map(a=>({connection:a,ledger:E.data?.[a.id]?.ledger??null})),l),[C,E.data,l]),G=`/${encodeURIComponent(b.id)}/migrations`,H=(0,h.useCallback)(b=>{let c=e(b.name);f(c,b.files),a.push(`${G}/${encodeURIComponent(c)}`)},[e,f,a,G]),I=(0,h.useMemo)(()=>[...c].sort((a,b)=>b.importedAt-a.importedAt),[c]);return(0,d.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[(0,d.jsxs)("header",{className:"flex h-11 shrink-0 items-center gap-2 border-b px-3",children:[(0,d.jsx)(i.A,{className:"size-4 shrink-0 text-muted-foreground"}),(0,d.jsx)("span",{className:"font-medium",children:"Migrations"}),(0,d.jsx)("span",{className:"truncate text-xs text-muted-foreground",children:b.name}),c.length>0&&(0,d.jsx)("div",{className:"ml-auto flex items-center gap-2",children:(0,d.jsxs)(n.$,{size:"sm",variant:"ghost",onClick:function(){let b=window.prompt("Name this migration","");if(null===b)return;let c=e(b.trim()||"Untitled migration");a.push(`${G}/${encodeURIComponent(c)}`)},children:[(0,d.jsx)(j.A,{"data-icon":"inline-start"}),"New migration"]})})]}),"history"===z?(0,d.jsx)(o.F,{className:"min-h-0 flex-1",children:(0,d.jsx)(w.H,{events:F,connections:C,loading:E.loading})}):0===c.length?(0,d.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center gap-4 p-6",children:[(0,d.jsx)(x.k,{onFiles:H,className:"w-full max-w-xl"}),(0,d.jsx)("p",{className:"max-w-xl text-center text-xs text-muted-foreground",children:"Each folder you drop becomes a migration of its own — open it to apply it to an environment, see where it stands, or revert it."})]}):(0,d.jsxs)(o.F,{className:"min-h-0 flex-1",children:[I.map(a=>(0,d.jsx)(A,{set:a,href:`${G}/${encodeURIComponent(a.id)}`,environments:C.map(b=>({connection:b,summary:(0,s.eh)(a,E.data?.[b.id]?.ledger??null),read:!!E.data?.[b.id]?.ledger,error:E.data?.[b.id]?.error??null}))},a.id)),(0,d.jsx)("div",{className:"p-4",children:(0,d.jsx)(x.k,{onFiles:H,compact:!0,hint:"Drop another folder to start a new migration.",className:"w-full"})})]}),(0,d.jsx)(y.l,{caption:0===c.length?"No migrations yet":`${c.length} migration${1===c.length?"":"s"}`,pane:z,onPaneChange:B,historyCount:F.length})]})}function A({set:a,href:b,environments:c}){return(0,d.jsxs)(f(),{href:b,className:"flex items-center gap-3 border-b px-4 py-3 outline-none transition-colors hover:bg-muted/40 focus-visible:bg-muted/40",children:[(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)("p",{className:"truncate text-sm font-medium",children:a.name}),(0,d.jsxs)("p",{className:"truncate text-xs text-muted-foreground",children:[0===a.steps.length?"No files yet":`${a.steps.length} migration${1===a.steps.length?"":"s"}`,a.steps.length>0&&` \xb7 ${a.steps[0].version}–${a.steps.at(-1)?.version}`]})]}),(0,d.jsx)("div",{className:"flex shrink-0 items-center gap-1.5",children:c.map(a=>(0,d.jsx)(B,{environment:a},a.connection.id))}),(0,d.jsx)(k.A,{className:"size-4 shrink-0 text-muted-foreground/60"})]})}function B({environment:a}){let{connection:b,summary:c,read:e,error:f}=a,g=e&&c.total>0&&0===c.pending&&0===c.drifted,h=e&&0===c.applied&&0===c.drifted;return(0,d.jsxs)("span",{title:f?`${b.name}: ${f}`:e?`${b.name}: ${c.applied} of ${c.total} applied`:`${b.name}: reading…`,className:(0,v.cn)("flex h-6 items-center gap-1.5 rounded-lg border px-2 text-[11px]",f&&"border-destructive/30 text-destructive",g&&"border-emerald-600/30 bg-emerald-500/10",!f&&!g&&!h&&"border-amber-600/30 bg-amber-500/10",h&&"text-muted-foreground"),children:[(0,d.jsx)(l.F,{connection:b,className:"size-1.5"}),(0,d.jsx)("span",{className:"max-w-24 truncate",children:b.name}),(0,d.jsx)("span",{className:"tabular-nums",children:f?"—":e?`${c.applied}/${c.total}`:"…"})]})}},54293:(a,b,c)=>{"use strict";c.r(b),c.d(b,{__next_app__:()=>s,handler:()=>u,routeModule:()=>t});var d=c(21635),e=c(86315),f=c(1020),g=c(61287),h={};for(let a in g)0>["default","__next_app__","routeModule","handler"].indexOf(a)&&(h[a]=()=>g[a]);c.d(b,h);let i=(0,d.p)(()=>Promise.resolve().then(c.bind(c,35780))),j=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),k=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,55091,23))),l=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,45270,23))),m=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,28193,23))),n=(0,d.p)(()=>Promise.resolve().then(c.bind(c,1777))),o=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),p=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),q={children:["",{children:["[connectionId]",{children:["migrations",{children:["__PAGE__",{},{page:[(0,d.p)(()=>Promise.resolve().then(c.bind(c,38632))),"/Users/theobourgeois/code/db-studio/src/app/[connectionId]/migrations/page.tsx"]}]},{"global-error":[p,"next/dist/client/components/builtin/global-error.js"]},[]]},{layout:[n,"/Users/theobourgeois/code/db-studio/src/app/[connectionId]/layout.tsx"],"global-error":[o,"next/dist/client/components/builtin/global-error.js"],metadata:{icon:[async a=>(await (0,d.p)(()=>Promise.resolve().then(c.bind(c,70440)))()).default(a),async a=>(await (0,d.p)(()=>Promise.resolve().then(c.bind(c,59645)))()).default(a)],apple:[],openGraph:[],twitter:[],manifest:void 0}},["_not-found","_global-error","api","favicon.ico","icon.svg"]]},{layout:[i,"/Users/theobourgeois/code/db-studio/src/app/layout.tsx"],"global-error":[j,"next/dist/client/components/builtin/global-error.js"],"not-found":[k,"next/dist/client/components/builtin/not-found.js"],forbidden:[l,"next/dist/client/components/builtin/forbidden.js"],unauthorized:[m,"next/dist/client/components/builtin/unauthorized.js"],metadata:{icon:[async a=>(await (0,d.p)(()=>Promise.resolve().then(c.bind(c,70440)))()).default(a),async a=>(await (0,d.p)(()=>Promise.resolve().then(c.bind(c,59645)))()).default(a)],apple:[],openGraph:[],twitter:[],manifest:void 0}},[]]}.children,r=(0,e.H)({tree:q,page:"/[connectionId]/migrations/page",pathname:"/[connectionId]/migrations",require:c,loadChunk:()=>Promise.resolve(),interopDefault:f.T}),s=r.__next_app__,t=r.routeModule,u=r.handler},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},69473:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d=(0,c(41926).A)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},94094:(a,b,c)=>{Promise.resolve().then(c.bind(c,47078))},99432:(a,b,c)=>{"use strict";c.d(b,{MigrationsIndex:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call MigrationsIndex() from the server but MigrationsIndex is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/theobourgeois/code/db-studio/src/components/migrations/migrations-index.tsx","MigrationsIndex")}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[741,430,458,792,400,391,593,729,702],()=>b(b.s=54293));module.exports=c})();
@@ -1 +1 @@
1
- {"version":1,"files":["../../../../../node_modules/@swc/helpers/_/_interop_require_default/package.json","../../../../../node_modules/@swc/helpers/cjs/_interop_require_default.cjs","../../../../../node_modules/@swc/helpers/package.json","../../../../../node_modules/next/dist/build/adapter/setup-node-env.external.js","../../../../../node_modules/next/dist/client/components/hooks-server-context.js","../../../../../node_modules/next/dist/client/components/static-generation-bailout.js","../../../../../node_modules/next/dist/client/lib/console.js","../../../../../node_modules/next/dist/compiled/@opentelemetry/api/index.js","../../../../../node_modules/next/dist/compiled/@opentelemetry/api/package.json","../../../../../node_modules/next/dist/compiled/jsonwebtoken/index.js","../../../../../node_modules/next/dist/compiled/jsonwebtoken/package.json","../../../../../node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js","../../../../../node_modules/next/dist/compiled/source-map/package.json","../../../../../node_modules/next/dist/compiled/source-map/source-map.js","../../../../../node_modules/next/dist/compiled/stacktrace-parser/package.json","../../../../../node_modules/next/dist/compiled/stacktrace-parser/stack-trace-parser.cjs.js","../../../../../node_modules/next/dist/compiled/ws/index.js","../../../../../node_modules/next/dist/compiled/ws/package.json","../../../../../node_modules/next/dist/lib/client-and-server-references.js","../../../../../node_modules/next/dist/lib/constants.js","../../../../../node_modules/next/dist/lib/framework/boundary-constants.js","../../../../../node_modules/next/dist/lib/interop-default.js","../../../../../node_modules/next/dist/lib/is-error.js","../../../../../node_modules/next/dist/lib/picocolors.js","../../../../../node_modules/next/dist/lib/scheduler.js","../../../../../node_modules/next/dist/lib/semver-noop.js","../../../../../node_modules/next/dist/server/app-render/action-async-storage-instance.js","../../../../../node_modules/next/dist/server/app-render/action-async-storage.external.js","../../../../../node_modules/next/dist/server/app-render/after-task-async-storage-instance.js","../../../../../node_modules/next/dist/server/app-render/after-task-async-storage.external.js","../../../../../node_modules/next/dist/server/app-render/async-local-storage.js","../../../../../node_modules/next/dist/server/app-render/blocking-route-messages.js","../../../../../node_modules/next/dist/server/app-render/cache-signal.js","../../../../../node_modules/next/dist/server/app-render/console-async-storage-instance.js","../../../../../node_modules/next/dist/server/app-render/console-async-storage.external.js","../../../../../node_modules/next/dist/server/app-render/dynamic-access-async-storage-instance.js","../../../../../node_modules/next/dist/server/app-render/dynamic-access-async-storage.external.js","../../../../../node_modules/next/dist/server/app-render/dynamic-rendering.js","../../../../../node_modules/next/dist/server/app-render/instant-validation/boundary-constants.js","../../../../../node_modules/next/dist/server/app-render/instant-validation/boundary-tracking.js","../../../../../node_modules/next/dist/server/app-render/module-loading/track-module-loading.external.js","../../../../../node_modules/next/dist/server/app-render/module-loading/track-module-loading.instance.js","../../../../../node_modules/next/dist/server/app-render/staged-rendering.js","../../../../../node_modules/next/dist/server/app-render/sync-io-messages.js","../../../../../node_modules/next/dist/server/app-render/work-async-storage-instance.js","../../../../../node_modules/next/dist/server/app-render/work-async-storage.external.js","../../../../../node_modules/next/dist/server/app-render/work-unit-async-storage-instance.js","../../../../../node_modules/next/dist/server/app-render/work-unit-async-storage.external.js","../../../../../node_modules/next/dist/server/dev/browser-logs/file-logger.js","../../../../../node_modules/next/dist/server/dynamic-rendering-utils.js","../../../../../node_modules/next/dist/server/lib/incremental-cache/memory-cache.external.js","../../../../../node_modules/next/dist/server/lib/incremental-cache/shared-cache-controls.external.js","../../../../../node_modules/next/dist/server/lib/incremental-cache/tags-manifest.external.js","../../../../../node_modules/next/dist/server/lib/lru-cache.js","../../../../../node_modules/next/dist/server/lib/parse-stack.js","../../../../../node_modules/next/dist/server/lib/router-utils/instrumentation-globals.external.js","../../../../../node_modules/next/dist/server/lib/router-utils/instrumentation-node-extensions.js","../../../../../node_modules/next/dist/server/lib/source-maps.js","../../../../../node_modules/next/dist/server/lib/trace/constants.js","../../../../../node_modules/next/dist/server/lib/trace/tracer.js","../../../../../node_modules/next/dist/server/load-manifest.external.js","../../../../../node_modules/next/dist/server/node-environment-baseline.js","../../../../../node_modules/next/dist/server/node-environment-extensions/console-dim.external.js","../../../../../node_modules/next/dist/server/node-environment-extensions/console-exit.js","../../../../../node_modules/next/dist/server/node-environment-extensions/console-file.js","../../../../../node_modules/next/dist/server/node-environment-extensions/date.js","../../../../../node_modules/next/dist/server/node-environment-extensions/error-inspect.js","../../../../../node_modules/next/dist/server/node-environment-extensions/fast-set-immediate.external.js","../../../../../node_modules/next/dist/server/node-environment-extensions/io-utils.js","../../../../../node_modules/next/dist/server/node-environment-extensions/node-crypto.js","../../../../../node_modules/next/dist/server/node-environment-extensions/random.js","../../../../../node_modules/next/dist/server/node-environment-extensions/unhandled-rejection.external.js","../../../../../node_modules/next/dist/server/node-environment-extensions/web-crypto.js","../../../../../node_modules/next/dist/server/node-environment.js","../../../../../node_modules/next/dist/server/node-polyfill-crypto.js","../../../../../node_modules/next/dist/server/patch-error-inspect.js","../../../../../node_modules/next/dist/server/require-hook.js","../../../../../node_modules/next/dist/server/response-cache/types.js","../../../../../node_modules/next/dist/server/runtime-reacts.external.js","../../../../../node_modules/next/dist/shared/lib/deep-freeze.js","../../../../../node_modules/next/dist/shared/lib/instant-messages.js","../../../../../node_modules/next/dist/shared/lib/invariant-error.js","../../../../../node_modules/next/dist/shared/lib/is-plain-object.js","../../../../../node_modules/next/dist/shared/lib/is-thenable.js","../../../../../node_modules/next/dist/shared/lib/lazy-dynamic/bailout-to-csr.js","../../../../../node_modules/next/dist/shared/lib/no-fallback-error.external.js","../../../../../node_modules/next/dist/shared/lib/promise-with-resolvers.js","../../../../../node_modules/next/dist/shared/lib/server-reference-info.js","../../../../../node_modules/next/package.json","../../../../../node_modules/react/cjs/react.development.js","../../../../../node_modules/react/cjs/react.production.js","../../../../../node_modules/react/index.js","../../../../../node_modules/react/package.json","../../../../../package.json","../../../../package.json","../../../chunks/391.js","../../../chunks/400.js","../../../chunks/430.js","../../../chunks/458.js","../../../chunks/593.js","../../../chunks/729.js","../../../chunks/741.js","../../../chunks/792.js","../../../webpack-runtime.js","page_client-reference-manifest.js"]}
1
+ {"version":1,"files":["../../../../../node_modules/@swc/helpers/_/_interop_require_default/package.json","../../../../../node_modules/@swc/helpers/cjs/_interop_require_default.cjs","../../../../../node_modules/@swc/helpers/package.json","../../../../../node_modules/next/dist/build/adapter/setup-node-env.external.js","../../../../../node_modules/next/dist/client/components/hooks-server-context.js","../../../../../node_modules/next/dist/client/components/static-generation-bailout.js","../../../../../node_modules/next/dist/client/lib/console.js","../../../../../node_modules/next/dist/compiled/@opentelemetry/api/index.js","../../../../../node_modules/next/dist/compiled/@opentelemetry/api/package.json","../../../../../node_modules/next/dist/compiled/jsonwebtoken/index.js","../../../../../node_modules/next/dist/compiled/jsonwebtoken/package.json","../../../../../node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js","../../../../../node_modules/next/dist/compiled/source-map/package.json","../../../../../node_modules/next/dist/compiled/source-map/source-map.js","../../../../../node_modules/next/dist/compiled/stacktrace-parser/package.json","../../../../../node_modules/next/dist/compiled/stacktrace-parser/stack-trace-parser.cjs.js","../../../../../node_modules/next/dist/compiled/ws/index.js","../../../../../node_modules/next/dist/compiled/ws/package.json","../../../../../node_modules/next/dist/lib/client-and-server-references.js","../../../../../node_modules/next/dist/lib/constants.js","../../../../../node_modules/next/dist/lib/framework/boundary-constants.js","../../../../../node_modules/next/dist/lib/interop-default.js","../../../../../node_modules/next/dist/lib/is-error.js","../../../../../node_modules/next/dist/lib/picocolors.js","../../../../../node_modules/next/dist/lib/scheduler.js","../../../../../node_modules/next/dist/lib/semver-noop.js","../../../../../node_modules/next/dist/server/app-render/action-async-storage-instance.js","../../../../../node_modules/next/dist/server/app-render/action-async-storage.external.js","../../../../../node_modules/next/dist/server/app-render/after-task-async-storage-instance.js","../../../../../node_modules/next/dist/server/app-render/after-task-async-storage.external.js","../../../../../node_modules/next/dist/server/app-render/async-local-storage.js","../../../../../node_modules/next/dist/server/app-render/blocking-route-messages.js","../../../../../node_modules/next/dist/server/app-render/cache-signal.js","../../../../../node_modules/next/dist/server/app-render/console-async-storage-instance.js","../../../../../node_modules/next/dist/server/app-render/console-async-storage.external.js","../../../../../node_modules/next/dist/server/app-render/dynamic-access-async-storage-instance.js","../../../../../node_modules/next/dist/server/app-render/dynamic-access-async-storage.external.js","../../../../../node_modules/next/dist/server/app-render/dynamic-rendering.js","../../../../../node_modules/next/dist/server/app-render/instant-validation/boundary-constants.js","../../../../../node_modules/next/dist/server/app-render/instant-validation/boundary-tracking.js","../../../../../node_modules/next/dist/server/app-render/module-loading/track-module-loading.external.js","../../../../../node_modules/next/dist/server/app-render/module-loading/track-module-loading.instance.js","../../../../../node_modules/next/dist/server/app-render/staged-rendering.js","../../../../../node_modules/next/dist/server/app-render/sync-io-messages.js","../../../../../node_modules/next/dist/server/app-render/work-async-storage-instance.js","../../../../../node_modules/next/dist/server/app-render/work-async-storage.external.js","../../../../../node_modules/next/dist/server/app-render/work-unit-async-storage-instance.js","../../../../../node_modules/next/dist/server/app-render/work-unit-async-storage.external.js","../../../../../node_modules/next/dist/server/dev/browser-logs/file-logger.js","../../../../../node_modules/next/dist/server/dynamic-rendering-utils.js","../../../../../node_modules/next/dist/server/lib/incremental-cache/memory-cache.external.js","../../../../../node_modules/next/dist/server/lib/incremental-cache/shared-cache-controls.external.js","../../../../../node_modules/next/dist/server/lib/incremental-cache/tags-manifest.external.js","../../../../../node_modules/next/dist/server/lib/lru-cache.js","../../../../../node_modules/next/dist/server/lib/parse-stack.js","../../../../../node_modules/next/dist/server/lib/router-utils/instrumentation-globals.external.js","../../../../../node_modules/next/dist/server/lib/router-utils/instrumentation-node-extensions.js","../../../../../node_modules/next/dist/server/lib/source-maps.js","../../../../../node_modules/next/dist/server/lib/trace/constants.js","../../../../../node_modules/next/dist/server/lib/trace/tracer.js","../../../../../node_modules/next/dist/server/load-manifest.external.js","../../../../../node_modules/next/dist/server/node-environment-baseline.js","../../../../../node_modules/next/dist/server/node-environment-extensions/console-dim.external.js","../../../../../node_modules/next/dist/server/node-environment-extensions/console-exit.js","../../../../../node_modules/next/dist/server/node-environment-extensions/console-file.js","../../../../../node_modules/next/dist/server/node-environment-extensions/date.js","../../../../../node_modules/next/dist/server/node-environment-extensions/error-inspect.js","../../../../../node_modules/next/dist/server/node-environment-extensions/fast-set-immediate.external.js","../../../../../node_modules/next/dist/server/node-environment-extensions/io-utils.js","../../../../../node_modules/next/dist/server/node-environment-extensions/node-crypto.js","../../../../../node_modules/next/dist/server/node-environment-extensions/random.js","../../../../../node_modules/next/dist/server/node-environment-extensions/unhandled-rejection.external.js","../../../../../node_modules/next/dist/server/node-environment-extensions/web-crypto.js","../../../../../node_modules/next/dist/server/node-environment.js","../../../../../node_modules/next/dist/server/node-polyfill-crypto.js","../../../../../node_modules/next/dist/server/patch-error-inspect.js","../../../../../node_modules/next/dist/server/require-hook.js","../../../../../node_modules/next/dist/server/response-cache/types.js","../../../../../node_modules/next/dist/server/runtime-reacts.external.js","../../../../../node_modules/next/dist/shared/lib/deep-freeze.js","../../../../../node_modules/next/dist/shared/lib/instant-messages.js","../../../../../node_modules/next/dist/shared/lib/invariant-error.js","../../../../../node_modules/next/dist/shared/lib/is-plain-object.js","../../../../../node_modules/next/dist/shared/lib/is-thenable.js","../../../../../node_modules/next/dist/shared/lib/lazy-dynamic/bailout-to-csr.js","../../../../../node_modules/next/dist/shared/lib/no-fallback-error.external.js","../../../../../node_modules/next/dist/shared/lib/promise-with-resolvers.js","../../../../../node_modules/next/dist/shared/lib/server-reference-info.js","../../../../../node_modules/next/package.json","../../../../../node_modules/react/cjs/react.development.js","../../../../../node_modules/react/cjs/react.production.js","../../../../../node_modules/react/index.js","../../../../../node_modules/react/package.json","../../../../../package.json","../../../../package.json","../../../chunks/391.js","../../../chunks/400.js","../../../chunks/430.js","../../../chunks/458.js","../../../chunks/593.js","../../../chunks/702.js","../../../chunks/729.js","../../../chunks/741.js","../../../chunks/792.js","../../../webpack-runtime.js","page_client-reference-manifest.js"]}
@@ -1 +1 @@
1
- globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/[connectionId]/migrations/page"]={"moduleLoading":{"prefix":"/_next/"},"ssrModuleMapping":{"3725":{"*":{"id":"75267","name":"*","chunks":[],"async":false}},"6937":{"*":{"id":"59809","name":"*","chunks":[],"async":false}},"20400":{"*":{"id":"22053","name":"*","chunks":[],"async":false}},"27123":{"*":{"id":"81921","name":"*","chunks":[],"async":false}},"32971":{"*":{"id":"16331","name":"*","chunks":[],"async":false}},"35788":{"*":{"id":"53534","name":"*","chunks":[],"async":false}},"39049":{"*":{"id":"91723","name":"*","chunks":[],"async":false}},"57121":{"*":{"id":"35421","name":"*","chunks":[],"async":false}},"61304":{"*":{"id":"60440","name":"*","chunks":[],"async":false}},"64777":{"*":{"id":"82265","name":"*","chunks":[],"async":false}},"72737":{"*":{"id":"4833","name":"*","chunks":[],"async":false}},"74581":{"*":{"id":"61335","name":"*","chunks":[],"async":false}},"78616":{"*":{"id":"84342","name":"*","chunks":[],"async":false}},"86869":{"*":{"id":"74661","name":"*","chunks":[],"async":false}},"87758":{"*":{"id":"19047","name":"*","chunks":[],"async":false}},"90484":{"*":{"id":"70664","name":"*","chunks":[],"async":false}},"94821":{"*":{"id":"80189","name":"*","chunks":[],"async":false}}},"edgeSSRModuleMapping":{},"clientModules":{"/Users/theobourgeois/code/db-studio/node_modules/next/dist/client/components/builtin/global-error.js":{"id":27123,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/dist/esm/client/components/builtin/global-error.js":{"id":27123,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/dist/client/components/client-page.js":{"id":61304,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/dist/esm/client/components/client-page.js":{"id":61304,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/dist/client/components/client-segment.js":{"id":78616,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/dist/esm/client/components/client-segment.js":{"id":78616,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/dist/client/components/http-access-fallback/error-boundary.js":{"id":64777,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/dist/esm/client/components/http-access-fallback/error-boundary.js":{"id":64777,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/dist/client/components/layout-router.js":{"id":57121,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/dist/esm/client/components/layout-router.js":{"id":57121,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/dist/client/components/render-from-template-context.js":{"id":74581,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":74581,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/dist/lib/framework/boundary-components.js":{"id":90484,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/dist/esm/lib/framework/boundary-components.js":{"id":90484,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/dist/lib/metadata/generate/icon-mark.js":{"id":86869,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/dist/esm/lib/metadata/generate/icon-mark.js":{"id":86869,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/font/google/target.css?{\"path\":\"src/app/layout.tsx\",\"import\":\"Geist\",\"arguments\":[{\"variable\":\"--font-sans\",\"subsets\":[\"latin\"]}],\"variableName\":\"sans\"}":{"id":34244,"name":"*","chunks":["39","static/chunks/39-3411368bf75bda4b.js","177","static/chunks/app/layout-6c0fa591484fc6df.js"],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/font/google/target.css?{\"path\":\"src/app/layout.tsx\",\"import\":\"Geist_Mono\",\"arguments\":[{\"variable\":\"--font-geist-mono\",\"subsets\":[\"latin\"]}],\"variableName\":\"mono\"}":{"id":64939,"name":"*","chunks":["39","static/chunks/39-3411368bf75bda4b.js","177","static/chunks/app/layout-6c0fa591484fc6df.js"],"async":false},"/Users/theobourgeois/code/db-studio/src/app/globals.css":{"id":51743,"name":"*","chunks":["39","static/chunks/39-3411368bf75bda4b.js","177","static/chunks/app/layout-6c0fa591484fc6df.js"],"async":false},"/Users/theobourgeois/code/db-studio/src/components/ConvexClientProvider.tsx":{"id":94821,"name":"*","chunks":["39","static/chunks/39-3411368bf75bda4b.js","177","static/chunks/app/layout-6c0fa591484fc6df.js"],"async":false},"/Users/theobourgeois/code/db-studio/src/components/local-bridge-gate.tsx":{"id":87758,"name":"*","chunks":["39","static/chunks/39-3411368bf75bda4b.js","177","static/chunks/app/layout-6c0fa591484fc6df.js"],"async":false},"/Users/theobourgeois/code/db-studio/src/components/theme-provider.tsx":{"id":72737,"name":"*","chunks":["39","static/chunks/39-3411368bf75bda4b.js","177","static/chunks/app/layout-6c0fa591484fc6df.js"],"async":false},"/Users/theobourgeois/code/db-studio/src/app/page.tsx":{"id":20400,"name":"*","chunks":["603","static/chunks/603-4d453706a69687ab.js","842","static/chunks/842-7d4f33472de28bfd.js","500","static/chunks/500-2d1136a2b6ea2d76.js","469","static/chunks/469-5223a74e4a332e16.js","938","static/chunks/938-3d7a8b7b2f336e91.js","974","static/chunks/app/page-b2d6b39a184ee5c7.js"],"async":false},"/Users/theobourgeois/code/db-studio/src/components/explorer/explorer-shell.tsx":{"id":6937,"name":"*","chunks":["603","static/chunks/603-4d453706a69687ab.js","842","static/chunks/842-7d4f33472de28bfd.js","500","static/chunks/500-2d1136a2b6ea2d76.js","9","static/chunks/9-34415c4a38da9de1.js","469","static/chunks/469-5223a74e4a332e16.js","938","static/chunks/938-3d7a8b7b2f336e91.js","123","static/chunks/app/%5BconnectionId%5D/layout-5ceae464cef50cb0.js"],"async":false},"/Users/theobourgeois/code/db-studio/src/components/table/table-view.tsx":{"id":32971,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/src/components/diff/schema-diff-view.tsx":{"id":35788,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/src/components/migrations/migrations-view.tsx":{"id":3725,"name":"*","chunks":["603","static/chunks/603-4d453706a69687ab.js","842","static/chunks/842-7d4f33472de28bfd.js","500","static/chunks/500-2d1136a2b6ea2d76.js","9","static/chunks/9-34415c4a38da9de1.js","469","static/chunks/469-5223a74e4a332e16.js","444","static/chunks/444-1a5198873808abcb.js","820","static/chunks/app/%5BconnectionId%5D/migrations/page-a5b61ff9ef6a087b.js"],"async":false},"/Users/theobourgeois/code/db-studio/src/components/query/query-view.tsx":{"id":39049,"name":"*","chunks":[],"async":false}},"entryCSSFiles":{"/Users/theobourgeois/code/db-studio/src/":[],"/Users/theobourgeois/code/db-studio/src/app/layout":[{"inlined":false,"path":"static/css/e02ab5db9ff2dca2.css"},{"inlined":false,"path":"static/css/c36a068647b766f7.css"}],"/Users/theobourgeois/code/db-studio/src/app/page":[],"/Users/theobourgeois/code/db-studio/src/app/[connectionId]/layout":[],"/Users/theobourgeois/code/db-studio/src/app/[connectionId]/page":[],"/Users/theobourgeois/code/db-studio/src/app/[connectionId]/migrations/page":[]},"rscModuleMapping":{"3725":{"*":{"id":"18261","name":"*","chunks":[],"async":false}},"6937":{"*":{"id":"34766","name":"*","chunks":[],"async":false}},"20400":{"*":{"id":"4494","name":"*","chunks":[],"async":false}},"27123":{"*":{"id":"95547","name":"*","chunks":[],"async":false}},"32971":{"*":{"id":"12377","name":"*","chunks":[],"async":false}},"35788":{"*":{"id":"58977","name":"*","chunks":[],"async":false}},"39049":{"*":{"id":"2781","name":"*","chunks":[],"async":false}},"51743":{"*":{"id":"61135","name":"*","chunks":[],"async":false}},"57121":{"*":{"id":"98099","name":"*","chunks":[],"async":false}},"61304":{"*":{"id":"15098","name":"*","chunks":[],"async":false}},"64777":{"*":{"id":"33859","name":"*","chunks":[],"async":false}},"72737":{"*":{"id":"65223","name":"*","chunks":[],"async":false}},"74581":{"*":{"id":"16237","name":"*","chunks":[],"async":false}},"78616":{"*":{"id":"47644","name":"*","chunks":[],"async":false}},"86869":{"*":{"id":"36675","name":"*","chunks":[],"async":false}},"87758":{"*":{"id":"17569","name":"*","chunks":[],"async":false}},"90484":{"*":{"id":"98562","name":"*","chunks":[],"async":false}},"94821":{"*":{"id":"88331","name":"*","chunks":[],"async":false}}},"edgeRscModuleMapping":{}};
1
+ globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/[connectionId]/migrations/page"]={"moduleLoading":{"prefix":"/_next/"},"ssrModuleMapping":{"6937":{"*":{"id":"59809","name":"*","chunks":[],"async":false}},"16364":{"*":{"id":"47078","name":"*","chunks":[],"async":false}},"20400":{"*":{"id":"22053","name":"*","chunks":[],"async":false}},"27123":{"*":{"id":"81921","name":"*","chunks":[],"async":false}},"32971":{"*":{"id":"88865","name":"*","chunks":[],"async":false}},"35788":{"*":{"id":"53534","name":"*","chunks":[],"async":false}},"39049":{"*":{"id":"91723","name":"*","chunks":[],"async":false}},"50492":{"*":{"id":"74678","name":"*","chunks":[],"async":false}},"57121":{"*":{"id":"35421","name":"*","chunks":[],"async":false}},"61304":{"*":{"id":"60440","name":"*","chunks":[],"async":false}},"64777":{"*":{"id":"82265","name":"*","chunks":[],"async":false}},"72737":{"*":{"id":"4833","name":"*","chunks":[],"async":false}},"74581":{"*":{"id":"61335","name":"*","chunks":[],"async":false}},"78616":{"*":{"id":"84342","name":"*","chunks":[],"async":false}},"86869":{"*":{"id":"74661","name":"*","chunks":[],"async":false}},"87758":{"*":{"id":"19047","name":"*","chunks":[],"async":false}},"90484":{"*":{"id":"70664","name":"*","chunks":[],"async":false}},"94821":{"*":{"id":"80189","name":"*","chunks":[],"async":false}}},"edgeSSRModuleMapping":{},"clientModules":{"/Users/theobourgeois/code/db-studio/node_modules/next/dist/client/components/builtin/global-error.js":{"id":27123,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/dist/esm/client/components/builtin/global-error.js":{"id":27123,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/dist/client/components/client-page.js":{"id":61304,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/dist/esm/client/components/client-page.js":{"id":61304,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/dist/client/components/client-segment.js":{"id":78616,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/dist/esm/client/components/client-segment.js":{"id":78616,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/dist/client/components/http-access-fallback/error-boundary.js":{"id":64777,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/dist/esm/client/components/http-access-fallback/error-boundary.js":{"id":64777,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/dist/client/components/layout-router.js":{"id":57121,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/dist/esm/client/components/layout-router.js":{"id":57121,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/dist/client/components/render-from-template-context.js":{"id":74581,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":74581,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/dist/lib/framework/boundary-components.js":{"id":90484,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/dist/esm/lib/framework/boundary-components.js":{"id":90484,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/dist/lib/metadata/generate/icon-mark.js":{"id":86869,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/dist/esm/lib/metadata/generate/icon-mark.js":{"id":86869,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/font/google/target.css?{\"path\":\"src/app/layout.tsx\",\"import\":\"Geist\",\"arguments\":[{\"variable\":\"--font-sans\",\"subsets\":[\"latin\"]}],\"variableName\":\"sans\"}":{"id":34244,"name":"*","chunks":["6039","static/chunks/6039-02dbcff4d4ccf559.js","7177","static/chunks/app/layout-dd332a9583f47cd6.js"],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/font/google/target.css?{\"path\":\"src/app/layout.tsx\",\"import\":\"Geist_Mono\",\"arguments\":[{\"variable\":\"--font-geist-mono\",\"subsets\":[\"latin\"]}],\"variableName\":\"mono\"}":{"id":64939,"name":"*","chunks":["6039","static/chunks/6039-02dbcff4d4ccf559.js","7177","static/chunks/app/layout-dd332a9583f47cd6.js"],"async":false},"/Users/theobourgeois/code/db-studio/src/app/globals.css":{"id":51743,"name":"*","chunks":["6039","static/chunks/6039-02dbcff4d4ccf559.js","7177","static/chunks/app/layout-dd332a9583f47cd6.js"],"async":false},"/Users/theobourgeois/code/db-studio/src/components/ConvexClientProvider.tsx":{"id":94821,"name":"*","chunks":["6039","static/chunks/6039-02dbcff4d4ccf559.js","7177","static/chunks/app/layout-dd332a9583f47cd6.js"],"async":false},"/Users/theobourgeois/code/db-studio/src/components/local-bridge-gate.tsx":{"id":87758,"name":"*","chunks":["6039","static/chunks/6039-02dbcff4d4ccf559.js","7177","static/chunks/app/layout-dd332a9583f47cd6.js"],"async":false},"/Users/theobourgeois/code/db-studio/src/components/theme-provider.tsx":{"id":72737,"name":"*","chunks":["6039","static/chunks/6039-02dbcff4d4ccf559.js","7177","static/chunks/app/layout-dd332a9583f47cd6.js"],"async":false},"/Users/theobourgeois/code/db-studio/src/app/page.tsx":{"id":20400,"name":"*","chunks":["8651","static/chunks/8651-f7ba864bc5a5b128.js","8360","static/chunks/8360-5a3ba00eb4ee0720.js","8500","static/chunks/8500-01a63dafd809e317.js","6842","static/chunks/6842-c2831fd548ae657c.js","1528","static/chunks/1528-3257b0cb7a73dd8b.js","6091","static/chunks/6091-de8d2e51b0196435.js","8974","static/chunks/app/page-b582d36c1b014a02.js"],"async":false},"/Users/theobourgeois/code/db-studio/src/components/explorer/explorer-shell.tsx":{"id":6937,"name":"*","chunks":["8651","static/chunks/8651-f7ba864bc5a5b128.js","8360","static/chunks/8360-5a3ba00eb4ee0720.js","8500","static/chunks/8500-01a63dafd809e317.js","6842","static/chunks/6842-c2831fd548ae657c.js","8322","static/chunks/8322-b1154a96547c860d.js","1528","static/chunks/1528-3257b0cb7a73dd8b.js","6091","static/chunks/6091-de8d2e51b0196435.js","7123","static/chunks/app/%5BconnectionId%5D/layout-18239a50b43285f6.js"],"async":false},"/Users/theobourgeois/code/db-studio/src/components/table/table-view.tsx":{"id":32971,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/src/components/diff/schema-diff-view.tsx":{"id":35788,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/src/components/migrations/migration-detail.tsx":{"id":50492,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/src/components/migrations/migrations-index.tsx":{"id":16364,"name":"*","chunks":["8651","static/chunks/8651-f7ba864bc5a5b128.js","8500","static/chunks/8500-01a63dafd809e317.js","8322","static/chunks/8322-b1154a96547c860d.js","1528","static/chunks/1528-3257b0cb7a73dd8b.js","7449","static/chunks/7449-2b9bc65afb482d61.js","9820","static/chunks/app/%5BconnectionId%5D/migrations/page-20f40d5f232b4607.js"],"async":false},"/Users/theobourgeois/code/db-studio/src/components/query/query-view.tsx":{"id":39049,"name":"*","chunks":[],"async":false}},"entryCSSFiles":{"/Users/theobourgeois/code/db-studio/src/":[],"/Users/theobourgeois/code/db-studio/src/app/layout":[{"inlined":false,"path":"static/css/e02ab5db9ff2dca2.css"},{"inlined":false,"path":"static/css/993f480f9e0f3e74.css"}],"/Users/theobourgeois/code/db-studio/src/app/page":[],"/Users/theobourgeois/code/db-studio/src/app/[connectionId]/layout":[],"/Users/theobourgeois/code/db-studio/src/app/[connectionId]/page":[],"/Users/theobourgeois/code/db-studio/src/app/[connectionId]/migrations/page":[]},"rscModuleMapping":{"6937":{"*":{"id":"34766","name":"*","chunks":[],"async":false}},"16364":{"*":{"id":"99432","name":"*","chunks":[],"async":false}},"20400":{"*":{"id":"4494","name":"*","chunks":[],"async":false}},"27123":{"*":{"id":"95547","name":"*","chunks":[],"async":false}},"32971":{"*":{"id":"12377","name":"*","chunks":[],"async":false}},"35788":{"*":{"id":"58977","name":"*","chunks":[],"async":false}},"39049":{"*":{"id":"2781","name":"*","chunks":[],"async":false}},"50492":{"*":{"id":"97182","name":"*","chunks":[],"async":false}},"51743":{"*":{"id":"61135","name":"*","chunks":[],"async":false}},"57121":{"*":{"id":"98099","name":"*","chunks":[],"async":false}},"61304":{"*":{"id":"15098","name":"*","chunks":[],"async":false}},"64777":{"*":{"id":"33859","name":"*","chunks":[],"async":false}},"72737":{"*":{"id":"65223","name":"*","chunks":[],"async":false}},"74581":{"*":{"id":"16237","name":"*","chunks":[],"async":false}},"78616":{"*":{"id":"47644","name":"*","chunks":[],"async":false}},"86869":{"*":{"id":"36675","name":"*","chunks":[],"async":false}},"87758":{"*":{"id":"17569","name":"*","chunks":[],"async":false}},"90484":{"*":{"id":"98562","name":"*","chunks":[],"async":false}},"94821":{"*":{"id":"88331","name":"*","chunks":[],"async":false}}},"edgeRscModuleMapping":{}};
@@ -1 +1 @@
1
- "use strict";(()=>{var a={};a.id=336,a.ids=[336],a.modules={3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},8128:a=>{a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},28354:a=>{a.exports=require("util")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},38522:a=>{a.exports=require("node:zlib")},41025:a=>{a.exports=require("next/dist/server/app-render/dynamic-access-async-storage.external.js")},42134:(a,b,c)=>{c.r(b),c.d(b,{default:()=>e});var d=c(5735);function e(){return(0,d.jsx)("div",{className:"flex flex-1 items-center justify-center text-muted-foreground",children:"Select a table"})}},46060:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external.js")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},75525:(a,b,c)=>{c.r(b),c.d(b,{__next_app__:()=>r,handler:()=>t,routeModule:()=>s});var d=c(21635),e=c(86315),f=c(1020),g=c(61287),h={};for(let a in g)0>["default","__next_app__","routeModule","handler"].indexOf(a)&&(h[a]=()=>g[a]);c.d(b,h);let i=(0,d.p)(()=>Promise.resolve().then(c.bind(c,35780))),j=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),k=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,55091,23))),l=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,45270,23))),m=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,28193,23))),n=(0,d.p)(()=>Promise.resolve().then(c.bind(c,1777))),o=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),p={children:["",{children:["[connectionId]",{children:["__PAGE__",{},{page:[(0,d.p)(()=>Promise.resolve().then(c.bind(c,42134))),"/Users/theobourgeois/code/db-studio/src/app/[connectionId]/page.tsx"]}]},{layout:[n,"/Users/theobourgeois/code/db-studio/src/app/[connectionId]/layout.tsx"],"global-error":[o,"next/dist/client/components/builtin/global-error.js"],metadata:{icon:[async a=>(await (0,d.p)(()=>Promise.resolve().then(c.bind(c,70440)))()).default(a),async a=>(await (0,d.p)(()=>Promise.resolve().then(c.bind(c,59645)))()).default(a)],apple:[],openGraph:[],twitter:[],manifest:void 0}},["_not-found","_global-error","api","favicon.ico","icon.svg"]]},{layout:[i,"/Users/theobourgeois/code/db-studio/src/app/layout.tsx"],"global-error":[j,"next/dist/client/components/builtin/global-error.js"],"not-found":[k,"next/dist/client/components/builtin/not-found.js"],forbidden:[l,"next/dist/client/components/builtin/forbidden.js"],unauthorized:[m,"next/dist/client/components/builtin/unauthorized.js"],metadata:{icon:[async a=>(await (0,d.p)(()=>Promise.resolve().then(c.bind(c,70440)))()).default(a),async a=>(await (0,d.p)(()=>Promise.resolve().then(c.bind(c,59645)))()).default(a)],apple:[],openGraph:[],twitter:[],manifest:void 0}},[]]}.children,q=(0,e.H)({tree:p,page:"/[connectionId]/page",pathname:"/[connectionId]",require:c,loadChunk:()=>Promise.resolve(),interopDefault:f.T}),r=q.__next_app__,s=q.routeModule,t=q.handler}};var b=require("../../webpack-runtime.js");b.C(a);var c=b.X(0,[741,430,458,792,400,391,593,729],()=>b(b.s=75525));module.exports=c})();
1
+ "use strict";(()=>{var a={};a.id=336,a.ids=[336],a.modules={3295:a=>{a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},8128:a=>{a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},28354:a=>{a.exports=require("util")},29294:a=>{a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},33873:a=>{a.exports=require("path")},38522:a=>{a.exports=require("node:zlib")},41025:a=>{a.exports=require("next/dist/server/app-render/dynamic-access-async-storage.external.js")},42134:(a,b,c)=>{c.r(b),c.d(b,{default:()=>e});var d=c(5735);function e(){return(0,d.jsx)("div",{className:"flex flex-1 items-center justify-center text-muted-foreground",children:"Select a table"})}},46060:a=>{a.exports=require("next/dist/shared/lib/no-fallback-error.external.js")},63033:a=>{a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},92087:(a,b,c)=>{c.r(b),c.d(b,{__next_app__:()=>r,handler:()=>t,routeModule:()=>s});var d=c(21635),e=c(86315),f=c(1020),g=c(61287),h={};for(let a in g)0>["default","__next_app__","routeModule","handler"].indexOf(a)&&(h[a]=()=>g[a]);c.d(b,h);let i=(0,d.p)(()=>Promise.resolve().then(c.bind(c,35780))),j=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),k=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,55091,23))),l=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,45270,23))),m=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,28193,23))),n=(0,d.p)(()=>Promise.resolve().then(c.bind(c,1777))),o=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),p={children:["",{children:["[connectionId]",{children:["__PAGE__",{},{page:[(0,d.p)(()=>Promise.resolve().then(c.bind(c,42134))),"/Users/theobourgeois/code/db-studio/src/app/[connectionId]/page.tsx"]}]},{layout:[n,"/Users/theobourgeois/code/db-studio/src/app/[connectionId]/layout.tsx"],"global-error":[o,"next/dist/client/components/builtin/global-error.js"],metadata:{icon:[async a=>(await (0,d.p)(()=>Promise.resolve().then(c.bind(c,70440)))()).default(a),async a=>(await (0,d.p)(()=>Promise.resolve().then(c.bind(c,59645)))()).default(a)],apple:[],openGraph:[],twitter:[],manifest:void 0}},["_not-found","_global-error","api","favicon.ico","icon.svg"]]},{layout:[i,"/Users/theobourgeois/code/db-studio/src/app/layout.tsx"],"global-error":[j,"next/dist/client/components/builtin/global-error.js"],"not-found":[k,"next/dist/client/components/builtin/not-found.js"],forbidden:[l,"next/dist/client/components/builtin/forbidden.js"],unauthorized:[m,"next/dist/client/components/builtin/unauthorized.js"],metadata:{icon:[async a=>(await (0,d.p)(()=>Promise.resolve().then(c.bind(c,70440)))()).default(a),async a=>(await (0,d.p)(()=>Promise.resolve().then(c.bind(c,59645)))()).default(a)],apple:[],openGraph:[],twitter:[],manifest:void 0}},[]]}.children,q=(0,e.H)({tree:p,page:"/[connectionId]/page",pathname:"/[connectionId]",require:c,loadChunk:()=>Promise.resolve(),interopDefault:f.T}),r=q.__next_app__,s=q.routeModule,t=q.handler}};var b=require("../../webpack-runtime.js");b.C(a);var c=b.X(0,[741,430,458,792,400,391,593,729],()=>b(b.s=92087));module.exports=c})();
@@ -1 +1 @@
1
- globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/[connectionId]/page"]={"moduleLoading":{"prefix":"/_next/"},"ssrModuleMapping":{"3725":{"*":{"id":"75267","name":"*","chunks":[],"async":false}},"6937":{"*":{"id":"59809","name":"*","chunks":[],"async":false}},"20400":{"*":{"id":"22053","name":"*","chunks":[],"async":false}},"27123":{"*":{"id":"81921","name":"*","chunks":[],"async":false}},"32971":{"*":{"id":"16331","name":"*","chunks":[],"async":false}},"35788":{"*":{"id":"53534","name":"*","chunks":[],"async":false}},"39049":{"*":{"id":"91723","name":"*","chunks":[],"async":false}},"57121":{"*":{"id":"35421","name":"*","chunks":[],"async":false}},"61304":{"*":{"id":"60440","name":"*","chunks":[],"async":false}},"64777":{"*":{"id":"82265","name":"*","chunks":[],"async":false}},"72737":{"*":{"id":"4833","name":"*","chunks":[],"async":false}},"74581":{"*":{"id":"61335","name":"*","chunks":[],"async":false}},"78616":{"*":{"id":"84342","name":"*","chunks":[],"async":false}},"86869":{"*":{"id":"74661","name":"*","chunks":[],"async":false}},"87758":{"*":{"id":"19047","name":"*","chunks":[],"async":false}},"90484":{"*":{"id":"70664","name":"*","chunks":[],"async":false}},"94821":{"*":{"id":"80189","name":"*","chunks":[],"async":false}}},"edgeSSRModuleMapping":{},"clientModules":{"/Users/theobourgeois/code/db-studio/node_modules/next/dist/client/components/builtin/global-error.js":{"id":27123,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/dist/esm/client/components/builtin/global-error.js":{"id":27123,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/dist/client/components/client-page.js":{"id":61304,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/dist/esm/client/components/client-page.js":{"id":61304,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/dist/client/components/client-segment.js":{"id":78616,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/dist/esm/client/components/client-segment.js":{"id":78616,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/dist/client/components/http-access-fallback/error-boundary.js":{"id":64777,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/dist/esm/client/components/http-access-fallback/error-boundary.js":{"id":64777,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/dist/client/components/layout-router.js":{"id":57121,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/dist/esm/client/components/layout-router.js":{"id":57121,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/dist/client/components/render-from-template-context.js":{"id":74581,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":74581,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/dist/lib/framework/boundary-components.js":{"id":90484,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/dist/esm/lib/framework/boundary-components.js":{"id":90484,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/dist/lib/metadata/generate/icon-mark.js":{"id":86869,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/dist/esm/lib/metadata/generate/icon-mark.js":{"id":86869,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/font/google/target.css?{\"path\":\"src/app/layout.tsx\",\"import\":\"Geist\",\"arguments\":[{\"variable\":\"--font-sans\",\"subsets\":[\"latin\"]}],\"variableName\":\"sans\"}":{"id":34244,"name":"*","chunks":["39","static/chunks/39-3411368bf75bda4b.js","177","static/chunks/app/layout-6c0fa591484fc6df.js"],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/font/google/target.css?{\"path\":\"src/app/layout.tsx\",\"import\":\"Geist_Mono\",\"arguments\":[{\"variable\":\"--font-geist-mono\",\"subsets\":[\"latin\"]}],\"variableName\":\"mono\"}":{"id":64939,"name":"*","chunks":["39","static/chunks/39-3411368bf75bda4b.js","177","static/chunks/app/layout-6c0fa591484fc6df.js"],"async":false},"/Users/theobourgeois/code/db-studio/src/app/globals.css":{"id":51743,"name":"*","chunks":["39","static/chunks/39-3411368bf75bda4b.js","177","static/chunks/app/layout-6c0fa591484fc6df.js"],"async":false},"/Users/theobourgeois/code/db-studio/src/components/ConvexClientProvider.tsx":{"id":94821,"name":"*","chunks":["39","static/chunks/39-3411368bf75bda4b.js","177","static/chunks/app/layout-6c0fa591484fc6df.js"],"async":false},"/Users/theobourgeois/code/db-studio/src/components/local-bridge-gate.tsx":{"id":87758,"name":"*","chunks":["39","static/chunks/39-3411368bf75bda4b.js","177","static/chunks/app/layout-6c0fa591484fc6df.js"],"async":false},"/Users/theobourgeois/code/db-studio/src/components/theme-provider.tsx":{"id":72737,"name":"*","chunks":["39","static/chunks/39-3411368bf75bda4b.js","177","static/chunks/app/layout-6c0fa591484fc6df.js"],"async":false},"/Users/theobourgeois/code/db-studio/src/app/page.tsx":{"id":20400,"name":"*","chunks":["603","static/chunks/603-4d453706a69687ab.js","842","static/chunks/842-7d4f33472de28bfd.js","500","static/chunks/500-2d1136a2b6ea2d76.js","469","static/chunks/469-5223a74e4a332e16.js","938","static/chunks/938-3d7a8b7b2f336e91.js","974","static/chunks/app/page-b2d6b39a184ee5c7.js"],"async":false},"/Users/theobourgeois/code/db-studio/src/components/explorer/explorer-shell.tsx":{"id":6937,"name":"*","chunks":["603","static/chunks/603-4d453706a69687ab.js","842","static/chunks/842-7d4f33472de28bfd.js","500","static/chunks/500-2d1136a2b6ea2d76.js","9","static/chunks/9-34415c4a38da9de1.js","469","static/chunks/469-5223a74e4a332e16.js","938","static/chunks/938-3d7a8b7b2f336e91.js","123","static/chunks/app/%5BconnectionId%5D/layout-5ceae464cef50cb0.js"],"async":false},"/Users/theobourgeois/code/db-studio/src/components/table/table-view.tsx":{"id":32971,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/src/components/diff/schema-diff-view.tsx":{"id":35788,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/src/components/migrations/migrations-view.tsx":{"id":3725,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/src/components/query/query-view.tsx":{"id":39049,"name":"*","chunks":[],"async":false}},"entryCSSFiles":{"/Users/theobourgeois/code/db-studio/src/":[],"/Users/theobourgeois/code/db-studio/src/app/layout":[{"inlined":false,"path":"static/css/e02ab5db9ff2dca2.css"},{"inlined":false,"path":"static/css/c36a068647b766f7.css"}],"/Users/theobourgeois/code/db-studio/src/app/page":[],"/Users/theobourgeois/code/db-studio/src/app/[connectionId]/layout":[],"/Users/theobourgeois/code/db-studio/src/app/[connectionId]/page":[]},"rscModuleMapping":{"3725":{"*":{"id":"18261","name":"*","chunks":[],"async":false}},"6937":{"*":{"id":"34766","name":"*","chunks":[],"async":false}},"20400":{"*":{"id":"4494","name":"*","chunks":[],"async":false}},"27123":{"*":{"id":"95547","name":"*","chunks":[],"async":false}},"32971":{"*":{"id":"12377","name":"*","chunks":[],"async":false}},"35788":{"*":{"id":"58977","name":"*","chunks":[],"async":false}},"39049":{"*":{"id":"2781","name":"*","chunks":[],"async":false}},"51743":{"*":{"id":"61135","name":"*","chunks":[],"async":false}},"57121":{"*":{"id":"98099","name":"*","chunks":[],"async":false}},"61304":{"*":{"id":"15098","name":"*","chunks":[],"async":false}},"64777":{"*":{"id":"33859","name":"*","chunks":[],"async":false}},"72737":{"*":{"id":"65223","name":"*","chunks":[],"async":false}},"74581":{"*":{"id":"16237","name":"*","chunks":[],"async":false}},"78616":{"*":{"id":"47644","name":"*","chunks":[],"async":false}},"86869":{"*":{"id":"36675","name":"*","chunks":[],"async":false}},"87758":{"*":{"id":"17569","name":"*","chunks":[],"async":false}},"90484":{"*":{"id":"98562","name":"*","chunks":[],"async":false}},"94821":{"*":{"id":"88331","name":"*","chunks":[],"async":false}}},"edgeRscModuleMapping":{}};
1
+ globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/[connectionId]/page"]={"moduleLoading":{"prefix":"/_next/"},"ssrModuleMapping":{"6937":{"*":{"id":"59809","name":"*","chunks":[],"async":false}},"16364":{"*":{"id":"47078","name":"*","chunks":[],"async":false}},"20400":{"*":{"id":"22053","name":"*","chunks":[],"async":false}},"27123":{"*":{"id":"81921","name":"*","chunks":[],"async":false}},"32971":{"*":{"id":"88865","name":"*","chunks":[],"async":false}},"35788":{"*":{"id":"53534","name":"*","chunks":[],"async":false}},"39049":{"*":{"id":"91723","name":"*","chunks":[],"async":false}},"50492":{"*":{"id":"74678","name":"*","chunks":[],"async":false}},"57121":{"*":{"id":"35421","name":"*","chunks":[],"async":false}},"61304":{"*":{"id":"60440","name":"*","chunks":[],"async":false}},"64777":{"*":{"id":"82265","name":"*","chunks":[],"async":false}},"72737":{"*":{"id":"4833","name":"*","chunks":[],"async":false}},"74581":{"*":{"id":"61335","name":"*","chunks":[],"async":false}},"78616":{"*":{"id":"84342","name":"*","chunks":[],"async":false}},"86869":{"*":{"id":"74661","name":"*","chunks":[],"async":false}},"87758":{"*":{"id":"19047","name":"*","chunks":[],"async":false}},"90484":{"*":{"id":"70664","name":"*","chunks":[],"async":false}},"94821":{"*":{"id":"80189","name":"*","chunks":[],"async":false}}},"edgeSSRModuleMapping":{},"clientModules":{"/Users/theobourgeois/code/db-studio/node_modules/next/dist/client/components/builtin/global-error.js":{"id":27123,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/dist/esm/client/components/builtin/global-error.js":{"id":27123,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/dist/client/components/client-page.js":{"id":61304,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/dist/esm/client/components/client-page.js":{"id":61304,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/dist/client/components/client-segment.js":{"id":78616,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/dist/esm/client/components/client-segment.js":{"id":78616,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/dist/client/components/http-access-fallback/error-boundary.js":{"id":64777,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/dist/esm/client/components/http-access-fallback/error-boundary.js":{"id":64777,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/dist/client/components/layout-router.js":{"id":57121,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/dist/esm/client/components/layout-router.js":{"id":57121,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/dist/client/components/render-from-template-context.js":{"id":74581,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":74581,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/dist/lib/framework/boundary-components.js":{"id":90484,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/dist/esm/lib/framework/boundary-components.js":{"id":90484,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/dist/lib/metadata/generate/icon-mark.js":{"id":86869,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/dist/esm/lib/metadata/generate/icon-mark.js":{"id":86869,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/font/google/target.css?{\"path\":\"src/app/layout.tsx\",\"import\":\"Geist\",\"arguments\":[{\"variable\":\"--font-sans\",\"subsets\":[\"latin\"]}],\"variableName\":\"sans\"}":{"id":34244,"name":"*","chunks":["6039","static/chunks/6039-02dbcff4d4ccf559.js","7177","static/chunks/app/layout-dd332a9583f47cd6.js"],"async":false},"/Users/theobourgeois/code/db-studio/node_modules/next/font/google/target.css?{\"path\":\"src/app/layout.tsx\",\"import\":\"Geist_Mono\",\"arguments\":[{\"variable\":\"--font-geist-mono\",\"subsets\":[\"latin\"]}],\"variableName\":\"mono\"}":{"id":64939,"name":"*","chunks":["6039","static/chunks/6039-02dbcff4d4ccf559.js","7177","static/chunks/app/layout-dd332a9583f47cd6.js"],"async":false},"/Users/theobourgeois/code/db-studio/src/app/globals.css":{"id":51743,"name":"*","chunks":["6039","static/chunks/6039-02dbcff4d4ccf559.js","7177","static/chunks/app/layout-dd332a9583f47cd6.js"],"async":false},"/Users/theobourgeois/code/db-studio/src/components/ConvexClientProvider.tsx":{"id":94821,"name":"*","chunks":["6039","static/chunks/6039-02dbcff4d4ccf559.js","7177","static/chunks/app/layout-dd332a9583f47cd6.js"],"async":false},"/Users/theobourgeois/code/db-studio/src/components/local-bridge-gate.tsx":{"id":87758,"name":"*","chunks":["6039","static/chunks/6039-02dbcff4d4ccf559.js","7177","static/chunks/app/layout-dd332a9583f47cd6.js"],"async":false},"/Users/theobourgeois/code/db-studio/src/components/theme-provider.tsx":{"id":72737,"name":"*","chunks":["6039","static/chunks/6039-02dbcff4d4ccf559.js","7177","static/chunks/app/layout-dd332a9583f47cd6.js"],"async":false},"/Users/theobourgeois/code/db-studio/src/app/page.tsx":{"id":20400,"name":"*","chunks":["8651","static/chunks/8651-f7ba864bc5a5b128.js","8360","static/chunks/8360-5a3ba00eb4ee0720.js","8500","static/chunks/8500-01a63dafd809e317.js","6842","static/chunks/6842-c2831fd548ae657c.js","1528","static/chunks/1528-3257b0cb7a73dd8b.js","6091","static/chunks/6091-de8d2e51b0196435.js","8974","static/chunks/app/page-b582d36c1b014a02.js"],"async":false},"/Users/theobourgeois/code/db-studio/src/components/explorer/explorer-shell.tsx":{"id":6937,"name":"*","chunks":["8651","static/chunks/8651-f7ba864bc5a5b128.js","8360","static/chunks/8360-5a3ba00eb4ee0720.js","8500","static/chunks/8500-01a63dafd809e317.js","6842","static/chunks/6842-c2831fd548ae657c.js","8322","static/chunks/8322-b1154a96547c860d.js","1528","static/chunks/1528-3257b0cb7a73dd8b.js","6091","static/chunks/6091-de8d2e51b0196435.js","7123","static/chunks/app/%5BconnectionId%5D/layout-18239a50b43285f6.js"],"async":false},"/Users/theobourgeois/code/db-studio/src/components/table/table-view.tsx":{"id":32971,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/src/components/diff/schema-diff-view.tsx":{"id":35788,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/src/components/migrations/migration-detail.tsx":{"id":50492,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/src/components/migrations/migrations-index.tsx":{"id":16364,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/src/components/query/query-view.tsx":{"id":39049,"name":"*","chunks":[],"async":false}},"entryCSSFiles":{"/Users/theobourgeois/code/db-studio/src/":[],"/Users/theobourgeois/code/db-studio/src/app/layout":[{"inlined":false,"path":"static/css/e02ab5db9ff2dca2.css"},{"inlined":false,"path":"static/css/993f480f9e0f3e74.css"}],"/Users/theobourgeois/code/db-studio/src/app/page":[],"/Users/theobourgeois/code/db-studio/src/app/[connectionId]/layout":[],"/Users/theobourgeois/code/db-studio/src/app/[connectionId]/page":[]},"rscModuleMapping":{"6937":{"*":{"id":"34766","name":"*","chunks":[],"async":false}},"16364":{"*":{"id":"99432","name":"*","chunks":[],"async":false}},"20400":{"*":{"id":"4494","name":"*","chunks":[],"async":false}},"27123":{"*":{"id":"95547","name":"*","chunks":[],"async":false}},"32971":{"*":{"id":"12377","name":"*","chunks":[],"async":false}},"35788":{"*":{"id":"58977","name":"*","chunks":[],"async":false}},"39049":{"*":{"id":"2781","name":"*","chunks":[],"async":false}},"50492":{"*":{"id":"97182","name":"*","chunks":[],"async":false}},"51743":{"*":{"id":"61135","name":"*","chunks":[],"async":false}},"57121":{"*":{"id":"98099","name":"*","chunks":[],"async":false}},"61304":{"*":{"id":"15098","name":"*","chunks":[],"async":false}},"64777":{"*":{"id":"33859","name":"*","chunks":[],"async":false}},"72737":{"*":{"id":"65223","name":"*","chunks":[],"async":false}},"74581":{"*":{"id":"16237","name":"*","chunks":[],"async":false}},"78616":{"*":{"id":"47644","name":"*","chunks":[],"async":false}},"86869":{"*":{"id":"36675","name":"*","chunks":[],"async":false}},"87758":{"*":{"id":"17569","name":"*","chunks":[],"async":false}},"90484":{"*":{"id":"98562","name":"*","chunks":[],"async":false}},"94821":{"*":{"id":"88331","name":"*","chunks":[],"async":false}}},"edgeRscModuleMapping":{}};