{"code":"__filename=\"/opt/canhelp/node_modules/better-auth/dist/context/init.mjs\";(()=>{\nvar __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __name=(target,value)=>__defProp(target,\"name\",{value,configurable:true});var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:true})};var __copyProps=(to,from,except,desc)=>{if(from&&typeof from===\"object\"||typeof from===\"function\"){for(let key of __getOwnPropNames(from))if(!__hasOwnProp.call(to,key)&&key!==except)__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable})}return to};var __toCommonJS=mod=>__copyProps(__defProp({},\"__esModule\",{value:true}),mod);var init_exports={};__export(init_exports,{init:()=>init});module.exports=__toCommonJS(init_exports);var import_adapter_kysely=require(\"../db/adapter-kysely.mjs\");var import_get_migration=require(\"../db/get-migration.mjs\");var import_create_context=require(\"./create-context.mjs\");var import_error=require(\"@better-auth/core/error\");var import_kysely_adapter=require(\"@better-auth/kysely-adapter\");const init=__name(async options=>{const adapter=await(0,import_adapter_kysely.getAdapter)(options);const getDatabaseType=__name(database=>(0,import_kysely_adapter.getKyselyDatabaseType)(database)||\"unknown\",\"getDatabaseType\");const ctx=await(0,import_create_context.createAuthContext)(adapter,options,getDatabaseType);ctx.runMigrations=async function(){if(!options.database||\"updateMany\"in options.database)throw new import_error.BetterAuthError(\"Database is not provided or it's an adapter. Migrations are only supported with a database instance.\");const{runMigrations}=await(0,import_get_migration.getMigrations)(options);await runMigrations()};return ctx},\"init\");0&&(module.exports={init});\n})()\n","warnings":[],"map":{"version":3,"mappings":";suBAAA,+HAA2B,oCAC3B,yBAA8B,mCAC9B,0BAAkC,gCAClC,iBAAgC,mCAChC,0BAAsC,uCAGtC,MAAM,KAAO,aAAO,SAAY,CAC/B,MAAM,QAAU,QAAM,kCAAW,OAAO,EACxC,MAAM,gBAAkB,OAAC,aAAa,6CAAsB,QAAQ,GAAK,UAAjD,mBACxB,MAAM,IAAM,QAAM,yCAAkB,QAAS,QAAS,eAAe,EACrE,IAAI,cAAgB,gBAAiB,CACpC,GAAI,CAAC,QAAQ,UAAY,eAAgB,QAAQ,SAAU,MAAM,IAAI,6BAAgB,sGAAsG,EAC3L,KAAM,CAAE,aAAc,EAAI,QAAM,oCAAc,OAAO,EACrD,MAAM,cAAc,CACrB,EACA,OAAO,GACR,EAVa","names":[],"ignoreList":[],"sources":["/opt/canhelp/node_modules/better-auth/dist/context/init.mjs"],"sourcesContent":[null]}}