@js4cytoscape/ndex-client 0.6.0-alpha.4 → 0.6.0-alpha.6

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/dist/index.d.mts CHANGED
@@ -744,19 +744,21 @@ declare class FilesService {
744
744
  /**
745
745
  * Search for files in NDEx
746
746
  *
747
- * Searches for networks, folders, and shortcuts based on various criteria including
748
- * search terms, ownership, permissions, file type, and visibility. Results are paginated
749
- * and support Lucene query syntax for advanced search capabilities.
747
+ * Searches files using the server's SimpleFileQuery request body and pagination
748
+ * query parameters. The query object can filter by search text, owner, permission,
749
+ * and file type, while visibility is sent separately as a required URL parameter.
750
+ * Results are returned in a paginated object with `numFound`, `start`, and
751
+ * a `files` array.
750
752
  *
751
753
  * @param params - Search parameters
752
754
  * @param params.searchString - Search terms as a string, supports Lucene syntax
753
- * @param params.accountName - Username to filter files by owner
754
- * @param params.permission - Filter by permission level (only for signed-in users)
755
+ * @param params.accountName - Account name to filter files by owner
756
+ * @param params.permission - Permission level filter, only applicable to signed-in users
755
757
  * @param params.type - File type filter (NETWORK, FOLDER, SHORTCUT, or null for all types)
756
- * @param params.visibility - Visibility filter (required, "PRIVATE" or "PUBLIC")
757
- * @param params.start - Starting index for pagination (default: 0)
758
- * @param params.size - Number of results to return (default: varies by server)
759
- * @returns Promise resolving to search results containing matching files
758
+ * @param params.visibility - Required visibility filter sent as a URL parameter ("PRIVATE" or "PUBLIC")
759
+ * @param params.start - Optional starting index for pagination, sent as a URL parameter
760
+ * @param params.size - Optional number of results to return, sent as a URL parameter
761
+ * @returns Promise resolving to a paginated search result containing matching files
760
762
  *
761
763
  * @example
762
764
  * ```typescript
@@ -771,11 +773,11 @@ declare class FilesService {
771
773
  *
772
774
  * console.log(`Found ${results.numFound} total results`);
773
775
  * console.log(`Showing results starting at ${results.start}`);
774
- * results.ResultList.forEach(file => {
776
+ * results.files.forEach(file => {
775
777
  * console.log(`${file.name} (${file.type})`);
776
778
  * });
777
779
  *
778
- * // Search with Lucene syntax for networks owned by specific user
780
+ * // Search for public networks owned by a specific user
779
781
  * const userNetworks = await client.files.searchFiles({
780
782
  * searchString: "name:pathway AND description:signaling",
781
783
  * accountName: "john_doe",
@@ -783,7 +785,7 @@ declare class FilesService {
783
785
  * visibility: "PUBLIC"
784
786
  * });
785
787
  *
786
- * // Search for all private files the signed-in user has WRITE permission on
788
+ * // Search for private files the signed-in user can write to
787
789
  * const writableFiles = await client.files.searchFiles({
788
790
  * permission: "WRITE",
789
791
  * visibility: "PRIVATE",
@@ -792,7 +794,7 @@ declare class FilesService {
792
794
  * });
793
795
  * ```
794
796
  */
795
- searchFiles(params: FileSearchParams): Promise<SearchResult<FileListItem>>;
797
+ searchFiles(params: FileSearchParams): Promise<FileSearchResult>;
796
798
  }
797
799
 
798
800
  /**
@@ -1130,6 +1132,11 @@ interface SearchResult<T> {
1130
1132
  start: number;
1131
1133
  numFound: number;
1132
1134
  }
1135
+ interface FileSearchResult {
1136
+ files: FileListItem[];
1137
+ start: number;
1138
+ numFound: number;
1139
+ }
1133
1140
  interface SearchParameters {
1134
1141
  searchString?: string;
1135
1142
  accountName?: string;
@@ -2929,4 +2936,4 @@ declare class NDExClient {
2929
2936
  */
2930
2937
  declare const version: string;
2931
2938
 
2932
- export { type APIError, type APIResponse, type AccessKeyAction, type AccessKeyResponse, type AccessParams, AdminService, AuthType, type BasicAuth, type CX1Edge, type CX1MetaDataItem, type CX1MetaDataResponse, type CX1NetworkProperty, type CX2AttributeDeclarations, type CX2AttributeSpec, type CX2Edge, type CX2EdgeBypass, type CX2ImportParams, type CX2MetaData, CX2Network, type CX2NetworkAttribute, type CX2NetworkProperties, type CX2Node, type CX2NodeBypass, type CX2Status, type CX2VisualProperty, CXDataType, CyNDExService as CyNDEx, type CyNDExAuthConfig, type CyNDExConfig, CyNDExService, type CyNDExStatusResponse, type CyWebWorkspace, type CytoscapeNetworkSummary, type DefaultVisualProperties, type ExportFormat, type ExportRequest, type FileListItem, type FilePermissionDetails, type FilePermissionList, type FileSearchParams, FilesService, type MappingDefinition, type NDExAny, NDExAuthError, type NDExAuthResponse, NDExClient, type NDExClientConfig, NDExError, type NDExExportParams, NDExFileType, type NDExImportParams, NDExNetworkError, NDExNotFoundError, type NDExObjectUpdateStatus, NDExServerError, type NDExUser, NDExValidationError, NetworkIndexLevel, type NetworkPermission, NetworkServiceV2, NetworkServiceV3, type NetworkSummaryV2, type NetworkSummaryV3, type OAuthAuth, type PaginationParams, Permission, type SearchParameters, type SearchResult, type SharingMemberRequest, type Shortcut, type TableColumnVisualStyle, type Task, type Timestamp, type UUID, UnifiedNetworkService, UserService, VPMappingType, Visibility, type VisualPropertyMapping, type VisualPropertyTable, WorkspaceService, version };
2939
+ export { type APIError, type APIResponse, type AccessKeyAction, type AccessKeyResponse, type AccessParams, AdminService, AuthType, type BasicAuth, type CX1Edge, type CX1MetaDataItem, type CX1MetaDataResponse, type CX1NetworkProperty, type CX2AttributeDeclarations, type CX2AttributeSpec, type CX2Edge, type CX2EdgeBypass, type CX2ImportParams, type CX2MetaData, CX2Network, type CX2NetworkAttribute, type CX2NetworkProperties, type CX2Node, type CX2NodeBypass, type CX2Status, type CX2VisualProperty, CXDataType, CyNDExService as CyNDEx, type CyNDExAuthConfig, type CyNDExConfig, CyNDExService, type CyNDExStatusResponse, type CyWebWorkspace, type CytoscapeNetworkSummary, type DefaultVisualProperties, type ExportFormat, type ExportRequest, type FileListItem, type FilePermissionDetails, type FilePermissionList, type FileSearchParams, type FileSearchResult, FilesService, type MappingDefinition, type NDExAny, NDExAuthError, type NDExAuthResponse, NDExClient, type NDExClientConfig, NDExError, type NDExExportParams, NDExFileType, type NDExImportParams, NDExNetworkError, NDExNotFoundError, type NDExObjectUpdateStatus, NDExServerError, type NDExUser, NDExValidationError, NetworkIndexLevel, type NetworkPermission, NetworkServiceV2, NetworkServiceV3, type NetworkSummaryV2, type NetworkSummaryV3, type OAuthAuth, type PaginationParams, Permission, type SearchParameters, type SearchResult, type SharingMemberRequest, type Shortcut, type TableColumnVisualStyle, type Task, type Timestamp, type UUID, UnifiedNetworkService, UserService, VPMappingType, Visibility, type VisualPropertyMapping, type VisualPropertyTable, WorkspaceService, version };
package/dist/index.d.ts CHANGED
@@ -744,19 +744,21 @@ declare class FilesService {
744
744
  /**
745
745
  * Search for files in NDEx
746
746
  *
747
- * Searches for networks, folders, and shortcuts based on various criteria including
748
- * search terms, ownership, permissions, file type, and visibility. Results are paginated
749
- * and support Lucene query syntax for advanced search capabilities.
747
+ * Searches files using the server's SimpleFileQuery request body and pagination
748
+ * query parameters. The query object can filter by search text, owner, permission,
749
+ * and file type, while visibility is sent separately as a required URL parameter.
750
+ * Results are returned in a paginated object with `numFound`, `start`, and
751
+ * a `files` array.
750
752
  *
751
753
  * @param params - Search parameters
752
754
  * @param params.searchString - Search terms as a string, supports Lucene syntax
753
- * @param params.accountName - Username to filter files by owner
754
- * @param params.permission - Filter by permission level (only for signed-in users)
755
+ * @param params.accountName - Account name to filter files by owner
756
+ * @param params.permission - Permission level filter, only applicable to signed-in users
755
757
  * @param params.type - File type filter (NETWORK, FOLDER, SHORTCUT, or null for all types)
756
- * @param params.visibility - Visibility filter (required, "PRIVATE" or "PUBLIC")
757
- * @param params.start - Starting index for pagination (default: 0)
758
- * @param params.size - Number of results to return (default: varies by server)
759
- * @returns Promise resolving to search results containing matching files
758
+ * @param params.visibility - Required visibility filter sent as a URL parameter ("PRIVATE" or "PUBLIC")
759
+ * @param params.start - Optional starting index for pagination, sent as a URL parameter
760
+ * @param params.size - Optional number of results to return, sent as a URL parameter
761
+ * @returns Promise resolving to a paginated search result containing matching files
760
762
  *
761
763
  * @example
762
764
  * ```typescript
@@ -771,11 +773,11 @@ declare class FilesService {
771
773
  *
772
774
  * console.log(`Found ${results.numFound} total results`);
773
775
  * console.log(`Showing results starting at ${results.start}`);
774
- * results.ResultList.forEach(file => {
776
+ * results.files.forEach(file => {
775
777
  * console.log(`${file.name} (${file.type})`);
776
778
  * });
777
779
  *
778
- * // Search with Lucene syntax for networks owned by specific user
780
+ * // Search for public networks owned by a specific user
779
781
  * const userNetworks = await client.files.searchFiles({
780
782
  * searchString: "name:pathway AND description:signaling",
781
783
  * accountName: "john_doe",
@@ -783,7 +785,7 @@ declare class FilesService {
783
785
  * visibility: "PUBLIC"
784
786
  * });
785
787
  *
786
- * // Search for all private files the signed-in user has WRITE permission on
788
+ * // Search for private files the signed-in user can write to
787
789
  * const writableFiles = await client.files.searchFiles({
788
790
  * permission: "WRITE",
789
791
  * visibility: "PRIVATE",
@@ -792,7 +794,7 @@ declare class FilesService {
792
794
  * });
793
795
  * ```
794
796
  */
795
- searchFiles(params: FileSearchParams): Promise<SearchResult<FileListItem>>;
797
+ searchFiles(params: FileSearchParams): Promise<FileSearchResult>;
796
798
  }
797
799
 
798
800
  /**
@@ -1130,6 +1132,11 @@ interface SearchResult<T> {
1130
1132
  start: number;
1131
1133
  numFound: number;
1132
1134
  }
1135
+ interface FileSearchResult {
1136
+ files: FileListItem[];
1137
+ start: number;
1138
+ numFound: number;
1139
+ }
1133
1140
  interface SearchParameters {
1134
1141
  searchString?: string;
1135
1142
  accountName?: string;
@@ -2929,4 +2936,4 @@ declare class NDExClient {
2929
2936
  */
2930
2937
  declare const version: string;
2931
2938
 
