d1s 0.3.14 → 0.3.15

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 (96) hide show
  1. package/dist/.next/BUILD_ID +1 -1
  2. package/dist/.next/app-build-manifest.json +45 -38
  3. package/dist/.next/app-path-routes-manifest.json +10 -9
  4. package/dist/.next/build-manifest.json +2 -2
  5. package/dist/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  6. package/dist/.next/server/app/_not-found.html +1 -1
  7. package/dist/.next/server/app/_not-found.rsc +3 -3
  8. package/dist/.next/server/app/api/cloudflare/route_client-reference-manifest.js +1 -1
  9. package/dist/.next/server/app/api/databases/route_client-reference-manifest.js +1 -1
  10. package/dist/.next/server/app/api/migrations/list/route_client-reference-manifest.js +1 -1
  11. package/dist/.next/server/app/api/migrations/sync/route_client-reference-manifest.js +1 -1
  12. package/dist/.next/server/app/api/migrations/sync-files/route_client-reference-manifest.js +1 -1
  13. package/dist/.next/server/app/api/pro/route_client-reference-manifest.js +1 -1
  14. package/dist/.next/server/app/api/pull-data/confirm/route_client-reference-manifest.js +1 -1
  15. package/dist/.next/server/app/api/pull-remote/confirm/route.js +1 -1
  16. package/dist/.next/server/app/api/pull-remote/confirm/route_client-reference-manifest.js +1 -1
  17. package/dist/.next/server/app/api/pull-remote/preview/route_client-reference-manifest.js +1 -1
  18. package/dist/.next/server/app/api/push-remote/confirm/route.js +1 -1
  19. package/dist/.next/server/app/api/push-remote/confirm/route_client-reference-manifest.js +1 -1
  20. package/dist/.next/server/app/api/push-remote/preview/route_client-reference-manifest.js +1 -1
  21. package/dist/.next/server/app/api/query/route.js +2 -2
  22. package/dist/.next/server/app/api/query/route_client-reference-manifest.js +1 -1
  23. package/dist/.next/server/app/api/schema/route_client-reference-manifest.js +1 -1
  24. package/dist/.next/server/app/api/tables/[name]/import/route.js +1 -1
  25. package/dist/.next/server/app/api/tables/[name]/import/route_client-reference-manifest.js +1 -1
  26. package/dist/.next/server/app/api/tables/[name]/route.js +1 -1
  27. package/dist/.next/server/app/api/tables/[name]/route_client-reference-manifest.js +1 -1
  28. package/dist/.next/server/app/api/tables/route_client-reference-manifest.js +1 -1
  29. package/dist/.next/server/app/api/telemetry/route.js +1 -0
  30. package/dist/.next/server/app/api/telemetry/route.js.nft.json +1 -0
  31. package/dist/.next/server/app/api/telemetry/route_client-reference-manifest.js +1 -0
  32. package/dist/.next/server/app/api/time-travel/preview/route_client-reference-manifest.js +1 -1
  33. package/dist/.next/server/app/api/time-travel/restore/route.js +1 -1
  34. package/dist/.next/server/app/api/time-travel/restore/route_client-reference-manifest.js +1 -1
  35. package/dist/.next/server/app/api/update/route.js +1 -1
  36. package/dist/.next/server/app/api/update/route_client-reference-manifest.js +1 -1
  37. package/dist/.next/server/app/index.html +2 -2
  38. package/dist/.next/server/app/index.rsc +4 -4
  39. package/dist/.next/server/app/page.js +9 -9
  40. package/dist/.next/server/app/page_client-reference-manifest.js +1 -1
  41. package/dist/.next/server/app-paths-manifest.json +10 -9
  42. package/dist/.next/server/chunks/839.js +1 -1
  43. package/dist/.next/server/pages/404.html +1 -1
  44. package/dist/.next/server/pages/500.html +1 -1
  45. package/dist/.next/static/6rea5Sqo2oDOjd57AS8fa/_buildManifest.js +1 -0
  46. package/dist/.next/static/chunks/823-ef19f8100936ef91.js +1 -0
  47. package/dist/.next/static/chunks/app/api/cloudflare/route-9bf180252c95d6f8.js +1 -0
  48. package/dist/.next/static/chunks/app/api/databases/route-9bf180252c95d6f8.js +1 -0
  49. package/dist/.next/static/chunks/app/api/migrations/list/route-9bf180252c95d6f8.js +1 -0
  50. package/dist/.next/static/chunks/app/api/migrations/sync/route-9bf180252c95d6f8.js +1 -0
  51. package/dist/.next/static/chunks/app/api/migrations/sync-files/route-9bf180252c95d6f8.js +1 -0
  52. package/dist/.next/static/chunks/app/api/pro/route-9bf180252c95d6f8.js +1 -0
  53. package/dist/.next/static/chunks/app/api/pull-data/confirm/route-9bf180252c95d6f8.js +1 -0
  54. package/dist/.next/static/chunks/app/api/pull-remote/confirm/route-9bf180252c95d6f8.js +1 -0
  55. package/dist/.next/static/chunks/app/api/pull-remote/preview/route-9bf180252c95d6f8.js +1 -0
  56. package/dist/.next/static/chunks/app/api/push-remote/confirm/route-9bf180252c95d6f8.js +1 -0
  57. package/dist/.next/static/chunks/app/api/push-remote/preview/route-9bf180252c95d6f8.js +1 -0
  58. package/dist/.next/static/chunks/app/api/query/route-9bf180252c95d6f8.js +1 -0
  59. package/dist/.next/static/chunks/app/api/schema/route-9bf180252c95d6f8.js +1 -0
  60. package/dist/.next/static/chunks/app/api/tables/[name]/import/route-9bf180252c95d6f8.js +1 -0
  61. package/dist/.next/static/chunks/app/api/tables/[name]/route-9bf180252c95d6f8.js +1 -0
  62. package/dist/.next/static/chunks/app/api/tables/route-9bf180252c95d6f8.js +1 -0
  63. package/dist/.next/static/chunks/app/api/telemetry/route-9bf180252c95d6f8.js +1 -0
  64. package/dist/.next/static/chunks/app/api/time-travel/preview/route-9bf180252c95d6f8.js +1 -0
  65. package/dist/.next/static/chunks/app/api/time-travel/restore/route-9bf180252c95d6f8.js +1 -0
  66. package/dist/.next/static/chunks/app/api/update/route-9bf180252c95d6f8.js +1 -0
  67. package/dist/.next/static/chunks/app/page-5888ce6414a8151d.js +1 -0
  68. package/dist/.next/trace +3 -3
  69. package/dist/app/api/query/route.js +67 -1
  70. package/dist/app/api/telemetry/route.js +42 -0
  71. package/dist/lib/client-telemetry.js +13 -0
  72. package/dist/lib/telemetry.js +13 -8
  73. package/package.json +1 -1
  74. package/dist/.next/static/chunks/823-77b9a2d152da81dd.js +0 -1
  75. package/dist/.next/static/chunks/app/api/cloudflare/route-58aca057db1e5530.js +0 -1
  76. package/dist/.next/static/chunks/app/api/databases/route-58aca057db1e5530.js +0 -1
  77. package/dist/.next/static/chunks/app/api/migrations/list/route-58aca057db1e5530.js +0 -1
  78. package/dist/.next/static/chunks/app/api/migrations/sync/route-58aca057db1e5530.js +0 -1
  79. package/dist/.next/static/chunks/app/api/migrations/sync-files/route-58aca057db1e5530.js +0 -1
  80. package/dist/.next/static/chunks/app/api/pro/route-58aca057db1e5530.js +0 -1
  81. package/dist/.next/static/chunks/app/api/pull-data/confirm/route-58aca057db1e5530.js +0 -1
  82. package/dist/.next/static/chunks/app/api/pull-remote/confirm/route-58aca057db1e5530.js +0 -1
  83. package/dist/.next/static/chunks/app/api/pull-remote/preview/route-58aca057db1e5530.js +0 -1
  84. package/dist/.next/static/chunks/app/api/push-remote/confirm/route-58aca057db1e5530.js +0 -1
  85. package/dist/.next/static/chunks/app/api/push-remote/preview/route-58aca057db1e5530.js +0 -1
  86. package/dist/.next/static/chunks/app/api/query/route-58aca057db1e5530.js +0 -1
  87. package/dist/.next/static/chunks/app/api/schema/route-58aca057db1e5530.js +0 -1
  88. package/dist/.next/static/chunks/app/api/tables/[name]/import/route-58aca057db1e5530.js +0 -1
  89. package/dist/.next/static/chunks/app/api/tables/[name]/route-58aca057db1e5530.js +0 -1
  90. package/dist/.next/static/chunks/app/api/tables/route-58aca057db1e5530.js +0 -1
  91. package/dist/.next/static/chunks/app/api/time-travel/preview/route-58aca057db1e5530.js +0 -1
  92. package/dist/.next/static/chunks/app/api/time-travel/restore/route-58aca057db1e5530.js +0 -1
  93. package/dist/.next/static/chunks/app/api/update/route-58aca057db1e5530.js +0 -1
  94. package/dist/.next/static/chunks/app/page-5f5e2a64d451ecb1.js +0 -1
  95. package/dist/.next/static/o_MkOiVF7_eRHovqofgAP/_buildManifest.js +0 -1
  96. /package/dist/.next/static/{o_MkOiVF7_eRHovqofgAP → 6rea5Sqo2oDOjd57AS8fa}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/page"]={"moduleLoading":{"prefix":"/_next/"},"ssrModuleMapping":{"622":{"*":{"id":"82146","name":"*","chunks":[],"async":false}},"930":{"*":{"id":"32122","name":"*","chunks":[],"async":false}},"1959":{"*":{"id":"31603","name":"*","chunks":[],"async":false}},"3190":{"*":{"id":"60122","name":"*","chunks":[],"async":false}},"3886":{"*":{"id":"75170","name":"*","chunks":[],"async":false}},"4431":{"*":{"id":"12263","name":"*","chunks":[],"async":false}},"5278":{"*":{"id":"78922","name":"*","chunks":[],"async":false}},"7150":{"*":{"id":"54160","name":"*","chunks":[],"async":false}},"7747":{"*":{"id":"60673","name":"*","chunks":[],"async":false}},"7989":{"*":{"id":"68495","name":"*","chunks":[],"async":false}},"8924":{"*":{"id":"29234","name":"*","chunks":[],"async":false}},"9766":{"*":{"id":"77526","name":"*","chunks":[],"async":false}}},"edgeSSRModuleMapping":{},"clientModules":{"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/builtin/global-error.js":{"id":7150,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/builtin/global-error.js":{"id":7150,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/client-page.js":{"id":1959,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/client-page.js":{"id":1959,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/client-segment.js":{"id":7989,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/client-segment.js":{"id":7989,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/http-access-fallback/error-boundary.js":{"id":3886,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/http-access-fallback/error-boundary.js":{"id":3886,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/layout-router.js":{"id":9766,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/layout-router.js":{"id":9766,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/metadata/async-metadata.js":{"id":5278,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/metadata/async-metadata.js":{"id":5278,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/render-from-template-context.js":{"id":8924,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":8924,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/lib/framework/boundary-components.js":{"id":4431,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/lib/framework/boundary-components.js":{"id":4431,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/lib/metadata/generate/icon-mark.js":{"id":622,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/lib/metadata/generate/icon-mark.js":{"id":622,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/font/google/target.css?{\"path\":\"src/app/layout.jsx\",\"import\":\"Geist\",\"arguments\":[{\"variable\":\"--font-geist-sans\",\"subsets\":[\"latin\"]}],\"variableName\":\"geistSans\"}":{"id":5706,"name":"*","chunks":["421","static/chunks/421-55f8ce492f5bd9c3.js","654","static/chunks/654-f2f8931465d44ae7.js","823","static/chunks/823-77b9a2d152da81dd.js","177","static/chunks/app/layout-a5219438265f0b6c.js"],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/font/google/target.css?{\"path\":\"src/app/layout.jsx\",\"import\":\"Geist_Mono\",\"arguments\":[{\"variable\":\"--font-geist-mono\",\"subsets\":[\"latin\"]}],\"variableName\":\"geistMono\"}":{"id":134,"name":"*","chunks":["421","static/chunks/421-55f8ce492f5bd9c3.js","654","static/chunks/654-f2f8931465d44ae7.js","823","static/chunks/823-77b9a2d152da81dd.js","177","static/chunks/app/layout-a5219438265f0b6c.js"],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/src/app/globals.css":{"id":3673,"name":"*","chunks":["421","static/chunks/421-55f8ce492f5bd9c3.js","654","static/chunks/654-f2f8931465d44ae7.js","823","static/chunks/823-77b9a2d152da81dd.js","177","static/chunks/app/layout-a5219438265f0b6c.js"],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/src/components/ui/toaster.jsx":{"id":7747,"name":"*","chunks":["421","static/chunks/421-55f8ce492f5bd9c3.js","654","static/chunks/654-f2f8931465d44ae7.js","823","static/chunks/823-77b9a2d152da81dd.js","177","static/chunks/app/layout-a5219438265f0b6c.js"],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/src/context/database-context.js":{"id":3190,"name":"*","chunks":["421","static/chunks/421-55f8ce492f5bd9c3.js","654","static/chunks/654-f2f8931465d44ae7.js","823","static/chunks/823-77b9a2d152da81dd.js","177","static/chunks/app/layout-a5219438265f0b6c.js"],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/src/app/page.jsx":{"id":930,"name":"*","chunks":["421","static/chunks/421-55f8ce492f5bd9c3.js","69","static/chunks/69-00a70b2df83ed9ee.js","823","static/chunks/823-77b9a2d152da81dd.js","974","static/chunks/app/page-5f5e2a64d451ecb1.js"],"async":false}},"entryCSSFiles":{"/Volumes/ProjectSpace/_wip/d1studio/src/":[],"/Volumes/ProjectSpace/_wip/d1studio/src/app/layout":[{"inlined":false,"path":"static/css/262ae258bbcfd289.css"}],"/Volumes/ProjectSpace/_wip/d1studio/src/app/page":[]},"rscModuleMapping":{"622":{"*":{"id":"51384","name":"*","chunks":[],"async":false}},"930":{"*":{"id":"1905","name":"*","chunks":[],"async":false}},"1959":{"*":{"id":"23597","name":"*","chunks":[],"async":false}},"3190":{"*":{"id":"46254","name":"*","chunks":[],"async":false}},"3673":{"*":{"id":"61135","name":"*","chunks":[],"async":false}},"3886":{"*":{"id":"89748","name":"*","chunks":[],"async":false}},"4431":{"*":{"id":"73041","name":"*","chunks":[],"async":false}},"5278":{"*":{"id":"7184","name":"*","chunks":[],"async":false}},"7150":{"*":{"id":"81170","name":"*","chunks":[],"async":false}},"7747":{"*":{"id":"44158","name":"*","chunks":[],"async":false}},"7989":{"*":{"id":"36893","name":"*","chunks":[],"async":false}},"8924":{"*":{"id":"69576","name":"*","chunks":[],"async":false}},"9766":{"*":{"id":"6060","name":"*","chunks":[],"async":false}}},"edgeRscModuleMapping":{}}
1
+ globalThis.__RSC_MANIFEST=(globalThis.__RSC_MANIFEST||{});globalThis.__RSC_MANIFEST["/page"]={"moduleLoading":{"prefix":"/_next/"},"ssrModuleMapping":{"622":{"*":{"id":"82146","name":"*","chunks":[],"async":false}},"930":{"*":{"id":"32122","name":"*","chunks":[],"async":false}},"1959":{"*":{"id":"31603","name":"*","chunks":[],"async":false}},"3190":{"*":{"id":"60122","name":"*","chunks":[],"async":false}},"3886":{"*":{"id":"75170","name":"*","chunks":[],"async":false}},"4431":{"*":{"id":"12263","name":"*","chunks":[],"async":false}},"5278":{"*":{"id":"78922","name":"*","chunks":[],"async":false}},"7150":{"*":{"id":"54160","name":"*","chunks":[],"async":false}},"7747":{"*":{"id":"60673","name":"*","chunks":[],"async":false}},"7989":{"*":{"id":"68495","name":"*","chunks":[],"async":false}},"8924":{"*":{"id":"29234","name":"*","chunks":[],"async":false}},"9766":{"*":{"id":"77526","name":"*","chunks":[],"async":false}}},"edgeSSRModuleMapping":{},"clientModules":{"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/builtin/global-error.js":{"id":7150,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/builtin/global-error.js":{"id":7150,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/client-page.js":{"id":1959,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/client-page.js":{"id":1959,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/client-segment.js":{"id":7989,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/client-segment.js":{"id":7989,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/http-access-fallback/error-boundary.js":{"id":3886,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/http-access-fallback/error-boundary.js":{"id":3886,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/layout-router.js":{"id":9766,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/layout-router.js":{"id":9766,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/metadata/async-metadata.js":{"id":5278,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/metadata/async-metadata.js":{"id":5278,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/client/components/render-from-template-context.js":{"id":8924,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":8924,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/lib/framework/boundary-components.js":{"id":4431,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/lib/framework/boundary-components.js":{"id":4431,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/lib/metadata/generate/icon-mark.js":{"id":622,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/dist/esm/lib/metadata/generate/icon-mark.js":{"id":622,"name":"*","chunks":[],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/font/google/target.css?{\"path\":\"src/app/layout.jsx\",\"import\":\"Geist\",\"arguments\":[{\"variable\":\"--font-geist-sans\",\"subsets\":[\"latin\"]}],\"variableName\":\"geistSans\"}":{"id":5706,"name":"*","chunks":["421","static/chunks/421-55f8ce492f5bd9c3.js","654","static/chunks/654-f2f8931465d44ae7.js","823","static/chunks/823-ef19f8100936ef91.js","177","static/chunks/app/layout-a5219438265f0b6c.js"],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/node_modules/next/font/google/target.css?{\"path\":\"src/app/layout.jsx\",\"import\":\"Geist_Mono\",\"arguments\":[{\"variable\":\"--font-geist-mono\",\"subsets\":[\"latin\"]}],\"variableName\":\"geistMono\"}":{"id":134,"name":"*","chunks":["421","static/chunks/421-55f8ce492f5bd9c3.js","654","static/chunks/654-f2f8931465d44ae7.js","823","static/chunks/823-ef19f8100936ef91.js","177","static/chunks/app/layout-a5219438265f0b6c.js"],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/src/app/globals.css":{"id":3673,"name":"*","chunks":["421","static/chunks/421-55f8ce492f5bd9c3.js","654","static/chunks/654-f2f8931465d44ae7.js","823","static/chunks/823-ef19f8100936ef91.js","177","static/chunks/app/layout-a5219438265f0b6c.js"],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/src/components/ui/toaster.jsx":{"id":7747,"name":"*","chunks":["421","static/chunks/421-55f8ce492f5bd9c3.js","654","static/chunks/654-f2f8931465d44ae7.js","823","static/chunks/823-ef19f8100936ef91.js","177","static/chunks/app/layout-a5219438265f0b6c.js"],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/src/context/database-context.js":{"id":3190,"name":"*","chunks":["421","static/chunks/421-55f8ce492f5bd9c3.js","654","static/chunks/654-f2f8931465d44ae7.js","823","static/chunks/823-ef19f8100936ef91.js","177","static/chunks/app/layout-a5219438265f0b6c.js"],"async":false},"/Volumes/ProjectSpace/_wip/d1studio/src/app/page.jsx":{"id":930,"name":"*","chunks":["421","static/chunks/421-55f8ce492f5bd9c3.js","69","static/chunks/69-00a70b2df83ed9ee.js","823","static/chunks/823-ef19f8100936ef91.js","974","static/chunks/app/page-5888ce6414a8151d.js"],"async":false}},"entryCSSFiles":{"/Volumes/ProjectSpace/_wip/d1studio/src/":[],"/Volumes/ProjectSpace/_wip/d1studio/src/app/layout":[{"inlined":false,"path":"static/css/262ae258bbcfd289.css"}],"/Volumes/ProjectSpace/_wip/d1studio/src/app/page":[]},"rscModuleMapping":{"622":{"*":{"id":"51384","name":"*","chunks":[],"async":false}},"930":{"*":{"id":"1905","name":"*","chunks":[],"async":false}},"1959":{"*":{"id":"23597","name":"*","chunks":[],"async":false}},"3190":{"*":{"id":"46254","name":"*","chunks":[],"async":false}},"3673":{"*":{"id":"61135","name":"*","chunks":[],"async":false}},"3886":{"*":{"id":"89748","name":"*","chunks":[],"async":false}},"4431":{"*":{"id":"73041","name":"*","chunks":[],"async":false}},"5278":{"*":{"id":"7184","name":"*","chunks":[],"async":false}},"7150":{"*":{"id":"81170","name":"*","chunks":[],"async":false}},"7747":{"*":{"id":"44158","name":"*","chunks":[],"async":false}},"7989":{"*":{"id":"36893","name":"*","chunks":[],"async":false}},"8924":{"*":{"id":"69576","name":"*","chunks":[],"async":false}},"9766":{"*":{"id":"6060","name":"*","chunks":[],"async":false}}},"edgeRscModuleMapping":{}}
@@ -1,23 +1,24 @@
1
1
  {
2
2
  "/api/cloudflare/route": "app/api/cloudflare/route.js",
3
3
  "/api/databases/route": "app/api/databases/route.js",
4
- "/api/migrations/sync-files/route": "app/api/migrations/sync-files/route.js",
4
+ "/api/migrations/list/route": "app/api/migrations/list/route.js",
5
5
  "/api/migrations/sync/route": "app/api/migrations/sync/route.js",
6
- "/api/pull-data/confirm/route": "app/api/pull-data/confirm/route.js",
7
- "/_not-found/page": "app/_not-found/page.js",
8
6
  "/api/pro/route": "app/api/pro/route.js",
9
- "/api/migrations/list/route": "app/api/migrations/list/route.js",
10
- "/api/push-remote/confirm/route": "app/api/push-remote/confirm/route.js",
11
- "/api/push-remote/preview/route": "app/api/push-remote/preview/route.js",
7
+ "/api/pull-data/confirm/route": "app/api/pull-data/confirm/route.js",
8
+ "/api/migrations/sync-files/route": "app/api/migrations/sync-files/route.js",
12
9
  "/api/pull-remote/preview/route": "app/api/pull-remote/preview/route.js",
10
+ "/api/push-remote/confirm/route": "app/api/push-remote/confirm/route.js",
13
11
  "/api/query/route": "app/api/query/route.js",
12
+ "/api/push-remote/preview/route": "app/api/push-remote/preview/route.js",
14
13
  "/api/schema/route": "app/api/schema/route.js",
14
+ "/api/tables/[name]/import/route": "app/api/tables/[name]/import/route.js",
15
+ "/api/telemetry/route": "app/api/telemetry/route.js",
15
16
  "/api/tables/route": "app/api/tables/route.js",
16
17
  "/api/time-travel/preview/route": "app/api/time-travel/preview/route.js",
17
- "/api/tables/[name]/import/route": "app/api/tables/[name]/import/route.js",
18
- "/api/time-travel/restore/route": "app/api/time-travel/restore/route.js",
19
18
  "/api/update/route": "app/api/update/route.js",
20
- "/api/tables/[name]/route": "app/api/tables/[name]/route.js",
19
+ "/api/time-travel/restore/route": "app/api/time-travel/restore/route.js",
20
+ "/_not-found/page": "app/_not-found/page.js",
21
21
  "/api/pull-remote/confirm/route": "app/api/pull-remote/confirm/route.js",
22
+ "/api/tables/[name]/route": "app/api/tables/[name]/route.js",
22
23
  "/page": "app/page.js"
23
24
  }
@@ -1 +1 @@
1
- exports.id=839,exports.ids=[839],exports.modules={15988:(a,b,c)=>{Promise.resolve().then(c.bind(c,44158)),Promise.resolve().then(c.bind(c,46254))},41062:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,54160,23)),Promise.resolve().then(c.t.bind(c,31603,23)),Promise.resolve().then(c.t.bind(c,68495,23)),Promise.resolve().then(c.t.bind(c,75170,23)),Promise.resolve().then(c.t.bind(c,77526,23)),Promise.resolve().then(c.t.bind(c,78922,23)),Promise.resolve().then(c.t.bind(c,29234,23)),Promise.resolve().then(c.t.bind(c,12263,23)),Promise.resolve().then(c.bind(c,82146))},44158:(a,b,c)=>{"use strict";c.d(b,{Toaster:()=>d});let d=(0,c(97954).registerClientReference)(function(){throw Error("Attempted to call Toaster() from the server but Toaster 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.")},"/Volumes/ProjectSpace/_wip/d1studio/src/components/ui/toaster.jsx","Toaster")},46254:(a,b,c)=>{"use strict";c.d(b,{DatabaseProvider:()=>e});var d=c(97954);let e=(0,d.registerClientReference)(function(){throw Error("Attempted to call DatabaseProvider() from the server but DatabaseProvider 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.")},"/Volumes/ProjectSpace/_wip/d1studio/src/context/database-context.js","DatabaseProvider");(0,d.registerClientReference)(function(){throw Error("Attempted to call useDatabase() from the server but useDatabase 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.")},"/Volumes/ProjectSpace/_wip/d1studio/src/context/database-context.js","useDatabase")},52603:(a,b,c)=>{"use strict";c.d(b,{cn:()=>f});var d=c(43249),e=c(58829);function f(...a){return(0,e.QP)((0,d.$)(a))}},60122:(a,b,c)=>{"use strict";c.d(b,{DatabaseProvider:()=>k,t:()=>l});var d=c(21124),e=c(38301);let f=new Map;function g(a,b,c=2e3){let d=f.get(a);if(d&&Date.now()-d.timestamp<c)return d.promise;let e=b();return f.set(a,{promise:e,timestamp:Date.now()}),e.finally(()=>{setTimeout(()=>{f.delete(a)},c)}),e}let h=(0,e.createContext)(void 0);class i{constructor(){this.cache=new Map}get(a){let b=this.cache.get(a);return b||null}set(a,b,c,d){this.cache.set(a,{data:b,schema:c,meta:d,timestamp:Date.now()})}update(a,b,c,d){let e=this.cache.get(a);e&&this.cache.set(a,{data:b||e.data,schema:c||e.schema,meta:d||e.meta,timestamp:Date.now()})}invalidate(a){this.cache.delete(a)}clear(){this.cache.clear()}}class j{constructor(){this.queue=[],this.processing=!1}async add(a){return new Promise((b,c)=>{this.queue.push({operation:a,resolve:b,reject:c}),this.process()})}async process(){if(this.processing||0===this.queue.length)return;this.processing=!0;let{operation:a,resolve:b,reject:c}=this.queue.shift();try{let c=await a();b(c)}catch(a){c(a)}finally{this.processing=!1,this.process()}}}function k({children:a}){let[b,c]=(0,e.useState)([]),[f,k]=(0,e.useState)(!0),[l,m]=(0,e.useState)(null),[n,o]=(0,e.useState)([]),[p,q]=(0,e.useState)(null),[r,s]=(0,e.useState)(()=>"local");(0,e.useRef)(new j);let[t,u]=(0,e.useState)(null),v=(0,e.useRef)(new i).current,w=(0,e.useRef)(null),x=(0,e.useRef)(r),[y,z]=(0,e.useState)(null),A=(0,e.useCallback)((a,b,c=null)=>{z({type:a,message:b,detail:c,ts:new Date})},[]),[B,C]=(0,e.useState)(()=>null),D=(0,e.useCallback)(a=>{let b=a instanceof Date?a.toISOString():new Date().toISOString();localStorage.setItem("d1_last_sync",b),C(b)},[]),E=(0,e.useCallback)((a,b=1,c=50,d=x.current)=>{let e=`table-${d}-${a}-${b}-${c}`;return v.get(e)},[]),F=(0,e.useCallback)(a=>{v.cache.forEach((b,c)=>{c.startsWith("table-")&&c.includes(`-${a}-`)&&v.invalidate(c)})},[]),G=(0,e.useCallback)((a,b,c,d,e=1,f=50,g=x.current)=>{let h=`table-${g}-${a}-${e}-${f}`;v.update(h,b,c,d)},[]),H=(0,e.useCallback)(async(a,b={})=>{let c=b?.target==="remote"||b?.target==="local"?b.target:x.current,d=/^\s*(SELECT|PRAGMA|EXPLAIN)/i.test(a),e=`query-${c}-${a}`,f=async()=>{A("loading",`Executing ${c} query…`);try{let b=w.current?.database_name,d=await fetch("/api/query",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:a,target:c,...b&&{db:b}})});if(!d.ok){let a="Failed to execute query";try{let b=await d.json();a=b?.error?.message||a}catch(a){}throw Error(a)}let e=await d.json();if(!e.success)throw Error(e.error||"Query execution failed");return A("success",`${"remote"===c?"Remote":"Local"} query executed`),e}catch(a){throw A("error",a.message||"Query failed"),a||Error("An unknown error occurred")}};return d?g(e,f,1e3):f()},[A]),I=(0,e.useCallback)(async(a,b={})=>{try{let c=b?.source==="remote"||b?.source==="local"?b.source:x.current,d=`source=${encodeURIComponent(c)}`,e=await fetch(`/api/tables/${a}?${d}`),f=await e.json();if(!e.ok||!f.success)throw Error(f.error||"Failed to fetch table schema");return f.schema||[]}catch(a){throw console.error("Schema fetch error:",a),a}},[]),J=(0,e.useCallback)(async(a,b={})=>{let{forceFetch:c=!1,page:d=1,limit:e=50}=b,f=b?.source==="remote"||b?.source==="local"?b.source:x.current,h=`table-${f}-${a}-${d}-${e}`;if(!c){let a=v.get(h);if(a)return a}return g(`table-${f}-${a}-${d}-${e}`,async()=>{A("loading",`Loading ${a} (${f})…`);try{let b=w.current?.database_name,c=b?`&db=${encodeURIComponent(b)}`:"",g=`source=${encodeURIComponent(f)}`,i=await fetch(`/api/tables/${a}?page=${d}&limit=${e}&${g}${c}`,{headers:{"Cache-Control":"no-cache",Pragma:"no-cache"}});if(!i.ok)throw Error("Failed to fetch table data");let j=await i.json();if(!j.success)throw Error(j.error||"Failed to fetch table data");v.set(h,j.data,j.schema,j.meta);let k=j.data?.length||0;return A("success",`Loaded ${k} row${1!==k?"s":""} \xb7 ${a} (${f})`),j}catch(b){throw console.error("Error fetching table data:",b),A("error",b.message,`Failed loading ${a}`),b}},1e3)},[A]),K=(0,e.useCallback)(async a=>{let b=x.current;A("loading",`Refreshing ${a}…`);try{return v.cache.forEach((b,c)=>{c.startsWith("table-")&&c.includes(`-${a}-`)&&v.invalidate(c)}),await J(a,{forceFetch:!0,source:b})}catch(b){throw console.error("Error updating table data:",b),A("error",b.message,`Failed refreshing ${a}`),b}},[J,A]),L=(0,e.useCallback)(async(a,b={})=>(u(a),await J(a,b)),[J]),M=(0,e.useCallback)(async()=>{let a=w.current?.database_name||"default",b=x.current;return g(`refresh-tables-${a}-${b}`,async()=>{A("loading",`Loading tables (${b})…`),k(!0),m(null);try{let a=w.current?.database_name,d=new URLSearchParams;d.set("source",b),a&&d.set("db",a);let e=await fetch(`/api/tables?${d.toString()}`);if(!e.ok)throw Error("Failed to fetch tables");let f=await e.json();if(f.error)throw Error(f.error);let g=f.tables||[];return c(g),A("success",`${g.length} table${1!==g.length?"s":""} loaded (${b})`),g}catch(a){throw m(a.message),A("error",a.message,"Failed loading tables"),a}finally{k(!1)}},2e3)},[A]),N=(0,e.useCallback)(async a=>{let b="remote"===a?"remote":"local";if(b===x.current)return;let d=x.current;x.current=b,s(b),v.clear(),c([]),u(null),m(null);try{await M(),A("success",`Source switched to ${b}`)}catch(a){throw x.current=d,s(d),a}},[M,A]),O=(0,e.useCallback)(async a=>{A("loading","Creating table…");try{await H(a),v.clear(),await M(),A("success","Table created")}catch(a){throw A("error",a.message,"Create table failed"),Error(`Failed to create table: ${a.message}`)}},[H,M,A]),P=(0,e.useCallback)(async a=>{A("loading",`Dropping "${a}"…`);try{await H(`DROP TABLE ${a};`),v.invalidate(a),await M(),A("success",`Table "${a}" dropped`)}catch(b){throw A("error",b.message,`Drop "${a}" failed`),Error(`Failed to drop table: ${b.message}`)}},[H,M,A]),Q=(0,e.useCallback)(async a=>{A("loading","Syncing migrations…");try{let b=await fetch("/api/migrations/sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(!b.ok){let a=await b.json();throw Error(a.error?.message||"Failed to sync migrations")}let c=await b.json();return A("success","Migrations synced"),c}catch(a){throw console.error("Error syncing migrations:",a),A("error",a.message,"Migration sync failed"),a}},[A]),R=(0,e.useCallback)(async()=>{A("loading","Pulling from remote…");try{let a=localStorage.getItem("cf_credentials");if(!a)throw Error("No Cloudflare credentials found. Please connect to Cloudflare first.");let b=JSON.parse(a);if(!b.accountId||!b.apiToken)throw Error("Invalid credentials stored. Please reconnect to Cloudflare.");let c=await fetch("/api/pull-remote/confirm",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accountId:b.accountId,apiToken:b.apiToken})}),d=await c.json();if(!c.ok||!d.success)throw Error(d.error?.message||"Failed to pull from remote");v.clear(),await M();let e=d.details?.appliedMigrations?.length??0;return A("success",`Pull complete — ${e} migration${1!==e?"s":""} applied`),d}catch(a){throw console.error("Error pulling from remote:",a),A("error",a.message,"Pull from remote failed"),a}},[M,A]),S=(0,e.useCallback)(async a=>{A("loading","Pushing to remote…");try{let b=await fetch("/api/push-remote/confirm",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}),c=await b.json();if(!b.ok)throw Error(c.error?.message||"Failed to push to remote");let d=c.applied??0;return A("success",`Push complete — ${d} migration${1!==d?"s":""} applied`),c}catch(a){throw console.error("Error pushing to remote:",a),A("error",a.message,"Push to remote failed"),a}},[A]),T=(0,e.useCallback)(async a=>{let b=n.find(b=>b.database_name===a);b&&(w.current=b,q(b),v.clear(),c([]),u(null),await M())},[n,M]),U=(0,e.useMemo)(()=>({tables:b,databases:n,currentDatabase:p,sourceMode:r,setSourceMode:N,switchDatabase:T,isLoading:f,error:l,activeTable:t,lastStatus:y,setOperationStatus:A,lastSyncTime:B,setLastSyncTime:D,refreshTables:M,executeQuery:H,fetchTableSchema:I,fetchTableData:J,updateTableData:K,createTable:O,dropTable:P,syncMigrations:Q,pullFromRemote:R,pushToRemote:S,getCachedTable:E,updateTableCache:G,invalidateTable:F,switchTable:L}),[b,n,p,r,N,T,f,l,t,y,A,B,D,M,H,I,J,K,O,P,Q,R,S,E,G,F,L]);return(0,d.jsx)(h.Provider,{value:U,children:a})}function l(){let a=(0,e.useContext)(h);if(!a)throw Error("useDatabase must be used within a DatabaseProvider");return a}},60673:(a,b,c)=>{"use strict";c.d(b,{Toaster:()=>r});var d=c(21124),e=c(99728),f=c(38301),g=c(76608),h=c(26691),i=c(90447),j=c(52603);let k=g.Kq,l=f.forwardRef(({className:a,...b},c)=>(0,d.jsx)(g.LM,{ref:c,className:(0,j.cn)("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",a),...b}));l.displayName=g.LM.displayName;let m=(0,h.F)("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),n=f.forwardRef(({className:a,variant:b,...c},e)=>(0,d.jsx)(g.bL,{ref:e,className:(0,j.cn)(m({variant:b}),a),...c}));n.displayName=g.bL.displayName,f.forwardRef(({className:a,...b},c)=>(0,d.jsx)(g.rc,{ref:c,className:(0,j.cn)("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",a),...b})).displayName=g.rc.displayName;let o=f.forwardRef(({className:a,...b},c)=>(0,d.jsx)(g.bm,{ref:c,className:(0,j.cn)("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",a),"toast-close":"",...b,children:(0,d.jsx)(i.A,{className:"h-4 w-4"})}));o.displayName=g.bm.displayName;let p=f.forwardRef(({className:a,...b},c)=>(0,d.jsx)(g.hE,{ref:c,className:(0,j.cn)("text-sm font-semibold [&+div]:text-xs",a),...b}));p.displayName=g.hE.displayName;let q=f.forwardRef(({className:a,...b},c)=>(0,d.jsx)(g.VY,{ref:c,className:(0,j.cn)("text-sm opacity-90",a),...b}));function r(){let{toasts:a}=(0,e.dj)();return(0,d.jsxs)(k,{children:[a.map(function({id:a,title:b,description:c,action:e,...f}){return(0,d.jsxs)(n,{...f,children:[(0,d.jsxs)("div",{className:"grid gap-1",children:[b&&(0,d.jsx)(p,{children:b}),c&&(0,d.jsx)(q,{children:c})]}),e,(0,d.jsx)(o,{})]},a)}),(0,d.jsx)(l,{})]})}q.displayName=g.VY.displayName},61135:()=>{},61662:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>l,metadata:()=>k});var d=c(75338),e=c(66914),f=c.n(e),g=c(4580),h=c.n(g);c(61135);var i=c(46254),j=c(44158);let k={title:"d1-studio",description:"Native D1 database studio."};function l({children:a}){return(0,d.jsx)("html",{lang:"en",children:(0,d.jsx)("body",{className:`${f().variable} ${h().variable} antialiased`,children:(0,d.jsxs)(i.DatabaseProvider,{children:[a,(0,d.jsx)(j.Toaster,{})," "]})})})}},72606:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,81170,23)),Promise.resolve().then(c.t.bind(c,23597,23)),Promise.resolve().then(c.t.bind(c,36893,23)),Promise.resolve().then(c.t.bind(c,89748,23)),Promise.resolve().then(c.t.bind(c,6060,23)),Promise.resolve().then(c.t.bind(c,7184,23)),Promise.resolve().then(c.t.bind(c,69576,23)),Promise.resolve().then(c.t.bind(c,73041,23)),Promise.resolve().then(c.t.bind(c,51384,23))},92020:(a,b,c)=>{Promise.resolve().then(c.bind(c,60673)),Promise.resolve().then(c.bind(c,60122))},99728:(a,b,c)=>{"use strict";c.d(b,{dj:()=>l});var d=c(38301);let e=0,f=new Map,g=a=>{if(f.has(a))return;let b=setTimeout(()=>{f.delete(a),j({type:"REMOVE_TOAST",toastId:a})},1e6);f.set(a,b)},h=[],i={toasts:[]};function j(a){i=((a,b)=>{switch(b.type){case"ADD_TOAST":return{...a,toasts:[b.toast,...a.toasts].slice(0,1)};case"UPDATE_TOAST":return{...a,toasts:a.toasts.map(a=>a.id===b.toast.id?{...a,...b.toast}:a)};case"DISMISS_TOAST":{let{toastId:c}=b;return c?g(c):a.toasts.forEach(a=>{g(a.id)}),{...a,toasts:a.toasts.map(a=>a.id===c||void 0===c?{...a,open:!1}:a)}}case"REMOVE_TOAST":if(void 0===b.toastId)return{...a,toasts:[]};return{...a,toasts:a.toasts.filter(a=>a.id!==b.toastId)}}})(i,a),h.forEach(a=>{a(i)})}function k({...a}){let b=(e=(e+1)%Number.MAX_SAFE_INTEGER).toString(),c=()=>j({type:"DISMISS_TOAST",toastId:b});return j({type:"ADD_TOAST",toast:{...a,id:b,open:!0,onOpenChange:a=>{a||c()}}}),{id:b,dismiss:c,update:a=>j({type:"UPDATE_TOAST",toast:{...a,id:b}})}}function l(){let[a,b]=d.useState(i);return d.useEffect(()=>(h.push(b),()=>{let a=h.indexOf(b);a>-1&&h.splice(a,1)}),[a]),{...a,toast:k,dismiss:a=>j({type:"DISMISS_TOAST",toastId:a})}}}};
1
+ exports.id=839,exports.ids=[839],exports.modules={15988:(a,b,c)=>{Promise.resolve().then(c.bind(c,44158)),Promise.resolve().then(c.bind(c,46254))},41062:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,54160,23)),Promise.resolve().then(c.t.bind(c,31603,23)),Promise.resolve().then(c.t.bind(c,68495,23)),Promise.resolve().then(c.t.bind(c,75170,23)),Promise.resolve().then(c.t.bind(c,77526,23)),Promise.resolve().then(c.t.bind(c,78922,23)),Promise.resolve().then(c.t.bind(c,29234,23)),Promise.resolve().then(c.t.bind(c,12263,23)),Promise.resolve().then(c.bind(c,82146))},44158:(a,b,c)=>{"use strict";c.d(b,{Toaster:()=>d});let d=(0,c(97954).registerClientReference)(function(){throw Error("Attempted to call Toaster() from the server but Toaster 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.")},"/Volumes/ProjectSpace/_wip/d1studio/src/components/ui/toaster.jsx","Toaster")},46254:(a,b,c)=>{"use strict";c.d(b,{DatabaseProvider:()=>e});var d=c(97954);let e=(0,d.registerClientReference)(function(){throw Error("Attempted to call DatabaseProvider() from the server but DatabaseProvider 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.")},"/Volumes/ProjectSpace/_wip/d1studio/src/context/database-context.js","DatabaseProvider");(0,d.registerClientReference)(function(){throw Error("Attempted to call useDatabase() from the server but useDatabase 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.")},"/Volumes/ProjectSpace/_wip/d1studio/src/context/database-context.js","useDatabase")},52603:(a,b,c)=>{"use strict";c.d(b,{cn:()=>f});var d=c(43249),e=c(58829);function f(...a){return(0,e.QP)((0,d.$)(a))}},60122:(a,b,c)=>{"use strict";c.d(b,{DatabaseProvider:()=>l,t:()=>m});var d=c(21124),e=c(38301);let f=new Map;function g(a,b,c=2e3){let d=f.get(a);if(d&&Date.now()-d.timestamp<c)return d.promise;let e=b();return f.set(a,{promise:e,timestamp:Date.now()}),e.finally(()=>{setTimeout(()=>{f.delete(a)},c)}),e}var h=c(62869);let i=(0,e.createContext)(void 0);class j{constructor(){this.cache=new Map}get(a){let b=this.cache.get(a);return b||null}set(a,b,c,d){this.cache.set(a,{data:b,schema:c,meta:d,timestamp:Date.now()})}update(a,b,c,d){let e=this.cache.get(a);e&&this.cache.set(a,{data:b||e.data,schema:c||e.schema,meta:d||e.meta,timestamp:Date.now()})}invalidate(a){this.cache.delete(a)}clear(){this.cache.clear()}}class k{constructor(){this.queue=[],this.processing=!1}async add(a){return new Promise((b,c)=>{this.queue.push({operation:a,resolve:b,reject:c}),this.process()})}async process(){if(this.processing||0===this.queue.length)return;this.processing=!0;let{operation:a,resolve:b,reject:c}=this.queue.shift();try{let c=await a();b(c)}catch(a){c(a)}finally{this.processing=!1,this.process()}}}function l({children:a}){let[b,c]=(0,e.useState)([]),[f,l]=(0,e.useState)(!0),[m,n]=(0,e.useState)(null),[o,p]=(0,e.useState)([]),[q,r]=(0,e.useState)(null),[s,t]=(0,e.useState)(()=>"local");(0,e.useRef)(new k);let[u,v]=(0,e.useState)(null),w=(0,e.useRef)(new j).current,x=(0,e.useRef)(null),y=(0,e.useRef)(s),[z,A]=(0,e.useState)(null),B=(0,e.useCallback)((a,b,c=null)=>{A({type:a,message:b,detail:c,ts:new Date})},[]),[C,D]=(0,e.useState)(()=>null),E=(0,e.useCallback)(a=>{let b=a instanceof Date?a.toISOString():new Date().toISOString();localStorage.setItem("d1_last_sync",b),D(b)},[]),F=(0,e.useCallback)((a,b=1,c=50,d=y.current)=>{let e=`table-${d}-${a}-${b}-${c}`;return w.get(e)},[]),G=(0,e.useCallback)(a=>{w.cache.forEach((b,c)=>{c.startsWith("table-")&&c.includes(`-${a}-`)&&w.invalidate(c)})},[]),H=(0,e.useCallback)((a,b,c,d,e=1,f=50,g=y.current)=>{let h=`table-${g}-${a}-${e}-${f}`;w.update(h,b,c,d)},[]),I=(0,e.useCallback)(async(a,b={})=>{let c=b?.target==="remote"||b?.target==="local"?b.target:y.current,d=b?.telemetryContext&&"object"==typeof b.telemetryContext?b.telemetryContext:null,e=/^\s*(SELECT|PRAGMA|EXPLAIN)/i.test(a),f=`query-${c}-${a}`,h=async()=>{B("loading",`Executing ${c} query…`);try{let b=x.current?.database_name,e=await fetch("/api/query",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:a,target:c,...b&&{db:b},...d?{telemetryContext:d}:{}})});if(!e.ok){let a="Failed to execute query";try{let b=await e.json();a=b?.error?.message||a}catch(a){}throw Error(a)}let f=await e.json();if(!f.success)throw Error(f.error||"Query execution failed");return B("success",`${"remote"===c?"Remote":"Local"} query executed`),f}catch(a){throw B("error",a.message||"Query failed"),a||Error("An unknown error occurred")}};return e?g(f,h,1e3):h()},[B]),J=(0,e.useCallback)(async(a,b={})=>{try{let c=b?.source==="remote"||b?.source==="local"?b.source:y.current,d=`source=${encodeURIComponent(c)}`,e=await fetch(`/api/tables/${a}?${d}`),f=await e.json();if(!e.ok||!f.success)throw Error(f.error||"Failed to fetch table schema");return f.schema||[]}catch(a){throw console.error("Schema fetch error:",a),a}},[]),K=(0,e.useCallback)(async(a,b={})=>{let{forceFetch:c=!1,page:d=1,limit:e=50}=b,f=b?.source==="remote"||b?.source==="local"?b.source:y.current,h=`table-${f}-${a}-${d}-${e}`;if(!c){let a=w.get(h);if(a)return a}return g(`table-${f}-${a}-${d}-${e}`,async()=>{B("loading",`Loading ${a} (${f})…`);try{let b=x.current?.database_name,c=b?`&db=${encodeURIComponent(b)}`:"",g=`source=${encodeURIComponent(f)}`,i=await fetch(`/api/tables/${a}?page=${d}&limit=${e}&${g}${c}`,{headers:{"Cache-Control":"no-cache",Pragma:"no-cache"}});if(!i.ok)throw Error("Failed to fetch table data");let j=await i.json();if(!j.success)throw Error(j.error||"Failed to fetch table data");w.set(h,j.data,j.schema,j.meta);let k=j.data?.length||0;return B("success",`Loaded ${k} row${1!==k?"s":""} \xb7 ${a} (${f})`),j}catch(b){throw console.error("Error fetching table data:",b),B("error",b.message,`Failed loading ${a}`),b}},1e3)},[B]),L=(0,e.useCallback)(async a=>{let b=y.current;B("loading",`Refreshing ${a}…`);try{return w.cache.forEach((b,c)=>{c.startsWith("table-")&&c.includes(`-${a}-`)&&w.invalidate(c)}),await K(a,{forceFetch:!0,source:b})}catch(b){throw console.error("Error updating table data:",b),B("error",b.message,`Failed refreshing ${a}`),b}},[K,B]),M=(0,e.useCallback)(async(a,b={})=>(v(a),await K(a,b)),[K]),N=(0,e.useCallback)(async()=>{let a=x.current?.database_name||"default",b=y.current;return g(`refresh-tables-${a}-${b}`,async()=>{B("loading",`Loading tables (${b})…`),l(!0),n(null);try{let a=x.current?.database_name,d=new URLSearchParams;d.set("source",b),a&&d.set("db",a);let e=await fetch(`/api/tables?${d.toString()}`);if(!e.ok)throw Error("Failed to fetch tables");let f=await e.json();if(f.error)throw Error(f.error);let g=f.tables||[];return c(g),B("success",`${g.length} table${1!==g.length?"s":""} loaded (${b})`),g}catch(a){throw n(a.message),B("error",a.message,"Failed loading tables"),a}finally{l(!1)}},2e3)},[B]),O=(0,e.useCallback)(async a=>{let b="remote"===a?"remote":"local";if(b===y.current)return;let d=y.current;y.current=b,t(b),w.clear(),c([]),v(null),n(null);try{await N(),B("success",`Source switched to ${b}`),(0,h.w)("source_mode_switched",{from:d,to:b})}catch(a){throw y.current=d,t(d),a}},[N,B]),P=(0,e.useCallback)(async a=>{B("loading","Creating table…");try{await I(a),w.clear(),await N(),B("success","Table created")}catch(a){throw B("error",a.message,"Create table failed"),Error(`Failed to create table: ${a.message}`)}},[I,N,B]),Q=(0,e.useCallback)(async a=>{B("loading",`Dropping "${a}"…`);try{await I(`DROP TABLE ${a};`),w.invalidate(a),await N(),B("success",`Table "${a}" dropped`)}catch(b){throw B("error",b.message,`Drop "${a}" failed`),Error(`Failed to drop table: ${b.message}`)}},[I,N,B]),R=(0,e.useCallback)(async a=>{B("loading","Syncing migrations…");try{let b=await fetch("/api/migrations/sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(!b.ok){let a=await b.json();throw Error(a.error?.message||"Failed to sync migrations")}let c=await b.json();return B("success","Migrations synced"),c}catch(a){throw console.error("Error syncing migrations:",a),B("error",a.message,"Migration sync failed"),a}},[B]),S=(0,e.useCallback)(async()=>{B("loading","Pulling from remote…");try{let a=localStorage.getItem("cf_credentials");if(!a)throw Error("No Cloudflare credentials found. Please connect to Cloudflare first.");let b=JSON.parse(a);if(!b.accountId||!b.apiToken)throw Error("Invalid credentials stored. Please reconnect to Cloudflare.");let c=await fetch("/api/pull-remote/confirm",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accountId:b.accountId,apiToken:b.apiToken})}),d=await c.json();if(!c.ok||!d.success)throw Error(d.error?.message||"Failed to pull from remote");w.clear(),await N();let e=d.details?.appliedMigrations?.length??0;return B("success",`Pull complete — ${e} migration${1!==e?"s":""} applied`),d}catch(a){throw console.error("Error pulling from remote:",a),B("error",a.message,"Pull from remote failed"),a}},[N,B]),T=(0,e.useCallback)(async a=>{B("loading","Pushing to remote…");try{let b=await fetch("/api/push-remote/confirm",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}),c=await b.json();if(!b.ok)throw Error(c.error?.message||"Failed to push to remote");let d=c.applied??0;return B("success",`Push complete — ${d} migration${1!==d?"s":""} applied`),c}catch(a){throw console.error("Error pushing to remote:",a),B("error",a.message,"Push to remote failed"),a}},[B]),U=(0,e.useCallback)(async a=>{let b=o.find(b=>b.database_name===a);if(!b)return;let d=x.current?.database_name||"";x.current=b,r(b),w.clear(),c([]),v(null),await N(),(0,h.w)("database_switched",{from:d,to:b.database_name})},[o,N]),V=(0,e.useMemo)(()=>({tables:b,databases:o,currentDatabase:q,sourceMode:s,setSourceMode:O,switchDatabase:U,isLoading:f,error:m,activeTable:u,lastStatus:z,setOperationStatus:B,lastSyncTime:C,setLastSyncTime:E,refreshTables:N,executeQuery:I,fetchTableSchema:J,fetchTableData:K,updateTableData:L,createTable:P,dropTable:Q,syncMigrations:R,pullFromRemote:S,pushToRemote:T,getCachedTable:F,updateTableCache:H,invalidateTable:G,switchTable:M}),[b,o,q,s,O,U,f,m,u,z,B,C,E,N,I,J,K,L,P,Q,R,S,T,F,H,G,M]);return(0,d.jsx)(i.Provider,{value:V,children:a})}function m(){let a=(0,e.useContext)(i);if(!a)throw Error("useDatabase must be used within a DatabaseProvider");return a}},60673:(a,b,c)=>{"use strict";c.d(b,{Toaster:()=>r});var d=c(21124),e=c(99728),f=c(38301),g=c(76608),h=c(26691),i=c(90447),j=c(52603);let k=g.Kq,l=f.forwardRef(({className:a,...b},c)=>(0,d.jsx)(g.LM,{ref:c,className:(0,j.cn)("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",a),...b}));l.displayName=g.LM.displayName;let m=(0,h.F)("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),n=f.forwardRef(({className:a,variant:b,...c},e)=>(0,d.jsx)(g.bL,{ref:e,className:(0,j.cn)(m({variant:b}),a),...c}));n.displayName=g.bL.displayName,f.forwardRef(({className:a,...b},c)=>(0,d.jsx)(g.rc,{ref:c,className:(0,j.cn)("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",a),...b})).displayName=g.rc.displayName;let o=f.forwardRef(({className:a,...b},c)=>(0,d.jsx)(g.bm,{ref:c,className:(0,j.cn)("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",a),"toast-close":"",...b,children:(0,d.jsx)(i.A,{className:"h-4 w-4"})}));o.displayName=g.bm.displayName;let p=f.forwardRef(({className:a,...b},c)=>(0,d.jsx)(g.hE,{ref:c,className:(0,j.cn)("text-sm font-semibold [&+div]:text-xs",a),...b}));p.displayName=g.hE.displayName;let q=f.forwardRef(({className:a,...b},c)=>(0,d.jsx)(g.VY,{ref:c,className:(0,j.cn)("text-sm opacity-90",a),...b}));function r(){let{toasts:a}=(0,e.dj)();return(0,d.jsxs)(k,{children:[a.map(function({id:a,title:b,description:c,action:e,...f}){return(0,d.jsxs)(n,{...f,children:[(0,d.jsxs)("div",{className:"grid gap-1",children:[b&&(0,d.jsx)(p,{children:b}),c&&(0,d.jsx)(q,{children:c})]}),e,(0,d.jsx)(o,{})]},a)}),(0,d.jsx)(l,{})]})}q.displayName=g.VY.displayName},61135:()=>{},61662:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>l,metadata:()=>k});var d=c(75338),e=c(66914),f=c.n(e),g=c(4580),h=c.n(g);c(61135);var i=c(46254),j=c(44158);let k={title:"d1-studio",description:"Native D1 database studio."};function l({children:a}){return(0,d.jsx)("html",{lang:"en",children:(0,d.jsx)("body",{className:`${f().variable} ${h().variable} antialiased`,children:(0,d.jsxs)(i.DatabaseProvider,{children:[a,(0,d.jsx)(j.Toaster,{})," "]})})})}},62869:(a,b,c)=>{"use strict";async function d(a,b=null){if(a&&"string"==typeof a)try{await fetch("/api/telemetry",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({event:a,...b&&"object"==typeof b?{properties:b}:{}})})}catch{}}c.d(b,{w:()=>d})},72606:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,81170,23)),Promise.resolve().then(c.t.bind(c,23597,23)),Promise.resolve().then(c.t.bind(c,36893,23)),Promise.resolve().then(c.t.bind(c,89748,23)),Promise.resolve().then(c.t.bind(c,6060,23)),Promise.resolve().then(c.t.bind(c,7184,23)),Promise.resolve().then(c.t.bind(c,69576,23)),Promise.resolve().then(c.t.bind(c,73041,23)),Promise.resolve().then(c.t.bind(c,51384,23))},92020:(a,b,c)=>{Promise.resolve().then(c.bind(c,60673)),Promise.resolve().then(c.bind(c,60122))},99728:(a,b,c)=>{"use strict";c.d(b,{dj:()=>l});var d=c(38301);let e=0,f=new Map,g=a=>{if(f.has(a))return;let b=setTimeout(()=>{f.delete(a),j({type:"REMOVE_TOAST",toastId:a})},1e6);f.set(a,b)},h=[],i={toasts:[]};function j(a){i=((a,b)=>{switch(b.type){case"ADD_TOAST":return{...a,toasts:[b.toast,...a.toasts].slice(0,1)};case"UPDATE_TOAST":return{...a,toasts:a.toasts.map(a=>a.id===b.toast.id?{...a,...b.toast}:a)};case"DISMISS_TOAST":{let{toastId:c}=b;return c?g(c):a.toasts.forEach(a=>{g(a.id)}),{...a,toasts:a.toasts.map(a=>a.id===c||void 0===c?{...a,open:!1}:a)}}case"REMOVE_TOAST":if(void 0===b.toastId)return{...a,toasts:[]};return{...a,toasts:a.toasts.filter(a=>a.id!==b.toastId)}}})(i,a),h.forEach(a=>{a(i)})}function k({...a}){let b=(e=(e+1)%Number.MAX_SAFE_INTEGER).toString(),c=()=>j({type:"DISMISS_TOAST",toastId:b});return j({type:"ADD_TOAST",toast:{...a,id:b,open:!0,onOpenChange:a=>{a||c()}}}),{id:b,dismiss:c,update:a=>j({type:"UPDATE_TOAST",toast:{...a,id:b}})}}function l(){let[a,b]=d.useState(i);return d.useEffect(()=>(h.push(b),()=>{let a=h.indexOf(b);a>-1&&h.splice(a,1)}),[a]),{...a,toast:k,dismiss:a=>j({type:"DISMISS_TOAST",toastId:a})}}}};
@@ -1 +1 @@
1
- <!DOCTYPE html><!--o_MkOiVF7_eRHovqofgAP--><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" href="/_next/static/media/4cf2300e9c8272f7-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/93f479601ee12b01-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="stylesheet" href="/_next/static/css/262ae258bbcfd289.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-d5e8b5757f0fec83.js"/><script src="/_next/static/chunks/4bd1b696-c023c6e3521b1417.js" async=""></script><script src="/_next/static/chunks/255-4f212684648fcab9.js" async=""></script><script src="/_next/static/chunks/main-app-d20e9d5e211da7c8.js" async=""></script><script src="/_next/static/chunks/421-55f8ce492f5bd9c3.js" async=""></script><script src="/_next/static/chunks/654-f2f8931465d44ae7.js" async=""></script><script src="/_next/static/chunks/823-77b9a2d152da81dd.js" async=""></script><script src="/_next/static/chunks/app/layout-a5219438265f0b6c.js" async=""></script><meta name="robots" content="noindex"/><meta name="next-size-adjust" content=""/><title>404: This page could not be found.</title><title>d1-studio</title><meta name="description" content="Native D1 database studio."/><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body class="__variable_188709 __variable_9a8899 antialiased"><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--><div role="region" aria-label="Notifications (F8)" tabindex="-1" style="pointer-events:none"><ol tabindex="-1" class="fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]"></ol></div> <script src="/_next/static/chunks/webpack-d5e8b5757f0fec83.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[3190,[\"421\",\"static/chunks/421-55f8ce492f5bd9c3.js\",\"654\",\"static/chunks/654-f2f8931465d44ae7.js\",\"823\",\"static/chunks/823-77b9a2d152da81dd.js\",\"177\",\"static/chunks/app/layout-a5219438265f0b6c.js\"],\"DatabaseProvider\"]\n3:I[9766,[],\"\"]\n4:I[8924,[],\"\"]\n5:I[7747,[\"421\",\"static/chunks/421-55f8ce492f5bd9c3.js\",\"654\",\"static/chunks/654-f2f8931465d44ae7.js\",\"823\",\"static/chunks/823-77b9a2d152da81dd.js\",\"177\",\"static/chunks/app/layout-a5219438265f0b6c.js\"],\"Toaster\"]\n6:I[4431,[],\"OutletBoundary\"]\n8:I[5278,[],\"AsyncMetadataOutlet\"]\na:I[4431,[],\"ViewportBoundary\"]\nc:I[4431,[],\"MetadataBoundary\"]\nd:\"$Sreact.suspense\"\nf:I[7150,[],\"\"]\n:HL[\"/_next/static/media/4cf2300e9c8272f7-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n:HL[\"/_next/static/media/93f479601ee12b01-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n:HL[\"/_next/static/css/262ae258bbcfd289.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"o_MkOiVF7_eRHovqofgAP\",\"p\":\"\",\"c\":[\"\",\"_not-found\"],\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[\"\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/262ae258bbcfd289.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[\"$\",\"body\",null,{\"className\":\"__variable_188709 __variable_9a8899 antialiased\",\"children\":[\"$\",\"$L2\",null,{\"children\":[[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}],[\"$\",\"$L5\",null,{}],\" \"]}]}]}]]}],{\"children\":[\"/_not-found\",[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[\"__PAGE__\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$L6\",null,{\"children\":[\"$L7\",[\"$\",\"$L8\",null,{\"promise\":\"$@9\"}]]}]]}],{},null,false]},null,false]},null,false],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[[\"$\",\"$La\",null,{\"children\":\"$Lb\"}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]],[\"$\",\"$Lc\",null,{\"children\":[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$d\",null,{\"fallback\":null,\"children\":\"$Le\"}]}]}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$f\",[]],\"s\":false,\"S\":true}\n"])</script><script>self.__next_f.push([1,"b:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n7:null\n"])</script><script>self.__next_f.push([1,"9:{\"metadata\":[[\"$\",\"title\",\"0\",{\"children\":\"d1-studio\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Native D1 database studio.\"}]],\"error\":null,\"digest\":\"$undefined\"}\n"])</script><script>self.__next_f.push([1,"e:\"$9:metadata\"\n"])</script></body></html>
1
+ <!DOCTYPE html><!--6rea5Sqo2oDOjd57AS8fa--><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" href="/_next/static/media/4cf2300e9c8272f7-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="preload" href="/_next/static/media/93f479601ee12b01-s.p.woff2" as="font" crossorigin="" type="font/woff2"/><link rel="stylesheet" href="/_next/static/css/262ae258bbcfd289.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-d5e8b5757f0fec83.js"/><script src="/_next/static/chunks/4bd1b696-c023c6e3521b1417.js" async=""></script><script src="/_next/static/chunks/255-4f212684648fcab9.js" async=""></script><script src="/_next/static/chunks/main-app-d20e9d5e211da7c8.js" async=""></script><script src="/_next/static/chunks/421-55f8ce492f5bd9c3.js" async=""></script><script src="/_next/static/chunks/654-f2f8931465d44ae7.js" async=""></script><script src="/_next/static/chunks/823-ef19f8100936ef91.js" async=""></script><script src="/_next/static/chunks/app/layout-a5219438265f0b6c.js" async=""></script><meta name="robots" content="noindex"/><meta name="next-size-adjust" content=""/><title>404: This page could not be found.</title><title>d1-studio</title><meta name="description" content="Native D1 database studio."/><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body class="__variable_188709 __variable_9a8899 antialiased"><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--><div role="region" aria-label="Notifications (F8)" tabindex="-1" style="pointer-events:none"><ol tabindex="-1" class="fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]"></ol></div> <script src="/_next/static/chunks/webpack-d5e8b5757f0fec83.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[3190,[\"421\",\"static/chunks/421-55f8ce492f5bd9c3.js\",\"654\",\"static/chunks/654-f2f8931465d44ae7.js\",\"823\",\"static/chunks/823-ef19f8100936ef91.js\",\"177\",\"static/chunks/app/layout-a5219438265f0b6c.js\"],\"DatabaseProvider\"]\n3:I[9766,[],\"\"]\n4:I[8924,[],\"\"]\n5:I[7747,[\"421\",\"static/chunks/421-55f8ce492f5bd9c3.js\",\"654\",\"static/chunks/654-f2f8931465d44ae7.js\",\"823\",\"static/chunks/823-ef19f8100936ef91.js\",\"177\",\"static/chunks/app/layout-a5219438265f0b6c.js\"],\"Toaster\"]\n6:I[4431,[],\"OutletBoundary\"]\n8:I[5278,[],\"AsyncMetadataOutlet\"]\na:I[4431,[],\"ViewportBoundary\"]\nc:I[4431,[],\"MetadataBoundary\"]\nd:\"$Sreact.suspense\"\nf:I[7150,[],\"\"]\n:HL[\"/_next/static/media/4cf2300e9c8272f7-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n:HL[\"/_next/static/media/93f479601ee12b01-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n:HL[\"/_next/static/css/262ae258bbcfd289.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"6rea5Sqo2oDOjd57AS8fa\",\"p\":\"\",\"c\":[\"\",\"_not-found\"],\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[\"\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/262ae258bbcfd289.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[\"$\",\"body\",null,{\"className\":\"__variable_188709 __variable_9a8899 antialiased\",\"children\":[\"$\",\"$L2\",null,{\"children\":[[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}],[\"$\",\"$L5\",null,{}],\" \"]}]}]}]]}],{\"children\":[\"/_not-found\",[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[\"__PAGE__\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$L6\",null,{\"children\":[\"$L7\",[\"$\",\"$L8\",null,{\"promise\":\"$@9\"}]]}]]}],{},null,false]},null,false]},null,false],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[[\"$\",\"$La\",null,{\"children\":\"$Lb\"}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]],[\"$\",\"$Lc\",null,{\"children\":[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$d\",null,{\"fallback\":null,\"children\":\"$Le\"}]}]}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$f\",[]],\"s\":false,\"S\":true}\n"])</script><script>self.__next_f.push([1,"b:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n7:null\n"])</script><script>self.__next_f.push([1,"9:{\"metadata\":[[\"$\",\"title\",\"0\",{\"children\":\"d1-studio\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Native D1 database studio.\"}]],\"error\":null,\"digest\":\"$undefined\"}\n"])</script><script>self.__next_f.push([1,"e:\"$9:metadata\"\n"])</script></body></html>
@@ -1 +1 @@
1
- <!DOCTYPE html><html><head><meta charSet="utf-8" data-next-head=""/><meta name="viewport" content="width=device-width" data-next-head=""/><title data-next-head="">500: Internal Server Error</title><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-d5e8b5757f0fec83.js" defer=""></script><script src="/_next/static/chunks/framework-a6e0b7e30f98059a.js" defer=""></script><script src="/_next/static/chunks/main-0bd218f776705cbf.js" defer=""></script><script src="/_next/static/chunks/pages/_app-7d307437aca18ad4.js" defer=""></script><script src="/_next/static/chunks/pages/_error-cb2a52f75f2162e2.js" defer=""></script><script src="/_next/static/o_MkOiVF7_eRHovqofgAP/_buildManifest.js" defer=""></script><script src="/_next/static/o_MkOiVF7_eRHovqofgAP/_ssgManifest.js" defer=""></script></head><body><div id="__next"><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">500</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">Internal Server Error<!-- -->.</h2></div></div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":500}},"page":"/_error","query":{},"buildId":"o_MkOiVF7_eRHovqofgAP","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
1
+ <!DOCTYPE html><html><head><meta charSet="utf-8" data-next-head=""/><meta name="viewport" content="width=device-width" data-next-head=""/><title data-next-head="">500: Internal Server Error</title><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-d5e8b5757f0fec83.js" defer=""></script><script src="/_next/static/chunks/framework-a6e0b7e30f98059a.js" defer=""></script><script src="/_next/static/chunks/main-0bd218f776705cbf.js" defer=""></script><script src="/_next/static/chunks/pages/_app-7d307437aca18ad4.js" defer=""></script><script src="/_next/static/chunks/pages/_error-cb2a52f75f2162e2.js" defer=""></script><script src="/_next/static/6rea5Sqo2oDOjd57AS8fa/_buildManifest.js" defer=""></script><script src="/_next/static/6rea5Sqo2oDOjd57AS8fa/_ssgManifest.js" defer=""></script></head><body><div id="__next"><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">500</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">Internal Server Error<!-- -->.</h2></div></div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":500}},"page":"/_error","query":{},"buildId":"6rea5Sqo2oDOjd57AS8fa","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
@@ -0,0 +1 @@
1
+ self.__BUILD_MANIFEST=function(e,r,t,_,s){return{__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},__routerFilterStatic:{numItems:20,errorRate:1e-4,numBits:384,numHashes:14,bitArray:[0,0,r,r,1,r,r,r,r,1,e,e,e,e,r,r,e,e,e,r,e,e,e,r,r,r,r,e,e,r,e,e,r,r,e,r,r,e,r,r,r,e,e,r,e,r,r,e,e,r,r,r,r,e,e,r,e,e,e,r,e,e,r,r,r,e,e,e,e,r,r,e,e,r,r,e,r,r,e,r,r,e,r,e,e,e,r,e,e,e,r,e,e,r,r,e,r,e,e,e,r,e,r,e,e,r,e,r,e,r,r,r,e,e,r,e,e,r,e,e,e,e,e,e,e,r,e,r,e,r,e,r,r,r,e,e,e,r,e,r,r,e,e,r,r,r,r,e,e,r,r,e,r,r,e,r,e,e,e,e,r,r,r,e,r,e,r,e,r,r,e,e,r,r,e,e,r,e,e,r,e,r,r,r,e,r,e,e,e,e,e,r,e,r,r,e,e,e,r,r,e,e,e,e,r,e,r,e,e,e,e,e,r,e,e,e,e,r,e,e,r,r,r,e,e,e,r,r,e,e,e,e,e,e,e,e,e,r,e,e,r,r,e,r,e,r,e,e,e,e,e,e,e,e,r,r,e,r,r,r,e,e,e,e,e,e,e,r,r,e,e,r,r,e,r,r,r,r,r,r,r,r,e,r,r,e,r,e,e,r,r,e,r,e,r,r,r,e,e,r,e,r,r,r,e,e,e,e,e,r,e,r,r,e,r,e,r,r,e,r,e,e,e,r,r,r,e,r,r,e,e,e,e,e,e,r,r,e,r,r,r,r,r,e,e,e,r,e,e,r,e,e,r,r,r,e,e,e,r,e,r,e,e,r,r,r,e,r,r,r,e,e,e,r,e,r,r,r,e,r,r,e,r,e]},__routerFilterDynamic:{numItems:e,errorRate:1e-4,numBits:20,numHashes:14,bitArray:[e,r,r,e,r,e,e,r,e,e,e,r,r,r,r,e,e,e,e,e]},"/_error":["static/chunks/pages/_error-cb2a52f75f2162e2.js"],sortedPages:["/_app","/_error"]}}(1,0,20,1e-4,14),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB();
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[823],{1374:(e,t,a)=>{a.d(t,{dj:()=>d});var r=a(2115);let o=0,c=new Map,n=e=>{if(c.has(e))return;let t=setTimeout(()=>{c.delete(e),i({type:"REMOVE_TOAST",toastId:e})},1e6);c.set(e,t)},s=[],l={toasts:[]};function i(e){l=((e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,1)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e)};case"DISMISS_TOAST":{let{toastId:a}=t;return a?n(a):e.toasts.forEach(e=>{n(e.id)}),{...e,toasts:e.toasts.map(e=>e.id===a||void 0===a?{...e,open:!1}:e)}}case"REMOVE_TOAST":if(void 0===t.toastId)return{...e,toasts:[]};return{...e,toasts:e.toasts.filter(e=>e.id!==t.toastId)}}})(l,e),s.forEach(e=>{e(l)})}function u(e){let{...t}=e,a=(o=(o+1)%Number.MAX_SAFE_INTEGER).toString(),r=()=>i({type:"DISMISS_TOAST",toastId:a});return i({type:"ADD_TOAST",toast:{...t,id:a,open:!0,onOpenChange:e=>{e||r()}}}),{id:a,dismiss:r,update:e=>i({type:"UPDATE_TOAST",toast:{...e,id:a}})}}function d(){let[e,t]=r.useState(l);return r.useEffect(()=>(s.push(t),()=>{let e=s.indexOf(t);e>-1&&s.splice(e,1)}),[e]),{...e,toast:u,dismiss:e=>i({type:"DISMISS_TOAST",toastId:e})}}},3190:(e,t,a)=>{a.d(t,{DatabaseProvider:()=>d,t:()=>h});var r=a(5155),o=a(2115);let c=new Map;function n(e,t){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2e3,r=c.get(e);if(r&&Date.now()-r.timestamp<a)return r.promise;let o=t();return c.set(e,{promise:o,timestamp:Date.now()}),o.finally(()=>{setTimeout(()=>{c.delete(e)},a)}),o}var s=a(9533);let l=(0,o.createContext)(void 0);class i{get(e){let t=this.cache.get(e);return t||null}set(e,t,a,r){this.cache.set(e,{data:t,schema:a,meta:r,timestamp:Date.now()})}update(e,t,a,r){let o=this.cache.get(e);o&&this.cache.set(e,{data:t||o.data,schema:a||o.schema,meta:r||o.meta,timestamp:Date.now()})}invalidate(e){this.cache.delete(e)}clear(){this.cache.clear()}constructor(){this.cache=new Map}}class u{async add(e){return new Promise((t,a)=>{this.queue.push({operation:e,resolve:t,reject:a}),this.process()})}async process(){if(this.processing||0===this.queue.length)return;this.processing=!0;let{operation:e,resolve:t,reject:a}=this.queue.shift();try{let a=await e();t(a)}catch(e){a(e)}finally{this.processing=!1,this.process()}}constructor(){this.queue=[],this.processing=!1}}function d(e){let{children:t}=e,[a,c]=(0,o.useState)([]),[d,h]=(0,o.useState)(!0),[f,m]=(0,o.useState)(null),[g,p]=(0,o.useState)([]),[y,w]=(0,o.useState)(null),[b,v]=(0,o.useState)(()=>"remote"===localStorage.getItem("d1_source_mode")?"remote":"local");(0,o.useRef)(new u);let[S,E]=(0,o.useState)(null),C=(0,o.useRef)(new i).current,T=(0,o.useRef)(null),k=(0,o.useRef)(b),[_,O]=(0,o.useState)(null),I=(0,o.useCallback)(function(e,t){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;O({type:e,message:t,detail:a,ts:new Date})},[]),[P,D]=(0,o.useState)(()=>localStorage.getItem("d1_last_sync")||null),A=(0,o.useCallback)(e=>{let t=e instanceof Date?e.toISOString():new Date().toISOString();localStorage.setItem("d1_last_sync",t),D(t)},[]);(0,o.useEffect)(()=>{k.current=b,localStorage.setItem("d1_source_mode",b)},[b]);let j=(0,o.useCallback)(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:50,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:k.current,o="table-".concat(r,"-").concat(e,"-").concat(t,"-").concat(a);return C.get(o)},[]),F=(0,o.useCallback)(e=>{C.cache.forEach((t,a)=>{a.startsWith("table-")&&a.includes("-".concat(e,"-"))&&C.invalidate(a)})},[]),R=(0,o.useCallback)(function(e,t,a,r){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,c=arguments.length>5&&void 0!==arguments[5]?arguments[5]:50,n=arguments.length>6&&void 0!==arguments[6]?arguments[6]:k.current,s="table-".concat(n,"-").concat(e,"-").concat(o,"-").concat(c);C.update(s,t,a,r)},[]),M=(0,o.useCallback)(async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=(null==t?void 0:t.target)==="remote"||(null==t?void 0:t.target)==="local"?t.target:k.current,r=(null==t?void 0:t.telemetryContext)&&"object"==typeof t.telemetryContext?t.telemetryContext:null,o=/^\s*(SELECT|PRAGMA|EXPLAIN)/i.test(e),c="query-".concat(a,"-").concat(e),s=async()=>{I("loading","Executing ".concat(a," query…"));try{var t,o;let c=null==(t=T.current)?void 0:t.database_name,n=await fetch("/api/query",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:e,target:a,...c&&{db:c},...r?{telemetryContext:r}:{}})});if(!n.ok){let e="Failed to execute query";try{let t=await n.json();e=(null==t||null==(o=t.error)?void 0:o.message)||e}catch(e){}throw Error(e)}let s=await n.json();if(!s.success)throw Error(s.error||"Query execution failed");return I("success","".concat("remote"===a?"Remote":"Local"," query executed")),s}catch(e){throw I("error",e.message||"Query failed"),e||Error("An unknown error occurred")}};return o?n(c,s,1e3):s()},[I]),N=(0,o.useCallback)(async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{let a=(null==t?void 0:t.source)==="remote"||(null==t?void 0:t.source)==="local"?t.source:k.current,r="source=".concat(encodeURIComponent(a)),o=await fetch("/api/tables/".concat(e,"?").concat(r)),c=await o.json();if(!o.ok||!c.success)throw Error(c.error||"Failed to fetch table schema");return c.schema||[]}catch(e){throw console.error("Schema fetch error:",e),e}},[]),x=(0,o.useCallback)(async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{forceFetch:a=!1,page:r=1,limit:o=50}=t,c=(null==t?void 0:t.source)==="remote"||(null==t?void 0:t.source)==="local"?t.source:k.current,s="table-".concat(c,"-").concat(e,"-").concat(r,"-").concat(o);if(!a){let e=C.get(s);if(e)return e}return n("table-".concat(c,"-").concat(e,"-").concat(r,"-").concat(o),async()=>{I("loading","Loading ".concat(e," (").concat(c,")…"));try{var t,a;let n=null==(t=T.current)?void 0:t.database_name,l=n?"&db=".concat(encodeURIComponent(n)):"",i="source=".concat(encodeURIComponent(c)),u=await fetch("/api/tables/".concat(e,"?page=").concat(r,"&limit=").concat(o,"&").concat(i).concat(l),{headers:{"Cache-Control":"no-cache",Pragma:"no-cache"}});if(!u.ok)throw Error("Failed to fetch table data");let d=await u.json();if(!d.success)throw Error(d.error||"Failed to fetch table data");C.set(s,d.data,d.schema,d.meta);let h=(null==(a=d.data)?void 0:a.length)||0;return I("success","Loaded ".concat(h," row").concat(1!==h?"s":""," \xb7 ").concat(e," (").concat(c,")")),d}catch(t){throw console.error("Error fetching table data:",t),I("error",t.message,"Failed loading ".concat(e)),t}},1e3)},[I]),q=(0,o.useCallback)(async e=>{let t=k.current;I("loading","Refreshing ".concat(e,"…"));try{return C.cache.forEach((t,a)=>{a.startsWith("table-")&&a.includes("-".concat(e,"-"))&&C.invalidate(a)}),await x(e,{forceFetch:!0,source:t})}catch(t){throw console.error("Error updating table data:",t),I("error",t.message,"Failed refreshing ".concat(e)),t}},[x,I]),L=(0,o.useCallback)(async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return E(e),await x(e,t)},[x]),J=(0,o.useCallback)(async()=>{var e;let t=(null==(e=T.current)?void 0:e.database_name)||"default",a=k.current;return n("refresh-tables-".concat(t,"-").concat(a),async()=>{I("loading","Loading tables (".concat(a,")…")),h(!0),m(null);try{var e;let t=null==(e=T.current)?void 0:e.database_name,r=new URLSearchParams;r.set("source",a),t&&r.set("db",t);let o=await fetch("/api/tables?".concat(r.toString()));if(!o.ok)throw Error("Failed to fetch tables");let n=await o.json();if(n.error)throw Error(n.error);let s=n.tables||[];return c(s),I("success","".concat(s.length," table").concat(1!==s.length?"s":""," loaded (").concat(a,")")),s}catch(e){throw m(e.message),I("error",e.message,"Failed loading tables"),e}finally{h(!1)}},2e3)},[I]),U=(0,o.useCallback)(async e=>{let t="remote"===e?"remote":"local";if(t===k.current)return;let a=k.current;k.current=t,v(t),C.clear(),c([]),E(null),m(null);try{await J(),I("success","Source switched to ".concat(t)),(0,s.w)("source_mode_switched",{from:a,to:t})}catch(e){throw k.current=a,v(a),e}},[J,I]),Q=(0,o.useCallback)(async e=>{I("loading","Creating table…");try{await M(e),C.clear(),await J(),I("success","Table created")}catch(e){throw I("error",e.message,"Create table failed"),Error("Failed to create table: ".concat(e.message))}},[M,J,I]),G=(0,o.useCallback)(async e=>{I("loading",'Dropping "'.concat(e,'"…'));try{await M("DROP TABLE ".concat(e,";")),C.invalidate(e),await J(),I("success",'Table "'.concat(e,'" dropped'))}catch(t){throw I("error",t.message,'Drop "'.concat(e,'" failed')),Error("Failed to drop table: ".concat(t.message))}},[M,J,I]),V=(0,o.useCallback)(async e=>{I("loading","Syncing migrations…");try{let a=await fetch("/api/migrations/sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!a.ok){var t;let e=await a.json();throw Error((null==(t=e.error)?void 0:t.message)||"Failed to sync migrations")}let r=await a.json();return I("success","Migrations synced"),r}catch(e){throw console.error("Error syncing migrations:",e),I("error",e.message,"Migration sync failed"),e}},[I]),W=(0,o.useCallback)(async()=>{I("loading","Pulling from remote…");try{var e,t,a,r;let o=localStorage.getItem("cf_credentials");if(!o)throw Error("No Cloudflare credentials found. Please connect to Cloudflare first.");let c=JSON.parse(o);if(!c.accountId||!c.apiToken)throw Error("Invalid credentials stored. Please reconnect to Cloudflare.");let n=await fetch("/api/pull-remote/confirm",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accountId:c.accountId,apiToken:c.apiToken})}),s=await n.json();if(!n.ok||!s.success)throw Error((null==(a=s.error)?void 0:a.message)||"Failed to pull from remote");C.clear(),await J();let l=null!=(r=null==(t=s.details)||null==(e=t.appliedMigrations)?void 0:e.length)?r:0;return I("success","Pull complete — ".concat(l," migration").concat(1!==l?"s":""," applied")),s}catch(e){throw console.error("Error pulling from remote:",e),I("error",e.message,"Pull from remote failed"),e}},[J,I]),X=(0,o.useCallback)(async e=>{I("loading","Pushing to remote…");try{var t,a;let r=await fetch("/api/push-remote/confirm",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),o=await r.json();if(!r.ok)throw Error((null==(t=o.error)?void 0:t.message)||"Failed to push to remote");let c=null!=(a=o.applied)?a:0;return I("success","Push complete — ".concat(c," migration").concat(1!==c?"s":""," applied")),o}catch(e){throw console.error("Error pushing to remote:",e),I("error",e.message,"Push to remote failed"),e}},[I]),B=(0,o.useCallback)(async e=>{var t;let a=g.find(t=>t.database_name===e);if(!a)return;let r=(null==(t=T.current)?void 0:t.database_name)||"";T.current=a,w(a),C.clear(),c([]),E(null),await J(),(0,s.w)("database_switched",{from:r,to:a.database_name})},[g,J]);(0,o.useEffect)(()=>((async()=>{try{let e=await fetch("/api/databases");if(e.ok){let t=(await e.json()).databases||[];p(t),t.length>0&&!T.current&&(T.current=t[0],w(t[0]))}}catch(e){}J()})(),()=>{C.clear()}),[J]);let $=(0,o.useMemo)(()=>({tables:a,databases:g,currentDatabase:y,sourceMode:b,setSourceMode:U,switchDatabase:B,isLoading:d,error:f,activeTable:S,lastStatus:_,setOperationStatus:I,lastSyncTime:P,setLastSyncTime:A,refreshTables:J,executeQuery:M,fetchTableSchema:N,fetchTableData:x,updateTableData:q,createTable:Q,dropTable:G,syncMigrations:V,pullFromRemote:W,pushToRemote:X,getCachedTable:j,updateTableCache:R,invalidateTable:F,switchTable:L}),[a,g,y,b,U,B,d,f,S,_,I,P,A,J,M,N,x,q,Q,G,V,W,X,j,R,F,L]);return(0,r.jsx)(l.Provider,{value:$,children:t})}function h(){let e=(0,o.useContext)(l);if(!e)throw Error("useDatabase must be used within a DatabaseProvider");return e}},3537:(e,t,a)=>{a.d(t,{cn:()=>c});var r=a(2821),o=a(5889);function c(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];return(0,o.QP)((0,r.$)(t))}},9533:(e,t,a)=>{a.d(t,{w:()=>r});async function r(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(e&&"string"==typeof e)try{await fetch("/api/telemetry",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({event:e,...t&&"object"==typeof t?{properties:t}:{}})})}catch(e){}}}}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[29,47,51,58,105,175,223,377,399,437,520,663,680,761,861,868,883,952,979,999],{4441:()=>{}},_=>{_.O(0,[441,255,358],()=>_(_.s=4441)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[29,47,51,58,105,175,223,377,399,437,520,663,680,761,861,868,883,952,979,999],{4441:()=>{}},_=>{_.O(0,[441,255,358],()=>_(_.s=4441)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[29,47,51,58,105,175,223,377,399,437,520,663,680,761,861,868,883,952,979,999],{4441:()=>{}},_=>{_.O(0,[441,255,358],()=>_(_.s=4441)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[29,47,51,58,105,175,223,377,399,437,520,663,680,761,861,868,883,952,979,999],{4441:()=>{}},_=>{_.O(0,[441,255,358],()=>_(_.s=4441)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[29,47,51,58,105,175,223,377,399,437,520,663,680,761,861,868,883,952,979,999],{4441:()=>{}},_=>{_.O(0,[441,255,358],()=>_(_.s=4441)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[29,47,51,58,105,175,223,377,399,437,520,663,680,761,861,868,883,952,979,999],{4441:()=>{}},_=>{_.O(0,[441,255,358],()=>_(_.s=4441)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[29,47,51,58,105,175,223,377,399,437,520,663,680,761,861,868,883,952,979,999],{4441:()=>{}},_=>{_.O(0,[441,255,358],()=>_(_.s=4441)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[29,47,51,58,105,175,223,377,399,437,520,663,680,761,861,868,883,952,979,999],{4441:()=>{}},_=>{_.O(0,[441,255,358],()=>_(_.s=4441)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[29,47,51,58,105,175,223,377,399,437,520,663,680,761,861,868,883,952,979,999],{4441:()=>{}},_=>{_.O(0,[441,255,358],()=>_(_.s=4441)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[29,47,51,58,105,175,223,377,399,437,520,663,680,761,861,868,883,952,979,999],{4441:()=>{}},_=>{_.O(0,[441,255,358],()=>_(_.s=4441)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[29,47,51,58,105,175,223,377,399,437,520,663,680,761,861,868,883,952,979,999],{4441:()=>{}},_=>{_.O(0,[441,255,358],()=>_(_.s=4441)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[29,47,51,58,105,175,223,377,399,437,520,663,680,761,861,868,883,952,979,999],{4441:()=>{}},_=>{_.O(0,[441,255,358],()=>_(_.s=4441)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[29,47,51,58,105,175,223,377,399,437,520,663,680,761,861,868,883,952,979,999],{4441:()=>{}},_=>{_.O(0,[441,255,358],()=>_(_.s=4441)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[29,47,51,58,105,175,223,377,399,437,520,663,680,761,861,868,883,952,979,999],{4441:()=>{}},_=>{_.O(0,[441,255,358],()=>_(_.s=4441)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[29,47,51,58,105,175,223,377,399,437,520,663,680,761,861,868,883,952,979,999],{4441:()=>{}},_=>{_.O(0,[441,255,358],()=>_(_.s=4441)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[29,47,51,58,105,175,223,377,399,437,520,663,680,761,861,868,883,952,979,999],{4441:()=>{}},_=>{_.O(0,[441,255,358],()=>_(_.s=4441)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[29,47,51,58,105,175,223,377,399,437,520,663,680,761,861,868,883,952,979,999],{4441:()=>{}},_=>{_.O(0,[441,255,358],()=>_(_.s=4441)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[29,47,51,58,105,175,223,377,399,437,520,663,680,761,861,868,883,952,979,999],{4441:()=>{}},_=>{_.O(0,[441,255,358],()=>_(_.s=4441)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[29,47,51,58,105,175,223,377,399,437,520,663,680,761,861,868,883,952,979,999],{4441:()=>{}},_=>{_.O(0,[441,255,358],()=>_(_.s=4441)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[29,47,51,58,105,175,223,377,399,437,520,663,680,761,861,868,883,952,979,999],{4441:()=>{}},_=>{_.O(0,[441,255,358],()=>_(_.s=4441)),_N_E=_.O()}]);