@madarco/agentbox 0.27.1 → 0.28.0-nightly.202607251721

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 (364) hide show
  1. package/CHANGELOG.md +87 -4
  2. package/README.md +7 -3
  3. package/dist/_cloud-attach-XZYF324R.js +26 -0
  4. package/dist/admin-client-NOZ5CCAH.js +15 -0
  5. package/dist/chunk-2VW37PW4.js +1694 -0
  6. package/dist/chunk-2VW37PW4.js.map +1 -0
  7. package/dist/{chunk-HR7NHH5J.js → chunk-3UMM4VJH.js} +808 -57
  8. package/dist/chunk-3UMM4VJH.js.map +1 -0
  9. package/dist/chunk-5U5QOFL5.js +20 -0
  10. package/dist/chunk-5U5QOFL5.js.map +1 -0
  11. package/dist/chunk-6P6D77QP.js +285 -0
  12. package/dist/chunk-6P6D77QP.js.map +1 -0
  13. package/dist/chunk-6V366IZC.js +2892 -0
  14. package/dist/chunk-6V366IZC.js.map +1 -0
  15. package/dist/{chunk-KWOEUFVA.js → chunk-7J6G526Q.js} +6 -14
  16. package/dist/{chunk-KWOEUFVA.js.map → chunk-7J6G526Q.js.map} +1 -1
  17. package/dist/{chunk-IDH5A4RR.js → chunk-AYPAYY5R.js} +17 -4
  18. package/dist/chunk-AYPAYY5R.js.map +1 -0
  19. package/dist/{chunk-JGZSA5ZI.js → chunk-BHJCMTHP.js} +58 -15
  20. package/dist/chunk-BHJCMTHP.js.map +1 -0
  21. package/dist/{chunk-26IKZRTT.js → chunk-BLWAWGFX.js} +297 -1217
  22. package/dist/chunk-BLWAWGFX.js.map +1 -0
  23. package/dist/chunk-CGPUFXET.js +95 -0
  24. package/dist/chunk-CGPUFXET.js.map +1 -0
  25. package/dist/{chunk-SJ75AIA2.js → chunk-D6AODRNA.js} +12 -9
  26. package/dist/{chunk-SJ75AIA2.js.map → chunk-D6AODRNA.js.map} +1 -1
  27. package/dist/chunk-DPJMEG7U.js +11 -0
  28. package/dist/chunk-DPJMEG7U.js.map +1 -0
  29. package/dist/chunk-E2ITEZAQ.js +148 -0
  30. package/dist/chunk-E2ITEZAQ.js.map +1 -0
  31. package/dist/{chunk-JE6UI5YR.js → chunk-NKVCIH6N.js} +89 -223
  32. package/dist/chunk-NKVCIH6N.js.map +1 -0
  33. package/dist/chunk-OEYAVBA6.js +120 -0
  34. package/dist/chunk-OEYAVBA6.js.map +1 -0
  35. package/dist/{chunk-UJEH2NJT.js → chunk-PXYPQ5BO.js} +64 -264
  36. package/dist/chunk-PXYPQ5BO.js.map +1 -0
  37. package/dist/chunk-QESXSSO6.js +670 -0
  38. package/dist/chunk-QESXSSO6.js.map +1 -0
  39. package/dist/{chunk-NEF6MDJO.js → chunk-QJCK2AFX.js} +128 -26
  40. package/dist/chunk-QJCK2AFX.js.map +1 -0
  41. package/dist/chunk-RUJJY23M.js +84 -0
  42. package/dist/chunk-RUJJY23M.js.map +1 -0
  43. package/dist/{chunk-LL7NCMUU.js → chunk-SKNJRYM5.js} +7 -13
  44. package/dist/chunk-SKNJRYM5.js.map +1 -0
  45. package/dist/chunk-WFGAMJ5Q.js +689 -0
  46. package/dist/chunk-WFGAMJ5Q.js.map +1 -0
  47. package/dist/chunk-ZJL56TJD.js +1444 -0
  48. package/dist/chunk-ZJL56TJD.js.map +1 -0
  49. package/dist/{chunk-V5XXJH63.js → chunk-ZXOP4LBG.js} +5 -8
  50. package/dist/chunk-ZXOP4LBG.js.map +1 -0
  51. package/dist/control-plane-2VEM2KCL.js +31 -0
  52. package/dist/custody-client-P6XIXHRG.js +16 -0
  53. package/dist/{dist-TSFVB7AI.js → dist-2SYQI5S2.js} +11 -7
  54. package/dist/dist-2SYQI5S2.js.map +1 -0
  55. package/dist/{dist-KQTMCVME.js → dist-6QZMZEL7.js} +18 -11
  56. package/dist/dist-6QZMZEL7.js.map +1 -0
  57. package/dist/{dist-FTKS2GI4.js → dist-JHMILJUT.js} +10 -6
  58. package/dist/{dist-OO52HARR.js → dist-JOFZOZCY.js} +41 -25
  59. package/dist/{dist-O3LKOIE7.js → dist-KZ2GEEEX.js} +11 -7
  60. package/dist/dist-KZ2GEEEX.js.map +1 -0
  61. package/dist/{dist-Z6L5MM5D.js → dist-Q5NY4CF6.js} +10 -6
  62. package/dist/{dist-U2SVLJUQ.js → dist-SKMNEDVW.js} +8 -2
  63. package/dist/dist-SKMNEDVW.js.map +1 -0
  64. package/dist/dist-SRCKO7ZV.js +197 -0
  65. package/dist/dist-SRCKO7ZV.js.map +1 -0
  66. package/dist/{dist-WVYAURMF.js → dist-UXZQWKY6.js} +10 -6
  67. package/dist/dist-UXZQWKY6.js.map +1 -0
  68. package/dist/env-file-UDUDQMP4.js +11 -0
  69. package/dist/env-file-UDUDQMP4.js.map +1 -0
  70. package/dist/hub-adopt-ZS5CREYF.js +21 -0
  71. package/dist/hub-adopt-ZS5CREYF.js.map +1 -0
  72. package/dist/index.js +2461 -1905
  73. package/dist/index.js.map +1 -1
  74. package/dist/node-postgres-6JUOVUN5.js +3584 -0
  75. package/dist/node-postgres-6JUOVUN5.js.map +1 -0
  76. package/dist/{prepared-state-75DIZ55S-TNJXWMXV.js → prepared-state-75DIZ55S-P6LE4N64.js} +3 -2
  77. package/dist/prepared-state-75DIZ55S-P6LE4N64.js.map +1 -0
  78. package/dist/remote-hub-SJ4XWBA5.js +9 -0
  79. package/dist/remote-hub-SJ4XWBA5.js.map +1 -0
  80. package/dist/sqlite-proxy-53E5D2VM.js +2882 -0
  81. package/dist/sqlite-proxy-53E5D2VM.js.map +1 -0
  82. package/package.json +1 -1
  83. package/runtime/_shared/ctl.cjs +29199 -16813
  84. package/runtime/digitalocean/ctl.cjs +29199 -16813
  85. package/runtime/docker/packages/ctl/dist/bin.cjs +29199 -16813
  86. package/runtime/e2b/ctl.cjs +29199 -16813
  87. package/runtime/hetzner/ctl.cjs +29199 -16813
  88. package/runtime/hub/apps/hub/.next/BUILD_ID +1 -1
  89. package/runtime/hub/apps/hub/.next/build-manifest.json +3 -3
  90. package/runtime/hub/apps/hub/.next/server/app/(auth)/api/auth/[...all]/route.js +5 -5
  91. package/runtime/hub/apps/hub/.next/server/app/(auth)/api/auth/[...all]/route.js.nft.json +1 -1
  92. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/approvals/[id]/answer/route.js +2 -2
  93. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/approvals/[id]/answer/route.js.nft.json +1 -1
  94. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/approvals/route.js +2 -2
  95. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/approvals/route.js.nft.json +1 -1
  96. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/[action]/route.js +2 -2
  97. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/[action]/route.js.nft.json +1 -1
  98. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/branches/route.js +2 -2
  99. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/branches/route.js.nft.json +1 -1
  100. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/git/[op]/route.js +2 -2
  101. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/git/[op]/route.js.nft.json +1 -1
  102. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/git/route.js +2 -2
  103. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/git/route.js.nft.json +1 -1
  104. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/open/route.js +2 -2
  105. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/open/route.js.nft.json +1 -1
  106. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/rename/route.js +2 -2
  107. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/rename/route.js.nft.json +1 -1
  108. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/route.js +2 -2
  109. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/route.js.nft.json +1 -1
  110. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/services/restart/route.js +2 -2
  111. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/services/restart/route.js.nft.json +1 -1
  112. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/services/route.js +4 -4
  113. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/services/route.js.nft.json +1 -1
  114. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/route.js +2 -2
  115. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/route.js.nft.json +1 -1
  116. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/health/route.js +2 -2
  117. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/health/route.js.nft.json +1 -1
  118. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/[alias]/bake/route.js +2 -2
  119. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/[alias]/bake/route.js.nft.json +1 -1
  120. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/[alias]/route.js +2 -2
  121. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/[alias]/route.js.nft.json +1 -1
  122. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/route.js +2 -2
  123. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/route.js.nft.json +1 -1
  124. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/login-code/route.js +2 -2
  125. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/login-code/route.js.nft.json +1 -1
  126. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/logs/route.js +2 -2
  127. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/logs/route.js.nft.json +1 -1
  128. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/route.js +2 -2
  129. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/route.js.nft.json +1 -1
  130. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/open-targets/route.js +2 -2
  131. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/open-targets/route.js.nft.json +1 -1
  132. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/branches/route.js +2 -2
  133. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/branches/route.js.nft.json +1 -1
  134. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/route.js +2 -2
  135. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/route.js.nft.json +1 -1
  136. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/route.js +2 -2
  137. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/route.js.nft.json +1 -1
  138. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/[id]/credentials/route.js +2 -2
  139. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/[id]/credentials/route.js.nft.json +1 -1
  140. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/[id]/prepare/route.js +2 -2
  141. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/[id]/prepare/route.js.nft.json +1 -1
  142. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/route.js +2 -2
  143. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/route.js.nft.json +1 -1
  144. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/approvals/page.js +2 -2
  145. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/approvals/page.js.nft.json +1 -1
  146. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/approvals/page_client-reference-manifest.js +1 -1
  147. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/page.js +2 -2
  148. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/page.js.nft.json +1 -1
  149. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/page_client-reference-manifest.js +1 -1
  150. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/page.js +2 -2
  151. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/page.js.nft.json +1 -1
  152. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
  153. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/projects/[id]/page.js +2 -2
  154. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/projects/[id]/page.js.nft.json +1 -1
  155. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/projects/[id]/page_client-reference-manifest.js +1 -1
  156. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/settings/page.js +2 -2
  157. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/settings/page.js.nft.json +1 -1
  158. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/settings/page_client-reference-manifest.js +1 -1
  159. package/runtime/hub/apps/hub/.next/server/app/[...path]/route.js +4 -2
  160. package/runtime/hub/apps/hub/.next/server/app/[...path]/route.js.nft.json +1 -1
  161. package/runtime/hub/apps/hub/.next/server/app/_global-error.html +1 -1
  162. package/runtime/hub/apps/hub/.next/server/app/_global-error.rsc +1 -1
  163. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  164. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  165. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  166. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  167. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  168. package/runtime/hub/apps/hub/.next/server/chunks/0-fj_better-auth_dist_adapters_kysely-adapter_index_mjs_0btft52._.js +3 -0
  169. package/runtime/hub/apps/hub/.next/server/chunks/1w4z_drizzle-orm_0gvv4ct._.js +4 -0
  170. package/runtime/hub/apps/hub/.next/server/chunks/1w4z_drizzle-orm_0pn9b49._.js +4 -0
  171. package/runtime/hub/apps/hub/.next/server/chunks/1w4z_drizzle-orm_145bz8z._.js +9 -0
  172. package/runtime/hub/apps/hub/.next/server/chunks/1w4z_drizzle-orm_14y990b._.js +3 -0
  173. package/runtime/hub/apps/hub/.next/server/chunks/1w4z_drizzle-orm_1nl4l3q._.js +3 -0
  174. package/runtime/hub/apps/hub/.next/server/chunks/1w4z_drizzle-orm_sqlite-proxy_index_05v_j5r.js +15 -0
  175. package/runtime/hub/apps/hub/.next/server/chunks/{[externals]__12m3qoa._.js → [externals]__0f3aqcx._.js} +2 -2
  176. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0-9g1s8._.js +3 -0
  177. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0-pvfxg._.js +3 -0
  178. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__01amzh6._.js +3 -0
  179. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__02q799_._.js +3 -0
  180. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__03k22rl._.js +3 -0
  181. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__04tqk-j._.js +3 -0
  182. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__05ovf1y._.js +3 -0
  183. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__05s-_x7._.js +3 -0
  184. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__07dnyfi._.js +3 -0
  185. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__07zk6qo._.js +3 -0
  186. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0_59yi6._.js +3 -0
  187. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0ajlo3d._.js +3 -0
  188. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0b5s54n._.js +3 -0
  189. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0c4fiez._.js +3 -0
  190. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0c9iff1._.js +3 -0
  191. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0d1lmiq._.js +5 -5
  192. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0dh6lzr._.js +3 -0
  193. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0ey83ai._.js +3 -0
  194. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0h6vdvr._.js +3 -0
  195. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0lup7p4._.js +3 -0
  196. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0luxuu4._.js +3 -0
  197. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0nl2u6u._.js +3 -0
  198. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0nonp-6._.js +3 -0
  199. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0oplozy._.js +3 -0
  200. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0p-6wgd._.js +3 -0
  201. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0rcnwbw._.js +3 -0
  202. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0tuz1am._.js +3 -0
  203. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1-9g0ae._.js +1 -1
  204. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__10ry4ss._.js +3 -0
  205. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__11hv164._.js +3 -0
  206. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__154_i13._.js +3 -0
  207. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__17676rc._.js +3 -0
  208. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1bg1alc._.js +3 -0
  209. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1cvqb1d._.js +3 -0
  210. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1d60gbz._.js +3 -0
  211. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1dm0jmw._.js +6 -0
  212. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1dv_b1t._.js +3 -0
  213. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1fzxip4._.js +3 -0
  214. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1h4oj-e._.js +3 -0
  215. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1i4gq_2._.js +3 -0
  216. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1v1p7in._.js +3 -0
  217. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1v9_her._.js +4 -0
  218. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1x1jkpb._.js +3 -0
  219. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1yd8n5l._.js +3 -0
  220. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__20t_rs8._.js +3 -0
  221. package/runtime/hub/apps/hub/.next/server/chunks/_033w048._.js +1 -1
  222. package/runtime/hub/apps/hub/.next/server/chunks/_06f2faq._.js +1 -1
  223. package/runtime/hub/apps/hub/.next/server/chunks/{_0760z6y._.js → _0907rw0._.js} +15 -15
  224. package/runtime/hub/apps/hub/.next/server/chunks/_0f3molr._.js +1 -1
  225. package/runtime/hub/apps/hub/.next/server/chunks/_0lgs9kd._.js +1 -1
  226. package/runtime/hub/apps/hub/.next/server/chunks/_0pyhcqe._.js +1 -1
  227. package/runtime/hub/apps/hub/.next/server/chunks/_1-42ili._.js +1 -1
  228. package/runtime/hub/apps/hub/.next/server/chunks/_11__3wi._.js +1 -1
  229. package/runtime/hub/apps/hub/.next/server/chunks/_12flzuh._.js +1 -1
  230. package/runtime/hub/apps/hub/.next/server/chunks/_1bng7w9._.js +1 -1
  231. package/runtime/hub/apps/hub/.next/server/chunks/_1rpkqst._.js +1 -1
  232. package/runtime/hub/apps/hub/.next/server/chunks/_1wt72m1._.js +1 -1
  233. package/runtime/hub/apps/hub/.next/server/chunks/_1x3l5t8._.js +1 -1
  234. package/runtime/hub/apps/hub/.next/server/chunks/packages_relay_dist_control-plane_03a-9aj.js +62 -31
  235. package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_0xy-j7z._.js +1 -1
  236. package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_1uccfbf._.js +1 -1
  237. package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_010858m.js +1 -1
  238. package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_04zwxnx.js +1 -1
  239. package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_06exuc7.js +1 -1
  240. package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_0f2ldrt.js +1 -1
  241. package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_0f2tzep.js +1 -1
  242. package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_116nh32.js +1 -1
  243. package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_11dyjcb.js +1 -1
  244. package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_1_4knli.js +1 -1
  245. package/runtime/hub/apps/hub/.next/server/chunks/ssr/1w4z_drizzle-orm_0ebuy19._.js +3 -0
  246. package/runtime/hub/apps/hub/.next/server/chunks/ssr/1w4z_drizzle-orm_0wxhi0-._.js +3 -0
  247. package/runtime/hub/apps/hub/.next/server/chunks/ssr/1w4z_drizzle-orm_0xe4ick._.js +9 -0
  248. package/runtime/hub/apps/hub/.next/server/chunks/ssr/1w4z_drizzle-orm_14oaveu._.js +4 -0
  249. package/runtime/hub/apps/hub/.next/server/chunks/ssr/1w4z_drizzle-orm_sqlite-proxy_index_1a6wfdg.js +15 -0
  250. package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__0-pm2yl._.js +3 -0
  251. package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__08-1wwu._.js +1 -1
  252. package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__0c9mbcn._.js +1 -1
  253. package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__0gdfxj4._.js +1 -1
  254. package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__0kc-hwp._.js +1 -1
  255. package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__0lu73p6._.js +1 -1
  256. package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__0m1yf2b._.js +4 -0
  257. package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__0wv-3zo._.js +3 -0
  258. package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__10bfmwi._.js +1 -1
  259. package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__18qvdzb._.js +2 -2
  260. package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__1l2urlw._.js +1 -1
  261. package/runtime/hub/apps/hub/.next/server/chunks/ssr/{_0ro6vh6._.js → _0r2xlss._.js} +3 -3
  262. package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub_components_1z1p98f._.js +1 -1
  263. package/runtime/hub/apps/hub/.next/server/chunks/ssr/packages_relay_dist_control-plane_0ve-wz4.js +2 -25
  264. package/runtime/hub/apps/hub/.next/server/middleware-build-manifest.js +3 -3
  265. package/runtime/hub/apps/hub/.next/server/middleware.js +1 -1
  266. package/runtime/hub/apps/hub/.next/server/pages/500.html +1 -1
  267. package/runtime/hub/apps/hub/.next/static/chunks/{2xc1sm79a6tsb.js → 2gsrna76i1d80.js} +1 -1
  268. package/runtime/hub/apps/hub/attach-helper.cjs +191 -0
  269. package/runtime/hub/apps/hub/{auth-DC44GQZY.js → auth-IRNNO3IK.js} +2 -2
  270. package/runtime/hub/apps/hub/{auth-config-LALRDYDO.js → auth-config-WJHIMGUE.js} +4 -2
  271. package/runtime/hub/apps/hub/{chunk-YJ5MJOXK.js → chunk-4LYVBRBC.js} +2094 -220
  272. package/runtime/hub/apps/hub/chunk-6AVSKCZJ.js +669 -0
  273. package/runtime/hub/apps/hub/{chunk-QSMPSV5Z.js → chunk-A5Y7LJMU.js} +57 -14
  274. package/runtime/hub/apps/hub/chunk-EDRFXO2M.js +35 -0
  275. package/runtime/hub/apps/hub/chunk-F2JI4GMX.js +2891 -0
  276. package/runtime/hub/apps/hub/{chunk-EHBJKZCL.js → chunk-O3K3ZGFF.js} +500 -35
  277. package/runtime/hub/apps/hub/chunk-RII6IKNJ.js +688 -0
  278. package/runtime/hub/apps/hub/{chunk-RXYOWSSN.js → chunk-RMEUA6PA.js} +120 -14
  279. package/runtime/hub/apps/hub/{chunk-3FJNKSNZ.js → chunk-SCHQR5KR.js} +3 -1
  280. package/runtime/hub/apps/hub/{dist-6FPPUSWZ.js → dist-2GEAA7QA.js} +15 -3
  281. package/runtime/hub/apps/hub/{dist-JG45OFT2.js → dist-36O6F6M3.js} +39 -24
  282. package/runtime/hub/apps/hub/{dist-3I7KUI6W.js → dist-IWLEL2TO.js} +21 -24
  283. package/runtime/hub/apps/hub/{dist-G6TXUSPZ.js → dist-NYKIT5W5.js} +10 -11
  284. package/runtime/hub/apps/hub/{dist-EQV4L7KP.js → dist-QB2IJ7OD.js} +7 -1
  285. package/runtime/hub/apps/hub/{dist-LYDHYTP2.js → dist-RBBXXGLI.js} +129 -26
  286. package/runtime/hub/apps/hub/{dist-GTVVXCBP.js → dist-RRJN2U5P.js} +10 -14
  287. package/runtime/hub/apps/hub/{dist-DX6IYMAH.js → dist-UWXGDCK4.js} +14 -11
  288. package/runtime/hub/apps/hub/{hub-token-COBZGSLS.js → hub-token-6USIMBPQ.js} +2 -2
  289. package/runtime/hub/apps/hub/hub-worker-SOFWVTWU.js +215 -0
  290. package/runtime/hub/apps/hub/node-postgres-DIU2H5VP.js +3583 -0
  291. package/runtime/hub/apps/hub/package.json +5 -2
  292. package/runtime/hub/apps/hub/{prepared-state-75DIZ55S-2IFNUHHM.js → prepared-state-75DIZ55S-P5FHEORG.js} +1 -1
  293. package/runtime/hub/apps/hub/server.js +247 -66
  294. package/runtime/hub/apps/hub/sqlite-proxy-VJS3HIOV.js +2881 -0
  295. package/runtime/relay/bin.cjs +694 -13
  296. package/runtime/vercel/ctl.cjs +29199 -16813
  297. package/dist/_cloud-attach-WDGM6FL5.js +0 -19
  298. package/dist/chunk-26IKZRTT.js.map +0 -1
  299. package/dist/chunk-HR7NHH5J.js.map +0 -1
  300. package/dist/chunk-IDH5A4RR.js.map +0 -1
  301. package/dist/chunk-JE6UI5YR.js.map +0 -1
  302. package/dist/chunk-JGZSA5ZI.js.map +0 -1
  303. package/dist/chunk-LL7NCMUU.js.map +0 -1
  304. package/dist/chunk-NEF6MDJO.js.map +0 -1
  305. package/dist/chunk-UJEH2NJT.js.map +0 -1
  306. package/dist/chunk-V5XXJH63.js.map +0 -1
  307. package/dist/dist-KQTMCVME.js.map +0 -1
  308. package/dist/dist-O3LKOIE7.js.map +0 -1
  309. package/dist/dist-TSFVB7AI.js.map +0 -1
  310. package/runtime/hub/apps/hub/.next/server/chunks/0zhp_better-auth_dist_adapters_kysely-adapter_index_mjs_1rl4qnh._.js +0 -3
  311. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__04h15ml._.js +0 -3
  312. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__04jgk9x._.js +0 -3
  313. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__07ednlo._.js +0 -3
  314. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0a7djvw._.js +0 -3
  315. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0ig1bot._.js +0 -3
  316. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0keu6we._.js +0 -3
  317. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0ql4fjo._.js +0 -3
  318. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0szd4sh._.js +0 -3
  319. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0t7o5ed._.js +0 -3
  320. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0vs8fma._.js +0 -3
  321. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0w9ud8u._.js +0 -3
  322. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0xh14bo._.js +0 -3
  323. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0yhb0gc._.js +0 -3
  324. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1-0flwc._.js +0 -3
  325. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__13ioh5z._.js +0 -3
  326. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__13jwk_k._.js +0 -3
  327. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__16_uteg._.js +0 -3
  328. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__16p2m-g._.js +0 -3
  329. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__19pc87s._.js +0 -3
  330. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1_gu2yk._.js +0 -3
  331. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1a50b07._.js +0 -3
  332. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1ai-945._.js +0 -3
  333. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1bu2zio._.js +0 -3
  334. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1ctczev._.js +0 -3
  335. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1d6mtlk._.js +0 -3
  336. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1dn_3i1._.js +0 -3
  337. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1e4z_-v._.js +0 -3
  338. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1f2sueq._.js +0 -3
  339. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1f9zctr._.js +0 -3
  340. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1h4xycg._.js +0 -3
  341. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1hqla7-._.js +0 -3
  342. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1js2jdv._.js +0 -3
  343. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1md9kdw._.js +0 -3
  344. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1mttufy._.js +0 -3
  345. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1nepkp-._.js +0 -6
  346. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1pp5oib._.js +0 -3
  347. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1q5bqse._.js +0 -3
  348. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1qwhzmi._.js +0 -3
  349. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1thipug._.js +0 -3
  350. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1v9om6g._.js +0 -3
  351. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1xeczo7._.js +0 -3
  352. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__20503l7._.js +0 -3
  353. package/runtime/hub/apps/hub/.next/server/chunks/ssr/[externals]_pg_20c820g._.js +0 -3
  354. package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__0j0tjwn._.js +0 -3
  355. /package/dist/{_cloud-attach-WDGM6FL5.js.map → _cloud-attach-XZYF324R.js.map} +0 -0
  356. /package/dist/{dist-FTKS2GI4.js.map → admin-client-NOZ5CCAH.js.map} +0 -0
  357. /package/dist/{dist-OO52HARR.js.map → control-plane-2VEM2KCL.js.map} +0 -0
  358. /package/dist/{dist-U2SVLJUQ.js.map → custody-client-P6XIXHRG.js.map} +0 -0
  359. /package/dist/{dist-WVYAURMF.js.map → dist-JHMILJUT.js.map} +0 -0
  360. /package/dist/{dist-Z6L5MM5D.js.map → dist-JOFZOZCY.js.map} +0 -0
  361. /package/dist/{prepared-state-75DIZ55S-TNJXWMXV.js.map → dist-Q5NY4CF6.js.map} +0 -0
  362. /package/runtime/hub/apps/hub/.next/static/{PWF2iHQOg9-rRyfqVDLrh → B4bEtdig9I9joQFHDOjX3}/_buildManifest.js +0 -0
  363. /package/runtime/hub/apps/hub/.next/static/{PWF2iHQOg9-rRyfqVDLrh → B4bEtdig9I9joQFHDOjX3}/_clientMiddlewareManifest.js +0 -0
  364. /package/runtime/hub/apps/hub/.next/static/{PWF2iHQOg9-rRyfqVDLrh → B4bEtdig9I9joQFHDOjX3}/_ssgManifest.js +0 -0
