@theobourgeois/ytdb 0.2.12 → 0.2.13

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 (195) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +4 -2
  3. package/.next/build-manifest.json +2 -2
  4. package/.next/prerender-manifest.json +2 -2
  5. package/.next/routes-manifest.json +12 -0
  6. package/.next/server/app/[connectionId]/[schema]/[table]/page.js +1 -1
  7. package/.next/server/app/[connectionId]/[schema]/[table]/page.js.nft.json +1 -1
  8. package/.next/server/app/[connectionId]/[schema]/[table]/page_client-reference-manifest.js +1 -1
  9. package/.next/server/app/[connectionId]/diff/page.js +5 -5
  10. package/.next/server/app/[connectionId]/diff/page.js.nft.json +1 -1
  11. package/.next/server/app/[connectionId]/diff/page_client-reference-manifest.js +1 -1
  12. package/.next/server/app/[connectionId]/migrations/[setId]/page.js +1 -1
  13. package/.next/server/app/[connectionId]/migrations/[setId]/page.js.nft.json +1 -1
  14. package/.next/server/app/[connectionId]/migrations/[setId]/page_client-reference-manifest.js +1 -1
  15. package/.next/server/app/[connectionId]/migrations/page.js +1 -1
  16. package/.next/server/app/[connectionId]/migrations/page.js.nft.json +1 -1
  17. package/.next/server/app/[connectionId]/migrations/page_client-reference-manifest.js +1 -1
  18. package/.next/server/app/[connectionId]/page.js +1 -1
  19. package/.next/server/app/[connectionId]/page.js.nft.json +1 -1
  20. package/.next/server/app/[connectionId]/page_client-reference-manifest.js +1 -1
  21. package/.next/server/app/[connectionId]/query/page.js +1 -1
  22. package/.next/server/app/[connectionId]/query/page.js.nft.json +1 -1
  23. package/.next/server/app/[connectionId]/query/page_client-reference-manifest.js +1 -1
  24. package/.next/server/app/_global-error/page.js +2 -2
  25. package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  26. package/.next/server/app/_global-error.html +1 -1
  27. package/.next/server/app/_global-error.rsc +1 -1
  28. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  29. package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  30. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  31. package/.next/server/app/_not-found/page.js +1 -1
  32. package/.next/server/app/_not-found/page.js.nft.json +1 -1
  33. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  34. package/.next/server/app/_not-found.html +1 -1
  35. package/.next/server/app/_not-found.rsc +19 -18
  36. package/.next/server/app/_not-found.segments/_full.segment.rsc +19 -18
  37. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +9 -8
  38. package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  39. package/.next/server/app/api/activity/route.js +2 -2
  40. package/.next/server/app/api/activity/route.js.nft.json +1 -1
  41. package/.next/server/app/api/adopt/route.js +40 -0
  42. package/.next/server/app/api/adopt/route.js.nft.json +1 -0
  43. package/.next/server/app/api/adopt/route_client-reference-manifest.js +1 -0
  44. package/.next/server/app/api/cell/route.js +2 -2
  45. package/.next/server/app/api/cell/route.js.nft.json +1 -1
  46. package/.next/server/app/api/definition/route.js +3 -3
  47. package/.next/server/app/api/definition/route.js.nft.json +1 -1
  48. package/.next/server/app/api/delete-rows/route.js +2 -2
  49. package/.next/server/app/api/delete-rows/route.js.nft.json +1 -1
  50. package/.next/server/app/api/health/route.js +1 -1
  51. package/.next/server/app/api/insert-row/route.js +2 -2
  52. package/.next/server/app/api/insert-row/route.js.nft.json +1 -1
  53. package/.next/server/app/api/ledger/route.js +40 -1
  54. package/.next/server/app/api/ledger/route.js.nft.json +1 -1
  55. package/.next/server/app/api/lookup/route.js +2 -2
  56. package/.next/server/app/api/lookup/route.js.nft.json +1 -1
  57. package/.next/server/app/api/migrate/route.js +40 -1
  58. package/.next/server/app/api/migrate/route.js.nft.json +1 -1
  59. package/.next/server/app/api/query/route.js +2 -2
  60. package/.next/server/app/api/query/route.js.nft.json +1 -1
  61. package/.next/server/app/api/related/route.js +2 -2
  62. package/.next/server/app/api/related/route.js.nft.json +1 -1
  63. package/.next/server/app/api/repo/route.js +1 -0
  64. package/.next/server/app/api/repo/route.js.nft.json +1 -0
  65. package/.next/server/app/api/repo/route_client-reference-manifest.js +1 -0
  66. package/.next/server/app/api/rows/route.js +1 -1
  67. package/.next/server/app/api/rows/route.js.nft.json +1 -1
  68. package/.next/server/app/api/schema/route.js +2 -2
  69. package/.next/server/app/api/schema/route.js.nft.json +1 -1
  70. package/.next/server/app/api/tables/route.js +2 -2
  71. package/.next/server/app/api/tables/route.js.nft.json +1 -1
  72. package/.next/server/app/api/update-row/route.js +1 -1
  73. package/.next/server/app/api/update-row/route.js.nft.json +1 -1
  74. package/.next/server/app/favicon.ico/route.js +1 -1
  75. package/.next/server/app/icon.svg/route.js +1 -1
  76. package/.next/server/app/index.html +1 -1
  77. package/.next/server/app/index.rsc +21 -20
  78. package/.next/server/app/index.segments/__PAGE__.segment.rsc +12 -11
  79. package/.next/server/app/index.segments/_full.segment.rsc +21 -20
  80. package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  81. package/.next/server/app/page.js +2 -2
  82. package/.next/server/app/page.js.nft.json +1 -1
  83. package/.next/server/app/page_client-reference-manifest.js +1 -1
  84. package/.next/server/app-paths-manifest.json +4 -2
  85. package/.next/server/chunks/172.js +1 -0
  86. package/.next/server/chunks/202.js +1 -0
  87. package/.next/server/chunks/421.js +1 -0
  88. package/.next/server/chunks/566.js +1 -0
  89. package/.next/server/chunks/593.js +1 -1
  90. package/.next/server/chunks/729.js +1 -1
  91. package/.next/server/chunks/738.js +2 -0
  92. package/.next/server/chunks/802.js +1 -0
  93. package/.next/server/chunks/{458.js → 928.js} +1 -1
  94. package/.next/server/chunks/97.js +1 -1
  95. package/.next/server/middleware-build-manifest.js +1 -1
  96. package/.next/server/pages/404.html +1 -1
  97. package/.next/server/pages/500.html +1 -1
  98. package/.next/static/KSnyCCtuopUbqXHmuoiqW/_buildManifest.js +1 -0
  99. package/.next/static/chunks/1656-2ef431c507f0f186.js +1 -0
  100. package/.next/static/chunks/1715-206f291fde410bf6.js +1 -0
  101. package/.next/static/chunks/1731-6dec4b981289174f.js +1 -0
  102. package/.next/static/chunks/{6039-02dbcff4d4ccf559.js → 223-a4fca67d979d899d.js} +2 -2
  103. package/.next/static/chunks/3678-daffdce12ffe73e6.js +1 -0
  104. package/.next/static/chunks/4029-abdeb362648dd921.js +1 -0
  105. package/.next/static/chunks/4097-e483bf4279ad2c38.js +1 -0
  106. package/.next/static/chunks/649-a1f6ba42883ab7ce.js +1 -0
  107. package/.next/static/chunks/6996-45e967f18861b87e.js +1 -0
  108. package/.next/static/chunks/7893-4515c42324443f01.js +1 -0
  109. package/.next/static/chunks/8322-ed3deecf058cc11c.js +1 -0
  110. package/.next/static/chunks/8361-d0f8ce41b74637bf.js +1 -0
  111. package/.next/static/chunks/900-3bd4de40e69579da.js +1 -0
  112. package/.next/static/chunks/app/[connectionId]/[schema]/[table]/page-b08fade19a53bd13.js +1 -0
  113. package/.next/static/chunks/app/[connectionId]/diff/page-794180465d38394e.js +10 -0
  114. package/.next/static/chunks/app/[connectionId]/layout-d990f4312947106b.js +1 -0
  115. package/.next/static/chunks/app/[connectionId]/migrations/[setId]/page-31589bfe4aa9fc68.js +1 -0
  116. package/.next/static/chunks/app/[connectionId]/migrations/page-e99de6630bfec654.js +1 -0
  117. package/.next/static/chunks/app/[connectionId]/page-a245bfbd8b3eb8a7.js +1 -0
  118. package/.next/static/chunks/app/[connectionId]/query/page-3955d207f27aefa9.js +1 -0
  119. package/.next/static/chunks/app/_global-error/page-474f91618aaa4c39.js +1 -0
  120. package/.next/static/chunks/app/api/activity/route-474f91618aaa4c39.js +1 -0
  121. package/.next/static/chunks/app/api/adopt/route-474f91618aaa4c39.js +1 -0
  122. package/.next/static/chunks/app/api/cell/route-474f91618aaa4c39.js +1 -0
  123. package/.next/static/chunks/app/api/definition/route-474f91618aaa4c39.js +1 -0
  124. package/.next/static/chunks/app/api/delete-rows/route-474f91618aaa4c39.js +1 -0
  125. package/.next/static/chunks/app/api/health/route-474f91618aaa4c39.js +1 -0
  126. package/.next/static/chunks/app/api/insert-row/route-474f91618aaa4c39.js +1 -0
  127. package/.next/static/chunks/app/api/ledger/route-474f91618aaa4c39.js +1 -0
  128. package/.next/static/chunks/app/api/lookup/route-474f91618aaa4c39.js +1 -0
  129. package/.next/static/chunks/app/api/migrate/route-474f91618aaa4c39.js +1 -0
  130. package/.next/static/chunks/app/api/query/route-474f91618aaa4c39.js +1 -0
  131. package/.next/static/chunks/app/api/related/route-474f91618aaa4c39.js +1 -0
  132. package/.next/static/chunks/app/api/repo/route-474f91618aaa4c39.js +1 -0
  133. package/.next/static/chunks/app/api/rows/route-474f91618aaa4c39.js +1 -0
  134. package/.next/static/chunks/app/api/schema/route-474f91618aaa4c39.js +1 -0
  135. package/.next/static/chunks/app/api/tables/route-474f91618aaa4c39.js +1 -0
  136. package/.next/static/chunks/app/api/update-row/route-474f91618aaa4c39.js +1 -0
  137. package/.next/static/chunks/app/layout-e3fdecae5544dc60.js +1 -0
  138. package/.next/static/chunks/app/page-c487da327ada2a6d.js +2 -0
  139. package/.next/static/chunks/f97e080b-53d22dc5d0e78dfd.js +1 -0
  140. package/.next/static/chunks/next/dist/client/components/builtin/app-error-474f91618aaa4c39.js +1 -0
  141. package/.next/static/chunks/next/dist/client/components/builtin/forbidden-474f91618aaa4c39.js +1 -0
  142. package/.next/static/chunks/next/dist/client/components/builtin/not-found-474f91618aaa4c39.js +1 -0
  143. package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-474f91618aaa4c39.js +1 -0
  144. package/.next/static/css/962dd5ab002fed8a.css +1 -0
  145. package/README.md +35 -6
  146. package/package.json +2 -2
  147. package/.next/server/chunks/25.js +0 -1
  148. package/.next/server/chunks/391.js +0 -1
  149. package/.next/server/chunks/400.js +0 -1
  150. package/.next/server/chunks/702.js +0 -1
  151. package/.next/server/chunks/792.js +0 -1
  152. package/.next/server/chunks/907.js +0 -29
  153. package/.next/static/Gx7RwhUq0gRMqScVFeGLq/_buildManifest.js +0 -1
  154. package/.next/static/chunks/1528-3257b0cb7a73dd8b.js +0 -1
  155. package/.next/static/chunks/3123-5b058e55010e138a.js +0 -1
  156. package/.next/static/chunks/4100-7151c91ac47f0e66.js +0 -1
  157. package/.next/static/chunks/5541-28b0ead901dee457.js +0 -1
  158. package/.next/static/chunks/6091-de8d2e51b0196435.js +0 -1
  159. package/.next/static/chunks/6842-c2831fd548ae657c.js +0 -1
  160. package/.next/static/chunks/7449-d0483bbc0f0fec63.js +0 -1
  161. package/.next/static/chunks/8322-b1154a96547c860d.js +0 -1
  162. package/.next/static/chunks/8360-5a3ba00eb4ee0720.js +0 -1
  163. package/.next/static/chunks/8651-f7ba864bc5a5b128.js +0 -1
  164. package/.next/static/chunks/9680-3eeb0b7b44c6cab3.js +0 -1
  165. package/.next/static/chunks/app/[connectionId]/[schema]/[table]/page-f2f42daf21a075f2.js +0 -1
  166. package/.next/static/chunks/app/[connectionId]/diff/page-f3262f6929e005e0.js +0 -10
  167. package/.next/static/chunks/app/[connectionId]/layout-237a770e53d2a6ef.js +0 -1
  168. package/.next/static/chunks/app/[connectionId]/migrations/[setId]/page-483afd7dc1a64119.js +0 -1
  169. package/.next/static/chunks/app/[connectionId]/migrations/page-2217de71c9ad52fa.js +0 -1
  170. package/.next/static/chunks/app/[connectionId]/page-6dcee1a99ffdd27c.js +0 -1
  171. package/.next/static/chunks/app/[connectionId]/query/page-a0a9cc495d3aa710.js +0 -1
  172. package/.next/static/chunks/app/_global-error/page-6dcee1a99ffdd27c.js +0 -1
  173. package/.next/static/chunks/app/api/activity/route-6dcee1a99ffdd27c.js +0 -1
  174. package/.next/static/chunks/app/api/cell/route-6dcee1a99ffdd27c.js +0 -1
  175. package/.next/static/chunks/app/api/definition/route-6dcee1a99ffdd27c.js +0 -1
  176. package/.next/static/chunks/app/api/delete-rows/route-6dcee1a99ffdd27c.js +0 -1
  177. package/.next/static/chunks/app/api/health/route-6dcee1a99ffdd27c.js +0 -1
  178. package/.next/static/chunks/app/api/insert-row/route-6dcee1a99ffdd27c.js +0 -1
  179. package/.next/static/chunks/app/api/ledger/route-6dcee1a99ffdd27c.js +0 -1
  180. package/.next/static/chunks/app/api/lookup/route-6dcee1a99ffdd27c.js +0 -1
  181. package/.next/static/chunks/app/api/migrate/route-6dcee1a99ffdd27c.js +0 -1
  182. package/.next/static/chunks/app/api/query/route-6dcee1a99ffdd27c.js +0 -1
  183. package/.next/static/chunks/app/api/related/route-6dcee1a99ffdd27c.js +0 -1
  184. package/.next/static/chunks/app/api/rows/route-6dcee1a99ffdd27c.js +0 -1
  185. package/.next/static/chunks/app/api/schema/route-6dcee1a99ffdd27c.js +0 -1
  186. package/.next/static/chunks/app/api/tables/route-6dcee1a99ffdd27c.js +0 -1
  187. package/.next/static/chunks/app/api/update-row/route-6dcee1a99ffdd27c.js +0 -1
  188. package/.next/static/chunks/app/layout-dd332a9583f47cd6.js +0 -1
  189. package/.next/static/chunks/app/page-b582d36c1b014a02.js +0 -2
  190. package/.next/static/chunks/next/dist/client/components/builtin/app-error-6dcee1a99ffdd27c.js +0 -1
  191. package/.next/static/chunks/next/dist/client/components/builtin/forbidden-6dcee1a99ffdd27c.js +0 -1
  192. package/.next/static/chunks/next/dist/client/components/builtin/not-found-6dcee1a99ffdd27c.js +0 -1
  193. package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-6dcee1a99ffdd27c.js +0 -1
  194. package/.next/static/css/7bb8868c12384025.css +0 -1
  195. /package/.next/static/{Gx7RwhUq0gRMqScVFeGLq → KSnyCCtuopUbqXHmuoiqW}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (()=>{var a={};a.id=838,a.ids=[838],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")},10410:(a,b,c)=>{Promise.resolve().then(c.bind(c,74678))},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))})})]})}},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"}]])},26926:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>f});var d=c(5735),e=c(97182);async function f({params:a}){let{setId:b}=await a;return(0,d.jsx)(e.MigrationDetail,{setId:decodeURIComponent(b)})}},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")},34644:(a,b,c)=>{"use strict";c.d(b,{A:()=>d});let d=(0,c(41926).A)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},38522:a=>{"use strict";a.exports=require("node:zlib")},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")},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"}]])},58277:(a,b,c)=>{"use strict";c.r(b),c.d(b,{__next_app__:()=>t,handler:()=>v,routeModule:()=>u});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=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),r={children:["",{children:["[connectionId]",{children:["migrations",{children:["[setId]",{children:["__PAGE__",{},{page:[(0,d.p)(()=>Promise.resolve().then(c.bind(c,26926))),"/Users/theobourgeois/code/db-studio/src/app/[connectionId]/migrations/[setId]/page.tsx"]}]},{"global-error":[q,"next/dist/client/components/builtin/global-error.js"]},[]]},{"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,s=(0,e.H)({tree:r,page:"/[connectionId]/migrations/[setId]/page",pathname:"/[connectionId]/migrations/[setId]",require:c,loadChunk:()=>Promise.resolve(),interopDefault:f.T}),t=s.__next_app__,u=s.routeModule,v=s.handler},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")},74678:(a,b,c)=>{"use strict";c.d(b,{MigrationDetail:()=>ak});var d=c(48249),e=c(2116),f=c.n(e),g=c(19099),h=c(67484),i=c(27993),j=c(41577),k=c(60136),l=c(45414),m=c(14807),n=c(82078),o=c(41926);let p=(0,o.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 q=c(54171),r=c(34644),s=c(1206);let t=(0,o.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 u=c(44231),v=c(25297),w=c(82244),x=c(53286),y=c(20886),z=c(21883),A=c(78931),B=c(72428),C=c(99598),D=c(453),E=c(66280),F=c(12229),G=c(14490),H=c(24277),I=c(30770),J=c(35471),K=c(32823),L=c(91995),M=c(29774);let N=(0,o.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 O=c(93217),P=c(20878),Q=c(13367),R=c(37654),S=c(67657);let T="w-24",U="w-[104px]",V={applied:"applied",drifted:"applied, but the file changed since",pending:"not applied",unknown:"not read yet"};function W({status:a}){return"applied"===a?(0,d.jsx)(J.A,{className:"size-4 text-emerald-600 dark:text-emerald-400"}):"drifted"===a?(0,d.jsx)(t,{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)(K.A,{className:"size-3.5 text-muted-foreground/40"})}function X({step:a,environments:b,targetId:c,status:e,isNewestApplied:f,expanded:g,busy:i,onToggle:j,actions:n}){let[o,p]=(0,h.useState)("apply"),[q,r]=(0,h.useState)(!1),s="revert"===o?a.revertSql??"":a.applySql,u=(0,S.qb)(a.transaction),x=(0,S.TA)(a.transaction),y=[];async function z(){await (0,Q.mw)(s),r(!0),window.setTimeout(()=>r(!1),1500)}return"drifted"===e&&y.push("This file changed after it was applied here, so it is no longer the migration that ran."),x&&y.push(x),(0,d.jsxs)("div",{className:"border-b last:border-b-0",children:[(0,d.jsxs)("div",{className:(0,G.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)(L.A,{className:(0,G.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}),u&&(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:u})]}),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 ${V[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,G.cn)("flex h-10 shrink-0 items-center justify-center",T,e&&"bg-foreground/[0.04]"),children:(0,d.jsx)(W,{status:b.status})},b.connection.id)}),(0,d.jsxs)("div",{className:(0,G.cn)("flex shrink-0 items-center justify-end gap-1 pr-2 pl-1",U),children:["pending"===e&&(0,d.jsx)(v.$,{size:"xs",variant:"outline",disabled:i,onClick:n.onApplyThrough,children:"Apply"}),f&&a.revertSql&&(0,d.jsxs)(v.$,{size:"xs",variant:"ghost",disabled:i,onClick:n.onRevertThrough,children:[(0,d.jsx)(m.A,{"data-icon":"inline-start"}),"Revert"]}),(0,d.jsxs)(w.rI,{children:[(0,d.jsx)(w.ty,{render:(0,d.jsx)(v.$,{size:"icon-xs",variant:"ghost","aria-label":`Actions for ${a.version}`}),className:"cursor-pointer",children:(0,d.jsx)(k.A,{})}),(0,d.jsxs)(w.SQ,{align:"end",className:"min-w-56",children:[(0,d.jsx)(w._2,{disabled:i||"applied"===e,onClick:n.onApplyThrough,children:"Apply everything through here"}),(0,d.jsx)(w._2,{disabled:i||"applied"===e,onClick:n.onApplyOne,children:"Apply only this one"}),(0,d.jsx)(w._2,{disabled:i||"pending"===e||!a.revertSql,onClick:n.onRevertThrough,children:"Revert back through here"}),(0,d.jsx)(w.mB,{}),(0,d.jsxs)(w._2,{disabled:i||"applied"===e,onClick:n.onMarkApplied,children:[(0,d.jsx)(l.A,{}),"Mark as already applied"]}),(0,d.jsxs)(w._2,{disabled:i||"pending"===e,onClick:n.onMarkPending,children:[(0,d.jsx)(M.A,{}),"Mark as not applied"]}),(0,d.jsx)(w.mB,{}),(0,d.jsxs)(w._2,{onClick:n.onAttachRevert,children:[(0,d.jsx)(N,{}),a.revertSql?"Replace revert file…":"Add a revert file…"]}),(0,d.jsxs)(w._2,{onClick:()=>n.onOpenInEditor(s),children:[(0,d.jsx)(O.A,{}),"Open ",o," SQL in editor"]}),(0,d.jsxs)(w._2,{onClick:()=>void z(),children:[(0,d.jsx)(P.A,{}),"Copy ",o," SQL"]}),(0,d.jsx)(w.mB,{}),(0,d.jsx)(w._2,{variant:"destructive",onClick:n.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)(R.x,{label:`SQL for ${a.version}`,value:o,onChange:p,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"===o?a.revertPath??"no revert file":a.applyPath}),(0,d.jsxs)(v.$,{size:"xs",variant:"ghost",className:"ml-auto",onClick:()=>void z(),children:[q?(0,d.jsx)(J.A,{"data-icon":"inline-start"}):(0,d.jsx)(P.A,{"data-icon":"inline-start"}),q?"Copied":"Copy"]})]}),y.length>0&&(0,d.jsx)("ul",{className:"space-y-1 px-3 pb-2",children:y.map(a=>(0,d.jsxs)("li",{className:"flex gap-1.5 text-[11px] text-amber-700 dark:text-amber-400",children:[(0,d.jsx)(t,{className:"mt-px size-3 shrink-0"}),(0,d.jsx)("span",{children:a})]},a))}),s?(0,d.jsx)(Q.os,{sql:s,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)(v.$,{size:"xs",variant:"outline",onClick:n.onAttachRevert,children:[(0,d.jsx)(N,{"data-icon":"inline-start"}),"Add one"]})]})]})]})}function Y({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)(w.rI,{children:[(0,d.jsxs)(w.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)(I.F,{connection:e.connection}),(0,d.jsx)("span",{className:"max-w-32 truncate",children:e.connection.name})]}),(0,d.jsx)(w.SQ,{align:"start",className:"min-w-52",children:a.map(a=>(0,d.jsxs)(w._2,{onClick:()=>c(a.connection.id),className:a.connection.id===b?"font-medium":void 0,children:[(0,d.jsx)(I.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 Z({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,G.cn)("flex h-11 shrink-0 flex-col items-center justify-center gap-0.5 border-l text-[11px] outline-none",T,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)(I.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,G.cn)("flex shrink-0 items-center justify-end border-l pr-2 pl-1",U),children:a.length>1&&(0,d.jsx)(v.$,{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)(H.A,{})})})]})}var $=c(38393),_=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=(0,B.hD)(i),k=b.filter(a=>a.schema!==i);function l(){j&&(e(i),c(!1))}return(0,d.jsx)($.lG,{open:!0,onOpenChange:c,children:(0,d.jsxs)($.Cf,{className:"sm:max-w-md",children:[(0,d.jsxs)($.c7,{children:[(0,d.jsx)($.L3,{children:"Where the ledger lives"}),(0,d.jsx)($.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)(_.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}.${B.R9}`:"\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)($.Es,{children:[i!==B.aC&&(0,d.jsx)(v.$,{variant:"ghost",onClick:()=>g(B.aC),children:"Reset"}),(0,d.jsx)(v.$,{variant:"outline",onClick:()=>c(!1),children:"Cancel"}),(0,d.jsx)(v.$,{disabled:!j,onClick:l,children:"Save"})]})]})})}var ac=c(77963),ad=c(76829),ae=c(32278),af=c(69357),ag=c(45535);let ah=(0,o.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 ai({status:a}){switch(a){case"running":return(0,d.jsx)(af.A,{className:"size-3.5 shrink-0 animate-spin text-primary"});case"ok":return(0,d.jsx)(J.A,{className:"size-3.5 shrink-0 text-emerald-600 dark:text-emerald-400"});case"failed":return(0,d.jsx)(ag.A,{className:"size-3.5 shrink-0 text-destructive"});case"skipped":return(0,d.jsx)(K.A,{className:"size-3.5 shrink-0 text-muted-foreground/60"});default:return(0,d.jsx)(ah,{className:"size-3.5 shrink-0 text-muted-foreground/60"})}}function aj({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,u=g??e.map(a=>({version:a.version,name:a.name,status:"waiting"}));return(0,d.jsx)($.lG,{open:a,onOpenChange:a=>!a&&!h&&l(),children:(0,d.jsxs)($.Cf,{className:"sm:max-w-lg",children:[(0,d.jsxs)($.c7,{children:[(0,d.jsx)($.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)($.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)(I.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)})]})})]}),u.length>0&&(0,d.jsx)("div",{className:"max-h-64 overflow-y-auto rounded-md border",children:u.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)(ai,{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)(t,{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)(t,{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)($.Es,{children:h?(0,d.jsx)(v.$,{variant:"outline",onClick:k,children:"Stop after this one"}):r?(0,d.jsx)(v.$,{onClick:l,children:"Close"}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(v.$,{variant:"outline",onClick:l,children:0===o?"Close":"Cancel"}),o>0&&(0,d.jsx)(v.$,{variant:i||"revert"!==b?"default":"destructive",onClick:j,children:i?`${m} (${o})`:`${m} ${1===o?"migration":`${o} migrations`}`})]})})]})})}function ak({setId:a}){let b=(0,g.useRouter)(),{connection:c,tables:e}=(0,u.k)(),o=(0,E.j)(a=>a.addFiles),r=(0,E.j)(a=>a.renameSet),s=(0,E.j)(a=>a.removeSet),t=(0,E.j)(a=>a.removeStep),H=(0,E.j)(a=>a.record),I=(0,E.j)(a=>a.ledgerSchema),J=(0,E.j)(a=>a.setLedgerSchema),K=(0,E.S)(a),L=(0,C.gz)(c.id),M=(0,F.En)(a=>a.setDraft),N=(0,F.En)(a=>a.setActiveSaved),[O,P]=(0,h.useState)("migrations"),[Q,R]=(0,h.useState)([]),[S,T]=(0,h.useState)(null),[U,V]=(0,h.useState)(null),[W,$]=(0,h.useState)(!1),[_,aa]=(0,h.useState)(!1),[af,ag]=(0,h.useState)(null),[ah,ai]=(0,h.useState)(null),[ao,ap]=(0,h.useState)(!1),aq=(0,h.useRef)(null),ar=(0,h.useRef)(!1),as=(0,h.useMemo)(()=>[c,...L],[c,L]),at=as.map(a=>a.url).join("|"),au=(0,y.Y)(`ledgers:${I}:${at}`,async a=>Object.fromEntries(await Promise.all(as.map(async b=>{try{return[b.id,{ledger:await z.F.ledger(b.url,I,a),error:null}]}catch(c){if(a.aborted)throw c;return[b.id,{ledger:null,error:c instanceof Error?c.message:String(c)}]}})))),av=au.data?.[c.id]??null,aw=av?.ledger??null,ax=(0,h.useMemo)(()=>as.map(a=>{let b=au.data?.[a.id]??null;return{connection:a,ledger:b?.ledger??null,error:b?.error??null,summary:(0,A.eh)(K,b?.ledger??null)}}),[as,au.data,K]),ay=`/${encodeURIComponent(c.id)}/migrations`,az=(0,E.j)(a=>a.history),aA=(0,h.useMemo)(()=>{let a=(0,D.x)(ax.map(a=>({connection:a.connection,ledger:a.ledger})),az),b=new Set(K?.steps.map(a=>a.version)??[]),c=K?.name;return a.filter(a=>b.has(a.version)||a.setName===c)},[ax,az,K]),aB=(0,A.eh)(K,aw),aC=(0,h.useMemo)(()=>(0,A.nb)(K,aw),[K,aw]),aD=(0,A.kB)(K,aw),aE=(0,h.useCallback)(b=>{ag(o(a,b.files)),P("migrations")},[o,a]),aF=(0,ae.$)(aE);function aG(a,b,c=!1){(0!==b.steps.length||b.blockedBy)&&(V(null),T({...b,direction:a,recordOnly:c}))}function aH(a){return{steps:a,blockedBy:null}}async function aI(){if(!S||!K)return;ar.current=!1,$(!0);let a=S.steps.map(a=>({version:a.version,name:a.name,status:"waiting"}));V(a);let b=(b,c)=>{V(a=a.map((a,d)=>d===b?{...a,...c}:a))},d=b=>{V(a=a.map((a,c)=>c>=b&&"waiting"===a.status?{...a,status:"skipped"}:a))};for(let[a,e]of S.steps.entries()){if(ar.current){d(a);break}let f="apply"===S.direction?e.applySql:e.revertSql;if(!f&&!S.recordOnly){b(a,{status:"failed",error:"No revert file for this migration."}),d(a+1);break}b(a,{status:"running"});try{let d=await z.F.migrate(c.url,{direction:S.direction,version:e.version,name:e.name,checksum:e.checksum,setName:K.name,sql:f??"",revertSql:"apply"===S.direction?e.revertSql:void 0,ledgerSchema:I,recordOnly:S.recordOnly});b(a,{status:"ok",durationMs:d.durationMs}),H({setId:K.id,setName:K.name,connectionId:c.id,connectionName:c.name,direction:S.direction,version:e.version,name:e.name,status:"ok",recorded:S.recordOnly,durationMs:d.durationMs})}catch(g){let f=g instanceof Error?g.message:String(g);b(a,{status:"failed",error:f}),d(a+1),H({setId:K.id,setName:K.name,connectionId:c.id,connectionName:c.name,direction:S.direction,version:e.version,name:e.name,status:"failed",durationMs:0,error:f});break}}$(!1),au.reload(),e.reload()}function aJ(a){M(c.id,a),N(c.id,null),b.push(`/${encodeURIComponent(c.id)}/query`)}function aK(a){a!==c.id&&b.push(`/${encodeURIComponent(a)}/migrations`)}async function aL(a){let b=a?.[0];ai(null),b&&ah&&K&&ag(o(K.id,[{path:`revert/${ah}_${b.name}`,text:await b.text()}]))}if(!K)return(0,d.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[(0,d.jsx)(al,{name:"Not found",indexHref:ay}),(0,d.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 text-muted-foreground",children:[(0,d.jsx)("p",{className:"text-sm",children:"That migration is no longer here."}),(0,d.jsx)(f(),{href:ay,className:"text-foreground underline underline-offset-4",children:"All migrations"})]})]});let aM=(0,A.gj)(K,aw),aN=(0,A.e)(K,aw),aO=W||au.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)(al,{name:K?.name??"",indexHref:ay,children:[(0,d.jsx)(Y,{environments:ax,targetId:c.id,onSelect:aK}),(0,d.jsxs)("div",{className:"ml-auto flex items-center gap-2",children:[(0,d.jsxs)(v.$,{size:"sm",variant:"ghost",disabled:au.loading,title:"Re-read every environment's ledger",onClick:()=>au.reload(),children:[(0,d.jsx)(i.A,{"data-icon":"inline-start",className:(0,G.cn)(au.loading&&"animate-spin")}),"Refresh"]}),(0,d.jsxs)(v.$,{size:"sm",variant:"ghost",onClick:()=>aa(!0),children:[(0,d.jsx)(j.A,{"data-icon":"inline-start"}),"Import"]}),(0,d.jsxs)(w.rI,{children:[(0,d.jsx)(w.ty,{render:(0,d.jsx)(v.$,{size:"icon-sm",variant:"ghost","aria-label":"More migration actions"}),className:"cursor-pointer",children:(0,d.jsx)(k.A,{})}),(0,d.jsxs)(w.SQ,{align:"end",className:"min-w-64",children:[(0,d.jsxs)(w._2,{disabled:aO||0===aM.steps.length,onClick:()=>aG("apply",aH(aM.steps),!0),children:[(0,d.jsx)(l.A,{}),"Mark ",aM.steps.length," as already applied"]}),(0,d.jsx)(w.mB,{}),(0,d.jsxs)(w._2,{disabled:aO||0===aN.steps.length,onClick:()=>aG("revert",aN),children:[(0,d.jsx)(m.A,{}),"Revert everything on ",c.name]}),(0,d.jsx)(w.mB,{}),(0,d.jsxs)(w._2,{onClick:function(){if(!K)return;let a=window.prompt("Rename this migration",K.name);null!==a&&r(K.id,a)},children:[(0,d.jsx)(n.A,{}),"Rename this migration"]}),(0,d.jsxs)(w._2,{onClick:()=>ap(!0),children:[(0,d.jsx)(p,{}),"Ledger table: ",I,".",B.R9]}),(0,d.jsx)(w.mB,{}),(0,d.jsx)(w._2,{variant:"destructive",onClick:function(){K&&(s(K.id),b.push(ay))},children:"Forget this migration"})]})]}),(0,d.jsxs)(v.$,{size:"sm",disabled:aO||0===aM.steps.length,onClick:()=>aG("apply",aM),children:[(0,d.jsx)(q.A,{"data-icon":"inline-start"}),0===aM.steps.length?"Nothing pending":`Apply ${aM.steps.length} to ${c.name}`]})]})]}),0===L.length&&(0,d.jsxs)("p",{className:"border-b bg-muted/30 px-4 py-1.5 text-xs text-muted-foreground",children:["Only ",c.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."]}),af&&(0,d.jsx)(am,{report:af,onDismiss:()=>ag(null)}),aF.error&&(0,d.jsx)("p",{className:"border-b bg-destructive/5 px-4 py-1.5 text-xs text-destructive",children:aF.error}),(0,d.jsxs)("div",{className:"relative flex min-h-0 flex-1 flex-col",children:["history"===O?(0,d.jsx)(x.F,{className:"min-h-0 flex-1",children:(0,d.jsx)(ac.H,{events:aA,connections:as,loading:au.loading})}):av?.error?(0,d.jsx)("p",{className:"flex-1 px-4 py-6 font-mono text-xs text-destructive",children:av.error}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(Z,{environments:ax,targetId:c.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}(aB,au.loading),loading:au.loading,onSelect:aK,onCompare:function(a){C.lz.getState().setCompareTarget(c.id,a),b.push(`/${encodeURIComponent(c.id)}/diff`)}}),(0,d.jsxs)(x.F,{className:(0,G.cn)("min-h-0 flex-1",au.loading&&"opacity-70"),children:[(K?.steps.length??0)===0&&(0,d.jsx)("div",{className:"p-6",children:(0,d.jsx)(ae.k,{onFiles:aE,compact:!0,hint:"Drop .sql files here to fill this set. They can arrive a folder at a time or one at a time."})}),(K?.steps??[]).map(a=>(0,d.jsx)(X,{step:a,targetId:c.id,status:(0,A.FY)(a,aw),environments:ax.map(b=>({connection:b.connection,status:(0,A.FY)(a,b.ledger),entry:(0,A.ay)(a,b.ledger),error:b.error})),isNewestApplied:aD?.version===a.version,expanded:Q.includes(a.version),busy:aO,onToggle:()=>{var b;return b=a.version,void R(a=>a.includes(b)?a.filter(a=>a!==b):[...a,b])},actions:{onApplyThrough:()=>aG("apply",(0,A.gj)(K,aw,a.version)),onApplyOne:()=>aG("apply",{steps:[a],blockedBy:null}),onRevertThrough:()=>aG("revert",(0,A.e)(K,aw,a.version)),onMarkApplied:()=>aG("apply",aH([a]),!0),onMarkPending:()=>aG("revert",aH([a]),!0),onAttachRevert:()=>{ai(a.version),window.requestAnimationFrame(()=>aq.current?.click())},onRemove:()=>K&&t(K.id,a.version),onOpenInEditor:aJ}},a.version)),aC.length>0&&(0,d.jsx)(an,{entries:aC,connectionName:c.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),aF.importFrom(a.dataTransfer)},children:(0,d.jsx)(ae.k,{onFiles:aE,className:"w-full max-w-xl bg-background"})})]}),(0,d.jsx)(ad.l,{pane:O,onPaneChange:P,historyCount:aA.length,migrationsLabel:"Files",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:K?.name??"",connectionName:c.name,summary:aB,initialized:aw?.initialized??null,loading:au.loading,foundIn:aw?.initialized?aw.schema:null,configuredSchema:I})}),(0,d.jsx)("input",{ref:aq,type:"file",accept:".sql",className:"sr-only",onChange:a=>{aL(a.target.files),a.target.value=""}}),ao&&(0,d.jsx)(ab,{schema:I,found:ax.filter(a=>a.ledger?.initialized).map(a=>({name:a.connection.name,schema:a.ledger?.schema??I})),onOpenChange:ap,onSave:a=>{J(a),au.reload()}}),S&&(0,d.jsx)(aj,{open:!0,direction:S.direction,connection:c,steps:S.steps,blockedBy:S.blockedBy,progress:U,running:W,recordOnly:S.recordOnly??!1,onRun:()=>void aI(),onStop:()=>{ar.current=!0},onClose:function(){W||(T(null),V(null))}})]})}function al({name:a,indexHref:b,children:c}){return(0,d.jsxs)("header",{className:"flex h-11 shrink-0 items-center gap-2 border-b px-3",children:[(0,d.jsxs)(f(),{href:b,title:"Back to all migrations",className:"flex shrink-0 items-center gap-1.5 rounded-md px-1 py-0.5 text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/60",children:[(0,d.jsx)(r.A,{className:"size-4"}),(0,d.jsx)(s.A,{className:"size-4"})]}),(0,d.jsx)("span",{className:"min-w-0 truncate font-medium",children:a}),c]})}function am({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)(v.$,{size:"xs",variant:"ghost",onClick:b,children:"Dismiss"})]})}function an({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)(t,{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)(W,{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))]})}},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"}]])},92258:(a,b,c)=>{Promise.resolve().then(c.bind(c,97182))},97182:(a,b,c)=>{"use strict";c.d(b,{MigrationDetail:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call MigrationDetail() from the server but MigrationDetail 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/migration-detail.tsx","MigrationDetail")}};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=58277));module.exports=c})();
1
+ (()=>{var a={};a.id=838,a.ids=[838],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")},10410:(a,b,c)=>{Promise.resolve().then(c.bind(c,20836))},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:()=>t,iX:()=>u,mw:()=>s});var d=c(48249),e=c(67484),f=c(23171),g=c(25297),h=c(13656);let i=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 j(a){let b=[],c=0;for(;c<a.length;){let d=a[c];if(!d)break;if(m(d)){let d=c;for(c+=1;c<a.length&&m(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&&p(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=l(a,c,'"',"ident",b);continue}if("'"===d){c=l(a,c,"'","string",b);continue}if(n(d)||"."===d&&n(a[c+1])){let d=c;c=function(a,b){let c=b;for("."===a[c]&&(c+=1);c<a.length&&n(a[c]);)c+=1;if("."===a[c]&&n(a[c+1]))for(c+=1;c<a.length&&n(a[c]);)c+=1;if("e"===a[c]||"E"===a[c]){let b=c+1;if(("+"===a[b]||"-"===a[b])&&(b+=1),n(a[b]))for(c=b;c<a.length&&n(a[c]);)c+=1}return c}(a,c),b.push({kind:"number",value:a.slice(d,c)});continue}if(o(d)){let d=c;for(c+=1;c<a.length&&p(a[c]);)c+=1;let e=a.slice(d,c);b.push({kind:function(a,b,c){let d=b.toLowerCase();if(i.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 k(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 l(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 m(a){return" "===a||" "===a||"\n"===a||"\r"===a}function n(a){return void 0!==a&&a>="0"&&a<="9"}function o(a){return void 0!==a&&(a>="A"&&a<="Z"||a>="a"&&a<="z"||"_"===a)}function p(a){return o(a)||n(a)||"$"===a}var q=c(14490);function r({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 s(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 t({sql:a,className:b}){let c=(0,e.useMemo)(()=>k(j(a.trimEnd())),[a]);return(0,d.jsx)("pre",{className:(0,q.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)(r,{tokens:a})},b))})})}function u({sql:a,error:b,loading:c,actions:i}){let[l,m]=(0,e.useState)(!1),n=(0,e.useMemo)(()=>a?k(j(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===n.length)return(0,d.jsx)("div",{className:"flex flex-col gap-2 p-4",children:Array.from({length:16},(a,b)=>(0,d.jsx)(h.E,{className:"h-4 w-full"},b))});async function o(){a&&(await s(a),m(!0),window.setTimeout(()=>m(!1),1500))}let p=`${Math.max(String(n.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:[i,(0,d.jsxs)(g.$,{type:"button",variant:"ghost",size:"sm",onClick:()=>void o(),children:[l?(0,d.jsx)(f.wiW,{"data-icon":"inline-start"}):(0,d.jsx)(f.hX7,{"data-icon":"inline-start"}),l?"Copied":"Copy SQL"]})]}),(0,d.jsx)("div",{className:(0,q.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:n.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:p},children:b+1}),(0,d.jsx)("code",{className:"pr-8 whitespace-pre",children:(0,d.jsx)(r,{tokens:a})})]},b))})})]})}},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},20836:(a,b,c)=>{"use strict";c.d(b,{MigrationDetail:()=>T});var d=c(48249),e=c(2116),f=c.n(e),g=c(19099),h=c(67484),i=c(23171),j=c(44231),k=c(60671),l=c(86229),m=c(25297),n=c(82244),o=c(53286),p=c(20886),q=c(21883),r=c(78931),s=c(72428),t=c(99598),u=c(453),v=c(66280),w=c(12229),x=c(14490),y=c(30770),z=c(13367),A=c(37654),B=c(67657);let C="w-24",D="w-[104px]",E={applied:"applied",drifted:"applied, but the file changed since",pending:"not applied",unknown:"not read yet"};function F({status:a}){return"applied"===a?(0,d.jsx)(i.wiW,{className:"size-4 text-emerald-600 dark:text-emerald-400"}):"drifted"===a?(0,d.jsx)(i.e5t,{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)(i.uPM,{className:"size-3.5 text-muted-foreground/40"})}function G({step:a,environments:b,targetId:c,status:e,isNewestApplied:f,expanded:g,busy:j,editable:k=!0,onToggle:l,actions:o}){let[p,q]=(0,h.useState)("apply"),[r,s]=(0,h.useState)(!1),t="revert"===p?a.revertSql??"":a.applySql,u=(0,B.qb)(a.transaction),v=(0,B.TA)(a.transaction),w=[];async function y(){await (0,z.mw)(t),s(!0),window.setTimeout(()=>s(!1),1500)}return"drifted"===e&&w.push("This file changed after it was applied here, so it is no longer the migration that ran."),v&&w.push(v),(0,d.jsxs)("div",{className:"border-b last:border-b-0",children:[(0,d.jsxs)("div",{className:(0,x.cn)("flex h-10 items-center transition-colors hover:bg-muted/40",j&&"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:l,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)(i.nNJ,{className:(0,x.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}),u&&(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:u})]}),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 ${E[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,x.cn)("flex h-10 shrink-0 items-center justify-center",C,e&&"bg-foreground/[0.04]"),children:(0,d.jsx)(F,{status:b.status})},b.connection.id)}),(0,d.jsxs)("div",{className:(0,x.cn)("flex shrink-0 items-center justify-end gap-1 pr-2 pl-1",D),children:["pending"===e&&(0,d.jsx)(m.$,{size:"xs",variant:"outline",disabled:j,onClick:o.onApplyThrough,children:"Apply"}),f&&a.revertSql&&(0,d.jsxs)(m.$,{size:"xs",variant:"ghost",disabled:j,onClick:o.onRevertThrough,children:[(0,d.jsx)(i.ij9,{"data-icon":"inline-start"}),"Revert"]}),(0,d.jsxs)(n.rI,{children:[(0,d.jsx)(n.ty,{render:(0,d.jsx)(m.$,{size:"icon-xs",variant:"ghost","aria-label":`Actions for ${a.version}`}),className:"cursor-pointer",children:(0,d.jsx)(i.YKd,{})}),(0,d.jsxs)(n.SQ,{align:"end",className:"min-w-56",children:[(0,d.jsx)(n._2,{disabled:j||"applied"===e,onClick:o.onApplyThrough,children:"Apply everything through here"}),(0,d.jsx)(n._2,{disabled:j||"applied"===e,onClick:o.onApplyOne,children:"Apply only this one"}),(0,d.jsx)(n._2,{disabled:j||"pending"===e||!a.revertSql,onClick:o.onRevertThrough,children:"Revert back through here"}),(0,d.jsx)(n.mB,{}),(0,d.jsxs)(n._2,{disabled:j||"applied"===e,onClick:o.onMarkApplied,children:[(0,d.jsx)(i.nXx,{}),"Mark as already applied"]}),(0,d.jsxs)(n._2,{disabled:j||"pending"===e,onClick:o.onMarkPending,children:[(0,d.jsx)(i.fJ4,{}),"Mark as not applied"]}),(0,d.jsx)(n.mB,{}),k&&(0,d.jsxs)(n._2,{onClick:o.onAttachRevert,children:[(0,d.jsx)(i.W4E,{}),a.revertSql?"Replace revert file…":"Add a revert file…"]}),(0,d.jsxs)(n._2,{onClick:()=>o.onOpenInEditor(t),children:[(0,d.jsx)(i.Uoo,{}),"Open ",p," SQL in editor"]}),(0,d.jsxs)(n._2,{onClick:()=>void y(),children:[(0,d.jsx)(i.hX7,{}),"Copy ",p," SQL"]}),k&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(n.mB,{}),(0,d.jsx)(n._2,{variant:"destructive",onClick:o.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)(A.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)(m.$,{size:"xs",variant:"ghost",className:"ml-auto",onClick:()=>void y(),children:[r?(0,d.jsx)(i.wiW,{"data-icon":"inline-start"}):(0,d.jsx)(i.hX7,{"data-icon":"inline-start"}),r?"Copied":"Copy"]})]}),w.length>0&&(0,d.jsx)("ul",{className:"space-y-1 px-3 pb-2",children:w.map(a=>(0,d.jsxs)("li",{className:"flex gap-1.5 text-[11px] text-amber-700 dark:text-amber-400",children:[(0,d.jsx)(i.e5t,{className:"mt-px size-3 shrink-0"}),(0,d.jsx)("span",{children:a})]},a))}),t?(0,d.jsx)(z.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."}),k&&(0,d.jsxs)(m.$,{size:"xs",variant:"outline",onClick:o.onAttachRevert,children:[(0,d.jsx)(i.W4E,{"data-icon":"inline-start"}),"Add one"]})]})]})]})}function H({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)(n.rI,{children:[(0,d.jsxs)(n.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)(y.F,{connection:e.connection}),(0,d.jsx)("span",{className:"max-w-32 truncate",children:e.connection.name})]}),(0,d.jsx)(n.SQ,{align:"start",className:"min-w-52",children:a.map(a=>(0,d.jsxs)(n._2,{onClick:()=>c(a.connection.id),className:a.connection.id===b?"font-medium":void 0,children:[(0,d.jsx)(y.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 I({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,x.cn)("flex h-11 shrink-0 flex-col items-center justify-center gap-0.5 border-l text-[11px] outline-none",C,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)(y.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,x.cn)("flex shrink-0 items-center justify-end border-l pr-2 pl-1",D),children:a.length>1&&(0,d.jsx)(m.$,{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)(i.R4X,{})})})]})}var J=c(38393),K=c(88877),L=c(90863);function M({schema:a,found:b,onOpenChange:c,onSave:e}){let[f,g]=(0,h.useState)(a),i=f.trim(),j=(0,s.hD)(i),k=b.filter(a=>a.schema!==i);function l(){j&&(e(i),c(!1))}return(0,d.jsx)(J.lG,{open:!0,onOpenChange:c,children:(0,d.jsxs)(J.Cf,{className:"sm:max-w-md",children:[(0,d.jsxs)(J.c7,{children:[(0,d.jsx)(J.L3,{children:"Ledger schema"}),(0,d.jsx)(J.rr,{children:"Where each database keeps its record of what has run. Created on the first apply."})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsx)(L.J,{htmlFor:"ledger-schema",children:"Schema"}),(0,d.jsx)(K.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}.${s.R9}`:"\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."})]}),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} keeps its ledger in ${a.schema}`).join("; "),". That one stays where it is."]}),(0,d.jsxs)(J.Es,{children:[i!==s.aC&&(0,d.jsx)(m.$,{variant:"ghost",onClick:()=>g(s.aC),children:"Reset"}),(0,d.jsx)(m.$,{variant:"outline",onClick:()=>c(!1),children:"Cancel"}),(0,d.jsx)(m.$,{disabled:!j,onClick:l,children:"Save"})]})]})})}var N=c(77963),O=c(76829),P=c(65292),Q=c(29613),R=c(78394),S=c(30904);function T({setId:a}){let b=(0,g.useRouter)(),{connection:c,tables:e}=(0,j.k)(),l=(0,v.jV)(a=>a.addFiles),y=(0,v.jV)(a=>a.renameSet),z=(0,v.jV)(a=>a.removeSet),A=(0,v.jV)(a=>a.removeStep),B=(0,v.jV)(a=>a.record),C=(0,v.jV)(a=>a.ledgerSchema),D=(0,v.jV)(a=>a.setLedgerSchema),E=(0,v.Ss)(a),{root:F}=(0,v.ox)(c.id),J=(0,S.y)((0,s.km)(a)?F:null),K=(0,s.km)(a)?J.data?.sets.find(b=>b.id===a)??null:E,L=!!K?.source,X=(0,t.gz)(c.id),Y=(0,w.En)(a=>a.setDraft),Z=(0,k.$C)(),$=(0,w.En)(a=>a.setActiveSaved),[_,aa]=(0,h.useState)("migrations"),[ab,ac]=(0,h.useState)([]),[ad,ae]=(0,h.useState)(null),[af,ag]=(0,h.useState)(null),[ah,ai]=(0,h.useState)(!1),[aj,ak]=(0,h.useState)(!1),[al,am]=(0,h.useState)(null),[an,ao]=(0,h.useState)(null),[ap,aq]=(0,h.useState)(!1),[ar,as]=(0,h.useState)(!1),at=(0,h.useRef)(null),au=(0,h.useRef)(!1),av=(0,h.useMemo)(()=>[c,...X],[c,X]),aw=av.map(a=>a.url).join("|"),ax=(0,p.Y)(`ledgers:${C}:${aw}`,async a=>Object.fromEntries(await Promise.all(av.map(async b=>{try{return[b.id,{ledger:await q.F.ledger(b.url,C,a),error:null}]}catch(c){if(a.aborted)throw c;return[b.id,{ledger:null,error:c instanceof Error?c.message:String(c)}]}})))),ay=ax.data?.[c.id]??null,az=K?.name??"",aA=(0,h.useMemo)(()=>(0,r.Gf)(ay?.ledger,az),[ay?.ledger,az]),aB=(0,h.useMemo)(()=>av.map(a=>{let b=ax.data?.[a.id]??null,c=(0,r.Gf)(b?.ledger,az);return{connection:a,ledger:c,error:b?.error??null,summary:(0,r.eh)(K,c)}}),[av,ax.data,K,az]),aC=`/${encodeURIComponent(c.id)}/migrations`,aD=(0,v.jV)(a=>a.history),aE=(0,h.useMemo)(()=>(0,u.x)(aB.map(a=>({connection:a.connection,ledger:a.ledger})),aD).filter(a=>a.setName===az),[aB,aD,az]),aF=(0,r.eh)(K,aA),aG=(0,h.useMemo)(()=>(0,r.nb)(K,aA),[K,aA]),aH=(0,r.kB)(K,aA),aI=(0,h.useCallback)(b=>{am(l(a,b.files)),aa("migrations")},[l,a]),aJ=(0,P.$)(aI);function aK(a,b,c=!1){(0!==b.steps.length||b.blockedBy)&&(ag(null),ae({...b,direction:a,recordOnly:c}))}function aL(a){return{steps:a,blockedBy:null}}async function aM(){if(!ad||!K)return;au.current=!1,ai(!0);let a=ad.steps.map(a=>({version:a.version,name:a.name,status:"waiting"}));ag(a);let b=(b,c)=>{ag(a=a.map((a,d)=>d===b?{...a,...c}:a))},d=b=>{ag(a=a.map((a,c)=>c>=b&&"waiting"===a.status?{...a,status:"skipped"}:a))};for(let[a,e]of ad.steps.entries()){if(au.current){d(a);break}let f="apply"===ad.direction?e.applySql:e.revertSql;if(!f&&!ad.recordOnly){b(a,{status:"failed",error:"No revert file for this migration."}),d(a+1);break}b(a,{status:"running"});try{let d=await q.F.migrate(c.url,{direction:ad.direction,version:e.version,name:e.name,checksum:e.checksum,setName:K.name,sql:f??"",revertSql:"apply"===ad.direction?e.revertSql:void 0,ledgerSchema:C,recordOnly:ad.recordOnly});b(a,{status:"ok",durationMs:d.durationMs}),B({setId:K.id,setName:K.name,connectionId:c.id,connectionName:c.name,direction:ad.direction,version:e.version,name:e.name,status:"ok",recorded:ad.recordOnly,durationMs:d.durationMs})}catch(g){let f=g instanceof Error?g.message:String(g);b(a,{status:"failed",error:f}),d(a+1),B({setId:K.id,setName:K.name,connectionId:c.id,connectionName:c.name,direction:ad.direction,version:e.version,name:e.name,status:"failed",durationMs:0,error:f});break}}ai(!1),ax.reload(),e.reload()}function aN(a){Y(c.id,a),$(c.id,null),b.push(`/${encodeURIComponent(c.id)}/query`)}function aO(a){Z(a)}async function aP(a){let b=a?.[0];ao(null),b&&an&&K&&am(l(K.id,[{path:`revert/${an}_${b.name}`,text:await b.text()}]))}if(!K){let b=(0,s.km)(a)&&J.loading;return(0,d.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[(0,d.jsx)(U,{name:b?"Reading…":"Not found"}),(0,d.jsx)("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 text-muted-foreground",children:b?(0,d.jsx)("p",{className:"text-sm",children:"Reading the folder…"}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("p",{className:"text-sm",children:J.error?J.error:(0,s.km)(a)?"That migration is not in the folder on the branch you have checked out.":"That migration is no longer here."}),(0,d.jsx)(f(),{href:aC,className:"text-foreground underline underline-offset-4",children:"All migrations"})]})})]})}let aQ=(0,r.gj)(K,aA),aR=(0,r.e)(K,aA),aS=ah||ax.loading||J.loading;return(0,d.jsxs)("div",{className:"relative flex min-h-0 flex-1 flex-col",onDragOver:a=>{!L&&a.dataTransfer.types.includes("Files")&&(a.preventDefault(),ak(!0))},children:[(0,d.jsxs)(U,{name:K?.name??"",children:[K.source&&(0,d.jsxs)("span",{className:"flex min-w-0 items-center gap-1 text-[11px] text-muted-foreground",title:`Read from ${K.source.path}`,children:[(0,d.jsx)(i.WzY,{className:"size-3.5 shrink-0"}),(0,d.jsx)("span",{className:"max-w-48 truncate font-mono",children:K.source.path})]}),(0,d.jsx)(H,{environments:aB,targetId:c.id,onSelect:aO}),(0,d.jsxs)("div",{className:"ml-auto flex items-center gap-2",children:[(0,d.jsx)(m.$,{size:"icon-sm",variant:"ghost",disabled:ax.loading||J.loading,"aria-label":"Refresh",title:L?"Re-read the files and every environment's ledger":"Re-read every environment's ledger",onClick:function(){ax.reload(),L&&J.reload()},children:(0,d.jsx)(i.oS8,{className:(0,x.cn)((ax.loading||J.loading)&&"animate-spin")})}),!L&&(0,d.jsxs)(m.$,{size:"sm",variant:"ghost",onClick:()=>ak(!0),children:[(0,d.jsx)(i.FeY,{"data-icon":"inline-start"}),"Import"]}),(0,d.jsxs)(n.rI,{children:[(0,d.jsx)(n.ty,{render:(0,d.jsx)(m.$,{size:"icon-sm",variant:"ghost","aria-label":"More migration actions"}),className:"cursor-pointer",children:(0,d.jsx)(i.YKd,{})}),(0,d.jsxs)(n.SQ,{align:"end",className:"min-w-64",children:[(0,d.jsxs)(n._2,{disabled:aS||0===aQ.steps.length,onClick:()=>aK("apply",aL(aQ.steps),!0),children:[(0,d.jsx)(i.nXx,{}),"Mark ",aQ.steps.length," as already applied"]}),(0,d.jsx)(n.mB,{}),(0,d.jsxs)(n._2,{disabled:aS||0===aR.steps.length,onClick:()=>aK("revert",aR),children:[(0,d.jsx)(i.ij9,{}),"Revert everything on ",c.name]}),(0,d.jsx)(n.mB,{}),!L&&(0,d.jsxs)(n._2,{onClick:()=>as(!0),children:[(0,d.jsx)(i.NOV,{}),"Rename"]}),(0,d.jsxs)(n._2,{onClick:()=>aq(!0),children:[(0,d.jsx)(i.ooN,{}),"Ledger table",(0,d.jsxs)("span",{className:"ml-auto pl-3 font-mono text-[11px] text-muted-foreground",children:[C,".",s.R9]})]}),!L&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(n.mB,{}),(0,d.jsx)(n._2,{variant:"destructive",onClick:function(){K&&(z(K.id),b.push(aC))},children:"Forget this migration"})]})]})]}),(0,d.jsxs)(m.$,{size:"sm",disabled:aS||0===aQ.steps.length,onClick:()=>aK("apply",aQ),children:[(0,d.jsx)(i.eGB,{"data-icon":"inline-start"}),0===aQ.steps.length?"Up to date":`Apply ${aQ.steps.length} to ${c.name}`]})]})]}),al&&(0,d.jsx)(V,{report:al,onDismiss:()=>am(null)}),aJ.error&&(0,d.jsx)("p",{className:"border-b bg-destructive/5 px-4 py-1.5 text-xs text-destructive",children:aJ.error}),(0,d.jsxs)("div",{className:"relative flex min-h-0 flex-1 flex-col",children:["history"===_?(0,d.jsx)(o.F,{className:"min-h-0 flex-1",children:(0,d.jsx)(N.H,{events:aE,connections:av,loading:ax.loading})}):ay?.error?(0,d.jsx)("p",{className:"flex-1 px-4 py-6 font-mono text-xs text-destructive",children:ay.error}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(I,{environments:aB,targetId:c.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} not in this folder`:c}(aF,ax.loading),loading:ax.loading,onSelect:aO,onCompare:function(a){t.lz.getState().setCompareTarget(c.id,a),b.push(`/${encodeURIComponent(c.id)}/diff`)}}),(0,d.jsxs)(o.F,{className:(0,x.cn)("min-h-0 flex-1",ax.loading&&"opacity-70"),children:[(K?.steps.length??0)===0&&!L&&(0,d.jsx)("div",{className:"p-6",children:(0,d.jsx)(P.k,{onFiles:aI,compact:!0})}),K.skipped.length>0&&L&&(0,d.jsxs)("div",{className:"border-b bg-muted/20 px-4 py-2 text-xs text-muted-foreground",children:[(0,d.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,d.jsx)(i.e5t,{className:"size-3.5 shrink-0 text-amber-600 dark:text-amber-400"}),"Skipped ",K.skipped.length," file",1===K.skipped.length?"":"s"]}),(0,d.jsx)("ul",{className:"mt-1 space-y-0.5 pl-5 font-mono text-[11px]",children:K.skipped.map(a=>(0,d.jsx)("li",{children:a},a))})]}),(K?.steps??[]).map(a=>(0,d.jsx)(G,{step:a,targetId:c.id,status:(0,r.FY)(a,aA),environments:aB.map(b=>({connection:b.connection,status:(0,r.FY)(a,b.ledger),entry:(0,r.ay)(a,b.ledger),error:b.error})),isNewestApplied:aH?.version===a.version,expanded:ab.includes(a.version),busy:aS,editable:!L,onToggle:()=>{var b;return b=a.version,void ac(a=>a.includes(b)?a.filter(a=>a!==b):[...a,b])},actions:{onApplyThrough:()=>aK("apply",(0,r.gj)(K,aA,a.version)),onApplyOne:()=>aK("apply",{steps:[a],blockedBy:null}),onRevertThrough:()=>aK("revert",(0,r.e)(K,aA,a.version)),onMarkApplied:()=>aK("apply",aL([a]),!0),onMarkPending:()=>aK("revert",aL([a]),!0),onAttachRevert:()=>{ao(a.version),window.requestAnimationFrame(()=>at.current?.click())},onRemove:()=>K&&A(K.id,a.version),onOpenInEditor:aN}},a.version)),aG.length>0&&(0,d.jsx)(W,{entries:aG,connectionName:c.name})]})]}),aj&&!L&&(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:()=>ak(!1),onDrop:a=>{a.preventDefault(),ak(!1),aJ.importFrom(a.dataTransfer)},children:(0,d.jsx)(P.k,{onFiles:aI,className:"w-full max-w-xl bg-background"})})]}),(0,d.jsx)(O.l,{pane:_,onPaneChange:aa,historyCount:aE.length,migrationsLabel:"Files",caption:function({connectionName:a,summary:b,initialized:c,loading:d,foundIn:e,configuredSchema:f}){if(d&&null===c)return"Reading ledgers…";let g=[];return!1===c||b.pending>0?g.push(`${b.pending} of ${b.total} pending on ${a}`):g.push(`${a} is up to date`),b.drifted>0&&g.push(`${b.drifted} changed since applied`),e&&e!==f&&g.push(`ledger in ${e}`),g.join(" \xb7 ")}({connectionName:c.name,summary:aF,initialized:aA?.initialized??null,loading:ax.loading,foundIn:aA?.initialized?aA.schema:null,configuredSchema:C})}),(0,d.jsx)("input",{ref:at,type:"file",accept:".sql",className:"sr-only",onChange:a=>{aP(a.target.files),a.target.value=""}}),(0,d.jsx)(Q.K,{open:ar,title:"Rename migration",initial:K.name,submitLabel:"Rename",onOpenChange:as,onSubmit:function(a){K&&y(K.id,a)}}),ap&&(0,d.jsx)(M,{schema:C,found:aB.filter(a=>a.ledger?.initialized).map(a=>({name:a.connection.name,schema:a.ledger?.schema??C})),onOpenChange:aq,onSave:a=>{D(a),ax.reload()}}),ad&&(0,d.jsx)(R.I,{open:!0,direction:ad.direction,connection:c,steps:ad.steps,blockedBy:ad.blockedBy,progress:af,running:ah,recordOnly:ad.recordOnly??!1,onRun:()=>void aM(),onStop:()=>{au.current=!0},onClose:function(){ah||(ae(null),ag(null))}})]})}function U({name:a,children:b}){return(0,d.jsxs)(l.X,{children:[(0,d.jsx)(i.olY,{className:"size-4 shrink-0 text-muted-foreground"}),(0,d.jsx)("span",{className:"min-w-0 truncate font-medium",children:a}),b]})}function V({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)(m.$,{size:"xs",variant:"ghost",onClick:b,children:"Dismiss"})]})}function W({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)(i.e5t,{className:"size-3.5 shrink-0 text-amber-600 dark:text-amber-400"}),"Applied on ",b,", not in this folder"]}),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)(F,{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))]})}},26926:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>f});var d=c(5735),e=c(97182);async function f({params:a}){let{setId:b}=await a;return(0,d.jsx)(e.MigrationDetail,{setId:decodeURIComponent(b)})}},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")},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")},59433:(a,b,c)=>{"use strict";c.r(b),c.d(b,{__next_app__:()=>t,handler:()=>v,routeModule:()=>u});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=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,95547,23))),r={children:["",{children:["[connectionId]",{children:["migrations",{children:["[setId]",{children:["__PAGE__",{},{page:[(0,d.p)(()=>Promise.resolve().then(c.bind(c,26926))),"/Users/theobourgeois/code/db-studio/src/app/[connectionId]/migrations/[setId]/page.tsx"]}]},{"global-error":[q,"next/dist/client/components/builtin/global-error.js"]},[]]},{"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,s=(0,e.H)({tree:r,page:"/[connectionId]/migrations/[setId]/page",pathname:"/[connectionId]/migrations/[setId]",require:c,loadChunk:()=>Promise.resolve(),interopDefault:f.T}),t=s.__next_app__,u=s.routeModule,v=s.handler},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},92258:(a,b,c)=>{Promise.resolve().then(c.bind(c,97182))},97182:(a,b,c)=>{"use strict";c.d(b,{MigrationDetail:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call MigrationDetail() from the server but MigrationDetail 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/migration-detail.tsx","MigrationDetail")}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[741,430,928,566,202,421,593,729,172],()=>b(b.s=59433));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/702.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/172.js","../../../../chunks/202.js","../../../../chunks/421.js","../../../../chunks/430.js","../../../../chunks/566.js","../../../../chunks/593.js","../../../../chunks/729.js","../../../../chunks/741.js","../../../../chunks/928.js","../../../../webpack-runtime.js","page_client-reference-manifest.js"]}
@@ -1 +1 @@
1
- globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/[connectionId]/migrations/[setId]/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-237a770e53d2a6ef.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":["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","3123","static/chunks/3123-5b058e55010e138a.js","7449","static/chunks/7449-d0483bbc0f0fec63.js","5838","static/chunks/app/%5BconnectionId%5D/migrations/%5BsetId%5D/page-483afd7dc1a64119.js"],"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-d0483bbc0f0fec63.js","9820","static/chunks/app/%5BconnectionId%5D/migrations/page-2217de71c9ad52fa.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/7bb8868c12384025.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":[],"/Users/theobourgeois/code/db-studio/src/app/[connectionId]/migrations/[setId]/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
+ globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/[connectionId]/migrations/[setId]/page"]={"moduleLoading":{"prefix":"/_next/"},"ssrModuleMapping":{"6044":{"*":{"id":"70344","name":"*","chunks":[],"async":false}},"21890":{"*":{"id":"41390","name":"*","chunks":[],"async":false}},"23042":{"*":{"id":"86104","name":"*","chunks":[],"async":false}},"27123":{"*":{"id":"81921","name":"*","chunks":[],"async":false}},"32971":{"*":{"id":"94488","name":"*","chunks":[],"async":false}},"37875":{"*":{"id":"53371","name":"*","chunks":[],"async":false}},"39049":{"*":{"id":"58963","name":"*","chunks":[],"async":false}},"48491":{"*":{"id":"8419","name":"*","chunks":[],"async":false}},"52096":{"*":{"id":"20836","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}},"65377":{"*":{"id":"19047","name":"*","chunks":[],"async":false}},"69063":{"*":{"id":"81040","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}},"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":["223","static/chunks/223-a4fca67d979d899d.js","7177","static/chunks/app/layout-e3fdecae5544dc60.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":["223","static/chunks/223-a4fca67d979d899d.js","7177","static/chunks/app/layout-e3fdecae5544dc60.js"],"async":false},"/Users/theobourgeois/code/db-studio/src/app/globals.css":{"id":51743,"name":"*","chunks":["223","static/chunks/223-a4fca67d979d899d.js","7177","static/chunks/app/layout-e3fdecae5544dc60.js"],"async":false},"/Users/theobourgeois/code/db-studio/src/components/ConvexClientProvider.tsx":{"id":94821,"name":"*","chunks":["223","static/chunks/223-a4fca67d979d899d.js","7177","static/chunks/app/layout-e3fdecae5544dc60.js"],"async":false},"/Users/theobourgeois/code/db-studio/src/components/local-bridge-gate.tsx":{"id":65377,"name":"*","chunks":["223","static/chunks/223-a4fca67d979d899d.js","7177","static/chunks/app/layout-e3fdecae5544dc60.js"],"async":false},"/Users/theobourgeois/code/db-studio/src/components/navigation-tracker.tsx":{"id":48491,"name":"*","chunks":["223","static/chunks/223-a4fca67d979d899d.js","7177","static/chunks/app/layout-e3fdecae5544dc60.js"],"async":false},"/Users/theobourgeois/code/db-studio/src/components/theme-provider.tsx":{"id":72737,"name":"*","chunks":["223","static/chunks/223-a4fca67d979d899d.js","7177","static/chunks/app/layout-e3fdecae5544dc60.js"],"async":false},"/Users/theobourgeois/code/db-studio/src/app/page.tsx":{"id":23042,"name":"*","chunks":["4506","static/chunks/f97e080b-53d22dc5d0e78dfd.js","1731","static/chunks/1731-6dec4b981289174f.js","900","static/chunks/900-3bd4de40e69579da.js","8361","static/chunks/8361-d0f8ce41b74637bf.js","8500","static/chunks/8500-01a63dafd809e317.js","649","static/chunks/649-a1f6ba42883ab7ce.js","7893","static/chunks/7893-4515c42324443f01.js","8974","static/chunks/app/page-c487da327ada2a6d.js"],"async":false},"/Users/theobourgeois/code/db-studio/src/components/explorer/explorer-shell.tsx":{"id":37875,"name":"*","chunks":["4506","static/chunks/f97e080b-53d22dc5d0e78dfd.js","1731","static/chunks/1731-6dec4b981289174f.js","900","static/chunks/900-3bd4de40e69579da.js","8361","static/chunks/8361-d0f8ce41b74637bf.js","8500","static/chunks/8500-01a63dafd809e317.js","8322","static/chunks/8322-ed3deecf058cc11c.js","649","static/chunks/649-a1f6ba42883ab7ce.js","6996","static/chunks/6996-45e967f18861b87e.js","7893","static/chunks/7893-4515c42324443f01.js","7123","static/chunks/app/%5BconnectionId%5D/layout-d990f4312947106b.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":6044,"name":"*","chunks":[],"async":false},"/Users/theobourgeois/code/db-studio/src/components/migrations/migration-detail.tsx":{"id":52096,"name":"*","chunks":["4506","static/chunks/f97e080b-53d22dc5d0e78dfd.js","1731","static/chunks/1731-6dec4b981289174f.js","900","static/chunks/900-3bd4de40e69579da.js","8361","static/chunks/8361-d0f8ce41b74637bf.js","8500","static/chunks/8500-01a63dafd809e317.js","8322","static/chunks/8322-ed3deecf058cc11c.js","649","static/chunks/649-a1f6ba42883ab7ce.js","6996","static/chunks/6996-45e967f18861b87e.js","1715","static/chunks/1715-206f291fde410bf6.js","3678","static/chunks/3678-daffdce12ffe73e6.js","5838","static/chunks/app/%5BconnectionId%5D/migrations/%5BsetId%5D/page-31589bfe4aa9fc68.js"],"async":false},"/Users/theobourgeois/code/db-studio/src/components/migrations/migrations-index.tsx":{"id":69063,"name":"*","chunks":["4506","static/chunks/f97e080b-53d22dc5d0e78dfd.js","1731","static/chunks/1731-6dec4b981289174f.js","900","static/chunks/900-3bd4de40e69579da.js","8361","static/chunks/8361-d0f8ce41b74637bf.js","8500","static/chunks/8500-01a63dafd809e317.js","8322","static/chunks/8322-ed3deecf058cc11c.js","649","static/chunks/649-a1f6ba42883ab7ce.js","6996","static/chunks/6996-45e967f18861b87e.js","3678","static/chunks/3678-daffdce12ffe73e6.js","9820","static/chunks/app/%5BconnectionId%5D/migrations/page-e99de6630bfec654.js"],"async":false},"/Users/theobourgeois/code/db-studio/src/components/explorer/connection-home.tsx":{"id":21890,"name":"*","chunks":["1731","static/chunks/1731-6dec4b981289174f.js","2336","static/chunks/app/%5BconnectionId%5D/page-a245bfbd8b3eb8a7.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/962dd5ab002fed8a.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":[],"/Users/theobourgeois/code/db-studio/src/app/[connectionId]/migrations/[setId]/page":[]},"rscModuleMapping":{"6044":{"*":{"id":"58977","name":"*","chunks":[],"async":false}},"21890":{"*":{"id":"52468","name":"*","chunks":[],"async":false}},"23042":{"*":{"id":"4494","name":"*","chunks":[],"async":false}},"27123":{"*":{"id":"95547","name":"*","chunks":[],"async":false}},"32971":{"*":{"id":"12377","name":"*","chunks":[],"async":false}},"37875":{"*":{"id":"34766","name":"*","chunks":[],"async":false}},"39049":{"*":{"id":"2781","name":"*","chunks":[],"async":false}},"48491":{"*":{"id":"19933","name":"*","chunks":[],"async":false}},"51743":{"*":{"id":"61135","name":"*","chunks":[],"async":false}},"52096":{"*":{"id":"97182","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}},"65377":{"*":{"id":"17569","name":"*","chunks":[],"async":false}},"69063":{"*":{"id":"99432","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}},"90484":{"*":{"id":"98562","name":"*","chunks":[],"async":false}},"94821":{"*":{"id":"88331","name":"*","chunks":[],"async":false}}},"edgeRscModuleMapping":{}};
@@ -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")},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:()=>A});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(56918),y=c(32278),z=c(76829);function A(){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.adoptSet),k=(0,u.j)(a=>a.addFiles),l=(0,u.j)(a=>a.ledgerSchema),v=(0,u.j)(a=>a.history),A=(0,t.gz)(b.id),[D,E]=(0,h.useState)("migrations"),[F,G]=(0,h.useState)(null),[H,I]=(0,h.useState)(null),J=(0,h.useMemo)(()=>[b,...A],[b,A]),K=J.map(a=>a.url).join("|"),L=(0,p.Y)(`ledgers:${l}:${K}`,async a=>Object.fromEntries(await Promise.all(J.map(async b=>{try{return[b.id,{ledger:await q.F.ledger(b.url,l,a),error:null}]}catch(c){if(a.aborted)throw c;return[b.id,{ledger:null,error:c instanceof Error?c.message:String(c)}]}})))),M=(0,h.useMemo)(()=>(0,r.x)(J.map(a=>({connection:a,ledger:L.data?.[a.id]?.ledger??null})),v),[J,L.data,v]),N=`/${encodeURIComponent(b.id)}/migrations`,O=(0,h.useCallback)(b=>{let c=e(b.name);k(c,b.files),a.push(`${N}/${encodeURIComponent(c)}`)},[e,k,a,N]);async function P(b){G(b),I(null);try{let c=await Promise.all(J.map(async a=>{try{return{read:await q.F.ledger(a.url,l,void 0,!0),error:null}}catch(a){return{read:null,error:a instanceof Error?a.message:String(a)}}})),d=c.find(a=>a.error);if(d?.error)return void I(d.error);let e=c.some(a=>a.read&&void 0===a.read.withSql),g=new Map;for(let{read:a}of c)for(let c of a?.entries??[]){if(c.setName?.trim()!==b)continue;let a=g.get(c.version);a?.applySql||g.set(c.version,c)}let{set:h,missing:i}=(0,x.wQ)(b,[...g.values()]);if(0===h.steps.length)return void I(e?"The YTDB running on your machine is older than this page and cannot send stored SQL. Restart it with `npx @theobourgeois/ytdb@latest`.":`${b} was applied before YTDB stored SQL, so it cannot be rebuilt. Drop its folder instead.`);f(h),i.length>0&&I(`Rebuilt ${h.steps.length} of ${h.steps.length+i.length}. No SQL was stored for ${i.join(", ")}.`),a.push(`${N}/${encodeURIComponent(h.id)}`)}catch(a){I(a instanceof Error?a.message:String(a))}finally{G(null)}}let Q=(0,h.useMemo)(()=>[...c].sort((a,b)=>b.importedAt-a.importedAt),[c]),R=(0,h.useMemo)(()=>(0,s.lF)(J.map(a=>({connection:a,ledger:L.data?.[a.id]?.ledger??null})),c.map(a=>a.name)),[J,L.data,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(`${N}/${encodeURIComponent(c)}`)},children:[(0,d.jsx)(j.A,{"data-icon":"inline-start"}),"New migration"]})})]}),"history"===D?(0,d.jsx)(o.F,{className:"min-h-0 flex-1",children:(0,d.jsx)(w.H,{events:M,connections:J,loading:L.loading})}):0===c.length&&0===R.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)(y.k,{onFiles:O,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:[Q.map(a=>(0,d.jsx)(B,{set:a,href:`${N}/${encodeURIComponent(a.id)}`,environments:J.map(b=>({connection:b,summary:(0,s.eh)(a,L.data?.[b.id]?.ledger??null),read:!!L.data?.[b.id]?.ledger,error:L.data?.[b.id]?.error??null}))},a.id)),R.length>0&&(0,d.jsxs)("div",{className:"border-b bg-muted/20",children:[(0,d.jsx)("p",{className:"px-4 py-2 text-xs text-muted-foreground",children:"Run against these databases but not imported here. The SQL was stored with each one, so it can be opened without the folder."}),R.map(a=>(0,d.jsx)(C,{migration:a,busy:F===a.name,onOpen:()=>void P(a.name)},a.name)),H&&(0,d.jsx)("p",{className:"px-4 pt-1 pb-2 text-xs text-destructive",children:H})]}),(0,d.jsx)("div",{className:"p-4",children:(0,d.jsx)(y.k,{onFiles:O,compact:!0,hint:0===c.length?"Drop a folder of .sql files to start a migration.":"Drop another folder to start a new migration.",className:"w-full"})})]}),(0,d.jsx)(z.l,{caption:function(a,b){if(0===a&&0===b)return"No migrations yet";let c=[`${a} migration${1===a?"":"s"}`];return b>0&&c.push(`${b} more run against these databases but not imported here`),c.join(" \xb7 ")}(c.length,R.length),pane:D,onPaneChange:E,historyCount:M.length})]})}function B({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)(D,{environment:a},a.connection.id))}),(0,d.jsx)(k.A,{className:"size-4 shrink-0 text-muted-foreground/60"})]})}function C({migration:a,busy:b,onOpen:c}){return(0,d.jsxs)("div",{className:"flex items-center gap-3 border-t px-4 py-2.5 first:border-t-0",children:[(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)("p",{className:"truncate text-sm",children:a.name}),(0,d.jsxs)("p",{className:"truncate text-xs text-muted-foreground",children:[a.total," migration",1===a.total?"":"s",a.versions.length>0&&` \xb7 ${a.versions[0]}–${a.versions.at(-1)}`]})]}),(0,d.jsx)("div",{className:"flex shrink-0 items-center gap-1.5",children:a.applied.map(b=>(0,d.jsxs)("span",{className:"flex h-6 items-center gap-1.5 rounded-lg border border-dashed px-2 text-[11px] text-muted-foreground",children:[(0,d.jsx)("span",{className:"max-w-24 truncate",children:b.connectionName}),(0,d.jsxs)("span",{className:"tabular-nums",children:[b.count,"/",a.total]})]},b.connectionId))}),(0,d.jsx)(n.$,{size:"xs",variant:"outline",disabled:b,onClick:c,children:b?"Opening…":"Open"})]})}function D({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
+ (()=>{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")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},78585:(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},81040:(a,b,c)=>{"use strict";c.d(b,{MigrationsIndex:()=>I});var d=c(48249),e=c(2116),f=c.n(e),g=c(19099),h=c(67484),i=c(23171),j=c(30770),k=c(44231),l=c(86229),m=c(25297),n=c(82244),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(56918),y=c(65292),z=c(29613),A=c(76829),B=c(38393),C=c(78394);function D({connection:a,ledgerSchema:b,plan:c,onDone:e,onOpenChange:f}){let[g,i]=(0,h.useState)(!1),[k,l]=(0,h.useState)(null),[n,o]=(0,h.useState)(null),p=c.entries.length;async function r(){i(!0),o(null);try{l(await q.F.adopt(a.url,{ledgerSchema:b,entries:c.entries})),e()}catch(a){o(a instanceof Error?a.message:String(a))}finally{i(!1)}}return(0,d.jsx)(B.lG,{open:!0,onOpenChange:a=>!g&&f(a),children:(0,d.jsxs)(B.Cf,{className:"sm:max-w-lg",children:[(0,d.jsxs)(B.c7,{children:[(0,d.jsx)(B.L3,{children:k?`Marked ${k.recorded} as applied`:`Mark ${p} migration${1===p?"":"s"} as already applied?`}),(0,d.jsx)(B.rr,{children:(0,d.jsxs)("span",{className:"flex flex-wrap items-center gap-1.5",children:[(0,d.jsx)("span",{children:k?"Recorded on":"Records on"}),(0,d.jsx)(j.F,{connection:a}),(0,d.jsx)("span",{className:"font-medium text-foreground",children:a.name}),(0,d.jsx)("span",{className:"font-mono text-[11px]",children:(0,C.p)(a.url)})]})})]}),k?(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:k.existing>0?`${k.existing} were already in the ledger and were left as they were.`:"Every one of them was new to the ledger."}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Everything in the folder that ",a.name," has no ledger row for, across"," ",c.sets," migration",1===c.sets?"":"s",". Use this once, for a database whose schema already has these changes, so that from here on only new work shows as pending."]}),(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."})," Only the ledger on"," ",a.name," changes, in one transaction. Rows already there are not touched."]})]}),n&&(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:n}),(0,d.jsx)(B.Es,{children:k?(0,d.jsx)(m.$,{onClick:()=>f(!1),children:"Close"}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(m.$,{variant:"outline",disabled:g,onClick:()=>f(!1),children:"Cancel"}),(0,d.jsx)(m.$,{disabled:g||0===p,onClick:()=>void r(),children:g?"Marking…":`Mark as applied (${p})`})]})})]})})}var E=c(88877),F=c(90863);function G({root:a,environmentNames:b,onOpenChange:c,onSave:e}){let[f,g]=(0,h.useState)(a??""),i=f.trim(),j=i.startsWith("/")||i.startsWith("~")||/^[A-Za-z]:[\\/]/.test(i);function k(){i&&j&&(e(i),c(!1))}return(0,d.jsx)(B.lG,{open:!0,onOpenChange:c,children:(0,d.jsxs)(B.Cf,{className:"sm:max-w-lg",children:[(0,d.jsxs)(B.c7,{children:[(0,d.jsx)(B.L3,{children:"Migrations folder"}),(0,d.jsxs)(B.rr,{children:["A folder on this computer. Each folder inside it that holds .sql files is one migration, read fresh from disk every time — whatever branch is checked out is what shows. ",b.join(", ")," will all read from it."]})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsx)(F.J,{htmlFor:"repo-root",children:"Path"}),(0,d.jsx)(E.p,{id:"repo-root",value:f,placeholder:"~/code/app/src/lib/supabase/migrations",spellCheck:!1,autoComplete:"off",autoFocus:!0,"aria-invalid":i.length>0&&!j,onChange:a=>g(a.target.value),onKeyDown:a=>"Enter"===a.key&&k()}),i.length>0&&!j&&(0,d.jsx)("p",{className:"text-xs text-destructive",children:"An absolute path, or one starting with ~."})]}),(0,d.jsxs)(B.Es,{children:[a&&(0,d.jsx)(m.$,{variant:"ghost",className:"mr-auto",onClick:function(){e(null),c(!1)},children:"Stop reading from disk"}),(0,d.jsx)(m.$,{variant:"outline",onClick:()=>c(!1),children:"Cancel"}),(0,d.jsx)(m.$,{disabled:!i||!j,onClick:k,children:"Save"})]})]})})}var H=c(30904);function I(){let a=(0,g.useRouter)(),{connection:b}=(0,k.k)(),c=(0,u.jV)(a=>a.sets),e=(0,u.jV)(a=>a.createSet),f=(0,u.jV)(a=>a.adoptSet),j=(0,u.jV)(a=>a.addFiles),B=(0,u.jV)(a=>a.ledgerSchema),C=(0,u.jV)(a=>a.history),E=(0,t.gz)(b.id),[F,I]=(0,h.useState)("migrations"),[M,N]=(0,h.useState)(null),[O,P]=(0,h.useState)(null),[Q,R]=(0,h.useState)(!1),[S,T]=(0,h.useState)(!1),[U,V]=(0,h.useState)(null),W=(0,h.useMemo)(()=>[b,...E],[b,E]),X=W.map(a=>a.url).join("|"),{scope:Y,root:Z}=(0,u.ox)(b.id),$=(0,u.jV)(a=>a.setRepoRoot),_=(0,H.y)(Z),aa=(0,h.useMemo)(()=>[..._.data?.sets??[]].sort((a,b)=>b.importedAt-a.importedAt),[_.data]),ab=(0,p.Y)(`ledgers:${B}:${X}`,async a=>Object.fromEntries(await Promise.all(W.map(async b=>{try{return[b.id,{ledger:await q.F.ledger(b.url,B,a),error:null}]}catch(c){if(a.aborted)throw c;return[b.id,{ledger:null,error:c instanceof Error?c.message:String(c)}]}})))),ac=(0,h.useMemo)(()=>(0,r.x)(W.map(a=>({connection:a,ledger:ab.data?.[a.id]?.ledger??null})),C),[W,ab.data,C]),ad=`/${encodeURIComponent(b.id)}/migrations`,ae=(0,h.useCallback)(b=>{let c=e(b.name);j(c,b.files),a.push(`${ad}/${encodeURIComponent(c)}`)},[e,j,a,ad]);async function af(b){N(b),P(null);try{let c=await Promise.all(W.map(async a=>{try{return{read:await q.F.ledger(a.url,B,void 0,!0),error:null}}catch(a){return{read:null,error:a instanceof Error?a.message:String(a)}}})),d=c.find(a=>a.error);if(d?.error)return void P(d.error);let e=c.some(a=>a.read&&void 0===a.read.withSql),g=new Map;for(let{read:a}of c)for(let c of a?.entries??[]){if(c.setName.trim()!==b)continue;let a=g.get(c.version);a?.applySql||g.set(c.version,c)}let{set:h,missing:i}=(0,x.wQ)(b,[...g.values()]);if(0===h.steps.length)return void P(e?"The YTDB running on your machine is older than this page and cannot send stored SQL. Restart it with `npx @theobourgeois/ytdb@latest`.":`${b} was applied before YTDB stored SQL, so it cannot be rebuilt. Drop its folder instead.`);f(h),i.length>0&&P(`Rebuilt ${h.steps.length} of ${h.steps.length+i.length}. No SQL was stored for ${i.join(", ")}.`),a.push(`${ad}/${encodeURIComponent(h.id)}`)}catch(a){P(a instanceof Error?a.message:String(a))}finally{N(null)}}let ag=(0,h.useMemo)(()=>[...c].sort((a,b)=>b.importedAt-a.importedAt),[c]),ah=(0,h.useMemo)(()=>(0,s.lF)(W.map(a=>({connection:a,ledger:ab.data?.[a.id]?.ledger??null})),[...aa,...c].map(a=>a.name)),[W,ab.data,aa,c]),ai=(0,h.useMemo)(()=>{let a=ab.data?.[b.id]?.ledger??null,c=[],d=0;if(!a)return{sets:0,entries:c};for(let b of aa){let e=(0,s.gj)(b,(0,s.Gf)(a,b.name));if(0!==e.steps.length)for(let a of(d+=1,e.steps))c.push({setName:b.name,version:a.version,name:a.name,checksum:a.checksum,applySql:a.applySql,revertSql:a.revertSql})}return{sets:d,entries:c}},[ab.data,b.id,aa]),aj=ab.loading||_.loading,ak=0===aa.length&&0===c.length&&0===ah.length;return(0,d.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[(0,d.jsxs)(l.X,{children:[(0,d.jsx)(i.olY,{className:"size-4 shrink-0 text-muted-foreground"}),(0,d.jsx)("span",{className:"font-medium",children:"Migrations"}),Z&&(0,d.jsx)(J,{root:Z,git:_.data?.git??null,onEdit:()=>T(!0)}),(0,d.jsxs)("div",{className:"ml-auto flex items-center gap-1",children:[(0,d.jsx)(m.$,{size:"icon-sm",variant:"ghost",disabled:aj,"aria-label":"Refresh",title:Z?"Re-read the folder and every environment's ledger":"Re-read every environment's ledger",onClick:function(){ab.reload(),_.reload()},children:(0,d.jsx)(i.oS8,{className:(0,v.cn)(aj&&"animate-spin")})}),!Z&&(0,d.jsxs)(m.$,{size:"sm",variant:"ghost",onClick:()=>T(!0),children:[(0,d.jsx)(i.WzY,{"data-icon":"inline-start"}),"Read from a folder"]}),(0,d.jsxs)(m.$,{size:"sm",variant:"ghost",onClick:()=>R(!0),children:[(0,d.jsx)(i.enO,{"data-icon":"inline-start"}),"New migration"]}),Z&&(0,d.jsxs)(n.rI,{children:[(0,d.jsx)(n.ty,{render:(0,d.jsx)(m.$,{size:"icon-sm",variant:"ghost","aria-label":"More migration actions"}),className:"cursor-pointer",children:(0,d.jsx)(i.YKd,{})}),(0,d.jsxs)(n.SQ,{align:"end",className:"min-w-72",children:[(0,d.jsxs)(n._2,{disabled:aj||0===ai.entries.length,onClick:()=>V(ai),children:[(0,d.jsx)(i.nXx,{}),"Mark everything as applied on ",b.name,(0,d.jsx)("span",{className:"ml-auto pl-3 font-mono text-[11px] text-muted-foreground",children:ai.entries.length})]}),(0,d.jsx)(n.mB,{}),(0,d.jsxs)(n._2,{onClick:()=>T(!0),children:[(0,d.jsx)(i.WzY,{}),"Change folder…"]})]})]})]})]}),_.error&&(0,d.jsxs)("p",{className:"flex items-start gap-2 border-b bg-destructive/5 px-4 py-1.5 text-xs text-destructive",children:[(0,d.jsx)(i.e5t,{className:"mt-px size-3.5 shrink-0"}),(0,d.jsx)("span",{className:"min-w-0 flex-1",children:_.error}),(0,d.jsx)(m.$,{size:"xs",variant:"ghost",onClick:()=>T(!0),children:"Change folder"})]}),"history"===F?(0,d.jsx)(o.F,{className:"min-h-0 flex-1",children:(0,d.jsx)(w.H,{events:ac,connections:W,loading:ab.loading})}):ak&&Z&&_.loading?(0,d.jsxs)("p",{className:"px-4 py-6 text-sm text-muted-foreground",children:["Reading ",Z,"…"]}):ak&&Z?(0,d.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center gap-2 p-6 text-center",children:[(0,d.jsxs)("p",{className:"text-sm",children:["Nothing in ",Z," yet."]}),(0,d.jsx)("p",{className:"max-w-md text-xs text-muted-foreground",children:"Each folder inside it that holds .sql files becomes a migration here, the moment it exists on the branch you have checked out."})]}):ak?(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)(y.k,{onFiles:ae,className:"w-full max-w-xl"}),(0,d.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Or"," ",(0,d.jsx)("button",{type:"button",className:"cursor-pointer underline underline-offset-4 hover:text-foreground",onClick:()=>T(!0),children:"read straight from a folder on this computer"}),", so nothing has to be imported."]})]}):(0,d.jsxs)(o.F,{className:"min-h-0 flex-1",children:[aa.map(a=>(0,d.jsx)(K,{set:a,href:`${ad}/${encodeURIComponent(a.id)}`,environments:W.map(b=>({connection:b,summary:(0,s.eh)(a,ab.data?.[b.id]?.ledger??null),read:!!ab.data?.[b.id]?.ledger,error:ab.data?.[b.id]?.error??null}))},a.id)),ag.length>0&&Z&&(0,d.jsx)("p",{className:"border-b px-4 pt-2.5 pb-1 text-[11px] font-medium tracking-wide text-muted-foreground uppercase",title:"Imported into this browser rather than read from the folder.",children:"Imported"}),ag.map(a=>(0,d.jsx)(K,{set:a,href:`${ad}/${encodeURIComponent(a.id)}`,environments:W.map(b=>({connection:b,summary:(0,s.eh)(a,ab.data?.[b.id]?.ledger??null),read:!!ab.data?.[b.id]?.ledger,error:ab.data?.[b.id]?.error??null}))},a.id)),ah.length>0&&(0,d.jsxs)("div",{className:"border-b bg-muted/20",children:[(0,d.jsx)("p",{className:"px-4 pt-2.5 pb-1 text-[11px] font-medium tracking-wide text-muted-foreground uppercase",title:"Applied to a database from elsewhere. The SQL is kept in its ledger, so it opens without the folder.",children:"In the ledger only"}),ah.map(a=>(0,d.jsx)(L,{migration:a,busy:M===a.name,onOpen:()=>void af(a.name)},a.name)),O&&(0,d.jsx)("p",{className:"px-4 pt-1 pb-2 text-xs text-destructive",children:O})]}),!Z&&(0,d.jsx)("div",{className:"p-4",children:(0,d.jsx)(y.k,{onFiles:ae,compact:!0,className:"w-full"})})]}),(0,d.jsx)(A.l,{caption:function(a,b,c,d){if(d&&0===a)return"Reading folder…";if(0===a&&0===b&&0===c)return"No migrations yet";let e=[];return a>0&&e.push(`${a} migration${1===a?"":"s"} on disk`),b>0&&e.push(`${b} imported`),c>0&&e.push(`${c} in the ledger only`),e.join(" \xb7 ")}(aa.length,c.length,ah.length,null!==Z&&_.loading),pane:F,onPaneChange:I,historyCount:ac.length}),S&&(0,d.jsx)(G,{root:Z,environmentNames:W.map(a=>a.name),onOpenChange:T,onSave:a=>$(Y,a)}),U&&(0,d.jsx)(D,{connection:b,ledgerSchema:B,plan:U,onDone:()=>ab.reload(),onOpenChange:a=>!a&&V(null)}),(0,d.jsx)(z.K,{open:Q,title:"New migration",submitLabel:"Create",onOpenChange:R,onSubmit:function(b){let c=e(b);a.push(`${ad}/${encodeURIComponent(c)}`)}})]})}function J({root:a,git:b,onEdit:c}){var e;let f;return(0,d.jsxs)("button",{type:"button",title:`Reading from ${a}${b?` on ${b.branch} (${b.commit}${b.dirty?", uncommitted changes":""})`:""}. Click to change.`,onClick:c,className:"flex min-w-0 cursor-pointer items-center gap-1.5 rounded-md px-1.5 py-0.5 text-xs text-muted-foreground outline-none hover:bg-muted/60 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/60",children:[(0,d.jsx)(i.WzY,{className:"size-3.5 shrink-0"}),(0,d.jsx)("span",{className:"max-w-64 truncate font-mono text-[11px]",children:(f=(e=a).split(/[\/]/).filter(Boolean)).length>2?`…/${f.slice(-2).join("/")}`:e}),b&&(0,d.jsxs)("span",{className:"shrink-0 rounded border px-1.5 font-mono text-[10px]",children:[b.branch,b.dirty&&"*"]})]})}function K({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}`,a.skipped.length>0&&` \xb7 ${a.skipped.length} skipped`]})]}),(0,d.jsx)("div",{className:"flex shrink-0 items-center gap-1.5",children:c.map(a=>(0,d.jsx)(M,{environment:a},a.connection.id))}),(0,d.jsx)(i.nNJ,{className:"size-4 shrink-0 text-muted-foreground/60"})]})}function L({migration:a,busy:b,onOpen:c}){return(0,d.jsxs)("div",{className:"flex items-center gap-3 border-t px-4 py-2.5 first:border-t-0",children:[(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)("p",{className:"truncate text-sm",children:a.name}),(0,d.jsxs)("p",{className:"truncate text-xs text-muted-foreground",children:[a.total," migration",1===a.total?"":"s",a.versions.length>0&&` \xb7 ${a.versions[0]}–${a.versions.at(-1)}`]})]}),(0,d.jsx)("div",{className:"flex shrink-0 items-center gap-1.5",children:a.applied.map(b=>(0,d.jsxs)("span",{className:"flex h-6 items-center gap-1.5 rounded-lg border border-dashed px-2 text-[11px] text-muted-foreground",children:[(0,d.jsx)("span",{className:"max-w-24 truncate",children:b.connectionName}),(0,d.jsxs)("span",{className:"tabular-nums",children:[b.count,"/",a.total]})]},b.connectionId))}),(0,d.jsx)(m.$,{size:"xs",variant:"outline",disabled:b,onClick:c,children:b?"Opening…":"Open"})]})}function M({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)(j.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}`:"…"})]})}},94094:(a,b,c)=>{Promise.resolve().then(c.bind(c,81040))},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,928,566,202,421,593,729,172],()=>b(b.s=78585));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/702.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/172.js","../../../chunks/202.js","../../../chunks/421.js","../../../chunks/430.js","../../../chunks/566.js","../../../chunks/593.js","../../../chunks/729.js","../../../chunks/741.js","../../../chunks/928.js","../../../webpack-runtime.js","page_client-reference-manifest.js"]}