"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3780],{13185:function(e,t,a){a.d(t,{Weu:function(){return J}});var r,s,n,o,i,d,l,c,u,h,m,b,p=a(48619).lW;function g(e){return null!=e}function f(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>g(e)))}function w(e){try{return e instanceof Blob}catch(e){return!1}}function k(e){return!!e&&"object"==typeof e&&!Array.isArray(e)&&!(e instanceof Date)&&!w(e)}function N(e){return null!=e}function y(e){return N(e)&&"string"==typeof e}function B(e){return N(e)&&"number"==typeof e}async function I(e){return new Promise(t=>setTimeout(t,e))}a(36815);var v=(e,t,a)=>{if(!t.has(e))throw TypeError("Cannot "+a)},S=(e,t,a)=>(v(e,t,"read from private field"),a?a.call(e):t.get(e)),x=(e,t,a)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,a)},C=(e,t,a,r)=>(v(e,t,"write to private field"),r?r.call(e,a):t.set(e,a),a),W=(e,t,a)=>(v(e,t,"access private method"),a);class M{constructor(e=10){x(this,o),x(this,r,void 0),x(this,s,void 0),x(this,n,void 0),C(this,s,[]),C(this,n,e),this.running=0,this.started=0}setFetch(e){C(this,r,e)}getFetch(){if(!S(this,r))throw Error("Fetch not set");return S(this,r)}request(e,t){let a=new Date,r=this.getFetch(),s=async(n=!1)=>{let o;let{promise:i,cancel:d}={cancel:()=>clearTimeout(o),promise:new Promise(e=>{o=setTimeout(()=>{e()},3e5)})},l=await Promise.race([r(e,t),i.then(()=>null)]).finally(d);if(!l)throw Error("Request timed out");if(429===l.status){let e=function(e){if(B(e))return e;if(y(e)){let t=Number(e);if(!Number.isNaN(t))return t}}(l.headers?.get("x-ratelimit-reset"))??1;return await I(1e3*e),await s(!0)}if(n){let e=new Date().getTime()-a.getTime();console.warn(`A request to Xata hit branch rate limits, was retried and stalled for ${e}ms`)}return l};return W(this,o,i).call(this,async()=>await s())}}function A(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)})}r=new WeakMap,s=new WeakMap,n=new WeakMap,o=new WeakSet,i=function(e){let t=new Promise(e=>S(this,s).push(e)).finally(()=>{this.started--,this.running++}).then(()=>e()).finally(()=>{this.running--;let e=S(this,s).shift();void 0!==e&&(this.started++,e())});if(this.running+this.started<S(this,n)){let e=S(this,s).shift();void 0!==e&&(this.started++,e())}return t};class U extends Error{constructor(e,t){super(e,t)}}class T extends U{constructor(e,t,a){super(q(t)),this.status=e,this.errors=j(t)?t.errors:[{message:q(t),status:e}],this.requestId=a,t instanceof Error&&(this.stack=t.stack,this.cause=t.cause)}toString(){let e=super.toString();return`[${this.status}] (${this.requestId??"Unknown"}): ${e}`}}function j(e){return k(e)&&Array.isArray(e.errors)}function q(e){return e instanceof Error?e.message:y(e)?e:k(e)&&y(e.message)?e.message:j(e)?"Bulk operation failed":"Unexpected error"}let _={production:{main:"https://api.xata.io",workspaces:"https://{workspaceId}.{region}.xata.sh"},staging:{main:"https://api.staging-xata.dev",workspaces:"https://{workspaceId}.{region}.staging-xata.dev"},dev:{main:"https://api.dev-xata.dev",workspaces:"https://{workspaceId}.{region}.dev-xata.dev"},local:{main:"http://localhost:6001",workspaces:"http://{workspaceId}.{region}.localhost:6001"}},O=new M,E=(e,t={},a={})=>{let r=Object.entries(t).reduce((e,[t,a])=>null==a?e:{...e,[t]:a},{}),s=new URLSearchParams(r).toString(),n=s.length>0?`?${s}`:"",o=Object.entries(a).reduce((e,[t,a])=>({...e,[t]:encodeURIComponent(String(a??"")).replace("%3A",":")}),{});return e.replace(/\{\w*\}/g,e=>o[e.slice(1,-1)])+n};async function $(e,t){if(!N(e))return;if(w(e)||"function"==typeof e.text)return e;let{"Content-Type":a}=t??{};return"application/json"===String(a).toLowerCase()&&k(e)?JSON.stringify(e):e}let R=A();async function D({url:e,method:t,body:a,headers:r,pathParams:s,queryParams:n,fetch:o,apiKey:i,endpoint:d,apiUrl:l,workspacesApiUrl:c,trace:u,signal:h,clientID:m,sessionID:b,clientName:p,xataAgentExtra:w,fetchOptions:k={},rawResponse:B=!1}){return O.setFetch(o),await u(`${t.toUpperCase()} ${e}`,async({setAttributes:o})=>{let u=E(function({method:e,endpoint:t,path:a,workspacesApiUrl:r,apiUrl:s,pathParams:n={}}){if("dataPlane"===t){let t=y(r)?`${r}${a}`:r(a,n);if("PUT"===e.toUpperCase()&&["/db/{dbBranchName}/tables/{tableName}/data/{recordId}/column/{columnName}/file","/db/{dbBranchName}/tables/{tableName}/data/{recordId}/column/{columnName}/file/{fileId}"].includes(a)){let{host:e}=function(e){if(!y(e))return null;let[t,a]=Object.entries({production:e.match(/(?:https:\/\/)?([^.]+)(?:\.([^.]+))\.xata\.sh\/db\/([^:]+):?(.*)?/),staging:e.match(/(?:https:\/\/)?([^.]+)(?:\.([^.]+))\.staging-xata\.dev\/db\/([^:]+):?(.*)?/),dev:e.match(/(?:https:\/\/)?([^.]+)(?:\.([^.]+))\.dev-xata\.dev\/db\/([^:]+):?(.*)?/),local:e.match(/(?:https?:\/\/)?([^.]+)(?:\.([^.]+))\.localhost:([^:]+):?(.*)?/)}).find(([,e])=>null!==e)??[];return y(t)&&Object.keys(_).includes(t)&&a?{workspace:a[1],region:a[2],database:a[3],branch:a[4],host:t}:null}(t)??{};switch(e){case"production":t=t.replace("xata.sh","upload.xata.sh");break;case"staging":t=t.replace("staging-xata.dev","upload.staging-xata.dev");break;case"dev":t=t.replace("dev-xata.dev","upload.dev-xata.dev")}}let s=y(n.workspace)?t.replace("{workspaceId}",String(n.workspace)):t;return y(n.region)?s.replace("{region}",String(n.region)):s}return`${s}${a}`}({method:t,endpoint:d,path:e,workspacesApiUrl:c,pathParams:s,apiUrl:l}),n,s),I=u.includes("localhost")?u.replace(/^[^.]+\.[^.]+\./,"http://"):u;o({"http.url":I,"http.target":E(e,n,s)});let v=[["client","TS_SDK"],["version","0.29.3"],N(p)?["service",p]:void 0,...Object.entries(w??{})].filter(g).map(([e,t])=>`${e}=${t}`).join("; "),S=f({"Accept-Encoding":"identity","Content-Type":"application/json","X-Xata-Client-ID":m??R,"X-Xata-Session-ID":b??A(),"X-Xata-Agent":v,...r,...function(e){let{groups:t}=/.*:\/\/(?<host>[^/]+).*/.exec(e)??{};return t?.host?{Host:t.host}:{}}(u),Authorization:`Bearer ${i}`}),x=await O.request(I,{...k,method:t.toUpperCase(),body:await $(a,S),headers:S,signal:h}),{host:C,protocol:W}=function(e){try{let{host:t,protocol:a}=new URL(e);return{host:t,protocol:a}}catch(e){return{}}}(x.url),M=x.headers?.get("x-request-id")??void 0;o({"xata.trace.kind":"http","http.request_id":M,"http.status_code":x.status,"http.host":C,"http.scheme":W?.replace(":",""),"cf.ray":x.headers?.get("cf-ray")??void 0});let U=x.headers?.get("x-xata-message");if(U&&console.warn(U),204===x.status)return{};if(429===x.status)throw new T(x.status,"Rate limit exceeded",M);try{let e=B?await x.blob():await x.json();if(x.ok)return e;throw new T(x.status,e,M)}catch(e){throw new T(x.status,e,M)}},{"http.method":t.toUpperCase(),"http.route":e})}let F=async e=>D({...e,endpoint:"dataPlane"}),P=(e,t)=>F({url:"/db/{dbBranchName}",method:"get",...e,signal:t}),z=async e=>D({...e,endpoint:"controlPlane"});function J(e,...t){if(!N(e))return;let a=t.flatMap(e=>Object.entries(e).map(([e,t])=>{if("trim"===e){let{left:a=0,top:r=0,right:s=0,bottom:n=0}=t;return`${e}=${[r,s,n,a].join(";")}`}if("gravity"===e&&"object"==typeof t){let{x:a=.5,y:r=.5}=t;return`${e}=${[a,r].join("x")}`}return`${e}=${t}`})).join(","),{hostname:r,pathname:s,search:n}=new URL(e),o=s.split("/"),i=o.findIndex(e=>"transform"===e),d=i>=0?o.splice(i,2):[],l=`/transform/${[d[1],a].filter(N).join(",")}`,c=o.join("/");return`https://${r}${l}${c}${n}`}!function e(t,a){let r={...t};for(let[t,s]of Object.entries(a))k(s)&&k(r[t])?r[t]=e(r[t],s):r[t]=s;return r}({migrations:{applyMigration:(e,t)=>F({url:"/db/{dbBranchName}/migrations/apply",method:"post",...e,signal:t}),adaptTable:(e,t)=>F({url:"/db/{dbBranchName}/migrations/adapt/{tableName}",method:"post",...e,signal:t}),getBranchMigrationJobStatus:(e,t)=>F({url:"/db/{dbBranchName}/migrations/status",method:"get",...e,signal:t}),getMigrationJobStatus:(e,t)=>F({url:"/db/{dbBranchName}/migrations/jobs/{jobId}",method:"get",...e,signal:t}),getMigrationHistory:(e,t)=>F({url:"/db/{dbBranchName}/migrations/history",method:"get",...e,signal:t}),getSchema:(e,t)=>F({url:"/db/{dbBranchName}/schema",method:"get",...e,signal:t}),getBranchMigrationHistory:(e,t)=>F({url:"/db/{dbBranchName}/migrations",method:"get",...e,signal:t}),getBranchMigrationPlan:(e,t)=>F({url:"/db/{dbBranchName}/migrations/plan",method:"post",...e,signal:t}),executeBranchMigrationPlan:(e,t)=>F({url:"/db/{dbBranchName}/migrations/execute",method:"post",...e,signal:t}),getBranchSchemaHistory:(e,t)=>F({url:"/db/{dbBranchName}/schema/history",method:"post",...e,signal:t}),compareBranchWithUserSchema:(e,t)=>F({url:"/db/{dbBranchName}/schema/compare",method:"post",...e,signal:t}),compareBranchSchemas:(e,t)=>F({url:"/db/{dbBranchName}/schema/compare/{branchName}",method:"post",...e,signal:t}),updateBranchSchema:(e,t)=>F({url:"/db/{dbBranchName}/schema/update",method:"post",...e,signal:t}),previewBranchSchemaEdit:(e,t)=>F({url:"/db/{dbBranchName}/schema/preview",method:"post",...e,signal:t}),applyBranchSchemaEdit:(e,t)=>F({url:"/db/{dbBranchName}/schema/apply",method:"post",...e,signal:t}),pushBranchMigrations:(e,t)=>F({url:"/db/{dbBranchName}/schema/push",method:"post",...e,signal:t})},branch:{getBranchList:(e,t)=>F({url:"/dbs/{dbName}",method:"get",...e,signal:t}),getBranchDetails:P,createBranch:(e,t)=>F({url:"/db/{dbBranchName}",method:"put",...e,signal:t}),deleteBranch:(e,t)=>F({url:"/db/{dbBranchName}",method:"delete",...e,signal:t}),copyBranch:(e,t)=>F({url:"/db/{dbBranchName}/copy",method:"post",...e,signal:t}),updateBranchMetadata:(e,t)=>F({url:"/db/{dbBranchName}/metadata",method:"put",...e,signal:t}),getBranchMetadata:(e,t)=>F({url:"/db/{dbBranchName}/metadata",method:"get",...e,signal:t}),getBranchStats:(e,t)=>F({url:"/db/{dbBranchName}/stats",method:"get",...e,signal:t}),getGitBranchesMapping:(e,t)=>F({url:"/dbs/{dbName}/gitBranches",method:"get",...e,signal:t}),addGitBranchesEntry:(e,t)=>F({url:"/dbs/{dbName}/gitBranches",method:"post",...e,signal:t}),removeGitBranchesEntry:(e,t)=>F({url:"/dbs/{dbName}/gitBranches",method:"delete",...e,signal:t}),resolveBranch:(e,t)=>F({url:"/dbs/{dbName}/resolveBranch",method:"get",...e,signal:t})},database:{getDatabaseSettings:(e,t)=>F({url:"/dbs/{dbName}/settings",method:"get",...e,signal:t}),updateDatabaseSettings:(e,t)=>F({url:"/dbs/{dbName}/settings",method:"patch",...e,signal:t})},migrationRequests:{queryMigrationRequests:(e,t)=>F({url:"/dbs/{dbName}/migrations/query",method:"post",...e,signal:t}),createMigrationRequest:(e,t)=>F({url:"/dbs/{dbName}/migrations",method:"post",...e,signal:t}),getMigrationRequest:(e,t)=>F({url:"/dbs/{dbName}/migrations/{mrNumber}",method:"get",...e,signal:t}),updateMigrationRequest:(e,t)=>F({url:"/dbs/{dbName}/migrations/{mrNumber}",method:"patch",...e,signal:t}),listMigrationRequestsCommits:(e,t)=>F({url:"/dbs/{dbName}/migrations/{mrNumber}/commits",method:"post",...e,signal:t}),compareMigrationRequest:(e,t)=>F({url:"/dbs/{dbName}/migrations/{mrNumber}/compare",method:"post",...e,signal:t}),getMigrationRequestIsMerged:(e,t)=>F({url:"/dbs/{dbName}/migrations/{mrNumber}/merge",method:"get",...e,signal:t}),mergeMigrationRequest:(e,t)=>F({url:"/dbs/{dbName}/migrations/{mrNumber}/merge",method:"post",...e,signal:t})},table:{createTable:(e,t)=>F({url:"/db/{dbBranchName}/tables/{tableName}",method:"put",...e,signal:t}),deleteTable:(e,t)=>F({url:"/db/{dbBranchName}/tables/{tableName}",method:"delete",...e,signal:t}),updateTable:(e,t)=>F({url:"/db/{dbBranchName}/tables/{tableName}",method:"patch",...e,signal:t}),getTableSchema:(e,t)=>F({url:"/db/{dbBranchName}/tables/{tableName}/schema",method:"get",...e,signal:t}),setTableSchema:(e,t)=>F({url:"/db/{dbBranchName}/tables/{tableName}/schema",method:"put",...e,signal:t}),getTableColumns:(e,t)=>F({url:"/db/{dbBranchName}/tables/{tableName}/columns",method:"get",...e,signal:t}),addTableColumn:(e,t)=>F({url:"/db/{dbBranchName}/tables/{tableName}/columns",method:"post",...e,signal:t}),getColumn:(e,t)=>F({url:"/db/{dbBranchName}/tables/{tableName}/columns/{columnName}",method:"get",...e,signal:t}),updateColumn:(e,t)=>F({url:"/db/{dbBranchName}/tables/{tableName}/columns/{columnName}",method:"patch",...e,signal:t}),deleteColumn:(e,t)=>F({url:"/db/{dbBranchName}/tables/{tableName}/columns/{columnName}",method:"delete",...e,signal:t})},records:{branchTransaction:(e,t)=>F({url:"/db/{dbBranchName}/transaction",method:"post",...e,signal:t}),insertRecord:(e,t)=>F({url:"/db/{dbBranchName}/tables/{tableName}/data",method:"post",...e,signal:t}),getRecord:(e,t)=>F({url:"/db/{dbBranchName}/tables/{tableName}/data/{recordId}",method:"get",...e,signal:t}),insertRecordWithID:(e,t)=>F({url:"/db/{dbBranchName}/tables/{tableName}/data/{recordId}",method:"put",...e,signal:t}),updateRecordWithID:(e,t)=>F({url:"/db/{dbBranchName}/tables/{tableName}/data/{recordId}",method:"patch",...e,signal:t}),upsertRecordWithID:(e,t)=>F({url:"/db/{dbBranchName}/tables/{tableName}/data/{recordId}",method:"post",...e,signal:t}),deleteRecord:(e,t)=>F({url:"/db/{dbBranchName}/tables/{tableName}/data/{recordId}",method:"delete",...e,signal:t}),bulkInsertTableRecords:(e,t)=>F({url:"/db/{dbBranchName}/tables/{tableName}/bulk",method:"post",...e,signal:t})},files:{getFileItem:(e,t)=>F({url:"/db/{dbBranchName}/tables/{tableName}/data/{recordId}/column/{columnName}/file/{fileId}",method:"get",...e,signal:t}),putFileItem:(e,t)=>F({url:"/db/{dbBranchName}/tables/{tableName}/data/{recordId}/column/{columnName}/file/{fileId}",method:"put",...e,signal:t}),deleteFileItem:(e,t)=>F({url:"/db/{dbBranchName}/tables/{tableName}/data/{recordId}/column/{columnName}/file/{fileId}",method:"delete",...e,signal:t}),getFile:(e,t)=>F({url:"/db/{dbBranchName}/tables/{tableName}/data/{recordId}/column/{columnName}/file",method:"get",...e,signal:t}),putFile:(e,t)=>F({url:"/db/{dbBranchName}/tables/{tableName}/data/{recordId}/column/{columnName}/file",method:"put",...e,signal:t}),deleteFile:(e,t)=>F({url:"/db/{dbBranchName}/tables/{tableName}/data/{recordId}/column/{columnName}/file",method:"delete",...e,signal:t}),fileAccess:(e,t)=>F({url:"/file/{fileId}",method:"get",...e,signal:t}),fileUpload:(e,t)=>F({url:"/file/{fileId}",method:"put",...e,signal:t})},searchAndFilter:{queryTable:(e,t)=>F({url:"/db/{dbBranchName}/tables/{tableName}/query",method:"post",...e,signal:t}),searchBranch:(e,t)=>F({url:"/db/{dbBranchName}/search",method:"post",...e,signal:t}),searchTable:(e,t)=>F({url:"/db/{dbBranchName}/tables/{tableName}/search",method:"post",...e,signal:t}),vectorSearchTable:(e,t)=>F({url:"/db/{dbBranchName}/tables/{tableName}/vectorSearch",method:"post",...e,signal:t}),askTable:(e,t)=>F({url:"/db/{dbBranchName}/tables/{tableName}/ask",method:"post",...e,signal:t}),askTableSession:(e,t)=>F({url:"/db/{dbBranchName}/tables/{tableName}/ask/{sessionId}",method:"post",...e,signal:t}),summarizeTable:(e,t)=>F({url:"/db/{dbBranchName}/tables/{tableName}/summarize",method:"post",...e,signal:t}),aggregateTable:(e,t)=>F({url:"/db/{dbBranchName}/tables/{tableName}/aggregate",method:"post",...e,signal:t})},sql:{sqlQuery:(e,t)=>F({url:"/db/{dbBranchName}/sql",method:"post",...e,signal:t})}},{oAuth:{getAuthorizationCode:(e,t)=>z({url:"/oauth/authorize",method:"get",...e,signal:t}),grantAuthorizationCode:(e,t)=>z({url:"/oauth/authorize",method:"post",...e,signal:t}),getUserOAuthClients:(e,t)=>z({url:"/user/oauth/clients",method:"get",...e,signal:t}),deleteUserOAuthClient:(e,t)=>z({url:"/user/oauth/clients/{clientId}",method:"delete",...e,signal:t}),getUserOAuthAccessTokens:(e,t)=>z({url:"/user/oauth/tokens",method:"get",...e,signal:t}),deleteOAuthAccessToken:(e,t)=>z({url:"/user/oauth/tokens/{token}",method:"delete",...e,signal:t}),updateOAuthAccessToken:(e,t)=>z({url:"/user/oauth/tokens/{token}",method:"patch",...e,signal:t})},users:{getUser:(e,t)=>z({url:"/user",method:"get",...e,signal:t}),updateUser:(e,t)=>z({url:"/user",method:"put",...e,signal:t}),deleteUser:(e,t)=>z({url:"/user",method:"delete",...e,signal:t})},authentication:{getUserAPIKeys:(e,t)=>z({url:"/user/keys",method:"get",...e,signal:t}),createUserAPIKey:(e,t)=>z({url:"/user/keys/{keyName}",method:"post",...e,signal:t}),deleteUserAPIKey:(e,t)=>z({url:"/user/keys/{keyName}",method:"delete",...e,signal:t})},workspaces:{getWorkspacesList:(e,t)=>z({url:"/workspaces",method:"get",...e,signal:t}),createWorkspace:(e,t)=>z({url:"/workspaces",method:"post",...e,signal:t}),getWorkspace:(e,t)=>z({url:"/workspaces/{workspaceId}",method:"get",...e,signal:t}),updateWorkspace:(e,t)=>z({url:"/workspaces/{workspaceId}",method:"put",...e,signal:t}),deleteWorkspace:(e,t)=>z({url:"/workspaces/{workspaceId}",method:"delete",...e,signal:t}),getWorkspaceSettings:(e,t)=>z({url:"/workspaces/{workspaceId}/settings",method:"get",...e,signal:t}),updateWorkspaceSettings:(e,t)=>z({url:"/workspaces/{workspaceId}/settings",method:"patch",...e,signal:t}),getWorkspaceMembersList:(e,t)=>z({url:"/workspaces/{workspaceId}/members",method:"get",...e,signal:t}),updateWorkspaceMemberRole:(e,t)=>z({url:"/workspaces/{workspaceId}/members/{userId}",method:"put",...e,signal:t}),removeWorkspaceMember:(e,t)=>z({url:"/workspaces/{workspaceId}/members/{userId}",method:"delete",...e,signal:t})},invites:{inviteWorkspaceMember:(e,t)=>z({url:"/workspaces/{workspaceId}/invites",method:"post",...e,signal:t}),updateWorkspaceMemberInvite:(e,t)=>z({url:"/workspaces/{workspaceId}/invites/{inviteId}",method:"patch",...e,signal:t}),cancelWorkspaceMemberInvite:(e,t)=>z({url:"/workspaces/{workspaceId}/invites/{inviteId}",method:"delete",...e,signal:t}),acceptWorkspaceMemberInvite:(e,t)=>z({url:"/workspaces/{workspaceId}/invites/{inviteKey}/accept",method:"post",...e,signal:t}),resendWorkspaceMemberInvite:(e,t)=>z({url:"/workspaces/{workspaceId}/invites/{inviteId}/resend",method:"post",...e,signal:t})},xbcontrolOther:{listClusters:(e,t)=>z({url:"/workspaces/{workspaceId}/clusters",method:"get",...e,signal:t}),createCluster:(e,t)=>z({url:"/workspaces/{workspaceId}/clusters",method:"post",...e,signal:t}),getCluster:(e,t)=>z({url:"/workspaces/{workspaceId}/clusters/{clusterId}",method:"get",...e,signal:t}),updateCluster:(e,t)=>z({url:"/workspaces/{workspaceId}/clusters/{clusterId}",method:"patch",...e,signal:t})},databases:{getDatabaseList:(e,t)=>z({url:"/workspaces/{workspaceId}/dbs",method:"get",...e,signal:t}),createDatabase:(e,t)=>z({url:"/workspaces/{workspaceId}/dbs/{dbName}",method:"put",...e,signal:t}),deleteDatabase:(e,t)=>z({url:"/workspaces/{workspaceId}/dbs/{dbName}",method:"delete",...e,signal:t}),getDatabaseMetadata:(e,t)=>z({url:"/workspaces/{workspaceId}/dbs/{dbName}",method:"get",...e,signal:t}),updateDatabaseMetadata:(e,t)=>z({url:"/workspaces/{workspaceId}/dbs/{dbName}",method:"patch",...e,signal:t}),renameDatabase:(e,t)=>z({url:"/workspaces/{workspaceId}/dbs/{dbName}/rename",method:"post",...e,signal:t}),getDatabaseGithubSettings:(e,t)=>z({url:"/workspaces/{workspaceId}/dbs/{dbName}/github",method:"get",...e,signal:t}),updateDatabaseGithubSettings:(e,t)=>z({url:"/workspaces/{workspaceId}/dbs/{dbName}/github",method:"put",...e,signal:t}),deleteDatabaseGithubSettings:(e,t)=>z({url:"/workspaces/{workspaceId}/dbs/{dbName}/github",method:"delete",...e,signal:t}),listRegions:(e,t)=>z({url:"/workspaces/{workspaceId}/regions",method:"get",...e,signal:t})}}),new WeakMap,new WeakMap;class L{constructor(e){this.id=e.id,this.name=e.name,this.mediaType=e.mediaType,this.base64Content=e.base64Content,this.enablePublicUrl=e.enablePublicUrl,this.signedUrlTimeout=e.signedUrlTimeout,this.uploadUrlTimeout=e.uploadUrlTimeout,this.size=e.size,this.version=e.version,this.url=e.url,this.signedUrl=e.signedUrl,this.uploadUrl=e.uploadUrl,this.attributes=e.attributes}static fromBuffer(e,t={}){let a=e.toString("base64");return new L({...t,base64Content:a})}toBuffer(){if(!this.base64Content)throw Error('File content is not available, please select property "base64Content" when querying the file');return p.from(this.base64Content,"base64")}static fromArrayBuffer(e,t={}){let a=new Uint8Array(e);return this.fromUint8Array(a,t)}toArrayBuffer(){if(!this.base64Content)throw Error('File content is not available, please select property "base64Content" when querying the file');let e=atob(this.base64Content);return new ArrayBuffer(e.length)}static fromUint8Array(e,t={}){let a="";for(let t=0;t<e.byteLength;t++)a+=String.fromCharCode(e[t]);let r=btoa(a);return new L({...t,base64Content:r})}toUint8Array(){if(!this.base64Content)throw Error('File content is not available, please select property "base64Content" when querying the file');let e=atob(this.base64Content),t=new Uint8Array(e.length);for(let a=0;a<e.length;a++)t[a]=e.charCodeAt(a);return t}static async fromBlob(e,t={}){let a=t.name??e.name,r=e.type,s=await e.arrayBuffer();return this.fromArrayBuffer(s,{...t,name:a,mediaType:r})}toBlob(){if(!this.base64Content)throw Error('File content is not available, please select property "base64Content" when querying the file');let e=atob(this.base64Content),t=new Uint8Array(e.length);for(let a=0;a<e.length;a++)t[a]=e.charCodeAt(a);return new Blob([t],{type:this.mediaType})}static fromString(e,t={}){let a=btoa(e);return new L({...t,base64Content:a})}toString(){if(!this.base64Content)throw Error('File content is not available, please select property "base64Content" when querying the file');return atob(this.base64Content)}static fromBase64(e,t={}){return new L({...t,base64Content:e})}toBase64(){if(!this.base64Content)throw Error('File content is not available, please select property "base64Content" when querying the file');return this.base64Content}transform(...e){return{url:J(this.url,...e),signedUrl:J(this.signedUrl,...e),metadataUrl:J(this.url,...e,{format:"json"}),metadataSignedUrl:J(this.signedUrl,...e,{format:"json"})}}}var X=(e,t,a)=>{if(!t.has(e))throw TypeError("Cannot "+a)};new WeakMap;class G extends Array{constructor(...e){super(...G.parseConstructorParams(...e))}static parseConstructorParams(...e){return 1===e.length&&"number"==typeof e[0]?Array(e[0]):e.length<=1&&Array.isArray(e[0]??[])?Array(...e[0]??[]):Array(...e)}toArray(){return Array(...this)}toSerializable(){return JSON.parse(this.toString())}toString(){return JSON.stringify(this.toArray())}map(e,t){return this.toArray().map(e,t)}}new WeakMap;var K=(e,t,a)=>{if(!t.has(e))throw TypeError("Cannot "+a)};new WeakMap,new WeakMap,new WeakMap,new WeakSet;var H=(e,t,a)=>{if(!t.has(e))throw TypeError("Cannot "+a)},Q=(e,t,a)=>(H(e,t,"read from private field"),a?a.call(e):t.get(e)),V=(e,t,a,r)=>(H(e,t,"write to private field"),r?r.call(e,a):t.set(e,a),a);new WeakMap,u=new WeakMap,new WeakMap,new WeakMap,h=new WeakMap,new WeakMap,new WeakSet,new WeakSet,new WeakSet,new WeakSet,new WeakSet,new WeakSet,new WeakSet,new WeakSet,new WeakSet,new WeakSet,new WeakSet,new WeakSet;new WeakMap,new WeakMap,new WeakSet;class Y{constructor(){this.classes={}}add(e){this.classes[e.name]=e}toJSON(e){return JSON.stringify(function e(t){if(Array.isArray(t))return t.map(e);let a=typeof t;if("undefined"===a)return{__:"undefined"};if("bigint"===a)return{__:"bigint",___:t.toString()};if(null===t||"object"!==a)return t;let r=t.constructor,s={__:r.name};for(let[a,r]of Object.entries(t))s[a]=e(r);return r===Date&&(s.___=t.toISOString()),r===Map&&(s.___=Object.fromEntries(t)),r===Set&&(s.___=[...t]),s}(e))}fromJSON(e){return JSON.parse(e,(e,t)=>{if(t&&"object"==typeof t&&!Array.isArray(t)){let{__:e,___:a,...r}=t,s=this.classes[e];if(s)return Object.assign(Object.create(s.prototype),r);if("Date"===e)return new Date(a);if("Set"===e)return new Set(a);if("Map"===e)return new Map(Object.entries(a));if("bigint"===e)return BigInt(a);if("undefined"===e)return;return r}return t})}}new Y}}]);