@antfly/cli-darwin-arm64 0.2.3-rc.1 → 0.2.5
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.
package/bin/antfly
CHANGED
package/lib/libantfly.dylib
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -99,7 +99,7 @@ void main(){
|
|
|
99
99
|
`)}if(r.length>dH)throw new Error(`${t} SSE line exceeded ${dH} characters`);if(p.done){if(r.length>0||o.length>0||i!=="")throw new Error(`${t} stream ended with an incomplete SSE event`);u=!0;return}}}finally{if(!u)try{await n.cancel()}catch{}n.releaseLock()}}var KMn=class extends Error{constructor(e,t,n,a){super(`inference request failed (${e}): ${n}`),this.status=e,this.code=t,this.retryable=a,this.name="InferenceAPIError"}},Djt=class extends KMn{constructor(e){super(503,e.error,`${e.message} (${e.error})`,!0),this.retryable=!0,this.name="InferenceCapacityError",this.code=e.error,this.reason=e.reason,this.retryAfterMs=e.retry_after_ms}};function Njt(e){if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.error=="string"&&typeof t.message=="string"&&(t.reason==="inference_capacity"||t.reason==="inference_admission"||t.reason==="request_queue")&&t.retryable===!0&&typeof t.retry_after_ms=="number"&&Number.isFinite(t.retry_after_ms)&&t.retry_after_ms>0}function cUe(e,t,n){if(e.table===void 0)return;const a=n===void 0?"request":`requests[${n}]`;throw new Error(`Table query ${a}.table must be omitted; the route already selects table ${JSON.stringify(t)}`)}function lUe(e,t){if(typeof e.table=="string"&&e.table.length>0)return;const n=t===void 0?"request":`requests[${t}]`;throw new Error(`Global query ${n}.table must be a non-empty string`)}var ZMn=["doc_identity_unavailable","read_requires_primary","standby_read_unavailable","storage_read_temporarily_unavailable","index_rebuilding","query_embedding_temporarily_unavailable"],JMn=["index_capability_upgrade_pending","index_probe_unavailable"],XMn=class extends Error{constructor(e,t,n){super(e),this.code=t,this.retryAfterSeconds=n,this.status=503,this.retryable=!0,this.name="IndexMutationTemporarilyUnavailableError"}},Ljt=class extends Error{constructor(e,t,n){super(e),this.code=t,this.retryAfterSeconds=n,this.status=503,this.retryable=!0,this.name="QueryTemporarilyUnavailableError"}},eOn=class extends Error{constructor(e,t,n){super(e),this.retryAfterMs=t,this.retryAfterSeconds=n,this.status=429,this.code="storage_resource_exhausted",this.retryable=!0,this.name="StorageResourceExhaustedError"}},tOn=class extends Ljt{constructor(e,t){super(e,"storage_read_temporarily_unavailable",t),this.name="StorageReadTemporarilyUnavailableError"}},nOn=class extends Error{constructor(e){super(e),this.status=409,this.code="hierarchy_cursor_stale",this.action="restart_hierarchy_traversal",this.restartWithout="search_after",this.retryable=!1,this.name="HierarchyCursorStaleError"}},aOn=64<<20,rOn=1<<20,uUe=1<<20;function iOn(e){if(e){if(!("type"in e))return`Basic ${btoa(`${e.username}:${e.password}`)}`;switch(e.type){case"basic":return`Basic ${btoa(`${e.username}:${e.password}`)}`;case"apiKey":return`ApiKey ${btoa(`${e.keyId}:${e.keySecret}`)}`;case"token":return`Bearer ${e.token}`}}}function Ld(e,t="unknown error"){if(!e)return t;if(typeof e=="string")return e.trim()||t;if(e&&typeof e=="object"){const n=e;for(const a of[n.error,n.detail,n.message,n.title])if(typeof a=="string"&&a.trim())return a;try{return JSON.stringify(e)}catch{return t}}return String(e)}function k7(e){return Ld(e)}function C4(e,t,n){if(n?.status===503&&Njt(t))return new Djt(t);const a=t&&typeof t=="object"?t:void 0;if(n?.status===409&&a?.error==="hierarchy_cursor_stale"&&a.action==="restart_hierarchy_traversal"&&a.restart_without==="search_after"&&a.retryable===!1)return new nOn(`${e}: ${typeof a.message=="string"&&a.message.trim()?a.message.trim():k7(t)}`);const r=`${e}: ${k7(t)}`,i=t&&typeof t=="object"?t.code:void 0;if(n?.status===503&&typeof i=="string"&&ZMn.includes(i)&&t.retryable===!0){const o=Number.parseInt(n?.headers.get("Retry-After")??"",10),s=Number.isSafeInteger(o)&&o>0?o:void 0;return i==="storage_read_temporarily_unavailable"?new tOn(r,s):new Ljt(r,i,s)}return new Error(r)}function Ade(e,t,n){const a=t&&typeof t=="object"?t:void 0,r=a?.error,i=`${e}: ${Ld(t)}`;if(n?.status===503&&typeof r=="string"&&JMn.includes(r)&&a?.retryable===!0){const o=Number.parseInt(n.headers.get("Retry-After")??"",10);return new XMn(i,r,Number.isSafeInteger(o)&&o>0?o:void 0)}return new Error(i)}function oOn(e){return{maxRequestBytes:e?.maxRequestBytes&&e.maxRequestBytes>0?e.maxRequestBytes:aOn,maxResponseBytes:e?.maxResponseBytes&&e.maxResponseBytes>0?e.maxResponseBytes:rOn,signal:e?.signal}}function sOn(e,t){const n=JSON.stringify(e);if(new TextEncoder().encode(n).byteLength>t)throw new Error(`encoded request exceeded ${t} bytes`);return n}async function cOn(e,t){if(!e.body)return{bytes:new Uint8Array(0),truncated:!1};const n=e.body.getReader(),a=[];let r=0,i=!1;try{for(;;){const{done:l,value:u}=await n.read();if(l)break;const d=t-r;if(d<=0){i=!0;break}if(u.byteLength>d){a.push(u.slice(0,d)),r+=d,i=!0;break}a.push(u),r+=u.byteLength}}finally{if(i)try{await n.cancel()}catch{}n.releaseLock()}const o=new Uint8Array(r);let s=0;for(const l of a)o.set(l,s),s+=l.byteLength;return{bytes:o,truncated:i}}async function dUe(e,t){const{bytes:n,truncated:a}=await cOn(e,t);return{text:new TextDecoder().decode(n),truncated:a}}function pUe(e){return JSON.parse(e)}var ox=class{constructor(e){this.connections={list:async t=>{const n={};t?.types?.length&&(n.types=t.types.join(",")),t?.include?.length&&(n.include=t.include.join(",")),t?.refresh&&(n.refresh="true");const{data:a,error:r,response:i}=await this.client.GET("/db/v1/connections",{params:{query:n},signal:t?.signal});if(i?.status!==404){if(r)throw new Error(`Failed to list connections: ${k7(r)}`);return a}}},this.tables={list:async t=>{const{data:n,error:a}=await this.client.GET("/db/v1/tables",{params:t?{query:t}:void 0});if(a)throw new Error(`Failed to list tables: ${a.error}`);return n},get:async t=>{const{data:n,error:a}=await this.client.GET("/db/v1/tables/{tableName}",{params:{path:{tableName:t}}});if(a)throw new Error(`Failed to get table: ${Ld(a)}`);return n},create:async(t,n={})=>{for(const[o,s]of Object.entries(n.indexes??{}))try{jEe(s)}catch(l){const u=l instanceof Error?l.message:String(l);throw new TypeError(`Invalid index ${JSON.stringify(o)}: ${u}`)}const{data:a,error:r,response:i}=await this.client.POST("/db/v1/tables/{tableName}",{params:{path:{tableName:t}},body:n});if(r)throw Ade("Failed to create table",r,i);return a},drop:async t=>{const{error:n}=await this.client.DELETE("/db/v1/tables/{tableName}",{params:{path:{tableName:t}}});if(n)throw new Error(`Failed to drop table: ${n.error}`);return!0},replaceSchema:async(t,n,a)=>{const{data:r,error:i}=await this.client.PUT("/db/v1/tables/{tableName}/schema",{params:{path:{tableName:t}},body:n,headers:a?.expectedVersion===void 0?void 0:{"If-Match":`"schema-${a.expectedVersion}"`}});if(i)throw new Error(`Failed to replace table schema: ${i.error}`);return r},patchSchema:async(t,n,a)=>{const{data:r,error:i}=await this.client.PATCH("/db/v1/tables/{tableName}/schema",{params:{path:{tableName:t}},body:n,headers:a?.expectedVersion===void 0?void 0:{"If-Match":`"schema-${a.expectedVersion}"`}});if(i)throw new Error(`Failed to patch table schema: ${i.error}`);return r},updateSchema:async(t,n,a)=>{const{data:r,error:i}=await this.client.PUT("/db/v1/tables/{tableName}/schema",{params:{path:{tableName:t}},body:n,headers:a?.expectedVersion===void 0?void 0:{"If-Match":`"schema-${a.expectedVersion}"`}});if(i)throw new Error(`Failed to replace table schema: ${i.error}`);return r},query:async(t,n,a)=>this.performQuery("/db/v1/tables/{tableName}/query",n,t,a),multiquery:async(t,n)=>this.performMultiquery("/db/v1/tables/{tableName}/query",n,t),batch:async(t,n)=>this.tables.batchWithOptions(t,n),batchWithOptions:async(t,n,a)=>{const{data:r}=await this.postBoundedJSON(`/db/v1/tables/${encodeURIComponent(t)}/batch`,n,a,"Batch operation failed","marshalling batch request");return r??{inserted:Object.keys(n.inserts??{}).length,deleted:n.deletes?.length??0,transformed:n.transforms?.length??0}},backup:async(t,n)=>{const{data:a,error:r}=await this.client.POST("/db/v1/tables/{tableName}/backup",{params:{path:{tableName:t}},body:n});if(r)throw new Error(`Backup failed: ${r.error}`);return a},restore:async(t,n,a)=>{const{data:r,error:i,response:o}=await this.client.POST("/db/v1/tables/{tableName}/restore",{params:{path:{tableName:t}},...a?.idempotencyKey?{headers:{"Idempotency-Key":a.idempotencyKey}}:{},body:n});if(i)throw Ade("Restore failed",i,o);if(!r)throw new Error("Restore failed: unexpected empty response");return r},lookup:async(t,n,a)=>{const{data:r,error:i}=await this.client.GET("/db/v1/tables/{tableName}/documents/{key}",{params:{path:{tableName:t,key:n},query:a?.fields?{fields:a.fields}:void 0}});if(i)throw new Error(`Key lookup failed: ${i.error}`);return r},artifacts:{listEnrichments:async t=>{const{data:n,error:a}=await this.client.GET("/db/v1/tables/{tableName}/artifacts",{params:{path:{tableName:t}}});if(a)throw new Error(`Failed to list artifact enrichments: ${Ld(a)}`);return n},putEnrichment:async(t,n,a)=>{const{data:r,error:i}=await this.client.PUT("/db/v1/tables/{tableName}/artifacts/{artifactName}/enrichment",{params:{path:{tableName:t,artifactName:n}},body:a});if(i)throw new Error(`Failed to put artifact enrichment: ${Ld(i)}`);return r},deleteEnrichment:async(t,n)=>{const{data:a,error:r}=await this.client.DELETE("/db/v1/tables/{tableName}/artifacts/{artifactName}/enrichment",{params:{path:{tableName:t,artifactName:n}}});if(r)throw new Error(`Failed to delete artifact enrichment: ${Ld(r)}`);return a},list:async(t,n,a="summary")=>{const{data:r,error:i}=await this.client.GET("/db/v1/tables/{tableName}/documents/{key}/artifacts",{params:{path:{tableName:t,key:n},query:{detail:a}}});if(i)throw new Error(`Failed to list document artifacts: ${Ld(i)}`);return r},get:async(t,n,a,r="raw")=>{const{data:i,error:o}=await this.client.GET("/db/v1/tables/{tableName}/documents/{key}/artifacts/{artifactName}",{params:{path:{tableName:t,key:n,artifactName:a},query:{detail:r}}});if(o)throw new Error(`Failed to get document artifact: ${Ld(o)}`);return i},reprocessDocument:async(t,n,a)=>{const{data:r,error:i}=await this.client.POST("/db/v1/tables/{tableName}/documents/{key}/artifacts/{artifactName}/reprocess",{params:{path:{tableName:t,key:n,artifactName:a}}});if(i)throw new Error(`Failed to reprocess document artifact: ${Ld(i)}`);return r},reprocessRange:async(t,n,a={})=>{const{data:r,error:i}=await this.client.POST("/db/v1/tables/{tableName}/artifacts/{artifactName}/reprocess",{params:{path:{tableName:t,artifactName:n}},body:a});if(i)throw new Error(`Failed to reprocess table artifact range: ${Ld(i)}`);return r},startReprocessJob:async(t,n,a={})=>{const{data:r,error:i}=await this.client.POST("/db/v1/tables/{tableName}/artifacts/{artifactName}/reprocess-jobs",{params:{path:{tableName:t,artifactName:n}},body:a});if(i)throw new Error(`Failed to start artifact reprocess job: ${Ld(i)}`);return r},getReprocessJob:async(t,n,a)=>{const{data:r,error:i}=await this.client.GET("/db/v1/tables/{tableName}/artifacts/{artifactName}/reprocess-jobs/{jobId}",{params:{path:{tableName:t,artifactName:n,jobId:a}}});if(i)throw new Error(`Failed to load artifact reprocess job: ${Ld(i)}`);return r},advanceReprocessJob:async(t,n,a)=>{const{data:r,error:i}=await this.client.POST("/db/v1/tables/{tableName}/artifacts/{artifactName}/reprocess-jobs/{jobId}/advance",{params:{path:{tableName:t,artifactName:n,jobId:a}}});if(i)throw new Error(`Failed to advance artifact reprocess job: ${Ld(i)}`);return r},cancelReprocessJob:async(t,n,a)=>{const{data:r,error:i}=await this.client.POST("/db/v1/tables/{tableName}/artifacts/{artifactName}/reprocess-jobs/{jobId}/cancel",{params:{path:{tableName:t,artifactName:n,jobId:a}}});if(i)throw new Error(`Failed to cancel artifact reprocess job: ${Ld(i)}`);return r}},scan:(t,n)=>{const a=this.config,r=this.getAuthHeader();async function*i(){const o={"Content-Type":"application/json",Accept:"application/x-ndjson"};r&&(o.Authorization=r),Object.assign(o,a.headers);const s=await fetch(`${x6(a.baseUrl)}/db/v1/tables/${t}/documents`,{method:"POST",headers:o,body:JSON.stringify(n||{})});if(!s.ok){const p=await s.text();throw new Error(`Scan failed: ${s.status} ${p}`)}if(!s.body)throw new Error("Response body is null");const l=s.body.getReader(),u=new TextDecoder;let d="";for(;;){const{done:p,value:m}=await l.read();if(p)break;d+=u.decode(m,{stream:!0});const A=d.split(`
|
|
100
100
|
`);d=A.pop()||"";for(const g of A)g.trim()&&(yield JSON.parse(g))}d.trim()&&(yield JSON.parse(d))}return i()},scanAll:async(t,n)=>{const a=[];for await(const r of this.tables.scan(t,n))a.push(r);return a}},this.restoreJobs={startCluster:async(t,n)=>{const{data:a,error:r}=await this.client.POST("/db/v1/restore",{...n?.idempotencyKey?{headers:{"Idempotency-Key":n.idempotencyKey}}:{},body:t});if(r)throw new Error(`Cluster restore failed: ${r.error}`);if(!a)throw new Error("Cluster restore failed: unexpected empty response");return a},get:async t=>{const{data:n,error:a}=await this.client.GET("/db/v1/restore/jobs/{job_id}",{params:{path:{job_id:t}}});if(a)throw new Error(`Get restore job failed: ${a.error}`);if(!n)throw new Error("Get restore job failed: unexpected empty response");return n},list:async(t={})=>{const{data:n,error:a}=await this.client.GET("/db/v1/restore/jobs",{params:{query:t}});if(a)throw new Error(`List restore jobs failed: ${a.error}`);if(!n)throw new Error("List restore jobs failed: unexpected empty response");return n},listAll:async(t={})=>{const n=[],a=new Set;let r;do{const i=await this.restoreJobs.list({...t,cursor:r});if(n.push(...i.jobs),r=i.next_cursor,r){if(a.has(r))throw new Error(`List restore jobs returned a repeated cursor: ${r}`);a.add(r)}}while(r);return n},cancel:async t=>{const{data:n,error:a}=await this.client.DELETE("/db/v1/restore/jobs/{job_id}",{params:{path:{job_id:t}}});if(a)throw new Error(`Cancel restore job failed: ${a.error}`);if(!n)throw new Error("Cancel restore job failed: unexpected empty response");return n}},this.indexes={list:async t=>{const{data:n,error:a}=await this.client.GET("/db/v1/tables/{tableName}/indexes",{params:{path:{tableName:t}}});if(a)throw new Error(`Failed to list indexes: ${a.error}`);if(!n)throw new Error("Failed to list indexes: unexpected empty response");return n},get:async(t,n)=>{const{data:a,error:r}=await this.client.GET("/db/v1/tables/{tableName}/indexes/{indexName}",{params:{path:{tableName:t,indexName:n}}});if(r)throw new Error(`Failed to get index: ${r.error}`);if(!a)throw new Error("Failed to get index: unexpected empty response");return a},create:async(t,n,a)=>{jEe(a);const{data:r,error:i,response:o}=await this.client.POST("/db/v1/tables/{tableName}/indexes/{indexName}",{params:{path:{tableName:t,indexName:n}},body:a});if(i){const s=i;if(o?.status===429&&s.code==="storage_resource_exhausted"&&s.retryable===!0){const l=o.headers.get("Retry-After"),u=l&&/^[1-9]\d*$/.test(l)?Number(l):NaN,d=Number.isFinite(u)&&u>0?u:void 0,p=typeof s.retry_after_ms=="number"&&Number.isFinite(s.retry_after_ms)&&s.retry_after_ms>0?s.retry_after_ms:(d??0)*1e3;throw new eOn(typeof s.message=="string"&&s.message?s.message:"storage capacity is temporarily exhausted",p,d)}throw Ade("Failed to create index",i,o)}if(!r)throw new Error("Failed to create index: unexpected empty response");return r},drop:async(t,n)=>{const{error:a}=await this.client.DELETE("/db/v1/tables/{tableName}/indexes/{indexName}",{params:{path:{tableName:t,indexName:n}}});if(a)throw new Error(`Failed to drop index: ${a.error}`);return!0}},this.users={getCurrentUser:async()=>{const{data:t,error:n}=await this.client.GET("/auth/v1/me");if(n)throw new Error(`Failed to get current user: ${n.error}`);return t},list:async()=>{const{data:t,error:n}=await this.client.GET("/auth/v1/users");if(n)throw new Error(`Failed to list users: ${n.error}`);return t},get:async t=>{const{data:n,error:a}=await this.client.GET("/auth/v1/users/{userName}",{params:{path:{userName:t}}});if(a)throw new Error(`Failed to get user: ${a.error}`);return n},create:async(t,n)=>{const{data:a,error:r}=await this.client.POST("/auth/v1/users/{userName}",{params:{path:{userName:t}},body:n});if(r)throw new Error(`Failed to create user: ${r.error}`);return a},delete:async t=>{const{error:n}=await this.client.DELETE("/auth/v1/users/{userName}",{params:{path:{userName:t}}});if(n)throw new Error(`Failed to delete user: ${n.error}`);return!0},updatePassword:async(t,n)=>{const{data:a,error:r}=await this.client.PUT("/auth/v1/users/{userName}/password",{params:{path:{userName:t}},body:{new_password:n}});if(r)throw new Error(`Failed to update password: ${r.error}`);return a},getPermissions:async t=>{const{data:n,error:a}=await this.client.GET("/auth/v1/users/{userName}/permissions",{params:{path:{userName:t}}});if(a)throw new Error(`Failed to get permissions: ${a.error}`);return n},addPermission:async(t,n)=>{const{data:a,error:r}=await this.client.POST("/auth/v1/users/{userName}/permissions",{params:{path:{userName:t}},body:n});if(r)throw new Error(`Failed to add permission: ${r.error}`);return a},removePermission:async(t,n,a)=>{const{error:r}=await this.client.DELETE("/auth/v1/users/{userName}/permissions",{params:{path:{userName:t},query:{resource:n,resourceType:a}}});if(r)throw new Error(`Failed to remove permission: ${r.error}`);return!0}},this.config={...e,baseUrl:x6(e.baseUrl)},this.client=this.buildClient()}getAuthHeader(){return iOn(this.config.auth)}buildClient(){const e={"Content-Type":"application/json",...this.config.headers},t=this.getAuthHeader();return t&&(e.Authorization=t),vMn({baseUrl:x6(this.config.baseUrl),headers:e,bodySerializer:n=>typeof n=="string"?n:JSON.stringify(n)})}requestHeaders(e){const t={"Content-Type":"application/json",...this.config.headers,...e},n=this.getAuthHeader();return n&&(t.Authorization=n),t}url(e){return`${x6(this.config.baseUrl)}${e}`}async postBoundedJSON(e,t,n,a,r){const i=oOn(n);let o;try{o=sOn(t,i.maxRequestBytes)}catch(d){throw new Error(`${r}: ${d.message}`)}const s=await fetch(this.url(e),{method:"POST",headers:this.requestHeaders(),body:o,signal:i.signal});if(!s.ok){const{text:d,truncated:p}=await dUe(s,uUe);let m=Ld(d);try{m=Ld(pUe(d),m)}catch{}throw p&&(m=`${m} (response body exceeded ${uUe} bytes)`),new Error(`${a}: ${s.status} ${m}`)}const{text:l,truncated:u}=await dUe(s,i.maxResponseBytes);if(u)throw new Error(`${a} response exceeded ${i.maxResponseBytes} bytes`);return l.trim()?{data:pUe(l),text:l}:{text:l}}setAuth(e,t){typeof e=="string"&&t!==void 0?this.config.auth={username:e,password:t}:this.config.auth=e,this.client=this.buildClient()}async getStatus(){const{data:e,error:t}=await this.client.GET("/db/v1/status");if(t)throw new Error(`Failed to get status: ${k7(t)}`);if(!e)throw new Error("Failed to get status: response body was empty");return e}async getClusterStatus(){const{data:e,error:t}=await this.client.GET("/db/v1/cluster");if(t)throw new Error(`Failed to get cluster: ${k7(t)}`);return e}async performQuery(e,t,n,a){if(e==="/db/v1/tables/{tableName}/query"&&n!==void 0&&cUe(t,n),aUe(t.graph_queries),e==="/db/v1/tables/{tableName}/query"&&n!==void 0){const{data:r,error:i,response:o}=await this.client.POST("/db/v1/tables/{tableName}/query",{params:{path:{tableName:n}},body:t,...a?.signal?{signal:a.signal}:{}});if(i)throw C4("Table query failed",i,o);return lH(r,[t],n),r}else{lUe(t);const{data:r,error:i,response:o}=await this.client.POST("/db/v1/query",{body:t,...a?.signal?{signal:a.signal}:{}});if(i)throw C4("Query failed",i,o);return lH(r,[t]),r}}async performMultiquery(e,t,n){if(e==="/db/v1/tables/{tableName}/query"&&n!==void 0)for(const[r,i]of t.entries())cUe(i,n,r);for(const r of t)aUe(r.graph_queries);const a=`${t.map(r=>JSON.stringify(r)).join(`
|
|
101
101
|
`)}
|
|
102
|
-
`;if(e==="/db/v1/tables/{tableName}/query"&&n!==void 0){const{data:r,error:i,response:o}=await this.client.POST("/db/v1/tables/{tableName}/query",{params:{path:{tableName:n}},body:a,headers:{"Content-Type":"application/x-ndjson"}});if(i)throw C4("Table multi-query failed",i,o);return lH(r,t,n),r}else{const{data:r,error:i,response:o}=await this.client.POST("/db/v1/query",{body:a,headers:{"Content-Type":"application/x-ndjson"}});if(i)throw C4("Multi-query failed",i,o);return lH(r,t),r}}async query(e,t){return(await this.performQuery("/db/v1/query",e,void 0,t))?.responses?.[0]}async multiquery(e){for(const[t,n]of e.entries())lUe(n,t);return this.performMultiquery("/db/v1/query",e)}async performRetrievalAgent(e,t){const n={"Content-Type":"application/json",Accept:"text/event-stream, application/json"},a=this.getAuthHeader();a&&(n.Authorization=a),Object.assign(n,this.config.headers);const r=new AbortController,i=await fetch(`${x6(this.config.baseUrl)}/db/v1/agents/retrieval`,{method:"POST",headers:n,body:JSON.stringify(e),signal:r.signal});if(!i.ok){const l=await i.text();let u=l;try{u=JSON.parse(l)}catch{}throw C4("Retrieval agent request failed",u,i)}if(!i.body)throw new Error("Response body is null");const o=i.headers.get("content-type")||"";if(o.includes("application/json"))return await i.json();if(o.split(";",1)[0]?.trim().toLowerCase()!=="text/event-stream")throw await i.body.cancel(),new Error("Retrieval agent returned an unsupported content type");if(!t)return await i.body.cancel(),r;const s=i.body;return(async()=>{try{for await(const l of VMn(s,"Retrieval agent")){if(r.signal.aborted)return;switch(l.event){case"classification":t.onClassification?.(JSON.parse(l.data));break;case"reasoning":t.onReasoning?.(JSON.parse(l.data));break;case"hit":t.onHit?.(JSON.parse(l.data));break;case"generation":t.onGeneration?.(JSON.parse(l.data));break;case"step_started":t.onStepStarted?.(JSON.parse(l.data));break;case"step_progress":t.onStepProgress?.(JSON.parse(l.data));break;case"step_completed":t.onStepCompleted?.(JSON.parse(l.data));break;case"tool_mode":t.onToolMode?.(JSON.parse(l.data));break;case"followup":t.onFollowup?.(JSON.parse(l.data));break;case"eval":t.onEvalResult?.(JSON.parse(l.data));break;case"done":{const u=JSON.parse(l.data);if(u===null||typeof u!="object"||Array.isArray(u))throw new Error("Retrieval agent returned an invalid done result");typeof u.generation_confidence=="number"&&typeof u.context_relevance=="number"&&t.onConfidence?.({generation_confidence:u.generation_confidence,context_relevance:u.context_relevance}),t.onDone?.(u);return}case"error":{const u=JSON.parse(l.data);if(Njt(u))throw new Djt(u);const d=u!==null&&typeof u=="object"&&u.error?String(u.error):String(u);throw new Error(d)}}}throw new Error("Retrieval agent stream ended before done")}catch(l){if(!r.signal.aborted){const u=l instanceof Error?l:new Error(String(l));t.onErrorDetail?.(u),t.onError?.(u.message)}}})(),r}async retrievalAgent(e,t){if(t)return this.streamRetrievalAgent(e,t);const n=await this.performRetrievalAgent({...e,stream:!1});if(n instanceof AbortController)throw n.abort(),new Error("Retrieval agent returned a stream for a JSON request");return n}async streamRetrievalAgent(e,t){const n=await this.performRetrievalAgent({...e,stream:!0},t);return n instanceof AbortController?n:(t.onDone?.(n),new AbortController)}async chatAgent(e,t,n=[],a){const r={query:e,queries:[{table:t.table,semantic_search:e,indexes:t.semanticIndexes,limit:t.limit??10}],generator:t.generator,messages:[...n,{role:"user",content:e}],max_internal_iterations:t.maxInternalIterations??5,stream:!!a,agent_knowledge:t.agentKnowledge};if(t.steps&&(r.steps=t.steps),a){let o="",s,l,u=!1,d=()=>{};const p=new Promise((y,w)=>{s=y,l=w});p.catch(()=>{});const m=y=>{u||(u=!0,d(),l(y))},A={...a,onGeneration:y=>{o+=y,a.onGeneration?.(y)},onDone:y=>{o=y.generation??o;const w=y.messages?.length?y.messages:[...n,{role:"user",content:e},{role:"assistant",content:o}];u=!0,d(),s(w),a.onAssistantMessage?.(o),a.onMessagesUpdated?.(w),a.onDone?.(y)},onErrorDetail:y=>{m(y),a.onErrorDetail?.(y)}},g=await this.streamRetrievalAgent(r,A),{signal:h}=g,f=()=>m(h.reason instanceof Error?h.reason:new DOMException("Chat turn aborted","AbortError"));return h.aborted?f():u||(h.addEventListener("abort",f,{once:!0}),d=()=>h.removeEventListener("abort",f)),{abortController:g,messages:p}}const i=await this.retrievalAgent(r);return{result:i,messages:i.messages?.length?i.messages:[...n,{role:"user",content:e},...i.generation?[{role:"assistant",content:i.generation}]:[]]}}async queryBuilderAgent(e){const{data:t,error:n,response:a}=await this.client.POST("/db/v1/agents/query-builder",{body:e});if(n)throw C4("Query builder agent failed",n,a);return t}async multiBatch(e){return this.multiBatchWithOptions(e)}async multiBatchWithOptions(e,t){const{data:n}=await this.postBoundedJSON("/db/v1/batch",e,t,"Multi-batch operation failed","marshalling multi-batch request");return n??{}}async linearMerge(e,t){return this.linearMergeWithOptions(e,t)}async linearMergeWithOptions(e,t,n){const{data:a}=await this.postBoundedJSON(`/db/v1/tables/${encodeURIComponent(e)}/merge`,t,n,"Linear merge operation failed","marshalling linear merge request");if(!a)throw new Error("Linear merge operation failed: unexpected empty response");return a}async evaluate(e){const{data:t,error:n}=await this.client.POST("/db/v1/eval",{body:e});if(n)throw new Error(`Evaluation failed: ${n.error}`);return t}getRawClient(){return this.client}};function x6(e){return e.trim().replace(/\/$/,"").replace(/\/db\/v1$/,"").replace(/\/auth\/v1$/,"").replace(/\/ai\/v1$/,"")}function Rjt(e){return e?.hits?.total??void 0}function lOn(e){return e?.value}function Qjt(e){return lOn(Rjt(e))}var Fjt={antfly:{index:!0},bedrock:{index:!0},cohere:{index:!1},gemini:{index:!1},ollama:{index:!0},openai:{index:!0},openrouter:{index:!1},vertex:{index:!1}},uOn=Object.keys(Fjt),dOn=uOn.filter(e=>Fjt[e].index),pOn={antfly:{},gemini:{},ollama:{},openai:{},vertex:{}},mOn=Object.keys(pOn),gde="gguf",AOn="antflydb/clipclap:gguf:Q4_K",gOn="antflydb/gliner2-base-v1:gguf:Q4_K",hOn="antflydb/mxbai-rerank-base-v1",bYa=Object.freeze([{name:AOn,task:"embedder",defaultFormat:gde,defaultVariant:"Q4_K"},{name:gOn,task:"extractor",defaultFormat:gde,defaultVariant:"Q4_K"},{name:hOn,task:"reranker",defaultFormat:gde,defaultVariant:"Q4_K"}]),Mjt=(0,z.createContext)(void 0);function hT(){return typeof window>"u"?{}:window.__ANTFARM_CONFIG__??{}}function fOn(){const e=hT().basePath?.trim();return!e||e==="/"?"":e.replace(/\/$/,"")}function lie(){return hT().authMode==="external"}var hde=()=>{const e=hT().apiUrl;return e||"/db/v1"},fde=()=>{const e=hT().inferenceApiUrl;return e||""},bde="antfarm-api-url",yde="antfarm-inference-api-url",mUe="antfarm-inference-connection";function bOn({children:e}){const t=hT(),n=!!t.apiUrl,a=!!t.inferenceApiUrl,[r,i]=(0,z.useState)(()=>n?hde():localStorage.getItem(bde)||hde()),[o,s]=(0,z.useState)(()=>a?fde():localStorage.getItem(yde)||fde()),[l,u]=(0,z.useState)(()=>localStorage.getItem(mUe)||"local-inference"),[d,p]=(0,z.useState)(()=>new ox({baseUrl:r})),m=w=>{if(n)return;const v=w.trim();i(v),localStorage.setItem(bde,v),p(new ox({baseUrl:v}))},A=()=>{const w=hde();i(w),localStorage.removeItem(bde),p(new ox({baseUrl:w}))},g=w=>{if(a)return;const v=w.trim();s(v),localStorage.setItem(yde,v)},h=()=>{s(fde()),localStorage.removeItem(yde)},f=(0,z.useCallback)(w=>{u(w),localStorage.setItem(mUe,w)},[]),y=(0,z.useCallback)(w=>l==="local-inference"?`${o}/ai/v1/${w}`:`${r}/connections/${encodeURIComponent(l)}/inference/${w}`,[r,o,l]);return(0,b.jsx)(Mjt.Provider,{value:{apiUrl:r,setApiUrl:m,client:d,resetToDefault:A,inferenceApiUrl:o,setInferenceApiUrl:g,resetInferenceApiUrl:h,inferenceConnectionId:l,setInferenceConnectionId:f,inferenceUrl:y},children:e})}function uh(e,t){if(e==null)return{};var n={},a=Object.keys(e),r,i;for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&(n[r]=e[r]);return n}var yOn=["color"],wOn=(0,z.forwardRef)(function(e,t){var n=e.color,a=n===void 0?"currentColor":n,r=uh(e,yOn);return(0,z.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),(0,z.createElement)("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))}),vOn=["color"],kOn=(0,z.forwardRef)(function(e,t){var n=e.color,a=n===void 0?"currentColor":n,r=uh(e,vOn);return(0,z.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),(0,z.createElement)("path",{d:"M6.1584 3.13508C6.35985 2.94621 6.67627 2.95642 6.86514 3.15788L10.6151 7.15788C10.7954 7.3502 10.7954 7.64949 10.6151 7.84182L6.86514 11.8418C6.67627 12.0433 6.35985 12.0535 6.1584 11.8646C5.95694 11.6757 5.94673 11.3593 6.1356 11.1579L9.565 7.49985L6.1356 3.84182C5.94673 3.64036 5.95694 3.32394 6.1584 3.13508Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))}),_On=["color"],COn=(0,z.forwardRef)(function(e,t){var n=e.color,a=n===void 0?"currentColor":n,r=uh(e,_On);return(0,z.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),(0,z.createElement)("path",{d:"M1 9.50006C1 10.3285 1.67157 11.0001 2.5 11.0001H4L4 10.0001H2.5C2.22386 10.0001 2 9.7762 2 9.50006L2 2.50006C2 2.22392 2.22386 2.00006 2.5 2.00006L9.5 2.00006C9.77614 2.00006 10 2.22392 10 2.50006V4.00002H5.5C4.67158 4.00002 4 4.67159 4 5.50002V12.5C4 13.3284 4.67158 14 5.5 14H12.5C13.3284 14 14 13.3284 14 12.5V5.50002C14 4.67159 13.3284 4.00002 12.5 4.00002H11V2.50006C11 1.67163 10.3284 1.00006 9.5 1.00006H2.5C1.67157 1.00006 1 1.67163 1 2.50006V9.50006ZM5 5.50002C5 5.22388 5.22386 5.00002 5.5 5.00002H12.5C12.7761 5.00002 13 5.22388 13 5.50002V12.5C13 12.7762 12.7761 13 12.5 13H5.5C5.22386 13 5 12.7762 5 12.5V5.50002Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))}),xOn=["color"],K$=(0,z.forwardRef)(function(e,t){var n=e.color,a=n===void 0?"currentColor":n,r=uh(e,xOn);return(0,z.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),(0,z.createElement)("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))}),EOn=["color"],BOn=(0,z.forwardRef)(function(e,t){var n=e.color,a=n===void 0?"currentColor":n,r=uh(e,EOn);return(0,z.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),(0,z.createElement)("path",{d:"M7.07095 0.650238C6.67391 0.650238 6.32977 0.925096 6.24198 1.31231L6.0039 2.36247C5.6249 2.47269 5.26335 2.62363 4.92436 2.81013L4.01335 2.23585C3.67748 2.02413 3.23978 2.07312 2.95903 2.35386L2.35294 2.95996C2.0722 3.2407 2.0232 3.6784 2.23493 4.01427L2.80942 4.92561C2.62307 5.2645 2.47227 5.62594 2.36216 6.00481L1.31209 6.24287C0.924883 6.33065 0.650024 6.6748 0.650024 7.07183V7.92897C0.650024 8.32601 0.924883 8.67015 1.31209 8.75794L2.36228 8.99603C2.47246 9.375 2.62335 9.73652 2.80979 10.0755L2.2354 10.9867C2.02367 11.3225 2.07267 11.7602 2.35341 12.041L2.95951 12.6471C3.24025 12.9278 3.67795 12.9768 4.01382 12.7651L4.92506 12.1907C5.26384 12.377 5.62516 12.5278 6.0039 12.6379L6.24198 13.6881C6.32977 14.0753 6.67391 14.3502 7.07095 14.3502H7.92809C8.32512 14.3502 8.66927 14.0753 8.75705 13.6881L8.99505 12.6383C9.37411 12.5282 9.73573 12.3773 10.0748 12.1909L10.986 12.7653C11.3218 12.977 11.7595 12.928 12.0403 12.6473L12.6464 12.0412C12.9271 11.7604 12.9761 11.3227 12.7644 10.9869L12.1902 10.076C12.3768 9.73688 12.5278 9.37515 12.638 8.99596L13.6879 8.75794C14.0751 8.67015 14.35 8.32601 14.35 7.92897V7.07183C14.35 6.6748 14.0751 6.33065 13.6879 6.24287L12.6381 6.00488C12.528 5.62578 12.3771 5.26414 12.1906 4.92507L12.7648 4.01407C12.9766 3.6782 12.9276 3.2405 12.6468 2.95975L12.0407 2.35366C11.76 2.07292 11.3223 2.02392 10.9864 2.23565L10.0755 2.80989C9.73622 2.62328 9.37437 2.47229 8.99505 2.36209L8.75705 1.31231C8.66927 0.925096 8.32512 0.650238 7.92809 0.650238H7.07095ZM4.92053 3.81251C5.44724 3.44339 6.05665 3.18424 6.71543 3.06839L7.07095 1.50024H7.92809L8.28355 3.06816C8.94267 3.18387 9.5524 3.44302 10.0794 3.81224L11.4397 2.9547L12.0458 3.56079L11.1882 4.92117C11.5573 5.44798 11.8164 6.0575 11.9321 6.71638L13.5 7.07183V7.92897L11.932 8.28444C11.8162 8.94342 11.557 9.55301 11.1878 10.0798L12.0453 11.4402L11.4392 12.0462L10.0787 11.1886C9.55192 11.5576 8.94241 11.8166 8.28355 11.9323L7.92809 13.5002H7.07095L6.71543 11.932C6.0569 11.8162 5.44772 11.5572 4.92116 11.1883L3.56055 12.046L2.95445 11.4399L3.81213 10.0794C3.4431 9.55266 3.18403 8.94326 3.06825 8.2845L1.50002 7.92897V7.07183L3.06818 6.71632C3.18388 6.05765 3.44283 5.44833 3.81171 4.92165L2.95398 3.561L3.56008 2.95491L4.92053 3.81251ZM9.02496 7.50008C9.02496 8.34226 8.34223 9.02499 7.50005 9.02499C6.65786 9.02499 5.97513 8.34226 5.97513 7.50008C5.97513 6.65789 6.65786 5.97516 7.50005 5.97516C8.34223 5.97516 9.02496 6.65789 9.02496 7.50008ZM9.92496 7.50008C9.92496 8.83932 8.83929 9.92499 7.50005 9.92499C6.1608 9.92499 5.07513 8.83932 5.07513 7.50008C5.07513 6.16084 6.1608 5.07516 7.50005 5.07516C8.83929 5.07516 9.92496 6.16084 9.92496 7.50008Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))}),IOn=["color"],AUe=(0,z.forwardRef)(function(e,t){var n=e.color,a=n===void 0?"currentColor":n,r=uh(e,IOn);return(0,z.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),(0,z.createElement)("path",{d:"M10 6.5C10 8.433 8.433 10 6.5 10C4.567 10 3 8.433 3 6.5C3 4.567 4.567 3 6.5 3C8.433 3 10 4.567 10 6.5ZM9.30884 10.0159C8.53901 10.6318 7.56251 11 6.5 11C4.01472 11 2 8.98528 2 6.5C2 4.01472 4.01472 2 6.5 2C8.98528 2 11 4.01472 11 6.5C11 7.56251 10.6318 8.53901 10.0159 9.30884L12.8536 12.1464C13.0488 12.3417 13.0488 12.6583 12.8536 12.8536C12.6583 13.0488 12.3417 13.0488 12.1464 12.8536L9.30884 10.0159Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))}),SOn=["color"],TOn=(0,z.forwardRef)(function(e,t){var n=e.color,a=n===void 0?"currentColor":n,r=uh(e,SOn);return(0,z.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),(0,z.createElement)("path",{d:"M2.89998 0.499976C2.89998 0.279062 2.72089 0.0999756 2.49998 0.0999756C2.27906 0.0999756 2.09998 0.279062 2.09998 0.499976V1.09998H1.49998C1.27906 1.09998 1.09998 1.27906 1.09998 1.49998C1.09998 1.72089 1.27906 1.89998 1.49998 1.89998H2.09998V2.49998C2.09998 2.72089 2.27906 2.89998 2.49998 2.89998C2.72089 2.89998 2.89998 2.72089 2.89998 2.49998V1.89998H3.49998C3.72089 1.89998 3.89998 1.72089 3.89998 1.49998C3.89998 1.27906 3.72089 1.09998 3.49998 1.09998H2.89998V0.499976ZM5.89998 3.49998C5.89998 3.27906 5.72089 3.09998 5.49998 3.09998C5.27906 3.09998 5.09998 3.27906 5.09998 3.49998V4.09998H4.49998C4.27906 4.09998 4.09998 4.27906 4.09998 4.49998C4.09998 4.72089 4.27906 4.89998 4.49998 4.89998H5.09998V5.49998C5.09998 5.72089 5.27906 5.89998 5.49998 5.89998C5.72089 5.89998 5.89998 5.72089 5.89998 5.49998V4.89998H6.49998C6.72089 4.89998 6.89998 4.72089 6.89998 4.49998C6.89998 4.27906 6.72089 4.09998 6.49998 4.09998H5.89998V3.49998ZM1.89998 6.49998C1.89998 6.27906 1.72089 6.09998 1.49998 6.09998C1.27906 6.09998 1.09998 6.27906 1.09998 6.49998V7.09998H0.499976C0.279062 7.09998 0.0999756 7.27906 0.0999756 7.49998C0.0999756 7.72089 0.279062 7.89998 0.499976 7.89998H1.09998V8.49998C1.09998 8.72089 1.27906 8.89997 1.49998 8.89997C1.72089 8.89997 1.89998 8.72089 1.89998 8.49998V7.89998H2.49998C2.72089 7.89998 2.89998 7.72089 2.89998 7.49998C2.89998 7.27906 2.72089 7.09998 2.49998 7.09998H1.89998V6.49998ZM8.54406 0.98184L8.24618 0.941586C8.03275 0.917676 7.90692 1.1655 8.02936 1.34194C8.17013 1.54479 8.29981 1.75592 8.41754 1.97445C8.91878 2.90485 9.20322 3.96932 9.20322 5.10022C9.20322 8.37201 6.82247 11.0878 3.69887 11.6097C3.45736 11.65 3.20988 11.6772 2.96008 11.6906C2.74563 11.702 2.62729 11.9535 2.77721 12.1072C2.84551 12.1773 2.91535 12.2458 2.98667 12.3128L3.05883 12.3795L3.31883 12.6045L3.50684 12.7532L3.62796 12.8433L3.81491 12.9742L3.99079 13.089C4.11175 13.1651 4.23536 13.2375 4.36157 13.3059L4.62496 13.4412L4.88553 13.5607L5.18837 13.6828L5.43169 13.7686C5.56564 13.8128 5.70149 13.8529 5.83857 13.8885C5.94262 13.9155 6.04767 13.9401 6.15405 13.9622C6.27993 13.9883 6.40713 14.0109 6.53544 14.0298L6.85241 14.0685L7.11934 14.0892C7.24637 14.0965 7.37436 14.1002 7.50322 14.1002C11.1483 14.1002 14.1032 11.1453 14.1032 7.50023C14.1032 7.25044 14.0893 7.00389 14.0623 6.76131L14.0255 6.48407C13.991 6.26083 13.9453 6.04129 13.8891 5.82642C13.8213 5.56709 13.7382 5.31398 13.6409 5.06881L13.5279 4.80132L13.4507 4.63542L13.3766 4.48666C13.2178 4.17773 13.0353 3.88295 12.8312 3.60423L12.6782 3.40352L12.4793 3.16432L12.3157 2.98361L12.1961 2.85951L12.0355 2.70246L11.8134 2.50184L11.4925 2.24191L11.2483 2.06498L10.9562 1.87446L10.6346 1.68894L10.3073 1.52378L10.1938 1.47176L9.95488 1.3706L9.67791 1.2669L9.42566 1.1846L9.10075 1.09489L8.83599 1.03486L8.54406 0.98184ZM10.4032 5.30023C10.4032 4.27588 10.2002 3.29829 9.83244 2.40604C11.7623 3.28995 13.1032 5.23862 13.1032 7.50023C13.1032 10.593 10.596 13.1002 7.50322 13.1002C6.63646 13.1002 5.81597 12.9036 5.08355 12.5522C6.5419 12.0941 7.81081 11.2082 8.74322 10.0416C8.87963 10.2284 9.10028 10.3497 9.34928 10.3497C9.76349 10.3497 10.0993 10.0139 10.0993 9.59971C10.0993 9.24256 9.84965 8.94373 9.51535 8.86816C9.57741 8.75165 9.63653 8.63334 9.6926 8.51332C9.88358 8.63163 10.1088 8.69993 10.35 8.69993C11.0403 8.69993 11.6 8.14028 11.6 7.44993C11.6 6.75976 11.0406 6.20024 10.3505 6.19993C10.3853 5.90487 10.4032 5.60464 10.4032 5.30023Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))}),DOn=["color"],NOn=(0,z.forwardRef)(function(e,t){var n=e.color,a=n===void 0?"currentColor":n,r=uh(e,DOn);return(0,z.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),(0,z.createElement)("path",{d:"M11.8536 1.14645C11.6583 0.951184 11.3417 0.951184 11.1465 1.14645L3.71455 8.57836C3.62459 8.66832 3.55263 8.77461 3.50251 8.89155L2.04044 12.303C1.9599 12.491 2.00189 12.709 2.14646 12.8536C2.29103 12.9981 2.50905 13.0401 2.69697 12.9596L6.10847 11.4975C6.2254 11.4474 6.3317 11.3754 6.42166 11.2855L13.8536 3.85355C14.0488 3.65829 14.0488 3.34171 13.8536 3.14645L11.8536 1.14645ZM4.42166 9.28547L11.5 2.20711L12.7929 3.5L5.71455 10.5784L4.21924 11.2192L3.78081 10.7808L4.42166 9.28547Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))}),LOn=["color"],w8=(0,z.forwardRef)(function(e,t){var n=e.color,a=n===void 0?"currentColor":n,r=uh(e,LOn);return(0,z.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),(0,z.createElement)("path",{d:"M8 2.75C8 2.47386 7.77614 2.25 7.5 2.25C7.22386 2.25 7 2.47386 7 2.75V7H2.75C2.47386 7 2.25 7.22386 2.25 7.5C2.25 7.77614 2.47386 8 2.75 8H7V12.25C7 12.5261 7.22386 12.75 7.5 12.75C7.77614 12.75 8 12.5261 8 12.25V8H12.25C12.5261 8 12.75 7.77614 12.75 7.5C12.75 7.22386 12.5261 7 12.25 7H8V2.75Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))}),ROn=["color"],jc=(0,z.forwardRef)(function(e,t){var n=e.color,a=n===void 0?"currentColor":n,r=uh(e,ROn);return(0,z.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),(0,z.createElement)("path",{d:"M1.84998 7.49998C1.84998 4.66458 4.05979 1.84998 7.49998 1.84998C10.2783 1.84998 11.6515 3.9064 12.2367 5H10.5C10.2239 5 10 5.22386 10 5.5C10 5.77614 10.2239 6 10.5 6H13.5C13.7761 6 14 5.77614 14 5.5V2.5C14 2.22386 13.7761 2 13.5 2C13.2239 2 13 2.22386 13 2.5V4.31318C12.2955 3.07126 10.6659 0.849976 7.49998 0.849976C3.43716 0.849976 0.849976 4.18537 0.849976 7.49998C0.849976 10.8146 3.43716 14.15 7.49998 14.15C9.44382 14.15 11.0622 13.3808 12.2145 12.2084C12.8315 11.5806 13.3133 10.839 13.6418 10.0407C13.7469 9.78536 13.6251 9.49315 13.3698 9.38806C13.1144 9.28296 12.8222 9.40478 12.7171 9.66014C12.4363 10.3425 12.0251 10.9745 11.5013 11.5074C10.5295 12.4963 9.16504 13.15 7.49998 13.15C4.05979 13.15 1.84998 10.3354 1.84998 7.49998Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))}),QOn=["color"],FOn=(0,z.forwardRef)(function(e,t){var n=e.color,a=n===void 0?"currentColor":n,r=uh(e,QOn);return(0,z.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),(0,z.createElement)("path",{d:"M7.5 0C7.77614 0 8 0.223858 8 0.5V2.5C8 2.77614 7.77614 3 7.5 3C7.22386 3 7 2.77614 7 2.5V0.5C7 0.223858 7.22386 0 7.5 0ZM2.1967 2.1967C2.39196 2.00144 2.70854 2.00144 2.90381 2.1967L4.31802 3.61091C4.51328 3.80617 4.51328 4.12276 4.31802 4.31802C4.12276 4.51328 3.80617 4.51328 3.61091 4.31802L2.1967 2.90381C2.00144 2.70854 2.00144 2.39196 2.1967 2.1967ZM0.5 7C0.223858 7 0 7.22386 0 7.5C0 7.77614 0.223858 8 0.5 8H2.5C2.77614 8 3 7.77614 3 7.5C3 7.22386 2.77614 7 2.5 7H0.5ZM2.1967 12.8033C2.00144 12.608 2.00144 12.2915 2.1967 12.0962L3.61091 10.682C3.80617 10.4867 4.12276 10.4867 4.31802 10.682C4.51328 10.8772 4.51328 11.1938 4.31802 11.3891L2.90381 12.8033C2.70854 12.9986 2.39196 12.9986 2.1967 12.8033ZM12.5 7C12.2239 7 12 7.22386 12 7.5C12 7.77614 12.2239 8 12.5 8H14.5C14.7761 8 15 7.77614 15 7.5C15 7.22386 14.7761 7 14.5 7H12.5ZM10.682 4.31802C10.4867 4.12276 10.4867 3.80617 10.682 3.61091L12.0962 2.1967C12.2915 2.00144 12.608 2.00144 12.8033 2.1967C12.9986 2.39196 12.9986 2.70854 12.8033 2.90381L11.3891 4.31802C11.1938 4.51328 10.8772 4.51328 10.682 4.31802ZM8 12.5C8 12.2239 7.77614 12 7.5 12C7.22386 12 7 12.2239 7 12.5V14.5C7 14.7761 7.22386 15 7.5 15C7.77614 15 8 14.7761 8 14.5V12.5ZM10.682 10.682C10.8772 10.4867 11.1938 10.4867 11.3891 10.682L12.8033 12.0962C12.9986 12.2915 12.9986 12.608 12.8033 12.8033C12.608 12.9986 12.2915 12.9986 12.0962 12.8033L10.682 11.3891C10.4867 11.1938 10.4867 10.8772 10.682 10.682ZM5.5 7.5C5.5 6.39543 6.39543 5.5 7.5 5.5C8.60457 5.5 9.5 6.39543 9.5 7.5C9.5 8.60457 8.60457 9.5 7.5 9.5C6.39543 9.5 5.5 8.60457 5.5 7.5ZM7.5 4.5C5.84315 4.5 4.5 5.84315 4.5 7.5C4.5 9.15685 5.84315 10.5 7.5 10.5C9.15685 10.5 10.5 9.15685 10.5 7.5C10.5 5.84315 9.15685 4.5 7.5 4.5Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))}),MOn=["color"],Ojt=(0,z.forwardRef)(function(e,t){var n=e.color,a=n===void 0?"currentColor":n,r=uh(e,MOn);return(0,z.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),(0,z.createElement)("path",{d:"M5.5 1C5.22386 1 5 1.22386 5 1.5C5 1.77614 5.22386 2 5.5 2H9.5C9.77614 2 10 1.77614 10 1.5C10 1.22386 9.77614 1 9.5 1H5.5ZM3 3.5C3 3.22386 3.22386 3 3.5 3H5H10H11.5C11.7761 3 12 3.22386 12 3.5C12 3.77614 11.7761 4 11.5 4H11V12C11 12.5523 10.5523 13 10 13H5C4.44772 13 4 12.5523 4 12V4L3.5 4C3.22386 4 3 3.77614 3 3.5ZM5 4H10V12H5V4Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))}),OOn={antfly:{id:"antfly",name:"Antfly",description:"Data and vector search",defaultRoute:"/"},inference:{id:"inference",name:"Antfly Inference",description:"Model runtimes and playgrounds",defaultRoute:"/inference/models"}},POn=()=>["antfly","inference"],Pjt=POn(),Fl=e=>Pjt.includes(e),jOn=Pjt[0],$On=()=>OOn[jOn].defaultRoute,zOn=[{id:"nav-tables",type:"navigation",group:"navigation",label:"Tables",description:"View and manage database tables",href:"/",icon:"Table",product:"antfly",semantic:!0},{id:"nav-create-table",type:"navigation",group:"navigation",label:"Create Table",description:"Create a new database table with indexes",href:"/create",icon:"Plus",product:"antfly",semantic:!0},{id:"nav-search",type:"navigation",group:"navigation",label:"Search",description:"Search documents in the selected table",href:"/retrieval/search",icon:"Search",product:"antfly",semantic:!1},{id:"nav-ask",type:"navigation",group:"navigation",label:"Ask Questions",description:"Ask questions over selected table data",href:"/retrieval/ask",icon:"Bot",product:"antfly",semantic:!0},{id:"nav-evaluate-retrieval",type:"navigation",group:"navigation",label:"Evaluate Retrieval",description:"Run retrieval evaluations and benchmarks",href:"/retrieval/evaluate",icon:"ClipboardCheck",product:"antfly",semantic:!0},{id:"nav-upload-data",type:"navigation",group:"navigation",label:"Upload Data",description:"Bulk upload documents into the selected table",href:"/ingest/upload",icon:"Upload",product:"antfly",semantic:!1},{id:"nav-models",type:"navigation",group:"navigation",label:"Models",description:"View model runtime status and tools",href:"/inference/models",icon:"Library",product:"inference",semantic:!0},{id:"nav-cluster",type:"navigation",group:"navigation",label:"Cluster",description:"Monitor data node health and placement",href:"/cluster",icon:"Network",product:"antfly",semantic:!1},{id:"nav-connections",type:"navigation",group:"navigation",label:"Connections",description:"Manage connected providers and stores",href:"/connections",icon:"Plug",product:"antfly",semantic:!1},{id:"nav-users",type:"navigation",group:"navigation",label:"Users",description:"Manage users and permissions",href:"/users",icon:"Users",product:"antfly",adminOnly:!0,semantic:!0},{id:"nav-secrets",type:"navigation",group:"navigation",label:"Secrets",description:"Manage backend secrets",href:"/secrets",icon:"KeyRound",product:"antfly",adminOnly:!0,semantic:!1},{id:"tool-graph-retrieval",type:"navigation",group:"tools",label:"Graph Retrieval",description:"Explore graph relationships for the selected table",href:"/retrieval/graph",icon:"Network",product:"antfly",semantic:!0},{id:"tool-chunk-text",type:"navigation",group:"tools",label:"Chunk Text",description:"Split text into chunks for retrieval workflows",href:"/inference/playground/chunk",icon:"Scissors",product:"inference",semantic:!0},{id:"tool-extract-structured-data",type:"navigation",group:"tools",label:"Extract Structured Data",description:"Named entity recognition and extraction",href:"/inference/playground/extract",icon:"Tag",product:"inference",semantic:!0},{id:"tool-rewrite-text",type:"navigation",group:"tools",label:"Rewrite Text",description:"Rewrite text with a model",href:"/inference/playground/rewrite",icon:"Repeat2",product:"inference",semantic:!0},{id:"tool-rerank-text",type:"navigation",group:"tools",label:"Rerank Text",description:"Rerank documents against a query",href:"/inference/playground/rerank",icon:"ArrowUpDown",product:"inference",semantic:!1},{id:"tool-embed-text",type:"navigation",group:"tools",label:"Embed Text",description:"Generate embeddings for text",href:"/inference/playground/embed",icon:"Waypoints",product:"inference",semantic:!1},{id:"tool-read-image",type:"navigation",group:"tools",label:"Read Image",description:"Extract text and structure from images",href:"/inference/playground/read",icon:"ScanLine",product:"inference",semantic:!1},{id:"tool-transcribe-audio",type:"navigation",group:"tools",label:"Transcribe Audio",description:"Transcribe audio into text",href:"/inference/playground/transcribe",icon:"Mic",product:"inference",semantic:!1},{id:"tool-manual-entry",type:"navigation",group:"tools",label:"Manual Entry",description:"Create documents from table schema",href:"/ingest/manual",icon:"FileInput",product:"antfly",semantic:!1},{id:"tool-artifacts",type:"navigation",group:"tools",label:"Artifacts",description:"Inspect document artifacts for the selected table",href:"/ingest/artifacts",icon:"FileStack",product:"antfly",semantic:!1},{id:"tool-reprocess",type:"navigation",group:"tools",label:"Reprocess",description:"Re-run document processing for the selected table",href:"/ingest/reprocess",icon:"RotateCw",product:"antfly",semantic:!1},{id:"action-toggle-theme",type:"action",group:"quickActions",label:"Toggle Theme",description:"Switch between light and dark mode",action:"toggle-theme",icon:"Moon",semantic:!0}],qOn="all-MiniLM-L6-v2",GOn="src/data/command-definitions.json",UOn=[{id:"nav-tables",type:"navigation",group:"navigation",label:"Tables",description:"View and manage database tables",href:"/",icon:"Table",product:"antfly",embedding:[.04798413,-.09767596,-.09205667,.06074907,-.02216648,.0143975895,.060993895,-.007881843,-.03718108,.04725993,.044393837,-.02145551,.055825237,.016412305,-.1097362,.053677753,-.026820347,-.035629325,.053253874,.13520288,-.056259766,.035397463,-.019970283,-.005525711,.012188043,.025313506,.0044299876,.015903115,-.11300302,-.06294237,-.048289556,.02032026,-.021233642,.08205605,-.018484248,-.07621126,.052557297,.037512094,-.0026957334,-.061225,-.053974487,-.015257638,-.030298343,.050424792,.015424348,.021584231,.013411382,-.088442065,-.04775085,.048433833,-.07097498,.05316684,-.02258835,-.05186592,-.005875181,.08683051,.015843585,.009383274,-.045008224,.071186535,-.021709273,.022746563,.0011699232,.06796884,-.12195693,.045490604,.0020913174,.033375476,.052189615,-.018148815,-.046635106,-.0047813826,-.058834925,-.11632478,-.07555343,-.04931288,.023306906,-.078203835,-.059530344,-.056674536,-.025427816,.021474715,.0068790023,.0074289157,.012833672,-.005578031,.026608035,-.093430035,.0050230897,-.004102263,.016040927,-.0025775733,.015749628,.023973558,-.13613527,-.035235457,.045329176,-.017763088,.040684752,.09076223,-.019821828,.022703333,-.031654812,.0242581,-.076227136,-.06700368,.06343901,-8782293e-11,-.017676568,.03234787,.019363599,.057571303,-.076527335,-.072366245,-.046312526,-.017693002,-.12621525,-.047375843,-.014583651,-.0027019742,-.025627516,.07201621,.032914944,.067596786,.015893308,.0054699564,-.071770765,-18551187e-40,.005841759,-.0051702685,-.00678261,-.023500977,.08050452,.055491716,.02798213,.07045723,.019789774,.053751778,.029754099,.049858153,-.02907395,-.026038859,.03676067,.081482284,-.08332754,.1494862,-.046100333,-.037099987,-.02867287,.037529517,-.0005620838,.078831665,.029660935,.039437518,.011897445,.073544085,-.025820756,.045871757,.10514303,-.05268223,-.038443822,-.08370527,.0028961103,.025399024,-.011869463,.0015772651,.07541631,.010763953,-.058212746,.043781143,-.09404158,-.07383866,-.037583385,.03778816,.06746889,.066103496,-.02058319,-.058670532,-.0072254227,-.05785029,-.0058971816,.06843437,.056816224,.039254818,-.08578834,.013171052,.12833078,.06333027,-.041336633,-.012698598,-.055701315,-.030668605,-.05775792,.083345056,-.012418296,-.016420584,.06632225,-.051405936,-.041596536,.015068011,.08476861,-.033480544,.05439986,-.04191255,.00016595605,-.067108646,-.027018022,.02486021,.07020104,.038027626,-.004016755,.018169217,.019323673,-.011306114,.01226652,-.07194892,.0046337503,.05409139,-.0149864685,-.052709702,-.014318467,-.05505509,-.008637414,-22125193e-42,.06553773,-.029324967,-.050092097,-.09135121,.034876168,-.023605982,-.03224997,.011382306,-.032544326,-.09826092,.006926248,-.030190118,-.0039796405,-.017614812,-.031653643,-.027792186,.08529685,-.065962054,-.1005197,.049479175,-.0028945112,.076256536,.0059575224,-.016752811,.0099703325,.04036499,-.061800662,.006010281,.024577163,.050228678,.002468701,-.022060448,.02380138,-.064586796,-.055683367,-.018452615,-.06166529,-.0129667455,.020352378,.04395067,-.043820713,.049357463,.04888069,-.006880367,-.031008372,.036192007,.006989706,.06250598,-.05886299,-.044861335,-.09662053,-.11393659,-.037469205,-.0855714,.03605457,-.0015281019,.03347331,.00089741545,-.0061756363,.0035416272,.052916866,.035096478,.008130984,.010866829,-.03672128,.02922621,.0046809926,.05147098,.06042938,-.03761208,-.08348632,-.042414505,.0027049414,.010109651,.05692957,.0059467065,-.09751078,-2050958e-12,.040633094,-.052880116,.033945344,-.01048485,.063283816,-.047335368,.060747538,-.027019033,-.039167996,-.04426874,-.012721398,-.014765103,-.11210092,-.066779695,-.015423705,.071828224,.07630337,-14340129e-15,.0013271808,.020265907,.115604736,-.0617747,.03999135,-.046182055,.049088214,.16755044,.015798658,-.052865427,.097180076,.031726774,-.06256355,.07231981,.020937806,.019495165,.04570219,.001796927,-.051732942,.08703792,-.027971908,.045875046,.016802547,-.00075923954,.080032274,.025942562,-.061714612,-.009344901,-.019225268,.05865566,.038566355,.019930892,.020021874,.04788337,.07538397,.020361591,-.010846411,.018382246,-.035531893,-.006672803,-.013069598,-.04603584,.0622086,.0642453,-.0009862555,.062967576,.046321083,-.011088369,.0070666927,-.05473264,-.06098498,-.0059797317,.006771861,.05251469,-.018405598,.114042744,.0725228,-.04046683,-.03240691,.0055399016,.02820444,-.010921183,-.06482953,-.0074974135]},{id:"nav-create-table",type:"navigation",group:"navigation",label:"Create Table",description:"Create a new database table with indexes",href:"/create",icon:"Plus",product:"antfly",embedding:[.09775662,-.06607429,-.0842546,.07709747,-.07086156,.04046908,.06613308,-.0061556506,-.031397965,.034340825,.040871497,-.06279888,.07356159,-.029884275,-.1276452,-.007420329,-.054558665,.07422514,.009087489,.0869107,.017405853,.0053092064,-.035676554,.002552261,-.03231025,-.013425839,.04658858,.055041052,-.013445128,-.01590601,-.10119094,.04926093,.0059924116,.05199202,-.0237869,-.06734755,.060805906,.0411825,.007861949,-.045262862,.002160884,-.005417641,.015859215,.078204684,.019797513,.008248569,-.03127459,-.007563612,.03787274,.04325766,-.083587915,.05356681,-.026052903,-.016427273,-.014496405,.04555278,-.07646462,981584e-9,-.043560285,.010654269,.058938038,.081268124,.059351683,-.009374099,-.015177634,-.05289373,-.023615742,-.009535209,.036020104,-.01328201,-.016250648,.10597985,-.14174496,.021706486,-.04595427,.029959159,-.037222676,.005368756,-.037120286,.043067757,-.056341905,.019714253,.047341052,-.09053429,-.02963532,-.09137256,.01657245,-.053777784,.0005346694,-.024575228,.0005228333,.017763756,.009726807,-.0057468987,-.009612805,.019542575,-.0069875005,.04067223,.06296823,.05950062,-.097515285,-.048514623,-.14055364,.08912508,-.12459975,-.06839596,.009113707,-.038664762,-.012988115,-.00057892274,-.02600065,.05607174,-.009170791,-.10574449,-.035740737,.05778603,-.13485408,.0019893784,.031297445,.034045015,.016574072,.03159001,-.023717614,.0036946519,-.06723299,.037591014,-.019786684,-9530561e-40,.019346608,.013092455,.05287244,.0028486694,-.021743782,.00066852494,.035803165,.076988794,-.03568838,.0053549996,-.050390992,-.014128424,-.016563097,-.017318109,.036006738,.020872219,-.006044769,.12101763,.06933874,-.09430383,.019582853,.022539359,.06503068,.062730156,.0107801985,.03268308,-.06431764,-.05351381,.0074547734,.015082704,.07752218,-.009130713,-.04571126,-.069339804,.04603409,.07367914,-.0014546413,.08868187,.079495765,.05013162,.06768109,-.0058667255,-.06318838,-.02379037,.02659092,.04302832,-.005865034,.010835759,-.005203683,-.028006678,-.029300986,-.076445386,-.027030211,.09591926,.0047218637,.031305157,.001332358,.008577549,.074531324,.008728773,-.053135674,-.007982406,-.041528203,.10558231,.013633344,.04155022,-.009227085,-.0049728556,.08111639,-.06734304,-.00748483,-.033289853,.019307414,.0045186155,-.018082924,-.044755366,-.045296542,-.05166611,-.075810224,-.0602587,.018912222,.03580315,-.086816564,-.10067488,.046425276,.01295746,-.046837676,-.02441872,.0043862513,-.05911397,-.00024435006,.006194051,-.025749717,-.103196815,.039249472,-20556718e-40,.01191839,-.04722886,-.021338291,.0108655,-.0024469143,-.054777086,.051971406,-.07800724,-.109146595,.04272055,.011329639,-.07915422,.0047565005,.017075136,-.056750428,.03519391,-.027558105,.031700686,-.022616407,.056821324,-.05252805,.05789111,-.04051875,.053158965,-.025395809,-.036161806,-.011253376,.025368184,-.01467244,.037227504,-.015562404,-.0479247,.023732333,.004856158,-.0068601416,-.021130838,.026660228,-.15911096,-.012463947,.05541158,-.027159864,.047563687,.070225164,.04017723,.029525714,-.065165624,-.02936147,-.01703588,-.0017278393,-.053326994,-.032731805,-.054305706,.022564558,-.057783775,.030456804,-.041464277,.007946846,.04390241,.05035254,.020460943,.059733916,.101231426,.022615664,.07176571,.08230189,-.03229786,-.0069521563,.028288614,-.061083283,-.017699806,-.11711021,-.005440546,.054927286,.06344516,.017339349,-.02654445,-.06758298,.024365706,-.052531887,-.030483913,-.036138833,.010803214,.045932017,-.102020614,-.028174244,-.008768632,.022557456,.06808293,-.054121595,.075130105,-.07827385,-.038174566,.05717021,-.03926178,.04385577,-21405743e-15,.029242018,.021741029,.036851138,.0497896,.055885732,-.10151074,-.043275867,.12859917,.0040161903,-.11316928,.0418363,-.014124073,-.0060549863,.1030574,.011226346,-.061281487,-.013947941,-.048078828,.012319991,.07740803,-.043546587,.09739608,.027119972,-.041792125,.13235243,-.018398589,-.026913313,-.02863934,-.012833216,.051101573,.050499942,-.0007306244,.034924608,.04115472,.07655034,.018178964,-.045151293,.022584395,-.07194681,-.10777543,.0030270773,.045265533,-.00092586403,-.024859767,.0073379516,-.02925298,-.057805445,.0069543337,.06076885,-.034572784,-.050912913,-.0116495015,.007245779,-.02419302,.024669126,.077224776,.03154798,.077753134,.07513028,-.013260546,.056651786,-.062031876,-.02220974,-.0130997235]},{id:"nav-ask",type:"navigation",group:"navigation",label:"Ask Questions",description:"Ask questions over selected table data",href:"/retrieval/ask",icon:"Bot",product:"antfly",embedding:[-.08185645,-.024673104,-.02928956,.009039619,.014073962,-.03198563,-.019658372,-.007545316,-.07873625,-.070511855,.035428032,-.117347546,.038478177,-.018653277,.032498304,.0485005,-.04395591,.07013979,-.0059850365,-.12582327,-.03934303,.068208784,-.007209542,-.010492978,-.025999956,-.006424191,-.06205598,-.025322635,.060887236,.0018801646,.043885432,.07775881,-.04199671,.022855079,.047775585,.057888668,-.0067735235,.031117236,.04117516,-.034210213,-.03921489,-.003671161,.07237012,-.052469503,.042583667,-.06509841,-.09843184,-.050335065,-.073531486,.0013814595,-.03601989,-.027231349,-.04664069,-.039079145,-.020881321,.04205191,.06997209,-.0018418862,-.013749526,-.02245389,-.03118555,-.13363265,-.060617607,-.030950135,.011503954,.0038412588,.041881364,.017695358,.055906035,.034073234,-.076403596,-.0014854581,-.023520848,.016612962,.03118033,.18422776,.026186254,-.03881924,.045997076,-.051792894,-.031037295,-.07785502,.018438347,.012505201,.005142435,.10315952,.048908286,-.010359676,.05975273,.08146795,-.05849171,-.10361059,.038014546,.0788306,-.042704865,-.0033064452,.06435949,-.10376214,.046753757,.07869342,.0021549494,.080341905,.098307244,-.07016228,-.040851027,-.009057079,-.0011085789,-.01997148,.010492798,-.06764994,-.010547891,-.06397153,.084513955,-.026893111,.028377471,-.012445896,-.017268032,-.061220013,-.04052641,-.005411601,.04159245,.027818836,.0064500645,.07277422,.028703306,.05226504,-.022522591,-144154105e-41,.0038807408,-.042311825,.042373758,.071269535,.052738942,.0045437673,.06963428,.07712019,-.07541053,-.041010577,-.021753168,.102243125,-.062313948,.042389702,.05482281,-.0295146,-.021724934,.04555992,-.05589936,.058772456,.013104453,-.028411651,-.036275312,-.109896734,.059079867,-.016220804,.034240313,-.00040649038,-.025488913,.0204293,-.045546073,-.0034144495,-.024040103,.07573455,.042043135,.085296296,.044758435,-.0009904074,-.036596905,.05504352,.011223945,-.0058393264,.01262928,-.012801187,.008632115,-.09238737,-.059375584,.015217712,.011419615,-.03496602,.055070255,.08898554,-.042130712,-.0928345,.0402425,-.0022773903,-.035936646,.053582847,.07562286,.10877451,-.015192899,.04562389,-.030818686,.036882613,-.057657678,.010876364,.029388677,-.06431115,.13193421,.056261692,.02603953,-.022084178,-.081523195,.016140243,.08041399,-.04560941,-.00853022,.01201039,-.02973606,-.085045725,-.004744895,.014136117,-.0038935002,.021660687,.038065787,-.047669176,-.03355088,-.057567246,-.03246025,-.08026241,-.029815612,.04862934,-.06264178,-.0013850342,.065772206,3626694e-40,.04733948,.020494398,-.062037826,.060947996,.01577579,-.06705178,.09149575,-.10294753,-.041364856,.01803797,-.060573082,.010948715,.019534087,.0092934,-.02414456,-.04260174,-.045144305,-.1316474,.04931684,.0291758,.027193604,.056721535,-.040734198,.010686924,-.063762516,.027218841,-.03548828,-.03710125,.01722598,.016490145,.042378556,.03351661,.011125934,-.071427174,-.00056821195,-.06042021,.1324417,.030656224,-.010319074,.048796307,-.03060991,.0026984331,-.00990126,-.0017565251,-.021672785,.11252494,.054278143,.05872658,.0029004787,-.008243493,.01580487,.017739747,-.07073722,-.0075090053,-.044870436,-.034899384,.0229689,-.051008698,-.08156282,.044464562,.002099454,.012577958,.012395844,.0027134803,.037562925,-.028382005,-.032048132,-.0011949382,-.0542789,-.027995005,.040892687,-.011156935,.042026144,-.04980434,.048972674,-.034535896,-.035888076,.015803346,.10497271,-.062429145,-.07797483,.0028949645,.033639032,.09951564,-.047530986,-.00869079,.05812443,.09681698,.008230883,.017395481,.0073526218,.023537664,-.08915888,-.014574627,.045268383,-1597311e-14,-.0011962373,.0053221346,-.07025926,.04237906,.0026059146,.053626243,-.05039796,.072075546,.019480238,-.043000754,-.07448014,.020275315,-.060558617,.05184019,.033403937,-.004660246,.005868305,.041687634,-.064999215,.007817541,-.027873976,.09891558,.014843852,.030598562,-.0010975625,-.0009388215,.07202019,-.008007597,.11742751,-.020715255,.039558798,-.025753416,-.023023322,-.0851004,.08941071,.08549913,-.029450782,-.0075080562,.027024705,.014961894,-.0070276493,.014897279,-.019729115,-.044430744,-.028837549,-.069833666,-.047216315,-.052277688,-.023216609,-.06354255,-.10396373,-.08764621,-.009196706,.024101403,.06793575,.013109643,-.0035518543,-.08883818,-.01895276,.058320068,.08998508,.01365449,.03637689,-.0019327299]},{id:"nav-evaluate-retrieval",type:"navigation",group:"navigation",label:"Evaluate Retrieval",description:"Run retrieval evaluations and benchmarks",href:"/retrieval/evaluate",icon:"ClipboardCheck",product:"antfly",embedding:[-.09651942,.057518497,-.052242387,.011058676,-.06290196,-.10746886,-.01275608,.020828096,-.010797219,-.050691325,-.044597913,-.027846934,-.016457913,-.043114346,-.023753867,.031955663,.033046085,.089015566,-.016086023,-.058508243,-.06301047,-.0014124985,-.01688671,.004776267,.005714012,-.004961639,-.04541551,.021688951,.028499244,-.08238727,.0018107495,-.0041428027,-.03555897,.042686377,-.01285778,.069981,.018313404,-.005803817,-.04003145,.0021360312,-.004650737,.016961996,-.036229238,-.0008720532,-.011963227,-.039378148,-.021208199,-.036495328,-.010098202,-.058331333,-.027625889,.021964848,-.018949375,-.04444957,-.029585682,.02106423,.04164881,-.053205527,-.03480937,.006491516,-.037595585,-.011771512,-.053632796,.05184066,.044823583,.0041485545,.09210665,.00883911,.041918408,.03184432,-.09720243,.029416023,-.024287395,.11455016,-.027968682,.073782876,-.007889022,-.08031643,-.041646447,-.15151942,-.06496169,-.08762066,-.05520168,.017353855,.074508145,.11940219,-.0008679706,-.020333411,.06525595,.011758106,.066776104,.014334314,.0026444967,.0020029084,.055707633,.04260498,.030286018,.0137170935,-.03834528,.08524635,-.033070754,-.07815241,.027584884,-.015767792,-.029908404,-.031513516,.047065232,-.012870272,-.046178088,-.043550305,.0452755,.023531863,-.0027338818,-.052291464,.005707821,-.004308086,.00044716804,-.062287636,-.006247468,.05936186,.038074553,-.0058378973,-.0003797541,.07051743,.03582728,.024424892,.020623587,-65239395e-41,-.0109381005,-.0075738085,.016738683,.028481286,-.124895066,-.020498645,.024851874,-.0007449178,.0050806683,.030156633,-.011677153,.0299703,-.0057626036,-.018166952,.09255053,.030191056,.0233401,.047244977,-.02678018,.02204697,.031722862,.023433799,-.060463842,-.04972876,.00993745,.05236627,.03439672,-.009594691,-.039743803,.050347444,.04983671,-.066144645,-.056291927,.09822082,.02788957,.0785797,-.09003285,.053430382,.005568521,-.017756721,-.05664118,-.013070844,-.076133616,-.040948052,.043437462,-.074601896,-.07208742,.074249156,-.0062168874,.031479668,.10876306,.07940675,-.033792894,.06883603,.014129797,.021490645,.06521389,-.017887088,.03987235,.23870704,-.04554535,.06668164,-.12547368,.011388025,-.013524462,-.016638272,-.012454479,-.027917422,-.043664638,.035634976,.03114527,.009264398,.03298697,.10029238,.011562176,.0021988128,.008662661,-.0042986986,-.06488741,-.06566521,.0537167,.04779884,-.03566002,-.044986583,-.025784004,-.025143886,.01649869,-.080008894,-.03597556,-.012504667,-.033811003,-.040523432,-.0026605283,.0012407283,-.029938016,-21414355e-41,.08530196,-.080591954,.05455669,.16921236,-.020163173,-.01581513,-.03647018,-.010637186,-.026863739,.07716831,.0042079617,.009757425,-.048632037,.024843588,.057170816,.045808636,-.059645478,-.1000468,-.006590578,.042185966,.013167662,.13514464,.10159627,.029534532,-.05034715,-.024499167,-.032003537,-.029489841,-.032414306,-.0518118,.009723873,.023535216,.014751248,-.034266822,.0039338516,-.07210361,.09176738,.078537315,-.022542905,-.011275794,.045477726,.019504065,-.06611117,-.0230109,-.035641752,.03969775,-.1289,-.03103727,-.026638668,.0009338254,.023280846,-.008673933,.05505192,.027852293,-.010067433,-.018873595,-.02032152,-.005908394,-.033264108,.0887982,.0067189746,.00085454684,-.01506223,.022544447,.07065083,.001558097,-.022115624,-.04604021,-.10365735,.021671576,.002040107,-.023151346,-.0455398,-.0019754455,-.047254805,-.046919562,.0105747245,-.053060006,.018945193,.05200773,-.053467,-.038522623,.019380633,.015286589,-.059264414,.07032895,-.06536299,.014022951,.05793296,-.03453241,.008411256,.03576161,-.023483783,.007409687,-.0013375685,-16851837e-15,.015689213,-.0027583018,.037119105,.060591742,-.043523315,.05267364,-.10166136,.09638187,.036076326,.04291084,.07229452,-.021345926,-.02502096,.0030904342,.024405884,-.016559392,-.0041433657,.007555202,-.047573566,-.048606813,.018070329,.13013963,.032333646,.018572021,-.013928287,-.066164255,.07187352,.061658595,.024049327,.012196271,-.0036112885,.02155215,.0519001,-.06589515,.059853148,.07356148,-.01970098,.054588795,.025752762,.18357943,-.079393096,.06242892,-.01998753,-.012815924,.045988,-.068171255,-.09736674,-.035468042,.034207992,-.061617,-.0014263573,-.04808966,-.062573195,.030880377,-.020347212,.029677335,.009886396,-.07795913,-.0060316226,.06987837,.07803995,-.101404116,-.030615484,.08803481]},{id:"nav-models",type:"navigation",group:"navigation",label:"Models",description:"View model runtime status and tools",href:"/inference/models",icon:"Library",product:"inference",embedding:[-.027897777,-.20297444,-.007913871,-.019472929,.09838957,.114076875,-.009573349,-.0070227836,.0033012924,-.041624416,-.006780371,.009198457,.057730578,.020711632,-.02826201,.063431,.11392183,.0666503,-.054189783,-.04812075,-.039836112,.03138217,-.013043246,-.082804345,.01469739,.00924502,.027781105,.04113775,-.017678939,-.060648784,.03193947,-.021711037,.029643683,.02284661,.030527027,-.01823522,-.015309274,.02200207,.009644737,.048177425,-.05579356,.020666702,-.0012897344,-.0056978506,.07878453,-.05950252,.028228529,-.058482695,-.05282797,.052987356,-.04020751,-.038306136,-.02974153,-.0038877474,-.042350587,-.1323455,-.039859984,-.029485717,.01609853,-.0032589855,.0014003267,-.03811922,-.011176448,.082442895,-.1011017,.023509001,-.009837721,.10710163,-.012536956,.022177937,-.102375954,.023835612,-.11580926,-.05788367,-.056056395,.022996208,.11136511,-.08209338,.13527218,-.110753864,-.003758407,.009845471,-.024186926,-.08395238,.110177174,.022994332,-.010508074,.047345735,.008209763,-.025824029,.011526135,-.02611971,-.03884439,.006356755,.011923911,.00035190614,.02240644,-.04900862,-.0083363345,.06663713,-.047780912,.09973421,.057794042,-.09640263,-.013125245,-.0871357,.026564963,.0929485,.014645767,-.024679834,.005357373,9239518e-12,-.009388617,.05203057,.059428375,-.12727992,.07656191,-.065470435,.017015975,-.008031802,-.0303069,.027385928,-.007547635,.047834244,.051389568,-.029231872,-.052839745,-43406626e-41,-.026887288,-.0068854764,.03581807,.016082935,.08006485,.046131372,-.03515567,.0062437486,.0016350673,-.028356884,-.04684695,.04301572,-.009296924,.024174873,-.016936854,.061198603,-.034624565,.07129649,-.077097416,.01106394,.012917395,.019980628,-.037604783,-.016253237,-.066488765,.015999164,.10993156,-.038556255,-.07981672,.00848608,-.048977554,-.028702088,-.058676098,.011198464,.012982955,.039189853,.054921634,.0005334454,.0010312498,-.06148347,-.029630302,.023610912,.029078519,-.06432906,-.10314753,-.07150001,.01308164,-.0119512025,.008239445,-.089576386,.018686997,-.0139485765,-.03566556,-.083673306,.0186694,.019956606,-.07317539,.116459705,.08254595,.01995021,-.055930264,.013017461,.0645297,-.048880816,.018344807,.06564963,-.042489287,-.025723826,.009594762,.08299734,.04528911,.016201837,.010962138,-.077311546,-.023084493,-.016619375,-.06559755,-.060339227,.013650846,.11592584,-.023200667,-.059122078,-.019961176,.017579969,.017621538,-.0717247,.023878032,-.13119754,.013794246,-.014850127,-.104214154,-.042980373,-.039625768,-.01980918,.037092965,-2188871e-39,-.046290625,.05814976,.030614974,.059141137,-.026179545,.029965173,.0056801247,.07606953,-.03164284,-.020247692,-.0050143776,-.013776455,.054495346,.036158815,-.029076617,.017690783,-.016568042,-.0069822003,-.024230707,.015708512,.018806696,-.028539775,-.016534183,.005885336,.08190572,.11441235,-.024344813,.04647896,-.048285656,-.06622633,-.030120399,-.045724098,-.031304438,.011723097,-.08411402,.06646547,.061890807,.05997966,-.026966143,.010899889,.05332003,.024054592,-.03750307,-.018886285,-.013525334,-.032492265,.026597166,.05668058,.09560847,-.07008288,-.047564033,.019152466,-.08274753,.029678077,-.0351269,-.031447385,.019314539,-.077219464,.043254063,-.00960109,-.0022959711,-.075407274,-.016954536,.026327334,.042702295,-.02616745,-.03815581,.019725252,-.043100856,-.0041221497,.036737222,-.018467192,-.00034702147,.025852356,.02821097,-.033565465,.017083704,.049831264,.0015683565,-.064485766,.03833455,-.094663285,.08995338,.0027258054,.09416577,.004819953,-.0017712635,-.02252868,.028876549,-.032538243,-.07618237,.048329014,-.007757753,.117640674,-.00152082,-18699115e-15,-.046449117,.055735778,.1455003,.015383921,.0015425802,.016112842,-.021398718,.044715345,.017086204,.033089526,.018621458,-.019670773,-.006118222,.011084864,.026016429,.06834926,.02327429,.020332541,.027486434,.04761481,.028291706,.023375751,.03882345,.029499467,.05585814,-.048462138,-.11686359,.031211106,.018862506,-.016660487,-.059828505,.07556212,.0021433055,-.09205089,.039110124,.0090534575,.019155107,-.028433293,-.053930186,.012723522,-.051899277,-.04173303,-.09305687,-.033427812,.11873172,.03177194,.0526439,-.09171722,-.025202123,.059799932,.0024693543,-.009729383,.04184006,.008466905,.015217444,.09732599,.021968024,-.060509756,-.024499843,.03418391,.028733678,.019403884,-.030596867,-.0069948738]},{id:"nav-users",type:"navigation",group:"navigation",label:"Users",description:"Manage users and permissions",href:"/users",icon:"Users",product:"antfly",adminOnly:!0,embedding:[-.026552599,-.027311087,-.057434577,.06630369,-.014030616,-.0004711129,.13218543,-.04583475,-.024014153,.034141578,.021795873,.010970841,.005125187,.04821193,.021150542,.014691408,-.045982644,-.00021011385,-.026462544,-.0061897957,.0036216069,-.06826668,-.012363679,-.012001973,-.016570125,-.01298,-.061832678,.003909997,-.03303165,-.030949324,.040626977,-.019162042,.058753464,.008937941,-.06532294,-.039466564,.03430134,-.034754407,-.009404169,-.008060472,-.06062817,.031790722,-.01250962,.043880515,-.051701225,.085502505,.0371079,-.040971447,-.05295159,.04177177,.10707015,-.008800853,-.015872683,-.07831084,.01729909,.029147875,.097694755,-.059007138,-.024759786,-.079808176,-.07443898,.020704292,-.062427472,.020075278,-.023632705,.021377347,-.0011015794,.03404709,-.04690037,-.058652867,-.004353554,-.03329864,-.057812426,.016419953,.015817462,-.08045929,-.04814886,.018821558,-.016486961,-.06255746,.0007400751,.006501267,.037902646,.0269355,-.05616982,.086826116,.027074458,-.056182355,.055334646,.045979936,.10288768,.05398986,.04389189,-.031144444,-.06572874,-.060125124,.047374073,.040089216,-.053590033,.056140363,.01020087,-.015092023,-.040138435,-.033684235,-.004481888,.015337979,-.01197492,.064818725,-.0013717571,.05594664,-.019251317,.042998284,-.097035944,-.005933775,.043117516,-.034720562,-.05601751,-.024179898,.04024196,.027239574,.044188235,.037520014,.08816124,.06758985,.050973997,.055279594,-.07907776,-34875037e-40,-.023335053,.005885281,-.03398876,.09273936,.062178425,.044375896,-.07030183,-.009237776,-.075287506,-.02903159,.061340954,.11222717,-.004964791,-.08798016,.09182318,-.022918886,.01858482,.057072766,-.012066709,.03709445,-.03839857,.063433595,-.02601877,.11022192,-.0045043314,-.037686665,-.054056976,.03307286,.13286147,-.008662642,.05076843,-.021033684,-.018591227,.040424883,-.007741235,.052611977,-.009940035,.028246714,.006687769,-.029375343,-.061552357,-.024874303,-.04882266,-.03606931,-.10331387,-.072395585,.04656043,.020320022,.04666313,.11119975,-.030672837,-.011651212,-.011878633,-.026100747,.06200728,-.061613172,-.07406362,.038703572,-.010992924,-.0598031,.06353704,.08602608,-.010165403,.02314624,-.03258889,-.13952085,-.00719692,-.07500556,.039468057,.015259171,-.06928183,.015527642,.057423204,-.017043592,-.055610534,.009090402,-.00020630394,.051834386,-.10423138,.017771775,.043101676,-.04963203,.05281699,.0035750607,.052109223,-.006929335,.021169445,-.041839458,.01215583,.02287584,.0065059126,-.024232358,.045418218,.068378076,-.09308719,-74514024e-42,.018244281,-.04216903,-.0048777605,-.05665925,.016621232,.019707695,-.0058775516,-.05173865,-.05147665,-.07880227,-.022252336,-.031751968,.022359759,.058800865,-.020091226,-.019763106,.015968744,-.0509142,-.072463475,-.052074168,-.09879146,.0776055,.03816793,.07142098,-.016488973,.03167015,-.0802595,.024308845,-.010950464,-.008715109,.0329166,-.1356076,-.007624536,-.11295392,-.049601715,-.12777433,-.060653664,.14437966,-.015525066,.06112669,.01081324,.008749228,.044327576,-.027585935,-.0098973755,.046368994,.0053059002,-.0646603,-.05783722,.03192043,-.04346675,-.096747614,.079468355,-.081757575,-.027077727,-.03423537,.098892115,-.03839502,.110832684,-.035858087,.00036598495,.009801884,-.0070386734,.05434583,-.06325684,.015094809,.0008206752,.06366539,-.043399274,.016513249,.022080228,-.13423097,.0045239828,-.08749031,.0052159997,-.08475643,-.08858278,-.08505489,-.018475588,-.06876059,-.004767673,.03807114,.017341252,.014344289,-.062028043,-.029998908,.016335024,-.013134086,.017730787,-.00030456117,-.03671223,-.008882961,-.00087901717,.020685788,.018825224,-17843321e-15,.021327008,.023963079,.05022901,.008294422,.053031225,-.0028987366,.0028941107,.060937054,.104764014,.07408303,.03126725,.024362724,-.038033344,.026391407,.056392454,.011555486,-.07409382,.054696538,-.022934752,.051603854,-.029588545,-.009689524,-.0086016655,.0019834305,.010737624,.051202454,.007618081,-.01840879,-.056514017,.16168329,-.022036213,.006934529,.017244684,.0716604,.017871745,-.026446052,-.07376763,.017091744,-.0013896598,-.07315456,-.006011402,.033570495,.041269004,.102064684,-.01683012,-.04633856,.075674005,-.011114054,.0138549935,-.08057092,.018888203,.06596067,.04433762,.10206802,.039101917,.06711373,.058326133,.05709235,.0014182302,-.033379413,-.0055335034,.062244464,-.05408989,-.0045401086]},{id:"tool-graph-retrieval",type:"navigation",group:"tools",label:"Graph Retrieval",description:"Explore graph relationships for the selected table",href:"/retrieval/graph",icon:"Network",product:"antfly",embedding:[.053930108,-.013544671,-.044834528,.0062742783,.019840378,-.07216902,-.013344643,.033728275,-.019263534,.11352999,.034947094,-.04133747,.037447803,.123561695,.009322797,.13893369,-.027595084,.018367643,-.042997472,-.15850063,-.010047569,-.047436297,-.042394567,.0119181005,.016023837,.053068127,-.03351623,-.02888535,.07964562,-.048875876,-.043116827,-.029867385,.06281969,.03369071,-.055833522,.026123676,.050024357,.09864921,-.0058197514,-.009368598,-.04286734,.019110594,.025992615,.07691908,.0073423428,.06232982,-.09511844,.028391268,-.007830356,.03111746,-.09878692,-.07939332,-.042518087,-.09419533,.09105082,.038447686,-.020058755,-.059259,-.02655185,-.039527673,.034905966,-.05273598,-.06671853,.04907381,.017699096,.019187728,.014538029,.03887137,.025975246,.022746596,.01901834,.008199081,-.070722654,-.038617313,.03494448,.048520844,.006292828,.01824218,-.04600169,-.13358952,-.0016872741,.041781653,-.039838675,.10463148,.022557443,.0046159783,.00689033,-.019876853,.034498088,-.032941587,-.043869063,-.031316258,-.0050625484,-.0026343847,.06317051,.069321774,.061079193,-.12551646,-.024417745,.08228324,.0009328466,.019039765,.06763592,-.07636802,-.037819657,.014421464,-.05506441,.03337924,.020656558,-.023154154,-.06088442,.05973666,.0026170032,.0062680338,.018578548,-.03276006,-.030743422,-.017848575,-.004964267,.014493366,.014998901,.02503801,-.0106195565,.02692376,.027495481,.0044971327,-.041960075,-4697565e-40,.07965066,.06536006,.1005269,.044516675,.09575232,.051726647,-.03918935,-.0115767615,-.08112377,-.03972595,-.03987699,.07314627,-.0012158162,.076321036,.010650257,-.058244243,.0096386485,.06318165,-.082788944,-.0461642,-.020818334,-.042984165,.0094692055,.029042743,.044332612,.038821373,.0141993705,.006615749,.038995616,-.02050122,-.016678194,.025224095,-508021e-9,.03547204,-.028638162,.013117296,.0129358135,-.093760066,.04522195,-.05068883,.0051316465,.016732939,-.03247578,.031158112,.007869372,.0060431096,.029701855,-.031739242,.051941603,-.045169063,.011067914,-.004632264,.028941624,-.01861862,.08314986,.03697557,.06381405,.03553337,.045773156,.062272586,-.04890318,.010662453,.003907142,.031449273,-.033035,.044718266,-.09324775,.0036229459,.13077919,.0043401816,-.039916348,.06385889,.011376384,-.014911448,-.063315034,-.00052642566,-.12506421,-.07418722,-.019976778,-.01420993,-.09262536,-.14033443,-.071833655,-.059358645,.01899606,-.020045985,.046273783,-.01772496,.007986488,-.051624082,-.0465245,.015899522,.02715209,.02751665,.013255105,-3717102e-40,-.08662653,.0567811,-.0038017575,.099143304,.07564392,-.031911146,-.019066673,.00047033172,-.062339846,.036201958,.0028250325,-.09261502,-.07586186,-.0019946608,-.030037984,.033090446,.044822402,-.017689295,-.05707165,.049077153,-.030388786,.040197063,-.12777695,.050153095,.04698245,.052799135,-.018923199,-.05053371,-.041819967,.12330131,.0101273265,-.09464183,-.029662224,-.06948789,.016369006,.008115286,.12525216,-.082699746,.002893759,-.075715855,-.006082166,.0153377475,.025381198,-.08802829,.015453167,.07615285,-.07234668,.04785721,-.04829122,-.022513494,-.011849606,.0065243836,.03437112,-.06523269,.03246069,-.015561671,.03772817,.07052865,-.0359717,-.0052083135,-.020483447,-.09429367,-.019067992,.037993785,.013868259,.010158943,-.031756185,.058334444,-.050293718,-.016050966,-.018749617,.08370214,-.056954797,-.08779023,.06635765,-.010665188,-.02527477,.033502392,-.025756883,-.029889643,-.025233451,-.038538177,.11252917,.036533322,.0055180257,.038680594,.024985885,.07256783,.045559842,.034355804,-.09382253,-.040099505,-.102217644,.10350164,.023546796,-16713754e-15,-.08796482,-.03250155,.07967074,-.034165174,.058176316,.01638016,.044102814,.079629764,-.032100063,.04046386,-.0068844324,.021506868,-.08290044,.05315421,.07603181,.007386934,-.018582545,.028552555,.016738722,-.052390445,.037661184,-.030092329,-.059634108,.119195506,.04635169,-.050396774,-.026244368,.084334016,-.024935251,.025097119,-.0064789355,-.06299392,.063518204,-.00039318574,.0889826,.018655505,-.04718608,.013489543,-.014982913,.047455374,-.014070455,.034998573,-.023739194,.0063816514,.00545996,.04536625,-.024293158,-.00945152,-.06454721,-.006852639,-.07889211,-.015955342,.030004727,-.0434881,.042622272,.034136835,-.031946257,-.014369257,.028175658,-.0022930142,.008754428,-.021178871,.038103763,.06130162]},{id:"tool-chunk-text",type:"navigation",group:"tools",label:"Chunk Text",description:"Split text into chunks for retrieval workflows",href:"/inference/playground/chunk",icon:"Scissors",product:"inference",embedding:[-.06970131,.09474816,.057795558,-.011022197,.00977627,-.09604803,-.007939067,.02813458,-.05661131,-.0013969138,-.03101834,-.009047856,-.0039018027,-.021884287,.03760199,-.003222,.0068975263,.11954068,-.018323153,-.022230329,-.030869303,.0014648221,-.008496318,.00079959485,.039671402,.059614185,-.1031707,-.040378377,.081458814,-.040963758,.056086447,-.005579152,-.030085767,.0048133694,.030343408,.048076585,-.038407195,.010669538,.012079646,.046453,-.008091507,.015217909,-.0066704694,-.01644044,.063726515,-.013747901,-.038034588,.053012263,-.014450237,-.031234974,-.0676618,-.016091889,-.03210442,.03551687,-.029936695,-.049694795,.035693526,-.008048574,-.028403897,.04471145,-.08277617,.014360658,-.014010489,.00020881693,.0843394,.027614802,.06190402,.08205767,-.016455548,.083378896,-.06915622,.066485964,-.018328307,.07900093,.01924458,.09829041,-.012588297,-.05521032,.01548151,-.12694481,-.04923381,-.0452919,.05505525,-.026718436,-.015043646,.050226104,.031740468,.030055225,-.009899655,.026939869,.022869488,-.061938044,.047283936,.010849457,-.013574276,.0714798,.01686062,-.0012698716,.053758085,.09640307,-.03978909,.027915286,.12394094,-.030468365,-.032298483,-.06110389,-.006891309,-.05505122,-.0075840694,-.03551336,.049756333,.012291539,-.027210789,-.027622905,-.036401737,-.08314442,.08902699,-.065053806,-.044415653,.09016634,.046359584,.02456509,-.04684661,.041214485,.017441805,.059057474,.066599555,-9407164e-40,-.041620966,-.02698312,-.037187666,.087337576,-.045803864,-.0054407376,-.016197313,.037923872,-.019680558,.025463033,-.016026104,-.021569973,.012245288,.007425903,.033364363,-.005638061,-.04742986,.038308058,-.07116564,.037571266,-.06391347,-.039175734,-.0054768217,-.059561715,-.054772053,.012246766,.05064459,-.11019101,-.07736046,.0014278317,-.003588159,-.049641702,-.08089218,.043338206,.07404405,.02142215,-.060356796,-.029649384,-.092092454,.005567892,-.060214028,-.046270937,.017835151,-.009551438,.008215153,-.07760394,-.065905556,.04809494,.013552425,.040154934,.11841456,.11175449,-.0071413424,-.022648873,.017979732,.032139495,.0387793,-.04692546,.08788805,.12083606,.0033923422,.041020285,-.027503528,.11522321,-.015990283,.00902255,-.037055857,.012219382,.008981137,-.03775798,.06864536,-.0717733,-.02305202,.039474986,-.040607773,-.020646488,.0787798,-.007779794,-.05783247,-.13181606,.08613717,-.02178259,.039486043,-.1051426,-.11220573,-.009319543,.03861687,-.12615979,-.015543168,-.07161802,.0027797425,.024706786,-.02944178,-.06691482,.110648245,-25560328e-41,.081739485,-.041469816,-.0320515,.05956987,.0033091926,.028229805,.0042185155,.026138335,-.045503806,.05662812,-.06799236,.0076928353,-.061963785,-.0029812579,-.053202298,-.043686844,.03155388,-.024043838,.05718889,.07556725,-.005700307,-.03726342,.02555406,.06819992,-.011985264,-.002666642,.011007778,-.042104937,-.027871277,-.017750941,-.04229138,-836267e-9,-.0050167576,-.037631173,.017212482,-.09369308,.08380546,.06600954,-.008723541,-.012774674,.012342875,.03631463,-.080150485,.0044484828,-.054008484,.030370735,-.07209446,.066061474,-.0066132513,.031258844,.007716961,.009486776,.03174581,-.042594906,-.035088643,.009222486,-.008420501,-.06417533,-.09994568,.04870897,-.038908217,.09593725,-.046283986,.035240393,.08596653,-.08204722,-.036234256,-.08263123,-.10719158,.007939454,-.034715958,.00023838913,.077433795,-.05871609,.04108111,.03122541,-.004395738,-.09581149,.018163828,-.01869759,.01907246,-.054483917,.04197858,.043284353,-.041484054,.061796535,-.09296329,.0624069,.020837005,-.028744888,.012546251,.048716586,.015843349,.026195932,.025286065,-17484014e-15,.04016904,.0041433796,-.06621081,.021316588,-.05429866,.012504844,-.06880541,.055389438,-.01272715,.020698778,.0464363,-.038898837,-.10779776,.0102574015,.016860517,-.041460626,.0348126,-.0015220692,-.11833349,.031808406,-.014302223,.059195947,.050345097,.06161839,.0003797866,.008364388,-.008747614,.109982334,.08851677,-.08520154,.049830988,.046551254,-.06624083,-.045723844,.036748663,.0871887,.052734908,.018068984,.06501429,.11710557,-.009470325,.0133720245,.03667901,-.04498624,.056525905,-.0071494053,-.10949053,.00031861427,.020518746,-.025031533,-.005052555,-.063985676,-.018697932,.04304731,-.012466775,-.031696808,.058221202,-.009633714,-.013450606,.032681055,.07119699,.0003052627,.046320997,.044513904]},{id:"tool-extract-structured-data",type:"navigation",group:"tools",label:"Extract Structured Data",description:"Named entity recognition and extraction",href:"/inference/playground/extract",icon:"Tag",product:"inference",embedding:[-.08874562,-.022256212,-.009120181,-.053892467,.05053006,-.018486928,.040400177,-.0023831993,.00678099,-.033485394,-.017083945,-.049964372,.055115968,.02856298,.0723122,.11621531,.013505721,.110577516,-.011341603,-.13720617,-.03484333,.039668083,-.060305133,-.011397313,-.02914752,-6672216e-11,-.0589421,.019182982,.067470804,.0023251662,.06344531,.016785244,.07899404,.05560304,.025126237,.0599105,-.107087485,.03758737,-.024779892,-.008085059,-.017311882,-.061214868,.0147454925,-.029363371,.049912337,.036477707,-.07270669,.028746687,.0162153,.02533481,-.040776983,-.006465362,.024962394,.03077211,-.0137268035,.059512224,.060141917,-.015386921,-.01865124,-.005199858,-.026608417,-.021789294,-.023131404,-.00135589,346578e-9,-.042007215,.023246208,.011857866,.033630338,.017017908,-.036027715,.04890431,.022766814,.025144972,-.039077163,.03743241,-.03341334,.013124883,.0011179536,-.0827018,-.028642155,.030358551,.045186896,.0068913507,-.021423837,.056285936,.030857116,-.009633174,.037442878,.025036069,-.108868845,-.1871056,.119999595,.022544993,.041834503,.0018585209,.0195384,-.119737655,.025041256,.10005554,-.09481581,.08088752,.06743374,-.061568737,-.08100125,-.0020140924,-.028973028,-.0148079945,.0355644,.03234016,-.004276465,.05425694,.0487464,-.041099507,.02945718,-.098950244,.0397847,-.041567672,.01765266,.006547666,.008203671,.002300835,-.026167255,.048958246,-.008981567,.024226306,-.020911383,-9584274e-40,.032635942,.0454979,.018419713,-.026369724,-.022679312,-.007785179,.0021940018,.045453425,-.03885785,-.022327691,.0019622275,-.009865884,-.013914842,-.031050377,.053419642,-.06165334,-.027827619,.07345617,.011072786,-.017397832,-.026893234,.06812895,-.034149602,.011018081,-.018436478,-.009670455,.041326843,-.10176092,.02524133,-.011708108,.043063592,-.13117252,-.030904265,.029280726,.089641795,.03402943,.001914983,-.046097044,-.06553729,-.0425973,-.032553118,-.015792985,.01779063,.04861898,-.033694666,-.050946396,-.043428976,-.025793554,.010875289,-.04847061,.025908483,.031276725,-.05655302,-.0826133,.004419915,.07358752,-.018398182,.034098264,.013433331,.029192973,-.0211011,.025543623,.01067993,.019888932,.06340308,-.014386645,.022231935,-.02183116,.018992452,.04077786,.050529495,.057323698,.017114159,.05260068,.08995728,.057486992,.017959755,-.0601126,-.034633998,-.050996494,.025711996,-.05657452,.015926596,-.018972773,-.057702318,.030537311,.06909325,-.13482518,-.045129582,-.042330757,-.09091135,.013106769,-.09119072,.0006591146,-.044076413,11582032e-41,.021924162,-.052826915,.017587114,-.00891491,.017645834,-.057032097,-.05479536,.021281624,-.06699103,.01613404,-.0757141,-.025989637,-.0017958318,-.058128357,.022953894,.01017944,.019677006,.008150547,-.03293853,.16991146,.020294426,.010766736,-.16695169,.043645084,.04542826,.04990581,.046782892,.085163645,-.014247059,.02420847,-.066411756,-.013136621,-.040954836,-.041503884,-.058913212,-.11093835,.035609428,-.057760153,-.020482032,-.06862799,.01852444,.054265812,-.08041484,-.023017019,-.06566843,-.0395714,-.13070229,.13387576,-.005659357,-.009325352,-.07045391,-.043156464,-.09691108,-.026925601,.025016258,.011205975,.06352339,-.07645516,-.029411297,.011306064,.021071061,.105412565,-.028521368,.103605464,.11213866,-.059073515,-.046811037,-.014090475,-.07850917,-.07917342,.069859825,.011620065,.016321333,-.05400831,-.003597211,.035069,-.026264125,-.04443558,-.03171094,-.057740778,.02392955,-.056429464,.096808225,.03557849,.04512177,.042053647,.060158957,.058278855,.05408943,-.0140841855,.004139648,.0035795984,.010609446,.11326325,-.03836706,-16554221e-15,-.02049628,-.011871276,-.04047453,.031868387,.027649136,-3343825e-11,-.012241356,.02044731,-.00060266646,-.013478005,-.028561348,-.03178598,-.12949376,.032781497,.07572633,.025027623,.07762569,.09401692,-.028200414,.035326842,-.01938705,.070477575,.005465177,-.028838426,-.0021380177,-.0053907544,-.0052379207,.04684624,.07345141,-.079261385,.014573092,.118635364,-.026982939,-.02553052,.066520795,.12017756,.03427335,.002777453,.004496069,.10155242,.04135254,.033738405,-.042040657,-.011324064,-.009325293,-.016487904,-.047362935,-.043370914,.05368254,-.044932097,.0139782075,-.03521386,.018879674,.019789811,.016824624,.008150227,-.0067206146,.017065464,-.02835101,.039356355,.00029231558,.00092672626,.06323251,.036483094]},{id:"tool-rewrite-text",type:"navigation",group:"tools",label:"Rewrite Text",description:"Rewrite text with a model",href:"/inference/playground/rewrite",icon:"Repeat2",product:"inference",embedding:[-.084463075,.14094223,-.04622238,.018248912,.01543113,.026562368,.02127763,.034180872,-.06698536,-.033089407,-.001239184,-.0832511,.044669624,-.06606045,-.05705478,.023112949,-.039569937,-.04296307,.019053305,-.021119127,.034762032,.08653245,.06853946,-.030677877,.032446545,-.04674308,-.0025183125,.03730568,.07053921,.06184016,.07336035,.0688727,-.0041831876,.027498508,.08271991,.06848373,.018686762,.06942358,.041510135,.0040971814,-.0500892,-.036250602,.005052521,.058352634,.07177745,-.07574305,-.053487148,-.015777685,-.056440495,.021127457,-.07662754,-.01954917,.002007575,-.083532006,-.011295244,.00801884,-.0016668341,-.030974895,-.05016074,-.012977473,-.11635111,-.030236507,-.095803365,-.0042869616,.0013710728,-.0024442507,.101122804,.003280899,-.009067943,-.06754264,-.0941841,.026682489,-.031238269,.06191317,-.05893738,.11430292,-.038308512,.00086501875,-.0015197428,-.11770186,.050473,-.044131342,.05634117,.035519425,-.0011344851,.0692779,.08390422,.019700676,.00061204226,.098620996,-.060638476,-.08810078,.09526319,.031258438,.048172526,.090552,.00044815487,-.11621798,.07674242,.07799476,.023392241,.043279555,.06025556,-.04251425,-.06257475,.024660511,-.018917521,-.0206999,.023658559,-.010690749,-.0018687559,.014801291,.02682781,.014202736,-.048404183,-.022056762,.032588426,.01713552,.041016933,.006884167,.027060023,-.01959212,.023426313,.030477086,-.0047380663,-.010618698,-.0056355926,-26719077e-40,-.01563081,-.0389418,.047960524,.097616516,-.05938939,.045622684,.0042131175,.03176545,-.050586015,-.08354327,-.07858098,.0010786605,-.0022931497,.02479961,.061315708,.03554865,-.10442551,.081669904,-.05411106,.046398137,-.0097317565,.018001253,.032080386,-.02718287,.0320495,.022609109,.009108949,-.08979434,-.003932135,-.009201643,-.06131203,-.06394052,.009047915,.03929416,.002145154,.11007198,.048377883,-.004566065,-.0031544236,-.0085038515,-.038589843,.033879265,.06262212,.031336024,-.015948512,.009809364,.005647739,.03156098,.04426618,.021168714,-.014616074,.05115338,-.064941995,-.05178212,.060387064,-.00014722791,-.044985104,.06703584,.028195342,.050083775,.0095639,.13517597,.017044641,-.0029732569,-.038015746,-.059265614,-.047640093,-.030161798,.11704382,.026504265,.061755545,-.08472976,-.11775914,-.13248582,.058779728,.003388674,-.009806704,.06585782,-.06460815,-.050974987,.014964778,.04054566,-.06316731,-.08696052,.044087153,-.01930861,.04522911,-.020655153,-.025134517,-.0982327,.012228415,-.025710404,-.03958309,-.090277396,.030410726,-5806658e-40,.00044751735,-.032449655,-.050133348,.078766726,-.029816974,-.049576815,-.025322285,-.019051567,-.08390814,-.0072520617,-.012914244,.007132538,.010089916,-.03628172,-.050128028,-.0654509,-.037409812,-.070493944,-.026932735,.059647225,-.0058213407,.14775357,-.016423985,.050087977,-.010250522,.008126979,.029368177,-.0036744098,-.00769748,.02025245,-.0164947,-.01772089,-.011597456,.05268985,.0127476165,-.046558525,.13083443,-.022803457,.009107009,.05679844,-.004435224,.078046404,-.07073914,.0642607,-.08670193,.017407896,-.039750066,.039381787,.070046306,-.003935022,-.008821423,.02771747,-.009377325,-.075989254,-.11358007,-.030747086,.0052809543,.013246476,.023255771,.06840393,-.024793103,.022307618,.030128485,-.048359822,.054017864,-.06579509,-.03646095,.027356822,-.04938521,.015700962,-.08085496,-.028243616,-.013875418,-.040673785,.041197598,.06708142,-.004343417,-.026829615,-.0069557317,-.114816904,.044378072,.03696441,.023380293,.083717085,-.032893736,-.06662444,.028340401,.04961357,.016711911,.035681855,.017456826,-.021168608,-.06985708,.015795965,-.019506939,-17945776e-15,-.006394363,.062324956,-9754139e-11,.07650153,.022426873,.03990773,-.10990142,.014787171,.034846235,-.05804858,-.0020872538,.014958762,-.0528918,.045376908,.032406565,-.021288749,-.0076927035,.07470752,-.0830408,-.023529267,.021502675,.011928362,-.07762995,.08189152,-.04061262,.02823563,-.0058697476,-.0345648,.0020315216,-.03007603,.04856943,.02227605,-.096076146,.020034187,.046950717,.023578594,-.090531744,.016524311,.034517225,-.0028123085,-.008689297,-.01283491,-.022420773,-.010166118,-.061380103,-.09444464,-.049657904,-.051141396,-.053308543,-.032494865,-.094900176,-.08423578,.027076192,-.02030964,.026962418,-.036608737,.018314773,.03622159,-.020554554,.004848901,.072428755,.0887996,.017838985,.001954755]},{id:"action-toggle-theme",type:"action",group:"quickActions",label:"Toggle Theme",description:"Switch between light and dark mode",action:"toggle-theme",icon:"Moon",embedding:[.021015331,.04611802,.011224644,.0929371,.023360502,-.008410275,.06508567,-.0515074,-.0103888605,-.014892304,.02718553,-.0669572,-.063323885,-.05225197,.05546497,.0367312,.027198069,.023237465,.061169855,.01922119,.02363471,-.075216554,-.034238894,-.052898373,-.04567474,.06380429,.02719372,-.022427661,-.047568463,-.040539455,.023403354,.065015815,-.054412596,-.02576282,-.06769511,-.047651477,-.021822453,-.041715536,-.014031458,.027767403,-.026966298,-.033950735,-.03290846,-.030809356,-.07425715,.0326208,-.016034001,.016342202,.025491921,-.05381381,.09316339,-.03472782,-.007830638,-.020119954,.041606054,.07991103,.04235812,.09607449,.038599662,-.0756568,.037332647,.073594615,-.04901336,-.028378073,.100169666,.11556791,-.045504477,-.05163797,-.014821616,.014544631,.07363041,.042748414,.08856914,-.032888215,-.008716166,-.0151563175,-.0015828433,-.014413518,-.053731594,-.014846121,.051826086,-.027098006,-.064497255,.03935684,.08472167,.04184526,-.045379374,.045845028,-.027537588,.0025859436,-.07939321,-.0012634046,.04347528,-.007210602,-.07605376,-.063976005,-.010884013,-.06411127,-.044255428,.08476794,-.0034883984,-.07609638,.06022736,.04691306,.028703615,-.03884288,.06556433,.030475767,-.040518682,.032234408,.04059941,-.022722641,.0032961313,-.031186474,-.0037704231,.055777434,.04252327,.09913576,.0049860463,.07718512,.060762532,.014789461,-.0220477,-.009860352,.0029508844,.02020053,.06855313,25971414e-40,.12431951,-.047199707,-.038689528,.033466864,.04452494,.0110707665,.047750466,-.027367182,-.11341392,.02355595,.09261154,.047586888,-.030604765,.02230333,.06718056,-.03508816,.018942852,.02143716,.046899915,-.08457216,-.015865432,-.031851657,.002095017,-.035210673,-.01317065,.029991996,.013365165,-.040942267,-.016037216,.004067832,.0064344206,.05764414,.09478455,.07232832,-.027822467,.05645973,-.05431818,.0027717855,.032145333,-.024437662,-.11118324,.0018947776,-.024720319,.0037980445,.022936417,.04619673,.10463544,-.086171016,-.049687672,.039202675,.04922911,-.0646811,-.030203555,-.081724554,.046157107,-.026849432,-.031550974,.08042494,.02563542,-.003938778,.035649113,-.0457436,.032378126,-.06786206,.009333239,.00055946055,-.037370875,-.062360745,-.078289956,-.13218641,-.042377934,-.025253853,.020896804,-.007764118,-.036796466,.06579396,.001493979,-.04776013,-.021945339,-.0007373659,.026399907,.04549091,-.078026265,-.050001957,.04306877,-.0055757905,.014911023,-.016050922,-.053021304,-.008154585,-.004261716,.0015819833,.04638297,-.050504103,.0021285773,-2415207e-39,.022197677,-.040342584,-.0952004,.057925735,-.015182957,.040454675,.013435283,-.07856491,-.017285407,.10134537,.1373802,-.0015339549,-.04505992,.012558004,-.034734916,.0012614107,.04013384,.1155946,-.04443094,.09056105,-.08600291,-.05845598,-.054208487,-.020805517,-.07551731,.029499691,.08331385,.06989265,-.017507091,-.05519114,.025722386,.039611284,-.019214753,.019488921,-.03349486,.089743465,-.049561717,-.0073054465,-.08278244,.020935085,.019231947,.051886126,.06956427,-.04633524,-.11834713,.06472452,-.035040878,.0037803217,-.08225101,-.047864318,-.019528056,-.090442404,-.019809652,.008101462,-.058010828,.032808535,.03135762,.053735938,-.0026986904,.117877856,.110595435,-.022698488,-.0049602697,-.011608461,.0017405422,-.027067052,-.019845273,.040890735,.06903735,-.012051576,.07514964,-.026712492,.046508122,-.025720447,.046899524,-.085669085,.04056559,.016088352,-.106240146,-.054565676,.020578448,-.07799154,.024285458,.0004280426,-.061270542,.036486402,-.05892136,.05538944,-.0018986709,-.059999224,-.09741779,.033229575,.08710978,-.012596878,.041586887,-18150276e-15,-.06292275,-.069363415,.0871275,-.022667078,.0045574387,.040028933,.024972603,-.052509457,.0009808771,.013331666,.0044475403,.012100486,.035712633,.039013274,.017234966,.08713012,-.040424403,.0002578425,.013594123,-.009672304,-.04521528,.0030568177,.0141780395,-.043559767,.065785035,.015885245,.021780467,.0006341215,.1120176,.05563781,.013914078,.037798535,-.0113636,-.070465565,-.051158167,.01736645,-.02608868,.07767548,-.007849373,-.015947971,.011249832,.029067192,-.1225885,.0069179265,-.13122576,-.032101676,.09302361,.016995095,-.058885843,.058040306,.039273713,-.0031883777,.021903811,.026383303,-.005458636,-.056622382,.0021553566,.057499904,-.06203852,-.013515508,.05877982,-.08229447,-.09794669,.031005852]}],HOn={model:qOn,dimension:384,generatedFrom:GOn,commands:UOn},wde=zOn,gUe=HOn;function Ro(){const e=(0,z.useContext)(Mjt);if(e===void 0)throw new Error("useApiConfig must be used within an ApiConfigProvider");return e}function dh(){const{client:e}=Ro();return e}var jjt=(0,z.createContext)(void 0);function kR(){const e=(0,z.useContext)(jjt);if(e===void 0)throw new Error("useAuth must be used within an AuthProvider");return e}var $jt=(0,z.createContext)(void 0);function yb(){const e=(0,z.useContext)($jt);if(e===void 0)throw new Error("useTable must be used within a TableProvider");return e}var zjt=z.createContext(void 0);function WOn(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function hUe(e){(e==="system"?WOn():e)==="dark"?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")}function YOn({children:e,defaultTheme:t="system"}){const[n,a]=z.useState(()=>typeof window>"u"?t:localStorage.getItem("theme")||t);z.useEffect(()=>{hUe(n),localStorage.setItem("theme",n)},[n]),z.useEffect(()=>{if(n!=="system")return;const i=window.matchMedia("(prefers-color-scheme: dark)"),o=()=>hUe("system");return i.addEventListener("change",o),()=>i.removeEventListener("change",o)},[n]);const r=z.useMemo(()=>({theme:n,setTheme:a}),[n]);return(0,b.jsx)(zjt.Provider,{value:r,children:e})}function _R(){const e=z.useContext(zjt);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e}function VOn(e,t){if(e.length!==t.length)throw new Error(`Vector length mismatch: ${e.length} vs ${t.length}`);let n=0,a=0,r=0;for(let o=0;o<e.length;o++)n+=e[o]*t[o],a+=e[o]*e[o],r+=t[o]*t[o];const i=Math.sqrt(a)*Math.sqrt(r);return i===0?0:n/i}async function KOn(e,t,n=3){try{const a=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:gUe.model,input:e})});if(!a.ok)return[];const r=(await a.json()).data[0]?.embedding;return Array.isArray(r)?gUe.commands.map(i=>({item:{id:i.id,type:i.type,group:i.group,label:i.label,description:i.description,href:i.href,action:i.action,icon:i.icon,product:i.product,adminOnly:i.adminOnly},score:VOn(r,i.embedding)})).sort((i,o)=>o.score-i.score).slice(0,n):[]}catch(a){return console.error("Semantic search failed:",a),[]}}var qjt={Table:YOt,Plus:Ju,Library:MOt,Users:bRn,FileInput:ROt,FileStack:QOt,Shield:t6e,KeyRound:JFe,Scissors:uT,Tag:LL,HelpCircle:kx,Network:g0,Plug:qOt,ClipboardCheck:ZFe,Bot:KFe,Search:nm,Upload:BS,Waypoints:n6e,ArrowUpDown:O$,Repeat2:GOt,RotateCw:UOt,ScanLine:e6e,Mic:VN,Moon:jOt,Sun:WOt},Gjt=z.createContext(void 0);function ZOn(e){return!e||e==="toggle-theme"}function vde(e){return{id:e.id,icon:qjt[e.icon]??kx,label:e.label,href:e.href,action:e.action,product:e.product,adminOnly:e.adminOnly}}function JOn({children:e}){const[t,n]=z.useState(!1),[a,r]=z.useState(!1),[i,o]=z.useState(""),[s,l]=z.useState([]),[u,d]=z.useState(!1),p=Ym(),{hasPermission:m}=kR(),{selectedTable:A,graphIndexes:g,isLoadingIndexes:h}=yb(),{theme:f,setTheme:y}=_R(),{inferenceUrl:w}=Ro(),v=!lie()&&m("*","*","admin"),k=z.useCallback(Q=>!(!ZOn(Q.action)||Q.product&&!Fl(Q.product)||Q.adminOnly&&!v||Q.href==="/retrieval/graph"&&!h&&g.length===0),[g.length,h,v]);z.useEffect(()=>{r(!0)},[]);const _=z.useCallback(()=>{n(Q=>!Q)},[]);z.useEffect(()=>{const Q=B=>{B.key==="k"&&(B.metaKey||B.ctrlKey)&&(B.preventDefault(),_())};return document.addEventListener("keydown",Q),()=>document.removeEventListener("keydown",Q)},[_]);const x=z.useMemo(()=>wde.filter(Q=>Q.group==="navigation").map(vde).filter(k),[k]),E=z.useMemo(()=>wde.filter(Q=>Q.group==="tools").map(vde).filter(k),[k]),S=z.useMemo(()=>wde.filter(Q=>Q.group==="quickActions").map(vde).filter(k),[k]),D=z.useMemo(()=>{if(!A)return[];const Q=`/tables/${encodeURIComponent(A)}`;return[{id:"context-create-index",icon:Ju,label:`Create index for ${A}`,href:`${Q}?section=indexes`,product:"antfly"},{id:"context-upload-data",icon:BS,label:`Upload data to ${A}`,href:`${Q}?section=bulk`,product:"antfly"},{id:"context-search-table",icon:nm,label:`Search ${A}`,href:`${Q}?section=semantic`,product:"antfly"},{id:"context-view-retrieval-trace",icon:ZFe,label:`View retrieval trace for ${A}`,href:`${Q}?section=semantic`,product:"antfly"}]},[A]),L=z.useMemo(()=>[...x.map(Q=>Q.label),...E.map(Q=>Q.label),...D.map(Q=>Q.label),...S.map(Q=>Q.label)],[x,E,D,S]),F=z.useMemo(()=>{if(!i)return!0;const Q=i.toLowerCase();return L.some(B=>B.toLowerCase().includes(Q))},[i,L]);z.useEffect(()=>{if(F||i.length<2){l([]);return}d(!0);const Q=setTimeout(async()=>{try{l((await KOn(i,w("embed"))).filter(B=>k(B.item)))}catch(B){console.error("Semantic search failed:",B),l([])}d(!1)},300);return()=>clearTimeout(Q)},[i,F,w,k]),z.useEffect(()=>{t||(o(""),l([]),d(!1))},[t]);const M=z.useCallback((Q,B)=>{n(!1),B==="toggle-theme"?y(f==="system"?"light":f==="light"?"dark":"system"):Q&&p(Q)},[p,f,y]);return(0,b.jsxs)(Gjt.Provider,{value:{isOpen:t,setIsOpen:n,toggle:_},children:[e,(0,b.jsxs)(eQn,{open:t,onOpenChange:n,children:[(0,b.jsx)(Nre,{placeholder:"Type a command or search...",value:i,onValueChange:o}),(0,b.jsxs)(Lre,{children:[(0,b.jsx)(Rre,{children:u?(0,b.jsxs)("div",{className:"flex items-center justify-center gap-2 py-6",children:[(0,b.jsx)(_0,{className:"h-4 w-4 animate-spin"}),(0,b.jsx)("span",{children:"Searching..."})]}):"No results found."}),!F&&s.length>0&&(0,b.jsx)(NC,{heading:"Closest Matches",children:s.map(Q=>{const B=qjt[Q.item.icon]||kx;return(0,b.jsxs)(LC,{value:`${i} ${Q.item.label}`,onSelect:()=>M(Q.item.href,Q.item.action),children:[(0,b.jsx)(B,{className:"h-4 w-4"}),(0,b.jsx)("span",{children:Q.item.label})]},Q.item.id)})}),(0,b.jsx)(NC,{heading:"Quick Actions",children:S.map(Q=>{let B=Q.icon,I=Q.label;return a&&Q.action==="toggle-theme"&&(B=f==="dark"?WOt:jOt,I=f==="dark"?"Switch to Light Mode":"Switch to Dark Mode"),(0,b.jsxs)(LC,{onSelect:()=>M(void 0,Q.action),className:"flex items-center gap-2 cursor-pointer",children:[(0,b.jsx)(B,{className:"h-4 w-4"}),(0,b.jsx)("span",{children:I})]},Q.id)})}),(0,b.jsx)(Gue,{}),(0,b.jsx)(NC,{heading:"Navigation",children:x.map(Q=>(0,b.jsxs)(LC,{onSelect:()=>M(Q.href),className:"flex items-center gap-2 cursor-pointer",children:[(0,b.jsx)(Q.icon,{className:"h-4 w-4"}),(0,b.jsx)("span",{children:Q.label})]},Q.id))}),(0,b.jsx)(Gue,{}),D.length>0&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(NC,{heading:"Current Table",children:D.map(Q=>(0,b.jsxs)(LC,{onSelect:()=>M(Q.href),className:"flex items-center gap-2 cursor-pointer",children:[(0,b.jsx)(Q.icon,{className:"h-4 w-4"}),(0,b.jsx)("span",{children:Q.label})]},Q.id))}),(0,b.jsx)(Gue,{})]}),(0,b.jsx)(NC,{heading:"Tools",children:E.map(Q=>(0,b.jsxs)(LC,{onSelect:()=>M(Q.href),className:"flex items-center gap-2 cursor-pointer",children:[(0,b.jsx)(Q.icon,{className:"h-4 w-4"}),(0,b.jsx)("span",{children:Q.label})]},Q.id))})]})]})]})}function XOn(){const e=z.useContext(Gjt);if(e===void 0)throw new Error("useCommandPalette must be used within a CommandPaletteProvider");return e}Gae();VQe();function Ea(...e){return TP(SP(e))}async function b0(e,t,n=1){for(let a=0;;a++){const r=await fetch(e,t);if(r.status===502&&a<n){await new Promise(i=>setTimeout(i,2e3));continue}return r}}function YP({options:e,value:t,onChange:n,placeholder:a="Select option...",searchPlaceholder:r="Search options...",emptyText:i="No option found.",allowCustomValue:o=!1,className:s,disabled:l=!1}){const[u,d]=z.useState(!1),[p,m]=z.useState(""),A=e.find(w=>w.value===t),g=w=>{n?.(w===t?"":w),d(!1),m("")},h=w=>{m(w),o&&n&&n(w)},f=w=>{o&&w.key==="Enter"&&p&&(n?.(p),d(!1),m(""),w.preventDefault())},y=A?A.label:o&&t?t:"";return(0,b.jsxs)(j$,{open:u,onOpenChange:d,children:[(0,b.jsx)($$,{asChild:!0,children:(0,b.jsxs)(Ct,{variant:"outline",role:"combobox","aria-expanded":u,className:Ea("w-full justify-between",!y&&"text-muted-foreground",s),disabled:l,children:[y||a,(0,b.jsx)(TOt,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,b.jsx)(z$,{className:"w-full p-0",align:"start",children:(0,b.jsxs)(Dre,{children:[(0,b.jsx)(Nre,{placeholder:r,value:p,onValueChange:h,onKeyDown:f}),(0,b.jsxs)(Lre,{children:[(0,b.jsx)(Rre,{children:i}),e.length>0&&(0,b.jsx)(NC,{children:e.map(w=>(0,b.jsxs)(LC,{value:w.value,onSelect:g,children:[(0,b.jsx)(Ud,{className:Ea("mr-2 h-4 w-4",t===w.value?"opacity-100":"opacity-0")}),w.label]},w.value))})]})]})})]})}var e7n=15e3,t7n=16,II=new Map,pH=new Map;function n7n(e,t){II.delete(e),II.set(e,t),II.size>t7n&&II.delete(II.keys().next().value)}function Ujt(e){const{apiUrl:t,client:n}=Ro(),a=`${t}|models=${e}`,r=II.get(a)??null,[i,o]=(0,z.useState)(r?.connections??[]),[s,l]=(0,z.useState)(r?.supported??!0),[u,d]=(0,z.useState)(!r),[p,m]=(0,z.useState)(null),A=(0,z.useRef)(!0),g=(0,z.useCallback)(async(f,y)=>{d(!0),m(null);try{const w=`${a}|refresh=${!!y?.refresh}`;let v=pH.get(w);v||(v=(async()=>{const _=new AbortController,x=window.setTimeout(()=>{_.abort(new DOMException("Request timed out","TimeoutError"))},e7n);try{const E=await n.connections.list({include:e?["models"]:void 0,refresh:y?.refresh,signal:_.signal});return{connections:E?.connections??[],supported:E!==void 0}}finally{window.clearTimeout(x)}})(),pH.set(w,v),v.then(()=>pH.delete(w),()=>pH.delete(w)));const k=await v;if(f?.aborted||!A.current)return;n7n(a,k),o(k.connections),l(k.supported),d(!1)}catch(w){if(f?.aborted||!A.current)return;m(w instanceof Error?w.message:"Failed to fetch connections"),d(!1)}},[a,n,e]),h=(0,z.useCallback)(()=>{g(void 0,{refresh:!0})},[g]);return(0,z.useEffect)(()=>{A.current=!0;const f=II.get(a);if(f)return o(f.connections),l(f.supported),d(!1),m(null),()=>{A.current=!1};const y=new AbortController;return g(y.signal),()=>{A.current=!1,y.abort()}},[a,g]),{connections:i,supported:s,loading:u,error:p,retry:h}}function a7n(){return Ujt(!0)}function CR(){const e=Ujt(!0);return{providers:e.connections.filter(t=>t.kind==="inference"),supported:e.supported,loading:e.loading,error:e.error,retry:e.retry}}function tb(e){const{inferenceConnectionId:t}=Ro(),{providers:n,loading:a}=CR(),r=n.find(o=>o.id===t)?.inference?.models,i=(0,z.useMemo)(()=>[...r?.[e==="other"?"other":`${e}s`]??[],...e==="generator"?r?.other??[]:[]].map(o=>o.name),[e,r]);return{models:(0,z.useMemo)(()=>[...new Set(i)],[i]),loading:a}}function Hjt(e,t){const n={};for(const a of e){const r=a.inference;if(!r||a.status!=="connected")continue;const i=r.models;if(!i)continue;const o=[...i[`${t}s`]??[],...t==="generator"?i.other??[]:[]].map(l=>l.name).filter(l=>l.length>0);if(o.length===0)continue;const s=n[r.provider]??[];n[r.provider]=[...new Set([...s,...o])]}return n}var kde={antfly:"gemma-3-1b-it",ollama:"llama3.3:70b",gemini:"gemini-2.5-flash",openai:"gpt-4.1",vertex:"gemini-2.5-flash"},r7n={antfly:"Antfly (Local)",ollama:"Ollama (Local)",gemini:"Google AI (Gemini)",openai:"OpenAI",vertex:"Google Cloud Vertex AI"},Z$={provider:"openai",model:"gpt-4.1",temperature:.7},i7n=["gemini","vertex","openai","ollama","antfly"];function v8(e,t="Server default"){return!e?.provider||!e?.model?t:`${e.provider}/${e.model}`}function uie(e){return e?{label:"Dashboard default",description:`Use the dashboard default generator (${v8(e)}).`}:{label:"Server default",description:"Use the generator configured in the Antfly server config and omit any local override."}}function k8({value:e,onChange:t,defaultConfig:n,defaultLabel:a="Server default",defaultDescription:r="Omit the generator override and let the backend choose the configured default.",customLabel:i="Custom override",showTemperature:o=!0,temperatureDisabled:s=!1,temperatureHelpText:l,providers:u=mOn,className:d}){const p=e?"custom":"default",m=(0,z.useId)(),A=`${m}-generator-mode-default`,g=`${m}-generator-mode-custom`,{providers:h}=CR(),f=(0,z.useMemo)(()=>Hjt(h,"generator"),[h]),y=(0,z.useMemo)(()=>{if(!e)return[];const k=f[e.provider]??[];return(k.length>0?k:[kde[e.provider]]).filter(_=>!!_).map(_=>({value:_,label:_}))},[f,e]),w=k=>{if(k==="default"){t(null);return}t(e?{...e}:{...n})},v=k=>{if(!e)return;const _=k,x=f[_]?.[0];t({...e,provider:_,model:x||kde[_]||e.model})};return(0,b.jsxs)("div",{className:Ea("space-y-4",d),children:[(0,b.jsxs)(v7,{value:p,onValueChange:w,className:"gap-2",children:[(0,b.jsxs)("label",{htmlFor:A,className:"flex items-start gap-3 rounded-none border p-3 cursor-pointer hover:bg-muted/30",children:[(0,b.jsx)(Of,{value:"default",id:A,className:"mt-0.5"}),(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)(Yt,{htmlFor:A,className:"cursor-pointer",children:a}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:r})]})]}),(0,b.jsxs)("label",{htmlFor:g,className:"flex items-start gap-3 rounded-none border p-3 cursor-pointer hover:bg-muted/30",children:[(0,b.jsx)(Of,{value:"custom",id:g,className:"mt-0.5"}),(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)(Yt,{htmlFor:g,className:"cursor-pointer",children:i}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"Pick a provider and model for this playground only."})]})]})]}),e&&(0,b.jsxs)("div",{className:Ea("grid gap-4",o?"grid-cols-1 lg:grid-cols-3":"grid-cols-1 lg:grid-cols-2"),children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(Yt,{className:"text-xs text-muted-foreground",children:"Provider"}),(0,b.jsxs)(Gr,{value:e.provider,onValueChange:v,children:[(0,b.jsx)(Hr,{children:(0,b.jsx)(Ur,{})}),(0,b.jsx)(Wr,{children:u.map(k=>(0,b.jsx)(ra,{value:k,children:r7n[k]||k},k))})]})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(Yt,{className:"text-xs text-muted-foreground",children:"Model"}),(0,b.jsx)(YP,{options:y,value:e.model,onChange:k=>t({...e,model:k}),placeholder:kde[e.provider],searchPlaceholder:"Search or type a model...",emptyText:"Type a model name.",allowCustomValue:!0})]}),o&&(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(Yt,{className:"text-xs text-muted-foreground",children:"Temperature"}),(0,b.jsx)(an,{type:"number",value:e.temperature??n.temperature??0,onChange:k=>{const _=Number.parseFloat(k.target.value);t({...e,temperature:Number.isFinite(_)?_:n.temperature??0})},min:0,max:2,step:.1,disabled:s,className:Ea(s&&"bg-muted")}),l&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:l})]})]})]})}var Wjt=(0,z.createContext)(void 0);function J$(){const e=(0,z.useContext)(Wjt);if(!e)throw new Error("useGeneratorPreference must be used within a GeneratorPreferenceProvider");return e}function o7n(){const{dashboardGenerator:e,setDashboardGenerator:t}=J$();return(0,b.jsxs)(j$,{children:[(0,b.jsx)($$,{asChild:!0,children:(0,b.jsxs)(Ct,{variant:"outline",size:"sm",className:"max-w-[260px] gap-2",children:[(0,b.jsx)(XA,{className:"size-4 shrink-0"}),(0,b.jsx)("span",{className:"hidden md:inline",children:"Generator"}),(0,b.jsx)("span",{className:"hidden lg:inline truncate text-muted-foreground",children:v8(e)})]})}),(0,b.jsxs)(z$,{align:"end",className:"w-[420px] space-y-3",children:[(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)("h4",{className:"text-sm font-medium",children:"Dashboard Generator"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"Playgrounds and query builders inherit this unless they set a local override."})]}),(0,b.jsx)(k8,{value:e,onChange:t,defaultLabel:"Server default",defaultDescription:"Leave unset to defer to the backend default generator.",customLabel:"Dashboard default",defaultConfig:Z$})]})]})}function Yjt({trigger:e}={}){const{apiUrl:t,setApiUrl:n,resetToDefault:a,inferenceApiUrl:r,setInferenceApiUrl:i,resetInferenceApiUrl:o}=Ro(),[s,l]=(0,z.useState)(!1),u=r||"same origin (/ai/v1)",d=Y$({defaultValues:{apiUrl:t,inferenceUrl:r}}),p=g=>{n(g.apiUrl),i(g.inferenceUrl),l(!1)},m=()=>{a(),o(),d.reset({apiUrl:t,inferenceUrl:r})},A=()=>{d.reset({apiUrl:t,inferenceUrl:r}),l(!1)};return(0,b.jsxs)(Hd,{open:s,onOpenChange:l,children:[(0,b.jsx)(Xf,{asChild:!0,children:e||(0,b.jsx)(Ct,{variant:"ghost",size:"icon",title:"Settings",children:(0,b.jsx)(ES,{className:"h-4 w-4"})})}),(0,b.jsxs)(Wd,{className:"sm:max-w-131.25",children:[(0,b.jsxs)(Gg,{children:[(0,b.jsx)(Yd,{children:"API Settings"}),(0,b.jsx)(qp,{children:"Configure the Antfly data and inference APIs. This is useful when accessing the dashboard remotely or connecting to separate Antfly deployments."})]}),(0,b.jsxs)(V$,{form:d,onSubmit:d.handleSubmit(p),className:"gap-6 py-4",children:[(0,b.jsx)(ya,{control:d.control,name:"apiUrl",render:({field:g})=>(0,b.jsxs)(na,{children:[(0,b.jsx)(ea,{children:"Antfly Data API URL"}),(0,b.jsx)(aa,{children:(0,b.jsx)(an,{placeholder:"http://localhost:8082/db/v1",...g})}),(0,b.jsxs)(Kv,{children:["Current:"," ",(0,b.jsx)("code",{className:"text-xs bg-muted px-1 py-0.5 rounded-none",children:t})]}),(0,b.jsxs)(Kv,{className:"text-xs",children:["Examples: ",(0,b.jsx)("code",{className:"bg-muted px-1 py-0.5 rounded-none",children:"/db/v1"})," ","(default),"," ",(0,b.jsx)("code",{className:"bg-muted px-1 py-0.5 rounded-none",children:"http://server:8082/db/v1"})]})]})}),(0,b.jsx)(ya,{control:d.control,name:"inferenceUrl",render:({field:g})=>(0,b.jsxs)(na,{children:[(0,b.jsx)(ea,{children:"Antfly Inference API URL"}),(0,b.jsx)(aa,{children:(0,b.jsx)(an,{placeholder:"/ai/v1",...g})}),(0,b.jsxs)(Kv,{children:["Current:"," ",(0,b.jsx)("code",{className:"text-xs bg-muted px-1 py-0.5 rounded-none",children:u})]}),(0,b.jsxs)(Kv,{className:"text-xs",children:["Examples: ",(0,b.jsx)("code",{className:"bg-muted px-1 py-0.5 rounded-none",children:"/ai/v1"})," ","(default),"," ",(0,b.jsx)("code",{className:"bg-muted px-1 py-0.5 rounded-none",children:"https://antfly.company.com/ai/v1"})]})]})}),(0,b.jsxs)(om,{children:[(0,b.jsx)(Ct,{variant:"outline",type:"button",onClick:m,children:"Reset to Default"}),(0,b.jsx)(Ct,{variant:"outline",type:"button",onClick:A,children:"Cancel"}),(0,b.jsx)(Ct,{type:"submit",children:"Save"})]})]})]})]})}var Vjt="antfarm-data-density",s7n="default",_de=["default","compact","comfortable"];function c7n(){try{const e=localStorage.getItem(Vjt);if(e==="compact"||e==="default"||e==="comfortable")return e}catch{}return s7n}function fUe(e){e==="default"?document.documentElement.removeAttribute("data-density"):document.documentElement.setAttribute("data-density",e)}function l7n(){const[e,t]=(0,z.useState)(c7n);(0,z.useEffect)(()=>{fUe(e)},[e]);const n=(0,z.useCallback)(a=>{t(a);try{localStorage.setItem(Vjt,a)}catch{}fUe(a)},[]);return{density:e,setDensity:n,toggleDensity:(0,z.useCallback)(()=>{const a=_de[(_de.indexOf(e)+1)%_de.length];n(a)},[e,n])}}function u7n({title:e,className:t,...n}){const{toggle:a}=XOn(),{density:r,toggleDensity:i}=l7n(),{theme:o,setTheme:s}=_R(),l=()=>{s(o==="system"?"light":o==="light"?"dark":"system")};return(0,b.jsxs)("header",{className:Ea("af-app-header sticky top-0 z-10 flex shrink-0 h-14 items-center gap-4 border-b border-border bg-background px-4",t),...n,children:[e&&(0,b.jsx)("h1",{className:"text-lg font-semibold",children:e}),(0,b.jsxs)("div",{className:"ml-auto flex items-center gap-2",children:[(0,b.jsxs)(Ct,{variant:"outline",size:"sm",onClick:a,className:"gap-2",children:[(0,b.jsx)(nm,{className:"size-4"}),(0,b.jsx)("span",{className:"hidden md:inline",children:"⌘K"})]}),(0,b.jsx)(o7n,{}),(0,b.jsx)(Yjt,{}),(0,b.jsx)(Ct,{variant:"ghost",size:"icon",onClick:l,title:o==="system"?"Switch to Light Mode":o==="light"?"Switch to Dark Mode":"Switch to System Theme",children:o==="system"?(0,b.jsx)(FOn,{className:"size-4"}):o==="light"?(0,b.jsx)(TOn,{className:"size-4"}):(0,b.jsx)(POt,{className:"size-4"})}),(0,b.jsx)(Ct,{variant:"ghost",size:"icon",onClick:i,title:`Density: ${r} (click to cycle)`,children:r==="compact"?(0,b.jsx)(G8n,{className:"size-4"}):r==="comfortable"?(0,b.jsx)(j8n,{className:"size-4"}):(0,b.jsx)(z8n,{className:"size-4"})})]})]})}function d7n({children:e}){const{apiUrl:t}=Ro(),[n,a]=(0,z.useState)(null),[r,i]=(0,z.useState)(null),[o,s]=(0,z.useState)(!0),[l,u]=(0,z.useState)(null),d=(0,z.useCallback)((_,x)=>new ox({baseUrl:t,..._&&x?{auth:{username:_,password:x}}:{}}),[t]),p=(0,z.useCallback)(()=>{const _=localStorage.getItem("antfly_auth");if(!_)return null;try{return JSON.parse(_)}catch{return null}},[]),m=(0,z.useCallback)((_,x)=>{localStorage.setItem("antfly_auth",JSON.stringify({username:_,password:x}))},[]),A=(0,z.useCallback)(()=>{localStorage.removeItem("antfly_auth")},[]),g=(0,z.useCallback)(async()=>{if(lie()||!Fl("antfly"))return!1;try{return(await d().getStatus())?.auth_enabled??!0}catch{return!0}},[d]),h=(0,z.useCallback)(async(_,x)=>{try{const E=await d(_,x).users.getCurrentUser();return{username:E?.username||_,permissions:E?.permissions||[]}}catch(E){throw E instanceof Error&&E.message.includes("401")?new Error("Invalid credentials"):new Error(`Failed to fetch user info from ${t}`)}},[t,d]),f=(0,z.useCallback)(async()=>{try{s(!0),u(null);const _=await g();if(i(_),!_){a(null),s(!1);return}const x=p();if(!x){a(null),s(!1);return}a(await h(x.username,x.password))}catch(_){u(_ instanceof Error?_.message:"Authentication failed"),A(),a(null)}finally{s(!1)}},[p,h,A,g]),y=(0,z.useCallback)(async(_,x)=>{try{s(!0),u(null);const E=await h(_,x);m(_,x),a(E)}catch(E){throw u(E instanceof Error?E.message:"Login failed"),E}finally{s(!1)}},[h,m]),w=(0,z.useCallback)(()=>{A(),a(null),u(null)},[A]),v=(0,z.useCallback)((_,x,E)=>r===!1?!0:n?(n.permissions??[]).some(S=>{const D=S.resource===_||S.resource==="*",L=S.resource_type===x||S.resource_type==="*",F=S.type===E||S.type==="admin";return D&&L&&F}):!1,[n,r]);(0,z.useEffect)(()=>{f().catch(_=>{u(_ instanceof Error?_.message:"Authentication check failed"),s(!1)})},[f]);const k={user:n,isAuthenticated:r===!1?!0:!!n,isLoading:o,error:l,login:y,logout:w,hasPermission:v,refreshUser:f,authEnabled:r};return(0,b.jsx)(jjt.Provider,{value:k,children:e})}var p7n=3e4,bUe=5e3;function m7n(){const{apiUrl:e,inferenceApiUrl:t}=Ro(),[n,a]=(0,z.useState)("checking"),[r,i]=(0,z.useState)("checking"),o=(0,z.useRef)(!0),s=(0,z.useCallback)(async d=>{if(!Fl("antfly")){a("connected");return}try{const p=await fetch(`${e}/status`,{method:"GET",signal:d??AbortSignal.timeout(bUe)});o.current&&a(p.ok?"connected":"disconnected")}catch{o.current&&a("disconnected")}},[e]),l=(0,z.useCallback)(async d=>{if(!Fl("inference")){i("connected");return}try{const p=await fetch(`${t}/healthz`,{method:"GET",signal:d??AbortSignal.timeout(bUe)});o.current&&i(p.ok?"connected":"disconnected")}catch{o.current&&i("disconnected")}},[t]),u=(0,z.useCallback)(()=>{Fl("antfly")&&a("checking"),Fl("inference")&&i("checking"),s(),l()},[s,l]);return(0,z.useEffect)(()=>{o.current=!0;const d=new AbortController;return s(d.signal),l(d.signal),()=>{o.current=!1,d.abort()}},[s,l]),(0,z.useEffect)(()=>{if(!(n==="disconnected"||r==="disconnected"))return;const d=setInterval(()=>{n==="disconnected"&&s(),r==="disconnected"&&l()},p7n);return()=>clearInterval(d)},[n,r,s,l]),{antfly:n,inference:r,retry:u}}function A7n(){const{antfly:e,inference:t,retry:n}=m7n(),{apiUrl:a,inferenceApiUrl:r}=Ro(),[i,o]=(0,z.useState)(!1),s="http://127.0.0.1:8080",l=a.startsWith("/")&&s?`${s}${a}`:a,u=r||`${s}/ai/v1`;(0,z.useEffect)(()=>{e==="connected"&&t==="connected"&&o(!1)},[e,t]);const d=()=>{o(!0)},p=[];Fl("antfly")&&e==="disconnected"&&p.push("antfly"),Fl("inference")&&t==="disconnected"&&p.push("inference");const m=Fl("antfly")&&e==="checking"||Fl("inference")&&t==="checking";if(i||m||p.length===0)return null;const A=p.includes("antfly")&&p.includes("inference"),g=A?"Antfly is not running":p.includes("antfly")?"Antfly data is not connected":"Antfly inference is not connected",h=A?(0,b.jsxs)(b.Fragment,{children:["Run ",(0,b.jsx)("code",{children:"./antfly standalone"}),", or use Settings to connect to another API."]}):p.includes("antfly")?(0,b.jsxs)(b.Fragment,{children:["Checking ",(0,b.jsx)("code",{children:l}),". Run ",(0,b.jsx)("code",{children:"./antfly standalone"})," or update Settings."]}):(0,b.jsxs)(b.Fragment,{children:["Checking ",(0,b.jsx)("code",{children:u}),". Run ",(0,b.jsx)("code",{children:"./antfly standalone"})," or update Settings."]});return(0,b.jsx)("div",{className:"af-connection-banner px-4 py-3",children:(0,b.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,b.jsxs)("div",{className:"flex items-start gap-3",children:[(0,b.jsx)(MP,{className:"af-connection-banner-icon h-5 w-5 mt-0.5 flex-shrink-0"}),(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"af-connection-banner-title",children:g}),(0,b.jsx)("p",{className:"af-connection-banner-description",children:h})]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(0,b.jsxs)(Ct,{variant:"outline",size:"sm",onClick:n,className:"af-connection-banner-action h-7 px-2 text-xs",children:[(0,b.jsx)(_x,{className:"h-3.5 w-3.5 mr-1"}),"Retry"]}),(0,b.jsx)(Ct,{variant:"ghost",size:"sm",onClick:d,"aria-label":"Dismiss",className:"af-connection-banner-action h-7 w-7 p-0",children:(0,b.jsx)(Zp,{className:"h-4 w-4"})})]})]})})}var g7n=class extends z.Component{state={hasError:!1,error:null};static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){console.error("Error caught by boundary:",e,t)}handleRetry=()=>{this.setState({hasError:!1,error:null}),window.location.reload()};render(){return this.state.hasError?this.props.fallback?this.props.fallback:(0,b.jsx)(Hxe,{children:(0,b.jsx)(Wxe,{children:(0,b.jsxs)(jn,{children:[(0,b.jsxs)(Hn,{className:"items-center text-center",children:[(0,b.jsx)(MP,{className:"af-status-icon-warning h-10 w-10"}),(0,b.jsx)(Wn,{children:"Something went wrong"}),(0,b.jsx)(SS,{children:"The application encountered an error. This might be because the backend server is unavailable."})]}),(0,b.jsxs)($n,{className:"space-y-4 text-center",children:[this.state.error&&(0,b.jsx)("p",{className:"rounded-none bg-muted p-2 font-mono text-xs text-muted-foreground",children:this.state.error.message}),(0,b.jsxs)(Ct,{onClick:this.handleRetry,className:"gap-2",children:[(0,b.jsx)(_x,{className:"h-4 w-4"}),"Reload Page"]})]})]})})}):this.props.children}},cte="antfarm-dashboard-generator";function Kjt(){try{return window.localStorage}catch{return null}}function h7n(){const e=Kjt();if(!e)return null;try{const t=e.getItem(cte);if(!t)return null;const n=JSON.parse(t);if(n&&typeof n=="object"&&typeof n.provider=="string"&&typeof n.model=="string")return n}catch{try{e.removeItem(cte)}catch{}}return null}function f7n({children:e}){const[t,n]=(0,z.useState)(h7n),a=(0,z.useCallback)(i=>{n(i);const o=Kjt();if(o)try{i?o.setItem(cte,JSON.stringify(i)):o.removeItem(cte)}catch{}},[]),r=(0,z.useMemo)(()=>({dashboardGenerator:t,setDashboardGenerator:a}),[t,a]);return(0,b.jsx)(Wjt.Provider,{value:r,children:e})}function Cde({children:e,requiredPermission:t}){const{isAuthenticated:n,isLoading:a,hasPermission:r,authEnabled:i}=kR(),o=vu();return a?(0,b.jsx)(Hxe,{children:(0,b.jsx)(Wxe,{children:(0,b.jsx)(jn,{children:(0,b.jsx)($n,{className:"py-6 text-center text-sm text-muted-foreground",children:"Loading..."})})})}):i===!1?(0,b.jsx)(b.Fragment,{children:e}):n?t&&!r(t.resource,t.resourceType,t.permissionType)?(0,b.jsx)(Hxe,{children:(0,b.jsx)(Wxe,{children:(0,b.jsx)(jn,{children:(0,b.jsxs)(Hn,{className:"text-center",children:[(0,b.jsx)(Wn,{children:"Access Denied"}),(0,b.jsx)(SS,{children:"You don't have permission to access this page."})]})})})}):(0,b.jsx)(b.Fragment,{children:e}):(0,b.jsx)(yP,{to:"/login",state:{from:o},replace:!0})}function b7n(e){return e.split(" ").map(t=>t[0]).join("").toUpperCase().slice(0,2)}function y7n(){const{isMobile:e,state:t}=Qre(),{user:n,logout:a,authEnabled:r}=kR(),i=Ym(),[o,s]=z.useState(!1),l=t==="collapsed";if(r===!1)return null;if(!n)return(0,b.jsx)(EC,{children:(0,b.jsx)(is,{children:(0,b.jsxs)("div",{className:"flex items-center gap-2 p-2",children:[(0,b.jsx)(Nl,{className:"h-8 w-8 rounded-none"}),(0,b.jsxs)("div",{className:"flex-1 space-y-2",children:[(0,b.jsx)(Nl,{className:"h-4 w-24"}),(0,b.jsx)(Nl,{className:"h-3 w-32"})]})]})})});const u=b7n(n.username),d=n.username,p=async()=>{s(!0);try{await a(),i("/login")}catch(m){console.error("Failed to logout:",m),s(!1)}};return(0,b.jsx)(EC,{children:(0,b.jsx)(is,{children:(0,b.jsxs)(Pee,{children:[(0,b.jsx)(jee,{asChild:!0,children:(0,b.jsxs)(rs,{size:"lg","aria-label":"Open user menu",className:Ea("data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",l&&"group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-0! relative z-50 pointer-events-auto"),children:[(0,b.jsxs)(Uqe,{className:"h-8 w-8 rounded-none",children:[(0,b.jsx)(Hqe,{src:void 0,alt:d}),(0,b.jsx)(Wqe,{className:"rounded-none bg-primary text-primary-foreground text-xs font-bold",children:u})]}),(0,b.jsxs)("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[(0,b.jsx)("span",{className:"truncate font-medium",children:d}),(0,b.jsxs)("span",{className:"truncate text-xs",children:[n.permissions?.length||0," permission(s)"]})]}),(0,b.jsx)(TOt,{className:"ml-auto size-4 opacity-50 peer-hover/menu-button:opacity-100 peer-data-[state=open]/menu-button:opacity-100 transition-opacity"})]})}),(0,b.jsxs)($ee,{className:"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-none",side:e?"bottom":"right",align:"end",sideOffset:4,children:[(0,b.jsx)(c7t,{className:"p-0 font-normal",children:(0,b.jsxs)("div",{className:"flex items-center gap-2 px-1 py-1.5 text-left text-sm",children:[(0,b.jsxs)(Uqe,{className:"h-8 w-8 rounded-none",children:[(0,b.jsx)(Hqe,{src:void 0,alt:d}),(0,b.jsx)(Wqe,{className:"rounded-none bg-primary text-primary-foreground text-xs font-bold",children:u})]}),(0,b.jsxs)("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[(0,b.jsx)("span",{className:"truncate font-medium",children:d}),(0,b.jsxs)("span",{className:"truncate text-xs",children:[n.permissions?.length||0," permission(s)"]})]})]})}),(0,b.jsx)(zee,{}),(0,b.jsxs)(OP,{onClick:()=>i("/settings"),className:"flex items-center gap-2",children:[(0,b.jsx)(ES,{className:"h-4 w-4"}),"Settings"]}),(0,b.jsx)(zee,{}),(0,b.jsxs)(OP,{onClick:p,disabled:o,className:"flex items-center gap-2 text-destructive focus:text-destructive",children:[(0,b.jsx)(h8n,{className:"h-4 w-4"}),o?"Signing out...":"Sign out"]})]})]})})})}function yUe(e,t){return`/tables/${encodeURIComponent(e)}?section=${encodeURIComponent(t)}`}function w7n({currentSection:e,onSectionChange:t,...n}){const a=vu(),r=Ym(),{state:i,toggleSidebar:o,isMobile:s}=Qre(),{hasPermission:l}=kR(),{tables:u,selectedTable:d,setSelectedTable:p,graphIndexes:m,isLoadingIndexes:A}=yb(),g=!lie()&&l("*","*","admin"),[h,f]=z.useState(!1),[y,w]=z.useState(!1),[v,k]=z.useState(!1);z.useEffect(()=>{k(!0)},[]);const _=L=>{d&&(t?.(L),r(yUe(d,L)))},x=L=>{r(`${L}${d?`?table=${encodeURIComponent(d)}`:""}`)},E=a.pathname.startsWith("/tables/"),S=L=>E&&e===L,D=L=>a.pathname===L;return(0,b.jsxs)(pQn,{collapsible:"icon",...n,children:[(0,b.jsx)(AQn,{className:"border-r border-b-0 group-data-[collapsible=icon]:border-r-0 gap-0 pb-0",children:(0,b.jsx)(EC,{children:(0,b.jsx)(is,{children:(0,b.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[i==="collapsed"&&!s?(0,b.jsx)(u8,{delayDuration:0,children:(0,b.jsxs)(Bx,{children:[(0,b.jsx)(Ix,{asChild:!0,children:(0,b.jsx)(rs,{size:"lg",className:"cursor-e-resize",onClick:o,children:(0,b.jsx)("div",{className:"flex items-center justify-center",style:{minWidth:32,height:32},children:(0,b.jsx)(IP,{size:32,eyeStyle:"original",float:!1,showShadow:!1,showGlow:!0,style:{height:32}})})})}),(0,b.jsx)(Sx,{side:"right",align:"center",children:"Open sidebar"})]})}):(0,b.jsxs)(rs,{size:"lg",className:"cursor-default",children:[(0,b.jsx)("div",{className:"flex h-8 min-w-8 items-center justify-center",children:(0,b.jsx)(IP,{size:24,eyeStyle:"original",float:!1,showShadow:!1,showGlow:!0,style:{height:24}})}),(0,b.jsx)("div",{className:"flex min-w-0 flex-1 items-center text-left text-sm leading-tight",children:(0,b.jsx)("span",{className:"truncate font-semibold",children:"Antfarm"})})]}),v&&(s||i!=="collapsed")&&(0,b.jsx)(u8,{delayDuration:0,children:(0,b.jsxs)(Bx,{open:y,onOpenChange:w,children:[(0,b.jsx)(Ix,{asChild:!0,children:(0,b.jsxs)(Ct,{variant:"ghost",size:"icon",className:Ea("size-7 shrink-0",s?"cursor-pointer":"cursor-w-resize"),onClick:o,onMouseEnter:()=>w(!0),onMouseLeave:()=>w(!1),children:[s?(0,b.jsx)(Zp,{className:"size-4"}):(0,b.jsx)(S8n,{className:"size-4"}),(0,b.jsx)("span",{className:"sr-only",children:s?"Close sidebar":"Collapse sidebar"})]})}),(0,b.jsx)(Sx,{side:"right",align:"center",children:s?"Close sidebar":"Collapse sidebar"})]})})]})})})}),(0,b.jsxs)(hQn,{className:"border-r border-t-0 group-data-[collapsible=icon]:border-r-0",children:[Fl("antfly")&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(g6,{children:[(0,b.jsx)(h6,{className:"mono-label",children:"Data"}),(0,b.jsxs)(f6,{children:[(0,b.jsx)(EC,{children:(0,b.jsx)(is,{children:(0,b.jsx)(rs,{asChild:!0,isActive:D("/")||D("/create")||S("overview"),tooltip:"Tables",children:(0,b.jsxs)("a",{href:"/",onClick:L=>{L.preventDefault(),t?.("overview"),r("/")},children:[(0,b.jsx)(YOt,{className:"size-4"}),(0,b.jsx)("span",{children:"Tables"})]})})})}),(0,b.jsx)("div",{className:"px-2 pt-2 pb-1 group-data-[collapsible=icon]:hidden",children:(0,b.jsxs)(kQn,{open:h,onOpenChange:f,children:[(0,b.jsx)(_Qn,{disabled:u.length===0,placeholder:"Select a table...",children:d}),(0,b.jsx)(CQn,{searchPlaceholder:"Search tables...",emptyMessage:"No table found.",heading:"Tables",footer:(0,b.jsxs)(EQn,{onClick:()=>r("/create"),children:[(0,b.jsx)(Ju,{className:"size-4"}),(0,b.jsx)("span",{children:"Create table"})]}),children:u.map(L=>(0,b.jsx)(xQn,{value:L.name,selected:d===L.name,onSelect:F=>{p(F),t?.("overview"),r(yUe(F,"overview"))},children:L.name},L.name))})]})})]})]}),(0,b.jsxs)(g6,{children:[(0,b.jsx)(h6,{className:"mono-label",children:"Retrieval"}),(0,b.jsx)(f6,{children:(0,b.jsxs)(EC,{children:[(0,b.jsx)(is,{children:(0,b.jsxs)(rs,{isActive:S("semantic"),tooltip:"Search",disabled:!d,className:"disabled:opacity-50",onClick:()=>_("semantic"),children:[(0,b.jsx)(nm,{className:"size-4"}),(0,b.jsx)("span",{children:"Search"})]})}),(0,b.jsx)(is,{children:(0,b.jsxs)(rs,{isActive:D("/data/playground/chat"),tooltip:"Ask",disabled:!d,className:"disabled:opacity-50",onClick:()=>x("/data/playground/chat"),children:[(0,b.jsx)(KFe,{className:"size-4"}),(0,b.jsx)("span",{children:"Ask"})]})}),(0,b.jsx)(is,{children:(0,b.jsxs)(rs,{isActive:D("/data/playground/evals"),tooltip:"Evaluate",disabled:!d,className:"disabled:opacity-50",onClick:()=>x("/data/playground/evals"),children:[(0,b.jsx)(ZFe,{className:"size-4"}),(0,b.jsx)("span",{children:"Evaluate"})]})}),(0,b.jsx)(is,{children:(0,b.jsxs)(rs,{isActive:S("graph"),tooltip:m.length>0?"Graph":"Create a graph index first",disabled:!d||!A&&m.length===0,className:"disabled:opacity-50",onClick:()=>_("graph"),children:[(0,b.jsx)(g0,{className:"size-4"}),(0,b.jsx)("span",{children:"Graph"})]})})]})})]}),(0,b.jsxs)(g6,{children:[(0,b.jsx)(h6,{className:"mono-label",children:"Ingest"}),(0,b.jsx)(f6,{children:(0,b.jsxs)(EC,{children:[(0,b.jsx)(is,{children:(0,b.jsxs)(rs,{isActive:S("bulk"),tooltip:"Upload",disabled:!d,className:"disabled:opacity-50",onClick:()=>_("bulk"),children:[(0,b.jsx)(BS,{className:"size-4"}),(0,b.jsx)("span",{children:"Upload"})]})}),(0,b.jsx)(is,{children:(0,b.jsxs)(rs,{isActive:S("document-builder"),tooltip:"Manual Entry",disabled:!d,className:"disabled:opacity-50",onClick:()=>_("document-builder"),children:[(0,b.jsx)(ROt,{className:"size-4"}),(0,b.jsx)("span",{children:"Manual Entry"})]})}),(0,b.jsx)(is,{children:(0,b.jsxs)(rs,{isActive:S("artifacts"),tooltip:"Artifacts",disabled:!d,className:"disabled:opacity-50",onClick:()=>_("artifacts"),children:[(0,b.jsx)(QOt,{className:"size-4"}),(0,b.jsx)("span",{children:"Artifacts"})]})}),(0,b.jsx)(is,{children:(0,b.jsxs)(rs,{isActive:S("reprocess"),tooltip:"Reprocess",disabled:!d,className:"disabled:opacity-50",onClick:()=>_("reprocess"),children:[(0,b.jsx)(UOt,{className:"size-4"}),(0,b.jsx)("span",{children:"Reprocess"})]})})]})})]})]}),Fl("inference")&&(0,b.jsxs)(g6,{children:[(0,b.jsx)(h6,{className:"mono-label",children:"Models"}),(0,b.jsx)(f6,{children:(0,b.jsxs)(EC,{children:[(0,b.jsx)(is,{children:(0,b.jsx)(rs,{asChild:!0,isActive:D("/inference/models"),tooltip:"Runtime",children:(0,b.jsxs)("a",{href:"/inference/models",onClick:L=>{L.preventDefault(),r("/inference/models")},children:[(0,b.jsx)(MOt,{className:"size-4"}),(0,b.jsx)("span",{children:"Runtime"})]})})}),(0,b.jsx)("div",{className:"px-2 py-1.5 mono-label text-sidebar-foreground/50 group-data-[collapsible=icon]:hidden",children:"Tools"}),(0,b.jsx)(is,{children:(0,b.jsx)(rs,{asChild:!0,isActive:D("/inference/playground/chunk"),tooltip:"Chunk Text",children:(0,b.jsxs)("a",{href:"/inference/playground/chunk",onClick:L=>{L.preventDefault(),r("/inference/playground/chunk")},children:[(0,b.jsx)(uT,{className:"size-4"}),(0,b.jsx)("span",{children:"Chunk Text"})]})})}),(0,b.jsx)(is,{children:(0,b.jsx)(rs,{asChild:!0,isActive:D("/inference/playground/extract"),tooltip:"Extract",children:(0,b.jsxs)("a",{href:"/inference/playground/extract",onClick:L=>{L.preventDefault(),r("/inference/playground/extract")},children:[(0,b.jsx)(LL,{className:"size-4"}),(0,b.jsx)("span",{children:"Extract"})]})})}),(0,b.jsx)(is,{children:(0,b.jsx)(rs,{asChild:!0,isActive:D("/inference/playground/rewrite"),tooltip:"Rewrite",children:(0,b.jsxs)("a",{href:"/inference/playground/rewrite",onClick:L=>{L.preventDefault(),r("/inference/playground/rewrite")},children:[(0,b.jsx)(GOt,{className:"size-4"}),(0,b.jsx)("span",{children:"Rewrite"})]})})}),(0,b.jsx)(is,{children:(0,b.jsx)(rs,{asChild:!0,isActive:D("/inference/playground/rerank"),tooltip:"Rerank",children:(0,b.jsxs)("a",{href:"/inference/playground/rerank",onClick:L=>{L.preventDefault(),r("/inference/playground/rerank")},children:[(0,b.jsx)(O$,{className:"size-4"}),(0,b.jsx)("span",{children:"Rerank"})]})})}),(0,b.jsx)(is,{children:(0,b.jsx)(rs,{asChild:!0,isActive:D("/inference/playground/kg"),tooltip:"Knowledge Graph",children:(0,b.jsxs)("a",{href:"/inference/playground/kg",onClick:L=>{L.preventDefault(),r("/inference/playground/kg")},children:[(0,b.jsx)(g0,{className:"size-4"}),(0,b.jsx)("span",{children:"Knowledge Graph"})]})})}),(0,b.jsx)(is,{children:(0,b.jsx)(rs,{asChild:!0,isActive:D("/inference/playground/embed"),tooltip:"Embed",children:(0,b.jsxs)("a",{href:"/inference/playground/embed",onClick:L=>{L.preventDefault(),r("/inference/playground/embed")},children:[(0,b.jsx)(n6e,{className:"size-4"}),(0,b.jsx)("span",{children:"Embed"})]})})}),(0,b.jsx)(is,{children:(0,b.jsx)(rs,{asChild:!0,isActive:D("/inference/playground/read"),tooltip:"Read Image",children:(0,b.jsxs)("a",{href:"/inference/playground/read",onClick:L=>{L.preventDefault(),r("/inference/playground/read")},children:[(0,b.jsx)(e6e,{className:"size-4"}),(0,b.jsx)("span",{children:"Read Image"})]})})}),(0,b.jsx)(is,{children:(0,b.jsx)(rs,{asChild:!0,isActive:D("/inference/playground/transcribe"),tooltip:"Transcribe",children:(0,b.jsxs)("a",{href:"/inference/playground/transcribe",onClick:L=>{L.preventDefault(),r("/inference/playground/transcribe")},children:[(0,b.jsx)(VN,{className:"size-4"}),(0,b.jsx)("span",{children:"Transcribe"})]})})})]})})]}),Fl("antfly")&&(0,b.jsxs)(g6,{children:[(0,b.jsx)(h6,{className:"mono-label",children:"Operations"}),(0,b.jsx)(f6,{children:(0,b.jsxs)(EC,{children:[(0,b.jsx)(is,{children:(0,b.jsx)(rs,{asChild:!0,isActive:D("/cluster"),tooltip:"Cluster",children:(0,b.jsxs)("a",{href:"/cluster",onClick:L=>{L.preventDefault(),r("/cluster")},children:[(0,b.jsx)(g0,{className:"size-4"}),(0,b.jsx)("span",{children:"Cluster"})]})})}),g&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(is,{children:(0,b.jsx)(rs,{asChild:!0,isActive:D("/users"),tooltip:"Users",children:(0,b.jsxs)("a",{href:"/users",onClick:L=>{L.preventDefault(),r("/users")},children:[(0,b.jsx)(t6e,{className:"size-4"}),(0,b.jsx)("span",{children:"Users"})]})})}),(0,b.jsx)(is,{children:(0,b.jsx)(rs,{asChild:!0,isActive:D("/secrets"),tooltip:"Secrets",children:(0,b.jsxs)("a",{href:"/secrets",onClick:L=>{L.preventDefault(),r("/secrets")},children:[(0,b.jsx)(JFe,{className:"size-4"}),(0,b.jsx)("span",{children:"Secrets"})]})})})]}),(0,b.jsx)(is,{children:(0,b.jsx)(rs,{asChild:!0,isActive:a.pathname==="/connections",tooltip:"Connected Providers & Stores",children:(0,b.jsxs)("a",{href:"/connections",onClick:L=>{L.preventDefault(),r("/connections")},children:[(0,b.jsx)(qOt,{className:"size-4"}),(0,b.jsx)("span",{children:"Connections"})]})})})]})})]})]}),(0,b.jsx)(gQn,{className:"border-r group-data-[collapsible=icon]:border-r-0",children:(0,b.jsx)(y7n,{})})]})}function Zjt(e){return Array.isArray(e)?e:e&&typeof e=="object"&&"tables"in e&&Array.isArray(e.tables)?e.tables:[]}function v7n({children:e}){const t=dh(),n=vu(),a=Ym(),[r,i]=pR(),[o,s]=(0,z.useState)([]),[l,u]=(0,z.useState)(()=>Fl("antfly")),[d,p]=(0,z.useState)([]),[m,A]=(0,z.useState)([]),[g,h]=(0,z.useState)([]),[f,y]=(0,z.useState)(!1),[w,v]=(0,z.useState)(""),[k,_]=(0,z.useState)(()=>{const D=n.pathname.match(/^\/tables\/([^/]+)/);return D?decodeURIComponent(D[1]):r.get("table")||""}),x=(0,z.useRef)(n.pathname);(0,z.useEffect)(()=>{const D=n.pathname.match(/^\/tables\/([^/]+)/),L=D?decodeURIComponent(D[1]):void 0,F=r.get("table"),M=L||F||"";M&&_(M)},[n.pathname,r]),(0,z.useEffect)(()=>{if(n.pathname.startsWith("/tables/"))return;const D=r.get("table");k&&D!==k&&i(L=>(L.set("table",k),L),{replace:!0}),x.current=n.pathname},[n.pathname,k,r,i]);const E=(0,z.useCallback)(D=>{_(D),n.pathname.startsWith("/tables/")?a(`/tables/${encodeURIComponent(D)}?section=overview`):i(L=>(L.set("table",D),L),{replace:!0})},[n.pathname,a,i]),S=(0,z.useCallback)(async()=>{if(Fl("antfly")){u(!0);try{s(Zjt(await t.tables.list()))}catch{s([])}finally{u(!1)}}},[t]);return(0,z.useEffect)(()=>{S()},[S]),(0,z.useEffect)(()=>{!k&&o.length>0&&E(o[0].name)},[o,k,E]),(0,z.useEffect)(()=>{(async()=>{if(!k){p([]),A([]),h([]),v("");return}y(!0);try{const L=await t.indexes.list(k)||[],F=L.filter(B=>B.config?.type?.includes("aknn")||B.config?.type?.includes("embedding")).map(B=>B.config?.name||"").filter(Boolean),M=L.filter(B=>B.config?.type?.includes("aknn")||B.config?.type?.includes("embedding")||B.config?.type?.includes("full_text")).map(B=>B.config?.name||"").filter(Boolean),Q=L.filter(B=>B.config?.type==="graph").map(B=>B.config?.name||"").filter(Boolean);p(F),A(Q),h(M),F.length>0?v(F[0]):v("")}catch{p([]),A([]),h([]),v("")}finally{y(!1)}})()},[k,t]),(0,b.jsx)($jt.Provider,{value:{tables:o,isLoadingTables:l,selectedTable:k,setSelectedTable:E,embeddingIndexes:d,graphIndexes:m,chatIndexes:g,isLoadingIndexes:f,selectedIndex:w,setSelectedIndex:v,refreshTables:S},children:e})}function k7n({onCreate:e}){return(0,b.jsx)(xx,{title:"No tables yet",description:"Create a table, add data, create an index, then search or ask questions over it.",action:e?(0,b.jsx)(Ct,{variant:"brand",onClick:e,children:"Create Table"}):void 0})}function Jjt({query:e}){return(0,b.jsx)(xx,{title:"No results found",description:e?`No results matched "${e}". Try adjusting your query or filters.`:"Try a different search query or adjust your filters."})}function Xjt({message:e,onRetry:t}){return(0,b.jsx)(xx,{title:"Something went wrong",description:e||"An unexpected error occurred. Please try again.",action:t?(0,b.jsx)(Ct,{variant:"outline",onClick:t,children:"Try Again"}):void 0})}function _7n(){return(0,b.jsx)(xx,{title:"No users configured",description:"Create users and assign permissions to manage access to your Antfly instance."})}function C7n(){return(0,b.jsx)(xx,{title:"No secrets stored",description:"Add secrets to securely store API keys, tokens, and other sensitive configuration."})}function wb(){return(0,b.jsx)(xx,{title:"Ready to experiment",description:"Configure your settings above and run a query to see results.",className:"border-none bg-transparent"})}function R0(){const{inferenceConnectionId:e,setInferenceConnectionId:t}=Ro(),{providers:n,loading:a,error:r,retry:i}=CR(),o=(0,z.useMemo)(()=>n.filter(u=>u.inference?.provider==="antfly").sort((u,d)=>u.id==="local-inference"?-1:d.id==="local-inference"?1:(u.display_name??u.name).localeCompare(d.display_name??d.name)),[n]),s=o.find(u=>u.id===e),l=a?"checking":s?.status==="connected"?"connected":"disconnected";return(0,z.useEffect)(()=>{!a&&o.length>0&&!s&&t(o[0].id)},[o,a,s,t]),l==="checking"?(0,b.jsxs)("div",{className:"flex items-center gap-2 mb-4 p-3 rounded-none border bg-muted/30",children:[(0,b.jsx)(Nl,{className:"h-4 w-4 rounded-full"}),(0,b.jsx)(Nl,{className:"h-4 w-32"}),(0,b.jsx)(Nl,{className:"h-4 w-24"})]}):l==="disconnected"?(0,b.jsxs)("div",{className:"flex items-center justify-between mb-4 p-3 rounded-none border border-destructive/30 bg-destructive/5",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[(0,b.jsx)(vRn,{className:"h-4 w-4"}),(0,b.jsx)("span",{children:r??(o.length===0?"No Antfly-compatible inference connection is configured":"Selected inference connection is unavailable")})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(Yjt,{trigger:(0,b.jsxs)(Ct,{variant:"outline",size:"sm",className:"h-7 text-xs",children:[(0,b.jsx)(ES,{className:"h-3 w-3 mr-1"}),"Configure"]})}),(0,b.jsx)(Ct,{variant:"outline",size:"sm",onClick:i,className:"h-7 text-xs",children:"Retry"})]})]}):(0,b.jsxs)("div",{className:"flex items-center gap-2 mb-4 p-3 rounded-none border bg-muted/30 flex-wrap",children:[(0,b.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,b.jsxs)("span",{className:"relative flex h-2.5 w-2.5",children:[(0,b.jsx)("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full af-status-bar-success opacity-75"}),(0,b.jsx)("span",{className:"relative inline-flex rounded-full h-2.5 w-2.5 af-status-bar-success"})]}),(0,b.jsx)(_Rn,{className:"h-3.5 w-3.5 text-muted-foreground"})]}),(0,b.jsxs)("label",{className:"flex items-center gap-2 text-xs",children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:"Connection"}),(0,b.jsx)("select",{value:e,onChange:u=>t(u.target.value),className:"h-7 border bg-background px-2","aria-label":"Inference connection",children:o.map(u=>(0,b.jsx)("option",{value:u.id,children:u.display_name??u.name},u.id))})]})]})}function wUe(e){return"text"in e}var vUe={provider:"antfly",strategy:"fixed",model:"fixed",target_tokens:500,overlap_tokens:50,separator:"\\n\\n",max_chunks:50,threshold:.5},mH=["af-chart-surface af-chart-surface-1","af-chart-surface af-chart-surface-2","af-chart-surface af-chart-surface-3","af-chart-surface af-chart-surface-4","af-chart-surface af-chart-surface-5","af-chart-surface af-chart-surface-6"],x7n=["af-chart-text af-chart-text-1","af-chart-text af-chart-text-2","af-chart-text af-chart-text-3","af-chart-text af-chart-text-4","af-chart-text af-chart-text-5","af-chart-text af-chart-text-6"];function kUe(e){const t=["text","content","body","description","summary","title","name"],n=[];for(const a of t){const r=e[a];typeof r=="string"&&r.length>0&&n.push(r)}return n.length===0?JSON.stringify(e,null,2):n.join(`
|
|
102
|
+
`;if(e==="/db/v1/tables/{tableName}/query"&&n!==void 0){const{data:r,error:i,response:o}=await this.client.POST("/db/v1/tables/{tableName}/query",{params:{path:{tableName:n}},body:a,headers:{"Content-Type":"application/x-ndjson"}});if(i)throw C4("Table multi-query failed",i,o);return lH(r,t,n),r}else{const{data:r,error:i,response:o}=await this.client.POST("/db/v1/query",{body:a,headers:{"Content-Type":"application/x-ndjson"}});if(i)throw C4("Multi-query failed",i,o);return lH(r,t),r}}async query(e,t){return(await this.performQuery("/db/v1/query",e,void 0,t))?.responses?.[0]}async multiquery(e){for(const[t,n]of e.entries())lUe(n,t);return this.performMultiquery("/db/v1/query",e)}async performRetrievalAgent(e,t){const n={"Content-Type":"application/json",Accept:"text/event-stream, application/json"},a=this.getAuthHeader();a&&(n.Authorization=a),Object.assign(n,this.config.headers);const r=new AbortController,i=await fetch(`${x6(this.config.baseUrl)}/db/v1/agents/retrieval`,{method:"POST",headers:n,body:JSON.stringify(e),signal:r.signal});if(!i.ok){const l=await i.text();let u=l;try{u=JSON.parse(l)}catch{}throw C4("Retrieval agent request failed",u,i)}if(!i.body)throw new Error("Response body is null");const o=i.headers.get("content-type")||"";if(o.includes("application/json"))return await i.json();if(o.split(";",1)[0]?.trim().toLowerCase()!=="text/event-stream")throw await i.body.cancel(),new Error("Retrieval agent returned an unsupported content type");if(!t)return await i.body.cancel(),r;const s=i.body;return(async()=>{try{for await(const l of VMn(s,"Retrieval agent")){if(r.signal.aborted)return;switch(l.event){case"classification":t.onClassification?.(JSON.parse(l.data));break;case"reasoning":t.onReasoning?.(JSON.parse(l.data));break;case"hit":t.onHit?.(JSON.parse(l.data));break;case"generation":t.onGeneration?.(JSON.parse(l.data));break;case"step_started":t.onStepStarted?.(JSON.parse(l.data));break;case"step_progress":t.onStepProgress?.(JSON.parse(l.data));break;case"step_completed":t.onStepCompleted?.(JSON.parse(l.data));break;case"tool_mode":t.onToolMode?.(JSON.parse(l.data));break;case"followup":t.onFollowup?.(JSON.parse(l.data));break;case"eval":t.onEvalResult?.(JSON.parse(l.data));break;case"done":{const u=JSON.parse(l.data);if(u===null||typeof u!="object"||Array.isArray(u))throw new Error("Retrieval agent returned an invalid done result");typeof u.generation_confidence=="number"&&typeof u.context_relevance=="number"&&t.onConfidence?.({generation_confidence:u.generation_confidence,context_relevance:u.context_relevance}),t.onDone?.(u);return}case"error":{const u=JSON.parse(l.data);if(Njt(u))throw new Djt(u);const d=u!==null&&typeof u=="object"&&u.error?String(u.error):String(u);throw new Error(d)}}}throw new Error("Retrieval agent stream ended before done")}catch(l){if(!r.signal.aborted){const u=l instanceof Error?l:new Error(String(l));t.onErrorDetail?.(u),t.onError?.(u.message)}}})(),r}async retrievalAgent(e,t){if(t)return this.streamRetrievalAgent(e,t);const n=await this.performRetrievalAgent({...e,stream:!1});if(n instanceof AbortController)throw n.abort(),new Error("Retrieval agent returned a stream for a JSON request");return n}async streamRetrievalAgent(e,t){const n=await this.performRetrievalAgent({...e,stream:!0},t);return n instanceof AbortController?n:(t.onDone?.(n),new AbortController)}async chatAgent(e,t,n=[],a){const r={query:e,queries:[{table:t.table,semantic_search:e,indexes:t.semanticIndexes,limit:t.limit??10}],generator:t.generator,messages:[...n,{role:"user",content:e}],max_internal_iterations:t.maxInternalIterations??5,stream:!!a,agent_knowledge:t.agentKnowledge};if(t.steps&&(r.steps=t.steps),a){let o="",s,l,u=!1,d=()=>{};const p=new Promise((y,w)=>{s=y,l=w});p.catch(()=>{});const m=y=>{u||(u=!0,d(),l(y))},A={...a,onGeneration:y=>{o+=y,a.onGeneration?.(y)},onDone:y=>{o=y.generation??o;const w=y.messages?.length?y.messages:[...n,{role:"user",content:e},{role:"assistant",content:o}];u=!0,d(),s(w),a.onAssistantMessage?.(o),a.onMessagesUpdated?.(w),a.onDone?.(y)},onErrorDetail:y=>{m(y),a.onErrorDetail?.(y)}},g=await this.streamRetrievalAgent(r,A),{signal:h}=g,f=()=>m(h.reason instanceof Error?h.reason:new DOMException("Chat turn aborted","AbortError"));return h.aborted?f():u||(h.addEventListener("abort",f,{once:!0}),d=()=>h.removeEventListener("abort",f)),{abortController:g,messages:p}}const i=await this.retrievalAgent(r);return{result:i,messages:i.messages?.length?i.messages:[...n,{role:"user",content:e},...i.generation?[{role:"assistant",content:i.generation}]:[]]}}async queryBuilderAgent(e){const{data:t,error:n,response:a}=await this.client.POST("/db/v1/agents/query-builder",{body:e});if(n)throw C4("Query builder agent failed",n,a);return t}async multiBatch(e){return this.multiBatchWithOptions(e)}async multiBatchWithOptions(e,t){const{data:n}=await this.postBoundedJSON("/db/v1/batch",e,t,"Multi-batch operation failed","marshalling multi-batch request");return n??{}}async linearMerge(e,t){return this.linearMergeWithOptions(e,t)}async linearMergeWithOptions(e,t,n){const{data:a}=await this.postBoundedJSON(`/db/v1/tables/${encodeURIComponent(e)}/merge`,t,n,"Linear merge operation failed","marshalling linear merge request");if(!a)throw new Error("Linear merge operation failed: unexpected empty response");return a}async evaluate(e){const{data:t,error:n}=await this.client.POST("/db/v1/eval",{body:e});if(n)throw new Error(`Evaluation failed: ${n.error}`);return t}getRawClient(){return this.client}};function x6(e){return e.trim().replace(/\/$/,"").replace(/\/db\/v1$/,"").replace(/\/auth\/v1$/,"").replace(/\/ai\/v1$/,"")}function Rjt(e){return e?.hits?.total??void 0}function lOn(e){return e?.value}function Qjt(e){return lOn(Rjt(e))}var Fjt={antfly:{index:!0},bedrock:{index:!0},cohere:{index:!1},gemini:{index:!1},ollama:{index:!0},openai:{index:!0},openrouter:{index:!1},vertex:{index:!1}},uOn=Object.keys(Fjt),dOn=uOn.filter(e=>Fjt[e].index),pOn={antfly:{},gemini:{},ollama:{},openai:{},openrouter:{},vertex:{}},mOn=Object.keys(pOn),gde="gguf",AOn="antflydb/clipclap:gguf:Q4_K",gOn="antflydb/gliner2-base-v1:gguf:Q4_K",hOn="antflydb/mxbai-rerank-base-v1",bYa=Object.freeze([{name:AOn,task:"embedder",defaultFormat:gde,defaultVariant:"Q4_K"},{name:gOn,task:"extractor",defaultFormat:gde,defaultVariant:"Q4_K"},{name:hOn,task:"reranker",defaultFormat:gde,defaultVariant:"Q4_K"}]),Mjt=(0,z.createContext)(void 0);function hT(){return typeof window>"u"?{}:window.__ANTFARM_CONFIG__??{}}function fOn(){const e=hT().basePath?.trim();return!e||e==="/"?"":e.replace(/\/$/,"")}function lie(){return hT().authMode==="external"}var hde=()=>{const e=hT().apiUrl;return e||"/db/v1"},fde=()=>{const e=hT().inferenceApiUrl;return e||""},bde="antfarm-api-url",yde="antfarm-inference-api-url",mUe="antfarm-inference-connection";function bOn({children:e}){const t=hT(),n=!!t.apiUrl,a=!!t.inferenceApiUrl,[r,i]=(0,z.useState)(()=>n?hde():localStorage.getItem(bde)||hde()),[o,s]=(0,z.useState)(()=>a?fde():localStorage.getItem(yde)||fde()),[l,u]=(0,z.useState)(()=>localStorage.getItem(mUe)||"local-inference"),[d,p]=(0,z.useState)(()=>new ox({baseUrl:r})),m=w=>{if(n)return;const v=w.trim();i(v),localStorage.setItem(bde,v),p(new ox({baseUrl:v}))},A=()=>{const w=hde();i(w),localStorage.removeItem(bde),p(new ox({baseUrl:w}))},g=w=>{if(a)return;const v=w.trim();s(v),localStorage.setItem(yde,v)},h=()=>{s(fde()),localStorage.removeItem(yde)},f=(0,z.useCallback)(w=>{u(w),localStorage.setItem(mUe,w)},[]),y=(0,z.useCallback)(w=>l==="local-inference"?`${o}/ai/v1/${w}`:`${r}/connections/${encodeURIComponent(l)}/inference/${w}`,[r,o,l]);return(0,b.jsx)(Mjt.Provider,{value:{apiUrl:r,setApiUrl:m,client:d,resetToDefault:A,inferenceApiUrl:o,setInferenceApiUrl:g,resetInferenceApiUrl:h,inferenceConnectionId:l,setInferenceConnectionId:f,inferenceUrl:y},children:e})}function uh(e,t){if(e==null)return{};var n={},a=Object.keys(e),r,i;for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&(n[r]=e[r]);return n}var yOn=["color"],wOn=(0,z.forwardRef)(function(e,t){var n=e.color,a=n===void 0?"currentColor":n,r=uh(e,yOn);return(0,z.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),(0,z.createElement)("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))}),vOn=["color"],kOn=(0,z.forwardRef)(function(e,t){var n=e.color,a=n===void 0?"currentColor":n,r=uh(e,vOn);return(0,z.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),(0,z.createElement)("path",{d:"M6.1584 3.13508C6.35985 2.94621 6.67627 2.95642 6.86514 3.15788L10.6151 7.15788C10.7954 7.3502 10.7954 7.64949 10.6151 7.84182L6.86514 11.8418C6.67627 12.0433 6.35985 12.0535 6.1584 11.8646C5.95694 11.6757 5.94673 11.3593 6.1356 11.1579L9.565 7.49985L6.1356 3.84182C5.94673 3.64036 5.95694 3.32394 6.1584 3.13508Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))}),_On=["color"],COn=(0,z.forwardRef)(function(e,t){var n=e.color,a=n===void 0?"currentColor":n,r=uh(e,_On);return(0,z.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),(0,z.createElement)("path",{d:"M1 9.50006C1 10.3285 1.67157 11.0001 2.5 11.0001H4L4 10.0001H2.5C2.22386 10.0001 2 9.7762 2 9.50006L2 2.50006C2 2.22392 2.22386 2.00006 2.5 2.00006L9.5 2.00006C9.77614 2.00006 10 2.22392 10 2.50006V4.00002H5.5C4.67158 4.00002 4 4.67159 4 5.50002V12.5C4 13.3284 4.67158 14 5.5 14H12.5C13.3284 14 14 13.3284 14 12.5V5.50002C14 4.67159 13.3284 4.00002 12.5 4.00002H11V2.50006C11 1.67163 10.3284 1.00006 9.5 1.00006H2.5C1.67157 1.00006 1 1.67163 1 2.50006V9.50006ZM5 5.50002C5 5.22388 5.22386 5.00002 5.5 5.00002H12.5C12.7761 5.00002 13 5.22388 13 5.50002V12.5C13 12.7762 12.7761 13 12.5 13H5.5C5.22386 13 5 12.7762 5 12.5V5.50002Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))}),xOn=["color"],K$=(0,z.forwardRef)(function(e,t){var n=e.color,a=n===void 0?"currentColor":n,r=uh(e,xOn);return(0,z.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),(0,z.createElement)("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))}),EOn=["color"],BOn=(0,z.forwardRef)(function(e,t){var n=e.color,a=n===void 0?"currentColor":n,r=uh(e,EOn);return(0,z.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),(0,z.createElement)("path",{d:"M7.07095 0.650238C6.67391 0.650238 6.32977 0.925096 6.24198 1.31231L6.0039 2.36247C5.6249 2.47269 5.26335 2.62363 4.92436 2.81013L4.01335 2.23585C3.67748 2.02413 3.23978 2.07312 2.95903 2.35386L2.35294 2.95996C2.0722 3.2407 2.0232 3.6784 2.23493 4.01427L2.80942 4.92561C2.62307 5.2645 2.47227 5.62594 2.36216 6.00481L1.31209 6.24287C0.924883 6.33065 0.650024 6.6748 0.650024 7.07183V7.92897C0.650024 8.32601 0.924883 8.67015 1.31209 8.75794L2.36228 8.99603C2.47246 9.375 2.62335 9.73652 2.80979 10.0755L2.2354 10.9867C2.02367 11.3225 2.07267 11.7602 2.35341 12.041L2.95951 12.6471C3.24025 12.9278 3.67795 12.9768 4.01382 12.7651L4.92506 12.1907C5.26384 12.377 5.62516 12.5278 6.0039 12.6379L6.24198 13.6881C6.32977 14.0753 6.67391 14.3502 7.07095 14.3502H7.92809C8.32512 14.3502 8.66927 14.0753 8.75705 13.6881L8.99505 12.6383C9.37411 12.5282 9.73573 12.3773 10.0748 12.1909L10.986 12.7653C11.3218 12.977 11.7595 12.928 12.0403 12.6473L12.6464 12.0412C12.9271 11.7604 12.9761 11.3227 12.7644 10.9869L12.1902 10.076C12.3768 9.73688 12.5278 9.37515 12.638 8.99596L13.6879 8.75794C14.0751 8.67015 14.35 8.32601 14.35 7.92897V7.07183C14.35 6.6748 14.0751 6.33065 13.6879 6.24287L12.6381 6.00488C12.528 5.62578 12.3771 5.26414 12.1906 4.92507L12.7648 4.01407C12.9766 3.6782 12.9276 3.2405 12.6468 2.95975L12.0407 2.35366C11.76 2.07292 11.3223 2.02392 10.9864 2.23565L10.0755 2.80989C9.73622 2.62328 9.37437 2.47229 8.99505 2.36209L8.75705 1.31231C8.66927 0.925096 8.32512 0.650238 7.92809 0.650238H7.07095ZM4.92053 3.81251C5.44724 3.44339 6.05665 3.18424 6.71543 3.06839L7.07095 1.50024H7.92809L8.28355 3.06816C8.94267 3.18387 9.5524 3.44302 10.0794 3.81224L11.4397 2.9547L12.0458 3.56079L11.1882 4.92117C11.5573 5.44798 11.8164 6.0575 11.9321 6.71638L13.5 7.07183V7.92897L11.932 8.28444C11.8162 8.94342 11.557 9.55301 11.1878 10.0798L12.0453 11.4402L11.4392 12.0462L10.0787 11.1886C9.55192 11.5576 8.94241 11.8166 8.28355 11.9323L7.92809 13.5002H7.07095L6.71543 11.932C6.0569 11.8162 5.44772 11.5572 4.92116 11.1883L3.56055 12.046L2.95445 11.4399L3.81213 10.0794C3.4431 9.55266 3.18403 8.94326 3.06825 8.2845L1.50002 7.92897V7.07183L3.06818 6.71632C3.18388 6.05765 3.44283 5.44833 3.81171 4.92165L2.95398 3.561L3.56008 2.95491L4.92053 3.81251ZM9.02496 7.50008C9.02496 8.34226 8.34223 9.02499 7.50005 9.02499C6.65786 9.02499 5.97513 8.34226 5.97513 7.50008C5.97513 6.65789 6.65786 5.97516 7.50005 5.97516C8.34223 5.97516 9.02496 6.65789 9.02496 7.50008ZM9.92496 7.50008C9.92496 8.83932 8.83929 9.92499 7.50005 9.92499C6.1608 9.92499 5.07513 8.83932 5.07513 7.50008C5.07513 6.16084 6.1608 5.07516 7.50005 5.07516C8.83929 5.07516 9.92496 6.16084 9.92496 7.50008Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))}),IOn=["color"],AUe=(0,z.forwardRef)(function(e,t){var n=e.color,a=n===void 0?"currentColor":n,r=uh(e,IOn);return(0,z.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),(0,z.createElement)("path",{d:"M10 6.5C10 8.433 8.433 10 6.5 10C4.567 10 3 8.433 3 6.5C3 4.567 4.567 3 6.5 3C8.433 3 10 4.567 10 6.5ZM9.30884 10.0159C8.53901 10.6318 7.56251 11 6.5 11C4.01472 11 2 8.98528 2 6.5C2 4.01472 4.01472 2 6.5 2C8.98528 2 11 4.01472 11 6.5C11 7.56251 10.6318 8.53901 10.0159 9.30884L12.8536 12.1464C13.0488 12.3417 13.0488 12.6583 12.8536 12.8536C12.6583 13.0488 12.3417 13.0488 12.1464 12.8536L9.30884 10.0159Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))}),SOn=["color"],TOn=(0,z.forwardRef)(function(e,t){var n=e.color,a=n===void 0?"currentColor":n,r=uh(e,SOn);return(0,z.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),(0,z.createElement)("path",{d:"M2.89998 0.499976C2.89998 0.279062 2.72089 0.0999756 2.49998 0.0999756C2.27906 0.0999756 2.09998 0.279062 2.09998 0.499976V1.09998H1.49998C1.27906 1.09998 1.09998 1.27906 1.09998 1.49998C1.09998 1.72089 1.27906 1.89998 1.49998 1.89998H2.09998V2.49998C2.09998 2.72089 2.27906 2.89998 2.49998 2.89998C2.72089 2.89998 2.89998 2.72089 2.89998 2.49998V1.89998H3.49998C3.72089 1.89998 3.89998 1.72089 3.89998 1.49998C3.89998 1.27906 3.72089 1.09998 3.49998 1.09998H2.89998V0.499976ZM5.89998 3.49998C5.89998 3.27906 5.72089 3.09998 5.49998 3.09998C5.27906 3.09998 5.09998 3.27906 5.09998 3.49998V4.09998H4.49998C4.27906 4.09998 4.09998 4.27906 4.09998 4.49998C4.09998 4.72089 4.27906 4.89998 4.49998 4.89998H5.09998V5.49998C5.09998 5.72089 5.27906 5.89998 5.49998 5.89998C5.72089 5.89998 5.89998 5.72089 5.89998 5.49998V4.89998H6.49998C6.72089 4.89998 6.89998 4.72089 6.89998 4.49998C6.89998 4.27906 6.72089 4.09998 6.49998 4.09998H5.89998V3.49998ZM1.89998 6.49998C1.89998 6.27906 1.72089 6.09998 1.49998 6.09998C1.27906 6.09998 1.09998 6.27906 1.09998 6.49998V7.09998H0.499976C0.279062 7.09998 0.0999756 7.27906 0.0999756 7.49998C0.0999756 7.72089 0.279062 7.89998 0.499976 7.89998H1.09998V8.49998C1.09998 8.72089 1.27906 8.89997 1.49998 8.89997C1.72089 8.89997 1.89998 8.72089 1.89998 8.49998V7.89998H2.49998C2.72089 7.89998 2.89998 7.72089 2.89998 7.49998C2.89998 7.27906 2.72089 7.09998 2.49998 7.09998H1.89998V6.49998ZM8.54406 0.98184L8.24618 0.941586C8.03275 0.917676 7.90692 1.1655 8.02936 1.34194C8.17013 1.54479 8.29981 1.75592 8.41754 1.97445C8.91878 2.90485 9.20322 3.96932 9.20322 5.10022C9.20322 8.37201 6.82247 11.0878 3.69887 11.6097C3.45736 11.65 3.20988 11.6772 2.96008 11.6906C2.74563 11.702 2.62729 11.9535 2.77721 12.1072C2.84551 12.1773 2.91535 12.2458 2.98667 12.3128L3.05883 12.3795L3.31883 12.6045L3.50684 12.7532L3.62796 12.8433L3.81491 12.9742L3.99079 13.089C4.11175 13.1651 4.23536 13.2375 4.36157 13.3059L4.62496 13.4412L4.88553 13.5607L5.18837 13.6828L5.43169 13.7686C5.56564 13.8128 5.70149 13.8529 5.83857 13.8885C5.94262 13.9155 6.04767 13.9401 6.15405 13.9622C6.27993 13.9883 6.40713 14.0109 6.53544 14.0298L6.85241 14.0685L7.11934 14.0892C7.24637 14.0965 7.37436 14.1002 7.50322 14.1002C11.1483 14.1002 14.1032 11.1453 14.1032 7.50023C14.1032 7.25044 14.0893 7.00389 14.0623 6.76131L14.0255 6.48407C13.991 6.26083 13.9453 6.04129 13.8891 5.82642C13.8213 5.56709 13.7382 5.31398 13.6409 5.06881L13.5279 4.80132L13.4507 4.63542L13.3766 4.48666C13.2178 4.17773 13.0353 3.88295 12.8312 3.60423L12.6782 3.40352L12.4793 3.16432L12.3157 2.98361L12.1961 2.85951L12.0355 2.70246L11.8134 2.50184L11.4925 2.24191L11.2483 2.06498L10.9562 1.87446L10.6346 1.68894L10.3073 1.52378L10.1938 1.47176L9.95488 1.3706L9.67791 1.2669L9.42566 1.1846L9.10075 1.09489L8.83599 1.03486L8.54406 0.98184ZM10.4032 5.30023C10.4032 4.27588 10.2002 3.29829 9.83244 2.40604C11.7623 3.28995 13.1032 5.23862 13.1032 7.50023C13.1032 10.593 10.596 13.1002 7.50322 13.1002C6.63646 13.1002 5.81597 12.9036 5.08355 12.5522C6.5419 12.0941 7.81081 11.2082 8.74322 10.0416C8.87963 10.2284 9.10028 10.3497 9.34928 10.3497C9.76349 10.3497 10.0993 10.0139 10.0993 9.59971C10.0993 9.24256 9.84965 8.94373 9.51535 8.86816C9.57741 8.75165 9.63653 8.63334 9.6926 8.51332C9.88358 8.63163 10.1088 8.69993 10.35 8.69993C11.0403 8.69993 11.6 8.14028 11.6 7.44993C11.6 6.75976 11.0406 6.20024 10.3505 6.19993C10.3853 5.90487 10.4032 5.60464 10.4032 5.30023Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))}),DOn=["color"],NOn=(0,z.forwardRef)(function(e,t){var n=e.color,a=n===void 0?"currentColor":n,r=uh(e,DOn);return(0,z.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),(0,z.createElement)("path",{d:"M11.8536 1.14645C11.6583 0.951184 11.3417 0.951184 11.1465 1.14645L3.71455 8.57836C3.62459 8.66832 3.55263 8.77461 3.50251 8.89155L2.04044 12.303C1.9599 12.491 2.00189 12.709 2.14646 12.8536C2.29103 12.9981 2.50905 13.0401 2.69697 12.9596L6.10847 11.4975C6.2254 11.4474 6.3317 11.3754 6.42166 11.2855L13.8536 3.85355C14.0488 3.65829 14.0488 3.34171 13.8536 3.14645L11.8536 1.14645ZM4.42166 9.28547L11.5 2.20711L12.7929 3.5L5.71455 10.5784L4.21924 11.2192L3.78081 10.7808L4.42166 9.28547Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))}),LOn=["color"],w8=(0,z.forwardRef)(function(e,t){var n=e.color,a=n===void 0?"currentColor":n,r=uh(e,LOn);return(0,z.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),(0,z.createElement)("path",{d:"M8 2.75C8 2.47386 7.77614 2.25 7.5 2.25C7.22386 2.25 7 2.47386 7 2.75V7H2.75C2.47386 7 2.25 7.22386 2.25 7.5C2.25 7.77614 2.47386 8 2.75 8H7V12.25C7 12.5261 7.22386 12.75 7.5 12.75C7.77614 12.75 8 12.5261 8 12.25V8H12.25C12.5261 8 12.75 7.77614 12.75 7.5C12.75 7.22386 12.5261 7 12.25 7H8V2.75Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))}),ROn=["color"],jc=(0,z.forwardRef)(function(e,t){var n=e.color,a=n===void 0?"currentColor":n,r=uh(e,ROn);return(0,z.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),(0,z.createElement)("path",{d:"M1.84998 7.49998C1.84998 4.66458 4.05979 1.84998 7.49998 1.84998C10.2783 1.84998 11.6515 3.9064 12.2367 5H10.5C10.2239 5 10 5.22386 10 5.5C10 5.77614 10.2239 6 10.5 6H13.5C13.7761 6 14 5.77614 14 5.5V2.5C14 2.22386 13.7761 2 13.5 2C13.2239 2 13 2.22386 13 2.5V4.31318C12.2955 3.07126 10.6659 0.849976 7.49998 0.849976C3.43716 0.849976 0.849976 4.18537 0.849976 7.49998C0.849976 10.8146 3.43716 14.15 7.49998 14.15C9.44382 14.15 11.0622 13.3808 12.2145 12.2084C12.8315 11.5806 13.3133 10.839 13.6418 10.0407C13.7469 9.78536 13.6251 9.49315 13.3698 9.38806C13.1144 9.28296 12.8222 9.40478 12.7171 9.66014C12.4363 10.3425 12.0251 10.9745 11.5013 11.5074C10.5295 12.4963 9.16504 13.15 7.49998 13.15C4.05979 13.15 1.84998 10.3354 1.84998 7.49998Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))}),QOn=["color"],FOn=(0,z.forwardRef)(function(e,t){var n=e.color,a=n===void 0?"currentColor":n,r=uh(e,QOn);return(0,z.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),(0,z.createElement)("path",{d:"M7.5 0C7.77614 0 8 0.223858 8 0.5V2.5C8 2.77614 7.77614 3 7.5 3C7.22386 3 7 2.77614 7 2.5V0.5C7 0.223858 7.22386 0 7.5 0ZM2.1967 2.1967C2.39196 2.00144 2.70854 2.00144 2.90381 2.1967L4.31802 3.61091C4.51328 3.80617 4.51328 4.12276 4.31802 4.31802C4.12276 4.51328 3.80617 4.51328 3.61091 4.31802L2.1967 2.90381C2.00144 2.70854 2.00144 2.39196 2.1967 2.1967ZM0.5 7C0.223858 7 0 7.22386 0 7.5C0 7.77614 0.223858 8 0.5 8H2.5C2.77614 8 3 7.77614 3 7.5C3 7.22386 2.77614 7 2.5 7H0.5ZM2.1967 12.8033C2.00144 12.608 2.00144 12.2915 2.1967 12.0962L3.61091 10.682C3.80617 10.4867 4.12276 10.4867 4.31802 10.682C4.51328 10.8772 4.51328 11.1938 4.31802 11.3891L2.90381 12.8033C2.70854 12.9986 2.39196 12.9986 2.1967 12.8033ZM12.5 7C12.2239 7 12 7.22386 12 7.5C12 7.77614 12.2239 8 12.5 8H14.5C14.7761 8 15 7.77614 15 7.5C15 7.22386 14.7761 7 14.5 7H12.5ZM10.682 4.31802C10.4867 4.12276 10.4867 3.80617 10.682 3.61091L12.0962 2.1967C12.2915 2.00144 12.608 2.00144 12.8033 2.1967C12.9986 2.39196 12.9986 2.70854 12.8033 2.90381L11.3891 4.31802C11.1938 4.51328 10.8772 4.51328 10.682 4.31802ZM8 12.5C8 12.2239 7.77614 12 7.5 12C7.22386 12 7 12.2239 7 12.5V14.5C7 14.7761 7.22386 15 7.5 15C7.77614 15 8 14.7761 8 14.5V12.5ZM10.682 10.682C10.8772 10.4867 11.1938 10.4867 11.3891 10.682L12.8033 12.0962C12.9986 12.2915 12.9986 12.608 12.8033 12.8033C12.608 12.9986 12.2915 12.9986 12.0962 12.8033L10.682 11.3891C10.4867 11.1938 10.4867 10.8772 10.682 10.682ZM5.5 7.5C5.5 6.39543 6.39543 5.5 7.5 5.5C8.60457 5.5 9.5 6.39543 9.5 7.5C9.5 8.60457 8.60457 9.5 7.5 9.5C6.39543 9.5 5.5 8.60457 5.5 7.5ZM7.5 4.5C5.84315 4.5 4.5 5.84315 4.5 7.5C4.5 9.15685 5.84315 10.5 7.5 10.5C9.15685 10.5 10.5 9.15685 10.5 7.5C10.5 5.84315 9.15685 4.5 7.5 4.5Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))}),MOn=["color"],Ojt=(0,z.forwardRef)(function(e,t){var n=e.color,a=n===void 0?"currentColor":n,r=uh(e,MOn);return(0,z.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},r,{ref:t}),(0,z.createElement)("path",{d:"M5.5 1C5.22386 1 5 1.22386 5 1.5C5 1.77614 5.22386 2 5.5 2H9.5C9.77614 2 10 1.77614 10 1.5C10 1.22386 9.77614 1 9.5 1H5.5ZM3 3.5C3 3.22386 3.22386 3 3.5 3H5H10H11.5C11.7761 3 12 3.22386 12 3.5C12 3.77614 11.7761 4 11.5 4H11V12C11 12.5523 10.5523 13 10 13H5C4.44772 13 4 12.5523 4 12V4L3.5 4C3.22386 4 3 3.77614 3 3.5ZM5 4H10V12H5V4Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))}),OOn={antfly:{id:"antfly",name:"Antfly",description:"Data and vector search",defaultRoute:"/"},inference:{id:"inference",name:"Antfly Inference",description:"Model runtimes and playgrounds",defaultRoute:"/inference/models"}},POn=()=>["antfly","inference"],Pjt=POn(),Fl=e=>Pjt.includes(e),jOn=Pjt[0],$On=()=>OOn[jOn].defaultRoute,zOn=[{id:"nav-tables",type:"navigation",group:"navigation",label:"Tables",description:"View and manage database tables",href:"/",icon:"Table",product:"antfly",semantic:!0},{id:"nav-create-table",type:"navigation",group:"navigation",label:"Create Table",description:"Create a new database table with indexes",href:"/create",icon:"Plus",product:"antfly",semantic:!0},{id:"nav-search",type:"navigation",group:"navigation",label:"Search",description:"Search documents in the selected table",href:"/retrieval/search",icon:"Search",product:"antfly",semantic:!1},{id:"nav-ask",type:"navigation",group:"navigation",label:"Ask Questions",description:"Ask questions over selected table data",href:"/retrieval/ask",icon:"Bot",product:"antfly",semantic:!0},{id:"nav-evaluate-retrieval",type:"navigation",group:"navigation",label:"Evaluate Retrieval",description:"Run retrieval evaluations and benchmarks",href:"/retrieval/evaluate",icon:"ClipboardCheck",product:"antfly",semantic:!0},{id:"nav-upload-data",type:"navigation",group:"navigation",label:"Upload Data",description:"Bulk upload documents into the selected table",href:"/ingest/upload",icon:"Upload",product:"antfly",semantic:!1},{id:"nav-models",type:"navigation",group:"navigation",label:"Models",description:"View model runtime status and tools",href:"/inference/models",icon:"Library",product:"inference",semantic:!0},{id:"nav-cluster",type:"navigation",group:"navigation",label:"Cluster",description:"Monitor data node health and placement",href:"/cluster",icon:"Network",product:"antfly",semantic:!1},{id:"nav-connections",type:"navigation",group:"navigation",label:"Connections",description:"Manage connected providers and stores",href:"/connections",icon:"Plug",product:"antfly",semantic:!1},{id:"nav-users",type:"navigation",group:"navigation",label:"Users",description:"Manage users and permissions",href:"/users",icon:"Users",product:"antfly",adminOnly:!0,semantic:!0},{id:"nav-secrets",type:"navigation",group:"navigation",label:"Secrets",description:"Manage backend secrets",href:"/secrets",icon:"KeyRound",product:"antfly",adminOnly:!0,semantic:!1},{id:"tool-graph-retrieval",type:"navigation",group:"tools",label:"Graph Retrieval",description:"Explore graph relationships for the selected table",href:"/retrieval/graph",icon:"Network",product:"antfly",semantic:!0},{id:"tool-chunk-text",type:"navigation",group:"tools",label:"Chunk Text",description:"Split text into chunks for retrieval workflows",href:"/inference/playground/chunk",icon:"Scissors",product:"inference",semantic:!0},{id:"tool-extract-structured-data",type:"navigation",group:"tools",label:"Extract Structured Data",description:"Named entity recognition and extraction",href:"/inference/playground/extract",icon:"Tag",product:"inference",semantic:!0},{id:"tool-rewrite-text",type:"navigation",group:"tools",label:"Rewrite Text",description:"Rewrite text with a model",href:"/inference/playground/rewrite",icon:"Repeat2",product:"inference",semantic:!0},{id:"tool-rerank-text",type:"navigation",group:"tools",label:"Rerank Text",description:"Rerank documents against a query",href:"/inference/playground/rerank",icon:"ArrowUpDown",product:"inference",semantic:!1},{id:"tool-embed-text",type:"navigation",group:"tools",label:"Embed Text",description:"Generate embeddings for text",href:"/inference/playground/embed",icon:"Waypoints",product:"inference",semantic:!1},{id:"tool-read-image",type:"navigation",group:"tools",label:"Read Image",description:"Extract text and structure from images",href:"/inference/playground/read",icon:"ScanLine",product:"inference",semantic:!1},{id:"tool-transcribe-audio",type:"navigation",group:"tools",label:"Transcribe Audio",description:"Transcribe audio into text",href:"/inference/playground/transcribe",icon:"Mic",product:"inference",semantic:!1},{id:"tool-manual-entry",type:"navigation",group:"tools",label:"Manual Entry",description:"Create documents from table schema",href:"/ingest/manual",icon:"FileInput",product:"antfly",semantic:!1},{id:"tool-artifacts",type:"navigation",group:"tools",label:"Artifacts",description:"Inspect document artifacts for the selected table",href:"/ingest/artifacts",icon:"FileStack",product:"antfly",semantic:!1},{id:"tool-reprocess",type:"navigation",group:"tools",label:"Reprocess",description:"Re-run document processing for the selected table",href:"/ingest/reprocess",icon:"RotateCw",product:"antfly",semantic:!1},{id:"action-toggle-theme",type:"action",group:"quickActions",label:"Toggle Theme",description:"Switch between light and dark mode",action:"toggle-theme",icon:"Moon",semantic:!0}],qOn="all-MiniLM-L6-v2",GOn="src/data/command-definitions.json",UOn=[{id:"nav-tables",type:"navigation",group:"navigation",label:"Tables",description:"View and manage database tables",href:"/",icon:"Table",product:"antfly",embedding:[.04798413,-.09767596,-.09205667,.06074907,-.02216648,.0143975895,.060993895,-.007881843,-.03718108,.04725993,.044393837,-.02145551,.055825237,.016412305,-.1097362,.053677753,-.026820347,-.035629325,.053253874,.13520288,-.056259766,.035397463,-.019970283,-.005525711,.012188043,.025313506,.0044299876,.015903115,-.11300302,-.06294237,-.048289556,.02032026,-.021233642,.08205605,-.018484248,-.07621126,.052557297,.037512094,-.0026957334,-.061225,-.053974487,-.015257638,-.030298343,.050424792,.015424348,.021584231,.013411382,-.088442065,-.04775085,.048433833,-.07097498,.05316684,-.02258835,-.05186592,-.005875181,.08683051,.015843585,.009383274,-.045008224,.071186535,-.021709273,.022746563,.0011699232,.06796884,-.12195693,.045490604,.0020913174,.033375476,.052189615,-.018148815,-.046635106,-.0047813826,-.058834925,-.11632478,-.07555343,-.04931288,.023306906,-.078203835,-.059530344,-.056674536,-.025427816,.021474715,.0068790023,.0074289157,.012833672,-.005578031,.026608035,-.093430035,.0050230897,-.004102263,.016040927,-.0025775733,.015749628,.023973558,-.13613527,-.035235457,.045329176,-.017763088,.040684752,.09076223,-.019821828,.022703333,-.031654812,.0242581,-.076227136,-.06700368,.06343901,-8782293e-11,-.017676568,.03234787,.019363599,.057571303,-.076527335,-.072366245,-.046312526,-.017693002,-.12621525,-.047375843,-.014583651,-.0027019742,-.025627516,.07201621,.032914944,.067596786,.015893308,.0054699564,-.071770765,-18551187e-40,.005841759,-.0051702685,-.00678261,-.023500977,.08050452,.055491716,.02798213,.07045723,.019789774,.053751778,.029754099,.049858153,-.02907395,-.026038859,.03676067,.081482284,-.08332754,.1494862,-.046100333,-.037099987,-.02867287,.037529517,-.0005620838,.078831665,.029660935,.039437518,.011897445,.073544085,-.025820756,.045871757,.10514303,-.05268223,-.038443822,-.08370527,.0028961103,.025399024,-.011869463,.0015772651,.07541631,.010763953,-.058212746,.043781143,-.09404158,-.07383866,-.037583385,.03778816,.06746889,.066103496,-.02058319,-.058670532,-.0072254227,-.05785029,-.0058971816,.06843437,.056816224,.039254818,-.08578834,.013171052,.12833078,.06333027,-.041336633,-.012698598,-.055701315,-.030668605,-.05775792,.083345056,-.012418296,-.016420584,.06632225,-.051405936,-.041596536,.015068011,.08476861,-.033480544,.05439986,-.04191255,.00016595605,-.067108646,-.027018022,.02486021,.07020104,.038027626,-.004016755,.018169217,.019323673,-.011306114,.01226652,-.07194892,.0046337503,.05409139,-.0149864685,-.052709702,-.014318467,-.05505509,-.008637414,-22125193e-42,.06553773,-.029324967,-.050092097,-.09135121,.034876168,-.023605982,-.03224997,.011382306,-.032544326,-.09826092,.006926248,-.030190118,-.0039796405,-.017614812,-.031653643,-.027792186,.08529685,-.065962054,-.1005197,.049479175,-.0028945112,.076256536,.0059575224,-.016752811,.0099703325,.04036499,-.061800662,.006010281,.024577163,.050228678,.002468701,-.022060448,.02380138,-.064586796,-.055683367,-.018452615,-.06166529,-.0129667455,.020352378,.04395067,-.043820713,.049357463,.04888069,-.006880367,-.031008372,.036192007,.006989706,.06250598,-.05886299,-.044861335,-.09662053,-.11393659,-.037469205,-.0855714,.03605457,-.0015281019,.03347331,.00089741545,-.0061756363,.0035416272,.052916866,.035096478,.008130984,.010866829,-.03672128,.02922621,.0046809926,.05147098,.06042938,-.03761208,-.08348632,-.042414505,.0027049414,.010109651,.05692957,.0059467065,-.09751078,-2050958e-12,.040633094,-.052880116,.033945344,-.01048485,.063283816,-.047335368,.060747538,-.027019033,-.039167996,-.04426874,-.012721398,-.014765103,-.11210092,-.066779695,-.015423705,.071828224,.07630337,-14340129e-15,.0013271808,.020265907,.115604736,-.0617747,.03999135,-.046182055,.049088214,.16755044,.015798658,-.052865427,.097180076,.031726774,-.06256355,.07231981,.020937806,.019495165,.04570219,.001796927,-.051732942,.08703792,-.027971908,.045875046,.016802547,-.00075923954,.080032274,.025942562,-.061714612,-.009344901,-.019225268,.05865566,.038566355,.019930892,.020021874,.04788337,.07538397,.020361591,-.010846411,.018382246,-.035531893,-.006672803,-.013069598,-.04603584,.0622086,.0642453,-.0009862555,.062967576,.046321083,-.011088369,.0070666927,-.05473264,-.06098498,-.0059797317,.006771861,.05251469,-.018405598,.114042744,.0725228,-.04046683,-.03240691,.0055399016,.02820444,-.010921183,-.06482953,-.0074974135]},{id:"nav-create-table",type:"navigation",group:"navigation",label:"Create Table",description:"Create a new database table with indexes",href:"/create",icon:"Plus",product:"antfly",embedding:[.09775662,-.06607429,-.0842546,.07709747,-.07086156,.04046908,.06613308,-.0061556506,-.031397965,.034340825,.040871497,-.06279888,.07356159,-.029884275,-.1276452,-.007420329,-.054558665,.07422514,.009087489,.0869107,.017405853,.0053092064,-.035676554,.002552261,-.03231025,-.013425839,.04658858,.055041052,-.013445128,-.01590601,-.10119094,.04926093,.0059924116,.05199202,-.0237869,-.06734755,.060805906,.0411825,.007861949,-.045262862,.002160884,-.005417641,.015859215,.078204684,.019797513,.008248569,-.03127459,-.007563612,.03787274,.04325766,-.083587915,.05356681,-.026052903,-.016427273,-.014496405,.04555278,-.07646462,981584e-9,-.043560285,.010654269,.058938038,.081268124,.059351683,-.009374099,-.015177634,-.05289373,-.023615742,-.009535209,.036020104,-.01328201,-.016250648,.10597985,-.14174496,.021706486,-.04595427,.029959159,-.037222676,.005368756,-.037120286,.043067757,-.056341905,.019714253,.047341052,-.09053429,-.02963532,-.09137256,.01657245,-.053777784,.0005346694,-.024575228,.0005228333,.017763756,.009726807,-.0057468987,-.009612805,.019542575,-.0069875005,.04067223,.06296823,.05950062,-.097515285,-.048514623,-.14055364,.08912508,-.12459975,-.06839596,.009113707,-.038664762,-.012988115,-.00057892274,-.02600065,.05607174,-.009170791,-.10574449,-.035740737,.05778603,-.13485408,.0019893784,.031297445,.034045015,.016574072,.03159001,-.023717614,.0036946519,-.06723299,.037591014,-.019786684,-9530561e-40,.019346608,.013092455,.05287244,.0028486694,-.021743782,.00066852494,.035803165,.076988794,-.03568838,.0053549996,-.050390992,-.014128424,-.016563097,-.017318109,.036006738,.020872219,-.006044769,.12101763,.06933874,-.09430383,.019582853,.022539359,.06503068,.062730156,.0107801985,.03268308,-.06431764,-.05351381,.0074547734,.015082704,.07752218,-.009130713,-.04571126,-.069339804,.04603409,.07367914,-.0014546413,.08868187,.079495765,.05013162,.06768109,-.0058667255,-.06318838,-.02379037,.02659092,.04302832,-.005865034,.010835759,-.005203683,-.028006678,-.029300986,-.076445386,-.027030211,.09591926,.0047218637,.031305157,.001332358,.008577549,.074531324,.008728773,-.053135674,-.007982406,-.041528203,.10558231,.013633344,.04155022,-.009227085,-.0049728556,.08111639,-.06734304,-.00748483,-.033289853,.019307414,.0045186155,-.018082924,-.044755366,-.045296542,-.05166611,-.075810224,-.0602587,.018912222,.03580315,-.086816564,-.10067488,.046425276,.01295746,-.046837676,-.02441872,.0043862513,-.05911397,-.00024435006,.006194051,-.025749717,-.103196815,.039249472,-20556718e-40,.01191839,-.04722886,-.021338291,.0108655,-.0024469143,-.054777086,.051971406,-.07800724,-.109146595,.04272055,.011329639,-.07915422,.0047565005,.017075136,-.056750428,.03519391,-.027558105,.031700686,-.022616407,.056821324,-.05252805,.05789111,-.04051875,.053158965,-.025395809,-.036161806,-.011253376,.025368184,-.01467244,.037227504,-.015562404,-.0479247,.023732333,.004856158,-.0068601416,-.021130838,.026660228,-.15911096,-.012463947,.05541158,-.027159864,.047563687,.070225164,.04017723,.029525714,-.065165624,-.02936147,-.01703588,-.0017278393,-.053326994,-.032731805,-.054305706,.022564558,-.057783775,.030456804,-.041464277,.007946846,.04390241,.05035254,.020460943,.059733916,.101231426,.022615664,.07176571,.08230189,-.03229786,-.0069521563,.028288614,-.061083283,-.017699806,-.11711021,-.005440546,.054927286,.06344516,.017339349,-.02654445,-.06758298,.024365706,-.052531887,-.030483913,-.036138833,.010803214,.045932017,-.102020614,-.028174244,-.008768632,.022557456,.06808293,-.054121595,.075130105,-.07827385,-.038174566,.05717021,-.03926178,.04385577,-21405743e-15,.029242018,.021741029,.036851138,.0497896,.055885732,-.10151074,-.043275867,.12859917,.0040161903,-.11316928,.0418363,-.014124073,-.0060549863,.1030574,.011226346,-.061281487,-.013947941,-.048078828,.012319991,.07740803,-.043546587,.09739608,.027119972,-.041792125,.13235243,-.018398589,-.026913313,-.02863934,-.012833216,.051101573,.050499942,-.0007306244,.034924608,.04115472,.07655034,.018178964,-.045151293,.022584395,-.07194681,-.10777543,.0030270773,.045265533,-.00092586403,-.024859767,.0073379516,-.02925298,-.057805445,.0069543337,.06076885,-.034572784,-.050912913,-.0116495015,.007245779,-.02419302,.024669126,.077224776,.03154798,.077753134,.07513028,-.013260546,.056651786,-.062031876,-.02220974,-.0130997235]},{id:"nav-ask",type:"navigation",group:"navigation",label:"Ask Questions",description:"Ask questions over selected table data",href:"/retrieval/ask",icon:"Bot",product:"antfly",embedding:[-.08185645,-.024673104,-.02928956,.009039619,.014073962,-.03198563,-.019658372,-.007545316,-.07873625,-.070511855,.035428032,-.117347546,.038478177,-.018653277,.032498304,.0485005,-.04395591,.07013979,-.0059850365,-.12582327,-.03934303,.068208784,-.007209542,-.010492978,-.025999956,-.006424191,-.06205598,-.025322635,.060887236,.0018801646,.043885432,.07775881,-.04199671,.022855079,.047775585,.057888668,-.0067735235,.031117236,.04117516,-.034210213,-.03921489,-.003671161,.07237012,-.052469503,.042583667,-.06509841,-.09843184,-.050335065,-.073531486,.0013814595,-.03601989,-.027231349,-.04664069,-.039079145,-.020881321,.04205191,.06997209,-.0018418862,-.013749526,-.02245389,-.03118555,-.13363265,-.060617607,-.030950135,.011503954,.0038412588,.041881364,.017695358,.055906035,.034073234,-.076403596,-.0014854581,-.023520848,.016612962,.03118033,.18422776,.026186254,-.03881924,.045997076,-.051792894,-.031037295,-.07785502,.018438347,.012505201,.005142435,.10315952,.048908286,-.010359676,.05975273,.08146795,-.05849171,-.10361059,.038014546,.0788306,-.042704865,-.0033064452,.06435949,-.10376214,.046753757,.07869342,.0021549494,.080341905,.098307244,-.07016228,-.040851027,-.009057079,-.0011085789,-.01997148,.010492798,-.06764994,-.010547891,-.06397153,.084513955,-.026893111,.028377471,-.012445896,-.017268032,-.061220013,-.04052641,-.005411601,.04159245,.027818836,.0064500645,.07277422,.028703306,.05226504,-.022522591,-144154105e-41,.0038807408,-.042311825,.042373758,.071269535,.052738942,.0045437673,.06963428,.07712019,-.07541053,-.041010577,-.021753168,.102243125,-.062313948,.042389702,.05482281,-.0295146,-.021724934,.04555992,-.05589936,.058772456,.013104453,-.028411651,-.036275312,-.109896734,.059079867,-.016220804,.034240313,-.00040649038,-.025488913,.0204293,-.045546073,-.0034144495,-.024040103,.07573455,.042043135,.085296296,.044758435,-.0009904074,-.036596905,.05504352,.011223945,-.0058393264,.01262928,-.012801187,.008632115,-.09238737,-.059375584,.015217712,.011419615,-.03496602,.055070255,.08898554,-.042130712,-.0928345,.0402425,-.0022773903,-.035936646,.053582847,.07562286,.10877451,-.015192899,.04562389,-.030818686,.036882613,-.057657678,.010876364,.029388677,-.06431115,.13193421,.056261692,.02603953,-.022084178,-.081523195,.016140243,.08041399,-.04560941,-.00853022,.01201039,-.02973606,-.085045725,-.004744895,.014136117,-.0038935002,.021660687,.038065787,-.047669176,-.03355088,-.057567246,-.03246025,-.08026241,-.029815612,.04862934,-.06264178,-.0013850342,.065772206,3626694e-40,.04733948,.020494398,-.062037826,.060947996,.01577579,-.06705178,.09149575,-.10294753,-.041364856,.01803797,-.060573082,.010948715,.019534087,.0092934,-.02414456,-.04260174,-.045144305,-.1316474,.04931684,.0291758,.027193604,.056721535,-.040734198,.010686924,-.063762516,.027218841,-.03548828,-.03710125,.01722598,.016490145,.042378556,.03351661,.011125934,-.071427174,-.00056821195,-.06042021,.1324417,.030656224,-.010319074,.048796307,-.03060991,.0026984331,-.00990126,-.0017565251,-.021672785,.11252494,.054278143,.05872658,.0029004787,-.008243493,.01580487,.017739747,-.07073722,-.0075090053,-.044870436,-.034899384,.0229689,-.051008698,-.08156282,.044464562,.002099454,.012577958,.012395844,.0027134803,.037562925,-.028382005,-.032048132,-.0011949382,-.0542789,-.027995005,.040892687,-.011156935,.042026144,-.04980434,.048972674,-.034535896,-.035888076,.015803346,.10497271,-.062429145,-.07797483,.0028949645,.033639032,.09951564,-.047530986,-.00869079,.05812443,.09681698,.008230883,.017395481,.0073526218,.023537664,-.08915888,-.014574627,.045268383,-1597311e-14,-.0011962373,.0053221346,-.07025926,.04237906,.0026059146,.053626243,-.05039796,.072075546,.019480238,-.043000754,-.07448014,.020275315,-.060558617,.05184019,.033403937,-.004660246,.005868305,.041687634,-.064999215,.007817541,-.027873976,.09891558,.014843852,.030598562,-.0010975625,-.0009388215,.07202019,-.008007597,.11742751,-.020715255,.039558798,-.025753416,-.023023322,-.0851004,.08941071,.08549913,-.029450782,-.0075080562,.027024705,.014961894,-.0070276493,.014897279,-.019729115,-.044430744,-.028837549,-.069833666,-.047216315,-.052277688,-.023216609,-.06354255,-.10396373,-.08764621,-.009196706,.024101403,.06793575,.013109643,-.0035518543,-.08883818,-.01895276,.058320068,.08998508,.01365449,.03637689,-.0019327299]},{id:"nav-evaluate-retrieval",type:"navigation",group:"navigation",label:"Evaluate Retrieval",description:"Run retrieval evaluations and benchmarks",href:"/retrieval/evaluate",icon:"ClipboardCheck",product:"antfly",embedding:[-.09651942,.057518497,-.052242387,.011058676,-.06290196,-.10746886,-.01275608,.020828096,-.010797219,-.050691325,-.044597913,-.027846934,-.016457913,-.043114346,-.023753867,.031955663,.033046085,.089015566,-.016086023,-.058508243,-.06301047,-.0014124985,-.01688671,.004776267,.005714012,-.004961639,-.04541551,.021688951,.028499244,-.08238727,.0018107495,-.0041428027,-.03555897,.042686377,-.01285778,.069981,.018313404,-.005803817,-.04003145,.0021360312,-.004650737,.016961996,-.036229238,-.0008720532,-.011963227,-.039378148,-.021208199,-.036495328,-.010098202,-.058331333,-.027625889,.021964848,-.018949375,-.04444957,-.029585682,.02106423,.04164881,-.053205527,-.03480937,.006491516,-.037595585,-.011771512,-.053632796,.05184066,.044823583,.0041485545,.09210665,.00883911,.041918408,.03184432,-.09720243,.029416023,-.024287395,.11455016,-.027968682,.073782876,-.007889022,-.08031643,-.041646447,-.15151942,-.06496169,-.08762066,-.05520168,.017353855,.074508145,.11940219,-.0008679706,-.020333411,.06525595,.011758106,.066776104,.014334314,.0026444967,.0020029084,.055707633,.04260498,.030286018,.0137170935,-.03834528,.08524635,-.033070754,-.07815241,.027584884,-.015767792,-.029908404,-.031513516,.047065232,-.012870272,-.046178088,-.043550305,.0452755,.023531863,-.0027338818,-.052291464,.005707821,-.004308086,.00044716804,-.062287636,-.006247468,.05936186,.038074553,-.0058378973,-.0003797541,.07051743,.03582728,.024424892,.020623587,-65239395e-41,-.0109381005,-.0075738085,.016738683,.028481286,-.124895066,-.020498645,.024851874,-.0007449178,.0050806683,.030156633,-.011677153,.0299703,-.0057626036,-.018166952,.09255053,.030191056,.0233401,.047244977,-.02678018,.02204697,.031722862,.023433799,-.060463842,-.04972876,.00993745,.05236627,.03439672,-.009594691,-.039743803,.050347444,.04983671,-.066144645,-.056291927,.09822082,.02788957,.0785797,-.09003285,.053430382,.005568521,-.017756721,-.05664118,-.013070844,-.076133616,-.040948052,.043437462,-.074601896,-.07208742,.074249156,-.0062168874,.031479668,.10876306,.07940675,-.033792894,.06883603,.014129797,.021490645,.06521389,-.017887088,.03987235,.23870704,-.04554535,.06668164,-.12547368,.011388025,-.013524462,-.016638272,-.012454479,-.027917422,-.043664638,.035634976,.03114527,.009264398,.03298697,.10029238,.011562176,.0021988128,.008662661,-.0042986986,-.06488741,-.06566521,.0537167,.04779884,-.03566002,-.044986583,-.025784004,-.025143886,.01649869,-.080008894,-.03597556,-.012504667,-.033811003,-.040523432,-.0026605283,.0012407283,-.029938016,-21414355e-41,.08530196,-.080591954,.05455669,.16921236,-.020163173,-.01581513,-.03647018,-.010637186,-.026863739,.07716831,.0042079617,.009757425,-.048632037,.024843588,.057170816,.045808636,-.059645478,-.1000468,-.006590578,.042185966,.013167662,.13514464,.10159627,.029534532,-.05034715,-.024499167,-.032003537,-.029489841,-.032414306,-.0518118,.009723873,.023535216,.014751248,-.034266822,.0039338516,-.07210361,.09176738,.078537315,-.022542905,-.011275794,.045477726,.019504065,-.06611117,-.0230109,-.035641752,.03969775,-.1289,-.03103727,-.026638668,.0009338254,.023280846,-.008673933,.05505192,.027852293,-.010067433,-.018873595,-.02032152,-.005908394,-.033264108,.0887982,.0067189746,.00085454684,-.01506223,.022544447,.07065083,.001558097,-.022115624,-.04604021,-.10365735,.021671576,.002040107,-.023151346,-.0455398,-.0019754455,-.047254805,-.046919562,.0105747245,-.053060006,.018945193,.05200773,-.053467,-.038522623,.019380633,.015286589,-.059264414,.07032895,-.06536299,.014022951,.05793296,-.03453241,.008411256,.03576161,-.023483783,.007409687,-.0013375685,-16851837e-15,.015689213,-.0027583018,.037119105,.060591742,-.043523315,.05267364,-.10166136,.09638187,.036076326,.04291084,.07229452,-.021345926,-.02502096,.0030904342,.024405884,-.016559392,-.0041433657,.007555202,-.047573566,-.048606813,.018070329,.13013963,.032333646,.018572021,-.013928287,-.066164255,.07187352,.061658595,.024049327,.012196271,-.0036112885,.02155215,.0519001,-.06589515,.059853148,.07356148,-.01970098,.054588795,.025752762,.18357943,-.079393096,.06242892,-.01998753,-.012815924,.045988,-.068171255,-.09736674,-.035468042,.034207992,-.061617,-.0014263573,-.04808966,-.062573195,.030880377,-.020347212,.029677335,.009886396,-.07795913,-.0060316226,.06987837,.07803995,-.101404116,-.030615484,.08803481]},{id:"nav-models",type:"navigation",group:"navigation",label:"Models",description:"View model runtime status and tools",href:"/inference/models",icon:"Library",product:"inference",embedding:[-.027897777,-.20297444,-.007913871,-.019472929,.09838957,.114076875,-.009573349,-.0070227836,.0033012924,-.041624416,-.006780371,.009198457,.057730578,.020711632,-.02826201,.063431,.11392183,.0666503,-.054189783,-.04812075,-.039836112,.03138217,-.013043246,-.082804345,.01469739,.00924502,.027781105,.04113775,-.017678939,-.060648784,.03193947,-.021711037,.029643683,.02284661,.030527027,-.01823522,-.015309274,.02200207,.009644737,.048177425,-.05579356,.020666702,-.0012897344,-.0056978506,.07878453,-.05950252,.028228529,-.058482695,-.05282797,.052987356,-.04020751,-.038306136,-.02974153,-.0038877474,-.042350587,-.1323455,-.039859984,-.029485717,.01609853,-.0032589855,.0014003267,-.03811922,-.011176448,.082442895,-.1011017,.023509001,-.009837721,.10710163,-.012536956,.022177937,-.102375954,.023835612,-.11580926,-.05788367,-.056056395,.022996208,.11136511,-.08209338,.13527218,-.110753864,-.003758407,.009845471,-.024186926,-.08395238,.110177174,.022994332,-.010508074,.047345735,.008209763,-.025824029,.011526135,-.02611971,-.03884439,.006356755,.011923911,.00035190614,.02240644,-.04900862,-.0083363345,.06663713,-.047780912,.09973421,.057794042,-.09640263,-.013125245,-.0871357,.026564963,.0929485,.014645767,-.024679834,.005357373,9239518e-12,-.009388617,.05203057,.059428375,-.12727992,.07656191,-.065470435,.017015975,-.008031802,-.0303069,.027385928,-.007547635,.047834244,.051389568,-.029231872,-.052839745,-43406626e-41,-.026887288,-.0068854764,.03581807,.016082935,.08006485,.046131372,-.03515567,.0062437486,.0016350673,-.028356884,-.04684695,.04301572,-.009296924,.024174873,-.016936854,.061198603,-.034624565,.07129649,-.077097416,.01106394,.012917395,.019980628,-.037604783,-.016253237,-.066488765,.015999164,.10993156,-.038556255,-.07981672,.00848608,-.048977554,-.028702088,-.058676098,.011198464,.012982955,.039189853,.054921634,.0005334454,.0010312498,-.06148347,-.029630302,.023610912,.029078519,-.06432906,-.10314753,-.07150001,.01308164,-.0119512025,.008239445,-.089576386,.018686997,-.0139485765,-.03566556,-.083673306,.0186694,.019956606,-.07317539,.116459705,.08254595,.01995021,-.055930264,.013017461,.0645297,-.048880816,.018344807,.06564963,-.042489287,-.025723826,.009594762,.08299734,.04528911,.016201837,.010962138,-.077311546,-.023084493,-.016619375,-.06559755,-.060339227,.013650846,.11592584,-.023200667,-.059122078,-.019961176,.017579969,.017621538,-.0717247,.023878032,-.13119754,.013794246,-.014850127,-.104214154,-.042980373,-.039625768,-.01980918,.037092965,-2188871e-39,-.046290625,.05814976,.030614974,.059141137,-.026179545,.029965173,.0056801247,.07606953,-.03164284,-.020247692,-.0050143776,-.013776455,.054495346,.036158815,-.029076617,.017690783,-.016568042,-.0069822003,-.024230707,.015708512,.018806696,-.028539775,-.016534183,.005885336,.08190572,.11441235,-.024344813,.04647896,-.048285656,-.06622633,-.030120399,-.045724098,-.031304438,.011723097,-.08411402,.06646547,.061890807,.05997966,-.026966143,.010899889,.05332003,.024054592,-.03750307,-.018886285,-.013525334,-.032492265,.026597166,.05668058,.09560847,-.07008288,-.047564033,.019152466,-.08274753,.029678077,-.0351269,-.031447385,.019314539,-.077219464,.043254063,-.00960109,-.0022959711,-.075407274,-.016954536,.026327334,.042702295,-.02616745,-.03815581,.019725252,-.043100856,-.0041221497,.036737222,-.018467192,-.00034702147,.025852356,.02821097,-.033565465,.017083704,.049831264,.0015683565,-.064485766,.03833455,-.094663285,.08995338,.0027258054,.09416577,.004819953,-.0017712635,-.02252868,.028876549,-.032538243,-.07618237,.048329014,-.007757753,.117640674,-.00152082,-18699115e-15,-.046449117,.055735778,.1455003,.015383921,.0015425802,.016112842,-.021398718,.044715345,.017086204,.033089526,.018621458,-.019670773,-.006118222,.011084864,.026016429,.06834926,.02327429,.020332541,.027486434,.04761481,.028291706,.023375751,.03882345,.029499467,.05585814,-.048462138,-.11686359,.031211106,.018862506,-.016660487,-.059828505,.07556212,.0021433055,-.09205089,.039110124,.0090534575,.019155107,-.028433293,-.053930186,.012723522,-.051899277,-.04173303,-.09305687,-.033427812,.11873172,.03177194,.0526439,-.09171722,-.025202123,.059799932,.0024693543,-.009729383,.04184006,.008466905,.015217444,.09732599,.021968024,-.060509756,-.024499843,.03418391,.028733678,.019403884,-.030596867,-.0069948738]},{id:"nav-users",type:"navigation",group:"navigation",label:"Users",description:"Manage users and permissions",href:"/users",icon:"Users",product:"antfly",adminOnly:!0,embedding:[-.026552599,-.027311087,-.057434577,.06630369,-.014030616,-.0004711129,.13218543,-.04583475,-.024014153,.034141578,.021795873,.010970841,.005125187,.04821193,.021150542,.014691408,-.045982644,-.00021011385,-.026462544,-.0061897957,.0036216069,-.06826668,-.012363679,-.012001973,-.016570125,-.01298,-.061832678,.003909997,-.03303165,-.030949324,.040626977,-.019162042,.058753464,.008937941,-.06532294,-.039466564,.03430134,-.034754407,-.009404169,-.008060472,-.06062817,.031790722,-.01250962,.043880515,-.051701225,.085502505,.0371079,-.040971447,-.05295159,.04177177,.10707015,-.008800853,-.015872683,-.07831084,.01729909,.029147875,.097694755,-.059007138,-.024759786,-.079808176,-.07443898,.020704292,-.062427472,.020075278,-.023632705,.021377347,-.0011015794,.03404709,-.04690037,-.058652867,-.004353554,-.03329864,-.057812426,.016419953,.015817462,-.08045929,-.04814886,.018821558,-.016486961,-.06255746,.0007400751,.006501267,.037902646,.0269355,-.05616982,.086826116,.027074458,-.056182355,.055334646,.045979936,.10288768,.05398986,.04389189,-.031144444,-.06572874,-.060125124,.047374073,.040089216,-.053590033,.056140363,.01020087,-.015092023,-.040138435,-.033684235,-.004481888,.015337979,-.01197492,.064818725,-.0013717571,.05594664,-.019251317,.042998284,-.097035944,-.005933775,.043117516,-.034720562,-.05601751,-.024179898,.04024196,.027239574,.044188235,.037520014,.08816124,.06758985,.050973997,.055279594,-.07907776,-34875037e-40,-.023335053,.005885281,-.03398876,.09273936,.062178425,.044375896,-.07030183,-.009237776,-.075287506,-.02903159,.061340954,.11222717,-.004964791,-.08798016,.09182318,-.022918886,.01858482,.057072766,-.012066709,.03709445,-.03839857,.063433595,-.02601877,.11022192,-.0045043314,-.037686665,-.054056976,.03307286,.13286147,-.008662642,.05076843,-.021033684,-.018591227,.040424883,-.007741235,.052611977,-.009940035,.028246714,.006687769,-.029375343,-.061552357,-.024874303,-.04882266,-.03606931,-.10331387,-.072395585,.04656043,.020320022,.04666313,.11119975,-.030672837,-.011651212,-.011878633,-.026100747,.06200728,-.061613172,-.07406362,.038703572,-.010992924,-.0598031,.06353704,.08602608,-.010165403,.02314624,-.03258889,-.13952085,-.00719692,-.07500556,.039468057,.015259171,-.06928183,.015527642,.057423204,-.017043592,-.055610534,.009090402,-.00020630394,.051834386,-.10423138,.017771775,.043101676,-.04963203,.05281699,.0035750607,.052109223,-.006929335,.021169445,-.041839458,.01215583,.02287584,.0065059126,-.024232358,.045418218,.068378076,-.09308719,-74514024e-42,.018244281,-.04216903,-.0048777605,-.05665925,.016621232,.019707695,-.0058775516,-.05173865,-.05147665,-.07880227,-.022252336,-.031751968,.022359759,.058800865,-.020091226,-.019763106,.015968744,-.0509142,-.072463475,-.052074168,-.09879146,.0776055,.03816793,.07142098,-.016488973,.03167015,-.0802595,.024308845,-.010950464,-.008715109,.0329166,-.1356076,-.007624536,-.11295392,-.049601715,-.12777433,-.060653664,.14437966,-.015525066,.06112669,.01081324,.008749228,.044327576,-.027585935,-.0098973755,.046368994,.0053059002,-.0646603,-.05783722,.03192043,-.04346675,-.096747614,.079468355,-.081757575,-.027077727,-.03423537,.098892115,-.03839502,.110832684,-.035858087,.00036598495,.009801884,-.0070386734,.05434583,-.06325684,.015094809,.0008206752,.06366539,-.043399274,.016513249,.022080228,-.13423097,.0045239828,-.08749031,.0052159997,-.08475643,-.08858278,-.08505489,-.018475588,-.06876059,-.004767673,.03807114,.017341252,.014344289,-.062028043,-.029998908,.016335024,-.013134086,.017730787,-.00030456117,-.03671223,-.008882961,-.00087901717,.020685788,.018825224,-17843321e-15,.021327008,.023963079,.05022901,.008294422,.053031225,-.0028987366,.0028941107,.060937054,.104764014,.07408303,.03126725,.024362724,-.038033344,.026391407,.056392454,.011555486,-.07409382,.054696538,-.022934752,.051603854,-.029588545,-.009689524,-.0086016655,.0019834305,.010737624,.051202454,.007618081,-.01840879,-.056514017,.16168329,-.022036213,.006934529,.017244684,.0716604,.017871745,-.026446052,-.07376763,.017091744,-.0013896598,-.07315456,-.006011402,.033570495,.041269004,.102064684,-.01683012,-.04633856,.075674005,-.011114054,.0138549935,-.08057092,.018888203,.06596067,.04433762,.10206802,.039101917,.06711373,.058326133,.05709235,.0014182302,-.033379413,-.0055335034,.062244464,-.05408989,-.0045401086]},{id:"tool-graph-retrieval",type:"navigation",group:"tools",label:"Graph Retrieval",description:"Explore graph relationships for the selected table",href:"/retrieval/graph",icon:"Network",product:"antfly",embedding:[.053930108,-.013544671,-.044834528,.0062742783,.019840378,-.07216902,-.013344643,.033728275,-.019263534,.11352999,.034947094,-.04133747,.037447803,.123561695,.009322797,.13893369,-.027595084,.018367643,-.042997472,-.15850063,-.010047569,-.047436297,-.042394567,.0119181005,.016023837,.053068127,-.03351623,-.02888535,.07964562,-.048875876,-.043116827,-.029867385,.06281969,.03369071,-.055833522,.026123676,.050024357,.09864921,-.0058197514,-.009368598,-.04286734,.019110594,.025992615,.07691908,.0073423428,.06232982,-.09511844,.028391268,-.007830356,.03111746,-.09878692,-.07939332,-.042518087,-.09419533,.09105082,.038447686,-.020058755,-.059259,-.02655185,-.039527673,.034905966,-.05273598,-.06671853,.04907381,.017699096,.019187728,.014538029,.03887137,.025975246,.022746596,.01901834,.008199081,-.070722654,-.038617313,.03494448,.048520844,.006292828,.01824218,-.04600169,-.13358952,-.0016872741,.041781653,-.039838675,.10463148,.022557443,.0046159783,.00689033,-.019876853,.034498088,-.032941587,-.043869063,-.031316258,-.0050625484,-.0026343847,.06317051,.069321774,.061079193,-.12551646,-.024417745,.08228324,.0009328466,.019039765,.06763592,-.07636802,-.037819657,.014421464,-.05506441,.03337924,.020656558,-.023154154,-.06088442,.05973666,.0026170032,.0062680338,.018578548,-.03276006,-.030743422,-.017848575,-.004964267,.014493366,.014998901,.02503801,-.0106195565,.02692376,.027495481,.0044971327,-.041960075,-4697565e-40,.07965066,.06536006,.1005269,.044516675,.09575232,.051726647,-.03918935,-.0115767615,-.08112377,-.03972595,-.03987699,.07314627,-.0012158162,.076321036,.010650257,-.058244243,.0096386485,.06318165,-.082788944,-.0461642,-.020818334,-.042984165,.0094692055,.029042743,.044332612,.038821373,.0141993705,.006615749,.038995616,-.02050122,-.016678194,.025224095,-508021e-9,.03547204,-.028638162,.013117296,.0129358135,-.093760066,.04522195,-.05068883,.0051316465,.016732939,-.03247578,.031158112,.007869372,.0060431096,.029701855,-.031739242,.051941603,-.045169063,.011067914,-.004632264,.028941624,-.01861862,.08314986,.03697557,.06381405,.03553337,.045773156,.062272586,-.04890318,.010662453,.003907142,.031449273,-.033035,.044718266,-.09324775,.0036229459,.13077919,.0043401816,-.039916348,.06385889,.011376384,-.014911448,-.063315034,-.00052642566,-.12506421,-.07418722,-.019976778,-.01420993,-.09262536,-.14033443,-.071833655,-.059358645,.01899606,-.020045985,.046273783,-.01772496,.007986488,-.051624082,-.0465245,.015899522,.02715209,.02751665,.013255105,-3717102e-40,-.08662653,.0567811,-.0038017575,.099143304,.07564392,-.031911146,-.019066673,.00047033172,-.062339846,.036201958,.0028250325,-.09261502,-.07586186,-.0019946608,-.030037984,.033090446,.044822402,-.017689295,-.05707165,.049077153,-.030388786,.040197063,-.12777695,.050153095,.04698245,.052799135,-.018923199,-.05053371,-.041819967,.12330131,.0101273265,-.09464183,-.029662224,-.06948789,.016369006,.008115286,.12525216,-.082699746,.002893759,-.075715855,-.006082166,.0153377475,.025381198,-.08802829,.015453167,.07615285,-.07234668,.04785721,-.04829122,-.022513494,-.011849606,.0065243836,.03437112,-.06523269,.03246069,-.015561671,.03772817,.07052865,-.0359717,-.0052083135,-.020483447,-.09429367,-.019067992,.037993785,.013868259,.010158943,-.031756185,.058334444,-.050293718,-.016050966,-.018749617,.08370214,-.056954797,-.08779023,.06635765,-.010665188,-.02527477,.033502392,-.025756883,-.029889643,-.025233451,-.038538177,.11252917,.036533322,.0055180257,.038680594,.024985885,.07256783,.045559842,.034355804,-.09382253,-.040099505,-.102217644,.10350164,.023546796,-16713754e-15,-.08796482,-.03250155,.07967074,-.034165174,.058176316,.01638016,.044102814,.079629764,-.032100063,.04046386,-.0068844324,.021506868,-.08290044,.05315421,.07603181,.007386934,-.018582545,.028552555,.016738722,-.052390445,.037661184,-.030092329,-.059634108,.119195506,.04635169,-.050396774,-.026244368,.084334016,-.024935251,.025097119,-.0064789355,-.06299392,.063518204,-.00039318574,.0889826,.018655505,-.04718608,.013489543,-.014982913,.047455374,-.014070455,.034998573,-.023739194,.0063816514,.00545996,.04536625,-.024293158,-.00945152,-.06454721,-.006852639,-.07889211,-.015955342,.030004727,-.0434881,.042622272,.034136835,-.031946257,-.014369257,.028175658,-.0022930142,.008754428,-.021178871,.038103763,.06130162]},{id:"tool-chunk-text",type:"navigation",group:"tools",label:"Chunk Text",description:"Split text into chunks for retrieval workflows",href:"/inference/playground/chunk",icon:"Scissors",product:"inference",embedding:[-.06970131,.09474816,.057795558,-.011022197,.00977627,-.09604803,-.007939067,.02813458,-.05661131,-.0013969138,-.03101834,-.009047856,-.0039018027,-.021884287,.03760199,-.003222,.0068975263,.11954068,-.018323153,-.022230329,-.030869303,.0014648221,-.008496318,.00079959485,.039671402,.059614185,-.1031707,-.040378377,.081458814,-.040963758,.056086447,-.005579152,-.030085767,.0048133694,.030343408,.048076585,-.038407195,.010669538,.012079646,.046453,-.008091507,.015217909,-.0066704694,-.01644044,.063726515,-.013747901,-.038034588,.053012263,-.014450237,-.031234974,-.0676618,-.016091889,-.03210442,.03551687,-.029936695,-.049694795,.035693526,-.008048574,-.028403897,.04471145,-.08277617,.014360658,-.014010489,.00020881693,.0843394,.027614802,.06190402,.08205767,-.016455548,.083378896,-.06915622,.066485964,-.018328307,.07900093,.01924458,.09829041,-.012588297,-.05521032,.01548151,-.12694481,-.04923381,-.0452919,.05505525,-.026718436,-.015043646,.050226104,.031740468,.030055225,-.009899655,.026939869,.022869488,-.061938044,.047283936,.010849457,-.013574276,.0714798,.01686062,-.0012698716,.053758085,.09640307,-.03978909,.027915286,.12394094,-.030468365,-.032298483,-.06110389,-.006891309,-.05505122,-.0075840694,-.03551336,.049756333,.012291539,-.027210789,-.027622905,-.036401737,-.08314442,.08902699,-.065053806,-.044415653,.09016634,.046359584,.02456509,-.04684661,.041214485,.017441805,.059057474,.066599555,-9407164e-40,-.041620966,-.02698312,-.037187666,.087337576,-.045803864,-.0054407376,-.016197313,.037923872,-.019680558,.025463033,-.016026104,-.021569973,.012245288,.007425903,.033364363,-.005638061,-.04742986,.038308058,-.07116564,.037571266,-.06391347,-.039175734,-.0054768217,-.059561715,-.054772053,.012246766,.05064459,-.11019101,-.07736046,.0014278317,-.003588159,-.049641702,-.08089218,.043338206,.07404405,.02142215,-.060356796,-.029649384,-.092092454,.005567892,-.060214028,-.046270937,.017835151,-.009551438,.008215153,-.07760394,-.065905556,.04809494,.013552425,.040154934,.11841456,.11175449,-.0071413424,-.022648873,.017979732,.032139495,.0387793,-.04692546,.08788805,.12083606,.0033923422,.041020285,-.027503528,.11522321,-.015990283,.00902255,-.037055857,.012219382,.008981137,-.03775798,.06864536,-.0717733,-.02305202,.039474986,-.040607773,-.020646488,.0787798,-.007779794,-.05783247,-.13181606,.08613717,-.02178259,.039486043,-.1051426,-.11220573,-.009319543,.03861687,-.12615979,-.015543168,-.07161802,.0027797425,.024706786,-.02944178,-.06691482,.110648245,-25560328e-41,.081739485,-.041469816,-.0320515,.05956987,.0033091926,.028229805,.0042185155,.026138335,-.045503806,.05662812,-.06799236,.0076928353,-.061963785,-.0029812579,-.053202298,-.043686844,.03155388,-.024043838,.05718889,.07556725,-.005700307,-.03726342,.02555406,.06819992,-.011985264,-.002666642,.011007778,-.042104937,-.027871277,-.017750941,-.04229138,-836267e-9,-.0050167576,-.037631173,.017212482,-.09369308,.08380546,.06600954,-.008723541,-.012774674,.012342875,.03631463,-.080150485,.0044484828,-.054008484,.030370735,-.07209446,.066061474,-.0066132513,.031258844,.007716961,.009486776,.03174581,-.042594906,-.035088643,.009222486,-.008420501,-.06417533,-.09994568,.04870897,-.038908217,.09593725,-.046283986,.035240393,.08596653,-.08204722,-.036234256,-.08263123,-.10719158,.007939454,-.034715958,.00023838913,.077433795,-.05871609,.04108111,.03122541,-.004395738,-.09581149,.018163828,-.01869759,.01907246,-.054483917,.04197858,.043284353,-.041484054,.061796535,-.09296329,.0624069,.020837005,-.028744888,.012546251,.048716586,.015843349,.026195932,.025286065,-17484014e-15,.04016904,.0041433796,-.06621081,.021316588,-.05429866,.012504844,-.06880541,.055389438,-.01272715,.020698778,.0464363,-.038898837,-.10779776,.0102574015,.016860517,-.041460626,.0348126,-.0015220692,-.11833349,.031808406,-.014302223,.059195947,.050345097,.06161839,.0003797866,.008364388,-.008747614,.109982334,.08851677,-.08520154,.049830988,.046551254,-.06624083,-.045723844,.036748663,.0871887,.052734908,.018068984,.06501429,.11710557,-.009470325,.0133720245,.03667901,-.04498624,.056525905,-.0071494053,-.10949053,.00031861427,.020518746,-.025031533,-.005052555,-.063985676,-.018697932,.04304731,-.012466775,-.031696808,.058221202,-.009633714,-.013450606,.032681055,.07119699,.0003052627,.046320997,.044513904]},{id:"tool-extract-structured-data",type:"navigation",group:"tools",label:"Extract Structured Data",description:"Named entity recognition and extraction",href:"/inference/playground/extract",icon:"Tag",product:"inference",embedding:[-.08874562,-.022256212,-.009120181,-.053892467,.05053006,-.018486928,.040400177,-.0023831993,.00678099,-.033485394,-.017083945,-.049964372,.055115968,.02856298,.0723122,.11621531,.013505721,.110577516,-.011341603,-.13720617,-.03484333,.039668083,-.060305133,-.011397313,-.02914752,-6672216e-11,-.0589421,.019182982,.067470804,.0023251662,.06344531,.016785244,.07899404,.05560304,.025126237,.0599105,-.107087485,.03758737,-.024779892,-.008085059,-.017311882,-.061214868,.0147454925,-.029363371,.049912337,.036477707,-.07270669,.028746687,.0162153,.02533481,-.040776983,-.006465362,.024962394,.03077211,-.0137268035,.059512224,.060141917,-.015386921,-.01865124,-.005199858,-.026608417,-.021789294,-.023131404,-.00135589,346578e-9,-.042007215,.023246208,.011857866,.033630338,.017017908,-.036027715,.04890431,.022766814,.025144972,-.039077163,.03743241,-.03341334,.013124883,.0011179536,-.0827018,-.028642155,.030358551,.045186896,.0068913507,-.021423837,.056285936,.030857116,-.009633174,.037442878,.025036069,-.108868845,-.1871056,.119999595,.022544993,.041834503,.0018585209,.0195384,-.119737655,.025041256,.10005554,-.09481581,.08088752,.06743374,-.061568737,-.08100125,-.0020140924,-.028973028,-.0148079945,.0355644,.03234016,-.004276465,.05425694,.0487464,-.041099507,.02945718,-.098950244,.0397847,-.041567672,.01765266,.006547666,.008203671,.002300835,-.026167255,.048958246,-.008981567,.024226306,-.020911383,-9584274e-40,.032635942,.0454979,.018419713,-.026369724,-.022679312,-.007785179,.0021940018,.045453425,-.03885785,-.022327691,.0019622275,-.009865884,-.013914842,-.031050377,.053419642,-.06165334,-.027827619,.07345617,.011072786,-.017397832,-.026893234,.06812895,-.034149602,.011018081,-.018436478,-.009670455,.041326843,-.10176092,.02524133,-.011708108,.043063592,-.13117252,-.030904265,.029280726,.089641795,.03402943,.001914983,-.046097044,-.06553729,-.0425973,-.032553118,-.015792985,.01779063,.04861898,-.033694666,-.050946396,-.043428976,-.025793554,.010875289,-.04847061,.025908483,.031276725,-.05655302,-.0826133,.004419915,.07358752,-.018398182,.034098264,.013433331,.029192973,-.0211011,.025543623,.01067993,.019888932,.06340308,-.014386645,.022231935,-.02183116,.018992452,.04077786,.050529495,.057323698,.017114159,.05260068,.08995728,.057486992,.017959755,-.0601126,-.034633998,-.050996494,.025711996,-.05657452,.015926596,-.018972773,-.057702318,.030537311,.06909325,-.13482518,-.045129582,-.042330757,-.09091135,.013106769,-.09119072,.0006591146,-.044076413,11582032e-41,.021924162,-.052826915,.017587114,-.00891491,.017645834,-.057032097,-.05479536,.021281624,-.06699103,.01613404,-.0757141,-.025989637,-.0017958318,-.058128357,.022953894,.01017944,.019677006,.008150547,-.03293853,.16991146,.020294426,.010766736,-.16695169,.043645084,.04542826,.04990581,.046782892,.085163645,-.014247059,.02420847,-.066411756,-.013136621,-.040954836,-.041503884,-.058913212,-.11093835,.035609428,-.057760153,-.020482032,-.06862799,.01852444,.054265812,-.08041484,-.023017019,-.06566843,-.0395714,-.13070229,.13387576,-.005659357,-.009325352,-.07045391,-.043156464,-.09691108,-.026925601,.025016258,.011205975,.06352339,-.07645516,-.029411297,.011306064,.021071061,.105412565,-.028521368,.103605464,.11213866,-.059073515,-.046811037,-.014090475,-.07850917,-.07917342,.069859825,.011620065,.016321333,-.05400831,-.003597211,.035069,-.026264125,-.04443558,-.03171094,-.057740778,.02392955,-.056429464,.096808225,.03557849,.04512177,.042053647,.060158957,.058278855,.05408943,-.0140841855,.004139648,.0035795984,.010609446,.11326325,-.03836706,-16554221e-15,-.02049628,-.011871276,-.04047453,.031868387,.027649136,-3343825e-11,-.012241356,.02044731,-.00060266646,-.013478005,-.028561348,-.03178598,-.12949376,.032781497,.07572633,.025027623,.07762569,.09401692,-.028200414,.035326842,-.01938705,.070477575,.005465177,-.028838426,-.0021380177,-.0053907544,-.0052379207,.04684624,.07345141,-.079261385,.014573092,.118635364,-.026982939,-.02553052,.066520795,.12017756,.03427335,.002777453,.004496069,.10155242,.04135254,.033738405,-.042040657,-.011324064,-.009325293,-.016487904,-.047362935,-.043370914,.05368254,-.044932097,.0139782075,-.03521386,.018879674,.019789811,.016824624,.008150227,-.0067206146,.017065464,-.02835101,.039356355,.00029231558,.00092672626,.06323251,.036483094]},{id:"tool-rewrite-text",type:"navigation",group:"tools",label:"Rewrite Text",description:"Rewrite text with a model",href:"/inference/playground/rewrite",icon:"Repeat2",product:"inference",embedding:[-.084463075,.14094223,-.04622238,.018248912,.01543113,.026562368,.02127763,.034180872,-.06698536,-.033089407,-.001239184,-.0832511,.044669624,-.06606045,-.05705478,.023112949,-.039569937,-.04296307,.019053305,-.021119127,.034762032,.08653245,.06853946,-.030677877,.032446545,-.04674308,-.0025183125,.03730568,.07053921,.06184016,.07336035,.0688727,-.0041831876,.027498508,.08271991,.06848373,.018686762,.06942358,.041510135,.0040971814,-.0500892,-.036250602,.005052521,.058352634,.07177745,-.07574305,-.053487148,-.015777685,-.056440495,.021127457,-.07662754,-.01954917,.002007575,-.083532006,-.011295244,.00801884,-.0016668341,-.030974895,-.05016074,-.012977473,-.11635111,-.030236507,-.095803365,-.0042869616,.0013710728,-.0024442507,.101122804,.003280899,-.009067943,-.06754264,-.0941841,.026682489,-.031238269,.06191317,-.05893738,.11430292,-.038308512,.00086501875,-.0015197428,-.11770186,.050473,-.044131342,.05634117,.035519425,-.0011344851,.0692779,.08390422,.019700676,.00061204226,.098620996,-.060638476,-.08810078,.09526319,.031258438,.048172526,.090552,.00044815487,-.11621798,.07674242,.07799476,.023392241,.043279555,.06025556,-.04251425,-.06257475,.024660511,-.018917521,-.0206999,.023658559,-.010690749,-.0018687559,.014801291,.02682781,.014202736,-.048404183,-.022056762,.032588426,.01713552,.041016933,.006884167,.027060023,-.01959212,.023426313,.030477086,-.0047380663,-.010618698,-.0056355926,-26719077e-40,-.01563081,-.0389418,.047960524,.097616516,-.05938939,.045622684,.0042131175,.03176545,-.050586015,-.08354327,-.07858098,.0010786605,-.0022931497,.02479961,.061315708,.03554865,-.10442551,.081669904,-.05411106,.046398137,-.0097317565,.018001253,.032080386,-.02718287,.0320495,.022609109,.009108949,-.08979434,-.003932135,-.009201643,-.06131203,-.06394052,.009047915,.03929416,.002145154,.11007198,.048377883,-.004566065,-.0031544236,-.0085038515,-.038589843,.033879265,.06262212,.031336024,-.015948512,.009809364,.005647739,.03156098,.04426618,.021168714,-.014616074,.05115338,-.064941995,-.05178212,.060387064,-.00014722791,-.044985104,.06703584,.028195342,.050083775,.0095639,.13517597,.017044641,-.0029732569,-.038015746,-.059265614,-.047640093,-.030161798,.11704382,.026504265,.061755545,-.08472976,-.11775914,-.13248582,.058779728,.003388674,-.009806704,.06585782,-.06460815,-.050974987,.014964778,.04054566,-.06316731,-.08696052,.044087153,-.01930861,.04522911,-.020655153,-.025134517,-.0982327,.012228415,-.025710404,-.03958309,-.090277396,.030410726,-5806658e-40,.00044751735,-.032449655,-.050133348,.078766726,-.029816974,-.049576815,-.025322285,-.019051567,-.08390814,-.0072520617,-.012914244,.007132538,.010089916,-.03628172,-.050128028,-.0654509,-.037409812,-.070493944,-.026932735,.059647225,-.0058213407,.14775357,-.016423985,.050087977,-.010250522,.008126979,.029368177,-.0036744098,-.00769748,.02025245,-.0164947,-.01772089,-.011597456,.05268985,.0127476165,-.046558525,.13083443,-.022803457,.009107009,.05679844,-.004435224,.078046404,-.07073914,.0642607,-.08670193,.017407896,-.039750066,.039381787,.070046306,-.003935022,-.008821423,.02771747,-.009377325,-.075989254,-.11358007,-.030747086,.0052809543,.013246476,.023255771,.06840393,-.024793103,.022307618,.030128485,-.048359822,.054017864,-.06579509,-.03646095,.027356822,-.04938521,.015700962,-.08085496,-.028243616,-.013875418,-.040673785,.041197598,.06708142,-.004343417,-.026829615,-.0069557317,-.114816904,.044378072,.03696441,.023380293,.083717085,-.032893736,-.06662444,.028340401,.04961357,.016711911,.035681855,.017456826,-.021168608,-.06985708,.015795965,-.019506939,-17945776e-15,-.006394363,.062324956,-9754139e-11,.07650153,.022426873,.03990773,-.10990142,.014787171,.034846235,-.05804858,-.0020872538,.014958762,-.0528918,.045376908,.032406565,-.021288749,-.0076927035,.07470752,-.0830408,-.023529267,.021502675,.011928362,-.07762995,.08189152,-.04061262,.02823563,-.0058697476,-.0345648,.0020315216,-.03007603,.04856943,.02227605,-.096076146,.020034187,.046950717,.023578594,-.090531744,.016524311,.034517225,-.0028123085,-.008689297,-.01283491,-.022420773,-.010166118,-.061380103,-.09444464,-.049657904,-.051141396,-.053308543,-.032494865,-.094900176,-.08423578,.027076192,-.02030964,.026962418,-.036608737,.018314773,.03622159,-.020554554,.004848901,.072428755,.0887996,.017838985,.001954755]},{id:"action-toggle-theme",type:"action",group:"quickActions",label:"Toggle Theme",description:"Switch between light and dark mode",action:"toggle-theme",icon:"Moon",embedding:[.021015331,.04611802,.011224644,.0929371,.023360502,-.008410275,.06508567,-.0515074,-.0103888605,-.014892304,.02718553,-.0669572,-.063323885,-.05225197,.05546497,.0367312,.027198069,.023237465,.061169855,.01922119,.02363471,-.075216554,-.034238894,-.052898373,-.04567474,.06380429,.02719372,-.022427661,-.047568463,-.040539455,.023403354,.065015815,-.054412596,-.02576282,-.06769511,-.047651477,-.021822453,-.041715536,-.014031458,.027767403,-.026966298,-.033950735,-.03290846,-.030809356,-.07425715,.0326208,-.016034001,.016342202,.025491921,-.05381381,.09316339,-.03472782,-.007830638,-.020119954,.041606054,.07991103,.04235812,.09607449,.038599662,-.0756568,.037332647,.073594615,-.04901336,-.028378073,.100169666,.11556791,-.045504477,-.05163797,-.014821616,.014544631,.07363041,.042748414,.08856914,-.032888215,-.008716166,-.0151563175,-.0015828433,-.014413518,-.053731594,-.014846121,.051826086,-.027098006,-.064497255,.03935684,.08472167,.04184526,-.045379374,.045845028,-.027537588,.0025859436,-.07939321,-.0012634046,.04347528,-.007210602,-.07605376,-.063976005,-.010884013,-.06411127,-.044255428,.08476794,-.0034883984,-.07609638,.06022736,.04691306,.028703615,-.03884288,.06556433,.030475767,-.040518682,.032234408,.04059941,-.022722641,.0032961313,-.031186474,-.0037704231,.055777434,.04252327,.09913576,.0049860463,.07718512,.060762532,.014789461,-.0220477,-.009860352,.0029508844,.02020053,.06855313,25971414e-40,.12431951,-.047199707,-.038689528,.033466864,.04452494,.0110707665,.047750466,-.027367182,-.11341392,.02355595,.09261154,.047586888,-.030604765,.02230333,.06718056,-.03508816,.018942852,.02143716,.046899915,-.08457216,-.015865432,-.031851657,.002095017,-.035210673,-.01317065,.029991996,.013365165,-.040942267,-.016037216,.004067832,.0064344206,.05764414,.09478455,.07232832,-.027822467,.05645973,-.05431818,.0027717855,.032145333,-.024437662,-.11118324,.0018947776,-.024720319,.0037980445,.022936417,.04619673,.10463544,-.086171016,-.049687672,.039202675,.04922911,-.0646811,-.030203555,-.081724554,.046157107,-.026849432,-.031550974,.08042494,.02563542,-.003938778,.035649113,-.0457436,.032378126,-.06786206,.009333239,.00055946055,-.037370875,-.062360745,-.078289956,-.13218641,-.042377934,-.025253853,.020896804,-.007764118,-.036796466,.06579396,.001493979,-.04776013,-.021945339,-.0007373659,.026399907,.04549091,-.078026265,-.050001957,.04306877,-.0055757905,.014911023,-.016050922,-.053021304,-.008154585,-.004261716,.0015819833,.04638297,-.050504103,.0021285773,-2415207e-39,.022197677,-.040342584,-.0952004,.057925735,-.015182957,.040454675,.013435283,-.07856491,-.017285407,.10134537,.1373802,-.0015339549,-.04505992,.012558004,-.034734916,.0012614107,.04013384,.1155946,-.04443094,.09056105,-.08600291,-.05845598,-.054208487,-.020805517,-.07551731,.029499691,.08331385,.06989265,-.017507091,-.05519114,.025722386,.039611284,-.019214753,.019488921,-.03349486,.089743465,-.049561717,-.0073054465,-.08278244,.020935085,.019231947,.051886126,.06956427,-.04633524,-.11834713,.06472452,-.035040878,.0037803217,-.08225101,-.047864318,-.019528056,-.090442404,-.019809652,.008101462,-.058010828,.032808535,.03135762,.053735938,-.0026986904,.117877856,.110595435,-.022698488,-.0049602697,-.011608461,.0017405422,-.027067052,-.019845273,.040890735,.06903735,-.012051576,.07514964,-.026712492,.046508122,-.025720447,.046899524,-.085669085,.04056559,.016088352,-.106240146,-.054565676,.020578448,-.07799154,.024285458,.0004280426,-.061270542,.036486402,-.05892136,.05538944,-.0018986709,-.059999224,-.09741779,.033229575,.08710978,-.012596878,.041586887,-18150276e-15,-.06292275,-.069363415,.0871275,-.022667078,.0045574387,.040028933,.024972603,-.052509457,.0009808771,.013331666,.0044475403,.012100486,.035712633,.039013274,.017234966,.08713012,-.040424403,.0002578425,.013594123,-.009672304,-.04521528,.0030568177,.0141780395,-.043559767,.065785035,.015885245,.021780467,.0006341215,.1120176,.05563781,.013914078,.037798535,-.0113636,-.070465565,-.051158167,.01736645,-.02608868,.07767548,-.007849373,-.015947971,.011249832,.029067192,-.1225885,.0069179265,-.13122576,-.032101676,.09302361,.016995095,-.058885843,.058040306,.039273713,-.0031883777,.021903811,.026383303,-.005458636,-.056622382,.0021553566,.057499904,-.06203852,-.013515508,.05877982,-.08229447,-.09794669,.031005852]}],HOn={model:qOn,dimension:384,generatedFrom:GOn,commands:UOn},wde=zOn,gUe=HOn;function Ro(){const e=(0,z.useContext)(Mjt);if(e===void 0)throw new Error("useApiConfig must be used within an ApiConfigProvider");return e}function dh(){const{client:e}=Ro();return e}var jjt=(0,z.createContext)(void 0);function kR(){const e=(0,z.useContext)(jjt);if(e===void 0)throw new Error("useAuth must be used within an AuthProvider");return e}var $jt=(0,z.createContext)(void 0);function yb(){const e=(0,z.useContext)($jt);if(e===void 0)throw new Error("useTable must be used within a TableProvider");return e}var zjt=z.createContext(void 0);function WOn(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function hUe(e){(e==="system"?WOn():e)==="dark"?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")}function YOn({children:e,defaultTheme:t="system"}){const[n,a]=z.useState(()=>typeof window>"u"?t:localStorage.getItem("theme")||t);z.useEffect(()=>{hUe(n),localStorage.setItem("theme",n)},[n]),z.useEffect(()=>{if(n!=="system")return;const i=window.matchMedia("(prefers-color-scheme: dark)"),o=()=>hUe("system");return i.addEventListener("change",o),()=>i.removeEventListener("change",o)},[n]);const r=z.useMemo(()=>({theme:n,setTheme:a}),[n]);return(0,b.jsx)(zjt.Provider,{value:r,children:e})}function _R(){const e=z.useContext(zjt);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e}function VOn(e,t){if(e.length!==t.length)throw new Error(`Vector length mismatch: ${e.length} vs ${t.length}`);let n=0,a=0,r=0;for(let o=0;o<e.length;o++)n+=e[o]*t[o],a+=e[o]*e[o],r+=t[o]*t[o];const i=Math.sqrt(a)*Math.sqrt(r);return i===0?0:n/i}async function KOn(e,t,n=3){try{const a=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:gUe.model,input:e})});if(!a.ok)return[];const r=(await a.json()).data[0]?.embedding;return Array.isArray(r)?gUe.commands.map(i=>({item:{id:i.id,type:i.type,group:i.group,label:i.label,description:i.description,href:i.href,action:i.action,icon:i.icon,product:i.product,adminOnly:i.adminOnly},score:VOn(r,i.embedding)})).sort((i,o)=>o.score-i.score).slice(0,n):[]}catch(a){return console.error("Semantic search failed:",a),[]}}var qjt={Table:YOt,Plus:Ju,Library:MOt,Users:bRn,FileInput:ROt,FileStack:QOt,Shield:t6e,KeyRound:JFe,Scissors:uT,Tag:LL,HelpCircle:kx,Network:g0,Plug:qOt,ClipboardCheck:ZFe,Bot:KFe,Search:nm,Upload:BS,Waypoints:n6e,ArrowUpDown:O$,Repeat2:GOt,RotateCw:UOt,ScanLine:e6e,Mic:VN,Moon:jOt,Sun:WOt},Gjt=z.createContext(void 0);function ZOn(e){return!e||e==="toggle-theme"}function vde(e){return{id:e.id,icon:qjt[e.icon]??kx,label:e.label,href:e.href,action:e.action,product:e.product,adminOnly:e.adminOnly}}function JOn({children:e}){const[t,n]=z.useState(!1),[a,r]=z.useState(!1),[i,o]=z.useState(""),[s,l]=z.useState([]),[u,d]=z.useState(!1),p=Ym(),{hasPermission:m}=kR(),{selectedTable:A,graphIndexes:g,isLoadingIndexes:h}=yb(),{theme:f,setTheme:y}=_R(),{inferenceUrl:w}=Ro(),v=!lie()&&m("*","*","admin"),k=z.useCallback(Q=>!(!ZOn(Q.action)||Q.product&&!Fl(Q.product)||Q.adminOnly&&!v||Q.href==="/retrieval/graph"&&!h&&g.length===0),[g.length,h,v]);z.useEffect(()=>{r(!0)},[]);const _=z.useCallback(()=>{n(Q=>!Q)},[]);z.useEffect(()=>{const Q=B=>{B.key==="k"&&(B.metaKey||B.ctrlKey)&&(B.preventDefault(),_())};return document.addEventListener("keydown",Q),()=>document.removeEventListener("keydown",Q)},[_]);const x=z.useMemo(()=>wde.filter(Q=>Q.group==="navigation").map(vde).filter(k),[k]),E=z.useMemo(()=>wde.filter(Q=>Q.group==="tools").map(vde).filter(k),[k]),S=z.useMemo(()=>wde.filter(Q=>Q.group==="quickActions").map(vde).filter(k),[k]),D=z.useMemo(()=>{if(!A)return[];const Q=`/tables/${encodeURIComponent(A)}`;return[{id:"context-create-index",icon:Ju,label:`Create index for ${A}`,href:`${Q}?section=indexes`,product:"antfly"},{id:"context-upload-data",icon:BS,label:`Upload data to ${A}`,href:`${Q}?section=bulk`,product:"antfly"},{id:"context-search-table",icon:nm,label:`Search ${A}`,href:`${Q}?section=semantic`,product:"antfly"},{id:"context-view-retrieval-trace",icon:ZFe,label:`View retrieval trace for ${A}`,href:`${Q}?section=semantic`,product:"antfly"}]},[A]),L=z.useMemo(()=>[...x.map(Q=>Q.label),...E.map(Q=>Q.label),...D.map(Q=>Q.label),...S.map(Q=>Q.label)],[x,E,D,S]),F=z.useMemo(()=>{if(!i)return!0;const Q=i.toLowerCase();return L.some(B=>B.toLowerCase().includes(Q))},[i,L]);z.useEffect(()=>{if(F||i.length<2){l([]);return}d(!0);const Q=setTimeout(async()=>{try{l((await KOn(i,w("embed"))).filter(B=>k(B.item)))}catch(B){console.error("Semantic search failed:",B),l([])}d(!1)},300);return()=>clearTimeout(Q)},[i,F,w,k]),z.useEffect(()=>{t||(o(""),l([]),d(!1))},[t]);const M=z.useCallback((Q,B)=>{n(!1),B==="toggle-theme"?y(f==="system"?"light":f==="light"?"dark":"system"):Q&&p(Q)},[p,f,y]);return(0,b.jsxs)(Gjt.Provider,{value:{isOpen:t,setIsOpen:n,toggle:_},children:[e,(0,b.jsxs)(eQn,{open:t,onOpenChange:n,children:[(0,b.jsx)(Nre,{placeholder:"Type a command or search...",value:i,onValueChange:o}),(0,b.jsxs)(Lre,{children:[(0,b.jsx)(Rre,{children:u?(0,b.jsxs)("div",{className:"flex items-center justify-center gap-2 py-6",children:[(0,b.jsx)(_0,{className:"h-4 w-4 animate-spin"}),(0,b.jsx)("span",{children:"Searching..."})]}):"No results found."}),!F&&s.length>0&&(0,b.jsx)(NC,{heading:"Closest Matches",children:s.map(Q=>{const B=qjt[Q.item.icon]||kx;return(0,b.jsxs)(LC,{value:`${i} ${Q.item.label}`,onSelect:()=>M(Q.item.href,Q.item.action),children:[(0,b.jsx)(B,{className:"h-4 w-4"}),(0,b.jsx)("span",{children:Q.item.label})]},Q.item.id)})}),(0,b.jsx)(NC,{heading:"Quick Actions",children:S.map(Q=>{let B=Q.icon,I=Q.label;return a&&Q.action==="toggle-theme"&&(B=f==="dark"?WOt:jOt,I=f==="dark"?"Switch to Light Mode":"Switch to Dark Mode"),(0,b.jsxs)(LC,{onSelect:()=>M(void 0,Q.action),className:"flex items-center gap-2 cursor-pointer",children:[(0,b.jsx)(B,{className:"h-4 w-4"}),(0,b.jsx)("span",{children:I})]},Q.id)})}),(0,b.jsx)(Gue,{}),(0,b.jsx)(NC,{heading:"Navigation",children:x.map(Q=>(0,b.jsxs)(LC,{onSelect:()=>M(Q.href),className:"flex items-center gap-2 cursor-pointer",children:[(0,b.jsx)(Q.icon,{className:"h-4 w-4"}),(0,b.jsx)("span",{children:Q.label})]},Q.id))}),(0,b.jsx)(Gue,{}),D.length>0&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(NC,{heading:"Current Table",children:D.map(Q=>(0,b.jsxs)(LC,{onSelect:()=>M(Q.href),className:"flex items-center gap-2 cursor-pointer",children:[(0,b.jsx)(Q.icon,{className:"h-4 w-4"}),(0,b.jsx)("span",{children:Q.label})]},Q.id))}),(0,b.jsx)(Gue,{})]}),(0,b.jsx)(NC,{heading:"Tools",children:E.map(Q=>(0,b.jsxs)(LC,{onSelect:()=>M(Q.href),className:"flex items-center gap-2 cursor-pointer",children:[(0,b.jsx)(Q.icon,{className:"h-4 w-4"}),(0,b.jsx)("span",{children:Q.label})]},Q.id))})]})]})]})}function XOn(){const e=z.useContext(Gjt);if(e===void 0)throw new Error("useCommandPalette must be used within a CommandPaletteProvider");return e}Gae();VQe();function Ea(...e){return TP(SP(e))}async function b0(e,t,n=1){for(let a=0;;a++){const r=await fetch(e,t);if(r.status===502&&a<n){await new Promise(i=>setTimeout(i,2e3));continue}return r}}function YP({options:e,value:t,onChange:n,placeholder:a="Select option...",searchPlaceholder:r="Search options...",emptyText:i="No option found.",allowCustomValue:o=!1,className:s,disabled:l=!1}){const[u,d]=z.useState(!1),[p,m]=z.useState(""),A=e.find(w=>w.value===t),g=w=>{n?.(w===t?"":w),d(!1),m("")},h=w=>{m(w),o&&n&&n(w)},f=w=>{o&&w.key==="Enter"&&p&&(n?.(p),d(!1),m(""),w.preventDefault())},y=A?A.label:o&&t?t:"";return(0,b.jsxs)(j$,{open:u,onOpenChange:d,children:[(0,b.jsx)($$,{asChild:!0,children:(0,b.jsxs)(Ct,{variant:"outline",role:"combobox","aria-expanded":u,className:Ea("w-full justify-between",!y&&"text-muted-foreground",s),disabled:l,children:[y||a,(0,b.jsx)(TOt,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,b.jsx)(z$,{className:"w-full p-0",align:"start",children:(0,b.jsxs)(Dre,{children:[(0,b.jsx)(Nre,{placeholder:r,value:p,onValueChange:h,onKeyDown:f}),(0,b.jsxs)(Lre,{children:[(0,b.jsx)(Rre,{children:i}),e.length>0&&(0,b.jsx)(NC,{children:e.map(w=>(0,b.jsxs)(LC,{value:w.value,onSelect:g,children:[(0,b.jsx)(Ud,{className:Ea("mr-2 h-4 w-4",t===w.value?"opacity-100":"opacity-0")}),w.label]},w.value))})]})]})})]})}var e7n=15e3,t7n=16,II=new Map,pH=new Map;function n7n(e,t){II.delete(e),II.set(e,t),II.size>t7n&&II.delete(II.keys().next().value)}function Ujt(e){const{apiUrl:t,client:n}=Ro(),a=`${t}|models=${e}`,r=II.get(a)??null,[i,o]=(0,z.useState)(r?.connections??[]),[s,l]=(0,z.useState)(r?.supported??!0),[u,d]=(0,z.useState)(!r),[p,m]=(0,z.useState)(null),A=(0,z.useRef)(!0),g=(0,z.useCallback)(async(f,y)=>{d(!0),m(null);try{const w=`${a}|refresh=${!!y?.refresh}`;let v=pH.get(w);v||(v=(async()=>{const _=new AbortController,x=window.setTimeout(()=>{_.abort(new DOMException("Request timed out","TimeoutError"))},e7n);try{const E=await n.connections.list({include:e?["models"]:void 0,refresh:y?.refresh,signal:_.signal});return{connections:E?.connections??[],supported:E!==void 0}}finally{window.clearTimeout(x)}})(),pH.set(w,v),v.then(()=>pH.delete(w),()=>pH.delete(w)));const k=await v;if(f?.aborted||!A.current)return;n7n(a,k),o(k.connections),l(k.supported),d(!1)}catch(w){if(f?.aborted||!A.current)return;m(w instanceof Error?w.message:"Failed to fetch connections"),d(!1)}},[a,n,e]),h=(0,z.useCallback)(()=>{g(void 0,{refresh:!0})},[g]);return(0,z.useEffect)(()=>{A.current=!0;const f=II.get(a);if(f)return o(f.connections),l(f.supported),d(!1),m(null),()=>{A.current=!1};const y=new AbortController;return g(y.signal),()=>{A.current=!1,y.abort()}},[a,g]),{connections:i,supported:s,loading:u,error:p,retry:h}}function a7n(){return Ujt(!0)}function CR(){const e=Ujt(!0);return{providers:e.connections.filter(t=>t.kind==="inference"),supported:e.supported,loading:e.loading,error:e.error,retry:e.retry}}function tb(e){const{inferenceConnectionId:t}=Ro(),{providers:n,loading:a}=CR(),r=n.find(o=>o.id===t)?.inference?.models,i=(0,z.useMemo)(()=>[...r?.[e==="other"?"other":`${e}s`]??[],...e==="generator"?r?.other??[]:[]].map(o=>o.name),[e,r]);return{models:(0,z.useMemo)(()=>[...new Set(i)],[i]),loading:a}}function Hjt(e,t){const n={};for(const a of e){const r=a.inference;if(!r||a.status!=="connected")continue;const i=r.models;if(!i)continue;const o=[...i[`${t}s`]??[],...t==="generator"?i.other??[]:[]].map(l=>l.name).filter(l=>l.length>0);if(o.length===0)continue;const s=n[r.provider]??[];n[r.provider]=[...new Set([...s,...o])]}return n}var kde={antfly:"gemma-3-1b-it",ollama:"llama3.3:70b",gemini:"gemini-2.5-flash",openai:"gpt-4.1",vertex:"gemini-2.5-flash"},r7n={antfly:"Antfly (Local)",ollama:"Ollama (Local)",gemini:"Google AI (Gemini)",openai:"OpenAI",vertex:"Google Cloud Vertex AI"},Z$={provider:"openai",model:"gpt-4.1",temperature:.7},i7n=["gemini","vertex","openai","ollama","antfly"];function v8(e,t="Server default"){return!e?.provider||!e?.model?t:`${e.provider}/${e.model}`}function uie(e){return e?{label:"Dashboard default",description:`Use the dashboard default generator (${v8(e)}).`}:{label:"Server default",description:"Use the generator configured in the Antfly server config and omit any local override."}}function k8({value:e,onChange:t,defaultConfig:n,defaultLabel:a="Server default",defaultDescription:r="Omit the generator override and let the backend choose the configured default.",customLabel:i="Custom override",showTemperature:o=!0,temperatureDisabled:s=!1,temperatureHelpText:l,providers:u=mOn,className:d}){const p=e?"custom":"default",m=(0,z.useId)(),A=`${m}-generator-mode-default`,g=`${m}-generator-mode-custom`,{providers:h}=CR(),f=(0,z.useMemo)(()=>Hjt(h,"generator"),[h]),y=(0,z.useMemo)(()=>{if(!e)return[];const k=f[e.provider]??[];return(k.length>0?k:[kde[e.provider]]).filter(_=>!!_).map(_=>({value:_,label:_}))},[f,e]),w=k=>{if(k==="default"){t(null);return}t(e?{...e}:{...n})},v=k=>{if(!e)return;const _=k,x=f[_]?.[0];t({...e,provider:_,model:x||kde[_]||e.model})};return(0,b.jsxs)("div",{className:Ea("space-y-4",d),children:[(0,b.jsxs)(v7,{value:p,onValueChange:w,className:"gap-2",children:[(0,b.jsxs)("label",{htmlFor:A,className:"flex items-start gap-3 rounded-none border p-3 cursor-pointer hover:bg-muted/30",children:[(0,b.jsx)(Of,{value:"default",id:A,className:"mt-0.5"}),(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)(Yt,{htmlFor:A,className:"cursor-pointer",children:a}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:r})]})]}),(0,b.jsxs)("label",{htmlFor:g,className:"flex items-start gap-3 rounded-none border p-3 cursor-pointer hover:bg-muted/30",children:[(0,b.jsx)(Of,{value:"custom",id:g,className:"mt-0.5"}),(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)(Yt,{htmlFor:g,className:"cursor-pointer",children:i}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"Pick a provider and model for this playground only."})]})]})]}),e&&(0,b.jsxs)("div",{className:Ea("grid gap-4",o?"grid-cols-1 lg:grid-cols-3":"grid-cols-1 lg:grid-cols-2"),children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(Yt,{className:"text-xs text-muted-foreground",children:"Provider"}),(0,b.jsxs)(Gr,{value:e.provider,onValueChange:v,children:[(0,b.jsx)(Hr,{children:(0,b.jsx)(Ur,{})}),(0,b.jsx)(Wr,{children:u.map(k=>(0,b.jsx)(ra,{value:k,children:r7n[k]||k},k))})]})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(Yt,{className:"text-xs text-muted-foreground",children:"Model"}),(0,b.jsx)(YP,{options:y,value:e.model,onChange:k=>t({...e,model:k}),placeholder:kde[e.provider],searchPlaceholder:"Search or type a model...",emptyText:"Type a model name.",allowCustomValue:!0})]}),o&&(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(Yt,{className:"text-xs text-muted-foreground",children:"Temperature"}),(0,b.jsx)(an,{type:"number",value:e.temperature??n.temperature??0,onChange:k=>{const _=Number.parseFloat(k.target.value);t({...e,temperature:Number.isFinite(_)?_:n.temperature??0})},min:0,max:2,step:.1,disabled:s,className:Ea(s&&"bg-muted")}),l&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:l})]})]})]})}var Wjt=(0,z.createContext)(void 0);function J$(){const e=(0,z.useContext)(Wjt);if(!e)throw new Error("useGeneratorPreference must be used within a GeneratorPreferenceProvider");return e}function o7n(){const{dashboardGenerator:e,setDashboardGenerator:t}=J$();return(0,b.jsxs)(j$,{children:[(0,b.jsx)($$,{asChild:!0,children:(0,b.jsxs)(Ct,{variant:"outline",size:"sm",className:"max-w-[260px] gap-2",children:[(0,b.jsx)(XA,{className:"size-4 shrink-0"}),(0,b.jsx)("span",{className:"hidden md:inline",children:"Generator"}),(0,b.jsx)("span",{className:"hidden lg:inline truncate text-muted-foreground",children:v8(e)})]})}),(0,b.jsxs)(z$,{align:"end",className:"w-[420px] space-y-3",children:[(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)("h4",{className:"text-sm font-medium",children:"Dashboard Generator"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"Playgrounds and query builders inherit this unless they set a local override."})]}),(0,b.jsx)(k8,{value:e,onChange:t,defaultLabel:"Server default",defaultDescription:"Leave unset to defer to the backend default generator.",customLabel:"Dashboard default",defaultConfig:Z$})]})]})}function Yjt({trigger:e}={}){const{apiUrl:t,setApiUrl:n,resetToDefault:a,inferenceApiUrl:r,setInferenceApiUrl:i,resetInferenceApiUrl:o}=Ro(),[s,l]=(0,z.useState)(!1),u=r||"same origin (/ai/v1)",d=Y$({defaultValues:{apiUrl:t,inferenceUrl:r}}),p=g=>{n(g.apiUrl),i(g.inferenceUrl),l(!1)},m=()=>{a(),o(),d.reset({apiUrl:t,inferenceUrl:r})},A=()=>{d.reset({apiUrl:t,inferenceUrl:r}),l(!1)};return(0,b.jsxs)(Hd,{open:s,onOpenChange:l,children:[(0,b.jsx)(Xf,{asChild:!0,children:e||(0,b.jsx)(Ct,{variant:"ghost",size:"icon",title:"Settings",children:(0,b.jsx)(ES,{className:"h-4 w-4"})})}),(0,b.jsxs)(Wd,{className:"sm:max-w-131.25",children:[(0,b.jsxs)(Gg,{children:[(0,b.jsx)(Yd,{children:"API Settings"}),(0,b.jsx)(qp,{children:"Configure the Antfly data and inference APIs. This is useful when accessing the dashboard remotely or connecting to separate Antfly deployments."})]}),(0,b.jsxs)(V$,{form:d,onSubmit:d.handleSubmit(p),className:"gap-6 py-4",children:[(0,b.jsx)(ya,{control:d.control,name:"apiUrl",render:({field:g})=>(0,b.jsxs)(na,{children:[(0,b.jsx)(ea,{children:"Antfly Data API URL"}),(0,b.jsx)(aa,{children:(0,b.jsx)(an,{placeholder:"http://localhost:8082/db/v1",...g})}),(0,b.jsxs)(Kv,{children:["Current:"," ",(0,b.jsx)("code",{className:"text-xs bg-muted px-1 py-0.5 rounded-none",children:t})]}),(0,b.jsxs)(Kv,{className:"text-xs",children:["Examples: ",(0,b.jsx)("code",{className:"bg-muted px-1 py-0.5 rounded-none",children:"/db/v1"})," ","(default),"," ",(0,b.jsx)("code",{className:"bg-muted px-1 py-0.5 rounded-none",children:"http://server:8082/db/v1"})]})]})}),(0,b.jsx)(ya,{control:d.control,name:"inferenceUrl",render:({field:g})=>(0,b.jsxs)(na,{children:[(0,b.jsx)(ea,{children:"Antfly Inference API URL"}),(0,b.jsx)(aa,{children:(0,b.jsx)(an,{placeholder:"/ai/v1",...g})}),(0,b.jsxs)(Kv,{children:["Current:"," ",(0,b.jsx)("code",{className:"text-xs bg-muted px-1 py-0.5 rounded-none",children:u})]}),(0,b.jsxs)(Kv,{className:"text-xs",children:["Examples: ",(0,b.jsx)("code",{className:"bg-muted px-1 py-0.5 rounded-none",children:"/ai/v1"})," ","(default),"," ",(0,b.jsx)("code",{className:"bg-muted px-1 py-0.5 rounded-none",children:"https://antfly.company.com/ai/v1"})]})]})}),(0,b.jsxs)(om,{children:[(0,b.jsx)(Ct,{variant:"outline",type:"button",onClick:m,children:"Reset to Default"}),(0,b.jsx)(Ct,{variant:"outline",type:"button",onClick:A,children:"Cancel"}),(0,b.jsx)(Ct,{type:"submit",children:"Save"})]})]})]})]})}var Vjt="antfarm-data-density",s7n="default",_de=["default","compact","comfortable"];function c7n(){try{const e=localStorage.getItem(Vjt);if(e==="compact"||e==="default"||e==="comfortable")return e}catch{}return s7n}function fUe(e){e==="default"?document.documentElement.removeAttribute("data-density"):document.documentElement.setAttribute("data-density",e)}function l7n(){const[e,t]=(0,z.useState)(c7n);(0,z.useEffect)(()=>{fUe(e)},[e]);const n=(0,z.useCallback)(a=>{t(a);try{localStorage.setItem(Vjt,a)}catch{}fUe(a)},[]);return{density:e,setDensity:n,toggleDensity:(0,z.useCallback)(()=>{const a=_de[(_de.indexOf(e)+1)%_de.length];n(a)},[e,n])}}function u7n({title:e,className:t,...n}){const{toggle:a}=XOn(),{density:r,toggleDensity:i}=l7n(),{theme:o,setTheme:s}=_R(),l=()=>{s(o==="system"?"light":o==="light"?"dark":"system")};return(0,b.jsxs)("header",{className:Ea("af-app-header sticky top-0 z-10 flex shrink-0 h-14 items-center gap-4 border-b border-border bg-background px-4",t),...n,children:[e&&(0,b.jsx)("h1",{className:"text-lg font-semibold",children:e}),(0,b.jsxs)("div",{className:"ml-auto flex items-center gap-2",children:[(0,b.jsxs)(Ct,{variant:"outline",size:"sm",onClick:a,className:"gap-2",children:[(0,b.jsx)(nm,{className:"size-4"}),(0,b.jsx)("span",{className:"hidden md:inline",children:"⌘K"})]}),(0,b.jsx)(o7n,{}),(0,b.jsx)(Yjt,{}),(0,b.jsx)(Ct,{variant:"ghost",size:"icon",onClick:l,title:o==="system"?"Switch to Light Mode":o==="light"?"Switch to Dark Mode":"Switch to System Theme",children:o==="system"?(0,b.jsx)(FOn,{className:"size-4"}):o==="light"?(0,b.jsx)(TOn,{className:"size-4"}):(0,b.jsx)(POt,{className:"size-4"})}),(0,b.jsx)(Ct,{variant:"ghost",size:"icon",onClick:i,title:`Density: ${r} (click to cycle)`,children:r==="compact"?(0,b.jsx)(G8n,{className:"size-4"}):r==="comfortable"?(0,b.jsx)(j8n,{className:"size-4"}):(0,b.jsx)(z8n,{className:"size-4"})})]})]})}function d7n({children:e}){const{apiUrl:t}=Ro(),[n,a]=(0,z.useState)(null),[r,i]=(0,z.useState)(null),[o,s]=(0,z.useState)(!0),[l,u]=(0,z.useState)(null),d=(0,z.useCallback)((_,x)=>new ox({baseUrl:t,..._&&x?{auth:{username:_,password:x}}:{}}),[t]),p=(0,z.useCallback)(()=>{const _=localStorage.getItem("antfly_auth");if(!_)return null;try{return JSON.parse(_)}catch{return null}},[]),m=(0,z.useCallback)((_,x)=>{localStorage.setItem("antfly_auth",JSON.stringify({username:_,password:x}))},[]),A=(0,z.useCallback)(()=>{localStorage.removeItem("antfly_auth")},[]),g=(0,z.useCallback)(async()=>{if(lie()||!Fl("antfly"))return!1;try{return(await d().getStatus())?.auth_enabled??!0}catch{return!0}},[d]),h=(0,z.useCallback)(async(_,x)=>{try{const E=await d(_,x).users.getCurrentUser();return{username:E?.username||_,permissions:E?.permissions||[]}}catch(E){throw E instanceof Error&&E.message.includes("401")?new Error("Invalid credentials"):new Error(`Failed to fetch user info from ${t}`)}},[t,d]),f=(0,z.useCallback)(async()=>{try{s(!0),u(null);const _=await g();if(i(_),!_){a(null),s(!1);return}const x=p();if(!x){a(null),s(!1);return}a(await h(x.username,x.password))}catch(_){u(_ instanceof Error?_.message:"Authentication failed"),A(),a(null)}finally{s(!1)}},[p,h,A,g]),y=(0,z.useCallback)(async(_,x)=>{try{s(!0),u(null);const E=await h(_,x);m(_,x),a(E)}catch(E){throw u(E instanceof Error?E.message:"Login failed"),E}finally{s(!1)}},[h,m]),w=(0,z.useCallback)(()=>{A(),a(null),u(null)},[A]),v=(0,z.useCallback)((_,x,E)=>r===!1?!0:n?(n.permissions??[]).some(S=>{const D=S.resource===_||S.resource==="*",L=S.resource_type===x||S.resource_type==="*",F=S.type===E||S.type==="admin";return D&&L&&F}):!1,[n,r]);(0,z.useEffect)(()=>{f().catch(_=>{u(_ instanceof Error?_.message:"Authentication check failed"),s(!1)})},[f]);const k={user:n,isAuthenticated:r===!1?!0:!!n,isLoading:o,error:l,login:y,logout:w,hasPermission:v,refreshUser:f,authEnabled:r};return(0,b.jsx)(jjt.Provider,{value:k,children:e})}var p7n=3e4,bUe=5e3;function m7n(){const{apiUrl:e,inferenceApiUrl:t}=Ro(),[n,a]=(0,z.useState)("checking"),[r,i]=(0,z.useState)("checking"),o=(0,z.useRef)(!0),s=(0,z.useCallback)(async d=>{if(!Fl("antfly")){a("connected");return}try{const p=await fetch(`${e}/status`,{method:"GET",signal:d??AbortSignal.timeout(bUe)});o.current&&a(p.ok?"connected":"disconnected")}catch{o.current&&a("disconnected")}},[e]),l=(0,z.useCallback)(async d=>{if(!Fl("inference")){i("connected");return}try{const p=await fetch(`${t}/healthz`,{method:"GET",signal:d??AbortSignal.timeout(bUe)});o.current&&i(p.ok?"connected":"disconnected")}catch{o.current&&i("disconnected")}},[t]),u=(0,z.useCallback)(()=>{Fl("antfly")&&a("checking"),Fl("inference")&&i("checking"),s(),l()},[s,l]);return(0,z.useEffect)(()=>{o.current=!0;const d=new AbortController;return s(d.signal),l(d.signal),()=>{o.current=!1,d.abort()}},[s,l]),(0,z.useEffect)(()=>{if(!(n==="disconnected"||r==="disconnected"))return;const d=setInterval(()=>{n==="disconnected"&&s(),r==="disconnected"&&l()},p7n);return()=>clearInterval(d)},[n,r,s,l]),{antfly:n,inference:r,retry:u}}function A7n(){const{antfly:e,inference:t,retry:n}=m7n(),{apiUrl:a,inferenceApiUrl:r}=Ro(),[i,o]=(0,z.useState)(!1),s="http://127.0.0.1:8080",l=a.startsWith("/")&&s?`${s}${a}`:a,u=r||`${s}/ai/v1`;(0,z.useEffect)(()=>{e==="connected"&&t==="connected"&&o(!1)},[e,t]);const d=()=>{o(!0)},p=[];Fl("antfly")&&e==="disconnected"&&p.push("antfly"),Fl("inference")&&t==="disconnected"&&p.push("inference");const m=Fl("antfly")&&e==="checking"||Fl("inference")&&t==="checking";if(i||m||p.length===0)return null;const A=p.includes("antfly")&&p.includes("inference"),g=A?"Antfly is not running":p.includes("antfly")?"Antfly data is not connected":"Antfly inference is not connected",h=A?(0,b.jsxs)(b.Fragment,{children:["Run ",(0,b.jsx)("code",{children:"./antfly standalone"}),", or use Settings to connect to another API."]}):p.includes("antfly")?(0,b.jsxs)(b.Fragment,{children:["Checking ",(0,b.jsx)("code",{children:l}),". Run ",(0,b.jsx)("code",{children:"./antfly standalone"})," or update Settings."]}):(0,b.jsxs)(b.Fragment,{children:["Checking ",(0,b.jsx)("code",{children:u}),". Run ",(0,b.jsx)("code",{children:"./antfly standalone"})," or update Settings."]});return(0,b.jsx)("div",{className:"af-connection-banner px-4 py-3",children:(0,b.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,b.jsxs)("div",{className:"flex items-start gap-3",children:[(0,b.jsx)(MP,{className:"af-connection-banner-icon h-5 w-5 mt-0.5 flex-shrink-0"}),(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"af-connection-banner-title",children:g}),(0,b.jsx)("p",{className:"af-connection-banner-description",children:h})]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(0,b.jsxs)(Ct,{variant:"outline",size:"sm",onClick:n,className:"af-connection-banner-action h-7 px-2 text-xs",children:[(0,b.jsx)(_x,{className:"h-3.5 w-3.5 mr-1"}),"Retry"]}),(0,b.jsx)(Ct,{variant:"ghost",size:"sm",onClick:d,"aria-label":"Dismiss",className:"af-connection-banner-action h-7 w-7 p-0",children:(0,b.jsx)(Zp,{className:"h-4 w-4"})})]})]})})}var g7n=class extends z.Component{state={hasError:!1,error:null};static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){console.error("Error caught by boundary:",e,t)}handleRetry=()=>{this.setState({hasError:!1,error:null}),window.location.reload()};render(){return this.state.hasError?this.props.fallback?this.props.fallback:(0,b.jsx)(Hxe,{children:(0,b.jsx)(Wxe,{children:(0,b.jsxs)(jn,{children:[(0,b.jsxs)(Hn,{className:"items-center text-center",children:[(0,b.jsx)(MP,{className:"af-status-icon-warning h-10 w-10"}),(0,b.jsx)(Wn,{children:"Something went wrong"}),(0,b.jsx)(SS,{children:"The application encountered an error. This might be because the backend server is unavailable."})]}),(0,b.jsxs)($n,{className:"space-y-4 text-center",children:[this.state.error&&(0,b.jsx)("p",{className:"rounded-none bg-muted p-2 font-mono text-xs text-muted-foreground",children:this.state.error.message}),(0,b.jsxs)(Ct,{onClick:this.handleRetry,className:"gap-2",children:[(0,b.jsx)(_x,{className:"h-4 w-4"}),"Reload Page"]})]})]})})}):this.props.children}},cte="antfarm-dashboard-generator";function Kjt(){try{return window.localStorage}catch{return null}}function h7n(){const e=Kjt();if(!e)return null;try{const t=e.getItem(cte);if(!t)return null;const n=JSON.parse(t);if(n&&typeof n=="object"&&typeof n.provider=="string"&&typeof n.model=="string")return n}catch{try{e.removeItem(cte)}catch{}}return null}function f7n({children:e}){const[t,n]=(0,z.useState)(h7n),a=(0,z.useCallback)(i=>{n(i);const o=Kjt();if(o)try{i?o.setItem(cte,JSON.stringify(i)):o.removeItem(cte)}catch{}},[]),r=(0,z.useMemo)(()=>({dashboardGenerator:t,setDashboardGenerator:a}),[t,a]);return(0,b.jsx)(Wjt.Provider,{value:r,children:e})}function Cde({children:e,requiredPermission:t}){const{isAuthenticated:n,isLoading:a,hasPermission:r,authEnabled:i}=kR(),o=vu();return a?(0,b.jsx)(Hxe,{children:(0,b.jsx)(Wxe,{children:(0,b.jsx)(jn,{children:(0,b.jsx)($n,{className:"py-6 text-center text-sm text-muted-foreground",children:"Loading..."})})})}):i===!1?(0,b.jsx)(b.Fragment,{children:e}):n?t&&!r(t.resource,t.resourceType,t.permissionType)?(0,b.jsx)(Hxe,{children:(0,b.jsx)(Wxe,{children:(0,b.jsx)(jn,{children:(0,b.jsxs)(Hn,{className:"text-center",children:[(0,b.jsx)(Wn,{children:"Access Denied"}),(0,b.jsx)(SS,{children:"You don't have permission to access this page."})]})})})}):(0,b.jsx)(b.Fragment,{children:e}):(0,b.jsx)(yP,{to:"/login",state:{from:o},replace:!0})}function b7n(e){return e.split(" ").map(t=>t[0]).join("").toUpperCase().slice(0,2)}function y7n(){const{isMobile:e,state:t}=Qre(),{user:n,logout:a,authEnabled:r}=kR(),i=Ym(),[o,s]=z.useState(!1),l=t==="collapsed";if(r===!1)return null;if(!n)return(0,b.jsx)(EC,{children:(0,b.jsx)(is,{children:(0,b.jsxs)("div",{className:"flex items-center gap-2 p-2",children:[(0,b.jsx)(Nl,{className:"h-8 w-8 rounded-none"}),(0,b.jsxs)("div",{className:"flex-1 space-y-2",children:[(0,b.jsx)(Nl,{className:"h-4 w-24"}),(0,b.jsx)(Nl,{className:"h-3 w-32"})]})]})})});const u=b7n(n.username),d=n.username,p=async()=>{s(!0);try{await a(),i("/login")}catch(m){console.error("Failed to logout:",m),s(!1)}};return(0,b.jsx)(EC,{children:(0,b.jsx)(is,{children:(0,b.jsxs)(Pee,{children:[(0,b.jsx)(jee,{asChild:!0,children:(0,b.jsxs)(rs,{size:"lg","aria-label":"Open user menu",className:Ea("data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",l&&"group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-0! relative z-50 pointer-events-auto"),children:[(0,b.jsxs)(Uqe,{className:"h-8 w-8 rounded-none",children:[(0,b.jsx)(Hqe,{src:void 0,alt:d}),(0,b.jsx)(Wqe,{className:"rounded-none bg-primary text-primary-foreground text-xs font-bold",children:u})]}),(0,b.jsxs)("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[(0,b.jsx)("span",{className:"truncate font-medium",children:d}),(0,b.jsxs)("span",{className:"truncate text-xs",children:[n.permissions?.length||0," permission(s)"]})]}),(0,b.jsx)(TOt,{className:"ml-auto size-4 opacity-50 peer-hover/menu-button:opacity-100 peer-data-[state=open]/menu-button:opacity-100 transition-opacity"})]})}),(0,b.jsxs)($ee,{className:"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-none",side:e?"bottom":"right",align:"end",sideOffset:4,children:[(0,b.jsx)(c7t,{className:"p-0 font-normal",children:(0,b.jsxs)("div",{className:"flex items-center gap-2 px-1 py-1.5 text-left text-sm",children:[(0,b.jsxs)(Uqe,{className:"h-8 w-8 rounded-none",children:[(0,b.jsx)(Hqe,{src:void 0,alt:d}),(0,b.jsx)(Wqe,{className:"rounded-none bg-primary text-primary-foreground text-xs font-bold",children:u})]}),(0,b.jsxs)("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[(0,b.jsx)("span",{className:"truncate font-medium",children:d}),(0,b.jsxs)("span",{className:"truncate text-xs",children:[n.permissions?.length||0," permission(s)"]})]})]})}),(0,b.jsx)(zee,{}),(0,b.jsxs)(OP,{onClick:()=>i("/settings"),className:"flex items-center gap-2",children:[(0,b.jsx)(ES,{className:"h-4 w-4"}),"Settings"]}),(0,b.jsx)(zee,{}),(0,b.jsxs)(OP,{onClick:p,disabled:o,className:"flex items-center gap-2 text-destructive focus:text-destructive",children:[(0,b.jsx)(h8n,{className:"h-4 w-4"}),o?"Signing out...":"Sign out"]})]})]})})})}function yUe(e,t){return`/tables/${encodeURIComponent(e)}?section=${encodeURIComponent(t)}`}function w7n({currentSection:e,onSectionChange:t,...n}){const a=vu(),r=Ym(),{state:i,toggleSidebar:o,isMobile:s}=Qre(),{hasPermission:l}=kR(),{tables:u,selectedTable:d,setSelectedTable:p,graphIndexes:m,isLoadingIndexes:A}=yb(),g=!lie()&&l("*","*","admin"),[h,f]=z.useState(!1),[y,w]=z.useState(!1),[v,k]=z.useState(!1);z.useEffect(()=>{k(!0)},[]);const _=L=>{d&&(t?.(L),r(yUe(d,L)))},x=L=>{r(`${L}${d?`?table=${encodeURIComponent(d)}`:""}`)},E=a.pathname.startsWith("/tables/"),S=L=>E&&e===L,D=L=>a.pathname===L;return(0,b.jsxs)(pQn,{collapsible:"icon",...n,children:[(0,b.jsx)(AQn,{className:"border-r border-b-0 group-data-[collapsible=icon]:border-r-0 gap-0 pb-0",children:(0,b.jsx)(EC,{children:(0,b.jsx)(is,{children:(0,b.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[i==="collapsed"&&!s?(0,b.jsx)(u8,{delayDuration:0,children:(0,b.jsxs)(Bx,{children:[(0,b.jsx)(Ix,{asChild:!0,children:(0,b.jsx)(rs,{size:"lg",className:"cursor-e-resize",onClick:o,children:(0,b.jsx)("div",{className:"flex items-center justify-center",style:{minWidth:32,height:32},children:(0,b.jsx)(IP,{size:32,eyeStyle:"original",float:!1,showShadow:!1,showGlow:!0,style:{height:32}})})})}),(0,b.jsx)(Sx,{side:"right",align:"center",children:"Open sidebar"})]})}):(0,b.jsxs)(rs,{size:"lg",className:"cursor-default",children:[(0,b.jsx)("div",{className:"flex h-8 min-w-8 items-center justify-center",children:(0,b.jsx)(IP,{size:24,eyeStyle:"original",float:!1,showShadow:!1,showGlow:!0,style:{height:24}})}),(0,b.jsx)("div",{className:"flex min-w-0 flex-1 items-center text-left text-sm leading-tight",children:(0,b.jsx)("span",{className:"truncate font-semibold",children:"Antfarm"})})]}),v&&(s||i!=="collapsed")&&(0,b.jsx)(u8,{delayDuration:0,children:(0,b.jsxs)(Bx,{open:y,onOpenChange:w,children:[(0,b.jsx)(Ix,{asChild:!0,children:(0,b.jsxs)(Ct,{variant:"ghost",size:"icon",className:Ea("size-7 shrink-0",s?"cursor-pointer":"cursor-w-resize"),onClick:o,onMouseEnter:()=>w(!0),onMouseLeave:()=>w(!1),children:[s?(0,b.jsx)(Zp,{className:"size-4"}):(0,b.jsx)(S8n,{className:"size-4"}),(0,b.jsx)("span",{className:"sr-only",children:s?"Close sidebar":"Collapse sidebar"})]})}),(0,b.jsx)(Sx,{side:"right",align:"center",children:s?"Close sidebar":"Collapse sidebar"})]})})]})})})}),(0,b.jsxs)(hQn,{className:"border-r border-t-0 group-data-[collapsible=icon]:border-r-0",children:[Fl("antfly")&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(g6,{children:[(0,b.jsx)(h6,{className:"mono-label",children:"Data"}),(0,b.jsxs)(f6,{children:[(0,b.jsx)(EC,{children:(0,b.jsx)(is,{children:(0,b.jsx)(rs,{asChild:!0,isActive:D("/")||D("/create")||S("overview"),tooltip:"Tables",children:(0,b.jsxs)("a",{href:"/",onClick:L=>{L.preventDefault(),t?.("overview"),r("/")},children:[(0,b.jsx)(YOt,{className:"size-4"}),(0,b.jsx)("span",{children:"Tables"})]})})})}),(0,b.jsx)("div",{className:"px-2 pt-2 pb-1 group-data-[collapsible=icon]:hidden",children:(0,b.jsxs)(kQn,{open:h,onOpenChange:f,children:[(0,b.jsx)(_Qn,{disabled:u.length===0,placeholder:"Select a table...",children:d}),(0,b.jsx)(CQn,{searchPlaceholder:"Search tables...",emptyMessage:"No table found.",heading:"Tables",footer:(0,b.jsxs)(EQn,{onClick:()=>r("/create"),children:[(0,b.jsx)(Ju,{className:"size-4"}),(0,b.jsx)("span",{children:"Create table"})]}),children:u.map(L=>(0,b.jsx)(xQn,{value:L.name,selected:d===L.name,onSelect:F=>{p(F),t?.("overview"),r(yUe(F,"overview"))},children:L.name},L.name))})]})})]})]}),(0,b.jsxs)(g6,{children:[(0,b.jsx)(h6,{className:"mono-label",children:"Retrieval"}),(0,b.jsx)(f6,{children:(0,b.jsxs)(EC,{children:[(0,b.jsx)(is,{children:(0,b.jsxs)(rs,{isActive:S("semantic"),tooltip:"Search",disabled:!d,className:"disabled:opacity-50",onClick:()=>_("semantic"),children:[(0,b.jsx)(nm,{className:"size-4"}),(0,b.jsx)("span",{children:"Search"})]})}),(0,b.jsx)(is,{children:(0,b.jsxs)(rs,{isActive:D("/data/playground/chat"),tooltip:"Ask",disabled:!d,className:"disabled:opacity-50",onClick:()=>x("/data/playground/chat"),children:[(0,b.jsx)(KFe,{className:"size-4"}),(0,b.jsx)("span",{children:"Ask"})]})}),(0,b.jsx)(is,{children:(0,b.jsxs)(rs,{isActive:D("/data/playground/evals"),tooltip:"Evaluate",disabled:!d,className:"disabled:opacity-50",onClick:()=>x("/data/playground/evals"),children:[(0,b.jsx)(ZFe,{className:"size-4"}),(0,b.jsx)("span",{children:"Evaluate"})]})}),(0,b.jsx)(is,{children:(0,b.jsxs)(rs,{isActive:S("graph"),tooltip:m.length>0?"Graph":"Create a graph index first",disabled:!d||!A&&m.length===0,className:"disabled:opacity-50",onClick:()=>_("graph"),children:[(0,b.jsx)(g0,{className:"size-4"}),(0,b.jsx)("span",{children:"Graph"})]})})]})})]}),(0,b.jsxs)(g6,{children:[(0,b.jsx)(h6,{className:"mono-label",children:"Ingest"}),(0,b.jsx)(f6,{children:(0,b.jsxs)(EC,{children:[(0,b.jsx)(is,{children:(0,b.jsxs)(rs,{isActive:S("bulk"),tooltip:"Upload",disabled:!d,className:"disabled:opacity-50",onClick:()=>_("bulk"),children:[(0,b.jsx)(BS,{className:"size-4"}),(0,b.jsx)("span",{children:"Upload"})]})}),(0,b.jsx)(is,{children:(0,b.jsxs)(rs,{isActive:S("document-builder"),tooltip:"Manual Entry",disabled:!d,className:"disabled:opacity-50",onClick:()=>_("document-builder"),children:[(0,b.jsx)(ROt,{className:"size-4"}),(0,b.jsx)("span",{children:"Manual Entry"})]})}),(0,b.jsx)(is,{children:(0,b.jsxs)(rs,{isActive:S("artifacts"),tooltip:"Artifacts",disabled:!d,className:"disabled:opacity-50",onClick:()=>_("artifacts"),children:[(0,b.jsx)(QOt,{className:"size-4"}),(0,b.jsx)("span",{children:"Artifacts"})]})}),(0,b.jsx)(is,{children:(0,b.jsxs)(rs,{isActive:S("reprocess"),tooltip:"Reprocess",disabled:!d,className:"disabled:opacity-50",onClick:()=>_("reprocess"),children:[(0,b.jsx)(UOt,{className:"size-4"}),(0,b.jsx)("span",{children:"Reprocess"})]})})]})})]})]}),Fl("inference")&&(0,b.jsxs)(g6,{children:[(0,b.jsx)(h6,{className:"mono-label",children:"Models"}),(0,b.jsx)(f6,{children:(0,b.jsxs)(EC,{children:[(0,b.jsx)(is,{children:(0,b.jsx)(rs,{asChild:!0,isActive:D("/inference/models"),tooltip:"Runtime",children:(0,b.jsxs)("a",{href:"/inference/models",onClick:L=>{L.preventDefault(),r("/inference/models")},children:[(0,b.jsx)(MOt,{className:"size-4"}),(0,b.jsx)("span",{children:"Runtime"})]})})}),(0,b.jsx)("div",{className:"px-2 py-1.5 mono-label text-sidebar-foreground/50 group-data-[collapsible=icon]:hidden",children:"Tools"}),(0,b.jsx)(is,{children:(0,b.jsx)(rs,{asChild:!0,isActive:D("/inference/playground/chunk"),tooltip:"Chunk Text",children:(0,b.jsxs)("a",{href:"/inference/playground/chunk",onClick:L=>{L.preventDefault(),r("/inference/playground/chunk")},children:[(0,b.jsx)(uT,{className:"size-4"}),(0,b.jsx)("span",{children:"Chunk Text"})]})})}),(0,b.jsx)(is,{children:(0,b.jsx)(rs,{asChild:!0,isActive:D("/inference/playground/extract"),tooltip:"Extract",children:(0,b.jsxs)("a",{href:"/inference/playground/extract",onClick:L=>{L.preventDefault(),r("/inference/playground/extract")},children:[(0,b.jsx)(LL,{className:"size-4"}),(0,b.jsx)("span",{children:"Extract"})]})})}),(0,b.jsx)(is,{children:(0,b.jsx)(rs,{asChild:!0,isActive:D("/inference/playground/rewrite"),tooltip:"Rewrite",children:(0,b.jsxs)("a",{href:"/inference/playground/rewrite",onClick:L=>{L.preventDefault(),r("/inference/playground/rewrite")},children:[(0,b.jsx)(GOt,{className:"size-4"}),(0,b.jsx)("span",{children:"Rewrite"})]})})}),(0,b.jsx)(is,{children:(0,b.jsx)(rs,{asChild:!0,isActive:D("/inference/playground/rerank"),tooltip:"Rerank",children:(0,b.jsxs)("a",{href:"/inference/playground/rerank",onClick:L=>{L.preventDefault(),r("/inference/playground/rerank")},children:[(0,b.jsx)(O$,{className:"size-4"}),(0,b.jsx)("span",{children:"Rerank"})]})})}),(0,b.jsx)(is,{children:(0,b.jsx)(rs,{asChild:!0,isActive:D("/inference/playground/kg"),tooltip:"Knowledge Graph",children:(0,b.jsxs)("a",{href:"/inference/playground/kg",onClick:L=>{L.preventDefault(),r("/inference/playground/kg")},children:[(0,b.jsx)(g0,{className:"size-4"}),(0,b.jsx)("span",{children:"Knowledge Graph"})]})})}),(0,b.jsx)(is,{children:(0,b.jsx)(rs,{asChild:!0,isActive:D("/inference/playground/embed"),tooltip:"Embed",children:(0,b.jsxs)("a",{href:"/inference/playground/embed",onClick:L=>{L.preventDefault(),r("/inference/playground/embed")},children:[(0,b.jsx)(n6e,{className:"size-4"}),(0,b.jsx)("span",{children:"Embed"})]})})}),(0,b.jsx)(is,{children:(0,b.jsx)(rs,{asChild:!0,isActive:D("/inference/playground/read"),tooltip:"Read Image",children:(0,b.jsxs)("a",{href:"/inference/playground/read",onClick:L=>{L.preventDefault(),r("/inference/playground/read")},children:[(0,b.jsx)(e6e,{className:"size-4"}),(0,b.jsx)("span",{children:"Read Image"})]})})}),(0,b.jsx)(is,{children:(0,b.jsx)(rs,{asChild:!0,isActive:D("/inference/playground/transcribe"),tooltip:"Transcribe",children:(0,b.jsxs)("a",{href:"/inference/playground/transcribe",onClick:L=>{L.preventDefault(),r("/inference/playground/transcribe")},children:[(0,b.jsx)(VN,{className:"size-4"}),(0,b.jsx)("span",{children:"Transcribe"})]})})})]})})]}),Fl("antfly")&&(0,b.jsxs)(g6,{children:[(0,b.jsx)(h6,{className:"mono-label",children:"Operations"}),(0,b.jsx)(f6,{children:(0,b.jsxs)(EC,{children:[(0,b.jsx)(is,{children:(0,b.jsx)(rs,{asChild:!0,isActive:D("/cluster"),tooltip:"Cluster",children:(0,b.jsxs)("a",{href:"/cluster",onClick:L=>{L.preventDefault(),r("/cluster")},children:[(0,b.jsx)(g0,{className:"size-4"}),(0,b.jsx)("span",{children:"Cluster"})]})})}),g&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(is,{children:(0,b.jsx)(rs,{asChild:!0,isActive:D("/users"),tooltip:"Users",children:(0,b.jsxs)("a",{href:"/users",onClick:L=>{L.preventDefault(),r("/users")},children:[(0,b.jsx)(t6e,{className:"size-4"}),(0,b.jsx)("span",{children:"Users"})]})})}),(0,b.jsx)(is,{children:(0,b.jsx)(rs,{asChild:!0,isActive:D("/secrets"),tooltip:"Secrets",children:(0,b.jsxs)("a",{href:"/secrets",onClick:L=>{L.preventDefault(),r("/secrets")},children:[(0,b.jsx)(JFe,{className:"size-4"}),(0,b.jsx)("span",{children:"Secrets"})]})})})]}),(0,b.jsx)(is,{children:(0,b.jsx)(rs,{asChild:!0,isActive:a.pathname==="/connections",tooltip:"Connected Providers & Stores",children:(0,b.jsxs)("a",{href:"/connections",onClick:L=>{L.preventDefault(),r("/connections")},children:[(0,b.jsx)(qOt,{className:"size-4"}),(0,b.jsx)("span",{children:"Connections"})]})})})]})})]})]}),(0,b.jsx)(gQn,{className:"border-r group-data-[collapsible=icon]:border-r-0",children:(0,b.jsx)(y7n,{})})]})}function Zjt(e){return Array.isArray(e)?e:e&&typeof e=="object"&&"tables"in e&&Array.isArray(e.tables)?e.tables:[]}function v7n({children:e}){const t=dh(),n=vu(),a=Ym(),[r,i]=pR(),[o,s]=(0,z.useState)([]),[l,u]=(0,z.useState)(()=>Fl("antfly")),[d,p]=(0,z.useState)([]),[m,A]=(0,z.useState)([]),[g,h]=(0,z.useState)([]),[f,y]=(0,z.useState)(!1),[w,v]=(0,z.useState)(""),[k,_]=(0,z.useState)(()=>{const D=n.pathname.match(/^\/tables\/([^/]+)/);return D?decodeURIComponent(D[1]):r.get("table")||""}),x=(0,z.useRef)(n.pathname);(0,z.useEffect)(()=>{const D=n.pathname.match(/^\/tables\/([^/]+)/),L=D?decodeURIComponent(D[1]):void 0,F=r.get("table"),M=L||F||"";M&&_(M)},[n.pathname,r]),(0,z.useEffect)(()=>{if(n.pathname.startsWith("/tables/"))return;const D=r.get("table");k&&D!==k&&i(L=>(L.set("table",k),L),{replace:!0}),x.current=n.pathname},[n.pathname,k,r,i]);const E=(0,z.useCallback)(D=>{_(D),n.pathname.startsWith("/tables/")?a(`/tables/${encodeURIComponent(D)}?section=overview`):i(L=>(L.set("table",D),L),{replace:!0})},[n.pathname,a,i]),S=(0,z.useCallback)(async()=>{if(Fl("antfly")){u(!0);try{s(Zjt(await t.tables.list()))}catch{s([])}finally{u(!1)}}},[t]);return(0,z.useEffect)(()=>{S()},[S]),(0,z.useEffect)(()=>{!k&&o.length>0&&E(o[0].name)},[o,k,E]),(0,z.useEffect)(()=>{(async()=>{if(!k){p([]),A([]),h([]),v("");return}y(!0);try{const L=await t.indexes.list(k)||[],F=L.filter(B=>B.config?.type?.includes("aknn")||B.config?.type?.includes("embedding")).map(B=>B.config?.name||"").filter(Boolean),M=L.filter(B=>B.config?.type?.includes("aknn")||B.config?.type?.includes("embedding")||B.config?.type?.includes("full_text")).map(B=>B.config?.name||"").filter(Boolean),Q=L.filter(B=>B.config?.type==="graph").map(B=>B.config?.name||"").filter(Boolean);p(F),A(Q),h(M),F.length>0?v(F[0]):v("")}catch{p([]),A([]),h([]),v("")}finally{y(!1)}})()},[k,t]),(0,b.jsx)($jt.Provider,{value:{tables:o,isLoadingTables:l,selectedTable:k,setSelectedTable:E,embeddingIndexes:d,graphIndexes:m,chatIndexes:g,isLoadingIndexes:f,selectedIndex:w,setSelectedIndex:v,refreshTables:S},children:e})}function k7n({onCreate:e}){return(0,b.jsx)(xx,{title:"No tables yet",description:"Create a table, add data, create an index, then search or ask questions over it.",action:e?(0,b.jsx)(Ct,{variant:"brand",onClick:e,children:"Create Table"}):void 0})}function Jjt({query:e}){return(0,b.jsx)(xx,{title:"No results found",description:e?`No results matched "${e}". Try adjusting your query or filters.`:"Try a different search query or adjust your filters."})}function Xjt({message:e,onRetry:t}){return(0,b.jsx)(xx,{title:"Something went wrong",description:e||"An unexpected error occurred. Please try again.",action:t?(0,b.jsx)(Ct,{variant:"outline",onClick:t,children:"Try Again"}):void 0})}function _7n(){return(0,b.jsx)(xx,{title:"No users configured",description:"Create users and assign permissions to manage access to your Antfly instance."})}function C7n(){return(0,b.jsx)(xx,{title:"No secrets stored",description:"Add secrets to securely store API keys, tokens, and other sensitive configuration."})}function wb(){return(0,b.jsx)(xx,{title:"Ready to experiment",description:"Configure your settings above and run a query to see results.",className:"border-none bg-transparent"})}function R0(){const{inferenceConnectionId:e,setInferenceConnectionId:t}=Ro(),{providers:n,loading:a,error:r,retry:i}=CR(),o=(0,z.useMemo)(()=>n.filter(u=>u.inference?.provider==="antfly").sort((u,d)=>u.id==="local-inference"?-1:d.id==="local-inference"?1:(u.display_name??u.name).localeCompare(d.display_name??d.name)),[n]),s=o.find(u=>u.id===e),l=a?"checking":s?.status==="connected"?"connected":"disconnected";return(0,z.useEffect)(()=>{!a&&o.length>0&&!s&&t(o[0].id)},[o,a,s,t]),l==="checking"?(0,b.jsxs)("div",{className:"flex items-center gap-2 mb-4 p-3 rounded-none border bg-muted/30",children:[(0,b.jsx)(Nl,{className:"h-4 w-4 rounded-full"}),(0,b.jsx)(Nl,{className:"h-4 w-32"}),(0,b.jsx)(Nl,{className:"h-4 w-24"})]}):l==="disconnected"?(0,b.jsxs)("div",{className:"flex items-center justify-between mb-4 p-3 rounded-none border border-destructive/30 bg-destructive/5",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 text-sm text-destructive",children:[(0,b.jsx)(vRn,{className:"h-4 w-4"}),(0,b.jsx)("span",{children:r??(o.length===0?"No Antfly-compatible inference connection is configured":"Selected inference connection is unavailable")})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(Yjt,{trigger:(0,b.jsxs)(Ct,{variant:"outline",size:"sm",className:"h-7 text-xs",children:[(0,b.jsx)(ES,{className:"h-3 w-3 mr-1"}),"Configure"]})}),(0,b.jsx)(Ct,{variant:"outline",size:"sm",onClick:i,className:"h-7 text-xs",children:"Retry"})]})]}):(0,b.jsxs)("div",{className:"flex items-center gap-2 mb-4 p-3 rounded-none border bg-muted/30 flex-wrap",children:[(0,b.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,b.jsxs)("span",{className:"relative flex h-2.5 w-2.5",children:[(0,b.jsx)("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full af-status-bar-success opacity-75"}),(0,b.jsx)("span",{className:"relative inline-flex rounded-full h-2.5 w-2.5 af-status-bar-success"})]}),(0,b.jsx)(_Rn,{className:"h-3.5 w-3.5 text-muted-foreground"})]}),(0,b.jsxs)("label",{className:"flex items-center gap-2 text-xs",children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:"Connection"}),(0,b.jsx)("select",{value:e,onChange:u=>t(u.target.value),className:"h-7 border bg-background px-2","aria-label":"Inference connection",children:o.map(u=>(0,b.jsx)("option",{value:u.id,children:u.display_name??u.name},u.id))})]})]})}function wUe(e){return"text"in e}var vUe={provider:"antfly",strategy:"fixed",model:"fixed",target_tokens:500,overlap_tokens:50,separator:"\\n\\n",max_chunks:50,threshold:.5},mH=["af-chart-surface af-chart-surface-1","af-chart-surface af-chart-surface-2","af-chart-surface af-chart-surface-3","af-chart-surface af-chart-surface-4","af-chart-surface af-chart-surface-5","af-chart-surface af-chart-surface-6"],x7n=["af-chart-text af-chart-text-1","af-chart-text af-chart-text-2","af-chart-text af-chart-text-3","af-chart-text af-chart-text-4","af-chart-text af-chart-text-5","af-chart-text af-chart-text-6"];function kUe(e){const t=["text","content","body","description","summary","title","name"],n=[];for(const a of t){const r=e[a];typeof r=="string"&&r.length>0&&n.push(r)}return n.length===0?JSON.stringify(e,null,2):n.join(`
|
|
103
103
|
|
|
104
104
|
`)}var E7n=()=>{const{client:e,inferenceUrl:t}=Ro(),{selectedTable:n,selectedIndex:a}=yb(),[r,i]=(0,z.useState)(vUe),[o,s]=(0,z.useState)(""),[l,u]=(0,z.useState)(""),[d,p]=(0,z.useState)(null),[m,A]=(0,z.useState)(!1),[g,h]=(0,z.useState)(!1),[f,y]=(0,z.useState)(null),[w,v]=(0,z.useState)(null),[k,_]=(0,z.useState)("table"),[x,E]=(0,z.useState)(""),[S,D]=(0,z.useState)(null),[L,F]=(0,z.useState)(!1),M=(0,z.useRef)(null),Q=Y=>Math.ceil(Y.length/4),B=async()=>{if(!(!n||!x.trim())){F(!0),y(null);try{const Y=a?{semantic_search:x,indexes:[a],limit:5}:{full_text_search:{query:x},limit:5};D(((await e.tables.query(n,Y))?.responses?.[0]?.hits?.hits||[]).map(U=>{const W=kUe(U._source||{});return{id:U._id,preview:W.slice(0,120)+(W.length>120?"...":"")}}))}catch(Y){y(Y instanceof Error?Y.message:"Search failed")}finally{F(!1)}}},I=async Y=>{if(!(!n||!Y.trim())){h(!0),y(null);try{const U=await e.tables.lookup(n,Y);U?(s(kUe(U)),u(Y),p(null),D(null)):y(`Document "${Y}" not found`)}catch(U){y(U instanceof Error?U.message:"Failed to fetch document")}finally{h(!1)}}},R=async()=>{if(!o.trim()){y("Please enter or load text to chunk");return}M.current&&M.current.abort(),M.current=new AbortController,A(!0),y(null),p(null);const Y=performance.now();try{const U=r.separator.replace(/\\n/g,`
|
|
105
105
|
`).replace(/\\t/g," "),W=await fetch(t("chunk"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({input:o,config:{model:r.model,text:{target_tokens:r.target_tokens,overlap_tokens:r.overlap_tokens,separator:U},max_chunks:r.max_chunks,threshold:r.threshold}}),signal:M.current.signal});if(!W.ok)throw new Error(await W.text()||`HTTP ${W.status}`);p(await W.json()),v(performance.now()-Y)}catch(U){if(U instanceof Error&&U.name==="AbortError")return;y(U instanceof Error?U.message:"Failed to connect to inference")}finally{A(!1)}},N=()=>{i(vUe),s(""),u(""),p(null),y(null),v(null),D(null),E("")},O=(0,z.useMemo)(()=>{const Y={provider:r.provider,strategy:r.model==="fixed"?"fixed":"hugot",text:{target_tokens:r.target_tokens,overlap_tokens:r.overlap_tokens,separator:r.separator.replace(/\\n/g,`
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Roboto+Mono:wght@400;500;700&family=Silkscreen:wght@400;700&display=swap"
|
|
12
12
|
rel="stylesheet"
|
|
13
13
|
/>
|
|
14
|
-
<script type="module" crossorigin src="/assets/index-
|
|
14
|
+
<script type="module" crossorigin src="/assets/index-B2gW-Qf0.js"></script>
|
|
15
15
|
<link rel="stylesheet" crossorigin href="/assets/index-B9-BVv7X.css">
|
|
16
16
|
</head>
|
|
17
17
|
<body>
|