@jiggai/kitchen 0.4.5 → 0.5.0

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 (67) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +2 -2
  3. package/.next/prerender-manifest.json +3 -3
  4. package/.next/required-server-files.js +3 -0
  5. package/.next/required-server-files.json +3 -0
  6. package/.next/server/app/_global-error.html +2 -2
  7. package/.next/server/app/_global-error.rsc +1 -1
  8. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  9. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  10. package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  11. package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  12. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  13. package/.next/server/app/_not-found.html +1 -1
  14. package/.next/server/app/_not-found.rsc +2 -2
  15. package/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  16. package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  17. package/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
  18. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  19. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  20. package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  21. package/.next/server/app/channels.html +2 -2
  22. package/.next/server/app/channels.rsc +2 -2
  23. package/.next/server/app/channels.segments/_full.segment.rsc +2 -2
  24. package/.next/server/app/channels.segments/_head.segment.rsc +1 -1
  25. package/.next/server/app/channels.segments/_index.segment.rsc +1 -1
  26. package/.next/server/app/channels.segments/_tree.segment.rsc +1 -1
  27. package/.next/server/app/channels.segments/channels/__PAGE__.segment.rsc +1 -1
  28. package/.next/server/app/channels.segments/channels.segment.rsc +1 -1
  29. package/.next/server/app/goals/new.html +2 -2
  30. package/.next/server/app/goals/new.rsc +2 -2
  31. package/.next/server/app/goals/new.segments/_full.segment.rsc +2 -2
  32. package/.next/server/app/goals/new.segments/_head.segment.rsc +1 -1
  33. package/.next/server/app/goals/new.segments/_index.segment.rsc +1 -1
  34. package/.next/server/app/goals/new.segments/_tree.segment.rsc +1 -1
  35. package/.next/server/app/goals/new.segments/goals/new/__PAGE__.segment.rsc +1 -1
  36. package/.next/server/app/goals/new.segments/goals/new.segment.rsc +1 -1
  37. package/.next/server/app/goals/new.segments/goals.segment.rsc +1 -1
  38. package/.next/server/app/goals.html +1 -1
  39. package/.next/server/app/goals.rsc +2 -2
  40. package/.next/server/app/goals.segments/_full.segment.rsc +2 -2
  41. package/.next/server/app/goals.segments/_head.segment.rsc +1 -1
  42. package/.next/server/app/goals.segments/_index.segment.rsc +1 -1
  43. package/.next/server/app/goals.segments/_tree.segment.rsc +1 -1
  44. package/.next/server/app/goals.segments/goals/__PAGE__.segment.rsc +1 -1
  45. package/.next/server/app/goals.segments/goals.segment.rsc +1 -1
  46. package/.next/server/app/settings.html +1 -1
  47. package/.next/server/app/settings.rsc +2 -2
  48. package/.next/server/app/settings.segments/_full.segment.rsc +2 -2
  49. package/.next/server/app/settings.segments/_head.segment.rsc +1 -1
  50. package/.next/server/app/settings.segments/_index.segment.rsc +1 -1
  51. package/.next/server/app/settings.segments/_tree.segment.rsc +1 -1
  52. package/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +1 -1
  53. package/.next/server/app/settings.segments/settings.segment.rsc +1 -1
  54. package/.next/server/chunks/[root-of-the-server]__1e0ade2e._.js +1 -1
  55. package/.next/server/chunks/ssr/[root-of-the-server]__3b880807._.js +1 -1
  56. package/.next/server/chunks/ssr/[root-of-the-server]__3b880807._.js.map +1 -1
  57. package/.next/server/pages/404.html +1 -1
  58. package/.next/server/pages/500.html +2 -2
  59. package/.next/server/server-reference-manifest.js +1 -1
  60. package/.next/server/server-reference-manifest.json +1 -1
  61. package/next.config.ts +3 -0
  62. package/openclaw/index.ts +16 -0
  63. package/openclaw.plugin.json +1 -1
  64. package/package.json +1 -1
  65. /package/.next/static/{mm0F9at4WhSZ8BVGvqrMK → joB2FecbcL7AranUOr_Dx}/_buildManifest.js +0 -0
  66. /package/.next/static/{mm0F9at4WhSZ8BVGvqrMK → joB2FecbcL7AranUOr_Dx}/_clientMiddlewareManifest.json +0 -0
  67. /package/.next/static/{mm0F9at4WhSZ8BVGvqrMK → joB2FecbcL7AranUOr_Dx}/_ssgManifest.js +0 -0