@@ -0,0 +1,2892 @@
1
+ #!/usr/bin/env node
2
+
3
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/entity.js
4
+ var entityKind = /* @__PURE__ */ Symbol.for("drizzle:entityKind");
5
+ function is(value, type) {
6
+ if (!value || typeof value !== "object") {
7
+ return false;
8
+ }
9
+ if (value instanceof type) {
10
+ return true;
11
+ }
12
+ if (!Object.prototype.hasOwnProperty.call(type, entityKind)) {
13
+ throw new Error(
14
+ `Class "${type.name ?? "<unknown>"}" doesn't look like a Drizzle entity. If this is incorrect and the class is provided by Drizzle, please report this as a bug.`
15
+ );
16
+ }
17
+ let cls = Object.getPrototypeOf(value).constructor;
18
+ if (cls) {
19
+ while (cls) {
20
+ if (entityKind in cls && cls[entityKind] === type[entityKind]) {
21
+ return true;
22
+ }
23
+ cls = Object.getPrototypeOf(cls);
24
+ }
25
+ }
26
+ return false;
27
+ }
28
+
29
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/tracing-utils.js
30
+ function iife(fn, ...args) {
31
+ return fn(...args);
32
+ }
33
+
34
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/version.js
35
+ var version = "0.45.2";
36
+
37
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/tracing.js
38
+ var otel;
39
+ var rawTracer;
40
+ var tracer = {
41
+ startActiveSpan(name, fn) {
42
+ if (!otel) {
43
+ return fn();
44
+ }
45
+ if (!rawTracer) {
46
+ rawTracer = otel.trace.getTracer("drizzle-orm", version);
47
+ }
48
+ return iife(
49
+ (otel2, rawTracer2) => rawTracer2.startActiveSpan(
50
+ name,
51
+ (span) => {
52
+ try {
53
+ return fn(span);
54
+ } catch (e) {
55
+ span.setStatus({
56
+ code: otel2.SpanStatusCode.ERROR,
57
+ message: e instanceof Error ? e.message : "Unknown error"
58
+ // eslint-disable-line no-instanceof/no-instanceof
59
+ });
60
+ throw e;
61
+ } finally {
62
+ span.end();
63
+ }
64
+ }
65
+ ),
66
+ otel,
67
+ rawTracer
68
+ );
69
+ }
70
+ };
71
+
72
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/column-builder.js
73
+ var ColumnBuilder = class {
74
+ static [entityKind] = "ColumnBuilder";
75
+ config;
76
+ constructor(name, dataType, columnType) {
77
+ this.config = {
78
+ name,
79
+ keyAsName: name === "",
80
+ notNull: false,
81
+ default: void 0,
82
+ hasDefault: false,
83
+ primaryKey: false,
84
+ isUnique: false,
85
+ uniqueName: void 0,
86
+ uniqueType: void 0,
87
+ dataType,
88
+ columnType,
89
+ generated: void 0
90
+ };
91
+ }
92
+ /**
93
+ * Changes the data type of the column. Commonly used with `json` columns. Also, useful for branded types.
94
+ *
95
+ * @example
96
+ * ```ts
97
+ * const users = pgTable('users', {
98
+ * id: integer('id').$type<UserId>().primaryKey(),
99
+ * details: json('details').$type<UserDetails>().notNull(),
100
+ * });
101
+ * ```
102
+ */
103
+ $type() {
104
+ return this;
105
+ }
106
+ /**
107
+ * Adds a `not null` clause to the column definition.
108
+ *
109
+ * Affects the `select` model of the table - columns *without* `not null` will be nullable on select.
110
+ */
111
+ notNull() {
112
+ this.config.notNull = true;
113
+ return this;
114
+ }
115
+ /**
116
+ * Adds a `default <value>` clause to the column definition.
117
+ *
118
+ * Affects the `insert` model of the table - columns *with* `default` are optional on insert.
119
+ *
120
+ * If you need to set a dynamic default value, use {@link $defaultFn} instead.
121
+ */
122
+ default(value) {
123
+ this.config.default = value;
124
+ this.config.hasDefault = true;
125
+ return this;
126
+ }
127
+ /**
128
+ * Adds a dynamic default value to the column.
129
+ * The function will be called when the row is inserted, and the returned value will be used as the column value.
130
+ *
131
+ * **Note:** This value does not affect the `drizzle-kit` behavior, it is only used at runtime in `drizzle-orm`.
132
+ */
133
+ $defaultFn(fn) {
134
+ this.config.defaultFn = fn;
135
+ this.config.hasDefault = true;
136
+ return this;
137
+ }
138
+ /**
139
+ * Alias for {@link $defaultFn}.
140
+ */
141
+ $default = this.$defaultFn;
142
+ /**
143
+ * Adds a dynamic update value to the column.
144
+ * The function will be called when the row is updated, and the returned value will be used as the column value if none is provided.
145
+ * If no `default` (or `$defaultFn`) value is provided, the function will be called when the row is inserted as well, and the returned value will be used as the column value.
146
+ *
147
+ * **Note:** This value does not affect the `drizzle-kit` behavior, it is only used at runtime in `drizzle-orm`.
148
+ */
149
+ $onUpdateFn(fn) {
150
+ this.config.onUpdateFn = fn;
151
+ this.config.hasDefault = true;
152
+ return this;
153
+ }
154
+ /**
155
+ * Alias for {@link $onUpdateFn}.
156
+ */
157
+ $onUpdate = this.$onUpdateFn;
158
+ /**
159
+ * Adds a `primary key` clause to the column definition. This implicitly makes the column `not null`.
160
+ *
161
+ * In SQLite, `integer primary key` implicitly makes the column auto-incrementing.
162
+ */
163
+ primaryKey() {
164
+ this.config.primaryKey = true;
165
+ this.config.notNull = true;
166
+ return this;
167
+ }
168
+ /** @internal Sets the name of the column to the key within the table definition if a name was not given. */
169
+ setName(name) {
170
+ if (this.config.name !== "") return;
171
+ this.config.name = name;
172
+ }
173
+ };
174
+
175
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/column.js
176
+ var Column = class {
177
+ constructor(table, config) {
178
+ this.table = table;
179
+ this.config = config;
180
+ this.name = config.name;
181
+ this.keyAsName = config.keyAsName;
182
+ this.notNull = config.notNull;
183
+ this.default = config.default;
184
+ this.defaultFn = config.defaultFn;
185
+ this.onUpdateFn = config.onUpdateFn;
186
+ this.hasDefault = config.hasDefault;
187
+ this.primary = config.primaryKey;
188
+ this.isUnique = config.isUnique;
189
+ this.uniqueName = config.uniqueName;
190
+ this.uniqueType = config.uniqueType;
191
+ this.dataType = config.dataType;
192
+ this.columnType = config.columnType;
193
+ this.generated = config.generated;
194
+ this.generatedIdentity = config.generatedIdentity;
195
+ }
196
+ static [entityKind] = "Column";
197
+ name;
198
+ keyAsName;
199
+ primary;
200
+ notNull;
201
+ default;
202
+ defaultFn;
203
+ onUpdateFn;
204
+ hasDefault;
205
+ isUnique;
206
+ uniqueName;
207
+ uniqueType;
208
+ dataType;
209
+ columnType;
210
+ enumValues = void 0;
211
+ generated = void 0;
212
+ generatedIdentity = void 0;
213
+ config;
214
+ mapFromDriverValue(value) {
215
+ return value;
216
+ }
217
+ mapToDriverValue(value) {
218
+ return value;
219
+ }
220
+ // ** @internal */
221
+ shouldDisableInsert() {
222
+ return this.config.generated !== void 0 && this.config.generated.type !== "byDefault";
223
+ }
224
+ };
225
+
226
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/table.utils.js
227
+ var TableName = /* @__PURE__ */ Symbol.for("drizzle:Name");
228
+
229
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/pg-core/foreign-keys.js
230
+ var ForeignKeyBuilder = class {
231
+ static [entityKind] = "PgForeignKeyBuilder";
232
+ /** @internal */
233
+ reference;
234
+ /** @internal */
235
+ _onUpdate = "no action";
236
+ /** @internal */
237
+ _onDelete = "no action";
238
+ constructor(config, actions) {
239
+ this.reference = () => {
240
+ const { name, columns, foreignColumns } = config();
241
+ return { name, columns, foreignTable: foreignColumns[0].table, foreignColumns };
242
+ };
243
+ if (actions) {
244
+ this._onUpdate = actions.onUpdate;
245
+ this._onDelete = actions.onDelete;
246
+ }
247
+ }
248
+ onUpdate(action) {
249
+ this._onUpdate = action === void 0 ? "no action" : action;
250
+ return this;
251
+ }
252
+ onDelete(action) {
253
+ this._onDelete = action === void 0 ? "no action" : action;
254
+ return this;
255
+ }
256
+ /** @internal */
257
+ build(table) {
258
+ return new ForeignKey(table, this);
259
+ }
260
+ };
261
+ var ForeignKey = class {
262
+ constructor(table, builder) {
263
+ this.table = table;
264
+ this.reference = builder.reference;
265
+ this.onUpdate = builder._onUpdate;
266
+ this.onDelete = builder._onDelete;
267
+ }
268
+ static [entityKind] = "PgForeignKey";
269
+ reference;
270
+ onUpdate;
271
+ onDelete;
272
+ getName() {
273
+ const { name, columns, foreignColumns } = this.reference();
274
+ const columnNames = columns.map((column) => column.name);
275
+ const foreignColumnNames = foreignColumns.map((column) => column.name);
276
+ const chunks = [
277
+ this.table[TableName],
278
+ ...columnNames,
279
+ foreignColumns[0].table[TableName],
280
+ ...foreignColumnNames
281
+ ];
282
+ return name ?? `${chunks.join("_")}_fk`;
283
+ }
284
+ };
285
+
286
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/pg-core/unique-constraint.js
287
+ function uniqueKeyName(table, columns) {
288
+ return `${table[TableName]}_${columns.join("_")}_unique`;
289
+ }
290
+ var UniqueConstraintBuilder = class {
291
+ constructor(columns, name) {
292
+ this.name = name;
293
+ this.columns = columns;
294
+ }
295
+ static [entityKind] = "PgUniqueConstraintBuilder";
296
+ /** @internal */
297
+ columns;
298
+ /** @internal */
299
+ nullsNotDistinctConfig = false;
300
+ nullsNotDistinct() {
301
+ this.nullsNotDistinctConfig = true;
302
+ return this;
303
+ }
304
+ /** @internal */
305
+ build(table) {
306
+ return new UniqueConstraint(table, this.columns, this.nullsNotDistinctConfig, this.name);
307
+ }
308
+ };
309
+ var UniqueOnConstraintBuilder = class {
310
+ static [entityKind] = "PgUniqueOnConstraintBuilder";
311
+ /** @internal */
312
+ name;
313
+ constructor(name) {
314
+ this.name = name;
315
+ }
316
+ on(...columns) {
317
+ return new UniqueConstraintBuilder(columns, this.name);
318
+ }
319
+ };
320
+ var UniqueConstraint = class {
321
+ constructor(table, columns, nullsNotDistinct, name) {
322
+ this.table = table;
323
+ this.columns = columns;
324
+ this.name = name ?? uniqueKeyName(this.table, this.columns.map((column) => column.name));
325
+ this.nullsNotDistinct = nullsNotDistinct;
326
+ }
327
+ static [entityKind] = "PgUniqueConstraint";
328
+ columns;
329
+ name;
330
+ nullsNotDistinct = false;
331
+ getName() {
332
+ return this.name;
333
+ }
334
+ };
335
+
336
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/pg-core/utils/array.js
337
+ function parsePgArrayValue(arrayString, startFrom, inQuotes) {
338
+ for (let i = startFrom; i < arrayString.length; i++) {
339
+ const char2 = arrayString[i];
340
+ if (char2 === "\\") {
341
+ i++;
342
+ continue;
343
+ }
344
+ if (char2 === '"') {
345
+ return [arrayString.slice(startFrom, i).replace(/\\/g, ""), i + 1];
346
+ }
347
+ if (inQuotes) {
348
+ continue;
349
+ }
350
+ if (char2 === "," || char2 === "}") {
351
+ return [arrayString.slice(startFrom, i).replace(/\\/g, ""), i];
352
+ }
353
+ }
354
+ return [arrayString.slice(startFrom).replace(/\\/g, ""), arrayString.length];
355
+ }
356
+ function parsePgNestedArray(arrayString, startFrom = 0) {
357
+ const result = [];
358
+ let i = startFrom;
359
+ let lastCharIsComma = false;
360
+ while (i < arrayString.length) {
361
+ const char2 = arrayString[i];
362
+ if (char2 === ",") {
363
+ if (lastCharIsComma || i === startFrom) {
364
+ result.push("");
365
+ }
366
+ lastCharIsComma = true;
367
+ i++;
368
+ continue;
369
+ }
370
+ lastCharIsComma = false;
371
+ if (char2 === "\\") {
372
+ i += 2;
373
+ continue;
374
+ }
375
+ if (char2 === '"') {
376
+ const [value2, startFrom2] = parsePgArrayValue(arrayString, i + 1, true);
377
+ result.push(value2);
378
+ i = startFrom2;
379
+ continue;
380
+ }
381
+ if (char2 === "}") {
382
+ return [result, i + 1];
383
+ }
384
+ if (char2 === "{") {
385
+ const [value2, startFrom2] = parsePgNestedArray(arrayString, i + 1);
386
+ result.push(value2);
387
+ i = startFrom2;
388
+ continue;
389
+ }
390
+ const [value, newStartFrom] = parsePgArrayValue(arrayString, i, false);
391
+ result.push(value);
392
+ i = newStartFrom;
393
+ }
394
+ return [result, i];
395
+ }
396
+ function parsePgArray(arrayString) {
397
+ const [result] = parsePgNestedArray(arrayString, 1);
398
+ return result;
399
+ }
400
+ function makePgArray(array) {
401
+ return `{${array.map((item) => {
402
+ if (Array.isArray(item)) {
403
+ return makePgArray(item);
404
+ }
405
+ if (typeof item === "string") {
406
+ return `"${item.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"`;
407
+ }
408
+ return `${item}`;
409
+ }).join(",")}}`;
410
+ }
411
+
412
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/pg-core/columns/common.js
413
+ var PgColumnBuilder = class extends ColumnBuilder {
414
+ foreignKeyConfigs = [];
415
+ static [entityKind] = "PgColumnBuilder";
416
+ array(size) {
417
+ return new PgArrayBuilder(this.config.name, this, size);
418
+ }
419
+ references(ref, actions = {}) {
420
+ this.foreignKeyConfigs.push({ ref, actions });
421
+ return this;
422
+ }
423
+ unique(name, config) {
424
+ this.config.isUnique = true;
425
+ this.config.uniqueName = name;
426
+ this.config.uniqueType = config?.nulls;
427
+ return this;
428
+ }
429
+ generatedAlwaysAs(as) {
430
+ this.config.generated = {
431
+ as,
432
+ type: "always",
433
+ mode: "stored"
434
+ };
435
+ return this;
436
+ }
437
+ /** @internal */
438
+ buildForeignKeys(column, table) {
439
+ return this.foreignKeyConfigs.map(({ ref, actions }) => {
440
+ return iife(
441
+ (ref2, actions2) => {
442
+ const builder = new ForeignKeyBuilder(() => {
443
+ const foreignColumn = ref2();
444
+ return { columns: [column], foreignColumns: [foreignColumn] };
445
+ });
446
+ if (actions2.onUpdate) {
447
+ builder.onUpdate(actions2.onUpdate);
448
+ }
449
+ if (actions2.onDelete) {
450
+ builder.onDelete(actions2.onDelete);
451
+ }
452
+ return builder.build(table);
453
+ },
454
+ ref,
455
+ actions
456
+ );
457
+ });
458
+ }
459
+ /** @internal */
460
+ buildExtraConfigColumn(table) {
461
+ return new ExtraConfigColumn(table, this.config);
462
+ }
463
+ };
464
+ var PgColumn = class extends Column {
465
+ constructor(table, config) {
466
+ if (!config.uniqueName) {
467
+ config.uniqueName = uniqueKeyName(table, [config.name]);
468
+ }
469
+ super(table, config);
470
+ this.table = table;
471
+ }
472
+ static [entityKind] = "PgColumn";
473
+ };
474
+ var ExtraConfigColumn = class extends PgColumn {
475
+ static [entityKind] = "ExtraConfigColumn";
476
+ getSQLType() {
477
+ return this.getSQLType();
478
+ }
479
+ indexConfig = {
480
+ order: this.config.order ?? "asc",
481
+ nulls: this.config.nulls ?? "last",
482
+ opClass: this.config.opClass
483
+ };
484
+ defaultConfig = {
485
+ order: "asc",
486
+ nulls: "last",
487
+ opClass: void 0
488
+ };
489
+ asc() {
490
+ this.indexConfig.order = "asc";
491
+ return this;
492
+ }
493
+ desc() {
494
+ this.indexConfig.order = "desc";
495
+ return this;
496
+ }
497
+ nullsFirst() {
498
+ this.indexConfig.nulls = "first";
499
+ return this;
500
+ }
501
+ nullsLast() {
502
+ this.indexConfig.nulls = "last";
503
+ return this;
504
+ }
505
+ /**
506
+ * ### PostgreSQL documentation quote
507
+ *
508
+ * > An operator class with optional parameters can be specified for each column of an index.
509
+ * The operator class identifies the operators to be used by the index for that column.
510
+ * For example, a B-tree index on four-byte integers would use the int4_ops class;
511
+ * this operator class includes comparison functions for four-byte integers.
512
+ * In practice the default operator class for the column's data type is usually sufficient.
513
+ * The main point of having operator classes is that for some data types, there could be more than one meaningful ordering.
514
+ * For example, we might want to sort a complex-number data type either by absolute value or by real part.
515
+ * We could do this by defining two operator classes for the data type and then selecting the proper class when creating an index.
516
+ * More information about operator classes check:
517
+ *
518
+ * ### Useful links
519
+ * https://www.postgresql.org/docs/current/sql-createindex.html
520
+ *
521
+ * https://www.postgresql.org/docs/current/indexes-opclass.html
522
+ *
523
+ * https://www.postgresql.org/docs/current/xindex.html
524
+ *
525
+ * ### Additional types
526
+ * If you have the `pg_vector` extension installed in your database, you can use the
527
+ * `vector_l2_ops`, `vector_ip_ops`, `vector_cosine_ops`, `vector_l1_ops`, `bit_hamming_ops`, `bit_jaccard_ops`, `halfvec_l2_ops`, `sparsevec_l2_ops` options, which are predefined types.
528
+ *
529
+ * **You can always specify any string you want in the operator class, in case Drizzle doesn't have it natively in its types**
530
+ *
531
+ * @param opClass
532
+ * @returns
533
+ */
534
+ op(opClass) {
535
+ this.indexConfig.opClass = opClass;
536
+ return this;
537
+ }
538
+ };
539
+ var IndexedColumn = class {
540
+ static [entityKind] = "IndexedColumn";
541
+ constructor(name, keyAsName, type, indexConfig) {
542
+ this.name = name;
543
+ this.keyAsName = keyAsName;
544
+ this.type = type;
545
+ this.indexConfig = indexConfig;
546
+ }
547
+ name;
548
+ keyAsName;
549
+ type;
550
+ indexConfig;
551
+ };
552
+ var PgArrayBuilder = class extends PgColumnBuilder {
553
+ static [entityKind] = "PgArrayBuilder";
554
+ constructor(name, baseBuilder, size) {
555
+ super(name, "array", "PgArray");
556
+ this.config.baseBuilder = baseBuilder;
557
+ this.config.size = size;
558
+ }
559
+ /** @internal */
560
+ build(table) {
561
+ const baseColumn = this.config.baseBuilder.build(table);
562
+ return new PgArray(
563
+ table,
564
+ this.config,
565
+ baseColumn
566
+ );
567
+ }
568
+ };
569
+ var PgArray = class _PgArray extends PgColumn {
570
+ constructor(table, config, baseColumn, range) {
571
+ super(table, config);
572
+ this.baseColumn = baseColumn;
573
+ this.range = range;
574
+ this.size = config.size;
575
+ }
576
+ size;
577
+ static [entityKind] = "PgArray";
578
+ getSQLType() {
579
+ return `${this.baseColumn.getSQLType()}[${typeof this.size === "number" ? this.size : ""}]`;
580
+ }
581
+ mapFromDriverValue(value) {
582
+ if (typeof value === "string") {
583
+ value = parsePgArray(value);
584
+ }
585
+ return value.map((v) => this.baseColumn.mapFromDriverValue(v));
586
+ }
587
+ mapToDriverValue(value, isNestedArray = false) {
588
+ const a = value.map(
589
+ (v) => v === null ? null : is(this.baseColumn, _PgArray) ? this.baseColumn.mapToDriverValue(v, true) : this.baseColumn.mapToDriverValue(v)
590
+ );
591
+ if (isNestedArray) return a;
592
+ return makePgArray(a);
593
+ }
594
+ };
595
+
596
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/pg-core/columns/enum.js
597
+ var PgEnumObjectColumnBuilder = class extends PgColumnBuilder {
598
+ static [entityKind] = "PgEnumObjectColumnBuilder";
599
+ constructor(name, enumInstance) {
600
+ super(name, "string", "PgEnumObjectColumn");
601
+ this.config.enum = enumInstance;
602
+ }
603
+ /** @internal */
604
+ build(table) {
605
+ return new PgEnumObjectColumn(
606
+ table,
607
+ this.config
608
+ );
609
+ }
610
+ };
611
+ var PgEnumObjectColumn = class extends PgColumn {
612
+ static [entityKind] = "PgEnumObjectColumn";
613
+ enum;
614
+ enumValues = this.config.enum.enumValues;
615
+ constructor(table, config) {
616
+ super(table, config);
617
+ this.enum = config.enum;
618
+ }
619
+ getSQLType() {
620
+ return this.enum.enumName;
621
+ }
622
+ };
623
+ var isPgEnumSym = /* @__PURE__ */ Symbol.for("drizzle:isPgEnum");
624
+ function isPgEnum(obj) {
625
+ return !!obj && typeof obj === "function" && isPgEnumSym in obj && obj[isPgEnumSym] === true;
626
+ }
627
+ var PgEnumColumnBuilder = class extends PgColumnBuilder {
628
+ static [entityKind] = "PgEnumColumnBuilder";
629
+ constructor(name, enumInstance) {
630
+ super(name, "string", "PgEnumColumn");
631
+ this.config.enum = enumInstance;
632
+ }
633
+ /** @internal */
634
+ build(table) {
635
+ return new PgEnumColumn(
636
+ table,
637
+ this.config
638
+ );
639
+ }
640
+ };
641
+ var PgEnumColumn = class extends PgColumn {
642
+ static [entityKind] = "PgEnumColumn";
643
+ enum = this.config.enum;
644
+ enumValues = this.config.enum.enumValues;
645
+ constructor(table, config) {
646
+ super(table, config);
647
+ this.enum = config.enum;
648
+ }
649
+ getSQLType() {
650
+ return this.enum.enumName;
651
+ }
652
+ };
653
+
654
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/subquery.js
655
+ var Subquery = class {
656
+ static [entityKind] = "Subquery";
657
+ constructor(sql2, fields, alias, isWith = false, usedTables = []) {
658
+ this._ = {
659
+ brand: "Subquery",
660
+ sql: sql2,
661
+ selectedFields: fields,
662
+ alias,
663
+ isWith,
664
+ usedTables
665
+ };
666
+ }
667
+ // getSQL(): SQL<unknown> {
668
+ // return new SQL([this]);
669
+ // }
670
+ };
671
+ var WithSubquery = class extends Subquery {
672
+ static [entityKind] = "WithSubquery";
673
+ };
674
+
675
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/view-common.js
676
+ var ViewBaseConfig = /* @__PURE__ */ Symbol.for("drizzle:ViewBaseConfig");
677
+
678
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/table.js
679
+ var Schema = /* @__PURE__ */ Symbol.for("drizzle:Schema");
680
+ var Columns = /* @__PURE__ */ Symbol.for("drizzle:Columns");
681
+ var ExtraConfigColumns = /* @__PURE__ */ Symbol.for("drizzle:ExtraConfigColumns");
682
+ var OriginalName = /* @__PURE__ */ Symbol.for("drizzle:OriginalName");
683
+ var BaseName = /* @__PURE__ */ Symbol.for("drizzle:BaseName");
684
+ var IsAlias = /* @__PURE__ */ Symbol.for("drizzle:IsAlias");
685
+ var ExtraConfigBuilder = /* @__PURE__ */ Symbol.for("drizzle:ExtraConfigBuilder");
686
+ var IsDrizzleTable = /* @__PURE__ */ Symbol.for("drizzle:IsDrizzleTable");
687
+ var Table = class {
688
+ static [entityKind] = "Table";
689
+ /** @internal */
690
+ static Symbol = {
691
+ Name: TableName,
692
+ Schema,
693
+ OriginalName,
694
+ Columns,
695
+ ExtraConfigColumns,
696
+ BaseName,
697
+ IsAlias,
698
+ ExtraConfigBuilder
699
+ };
700
+ /**
701
+ * @internal
702
+ * Can be changed if the table is aliased.
703
+ */
704
+ [TableName];
705
+ /**
706
+ * @internal
707
+ * Used to store the original name of the table, before any aliasing.
708
+ */
709
+ [OriginalName];
710
+ /** @internal */
711
+ [Schema];
712
+ /** @internal */
713
+ [Columns];
714
+ /** @internal */
715
+ [ExtraConfigColumns];
716
+ /**
717
+ * @internal
718
+ * Used to store the table name before the transformation via the `tableCreator` functions.
719
+ */
720
+ [BaseName];
721
+ /** @internal */
722
+ [IsAlias] = false;
723
+ /** @internal */
724
+ [IsDrizzleTable] = true;
725
+ /** @internal */
726
+ [ExtraConfigBuilder] = void 0;
727
+ constructor(name, schema, baseName) {
728
+ this[TableName] = this[OriginalName] = name;
729
+ this[Schema] = schema;
730
+ this[BaseName] = baseName;
731
+ }
732
+ };
733
+ function getTableName(table) {
734
+ return table[TableName];
735
+ }
736
+ function getTableUniqueName(table) {
737
+ return `${table[Schema] ?? "public"}.${table[TableName]}`;
738
+ }
739
+
740
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/sql/sql.js
741
+ var FakePrimitiveParam = class {
742
+ static [entityKind] = "FakePrimitiveParam";
743
+ };
744
+ function isSQLWrapper(value) {
745
+ return value !== null && value !== void 0 && typeof value.getSQL === "function";
746
+ }
747
+ function mergeQueries(queries) {
748
+ const result = { sql: "", params: [] };
749
+ for (const query of queries) {
750
+ result.sql += query.sql;
751
+ result.params.push(...query.params);
752
+ if (query.typings?.length) {
753
+ if (!result.typings) {
754
+ result.typings = [];
755
+ }
756
+ result.typings.push(...query.typings);
757
+ }
758
+ }
759
+ return result;
760
+ }
761
+ var StringChunk = class {
762
+ static [entityKind] = "StringChunk";
763
+ value;
764
+ constructor(value) {
765
+ this.value = Array.isArray(value) ? value : [value];
766
+ }
767
+ getSQL() {
768
+ return new SQL([this]);
769
+ }
770
+ };
771
+ var SQL = class _SQL {
772
+ constructor(queryChunks) {
773
+ this.queryChunks = queryChunks;
774
+ for (const chunk of queryChunks) {
775
+ if (is(chunk, Table)) {
776
+ const schemaName = chunk[Table.Symbol.Schema];
777
+ this.usedTables.push(
778
+ schemaName === void 0 ? chunk[Table.Symbol.Name] : schemaName + "." + chunk[Table.Symbol.Name]
779
+ );
780
+ }
781
+ }
782
+ }
783
+ static [entityKind] = "SQL";
784
+ /** @internal */
785
+ decoder = noopDecoder;
786
+ shouldInlineParams = false;
787
+ /** @internal */
788
+ usedTables = [];
789
+ append(query) {
790
+ this.queryChunks.push(...query.queryChunks);
791
+ return this;
792
+ }
793
+ toQuery(config) {
794
+ return tracer.startActiveSpan("drizzle.buildSQL", (span) => {
795
+ const query = this.buildQueryFromSourceParams(this.queryChunks, config);
796
+ span?.setAttributes({
797
+ "drizzle.query.text": query.sql,
798
+ "drizzle.query.params": JSON.stringify(query.params)
799
+ });
800
+ return query;
801
+ });
802
+ }
803
+ buildQueryFromSourceParams(chunks, _config) {
804
+ const config = Object.assign({}, _config, {
805
+ inlineParams: _config.inlineParams || this.shouldInlineParams,
806
+ paramStartIndex: _config.paramStartIndex || { value: 0 }
807
+ });
808
+ const {
809
+ casing,
810
+ escapeName,
811
+ escapeParam,
812
+ prepareTyping,
813
+ inlineParams,
814
+ paramStartIndex
815
+ } = config;
816
+ return mergeQueries(chunks.map((chunk) => {
817
+ if (is(chunk, StringChunk)) {
818
+ return { sql: chunk.value.join(""), params: [] };
819
+ }
820
+ if (is(chunk, Name)) {
821
+ return { sql: escapeName(chunk.value), params: [] };
822
+ }
823
+ if (chunk === void 0) {
824
+ return { sql: "", params: [] };
825
+ }
826
+ if (Array.isArray(chunk)) {
827
+ const result = [new StringChunk("(")];
828
+ for (const [i, p] of chunk.entries()) {
829
+ result.push(p);
830
+ if (i < chunk.length - 1) {
831
+ result.push(new StringChunk(", "));
832
+ }
833
+ }
834
+ result.push(new StringChunk(")"));
835
+ return this.buildQueryFromSourceParams(result, config);
836
+ }
837
+ if (is(chunk, _SQL)) {
838
+ return this.buildQueryFromSourceParams(chunk.queryChunks, {
839
+ ...config,
840
+ inlineParams: inlineParams || chunk.shouldInlineParams
841
+ });
842
+ }
843
+ if (is(chunk, Table)) {
844
+ const schemaName = chunk[Table.Symbol.Schema];
845
+ const tableName = chunk[Table.Symbol.Name];
846
+ return {
847
+ sql: schemaName === void 0 || chunk[IsAlias] ? escapeName(tableName) : escapeName(schemaName) + "." + escapeName(tableName),
848
+ params: []
849
+ };
850
+ }
851
+ if (is(chunk, Column)) {
852
+ const columnName = casing.getColumnCasing(chunk);
853
+ if (_config.invokeSource === "indexes") {
854
+ return { sql: escapeName(columnName), params: [] };
855
+ }
856
+ const schemaName = chunk.table[Table.Symbol.Schema];
857
+ return {
858
+ sql: chunk.table[IsAlias] || schemaName === void 0 ? escapeName(chunk.table[Table.Symbol.Name]) + "." + escapeName(columnName) : escapeName(schemaName) + "." + escapeName(chunk.table[Table.Symbol.Name]) + "." + escapeName(columnName),
859
+ params: []
860
+ };
861
+ }
862
+ if (is(chunk, View)) {
863
+ const schemaName = chunk[ViewBaseConfig].schema;
864
+ const viewName = chunk[ViewBaseConfig].name;
865
+ return {
866
+ sql: schemaName === void 0 || chunk[ViewBaseConfig].isAlias ? escapeName(viewName) : escapeName(schemaName) + "." + escapeName(viewName),
867
+ params: []
868
+ };
869
+ }
870
+ if (is(chunk, Param)) {
871
+ if (is(chunk.value, Placeholder)) {
872
+ return { sql: escapeParam(paramStartIndex.value++, chunk), params: [chunk], typings: ["none"] };
873
+ }
874
+ const mappedValue = chunk.value === null ? null : chunk.encoder.mapToDriverValue(chunk.value);
875
+ if (is(mappedValue, _SQL)) {
876
+ return this.buildQueryFromSourceParams([mappedValue], config);
877
+ }
878
+ if (inlineParams) {
879
+ return { sql: this.mapInlineParam(mappedValue, config), params: [] };
880
+ }
881
+ let typings = ["none"];
882
+ if (prepareTyping) {
883
+ typings = [prepareTyping(chunk.encoder)];
884
+ }
885
+ return { sql: escapeParam(paramStartIndex.value++, mappedValue), params: [mappedValue], typings };
886
+ }
887
+ if (is(chunk, Placeholder)) {
888
+ return { sql: escapeParam(paramStartIndex.value++, chunk), params: [chunk], typings: ["none"] };
889
+ }
890
+ if (is(chunk, _SQL.Aliased) && chunk.fieldAlias !== void 0) {
891
+ return { sql: escapeName(chunk.fieldAlias), params: [] };
892
+ }
893
+ if (is(chunk, Subquery)) {
894
+ if (chunk._.isWith) {
895
+ return { sql: escapeName(chunk._.alias), params: [] };
896
+ }
897
+ return this.buildQueryFromSourceParams([
898
+ new StringChunk("("),
899
+ chunk._.sql,
900
+ new StringChunk(") "),
901
+ new Name(chunk._.alias)
902
+ ], config);
903
+ }
904
+ if (isPgEnum(chunk)) {
905
+ if (chunk.schema) {
906
+ return { sql: escapeName(chunk.schema) + "." + escapeName(chunk.enumName), params: [] };
907
+ }
908
+ return { sql: escapeName(chunk.enumName), params: [] };
909
+ }
910
+ if (isSQLWrapper(chunk)) {
911
+ if (chunk.shouldOmitSQLParens?.()) {
912
+ return this.buildQueryFromSourceParams([chunk.getSQL()], config);
913
+ }
914
+ return this.buildQueryFromSourceParams([
915
+ new StringChunk("("),
916
+ chunk.getSQL(),
917
+ new StringChunk(")")
918
+ ], config);
919
+ }
920
+ if (inlineParams) {
921
+ return { sql: this.mapInlineParam(chunk, config), params: [] };
922
+ }
923
+ return { sql: escapeParam(paramStartIndex.value++, chunk), params: [chunk], typings: ["none"] };
924
+ }));
925
+ }
926
+ mapInlineParam(chunk, { escapeString }) {
927
+ if (chunk === null) {
928
+ return "null";
929
+ }
930
+ if (typeof chunk === "number" || typeof chunk === "boolean") {
931
+ return chunk.toString();
932
+ }
933
+ if (typeof chunk === "string") {
934
+ return escapeString(chunk);
935
+ }
936
+ if (typeof chunk === "object") {
937
+ const mappedValueAsString = chunk.toString();
938
+ if (mappedValueAsString === "[object Object]") {
939
+ return escapeString(JSON.stringify(chunk));
940
+ }
941
+ return escapeString(mappedValueAsString);
942
+ }
943
+ throw new Error("Unexpected param value: " + chunk);
944
+ }
945
+ getSQL() {
946
+ return this;
947
+ }
948
+ as(alias) {
949
+ if (alias === void 0) {
950
+ return this;
951
+ }
952
+ return new _SQL.Aliased(this, alias);
953
+ }
954
+ mapWith(decoder) {
955
+ this.decoder = typeof decoder === "function" ? { mapFromDriverValue: decoder } : decoder;
956
+ return this;
957
+ }
958
+ inlineParams() {
959
+ this.shouldInlineParams = true;
960
+ return this;
961
+ }
962
+ /**
963
+ * This method is used to conditionally include a part of the query.
964
+ *
965
+ * @param condition - Condition to check
966
+ * @returns itself if the condition is `true`, otherwise `undefined`
967
+ */
968
+ if(condition) {
969
+ return condition ? this : void 0;
970
+ }
971
+ };
972
+ var Name = class {
973
+ constructor(value) {
974
+ this.value = value;
975
+ }
976
+ static [entityKind] = "Name";
977
+ brand;
978
+ getSQL() {
979
+ return new SQL([this]);
980
+ }
981
+ };
982
+ function isDriverValueEncoder(value) {
983
+ return typeof value === "object" && value !== null && "mapToDriverValue" in value && typeof value.mapToDriverValue === "function";
984
+ }
985
+ var noopDecoder = {
986
+ mapFromDriverValue: (value) => value
987
+ };
988
+ var noopEncoder = {
989
+ mapToDriverValue: (value) => value
990
+ };
991
+ var noopMapper = {
992
+ ...noopDecoder,
993
+ ...noopEncoder
994
+ };
995
+ var Param = class {
996
+ /**
997
+ * @param value - Parameter value
998
+ * @param encoder - Encoder to convert the value to a driver parameter
999
+ */
1000
+ constructor(value, encoder = noopEncoder) {
1001
+ this.value = value;
1002
+ this.encoder = encoder;
1003
+ }
1004
+ static [entityKind] = "Param";
1005
+ brand;
1006
+ getSQL() {
1007
+ return new SQL([this]);
1008
+ }
1009
+ };
1010
+ function sql(strings, ...params) {
1011
+ const queryChunks = [];
1012
+ if (params.length > 0 || strings.length > 0 && strings[0] !== "") {
1013
+ queryChunks.push(new StringChunk(strings[0]));
1014
+ }
1015
+ for (const [paramIndex, param2] of params.entries()) {
1016
+ queryChunks.push(param2, new StringChunk(strings[paramIndex + 1]));
1017
+ }
1018
+ return new SQL(queryChunks);
1019
+ }
1020
+ ((sql2) => {
1021
+ function empty() {
1022
+ return new SQL([]);
1023
+ }
1024
+ sql2.empty = empty;
1025
+ function fromList(list) {
1026
+ return new SQL(list);
1027
+ }
1028
+ sql2.fromList = fromList;
1029
+ function raw(str) {
1030
+ return new SQL([new StringChunk(str)]);
1031
+ }
1032
+ sql2.raw = raw;
1033
+ function join(chunks, separator) {
1034
+ const result = [];
1035
+ for (const [i, chunk] of chunks.entries()) {
1036
+ if (i > 0 && separator !== void 0) {
1037
+ result.push(separator);
1038
+ }
1039
+ result.push(chunk);
1040
+ }
1041
+ return new SQL(result);
1042
+ }
1043
+ sql2.join = join;
1044
+ function identifier(value) {
1045
+ return new Name(value);
1046
+ }
1047
+ sql2.identifier = identifier;
1048
+ function placeholder2(name2) {
1049
+ return new Placeholder(name2);
1050
+ }
1051
+ sql2.placeholder = placeholder2;
1052
+ function param2(value, encoder) {
1053
+ return new Param(value, encoder);
1054
+ }
1055
+ sql2.param = param2;
1056
+ })(sql || (sql = {}));
1057
+ ((SQL2) => {
1058
+ class Aliased {
1059
+ constructor(sql2, fieldAlias) {
1060
+ this.sql = sql2;
1061
+ this.fieldAlias = fieldAlias;
1062
+ }
1063
+ static [entityKind] = "SQL.Aliased";
1064
+ /** @internal */
1065
+ isSelectionField = false;
1066
+ getSQL() {
1067
+ return this.sql;
1068
+ }
1069
+ /** @internal */
1070
+ clone() {
1071
+ return new Aliased(this.sql, this.fieldAlias);
1072
+ }
1073
+ }
1074
+ SQL2.Aliased = Aliased;
1075
+ })(SQL || (SQL = {}));
1076
+ var Placeholder = class {
1077
+ constructor(name2) {
1078
+ this.name = name2;
1079
+ }
1080
+ static [entityKind] = "Placeholder";
1081
+ getSQL() {
1082
+ return new SQL([this]);
1083
+ }
1084
+ };
1085
+ function fillPlaceholders(params, values) {
1086
+ return params.map((p) => {
1087
+ if (is(p, Placeholder)) {
1088
+ if (!(p.name in values)) {
1089
+ throw new Error(`No value for placeholder "${p.name}" was provided`);
1090
+ }
1091
+ return values[p.name];
1092
+ }
1093
+ if (is(p, Param) && is(p.value, Placeholder)) {
1094
+ if (!(p.value.name in values)) {
1095
+ throw new Error(`No value for placeholder "${p.value.name}" was provided`);
1096
+ }
1097
+ return p.encoder.mapToDriverValue(values[p.value.name]);
1098
+ }
1099
+ return p;
1100
+ });
1101
+ }
1102
+ var IsDrizzleView = /* @__PURE__ */ Symbol.for("drizzle:IsDrizzleView");
1103
+ var View = class {
1104
+ static [entityKind] = "View";
1105
+ /** @internal */
1106
+ [ViewBaseConfig];
1107
+ /** @internal */
1108
+ [IsDrizzleView] = true;
1109
+ constructor({ name: name2, schema, selectedFields, query }) {
1110
+ this[ViewBaseConfig] = {
1111
+ name: name2,
1112
+ originalName: name2,
1113
+ schema,
1114
+ selectedFields,
1115
+ query,
1116
+ isExisting: !query,
1117
+ isAlias: false
1118
+ };
1119
+ }
1120
+ getSQL() {
1121
+ return new SQL([this]);
1122
+ }
1123
+ };
1124
+ Column.prototype.getSQL = function() {
1125
+ return new SQL([this]);
1126
+ };
1127
+ Table.prototype.getSQL = function() {
1128
+ return new SQL([this]);
1129
+ };
1130
+ Subquery.prototype.getSQL = function() {
1131
+ return new SQL([this]);
1132
+ };
1133
+
1134
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/utils.js
1135
+ function mapResultRow(columns, row, joinsNotNullableMap) {
1136
+ const nullifyMap = {};
1137
+ const result = columns.reduce(
1138
+ (result2, { path, field }, columnIndex) => {
1139
+ let decoder;
1140
+ if (is(field, Column)) {
1141
+ decoder = field;
1142
+ } else if (is(field, SQL)) {
1143
+ decoder = field.decoder;
1144
+ } else if (is(field, Subquery)) {
1145
+ decoder = field._.sql.decoder;
1146
+ } else {
1147
+ decoder = field.sql.decoder;
1148
+ }
1149
+ let node = result2;
1150
+ for (const [pathChunkIndex, pathChunk] of path.entries()) {
1151
+ if (pathChunkIndex < path.length - 1) {
1152
+ if (!(pathChunk in node)) {
1153
+ node[pathChunk] = {};
1154
+ }
1155
+ node = node[pathChunk];
1156
+ } else {
1157
+ const rawValue = row[columnIndex];
1158
+ const value = node[pathChunk] = rawValue === null ? null : decoder.mapFromDriverValue(rawValue);
1159
+ if (joinsNotNullableMap && is(field, Column) && path.length === 2) {
1160
+ const objectName = path[0];
1161
+ if (!(objectName in nullifyMap)) {
1162
+ nullifyMap[objectName] = value === null ? getTableName(field.table) : false;
1163
+ } else if (typeof nullifyMap[objectName] === "string" && nullifyMap[objectName] !== getTableName(field.table)) {
1164
+ nullifyMap[objectName] = false;
1165
+ }
1166
+ }
1167
+ }
1168
+ }
1169
+ return result2;
1170
+ },
1171
+ {}
1172
+ );
1173
+ if (joinsNotNullableMap && Object.keys(nullifyMap).length > 0) {
1174
+ for (const [objectName, tableName] of Object.entries(nullifyMap)) {
1175
+ if (typeof tableName === "string" && !joinsNotNullableMap[tableName]) {
1176
+ result[objectName] = null;
1177
+ }
1178
+ }
1179
+ }
1180
+ return result;
1181
+ }
1182
+ function orderSelectedFields(fields, pathPrefix) {
1183
+ return Object.entries(fields).reduce((result, [name, field]) => {
1184
+ if (typeof name !== "string") {
1185
+ return result;
1186
+ }
1187
+ const newPath = pathPrefix ? [...pathPrefix, name] : [name];
1188
+ if (is(field, Column) || is(field, SQL) || is(field, SQL.Aliased) || is(field, Subquery)) {
1189
+ result.push({ path: newPath, field });
1190
+ } else if (is(field, Table)) {
1191
+ result.push(...orderSelectedFields(field[Table.Symbol.Columns], newPath));
1192
+ } else {
1193
+ result.push(...orderSelectedFields(field, newPath));
1194
+ }
1195
+ return result;
1196
+ }, []);
1197
+ }
1198
+ function haveSameKeys(left, right) {
1199
+ const leftKeys = Object.keys(left);
1200
+ const rightKeys = Object.keys(right);
1201
+ if (leftKeys.length !== rightKeys.length) {
1202
+ return false;
1203
+ }
1204
+ for (const [index, key] of leftKeys.entries()) {
1205
+ if (key !== rightKeys[index]) {
1206
+ return false;
1207
+ }
1208
+ }
1209
+ return true;
1210
+ }
1211
+ function mapUpdateSet(table, values) {
1212
+ const entries = Object.entries(values).filter(([, value]) => value !== void 0).map(([key, value]) => {
1213
+ if (is(value, SQL) || is(value, Column)) {
1214
+ return [key, value];
1215
+ } else {
1216
+ return [key, new Param(value, table[Table.Symbol.Columns][key])];
1217
+ }
1218
+ });
1219
+ if (entries.length === 0) {
1220
+ throw new Error("No values to set");
1221
+ }
1222
+ return Object.fromEntries(entries);
1223
+ }
1224
+ function applyMixins(baseClass, extendedClasses) {
1225
+ for (const extendedClass of extendedClasses) {
1226
+ for (const name of Object.getOwnPropertyNames(extendedClass.prototype)) {
1227
+ if (name === "constructor") continue;
1228
+ Object.defineProperty(
1229
+ baseClass.prototype,
1230
+ name,
1231
+ Object.getOwnPropertyDescriptor(extendedClass.prototype, name) || /* @__PURE__ */ Object.create(null)
1232
+ );
1233
+ }
1234
+ }
1235
+ }
1236
+ function getTableColumns(table) {
1237
+ return table[Table.Symbol.Columns];
1238
+ }
1239
+ function getTableLikeName(table) {
1240
+ return is(table, Subquery) ? table._.alias : is(table, View) ? table[ViewBaseConfig].name : is(table, SQL) ? void 0 : table[Table.Symbol.IsAlias] ? table[Table.Symbol.Name] : table[Table.Symbol.BaseName];
1241
+ }
1242
+ function getColumnNameAndConfig(a, b) {
1243
+ return {
1244
+ name: typeof a === "string" && a.length > 0 ? a : "",
1245
+ config: typeof a === "object" ? a : b
1246
+ };
1247
+ }
1248
+ function isConfig(data) {
1249
+ if (typeof data !== "object" || data === null) return false;
1250
+ if (data.constructor.name !== "Object") return false;
1251
+ if ("logger" in data) {
1252
+ const type = typeof data["logger"];
1253
+ if (type !== "boolean" && (type !== "object" || typeof data["logger"]["logQuery"] !== "function") && type !== "undefined") return false;
1254
+ return true;
1255
+ }
1256
+ if ("schema" in data) {
1257
+ const type = typeof data["schema"];
1258
+ if (type !== "object" && type !== "undefined") return false;
1259
+ return true;
1260
+ }
1261
+ if ("casing" in data) {
1262
+ const type = typeof data["casing"];
1263
+ if (type !== "string" && type !== "undefined") return false;
1264
+ return true;
1265
+ }
1266
+ if ("mode" in data) {
1267
+ if (data["mode"] !== "default" || data["mode"] !== "planetscale" || data["mode"] !== void 0) return false;
1268
+ return true;
1269
+ }
1270
+ if ("connection" in data) {
1271
+ const type = typeof data["connection"];
1272
+ if (type !== "string" && type !== "object" && type !== "undefined") return false;
1273
+ return true;
1274
+ }
1275
+ if ("client" in data) {
1276
+ const type = typeof data["client"];
1277
+ if (type !== "object" && type !== "function" && type !== "undefined") return false;
1278
+ return true;
1279
+ }
1280
+ if (Object.keys(data).length === 0) return true;
1281
+ return false;
1282
+ }
1283
+ var textDecoder = typeof TextDecoder === "undefined" ? null : new TextDecoder();
1284
+
1285
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/pg-core/columns/int.common.js
1286
+ var PgIntColumnBaseBuilder = class extends PgColumnBuilder {
1287
+ static [entityKind] = "PgIntColumnBaseBuilder";
1288
+ generatedAlwaysAsIdentity(sequence) {
1289
+ if (sequence) {
1290
+ const { name, ...options } = sequence;
1291
+ this.config.generatedIdentity = {
1292
+ type: "always",
1293
+ sequenceName: name,
1294
+ sequenceOptions: options
1295
+ };
1296
+ } else {
1297
+ this.config.generatedIdentity = {
1298
+ type: "always"
1299
+ };
1300
+ }
1301
+ this.config.hasDefault = true;
1302
+ this.config.notNull = true;
1303
+ return this;
1304
+ }
1305
+ generatedByDefaultAsIdentity(sequence) {
1306
+ if (sequence) {
1307
+ const { name, ...options } = sequence;
1308
+ this.config.generatedIdentity = {
1309
+ type: "byDefault",
1310
+ sequenceName: name,
1311
+ sequenceOptions: options
1312
+ };
1313
+ } else {
1314
+ this.config.generatedIdentity = {
1315
+ type: "byDefault"
1316
+ };
1317
+ }
1318
+ this.config.hasDefault = true;
1319
+ this.config.notNull = true;
1320
+ return this;
1321
+ }
1322
+ };
1323
+
1324
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/pg-core/columns/bigint.js
1325
+ var PgBigInt53Builder = class extends PgIntColumnBaseBuilder {
1326
+ static [entityKind] = "PgBigInt53Builder";
1327
+ constructor(name) {
1328
+ super(name, "number", "PgBigInt53");
1329
+ }
1330
+ /** @internal */
1331
+ build(table) {
1332
+ return new PgBigInt53(table, this.config);
1333
+ }
1334
+ };
1335
+ var PgBigInt53 = class extends PgColumn {
1336
+ static [entityKind] = "PgBigInt53";
1337
+ getSQLType() {
1338
+ return "bigint";
1339
+ }
1340
+ mapFromDriverValue(value) {
1341
+ if (typeof value === "number") {
1342
+ return value;
1343
+ }
1344
+ return Number(value);
1345
+ }
1346
+ };
1347
+ var PgBigInt64Builder = class extends PgIntColumnBaseBuilder {
1348
+ static [entityKind] = "PgBigInt64Builder";
1349
+ constructor(name) {
1350
+ super(name, "bigint", "PgBigInt64");
1351
+ }
1352
+ /** @internal */
1353
+ build(table) {
1354
+ return new PgBigInt64(
1355
+ table,
1356
+ this.config
1357
+ );
1358
+ }
1359
+ };
1360
+ var PgBigInt64 = class extends PgColumn {
1361
+ static [entityKind] = "PgBigInt64";
1362
+ getSQLType() {
1363
+ return "bigint";
1364
+ }
1365
+ // eslint-disable-next-line unicorn/prefer-native-coercion-functions
1366
+ mapFromDriverValue(value) {
1367
+ return BigInt(value);
1368
+ }
1369
+ };
1370
+ function bigint(a, b) {
1371
+ const { name, config } = getColumnNameAndConfig(a, b);
1372
+ if (config.mode === "number") {
1373
+ return new PgBigInt53Builder(name);
1374
+ }
1375
+ return new PgBigInt64Builder(name);
1376
+ }
1377
+
1378
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/pg-core/columns/boolean.js
1379
+ var PgBooleanBuilder = class extends PgColumnBuilder {
1380
+ static [entityKind] = "PgBooleanBuilder";
1381
+ constructor(name) {
1382
+ super(name, "boolean", "PgBoolean");
1383
+ }
1384
+ /** @internal */
1385
+ build(table) {
1386
+ return new PgBoolean(table, this.config);
1387
+ }
1388
+ };
1389
+ var PgBoolean = class extends PgColumn {
1390
+ static [entityKind] = "PgBoolean";
1391
+ getSQLType() {
1392
+ return "boolean";
1393
+ }
1394
+ };
1395
+ function boolean(name) {
1396
+ return new PgBooleanBuilder(name ?? "");
1397
+ }
1398
+
1399
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/pg-core/columns/integer.js
1400
+ var PgIntegerBuilder = class extends PgIntColumnBaseBuilder {
1401
+ static [entityKind] = "PgIntegerBuilder";
1402
+ constructor(name) {
1403
+ super(name, "number", "PgInteger");
1404
+ }
1405
+ /** @internal */
1406
+ build(table) {
1407
+ return new PgInteger(table, this.config);
1408
+ }
1409
+ };
1410
+ var PgInteger = class extends PgColumn {
1411
+ static [entityKind] = "PgInteger";
1412
+ getSQLType() {
1413
+ return "integer";
1414
+ }
1415
+ mapFromDriverValue(value) {
1416
+ if (typeof value === "string") {
1417
+ return Number.parseInt(value);
1418
+ }
1419
+ return value;
1420
+ }
1421
+ };
1422
+ function integer(name) {
1423
+ return new PgIntegerBuilder(name ?? "");
1424
+ }
1425
+
1426
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/pg-core/columns/jsonb.js
1427
+ var PgJsonbBuilder = class extends PgColumnBuilder {
1428
+ static [entityKind] = "PgJsonbBuilder";
1429
+ constructor(name) {
1430
+ super(name, "json", "PgJsonb");
1431
+ }
1432
+ /** @internal */
1433
+ build(table) {
1434
+ return new PgJsonb(table, this.config);
1435
+ }
1436
+ };
1437
+ var PgJsonb = class extends PgColumn {
1438
+ static [entityKind] = "PgJsonb";
1439
+ constructor(table, config) {
1440
+ super(table, config);
1441
+ }
1442
+ getSQLType() {
1443
+ return "jsonb";
1444
+ }
1445
+ mapToDriverValue(value) {
1446
+ return JSON.stringify(value);
1447
+ }
1448
+ mapFromDriverValue(value) {
1449
+ if (typeof value === "string") {
1450
+ try {
1451
+ return JSON.parse(value);
1452
+ } catch {
1453
+ return value;
1454
+ }
1455
+ }
1456
+ return value;
1457
+ }
1458
+ };
1459
+ function jsonb(name) {
1460
+ return new PgJsonbBuilder(name ?? "");
1461
+ }
1462
+
1463
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/pg-core/columns/text.js
1464
+ var PgTextBuilder = class extends PgColumnBuilder {
1465
+ static [entityKind] = "PgTextBuilder";
1466
+ constructor(name, config) {
1467
+ super(name, "string", "PgText");
1468
+ this.config.enumValues = config.enum;
1469
+ }
1470
+ /** @internal */
1471
+ build(table) {
1472
+ return new PgText(table, this.config);
1473
+ }
1474
+ };
1475
+ var PgText = class extends PgColumn {
1476
+ static [entityKind] = "PgText";
1477
+ enumValues = this.config.enumValues;
1478
+ getSQLType() {
1479
+ return "text";
1480
+ }
1481
+ };
1482
+ function text(a, b = {}) {
1483
+ const { name, config } = getColumnNameAndConfig(a, b);
1484
+ return new PgTextBuilder(name, config);
1485
+ }
1486
+
1487
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/pg-core/columns/date.common.js
1488
+ var PgDateColumnBaseBuilder = class extends PgColumnBuilder {
1489
+ static [entityKind] = "PgDateColumnBaseBuilder";
1490
+ defaultNow() {
1491
+ return this.default(sql`now()`);
1492
+ }
1493
+ };
1494
+
1495
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/pg-core/columns/timestamp.js
1496
+ var PgTimestampBuilder = class extends PgDateColumnBaseBuilder {
1497
+ static [entityKind] = "PgTimestampBuilder";
1498
+ constructor(name, withTimezone, precision) {
1499
+ super(name, "date", "PgTimestamp");
1500
+ this.config.withTimezone = withTimezone;
1501
+ this.config.precision = precision;
1502
+ }
1503
+ /** @internal */
1504
+ build(table) {
1505
+ return new PgTimestamp(table, this.config);
1506
+ }
1507
+ };
1508
+ var PgTimestamp = class extends PgColumn {
1509
+ static [entityKind] = "PgTimestamp";
1510
+ withTimezone;
1511
+ precision;
1512
+ constructor(table, config) {
1513
+ super(table, config);
1514
+ this.withTimezone = config.withTimezone;
1515
+ this.precision = config.precision;
1516
+ }
1517
+ getSQLType() {
1518
+ const precision = this.precision === void 0 ? "" : ` (${this.precision})`;
1519
+ return `timestamp${precision}${this.withTimezone ? " with time zone" : ""}`;
1520
+ }
1521
+ mapFromDriverValue(value) {
1522
+ if (typeof value === "string") return new Date(this.withTimezone ? value : value + "+0000");
1523
+ return value;
1524
+ }
1525
+ mapToDriverValue = (value) => {
1526
+ return value.toISOString();
1527
+ };
1528
+ };
1529
+ var PgTimestampStringBuilder = class extends PgDateColumnBaseBuilder {
1530
+ static [entityKind] = "PgTimestampStringBuilder";
1531
+ constructor(name, withTimezone, precision) {
1532
+ super(name, "string", "PgTimestampString");
1533
+ this.config.withTimezone = withTimezone;
1534
+ this.config.precision = precision;
1535
+ }
1536
+ /** @internal */
1537
+ build(table) {
1538
+ return new PgTimestampString(
1539
+ table,
1540
+ this.config
1541
+ );
1542
+ }
1543
+ };
1544
+ var PgTimestampString = class extends PgColumn {
1545
+ static [entityKind] = "PgTimestampString";
1546
+ withTimezone;
1547
+ precision;
1548
+ constructor(table, config) {
1549
+ super(table, config);
1550
+ this.withTimezone = config.withTimezone;
1551
+ this.precision = config.precision;
1552
+ }
1553
+ getSQLType() {
1554
+ const precision = this.precision === void 0 ? "" : `(${this.precision})`;
1555
+ return `timestamp${precision}${this.withTimezone ? " with time zone" : ""}`;
1556
+ }
1557
+ mapFromDriverValue(value) {
1558
+ if (typeof value === "string") return value;
1559
+ const shortened = value.toISOString().slice(0, -1).replace("T", " ");
1560
+ if (this.withTimezone) {
1561
+ const offset = value.getTimezoneOffset();
1562
+ const sign = offset <= 0 ? "+" : "-";
1563
+ return `${shortened}${sign}${Math.floor(Math.abs(offset) / 60).toString().padStart(2, "0")}`;
1564
+ }
1565
+ return shortened;
1566
+ }
1567
+ };
1568
+ function timestamp(a, b = {}) {
1569
+ const { name, config } = getColumnNameAndConfig(a, b);
1570
+ if (config?.mode === "string") {
1571
+ return new PgTimestampStringBuilder(name, config.withTimezone ?? false, config.precision);
1572
+ }
1573
+ return new PgTimestampBuilder(name, config?.withTimezone ?? false, config?.precision);
1574
+ }
1575
+
1576
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/pg-core/columns/bigserial.js
1577
+ var PgBigSerial53Builder = class extends PgColumnBuilder {
1578
+ static [entityKind] = "PgBigSerial53Builder";
1579
+ constructor(name) {
1580
+ super(name, "number", "PgBigSerial53");
1581
+ this.config.hasDefault = true;
1582
+ this.config.notNull = true;
1583
+ }
1584
+ /** @internal */
1585
+ build(table) {
1586
+ return new PgBigSerial53(
1587
+ table,
1588
+ this.config
1589
+ );
1590
+ }
1591
+ };
1592
+ var PgBigSerial53 = class extends PgColumn {
1593
+ static [entityKind] = "PgBigSerial53";
1594
+ getSQLType() {
1595
+ return "bigserial";
1596
+ }
1597
+ mapFromDriverValue(value) {
1598
+ if (typeof value === "number") {
1599
+ return value;
1600
+ }
1601
+ return Number(value);
1602
+ }
1603
+ };
1604
+ var PgBigSerial64Builder = class extends PgColumnBuilder {
1605
+ static [entityKind] = "PgBigSerial64Builder";
1606
+ constructor(name) {
1607
+ super(name, "bigint", "PgBigSerial64");
1608
+ this.config.hasDefault = true;
1609
+ }
1610
+ /** @internal */
1611
+ build(table) {
1612
+ return new PgBigSerial64(
1613
+ table,
1614
+ this.config
1615
+ );
1616
+ }
1617
+ };
1618
+ var PgBigSerial64 = class extends PgColumn {
1619
+ static [entityKind] = "PgBigSerial64";
1620
+ getSQLType() {
1621
+ return "bigserial";
1622
+ }
1623
+ // eslint-disable-next-line unicorn/prefer-native-coercion-functions
1624
+ mapFromDriverValue(value) {
1625
+ return BigInt(value);
1626
+ }
1627
+ };
1628
+ function bigserial(a, b) {
1629
+ const { name, config } = getColumnNameAndConfig(a, b);
1630
+ if (config.mode === "number") {
1631
+ return new PgBigSerial53Builder(name);
1632
+ }
1633
+ return new PgBigSerial64Builder(name);
1634
+ }
1635
+
1636
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/pg-core/columns/char.js
1637
+ var PgCharBuilder = class extends PgColumnBuilder {
1638
+ static [entityKind] = "PgCharBuilder";
1639
+ constructor(name, config) {
1640
+ super(name, "string", "PgChar");
1641
+ this.config.length = config.length;
1642
+ this.config.enumValues = config.enum;
1643
+ }
1644
+ /** @internal */
1645
+ build(table) {
1646
+ return new PgChar(
1647
+ table,
1648
+ this.config
1649
+ );
1650
+ }
1651
+ };
1652
+ var PgChar = class extends PgColumn {
1653
+ static [entityKind] = "PgChar";
1654
+ length = this.config.length;
1655
+ enumValues = this.config.enumValues;
1656
+ getSQLType() {
1657
+ return this.length === void 0 ? `char` : `char(${this.length})`;
1658
+ }
1659
+ };
1660
+ function char(a, b = {}) {
1661
+ const { name, config } = getColumnNameAndConfig(a, b);
1662
+ return new PgCharBuilder(name, config);
1663
+ }
1664
+
1665
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/pg-core/columns/cidr.js
1666
+ var PgCidrBuilder = class extends PgColumnBuilder {
1667
+ static [entityKind] = "PgCidrBuilder";
1668
+ constructor(name) {
1669
+ super(name, "string", "PgCidr");
1670
+ }
1671
+ /** @internal */
1672
+ build(table) {
1673
+ return new PgCidr(table, this.config);
1674
+ }
1675
+ };
1676
+ var PgCidr = class extends PgColumn {
1677
+ static [entityKind] = "PgCidr";
1678
+ getSQLType() {
1679
+ return "cidr";
1680
+ }
1681
+ };
1682
+ function cidr(name) {
1683
+ return new PgCidrBuilder(name ?? "");
1684
+ }
1685
+
1686
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/pg-core/columns/custom.js
1687
+ var PgCustomColumnBuilder = class extends PgColumnBuilder {
1688
+ static [entityKind] = "PgCustomColumnBuilder";
1689
+ constructor(name, fieldConfig, customTypeParams) {
1690
+ super(name, "custom", "PgCustomColumn");
1691
+ this.config.fieldConfig = fieldConfig;
1692
+ this.config.customTypeParams = customTypeParams;
1693
+ }
1694
+ /** @internal */
1695
+ build(table) {
1696
+ return new PgCustomColumn(
1697
+ table,
1698
+ this.config
1699
+ );
1700
+ }
1701
+ };
1702
+ var PgCustomColumn = class extends PgColumn {
1703
+ static [entityKind] = "PgCustomColumn";
1704
+ sqlName;
1705
+ mapTo;
1706
+ mapFrom;
1707
+ constructor(table, config) {
1708
+ super(table, config);
1709
+ this.sqlName = config.customTypeParams.dataType(config.fieldConfig);
1710
+ this.mapTo = config.customTypeParams.toDriver;
1711
+ this.mapFrom = config.customTypeParams.fromDriver;
1712
+ }
1713
+ getSQLType() {
1714
+ return this.sqlName;
1715
+ }
1716
+ mapFromDriverValue(value) {
1717
+ return typeof this.mapFrom === "function" ? this.mapFrom(value) : value;
1718
+ }
1719
+ mapToDriverValue(value) {
1720
+ return typeof this.mapTo === "function" ? this.mapTo(value) : value;
1721
+ }
1722
+ };
1723
+ function customType(customTypeParams) {
1724
+ return (a, b) => {
1725
+ const { name, config } = getColumnNameAndConfig(a, b);
1726
+ return new PgCustomColumnBuilder(name, config, customTypeParams);
1727
+ };
1728
+ }
1729
+
1730
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/pg-core/columns/date.js
1731
+ var PgDateBuilder = class extends PgDateColumnBaseBuilder {
1732
+ static [entityKind] = "PgDateBuilder";
1733
+ constructor(name) {
1734
+ super(name, "date", "PgDate");
1735
+ }
1736
+ /** @internal */
1737
+ build(table) {
1738
+ return new PgDate(table, this.config);
1739
+ }
1740
+ };
1741
+ var PgDate = class extends PgColumn {
1742
+ static [entityKind] = "PgDate";
1743
+ getSQLType() {
1744
+ return "date";
1745
+ }
1746
+ mapFromDriverValue(value) {
1747
+ if (typeof value === "string") return new Date(value);
1748
+ return value;
1749
+ }
1750
+ mapToDriverValue(value) {
1751
+ return value.toISOString();
1752
+ }
1753
+ };
1754
+ var PgDateStringBuilder = class extends PgDateColumnBaseBuilder {
1755
+ static [entityKind] = "PgDateStringBuilder";
1756
+ constructor(name) {
1757
+ super(name, "string", "PgDateString");
1758
+ }
1759
+ /** @internal */
1760
+ build(table) {
1761
+ return new PgDateString(
1762
+ table,
1763
+ this.config
1764
+ );
1765
+ }
1766
+ };
1767
+ var PgDateString = class extends PgColumn {
1768
+ static [entityKind] = "PgDateString";
1769
+ getSQLType() {
1770
+ return "date";
1771
+ }
1772
+ mapFromDriverValue(value) {
1773
+ if (typeof value === "string") return value;
1774
+ return value.toISOString().slice(0, -14);
1775
+ }
1776
+ };
1777
+ function date(a, b) {
1778
+ const { name, config } = getColumnNameAndConfig(a, b);
1779
+ if (config?.mode === "date") {
1780
+ return new PgDateBuilder(name);
1781
+ }
1782
+ return new PgDateStringBuilder(name);
1783
+ }
1784
+
1785
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/pg-core/columns/double-precision.js
1786
+ var PgDoublePrecisionBuilder = class extends PgColumnBuilder {
1787
+ static [entityKind] = "PgDoublePrecisionBuilder";
1788
+ constructor(name) {
1789
+ super(name, "number", "PgDoublePrecision");
1790
+ }
1791
+ /** @internal */
1792
+ build(table) {
1793
+ return new PgDoublePrecision(
1794
+ table,
1795
+ this.config
1796
+ );
1797
+ }
1798
+ };
1799
+ var PgDoublePrecision = class extends PgColumn {
1800
+ static [entityKind] = "PgDoublePrecision";
1801
+ getSQLType() {
1802
+ return "double precision";
1803
+ }
1804
+ mapFromDriverValue(value) {
1805
+ if (typeof value === "string") {
1806
+ return Number.parseFloat(value);
1807
+ }
1808
+ return value;
1809
+ }
1810
+ };
1811
+ function doublePrecision(name) {
1812
+ return new PgDoublePrecisionBuilder(name ?? "");
1813
+ }
1814
+
1815
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/pg-core/columns/inet.js
1816
+ var PgInetBuilder = class extends PgColumnBuilder {
1817
+ static [entityKind] = "PgInetBuilder";
1818
+ constructor(name) {
1819
+ super(name, "string", "PgInet");
1820
+ }
1821
+ /** @internal */
1822
+ build(table) {
1823
+ return new PgInet(table, this.config);
1824
+ }
1825
+ };
1826
+ var PgInet = class extends PgColumn {
1827
+ static [entityKind] = "PgInet";
1828
+ getSQLType() {
1829
+ return "inet";
1830
+ }
1831
+ };
1832
+ function inet(name) {
1833
+ return new PgInetBuilder(name ?? "");
1834
+ }
1835
+
1836
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/pg-core/columns/interval.js
1837
+ var PgIntervalBuilder = class extends PgColumnBuilder {
1838
+ static [entityKind] = "PgIntervalBuilder";
1839
+ constructor(name, intervalConfig) {
1840
+ super(name, "string", "PgInterval");
1841
+ this.config.intervalConfig = intervalConfig;
1842
+ }
1843
+ /** @internal */
1844
+ build(table) {
1845
+ return new PgInterval(table, this.config);
1846
+ }
1847
+ };
1848
+ var PgInterval = class extends PgColumn {
1849
+ static [entityKind] = "PgInterval";
1850
+ fields = this.config.intervalConfig.fields;
1851
+ precision = this.config.intervalConfig.precision;
1852
+ getSQLType() {
1853
+ const fields = this.fields ? ` ${this.fields}` : "";
1854
+ const precision = this.precision ? `(${this.precision})` : "";
1855
+ return `interval${fields}${precision}`;
1856
+ }
1857
+ };
1858
+ function interval(a, b = {}) {
1859
+ const { name, config } = getColumnNameAndConfig(a, b);
1860
+ return new PgIntervalBuilder(name, config);
1861
+ }
1862
+
1863
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/pg-core/columns/json.js
1864
+ var PgJsonBuilder = class extends PgColumnBuilder {
1865
+ static [entityKind] = "PgJsonBuilder";
1866
+ constructor(name) {
1867
+ super(name, "json", "PgJson");
1868
+ }
1869
+ /** @internal */
1870
+ build(table) {
1871
+ return new PgJson(table, this.config);
1872
+ }
1873
+ };
1874
+ var PgJson = class extends PgColumn {
1875
+ static [entityKind] = "PgJson";
1876
+ constructor(table, config) {
1877
+ super(table, config);
1878
+ }
1879
+ getSQLType() {
1880
+ return "json";
1881
+ }
1882
+ mapToDriverValue(value) {
1883
+ return JSON.stringify(value);
1884
+ }
1885
+ mapFromDriverValue(value) {
1886
+ if (typeof value === "string") {
1887
+ try {
1888
+ return JSON.parse(value);
1889
+ } catch {
1890
+ return value;
1891
+ }
1892
+ }
1893
+ return value;
1894
+ }
1895
+ };
1896
+ function json(name) {
1897
+ return new PgJsonBuilder(name ?? "");
1898
+ }
1899
+
1900
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/pg-core/columns/line.js
1901
+ var PgLineBuilder = class extends PgColumnBuilder {
1902
+ static [entityKind] = "PgLineBuilder";
1903
+ constructor(name) {
1904
+ super(name, "array", "PgLine");
1905
+ }
1906
+ /** @internal */
1907
+ build(table) {
1908
+ return new PgLineTuple(
1909
+ table,
1910
+ this.config
1911
+ );
1912
+ }
1913
+ };
1914
+ var PgLineTuple = class extends PgColumn {
1915
+ static [entityKind] = "PgLine";
1916
+ getSQLType() {
1917
+ return "line";
1918
+ }
1919
+ mapFromDriverValue(value) {
1920
+ const [a, b, c] = value.slice(1, -1).split(",");
1921
+ return [Number.parseFloat(a), Number.parseFloat(b), Number.parseFloat(c)];
1922
+ }
1923
+ mapToDriverValue(value) {
1924
+ return `{${value[0]},${value[1]},${value[2]}}`;
1925
+ }
1926
+ };
1927
+ var PgLineABCBuilder = class extends PgColumnBuilder {
1928
+ static [entityKind] = "PgLineABCBuilder";
1929
+ constructor(name) {
1930
+ super(name, "json", "PgLineABC");
1931
+ }
1932
+ /** @internal */
1933
+ build(table) {
1934
+ return new PgLineABC(
1935
+ table,
1936
+ this.config
1937
+ );
1938
+ }
1939
+ };
1940
+ var PgLineABC = class extends PgColumn {
1941
+ static [entityKind] = "PgLineABC";
1942
+ getSQLType() {
1943
+ return "line";
1944
+ }
1945
+ mapFromDriverValue(value) {
1946
+ const [a, b, c] = value.slice(1, -1).split(",");
1947
+ return { a: Number.parseFloat(a), b: Number.parseFloat(b), c: Number.parseFloat(c) };
1948
+ }
1949
+ mapToDriverValue(value) {
1950
+ return `{${value.a},${value.b},${value.c}}`;
1951
+ }
1952
+ };
1953
+ function line(a, b) {
1954
+ const { name, config } = getColumnNameAndConfig(a, b);
1955
+ if (!config?.mode || config.mode === "tuple") {
1956
+ return new PgLineBuilder(name);
1957
+ }
1958
+ return new PgLineABCBuilder(name);
1959
+ }
1960
+
1961
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/pg-core/columns/macaddr.js
1962
+ var PgMacaddrBuilder = class extends PgColumnBuilder {
1963
+ static [entityKind] = "PgMacaddrBuilder";
1964
+ constructor(name) {
1965
+ super(name, "string", "PgMacaddr");
1966
+ }
1967
+ /** @internal */
1968
+ build(table) {
1969
+ return new PgMacaddr(table, this.config);
1970
+ }
1971
+ };
1972
+ var PgMacaddr = class extends PgColumn {
1973
+ static [entityKind] = "PgMacaddr";
1974
+ getSQLType() {
1975
+ return "macaddr";
1976
+ }
1977
+ };
1978
+ function macaddr(name) {
1979
+ return new PgMacaddrBuilder(name ?? "");
1980
+ }
1981
+
1982
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/pg-core/columns/macaddr8.js
1983
+ var PgMacaddr8Builder = class extends PgColumnBuilder {
1984
+ static [entityKind] = "PgMacaddr8Builder";
1985
+ constructor(name) {
1986
+ super(name, "string", "PgMacaddr8");
1987
+ }
1988
+ /** @internal */
1989
+ build(table) {
1990
+ return new PgMacaddr8(table, this.config);
1991
+ }
1992
+ };
1993
+ var PgMacaddr8 = class extends PgColumn {
1994
+ static [entityKind] = "PgMacaddr8";
1995
+ getSQLType() {
1996
+ return "macaddr8";
1997
+ }
1998
+ };
1999
+ function macaddr8(name) {
2000
+ return new PgMacaddr8Builder(name ?? "");
2001
+ }
2002
+
2003
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/pg-core/columns/numeric.js
2004
+ var PgNumericBuilder = class extends PgColumnBuilder {
2005
+ static [entityKind] = "PgNumericBuilder";
2006
+ constructor(name, precision, scale) {
2007
+ super(name, "string", "PgNumeric");
2008
+ this.config.precision = precision;
2009
+ this.config.scale = scale;
2010
+ }
2011
+ /** @internal */
2012
+ build(table) {
2013
+ return new PgNumeric(table, this.config);
2014
+ }
2015
+ };
2016
+ var PgNumeric = class extends PgColumn {
2017
+ static [entityKind] = "PgNumeric";
2018
+ precision;
2019
+ scale;
2020
+ constructor(table, config) {
2021
+ super(table, config);
2022
+ this.precision = config.precision;
2023
+ this.scale = config.scale;
2024
+ }
2025
+ mapFromDriverValue(value) {
2026
+ if (typeof value === "string") return value;
2027
+ return String(value);
2028
+ }
2029
+ getSQLType() {
2030
+ if (this.precision !== void 0 && this.scale !== void 0) {
2031
+ return `numeric(${this.precision}, ${this.scale})`;
2032
+ } else if (this.precision === void 0) {
2033
+ return "numeric";
2034
+ } else {
2035
+ return `numeric(${this.precision})`;
2036
+ }
2037
+ }
2038
+ };
2039
+ var PgNumericNumberBuilder = class extends PgColumnBuilder {
2040
+ static [entityKind] = "PgNumericNumberBuilder";
2041
+ constructor(name, precision, scale) {
2042
+ super(name, "number", "PgNumericNumber");
2043
+ this.config.precision = precision;
2044
+ this.config.scale = scale;
2045
+ }
2046
+ /** @internal */
2047
+ build(table) {
2048
+ return new PgNumericNumber(
2049
+ table,
2050
+ this.config
2051
+ );
2052
+ }
2053
+ };
2054
+ var PgNumericNumber = class extends PgColumn {
2055
+ static [entityKind] = "PgNumericNumber";
2056
+ precision;
2057
+ scale;
2058
+ constructor(table, config) {
2059
+ super(table, config);
2060
+ this.precision = config.precision;
2061
+ this.scale = config.scale;
2062
+ }
2063
+ mapFromDriverValue(value) {
2064
+ if (typeof value === "number") return value;
2065
+ return Number(value);
2066
+ }
2067
+ mapToDriverValue = String;
2068
+ getSQLType() {
2069
+ if (this.precision !== void 0 && this.scale !== void 0) {
2070
+ return `numeric(${this.precision}, ${this.scale})`;
2071
+ } else if (this.precision === void 0) {
2072
+ return "numeric";
2073
+ } else {
2074
+ return `numeric(${this.precision})`;
2075
+ }
2076
+ }
2077
+ };
2078
+ var PgNumericBigIntBuilder = class extends PgColumnBuilder {
2079
+ static [entityKind] = "PgNumericBigIntBuilder";
2080
+ constructor(name, precision, scale) {
2081
+ super(name, "bigint", "PgNumericBigInt");
2082
+ this.config.precision = precision;
2083
+ this.config.scale = scale;
2084
+ }
2085
+ /** @internal */
2086
+ build(table) {
2087
+ return new PgNumericBigInt(
2088
+ table,
2089
+ this.config
2090
+ );
2091
+ }
2092
+ };
2093
+ var PgNumericBigInt = class extends PgColumn {
2094
+ static [entityKind] = "PgNumericBigInt";
2095
+ precision;
2096
+ scale;
2097
+ constructor(table, config) {
2098
+ super(table, config);
2099
+ this.precision = config.precision;
2100
+ this.scale = config.scale;
2101
+ }
2102
+ mapFromDriverValue = BigInt;
2103
+ mapToDriverValue = String;
2104
+ getSQLType() {
2105
+ if (this.precision !== void 0 && this.scale !== void 0) {
2106
+ return `numeric(${this.precision}, ${this.scale})`;
2107
+ } else if (this.precision === void 0) {
2108
+ return "numeric";
2109
+ } else {
2110
+ return `numeric(${this.precision})`;
2111
+ }
2112
+ }
2113
+ };
2114
+ function numeric(a, b) {
2115
+ const { name, config } = getColumnNameAndConfig(a, b);
2116
+ const mode = config?.mode;
2117
+ return mode === "number" ? new PgNumericNumberBuilder(name, config?.precision, config?.scale) : mode === "bigint" ? new PgNumericBigIntBuilder(name, config?.precision, config?.scale) : new PgNumericBuilder(name, config?.precision, config?.scale);
2118
+ }
2119
+
2120
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/pg-core/columns/point.js
2121
+ var PgPointTupleBuilder = class extends PgColumnBuilder {
2122
+ static [entityKind] = "PgPointTupleBuilder";
2123
+ constructor(name) {
2124
+ super(name, "array", "PgPointTuple");
2125
+ }
2126
+ /** @internal */
2127
+ build(table) {
2128
+ return new PgPointTuple(
2129
+ table,
2130
+ this.config
2131
+ );
2132
+ }
2133
+ };
2134
+ var PgPointTuple = class extends PgColumn {
2135
+ static [entityKind] = "PgPointTuple";
2136
+ getSQLType() {
2137
+ return "point";
2138
+ }
2139
+ mapFromDriverValue(value) {
2140
+ if (typeof value === "string") {
2141
+ const [x, y] = value.slice(1, -1).split(",");
2142
+ return [Number.parseFloat(x), Number.parseFloat(y)];
2143
+ }
2144
+ return [value.x, value.y];
2145
+ }
2146
+ mapToDriverValue(value) {
2147
+ return `(${value[0]},${value[1]})`;
2148
+ }
2149
+ };
2150
+ var PgPointObjectBuilder = class extends PgColumnBuilder {
2151
+ static [entityKind] = "PgPointObjectBuilder";
2152
+ constructor(name) {
2153
+ super(name, "json", "PgPointObject");
2154
+ }
2155
+ /** @internal */
2156
+ build(table) {
2157
+ return new PgPointObject(
2158
+ table,
2159
+ this.config
2160
+ );
2161
+ }
2162
+ };
2163
+ var PgPointObject = class extends PgColumn {
2164
+ static [entityKind] = "PgPointObject";
2165
+ getSQLType() {
2166
+ return "point";
2167
+ }
2168
+ mapFromDriverValue(value) {
2169
+ if (typeof value === "string") {
2170
+ const [x, y] = value.slice(1, -1).split(",");
2171
+ return { x: Number.parseFloat(x), y: Number.parseFloat(y) };
2172
+ }
2173
+ return value;
2174
+ }
2175
+ mapToDriverValue(value) {
2176
+ return `(${value.x},${value.y})`;
2177
+ }
2178
+ };
2179
+ function point(a, b) {
2180
+ const { name, config } = getColumnNameAndConfig(a, b);
2181
+ if (!config?.mode || config.mode === "tuple") {
2182
+ return new PgPointTupleBuilder(name);
2183
+ }
2184
+ return new PgPointObjectBuilder(name);
2185
+ }
2186
+
2187
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/pg-core/columns/postgis_extension/utils.js
2188
+ function hexToBytes(hex) {
2189
+ const bytes = [];
2190
+ for (let c = 0; c < hex.length; c += 2) {
2191
+ bytes.push(Number.parseInt(hex.slice(c, c + 2), 16));
2192
+ }
2193
+ return new Uint8Array(bytes);
2194
+ }
2195
+ function bytesToFloat64(bytes, offset) {
2196
+ const buffer = new ArrayBuffer(8);
2197
+ const view = new DataView(buffer);
2198
+ for (let i = 0; i < 8; i++) {
2199
+ view.setUint8(i, bytes[offset + i]);
2200
+ }
2201
+ return view.getFloat64(0, true);
2202
+ }
2203
+ function parseEWKB(hex) {
2204
+ const bytes = hexToBytes(hex);
2205
+ let offset = 0;
2206
+ const byteOrder = bytes[offset];
2207
+ offset += 1;
2208
+ const view = new DataView(bytes.buffer);
2209
+ const geomType = view.getUint32(offset, byteOrder === 1);
2210
+ offset += 4;
2211
+ let _srid;
2212
+ if (geomType & 536870912) {
2213
+ _srid = view.getUint32(offset, byteOrder === 1);
2214
+ offset += 4;
2215
+ }
2216
+ if ((geomType & 65535) === 1) {
2217
+ const x = bytesToFloat64(bytes, offset);
2218
+ offset += 8;
2219
+ const y = bytesToFloat64(bytes, offset);
2220
+ offset += 8;
2221
+ return [x, y];
2222
+ }
2223
+ throw new Error("Unsupported geometry type");
2224
+ }
2225
+
2226
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/pg-core/columns/postgis_extension/geometry.js
2227
+ var PgGeometryBuilder = class extends PgColumnBuilder {
2228
+ static [entityKind] = "PgGeometryBuilder";
2229
+ constructor(name) {
2230
+ super(name, "array", "PgGeometry");
2231
+ }
2232
+ /** @internal */
2233
+ build(table) {
2234
+ return new PgGeometry(
2235
+ table,
2236
+ this.config
2237
+ );
2238
+ }
2239
+ };
2240
+ var PgGeometry = class extends PgColumn {
2241
+ static [entityKind] = "PgGeometry";
2242
+ getSQLType() {
2243
+ return "geometry(point)";
2244
+ }
2245
+ mapFromDriverValue(value) {
2246
+ return parseEWKB(value);
2247
+ }
2248
+ mapToDriverValue(value) {
2249
+ return `point(${value[0]} ${value[1]})`;
2250
+ }
2251
+ };
2252
+ var PgGeometryObjectBuilder = class extends PgColumnBuilder {
2253
+ static [entityKind] = "PgGeometryObjectBuilder";
2254
+ constructor(name) {
2255
+ super(name, "json", "PgGeometryObject");
2256
+ }
2257
+ /** @internal */
2258
+ build(table) {
2259
+ return new PgGeometryObject(
2260
+ table,
2261
+ this.config
2262
+ );
2263
+ }
2264
+ };
2265
+ var PgGeometryObject = class extends PgColumn {
2266
+ static [entityKind] = "PgGeometryObject";
2267
+ getSQLType() {
2268
+ return "geometry(point)";
2269
+ }
2270
+ mapFromDriverValue(value) {
2271
+ const parsed = parseEWKB(value);
2272
+ return { x: parsed[0], y: parsed[1] };
2273
+ }
2274
+ mapToDriverValue(value) {
2275
+ return `point(${value.x} ${value.y})`;
2276
+ }
2277
+ };
2278
+ function geometry(a, b) {
2279
+ const { name, config } = getColumnNameAndConfig(a, b);
2280
+ if (!config?.mode || config.mode === "tuple") {
2281
+ return new PgGeometryBuilder(name);
2282
+ }
2283
+ return new PgGeometryObjectBuilder(name);
2284
+ }
2285
+
2286
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/pg-core/columns/real.js
2287
+ var PgRealBuilder = class extends PgColumnBuilder {
2288
+ static [entityKind] = "PgRealBuilder";
2289
+ constructor(name, length) {
2290
+ super(name, "number", "PgReal");
2291
+ this.config.length = length;
2292
+ }
2293
+ /** @internal */
2294
+ build(table) {
2295
+ return new PgReal(table, this.config);
2296
+ }
2297
+ };
2298
+ var PgReal = class extends PgColumn {
2299
+ static [entityKind] = "PgReal";
2300
+ constructor(table, config) {
2301
+ super(table, config);
2302
+ }
2303
+ getSQLType() {
2304
+ return "real";
2305
+ }
2306
+ mapFromDriverValue = (value) => {
2307
+ if (typeof value === "string") {
2308
+ return Number.parseFloat(value);
2309
+ }
2310
+ return value;
2311
+ };
2312
+ };
2313
+ function real(name) {
2314
+ return new PgRealBuilder(name ?? "");
2315
+ }
2316
+
2317
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/pg-core/columns/serial.js
2318
+ var PgSerialBuilder = class extends PgColumnBuilder {
2319
+ static [entityKind] = "PgSerialBuilder";
2320
+ constructor(name) {
2321
+ super(name, "number", "PgSerial");
2322
+ this.config.hasDefault = true;
2323
+ this.config.notNull = true;
2324
+ }
2325
+ /** @internal */
2326
+ build(table) {
2327
+ return new PgSerial(table, this.config);
2328
+ }
2329
+ };
2330
+ var PgSerial = class extends PgColumn {
2331
+ static [entityKind] = "PgSerial";
2332
+ getSQLType() {
2333
+ return "serial";
2334
+ }
2335
+ };
2336
+ function serial(name) {
2337
+ return new PgSerialBuilder(name ?? "");
2338
+ }
2339
+
2340
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/pg-core/columns/smallint.js
2341
+ var PgSmallIntBuilder = class extends PgIntColumnBaseBuilder {
2342
+ static [entityKind] = "PgSmallIntBuilder";
2343
+ constructor(name) {
2344
+ super(name, "number", "PgSmallInt");
2345
+ }
2346
+ /** @internal */
2347
+ build(table) {
2348
+ return new PgSmallInt(table, this.config);
2349
+ }
2350
+ };
2351
+ var PgSmallInt = class extends PgColumn {
2352
+ static [entityKind] = "PgSmallInt";
2353
+ getSQLType() {
2354
+ return "smallint";
2355
+ }
2356
+ mapFromDriverValue = (value) => {
2357
+ if (typeof value === "string") {
2358
+ return Number(value);
2359
+ }
2360
+ return value;
2361
+ };
2362
+ };
2363
+ function smallint(name) {
2364
+ return new PgSmallIntBuilder(name ?? "");
2365
+ }
2366
+
2367
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/pg-core/columns/smallserial.js
2368
+ var PgSmallSerialBuilder = class extends PgColumnBuilder {
2369
+ static [entityKind] = "PgSmallSerialBuilder";
2370
+ constructor(name) {
2371
+ super(name, "number", "PgSmallSerial");
2372
+ this.config.hasDefault = true;
2373
+ this.config.notNull = true;
2374
+ }
2375
+ /** @internal */
2376
+ build(table) {
2377
+ return new PgSmallSerial(
2378
+ table,
2379
+ this.config
2380
+ );
2381
+ }
2382
+ };
2383
+ var PgSmallSerial = class extends PgColumn {
2384
+ static [entityKind] = "PgSmallSerial";
2385
+ getSQLType() {
2386
+ return "smallserial";
2387
+ }
2388
+ };
2389
+ function smallserial(name) {
2390
+ return new PgSmallSerialBuilder(name ?? "");
2391
+ }
2392
+
2393
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/pg-core/columns/time.js
2394
+ var PgTimeBuilder = class extends PgDateColumnBaseBuilder {
2395
+ constructor(name, withTimezone, precision) {
2396
+ super(name, "string", "PgTime");
2397
+ this.withTimezone = withTimezone;
2398
+ this.precision = precision;
2399
+ this.config.withTimezone = withTimezone;
2400
+ this.config.precision = precision;
2401
+ }
2402
+ static [entityKind] = "PgTimeBuilder";
2403
+ /** @internal */
2404
+ build(table) {
2405
+ return new PgTime(table, this.config);
2406
+ }
2407
+ };
2408
+ var PgTime = class extends PgColumn {
2409
+ static [entityKind] = "PgTime";
2410
+ withTimezone;
2411
+ precision;
2412
+ constructor(table, config) {
2413
+ super(table, config);
2414
+ this.withTimezone = config.withTimezone;
2415
+ this.precision = config.precision;
2416
+ }
2417
+ getSQLType() {
2418
+ const precision = this.precision === void 0 ? "" : `(${this.precision})`;
2419
+ return `time${precision}${this.withTimezone ? " with time zone" : ""}`;
2420
+ }
2421
+ };
2422
+ function time(a, b = {}) {
2423
+ const { name, config } = getColumnNameAndConfig(a, b);
2424
+ return new PgTimeBuilder(name, config.withTimezone ?? false, config.precision);
2425
+ }
2426
+
2427
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/pg-core/columns/uuid.js
2428
+ var PgUUIDBuilder = class extends PgColumnBuilder {
2429
+ static [entityKind] = "PgUUIDBuilder";
2430
+ constructor(name) {
2431
+ super(name, "string", "PgUUID");
2432
+ }
2433
+ /**
2434
+ * Adds `default gen_random_uuid()` to the column definition.
2435
+ */
2436
+ defaultRandom() {
2437
+ return this.default(sql`gen_random_uuid()`);
2438
+ }
2439
+ /** @internal */
2440
+ build(table) {
2441
+ return new PgUUID(table, this.config);
2442
+ }
2443
+ };
2444
+ var PgUUID = class extends PgColumn {
2445
+ static [entityKind] = "PgUUID";
2446
+ getSQLType() {
2447
+ return "uuid";
2448
+ }
2449
+ };
2450
+ function uuid(name) {
2451
+ return new PgUUIDBuilder(name ?? "");
2452
+ }
2453
+
2454
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/pg-core/columns/varchar.js
2455
+ var PgVarcharBuilder = class extends PgColumnBuilder {
2456
+ static [entityKind] = "PgVarcharBuilder";
2457
+ constructor(name, config) {
2458
+ super(name, "string", "PgVarchar");
2459
+ this.config.length = config.length;
2460
+ this.config.enumValues = config.enum;
2461
+ }
2462
+ /** @internal */
2463
+ build(table) {
2464
+ return new PgVarchar(
2465
+ table,
2466
+ this.config
2467
+ );
2468
+ }
2469
+ };
2470
+ var PgVarchar = class extends PgColumn {
2471
+ static [entityKind] = "PgVarchar";
2472
+ length = this.config.length;
2473
+ enumValues = this.config.enumValues;
2474
+ getSQLType() {
2475
+ return this.length === void 0 ? `varchar` : `varchar(${this.length})`;
2476
+ }
2477
+ };
2478
+ function varchar(a, b = {}) {
2479
+ const { name, config } = getColumnNameAndConfig(a, b);
2480
+ return new PgVarcharBuilder(name, config);
2481
+ }
2482
+
2483
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/pg-core/columns/vector_extension/bit.js
2484
+ var PgBinaryVectorBuilder = class extends PgColumnBuilder {
2485
+ static [entityKind] = "PgBinaryVectorBuilder";
2486
+ constructor(name, config) {
2487
+ super(name, "string", "PgBinaryVector");
2488
+ this.config.dimensions = config.dimensions;
2489
+ }
2490
+ /** @internal */
2491
+ build(table) {
2492
+ return new PgBinaryVector(
2493
+ table,
2494
+ this.config
2495
+ );
2496
+ }
2497
+ };
2498
+ var PgBinaryVector = class extends PgColumn {
2499
+ static [entityKind] = "PgBinaryVector";
2500
+ dimensions = this.config.dimensions;
2501
+ getSQLType() {
2502
+ return `bit(${this.dimensions})`;
2503
+ }
2504
+ };
2505
+ function bit(a, b) {
2506
+ const { name, config } = getColumnNameAndConfig(a, b);
2507
+ return new PgBinaryVectorBuilder(name, config);
2508
+ }
2509
+
2510
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/pg-core/columns/vector_extension/halfvec.js
2511
+ var PgHalfVectorBuilder = class extends PgColumnBuilder {
2512
+ static [entityKind] = "PgHalfVectorBuilder";
2513
+ constructor(name, config) {
2514
+ super(name, "array", "PgHalfVector");
2515
+ this.config.dimensions = config.dimensions;
2516
+ }
2517
+ /** @internal */
2518
+ build(table) {
2519
+ return new PgHalfVector(
2520
+ table,
2521
+ this.config
2522
+ );
2523
+ }
2524
+ };
2525
+ var PgHalfVector = class extends PgColumn {
2526
+ static [entityKind] = "PgHalfVector";
2527
+ dimensions = this.config.dimensions;
2528
+ getSQLType() {
2529
+ return `halfvec(${this.dimensions})`;
2530
+ }
2531
+ mapToDriverValue(value) {
2532
+ return JSON.stringify(value);
2533
+ }
2534
+ mapFromDriverValue(value) {
2535
+ return value.slice(1, -1).split(",").map((v) => Number.parseFloat(v));
2536
+ }
2537
+ };
2538
+ function halfvec(a, b) {
2539
+ const { name, config } = getColumnNameAndConfig(a, b);
2540
+ return new PgHalfVectorBuilder(name, config);
2541
+ }
2542
+
2543
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/pg-core/columns/vector_extension/sparsevec.js
2544
+ var PgSparseVectorBuilder = class extends PgColumnBuilder {
2545
+ static [entityKind] = "PgSparseVectorBuilder";
2546
+ constructor(name, config) {
2547
+ super(name, "string", "PgSparseVector");
2548
+ this.config.dimensions = config.dimensions;
2549
+ }
2550
+ /** @internal */
2551
+ build(table) {
2552
+ return new PgSparseVector(
2553
+ table,
2554
+ this.config
2555
+ );
2556
+ }
2557
+ };
2558
+ var PgSparseVector = class extends PgColumn {
2559
+ static [entityKind] = "PgSparseVector";
2560
+ dimensions = this.config.dimensions;
2561
+ getSQLType() {
2562
+ return `sparsevec(${this.dimensions})`;
2563
+ }
2564
+ };
2565
+ function sparsevec(a, b) {
2566
+ const { name, config } = getColumnNameAndConfig(a, b);
2567
+ return new PgSparseVectorBuilder(name, config);
2568
+ }
2569
+
2570
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/pg-core/columns/vector_extension/vector.js
2571
+ var PgVectorBuilder = class extends PgColumnBuilder {
2572
+ static [entityKind] = "PgVectorBuilder";
2573
+ constructor(name, config) {
2574
+ super(name, "array", "PgVector");
2575
+ this.config.dimensions = config.dimensions;
2576
+ }
2577
+ /** @internal */
2578
+ build(table) {
2579
+ return new PgVector(
2580
+ table,
2581
+ this.config
2582
+ );
2583
+ }
2584
+ };
2585
+ var PgVector = class extends PgColumn {
2586
+ static [entityKind] = "PgVector";
2587
+ dimensions = this.config.dimensions;
2588
+ getSQLType() {
2589
+ return `vector(${this.dimensions})`;
2590
+ }
2591
+ mapToDriverValue(value) {
2592
+ return JSON.stringify(value);
2593
+ }
2594
+ mapFromDriverValue(value) {
2595
+ return value.slice(1, -1).split(",").map((v) => Number.parseFloat(v));
2596
+ }
2597
+ };
2598
+ function vector(a, b) {
2599
+ const { name, config } = getColumnNameAndConfig(a, b);
2600
+ return new PgVectorBuilder(name, config);
2601
+ }
2602
+
2603
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/pg-core/columns/all.js
2604
+ function getPgColumnBuilders() {
2605
+ return {
2606
+ bigint,
2607
+ bigserial,
2608
+ boolean,
2609
+ char,
2610
+ cidr,
2611
+ customType,
2612
+ date,
2613
+ doublePrecision,
2614
+ inet,
2615
+ integer,
2616
+ interval,
2617
+ json,
2618
+ jsonb,
2619
+ line,
2620
+ macaddr,
2621
+ macaddr8,
2622
+ numeric,
2623
+ point,
2624
+ geometry,
2625
+ real,
2626
+ serial,
2627
+ smallint,
2628
+ smallserial,
2629
+ text,
2630
+ time,
2631
+ timestamp,
2632
+ uuid,
2633
+ varchar,
2634
+ bit,
2635
+ halfvec,
2636
+ sparsevec,
2637
+ vector
2638
+ };
2639
+ }
2640
+
2641
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/pg-core/table.js
2642
+ var InlineForeignKeys = /* @__PURE__ */ Symbol.for("drizzle:PgInlineForeignKeys");
2643
+ var EnableRLS = /* @__PURE__ */ Symbol.for("drizzle:EnableRLS");
2644
+ var PgTable = class extends Table {
2645
+ static [entityKind] = "PgTable";
2646
+ /** @internal */
2647
+ static Symbol = Object.assign({}, Table.Symbol, {
2648
+ InlineForeignKeys,
2649
+ EnableRLS
2650
+ });
2651
+ /**@internal */
2652
+ [InlineForeignKeys] = [];
2653
+ /** @internal */
2654
+ [EnableRLS] = false;
2655
+ /** @internal */
2656
+ [Table.Symbol.ExtraConfigBuilder] = void 0;
2657
+ /** @internal */
2658
+ [Table.Symbol.ExtraConfigColumns] = {};
2659
+ };
2660
+ function pgTableWithSchema(name, columns, extraConfig, schema, baseName = name) {
2661
+ const rawTable = new PgTable(name, schema, baseName);
2662
+ const parsedColumns = typeof columns === "function" ? columns(getPgColumnBuilders()) : columns;
2663
+ const builtColumns = Object.fromEntries(
2664
+ Object.entries(parsedColumns).map(([name2, colBuilderBase]) => {
2665
+ const colBuilder = colBuilderBase;
2666
+ colBuilder.setName(name2);
2667
+ const column = colBuilder.build(rawTable);
2668
+ rawTable[InlineForeignKeys].push(...colBuilder.buildForeignKeys(column, rawTable));
2669
+ return [name2, column];
2670
+ })
2671
+ );
2672
+ const builtColumnsForExtraConfig = Object.fromEntries(
2673
+ Object.entries(parsedColumns).map(([name2, colBuilderBase]) => {
2674
+ const colBuilder = colBuilderBase;
2675
+ colBuilder.setName(name2);
2676
+ const column = colBuilder.buildExtraConfigColumn(rawTable);
2677
+ return [name2, column];
2678
+ })
2679
+ );
2680
+ const table = Object.assign(rawTable, builtColumns);
2681
+ table[Table.Symbol.Columns] = builtColumns;
2682
+ table[Table.Symbol.ExtraConfigColumns] = builtColumnsForExtraConfig;
2683
+ if (extraConfig) {
2684
+ table[PgTable.Symbol.ExtraConfigBuilder] = extraConfig;
2685
+ }
2686
+ return Object.assign(table, {
2687
+ enableRLS: () => {
2688
+ table[PgTable.Symbol.EnableRLS] = true;
2689
+ return table;
2690
+ }
2691
+ });
2692
+ }
2693
+ var pgTable = (name, columns, extraConfig) => {
2694
+ return pgTableWithSchema(name, columns, extraConfig, void 0);
2695
+ };
2696
+
2697
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/sql/expressions/conditions.js
2698
+ function bindIfParam(value, column) {
2699
+ if (isDriverValueEncoder(column) && !isSQLWrapper(value) && !is(value, Param) && !is(value, Placeholder) && !is(value, Column) && !is(value, Table) && !is(value, View)) {
2700
+ return new Param(value, column);
2701
+ }
2702
+ return value;
2703
+ }
2704
+ var eq = (left, right) => {
2705
+ return sql`${left} = ${bindIfParam(right, left)}`;
2706
+ };
2707
+ var ne = (left, right) => {
2708
+ return sql`${left} <> ${bindIfParam(right, left)}`;
2709
+ };
2710
+ function and(...unfilteredConditions) {
2711
+ const conditions = unfilteredConditions.filter(
2712
+ (c) => c !== void 0
2713
+ );
2714
+ if (conditions.length === 0) {
2715
+ return void 0;
2716
+ }
2717
+ if (conditions.length === 1) {
2718
+ return new SQL(conditions);
2719
+ }
2720
+ return new SQL([
2721
+ new StringChunk("("),
2722
+ sql.join(conditions, new StringChunk(" and ")),
2723
+ new StringChunk(")")
2724
+ ]);
2725
+ }
2726
+ function or(...unfilteredConditions) {
2727
+ const conditions = unfilteredConditions.filter(
2728
+ (c) => c !== void 0
2729
+ );
2730
+ if (conditions.length === 0) {
2731
+ return void 0;
2732
+ }
2733
+ if (conditions.length === 1) {
2734
+ return new SQL(conditions);
2735
+ }
2736
+ return new SQL([
2737
+ new StringChunk("("),
2738
+ sql.join(conditions, new StringChunk(" or ")),
2739
+ new StringChunk(")")
2740
+ ]);
2741
+ }
2742
+ function not(condition) {
2743
+ return sql`not ${condition}`;
2744
+ }
2745
+ var gt = (left, right) => {
2746
+ return sql`${left} > ${bindIfParam(right, left)}`;
2747
+ };
2748
+ var gte = (left, right) => {
2749
+ return sql`${left} >= ${bindIfParam(right, left)}`;
2750
+ };
2751
+ var lt = (left, right) => {
2752
+ return sql`${left} < ${bindIfParam(right, left)}`;
2753
+ };
2754
+ var lte = (left, right) => {
2755
+ return sql`${left} <= ${bindIfParam(right, left)}`;
2756
+ };
2757
+ function inArray(column, values) {
2758
+ if (Array.isArray(values)) {
2759
+ if (values.length === 0) {
2760
+ return sql`false`;
2761
+ }
2762
+ return sql`${column} in ${values.map((v) => bindIfParam(v, column))}`;
2763
+ }
2764
+ return sql`${column} in ${bindIfParam(values, column)}`;
2765
+ }
2766
+ function notInArray(column, values) {
2767
+ if (Array.isArray(values)) {
2768
+ if (values.length === 0) {
2769
+ return sql`true`;
2770
+ }
2771
+ return sql`${column} not in ${values.map((v) => bindIfParam(v, column))}`;
2772
+ }
2773
+ return sql`${column} not in ${bindIfParam(values, column)}`;
2774
+ }
2775
+ function isNull(value) {
2776
+ return sql`${value} is null`;
2777
+ }
2778
+ function isNotNull(value) {
2779
+ return sql`${value} is not null`;
2780
+ }
2781
+ function exists(subquery) {
2782
+ return sql`exists ${subquery}`;
2783
+ }
2784
+ function notExists(subquery) {
2785
+ return sql`not exists ${subquery}`;
2786
+ }
2787
+ function between(column, min, max) {
2788
+ return sql`${column} between ${bindIfParam(min, column)} and ${bindIfParam(
2789
+ max,
2790
+ column
2791
+ )}`;
2792
+ }
2793
+ function notBetween(column, min, max) {
2794
+ return sql`${column} not between ${bindIfParam(
2795
+ min,
2796
+ column
2797
+ )} and ${bindIfParam(max, column)}`;
2798
+ }
2799
+ function like(column, value) {
2800
+ return sql`${column} like ${value}`;
2801
+ }
2802
+ function notLike(column, value) {
2803
+ return sql`${column} not like ${value}`;
2804
+ }
2805
+ function ilike(column, value) {
2806
+ return sql`${column} ilike ${value}`;
2807
+ }
2808
+ function notIlike(column, value) {
2809
+ return sql`${column} not ilike ${value}`;
2810
+ }
2811
+
2812
+ // ../../node_modules/.pnpm/drizzle-orm@0.45.2_@opentelemetry+api@1.9.1_@types+pg@8.20.0_kysely@0.29.2_pg@8.22.0/node_modules/drizzle-orm/sql/expressions/select.js
2813
+ function asc(column) {
2814
+ return sql`${column} asc`;
2815
+ }
2816
+ function desc(column) {
2817
+ return sql`${column} desc`;
2818
+ }
2819
+
2820
+ export {
2821
+ entityKind,
2822
+ is,
2823
+ Column,
2824
+ ColumnBuilder,
2825
+ TableName,
2826
+ PgColumn,
2827
+ Subquery,
2828
+ WithSubquery,
2829
+ tracer,
2830
+ ViewBaseConfig,
2831
+ Schema,
2832
+ Columns,
2833
+ Table,
2834
+ getTableName,
2835
+ getTableUniqueName,
2836
+ SQL,
2837
+ Param,
2838
+ sql,
2839
+ fillPlaceholders,
2840
+ View,
2841
+ mapResultRow,
2842
+ orderSelectedFields,
2843
+ haveSameKeys,
2844
+ mapUpdateSet,
2845
+ applyMixins,
2846
+ getTableColumns,
2847
+ getTableLikeName,
2848
+ getColumnNameAndConfig,
2849
+ isConfig,
2850
+ textDecoder,
2851
+ bigint,
2852
+ boolean,
2853
+ PgDate,
2854
+ PgDateString,
2855
+ integer,
2856
+ PgJson,
2857
+ PgJsonb,
2858
+ jsonb,
2859
+ PgNumeric,
2860
+ text,
2861
+ PgTime,
2862
+ PgTimestamp,
2863
+ PgTimestampString,
2864
+ timestamp,
2865
+ PgUUID,
2866
+ PgTable,
2867
+ pgTable,
2868
+ eq,
2869
+ ne,
2870
+ and,
2871
+ or,
2872
+ not,
2873
+ gt,
2874
+ gte,
2875
+ lt,
2876
+ lte,
2877
+ inArray,
2878
+ notInArray,
2879
+ isNull,
2880
+ isNotNull,
2881
+ exists,
2882
+ notExists,
2883
+ between,
2884
+ notBetween,
2885
+ like,
2886
+ notLike,
2887
+ ilike,
2888
+ notIlike,
2889
+ asc,
2890
+ desc
2891
+ };
2892
+ //# sourceMappingURL=chunk-6V366IZC.js.map