2932
- export { type APIError, type APIResponse, type AccessKeyAction, type AccessKeyResponse, type AccessParams, AdminService, AuthType, type BasicAuth, type CX1Edge, type CX1MetaDataItem, type CX1MetaDataResponse, type CX1NetworkProperty, type CX2AttributeDeclarations, type CX2AttributeSpec, type CX2Edge, type CX2EdgeBypass, type CX2ImportParams, type CX2MetaData, CX2Network, type CX2NetworkAttribute, type CX2NetworkProperties, type CX2Node, type CX2NodeBypass, type CX2Status, type CX2VisualProperty, CXDataType, CyNDExService as CyNDEx, type CyNDExAuthConfig, type CyNDExConfig, CyNDExService, type CyNDExStatusResponse, type CyWebWorkspace, type CytoscapeNetworkSummary, type DefaultVisualProperties, type ExportFormat, type ExportRequest, type FileListItem, type FilePermissionDetails, type FilePermissionList, type FileSearchParams, FilesService, type MappingDefinition, type NDExAny, NDExAuthError, type NDExAuthResponse, NDExClient, type NDExClientConfig, NDExError, type NDExExportParams, NDExFileType, type NDExImportParams, NDExNetworkError, NDExNotFoundError, type NDExObjectUpdateStatus, NDExServerError, type NDExUser, NDExValidationError, NetworkIndexLevel, type NetworkPermission, NetworkServiceV2, NetworkServiceV3, type NetworkSummaryV2, type NetworkSummaryV3, type OAuthAuth, type PaginationParams, Permission, type SearchParameters, type SearchResult, type SharingMemberRequest, type Shortcut, type TableColumnVisualStyle, type Task, type Timestamp, type UUID, UnifiedNetworkService, UserService, VPMappingType, Visibility, type VisualPropertyMapping, type VisualPropertyTable, WorkspaceService, version };
2939
+ export { type APIError, type APIResponse, type AccessKeyAction, type AccessKeyResponse, type AccessParams, AdminService, AuthType, type BasicAuth, type CX1Edge, type CX1MetaDataItem, type CX1MetaDataResponse, type CX1NetworkProperty, type CX2AttributeDeclarations, type CX2AttributeSpec, type CX2Edge, type CX2EdgeBypass, type CX2ImportParams, type CX2MetaData, CX2Network, type CX2NetworkAttribute, type CX2NetworkProperties, type CX2Node, type CX2NodeBypass, type CX2Status, type CX2VisualProperty, CXDataType, CyNDExService as CyNDEx, type CyNDExAuthConfig, type CyNDExConfig, CyNDExService, type CyNDExStatusResponse, type CyWebWorkspace, type CytoscapeNetworkSummary, type DefaultVisualProperties, type ExportFormat, type ExportRequest, type FileListItem, type FilePermissionDetails, type FilePermissionList, type FileSearchParams, type FileSearchResult, FilesService, type MappingDefinition, type NDExAny, NDExAuthError, type NDExAuthResponse, NDExClient, type NDExClientConfig, NDExError, type NDExExportParams, NDExFileType, type NDExImportParams, NDExNetworkError, NDExNotFoundError, type NDExObjectUpdateStatus, NDExServerError, type NDExUser, NDExValidationError, NetworkIndexLevel, type NetworkPermission, NetworkServiceV2, NetworkServiceV3, type NetworkSummaryV2, type NetworkSummaryV3, type OAuthAuth, type PaginationParams, Permission, type SearchParameters, type SearchResult, type SharingMemberRequest, type Shortcut, type TableColumnVisualStyle, type Task, type Timestamp, type UUID, UnifiedNetworkService, UserService, VPMappingType, Visibility, type VisualPropertyMapping, type VisualPropertyTable, WorkspaceService, version };
@@ -1,9 +1,9 @@
1
1
  var NDExClient=(function(exports){'use strict';/* NDEx Client Library - Browser Build with Axios */
2
- var Kt=Object.defineProperty;var Gt=(s,e)=>()=>(e||s((e={exports:{}}).exports,e),e.exports),Qt=(s,e)=>{for(var t in e)Kt(s,t,{get:e[t],enumerable:true});};var ut=Gt((ks,ct)=>{ct.exports=typeof self=="object"?self.FormData:window.FormData;});var Zt=(r=>(r.NONE="NONE",r.BASIC="BASIC",r.FULL="FULL",r))(Zt||{}),A=class extends Error{constructor(t,r,n,i){super(t);this.statusCode=r;this.errorCode=n;this.description=i;this.name="NDExError";}},fe=class extends A{constructor(t,r){super(t,void 0,"NETWORK_ERROR");this.originalError=r;this.name="NDExNetworkError";}},me=class extends A{constructor(e="Authentication failed",t=401,r){super(e,t,r??"AUTH_ERROR"),this.name="NDExAuthError";}},he=class extends A{constructor(e="Resource not found",t=404,r){super(e,t,r??"NOT_FOUND"),this.name="NDExNotFoundError";}},ge=class extends A{constructor(e,t=400,r){super(e,t,r??"VALIDATION_ERROR"),this.name="NDExValidationError";}},ye=class extends A{constructor(e="Internal server error",t=500,r){super(e,t,r??"SERVER_ERROR"),this.name="NDExServerError";}};var k={BASIC:"basic",OAUTH:"oauth"},ys={PUBLIC:"PUBLIC",PRIVATE:"PRIVATE",UNLISTED:"UNLISTED"},bs={READ:"READ",WRITE:"WRITE",ADMIN:"ADMIN"},ws={NETWORK:"NETWORK",FOLDER:"FOLDER",SHORTCUT:"SHORTCUT"},vs={DISCRETE:"DISCRETE",CONTINUOUS:"CONTINUOUS",PASSTHROUGH:"PASSTHROUGH"},Ss={STRING:"string",LONG:"long",INTEGER:"integer",DOUBLE:"double",BOOLEAN:"boolean",LIST_OF_STRING:"list_of_string",LIST_OF_LONG:"list_of_long",LIST_OF_INTEGER:"list_of_integer",LIST_OF_DOUBLE:"list_of_double",LIST_OF_BOOLEAN:"list_of_boolean"};var B=class s{constructor(e){this.CXVersion="2.0";this.hasFragments=false;this.metaData=[];e&&Object.assign(this,e),this.ensureRequiredMetadata();}static createEmpty(){let e=new s;return e.nodes=[],e.edges=[],e.metaData=[{name:"nodes",elementCount:0},{name:"edges",elementCount:0}],e}static fromJSON(e){let t=typeof e=="string"?JSON.parse(e):e;return new s(t)}static fromNetworkSummary(e){let t=s.createEmpty();return t.networkAttributes=[{name:e.name},...e.description?[{description:e.description}]:[],...e.version?[{version:e.version}]:[]],e.properties&&Object.entries(e.properties).forEach(([r,n])=>{t.networkAttributes?.push({[r]:n.v});}),t}addNode(e,t){this.nodes||(this.nodes=[]);let r={id:e};return t&&(r.v=t),this.nodes.push(r),this.updateNodeCount(),r}addEdge(e,t,r,n){this.edges||(this.edges=[]);let i={id:e,s:t,t:r};return n&&(i.v=n),this.edges.push(i),this.updateEdgeCount(),i}addNodeAttribute(e,t,r){let n=this.nodes?.find(i=>i.id===e);n&&(n.v||(n.v={}),n.v[t]=r);}addEdgeAttribute(e,t,r){let n=this.edges?.find(i=>i.id===e);n&&(n.v||(n.v={}),n.v[t]=r);}setNodeCoordinates(e,t,r,n){this.nodes||(this.nodes=[]);let i=this.nodes.find(o=>o.id===e);i||(i={id:e},this.nodes.push(i),this.updateNodeCount()),i.x=t,i.y=r,n!==void 0&&(i.z=n);}getNode(e){return this.nodes?.find(t=>t.id===e)}getEdge(e){return this.edges?.find(t=>t.id===e)}getNodes(){return this.nodes||[]}getEdges(){return this.edges||[]}getNodeCount(){return this.nodes?.length||0}getEdgeCount(){return this.edges?.length||0}getNetworkName(){return this.networkAttributes?.find(e=>"name"in e)?.name}setNetworkName(e){this.networkAttributes||(this.networkAttributes=[]),this.networkAttributes=this.networkAttributes.filter(t=>!("name"in t)),this.networkAttributes.push({name:e});}getNetworkAttribute(e){return this.networkAttributes?.find(t=>e in t)?.[e]}setNetworkAttribute(e,t){this.networkAttributes||(this.networkAttributes=[]),this.networkAttributes=this.networkAttributes.filter(r=>!(e in r)),this.networkAttributes.push({[e]:t});}validate(){let e=[];return this.CXVersion||e.push("CXVersion is required"),this.hasFragments===void 0&&e.push("hasFragments is required"),(!this.metaData||this.metaData.length===0)&&e.push("metaData is required and must not be empty"),this.metaData?.forEach((t,r)=>{t.name||e.push(`metaData[${r}] is missing required 'name' field`);}),this.nodes&&this.nodes.forEach((t,r)=>{(t.id===void 0||t.id===null)&&e.push(`nodes[${r}] is missing required 'id' field`);}),this.edges&&this.edges.forEach((t,r)=>{if((t.id===void 0||t.id===null)&&e.push(`edges[${r}] is missing required 'id' field`),(t.s===void 0||t.s===null)&&e.push(`edges[${r}] is missing required 's' (source) field`),(t.t===void 0||t.t===null)&&e.push(`edges[${r}] is missing required 't' (target) field`),this.nodes&&t.s!==void 0&&t.t!==void 0){let n=this.nodes.some(o=>o.id===t.s),i=this.nodes.some(o=>o.id===t.t);n||e.push(`edges[${r}] references non-existent source node ${t.s}`),i||e.push(`edges[${r}] references non-existent target node ${t.t}`);}}),{isValid:e.length===0,errors:e}}toJSON(){return JSON.stringify(this,null,2)}clone(){return new s(JSON.parse(this.toJSON()))}getStatistics(){return {nodeCount:this.getNodeCount(),edgeCount:this.getEdgeCount(),hasCoordinates:!!(this.nodes&&this.nodes.some(e=>e.x!==void 0||e.y!==void 0||e.z!==void 0)),hasVisualProperties:!!(this.visualProperties&&(this.visualProperties.default||this.visualProperties.edgeMapping||this.visualProperties.nodeMapping))}}ensureRequiredMetadata(){this.metaData||(this.metaData=[]),this.nodes&&!this.metaData.find(e=>e.name==="nodes")&&this.metaData.push({name:"nodes",elementCount:this.nodes.length}),this.edges&&!this.metaData.find(e=>e.name==="edges")&&this.metaData.push({name:"edges",elementCount:this.edges.length});}updateNodeCount(){let e=this.metaData?.find(t=>t.name==="nodes");e&&(e.elementCount=this.nodes?.length||0);}updateEdgeCount(){let e=this.metaData?.find(t=>t.name==="edges");e&&(e.elementCount=this.edges?.length||0);}};var W=class{constructor(e){this.http=e;}async getRawCX1Network(e,t={}){let r=new URLSearchParams;t.accesskey&&r.append("accesskey",t.accesskey);let n=`network/${e}${r.toString()?`?${r.toString()}`:""}`;return this.http.get(n,{version:"v2",headers:{Accept:"application/json"}})}async getNetworkSummary(e,t={}){let r=new URLSearchParams;t.accesskey&&r.append("accesskey",t.accesskey);let n=`network/${e}/summary${r.toString()?`?${r.toString()}`:""}`;return this.http.get(n,{version:"v2"})}async updateNetworkSummary(e,t){let r=`network/${e}/summary`;return this.http.put(r,t,{version:"v2"})}async copyNetwork(e){let t=`network/${e}/copy`;return this.http.post(t,{},{version:"v2"})}async searchNetworks(e,t,r,n){let i={};t!==void 0&&(i.start=t.toString()),r!==void 0&&(i.limit=r.toString());let o={searchString:e};return n!==void 0&&(n.permission!==void 0&&(o.permission=n.permission),n.includeGroups!==void 0&&(o.includeGroups=n.includeGroups),n.accountName!==void 0&&(o.accountName=n.accountName)),this.http.post("search/network",o,{version:"v2",params:i})}async createNetworkFromRawCX1(e,t={}){let i=(await this.http.post("network",e,{version:"v2",params:t})).split("/"),o=i[i.length-1];if(!o)throw new Error("Failed to extract UUID from response");return o}async updateNetworkFromRawCX1(e,t){let r=`network/${e}`;return this.http.put(r,t,{version:"v2"})}async deleteNetwork(e){let t=`network/${e}`;return this.http.delete(t,{version:"v2"})}async getNetworkSummariesByUUIDs(e,t){let r=t?{accesskey:t}:void 0;return this.http.post("batch/network/summary",e,{version:"v2",params:r})}async getUserNetworks(e,t={}){let r=new URLSearchParams;t.start!==void 0&&r.append("start",t.start.toString()),t.size!==void 0&&r.append("size",t.size.toString());let n=`user/${e}/networks${r.toString()?`?${r.toString()}`:""}`;return this.http.get(n,{version:"v2"})}async setNetworkSystemProperties(e,t){let r=`networks/${e}/systemproperty`;return this.http.put(r,t,{version:"v2"})}async getNetworkPermissions(e){let t=`networks/${e}/permission`;return this.http.get(t,{version:"v2"})}async setNetworkPermissions(e,t){let r=`networks/${e}/permission`;return this.http.put(r,t,{version:"v2"})}async grantNetworkPermission(e,t,r){let n=`networks/${e}/permission`,i={memberUUID:t,permission:r};return this.http.post(n,i,{version:"v2"})}async revokeNetworkPermission(e,t){let r=`networks/${e}/permission`;return this.http.delete(r,{version:"v2",data:{memberUUID:t}})}async getNetworkProfile(e){let t=`networks/${e}/profile`;return this.http.get(t,{version:"v2"})}async setNetworkProfile(e,t){let r=`networks/${e}/profile`;return this.http.put(r,t,{version:"v2"})}async makeNetworkPublic(e){let t=`networks/${e}/systemproperty`,r={visibility:"PUBLIC"};return this.http.put(t,r,{version:"v2"})}async makeNetworkPrivate(e){let t=`networks/${e}/systemproperty`,r={visibility:"PRIVATE"};return this.http.put(t,r,{version:"v2"})}async getNetworkSample(e,t={}){let r=new URLSearchParams;t.accesskey&&r.append("accesskey",t.accesskey);let n=`networks/${e}/sample${r.toString()?`?${r.toString()}`:""}`;return this.http.get(n,{version:"v2"})}async getMetaData(e,t){let r=new URLSearchParams;t!==void 0&&r.append("accesskey",t);let n=`network/${e}/aspect${r.toString()?`?${r.toString()}`:""}`;return this.http.get(n,{version:"v2"})}async getAccessKey(e){let t=`networks/${e}/accesskey`;return this.http.get(t,{version:"v2"})}async updateAccessKey(e,t){let r=`networks/${e}/accesskey`;return this.http.put(r,{action:t},{version:"v2"})}};var z=class{constructor(e){this.http=e;}async getNetworkSummary(e,t={}){let r=new URLSearchParams;t.accesskey&&r.append("accesskey",t.accesskey);let n=`networks/${e}/summary${r.toString()?`?${r.toString()}`:""}`;return this.http.get(n,{version:"v3"})}async getRawCX2Network(e,t={}){let r=new URLSearchParams;t.accesskey&&r.append("accesskey",t.accesskey);let n=`networks/${e}${r.toString()?`?${r.toString()}`:""}`;return this.http.get(n,{version:"v3"})}async getAttributesOfSelectedNodes(e,t,r={}){let n=new URLSearchParams;r.accesskey&&n.append("accesskey",r.accesskey);let i={ids:t.ids,attributeNames:t.attributeNames},o=`search/networks/${e}/nodes${n.toString()?`?${n.toString()}`:""}`;return this.http.post(o,i,{version:"v3"})}async getNetworkSummariesV3ByUUIDs(e,t,r){let n={format:r===void 0?"FULL":r};return t!=null&&(n.accesskey=t),this.http.post("batch/networks/summary",e,{version:"v3",params:n})}async searchNetworks(e={}){let t=new URLSearchParams;e.searchString&&t.append("searchString",e.searchString),e.accountName&&t.append("accountName",e.accountName),e.permission&&t.append("permission",e.permission),e.includeGroups!==void 0&&t.append("includeGroups",e.includeGroups.toString()),e.admin&&t.append("admin",e.admin),e.start!==void 0&&t.append("start",e.start.toString()),e.size!==void 0&&t.append("size",e.size.toString()),e.source&&t.append("source",e.source);let r=`search/network${t.toString()?`?${t.toString()}`:""}`;return this.http.get(r,{version:"v3"})}async getNetworkAsCX2Object(e,t={}){let r=await this.getRawCX2Network(e,t);return new B(r)}async createNetworkFromCX2(e,t={}){let r="networks",n=e instanceof B?JSON.parse(e.toJSON()):e;return this.http.post(r,n,{version:"v3",params:t})}async updateNetworkCX2(e,t){let r=`networks/${e}`,n=t instanceof B?JSON.parse(t.toJSON()):t;return this.http.put(r,n,{version:"v3"})}async uploadCX2Network(e,t={}){let r={};if(t.visibility!==void 0&&(r.visibility=String(t.visibility)),t.folderId!==void 0&&(r.folderId=t.folderId),typeof globalThis.window>"u"){let u;try{u=ut();}catch{u=null;}if(u){let l=new u;if((f=>f&&typeof f=="object"&&typeof f.pipe=="function")(e))l.append("CXNetworkStream",e,{filename:"network.cx2",contentType:"application/json"});else if(typeof globalThis.Buffer<"u"&&globalThis.Buffer.isBuffer(e))l.append("CXNetworkStream",e,{filename:"network.cx2",contentType:"application/json"});else if(typeof e=="string")l.append("CXNetworkStream",globalThis.Buffer.from(e),{filename:"network.cx2",contentType:"application/json"});else if(typeof globalThis.Blob<"u"&&e instanceof globalThis.Blob){let f=await e.arrayBuffer();l.append("CXNetworkStream",globalThis.Buffer.from(f),{filename:"network.cx2",contentType:e.type||"application/json"});}else l.append("CXNetworkStream",globalThis.Buffer.from(String(e)),{filename:"network.cx2",contentType:"application/json"});let b={version:"v3",params:r,headers:l.getHeaders?.()||{},maxBodyLength:1/0};return this.http.post("networks",l,b)}if((l=>l&&typeof l=="object"&&typeof l.pipe=="function")(e))throw new Error("Readable stream upload requires 'form-data' package. Please install 'form-data' or pass a string/Buffer/Blob instead.")}let i=new FormData,o=typeof globalThis.File<"u",c=typeof globalThis.Blob<"u";if(o&&e instanceof globalThis.File)i.append("CXNetworkStream",e,e.name||"network.cx2");else if(c&&e instanceof globalThis.Blob)i.append("CXNetworkStream",e,"network.cx2");else if(typeof e=="string"){let u=new Blob([e],{type:"application/json"});i.append("CXNetworkStream",u,"network.cx2");}else if(typeof globalThis.Buffer<"u"&&globalThis.Buffer.isBuffer(e)){let u=new Blob([e],{type:"application/json"});i.append("CXNetworkStream",u,"network.cx2");}else {let u=new Blob([String(e)],{type:"application/json"});i.append("CXNetworkStream",u,"network.cx2");}let d={version:"v3",params:r};return t.onProgress&&(d.onUploadProgress=u=>{let p=Math.round(u.loaded*100/(u.total||1));t.onProgress(p);}),this.http.post("networks",i,d)}async uploadNetworkFile(e,t={}){let r={};return t.visibility!==void 0&&(r.visibility=t.visibility),t.folderId!==void 0&&(r.folderId=t.folderId),t.onProgress&&(r.onProgress=t.onProgress),this.uploadCX2Network(e,r)}async getNetworkMetadata(e){let t=`networks/${e}/metadata`;return this.http.get(t,{version:"v3"})}async updateNetworkMetadata(e,t){let r=`networks/${e}/metadata`;return this.http.put(r,t,{version:"v3"})}async getNetworkAspect(e,t,r={}){let n=new URLSearchParams;r.accesskey&&n.append("accesskey",r.accesskey);let i=`networks/${e}/aspects/${t}${n.toString()?`?${n.toString()}`:""}`;return this.http.get(i,{version:"v3"})}async deleteNetwork(e,t=false){let r=new URLSearchParams;r.append("permanent",t.toString());let n=`networks/${e}?${r.toString()}`;return this.http.delete(n,{version:"v3"})}};var J=class{constructor(e){this.http=e;this.v2Service=new W(e),this.v3Service=new z(e);}async getNetworkSummary(e,t={}){return this.v3Service.getNetworkSummary(e,t)}async updateNetworkSummary(e,t){let r=this.transformV3ToV2(t);return this.v2Service.updateNetworkSummary(e,r)}transformV3ToV2(e){let{properties:t,...r}=e,n,i=[];if(t)for(let[c,d]of Object.entries(t))c==="version"?n=this.convertValueToString(d.v):i.push({predicateString:c,value:this.convertValueToString(d.v),dataType:d.t});let o={...r,properties:i};return n!==void 0&&(o.version=n),o}convertValueToString(e){return Array.isArray(e)?e.map(t=>String(t)).join(","):String(e)}async getRawCX1Network(e,t={}){return this.v2Service.getRawCX1Network(e,t)}async getRawCX2Network(e,t={}){return this.v3Service.getRawCX2Network(e,t)}async deleteNetwork(e,t=false){return this.v3Service.deleteNetwork(e,t)}async createNetworkDOI(e){let t="admin/request",r={type:"DOI",networkId:e.networkId,properties:{contactEmail:e.contactEmail},isCertified:e.isCertified};return this.http.post(t,r,{version:"v2"})}async getAttributesOfSelectedNodes(e,t,r={}){return this.v3Service.getAttributesOfSelectedNodes(e,t,r)}async neighborhoodQuery(e,t,r,n,i=false){let o={};r!==void 0&&r===true&&(o.save="true");let c={searchString:t,searchDepth:1};if(n!==void 0&&(n.searchDepth!==void 0&&(c.searchDepth=n.searchDepth),n.edgeLimit!==void 0&&(c.edgeLimit=n.edgeLimit),n.errorWhenLimitIsOver!==void 0&&(c.errorWhenLimitIsOver=n.errorWhenLimitIsOver),n.directOnly!==void 0&&(c.directOnly=n.directOnly),n.nodeIds!=null&&(c.nodeIds=n.nodeIds)),i){let u=`search/network/${e}/query`;return this.http.post(u,c,{version:"v3",params:o})}let d=`search/network/${e}/query`;return this.http.post(d,c,{version:"v2",params:o})}async interConnectQuery(e,t,r,n,i=false){let o={};r!==void 0&&r===true&&(o.save="true");let c={searchString:t};if(n!==void 0&&(n.edgeLimit!==void 0&&(c.edgeLimit=n.edgeLimit),n.errorWhenLimitIsOver!==void 0&&(c.errorWhenLimitIsOver=n.errorWhenLimitIsOver),n.nodeIds!=null&&(c.nodeIds=n.nodeIds)),i){let u=`search/networks/${e}/interconnectquery`;return this.http.post(u,c,{version:"v3",params:o})}let d=`search/network/${e}/interconnectquery`;return this.http.post(d,c,{version:"v2",params:o})}async getNetworkPermissionsByUUIDs(e){return this.http.post("batch/network/permission",e,{version:"v2"})}async exportNetworks(e){return this.http.post("batch/network/export",e,{version:"v2"})}async moveNetworks(e,t){if(!Array.isArray(e))throw new Error("Invalid networkIds - must be an array");let r="batch/networks/move",n={targetFolder:t!==void 0?t:null,networks:e};return this.http.post(r,n,{version:"v3"})}async setNetworksVisibility(e,t){this.validateShareData(e);let r="batch/files/setvisibility",n={files:e,visibility:t};return this.http.post(r,n,{version:"v3"})}async getNetworkAccessKey(e){let t=`network/${e}/accesskey`;return this.http.get(t,{version:"v2"})}async getRandomEdges(e,t,r){if(t<=0)throw new Error("Value of parameter limit has to be greater than 0.");let n={size:t.toString(),method:"random"};r!==void 0&&(n.accesskey=r);let i=`networks/${e}/aspects/edges`;return this.http.get(i,{version:"v3",params:n})}validateShareData(e){for(let t of Object.keys(e.files))if(!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(t))throw new Error(`Invalid UUID format: ${t}`)}async getAspectElements(e,t,r,n){let i={};r!==void 0&&(i.size=r.toString()),n!==void 0&&(i.accesskey=n);let o=`networks/${e}/aspects/${t}`;return this.http.get(o,{version:"v3",params:i})}async getFilteredEdges(e,t,r,n,i,o,c,d){let u={};i!==void 0&&(u.size=i.toString()),o!==void 0&&(u.order=o),d!==void 0&&(u.accesskey=d),c!==void 0&&(u.format=c);let p={name:t,value:r,operator:n},l=`search/networks/${e}/edges`;return this.http.post(l,p,{version:"v3",params:u})}async getCX2MetaData(e,t){let r={};t!==void 0&&(r.accesskey=t);let n=`networks/${e}/aspects`;return this.http.get(n,{version:"v3",params:r})}async createNetworkFromRawCX2(e,t={}){return this.v3.createNetworkFromCX2(e,t)}async updateNetworkFromRawCX2(e,t){let r=`networks/${e}`;return this.http.put(r,t,{version:"v3"})}async setReadOnly(e,t){let r=`network/${e}/systemproperty`;return this.http.put(r,{readOnly:t},{version:"v2"})}get v2(){return this.v2Service}get v3(){return this.v3Service}};var K=class{constructor(e){this.http=e;}copyFile(e){if(e.type==="FOLDER")throw new Error("Folder copying is not supported. Only NETWORK and SHORTCUT types are allowed.");let t={};return e.accessKey!==void 0&&(t.accesskey=e.accessKey),this.http.post("files/copy",{fileId:e.fileId,type:e.type,targetId:e.targetId},{params:t,version:"v3"})}getCount(){return this.http.get("files/count",{version:"v3"})}getTrash(){return this.http.get("files/trash",{version:"v3"})}emptyTrash(){return this.http.delete("files/trash",{version:"v3"})}permanentlyDeleteFile(e){return this.http.delete(`files/trash/${e}`,{version:"v3"})}restoreFile(e,t,r){return this.http.post("files/trash/restore",{networks:e,folders:t,shortcuts:r},{version:"v3"})}_validateShareData(e){if(typeof e!="object"||e===null||e.files===void 0)throw new Error('Data must be an object with a "files" property');if(typeof e.files!="object"||e.files===null)throw new Error('The "files" property must be an object');let t=["NETWORK","FOLDER","SHORTCUT"];for(let[r,n]of Object.entries(e.files)){if(!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(r))throw new Error(`Invalid UUID format: ${r}`);if(!t.includes(n))throw new Error(`Invalid file type for ${r}: ${n}. Must be one of: ${t.join(", ")}`)}}_validateMemberData(e){for(let t of Object.keys(e.members))if(typeof t!="string"||!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(t))throw new Error(`Invalid UUID format: ${t}`)}updateMember(e){return this._validateShareData({files:e.files}),this._validateMemberData({members:e.members}),this.http.post("files/sharing/members",{files:e.files,members:e.members},{version:"v3"})}listMembers(e){return this._validateShareData({files:e}),this.http.post("files/sharing/members/list",e,{version:"v3"})}transferOwnership(e){return this.http.post("files/sharing/transfer",e,{version:"v3"})}listShares(e){let t={};return e!==void 0&&(t.limit=e),this.http.get("files/sharing/list",{params:t,version:"v3"})}share(e){return this._validateShareData({files:e}),this.http.post("files/sharing/share",{files:e},{version:"v3"})}unshare(e){return this._validateShareData({files:e}),this.http.post("files/sharing/unshare",{files:e},{version:"v3"})}getFolders(e){let t={};return e!==void 0&&(t.limit=e),this.http.get("files/folders",{params:t,version:"v3"})}createFolder(e,t){return this.http.post("files/folders",{name:e,parent:t},{version:"v3"})}getFolder(e,t){let r={};return t!==void 0&&(r.accesskey=t),this.http.get(`files/folders/${e}`,{params:r,version:"v3"})}updateFolder(e,t){return this.http.put(`files/folders/${e}`,t,{version:"v3"})}deleteFolder(e){return this.http.delete(`files/folders/${e}`,{version:"v3"})}getFolderCount(e,t){let r={};return t!==void 0&&(r.accesskey=t),this.http.get(`files/folders/${e}/count`,{params:r,version:"v3"})}getFolderList(e,t,r,n){let i={};return t!==void 0&&(i.accesskey=t),r!==void 0&&(i.format=r),n!==void 0&&(i.type=n),this.http.get(`files/folders/${e}/list`,{params:i,version:"v3"})}getFolderAccessKey(e){let t=`files/folders/${e}/accesskey`;return this.http.get(t,{version:"v3"})}getShortcuts(e){let t={};return e!==void 0&&(t.limit=e),this.http.get("files/shortcuts",{params:t,version:"v3"})}createShortcut(e){return this.http.post("files/shortcuts",e,{version:"v3"})}getShortcut(e,t){let r={};return t!==void 0&&(r.accesskey=t),this.http.get(`files/shortcuts/${e}`,{params:r,version:"v3"})}updateShortcut(e,t){return this.http.put(`files/shortcuts/${e}`,{...t,parent:t.parent??null},{version:"v3"})}deleteShortcut(e){return this.http.delete(`files/shortcuts/${e}`,{version:"v3"})}setVisibility(e){return this.http.post("batch/files/setvisibility",{files:e.files,visibility:e.visibility},{version:"v3"})}searchFiles(e){return this.http.post("search/files",e,{version:"v3"})}};var G=class{constructor(e){this.http=e;}async createCyWebWorkspace(e){return this.http.post("workspaces",e,{version:"v3"})}async getCyWebWorkspace(e){let t=`workspaces/${e}`;return this.http.get(t,{version:"v3"})}async deleteCyWebWorkspace(e){let t=`workspaces/${e}`;return this.http.delete(t,{version:"v3"})}async updateCyWebWorkspace(e,t){let r=`workspaces/${e}`;return this.http.put(r,t,{version:"v3"})}async updateCyWebWorkspaceName(e,t){let r=`workspaces/${e}/name`;return this.http.put(r,{name:t},{version:"v3"})}async updateCyWebWorkspaceNetworks(e,t){let r=`workspaces/${e}/networkids`;return this.http.put(r,t,{version:"v3"})}async getUserCyWebWorkspaces(){let t=`users/${(await this.http.get("user",{params:{valid:true}})).externalId}/workspaces`;return this.http.get(t,{version:"v3"})}};var Q=class{constructor(e){this.http=e;}async authenticate(){let e=this.http.getAuthType();if(!e)throw new Error("Authentication parameters are missing in NDEx client.");if(e===k.BASIC){let t="user",r={valid:true};return this.http.get(t,{params:r})}else if(e===k.OAUTH){let t=this.http.getIdToken();if(!t)throw new Error("OAuth ID token is missing.");let r="users/signin",n={idToken:t};return this.http.post(r,n,{version:"v3"})}throw new Error(`Unsupported authentication type: ${e}`)}async getCurrentUser(){if(!this.http.getAuthType())throw new Error("Authentication parameters are missing in NDEx client.");let t="user",r={valid:true};return this.http.get(t,{params:r})}async updateCurrentUser(e){if(!e.externalId)throw new Error("User uuid is required in userUpdate object");let t=`user/${e.externalId}`;return this.http.put(t,e)}async requestPasswordReset(e){return this.http.post("user/forgot-password",{email:e})}async resetPassword(e,t){let r=`user/${e}/password`,n={headers:{"Content-Type":"text/plain"}};return this.http.put(r,t,n)}async getUser(e){let t=`user/${e}`;return this.http.get(t)}async getUserByNameOrEmail(e){let t=new URLSearchParams;"username"in e?t.append("username",e.username):"email"in e&&t.append("email",e.email);let r=`user?${t.toString()}`;return this.http.get(r)}async getUsersByUUIDs(e){return this.http.post("batch/user",e)}async searchUsers(e,t,r){let n={};t!==void 0&&(n.start=t.toString()),r!==void 0&&(n.limit=r.toString());let i={searchString:e};return this.http.post("search/user",i,{params:n})}async getAccountPageNetworks(e,t,r){let n={};t!==void 0&&(n.offset=t.toString()),r!==void 0&&(n.limit=r.toString());let i=`user/${e}/networksummary`;return this.http.get(i,{params:n})}async getUserHomeContent(e,t="update"){let r={format:t},n=`users/${e}/home`;return this.http.get(n,{params:r,version:"v3"})}async deleteUserAccount(e){let t=`user/${e}`;return this.http.delete(t)}};var Z=class{constructor(){}};function Y(s,e){return function(){return s.apply(e,arguments)}}var{toString:Yt}=Object.prototype,{getPrototypeOf:Xe}=Object,{iterator:we,toStringTag:dt}=Symbol,ve=(s=>e=>{let t=Yt.call(e);return s[t]||(s[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),T=s=>(s=s.toLowerCase(),e=>ve(e)===s),Se=s=>e=>typeof e===s,{isArray:j}=Array,ee=Se("undefined");function te(s){return s!==null&&!ee(s)&&s.constructor!==null&&!ee(s.constructor)&&C(s.constructor.isBuffer)&&s.constructor.isBuffer(s)}var lt=T("ArrayBuffer");function er(s){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(s):e=s&&s.buffer&&lt(s.buffer),e}var tr=Se("string"),C=Se("function"),ft=Se("number"),re=s=>s!==null&&typeof s=="object",rr=s=>s===true||s===false,be=s=>{if(ve(s)!=="object")return false;let e=Xe(s);return (e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(dt in s)&&!(we in s)},sr=s=>{if(!re(s)||te(s))return false;try{return Object.keys(s).length===0&&Object.getPrototypeOf(s)===Object.prototype}catch{return false}},nr=T("Date"),ir=T("File"),or=T("Blob"),ar=T("FileList"),cr=s=>re(s)&&C(s.pipe),ur=s=>{let e;return s&&(typeof FormData=="function"&&s instanceof FormData||C(s.append)&&((e=ve(s))==="formdata"||e==="object"&&C(s.toString)&&s.toString()==="[object FormData]"))},pr=T("URLSearchParams"),[dr,lr,fr,mr]=["ReadableStream","Request","Response","Headers"].map(T),hr=s=>s.trim?s.trim():s.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function se(s,e,{allOwnKeys:t=false}={}){if(s===null||typeof s>"u")return;let r,n;if(typeof s!="object"&&(s=[s]),j(s))for(r=0,n=s.length;r<n;r++)e.call(null,s[r],r,s);else {if(te(s))return;let i=t?Object.getOwnPropertyNames(s):Object.keys(s),o=i.length,c;for(r=0;r<o;r++)c=i[r],e.call(null,s[c],c,s);}}function mt(s,e){if(te(s))return null;e=e.toLowerCase();let t=Object.keys(s),r=t.length,n;for(;r-- >0;)if(n=t[r],e===n.toLowerCase())return n;return null}var X=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:globalThis,ht=s=>!ee(s)&&s!==X;function Be(){let{caseless:s}=ht(this)&&this||{},e={},t=(r,n)=>{let i=s&&mt(e,n)||n;be(e[i])&&be(r)?e[i]=Be(e[i],r):be(r)?e[i]=Be({},r):j(r)?e[i]=r.slice():e[i]=r;};for(let r=0,n=arguments.length;r<n;r++)arguments[r]&&se(arguments[r],t);return e}var gr=(s,e,t,{allOwnKeys:r}={})=>(se(e,(n,i)=>{t&&C(n)?s[i]=Y(n,t):s[i]=n;},{allOwnKeys:r}),s),yr=s=>(s.charCodeAt(0)===65279&&(s=s.slice(1)),s),br=(s,e,t,r)=>{s.prototype=Object.create(e.prototype,r),s.prototype.constructor=s,Object.defineProperty(s,"super",{value:e.prototype}),t&&Object.assign(s.prototype,t);},wr=(s,e,t,r)=>{let n,i,o,c={};if(e=e||{},s==null)return e;do{for(n=Object.getOwnPropertyNames(s),i=n.length;i-- >0;)o=n[i],(!r||r(o,s,e))&&!c[o]&&(e[o]=s[o],c[o]=true);s=t!==false&&Xe(s);}while(s&&(!t||t(s,e))&&s!==Object.prototype);return e},vr=(s,e,t)=>{s=String(s),(t===void 0||t>s.length)&&(t=s.length),t-=e.length;let r=s.indexOf(e,t);return r!==-1&&r===t},Sr=s=>{if(!s)return null;if(j(s))return s;let e=s.length;if(!ft(e))return null;let t=new Array(e);for(;e-- >0;)t[e]=s[e];return t},xr=(s=>e=>s&&e instanceof s)(typeof Uint8Array<"u"&&Xe(Uint8Array)),Nr=(s,e)=>{let r=(s&&s[we]).call(s),n;for(;(n=r.next())&&!n.done;){let i=n.value;e.call(s,i[0],i[1]);}},Er=(s,e)=>{let t,r=[];for(;(t=s.exec(e))!==null;)r.push(t);return r},kr=T("HTMLFormElement"),Rr=s=>s.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,r,n){return r.toUpperCase()+n}),pt=(({hasOwnProperty:s})=>(e,t)=>s.call(e,t))(Object.prototype),Cr=T("RegExp"),gt=(s,e)=>{let t=Object.getOwnPropertyDescriptors(s),r={};se(t,(n,i)=>{let o;(o=e(n,i,s))!==false&&(r[i]=o||n);}),Object.defineProperties(s,r);},Tr=s=>{gt(s,(e,t)=>{if(C(s)&&["arguments","caller","callee"].indexOf(t)!==-1)return false;let r=s[t];if(C(r)){if(e.enumerable=false,"writable"in e){e.writable=false;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")});}});},Pr=(s,e)=>{let t={},r=n=>{n.forEach(i=>{t[i]=true;});};return j(s)?r(s):r(String(s).split(e)),t},Ar=()=>{},Dr=(s,e)=>s!=null&&Number.isFinite(s=+s)?s:e;function Or(s){return !!(s&&C(s.append)&&s[dt]==="FormData"&&s[we])}var Ur=s=>{let e=new Array(10),t=(r,n)=>{if(re(r)){if(e.indexOf(r)>=0)return;if(te(r))return r;if(!("toJSON"in r)){e[n]=r;let i=j(r)?[]:{};return se(r,(o,c)=>{let d=t(o,n+1);!ee(d)&&(i[c]=d);}),e[n]=void 0,i}}return r};return t(s,0)},Ir=T("AsyncFunction"),Fr=s=>s&&(re(s)||C(s))&&C(s.then)&&C(s.catch),yt=((s,e)=>s?setImmediate:e?((t,r)=>(X.addEventListener("message",({source:n,data:i})=>{n===X&&i===t&&r.length&&r.shift()();},false),n=>{r.push(n),X.postMessage(t,"*");}))(`axios@${Math.random()}`,[]):t=>setTimeout(t))(typeof setImmediate=="function",C(X.postMessage)),Lr=typeof queueMicrotask<"u"?queueMicrotask.bind(X):typeof process<"u"&&process.nextTick||yt,Br=s=>s!=null&&C(s[we]),a={isArray:j,isArrayBuffer:lt,isBuffer:te,isFormData:ur,isArrayBufferView:er,isString:tr,isNumber:ft,isBoolean:rr,isObject:re,isPlainObject:be,isEmptyObject:sr,isReadableStream:dr,isRequest:lr,isResponse:fr,isHeaders:mr,isUndefined:ee,isDate:nr,isFile:ir,isBlob:or,isRegExp:Cr,isFunction:C,isStream:cr,isURLSearchParams:pr,isTypedArray:xr,isFileList:ar,forEach:se,merge:Be,extend:gr,trim:hr,stripBOM:yr,inherits:br,toFlatObject:wr,kindOf:ve,kindOfTest:T,endsWith:vr,toArray:Sr,forEachEntry:Nr,matchAll:Er,isHTMLForm:kr,hasOwnProperty:pt,hasOwnProp:pt,reduceDescriptors:gt,freezeMethods:Tr,toObjectSet:Pr,toCamelCase:Rr,noop:Ar,toFiniteNumber:Dr,findKey:mt,global:X,isContextDefined:ht,isSpecCompliantForm:Or,toJSONObject:Ur,isAsyncFn:Ir,isThenable:Fr,setImmediate:yt,asap:Lr,isIterable:Br};function _(s,e,t,r,n){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=s,this.name="AxiosError",e&&(this.code=e),t&&(this.config=t),r&&(this.request=r),n&&(this.response=n,this.status=n.status?n.status:null);}a.inherits(_,Error,{toJSON:function(){return {message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:a.toJSONObject(this.config),code:this.code,status:this.status}}});var bt=_.prototype,wt={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(s=>{wt[s]={value:s};});Object.defineProperties(_,wt);Object.defineProperty(bt,"isAxiosError",{value:true});_.from=(s,e,t,r,n,i)=>{let o=Object.create(bt);return a.toFlatObject(s,o,function(d){return d!==Error.prototype},c=>c!=="isAxiosError"),_.call(o,s.message,e,t,r,n),o.cause=s,o.name=s.name,i&&Object.assign(o,i),o};var h=_;var xe=null;function je(s){return a.isPlainObject(s)||a.isArray(s)}function St(s){return a.endsWith(s,"[]")?s.slice(0,-2):s}function vt(s,e,t){return s?s.concat(e).map(function(n,i){return n=St(n),!t&&i?"["+n+"]":n}).join(t?".":""):e}function Xr(s){return a.isArray(s)&&!s.some(je)}var jr=a.toFlatObject(a,{},null,function(e){return /^is[A-Z]/.test(e)});function _r(s,e,t){if(!a.isObject(s))throw new TypeError("target must be an object");e=e||new(FormData),t=a.toFlatObject(t,{metaTokens:true,dots:false,indexes:false},false,function(g,m){return !a.isUndefined(m[g])});let r=t.metaTokens,n=t.visitor||p,i=t.dots,o=t.indexes,d=(t.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(e);if(!a.isFunction(n))throw new TypeError("visitor must be a function");function u(f){if(f===null)return "";if(a.isDate(f))return f.toISOString();if(a.isBoolean(f))return f.toString();if(!d&&a.isBlob(f))throw new h("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(f)||a.isTypedArray(f)?d&&typeof Blob=="function"?new Blob([f]):Buffer.from(f):f}function p(f,g,m){let v=f;if(f&&!m&&typeof f=="object"){if(a.endsWith(g,"{}"))g=r?g:g.slice(0,-2),f=JSON.stringify(f);else if(a.isArray(f)&&Xr(f)||(a.isFileList(f)||a.endsWith(g,"[]"))&&(v=a.toArray(f)))return g=St(g),v.forEach(function(E,U){!(a.isUndefined(E)||E===null)&&e.append(o===true?vt([g],U,i):o===null?g:g+"[]",u(E));}),false}return je(f)?true:(e.append(vt(m,g,i),u(f)),false)}let l=[],y=Object.assign(jr,{defaultVisitor:p,convertValue:u,isVisitable:je});function b(f,g){if(!a.isUndefined(f)){if(l.indexOf(f)!==-1)throw Error("Circular reference detected in "+g.join("."));l.push(f),a.forEach(f,function(v,x){(!(a.isUndefined(v)||v===null)&&n.call(e,v,a.isString(x)?x.trim():x,g,y))===true&&b(v,g?g.concat(x):[x]);}),l.pop();}}if(!a.isObject(s))throw new TypeError("data must be an object");return b(s),e}var F=_r;function xt(s){let e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(s).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function Nt(s,e){this._pairs=[],s&&F(s,this,e);}var Et=Nt.prototype;Et.append=function(e,t){this._pairs.push([e,t]);};Et.toString=function(e){let t=e?function(r){return e.call(this,r,xt)}:xt;return this._pairs.map(function(n){return t(n[0])+"="+t(n[1])},"").join("&")};var Ne=Nt;function Vr(s){return encodeURIComponent(s).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function ne(s,e,t){if(!e)return s;let r=t&&t.encode||Vr;a.isFunction(t)&&(t={serialize:t});let n=t&&t.serialize,i;if(n?i=n(e,t):i=a.isURLSearchParams(e)?e.toString():new Ne(e,t).toString(r),i){let o=s.indexOf("#");o!==-1&&(s=s.slice(0,o)),s+=(s.indexOf("?")===-1?"?":"&")+i;}return s}var _e=class{constructor(){this.handlers=[];}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:r?r.synchronous:false,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null);}clear(){this.handlers&&(this.handlers=[]);}forEach(e){a.forEach(this.handlers,function(r){r!==null&&e(r);});}},Ve=_e;var Ee={silentJSONParsing:true,forcedJSONParsing:true,clarifyTimeoutError:false};var kt=typeof URLSearchParams<"u"?URLSearchParams:Ne;var Rt=typeof FormData<"u"?FormData:null;var Ct=typeof Blob<"u"?Blob:null;var Tt={isBrowser:true,classes:{URLSearchParams:kt,FormData:Rt,Blob:Ct},protocols:["http","https","file","blob","url","data"]};var He={};Qt(He,{hasBrowserEnv:()=>Me,hasStandardBrowserEnv:()=>$r,hasStandardBrowserWebWorkerEnv:()=>Mr,navigator:()=>$e,origin:()=>Hr});var Me=typeof window<"u"&&typeof document<"u",$e=typeof navigator=="object"&&navigator||void 0,$r=Me&&(!$e||["ReactNative","NativeScript","NS"].indexOf($e.product)<0),Mr=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Hr=Me&&window.location.href||"http://localhost";var w={...He,...Tt};function qe(s,e){return F(s,new w.classes.URLSearchParams,{visitor:function(t,r,n,i){return w.isNode&&a.isBuffer(t)?(this.append(r,t.toString("base64")),false):i.defaultVisitor.apply(this,arguments)},...e})}function qr(s){return a.matchAll(/\w+|\[(\w*)]/g,s).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Wr(s){let e={},t=Object.keys(s),r,n=t.length,i;for(r=0;r<n;r++)i=t[r],e[i]=s[i];return e}function zr(s){function e(t,r,n,i){let o=t[i++];if(o==="__proto__")return true;let c=Number.isFinite(+o),d=i>=t.length;return o=!o&&a.isArray(n)?n.length:o,d?(a.hasOwnProp(n,o)?n[o]=[n[o],r]:n[o]=r,!c):((!n[o]||!a.isObject(n[o]))&&(n[o]=[]),e(t,r,n[o],i)&&a.isArray(n[o])&&(n[o]=Wr(n[o])),!c)}if(a.isFormData(s)&&a.isFunction(s.entries)){let t={};return a.forEachEntry(s,(r,n)=>{e(qr(r),n,t,0);}),t}return null}var ke=zr;function Jr(s,e,t){if(a.isString(s))try{return (e||JSON.parse)(s),a.trim(s)}catch(r){if(r.name!=="SyntaxError")throw r}return (t||JSON.stringify)(s)}var We={transitional:Ee,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){let r=t.getContentType()||"",n=r.indexOf("application/json")>-1,i=a.isObject(e);if(i&&a.isHTMLForm(e)&&(e=new FormData(e)),a.isFormData(e))return n?JSON.stringify(ke(e)):e;if(a.isArrayBuffer(e)||a.isBuffer(e)||a.isStream(e)||a.isFile(e)||a.isBlob(e)||a.isReadableStream(e))return e;if(a.isArrayBufferView(e))return e.buffer;if(a.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",false),e.toString();let c;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return qe(e,this.formSerializer).toString();if((c=a.isFileList(e))||r.indexOf("multipart/form-data")>-1){let d=this.env&&this.env.FormData;return F(c?{"files[]":e}:e,d&&new d,this.formSerializer)}}return i||n?(t.setContentType("application/json",false),Jr(e)):e}],transformResponse:[function(e){let t=this.transitional||We.transitional,r=t&&t.forcedJSONParsing,n=this.responseType==="json";if(a.isResponse(e)||a.isReadableStream(e))return e;if(e&&a.isString(e)&&(r&&!this.responseType||n)){let o=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e)}catch(c){if(o)throw c.name==="SyntaxError"?h.from(c,h.ERR_BAD_RESPONSE,this,null,this.response):c}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:w.classes.FormData,Blob:w.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a.forEach(["delete","get","head","post","put","patch"],s=>{We.headers[s]={};});var V=We;var Kr=a.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Pt=s=>{let e={},t,r,n;return s&&s.split(`
2
+ var Kt=Object.defineProperty;var Gt=(s,e)=>()=>(e||s((e={exports:{}}).exports,e),e.exports),Qt=(s,e)=>{for(var t in e)Kt(s,t,{get:e[t],enumerable:true});};var ut=Gt((ks,ct)=>{ct.exports=typeof self=="object"?self.FormData:window.FormData;});var Zt=(r=>(r.NONE="NONE",r.BASIC="BASIC",r.FULL="FULL",r))(Zt||{}),A=class extends Error{constructor(t,r,n,i){super(t);this.statusCode=r;this.errorCode=n;this.description=i;this.name="NDExError";}},fe=class extends A{constructor(t,r){super(t,void 0,"NETWORK_ERROR");this.originalError=r;this.name="NDExNetworkError";}},me=class extends A{constructor(e="Authentication failed",t=401,r){super(e,t,r??"AUTH_ERROR"),this.name="NDExAuthError";}},he=class extends A{constructor(e="Resource not found",t=404,r){super(e,t,r??"NOT_FOUND"),this.name="NDExNotFoundError";}},ge=class extends A{constructor(e,t=400,r){super(e,t,r??"VALIDATION_ERROR"),this.name="NDExValidationError";}},ye=class extends A{constructor(e="Internal server error",t=500,r){super(e,t,r??"SERVER_ERROR"),this.name="NDExServerError";}};var k={BASIC:"basic",OAUTH:"oauth"},ys={PUBLIC:"PUBLIC",PRIVATE:"PRIVATE",UNLISTED:"UNLISTED"},bs={READ:"READ",WRITE:"WRITE",ADMIN:"ADMIN"},ws={NETWORK:"NETWORK",FOLDER:"FOLDER",SHORTCUT:"SHORTCUT"},vs={DISCRETE:"DISCRETE",CONTINUOUS:"CONTINUOUS",PASSTHROUGH:"PASSTHROUGH"},Ss={STRING:"string",LONG:"long",INTEGER:"integer",DOUBLE:"double",BOOLEAN:"boolean",LIST_OF_STRING:"list_of_string",LIST_OF_LONG:"list_of_long",LIST_OF_INTEGER:"list_of_integer",LIST_OF_DOUBLE:"list_of_double",LIST_OF_BOOLEAN:"list_of_boolean"};var B=class s{constructor(e){this.CXVersion="2.0";this.hasFragments=false;this.metaData=[];e&&Object.assign(this,e),this.ensureRequiredMetadata();}static createEmpty(){let e=new s;return e.nodes=[],e.edges=[],e.metaData=[{name:"nodes",elementCount:0},{name:"edges",elementCount:0}],e}static fromJSON(e){let t=typeof e=="string"?JSON.parse(e):e;return new s(t)}static fromNetworkSummary(e){let t=s.createEmpty();return t.networkAttributes=[{name:e.name},...e.description?[{description:e.description}]:[],...e.version?[{version:e.version}]:[]],e.properties&&Object.entries(e.properties).forEach(([r,n])=>{t.networkAttributes?.push({[r]:n.v});}),t}addNode(e,t){this.nodes||(this.nodes=[]);let r={id:e};return t&&(r.v=t),this.nodes.push(r),this.updateNodeCount(),r}addEdge(e,t,r,n){this.edges||(this.edges=[]);let i={id:e,s:t,t:r};return n&&(i.v=n),this.edges.push(i),this.updateEdgeCount(),i}addNodeAttribute(e,t,r){let n=this.nodes?.find(i=>i.id===e);n&&(n.v||(n.v={}),n.v[t]=r);}addEdgeAttribute(e,t,r){let n=this.edges?.find(i=>i.id===e);n&&(n.v||(n.v={}),n.v[t]=r);}setNodeCoordinates(e,t,r,n){this.nodes||(this.nodes=[]);let i=this.nodes.find(o=>o.id===e);i||(i={id:e},this.nodes.push(i),this.updateNodeCount()),i.x=t,i.y=r,n!==void 0&&(i.z=n);}getNode(e){return this.nodes?.find(t=>t.id===e)}getEdge(e){return this.edges?.find(t=>t.id===e)}getNodes(){return this.nodes||[]}getEdges(){return this.edges||[]}getNodeCount(){return this.nodes?.length||0}getEdgeCount(){return this.edges?.length||0}getNetworkName(){return this.networkAttributes?.find(e=>"name"in e)?.name}setNetworkName(e){this.networkAttributes||(this.networkAttributes=[]),this.networkAttributes=this.networkAttributes.filter(t=>!("name"in t)),this.networkAttributes.push({name:e});}getNetworkAttribute(e){return this.networkAttributes?.find(t=>e in t)?.[e]}setNetworkAttribute(e,t){this.networkAttributes||(this.networkAttributes=[]),this.networkAttributes=this.networkAttributes.filter(r=>!(e in r)),this.networkAttributes.push({[e]:t});}validate(){let e=[];return this.CXVersion||e.push("CXVersion is required"),this.hasFragments===void 0&&e.push("hasFragments is required"),(!this.metaData||this.metaData.length===0)&&e.push("metaData is required and must not be empty"),this.metaData?.forEach((t,r)=>{t.name||e.push(`metaData[${r}] is missing required 'name' field`);}),this.nodes&&this.nodes.forEach((t,r)=>{(t.id===void 0||t.id===null)&&e.push(`nodes[${r}] is missing required 'id' field`);}),this.edges&&this.edges.forEach((t,r)=>{if((t.id===void 0||t.id===null)&&e.push(`edges[${r}] is missing required 'id' field`),(t.s===void 0||t.s===null)&&e.push(`edges[${r}] is missing required 's' (source) field`),(t.t===void 0||t.t===null)&&e.push(`edges[${r}] is missing required 't' (target) field`),this.nodes&&t.s!==void 0&&t.t!==void 0){let n=this.nodes.some(o=>o.id===t.s),i=this.nodes.some(o=>o.id===t.t);n||e.push(`edges[${r}] references non-existent source node ${t.s}`),i||e.push(`edges[${r}] references non-existent target node ${t.t}`);}}),{isValid:e.length===0,errors:e}}toJSON(){return JSON.stringify(this,null,2)}clone(){return new s(JSON.parse(this.toJSON()))}getStatistics(){return {nodeCount:this.getNodeCount(),edgeCount:this.getEdgeCount(),hasCoordinates:!!(this.nodes&&this.nodes.some(e=>e.x!==void 0||e.y!==void 0||e.z!==void 0)),hasVisualProperties:!!(this.visualProperties&&(this.visualProperties.default||this.visualProperties.edgeMapping||this.visualProperties.nodeMapping))}}ensureRequiredMetadata(){this.metaData||(this.metaData=[]),this.nodes&&!this.metaData.find(e=>e.name==="nodes")&&this.metaData.push({name:"nodes",elementCount:this.nodes.length}),this.edges&&!this.metaData.find(e=>e.name==="edges")&&this.metaData.push({name:"edges",elementCount:this.edges.length});}updateNodeCount(){let e=this.metaData?.find(t=>t.name==="nodes");e&&(e.elementCount=this.nodes?.length||0);}updateEdgeCount(){let e=this.metaData?.find(t=>t.name==="edges");e&&(e.elementCount=this.edges?.length||0);}};var W=class{constructor(e){this.http=e;}async getRawCX1Network(e,t={}){let r=new URLSearchParams;t.accesskey&&r.append("accesskey",t.accesskey);let n=`network/${e}${r.toString()?`?${r.toString()}`:""}`;return this.http.get(n,{version:"v2",headers:{Accept:"application/json"}})}async getNetworkSummary(e,t={}){let r=new URLSearchParams;t.accesskey&&r.append("accesskey",t.accesskey);let n=`network/${e}/summary${r.toString()?`?${r.toString()}`:""}`;return this.http.get(n,{version:"v2"})}async updateNetworkSummary(e,t){let r=`network/${e}/summary`;return this.http.put(r,t,{version:"v2"})}async copyNetwork(e){let t=`network/${e}/copy`;return this.http.post(t,{},{version:"v2"})}async searchNetworks(e,t,r,n){let i={};t!==void 0&&(i.start=t.toString()),r!==void 0&&(i.limit=r.toString());let o={searchString:e};return n!==void 0&&(n.permission!==void 0&&(o.permission=n.permission),n.includeGroups!==void 0&&(o.includeGroups=n.includeGroups),n.accountName!==void 0&&(o.accountName=n.accountName)),this.http.post("search/network",o,{version:"v2",params:i})}async createNetworkFromRawCX1(e,t={}){let i=(await this.http.post("network",e,{version:"v2",params:t})).split("/"),o=i[i.length-1];if(!o)throw new Error("Failed to extract UUID from response");return o}async updateNetworkFromRawCX1(e,t){let r=`network/${e}`;return this.http.put(r,t,{version:"v2"})}async deleteNetwork(e){let t=`network/${e}`;return this.http.delete(t,{version:"v2"})}async getNetworkSummariesByUUIDs(e,t){let r=t?{accesskey:t}:void 0;return this.http.post("batch/network/summary",e,{version:"v2",params:r})}async getUserNetworks(e,t={}){let r=new URLSearchParams;t.start!==void 0&&r.append("start",t.start.toString()),t.size!==void 0&&r.append("size",t.size.toString());let n=`user/${e}/networks${r.toString()?`?${r.toString()}`:""}`;return this.http.get(n,{version:"v2"})}async setNetworkSystemProperties(e,t){let r=`networks/${e}/systemproperty`;return this.http.put(r,t,{version:"v2"})}async getNetworkPermissions(e){let t=`networks/${e}/permission`;return this.http.get(t,{version:"v2"})}async setNetworkPermissions(e,t){let r=`networks/${e}/permission`;return this.http.put(r,t,{version:"v2"})}async grantNetworkPermission(e,t,r){let n=`networks/${e}/permission`,i={memberUUID:t,permission:r};return this.http.post(n,i,{version:"v2"})}async revokeNetworkPermission(e,t){let r=`networks/${e}/permission`;return this.http.delete(r,{version:"v2",data:{memberUUID:t}})}async getNetworkProfile(e){let t=`networks/${e}/profile`;return this.http.get(t,{version:"v2"})}async setNetworkProfile(e,t){let r=`networks/${e}/profile`;return this.http.put(r,t,{version:"v2"})}async makeNetworkPublic(e){let t=`networks/${e}/systemproperty`,r={visibility:"PUBLIC"};return this.http.put(t,r,{version:"v2"})}async makeNetworkPrivate(e){let t=`networks/${e}/systemproperty`,r={visibility:"PRIVATE"};return this.http.put(t,r,{version:"v2"})}async getNetworkSample(e,t={}){let r=new URLSearchParams;t.accesskey&&r.append("accesskey",t.accesskey);let n=`networks/${e}/sample${r.toString()?`?${r.toString()}`:""}`;return this.http.get(n,{version:"v2"})}async getMetaData(e,t){let r=new URLSearchParams;t!==void 0&&r.append("accesskey",t);let n=`network/${e}/aspect${r.toString()?`?${r.toString()}`:""}`;return this.http.get(n,{version:"v2"})}async getAccessKey(e){let t=`networks/${e}/accesskey`;return this.http.get(t,{version:"v2"})}async updateAccessKey(e,t){let r=`networks/${e}/accesskey`;return this.http.put(r,{action:t},{version:"v2"})}};var z=class{constructor(e){this.http=e;}async getNetworkSummary(e,t={}){let r=new URLSearchParams;t.accesskey&&r.append("accesskey",t.accesskey);let n=`networks/${e}/summary${r.toString()?`?${r.toString()}`:""}`;return this.http.get(n,{version:"v3"})}async getRawCX2Network(e,t={}){let r=new URLSearchParams;t.accesskey&&r.append("accesskey",t.accesskey);let n=`networks/${e}${r.toString()?`?${r.toString()}`:""}`;return this.http.get(n,{version:"v3"})}async getAttributesOfSelectedNodes(e,t,r={}){let n=new URLSearchParams;r.accesskey&&n.append("accesskey",r.accesskey);let i={ids:t.ids,attributeNames:t.attributeNames},o=`search/networks/${e}/nodes${n.toString()?`?${n.toString()}`:""}`;return this.http.post(o,i,{version:"v3"})}async getNetworkSummariesV3ByUUIDs(e,t,r){let n={format:r===void 0?"FULL":r};return t!=null&&(n.accesskey=t),this.http.post("batch/networks/summary",e,{version:"v3",params:n})}async searchNetworks(e={}){let t=new URLSearchParams;e.searchString&&t.append("searchString",e.searchString),e.accountName&&t.append("accountName",e.accountName),e.permission&&t.append("permission",e.permission),e.includeGroups!==void 0&&t.append("includeGroups",e.includeGroups.toString()),e.admin&&t.append("admin",e.admin),e.start!==void 0&&t.append("start",e.start.toString()),e.size!==void 0&&t.append("size",e.size.toString()),e.source&&t.append("source",e.source);let r=`search/network${t.toString()?`?${t.toString()}`:""}`;return this.http.get(r,{version:"v3"})}async getNetworkAsCX2Object(e,t={}){let r=await this.getRawCX2Network(e,t);return new B(r)}async createNetworkFromCX2(e,t={}){let r="networks",n=e instanceof B?JSON.parse(e.toJSON()):e;return this.http.post(r,n,{version:"v3",params:t})}async updateNetworkCX2(e,t){let r=`networks/${e}`,n=t instanceof B?JSON.parse(t.toJSON()):t;return this.http.put(r,n,{version:"v3"})}async uploadCX2Network(e,t={}){let r={};if(t.visibility!==void 0&&(r.visibility=String(t.visibility)),t.folderId!==void 0&&(r.folderId=t.folderId),typeof globalThis.window>"u"){let u;try{u=ut();}catch{u=null;}if(u){let l=new u;if((f=>f&&typeof f=="object"&&typeof f.pipe=="function")(e))l.append("CXNetworkStream",e,{filename:"network.cx2",contentType:"application/json"});else if(typeof globalThis.Buffer<"u"&&globalThis.Buffer.isBuffer(e))l.append("CXNetworkStream",e,{filename:"network.cx2",contentType:"application/json"});else if(typeof e=="string")l.append("CXNetworkStream",globalThis.Buffer.from(e),{filename:"network.cx2",contentType:"application/json"});else if(typeof globalThis.Blob<"u"&&e instanceof globalThis.Blob){let f=await e.arrayBuffer();l.append("CXNetworkStream",globalThis.Buffer.from(f),{filename:"network.cx2",contentType:e.type||"application/json"});}else l.append("CXNetworkStream",globalThis.Buffer.from(String(e)),{filename:"network.cx2",contentType:"application/json"});let b={version:"v3",params:r,headers:l.getHeaders?.()||{},maxBodyLength:1/0};return this.http.post("networks",l,b)}if((l=>l&&typeof l=="object"&&typeof l.pipe=="function")(e))throw new Error("Readable stream upload requires 'form-data' package. Please install 'form-data' or pass a string/Buffer/Blob instead.")}let i=new FormData,o=typeof globalThis.File<"u",c=typeof globalThis.Blob<"u";if(o&&e instanceof globalThis.File)i.append("CXNetworkStream",e,e.name||"network.cx2");else if(c&&e instanceof globalThis.Blob)i.append("CXNetworkStream",e,"network.cx2");else if(typeof e=="string"){let u=new Blob([e],{type:"application/json"});i.append("CXNetworkStream",u,"network.cx2");}else if(typeof globalThis.Buffer<"u"&&globalThis.Buffer.isBuffer(e)){let u=new Blob([e],{type:"application/json"});i.append("CXNetworkStream",u,"network.cx2");}else {let u=new Blob([String(e)],{type:"application/json"});i.append("CXNetworkStream",u,"network.cx2");}let d={version:"v3",params:r};return t.onProgress&&(d.onUploadProgress=u=>{let p=Math.round(u.loaded*100/(u.total||1));t.onProgress(p);}),this.http.post("networks",i,d)}async uploadNetworkFile(e,t={}){let r={};return t.visibility!==void 0&&(r.visibility=t.visibility),t.folderId!==void 0&&(r.folderId=t.folderId),t.onProgress&&(r.onProgress=t.onProgress),this.uploadCX2Network(e,r)}async getNetworkMetadata(e){let t=`networks/${e}/metadata`;return this.http.get(t,{version:"v3"})}async updateNetworkMetadata(e,t){let r=`networks/${e}/metadata`;return this.http.put(r,t,{version:"v3"})}async getNetworkAspect(e,t,r={}){let n=new URLSearchParams;r.accesskey&&n.append("accesskey",r.accesskey);let i=`networks/${e}/aspects/${t}${n.toString()?`?${n.toString()}`:""}`;return this.http.get(i,{version:"v3"})}async deleteNetwork(e,t=false){let r=new URLSearchParams;r.append("permanent",t.toString());let n=`networks/${e}?${r.toString()}`;return this.http.delete(n,{version:"v3"})}};var J=class{constructor(e){this.http=e;this.v2Service=new W(e),this.v3Service=new z(e);}async getNetworkSummary(e,t={}){return this.v3Service.getNetworkSummary(e,t)}async updateNetworkSummary(e,t){let r=this.transformV3ToV2(t);return this.v2Service.updateNetworkSummary(e,r)}transformV3ToV2(e){let{properties:t,...r}=e,n,i=[];if(t)for(let[c,d]of Object.entries(t))c==="version"?n=this.convertValueToString(d.v):i.push({predicateString:c,value:this.convertValueToString(d.v),dataType:d.t});let o={...r,properties:i};return n!==void 0&&(o.version=n),o}convertValueToString(e){return Array.isArray(e)?e.map(t=>String(t)).join(","):String(e)}async getRawCX1Network(e,t={}){return this.v2Service.getRawCX1Network(e,t)}async getRawCX2Network(e,t={}){return this.v3Service.getRawCX2Network(e,t)}async deleteNetwork(e,t=false){return this.v3Service.deleteNetwork(e,t)}async createNetworkDOI(e){let t="admin/request",r={type:"DOI",networkId:e.networkId,properties:{contactEmail:e.contactEmail},isCertified:e.isCertified};return this.http.post(t,r,{version:"v2"})}async getAttributesOfSelectedNodes(e,t,r={}){return this.v3Service.getAttributesOfSelectedNodes(e,t,r)}async neighborhoodQuery(e,t,r,n,i=false){let o={};r!==void 0&&r===true&&(o.save="true");let c={searchString:t,searchDepth:1};if(n!==void 0&&(n.searchDepth!==void 0&&(c.searchDepth=n.searchDepth),n.edgeLimit!==void 0&&(c.edgeLimit=n.edgeLimit),n.errorWhenLimitIsOver!==void 0&&(c.errorWhenLimitIsOver=n.errorWhenLimitIsOver),n.directOnly!==void 0&&(c.directOnly=n.directOnly),n.nodeIds!=null&&(c.nodeIds=n.nodeIds)),i){let u=`search/network/${e}/query`;return this.http.post(u,c,{version:"v3",params:o})}let d=`search/network/${e}/query`;return this.http.post(d,c,{version:"v2",params:o})}async interConnectQuery(e,t,r,n,i=false){let o={};r!==void 0&&r===true&&(o.save="true");let c={searchString:t};if(n!==void 0&&(n.edgeLimit!==void 0&&(c.edgeLimit=n.edgeLimit),n.errorWhenLimitIsOver!==void 0&&(c.errorWhenLimitIsOver=n.errorWhenLimitIsOver),n.nodeIds!=null&&(c.nodeIds=n.nodeIds)),i){let u=`search/networks/${e}/interconnectquery`;return this.http.post(u,c,{version:"v3",params:o})}let d=`search/network/${e}/interconnectquery`;return this.http.post(d,c,{version:"v2",params:o})}async getNetworkPermissionsByUUIDs(e){return this.http.post("batch/network/permission",e,{version:"v2"})}async exportNetworks(e){return this.http.post("batch/network/export",e,{version:"v2"})}async moveNetworks(e,t){if(!Array.isArray(e))throw new Error("Invalid networkIds - must be an array");let r="batch/networks/move",n={targetFolder:t!==void 0?t:null,networks:e};return this.http.post(r,n,{version:"v3"})}async setNetworksVisibility(e,t){this.validateShareData(e);let r="batch/files/setvisibility",n={files:e,visibility:t};return this.http.post(r,n,{version:"v3"})}async getNetworkAccessKey(e){let t=`network/${e}/accesskey`;return this.http.get(t,{version:"v2"})}async getRandomEdges(e,t,r){if(t<=0)throw new Error("Value of parameter limit has to be greater than 0.");let n={size:t.toString(),method:"random"};r!==void 0&&(n.accesskey=r);let i=`networks/${e}/aspects/edges`;return this.http.get(i,{version:"v3",params:n})}validateShareData(e){for(let t of Object.keys(e.files))if(!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(t))throw new Error(`Invalid UUID format: ${t}`)}async getAspectElements(e,t,r,n){let i={};r!==void 0&&(i.size=r.toString()),n!==void 0&&(i.accesskey=n);let o=`networks/${e}/aspects/${t}`;return this.http.get(o,{version:"v3",params:i})}async getFilteredEdges(e,t,r,n,i,o,c,d){let u={};i!==void 0&&(u.size=i.toString()),o!==void 0&&(u.order=o),d!==void 0&&(u.accesskey=d),c!==void 0&&(u.format=c);let p={name:t,value:r,operator:n},l=`search/networks/${e}/edges`;return this.http.post(l,p,{version:"v3",params:u})}async getCX2MetaData(e,t){let r={};t!==void 0&&(r.accesskey=t);let n=`networks/${e}/aspects`;return this.http.get(n,{version:"v3",params:r})}async createNetworkFromRawCX2(e,t={}){return this.v3.createNetworkFromCX2(e,t)}async updateNetworkFromRawCX2(e,t){let r=`networks/${e}`;return this.http.put(r,t,{version:"v3"})}async setReadOnly(e,t){let r=`network/${e}/systemproperty`;return this.http.put(r,{readOnly:t},{version:"v2"})}get v2(){return this.v2Service}get v3(){return this.v3Service}};var K=class{constructor(e){this.http=e;}copyFile(e){if(e.type==="FOLDER")throw new Error("Folder copying is not supported. Only NETWORK and SHORTCUT types are allowed.");let t={};return e.accessKey!==void 0&&(t.accesskey=e.accessKey),this.http.post("files/copy",{fileId:e.fileId,type:e.type,targetId:e.targetId},{params:t,version:"v3"})}getCount(){return this.http.get("files/count",{version:"v3"})}getTrash(){return this.http.get("files/trash",{version:"v3"})}emptyTrash(){return this.http.delete("files/trash",{version:"v3"})}permanentlyDeleteFile(e){return this.http.delete(`files/trash/${e}`,{version:"v3"})}restoreFile(e,t,r){return this.http.post("files/trash/restore",{networks:e,folders:t,shortcuts:r},{version:"v3"})}_validateShareData(e){if(typeof e!="object"||e===null||e.files===void 0)throw new Error('Data must be an object with a "files" property');if(typeof e.files!="object"||e.files===null)throw new Error('The "files" property must be an object');let t=["NETWORK","FOLDER","SHORTCUT"];for(let[r,n]of Object.entries(e.files)){if(!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(r))throw new Error(`Invalid UUID format: ${r}`);if(!t.includes(n))throw new Error(`Invalid file type for ${r}: ${n}. Must be one of: ${t.join(", ")}`)}}_validateMemberData(e){for(let t of Object.keys(e.members))if(typeof t!="string"||!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(t))throw new Error(`Invalid UUID format: ${t}`)}updateMember(e){return this._validateShareData({files:e.files}),this._validateMemberData({members:e.members}),this.http.post("files/sharing/members",{files:e.files,members:e.members},{version:"v3"})}listMembers(e){return this._validateShareData({files:e}),this.http.post("files/sharing/members/list",e,{version:"v3"})}transferOwnership(e){return this.http.post("files/sharing/transfer",e,{version:"v3"})}listShares(e){let t={};return e!==void 0&&(t.limit=e),this.http.get("files/sharing/list",{params:t,version:"v3"})}share(e){return this._validateShareData({files:e}),this.http.post("files/sharing/share",{files:e},{version:"v3"})}unshare(e){return this._validateShareData({files:e}),this.http.post("files/sharing/unshare",{files:e},{version:"v3"})}getFolders(e){let t={};return e!==void 0&&(t.limit=e),this.http.get("files/folders",{params:t,version:"v3"})}createFolder(e,t){return this.http.post("files/folders",{name:e,parent:t},{version:"v3"})}getFolder(e,t){let r={};return t!==void 0&&(r.accesskey=t),this.http.get(`files/folders/${e}`,{params:r,version:"v3"})}updateFolder(e,t){return this.http.put(`files/folders/${e}`,t,{version:"v3"})}deleteFolder(e){return this.http.delete(`files/folders/${e}`,{version:"v3"})}getFolderCount(e,t){let r={};return t!==void 0&&(r.accesskey=t),this.http.get(`files/folders/${e}/count`,{params:r,version:"v3"})}getFolderList(e,t,r,n){let i={};return t!==void 0&&(i.accesskey=t),r!==void 0&&(i.format=r),n!==void 0&&(i.type=n),this.http.get(`files/folders/${e}/list`,{params:i,version:"v3"})}getFolderAccessKey(e){let t=`files/folders/${e}/accesskey`;return this.http.get(t,{version:"v3"})}getShortcuts(e){let t={};return e!==void 0&&(t.limit=e),this.http.get("files/shortcuts",{params:t,version:"v3"})}createShortcut(e){return this.http.post("files/shortcuts",e,{version:"v3"})}getShortcut(e,t){let r={};return t!==void 0&&(r.accesskey=t),this.http.get(`files/shortcuts/${e}`,{params:r,version:"v3"})}updateShortcut(e,t){return this.http.put(`files/shortcuts/${e}`,{...t,parent:t.parent??null},{version:"v3"})}deleteShortcut(e){return this.http.delete(`files/shortcuts/${e}`,{version:"v3"})}setVisibility(e){return this.http.post("batch/files/setvisibility",{files:e.files,visibility:e.visibility},{version:"v3"})}searchFiles(e){let{visibility:t,start:r,size:n,...i}=e,o={visibility:t};return r!==void 0&&(o.start=String(r)),n!==void 0&&(o.size=String(n)),this.http.post("search/files",i,{version:"v3",params:o})}};var G=class{constructor(e){this.http=e;}async createCyWebWorkspace(e){return this.http.post("workspaces",e,{version:"v3"})}async getCyWebWorkspace(e){let t=`workspaces/${e}`;return this.http.get(t,{version:"v3"})}async deleteCyWebWorkspace(e){let t=`workspaces/${e}`;return this.http.delete(t,{version:"v3"})}async updateCyWebWorkspace(e,t){let r=`workspaces/${e}`;return this.http.put(r,t,{version:"v3"})}async updateCyWebWorkspaceName(e,t){let r=`workspaces/${e}/name`;return this.http.put(r,{name:t},{version:"v3"})}async updateCyWebWorkspaceNetworks(e,t){let r=`workspaces/${e}/networkids`;return this.http.put(r,t,{version:"v3"})}async getUserCyWebWorkspaces(){let t=`users/${(await this.http.get("user",{params:{valid:true}})).externalId}/workspaces`;return this.http.get(t,{version:"v3"})}};var Q=class{constructor(e){this.http=e;}async authenticate(){let e=this.http.getAuthType();if(!e)throw new Error("Authentication parameters are missing in NDEx client.");if(e===k.BASIC){let t="user",r={valid:true};return this.http.get(t,{params:r})}else if(e===k.OAUTH){let t=this.http.getIdToken();if(!t)throw new Error("OAuth ID token is missing.");let r="users/signin",n={idToken:t};return this.http.post(r,n,{version:"v3"})}throw new Error(`Unsupported authentication type: ${e}`)}async getCurrentUser(){if(!this.http.getAuthType())throw new Error("Authentication parameters are missing in NDEx client.");let t="user",r={valid:true};return this.http.get(t,{params:r})}async updateCurrentUser(e){if(!e.externalId)throw new Error("User uuid is required in userUpdate object");let t=`user/${e.externalId}`;return this.http.put(t,e)}async requestPasswordReset(e){return this.http.post("user/forgot-password",{email:e})}async resetPassword(e,t){let r=`user/${e}/password`,n={headers:{"Content-Type":"text/plain"}};return this.http.put(r,t,n)}async getUser(e){let t=`user/${e}`;return this.http.get(t)}async getUserByNameOrEmail(e){let t=new URLSearchParams;"username"in e?t.append("username",e.username):"email"in e&&t.append("email",e.email);let r=`user?${t.toString()}`;return this.http.get(r)}async getUsersByUUIDs(e){return this.http.post("batch/user",e)}async searchUsers(e,t,r){let n={};t!==void 0&&(n.start=t.toString()),r!==void 0&&(n.limit=r.toString());let i={searchString:e};return this.http.post("search/user",i,{params:n})}async getAccountPageNetworks(e,t,r){let n={};t!==void 0&&(n.offset=t.toString()),r!==void 0&&(n.limit=r.toString());let i=`user/${e}/networksummary`;return this.http.get(i,{params:n})}async getUserHomeContent(e,t="update"){let r={format:t},n=`users/${e}/home`;return this.http.get(n,{params:r,version:"v3"})}async deleteUserAccount(e){let t=`user/${e}`;return this.http.delete(t)}};var Z=class{constructor(){}};function Y(s,e){return function(){return s.apply(e,arguments)}}var{toString:Yt}=Object.prototype,{getPrototypeOf:Xe}=Object,{iterator:we,toStringTag:dt}=Symbol,ve=(s=>e=>{let t=Yt.call(e);return s[t]||(s[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),T=s=>(s=s.toLowerCase(),e=>ve(e)===s),Se=s=>e=>typeof e===s,{isArray:j}=Array,ee=Se("undefined");function te(s){return s!==null&&!ee(s)&&s.constructor!==null&&!ee(s.constructor)&&C(s.constructor.isBuffer)&&s.constructor.isBuffer(s)}var lt=T("ArrayBuffer");function er(s){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(s):e=s&&s.buffer&&lt(s.buffer),e}var tr=Se("string"),C=Se("function"),ft=Se("number"),re=s=>s!==null&&typeof s=="object",rr=s=>s===true||s===false,be=s=>{if(ve(s)!=="object")return false;let e=Xe(s);return (e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(dt in s)&&!(we in s)},sr=s=>{if(!re(s)||te(s))return false;try{return Object.keys(s).length===0&&Object.getPrototypeOf(s)===Object.prototype}catch{return false}},nr=T("Date"),ir=T("File"),or=T("Blob"),ar=T("FileList"),cr=s=>re(s)&&C(s.pipe),ur=s=>{let e;return s&&(typeof FormData=="function"&&s instanceof FormData||C(s.append)&&((e=ve(s))==="formdata"||e==="object"&&C(s.toString)&&s.toString()==="[object FormData]"))},pr=T("URLSearchParams"),[dr,lr,fr,mr]=["ReadableStream","Request","Response","Headers"].map(T),hr=s=>s.trim?s.trim():s.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function se(s,e,{allOwnKeys:t=false}={}){if(s===null||typeof s>"u")return;let r,n;if(typeof s!="object"&&(s=[s]),j(s))for(r=0,n=s.length;r<n;r++)e.call(null,s[r],r,s);else {if(te(s))return;let i=t?Object.getOwnPropertyNames(s):Object.keys(s),o=i.length,c;for(r=0;r<o;r++)c=i[r],e.call(null,s[c],c,s);}}function mt(s,e){if(te(s))return null;e=e.toLowerCase();let t=Object.keys(s),r=t.length,n;for(;r-- >0;)if(n=t[r],e===n.toLowerCase())return n;return null}var X=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:globalThis,ht=s=>!ee(s)&&s!==X;function Be(){let{caseless:s}=ht(this)&&this||{},e={},t=(r,n)=>{let i=s&&mt(e,n)||n;be(e[i])&&be(r)?e[i]=Be(e[i],r):be(r)?e[i]=Be({},r):j(r)?e[i]=r.slice():e[i]=r;};for(let r=0,n=arguments.length;r<n;r++)arguments[r]&&se(arguments[r],t);return e}var gr=(s,e,t,{allOwnKeys:r}={})=>(se(e,(n,i)=>{t&&C(n)?s[i]=Y(n,t):s[i]=n;},{allOwnKeys:r}),s),yr=s=>(s.charCodeAt(0)===65279&&(s=s.slice(1)),s),br=(s,e,t,r)=>{s.prototype=Object.create(e.prototype,r),s.prototype.constructor=s,Object.defineProperty(s,"super",{value:e.prototype}),t&&Object.assign(s.prototype,t);},wr=(s,e,t,r)=>{let n,i,o,c={};if(e=e||{},s==null)return e;do{for(n=Object.getOwnPropertyNames(s),i=n.length;i-- >0;)o=n[i],(!r||r(o,s,e))&&!c[o]&&(e[o]=s[o],c[o]=true);s=t!==false&&Xe(s);}while(s&&(!t||t(s,e))&&s!==Object.prototype);return e},vr=(s,e,t)=>{s=String(s),(t===void 0||t>s.length)&&(t=s.length),t-=e.length;let r=s.indexOf(e,t);return r!==-1&&r===t},Sr=s=>{if(!s)return null;if(j(s))return s;let e=s.length;if(!ft(e))return null;let t=new Array(e);for(;e-- >0;)t[e]=s[e];return t},xr=(s=>e=>s&&e instanceof s)(typeof Uint8Array<"u"&&Xe(Uint8Array)),Nr=(s,e)=>{let r=(s&&s[we]).call(s),n;for(;(n=r.next())&&!n.done;){let i=n.value;e.call(s,i[0],i[1]);}},Er=(s,e)=>{let t,r=[];for(;(t=s.exec(e))!==null;)r.push(t);return r},kr=T("HTMLFormElement"),Rr=s=>s.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,r,n){return r.toUpperCase()+n}),pt=(({hasOwnProperty:s})=>(e,t)=>s.call(e,t))(Object.prototype),Cr=T("RegExp"),gt=(s,e)=>{let t=Object.getOwnPropertyDescriptors(s),r={};se(t,(n,i)=>{let o;(o=e(n,i,s))!==false&&(r[i]=o||n);}),Object.defineProperties(s,r);},Tr=s=>{gt(s,(e,t)=>{if(C(s)&&["arguments","caller","callee"].indexOf(t)!==-1)return false;let r=s[t];if(C(r)){if(e.enumerable=false,"writable"in e){e.writable=false;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")});}});},Pr=(s,e)=>{let t={},r=n=>{n.forEach(i=>{t[i]=true;});};return j(s)?r(s):r(String(s).split(e)),t},Ar=()=>{},Dr=(s,e)=>s!=null&&Number.isFinite(s=+s)?s:e;function Or(s){return !!(s&&C(s.append)&&s[dt]==="FormData"&&s[we])}var Ur=s=>{let e=new Array(10),t=(r,n)=>{if(re(r)){if(e.indexOf(r)>=0)return;if(te(r))return r;if(!("toJSON"in r)){e[n]=r;let i=j(r)?[]:{};return se(r,(o,c)=>{let d=t(o,n+1);!ee(d)&&(i[c]=d);}),e[n]=void 0,i}}return r};return t(s,0)},Ir=T("AsyncFunction"),Fr=s=>s&&(re(s)||C(s))&&C(s.then)&&C(s.catch),yt=((s,e)=>s?setImmediate:e?((t,r)=>(X.addEventListener("message",({source:n,data:i})=>{n===X&&i===t&&r.length&&r.shift()();},false),n=>{r.push(n),X.postMessage(t,"*");}))(`axios@${Math.random()}`,[]):t=>setTimeout(t))(typeof setImmediate=="function",C(X.postMessage)),Lr=typeof queueMicrotask<"u"?queueMicrotask.bind(X):typeof process<"u"&&process.nextTick||yt,Br=s=>s!=null&&C(s[we]),a={isArray:j,isArrayBuffer:lt,isBuffer:te,isFormData:ur,isArrayBufferView:er,isString:tr,isNumber:ft,isBoolean:rr,isObject:re,isPlainObject:be,isEmptyObject:sr,isReadableStream:dr,isRequest:lr,isResponse:fr,isHeaders:mr,isUndefined:ee,isDate:nr,isFile:ir,isBlob:or,isRegExp:Cr,isFunction:C,isStream:cr,isURLSearchParams:pr,isTypedArray:xr,isFileList:ar,forEach:se,merge:Be,extend:gr,trim:hr,stripBOM:yr,inherits:br,toFlatObject:wr,kindOf:ve,kindOfTest:T,endsWith:vr,toArray:Sr,forEachEntry:Nr,matchAll:Er,isHTMLForm:kr,hasOwnProperty:pt,hasOwnProp:pt,reduceDescriptors:gt,freezeMethods:Tr,toObjectSet:Pr,toCamelCase:Rr,noop:Ar,toFiniteNumber:Dr,findKey:mt,global:X,isContextDefined:ht,isSpecCompliantForm:Or,toJSONObject:Ur,isAsyncFn:Ir,isThenable:Fr,setImmediate:yt,asap:Lr,isIterable:Br};function _(s,e,t,r,n){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=s,this.name="AxiosError",e&&(this.code=e),t&&(this.config=t),r&&(this.request=r),n&&(this.response=n,this.status=n.status?n.status:null);}a.inherits(_,Error,{toJSON:function(){return {message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:a.toJSONObject(this.config),code:this.code,status:this.status}}});var bt=_.prototype,wt={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(s=>{wt[s]={value:s};});Object.defineProperties(_,wt);Object.defineProperty(bt,"isAxiosError",{value:true});_.from=(s,e,t,r,n,i)=>{let o=Object.create(bt);return a.toFlatObject(s,o,function(d){return d!==Error.prototype},c=>c!=="isAxiosError"),_.call(o,s.message,e,t,r,n),o.cause=s,o.name=s.name,i&&Object.assign(o,i),o};var h=_;var xe=null;function je(s){return a.isPlainObject(s)||a.isArray(s)}function St(s){return a.endsWith(s,"[]")?s.slice(0,-2):s}function vt(s,e,t){return s?s.concat(e).map(function(n,i){return n=St(n),!t&&i?"["+n+"]":n}).join(t?".":""):e}function Xr(s){return a.isArray(s)&&!s.some(je)}var jr=a.toFlatObject(a,{},null,function(e){return /^is[A-Z]/.test(e)});function _r(s,e,t){if(!a.isObject(s))throw new TypeError("target must be an object");e=e||new(FormData),t=a.toFlatObject(t,{metaTokens:true,dots:false,indexes:false},false,function(g,m){return !a.isUndefined(m[g])});let r=t.metaTokens,n=t.visitor||p,i=t.dots,o=t.indexes,d=(t.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(e);if(!a.isFunction(n))throw new TypeError("visitor must be a function");function u(f){if(f===null)return "";if(a.isDate(f))return f.toISOString();if(a.isBoolean(f))return f.toString();if(!d&&a.isBlob(f))throw new h("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(f)||a.isTypedArray(f)?d&&typeof Blob=="function"?new Blob([f]):Buffer.from(f):f}function p(f,g,m){let v=f;if(f&&!m&&typeof f=="object"){if(a.endsWith(g,"{}"))g=r?g:g.slice(0,-2),f=JSON.stringify(f);else if(a.isArray(f)&&Xr(f)||(a.isFileList(f)||a.endsWith(g,"[]"))&&(v=a.toArray(f)))return g=St(g),v.forEach(function(E,U){!(a.isUndefined(E)||E===null)&&e.append(o===true?vt([g],U,i):o===null?g:g+"[]",u(E));}),false}return je(f)?true:(e.append(vt(m,g,i),u(f)),false)}let l=[],y=Object.assign(jr,{defaultVisitor:p,convertValue:u,isVisitable:je});function b(f,g){if(!a.isUndefined(f)){if(l.indexOf(f)!==-1)throw Error("Circular reference detected in "+g.join("."));l.push(f),a.forEach(f,function(v,x){(!(a.isUndefined(v)||v===null)&&n.call(e,v,a.isString(x)?x.trim():x,g,y))===true&&b(v,g?g.concat(x):[x]);}),l.pop();}}if(!a.isObject(s))throw new TypeError("data must be an object");return b(s),e}var F=_r;function xt(s){let e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(s).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function Nt(s,e){this._pairs=[],s&&F(s,this,e);}var Et=Nt.prototype;Et.append=function(e,t){this._pairs.push([e,t]);};Et.toString=function(e){let t=e?function(r){return e.call(this,r,xt)}:xt;return this._pairs.map(function(n){return t(n[0])+"="+t(n[1])},"").join("&")};var Ne=Nt;function Vr(s){return encodeURIComponent(s).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function ne(s,e,t){if(!e)return s;let r=t&&t.encode||Vr;a.isFunction(t)&&(t={serialize:t});let n=t&&t.serialize,i;if(n?i=n(e,t):i=a.isURLSearchParams(e)?e.toString():new Ne(e,t).toString(r),i){let o=s.indexOf("#");o!==-1&&(s=s.slice(0,o)),s+=(s.indexOf("?")===-1?"?":"&")+i;}return s}var _e=class{constructor(){this.handlers=[];}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:r?r.synchronous:false,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null);}clear(){this.handlers&&(this.handlers=[]);}forEach(e){a.forEach(this.handlers,function(r){r!==null&&e(r);});}},Ve=_e;var Ee={silentJSONParsing:true,forcedJSONParsing:true,clarifyTimeoutError:false};var kt=typeof URLSearchParams<"u"?URLSearchParams:Ne;var Rt=typeof FormData<"u"?FormData:null;var Ct=typeof Blob<"u"?Blob:null;var Tt={isBrowser:true,classes:{URLSearchParams:kt,FormData:Rt,Blob:Ct},protocols:["http","https","file","blob","url","data"]};var qe={};Qt(qe,{hasBrowserEnv:()=>Me,hasStandardBrowserEnv:()=>$r,hasStandardBrowserWebWorkerEnv:()=>Mr,navigator:()=>$e,origin:()=>qr});var Me=typeof window<"u"&&typeof document<"u",$e=typeof navigator=="object"&&navigator||void 0,$r=Me&&(!$e||["ReactNative","NativeScript","NS"].indexOf($e.product)<0),Mr=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",qr=Me&&window.location.href||"http://localhost";var w={...qe,...Tt};function He(s,e){return F(s,new w.classes.URLSearchParams,{visitor:function(t,r,n,i){return w.isNode&&a.isBuffer(t)?(this.append(r,t.toString("base64")),false):i.defaultVisitor.apply(this,arguments)},...e})}function Hr(s){return a.matchAll(/\w+|\[(\w*)]/g,s).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Wr(s){let e={},t=Object.keys(s),r,n=t.length,i;for(r=0;r<n;r++)i=t[r],e[i]=s[i];return e}function zr(s){function e(t,r,n,i){let o=t[i++];if(o==="__proto__")return true;let c=Number.isFinite(+o),d=i>=t.length;return o=!o&&a.isArray(n)?n.length:o,d?(a.hasOwnProp(n,o)?n[o]=[n[o],r]:n[o]=r,!c):((!n[o]||!a.isObject(n[o]))&&(n[o]=[]),e(t,r,n[o],i)&&a.isArray(n[o])&&(n[o]=Wr(n[o])),!c)}if(a.isFormData(s)&&a.isFunction(s.entries)){let t={};return a.forEachEntry(s,(r,n)=>{e(Hr(r),n,t,0);}),t}return null}var ke=zr;function Jr(s,e,t){if(a.isString(s))try{return (e||JSON.parse)(s),a.trim(s)}catch(r){if(r.name!=="SyntaxError")throw r}return (t||JSON.stringify)(s)}var We={transitional:Ee,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){let r=t.getContentType()||"",n=r.indexOf("application/json")>-1,i=a.isObject(e);if(i&&a.isHTMLForm(e)&&(e=new FormData(e)),a.isFormData(e))return n?JSON.stringify(ke(e)):e;if(a.isArrayBuffer(e)||a.isBuffer(e)||a.isStream(e)||a.isFile(e)||a.isBlob(e)||a.isReadableStream(e))return e;if(a.isArrayBufferView(e))return e.buffer;if(a.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",false),e.toString();let c;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return He(e,this.formSerializer).toString();if((c=a.isFileList(e))||r.indexOf("multipart/form-data")>-1){let d=this.env&&this.env.FormData;return F(c?{"files[]":e}:e,d&&new d,this.formSerializer)}}return i||n?(t.setContentType("application/json",false),Jr(e)):e}],transformResponse:[function(e){let t=this.transitional||We.transitional,r=t&&t.forcedJSONParsing,n=this.responseType==="json";if(a.isResponse(e)||a.isReadableStream(e))return e;if(e&&a.isString(e)&&(r&&!this.responseType||n)){let o=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e)}catch(c){if(o)throw c.name==="SyntaxError"?h.from(c,h.ERR_BAD_RESPONSE,this,null,this.response):c}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:w.classes.FormData,Blob:w.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a.forEach(["delete","get","head","post","put","patch"],s=>{We.headers[s]={};});var V=We;var Kr=a.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Pt=s=>{let e={},t,r,n;return s&&s.split(`
3
3
  `).forEach(function(o){n=o.indexOf(":"),t=o.substring(0,n).trim().toLowerCase(),r=o.substring(n+1).trim(),!(!t||e[t]&&Kr[t])&&(t==="set-cookie"?e[t]?e[t].push(r):e[t]=[r]:e[t]=e[t]?e[t]+", "+r:r);}),e};var At=Symbol("internals");function ie(s){return s&&String(s).trim().toLowerCase()}function Re(s){return s===false||s==null?s:a.isArray(s)?s.map(Re):String(s)}function Gr(s){let e=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,r;for(;r=t.exec(s);)e[r[1]]=r[2];return e}var Qr=s=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(s.trim());function ze(s,e,t,r,n){if(a.isFunction(r))return r.call(this,e,t);if(n&&(e=t),!!a.isString(e)){if(a.isString(r))return e.indexOf(r)!==-1;if(a.isRegExp(r))return r.test(e)}}function Zr(s){return s.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,r)=>t.toUpperCase()+r)}function Yr(s,e){let t=a.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(s,r+t,{value:function(n,i,o){return this[r].call(this,e,n,i,o)},configurable:true});});}var $=class{constructor(e){e&&this.set(e);}set(e,t,r){let n=this;function i(c,d,u){let p=ie(d);if(!p)throw new Error("header name must be a non-empty string");let l=a.findKey(n,p);(!l||n[l]===void 0||u===true||u===void 0&&n[l]!==false)&&(n[l||d]=Re(c));}let o=(c,d)=>a.forEach(c,(u,p)=>i(u,p,d));if(a.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if(a.isString(e)&&(e=e.trim())&&!Qr(e))o(Pt(e),t);else if(a.isObject(e)&&a.isIterable(e)){let c={},d,u;for(let p of e){if(!a.isArray(p))throw TypeError("Object iterator must return a key-value pair");c[u=p[0]]=(d=c[u])?a.isArray(d)?[...d,p[1]]:[d,p[1]]:p[1];}o(c,t);}else e!=null&&i(t,e,r);return this}get(e,t){if(e=ie(e),e){let r=a.findKey(this,e);if(r){let n=this[r];if(!t)return n;if(t===true)return Gr(n);if(a.isFunction(t))return t.call(this,n,r);if(a.isRegExp(t))return t.exec(n);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=ie(e),e){let r=a.findKey(this,e);return !!(r&&this[r]!==void 0&&(!t||ze(this,this[r],r,t)))}return false}delete(e,t){let r=this,n=false;function i(o){if(o=ie(o),o){let c=a.findKey(r,o);c&&(!t||ze(r,r[c],c,t))&&(delete r[c],n=true);}}return a.isArray(e)?e.forEach(i):i(e),n}clear(e){let t=Object.keys(this),r=t.length,n=false;for(;r--;){let i=t[r];(!e||ze(this,this[i],i,e,true))&&(delete this[i],n=true);}return n}normalize(e){let t=this,r={};return a.forEach(this,(n,i)=>{let o=a.findKey(r,i);if(o){t[o]=Re(n),delete t[i];return}let c=e?Zr(i):String(i).trim();c!==i&&delete t[i],t[c]=Re(n),r[c]=true;}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return a.forEach(this,(r,n)=>{r!=null&&r!==false&&(t[n]=e&&a.isArray(r)?r.join(", "):r);}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join(`
4
4
  `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return "AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){let r=new this(e);return t.forEach(n=>r.set(n)),r}static accessor(e){let r=(this[At]=this[At]={accessors:{}}).accessors,n=this.prototype;function i(o){let c=ie(o);r[c]||(Yr(n,o),r[c]=true);}return a.isArray(e)?e.forEach(i):i(e),this}};$.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);a.reduceDescriptors($.prototype,({value:s},e)=>{let t=e[0].toUpperCase()+e.slice(1);return {get:()=>s,set(r){this[t]=r;}}});a.freezeMethods($);var N=$;function oe(s,e){let t=this||V,r=e||t,n=N.from(r.headers),i=r.data;return a.forEach(s,function(c){i=c.call(t,i,n.normalize(),e?e.status:void 0);}),n.normalize(),i}function ae(s){return !!(s&&s.__CANCEL__)}function Dt(s,e,t){h.call(this,s??"canceled",h.ERR_CANCELED,e,t),this.name="CanceledError";}a.inherits(Dt,h,{__CANCEL__:true});var D=Dt;function ce(s,e,t){let r=t.config.validateStatus;!t.status||!r||r(t.status)?s(t):e(new h("Request failed with status code "+t.status,[h.ERR_BAD_REQUEST,h.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t));}function Je(s){let e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(s);return e&&e[1]||""}function es(s,e){s=s||10;let t=new Array(s),r=new Array(s),n=0,i=0,o;return e=e!==void 0?e:1e3,function(d){let u=Date.now(),p=r[i];o||(o=u),t[n]=d,r[n]=u;let l=i,y=0;for(;l!==n;)y+=t[l++],l=l%s;if(n=(n+1)%s,n===i&&(i=(i+1)%s),u-o<e)return;let b=p&&u-p;return b?Math.round(y*1e3/b):void 0}}var Ot=es;function ts(s,e){let t=0,r=1e3/e,n,i,o=(u,p=Date.now())=>{t=p,n=null,i&&(clearTimeout(i),i=null),s(...u);};return [(...u)=>{let p=Date.now(),l=p-t;l>=r?o(u,p):(n=u,i||(i=setTimeout(()=>{i=null,o(n);},r-l)));},()=>n&&o(n)]}var Ut=ts;var M=(s,e,t=3)=>{let r=0,n=Ot(50,250);return Ut(i=>{let o=i.loaded,c=i.lengthComputable?i.total:void 0,d=o-r,u=n(d),p=o<=c;r=o;let l={loaded:o,total:c,progress:c?o/c:void 0,bytes:d,rate:u||void 0,estimated:u&&c&&p?(c-o)/u:void 0,event:i,lengthComputable:c!=null,[e?"download":"upload"]:true};s(l);},t)},Ke=(s,e)=>{let t=s!=null;return [r=>e[0]({lengthComputable:t,total:s,loaded:r}),e[1]]},Ge=s=>(...e)=>a.asap(()=>s(...e));var It=w.hasStandardBrowserEnv?((s,e)=>t=>(t=new URL(t,w.origin),s.protocol===t.protocol&&s.host===t.host&&(e||s.port===t.port)))(new URL(w.origin),w.navigator&&/(msie|trident)/i.test(w.navigator.userAgent)):()=>true;var Ft=w.hasStandardBrowserEnv?{write(s,e,t,r,n,i){let o=[s+"="+encodeURIComponent(e)];a.isNumber(t)&&o.push("expires="+new Date(t).toGMTString()),a.isString(r)&&o.push("path="+r),a.isString(n)&&o.push("domain="+n),i===true&&o.push("secure"),document.cookie=o.join("; ");},read(s){let e=document.cookie.match(new RegExp("(^|;\\s*)("+s+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(s){this.write(s,"",Date.now()-864e5);}}:{write(){},read(){return null},remove(){}};function Qe(s){return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(s)}function Ze(s,e){return e?s.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):s}function ue(s,e,t){let r=!Qe(e);return s&&(r||t==false)?Ze(s,e):e}var Lt=s=>s instanceof N?{...s}:s;function P(s,e){e=e||{};let t={};function r(u,p,l,y){return a.isPlainObject(u)&&a.isPlainObject(p)?a.merge.call({caseless:y},u,p):a.isPlainObject(p)?a.merge({},p):a.isArray(p)?p.slice():p}function n(u,p,l,y){if(a.isUndefined(p)){if(!a.isUndefined(u))return r(void 0,u,l,y)}else return r(u,p,l,y)}function i(u,p){if(!a.isUndefined(p))return r(void 0,p)}function o(u,p){if(a.isUndefined(p)){if(!a.isUndefined(u))return r(void 0,u)}else return r(void 0,p)}function c(u,p,l){if(l in e)return r(u,p);if(l in s)return r(void 0,u)}let d={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:c,headers:(u,p,l)=>n(Lt(u),Lt(p),l,true)};return a.forEach(Object.keys({...s,...e}),function(p){let l=d[p]||n,y=l(s[p],e[p],p);a.isUndefined(y)&&l!==c||(t[p]=y);}),t}var Ce=s=>{let e=P({},s),{data:t,withXSRFToken:r,xsrfHeaderName:n,xsrfCookieName:i,headers:o,auth:c}=e;e.headers=o=N.from(o),e.url=ne(ue(e.baseURL,e.url,e.allowAbsoluteUrls),s.params,s.paramsSerializer),c&&o.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")));let d;if(a.isFormData(t)){if(w.hasStandardBrowserEnv||w.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((d=o.getContentType())!==false){let[u,...p]=d?d.split(";").map(l=>l.trim()).filter(Boolean):[];o.setContentType([u||"multipart/form-data",...p].join("; "));}}if(w.hasStandardBrowserEnv&&(r&&a.isFunction(r)&&(r=r(e)),r||r!==false&&It(e.url))){let u=n&&i&&Ft.read(i);u&&o.set(n,u);}return e};var rs=typeof XMLHttpRequest<"u",Bt=rs&&function(s){return new Promise(function(t,r){let n=Ce(s),i=n.data,o=N.from(n.headers).normalize(),{responseType:c,onUploadProgress:d,onDownloadProgress:u}=n,p,l,y,b,f;function g(){b&&b(),f&&f(),n.cancelToken&&n.cancelToken.unsubscribe(p),n.signal&&n.signal.removeEventListener("abort",p);}let m=new XMLHttpRequest;m.open(n.method.toUpperCase(),n.url,true),m.timeout=n.timeout;function v(){if(!m)return;let E=N.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders()),R={data:!c||c==="text"||c==="json"?m.responseText:m.response,status:m.status,statusText:m.statusText,headers:E,config:s,request:m};ce(function(L){t(L),g();},function(L){r(L),g();},R),m=null;}"onloadend"in m?m.onloadend=v:m.onreadystatechange=function(){!m||m.readyState!==4||m.status===0&&!(m.responseURL&&m.responseURL.indexOf("file:")===0)||setTimeout(v);},m.onabort=function(){m&&(r(new h("Request aborted",h.ECONNABORTED,s,m)),m=null);},m.onerror=function(){r(new h("Network Error",h.ERR_NETWORK,s,m)),m=null;},m.ontimeout=function(){let U=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded",R=n.transitional||Ee;n.timeoutErrorMessage&&(U=n.timeoutErrorMessage),r(new h(U,R.clarifyTimeoutError?h.ETIMEDOUT:h.ECONNABORTED,s,m)),m=null;},i===void 0&&o.setContentType(null),"setRequestHeader"in m&&a.forEach(o.toJSON(),function(U,R){m.setRequestHeader(R,U);}),a.isUndefined(n.withCredentials)||(m.withCredentials=!!n.withCredentials),c&&c!=="json"&&(m.responseType=n.responseType),u&&([y,f]=M(u,true),m.addEventListener("progress",y)),d&&m.upload&&([l,b]=M(d),m.upload.addEventListener("progress",l),m.upload.addEventListener("loadend",b)),(n.cancelToken||n.signal)&&(p=E=>{m&&(r(!E||E.type?new D(null,s,m):E),m.abort(),m=null);},n.cancelToken&&n.cancelToken.subscribe(p),n.signal&&(n.signal.aborted?p():n.signal.addEventListener("abort",p)));let x=Je(n.url);if(x&&w.protocols.indexOf(x)===-1){r(new h("Unsupported protocol "+x+":",h.ERR_BAD_REQUEST,s));return}m.send(i||null);})};var ss=(s,e)=>{let{length:t}=s=s?s.filter(Boolean):[];if(e||t){let r=new AbortController,n,i=function(u){if(!n){n=true,c();let p=u instanceof Error?u:this.reason;r.abort(p instanceof h?p:new D(p instanceof Error?p.message:p));}},o=e&&setTimeout(()=>{o=null,i(new h(`timeout ${e} of ms exceeded`,h.ETIMEDOUT));},e),c=()=>{s&&(o&&clearTimeout(o),o=null,s.forEach(u=>{u.unsubscribe?u.unsubscribe(i):u.removeEventListener("abort",i);}),s=null);};s.forEach(u=>u.addEventListener("abort",i));let{signal:d}=r;return d.unsubscribe=()=>a.asap(c),d}},Xt=ss;var ns=function*(s,e){let t=s.byteLength;if(t<e){yield s;return}let r=0,n;for(;r<t;)n=r+e,yield s.slice(r,n),r=n;},is=async function*(s,e){for await(let t of os(s))yield*ns(t,e);},os=async function*(s){if(s[Symbol.asyncIterator]){yield*s;return}let e=s.getReader();try{for(;;){let{done:t,value:r}=await e.read();if(t)break;yield r;}}finally{await e.cancel();}},Ye=(s,e,t,r)=>{let n=is(s,e),i=0,o,c=d=>{o||(o=true,r&&r(d));};return new ReadableStream({async pull(d){try{let{done:u,value:p}=await n.next();if(u){c(),d.close();return}let l=p.byteLength;if(t){let y=i+=l;t(y);}d.enqueue(new Uint8Array(p));}catch(u){throw c(u),u}},cancel(d){return c(d),n.return()}},{highWaterMark:2})};var Pe=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",_t=Pe&&typeof ReadableStream=="function",as=Pe&&(typeof TextEncoder=="function"?(s=>e=>s.encode(e))(new TextEncoder):async s=>new Uint8Array(await new Response(s).arrayBuffer())),Vt=(s,...e)=>{try{return !!s(...e)}catch{return false}},cs=_t&&Vt(()=>{let s=!1,e=new Request(w.origin,{body:new ReadableStream,method:"POST",get duplex(){return s=!0,"half"}}).headers.has("Content-Type");return s&&!e}),jt=64*1024,et=_t&&Vt(()=>a.isReadableStream(new Response("").body)),Te={stream:et&&(s=>s.body)};Pe&&(s=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!Te[e]&&(Te[e]=a.isFunction(s[e])?t=>t[e]():(t,r)=>{throw new h(`Response type '${e}' is not supported`,h.ERR_NOT_SUPPORT,r)});});})(new Response);var us=async s=>{if(s==null)return 0;if(a.isBlob(s))return s.size;if(a.isSpecCompliantForm(s))return (await new Request(w.origin,{method:"POST",body:s}).arrayBuffer()).byteLength;if(a.isArrayBufferView(s)||a.isArrayBuffer(s))return s.byteLength;if(a.isURLSearchParams(s)&&(s=s+""),a.isString(s))return (await as(s)).byteLength},ps=async(s,e)=>{let t=a.toFiniteNumber(s.getContentLength());return t??us(e)},$t=Pe&&(async s=>{let{url:e,method:t,data:r,signal:n,cancelToken:i,timeout:o,onDownloadProgress:c,onUploadProgress:d,responseType:u,headers:p,withCredentials:l="same-origin",fetchOptions:y}=Ce(s);u=u?(u+"").toLowerCase():"text";let b=Xt([n,i&&i.toAbortSignal()],o),f,g=b&&b.unsubscribe&&(()=>{b.unsubscribe();}),m;try{if(d&&cs&&t!=="get"&&t!=="head"&&(m=await ps(p,r))!==0){let R=new Request(e,{method:"POST",body:r,duplex:"half"}),I;if(a.isFormData(r)&&(I=R.headers.get("content-type"))&&p.setContentType(I),R.body){let[L,le]=Ke(m,M(Ge(d)));r=Ye(R.body,jt,L,le);}}a.isString(l)||(l=l?"include":"omit");let v="credentials"in Request.prototype;f=new Request(e,{...y,signal:b,method:t.toUpperCase(),headers:p.normalize().toJSON(),body:r,duplex:"half",credentials:v?l:void 0});let x=await fetch(f,y),E=et&&(u==="stream"||u==="response");if(et&&(c||E&&g)){let R={};["status","statusText","headers"].forEach(at=>{R[at]=x[at];});let I=a.toFiniteNumber(x.headers.get("content-length")),[L,le]=c&&Ke(I,M(Ge(c),!0))||[];x=new Response(Ye(x.body,jt,L,()=>{le&&le(),g&&g();}),R);}u=u||"text";let U=await Te[a.findKey(Te,u)||"text"](x,s);return !E&&g&&g(),await new Promise((R,I)=>{ce(R,I,{data:U,headers:N.from(x.headers),status:x.status,statusText:x.statusText,config:s,request:f});})}catch(v){throw g&&g(),v&&v.name==="TypeError"&&/Load failed|fetch/i.test(v.message)?Object.assign(new h("Network Error",h.ERR_NETWORK,s,f),{cause:v.cause||v}):h.from(v,v&&v.code,s,f)}});var tt={http:xe,xhr:Bt,fetch:$t};a.forEach(tt,(s,e)=>{if(s){try{Object.defineProperty(s,"name",{value:e});}catch{}Object.defineProperty(s,"adapterName",{value:e});}});var Mt=s=>`- ${s}`,ds=s=>a.isFunction(s)||s===null||s===false,Ae={getAdapter:s=>{s=a.isArray(s)?s:[s];let{length:e}=s,t,r,n={};for(let i=0;i<e;i++){t=s[i];let o;if(r=t,!ds(t)&&(r=tt[(o=String(t)).toLowerCase()],r===void 0))throw new h(`Unknown adapter '${o}'`);if(r)break;n[o||"#"+i]=r;}if(!r){let i=Object.entries(n).map(([c,d])=>`adapter ${c} `+(d===false?"is not supported by the environment":"is not available in the build")),o=e?i.length>1?`since :
5
5
  `+i.map(Mt).join(`
6
- `):" "+Mt(i[0]):"as no adapter specified";throw new h("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return r},adapters:tt};function rt(s){if(s.cancelToken&&s.cancelToken.throwIfRequested(),s.signal&&s.signal.aborted)throw new D(null,s)}function De(s){return rt(s),s.headers=N.from(s.headers),s.data=oe.call(s,s.transformRequest),["post","put","patch"].indexOf(s.method)!==-1&&s.headers.setContentType("application/x-www-form-urlencoded",false),Ae.getAdapter(s.adapter||V.adapter)(s).then(function(r){return rt(s),r.data=oe.call(s,s.transformResponse,r),r.headers=N.from(r.headers),r},function(r){return ae(r)||(rt(s),r&&r.response&&(r.response.data=oe.call(s,s.transformResponse,r.response),r.response.headers=N.from(r.response.headers))),Promise.reject(r)})}var Oe="1.11.0";var Ue={};["object","boolean","number","function","string","symbol"].forEach((s,e)=>{Ue[s]=function(r){return typeof r===s||"a"+(e<1?"n ":" ")+s};});var Ht={};Ue.transitional=function(e,t,r){function n(i,o){return "[Axios v"+Oe+"] Transitional option '"+i+"'"+o+(r?". "+r:"")}return (i,o,c)=>{if(e===false)throw new h(n(o," has been removed"+(t?" in "+t:"")),h.ERR_DEPRECATED);return t&&!Ht[o]&&(Ht[o]=true,console.warn(n(o," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(i,o,c):true}};Ue.spelling=function(e){return (t,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),true)};function ls(s,e,t){if(typeof s!="object")throw new h("options must be an object",h.ERR_BAD_OPTION_VALUE);let r=Object.keys(s),n=r.length;for(;n-- >0;){let i=r[n],o=e[i];if(o){let c=s[i],d=c===void 0||o(c,i,s);if(d!==true)throw new h("option "+i+" must be "+d,h.ERR_BAD_OPTION_VALUE);continue}if(t!==true)throw new h("Unknown option "+i,h.ERR_BAD_OPTION)}}var pe={assertOptions:ls,validators:Ue};var O=pe.validators,H=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Ve,response:new Ve};}async request(e,t){try{return await this._request(e,t)}catch(r){if(r instanceof Error){let n={};Error.captureStackTrace?Error.captureStackTrace(n):n=new Error;let i=n.stack?n.stack.replace(/^.+\n/,""):"";try{r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=`
7
- `+i):r.stack=i;}catch{}}throw r}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=P(this.defaults,t);let{transitional:r,paramsSerializer:n,headers:i}=t;r!==void 0&&pe.assertOptions(r,{silentJSONParsing:O.transitional(O.boolean),forcedJSONParsing:O.transitional(O.boolean),clarifyTimeoutError:O.transitional(O.boolean)},false),n!=null&&(a.isFunction(n)?t.paramsSerializer={serialize:n}:pe.assertOptions(n,{encode:O.function,serialize:O.function},true)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=true),pe.assertOptions(t,{baseUrl:O.spelling("baseURL"),withXsrfToken:O.spelling("withXSRFToken")},true),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=i&&a.merge(i.common,i[t.method]);i&&a.forEach(["delete","get","head","post","put","patch","common"],f=>{delete i[f];}),t.headers=N.concat(o,i);let c=[],d=true;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(t)===false||(d=d&&g.synchronous,c.unshift(g.fulfilled,g.rejected));});let u=[];this.interceptors.response.forEach(function(g){u.push(g.fulfilled,g.rejected);});let p,l=0,y;if(!d){let f=[De.bind(this),void 0];for(f.unshift(...c),f.push(...u),y=f.length,p=Promise.resolve(t);l<y;)p=p.then(f[l++],f[l++]);return p}y=c.length;let b=t;for(l=0;l<y;){let f=c[l++],g=c[l++];try{b=f(b);}catch(m){g.call(this,m);break}}try{p=De.call(this,b);}catch(f){return Promise.reject(f)}for(l=0,y=u.length;l<y;)p=p.then(u[l++],u[l++]);return p}getUri(e){e=P(this.defaults,e);let t=ue(e.baseURL,e.url,e.allowAbsoluteUrls);return ne(t,e.params,e.paramsSerializer)}};a.forEach(["delete","get","head","options"],function(e){H.prototype[e]=function(t,r){return this.request(P(r||{},{method:e,url:t,data:(r||{}).data}))};});a.forEach(["post","put","patch"],function(e){function t(r){return function(i,o,c){return this.request(P(c||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}H.prototype[e]=t(),H.prototype[e+"Form"]=t(true);});var de=H;var st=class s{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(i){t=i;});let r=this;this.promise.then(n=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](n);r._listeners=null;}),this.promise.then=n=>{let i,o=new Promise(c=>{r.subscribe(c),i=c;}).then(n);return o.cancel=function(){r.unsubscribe(i);},o},e(function(i,o,c){r.reason||(r.reason=new D(i,o,c),t(r.reason));});}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e];}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1);}toAbortSignal(){let e=new AbortController,t=r=>{e.abort(r);};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return {token:new s(function(n){e=n;}),cancel:e}}},qt=st;function nt(s){return function(t){return s.apply(null,t)}}function it(s){return a.isObject(s)&&s.isAxiosError===true}var ot={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(ot).forEach(([s,e])=>{ot[e]=s;});var Wt=ot;function zt(s){let e=new de(s),t=Y(de.prototype.request,e);return a.extend(t,de.prototype,e,{allOwnKeys:true}),a.extend(t,e,null,{allOwnKeys:true}),t.create=function(n){return zt(P(s,n))},t}var S=zt(V);S.Axios=de;S.CanceledError=D;S.CancelToken=qt;S.isCancel=ae;S.VERSION=Oe;S.toFormData=F;S.AxiosError=h;S.Cancel=S.CanceledError;S.all=function(e){return Promise.all(e)};S.spread=nt;S.isAxiosError=it;S.mergeConfig=P;S.AxiosHeaders=N;S.formToJSON=s=>ke(a.isHTMLForm(s)?new FormData(s):s);S.getAdapter=Ae.getAdapter;S.HttpStatusCode=Wt;S.default=S;var q=S;var{Axios:jo,AxiosError:_o,CanceledError:Vo,isCancel:$o,CancelToken:Mo,VERSION:Ho,all:qo,Cancel:Wo,isAxiosError:zo,spread:Jo,toFormData:Ko,AxiosHeaders:Go,HttpStatusCode:Qo,formToJSON:Zo,getAdapter:Yo,mergeConfig:ea}=q;var Ie=class{constructor(e=1234,t){this._port=e,this.cyRestBaseURL=t?.cyRestBaseURL||"http://127.0.0.1",this.ndexBaseURL=t?.ndexBaseURL||"https://www.ndexbio.org",this.axiosInstance=q.create({baseURL:this.cyRestURL(),timeout:3e4,headers:{"Content-Type":"application/json"}});}get port(){return this._port}static get cyRestBaseURL(){return "http://127.0.0.1"}setNDExBaseURL(e){e?.trim()&&(this.ndexBaseURL=e.trim());}getNDExBaseURL(){return this.ndexBaseURL}setBasicAuth(e,t){e?.trim()&&t&&(this.authConfig={type:k.BASIC,username:e.trim(),password:t});}setAuthToken(e){e?.trim()&&(this.authConfig={type:k.OAUTH,idToken:e.trim()});}clearAuth(){delete this.authConfig;}cyRestURL(){return `${this.cyRestBaseURL}:${this._port}`}getAuthFields(){if(!this.authConfig)return {};switch(this.authConfig.type){case k.BASIC:return {username:this.authConfig.username,password:this.authConfig.password};case k.OAUTH:return {idToken:this.authConfig.idToken};default:return {}}}async _httpGet(e){return (await this.axiosInstance.get(e)).data}async _httpPost(e,t,r){return (await this.axiosInstance.post(e,r,{params:t})).data}async _httpPut(e,t,r){return (await this.axiosInstance.put(e,r,{params:t})).data}async getCyNDExStatus(){return this._httpGet("/cyndex2/v1")}async getCytoscapeNetworkSummary(e="current"){return this._httpGet(`/cyndex2/v1/networks/${e}`)}async postNDExNetworkToCytoscape(e,t,r){let n={serverUrl:`${this.ndexBaseURL}/v2`,uuid:e,...this.getAuthFields()};return t!==void 0&&(n.accessKey=t),r!==void 0&&(n.createView=r),this._httpPost("/cyndex2/v1/networks",void 0,n)}async postCXNetworkToCytoscape(e){return this._httpPost("/cyndex2/v1/networks/cx",void 0,e)}async postCX2NetworkToCytoscape(e,t,r){let n={format:"cx2",collection:r,title:t};return this._httpPost("/v1/networks",n,e)}async postCytoscapeNetworkToNDEx(e="current"){let t={serverUrl:`${this.ndexBaseURL}/v2`,...this.getAuthFields()};return this._httpPost(`/cyndex2/v1/networks/${e}`,void 0,t)}async putCytoscapeNetworkInNDEx(e="current",t){let r={serverUrl:`${this.ndexBaseURL}/v2`,uuid:t,...this.getAuthFields()};return this._httpPut(`/cyndex2/v1/networks/${e}`,void 0,r)}};var Fe="0.6.0-alpha.4";var Le=class{constructor(e={}){this.config={baseURL:"https://www.ndexbio.org",timeout:3e4,retries:3,retryDelay:1e3,debug:false,...e};let t={...this.config.headers,...this.getAuthHeaders()};typeof window>"u"&&(t["User-Agent"]=`NDEx-JS-Client/${Fe}`);let r={headers:t};this.config.baseURL&&(r.baseURL=this.config.baseURL),this.config.timeout&&(r.timeout=this.config.timeout),this.axiosInstance=q.create(r),this.setupInterceptors();}getAuthHeaders(){if(!this.config.auth)return {};if(this.config.auth.type===k.BASIC){let e=`${this.config.auth.username}:${this.config.auth.password}`;return {Authorization:`Basic ${typeof window<"u"&&typeof btoa<"u"?btoa(e):Buffer.from(e,"utf-8").toString("base64")}`}}else if(this.config.auth.type===k.OAUTH)return {Authorization:`Bearer ${this.config.auth.idToken}`};return {}}buildUrl(e,t="v2"){let r=e.startsWith("/")?e.slice(1):e;return `/${t}/${r}`}async get(e,t){let{version:r,...n}=t||{},i=this.buildUrl(e,r);try{let o=await this.axiosInstance.get(i,n);return this.handleResponse(o)}catch(o){this.handleError(o);}}async post(e,t,r){let{version:n,...i}=r||{},o=this.buildUrl(e,n);try{let c=await this.axiosInstance.post(o,t,i);return this.handleResponse(c)}catch(c){this.handleError(c);}}async put(e,t,r){let{version:n,...i}=r||{},o=this.buildUrl(e,n);try{let c=await this.axiosInstance.put(o,t,i);return this.handleResponse(c)}catch(c){this.handleError(c);}}async delete(e,t){let{version:r,...n}=t||{},i=this.buildUrl(e,r);try{let o=await this.axiosInstance.delete(i,n);return this.handleResponse(o)}catch(o){this.handleError(o);}}async uploadFile(e,t,r={}){let{version:n,onProgress:i,contentType:o}=r,c=this.buildUrl(e,n),d=new FormData,u=typeof globalThis.File<"u",p=typeof globalThis.Blob<"u";if(u&&t instanceof globalThis.File)d.append("file",t,t.name);else if(p&&t instanceof globalThis.Blob)d.append("file",t,"file.cx2");else if(typeof t=="string"){let l=new Blob([t],{type:o||"application/json"});d.append("file",l,"file.cx2");}else if(typeof globalThis.Buffer<"u"&&globalThis.Buffer.isBuffer(t)){let l=new Blob([t],{type:o||"application/octet-stream"});d.append("file",l,"file.cx2");}else {let l=new Blob([String(t)],{type:o||"application/octet-stream"});d.append("file",l,"file.cx2");}try{let l={};i&&(l.onUploadProgress=b=>{let f=Math.round(b.loaded*100/(b.total||1));i(f);});let y=await this.axiosInstance.post(c,d,l);return this.handleResponse(y)}catch(l){this.handleError(l);}}setupInterceptors(){this.axiosInstance.interceptors.request.use(e=>(this.config.debug&&console.log("NDEx API Request:",{method:e.method?.toUpperCase(),url:e.url,headers:e.headers}),e),e=>(this.config.debug&&console.error("NDEx API Request Error:",e),Promise.reject(e))),this.axiosInstance.interceptors.response.use(e=>(this.config.debug&&console.log("NDEx API Response:",{status:e.status,url:e.config.url,data:e.data}),e),e=>(this.config.debug&&console.error("NDEx API Response Error:",e.response?.data||e.message),Promise.reject(e)));}handleResponse(e){return e.data&&typeof e.data=="object"&&"errorCode"in e.data&&this.throwNDExError(e.data.message||"Unknown error occurred",e.status,e.data.errorCode||"UNKNOWN_ERROR",e.data.description),e.data&&typeof e.data=="object"&&"data"in e.data?e.data.data:e.data}handleError(e){if(e.response){let t=e.response.data?.message||e.message,r=e.response.data?.errorCode,n=e.response.data?.description;this.throwNDExError(t,e.response.status,r,n);}else throw e.request?new fe("Network error - no response received",e):new A(e.message||"Unknown error occurred",void 0,"CLIENT_ERROR",e.toString())}throwNDExError(e,t,r,n){switch(t){case 400:throw new ge(e,t,r);case 401:case 403:throw new me(e,t,r);case 404:throw new he(e,t,r);case 500:case 502:case 503:case 504:throw new ye(e,t,r);default:throw new A(e,t,r??`HTTP_${t}`,n)}}updateConfig(e){if(this.config={...this.config,...e},e.baseURL&&(this.axiosInstance.defaults.baseURL=e.baseURL),e.timeout&&(this.axiosInstance.defaults.timeout=e.timeout),e.headers&&Object.assign(this.axiosInstance.defaults.headers,e.headers),"auth"in e){let t=this.getAuthHeaders();delete this.axiosInstance.defaults.headers.common.Authorization,Object.assign(this.axiosInstance.defaults.headers.common,t);}}getConfig(){return {...this.config}}getAuthType(){return this.config.auth?.type}getIdToken(){return this.config.auth?.type===k.OAUTH?this.config.auth.idToken:void 0}setIdToken(e){this.updateConfig({auth:{type:k.OAUTH,idToken:e}});}};var Jt=class{constructor(e={}){this.httpService=new Le(e),this.networks=new J(this.httpService),this.files=new K(this.httpService),this.workspace=new G(this.httpService),this.user=new Q(this.httpService),this.admin=new Z;}logout(){this.httpService.updateConfig({});}async getServerStatus(e){let t=new URLSearchParams;e&&t.append("format",e);let r=`admin/status${t.toString()?`?${t.toString()}`:""}`;return this.httpService.get(r)}hasAuthInfo(){let e=this.httpService.getConfig().auth;return e?e.type===k.BASIC?!!e.username&&!!e.password:e.type===k.OAUTH?!!e.idToken:false:false}updateConfig(e){this.httpService.updateConfig(e);}getConfig(){return this.httpService.getConfig()}getAuthType(){return this.httpService.getAuthType()}setIdToken(e){this.httpService.setIdToken(e);}get v2(){return {networks:this.networks.v2}}get v3(){return {networks:this.networks.v3}}},ka=Fe;
6
+ `):" "+Mt(i[0]):"as no adapter specified";throw new h("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return r},adapters:tt};function rt(s){if(s.cancelToken&&s.cancelToken.throwIfRequested(),s.signal&&s.signal.aborted)throw new D(null,s)}function De(s){return rt(s),s.headers=N.from(s.headers),s.data=oe.call(s,s.transformRequest),["post","put","patch"].indexOf(s.method)!==-1&&s.headers.setContentType("application/x-www-form-urlencoded",false),Ae.getAdapter(s.adapter||V.adapter)(s).then(function(r){return rt(s),r.data=oe.call(s,s.transformResponse,r),r.headers=N.from(r.headers),r},function(r){return ae(r)||(rt(s),r&&r.response&&(r.response.data=oe.call(s,s.transformResponse,r.response),r.response.headers=N.from(r.response.headers))),Promise.reject(r)})}var Oe="1.11.0";var Ue={};["object","boolean","number","function","string","symbol"].forEach((s,e)=>{Ue[s]=function(r){return typeof r===s||"a"+(e<1?"n ":" ")+s};});var qt={};Ue.transitional=function(e,t,r){function n(i,o){return "[Axios v"+Oe+"] Transitional option '"+i+"'"+o+(r?". "+r:"")}return (i,o,c)=>{if(e===false)throw new h(n(o," has been removed"+(t?" in "+t:"")),h.ERR_DEPRECATED);return t&&!qt[o]&&(qt[o]=true,console.warn(n(o," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(i,o,c):true}};Ue.spelling=function(e){return (t,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),true)};function ls(s,e,t){if(typeof s!="object")throw new h("options must be an object",h.ERR_BAD_OPTION_VALUE);let r=Object.keys(s),n=r.length;for(;n-- >0;){let i=r[n],o=e[i];if(o){let c=s[i],d=c===void 0||o(c,i,s);if(d!==true)throw new h("option "+i+" must be "+d,h.ERR_BAD_OPTION_VALUE);continue}if(t!==true)throw new h("Unknown option "+i,h.ERR_BAD_OPTION)}}var pe={assertOptions:ls,validators:Ue};var O=pe.validators,q=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Ve,response:new Ve};}async request(e,t){try{return await this._request(e,t)}catch(r){if(r instanceof Error){let n={};Error.captureStackTrace?Error.captureStackTrace(n):n=new Error;let i=n.stack?n.stack.replace(/^.+\n/,""):"";try{r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=`
7
+ `+i):r.stack=i;}catch{}}throw r}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=P(this.defaults,t);let{transitional:r,paramsSerializer:n,headers:i}=t;r!==void 0&&pe.assertOptions(r,{silentJSONParsing:O.transitional(O.boolean),forcedJSONParsing:O.transitional(O.boolean),clarifyTimeoutError:O.transitional(O.boolean)},false),n!=null&&(a.isFunction(n)?t.paramsSerializer={serialize:n}:pe.assertOptions(n,{encode:O.function,serialize:O.function},true)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=true),pe.assertOptions(t,{baseUrl:O.spelling("baseURL"),withXsrfToken:O.spelling("withXSRFToken")},true),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=i&&a.merge(i.common,i[t.method]);i&&a.forEach(["delete","get","head","post","put","patch","common"],f=>{delete i[f];}),t.headers=N.concat(o,i);let c=[],d=true;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(t)===false||(d=d&&g.synchronous,c.unshift(g.fulfilled,g.rejected));});let u=[];this.interceptors.response.forEach(function(g){u.push(g.fulfilled,g.rejected);});let p,l=0,y;if(!d){let f=[De.bind(this),void 0];for(f.unshift(...c),f.push(...u),y=f.length,p=Promise.resolve(t);l<y;)p=p.then(f[l++],f[l++]);return p}y=c.length;let b=t;for(l=0;l<y;){let f=c[l++],g=c[l++];try{b=f(b);}catch(m){g.call(this,m);break}}try{p=De.call(this,b);}catch(f){return Promise.reject(f)}for(l=0,y=u.length;l<y;)p=p.then(u[l++],u[l++]);return p}getUri(e){e=P(this.defaults,e);let t=ue(e.baseURL,e.url,e.allowAbsoluteUrls);return ne(t,e.params,e.paramsSerializer)}};a.forEach(["delete","get","head","options"],function(e){q.prototype[e]=function(t,r){return this.request(P(r||{},{method:e,url:t,data:(r||{}).data}))};});a.forEach(["post","put","patch"],function(e){function t(r){return function(i,o,c){return this.request(P(c||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}q.prototype[e]=t(),q.prototype[e+"Form"]=t(true);});var de=q;var st=class s{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(i){t=i;});let r=this;this.promise.then(n=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](n);r._listeners=null;}),this.promise.then=n=>{let i,o=new Promise(c=>{r.subscribe(c),i=c;}).then(n);return o.cancel=function(){r.unsubscribe(i);},o},e(function(i,o,c){r.reason||(r.reason=new D(i,o,c),t(r.reason));});}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e];}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1);}toAbortSignal(){let e=new AbortController,t=r=>{e.abort(r);};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return {token:new s(function(n){e=n;}),cancel:e}}},Ht=st;function nt(s){return function(t){return s.apply(null,t)}}function it(s){return a.isObject(s)&&s.isAxiosError===true}var ot={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(ot).forEach(([s,e])=>{ot[e]=s;});var Wt=ot;function zt(s){let e=new de(s),t=Y(de.prototype.request,e);return a.extend(t,de.prototype,e,{allOwnKeys:true}),a.extend(t,e,null,{allOwnKeys:true}),t.create=function(n){return zt(P(s,n))},t}var S=zt(V);S.Axios=de;S.CanceledError=D;S.CancelToken=Ht;S.isCancel=ae;S.VERSION=Oe;S.toFormData=F;S.AxiosError=h;S.Cancel=S.CanceledError;S.all=function(e){return Promise.all(e)};S.spread=nt;S.isAxiosError=it;S.mergeConfig=P;S.AxiosHeaders=N;S.formToJSON=s=>ke(a.isHTMLForm(s)?new FormData(s):s);S.getAdapter=Ae.getAdapter;S.HttpStatusCode=Wt;S.default=S;var H=S;var{Axios:jo,AxiosError:_o,CanceledError:Vo,isCancel:$o,CancelToken:Mo,VERSION:qo,all:Ho,Cancel:Wo,isAxiosError:zo,spread:Jo,toFormData:Ko,AxiosHeaders:Go,HttpStatusCode:Qo,formToJSON:Zo,getAdapter:Yo,mergeConfig:ea}=H;var Ie=class{constructor(e=1234,t){this._port=e,this.cyRestBaseURL=t?.cyRestBaseURL||"http://127.0.0.1",this.ndexBaseURL=t?.ndexBaseURL||"https://www.ndexbio.org",this.axiosInstance=H.create({baseURL:this.cyRestURL(),timeout:3e4,headers:{"Content-Type":"application/json"}});}get port(){return this._port}static get cyRestBaseURL(){return "http://127.0.0.1"}setNDExBaseURL(e){e?.trim()&&(this.ndexBaseURL=e.trim());}getNDExBaseURL(){return this.ndexBaseURL}setBasicAuth(e,t){e?.trim()&&t&&(this.authConfig={type:k.BASIC,username:e.trim(),password:t});}setAuthToken(e){e?.trim()&&(this.authConfig={type:k.OAUTH,idToken:e.trim()});}clearAuth(){delete this.authConfig;}cyRestURL(){return `${this.cyRestBaseURL}:${this._port}`}getAuthFields(){if(!this.authConfig)return {};switch(this.authConfig.type){case k.BASIC:return {username:this.authConfig.username,password:this.authConfig.password};case k.OAUTH:return {idToken:this.authConfig.idToken};default:return {}}}async _httpGet(e){return (await this.axiosInstance.get(e)).data}async _httpPost(e,t,r){return (await this.axiosInstance.post(e,r,{params:t})).data}async _httpPut(e,t,r){return (await this.axiosInstance.put(e,r,{params:t})).data}async getCyNDExStatus(){return this._httpGet("/cyndex2/v1")}async getCytoscapeNetworkSummary(e="current"){return this._httpGet(`/cyndex2/v1/networks/${e}`)}async postNDExNetworkToCytoscape(e,t,r){let n={serverUrl:`${this.ndexBaseURL}/v2`,uuid:e,...this.getAuthFields()};return t!==void 0&&(n.accessKey=t),r!==void 0&&(n.createView=r),this._httpPost("/cyndex2/v1/networks",void 0,n)}async postCXNetworkToCytoscape(e){return this._httpPost("/cyndex2/v1/networks/cx",void 0,e)}async postCX2NetworkToCytoscape(e,t,r){let n={format:"cx2",collection:r,title:t};return this._httpPost("/v1/networks",n,e)}async postCytoscapeNetworkToNDEx(e="current"){let t={serverUrl:`${this.ndexBaseURL}/v2`,...this.getAuthFields()};return this._httpPost(`/cyndex2/v1/networks/${e}`,void 0,t)}async putCytoscapeNetworkInNDEx(e="current",t){let r={serverUrl:`${this.ndexBaseURL}/v2`,uuid:t,...this.getAuthFields()};return this._httpPut(`/cyndex2/v1/networks/${e}`,void 0,r)}};var Fe="0.6.0-alpha.6";var Le=class{constructor(e={}){this.config={baseURL:"https://www.ndexbio.org",timeout:3e4,retries:3,retryDelay:1e3,debug:false,...e};let t={...this.config.headers,...this.getAuthHeaders()};typeof window>"u"&&(t["User-Agent"]=`NDEx-JS-Client/${Fe}`);let r={headers:t};this.config.baseURL&&(r.baseURL=this.config.baseURL),this.config.timeout&&(r.timeout=this.config.timeout),this.axiosInstance=H.create(r),this.setupInterceptors();}getAuthHeaders(){if(!this.config.auth)return {};if(this.config.auth.type===k.BASIC){let e=`${this.config.auth.username}:${this.config.auth.password}`;return {Authorization:`Basic ${typeof window<"u"&&typeof btoa<"u"?btoa(e):Buffer.from(e,"utf-8").toString("base64")}`}}else if(this.config.auth.type===k.OAUTH)return {Authorization:`Bearer ${this.config.auth.idToken}`};return {}}buildUrl(e,t="v2"){let r=e.startsWith("/")?e.slice(1):e;return `/${t}/${r}`}async get(e,t){let{version:r,...n}=t||{},i=this.buildUrl(e,r);try{let o=await this.axiosInstance.get(i,n);return this.handleResponse(o)}catch(o){this.handleError(o);}}async post(e,t,r){let{version:n,...i}=r||{},o=this.buildUrl(e,n);try{let c=await this.axiosInstance.post(o,t,i);return this.handleResponse(c)}catch(c){this.handleError(c);}}async put(e,t,r){let{version:n,...i}=r||{},o=this.buildUrl(e,n);try{let c=await this.axiosInstance.put(o,t,i);return this.handleResponse(c)}catch(c){this.handleError(c);}}async delete(e,t){let{version:r,...n}=t||{},i=this.buildUrl(e,r);try{let o=await this.axiosInstance.delete(i,n);return this.handleResponse(o)}catch(o){this.handleError(o);}}async uploadFile(e,t,r={}){let{version:n,onProgress:i,contentType:o}=r,c=this.buildUrl(e,n),d=new FormData,u=typeof globalThis.File<"u",p=typeof globalThis.Blob<"u";if(u&&t instanceof globalThis.File)d.append("file",t,t.name);else if(p&&t instanceof globalThis.Blob)d.append("file",t,"file.cx2");else if(typeof t=="string"){let l=new Blob([t],{type:o||"application/json"});d.append("file",l,"file.cx2");}else if(typeof globalThis.Buffer<"u"&&globalThis.Buffer.isBuffer(t)){let l=new Blob([t],{type:o||"application/octet-stream"});d.append("file",l,"file.cx2");}else {let l=new Blob([String(t)],{type:o||"application/octet-stream"});d.append("file",l,"file.cx2");}try{let l={};i&&(l.onUploadProgress=b=>{let f=Math.round(b.loaded*100/(b.total||1));i(f);});let y=await this.axiosInstance.post(c,d,l);return this.handleResponse(y)}catch(l){this.handleError(l);}}setupInterceptors(){this.axiosInstance.interceptors.request.use(e=>(this.config.debug&&console.log("NDEx API Request:",{method:e.method?.toUpperCase(),url:e.url,headers:e.headers}),e),e=>(this.config.debug&&console.error("NDEx API Request Error:",e),Promise.reject(e))),this.axiosInstance.interceptors.response.use(e=>(this.config.debug&&console.log("NDEx API Response:",{status:e.status,url:e.config.url,data:e.data}),e),e=>(this.config.debug&&console.error("NDEx API Response Error:",e.response?.data||e.message),Promise.reject(e)));}handleResponse(e){return e.data&&typeof e.data=="object"&&"errorCode"in e.data&&this.throwNDExError(e.data.message||"Unknown error occurred",e.status,e.data.errorCode||"UNKNOWN_ERROR",e.data.description),e.data&&typeof e.data=="object"&&"data"in e.data?e.data.data:e.data}handleError(e){if(e.response){let t=e.response.data?.message||e.message,r=e.response.data?.errorCode,n=e.response.data?.description;this.throwNDExError(t,e.response.status,r,n);}else throw e.request?new fe("Network error - no response received",e):new A(e.message||"Unknown error occurred",void 0,"CLIENT_ERROR",e.toString())}throwNDExError(e,t,r,n){switch(t){case 400:throw new ge(e,t,r);case 401:case 403:throw new me(e,t,r);case 404:throw new he(e,t,r);case 500:case 502:case 503:case 504:throw new ye(e,t,r);default:throw new A(e,t,r??`HTTP_${t}`,n)}}updateConfig(e){if(this.config={...this.config,...e},e.baseURL&&(this.axiosInstance.defaults.baseURL=e.baseURL),e.timeout&&(this.axiosInstance.defaults.timeout=e.timeout),e.headers&&Object.assign(this.axiosInstance.defaults.headers,e.headers),"auth"in e){let t=this.getAuthHeaders();delete this.axiosInstance.defaults.headers.common.Authorization,Object.assign(this.axiosInstance.defaults.headers.common,t);}}getConfig(){return {...this.config}}getAuthType(){return this.config.auth?.type}getIdToken(){return this.config.auth?.type===k.OAUTH?this.config.auth.idToken:void 0}setIdToken(e){this.updateConfig({auth:{type:k.OAUTH,idToken:e}});}};var Jt=class{constructor(e={}){this.httpService=new Le(e),this.networks=new J(this.httpService),this.files=new K(this.httpService),this.workspace=new G(this.httpService),this.user=new Q(this.httpService),this.admin=new Z;}logout(){this.httpService.updateConfig({});}async getServerStatus(e){let t=new URLSearchParams;e&&t.append("format",e);let r=`admin/status${t.toString()?`?${t.toString()}`:""}`;return this.httpService.get(r)}hasAuthInfo(){let e=this.httpService.getConfig().auth;return e?e.type===k.BASIC?!!e.username&&!!e.password:e.type===k.OAUTH?!!e.idToken:false:false}updateConfig(e){this.httpService.updateConfig(e);}getConfig(){return this.httpService.getConfig()}getAuthType(){return this.httpService.getAuthType()}setIdToken(e){this.httpService.setIdToken(e);}get v2(){return {networks:this.networks.v2}}get v3(){return {networks:this.networks.v3}}},ka=Fe;
8
8
  exports.AdminService=Z;exports.AuthType=k;exports.CX2Network=B;exports.CXDataType=Ss;exports.CyNDEx=Ie;exports.CyNDExService=Ie;exports.FilesService=K;exports.NDExAuthError=me;exports.NDExClient=Jt;exports.NDExError=A;exports.NDExFileType=ws;exports.NDExNetworkError=fe;exports.NDExNotFoundError=he;exports.NDExServerError=ye;exports.NDExValidationError=ge;exports.NetworkIndexLevel=Zt;exports.NetworkServiceV2=W;exports.NetworkServiceV3=z;exports.Permission=bs;exports.UnifiedNetworkService=J;exports.UserService=Q;exports.VPMappingType=vs;exports.Visibility=ys;exports.WorkspaceService=G;exports.version=ka;return exports;})({});//# sourceMappingURL=index.global.js.map
9
9
  //# sourceMappingURL=index.global.js.map