@@ -1,4 +1,4 @@
1
- module.exports=[22734,(e,t,r)=>{t.exports=e.x("fs",()=>require("fs"))},46786,(e,t,r)=>{t.exports=e.x("os",()=>require("os"))},85148,(e,t,r)=>{t.exports=e.x("better-sqlite3-90e2652d1716b047",()=>require("better-sqlite3-90e2652d1716b047"))},66044,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={entityKind:()=>c,hasOwnEntityKind:()=>f,is:()=>d};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);let c=Symbol.for("drizzle:entityKind"),f=Symbol.for("drizzle:hasOwnEntityKind");function d(e,t){if(!e||"object"!=typeof e)return!1;if(e instanceof t)return!0;if(!Object.prototype.hasOwnProperty.call(t,c))throw Error(`Class "${t.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.`);let r=Object.getPrototypeOf(e).constructor;if(r)for(;r;){if(c in r&&r[c]===t[c])return!0;r=Object.getPrototypeOf(r)}return!1}},24108,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={ConsoleLogWriter:()=>f,DefaultLogger:()=>d,NoopLogger:()=>p};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044);class f{static [c.entityKind]="ConsoleLogWriter";write(e){console.log(e)}}class d{static [c.entityKind]="DefaultLogger";writer;constructor(e){this.writer=e?.writer??new f}logQuery(e,t){let r=t.map(e=>{try{return JSON.stringify(e)}catch{return String(e)}}),i=r.length?` -- params: [${r.join(", ")}]`:"";this.writer.write(`Query: ${e}${i}`)}}class p{static [c.entityKind]="NoopLogger";logQuery(){}}},88564,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={TableName:()=>c};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);let c=Symbol.for("drizzle:Name")},9289,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={BaseName:()=>h,Columns:()=>p,ExtraConfigBuilder:()=>b,ExtraConfigColumns:()=>m,IsAlias:()=>y,OriginalName:()=>g,Schema:()=>d,Table:()=>O,getTableName:()=>v,getTableUniqueName:()=>S,isTable:()=>P};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(88564);let d=Symbol.for("drizzle:Schema"),p=Symbol.for("drizzle:Columns"),m=Symbol.for("drizzle:ExtraConfigColumns"),g=Symbol.for("drizzle:OriginalName"),h=Symbol.for("drizzle:BaseName"),y=Symbol.for("drizzle:IsAlias"),b=Symbol.for("drizzle:ExtraConfigBuilder"),w=Symbol.for("drizzle:IsDrizzleTable");class O{static [c.entityKind]="Table";static Symbol={Name:f.TableName,Schema:d,OriginalName:g,Columns:p,ExtraConfigColumns:m,BaseName:h,IsAlias:y,ExtraConfigBuilder:b};[f.TableName];[g];[d];[p];[m];[h];[y]=!1;[w]=!0;[b]=void 0;constructor(e,t,r){this[f.TableName]=this[g]=e,this[d]=t,this[h]=r}}function P(e){return"object"==typeof e&&null!==e&&w in e}function v(e){return e[f.TableName]}function S(e){return`${e[d]??"public"}.${e[f.TableName]}`}},28892,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={Column:()=>f};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044);class f{constructor(e,t){this.table=e,this.config=t,this.name=t.name,this.keyAsName=t.keyAsName,this.notNull=t.notNull,this.default=t.default,this.defaultFn=t.defaultFn,this.onUpdateFn=t.onUpdateFn,this.hasDefault=t.hasDefault,this.primary=t.primaryKey,this.isUnique=t.isUnique,this.uniqueName=t.uniqueName,this.uniqueType=t.uniqueType,this.dataType=t.dataType,this.columnType=t.columnType,this.generated=t.generated,this.generatedIdentity=t.generatedIdentity}static [c.entityKind]="Column";name;keyAsName;primary;notNull;default;defaultFn;onUpdateFn;hasDefault;isUnique;uniqueName;uniqueType;dataType;columnType;enumValues=void 0;generated=void 0;generatedIdentity=void 0;config;mapFromDriverValue(e){return e}mapToDriverValue(e){return e}shouldDisableInsert(){return void 0!==this.config.generated&&"byDefault"!==this.config.generated.type}}},601,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={ColumnBuilder:()=>f};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044);class f{static [c.entityKind]="ColumnBuilder";config;constructor(e,t,r){this.config={name:e,keyAsName:""===e,notNull:!1,default:void 0,hasDefault:!1,primaryKey:!1,isUnique:!1,uniqueName:void 0,uniqueType:void 0,dataType:t,columnType:r,generated:void 0}}$type(){return this}notNull(){return this.config.notNull=!0,this}default(e){return this.config.default=e,this.config.hasDefault=!0,this}$defaultFn(e){return this.config.defaultFn=e,this.config.hasDefault=!0,this}$default=this.$defaultFn;$onUpdateFn(e){return this.config.onUpdateFn=e,this.config.hasDefault=!0,this}$onUpdate=this.$onUpdateFn;primaryKey(){return this.config.primaryKey=!0,this.config.notNull=!0,this}setName(e){""===this.config.name&&(this.config.name=e)}}},22989,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={ForeignKey:()=>p,ForeignKeyBuilder:()=>d,foreignKey:()=>m};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(88564);class d{static [c.entityKind]="PgForeignKeyBuilder";reference;_onUpdate="no action";_onDelete="no action";constructor(e,t){this.reference=()=>{let{name:t,columns:r,foreignColumns:i}=e();return{name:t,columns:r,foreignTable:i[0].table,foreignColumns:i}},t&&(this._onUpdate=t.onUpdate,this._onDelete=t.onDelete)}onUpdate(e){return this._onUpdate=void 0===e?"no action":e,this}onDelete(e){return this._onDelete=void 0===e?"no action":e,this}build(e){return new p(e,this)}}class p{constructor(e,t){this.table=e,this.reference=t.reference,this.onUpdate=t._onUpdate,this.onDelete=t._onDelete}static [c.entityKind]="PgForeignKey";reference;onUpdate;onDelete;getName(){let{name:e,columns:t,foreignColumns:r}=this.reference(),i=t.map(e=>e.name),n=r.map(e=>e.name),s=[this.table[f.TableName],...i,r[0].table[f.TableName],...n];return e??`${s.join("_")}_fk`}}function m(e){return new d(function(){let{name:t,columns:r,foreignColumns:i}=e;return{name:t,columns:r,foreignColumns:i}})}},74433,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={iife:()=>c};for(var u in l)i(a,u,{get:l[u],enumerable:!0});function c(e,...t){return e(...t)}t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a)},81699,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={UniqueConstraint:()=>h,UniqueConstraintBuilder:()=>m,UniqueOnConstraintBuilder:()=>g,unique:()=>d,uniqueKeyName:()=>p};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(88564);function d(e){return new g(e)}function p(e,t){return`${e[f.TableName]}_${t.join("_")}_unique`}class m{constructor(e,t){this.name=t,this.columns=e}static [c.entityKind]="PgUniqueConstraintBuilder";columns;nullsNotDistinctConfig=!1;nullsNotDistinct(){return this.nullsNotDistinctConfig=!0,this}build(e){return new h(e,this.columns,this.nullsNotDistinctConfig,this.name)}}class g{static [c.entityKind]="PgUniqueOnConstraintBuilder";name;constructor(e){this.name=e}on(...e){return new m(e,this.name)}}class h{constructor(e,t,r,i){this.table=e,this.columns=t,this.name=i??p(this.table,this.columns.map(e=>e.name)),this.nullsNotDistinct=r}static [c.entityKind]="PgUniqueConstraint";columns;name;nullsNotDistinct=!1;getName(){return this.name}}},89842,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={makePgArray:()=>function e(t){return`{${t.map(t=>Array.isArray(t)?e(t):"string"==typeof t?`"${t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`:`${t}`).join(",")}}`},parsePgArray:()=>d,parsePgNestedArray:()=>f};for(var u in l)i(a,u,{get:l[u],enumerable:!0});function c(e,t,r){for(let i=t;i<e.length;i++){let n=e[i];if("\\"===n){i++;continue}if('"'===n)return[e.slice(t,i).replace(/\\/g,""),i+1];if(!r&&(","===n||"}"===n))return[e.slice(t,i).replace(/\\/g,""),i]}return[e.slice(t).replace(/\\/g,""),e.length]}function f(e,t=0){let r=[],i=t,n=!1;for(;i<e.length;){let s=e[i];if(","===s){(n||i===t)&&r.push(""),n=!0,i++;continue}if(n=!1,"\\"===s){i+=2;continue}if('"'===s){let[t,n]=c(e,i+1,!0);r.push(t),i=n;continue}if("}"===s)return[r,i+1];if("{"===s){let[t,n]=f(e,i+1);r.push(t),i=n;continue}let[o,a]=c(e,i,!1);r.push(o),i=a}return[r,i]}function d(e){let[t]=f(e,1);return t}t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a)},54732,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={ExtraConfigColumn:()=>w,IndexedColumn:()=>O,PgArray:()=>v,PgArrayBuilder:()=>P,PgColumn:()=>b,PgColumnBuilder:()=>y};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(601),f=e.r(28892),d=e.r(66044),p=e.r(22989),m=e.r(74433),g=e.r(81699),h=e.r(89842);class y extends c.ColumnBuilder{foreignKeyConfigs=[];static [d.entityKind]="PgColumnBuilder";array(e){return new P(this.config.name,this,e)}references(e,t={}){return this.foreignKeyConfigs.push({ref:e,actions:t}),this}unique(e,t){return this.config.isUnique=!0,this.config.uniqueName=e,this.config.uniqueType=t?.nulls,this}generatedAlwaysAs(e){return this.config.generated={as:e,type:"always",mode:"stored"},this}buildForeignKeys(e,t){return this.foreignKeyConfigs.map(({ref:r,actions:i})=>(0,m.iife)((r,i)=>{let n=new p.ForeignKeyBuilder(()=>({columns:[e],foreignColumns:[r()]}));return i.onUpdate&&n.onUpdate(i.onUpdate),i.onDelete&&n.onDelete(i.onDelete),n.build(t)},r,i))}buildExtraConfigColumn(e){return new w(e,this.config)}}class b extends f.Column{constructor(e,t){t.uniqueName||(t.uniqueName=(0,g.uniqueKeyName)(e,[t.name])),super(e,t),this.table=e}static [d.entityKind]="PgColumn"}class w extends b{static [d.entityKind]="ExtraConfigColumn";getSQLType(){return this.getSQLType()}indexConfig={order:this.config.order??"asc",nulls:this.config.nulls??"last",opClass:this.config.opClass};defaultConfig={order:"asc",nulls:"last",opClass:void 0};asc(){return this.indexConfig.order="asc",this}desc(){return this.indexConfig.order="desc",this}nullsFirst(){return this.indexConfig.nulls="first",this}nullsLast(){return this.indexConfig.nulls="last",this}op(e){return this.indexConfig.opClass=e,this}}class O{static [d.entityKind]="IndexedColumn";constructor(e,t,r,i){this.name=e,this.keyAsName=t,this.type=r,this.indexConfig=i}name;keyAsName;type;indexConfig}class P extends y{static [d.entityKind]="PgArrayBuilder";constructor(e,t,r){super(e,"array","PgArray"),this.config.baseBuilder=t,this.config.size=r}build(e){let t=this.config.baseBuilder.build(e);return new v(e,this.config,t)}}class v extends b{constructor(e,t,r,i){super(e,t),this.baseColumn=r,this.range=i,this.size=t.size}size;static [d.entityKind]="PgArray";getSQLType(){return`${this.baseColumn.getSQLType()}[${"number"==typeof this.size?this.size:""}]`}mapFromDriverValue(e){return"string"==typeof e&&(e=(0,h.parsePgArray)(e)),e.map(e=>this.baseColumn.mapFromDriverValue(e))}mapToDriverValue(e,t=!1){let r=e.map(e=>null===e?null:(0,d.is)(this.baseColumn,v)?this.baseColumn.mapToDriverValue(e,!0):this.baseColumn.mapToDriverValue(e));return t?r:(0,h.makePgArray)(r)}}},16561,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgEnumColumn:()=>y,PgEnumColumnBuilder:()=>h,PgEnumObjectColumn:()=>p,PgEnumObjectColumnBuilder:()=>d,isPgEnum:()=>g,pgEnum:()=>b,pgEnumObjectWithSchema:()=>O,pgEnumWithSchema:()=>w};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(54732);class d extends f.PgColumnBuilder{static [c.entityKind]="PgEnumObjectColumnBuilder";constructor(e,t){super(e,"string","PgEnumObjectColumn"),this.config.enum=t}build(e){return new p(e,this.config)}}class p extends f.PgColumn{static [c.entityKind]="PgEnumObjectColumn";enum;enumValues=this.config.enum.enumValues;constructor(e,t){super(e,t),this.enum=t.enum}getSQLType(){return this.enum.enumName}}let m=Symbol.for("drizzle:isPgEnum");function g(e){return!!e&&"function"==typeof e&&m in e&&!0===e[m]}class h extends f.PgColumnBuilder{static [c.entityKind]="PgEnumColumnBuilder";constructor(e,t){super(e,"string","PgEnumColumn"),this.config.enum=t}build(e){return new y(e,this.config)}}class y extends f.PgColumn{static [c.entityKind]="PgEnumColumn";enum=this.config.enum;enumValues=this.config.enum.enumValues;constructor(e,t){super(e,t),this.enum=t.enum}getSQLType(){return this.enum.enumName}}function b(e,t){return Array.isArray(t)?w(e,[...t],void 0):O(e,t,void 0)}function w(e,t,r){let i=Object.assign(e=>new h(e??"",i),{enumName:e,enumValues:t,schema:r,[m]:!0});return i}function O(e,t,r){let i=Object.assign(e=>new d(e??"",i),{enumName:e,enumValues:Object.values(t),schema:r,[m]:!0});return i}},77509,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={Subquery:()=>f,WithSubquery:()=>d};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044);class f{static [c.entityKind]="Subquery";constructor(e,t,r,i=!1,n=[]){this._={brand:"Subquery",sql:e,selectedFields:t,alias:r,isWith:i,usedTables:n}}}class d extends f{static [c.entityKind]="WithSubquery"}},60995,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={compatibilityVersion:()=>f,npmVersion:()=>c};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c="0.45.2",f=10},45312,(e,t,r)=>{"use strict";let i,n;var s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.prototype.hasOwnProperty,u={},c={tracer:()=>m};for(var f in c)s(u,f,{get:c[f],enumerable:!0});t.exports=((e,t,r,i)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of a(t))l.call(e,r)||void 0===r||s(e,r,{get:()=>t[r],enumerable:!(i=o(t,r))||i.enumerable});return e})(s({},"__esModule",{value:!0}),u);var d=e.r(74433),p=e.r(60995);let m={startActiveSpan:(e,t)=>i?(n||(n=i.trace.getTracer("drizzle-orm",p.npmVersion)),(0,d.iife)((r,i)=>i.startActiveSpan(e,e=>{try{return t(e)}catch(t){throw e.setStatus({code:r.SpanStatusCode.ERROR,message:t instanceof Error?t.message:"Unknown error"}),t}finally{e.end()}}),i,n)):t()}},32315,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={ViewBaseConfig:()=>c};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);let c=Symbol.for("drizzle:ViewBaseConfig")},84541,(e,t,r)=>{"use strict";var i,n=Object.defineProperty,s=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,l={},u={FakePrimitiveParam:()=>b,Name:()=>v,Param:()=>T,Placeholder:()=>D,SQL:()=>P,StringChunk:()=>O,View:()=>A,fillPlaceholders:()=>$,getViewName:()=>V,isDriverValueEncoder:()=>j,isSQLWrapper:()=>w,isView:()=>F,name:()=>S,noopDecoder:()=>C,noopEncoder:()=>B,noopMapper:()=>x,param:()=>Q,placeholder:()=>_,sql:()=>N};for(var c in u)n(l,c,{get:u[c],enumerable:!0});t.exports=((e,t,r,i)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of o(t))a.call(e,r)||void 0===r||n(e,r,{get:()=>t[r],enumerable:!(i=s(t,r))||i.enumerable});return e})(n({},"__esModule",{value:!0}),l);var f=e.r(66044),d=e.r(16561),p=e.r(77509),m=e.r(45312),g=e.r(32315),h=e.r(28892),y=e.r(9289);class b{static [f.entityKind]="FakePrimitiveParam"}function w(e){return null!=e&&"function"==typeof e.getSQL}class O{static [f.entityKind]="StringChunk";value;constructor(e){this.value=Array.isArray(e)?e:[e]}getSQL(){return new P([this])}}class P{constructor(e){for(const t of(this.queryChunks=e,e))if((0,f.is)(t,y.Table)){const e=t[y.Table.Symbol.Schema];this.usedTables.push(void 0===e?t[y.Table.Symbol.Name]:e+"."+t[y.Table.Symbol.Name])}}static [f.entityKind]="SQL";decoder=C;shouldInlineParams=!1;usedTables=[];append(e){return this.queryChunks.push(...e.queryChunks),this}toQuery(e){return m.tracer.startActiveSpan("drizzle.buildSQL",t=>{let r=this.buildQueryFromSourceParams(this.queryChunks,e);return t?.setAttributes({"drizzle.query.text":r.sql,"drizzle.query.params":JSON.stringify(r.params)}),r})}buildQueryFromSourceParams(e,t){let r=Object.assign({},t,{inlineParams:t.inlineParams||this.shouldInlineParams,paramStartIndex:t.paramStartIndex||{value:0}}),{casing:i,escapeName:n,escapeParam:s,prepareTyping:o,inlineParams:a,paramStartIndex:l}=r;var u=e.map(e=>{if((0,f.is)(e,O))return{sql:e.value.join(""),params:[]};if((0,f.is)(e,v))return{sql:n(e.value),params:[]};if(void 0===e)return{sql:"",params:[]};if(Array.isArray(e)){let t=[new O("(")];for(let[r,i]of e.entries())t.push(i),r<e.length-1&&t.push(new O(", "));return t.push(new O(")")),this.buildQueryFromSourceParams(t,r)}if((0,f.is)(e,P))return this.buildQueryFromSourceParams(e.queryChunks,{...r,inlineParams:a||e.shouldInlineParams});if((0,f.is)(e,y.Table)){let t=e[y.Table.Symbol.Schema],r=e[y.Table.Symbol.Name];return{sql:void 0===t||e[y.IsAlias]?n(r):n(t)+"."+n(r),params:[]}}if((0,f.is)(e,h.Column)){let r=i.getColumnCasing(e);if("indexes"===t.invokeSource)return{sql:n(r),params:[]};let s=e.table[y.Table.Symbol.Schema];return{sql:e.table[y.IsAlias]||void 0===s?n(e.table[y.Table.Symbol.Name])+"."+n(r):n(s)+"."+n(e.table[y.Table.Symbol.Name])+"."+n(r),params:[]}}if((0,f.is)(e,A)){let t=e[g.ViewBaseConfig].schema,r=e[g.ViewBaseConfig].name;return{sql:void 0===t||e[g.ViewBaseConfig].isAlias?n(r):n(t)+"."+n(r),params:[]}}if((0,f.is)(e,T)){if((0,f.is)(e.value,D))return{sql:s(l.value++,e),params:[e],typings:["none"]};let t=null===e.value?null:e.encoder.mapToDriverValue(e.value);if((0,f.is)(t,P))return this.buildQueryFromSourceParams([t],r);if(a)return{sql:this.mapInlineParam(t,r),params:[]};let i=["none"];return o&&(i=[o(e.encoder)]),{sql:s(l.value++,t),params:[t],typings:i}}return(0,f.is)(e,D)?{sql:s(l.value++,e),params:[e],typings:["none"]}:(0,f.is)(e,P.Aliased)&&void 0!==e.fieldAlias?{sql:n(e.fieldAlias),params:[]}:(0,f.is)(e,p.Subquery)?e._.isWith?{sql:n(e._.alias),params:[]}:this.buildQueryFromSourceParams([new O("("),e._.sql,new O(") "),new v(e._.alias)],r):(0,d.isPgEnum)(e)?e.schema?{sql:n(e.schema)+"."+n(e.enumName),params:[]}:{sql:n(e.enumName),params:[]}:w(e)?e.shouldOmitSQLParens?.()?this.buildQueryFromSourceParams([e.getSQL()],r):this.buildQueryFromSourceParams([new O("("),e.getSQL(),new O(")")],r):a?{sql:this.mapInlineParam(e,r),params:[]}:{sql:s(l.value++,e),params:[e],typings:["none"]}});let c={sql:"",params:[]};for(let e of u)c.sql+=e.sql,c.params.push(...e.params),e.typings?.length&&(c.typings||(c.typings=[]),c.typings.push(...e.typings));return c}mapInlineParam(e,{escapeString:t}){if(null===e)return"null";if("number"==typeof e||"boolean"==typeof e)return e.toString();if("string"==typeof e)return t(e);if("object"==typeof e){let r=e.toString();return"[object Object]"===r?t(JSON.stringify(e)):t(r)}throw Error("Unexpected param value: "+e)}getSQL(){return this}as(e){return void 0===e?this:new P.Aliased(this,e)}mapWith(e){return this.decoder="function"==typeof e?{mapFromDriverValue:e}:e,this}inlineParams(){return this.shouldInlineParams=!0,this}if(e){return e?this:void 0}}class v{constructor(e){this.value=e}static [f.entityKind]="Name";brand;getSQL(){return new P([this])}}function S(e){return new v(e)}function j(e){return"object"==typeof e&&null!==e&&"mapToDriverValue"in e&&"function"==typeof e.mapToDriverValue}let C={mapFromDriverValue:e=>e},B={mapToDriverValue:e=>e},x={...C,...B};class T{constructor(e,t=B){this.value=e,this.encoder=t}static [f.entityKind]="Param";brand;getSQL(){return new P([this])}}function Q(e,t){return new T(e,t)}function N(e,...t){let r=[];for(let[i,n]of((t.length>0||e.length>0&&""!==e[0])&&r.push(new O(e[0])),t.entries()))r.push(n,new O(e[i+1]));return new P(r)}(i=N||(N={})).empty=function(){return new P([])},i.fromList=function(e){return new P(e)},i.raw=function(e){return new P([new O(e)])},i.join=function(e,t){let r=[];for(let[i,n]of e.entries())i>0&&void 0!==t&&r.push(t),r.push(n);return new P(r)},i.identifier=function(e){return new v(e)},i.placeholder=function(e){return new D(e)},i.param=function(e,t){return new T(e,t)};var q=P||(P={});class L{constructor(e,t){this.sql=e,this.fieldAlias=t}static [f.entityKind]="SQL.Aliased";isSelectionField=!1;getSQL(){return this.sql}clone(){return new L(this.sql,this.fieldAlias)}}q.Aliased=L;class D{constructor(e){this.name=e}static [f.entityKind]="Placeholder";getSQL(){return new P([this])}}function _(e){return new D(e)}function $(e,t){return e.map(e=>{if((0,f.is)(e,D)){if(!(e.name in t))throw Error(`No value for placeholder "${e.name}" was provided`);return t[e.name]}if((0,f.is)(e,T)&&(0,f.is)(e.value,D)){if(!(e.value.name in t))throw Error(`No value for placeholder "${e.value.name}" was provided`);return e.encoder.mapToDriverValue(t[e.value.name])}return e})}let K=Symbol.for("drizzle:IsDrizzleView");class A{static [f.entityKind]="View";[g.ViewBaseConfig];[K]=!0;constructor({name:e,schema:t,selectedFields:r,query:i}){this[g.ViewBaseConfig]={name:e,originalName:e,schema:t,selectedFields:r,query:i,isExisting:!i,isAlias:!1}}getSQL(){return new P([this])}}function F(e){return"object"==typeof e&&null!==e&&K in e}function V(e){return e[g.ViewBaseConfig].name}h.Column.prototype.getSQL=function(){return new P([this])},y.Table.prototype.getSQL=function(){return new P([this])},p.Subquery.prototype.getSQL=function(){return new P([this])}},96707,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={applyMixins:()=>w,getColumnNameAndConfig:()=>S,getTableColumns:()=>O,getTableLikeName:()=>v,getViewSelectedFields:()=>P,haveSameKeys:()=>y,isConfig:()=>j,mapResultRow:()=>h,mapUpdateSet:()=>b,orderSelectedFields:()=>function e(t,r){return Object.entries(t).reduce((t,[i,n])=>{if("string"!=typeof i)return t;let s=r?[...r,i]:[i];return(0,f.is)(n,c.Column)||(0,f.is)(n,d.SQL)||(0,f.is)(n,d.SQL.Aliased)||(0,f.is)(n,p.Subquery)?t.push({path:s,field:n}):(0,f.is)(n,m.Table)?t.push(...e(n[m.Table.Symbol.Columns],s)):t.push(...e(n,s)),t},[])},textDecoder:()=>C};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(28892),f=e.r(66044),d=e.r(84541),p=e.r(77509),m=e.r(9289),g=e.r(32315);function h(e,t,r){let i={},n=e.reduce((e,{path:n,field:s},o)=>{let a;a=(0,f.is)(s,c.Column)?s:(0,f.is)(s,d.SQL)?s.decoder:(0,f.is)(s,p.Subquery)?s._.sql.decoder:s.sql.decoder;let l=e;for(let[e,u]of n.entries())if(e<n.length-1)u in l||(l[u]={}),l=l[u];else{let e=t[o],d=l[u]=null===e?null:a.mapFromDriverValue(e);if(r&&(0,f.is)(s,c.Column)&&2===n.length){let e=n[0];e in i?"string"==typeof i[e]&&i[e]!==(0,m.getTableName)(s.table)&&(i[e]=!1):i[e]=null===d&&(0,m.getTableName)(s.table)}}return e},{});if(r&&Object.keys(i).length>0)for(let[e,t]of Object.entries(i))"string"!=typeof t||r[t]||(n[e]=null);return n}function y(e,t){let r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(let[e,t]of r.entries())if(t!==i[e])return!1;return!0}function b(e,t){let r=Object.entries(t).filter(([,e])=>void 0!==e).map(([t,r])=>(0,f.is)(r,d.SQL)||(0,f.is)(r,c.Column)?[t,r]:[t,new d.Param(r,e[m.Table.Symbol.Columns][t])]);if(0===r.length)throw Error("No values to set");return Object.fromEntries(r)}function w(e,t){for(let r of t)for(let t of Object.getOwnPropertyNames(r.prototype))"constructor"!==t&&Object.defineProperty(e.prototype,t,Object.getOwnPropertyDescriptor(r.prototype,t)||Object.create(null))}function O(e){return e[m.Table.Symbol.Columns]}function P(e){return e[g.ViewBaseConfig].selectedFields}function v(e){return(0,f.is)(e,p.Subquery)?e._.alias:(0,f.is)(e,d.View)?e[g.ViewBaseConfig].name:(0,f.is)(e,d.SQL)?void 0:e[m.Table.Symbol.IsAlias]?e[m.Table.Symbol.Name]:e[m.Table.Symbol.BaseName]}function S(e,t){return{name:"string"==typeof e&&e.length>0?e:"",config:"object"==typeof e?e:t}}function j(e){if("object"!=typeof e||null===e||"Object"!==e.constructor.name)return!1;if("logger"in e){let t=typeof e.logger;return"boolean"===t||"object"===t&&"function"==typeof e.logger.logQuery||"undefined"===t}if("schema"in e){let t=typeof e.schema;return"object"===t||"undefined"===t}if("casing"in e){let t=typeof e.casing;return"string"===t||"undefined"===t}if("mode"in e)return"default"===e.mode&&"planetscale"===e.mode&&void 0===e.mode;if("connection"in e){let t=typeof e.connection;return"string"===t||"object"===t||"undefined"===t}if("client"in e){let t=typeof e.client;return"object"===t||"function"===t||"undefined"===t}return 0===Object.keys(e).length}let C="u"<typeof TextDecoder?null:new TextDecoder},90767,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgIntColumnBaseBuilder:()=>d};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(54732);class d extends f.PgColumnBuilder{static [c.entityKind]="PgIntColumnBaseBuilder";generatedAlwaysAsIdentity(e){if(e){let{name:t,...r}=e;this.config.generatedIdentity={type:"always",sequenceName:t,sequenceOptions:r}}else this.config.generatedIdentity={type:"always"};return this.config.hasDefault=!0,this.config.notNull=!0,this}generatedByDefaultAsIdentity(e){if(e){let{name:t,...r}=e;this.config.generatedIdentity={type:"byDefault",sequenceName:t,sequenceOptions:r}}else this.config.generatedIdentity={type:"byDefault"};return this.config.hasDefault=!0,this.config.notNull=!0,this}}},98315,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgBigInt53:()=>g,PgBigInt53Builder:()=>m,PgBigInt64:()=>y,PgBigInt64Builder:()=>h,bigint:()=>b};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(96707),d=e.r(54732),p=e.r(90767);class m extends p.PgIntColumnBaseBuilder{static [c.entityKind]="PgBigInt53Builder";constructor(e){super(e,"number","PgBigInt53")}build(e){return new g(e,this.config)}}class g extends d.PgColumn{static [c.entityKind]="PgBigInt53";getSQLType(){return"bigint"}mapFromDriverValue(e){return"number"==typeof e?e:Number(e)}}class h extends p.PgIntColumnBaseBuilder{static [c.entityKind]="PgBigInt64Builder";constructor(e){super(e,"bigint","PgBigInt64")}build(e){return new y(e,this.config)}}class y extends d.PgColumn{static [c.entityKind]="PgBigInt64";getSQLType(){return"bigint"}mapFromDriverValue(e){return BigInt(e)}}function b(e,t){let{name:r,config:i}=(0,f.getColumnNameAndConfig)(e,t);return"number"===i.mode?new m(r):new h(r)}},79991,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgBigSerial53:()=>m,PgBigSerial53Builder:()=>p,PgBigSerial64:()=>h,PgBigSerial64Builder:()=>g,bigserial:()=>y};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(96707),d=e.r(54732);class p extends d.PgColumnBuilder{static [c.entityKind]="PgBigSerial53Builder";constructor(e){super(e,"number","PgBigSerial53"),this.config.hasDefault=!0,this.config.notNull=!0}build(e){return new m(e,this.config)}}class m extends d.PgColumn{static [c.entityKind]="PgBigSerial53";getSQLType(){return"bigserial"}mapFromDriverValue(e){return"number"==typeof e?e:Number(e)}}class g extends d.PgColumnBuilder{static [c.entityKind]="PgBigSerial64Builder";constructor(e){super(e,"bigint","PgBigSerial64"),this.config.hasDefault=!0}build(e){return new h(e,this.config)}}class h extends d.PgColumn{static [c.entityKind]="PgBigSerial64";getSQLType(){return"bigserial"}mapFromDriverValue(e){return BigInt(e)}}function y(e,t){let{name:r,config:i}=(0,f.getColumnNameAndConfig)(e,t);return"number"===i.mode?new p(r):new g(r)}},53548,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgBoolean:()=>p,PgBooleanBuilder:()=>d,boolean:()=>m};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(54732);class d extends f.PgColumnBuilder{static [c.entityKind]="PgBooleanBuilder";constructor(e){super(e,"boolean","PgBoolean")}build(e){return new p(e,this.config)}}class p extends f.PgColumn{static [c.entityKind]="PgBoolean";getSQLType(){return"boolean"}}function m(e){return new d(e??"")}},37329,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgChar:()=>m,PgCharBuilder:()=>p,char:()=>g};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(96707),d=e.r(54732);class p extends d.PgColumnBuilder{static [c.entityKind]="PgCharBuilder";constructor(e,t){super(e,"string","PgChar"),this.config.length=t.length,this.config.enumValues=t.enum}build(e){return new m(e,this.config)}}class m extends d.PgColumn{static [c.entityKind]="PgChar";length=this.config.length;enumValues=this.config.enumValues;getSQLType(){return void 0===this.length?"char":`char(${this.length})`}}function g(e,t={}){let{name:r,config:i}=(0,f.getColumnNameAndConfig)(e,t);return new p(r,i)}},97493,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgCidr:()=>p,PgCidrBuilder:()=>d,cidr:()=>m};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(54732);class d extends f.PgColumnBuilder{static [c.entityKind]="PgCidrBuilder";constructor(e){super(e,"string","PgCidr")}build(e){return new p(e,this.config)}}class p extends f.PgColumn{static [c.entityKind]="PgCidr";getSQLType(){return"cidr"}}function m(e){return new d(e??"")}},61148,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgCustomColumn:()=>m,PgCustomColumnBuilder:()=>p,customType:()=>g};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(96707),d=e.r(54732);class p extends d.PgColumnBuilder{static [c.entityKind]="PgCustomColumnBuilder";constructor(e,t,r){super(e,"custom","PgCustomColumn"),this.config.fieldConfig=t,this.config.customTypeParams=r}build(e){return new m(e,this.config)}}class m extends d.PgColumn{static [c.entityKind]="PgCustomColumn";sqlName;mapTo;mapFrom;constructor(e,t){super(e,t),this.sqlName=t.customTypeParams.dataType(t.fieldConfig),this.mapTo=t.customTypeParams.toDriver,this.mapFrom=t.customTypeParams.fromDriver}getSQLType(){return this.sqlName}mapFromDriverValue(e){return"function"==typeof this.mapFrom?this.mapFrom(e):e}mapToDriverValue(e){return"function"==typeof this.mapTo?this.mapTo(e):e}}function g(e){return(t,r)=>{let{name:i,config:n}=(0,f.getColumnNameAndConfig)(t,r);return new p(i,n,e)}}},44856,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgDateColumnBaseBuilder:()=>p};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(84541),d=e.r(54732);class p extends d.PgColumnBuilder{static [c.entityKind]="PgDateColumnBaseBuilder";defaultNow(){return this.default(f.sql`now()`)}}},74438,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgDate:()=>g,PgDateBuilder:()=>m,PgDateString:()=>y,PgDateStringBuilder:()=>h,date:()=>b};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(96707),d=e.r(54732),p=e.r(44856);class m extends p.PgDateColumnBaseBuilder{static [c.entityKind]="PgDateBuilder";constructor(e){super(e,"date","PgDate")}build(e){return new g(e,this.config)}}class g extends d.PgColumn{static [c.entityKind]="PgDate";getSQLType(){return"date"}mapFromDriverValue(e){return"string"==typeof e?new Date(e):e}mapToDriverValue(e){return e.toISOString()}}class h extends p.PgDateColumnBaseBuilder{static [c.entityKind]="PgDateStringBuilder";constructor(e){super(e,"string","PgDateString")}build(e){return new y(e,this.config)}}class y extends d.PgColumn{static [c.entityKind]="PgDateString";getSQLType(){return"date"}mapFromDriverValue(e){return"string"==typeof e?e:e.toISOString().slice(0,-14)}}function b(e,t){let{name:r,config:i}=(0,f.getColumnNameAndConfig)(e,t);return i?.mode==="date"?new m(r):new h(r)}},18358,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgDoublePrecision:()=>p,PgDoublePrecisionBuilder:()=>d,doublePrecision:()=>m};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(54732);class d extends f.PgColumnBuilder{static [c.entityKind]="PgDoublePrecisionBuilder";constructor(e){super(e,"number","PgDoublePrecision")}build(e){return new p(e,this.config)}}class p extends f.PgColumn{static [c.entityKind]="PgDoublePrecision";getSQLType(){return"double precision"}mapFromDriverValue(e){return"string"==typeof e?Number.parseFloat(e):e}}function m(e){return new d(e??"")}},71209,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgInet:()=>p,PgInetBuilder:()=>d,inet:()=>m};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(54732);class d extends f.PgColumnBuilder{static [c.entityKind]="PgInetBuilder";constructor(e){super(e,"string","PgInet")}build(e){return new p(e,this.config)}}class p extends f.PgColumn{static [c.entityKind]="PgInet";getSQLType(){return"inet"}}function m(e){return new d(e??"")}},21085,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgInteger:()=>m,PgIntegerBuilder:()=>p,integer:()=>g};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(54732),d=e.r(90767);class p extends d.PgIntColumnBaseBuilder{static [c.entityKind]="PgIntegerBuilder";constructor(e){super(e,"number","PgInteger")}build(e){return new m(e,this.config)}}class m extends f.PgColumn{static [c.entityKind]="PgInteger";getSQLType(){return"integer"}mapFromDriverValue(e){return"string"==typeof e?Number.parseInt(e):e}}function g(e){return new p(e??"")}},1137,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgInterval:()=>m,PgIntervalBuilder:()=>p,interval:()=>g};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(96707),d=e.r(54732);class p extends d.PgColumnBuilder{static [c.entityKind]="PgIntervalBuilder";constructor(e,t){super(e,"string","PgInterval"),this.config.intervalConfig=t}build(e){return new m(e,this.config)}}class m extends d.PgColumn{static [c.entityKind]="PgInterval";fields=this.config.intervalConfig.fields;precision=this.config.intervalConfig.precision;getSQLType(){let e=this.fields?` ${this.fields}`:"",t=this.precision?`(${this.precision})`:"";return`interval${e}${t}`}}function g(e,t={}){let{name:r,config:i}=(0,f.getColumnNameAndConfig)(e,t);return new p(r,i)}},80411,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgJson:()=>p,PgJsonBuilder:()=>d,json:()=>m};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(54732);class d extends f.PgColumnBuilder{static [c.entityKind]="PgJsonBuilder";constructor(e){super(e,"json","PgJson")}build(e){return new p(e,this.config)}}class p extends f.PgColumn{static [c.entityKind]="PgJson";constructor(e,t){super(e,t)}getSQLType(){return"json"}mapToDriverValue(e){return JSON.stringify(e)}mapFromDriverValue(e){if("string"==typeof e)try{return JSON.parse(e)}catch{}return e}}function m(e){return new d(e??"")}},92740,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgJsonb:()=>p,PgJsonbBuilder:()=>d,jsonb:()=>m};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(54732);class d extends f.PgColumnBuilder{static [c.entityKind]="PgJsonbBuilder";constructor(e){super(e,"json","PgJsonb")}build(e){return new p(e,this.config)}}class p extends f.PgColumn{static [c.entityKind]="PgJsonb";constructor(e,t){super(e,t)}getSQLType(){return"jsonb"}mapToDriverValue(e){return JSON.stringify(e)}mapFromDriverValue(e){if("string"==typeof e)try{return JSON.parse(e)}catch{}return e}}function m(e){return new d(e??"")}},33219,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgLineABC:()=>h,PgLineABCBuilder:()=>g,PgLineBuilder:()=>p,PgLineTuple:()=>m,line:()=>y};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(96707),d=e.r(54732);class p extends d.PgColumnBuilder{static [c.entityKind]="PgLineBuilder";constructor(e){super(e,"array","PgLine")}build(e){return new m(e,this.config)}}class m extends d.PgColumn{static [c.entityKind]="PgLine";getSQLType(){return"line"}mapFromDriverValue(e){let[t,r,i]=e.slice(1,-1).split(",");return[Number.parseFloat(t),Number.parseFloat(r),Number.parseFloat(i)]}mapToDriverValue(e){return`{${e[0]},${e[1]},${e[2]}}`}}class g extends d.PgColumnBuilder{static [c.entityKind]="PgLineABCBuilder";constructor(e){super(e,"json","PgLineABC")}build(e){return new h(e,this.config)}}class h extends d.PgColumn{static [c.entityKind]="PgLineABC";getSQLType(){return"line"}mapFromDriverValue(e){let[t,r,i]=e.slice(1,-1).split(",");return{a:Number.parseFloat(t),b:Number.parseFloat(r),c:Number.parseFloat(i)}}mapToDriverValue(e){return`{${e.a},${e.b},${e.c}}`}}function y(e,t){let{name:r,config:i}=(0,f.getColumnNameAndConfig)(e,t);return i?.mode&&"tuple"!==i.mode?new g(r):new p(r)}},881,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgMacaddr:()=>p,PgMacaddrBuilder:()=>d,macaddr:()=>m};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(54732);class d extends f.PgColumnBuilder{static [c.entityKind]="PgMacaddrBuilder";constructor(e){super(e,"string","PgMacaddr")}build(e){return new p(e,this.config)}}class p extends f.PgColumn{static [c.entityKind]="PgMacaddr";getSQLType(){return"macaddr"}}function m(e){return new d(e??"")}},55236,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgMacaddr8:()=>p,PgMacaddr8Builder:()=>d,macaddr8:()=>m};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(54732);class d extends f.PgColumnBuilder{static [c.entityKind]="PgMacaddr8Builder";constructor(e){super(e,"string","PgMacaddr8")}build(e){return new p(e,this.config)}}class p extends f.PgColumn{static [c.entityKind]="PgMacaddr8";getSQLType(){return"macaddr8"}}function m(e){return new d(e??"")}},25583,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgNumeric:()=>m,PgNumericBigInt:()=>b,PgNumericBigIntBuilder:()=>y,PgNumericBuilder:()=>p,PgNumericNumber:()=>h,PgNumericNumberBuilder:()=>g,decimal:()=>O,numeric:()=>w};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(96707),d=e.r(54732);class p extends d.PgColumnBuilder{static [c.entityKind]="PgNumericBuilder";constructor(e,t,r){super(e,"string","PgNumeric"),this.config.precision=t,this.config.scale=r}build(e){return new m(e,this.config)}}class m extends d.PgColumn{static [c.entityKind]="PgNumeric";precision;scale;constructor(e,t){super(e,t),this.precision=t.precision,this.scale=t.scale}mapFromDriverValue(e){return"string"==typeof e?e:String(e)}getSQLType(){return void 0!==this.precision&&void 0!==this.scale?`numeric(${this.precision}, ${this.scale})`:void 0===this.precision?"numeric":`numeric(${this.precision})`}}class g extends d.PgColumnBuilder{static [c.entityKind]="PgNumericNumberBuilder";constructor(e,t,r){super(e,"number","PgNumericNumber"),this.config.precision=t,this.config.scale=r}build(e){return new h(e,this.config)}}class h extends d.PgColumn{static [c.entityKind]="PgNumericNumber";precision;scale;constructor(e,t){super(e,t),this.precision=t.precision,this.scale=t.scale}mapFromDriverValue(e){return"number"==typeof e?e:Number(e)}mapToDriverValue=String;getSQLType(){return void 0!==this.precision&&void 0!==this.scale?`numeric(${this.precision}, ${this.scale})`:void 0===this.precision?"numeric":`numeric(${this.precision})`}}class y extends d.PgColumnBuilder{static [c.entityKind]="PgNumericBigIntBuilder";constructor(e,t,r){super(e,"bigint","PgNumericBigInt"),this.config.precision=t,this.config.scale=r}build(e){return new b(e,this.config)}}class b extends d.PgColumn{static [c.entityKind]="PgNumericBigInt";precision;scale;constructor(e,t){super(e,t),this.precision=t.precision,this.scale=t.scale}mapFromDriverValue=BigInt;mapToDriverValue=String;getSQLType(){return void 0!==this.precision&&void 0!==this.scale?`numeric(${this.precision}, ${this.scale})`:void 0===this.precision?"numeric":`numeric(${this.precision})`}}function w(e,t){let{name:r,config:i}=(0,f.getColumnNameAndConfig)(e,t),n=i?.mode;return"number"===n?new g(r,i?.precision,i?.scale):"bigint"===n?new y(r,i?.precision,i?.scale):new p(r,i?.precision,i?.scale)}let O=w},84011,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgPointObject:()=>h,PgPointObjectBuilder:()=>g,PgPointTuple:()=>m,PgPointTupleBuilder:()=>p,point:()=>y};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(96707),d=e.r(54732);class p extends d.PgColumnBuilder{static [c.entityKind]="PgPointTupleBuilder";constructor(e){super(e,"array","PgPointTuple")}build(e){return new m(e,this.config)}}class m extends d.PgColumn{static [c.entityKind]="PgPointTuple";getSQLType(){return"point"}mapFromDriverValue(e){if("string"==typeof e){let[t,r]=e.slice(1,-1).split(",");return[Number.parseFloat(t),Number.parseFloat(r)]}return[e.x,e.y]}mapToDriverValue(e){return`(${e[0]},${e[1]})`}}class g extends d.PgColumnBuilder{static [c.entityKind]="PgPointObjectBuilder";constructor(e){super(e,"json","PgPointObject")}build(e){return new h(e,this.config)}}class h extends d.PgColumn{static [c.entityKind]="PgPointObject";getSQLType(){return"point"}mapFromDriverValue(e){if("string"==typeof e){let[t,r]=e.slice(1,-1).split(",");return{x:Number.parseFloat(t),y:Number.parseFloat(r)}}return e}mapToDriverValue(e){return`(${e.x},${e.y})`}}function y(e,t){let{name:r,config:i}=(0,f.getColumnNameAndConfig)(e,t);return i?.mode&&"tuple"!==i.mode?new g(r):new p(r)}},97229,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={parseEWKB:()=>f};for(var u in l)i(a,u,{get:l[u],enumerable:!0});function c(e,t){let r=new DataView(new ArrayBuffer(8));for(let i=0;i<8;i++)r.setUint8(i,e[t+i]);return r.getFloat64(0,!0)}function f(e){let t=function(e){let t=[];for(let r=0;r<e.length;r+=2)t.push(Number.parseInt(e.slice(r,r+2),16));return new Uint8Array(t)}(e),r=0,i=t[0];r+=1;let n=new DataView(t.buffer),s=n.getUint32(r,1===i);if(r+=4,0x20000000&s&&(n.getUint32(r,1===i),r+=4),(65535&s)==1){let e=c(t,r),i=c(t,r+=8);return r+=8,[e,i]}throw Error("Unsupported geometry type")}t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a)},12752,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgGeometry:()=>g,PgGeometryBuilder:()=>m,PgGeometryObject:()=>y,PgGeometryObjectBuilder:()=>h,geometry:()=>b};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(96707),d=e.r(54732),p=e.r(97229);class m extends d.PgColumnBuilder{static [c.entityKind]="PgGeometryBuilder";constructor(e){super(e,"array","PgGeometry")}build(e){return new g(e,this.config)}}class g extends d.PgColumn{static [c.entityKind]="PgGeometry";getSQLType(){return"geometry(point)"}mapFromDriverValue(e){return(0,p.parseEWKB)(e)}mapToDriverValue(e){return`point(${e[0]} ${e[1]})`}}class h extends d.PgColumnBuilder{static [c.entityKind]="PgGeometryObjectBuilder";constructor(e){super(e,"json","PgGeometryObject")}build(e){return new y(e,this.config)}}class y extends d.PgColumn{static [c.entityKind]="PgGeometryObject";getSQLType(){return"geometry(point)"}mapFromDriverValue(e){let t=(0,p.parseEWKB)(e);return{x:t[0],y:t[1]}}mapToDriverValue(e){return`point(${e.x} ${e.y})`}}function b(e,t){let{name:r,config:i}=(0,f.getColumnNameAndConfig)(e,t);return i?.mode&&"tuple"!==i.mode?new h(r):new m(r)}},41846,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgReal:()=>p,PgRealBuilder:()=>d,real:()=>m};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(54732);class d extends f.PgColumnBuilder{static [c.entityKind]="PgRealBuilder";constructor(e,t){super(e,"number","PgReal"),this.config.length=t}build(e){return new p(e,this.config)}}class p extends f.PgColumn{static [c.entityKind]="PgReal";constructor(e,t){super(e,t)}getSQLType(){return"real"}mapFromDriverValue=e=>"string"==typeof e?Number.parseFloat(e):e}function m(e){return new d(e??"")}},32231,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgSerial:()=>p,PgSerialBuilder:()=>d,serial:()=>m};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(54732);class d extends f.PgColumnBuilder{static [c.entityKind]="PgSerialBuilder";constructor(e){super(e,"number","PgSerial"),this.config.hasDefault=!0,this.config.notNull=!0}build(e){return new p(e,this.config)}}class p extends f.PgColumn{static [c.entityKind]="PgSerial";getSQLType(){return"serial"}}function m(e){return new d(e??"")}},98697,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgSmallInt:()=>m,PgSmallIntBuilder:()=>p,smallint:()=>g};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(54732),d=e.r(90767);class p extends d.PgIntColumnBaseBuilder{static [c.entityKind]="PgSmallIntBuilder";constructor(e){super(e,"number","PgSmallInt")}build(e){return new m(e,this.config)}}class m extends f.PgColumn{static [c.entityKind]="PgSmallInt";getSQLType(){return"smallint"}mapFromDriverValue=e=>"string"==typeof e?Number(e):e}function g(e){return new p(e??"")}},71614,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgSmallSerial:()=>p,PgSmallSerialBuilder:()=>d,smallserial:()=>m};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(54732);class d extends f.PgColumnBuilder{static [c.entityKind]="PgSmallSerialBuilder";constructor(e){super(e,"number","PgSmallSerial"),this.config.hasDefault=!0,this.config.notNull=!0}build(e){return new p(e,this.config)}}class p extends f.PgColumn{static [c.entityKind]="PgSmallSerial";getSQLType(){return"smallserial"}}function m(e){return new d(e??"")}},43068,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgText:()=>m,PgTextBuilder:()=>p,text:()=>g};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(96707),d=e.r(54732);class p extends d.PgColumnBuilder{static [c.entityKind]="PgTextBuilder";constructor(e,t){super(e,"string","PgText"),this.config.enumValues=t.enum}build(e){return new m(e,this.config)}}class m extends d.PgColumn{static [c.entityKind]="PgText";enumValues=this.config.enumValues;getSQLType(){return"text"}}function g(e,t={}){let{name:r,config:i}=(0,f.getColumnNameAndConfig)(e,t);return new p(r,i)}},71130,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgTime:()=>g,PgTimeBuilder:()=>m,time:()=>h};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(96707),d=e.r(54732),p=e.r(44856);class m extends p.PgDateColumnBaseBuilder{constructor(e,t,r){super(e,"string","PgTime"),this.withTimezone=t,this.precision=r,this.config.withTimezone=t,this.config.precision=r}static [c.entityKind]="PgTimeBuilder";build(e){return new g(e,this.config)}}class g extends d.PgColumn{static [c.entityKind]="PgTime";withTimezone;precision;constructor(e,t){super(e,t),this.withTimezone=t.withTimezone,this.precision=t.precision}getSQLType(){let e=void 0===this.precision?"":`(${this.precision})`;return`time${e}${this.withTimezone?" with time zone":""}`}}function h(e,t={}){let{name:r,config:i}=(0,f.getColumnNameAndConfig)(e,t);return new m(r,i.withTimezone??!1,i.precision)}},68415,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgTimestamp:()=>g,PgTimestampBuilder:()=>m,PgTimestampString:()=>y,PgTimestampStringBuilder:()=>h,timestamp:()=>b};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(96707),d=e.r(54732),p=e.r(44856);class m extends p.PgDateColumnBaseBuilder{static [c.entityKind]="PgTimestampBuilder";constructor(e,t,r){super(e,"date","PgTimestamp"),this.config.withTimezone=t,this.config.precision=r}build(e){return new g(e,this.config)}}class g extends d.PgColumn{static [c.entityKind]="PgTimestamp";withTimezone;precision;constructor(e,t){super(e,t),this.withTimezone=t.withTimezone,this.precision=t.precision}getSQLType(){let e=void 0===this.precision?"":` (${this.precision})`;return`timestamp${e}${this.withTimezone?" with time zone":""}`}mapFromDriverValue(e){return"string"==typeof e?new Date(this.withTimezone?e:e+"+0000"):e}mapToDriverValue=e=>e.toISOString()}class h extends p.PgDateColumnBaseBuilder{static [c.entityKind]="PgTimestampStringBuilder";constructor(e,t,r){super(e,"string","PgTimestampString"),this.config.withTimezone=t,this.config.precision=r}build(e){return new y(e,this.config)}}class y extends d.PgColumn{static [c.entityKind]="PgTimestampString";withTimezone;precision;constructor(e,t){super(e,t),this.withTimezone=t.withTimezone,this.precision=t.precision}getSQLType(){let e=void 0===this.precision?"":`(${this.precision})`;return`timestamp${e}${this.withTimezone?" with time zone":""}`}mapFromDriverValue(e){if("string"==typeof e)return e;let t=e.toISOString().slice(0,-1).replace("T"," ");if(this.withTimezone){let r=e.getTimezoneOffset();return`${t}${r<=0?"+":"-"}${Math.floor(Math.abs(r)/60).toString().padStart(2,"0")}`}return t}}function b(e,t={}){let{name:r,config:i}=(0,f.getColumnNameAndConfig)(e,t);return i?.mode==="string"?new h(r,i.withTimezone??!1,i.precision):new m(r,i?.withTimezone??!1,i?.precision)}},36936,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgUUID:()=>m,PgUUIDBuilder:()=>p,uuid:()=>g};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(84541),d=e.r(54732);class p extends d.PgColumnBuilder{static [c.entityKind]="PgUUIDBuilder";constructor(e){super(e,"string","PgUUID")}defaultRandom(){return this.default(f.sql`gen_random_uuid()`)}build(e){return new m(e,this.config)}}class m extends d.PgColumn{static [c.entityKind]="PgUUID";getSQLType(){return"uuid"}}function g(e){return new p(e??"")}},74150,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgVarchar:()=>m,PgVarcharBuilder:()=>p,varchar:()=>g};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(96707),d=e.r(54732);class p extends d.PgColumnBuilder{static [c.entityKind]="PgVarcharBuilder";constructor(e,t){super(e,"string","PgVarchar"),this.config.length=t.length,this.config.enumValues=t.enum}build(e){return new m(e,this.config)}}class m extends d.PgColumn{static [c.entityKind]="PgVarchar";length=this.config.length;enumValues=this.config.enumValues;getSQLType(){return void 0===this.length?"varchar":`varchar(${this.length})`}}function g(e,t={}){let{name:r,config:i}=(0,f.getColumnNameAndConfig)(e,t);return new p(r,i)}},45596,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgBinaryVector:()=>m,PgBinaryVectorBuilder:()=>p,bit:()=>g};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(96707),d=e.r(54732);class p extends d.PgColumnBuilder{static [c.entityKind]="PgBinaryVectorBuilder";constructor(e,t){super(e,"string","PgBinaryVector"),this.config.dimensions=t.dimensions}build(e){return new m(e,this.config)}}class m extends d.PgColumn{static [c.entityKind]="PgBinaryVector";dimensions=this.config.dimensions;getSQLType(){return`bit(${this.dimensions})`}}function g(e,t){let{name:r,config:i}=(0,f.getColumnNameAndConfig)(e,t);return new p(r,i)}},97548,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgHalfVector:()=>m,PgHalfVectorBuilder:()=>p,halfvec:()=>g};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(96707),d=e.r(54732);class p extends d.PgColumnBuilder{static [c.entityKind]="PgHalfVectorBuilder";constructor(e,t){super(e,"array","PgHalfVector"),this.config.dimensions=t.dimensions}build(e){return new m(e,this.config)}}class m extends d.PgColumn{static [c.entityKind]="PgHalfVector";dimensions=this.config.dimensions;getSQLType(){return`halfvec(${this.dimensions})`}mapToDriverValue(e){return JSON.stringify(e)}mapFromDriverValue(e){return e.slice(1,-1).split(",").map(e=>Number.parseFloat(e))}}function g(e,t){let{name:r,config:i}=(0,f.getColumnNameAndConfig)(e,t);return new p(r,i)}},83240,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgSparseVector:()=>m,PgSparseVectorBuilder:()=>p,sparsevec:()=>g};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(96707),d=e.r(54732);class p extends d.PgColumnBuilder{static [c.entityKind]="PgSparseVectorBuilder";constructor(e,t){super(e,"string","PgSparseVector"),this.config.dimensions=t.dimensions}build(e){return new m(e,this.config)}}class m extends d.PgColumn{static [c.entityKind]="PgSparseVector";dimensions=this.config.dimensions;getSQLType(){return`sparsevec(${this.dimensions})`}}function g(e,t){let{name:r,config:i}=(0,f.getColumnNameAndConfig)(e,t);return new p(r,i)}},56473,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgVector:()=>m,PgVectorBuilder:()=>p,vector:()=>g};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(96707),d=e.r(54732);class p extends d.PgColumnBuilder{static [c.entityKind]="PgVectorBuilder";constructor(e,t){super(e,"array","PgVector"),this.config.dimensions=t.dimensions}build(e){return new m(e,this.config)}}class m extends d.PgColumn{static [c.entityKind]="PgVector";dimensions=this.config.dimensions;getSQLType(){return`vector(${this.dimensions})`}mapToDriverValue(e){return JSON.stringify(e)}mapFromDriverValue(e){return e.slice(1,-1).split(",").map(e=>Number.parseFloat(e))}}function g(e,t){let{name:r,config:i}=(0,f.getColumnNameAndConfig)(e,t);return new p(r,i)}},92097,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={getPgColumnBuilders:()=>E};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(98315),f=e.r(79991),d=e.r(53548),p=e.r(37329),m=e.r(97493),g=e.r(61148),h=e.r(74438),y=e.r(18358),b=e.r(71209),w=e.r(21085),O=e.r(1137),P=e.r(80411),v=e.r(92740),S=e.r(33219),j=e.r(881),C=e.r(55236),B=e.r(25583),x=e.r(84011),T=e.r(12752),Q=e.r(41846),N=e.r(32231),q=e.r(98697),L=e.r(71614),D=e.r(43068),_=e.r(71130),$=e.r(68415),K=e.r(36936),A=e.r(74150),F=e.r(45596),V=e.r(97548),I=e.r(83240),M=e.r(56473);function E(){return{bigint:c.bigint,bigserial:f.bigserial,boolean:d.boolean,char:p.char,cidr:m.cidr,customType:g.customType,date:h.date,doublePrecision:y.doublePrecision,inet:b.inet,integer:w.integer,interval:O.interval,json:P.json,jsonb:v.jsonb,line:S.line,macaddr:j.macaddr,macaddr8:C.macaddr8,numeric:B.numeric,point:x.point,geometry:T.geometry,real:Q.real,serial:N.serial,smallint:q.smallint,smallserial:L.smallserial,text:D.text,time:_.time,timestamp:$.timestamp,uuid:K.uuid,varchar:A.varchar,bit:F.bit,halfvec:V.halfvec,sparsevec:I.sparsevec,vector:M.vector}}},65232,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={EnableRLS:()=>m,InlineForeignKeys:()=>p,PgTable:()=>g,pgTable:()=>y,pgTableCreator:()=>b,pgTableWithSchema:()=>h};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(9289),d=e.r(92097);let p=Symbol.for("drizzle:PgInlineForeignKeys"),m=Symbol.for("drizzle:EnableRLS");class g extends f.Table{static [c.entityKind]="PgTable";static Symbol=Object.assign({},f.Table.Symbol,{InlineForeignKeys:p,EnableRLS:m});[p]=[];[m]=!1;[f.Table.Symbol.ExtraConfigBuilder]=void 0;[f.Table.Symbol.ExtraConfigColumns]={}}function h(e,t,r,i,n=e){let s=new g(e,i,n),o="function"==typeof t?t((0,d.getPgColumnBuilders)()):t,a=Object.fromEntries(Object.entries(o).map(([e,t])=>{t.setName(e);let r=t.build(s);return s[p].push(...t.buildForeignKeys(r,s)),[e,r]})),l=Object.fromEntries(Object.entries(o).map(([e,t])=>(t.setName(e),[e,t.buildExtraConfigColumn(s)]))),u=Object.assign(s,a);return u[f.Table.Symbol.Columns]=a,u[f.Table.Symbol.ExtraConfigColumns]=l,r&&(u[g.Symbol.ExtraConfigBuilder]=r),Object.assign(u,{enableRLS:()=>(u[g.Symbol.EnableRLS]=!0,u)})}let y=(e,t,r)=>h(e,t,r,void 0);function b(e){return(t,r,i)=>h(e(t),r,i,void 0,t)}},23331,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PrimaryKey:()=>m,PrimaryKeyBuilder:()=>p,primaryKey:()=>d};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(65232);function d(...e){return e[0].columns?new p(e[0].columns,e[0].name):new p(e)}class p{static [c.entityKind]="PgPrimaryKeyBuilder";columns;name;constructor(e,t){this.columns=e,this.name=t}build(e){return new m(e,this.columns,this.name)}}class m{constructor(e,t,r){this.table=e,this.columns=t,this.name=r}static [c.entityKind]="PgPrimaryKey";columns;name;getName(){return this.name??`${this.table[f.PgTable.Symbol.Name]}_${this.columns.map(e=>e.name).join("_")}_pk`}}},98084,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={and:()=>y,arrayContained:()=>A,arrayContains:()=>K,arrayOverlaps:()=>F,between:()=>N,bindIfParam:()=>m,eq:()=>g,exists:()=>T,gt:()=>O,gte:()=>P,ilike:()=>_,inArray:()=>j,isNotNull:()=>x,isNull:()=>B,like:()=>L,lt:()=>v,lte:()=>S,ne:()=>h,not:()=>w,notBetween:()=>q,notExists:()=>Q,notIlike:()=>$,notInArray:()=>C,notLike:()=>D,or:()=>b};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(28892),f=e.r(66044),d=e.r(9289),p=e.r(84541);function m(e,t){return!(0,p.isDriverValueEncoder)(t)||(0,p.isSQLWrapper)(e)||(0,f.is)(e,p.Param)||(0,f.is)(e,p.Placeholder)||(0,f.is)(e,c.Column)||(0,f.is)(e,d.Table)||(0,f.is)(e,p.View)?e:new p.Param(e,t)}let g=(e,t)=>p.sql`${e} = ${m(t,e)}`,h=(e,t)=>p.sql`${e} <> ${m(t,e)}`;function y(...e){let t=e.filter(e=>void 0!==e);if(0!==t.length)return new p.SQL(1===t.length?t:[new p.StringChunk("("),p.sql.join(t,new p.StringChunk(" and ")),new p.StringChunk(")")])}function b(...e){let t=e.filter(e=>void 0!==e);if(0!==t.length)return new p.SQL(1===t.length?t:[new p.StringChunk("("),p.sql.join(t,new p.StringChunk(" or ")),new p.StringChunk(")")])}function w(e){return p.sql`not ${e}`}let O=(e,t)=>p.sql`${e} > ${m(t,e)}`,P=(e,t)=>p.sql`${e} >= ${m(t,e)}`,v=(e,t)=>p.sql`${e} < ${m(t,e)}`,S=(e,t)=>p.sql`${e} <= ${m(t,e)}`;function j(e,t){return Array.isArray(t)?0===t.length?p.sql`false`:p.sql`${e} in ${t.map(t=>m(t,e))}`:p.sql`${e} in ${m(t,e)}`}function C(e,t){return Array.isArray(t)?0===t.length?p.sql`true`:p.sql`${e} not in ${t.map(t=>m(t,e))}`:p.sql`${e} not in ${m(t,e)}`}function B(e){return p.sql`${e} is null`}function x(e){return p.sql`${e} is not null`}function T(e){return p.sql`exists ${e}`}function Q(e){return p.sql`not exists ${e}`}function N(e,t,r){return p.sql`${e} between ${m(t,e)} and ${m(r,e)}`}function q(e,t,r){return p.sql`${e} not between ${m(t,e)} and ${m(r,e)}`}function L(e,t){return p.sql`${e} like ${t}`}function D(e,t){return p.sql`${e} not like ${t}`}function _(e,t){return p.sql`${e} ilike ${t}`}function $(e,t){return p.sql`${e} not ilike ${t}`}function K(e,t){if(Array.isArray(t)){if(0===t.length)throw Error("arrayContains requires at least one value");let r=p.sql`${m(t,e)}`;return p.sql`${e} @> ${r}`}return p.sql`${e} @> ${m(t,e)}`}function A(e,t){if(Array.isArray(t)){if(0===t.length)throw Error("arrayContained requires at least one value");let r=p.sql`${m(t,e)}`;return p.sql`${e} <@ ${r}`}return p.sql`${e} <@ ${m(t,e)}`}function F(e,t){if(Array.isArray(t)){if(0===t.length)throw Error("arrayOverlaps requires at least one value");let r=p.sql`${m(t,e)}`;return p.sql`${e} && ${r}`}return p.sql`${e} && ${m(t,e)}`}},62755,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={asc:()=>f,desc:()=>d};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(84541);function f(e){return c.sql`${e} asc`}function d(e){return c.sql`${e} desc`}},45592,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a=(e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of s(t))o.call(e,l)||l===r||i(e,l,{get:()=>t[l],enumerable:!(a=n(t,l))||a.enumerable});return e},l=(e,t,r)=>(a(e,t,"default"),r&&a(r,t,"default")),u={};t.exports=a(i({},"__esModule",{value:!0}),u),l(u,e.r(98084),t.exports),l(u,e.r(62755),t.exports)},97404,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={Many:()=>w,One:()=>b,Relation:()=>h,Relations:()=>y,createMany:()=>C,createOne:()=>j,createTableRelationsHelpers:()=>x,extractTablesRelationalConfig:()=>v,getOperators:()=>O,getOrderByOperators:()=>P,mapRelationalRow:()=>function e(t,r,i,n,s=e=>e){let o={};for(let[a,l]of n.entries())if(l.isJson){let n=r.relations[l.tsKey],u=i[a],c="string"==typeof u?JSON.parse(u):u;o[l.tsKey]=(0,d.is)(n,b)?c&&e(t,t[l.relationTableTsKey],c,l.selection,s):c.map(r=>e(t,t[l.relationTableTsKey],r,l.selection,s))}else{let e,t=s(i[a]),r=l.field;e=(0,d.is)(r,f.Column)?r:(0,d.is)(r,g.SQL)?r.decoder:r.sql.decoder,o[l.tsKey]=null===t?null:e.mapFromDriverValue(t)}return o},normalizeRelation:()=>B,relations:()=>S};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(9289),f=e.r(28892),d=e.r(66044),p=e.r(23331),m=e.r(45592),g=e.r(84541);class h{constructor(e,t,r){this.sourceTable=e,this.referencedTable=t,this.relationName=r,this.referencedTableName=t[c.Table.Symbol.Name]}static [d.entityKind]="Relation";referencedTableName;fieldName}class y{constructor(e,t){this.table=e,this.config=t}static [d.entityKind]="Relations"}class b extends h{constructor(e,t,r,i){super(e,t,r?.relationName),this.config=r,this.isNullable=i}static [d.entityKind]="One";withFieldName(e){let t=new b(this.sourceTable,this.referencedTable,this.config,this.isNullable);return t.fieldName=e,t}}class w extends h{constructor(e,t,r){super(e,t,r?.relationName),this.config=r}static [d.entityKind]="Many";withFieldName(e){let t=new w(this.sourceTable,this.referencedTable,this.config);return t.fieldName=e,t}}function O(){return{and:m.and,between:m.between,eq:m.eq,exists:m.exists,gt:m.gt,gte:m.gte,ilike:m.ilike,inArray:m.inArray,isNull:m.isNull,isNotNull:m.isNotNull,like:m.like,lt:m.lt,lte:m.lte,ne:m.ne,not:m.not,notBetween:m.notBetween,notExists:m.notExists,notLike:m.notLike,notIlike:m.notIlike,notInArray:m.notInArray,or:m.or,sql:g.sql}}function P(){return{sql:g.sql,asc:m.asc,desc:m.desc}}function v(e,t){1===Object.keys(e).length&&"default"in e&&!(0,d.is)(e.default,c.Table)&&(e=e.default);let r={},i={},n={};for(let[s,o]of Object.entries(e))if((0,d.is)(o,c.Table)){let e=(0,c.getTableUniqueName)(o),t=i[e];for(let i of(r[e]=s,n[s]={tsName:s,dbName:o[c.Table.Symbol.Name],schema:o[c.Table.Symbol.Schema],columns:o[c.Table.Symbol.Columns],relations:t?.relations??{},primaryKey:t?.primaryKey??[]},Object.values(o[c.Table.Symbol.Columns])))i.primary&&n[s].primaryKey.push(i);let a=o[c.Table.Symbol.ExtraConfigBuilder]?.(o[c.Table.Symbol.ExtraConfigColumns]);if(a)for(let e of Object.values(a))(0,d.is)(e,p.PrimaryKeyBuilder)&&n[s].primaryKey.push(...e.columns)}else if((0,d.is)(o,y)){let e,s=(0,c.getTableUniqueName)(o.table),a=r[s];for(let[r,l]of Object.entries(o.config(t(o.table))))if(a){let t=n[a];t.relations[r]=l,e&&t.primaryKey.push(...e)}else s in i||(i[s]={relations:{},primaryKey:e}),i[s].relations[r]=l}return{tables:n,tableNamesMap:r}}function S(e,t){return new y(e,e=>Object.fromEntries(Object.entries(t(e)).map(([e,t])=>[e,t.withFieldName(e)])))}function j(e){return function(t,r){return new b(e,t,r,r?.fields.reduce((e,t)=>e&&t.notNull,!0)??!1)}}function C(e){return function(t,r){return new w(e,t,r)}}function B(e,t,r){if((0,d.is)(r,b)&&r.config)return{fields:r.config.fields,references:r.config.references};let i=t[(0,c.getTableUniqueName)(r.referencedTable)];if(!i)throw Error(`Table "${r.referencedTable[c.Table.Symbol.Name]}" not found in schema`);let n=e[i];if(!n)throw Error(`Table "${i}" not found in schema`);let s=r.sourceTable,o=t[(0,c.getTableUniqueName)(s)];if(!o)throw Error(`Table "${s[c.Table.Symbol.Name]}" not found in schema`);let a=[];for(let e of Object.values(n.relations))(r.relationName&&r!==e&&e.relationName===r.relationName||!r.relationName&&e.referencedTable===r.sourceTable)&&a.push(e);if(a.length>1)throw r.relationName?Error(`There are multiple relations with name "${r.relationName}" in table "${i}"`):Error(`There are multiple relations between "${i}" and "${r.sourceTable[c.Table.Symbol.Name]}". Please specify relation name`);if(a[0]&&(0,d.is)(a[0],b)&&a[0].config)return{fields:a[0].config.references,references:a[0].config.fields};throw Error(`There is not enough information to infer relation "${o}.${r.fieldName}"`)}function x(e){return{one:j(e),many:C(e)}}},77870,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={ColumnAliasProxyHandler:()=>g,RelationTableAliasProxyHandler:()=>y,TableAliasProxyHandler:()=>h,aliasedRelation:()=>w,aliasedTable:()=>b,aliasedTableColumn:()=>O,mapColumnsInAliasedSQLToAlias:()=>P,mapColumnsInSQLToAlias:()=>v};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(28892),f=e.r(66044),d=e.r(84541),p=e.r(9289),m=e.r(32315);class g{constructor(e){this.table=e}static [f.entityKind]="ColumnAliasProxyHandler";get(e,t){return"table"===t?this.table:e[t]}}class h{constructor(e,t){this.alias=e,this.replaceOriginalName=t}static [f.entityKind]="TableAliasProxyHandler";get(e,t){if(t===p.Table.Symbol.IsAlias)return!0;if(t===p.Table.Symbol.Name||this.replaceOriginalName&&t===p.Table.Symbol.OriginalName)return this.alias;if(t===m.ViewBaseConfig)return{...e[m.ViewBaseConfig],name:this.alias,isAlias:!0};if(t===p.Table.Symbol.Columns){let t=e[p.Table.Symbol.Columns];if(!t)return t;let r={};return Object.keys(t).map(i=>{r[i]=new Proxy(t[i],new g(new Proxy(e,this)))}),r}let r=e[t];return(0,f.is)(r,c.Column)?new Proxy(r,new g(new Proxy(e,this))):r}}class y{constructor(e){this.alias=e}static [f.entityKind]="RelationTableAliasProxyHandler";get(e,t){return"sourceTable"===t?b(e.sourceTable,this.alias):e[t]}}function b(e,t){return new Proxy(e,new h(t,!1))}function w(e,t){return new Proxy(e,new y(t))}function O(e,t){return new Proxy(e,new g(new Proxy(e.table,new h(t,!1))))}function P(e,t){return new d.SQL.Aliased(v(e.sql,t),e.fieldAlias)}function v(e,t){return d.sql.join(e.queryChunks.map(e=>(0,f.is)(e,c.Column)?O(e,t):(0,f.is)(e,d.SQL)?v(e,t):(0,f.is)(e,d.SQL.Aliased)?P(e,t):e))}},34700,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={SelectionProxyHandler:()=>h};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(77870),f=e.r(28892),d=e.r(66044),p=e.r(84541),m=e.r(77509),g=e.r(32315);class h{static [d.entityKind]="SelectionProxyHandler";config;constructor(e){this.config={...e}}get(e,t){if("_"===t)return{...e._,selectedFields:new Proxy(e._.selectedFields,this)};if(t===g.ViewBaseConfig)return{...e[g.ViewBaseConfig],selectedFields:new Proxy(e[g.ViewBaseConfig].selectedFields,this)};if("symbol"==typeof t)return e[t];let r=((0,d.is)(e,m.Subquery)?e._.selectedFields:(0,d.is)(e,p.View)?e[g.ViewBaseConfig].selectedFields:e)[t];if((0,d.is)(r,p.SQL.Aliased)){if("sql"===this.config.sqlAliasedBehavior&&!r.isSelectionField)return r.sql;let e=r.clone();return e.isSelectionField=!0,e}if((0,d.is)(r,p.SQL)){if("sql"===this.config.sqlBehavior)return r;throw Error(`You tried to reference "${t}" field from a subquery, which is a raw SQL field, but it doesn't have an alias declared. Please add an alias to the field using ".as('alias')" method.`)}return(0,d.is)(r,f.Column)?this.config.alias?new Proxy(r,new c.ColumnAliasProxyHandler(new Proxy(r.table,new c.TableAliasProxyHandler(this.config.alias,this.config.replaceOriginalName??!1)))):r:"object"!=typeof r||null===r?r:new Proxy(r,new h(this.config))}}},18875,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={QueryPromise:()=>f};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044);class f{static [c.entityKind]="QueryPromise";[Symbol.toStringTag]="QueryPromise";catch(e){return this.then(void 0,e)}finally(e){return this.then(t=>(e?.(),t),t=>{throw e?.(),t})}then(e,t){return this.execute().then(e,t)}}},9952,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={ForeignKey:()=>p,ForeignKeyBuilder:()=>d,foreignKey:()=>m};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(88564);class d{static [c.entityKind]="SQLiteForeignKeyBuilder";reference;_onUpdate;_onDelete;constructor(e,t){this.reference=()=>{let{name:t,columns:r,foreignColumns:i}=e();return{name:t,columns:r,foreignTable:i[0].table,foreignColumns:i}},t&&(this._onUpdate=t.onUpdate,this._onDelete=t.onDelete)}onUpdate(e){return this._onUpdate=e,this}onDelete(e){return this._onDelete=e,this}build(e){return new p(e,this)}}class p{constructor(e,t){this.table=e,this.reference=t.reference,this.onUpdate=t._onUpdate,this.onDelete=t._onDelete}static [c.entityKind]="SQLiteForeignKey";reference;onUpdate;onDelete;getName(){let{name:e,columns:t,foreignColumns:r}=this.reference(),i=t.map(e=>e.name),n=r.map(e=>e.name),s=[this.table[f.TableName],...i,r[0].table[f.TableName],...n];return e??`${s.join("_")}_fk`}}function m(e){return new d(function(){if("function"==typeof e){let{name:t,columns:r,foreignColumns:i}=e();return{name:t,columns:r,foreignColumns:i}}return e})}},15317,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={UniqueConstraint:()=>h,UniqueConstraintBuilder:()=>m,UniqueOnConstraintBuilder:()=>g,unique:()=>p,uniqueKeyName:()=>d};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(88564);function d(e,t){return`${e[f.TableName]}_${t.join("_")}_unique`}function p(e){return new g(e)}class m{constructor(e,t){this.name=t,this.columns=e}static [c.entityKind]="SQLiteUniqueConstraintBuilder";columns;build(e){return new h(e,this.columns,this.name)}}class g{static [c.entityKind]="SQLiteUniqueOnConstraintBuilder";name;constructor(e){this.name=e}on(...e){return new m(e,this.name)}}class h{constructor(e,t,r){this.table=e,this.columns=t,this.name=r??d(this.table,this.columns.map(e=>e.name))}static [c.entityKind]="SQLiteUniqueConstraint";columns;name;getName(){return this.name}}},42381,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={SQLiteColumn:()=>h,SQLiteColumnBuilder:()=>g};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(601),f=e.r(28892),d=e.r(66044),p=e.r(9952),m=e.r(15317);class g extends c.ColumnBuilder{static [d.entityKind]="SQLiteColumnBuilder";foreignKeyConfigs=[];references(e,t={}){return this.foreignKeyConfigs.push({ref:e,actions:t}),this}unique(e){return this.config.isUnique=!0,this.config.uniqueName=e,this}generatedAlwaysAs(e,t){return this.config.generated={as:e,type:"always",mode:t?.mode??"virtual"},this}buildForeignKeys(e,t){return this.foreignKeyConfigs.map(({ref:r,actions:i})=>{let n;return n=new p.ForeignKeyBuilder(()=>({columns:[e],foreignColumns:[r()]})),i.onUpdate&&n.onUpdate(i.onUpdate),i.onDelete&&n.onDelete(i.onDelete),n.build(t)})}}class h extends f.Column{constructor(e,t){t.uniqueName||(t.uniqueName=(0,m.uniqueKeyName)(e,[t.name])),super(e,t),this.table=e}static [d.entityKind]="SQLiteColumn"}},18762,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={SQLiteBigInt:()=>m,SQLiteBigIntBuilder:()=>p,SQLiteBlobBuffer:()=>b,SQLiteBlobBufferBuilder:()=>y,SQLiteBlobJson:()=>h,SQLiteBlobJsonBuilder:()=>g,blob:()=>w};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(96707),d=e.r(42381);class p extends d.SQLiteColumnBuilder{static [c.entityKind]="SQLiteBigIntBuilder";constructor(e){super(e,"bigint","SQLiteBigInt")}build(e){return new m(e,this.config)}}class m extends d.SQLiteColumn{static [c.entityKind]="SQLiteBigInt";getSQLType(){return"blob"}mapFromDriverValue(e){return"u">typeof Buffer&&Buffer.from?BigInt((Buffer.isBuffer(e)?e:e instanceof ArrayBuffer?Buffer.from(e):e.buffer?Buffer.from(e.buffer,e.byteOffset,e.byteLength):Buffer.from(e)).toString("utf8")):BigInt(f.textDecoder.decode(e))}mapToDriverValue(e){return Buffer.from(e.toString())}}class g extends d.SQLiteColumnBuilder{static [c.entityKind]="SQLiteBlobJsonBuilder";constructor(e){super(e,"json","SQLiteBlobJson")}build(e){return new h(e,this.config)}}class h extends d.SQLiteColumn{static [c.entityKind]="SQLiteBlobJson";getSQLType(){return"blob"}mapFromDriverValue(e){return"u">typeof Buffer&&Buffer.from?JSON.parse((Buffer.isBuffer(e)?e:e instanceof ArrayBuffer?Buffer.from(e):e.buffer?Buffer.from(e.buffer,e.byteOffset,e.byteLength):Buffer.from(e)).toString("utf8")):JSON.parse(f.textDecoder.decode(e))}mapToDriverValue(e){return Buffer.from(JSON.stringify(e))}}class y extends d.SQLiteColumnBuilder{static [c.entityKind]="SQLiteBlobBufferBuilder";constructor(e){super(e,"buffer","SQLiteBlobBuffer")}build(e){return new b(e,this.config)}}class b extends d.SQLiteColumn{static [c.entityKind]="SQLiteBlobBuffer";mapFromDriverValue(e){return Buffer.isBuffer(e)?e:Buffer.from(e)}getSQLType(){return"blob"}}function w(e,t){let{name:r,config:i}=(0,f.getColumnNameAndConfig)(e,t);return i?.mode==="json"?new g(r):i?.mode==="bigint"?new p(r):new y(r)}},87081,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={SQLiteCustomColumn:()=>m,SQLiteCustomColumnBuilder:()=>p,customType:()=>g};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(96707),d=e.r(42381);class p extends d.SQLiteColumnBuilder{static [c.entityKind]="SQLiteCustomColumnBuilder";constructor(e,t,r){super(e,"custom","SQLiteCustomColumn"),this.config.fieldConfig=t,this.config.customTypeParams=r}build(e){return new m(e,this.config)}}class m extends d.SQLiteColumn{static [c.entityKind]="SQLiteCustomColumn";sqlName;mapTo;mapFrom;constructor(e,t){super(e,t),this.sqlName=t.customTypeParams.dataType(t.fieldConfig),this.mapTo=t.customTypeParams.toDriver,this.mapFrom=t.customTypeParams.fromDriver}getSQLType(){return this.sqlName}mapFromDriverValue(e){return"function"==typeof this.mapFrom?this.mapFrom(e):e}mapToDriverValue(e){return"function"==typeof this.mapTo?this.mapTo(e):e}}function g(e){return(t,r)=>{let{name:i,config:n}=(0,f.getColumnNameAndConfig)(t,r);return new p(i,n,e)}}},162,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={SQLiteBaseInteger:()=>g,SQLiteBaseIntegerBuilder:()=>m,SQLiteBoolean:()=>P,SQLiteBooleanBuilder:()=>O,SQLiteInteger:()=>y,SQLiteIntegerBuilder:()=>h,SQLiteTimestamp:()=>w,SQLiteTimestampBuilder:()=>b,int:()=>S,integer:()=>v};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(84541),d=e.r(96707),p=e.r(42381);class m extends p.SQLiteColumnBuilder{static [c.entityKind]="SQLiteBaseIntegerBuilder";constructor(e,t,r){super(e,t,r),this.config.autoIncrement=!1}primaryKey(e){return e?.autoIncrement&&(this.config.autoIncrement=!0),this.config.hasDefault=!0,super.primaryKey()}}class g extends p.SQLiteColumn{static [c.entityKind]="SQLiteBaseInteger";autoIncrement=this.config.autoIncrement;getSQLType(){return"integer"}}class h extends m{static [c.entityKind]="SQLiteIntegerBuilder";constructor(e){super(e,"number","SQLiteInteger")}build(e){return new y(e,this.config)}}class y extends g{static [c.entityKind]="SQLiteInteger"}class b extends m{static [c.entityKind]="SQLiteTimestampBuilder";constructor(e,t){super(e,"date","SQLiteTimestamp"),this.config.mode=t}defaultNow(){return this.default(f.sql`(cast((julianday('now') - 2440587.5)*86400000 as integer))`)}build(e){return new w(e,this.config)}}class w extends g{static [c.entityKind]="SQLiteTimestamp";mode=this.config.mode;mapFromDriverValue(e){return new Date("timestamp"===this.config.mode?1e3*e:e)}mapToDriverValue(e){let t=e.getTime();return"timestamp"===this.config.mode?Math.floor(t/1e3):t}}class O extends m{static [c.entityKind]="SQLiteBooleanBuilder";constructor(e,t){super(e,"boolean","SQLiteBoolean"),this.config.mode=t}build(e){return new P(e,this.config)}}class P extends g{static [c.entityKind]="SQLiteBoolean";mode=this.config.mode;mapFromDriverValue(e){return 1===Number(e)}mapToDriverValue(e){return+!!e}}function v(e,t){let{name:r,config:i}=(0,d.getColumnNameAndConfig)(e,t);return i?.mode==="timestamp"||i?.mode==="timestamp_ms"?new b(r,i.mode):i?.mode==="boolean"?new O(r,i.mode):new h(r)}let S=v},54751,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={SQLiteNumeric:()=>m,SQLiteNumericBigInt:()=>b,SQLiteNumericBigIntBuilder:()=>y,SQLiteNumericBuilder:()=>p,SQLiteNumericNumber:()=>h,SQLiteNumericNumberBuilder:()=>g,numeric:()=>w};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(96707),d=e.r(42381);class p extends d.SQLiteColumnBuilder{static [c.entityKind]="SQLiteNumericBuilder";constructor(e){super(e,"string","SQLiteNumeric")}build(e){return new m(e,this.config)}}class m extends d.SQLiteColumn{static [c.entityKind]="SQLiteNumeric";mapFromDriverValue(e){return"string"==typeof e?e:String(e)}getSQLType(){return"numeric"}}class g extends d.SQLiteColumnBuilder{static [c.entityKind]="SQLiteNumericNumberBuilder";constructor(e){super(e,"number","SQLiteNumericNumber")}build(e){return new h(e,this.config)}}class h extends d.SQLiteColumn{static [c.entityKind]="SQLiteNumericNumber";mapFromDriverValue(e){return"number"==typeof e?e:Number(e)}mapToDriverValue=String;getSQLType(){return"numeric"}}class y extends d.SQLiteColumnBuilder{static [c.entityKind]="SQLiteNumericBigIntBuilder";constructor(e){super(e,"bigint","SQLiteNumericBigInt")}build(e){return new b(e,this.config)}}class b extends d.SQLiteColumn{static [c.entityKind]="SQLiteNumericBigInt";mapFromDriverValue=BigInt;mapToDriverValue=String;getSQLType(){return"numeric"}}function w(e,t){let{name:r,config:i}=(0,f.getColumnNameAndConfig)(e,t),n=i?.mode;return"number"===n?new g(r):"bigint"===n?new y(r):new p(r)}},6941,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={SQLiteReal:()=>p,SQLiteRealBuilder:()=>d,real:()=>m};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(42381);class d extends f.SQLiteColumnBuilder{static [c.entityKind]="SQLiteRealBuilder";constructor(e){super(e,"number","SQLiteReal")}build(e){return new p(e,this.config)}}class p extends f.SQLiteColumn{static [c.entityKind]="SQLiteReal";getSQLType(){return"real"}}function m(e){return new d(e??"")}},67773,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={SQLiteText:()=>m,SQLiteTextBuilder:()=>p,SQLiteTextJson:()=>h,SQLiteTextJsonBuilder:()=>g,text:()=>y};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(96707),d=e.r(42381);class p extends d.SQLiteColumnBuilder{static [c.entityKind]="SQLiteTextBuilder";constructor(e,t){super(e,"string","SQLiteText"),this.config.enumValues=t.enum,this.config.length=t.length}build(e){return new m(e,this.config)}}class m extends d.SQLiteColumn{static [c.entityKind]="SQLiteText";enumValues=this.config.enumValues;length=this.config.length;constructor(e,t){super(e,t)}getSQLType(){return`text${this.config.length?`(${this.config.length})`:""}`}}class g extends d.SQLiteColumnBuilder{static [c.entityKind]="SQLiteTextJsonBuilder";constructor(e){super(e,"json","SQLiteTextJson")}build(e){return new h(e,this.config)}}class h extends d.SQLiteColumn{static [c.entityKind]="SQLiteTextJson";getSQLType(){return"text"}mapFromDriverValue(e){return JSON.parse(e)}mapToDriverValue(e){return JSON.stringify(e)}}function y(e,t={}){let{name:r,config:i}=(0,f.getColumnNameAndConfig)(e,t);return"json"===i.mode?new g(r):new p(r,i)}},1523,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={getSQLiteColumnBuilders:()=>h};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(18762),f=e.r(87081),d=e.r(162),p=e.r(54751),m=e.r(6941),g=e.r(67773);function h(){return{blob:c.blob,customType:f.customType,integer:d.integer,numeric:p.numeric,real:m.real,text:g.text}}},81145,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={InlineForeignKeys:()=>p,SQLiteTable:()=>m,sqliteTable:()=>h,sqliteTableCreator:()=>y};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(9289),d=e.r(1523);let p=Symbol.for("drizzle:SQLiteInlineForeignKeys");class m extends f.Table{static [c.entityKind]="SQLiteTable";static Symbol=Object.assign({},f.Table.Symbol,{InlineForeignKeys:p});[f.Table.Symbol.Columns];[p]=[];[f.Table.Symbol.ExtraConfigBuilder]=void 0}function g(e,t,r,i,n=e){let s=new m(e,i,n),o=Object.fromEntries(Object.entries("function"==typeof t?t((0,d.getSQLiteColumnBuilders)()):t).map(([e,t])=>{t.setName(e);let r=t.build(s);return s[p].push(...t.buildForeignKeys(r,s)),[e,r]})),a=Object.assign(s,o);return a[f.Table.Symbol.Columns]=o,a[f.Table.Symbol.ExtraConfigColumns]=o,r&&(a[m.Symbol.ExtraConfigBuilder]=r),a}let h=(e,t,r)=>g(e,t,r);function y(e){return(t,r,i)=>g(e(t),r,i,void 0,t)}},32328,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={Check:()=>d,CheckBuilder:()=>f,check:()=>p};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044);class f{constructor(e,t){this.name=e,this.value=t}static [c.entityKind]="SQLiteCheckBuilder";brand;build(e){return new d(e,this)}}class d{constructor(e,t){this.table=e,this.name=t.name,this.value=t.value}static [c.entityKind]="SQLiteCheck";name;value}function p(e,t){return new f(e,t)}},67584,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={Index:()=>p,IndexBuilder:()=>d,IndexBuilderOn:()=>f,index:()=>m,uniqueIndex:()=>g};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044);class f{constructor(e,t){this.name=e,this.unique=t}static [c.entityKind]="SQLiteIndexBuilderOn";on(...e){return new d(this.name,e,this.unique)}}class d{static [c.entityKind]="SQLiteIndexBuilder";config;constructor(e,t,r){this.config={name:e,columns:t,unique:r,where:void 0}}where(e){return this.config.where=e,this}build(e){return new p(this.config,e)}}class p{static [c.entityKind]="SQLiteIndex";config;constructor(e,t){this.config={...e,table:t}}}function m(e){return new f(e,!1)}function g(e){return new f(e,!0)}},87505,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PrimaryKey:()=>m,PrimaryKeyBuilder:()=>p,primaryKey:()=>d};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(81145);function d(...e){return e[0].columns?new p(e[0].columns,e[0].name):new p(e)}class p{static [c.entityKind]="SQLitePrimaryKeyBuilder";columns;name;constructor(e,t){this.columns=e,this.name=t}build(e){return new m(e,this.columns,this.name)}}class m{constructor(e,t,r){this.table=e,this.columns=t,this.name=r}static [c.entityKind]="SQLitePrimaryKey";columns;name;getName(){return this.name??`${this.table[f.SQLiteTable.Symbol.Name]}_${this.columns.map(e=>e.name).join("_")}_pk`}}},94910,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={extractUsedTable:()=>v,getTableConfig:()=>P,getViewConfig:()=>S};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(84541),d=e.r(77509),p=e.r(9289),m=e.r(32315),g=e.r(32328),h=e.r(9952),y=e.r(67584),b=e.r(87505),w=e.r(81145),O=e.r(15317);function P(e){let t=Object.values(e[w.SQLiteTable.Symbol.Columns]),r=[],i=[],n=[],s=[],o=Object.values(e[w.SQLiteTable.Symbol.InlineForeignKeys]),a=e[p.Table.Symbol.Name],l=e[w.SQLiteTable.Symbol.ExtraConfigBuilder];if(void 0!==l){let t=l(e[w.SQLiteTable.Symbol.Columns]);for(let a of Object.values(Array.isArray(t)?t.flat(1):Object.values(t)))(0,c.is)(a,y.IndexBuilder)?r.push(a.build(e)):(0,c.is)(a,g.CheckBuilder)?i.push(a.build(e)):(0,c.is)(a,O.UniqueConstraintBuilder)?s.push(a.build(e)):(0,c.is)(a,b.PrimaryKeyBuilder)?n.push(a.build(e)):(0,c.is)(a,h.ForeignKeyBuilder)&&o.push(a.build(e))}return{columns:t,indexes:r,foreignKeys:o,checks:i,primaryKeys:n,uniqueConstraints:s,name:a}}function v(e){return(0,c.is)(e,w.SQLiteTable)?[`${e[p.Table.Symbol.BaseName]}`]:(0,c.is)(e,d.Subquery)?e._.usedTables??[]:(0,c.is)(e,f.SQL)?e.usedTables??[]:[]}function S(e){return{...e[m.ViewBaseConfig]}}},37232,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={SQLiteDeleteBase:()=>y};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(18875),d=e.r(34700),p=e.r(81145),m=e.r(9289),g=e.r(96707),h=e.r(94910);class y extends f.QueryPromise{constructor(e,t,r,i){super(),this.table=e,this.session=t,this.dialect=r,this.config={table:e,withList:i}}static [c.entityKind]="SQLiteDelete";config;where(e){return this.config.where=e,this}orderBy(...e){if("function"==typeof e[0]){let t=e[0](new Proxy(this.config.table[m.Table.Symbol.Columns],new d.SelectionProxyHandler({sqlAliasedBehavior:"alias",sqlBehavior:"sql"}))),r=Array.isArray(t)?t:[t];this.config.orderBy=r}else this.config.orderBy=e;return this}limit(e){return this.config.limit=e,this}returning(e=this.table[p.SQLiteTable.Symbol.Columns]){return this.config.returning=(0,g.orderSelectedFields)(e),this}getSQL(){return this.dialect.buildDeleteQuery(this.config)}toSQL(){let{typings:e,...t}=this.dialect.sqlToQuery(this.getSQL());return t}_prepare(e=!0){return this.session[e?"prepareOneTimeQuery":"prepareQuery"](this.dialect.sqlToQuery(this.getSQL()),this.config.returning,this.config.returning?"all":"run",!0,void 0,{type:"delete",tables:(0,h.extractUsedTable)(this.config.table)})}prepare(){return this._prepare(!1)}run=e=>this._prepare().run(e);all=e=>this._prepare().all(e);get=e=>this._prepare().get(e);values=e=>this._prepare().values(e);async execute(e){return this._prepare().execute(e)}$dynamic(){return this}}},48271,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={CasingCache:()=>g,toCamelCase:()=>p,toSnakeCase:()=>d};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(9289);function d(e){return(e.replace(/['\u2019]/g,"").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[]).map(e=>e.toLowerCase()).join("_")}function p(e){return(e.replace(/['\u2019]/g,"").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[]).reduce((e,t,r)=>e+(0===r?t.toLowerCase():`${t[0].toUpperCase()}${t.slice(1)}`),"")}function m(e){return e}class g{static [c.entityKind]="CasingCache";cache={};cachedTables={};convert;constructor(e){this.convert="snake_case"===e?d:"camelCase"===e?p:m}getColumnCasing(e){if(!e.keyAsName)return e.name;let t=e.table[f.Table.Symbol.Schema]??"public",r=e.table[f.Table.Symbol.OriginalName],i=`${t}.${r}.${e.name}`;return this.cache[i]||this.cacheTable(e.table),this.cache[i]}cacheTable(e){let t=e[f.Table.Symbol.Schema]??"public",r=e[f.Table.Symbol.OriginalName],i=`${t}.${r}`;if(!this.cachedTables[i]){for(let t of Object.values(e[f.Table.Symbol.Columns])){let e=`${i}.${t.name}`;this.cache[e]=this.convert(t.name)}this.cachedTables[i]=!0}}clearCache(){this.cache={},this.cachedTables={}}}},83525,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={DrizzleError:()=>f,DrizzleQueryError:()=>d,TransactionRollbackError:()=>p};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044);class f extends Error{static [c.entityKind]="DrizzleError";constructor({message:e,cause:t}){super(e),this.name="DrizzleError",this.cause=t}}class d extends Error{constructor(e,t,r){super(`Failed query: ${e}
1
+ module.exports=[22734,(e,t,r)=>{t.exports=e.x("fs",()=>require("fs"))},46786,(e,t,r)=>{t.exports=e.x("os",()=>require("os"))},85148,(e,t,r)=>{t.exports=e.x("better-sqlite3",()=>require("better-sqlite3"))},66044,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={entityKind:()=>c,hasOwnEntityKind:()=>f,is:()=>d};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);let c=Symbol.for("drizzle:entityKind"),f=Symbol.for("drizzle:hasOwnEntityKind");function d(e,t){if(!e||"object"!=typeof e)return!1;if(e instanceof t)return!0;if(!Object.prototype.hasOwnProperty.call(t,c))throw Error(`Class "${t.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.`);let r=Object.getPrototypeOf(e).constructor;if(r)for(;r;){if(c in r&&r[c]===t[c])return!0;r=Object.getPrototypeOf(r)}return!1}},24108,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={ConsoleLogWriter:()=>f,DefaultLogger:()=>d,NoopLogger:()=>p};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044);class f{static [c.entityKind]="ConsoleLogWriter";write(e){console.log(e)}}class d{static [c.entityKind]="DefaultLogger";writer;constructor(e){this.writer=e?.writer??new f}logQuery(e,t){let r=t.map(e=>{try{return JSON.stringify(e)}catch{return String(e)}}),i=r.length?` -- params: [${r.join(", ")}]`:"";this.writer.write(`Query: ${e}${i}`)}}class p{static [c.entityKind]="NoopLogger";logQuery(){}}},88564,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={TableName:()=>c};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);let c=Symbol.for("drizzle:Name")},9289,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={BaseName:()=>h,Columns:()=>p,ExtraConfigBuilder:()=>b,ExtraConfigColumns:()=>m,IsAlias:()=>y,OriginalName:()=>g,Schema:()=>d,Table:()=>O,getTableName:()=>v,getTableUniqueName:()=>S,isTable:()=>P};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(88564);let d=Symbol.for("drizzle:Schema"),p=Symbol.for("drizzle:Columns"),m=Symbol.for("drizzle:ExtraConfigColumns"),g=Symbol.for("drizzle:OriginalName"),h=Symbol.for("drizzle:BaseName"),y=Symbol.for("drizzle:IsAlias"),b=Symbol.for("drizzle:ExtraConfigBuilder"),w=Symbol.for("drizzle:IsDrizzleTable");class O{static [c.entityKind]="Table";static Symbol={Name:f.TableName,Schema:d,OriginalName:g,Columns:p,ExtraConfigColumns:m,BaseName:h,IsAlias:y,ExtraConfigBuilder:b};[f.TableName];[g];[d];[p];[m];[h];[y]=!1;[w]=!0;[b]=void 0;constructor(e,t,r){this[f.TableName]=this[g]=e,this[d]=t,this[h]=r}}function P(e){return"object"==typeof e&&null!==e&&w in e}function v(e){return e[f.TableName]}function S(e){return`${e[d]??"public"}.${e[f.TableName]}`}},28892,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={Column:()=>f};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044);class f{constructor(e,t){this.table=e,this.config=t,this.name=t.name,this.keyAsName=t.keyAsName,this.notNull=t.notNull,this.default=t.default,this.defaultFn=t.defaultFn,this.onUpdateFn=t.onUpdateFn,this.hasDefault=t.hasDefault,this.primary=t.primaryKey,this.isUnique=t.isUnique,this.uniqueName=t.uniqueName,this.uniqueType=t.uniqueType,this.dataType=t.dataType,this.columnType=t.columnType,this.generated=t.generated,this.generatedIdentity=t.generatedIdentity}static [c.entityKind]="Column";name;keyAsName;primary;notNull;default;defaultFn;onUpdateFn;hasDefault;isUnique;uniqueName;uniqueType;dataType;columnType;enumValues=void 0;generated=void 0;generatedIdentity=void 0;config;mapFromDriverValue(e){return e}mapToDriverValue(e){return e}shouldDisableInsert(){return void 0!==this.config.generated&&"byDefault"!==this.config.generated.type}}},601,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={ColumnBuilder:()=>f};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044);class f{static [c.entityKind]="ColumnBuilder";config;constructor(e,t,r){this.config={name:e,keyAsName:""===e,notNull:!1,default:void 0,hasDefault:!1,primaryKey:!1,isUnique:!1,uniqueName:void 0,uniqueType:void 0,dataType:t,columnType:r,generated:void 0}}$type(){return this}notNull(){return this.config.notNull=!0,this}default(e){return this.config.default=e,this.config.hasDefault=!0,this}$defaultFn(e){return this.config.defaultFn=e,this.config.hasDefault=!0,this}$default=this.$defaultFn;$onUpdateFn(e){return this.config.onUpdateFn=e,this.config.hasDefault=!0,this}$onUpdate=this.$onUpdateFn;primaryKey(){return this.config.primaryKey=!0,this.config.notNull=!0,this}setName(e){""===this.config.name&&(this.config.name=e)}}},22989,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={ForeignKey:()=>p,ForeignKeyBuilder:()=>d,foreignKey:()=>m};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(88564);class d{static [c.entityKind]="PgForeignKeyBuilder";reference;_onUpdate="no action";_onDelete="no action";constructor(e,t){this.reference=()=>{let{name:t,columns:r,foreignColumns:i}=e();return{name:t,columns:r,foreignTable:i[0].table,foreignColumns:i}},t&&(this._onUpdate=t.onUpdate,this._onDelete=t.onDelete)}onUpdate(e){return this._onUpdate=void 0===e?"no action":e,this}onDelete(e){return this._onDelete=void 0===e?"no action":e,this}build(e){return new p(e,this)}}class p{constructor(e,t){this.table=e,this.reference=t.reference,this.onUpdate=t._onUpdate,this.onDelete=t._onDelete}static [c.entityKind]="PgForeignKey";reference;onUpdate;onDelete;getName(){let{name:e,columns:t,foreignColumns:r}=this.reference(),i=t.map(e=>e.name),n=r.map(e=>e.name),s=[this.table[f.TableName],...i,r[0].table[f.TableName],...n];return e??`${s.join("_")}_fk`}}function m(e){return new d(function(){let{name:t,columns:r,foreignColumns:i}=e;return{name:t,columns:r,foreignColumns:i}})}},74433,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={iife:()=>c};for(var u in l)i(a,u,{get:l[u],enumerable:!0});function c(e,...t){return e(...t)}t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a)},81699,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={UniqueConstraint:()=>h,UniqueConstraintBuilder:()=>m,UniqueOnConstraintBuilder:()=>g,unique:()=>d,uniqueKeyName:()=>p};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(88564);function d(e){return new g(e)}function p(e,t){return`${e[f.TableName]}_${t.join("_")}_unique`}class m{constructor(e,t){this.name=t,this.columns=e}static [c.entityKind]="PgUniqueConstraintBuilder";columns;nullsNotDistinctConfig=!1;nullsNotDistinct(){return this.nullsNotDistinctConfig=!0,this}build(e){return new h(e,this.columns,this.nullsNotDistinctConfig,this.name)}}class g{static [c.entityKind]="PgUniqueOnConstraintBuilder";name;constructor(e){this.name=e}on(...e){return new m(e,this.name)}}class h{constructor(e,t,r,i){this.table=e,this.columns=t,this.name=i??p(this.table,this.columns.map(e=>e.name)),this.nullsNotDistinct=r}static [c.entityKind]="PgUniqueConstraint";columns;name;nullsNotDistinct=!1;getName(){return this.name}}},89842,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={makePgArray:()=>function e(t){return`{${t.map(t=>Array.isArray(t)?e(t):"string"==typeof t?`"${t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`:`${t}`).join(",")}}`},parsePgArray:()=>d,parsePgNestedArray:()=>f};for(var u in l)i(a,u,{get:l[u],enumerable:!0});function c(e,t,r){for(let i=t;i<e.length;i++){let n=e[i];if("\\"===n){i++;continue}if('"'===n)return[e.slice(t,i).replace(/\\/g,""),i+1];if(!r&&(","===n||"}"===n))return[e.slice(t,i).replace(/\\/g,""),i]}return[e.slice(t).replace(/\\/g,""),e.length]}function f(e,t=0){let r=[],i=t,n=!1;for(;i<e.length;){let s=e[i];if(","===s){(n||i===t)&&r.push(""),n=!0,i++;continue}if(n=!1,"\\"===s){i+=2;continue}if('"'===s){let[t,n]=c(e,i+1,!0);r.push(t),i=n;continue}if("}"===s)return[r,i+1];if("{"===s){let[t,n]=f(e,i+1);r.push(t),i=n;continue}let[o,a]=c(e,i,!1);r.push(o),i=a}return[r,i]}function d(e){let[t]=f(e,1);return t}t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a)},54732,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={ExtraConfigColumn:()=>w,IndexedColumn:()=>O,PgArray:()=>v,PgArrayBuilder:()=>P,PgColumn:()=>b,PgColumnBuilder:()=>y};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(601),f=e.r(28892),d=e.r(66044),p=e.r(22989),m=e.r(74433),g=e.r(81699),h=e.r(89842);class y extends c.ColumnBuilder{foreignKeyConfigs=[];static [d.entityKind]="PgColumnBuilder";array(e){return new P(this.config.name,this,e)}references(e,t={}){return this.foreignKeyConfigs.push({ref:e,actions:t}),this}unique(e,t){return this.config.isUnique=!0,this.config.uniqueName=e,this.config.uniqueType=t?.nulls,this}generatedAlwaysAs(e){return this.config.generated={as:e,type:"always",mode:"stored"},this}buildForeignKeys(e,t){return this.foreignKeyConfigs.map(({ref:r,actions:i})=>(0,m.iife)((r,i)=>{let n=new p.ForeignKeyBuilder(()=>({columns:[e],foreignColumns:[r()]}));return i.onUpdate&&n.onUpdate(i.onUpdate),i.onDelete&&n.onDelete(i.onDelete),n.build(t)},r,i))}buildExtraConfigColumn(e){return new w(e,this.config)}}class b extends f.Column{constructor(e,t){t.uniqueName||(t.uniqueName=(0,g.uniqueKeyName)(e,[t.name])),super(e,t),this.table=e}static [d.entityKind]="PgColumn"}class w extends b{static [d.entityKind]="ExtraConfigColumn";getSQLType(){return this.getSQLType()}indexConfig={order:this.config.order??"asc",nulls:this.config.nulls??"last",opClass:this.config.opClass};defaultConfig={order:"asc",nulls:"last",opClass:void 0};asc(){return this.indexConfig.order="asc",this}desc(){return this.indexConfig.order="desc",this}nullsFirst(){return this.indexConfig.nulls="first",this}nullsLast(){return this.indexConfig.nulls="last",this}op(e){return this.indexConfig.opClass=e,this}}class O{static [d.entityKind]="IndexedColumn";constructor(e,t,r,i){this.name=e,this.keyAsName=t,this.type=r,this.indexConfig=i}name;keyAsName;type;indexConfig}class P extends y{static [d.entityKind]="PgArrayBuilder";constructor(e,t,r){super(e,"array","PgArray"),this.config.baseBuilder=t,this.config.size=r}build(e){let t=this.config.baseBuilder.build(e);return new v(e,this.config,t)}}class v extends b{constructor(e,t,r,i){super(e,t),this.baseColumn=r,this.range=i,this.size=t.size}size;static [d.entityKind]="PgArray";getSQLType(){return`${this.baseColumn.getSQLType()}[${"number"==typeof this.size?this.size:""}]`}mapFromDriverValue(e){return"string"==typeof e&&(e=(0,h.parsePgArray)(e)),e.map(e=>this.baseColumn.mapFromDriverValue(e))}mapToDriverValue(e,t=!1){let r=e.map(e=>null===e?null:(0,d.is)(this.baseColumn,v)?this.baseColumn.mapToDriverValue(e,!0):this.baseColumn.mapToDriverValue(e));return t?r:(0,h.makePgArray)(r)}}},16561,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgEnumColumn:()=>y,PgEnumColumnBuilder:()=>h,PgEnumObjectColumn:()=>p,PgEnumObjectColumnBuilder:()=>d,isPgEnum:()=>g,pgEnum:()=>b,pgEnumObjectWithSchema:()=>O,pgEnumWithSchema:()=>w};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(54732);class d extends f.PgColumnBuilder{static [c.entityKind]="PgEnumObjectColumnBuilder";constructor(e,t){super(e,"string","PgEnumObjectColumn"),this.config.enum=t}build(e){return new p(e,this.config)}}class p extends f.PgColumn{static [c.entityKind]="PgEnumObjectColumn";enum;enumValues=this.config.enum.enumValues;constructor(e,t){super(e,t),this.enum=t.enum}getSQLType(){return this.enum.enumName}}let m=Symbol.for("drizzle:isPgEnum");function g(e){return!!e&&"function"==typeof e&&m in e&&!0===e[m]}class h extends f.PgColumnBuilder{static [c.entityKind]="PgEnumColumnBuilder";constructor(e,t){super(e,"string","PgEnumColumn"),this.config.enum=t}build(e){return new y(e,this.config)}}class y extends f.PgColumn{static [c.entityKind]="PgEnumColumn";enum=this.config.enum;enumValues=this.config.enum.enumValues;constructor(e,t){super(e,t),this.enum=t.enum}getSQLType(){return this.enum.enumName}}function b(e,t){return Array.isArray(t)?w(e,[...t],void 0):O(e,t,void 0)}function w(e,t,r){let i=Object.assign(e=>new h(e??"",i),{enumName:e,enumValues:t,schema:r,[m]:!0});return i}function O(e,t,r){let i=Object.assign(e=>new d(e??"",i),{enumName:e,enumValues:Object.values(t),schema:r,[m]:!0});return i}},77509,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={Subquery:()=>f,WithSubquery:()=>d};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044);class f{static [c.entityKind]="Subquery";constructor(e,t,r,i=!1,n=[]){this._={brand:"Subquery",sql:e,selectedFields:t,alias:r,isWith:i,usedTables:n}}}class d extends f{static [c.entityKind]="WithSubquery"}},60995,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={compatibilityVersion:()=>f,npmVersion:()=>c};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c="0.45.2",f=10},45312,(e,t,r)=>{"use strict";let i,n;var s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,l=Object.prototype.hasOwnProperty,u={},c={tracer:()=>m};for(var f in c)s(u,f,{get:c[f],enumerable:!0});t.exports=((e,t,r,i)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of a(t))l.call(e,r)||void 0===r||s(e,r,{get:()=>t[r],enumerable:!(i=o(t,r))||i.enumerable});return e})(s({},"__esModule",{value:!0}),u);var d=e.r(74433),p=e.r(60995);let m={startActiveSpan:(e,t)=>i?(n||(n=i.trace.getTracer("drizzle-orm",p.npmVersion)),(0,d.iife)((r,i)=>i.startActiveSpan(e,e=>{try{return t(e)}catch(t){throw e.setStatus({code:r.SpanStatusCode.ERROR,message:t instanceof Error?t.message:"Unknown error"}),t}finally{e.end()}}),i,n)):t()}},32315,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={ViewBaseConfig:()=>c};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);let c=Symbol.for("drizzle:ViewBaseConfig")},84541,(e,t,r)=>{"use strict";var i,n=Object.defineProperty,s=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,l={},u={FakePrimitiveParam:()=>b,Name:()=>v,Param:()=>T,Placeholder:()=>D,SQL:()=>P,StringChunk:()=>O,View:()=>A,fillPlaceholders:()=>$,getViewName:()=>V,isDriverValueEncoder:()=>j,isSQLWrapper:()=>w,isView:()=>F,name:()=>S,noopDecoder:()=>C,noopEncoder:()=>B,noopMapper:()=>x,param:()=>Q,placeholder:()=>_,sql:()=>N};for(var c in u)n(l,c,{get:u[c],enumerable:!0});t.exports=((e,t,r,i)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of o(t))a.call(e,r)||void 0===r||n(e,r,{get:()=>t[r],enumerable:!(i=s(t,r))||i.enumerable});return e})(n({},"__esModule",{value:!0}),l);var f=e.r(66044),d=e.r(16561),p=e.r(77509),m=e.r(45312),g=e.r(32315),h=e.r(28892),y=e.r(9289);class b{static [f.entityKind]="FakePrimitiveParam"}function w(e){return null!=e&&"function"==typeof e.getSQL}class O{static [f.entityKind]="StringChunk";value;constructor(e){this.value=Array.isArray(e)?e:[e]}getSQL(){return new P([this])}}class P{constructor(e){for(const t of(this.queryChunks=e,e))if((0,f.is)(t,y.Table)){const e=t[y.Table.Symbol.Schema];this.usedTables.push(void 0===e?t[y.Table.Symbol.Name]:e+"."+t[y.Table.Symbol.Name])}}static [f.entityKind]="SQL";decoder=C;shouldInlineParams=!1;usedTables=[];append(e){return this.queryChunks.push(...e.queryChunks),this}toQuery(e){return m.tracer.startActiveSpan("drizzle.buildSQL",t=>{let r=this.buildQueryFromSourceParams(this.queryChunks,e);return t?.setAttributes({"drizzle.query.text":r.sql,"drizzle.query.params":JSON.stringify(r.params)}),r})}buildQueryFromSourceParams(e,t){let r=Object.assign({},t,{inlineParams:t.inlineParams||this.shouldInlineParams,paramStartIndex:t.paramStartIndex||{value:0}}),{casing:i,escapeName:n,escapeParam:s,prepareTyping:o,inlineParams:a,paramStartIndex:l}=r;var u=e.map(e=>{if((0,f.is)(e,O))return{sql:e.value.join(""),params:[]};if((0,f.is)(e,v))return{sql:n(e.value),params:[]};if(void 0===e)return{sql:"",params:[]};if(Array.isArray(e)){let t=[new O("(")];for(let[r,i]of e.entries())t.push(i),r<e.length-1&&t.push(new O(", "));return t.push(new O(")")),this.buildQueryFromSourceParams(t,r)}if((0,f.is)(e,P))return this.buildQueryFromSourceParams(e.queryChunks,{...r,inlineParams:a||e.shouldInlineParams});if((0,f.is)(e,y.Table)){let t=e[y.Table.Symbol.Schema],r=e[y.Table.Symbol.Name];return{sql:void 0===t||e[y.IsAlias]?n(r):n(t)+"."+n(r),params:[]}}if((0,f.is)(e,h.Column)){let r=i.getColumnCasing(e);if("indexes"===t.invokeSource)return{sql:n(r),params:[]};let s=e.table[y.Table.Symbol.Schema];return{sql:e.table[y.IsAlias]||void 0===s?n(e.table[y.Table.Symbol.Name])+"."+n(r):n(s)+"."+n(e.table[y.Table.Symbol.Name])+"."+n(r),params:[]}}if((0,f.is)(e,A)){let t=e[g.ViewBaseConfig].schema,r=e[g.ViewBaseConfig].name;return{sql:void 0===t||e[g.ViewBaseConfig].isAlias?n(r):n(t)+"."+n(r),params:[]}}if((0,f.is)(e,T)){if((0,f.is)(e.value,D))return{sql:s(l.value++,e),params:[e],typings:["none"]};let t=null===e.value?null:e.encoder.mapToDriverValue(e.value);if((0,f.is)(t,P))return this.buildQueryFromSourceParams([t],r);if(a)return{sql:this.mapInlineParam(t,r),params:[]};let i=["none"];return o&&(i=[o(e.encoder)]),{sql:s(l.value++,t),params:[t],typings:i}}return(0,f.is)(e,D)?{sql:s(l.value++,e),params:[e],typings:["none"]}:(0,f.is)(e,P.Aliased)&&void 0!==e.fieldAlias?{sql:n(e.fieldAlias),params:[]}:(0,f.is)(e,p.Subquery)?e._.isWith?{sql:n(e._.alias),params:[]}:this.buildQueryFromSourceParams([new O("("),e._.sql,new O(") "),new v(e._.alias)],r):(0,d.isPgEnum)(e)?e.schema?{sql:n(e.schema)+"."+n(e.enumName),params:[]}:{sql:n(e.enumName),params:[]}:w(e)?e.shouldOmitSQLParens?.()?this.buildQueryFromSourceParams([e.getSQL()],r):this.buildQueryFromSourceParams([new O("("),e.getSQL(),new O(")")],r):a?{sql:this.mapInlineParam(e,r),params:[]}:{sql:s(l.value++,e),params:[e],typings:["none"]}});let c={sql:"",params:[]};for(let e of u)c.sql+=e.sql,c.params.push(...e.params),e.typings?.length&&(c.typings||(c.typings=[]),c.typings.push(...e.typings));return c}mapInlineParam(e,{escapeString:t}){if(null===e)return"null";if("number"==typeof e||"boolean"==typeof e)return e.toString();if("string"==typeof e)return t(e);if("object"==typeof e){let r=e.toString();return"[object Object]"===r?t(JSON.stringify(e)):t(r)}throw Error("Unexpected param value: "+e)}getSQL(){return this}as(e){return void 0===e?this:new P.Aliased(this,e)}mapWith(e){return this.decoder="function"==typeof e?{mapFromDriverValue:e}:e,this}inlineParams(){return this.shouldInlineParams=!0,this}if(e){return e?this:void 0}}class v{constructor(e){this.value=e}static [f.entityKind]="Name";brand;getSQL(){return new P([this])}}function S(e){return new v(e)}function j(e){return"object"==typeof e&&null!==e&&"mapToDriverValue"in e&&"function"==typeof e.mapToDriverValue}let C={mapFromDriverValue:e=>e},B={mapToDriverValue:e=>e},x={...C,...B};class T{constructor(e,t=B){this.value=e,this.encoder=t}static [f.entityKind]="Param";brand;getSQL(){return new P([this])}}function Q(e,t){return new T(e,t)}function N(e,...t){let r=[];for(let[i,n]of((t.length>0||e.length>0&&""!==e[0])&&r.push(new O(e[0])),t.entries()))r.push(n,new O(e[i+1]));return new P(r)}(i=N||(N={})).empty=function(){return new P([])},i.fromList=function(e){return new P(e)},i.raw=function(e){return new P([new O(e)])},i.join=function(e,t){let r=[];for(let[i,n]of e.entries())i>0&&void 0!==t&&r.push(t),r.push(n);return new P(r)},i.identifier=function(e){return new v(e)},i.placeholder=function(e){return new D(e)},i.param=function(e,t){return new T(e,t)};var q=P||(P={});class L{constructor(e,t){this.sql=e,this.fieldAlias=t}static [f.entityKind]="SQL.Aliased";isSelectionField=!1;getSQL(){return this.sql}clone(){return new L(this.sql,this.fieldAlias)}}q.Aliased=L;class D{constructor(e){this.name=e}static [f.entityKind]="Placeholder";getSQL(){return new P([this])}}function _(e){return new D(e)}function $(e,t){return e.map(e=>{if((0,f.is)(e,D)){if(!(e.name in t))throw Error(`No value for placeholder "${e.name}" was provided`);return t[e.name]}if((0,f.is)(e,T)&&(0,f.is)(e.value,D)){if(!(e.value.name in t))throw Error(`No value for placeholder "${e.value.name}" was provided`);return e.encoder.mapToDriverValue(t[e.value.name])}return e})}let K=Symbol.for("drizzle:IsDrizzleView");class A{static [f.entityKind]="View";[g.ViewBaseConfig];[K]=!0;constructor({name:e,schema:t,selectedFields:r,query:i}){this[g.ViewBaseConfig]={name:e,originalName:e,schema:t,selectedFields:r,query:i,isExisting:!i,isAlias:!1}}getSQL(){return new P([this])}}function F(e){return"object"==typeof e&&null!==e&&K in e}function V(e){return e[g.ViewBaseConfig].name}h.Column.prototype.getSQL=function(){return new P([this])},y.Table.prototype.getSQL=function(){return new P([this])},p.Subquery.prototype.getSQL=function(){return new P([this])}},96707,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={applyMixins:()=>w,getColumnNameAndConfig:()=>S,getTableColumns:()=>O,getTableLikeName:()=>v,getViewSelectedFields:()=>P,haveSameKeys:()=>y,isConfig:()=>j,mapResultRow:()=>h,mapUpdateSet:()=>b,orderSelectedFields:()=>function e(t,r){return Object.entries(t).reduce((t,[i,n])=>{if("string"!=typeof i)return t;let s=r?[...r,i]:[i];return(0,f.is)(n,c.Column)||(0,f.is)(n,d.SQL)||(0,f.is)(n,d.SQL.Aliased)||(0,f.is)(n,p.Subquery)?t.push({path:s,field:n}):(0,f.is)(n,m.Table)?t.push(...e(n[m.Table.Symbol.Columns],s)):t.push(...e(n,s)),t},[])},textDecoder:()=>C};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(28892),f=e.r(66044),d=e.r(84541),p=e.r(77509),m=e.r(9289),g=e.r(32315);function h(e,t,r){let i={},n=e.reduce((e,{path:n,field:s},o)=>{let a;a=(0,f.is)(s,c.Column)?s:(0,f.is)(s,d.SQL)?s.decoder:(0,f.is)(s,p.Subquery)?s._.sql.decoder:s.sql.decoder;let l=e;for(let[e,u]of n.entries())if(e<n.length-1)u in l||(l[u]={}),l=l[u];else{let e=t[o],d=l[u]=null===e?null:a.mapFromDriverValue(e);if(r&&(0,f.is)(s,c.Column)&&2===n.length){let e=n[0];e in i?"string"==typeof i[e]&&i[e]!==(0,m.getTableName)(s.table)&&(i[e]=!1):i[e]=null===d&&(0,m.getTableName)(s.table)}}return e},{});if(r&&Object.keys(i).length>0)for(let[e,t]of Object.entries(i))"string"!=typeof t||r[t]||(n[e]=null);return n}function y(e,t){let r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(let[e,t]of r.entries())if(t!==i[e])return!1;return!0}function b(e,t){let r=Object.entries(t).filter(([,e])=>void 0!==e).map(([t,r])=>(0,f.is)(r,d.SQL)||(0,f.is)(r,c.Column)?[t,r]:[t,new d.Param(r,e[m.Table.Symbol.Columns][t])]);if(0===r.length)throw Error("No values to set");return Object.fromEntries(r)}function w(e,t){for(let r of t)for(let t of Object.getOwnPropertyNames(r.prototype))"constructor"!==t&&Object.defineProperty(e.prototype,t,Object.getOwnPropertyDescriptor(r.prototype,t)||Object.create(null))}function O(e){return e[m.Table.Symbol.Columns]}function P(e){return e[g.ViewBaseConfig].selectedFields}function v(e){return(0,f.is)(e,p.Subquery)?e._.alias:(0,f.is)(e,d.View)?e[g.ViewBaseConfig].name:(0,f.is)(e,d.SQL)?void 0:e[m.Table.Symbol.IsAlias]?e[m.Table.Symbol.Name]:e[m.Table.Symbol.BaseName]}function S(e,t){return{name:"string"==typeof e&&e.length>0?e:"",config:"object"==typeof e?e:t}}function j(e){if("object"!=typeof e||null===e||"Object"!==e.constructor.name)return!1;if("logger"in e){let t=typeof e.logger;return"boolean"===t||"object"===t&&"function"==typeof e.logger.logQuery||"undefined"===t}if("schema"in e){let t=typeof e.schema;return"object"===t||"undefined"===t}if("casing"in e){let t=typeof e.casing;return"string"===t||"undefined"===t}if("mode"in e)return"default"===e.mode&&"planetscale"===e.mode&&void 0===e.mode;if("connection"in e){let t=typeof e.connection;return"string"===t||"object"===t||"undefined"===t}if("client"in e){let t=typeof e.client;return"object"===t||"function"===t||"undefined"===t}return 0===Object.keys(e).length}let C="u"<typeof TextDecoder?null:new TextDecoder},90767,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgIntColumnBaseBuilder:()=>d};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(54732);class d extends f.PgColumnBuilder{static [c.entityKind]="PgIntColumnBaseBuilder";generatedAlwaysAsIdentity(e){if(e){let{name:t,...r}=e;this.config.generatedIdentity={type:"always",sequenceName:t,sequenceOptions:r}}else this.config.generatedIdentity={type:"always"};return this.config.hasDefault=!0,this.config.notNull=!0,this}generatedByDefaultAsIdentity(e){if(e){let{name:t,...r}=e;this.config.generatedIdentity={type:"byDefault",sequenceName:t,sequenceOptions:r}}else this.config.generatedIdentity={type:"byDefault"};return this.config.hasDefault=!0,this.config.notNull=!0,this}}},98315,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgBigInt53:()=>g,PgBigInt53Builder:()=>m,PgBigInt64:()=>y,PgBigInt64Builder:()=>h,bigint:()=>b};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(96707),d=e.r(54732),p=e.r(90767);class m extends p.PgIntColumnBaseBuilder{static [c.entityKind]="PgBigInt53Builder";constructor(e){super(e,"number","PgBigInt53")}build(e){return new g(e,this.config)}}class g extends d.PgColumn{static [c.entityKind]="PgBigInt53";getSQLType(){return"bigint"}mapFromDriverValue(e){return"number"==typeof e?e:Number(e)}}class h extends p.PgIntColumnBaseBuilder{static [c.entityKind]="PgBigInt64Builder";constructor(e){super(e,"bigint","PgBigInt64")}build(e){return new y(e,this.config)}}class y extends d.PgColumn{static [c.entityKind]="PgBigInt64";getSQLType(){return"bigint"}mapFromDriverValue(e){return BigInt(e)}}function b(e,t){let{name:r,config:i}=(0,f.getColumnNameAndConfig)(e,t);return"number"===i.mode?new m(r):new h(r)}},79991,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgBigSerial53:()=>m,PgBigSerial53Builder:()=>p,PgBigSerial64:()=>h,PgBigSerial64Builder:()=>g,bigserial:()=>y};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(96707),d=e.r(54732);class p extends d.PgColumnBuilder{static [c.entityKind]="PgBigSerial53Builder";constructor(e){super(e,"number","PgBigSerial53"),this.config.hasDefault=!0,this.config.notNull=!0}build(e){return new m(e,this.config)}}class m extends d.PgColumn{static [c.entityKind]="PgBigSerial53";getSQLType(){return"bigserial"}mapFromDriverValue(e){return"number"==typeof e?e:Number(e)}}class g extends d.PgColumnBuilder{static [c.entityKind]="PgBigSerial64Builder";constructor(e){super(e,"bigint","PgBigSerial64"),this.config.hasDefault=!0}build(e){return new h(e,this.config)}}class h extends d.PgColumn{static [c.entityKind]="PgBigSerial64";getSQLType(){return"bigserial"}mapFromDriverValue(e){return BigInt(e)}}function y(e,t){let{name:r,config:i}=(0,f.getColumnNameAndConfig)(e,t);return"number"===i.mode?new p(r):new g(r)}},53548,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgBoolean:()=>p,PgBooleanBuilder:()=>d,boolean:()=>m};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(54732);class d extends f.PgColumnBuilder{static [c.entityKind]="PgBooleanBuilder";constructor(e){super(e,"boolean","PgBoolean")}build(e){return new p(e,this.config)}}class p extends f.PgColumn{static [c.entityKind]="PgBoolean";getSQLType(){return"boolean"}}function m(e){return new d(e??"")}},37329,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgChar:()=>m,PgCharBuilder:()=>p,char:()=>g};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(96707),d=e.r(54732);class p extends d.PgColumnBuilder{static [c.entityKind]="PgCharBuilder";constructor(e,t){super(e,"string","PgChar"),this.config.length=t.length,this.config.enumValues=t.enum}build(e){return new m(e,this.config)}}class m extends d.PgColumn{static [c.entityKind]="PgChar";length=this.config.length;enumValues=this.config.enumValues;getSQLType(){return void 0===this.length?"char":`char(${this.length})`}}function g(e,t={}){let{name:r,config:i}=(0,f.getColumnNameAndConfig)(e,t);return new p(r,i)}},97493,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgCidr:()=>p,PgCidrBuilder:()=>d,cidr:()=>m};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(54732);class d extends f.PgColumnBuilder{static [c.entityKind]="PgCidrBuilder";constructor(e){super(e,"string","PgCidr")}build(e){return new p(e,this.config)}}class p extends f.PgColumn{static [c.entityKind]="PgCidr";getSQLType(){return"cidr"}}function m(e){return new d(e??"")}},61148,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgCustomColumn:()=>m,PgCustomColumnBuilder:()=>p,customType:()=>g};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(96707),d=e.r(54732);class p extends d.PgColumnBuilder{static [c.entityKind]="PgCustomColumnBuilder";constructor(e,t,r){super(e,"custom","PgCustomColumn"),this.config.fieldConfig=t,this.config.customTypeParams=r}build(e){return new m(e,this.config)}}class m extends d.PgColumn{static [c.entityKind]="PgCustomColumn";sqlName;mapTo;mapFrom;constructor(e,t){super(e,t),this.sqlName=t.customTypeParams.dataType(t.fieldConfig),this.mapTo=t.customTypeParams.toDriver,this.mapFrom=t.customTypeParams.fromDriver}getSQLType(){return this.sqlName}mapFromDriverValue(e){return"function"==typeof this.mapFrom?this.mapFrom(e):e}mapToDriverValue(e){return"function"==typeof this.mapTo?this.mapTo(e):e}}function g(e){return(t,r)=>{let{name:i,config:n}=(0,f.getColumnNameAndConfig)(t,r);return new p(i,n,e)}}},44856,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgDateColumnBaseBuilder:()=>p};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(84541),d=e.r(54732);class p extends d.PgColumnBuilder{static [c.entityKind]="PgDateColumnBaseBuilder";defaultNow(){return this.default(f.sql`now()`)}}},74438,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgDate:()=>g,PgDateBuilder:()=>m,PgDateString:()=>y,PgDateStringBuilder:()=>h,date:()=>b};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(96707),d=e.r(54732),p=e.r(44856);class m extends p.PgDateColumnBaseBuilder{static [c.entityKind]="PgDateBuilder";constructor(e){super(e,"date","PgDate")}build(e){return new g(e,this.config)}}class g extends d.PgColumn{static [c.entityKind]="PgDate";getSQLType(){return"date"}mapFromDriverValue(e){return"string"==typeof e?new Date(e):e}mapToDriverValue(e){return e.toISOString()}}class h extends p.PgDateColumnBaseBuilder{static [c.entityKind]="PgDateStringBuilder";constructor(e){super(e,"string","PgDateString")}build(e){return new y(e,this.config)}}class y extends d.PgColumn{static [c.entityKind]="PgDateString";getSQLType(){return"date"}mapFromDriverValue(e){return"string"==typeof e?e:e.toISOString().slice(0,-14)}}function b(e,t){let{name:r,config:i}=(0,f.getColumnNameAndConfig)(e,t);return i?.mode==="date"?new m(r):new h(r)}},18358,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgDoublePrecision:()=>p,PgDoublePrecisionBuilder:()=>d,doublePrecision:()=>m};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(54732);class d extends f.PgColumnBuilder{static [c.entityKind]="PgDoublePrecisionBuilder";constructor(e){super(e,"number","PgDoublePrecision")}build(e){return new p(e,this.config)}}class p extends f.PgColumn{static [c.entityKind]="PgDoublePrecision";getSQLType(){return"double precision"}mapFromDriverValue(e){return"string"==typeof e?Number.parseFloat(e):e}}function m(e){return new d(e??"")}},71209,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgInet:()=>p,PgInetBuilder:()=>d,inet:()=>m};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(54732);class d extends f.PgColumnBuilder{static [c.entityKind]="PgInetBuilder";constructor(e){super(e,"string","PgInet")}build(e){return new p(e,this.config)}}class p extends f.PgColumn{static [c.entityKind]="PgInet";getSQLType(){return"inet"}}function m(e){return new d(e??"")}},21085,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgInteger:()=>m,PgIntegerBuilder:()=>p,integer:()=>g};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(54732),d=e.r(90767);class p extends d.PgIntColumnBaseBuilder{static [c.entityKind]="PgIntegerBuilder";constructor(e){super(e,"number","PgInteger")}build(e){return new m(e,this.config)}}class m extends f.PgColumn{static [c.entityKind]="PgInteger";getSQLType(){return"integer"}mapFromDriverValue(e){return"string"==typeof e?Number.parseInt(e):e}}function g(e){return new p(e??"")}},1137,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgInterval:()=>m,PgIntervalBuilder:()=>p,interval:()=>g};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(96707),d=e.r(54732);class p extends d.PgColumnBuilder{static [c.entityKind]="PgIntervalBuilder";constructor(e,t){super(e,"string","PgInterval"),this.config.intervalConfig=t}build(e){return new m(e,this.config)}}class m extends d.PgColumn{static [c.entityKind]="PgInterval";fields=this.config.intervalConfig.fields;precision=this.config.intervalConfig.precision;getSQLType(){let e=this.fields?` ${this.fields}`:"",t=this.precision?`(${this.precision})`:"";return`interval${e}${t}`}}function g(e,t={}){let{name:r,config:i}=(0,f.getColumnNameAndConfig)(e,t);return new p(r,i)}},80411,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgJson:()=>p,PgJsonBuilder:()=>d,json:()=>m};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(54732);class d extends f.PgColumnBuilder{static [c.entityKind]="PgJsonBuilder";constructor(e){super(e,"json","PgJson")}build(e){return new p(e,this.config)}}class p extends f.PgColumn{static [c.entityKind]="PgJson";constructor(e,t){super(e,t)}getSQLType(){return"json"}mapToDriverValue(e){return JSON.stringify(e)}mapFromDriverValue(e){if("string"==typeof e)try{return JSON.parse(e)}catch{}return e}}function m(e){return new d(e??"")}},92740,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgJsonb:()=>p,PgJsonbBuilder:()=>d,jsonb:()=>m};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(54732);class d extends f.PgColumnBuilder{static [c.entityKind]="PgJsonbBuilder";constructor(e){super(e,"json","PgJsonb")}build(e){return new p(e,this.config)}}class p extends f.PgColumn{static [c.entityKind]="PgJsonb";constructor(e,t){super(e,t)}getSQLType(){return"jsonb"}mapToDriverValue(e){return JSON.stringify(e)}mapFromDriverValue(e){if("string"==typeof e)try{return JSON.parse(e)}catch{}return e}}function m(e){return new d(e??"")}},33219,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgLineABC:()=>h,PgLineABCBuilder:()=>g,PgLineBuilder:()=>p,PgLineTuple:()=>m,line:()=>y};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(96707),d=e.r(54732);class p extends d.PgColumnBuilder{static [c.entityKind]="PgLineBuilder";constructor(e){super(e,"array","PgLine")}build(e){return new m(e,this.config)}}class m extends d.PgColumn{static [c.entityKind]="PgLine";getSQLType(){return"line"}mapFromDriverValue(e){let[t,r,i]=e.slice(1,-1).split(",");return[Number.parseFloat(t),Number.parseFloat(r),Number.parseFloat(i)]}mapToDriverValue(e){return`{${e[0]},${e[1]},${e[2]}}`}}class g extends d.PgColumnBuilder{static [c.entityKind]="PgLineABCBuilder";constructor(e){super(e,"json","PgLineABC")}build(e){return new h(e,this.config)}}class h extends d.PgColumn{static [c.entityKind]="PgLineABC";getSQLType(){return"line"}mapFromDriverValue(e){let[t,r,i]=e.slice(1,-1).split(",");return{a:Number.parseFloat(t),b:Number.parseFloat(r),c:Number.parseFloat(i)}}mapToDriverValue(e){return`{${e.a},${e.b},${e.c}}`}}function y(e,t){let{name:r,config:i}=(0,f.getColumnNameAndConfig)(e,t);return i?.mode&&"tuple"!==i.mode?new g(r):new p(r)}},881,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgMacaddr:()=>p,PgMacaddrBuilder:()=>d,macaddr:()=>m};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(54732);class d extends f.PgColumnBuilder{static [c.entityKind]="PgMacaddrBuilder";constructor(e){super(e,"string","PgMacaddr")}build(e){return new p(e,this.config)}}class p extends f.PgColumn{static [c.entityKind]="PgMacaddr";getSQLType(){return"macaddr"}}function m(e){return new d(e??"")}},55236,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgMacaddr8:()=>p,PgMacaddr8Builder:()=>d,macaddr8:()=>m};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(54732);class d extends f.PgColumnBuilder{static [c.entityKind]="PgMacaddr8Builder";constructor(e){super(e,"string","PgMacaddr8")}build(e){return new p(e,this.config)}}class p extends f.PgColumn{static [c.entityKind]="PgMacaddr8";getSQLType(){return"macaddr8"}}function m(e){return new d(e??"")}},25583,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgNumeric:()=>m,PgNumericBigInt:()=>b,PgNumericBigIntBuilder:()=>y,PgNumericBuilder:()=>p,PgNumericNumber:()=>h,PgNumericNumberBuilder:()=>g,decimal:()=>O,numeric:()=>w};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(96707),d=e.r(54732);class p extends d.PgColumnBuilder{static [c.entityKind]="PgNumericBuilder";constructor(e,t,r){super(e,"string","PgNumeric"),this.config.precision=t,this.config.scale=r}build(e){return new m(e,this.config)}}class m extends d.PgColumn{static [c.entityKind]="PgNumeric";precision;scale;constructor(e,t){super(e,t),this.precision=t.precision,this.scale=t.scale}mapFromDriverValue(e){return"string"==typeof e?e:String(e)}getSQLType(){return void 0!==this.precision&&void 0!==this.scale?`numeric(${this.precision}, ${this.scale})`:void 0===this.precision?"numeric":`numeric(${this.precision})`}}class g extends d.PgColumnBuilder{static [c.entityKind]="PgNumericNumberBuilder";constructor(e,t,r){super(e,"number","PgNumericNumber"),this.config.precision=t,this.config.scale=r}build(e){return new h(e,this.config)}}class h extends d.PgColumn{static [c.entityKind]="PgNumericNumber";precision;scale;constructor(e,t){super(e,t),this.precision=t.precision,this.scale=t.scale}mapFromDriverValue(e){return"number"==typeof e?e:Number(e)}mapToDriverValue=String;getSQLType(){return void 0!==this.precision&&void 0!==this.scale?`numeric(${this.precision}, ${this.scale})`:void 0===this.precision?"numeric":`numeric(${this.precision})`}}class y extends d.PgColumnBuilder{static [c.entityKind]="PgNumericBigIntBuilder";constructor(e,t,r){super(e,"bigint","PgNumericBigInt"),this.config.precision=t,this.config.scale=r}build(e){return new b(e,this.config)}}class b extends d.PgColumn{static [c.entityKind]="PgNumericBigInt";precision;scale;constructor(e,t){super(e,t),this.precision=t.precision,this.scale=t.scale}mapFromDriverValue=BigInt;mapToDriverValue=String;getSQLType(){return void 0!==this.precision&&void 0!==this.scale?`numeric(${this.precision}, ${this.scale})`:void 0===this.precision?"numeric":`numeric(${this.precision})`}}function w(e,t){let{name:r,config:i}=(0,f.getColumnNameAndConfig)(e,t),n=i?.mode;return"number"===n?new g(r,i?.precision,i?.scale):"bigint"===n?new y(r,i?.precision,i?.scale):new p(r,i?.precision,i?.scale)}let O=w},84011,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgPointObject:()=>h,PgPointObjectBuilder:()=>g,PgPointTuple:()=>m,PgPointTupleBuilder:()=>p,point:()=>y};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(96707),d=e.r(54732);class p extends d.PgColumnBuilder{static [c.entityKind]="PgPointTupleBuilder";constructor(e){super(e,"array","PgPointTuple")}build(e){return new m(e,this.config)}}class m extends d.PgColumn{static [c.entityKind]="PgPointTuple";getSQLType(){return"point"}mapFromDriverValue(e){if("string"==typeof e){let[t,r]=e.slice(1,-1).split(",");return[Number.parseFloat(t),Number.parseFloat(r)]}return[e.x,e.y]}mapToDriverValue(e){return`(${e[0]},${e[1]})`}}class g extends d.PgColumnBuilder{static [c.entityKind]="PgPointObjectBuilder";constructor(e){super(e,"json","PgPointObject")}build(e){return new h(e,this.config)}}class h extends d.PgColumn{static [c.entityKind]="PgPointObject";getSQLType(){return"point"}mapFromDriverValue(e){if("string"==typeof e){let[t,r]=e.slice(1,-1).split(",");return{x:Number.parseFloat(t),y:Number.parseFloat(r)}}return e}mapToDriverValue(e){return`(${e.x},${e.y})`}}function y(e,t){let{name:r,config:i}=(0,f.getColumnNameAndConfig)(e,t);return i?.mode&&"tuple"!==i.mode?new g(r):new p(r)}},97229,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={parseEWKB:()=>f};for(var u in l)i(a,u,{get:l[u],enumerable:!0});function c(e,t){let r=new DataView(new ArrayBuffer(8));for(let i=0;i<8;i++)r.setUint8(i,e[t+i]);return r.getFloat64(0,!0)}function f(e){let t=function(e){let t=[];for(let r=0;r<e.length;r+=2)t.push(Number.parseInt(e.slice(r,r+2),16));return new Uint8Array(t)}(e),r=0,i=t[0];r+=1;let n=new DataView(t.buffer),s=n.getUint32(r,1===i);if(r+=4,0x20000000&s&&(n.getUint32(r,1===i),r+=4),(65535&s)==1){let e=c(t,r),i=c(t,r+=8);return r+=8,[e,i]}throw Error("Unsupported geometry type")}t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a)},12752,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgGeometry:()=>g,PgGeometryBuilder:()=>m,PgGeometryObject:()=>y,PgGeometryObjectBuilder:()=>h,geometry:()=>b};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(96707),d=e.r(54732),p=e.r(97229);class m extends d.PgColumnBuilder{static [c.entityKind]="PgGeometryBuilder";constructor(e){super(e,"array","PgGeometry")}build(e){return new g(e,this.config)}}class g extends d.PgColumn{static [c.entityKind]="PgGeometry";getSQLType(){return"geometry(point)"}mapFromDriverValue(e){return(0,p.parseEWKB)(e)}mapToDriverValue(e){return`point(${e[0]} ${e[1]})`}}class h extends d.PgColumnBuilder{static [c.entityKind]="PgGeometryObjectBuilder";constructor(e){super(e,"json","PgGeometryObject")}build(e){return new y(e,this.config)}}class y extends d.PgColumn{static [c.entityKind]="PgGeometryObject";getSQLType(){return"geometry(point)"}mapFromDriverValue(e){let t=(0,p.parseEWKB)(e);return{x:t[0],y:t[1]}}mapToDriverValue(e){return`point(${e.x} ${e.y})`}}function b(e,t){let{name:r,config:i}=(0,f.getColumnNameAndConfig)(e,t);return i?.mode&&"tuple"!==i.mode?new h(r):new m(r)}},41846,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgReal:()=>p,PgRealBuilder:()=>d,real:()=>m};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(54732);class d extends f.PgColumnBuilder{static [c.entityKind]="PgRealBuilder";constructor(e,t){super(e,"number","PgReal"),this.config.length=t}build(e){return new p(e,this.config)}}class p extends f.PgColumn{static [c.entityKind]="PgReal";constructor(e,t){super(e,t)}getSQLType(){return"real"}mapFromDriverValue=e=>"string"==typeof e?Number.parseFloat(e):e}function m(e){return new d(e??"")}},32231,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgSerial:()=>p,PgSerialBuilder:()=>d,serial:()=>m};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(54732);class d extends f.PgColumnBuilder{static [c.entityKind]="PgSerialBuilder";constructor(e){super(e,"number","PgSerial"),this.config.hasDefault=!0,this.config.notNull=!0}build(e){return new p(e,this.config)}}class p extends f.PgColumn{static [c.entityKind]="PgSerial";getSQLType(){return"serial"}}function m(e){return new d(e??"")}},98697,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgSmallInt:()=>m,PgSmallIntBuilder:()=>p,smallint:()=>g};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(54732),d=e.r(90767);class p extends d.PgIntColumnBaseBuilder{static [c.entityKind]="PgSmallIntBuilder";constructor(e){super(e,"number","PgSmallInt")}build(e){return new m(e,this.config)}}class m extends f.PgColumn{static [c.entityKind]="PgSmallInt";getSQLType(){return"smallint"}mapFromDriverValue=e=>"string"==typeof e?Number(e):e}function g(e){return new p(e??"")}},71614,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgSmallSerial:()=>p,PgSmallSerialBuilder:()=>d,smallserial:()=>m};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(54732);class d extends f.PgColumnBuilder{static [c.entityKind]="PgSmallSerialBuilder";constructor(e){super(e,"number","PgSmallSerial"),this.config.hasDefault=!0,this.config.notNull=!0}build(e){return new p(e,this.config)}}class p extends f.PgColumn{static [c.entityKind]="PgSmallSerial";getSQLType(){return"smallserial"}}function m(e){return new d(e??"")}},43068,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgText:()=>m,PgTextBuilder:()=>p,text:()=>g};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(96707),d=e.r(54732);class p extends d.PgColumnBuilder{static [c.entityKind]="PgTextBuilder";constructor(e,t){super(e,"string","PgText"),this.config.enumValues=t.enum}build(e){return new m(e,this.config)}}class m extends d.PgColumn{static [c.entityKind]="PgText";enumValues=this.config.enumValues;getSQLType(){return"text"}}function g(e,t={}){let{name:r,config:i}=(0,f.getColumnNameAndConfig)(e,t);return new p(r,i)}},71130,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgTime:()=>g,PgTimeBuilder:()=>m,time:()=>h};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(96707),d=e.r(54732),p=e.r(44856);class m extends p.PgDateColumnBaseBuilder{constructor(e,t,r){super(e,"string","PgTime"),this.withTimezone=t,this.precision=r,this.config.withTimezone=t,this.config.precision=r}static [c.entityKind]="PgTimeBuilder";build(e){return new g(e,this.config)}}class g extends d.PgColumn{static [c.entityKind]="PgTime";withTimezone;precision;constructor(e,t){super(e,t),this.withTimezone=t.withTimezone,this.precision=t.precision}getSQLType(){let e=void 0===this.precision?"":`(${this.precision})`;return`time${e}${this.withTimezone?" with time zone":""}`}}function h(e,t={}){let{name:r,config:i}=(0,f.getColumnNameAndConfig)(e,t);return new m(r,i.withTimezone??!1,i.precision)}},68415,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgTimestamp:()=>g,PgTimestampBuilder:()=>m,PgTimestampString:()=>y,PgTimestampStringBuilder:()=>h,timestamp:()=>b};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(96707),d=e.r(54732),p=e.r(44856);class m extends p.PgDateColumnBaseBuilder{static [c.entityKind]="PgTimestampBuilder";constructor(e,t,r){super(e,"date","PgTimestamp"),this.config.withTimezone=t,this.config.precision=r}build(e){return new g(e,this.config)}}class g extends d.PgColumn{static [c.entityKind]="PgTimestamp";withTimezone;precision;constructor(e,t){super(e,t),this.withTimezone=t.withTimezone,this.precision=t.precision}getSQLType(){let e=void 0===this.precision?"":` (${this.precision})`;return`timestamp${e}${this.withTimezone?" with time zone":""}`}mapFromDriverValue(e){return"string"==typeof e?new Date(this.withTimezone?e:e+"+0000"):e}mapToDriverValue=e=>e.toISOString()}class h extends p.PgDateColumnBaseBuilder{static [c.entityKind]="PgTimestampStringBuilder";constructor(e,t,r){super(e,"string","PgTimestampString"),this.config.withTimezone=t,this.config.precision=r}build(e){return new y(e,this.config)}}class y extends d.PgColumn{static [c.entityKind]="PgTimestampString";withTimezone;precision;constructor(e,t){super(e,t),this.withTimezone=t.withTimezone,this.precision=t.precision}getSQLType(){let e=void 0===this.precision?"":`(${this.precision})`;return`timestamp${e}${this.withTimezone?" with time zone":""}`}mapFromDriverValue(e){if("string"==typeof e)return e;let t=e.toISOString().slice(0,-1).replace("T"," ");if(this.withTimezone){let r=e.getTimezoneOffset();return`${t}${r<=0?"+":"-"}${Math.floor(Math.abs(r)/60).toString().padStart(2,"0")}`}return t}}function b(e,t={}){let{name:r,config:i}=(0,f.getColumnNameAndConfig)(e,t);return i?.mode==="string"?new h(r,i.withTimezone??!1,i.precision):new m(r,i?.withTimezone??!1,i?.precision)}},36936,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgUUID:()=>m,PgUUIDBuilder:()=>p,uuid:()=>g};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(84541),d=e.r(54732);class p extends d.PgColumnBuilder{static [c.entityKind]="PgUUIDBuilder";constructor(e){super(e,"string","PgUUID")}defaultRandom(){return this.default(f.sql`gen_random_uuid()`)}build(e){return new m(e,this.config)}}class m extends d.PgColumn{static [c.entityKind]="PgUUID";getSQLType(){return"uuid"}}function g(e){return new p(e??"")}},74150,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgVarchar:()=>m,PgVarcharBuilder:()=>p,varchar:()=>g};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(96707),d=e.r(54732);class p extends d.PgColumnBuilder{static [c.entityKind]="PgVarcharBuilder";constructor(e,t){super(e,"string","PgVarchar"),this.config.length=t.length,this.config.enumValues=t.enum}build(e){return new m(e,this.config)}}class m extends d.PgColumn{static [c.entityKind]="PgVarchar";length=this.config.length;enumValues=this.config.enumValues;getSQLType(){return void 0===this.length?"varchar":`varchar(${this.length})`}}function g(e,t={}){let{name:r,config:i}=(0,f.getColumnNameAndConfig)(e,t);return new p(r,i)}},45596,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgBinaryVector:()=>m,PgBinaryVectorBuilder:()=>p,bit:()=>g};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(96707),d=e.r(54732);class p extends d.PgColumnBuilder{static [c.entityKind]="PgBinaryVectorBuilder";constructor(e,t){super(e,"string","PgBinaryVector"),this.config.dimensions=t.dimensions}build(e){return new m(e,this.config)}}class m extends d.PgColumn{static [c.entityKind]="PgBinaryVector";dimensions=this.config.dimensions;getSQLType(){return`bit(${this.dimensions})`}}function g(e,t){let{name:r,config:i}=(0,f.getColumnNameAndConfig)(e,t);return new p(r,i)}},97548,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgHalfVector:()=>m,PgHalfVectorBuilder:()=>p,halfvec:()=>g};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(96707),d=e.r(54732);class p extends d.PgColumnBuilder{static [c.entityKind]="PgHalfVectorBuilder";constructor(e,t){super(e,"array","PgHalfVector"),this.config.dimensions=t.dimensions}build(e){return new m(e,this.config)}}class m extends d.PgColumn{static [c.entityKind]="PgHalfVector";dimensions=this.config.dimensions;getSQLType(){return`halfvec(${this.dimensions})`}mapToDriverValue(e){return JSON.stringify(e)}mapFromDriverValue(e){return e.slice(1,-1).split(",").map(e=>Number.parseFloat(e))}}function g(e,t){let{name:r,config:i}=(0,f.getColumnNameAndConfig)(e,t);return new p(r,i)}},83240,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgSparseVector:()=>m,PgSparseVectorBuilder:()=>p,sparsevec:()=>g};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(96707),d=e.r(54732);class p extends d.PgColumnBuilder{static [c.entityKind]="PgSparseVectorBuilder";constructor(e,t){super(e,"string","PgSparseVector"),this.config.dimensions=t.dimensions}build(e){return new m(e,this.config)}}class m extends d.PgColumn{static [c.entityKind]="PgSparseVector";dimensions=this.config.dimensions;getSQLType(){return`sparsevec(${this.dimensions})`}}function g(e,t){let{name:r,config:i}=(0,f.getColumnNameAndConfig)(e,t);return new p(r,i)}},56473,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PgVector:()=>m,PgVectorBuilder:()=>p,vector:()=>g};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(96707),d=e.r(54732);class p extends d.PgColumnBuilder{static [c.entityKind]="PgVectorBuilder";constructor(e,t){super(e,"array","PgVector"),this.config.dimensions=t.dimensions}build(e){return new m(e,this.config)}}class m extends d.PgColumn{static [c.entityKind]="PgVector";dimensions=this.config.dimensions;getSQLType(){return`vector(${this.dimensions})`}mapToDriverValue(e){return JSON.stringify(e)}mapFromDriverValue(e){return e.slice(1,-1).split(",").map(e=>Number.parseFloat(e))}}function g(e,t){let{name:r,config:i}=(0,f.getColumnNameAndConfig)(e,t);return new p(r,i)}},92097,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={getPgColumnBuilders:()=>E};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(98315),f=e.r(79991),d=e.r(53548),p=e.r(37329),m=e.r(97493),g=e.r(61148),h=e.r(74438),y=e.r(18358),b=e.r(71209),w=e.r(21085),O=e.r(1137),P=e.r(80411),v=e.r(92740),S=e.r(33219),j=e.r(881),C=e.r(55236),B=e.r(25583),x=e.r(84011),T=e.r(12752),Q=e.r(41846),N=e.r(32231),q=e.r(98697),L=e.r(71614),D=e.r(43068),_=e.r(71130),$=e.r(68415),K=e.r(36936),A=e.r(74150),F=e.r(45596),V=e.r(97548),I=e.r(83240),M=e.r(56473);function E(){return{bigint:c.bigint,bigserial:f.bigserial,boolean:d.boolean,char:p.char,cidr:m.cidr,customType:g.customType,date:h.date,doublePrecision:y.doublePrecision,inet:b.inet,integer:w.integer,interval:O.interval,json:P.json,jsonb:v.jsonb,line:S.line,macaddr:j.macaddr,macaddr8:C.macaddr8,numeric:B.numeric,point:x.point,geometry:T.geometry,real:Q.real,serial:N.serial,smallint:q.smallint,smallserial:L.smallserial,text:D.text,time:_.time,timestamp:$.timestamp,uuid:K.uuid,varchar:A.varchar,bit:F.bit,halfvec:V.halfvec,sparsevec:I.sparsevec,vector:M.vector}}},65232,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={EnableRLS:()=>m,InlineForeignKeys:()=>p,PgTable:()=>g,pgTable:()=>y,pgTableCreator:()=>b,pgTableWithSchema:()=>h};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(9289),d=e.r(92097);let p=Symbol.for("drizzle:PgInlineForeignKeys"),m=Symbol.for("drizzle:EnableRLS");class g extends f.Table{static [c.entityKind]="PgTable";static Symbol=Object.assign({},f.Table.Symbol,{InlineForeignKeys:p,EnableRLS:m});[p]=[];[m]=!1;[f.Table.Symbol.ExtraConfigBuilder]=void 0;[f.Table.Symbol.ExtraConfigColumns]={}}function h(e,t,r,i,n=e){let s=new g(e,i,n),o="function"==typeof t?t((0,d.getPgColumnBuilders)()):t,a=Object.fromEntries(Object.entries(o).map(([e,t])=>{t.setName(e);let r=t.build(s);return s[p].push(...t.buildForeignKeys(r,s)),[e,r]})),l=Object.fromEntries(Object.entries(o).map(([e,t])=>(t.setName(e),[e,t.buildExtraConfigColumn(s)]))),u=Object.assign(s,a);return u[f.Table.Symbol.Columns]=a,u[f.Table.Symbol.ExtraConfigColumns]=l,r&&(u[g.Symbol.ExtraConfigBuilder]=r),Object.assign(u,{enableRLS:()=>(u[g.Symbol.EnableRLS]=!0,u)})}let y=(e,t,r)=>h(e,t,r,void 0);function b(e){return(t,r,i)=>h(e(t),r,i,void 0,t)}},23331,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PrimaryKey:()=>m,PrimaryKeyBuilder:()=>p,primaryKey:()=>d};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(65232);function d(...e){return e[0].columns?new p(e[0].columns,e[0].name):new p(e)}class p{static [c.entityKind]="PgPrimaryKeyBuilder";columns;name;constructor(e,t){this.columns=e,this.name=t}build(e){return new m(e,this.columns,this.name)}}class m{constructor(e,t,r){this.table=e,this.columns=t,this.name=r}static [c.entityKind]="PgPrimaryKey";columns;name;getName(){return this.name??`${this.table[f.PgTable.Symbol.Name]}_${this.columns.map(e=>e.name).join("_")}_pk`}}},98084,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={and:()=>y,arrayContained:()=>A,arrayContains:()=>K,arrayOverlaps:()=>F,between:()=>N,bindIfParam:()=>m,eq:()=>g,exists:()=>T,gt:()=>O,gte:()=>P,ilike:()=>_,inArray:()=>j,isNotNull:()=>x,isNull:()=>B,like:()=>L,lt:()=>v,lte:()=>S,ne:()=>h,not:()=>w,notBetween:()=>q,notExists:()=>Q,notIlike:()=>$,notInArray:()=>C,notLike:()=>D,or:()=>b};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(28892),f=e.r(66044),d=e.r(9289),p=e.r(84541);function m(e,t){return!(0,p.isDriverValueEncoder)(t)||(0,p.isSQLWrapper)(e)||(0,f.is)(e,p.Param)||(0,f.is)(e,p.Placeholder)||(0,f.is)(e,c.Column)||(0,f.is)(e,d.Table)||(0,f.is)(e,p.View)?e:new p.Param(e,t)}let g=(e,t)=>p.sql`${e} = ${m(t,e)}`,h=(e,t)=>p.sql`${e} <> ${m(t,e)}`;function y(...e){let t=e.filter(e=>void 0!==e);if(0!==t.length)return new p.SQL(1===t.length?t:[new p.StringChunk("("),p.sql.join(t,new p.StringChunk(" and ")),new p.StringChunk(")")])}function b(...e){let t=e.filter(e=>void 0!==e);if(0!==t.length)return new p.SQL(1===t.length?t:[new p.StringChunk("("),p.sql.join(t,new p.StringChunk(" or ")),new p.StringChunk(")")])}function w(e){return p.sql`not ${e}`}let O=(e,t)=>p.sql`${e} > ${m(t,e)}`,P=(e,t)=>p.sql`${e} >= ${m(t,e)}`,v=(e,t)=>p.sql`${e} < ${m(t,e)}`,S=(e,t)=>p.sql`${e} <= ${m(t,e)}`;function j(e,t){return Array.isArray(t)?0===t.length?p.sql`false`:p.sql`${e} in ${t.map(t=>m(t,e))}`:p.sql`${e} in ${m(t,e)}`}function C(e,t){return Array.isArray(t)?0===t.length?p.sql`true`:p.sql`${e} not in ${t.map(t=>m(t,e))}`:p.sql`${e} not in ${m(t,e)}`}function B(e){return p.sql`${e} is null`}function x(e){return p.sql`${e} is not null`}function T(e){return p.sql`exists ${e}`}function Q(e){return p.sql`not exists ${e}`}function N(e,t,r){return p.sql`${e} between ${m(t,e)} and ${m(r,e)}`}function q(e,t,r){return p.sql`${e} not between ${m(t,e)} and ${m(r,e)}`}function L(e,t){return p.sql`${e} like ${t}`}function D(e,t){return p.sql`${e} not like ${t}`}function _(e,t){return p.sql`${e} ilike ${t}`}function $(e,t){return p.sql`${e} not ilike ${t}`}function K(e,t){if(Array.isArray(t)){if(0===t.length)throw Error("arrayContains requires at least one value");let r=p.sql`${m(t,e)}`;return p.sql`${e} @> ${r}`}return p.sql`${e} @> ${m(t,e)}`}function A(e,t){if(Array.isArray(t)){if(0===t.length)throw Error("arrayContained requires at least one value");let r=p.sql`${m(t,e)}`;return p.sql`${e} <@ ${r}`}return p.sql`${e} <@ ${m(t,e)}`}function F(e,t){if(Array.isArray(t)){if(0===t.length)throw Error("arrayOverlaps requires at least one value");let r=p.sql`${m(t,e)}`;return p.sql`${e} && ${r}`}return p.sql`${e} && ${m(t,e)}`}},62755,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={asc:()=>f,desc:()=>d};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(84541);function f(e){return c.sql`${e} asc`}function d(e){return c.sql`${e} desc`}},45592,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a=(e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of s(t))o.call(e,l)||l===r||i(e,l,{get:()=>t[l],enumerable:!(a=n(t,l))||a.enumerable});return e},l=(e,t,r)=>(a(e,t,"default"),r&&a(r,t,"default")),u={};t.exports=a(i({},"__esModule",{value:!0}),u),l(u,e.r(98084),t.exports),l(u,e.r(62755),t.exports)},97404,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={Many:()=>w,One:()=>b,Relation:()=>h,Relations:()=>y,createMany:()=>C,createOne:()=>j,createTableRelationsHelpers:()=>x,extractTablesRelationalConfig:()=>v,getOperators:()=>O,getOrderByOperators:()=>P,mapRelationalRow:()=>function e(t,r,i,n,s=e=>e){let o={};for(let[a,l]of n.entries())if(l.isJson){let n=r.relations[l.tsKey],u=i[a],c="string"==typeof u?JSON.parse(u):u;o[l.tsKey]=(0,d.is)(n,b)?c&&e(t,t[l.relationTableTsKey],c,l.selection,s):c.map(r=>e(t,t[l.relationTableTsKey],r,l.selection,s))}else{let e,t=s(i[a]),r=l.field;e=(0,d.is)(r,f.Column)?r:(0,d.is)(r,g.SQL)?r.decoder:r.sql.decoder,o[l.tsKey]=null===t?null:e.mapFromDriverValue(t)}return o},normalizeRelation:()=>B,relations:()=>S};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(9289),f=e.r(28892),d=e.r(66044),p=e.r(23331),m=e.r(45592),g=e.r(84541);class h{constructor(e,t,r){this.sourceTable=e,this.referencedTable=t,this.relationName=r,this.referencedTableName=t[c.Table.Symbol.Name]}static [d.entityKind]="Relation";referencedTableName;fieldName}class y{constructor(e,t){this.table=e,this.config=t}static [d.entityKind]="Relations"}class b extends h{constructor(e,t,r,i){super(e,t,r?.relationName),this.config=r,this.isNullable=i}static [d.entityKind]="One";withFieldName(e){let t=new b(this.sourceTable,this.referencedTable,this.config,this.isNullable);return t.fieldName=e,t}}class w extends h{constructor(e,t,r){super(e,t,r?.relationName),this.config=r}static [d.entityKind]="Many";withFieldName(e){let t=new w(this.sourceTable,this.referencedTable,this.config);return t.fieldName=e,t}}function O(){return{and:m.and,between:m.between,eq:m.eq,exists:m.exists,gt:m.gt,gte:m.gte,ilike:m.ilike,inArray:m.inArray,isNull:m.isNull,isNotNull:m.isNotNull,like:m.like,lt:m.lt,lte:m.lte,ne:m.ne,not:m.not,notBetween:m.notBetween,notExists:m.notExists,notLike:m.notLike,notIlike:m.notIlike,notInArray:m.notInArray,or:m.or,sql:g.sql}}function P(){return{sql:g.sql,asc:m.asc,desc:m.desc}}function v(e,t){1===Object.keys(e).length&&"default"in e&&!(0,d.is)(e.default,c.Table)&&(e=e.default);let r={},i={},n={};for(let[s,o]of Object.entries(e))if((0,d.is)(o,c.Table)){let e=(0,c.getTableUniqueName)(o),t=i[e];for(let i of(r[e]=s,n[s]={tsName:s,dbName:o[c.Table.Symbol.Name],schema:o[c.Table.Symbol.Schema],columns:o[c.Table.Symbol.Columns],relations:t?.relations??{},primaryKey:t?.primaryKey??[]},Object.values(o[c.Table.Symbol.Columns])))i.primary&&n[s].primaryKey.push(i);let a=o[c.Table.Symbol.ExtraConfigBuilder]?.(o[c.Table.Symbol.ExtraConfigColumns]);if(a)for(let e of Object.values(a))(0,d.is)(e,p.PrimaryKeyBuilder)&&n[s].primaryKey.push(...e.columns)}else if((0,d.is)(o,y)){let e,s=(0,c.getTableUniqueName)(o.table),a=r[s];for(let[r,l]of Object.entries(o.config(t(o.table))))if(a){let t=n[a];t.relations[r]=l,e&&t.primaryKey.push(...e)}else s in i||(i[s]={relations:{},primaryKey:e}),i[s].relations[r]=l}return{tables:n,tableNamesMap:r}}function S(e,t){return new y(e,e=>Object.fromEntries(Object.entries(t(e)).map(([e,t])=>[e,t.withFieldName(e)])))}function j(e){return function(t,r){return new b(e,t,r,r?.fields.reduce((e,t)=>e&&t.notNull,!0)??!1)}}function C(e){return function(t,r){return new w(e,t,r)}}function B(e,t,r){if((0,d.is)(r,b)&&r.config)return{fields:r.config.fields,references:r.config.references};let i=t[(0,c.getTableUniqueName)(r.referencedTable)];if(!i)throw Error(`Table "${r.referencedTable[c.Table.Symbol.Name]}" not found in schema`);let n=e[i];if(!n)throw Error(`Table "${i}" not found in schema`);let s=r.sourceTable,o=t[(0,c.getTableUniqueName)(s)];if(!o)throw Error(`Table "${s[c.Table.Symbol.Name]}" not found in schema`);let a=[];for(let e of Object.values(n.relations))(r.relationName&&r!==e&&e.relationName===r.relationName||!r.relationName&&e.referencedTable===r.sourceTable)&&a.push(e);if(a.length>1)throw r.relationName?Error(`There are multiple relations with name "${r.relationName}" in table "${i}"`):Error(`There are multiple relations between "${i}" and "${r.sourceTable[c.Table.Symbol.Name]}". Please specify relation name`);if(a[0]&&(0,d.is)(a[0],b)&&a[0].config)return{fields:a[0].config.references,references:a[0].config.fields};throw Error(`There is not enough information to infer relation "${o}.${r.fieldName}"`)}function x(e){return{one:j(e),many:C(e)}}},77870,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={ColumnAliasProxyHandler:()=>g,RelationTableAliasProxyHandler:()=>y,TableAliasProxyHandler:()=>h,aliasedRelation:()=>w,aliasedTable:()=>b,aliasedTableColumn:()=>O,mapColumnsInAliasedSQLToAlias:()=>P,mapColumnsInSQLToAlias:()=>v};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(28892),f=e.r(66044),d=e.r(84541),p=e.r(9289),m=e.r(32315);class g{constructor(e){this.table=e}static [f.entityKind]="ColumnAliasProxyHandler";get(e,t){return"table"===t?this.table:e[t]}}class h{constructor(e,t){this.alias=e,this.replaceOriginalName=t}static [f.entityKind]="TableAliasProxyHandler";get(e,t){if(t===p.Table.Symbol.IsAlias)return!0;if(t===p.Table.Symbol.Name||this.replaceOriginalName&&t===p.Table.Symbol.OriginalName)return this.alias;if(t===m.ViewBaseConfig)return{...e[m.ViewBaseConfig],name:this.alias,isAlias:!0};if(t===p.Table.Symbol.Columns){let t=e[p.Table.Symbol.Columns];if(!t)return t;let r={};return Object.keys(t).map(i=>{r[i]=new Proxy(t[i],new g(new Proxy(e,this)))}),r}let r=e[t];return(0,f.is)(r,c.Column)?new Proxy(r,new g(new Proxy(e,this))):r}}class y{constructor(e){this.alias=e}static [f.entityKind]="RelationTableAliasProxyHandler";get(e,t){return"sourceTable"===t?b(e.sourceTable,this.alias):e[t]}}function b(e,t){return new Proxy(e,new h(t,!1))}function w(e,t){return new Proxy(e,new y(t))}function O(e,t){return new Proxy(e,new g(new Proxy(e.table,new h(t,!1))))}function P(e,t){return new d.SQL.Aliased(v(e.sql,t),e.fieldAlias)}function v(e,t){return d.sql.join(e.queryChunks.map(e=>(0,f.is)(e,c.Column)?O(e,t):(0,f.is)(e,d.SQL)?v(e,t):(0,f.is)(e,d.SQL.Aliased)?P(e,t):e))}},34700,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={SelectionProxyHandler:()=>h};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(77870),f=e.r(28892),d=e.r(66044),p=e.r(84541),m=e.r(77509),g=e.r(32315);class h{static [d.entityKind]="SelectionProxyHandler";config;constructor(e){this.config={...e}}get(e,t){if("_"===t)return{...e._,selectedFields:new Proxy(e._.selectedFields,this)};if(t===g.ViewBaseConfig)return{...e[g.ViewBaseConfig],selectedFields:new Proxy(e[g.ViewBaseConfig].selectedFields,this)};if("symbol"==typeof t)return e[t];let r=((0,d.is)(e,m.Subquery)?e._.selectedFields:(0,d.is)(e,p.View)?e[g.ViewBaseConfig].selectedFields:e)[t];if((0,d.is)(r,p.SQL.Aliased)){if("sql"===this.config.sqlAliasedBehavior&&!r.isSelectionField)return r.sql;let e=r.clone();return e.isSelectionField=!0,e}if((0,d.is)(r,p.SQL)){if("sql"===this.config.sqlBehavior)return r;throw Error(`You tried to reference "${t}" field from a subquery, which is a raw SQL field, but it doesn't have an alias declared. Please add an alias to the field using ".as('alias')" method.`)}return(0,d.is)(r,f.Column)?this.config.alias?new Proxy(r,new c.ColumnAliasProxyHandler(new Proxy(r.table,new c.TableAliasProxyHandler(this.config.alias,this.config.replaceOriginalName??!1)))):r:"object"!=typeof r||null===r?r:new Proxy(r,new h(this.config))}}},18875,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={QueryPromise:()=>f};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044);class f{static [c.entityKind]="QueryPromise";[Symbol.toStringTag]="QueryPromise";catch(e){return this.then(void 0,e)}finally(e){return this.then(t=>(e?.(),t),t=>{throw e?.(),t})}then(e,t){return this.execute().then(e,t)}}},9952,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={ForeignKey:()=>p,ForeignKeyBuilder:()=>d,foreignKey:()=>m};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(88564);class d{static [c.entityKind]="SQLiteForeignKeyBuilder";reference;_onUpdate;_onDelete;constructor(e,t){this.reference=()=>{let{name:t,columns:r,foreignColumns:i}=e();return{name:t,columns:r,foreignTable:i[0].table,foreignColumns:i}},t&&(this._onUpdate=t.onUpdate,this._onDelete=t.onDelete)}onUpdate(e){return this._onUpdate=e,this}onDelete(e){return this._onDelete=e,this}build(e){return new p(e,this)}}class p{constructor(e,t){this.table=e,this.reference=t.reference,this.onUpdate=t._onUpdate,this.onDelete=t._onDelete}static [c.entityKind]="SQLiteForeignKey";reference;onUpdate;onDelete;getName(){let{name:e,columns:t,foreignColumns:r}=this.reference(),i=t.map(e=>e.name),n=r.map(e=>e.name),s=[this.table[f.TableName],...i,r[0].table[f.TableName],...n];return e??`${s.join("_")}_fk`}}function m(e){return new d(function(){if("function"==typeof e){let{name:t,columns:r,foreignColumns:i}=e();return{name:t,columns:r,foreignColumns:i}}return e})}},15317,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={UniqueConstraint:()=>h,UniqueConstraintBuilder:()=>m,UniqueOnConstraintBuilder:()=>g,unique:()=>p,uniqueKeyName:()=>d};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(88564);function d(e,t){return`${e[f.TableName]}_${t.join("_")}_unique`}function p(e){return new g(e)}class m{constructor(e,t){this.name=t,this.columns=e}static [c.entityKind]="SQLiteUniqueConstraintBuilder";columns;build(e){return new h(e,this.columns,this.name)}}class g{static [c.entityKind]="SQLiteUniqueOnConstraintBuilder";name;constructor(e){this.name=e}on(...e){return new m(e,this.name)}}class h{constructor(e,t,r){this.table=e,this.columns=t,this.name=r??d(this.table,this.columns.map(e=>e.name))}static [c.entityKind]="SQLiteUniqueConstraint";columns;name;getName(){return this.name}}},42381,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={SQLiteColumn:()=>h,SQLiteColumnBuilder:()=>g};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(601),f=e.r(28892),d=e.r(66044),p=e.r(9952),m=e.r(15317);class g extends c.ColumnBuilder{static [d.entityKind]="SQLiteColumnBuilder";foreignKeyConfigs=[];references(e,t={}){return this.foreignKeyConfigs.push({ref:e,actions:t}),this}unique(e){return this.config.isUnique=!0,this.config.uniqueName=e,this}generatedAlwaysAs(e,t){return this.config.generated={as:e,type:"always",mode:t?.mode??"virtual"},this}buildForeignKeys(e,t){return this.foreignKeyConfigs.map(({ref:r,actions:i})=>{let n;return n=new p.ForeignKeyBuilder(()=>({columns:[e],foreignColumns:[r()]})),i.onUpdate&&n.onUpdate(i.onUpdate),i.onDelete&&n.onDelete(i.onDelete),n.build(t)})}}class h extends f.Column{constructor(e,t){t.uniqueName||(t.uniqueName=(0,m.uniqueKeyName)(e,[t.name])),super(e,t),this.table=e}static [d.entityKind]="SQLiteColumn"}},18762,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={SQLiteBigInt:()=>m,SQLiteBigIntBuilder:()=>p,SQLiteBlobBuffer:()=>b,SQLiteBlobBufferBuilder:()=>y,SQLiteBlobJson:()=>h,SQLiteBlobJsonBuilder:()=>g,blob:()=>w};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(96707),d=e.r(42381);class p extends d.SQLiteColumnBuilder{static [c.entityKind]="SQLiteBigIntBuilder";constructor(e){super(e,"bigint","SQLiteBigInt")}build(e){return new m(e,this.config)}}class m extends d.SQLiteColumn{static [c.entityKind]="SQLiteBigInt";getSQLType(){return"blob"}mapFromDriverValue(e){return"u">typeof Buffer&&Buffer.from?BigInt((Buffer.isBuffer(e)?e:e instanceof ArrayBuffer?Buffer.from(e):e.buffer?Buffer.from(e.buffer,e.byteOffset,e.byteLength):Buffer.from(e)).toString("utf8")):BigInt(f.textDecoder.decode(e))}mapToDriverValue(e){return Buffer.from(e.toString())}}class g extends d.SQLiteColumnBuilder{static [c.entityKind]="SQLiteBlobJsonBuilder";constructor(e){super(e,"json","SQLiteBlobJson")}build(e){return new h(e,this.config)}}class h extends d.SQLiteColumn{static [c.entityKind]="SQLiteBlobJson";getSQLType(){return"blob"}mapFromDriverValue(e){return"u">typeof Buffer&&Buffer.from?JSON.parse((Buffer.isBuffer(e)?e:e instanceof ArrayBuffer?Buffer.from(e):e.buffer?Buffer.from(e.buffer,e.byteOffset,e.byteLength):Buffer.from(e)).toString("utf8")):JSON.parse(f.textDecoder.decode(e))}mapToDriverValue(e){return Buffer.from(JSON.stringify(e))}}class y extends d.SQLiteColumnBuilder{static [c.entityKind]="SQLiteBlobBufferBuilder";constructor(e){super(e,"buffer","SQLiteBlobBuffer")}build(e){return new b(e,this.config)}}class b extends d.SQLiteColumn{static [c.entityKind]="SQLiteBlobBuffer";mapFromDriverValue(e){return Buffer.isBuffer(e)?e:Buffer.from(e)}getSQLType(){return"blob"}}function w(e,t){let{name:r,config:i}=(0,f.getColumnNameAndConfig)(e,t);return i?.mode==="json"?new g(r):i?.mode==="bigint"?new p(r):new y(r)}},87081,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={SQLiteCustomColumn:()=>m,SQLiteCustomColumnBuilder:()=>p,customType:()=>g};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(96707),d=e.r(42381);class p extends d.SQLiteColumnBuilder{static [c.entityKind]="SQLiteCustomColumnBuilder";constructor(e,t,r){super(e,"custom","SQLiteCustomColumn"),this.config.fieldConfig=t,this.config.customTypeParams=r}build(e){return new m(e,this.config)}}class m extends d.SQLiteColumn{static [c.entityKind]="SQLiteCustomColumn";sqlName;mapTo;mapFrom;constructor(e,t){super(e,t),this.sqlName=t.customTypeParams.dataType(t.fieldConfig),this.mapTo=t.customTypeParams.toDriver,this.mapFrom=t.customTypeParams.fromDriver}getSQLType(){return this.sqlName}mapFromDriverValue(e){return"function"==typeof this.mapFrom?this.mapFrom(e):e}mapToDriverValue(e){return"function"==typeof this.mapTo?this.mapTo(e):e}}function g(e){return(t,r)=>{let{name:i,config:n}=(0,f.getColumnNameAndConfig)(t,r);return new p(i,n,e)}}},162,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={SQLiteBaseInteger:()=>g,SQLiteBaseIntegerBuilder:()=>m,SQLiteBoolean:()=>P,SQLiteBooleanBuilder:()=>O,SQLiteInteger:()=>y,SQLiteIntegerBuilder:()=>h,SQLiteTimestamp:()=>w,SQLiteTimestampBuilder:()=>b,int:()=>S,integer:()=>v};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(84541),d=e.r(96707),p=e.r(42381);class m extends p.SQLiteColumnBuilder{static [c.entityKind]="SQLiteBaseIntegerBuilder";constructor(e,t,r){super(e,t,r),this.config.autoIncrement=!1}primaryKey(e){return e?.autoIncrement&&(this.config.autoIncrement=!0),this.config.hasDefault=!0,super.primaryKey()}}class g extends p.SQLiteColumn{static [c.entityKind]="SQLiteBaseInteger";autoIncrement=this.config.autoIncrement;getSQLType(){return"integer"}}class h extends m{static [c.entityKind]="SQLiteIntegerBuilder";constructor(e){super(e,"number","SQLiteInteger")}build(e){return new y(e,this.config)}}class y extends g{static [c.entityKind]="SQLiteInteger"}class b extends m{static [c.entityKind]="SQLiteTimestampBuilder";constructor(e,t){super(e,"date","SQLiteTimestamp"),this.config.mode=t}defaultNow(){return this.default(f.sql`(cast((julianday('now') - 2440587.5)*86400000 as integer))`)}build(e){return new w(e,this.config)}}class w extends g{static [c.entityKind]="SQLiteTimestamp";mode=this.config.mode;mapFromDriverValue(e){return new Date("timestamp"===this.config.mode?1e3*e:e)}mapToDriverValue(e){let t=e.getTime();return"timestamp"===this.config.mode?Math.floor(t/1e3):t}}class O extends m{static [c.entityKind]="SQLiteBooleanBuilder";constructor(e,t){super(e,"boolean","SQLiteBoolean"),this.config.mode=t}build(e){return new P(e,this.config)}}class P extends g{static [c.entityKind]="SQLiteBoolean";mode=this.config.mode;mapFromDriverValue(e){return 1===Number(e)}mapToDriverValue(e){return+!!e}}function v(e,t){let{name:r,config:i}=(0,d.getColumnNameAndConfig)(e,t);return i?.mode==="timestamp"||i?.mode==="timestamp_ms"?new b(r,i.mode):i?.mode==="boolean"?new O(r,i.mode):new h(r)}let S=v},54751,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={SQLiteNumeric:()=>m,SQLiteNumericBigInt:()=>b,SQLiteNumericBigIntBuilder:()=>y,SQLiteNumericBuilder:()=>p,SQLiteNumericNumber:()=>h,SQLiteNumericNumberBuilder:()=>g,numeric:()=>w};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(96707),d=e.r(42381);class p extends d.SQLiteColumnBuilder{static [c.entityKind]="SQLiteNumericBuilder";constructor(e){super(e,"string","SQLiteNumeric")}build(e){return new m(e,this.config)}}class m extends d.SQLiteColumn{static [c.entityKind]="SQLiteNumeric";mapFromDriverValue(e){return"string"==typeof e?e:String(e)}getSQLType(){return"numeric"}}class g extends d.SQLiteColumnBuilder{static [c.entityKind]="SQLiteNumericNumberBuilder";constructor(e){super(e,"number","SQLiteNumericNumber")}build(e){return new h(e,this.config)}}class h extends d.SQLiteColumn{static [c.entityKind]="SQLiteNumericNumber";mapFromDriverValue(e){return"number"==typeof e?e:Number(e)}mapToDriverValue=String;getSQLType(){return"numeric"}}class y extends d.SQLiteColumnBuilder{static [c.entityKind]="SQLiteNumericBigIntBuilder";constructor(e){super(e,"bigint","SQLiteNumericBigInt")}build(e){return new b(e,this.config)}}class b extends d.SQLiteColumn{static [c.entityKind]="SQLiteNumericBigInt";mapFromDriverValue=BigInt;mapToDriverValue=String;getSQLType(){return"numeric"}}function w(e,t){let{name:r,config:i}=(0,f.getColumnNameAndConfig)(e,t),n=i?.mode;return"number"===n?new g(r):"bigint"===n?new y(r):new p(r)}},6941,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={SQLiteReal:()=>p,SQLiteRealBuilder:()=>d,real:()=>m};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(42381);class d extends f.SQLiteColumnBuilder{static [c.entityKind]="SQLiteRealBuilder";constructor(e){super(e,"number","SQLiteReal")}build(e){return new p(e,this.config)}}class p extends f.SQLiteColumn{static [c.entityKind]="SQLiteReal";getSQLType(){return"real"}}function m(e){return new d(e??"")}},67773,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={SQLiteText:()=>m,SQLiteTextBuilder:()=>p,SQLiteTextJson:()=>h,SQLiteTextJsonBuilder:()=>g,text:()=>y};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(96707),d=e.r(42381);class p extends d.SQLiteColumnBuilder{static [c.entityKind]="SQLiteTextBuilder";constructor(e,t){super(e,"string","SQLiteText"),this.config.enumValues=t.enum,this.config.length=t.length}build(e){return new m(e,this.config)}}class m extends d.SQLiteColumn{static [c.entityKind]="SQLiteText";enumValues=this.config.enumValues;length=this.config.length;constructor(e,t){super(e,t)}getSQLType(){return`text${this.config.length?`(${this.config.length})`:""}`}}class g extends d.SQLiteColumnBuilder{static [c.entityKind]="SQLiteTextJsonBuilder";constructor(e){super(e,"json","SQLiteTextJson")}build(e){return new h(e,this.config)}}class h extends d.SQLiteColumn{static [c.entityKind]="SQLiteTextJson";getSQLType(){return"text"}mapFromDriverValue(e){return JSON.parse(e)}mapToDriverValue(e){return JSON.stringify(e)}}function y(e,t={}){let{name:r,config:i}=(0,f.getColumnNameAndConfig)(e,t);return"json"===i.mode?new g(r):new p(r,i)}},1523,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={getSQLiteColumnBuilders:()=>h};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(18762),f=e.r(87081),d=e.r(162),p=e.r(54751),m=e.r(6941),g=e.r(67773);function h(){return{blob:c.blob,customType:f.customType,integer:d.integer,numeric:p.numeric,real:m.real,text:g.text}}},81145,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={InlineForeignKeys:()=>p,SQLiteTable:()=>m,sqliteTable:()=>h,sqliteTableCreator:()=>y};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(9289),d=e.r(1523);let p=Symbol.for("drizzle:SQLiteInlineForeignKeys");class m extends f.Table{static [c.entityKind]="SQLiteTable";static Symbol=Object.assign({},f.Table.Symbol,{InlineForeignKeys:p});[f.Table.Symbol.Columns];[p]=[];[f.Table.Symbol.ExtraConfigBuilder]=void 0}function g(e,t,r,i,n=e){let s=new m(e,i,n),o=Object.fromEntries(Object.entries("function"==typeof t?t((0,d.getSQLiteColumnBuilders)()):t).map(([e,t])=>{t.setName(e);let r=t.build(s);return s[p].push(...t.buildForeignKeys(r,s)),[e,r]})),a=Object.assign(s,o);return a[f.Table.Symbol.Columns]=o,a[f.Table.Symbol.ExtraConfigColumns]=o,r&&(a[m.Symbol.ExtraConfigBuilder]=r),a}let h=(e,t,r)=>g(e,t,r);function y(e){return(t,r,i)=>g(e(t),r,i,void 0,t)}},32328,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={Check:()=>d,CheckBuilder:()=>f,check:()=>p};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044);class f{constructor(e,t){this.name=e,this.value=t}static [c.entityKind]="SQLiteCheckBuilder";brand;build(e){return new d(e,this)}}class d{constructor(e,t){this.table=e,this.name=t.name,this.value=t.value}static [c.entityKind]="SQLiteCheck";name;value}function p(e,t){return new f(e,t)}},67584,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={Index:()=>p,IndexBuilder:()=>d,IndexBuilderOn:()=>f,index:()=>m,uniqueIndex:()=>g};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044);class f{constructor(e,t){this.name=e,this.unique=t}static [c.entityKind]="SQLiteIndexBuilderOn";on(...e){return new d(this.name,e,this.unique)}}class d{static [c.entityKind]="SQLiteIndexBuilder";config;constructor(e,t,r){this.config={name:e,columns:t,unique:r,where:void 0}}where(e){return this.config.where=e,this}build(e){return new p(this.config,e)}}class p{static [c.entityKind]="SQLiteIndex";config;constructor(e,t){this.config={...e,table:t}}}function m(e){return new f(e,!1)}function g(e){return new f(e,!0)}},87505,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={PrimaryKey:()=>m,PrimaryKeyBuilder:()=>p,primaryKey:()=>d};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(81145);function d(...e){return e[0].columns?new p(e[0].columns,e[0].name):new p(e)}class p{static [c.entityKind]="SQLitePrimaryKeyBuilder";columns;name;constructor(e,t){this.columns=e,this.name=t}build(e){return new m(e,this.columns,this.name)}}class m{constructor(e,t,r){this.table=e,this.columns=t,this.name=r}static [c.entityKind]="SQLitePrimaryKey";columns;name;getName(){return this.name??`${this.table[f.SQLiteTable.Symbol.Name]}_${this.columns.map(e=>e.name).join("_")}_pk`}}},94910,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={extractUsedTable:()=>v,getTableConfig:()=>P,getViewConfig:()=>S};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(84541),d=e.r(77509),p=e.r(9289),m=e.r(32315),g=e.r(32328),h=e.r(9952),y=e.r(67584),b=e.r(87505),w=e.r(81145),O=e.r(15317);function P(e){let t=Object.values(e[w.SQLiteTable.Symbol.Columns]),r=[],i=[],n=[],s=[],o=Object.values(e[w.SQLiteTable.Symbol.InlineForeignKeys]),a=e[p.Table.Symbol.Name],l=e[w.SQLiteTable.Symbol.ExtraConfigBuilder];if(void 0!==l){let t=l(e[w.SQLiteTable.Symbol.Columns]);for(let a of Object.values(Array.isArray(t)?t.flat(1):Object.values(t)))(0,c.is)(a,y.IndexBuilder)?r.push(a.build(e)):(0,c.is)(a,g.CheckBuilder)?i.push(a.build(e)):(0,c.is)(a,O.UniqueConstraintBuilder)?s.push(a.build(e)):(0,c.is)(a,b.PrimaryKeyBuilder)?n.push(a.build(e)):(0,c.is)(a,h.ForeignKeyBuilder)&&o.push(a.build(e))}return{columns:t,indexes:r,foreignKeys:o,checks:i,primaryKeys:n,uniqueConstraints:s,name:a}}function v(e){return(0,c.is)(e,w.SQLiteTable)?[`${e[p.Table.Symbol.BaseName]}`]:(0,c.is)(e,d.Subquery)?e._.usedTables??[]:(0,c.is)(e,f.SQL)?e.usedTables??[]:[]}function S(e){return{...e[m.ViewBaseConfig]}}},37232,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={SQLiteDeleteBase:()=>y};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(18875),d=e.r(34700),p=e.r(81145),m=e.r(9289),g=e.r(96707),h=e.r(94910);class y extends f.QueryPromise{constructor(e,t,r,i){super(),this.table=e,this.session=t,this.dialect=r,this.config={table:e,withList:i}}static [c.entityKind]="SQLiteDelete";config;where(e){return this.config.where=e,this}orderBy(...e){if("function"==typeof e[0]){let t=e[0](new Proxy(this.config.table[m.Table.Symbol.Columns],new d.SelectionProxyHandler({sqlAliasedBehavior:"alias",sqlBehavior:"sql"}))),r=Array.isArray(t)?t:[t];this.config.orderBy=r}else this.config.orderBy=e;return this}limit(e){return this.config.limit=e,this}returning(e=this.table[p.SQLiteTable.Symbol.Columns]){return this.config.returning=(0,g.orderSelectedFields)(e),this}getSQL(){return this.dialect.buildDeleteQuery(this.config)}toSQL(){let{typings:e,...t}=this.dialect.sqlToQuery(this.getSQL());return t}_prepare(e=!0){return this.session[e?"prepareOneTimeQuery":"prepareQuery"](this.dialect.sqlToQuery(this.getSQL()),this.config.returning,this.config.returning?"all":"run",!0,void 0,{type:"delete",tables:(0,h.extractUsedTable)(this.config.table)})}prepare(){return this._prepare(!1)}run=e=>this._prepare().run(e);all=e=>this._prepare().all(e);get=e=>this._prepare().get(e);values=e=>this._prepare().values(e);async execute(e){return this._prepare().execute(e)}$dynamic(){return this}}},48271,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={CasingCache:()=>g,toCamelCase:()=>p,toSnakeCase:()=>d};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(9289);function d(e){return(e.replace(/['\u2019]/g,"").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[]).map(e=>e.toLowerCase()).join("_")}function p(e){return(e.replace(/['\u2019]/g,"").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[]).reduce((e,t,r)=>e+(0===r?t.toLowerCase():`${t[0].toUpperCase()}${t.slice(1)}`),"")}function m(e){return e}class g{static [c.entityKind]="CasingCache";cache={};cachedTables={};convert;constructor(e){this.convert="snake_case"===e?d:"camelCase"===e?p:m}getColumnCasing(e){if(!e.keyAsName)return e.name;let t=e.table[f.Table.Symbol.Schema]??"public",r=e.table[f.Table.Symbol.OriginalName],i=`${t}.${r}.${e.name}`;return this.cache[i]||this.cacheTable(e.table),this.cache[i]}cacheTable(e){let t=e[f.Table.Symbol.Schema]??"public",r=e[f.Table.Symbol.OriginalName],i=`${t}.${r}`;if(!this.cachedTables[i]){for(let t of Object.values(e[f.Table.Symbol.Columns])){let e=`${i}.${t.name}`;this.cache[e]=this.convert(t.name)}this.cachedTables[i]=!0}}clearCache(){this.cache={},this.cachedTables={}}}},83525,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={DrizzleError:()=>f,DrizzleQueryError:()=>d,TransactionRollbackError:()=>p};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044);class f extends Error{static [c.entityKind]="DrizzleError";constructor({message:e,cause:t}){super(e),this.name="DrizzleError",this.cause=t}}class d extends Error{constructor(e,t,r){super(`Failed query: ${e}
2
2
  params: ${t}`),this.query=e,this.params=t,this.cause=r,Error.captureStackTrace(this,d),r&&(this.cause=r)}}class p extends f{static [c.entityKind]="TransactionRollbackError";constructor(){super({message:"Rollback"})}}},10186,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={avg:()=>g,avgDistinct:()=>h,count:()=>p,countDistinct:()=>m,max:()=>w,min:()=>O,sum:()=>y,sumDistinct:()=>b};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(28892),f=e.r(66044),d=e.r(84541);function p(e){return d.sql`count(${e||d.sql.raw("*")})`.mapWith(Number)}function m(e){return d.sql`count(distinct ${e})`.mapWith(Number)}function g(e){return d.sql`avg(${e})`.mapWith(String)}function h(e){return d.sql`avg(distinct ${e})`.mapWith(String)}function y(e){return d.sql`sum(${e})`.mapWith(String)}function b(e){return d.sql`sum(distinct ${e})`.mapWith(String)}function w(e){return d.sql`max(${e})`.mapWith((0,f.is)(e,c.Column)?e:String)}function O(e){return d.sql`min(${e})`.mapWith((0,f.is)(e,c.Column)?e:String)}},76299,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={cosineDistance:()=>g,hammingDistance:()=>h,innerProduct:()=>m,jaccardDistance:()=>y,l1Distance:()=>p,l2Distance:()=>d};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(84541);function f(e){return JSON.stringify(e)}function d(e,t){return Array.isArray(t)?c.sql`${e} <-> ${f(t)}`:c.sql`${e} <-> ${t}`}function p(e,t){return Array.isArray(t)?c.sql`${e} <+> ${f(t)}`:c.sql`${e} <+> ${t}`}function m(e,t){return Array.isArray(t)?c.sql`${e} <#> ${f(t)}`:c.sql`${e} <#> ${t}`}function g(e,t){return Array.isArray(t)?c.sql`${e} <=> ${f(t)}`:c.sql`${e} <=> ${t}`}function h(e,t){return Array.isArray(t)?c.sql`${e} <~> ${f(t)}`:c.sql`${e} <~> ${t}`}function y(e,t){return Array.isArray(t)?c.sql`${e} <%> ${f(t)}`:c.sql`${e} <%> ${t}`}},16998,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a=(e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of s(t))o.call(e,l)||l===r||i(e,l,{get:()=>t[l],enumerable:!(a=n(t,l))||a.enumerable});return e},l=(e,t,r)=>(a(e,t,"default"),r&&a(r,t,"default")),u={};t.exports=a(i({},"__esModule",{value:!0}),u),l(u,e.r(10186),t.exports),l(u,e.r(76299),t.exports)},4907,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a=(e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of s(t))o.call(e,l)||l===r||i(e,l,{get:()=>t[l],enumerable:!(a=n(t,l))||a.enumerable});return e},l=(e,t,r)=>(a(e,t,"default"),r&&a(r,t,"default")),u={};t.exports=a(i({},"__esModule",{value:!0}),u),l(u,e.r(45592),t.exports),l(u,e.r(16998),t.exports),l(u,e.r(84541),t.exports)},52434,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a=(e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of s(t))o.call(e,l)||l===r||i(e,l,{get:()=>t[l],enumerable:!(a=n(t,l))||a.enumerable});return e},l=(e,t,r)=>(a(e,t,"default"),r&&a(r,t,"default")),u={};t.exports=a(i({},"__esModule",{value:!0}),u),l(u,e.r(18762),t.exports),l(u,e.r(42381),t.exports),l(u,e.r(87081),t.exports),l(u,e.r(162),t.exports),l(u,e.r(54751),t.exports),l(u,e.r(6941),t.exports),l(u,e.r(67773),t.exports)},68464,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={SQLiteViewBase:()=>d};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(66044),f=e.r(84541);class d extends f.View{static [c.entityKind]="SQLiteViewBase"}},76493,(e,t,r)=>{"use strict";var i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,a={},l={SQLiteAsyncDialect:()=>x,SQLiteDialect:()=>C,SQLiteSyncDialect:()=>B};for(var u in l)i(a,u,{get:l[u],enumerable:!0});t.exports=((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of s(t))o.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(a=n(t,r))||a.enumerable});return e})(i({},"__esModule",{value:!0}),a);var c=e.r(77870),f=e.r(48271),d=e.r(28892),p=e.r(66044),m=e.r(83525),g=e.r(97404),h=e.r(4907),y=e.r(84541),b=e.r(52434),w=e.r(81145),O=e.r(77509),P=e.r(9289),v=e.r(96707),S=e.r(32315),j=e.r(68464);class C{static [p.entityKind]="SQLiteDialect";casing;constructor(e){this.casing=new f.CasingCache(e?.casing)}escapeName(e){return`"${e.replace(/"/g,'""')}"`}escapeParam(e){return"?"}escapeString(e){return`'${e.replace(/'/g,"''")}'`}buildWithCTE(e){if(!e?.length)return;let t=[y.sql`with `];for(let[r,i]of e.entries())t.push(y.sql`${y.sql.identifier(i._.alias)} as (${i._.sql})`),r<e.length-1&&t.push(y.sql`, `);return t.push(y.sql` `),y.sql.join(t)}buildDeleteQuery({table:e,where:t,returning:r,withList:i,limit:n,orderBy:s}){let o=this.buildWithCTE(i),a=r?y.sql` returning ${this.buildSelection(r,{isSingleTable:!0})}`:void 0,l=t?y.sql` where ${t}`:void 0,u=this.buildOrderBy(s),c=this.buildLimit(n);return y.sql`${o}delete from ${e}${l}${a}${u}${c}`}buildUpdateSet(e,t){let r=e[P.Table.Symbol.Columns],i=Object.keys(r).filter(e=>void 0!==t[e]||r[e]?.onUpdateFn!==void 0),n=i.length;return y.sql.join(i.flatMap((e,i)=>{let s=r[e],o=s.onUpdateFn?.(),a=t[e]??((0,p.is)(o,y.SQL)?o:y.sql.param(o,s)),l=y.sql`${y.sql.identifier(this.casing.getColumnCasing(s))} = ${a}`;return i<n-1?[l,y.sql.raw(", ")]:[l]}))}buildUpdateQuery({table:e,set:t,where:r,returning:i,withList:n,joins:s,from:o,limit:a,orderBy:l}){let u=this.buildWithCTE(n),c=this.buildUpdateSet(e,t),f=o&&y.sql.join([y.sql.raw(" from "),this.buildFromTable(o)]),d=this.buildJoins(s),p=i?y.sql` returning ${this.buildSelection(i,{isSingleTable:!0})}`:void 0,m=r?y.sql` where ${r}`:void 0,g=this.buildOrderBy(l),h=this.buildLimit(a);return y.sql`${u}update ${e} set ${c}${f}${d}${m}${p}${g}${h}`}buildSelection(e,{isSingleTable:t=!1}={}){let r=e.length,i=e.flatMap(({field:e},i)=>{let n=[];if((0,p.is)(e,y.SQL.Aliased)&&e.isSelectionField)n.push(y.sql.identifier(e.fieldAlias));else if((0,p.is)(e,y.SQL.Aliased)||(0,p.is)(e,y.SQL)){let r=(0,p.is)(e,y.SQL.Aliased)?e.sql:e;t?n.push(new y.SQL(r.queryChunks.map(e=>(0,p.is)(e,d.Column)?y.sql.identifier(this.casing.getColumnCasing(e)):e))):n.push(r),(0,p.is)(e,y.SQL.Aliased)&&n.push(y.sql` as ${y.sql.identifier(e.fieldAlias)}`)}else if((0,p.is)(e,d.Column)){let r=e.table[P.Table.Symbol.Name];"SQLiteNumericBigInt"===e.columnType?t?n.push(y.sql`cast(${y.sql.identifier(this.casing.getColumnCasing(e))} as text)`):n.push(y.sql`cast(${y.sql.identifier(r)}.${y.sql.identifier(this.casing.getColumnCasing(e))} as text)`):t?n.push(y.sql.identifier(this.casing.getColumnCasing(e))):n.push(y.sql`${y.sql.identifier(r)}.${y.sql.identifier(this.casing.getColumnCasing(e))}`)}else if((0,p.is)(e,O.Subquery)){let t=Object.entries(e._.selectedFields);if(1===t.length){let r=t[0][1],i=(0,p.is)(r,y.SQL)?r.decoder:(0,p.is)(r,d.Column)?{mapFromDriverValue:e=>r.mapFromDriverValue(e)}:r.sql.decoder;i&&(e._.sql.decoder=i)}n.push(e)}return i<r-1&&n.push(y.sql`, `),n});return y.sql.join(i)}buildJoins(e){if(!e||0===e.length)return;let t=[];if(e)for(let[r,i]of e.entries()){0===r&&t.push(y.sql` `);let n=i.table,s=i.on?y.sql` on ${i.on}`:void 0;if((0,p.is)(n,w.SQLiteTable)){let e=n[w.SQLiteTable.Symbol.Name],r=n[w.SQLiteTable.Symbol.Schema],o=n[w.SQLiteTable.Symbol.OriginalName],a=e===o?void 0:i.alias;t.push(y.sql`${y.sql.raw(i.joinType)} join ${r?y.sql`${y.sql.identifier(r)}.`:void 0}${y.sql.identifier(o)}${a&&y.sql` ${y.sql.identifier(a)}`}${s}`)}else t.push(y.sql`${y.sql.raw(i.joinType)} join ${n}${s}`);r<e.length-1&&t.push(y.sql` `)}return y.sql.join(t)}buildLimit(e){return"object"==typeof e||"number"==typeof e&&e>=0?y.sql` limit ${e}`:void 0}buildOrderBy(e){let t=[];if(e)for(let[r,i]of e.entries())t.push(i),r<e.length-1&&t.push(y.sql`, `);return t.length>0?y.sql` order by ${y.sql.join(t)}`:void 0}buildFromTable(e){return(0,p.is)(e,P.Table)&&e[P.Table.Symbol.IsAlias]?y.sql`${y.sql`${y.sql.identifier(e[P.Table.Symbol.Schema]??"")}.`.if(e[P.Table.Symbol.Schema])}${y.sql.identifier(e[P.Table.Symbol.OriginalName])} ${y.sql.identifier(e[P.Table.Symbol.Name])}`:e}buildSelectQuery({withList:e,fields:t,fieldsFlat:r,where:i,having:n,table:s,joins:o,orderBy:a,groupBy:l,limit:u,offset:c,distinct:f,setOperators:m}){let g=r??(0,v.orderSelectedFields)(t);for(let e of g){let t;if((0,p.is)(e.field,d.Column)&&(0,P.getTableName)(e.field.table)!==((0,p.is)(s,O.Subquery)?s._.alias:(0,p.is)(s,j.SQLiteViewBase)?s[S.ViewBaseConfig].name:(0,p.is)(s,y.SQL)?void 0:(0,P.getTableName)(s))&&(t=e.field.table,!o?.some(({alias:e})=>e===(t[P.Table.Symbol.IsAlias]?(0,P.getTableName)(t):t[P.Table.Symbol.BaseName])))){let t=(0,P.getTableName)(e.field.table);throw Error(`Your "${e.path.join("->")}" field references a column "${t}"."${e.field.name}", but the table "${t}" is not part of the query! Did you forget to join it?`)}}let h=!o||0===o.length,b=this.buildWithCTE(e),w=f?y.sql` distinct`:void 0,C=this.buildSelection(g,{isSingleTable:h}),B=this.buildFromTable(s),x=this.buildJoins(o),T=i?y.sql` where ${i}`:void 0,Q=n?y.sql` having ${n}`:void 0,N=[];if(l)for(let[e,t]of l.entries())N.push(t),e<l.length-1&&N.push(y.sql`, `);let q=N.length>0?y.sql` group by ${y.sql.join(N)}`:void 0,L=this.buildOrderBy(a),D=this.buildLimit(u),_=c?y.sql` offset ${c}`:void 0,$=y.sql`${b}select${w} ${C} from ${B}${x}${T}${q}${Q}${L}${D}${_}`;return m.length>0?this.buildSetOperations($,m):$}buildSetOperations(e,t){let[r,...i]=t;if(!r)throw Error("Cannot pass undefined values to any set operator");return 0===i.length?this.buildSetOperationQuery({leftSelect:e,setOperator:r}):this.buildSetOperations(this.buildSetOperationQuery({leftSelect:e,setOperator:r}),i)}buildSetOperationQuery({leftSelect:e,setOperator:{type:t,isAll:r,rightSelect:i,limit:n,orderBy:s,offset:o}}){let a,l=y.sql`${e.getSQL()} `,u=y.sql`${i.getSQL()}`;if(s&&s.length>0){let e=[];for(let t of s)if((0,p.is)(t,b.SQLiteColumn))e.push(y.sql.identifier(t.name));else if((0,p.is)(t,y.SQL)){for(let e=0;e<t.queryChunks.length;e++){let r=t.queryChunks[e];(0,p.is)(r,b.SQLiteColumn)&&(t.queryChunks[e]=y.sql.identifier(this.casing.getColumnCasing(r)))}e.push(y.sql`${t}`)}else e.push(y.sql`${t}`);a=y.sql` order by ${y.sql.join(e,y.sql`, `)}`}let c="object"==typeof n||"number"==typeof n&&n>=0?y.sql` limit ${n}`:void 0,f=y.sql.raw(`${t} ${r?"all ":""}`),d=o?y.sql` offset ${o}`:void 0;return y.sql`${l}${f}${u}${a}${c}${d}`}buildInsertQuery({table:e,values:t,onConflict:r,returning:i,withList:n,select:s}){let o=[],a=Object.entries(e[P.Table.Symbol.Columns]).filter(([e,t])=>!t.shouldDisableInsert()),l=a.map(([,e])=>y.sql.identifier(this.casing.getColumnCasing(e)));if(s)(0,p.is)(t,y.SQL)?o.push(t):o.push(t.getSQL());else for(let[e,r]of(o.push(y.sql.raw("values ")),t.entries())){let i=[];for(let[e,t]of a){let n=r[e];if(void 0===n||(0,p.is)(n,y.Param)&&void 0===n.value){let e;if(null!==t.default&&void 0!==t.default)e=(0,p.is)(t.default,y.SQL)?t.default:y.sql.param(t.default,t);else if(void 0!==t.defaultFn){let r=t.defaultFn();e=(0,p.is)(r,y.SQL)?r:y.sql.param(r,t)}else if(t.default||void 0===t.onUpdateFn)e=y.sql`null`;else{let r=t.onUpdateFn();e=(0,p.is)(r,y.SQL)?r:y.sql.param(r,t)}i.push(e)}else i.push(n)}o.push(i),e<t.length-1&&o.push(y.sql`, `)}let u=this.buildWithCTE(n),c=y.sql.join(o),f=i?y.sql` returning ${this.buildSelection(i,{isSingleTable:!0})}`:void 0,d=r?.length?y.sql.join(r):void 0;return y.sql`${u}insert into ${e} ${l} ${c}${d}${f}`}sqlToQuery(e,t){return e.toQuery({casing:this.casing,escapeName:this.escapeName,escapeParam:this.escapeParam,escapeString:this.escapeString,invokeSource:t})}buildRelationalQuery({fullSchema:e,schema:t,tableNamesMap:r,table:i,tableConfig:n,queryConfig:s,tableAlias:o,nestedQueryRelation:a,joinOn:l}){let u,f=[],v,S,j=[],C,B=[];if(!0===s)f=Object.entries(n.columns).map(([e,t])=>({dbKey:t.name,tsKey:e,field:(0,c.aliasedTableColumn)(t,o),relationTableTsKey:void 0,isJson:!1,selection:[]}));else{let i=Object.fromEntries(Object.entries(n.columns).map(([e,t])=>[e,(0,c.aliasedTableColumn)(t,o)]));if(s.where){let e="function"==typeof s.where?s.where(i,(0,g.getOperators)()):s.where;C=e&&(0,c.mapColumnsInSQLToAlias)(e,o)}let a=[],l=[];if(s.columns){let e=!1;for(let[t,r]of Object.entries(s.columns))void 0!==r&&t in n.columns&&(e||!0!==r||(e=!0),l.push(t));l.length>0&&(l=e?l.filter(e=>s.columns?.[e]===!0):Object.keys(n.columns).filter(e=>!l.includes(e)))}else l=Object.keys(n.columns);for(let e of l){let t=n.columns[e];a.push({tsKey:e,value:t})}let u=[];if(s.with&&(u=Object.entries(s.with).filter(e=>!!e[1]).map(([e,t])=>({tsKey:e,queryConfig:t,relation:n.relations[e]}))),s.extras)for(let[e,t]of Object.entries("function"==typeof s.extras?s.extras(i,{sql:y.sql}):s.extras))a.push({tsKey:e,value:(0,c.mapColumnsInAliasedSQLToAlias)(t,o)});for(let{tsKey:e,value:t}of a)f.push({dbKey:(0,p.is)(t,y.SQL.Aliased)?t.fieldAlias:n.columns[e].name,tsKey:e,field:(0,p.is)(t,d.Column)?(0,c.aliasedTableColumn)(t,o):t,relationTableTsKey:void 0,isJson:!1,selection:[]});let m="function"==typeof s.orderBy?s.orderBy(i,(0,g.getOrderByOperators)()):s.orderBy??[];for(let{tsKey:i,queryConfig:n,relation:a}of(Array.isArray(m)||(m=[m]),j=m.map(e=>(0,p.is)(e,d.Column)?(0,c.aliasedTableColumn)(e,o):(0,c.mapColumnsInSQLToAlias)(e,o)),v=s.limit,S=s.offset,u)){let s=(0,g.normalizeRelation)(t,r,a),l=r[(0,P.getTableUniqueName)(a.referencedTable)],u=`${o}_${i}`,d=(0,h.and)(...s.fields.map((e,t)=>(0,h.eq)((0,c.aliasedTableColumn)(s.references[t],u),(0,c.aliasedTableColumn)(e,o)))),m=this.buildRelationalQuery({fullSchema:e,schema:t,tableNamesMap:r,table:e[l],tableConfig:t[l],queryConfig:(0,p.is)(a,g.One)?!0===n?{limit:1}:{...n,limit:1}:n,tableAlias:u,joinOn:d,nestedQueryRelation:a}),b=y.sql`(${m.sql})`.as(i);f.push({dbKey:i,tsKey:i,field:b,relationTableTsKey:l,isJson:!0,selection:m.selection})}}if(0===f.length)throw new m.DrizzleError({message:`No fields selected for table "${n.tsName}" ("${o}"). You need to have at least one item in "columns", "with" or "extras". If you need to select all columns, omit the "columns" key or set it to undefined.`});if(C=(0,h.and)(l,C),a){let e=y.sql`json_array(${y.sql.join(f.map(({field:e})=>(0,p.is)(e,b.SQLiteColumn)?y.sql.identifier(this.casing.getColumnCasing(e)):(0,p.is)(e,y.SQL.Aliased)?e.sql:e),y.sql`, `)})`;(0,p.is)(a,g.Many)&&(e=y.sql`coalesce(json_group_array(${e}), json_array())`);let t=[{dbKey:"data",tsKey:"data",field:e.as("data"),isJson:!0,relationTableTsKey:n.tsName,selection:f}];void 0!==v||void 0!==S||j.length>0?(u=this.buildSelectQuery({table:(0,c.aliasedTable)(i,o),fields:{},fieldsFlat:[{path:[],field:y.sql.raw("*")}],where:C,limit:v,offset:S,orderBy:j,setOperators:[]}),C=void 0,v=void 0,S=void 0,j=void 0):u=(0,c.aliasedTable)(i,o),u=this.buildSelectQuery({table:(0,p.is)(u,w.SQLiteTable)?u:new O.Subquery(u,{},o),fields:{},fieldsFlat:t.map(({field:e})=>({path:[],field:(0,p.is)(e,d.Column)?(0,c.aliasedTableColumn)(e,o):e})),joins:B,where:C,limit:v,offset:S,orderBy:j,setOperators:[]})}else u=this.buildSelectQuery({table:(0,c.aliasedTable)(i,o),fields:{},fieldsFlat:f.map(({field:e})=>({path:[],field:(0,p.is)(e,d.Column)?(0,c.aliasedTableColumn)(e,o):e})),joins:B,where:C,limit:v,offset:S,orderBy:j,setOperators:[]});return{tableTsKey:n.tsName,sql:u,selection:f}}}class B extends C{static [p.entityKind]="SQLiteSyncDialect";migrate(e,t,r){let i=void 0===r||"string"==typeof r?"__drizzle_migrations":r.migrationsTable??"__drizzle_migrations",n=y.sql`
3
3
  CREATE TABLE IF NOT EXISTS ${y.sql.identifier(i)} (
4
4
  id SERIAL PRIMARY KEY,