@tableau/mcp-server 1.9.1 → 1.9.3
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/build/index.js +1 -1
- package/build/index.js.map +2 -2
- package/package.json +4 -1
package/build/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
var Ys=Object.defineProperty;var Xs=(t,e)=>{for(var r in e)Ys(t,r,{get:e[r],enumerable:!0})};import{StdioServerTransport as Lu}from"@modelcontextprotocol/sdk/server/stdio.js";import Du from"dotenv";var cr=["list-datasources","list-workbooks","list-views","query-datasource","get-datasource-metadata","get-workbook","get-view-data","get-view-image","list-all-pulse-metric-definitions","list-pulse-metric-definitions-from-definition-ids","list-pulse-metrics-from-metric-definition-id","list-pulse-metrics-from-metric-ids","list-pulse-metric-subscriptions","generate-pulse-metric-value-insight-bundle","search-content"],en=["datasource","workbook","view","pulse","content-exploration"],ur={datasource:["list-datasources","get-datasource-metadata","query-datasource"],workbook:["list-workbooks","get-workbook"],view:["list-views","get-view-data","get-view-image"],pulse:["list-all-pulse-metric-definitions","list-pulse-metric-definitions-from-definition-ids","list-pulse-metrics-from-metric-definition-id","list-pulse-metrics-from-metric-ids","list-pulse-metric-subscriptions","generate-pulse-metric-value-insight-bundle"],"content-exploration":["search-content"]};function dr(t){return!!cr.find(e=>e===t)}function pr(t){return!!en.find(e=>e===t)}var tn=["stdio","http"];function go(t){return!!tn.find(e=>e===t)}function fe(t,e){if(!t)throw new Error(e||"Invariant Violation")}var rn=["pat","direct-trust"],mr=class{auth;server;transport;sslKey;sslCert;httpPort;corsOriginConfig;siteName;patName;patValue;jwtSubClaim;connectedAppClientId;connectedAppSecretId;connectedAppSecretValue;jwtAdditionalPayload;datasourceCredentials;defaultLogLevel;disableLogMasking;includeTools;excludeTools;maxResultLimit;disableQueryDatasourceFilterValidation;disableMetadataApiRequests;constructor(){let e=nn(process.env),{AUTH:r,SERVER:o,SITE_NAME:i,TRANSPORT:n,SSL_KEY:s,SSL_CERT:l,HTTP_PORT_ENV_VAR_NAME:u,CORS_ORIGIN_CONFIG:p,PAT_NAME:c,PAT_VALUE:h,JWT_SUB_CLAIM:b,CONNECTED_APP_CLIENT_ID:E,CONNECTED_APP_SECRET_ID:m,CONNECTED_APP_SECRET_VALUE:y,JWT_ADDITIONAL_PAYLOAD:T,DATASOURCE_CREDENTIALS:_,DEFAULT_LOG_LEVEL:F,DISABLE_LOG_MASKING:S,INCLUDE_TOOLS:x,EXCLUDE_TOOLS:L,MAX_RESULT_LIMIT:U,DISABLE_QUERY_DATASOURCE_FILTER_VALIDATION:j,DISABLE_METADATA_API_REQUESTS:le}=e,te=3927,pe=e[u?.trim()||"PORT"]||te.toString(),me=parseInt(pe,10);this.siteName=i??"",this.auth=rn.find(H=>H===r)??"pat",this.transport=go(n)?n:"stdio",this.sslKey=s?.trim()??"",this.sslCert=l?.trim()??"",this.httpPort=isNaN(me)?te:me,this.corsOriginConfig=sn(p?.trim()??""),this.datasourceCredentials=_??"",this.defaultLogLevel=F??"debug",this.disableLogMasking=S==="true",this.disableQueryDatasourceFilterValidation=j==="true",this.disableMetadataApiRequests=le==="true";let Q=U?parseInt(U):NaN;if(this.maxResultLimit=isNaN(Q)||Q<=0?null:Q,this.includeTools=x?x.split(",").flatMap(H=>{let N=H.trim();return dr(N)?N:pr(N)?ur[N]:[]}):[],this.excludeTools=L?L.split(",").flatMap(H=>{let N=H.trim();return dr(N)?N:pr(N)?ur[N]:[]}):[],this.includeTools.length>0&&this.excludeTools.length>0)throw new Error("Cannot include and exclude tools simultaneously");fe(o,"The environment variable SERVER is not set"),on(o),this.auth==="pat"?(fe(c,"The environment variable PAT_NAME is not set"),fe(h,"The environment variable PAT_VALUE is not set")):this.auth==="direct-trust"&&(fe(b,"The environment variable JWT_SUB_CLAIM is not set"),fe(E,"The environment variable CONNECTED_APP_CLIENT_ID is not set"),fe(m,"The environment variable CONNECTED_APP_SECRET_ID is not set"),fe(y,"The environment variable CONNECTED_APP_SECRET_VALUE is not set")),this.server=o,this.patName=c??"",this.patValue=h??"",this.jwtSubClaim=b??"",this.connectedAppClientId=E??"",this.connectedAppSecretId=m??"",this.connectedAppSecretValue=y??"",this.jwtAdditionalPayload=T||"{}"}};function on(t){if(!t.startsWith("https://"))throw new Error(`The environment variable SERVER must start with "https://": ${t}`);try{let e=new URL(t)}catch(e){let r=e instanceof Error?e.message:String(e);throw new Error(`The environment variable SERVER is not a valid URL: ${t} -- ${r}`)}}function sn(t){if(!t)return!0;if(t.match(/^true|false$/i))return t.toLowerCase()==="true";if(t==="*")return"*";if(t.startsWith("[")&&t.endsWith("]"))try{return JSON.parse(t).map(r=>new URL(r).origin)}catch{throw new Error(`The environment variable CORS_ORIGIN_CONFIG is not a valid array of URLs: ${t}`)}try{return new URL(t).origin}catch{throw new Error(`The environment variable CORS_ORIGIN_CONFIG is not a valid URL: ${t}`)}}function nn(t){return Object.entries(t).reduce((e,[r,o])=>(o?.startsWith("${user_config.")?e[r]="":e[r]=o,e),{})}var R=()=>new mr;var fr=["debug","info","notice","warning","error","critical","alert","emergency"],it="debug";function yo(t){return!!fr.find(e=>e===t)}var Ne=(t,e,{silent:r=!1}={})=>{it!==e&&(it=e,r||ie.notice(t,`Logging level set to: ${e}`))},ie={debug:be("debug"),info:be("info"),notice:be("notice"),warning:be("warning"),error:be("error"),critical:be("critical"),alert:be("alert"),emergency:be("emergency")},Ee=(t=it)=>fr.indexOf(t)>=fr.indexOf(it),st=t=>{process.env.TABLEAU_MCP_TEST!=="true"&&(t=t.endsWith(`
|
|
3
3
|
`)?t:`${t}
|
|
4
|
-
`,process.stderr.write(t))},bo=({requestId:t,toolName:e,args:r})=>({type:"tool",requestId:t,tool:{name:e,...r!==void 0?{args:r}:{}}});function be(t){return async(e,r,{logger:o,requestId:i}={logger:e.name})=>{if(Ee(t))return e.server.notification({method:"notifications/message",params:{level:t,logger:o,message:JSON.stringify({timestamp:new Date().toISOString(),currentLogLevel:it,message:r},null,2)}},{relatedRequestId:i})}}import{McpServer as Su}from"@modelcontextprotocol/sdk/server/mcp.js";import{SetLevelRequestSchema as Cu}from"@modelcontextprotocol/sdk/types.js";var To={name:"@tableau/mcp-server",description:"An MCP server for Tableau, providing a suite of tools that will make it easier for developers to build AI applications that integrate with Tableau.",version:"1.9.1",repository:{type:"git",url:"git+https://github.com/tableau/tableau-mcp.git"},homepage:"https://github.com/tableau/tableau-mcp",bugs:"https://github.com/tableau/tableau-mcp/issues",author:"Tableau",type:"module",license:"Apache-2.0",keywords:["tableau","mcp"],bin:{"tableau-mcp-server":"./build/index.js"},scripts:{":build":"npx rimraf ./build && esbuild src/index.ts --bundle --packages=external --platform=node --format=esm --minify --outdir=build --sourcemap",build:"run-s :build exec-perms","build:watch":"npm run :build -- --watch","build:docker":"docker build -t tableau-mcp .",":build:mcpb":"npx -y @anthropic-ai/mcpb pack . tableau-mcp.mcpb","build:mcpb":"run-s build:manifest:script build:manifest :build:mcpb","build:manifest":"node build/scripts/createClaudeMcpBundleManifest.mjs","build:manifest:script":"esbuild src/scripts/createClaudeMcpBundleManifest.ts --bundle --platform=node --format=esm --outdir=build/scripts --sourcemap=inline --out-extension:.js=.mjs","start:http":"node build/index.js","start:http:docker":"docker run -p 3927:3927 -i --rm --env-file env.list tableau-mcp",lint:"npm exec eslint",inspect:"npx @modelcontextprotocol/inspector --config config.json --server tableau",":inspect:http":"npx @modelcontextprotocol/inspector --config config.http.json --server tableau","inspect:http":"run-p start:http :inspect:http","inspect:docker":"npx @modelcontextprotocol/inspector --config config.docker.json --server tableau","inspect:docker:http":"run-p start:http:docker :inspect:http","build:inspect":"run-s build inspect","build:inspect:docker":"run-s build:docker inspect:docker","build:inspect:docker:http":"run-s build:docker inspect:docker:http","exec-perms":"shx chmod +x build/*.js",test:"vitest --config ./vitest.config.ts","test:e2e":"vitest --config ./vitest.config.e2e.ts",coverage:"vitest run --config ./vitest.config.ts --coverage","version:major":"npm version major --no-git-tag-version","version:minor":"npm version minor --no-git-tag-version","version:patch":"npm version patch --no-git-tag-version"},dependencies:{"@modelcontextprotocol/sdk":"^1.12.1","@zodios/core":"^10.9.6",cors:"^2.8.5",dotenv:"^16.5.0",express:"^5.1.0","fast-levenshtein":"^3.0.0",jose:"^6.0.12","ts-results-es":"^5.0.1",zod:"^3.24.3","zod-validation-error":"^4.0.1"},devDependencies:{"@anthropic-ai/mcpb":"^1.0.0","@eslint/eslintrc":"^3.3.1","@eslint/js":"^9.25.1","@modelcontextprotocol/inspector":"^0.16.6","@types/cors":"^2.8.19","@types/eslint__js":"^8.42.3","@types/express":"^5.0.3","@types/fast-levenshtein":"^0.0.1","@types/node":"^22.15.3","@typescript-eslint/eslint-plugin":"^8.31.1","@typescript-eslint/parser":"^8.31.1","@vitest/coverage-v8":"^3.1.3",esbuild:"^0.25.5",eslint:"^9.25.1","eslint-config-prettier":"^10.1.2","eslint-plugin-prettier":"^5.2.6","eslint-plugin-simple-import-sort":"^12.1.1","npm-run-all":"^4.1.5",prettier:"^3.5.3",rimraf:"^6.0.1",shx:"^0.4.0",typescript:"^5.8.3","typescript-eslint":"^8.31.1",vitest:"^3.1.3"},engines:{node:">=20"}};import{Ok as Ic}from"ts-results-es";import{z as as}from"zod";import{Err as wo,Ok as ln}from"ts-results-es";function he(t){if(t instanceof Error)return t.message;try{return JSON.stringify(t)??"undefined"}catch{return`${t}`}}var Eo=t=>{let e=So(t);if(e.isErr())return t;let r=e.value;return Ee("debug")?(r.data?.credentials&&(r.data.credentials="<redacted>"),Array.isArray(r?.data?.datasource?.connections)&&r.data.datasource.connections.forEach(i=>{i.connectionUsername="<redacted>",i.connectionPassword="<redacted>"}),r.headers?.["X-Tableau-Auth"]&&(r.headers["X-Tableau-Auth"]="<redacted>"),r.params?.user_id&&(r.params.user_id="<redacted>")):(delete r.data,delete r.headers,delete r.params),r},Ao=t=>{let e=So(t);if(e.isErr())return t;let r=e.value;return Ee("debug")?r.data?.credentials&&(r.data.credentials="<redacted>"):(delete r.data,delete r.headers),r};function So(t){try{return ln(structuredClone(t))}catch(e){if(e instanceof Error)return wo(e);let r=he(e);return st(`Could not clone object, notification may not be sanitized! Error: ${r}`),wo(new Error(r))}}function Ot(t){return{method:t.method??"UNKNOWN METHOD",url:t.url??"UNKNOWN URL",headers:t.headers,data:t.data,params:t.params}}function Pt(t){return{url:t.config.url??"UNKNOWN URL",status:t.status,headers:t.headers,data:t.data}}import{Zodios as xo}from"@zodios/core";import{randomUUID as cn}from"node:crypto";import{SignJWT as un}from"jose";async function Co({username:t,connectedApp:e,scopes:r,additionalPayload:o}){let i={alg:"HS256",typ:"JWT",kid:e.secretId},n={jti:cn(),iss:e.clientId,aud:"tableau",sub:t,scp:[...r],iat:Math.floor(Date.now()/1e3)-5,exp:Math.floor(Date.now()/1e3)+5*60,...o};return await new un(n).setProtectedHeader(i).sign(new TextEncoder().encode(e.secretValue))}import{makeApi as dn,makeEndpoint as Ro}from"@zodios/core";import{z as ce}from"zod";import{z as Ae}from"zod";var _o=Ae.object({credentials:Ae.object({site:Ae.object({id:Ae.string()}),user:Ae.object({id:Ae.string()}),token:Ae.string()})});var pn=ce.object({credentials:ce.object({site:ce.object({contentUrl:ce.string()})}).and(ce.object({personalAccessTokenName:ce.string(),personalAccessTokenSecret:ce.string()}).or(ce.object({jwt:ce.string()})))}),mn=Ro({method:"post",path:"/auth/signin",alias:"signIn",description:"Signs in with Tableau credentials.",response:_o,parameters:[{name:"credentials",type:"Body",schema:pn}]}),fn=Ro({method:"post",path:"/auth/signout",alias:"signOut",description:"Signs you out of the current session. This call invalidates the authentication token that is created by a call to Sign In.",response:ce.void()}),hn=dn([mn,fn]),hr=[...hn];var Se=class{_apiClient;constructor(e){this._apiClient=e}get interceptors(){return this._apiClient.axios.interceptors}};var z=class extends Se{_creds;get authHeader(){if(!this._creds)throw new Error("Authenticate by calling signIn() first");return{headers:{"X-Tableau-Auth":this._creds.token}}}get userId(){if(!this._creds)throw new Error("Authenticate by calling signIn() first");return this._creds.user.id}constructor(e,r){super(e),this._creds=r}};var nt=class extends Se{constructor(e){super(new xo(e,hr))}signIn=async e=>(await this._apiClient.signIn({credentials:{site:{contentUrl:e.siteName},...await(async()=>{switch(e.type){case"pat":return{personalAccessTokenName:e.patName,personalAccessTokenSecret:e.patValue};case"direct-trust":return{jwt:await Co({username:e.username,connectedApp:{clientId:e.clientId,secretId:e.secretId,secretValue:e.secretValue},scopes:e.scopes,additionalPayload:e.additionalPayload})}}})()}})).credentials},Ft=class extends z{constructor(e,r){super(new xo(e,hr),r)}signOut=async()=>{await this._apiClient.signOut(void 0,{...this.authHeader})}};import{Zodios as An}from"@zodios/core";import{makeApi as bn,makeEndpoint as Tn}from"@zodios/core";import{z as ke}from"zod";import{z as D}from"zod";var gn=D.enum(["hitsTotal","hitsSmallSpanTotal","hitsMediumSpanTotal","hitsLargeSpanTotal","downstreamWorkbookCount"]),vo=D.array(D.object({method:gn,sortDirection:D.enum(["asc","desc"]).default("asc").optional()})).nonempty(),Lo=D.enum(["lens","datasource","virtualconnection","collection","project","flow","datarole","table","database","view","workbook"]),Do=D.union([D.array(D.string().datetime()).nonempty(),D.object({startDate:D.string().datetime(),endDate:D.string().datetime().optional()}).strict(),D.object({startDate:D.string().datetime().optional(),endDate:D.string().datetime()}).strict()]),gr=D.object({contentTypes:D.array(Lo).nonempty(),ownerIds:D.array(D.number().int()).nonempty(),modifiedTime:Do}).partial(),Io=D.union([gr.extend({contentTypes:D.array(Lo).nonempty()}).strict(),gr.extend({ownerIds:D.array(D.number().int()).nonempty()}).strict(),gr.extend({modifiedTime:Do}).strict()]),yn=D.object({uri:D.string(),content:D.record(D.string(),D.unknown())}),Oo=D.object({next:D.string(),prev:D.string(),pageIndex:D.number().int(),startIndex:D.number().int(),total:D.number().int(),limit:D.number().int(),items:D.array(yn)}).partial();var wn=Tn({method:"get",path:"/search",alias:"searchContent",description:"Searches across all supported content types for objects relevant to the search expression specified in the querystring of the request URI.",parameters:[{name:"terms",type:"Query",schema:ke.string().optional()},{name:"page",type:"Query",schema:ke.number().int().optional()},{name:"limit",type:"Query",schema:ke.number().int().optional()},{name:"order_by",type:"Query",schema:ke.string().optional()},{name:"filter",type:"Query",schema:ke.string().optional()}],response:ke.object({hits:Oo})}),En=bn([wn]),Po=[...En];var at=class extends z{constructor(e,r){super(new An(e,Po),r)}searchContent=async e=>(Object.entries(e).forEach(([o,i])=>{i===void 0&&delete e[o]}),(await this._apiClient.searchContent({queries:e,...this.authHeader})).hits)};import{Zodios as xn}from"@zodios/core";import{makeApi as Sn,makeEndpoint as Cn}from"@zodios/core";import{z as Ue}from"zod";import{z as kt}from"zod";import{z as yr}from"zod";var Nt=yr.object({name:yr.string(),id:yr.string()});var Fo=kt.object({id:kt.string(),name:kt.string(),description:kt.string().optional(),project:Nt});import{z as Mt}from"zod";var Me=Mt.object({pageNumber:Mt.coerce.number(),pageSize:Mt.coerce.number(),totalAvailable:Mt.coerce.number()});import{z as No}from"zod";var qe=[{name:"pageSize",type:"Query",schema:No.number().optional(),description:"The number of items to return in one response. The minimum is 1. The maximum is 1000. The default is 100."},{name:"pageNumber",type:"Query",schema:No.number().optional(),description:"The offset for paging. The default is 1."}];var _n=Cn({method:"get",path:"/sites/:siteId/datasources",alias:"listDatasources",description:"Returns a list of published data sources on the specified site. Supports a filter string as a query parameter in the format field:operator:value.",parameters:[...qe,{name:"siteId",type:"Path",schema:Ue.string()},{name:"filter",type:"Query",schema:Ue.string().optional(),description:"Filter string in the format field:operator:value (e.g., name:eq:Project Views)"}],response:Ue.object({pagination:Me,datasources:Ue.object({datasource:Ue.optional(Ue.array(Fo))})})}),Rn=Sn([_n]),ko=[...Rn];var lt=class extends z{constructor(e,r){super(new xn(e,ko),r)}listDatasources=async({siteId:e,filter:r,pageSize:o,pageNumber:i})=>{let n=await this._apiClient.listDatasources({params:{siteId:e},queries:{filter:r,pageSize:o,pageNumber:i},...this.authHeader});return{pagination:n.pagination,datasources:n.datasources.datasource??[]}}};import{Zodios as Pn}from"@zodios/core";import{makeApi as vn,makeEndpoint as Ln}from"@zodios/core";import{z as w}from"zod";var Dn=w.object({data:w.object({publishedDatasources:w.array(w.object({name:w.string().or(w.null()),description:w.string().or(w.null()),owner:w.object({name:w.string().or(w.null())}),fields:w.array(w.object({name:w.string(),isHidden:w.boolean().or(w.null()),description:w.string().or(w.null()),descriptionInherited:w.array(w.object({attribute:w.string(),value:w.string().or(w.null())}).or(w.null())).or(w.null()),fullyQualifiedName:w.string(),__typename:w.string(),dataCategory:w.string().or(w.null()).optional(),role:w.string().or(w.null()).optional(),dataType:w.string().or(w.null()).optional(),defaultFormat:w.string().or(w.null()).optional(),semanticRole:w.string().or(w.null()).optional(),aggregation:w.string().or(w.null()).optional(),aggregationParam:w.string().or(w.null()).optional(),formula:w.string().or(w.null()).optional(),isAutoGenerated:w.boolean().or(w.null()).optional(),hasUserReference:w.boolean().or(w.null()).optional(),binSize:w.number().or(w.null()).optional(),hasOther:w.boolean().or(w.null()).optional(),delimiter:w.string().or(w.null()).optional(),combinationType:w.string().or(w.null()).optional()}))}))})}),In=Ln({method:"post",path:"/graphql",alias:"graphql",response:Dn,parameters:[{name:"query",type:"Body",schema:w.object({query:w.string()})}]}),On=vn([In]),Mo=[...On];var ct=class extends z{constructor(e,r){super(new Pn(e,Mo),r)}graphql=async e=>await this._apiClient.graphql({query:e},{...this.authHeader})};import{Zodios as Ul}from"@zodios/core";import{Err as Hi,Ok as jl}from"ts-results-es";function ut(t,e){return function(){return t.apply(e,arguments)}}var{toString:Fn}=Object.prototype,{getPrototypeOf:Tr}=Object,{iterator:Ut,toStringTag:Uo}=Symbol,jt=(t=>e=>{let r=Fn.call(e);return t[r]||(t[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),ne=t=>(t=t.toLowerCase(),e=>jt(e)===t),Bt=t=>e=>typeof e===t,{isArray:Be}=Array,je=Bt("undefined");function dt(t){return t!==null&&!je(t)&&t.constructor!==null&&!je(t.constructor)&&K(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}var jo=ne("ArrayBuffer");function Nn(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&jo(t.buffer),e}var kn=Bt("string"),K=Bt("function"),Bo=Bt("number"),pt=t=>t!==null&&typeof t=="object",Mn=t=>t===!0||t===!1,qt=t=>{if(jt(t)!=="object")return!1;let e=Tr(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Uo in t)&&!(Ut in t)},qn=t=>{if(!pt(t)||dt(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},Un=ne("Date"),jn=ne("File"),Bn=ne("Blob"),Vn=ne("FileList"),zn=t=>pt(t)&&K(t.pipe),Wn=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||K(t.append)&&((e=jt(t))==="formdata"||e==="object"&&K(t.toString)&&t.toString()==="[object FormData]"))},Hn=ne("URLSearchParams"),[Gn,Qn,$n,Zn]=["ReadableStream","Request","Response","Headers"].map(ne),Jn=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function mt(t,e,{allOwnKeys:r=!1}={}){if(t===null||typeof t>"u")return;let o,i;if(typeof t!="object"&&(t=[t]),Be(t))for(o=0,i=t.length;o<i;o++)e.call(null,t[o],o,t);else{if(dt(t))return;let n=r?Object.getOwnPropertyNames(t):Object.keys(t),s=n.length,l;for(o=0;o<s;o++)l=n[o],e.call(null,t[l],l,t)}}function Vo(t,e){if(dt(t))return null;e=e.toLowerCase();let r=Object.keys(t),o=r.length,i;for(;o-- >0;)if(i=r[o],e===i.toLowerCase())return i;return null}var Ce=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,zo=t=>!je(t)&&t!==Ce;function br(){let{caseless:t,skipUndefined:e}=zo(this)&&this||{},r={},o=(i,n)=>{let s=t&&Vo(r,n)||n;qt(r[s])&&qt(i)?r[s]=br(r[s],i):qt(i)?r[s]=br({},i):Be(i)?r[s]=i.slice():(!e||!je(i))&&(r[s]=i)};for(let i=0,n=arguments.length;i<n;i++)arguments[i]&&mt(arguments[i],o);return r}var Kn=(t,e,r,{allOwnKeys:o}={})=>(mt(e,(i,n)=>{r&&K(i)?t[n]=ut(i,r):t[n]=i},{allOwnKeys:o}),t),Yn=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),Xn=(t,e,r,o)=>{t.prototype=Object.create(e.prototype,o),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),r&&Object.assign(t.prototype,r)},ea=(t,e,r,o)=>{let i,n,s,l={};if(e=e||{},t==null)return e;do{for(i=Object.getOwnPropertyNames(t),n=i.length;n-- >0;)s=i[n],(!o||o(s,t,e))&&!l[s]&&(e[s]=t[s],l[s]=!0);t=r!==!1&&Tr(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},ta=(t,e,r)=>{t=String(t),(r===void 0||r>t.length)&&(r=t.length),r-=e.length;let o=t.indexOf(e,r);return o!==-1&&o===r},ra=t=>{if(!t)return null;if(Be(t))return t;let e=t.length;if(!Bo(e))return null;let r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},oa=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&Tr(Uint8Array)),ia=(t,e)=>{let o=(t&&t[Ut]).call(t),i;for(;(i=o.next())&&!i.done;){let n=i.value;e.call(t,n[0],n[1])}},sa=(t,e)=>{let r,o=[];for(;(r=t.exec(e))!==null;)o.push(r);return o},na=ne("HTMLFormElement"),aa=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,o,i){return o.toUpperCase()+i}),qo=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),la=ne("RegExp"),Wo=(t,e)=>{let r=Object.getOwnPropertyDescriptors(t),o={};mt(r,(i,n)=>{let s;(s=e(i,n,t))!==!1&&(o[n]=s||i)}),Object.defineProperties(t,o)},ca=t=>{Wo(t,(e,r)=>{if(K(t)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;let o=t[r];if(K(o)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},ua=(t,e)=>{let r={},o=i=>{i.forEach(n=>{r[n]=!0})};return Be(t)?o(t):o(String(t).split(e)),r},da=()=>{},pa=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function ma(t){return!!(t&&K(t.append)&&t[Uo]==="FormData"&&t[Ut])}var fa=t=>{let e=new Array(10),r=(o,i)=>{if(pt(o)){if(e.indexOf(o)>=0)return;if(dt(o))return o;if(!("toJSON"in o)){e[i]=o;let n=Be(o)?[]:{};return mt(o,(s,l)=>{let u=r(s,i+1);!je(u)&&(n[l]=u)}),e[i]=void 0,n}}return o};return r(t,0)},ha=ne("AsyncFunction"),ga=t=>t&&(pt(t)||K(t))&&K(t.then)&&K(t.catch),Ho=((t,e)=>t?setImmediate:e?((r,o)=>(Ce.addEventListener("message",({source:i,data:n})=>{i===Ce&&n===r&&o.length&&o.shift()()},!1),i=>{o.push(i),Ce.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",K(Ce.postMessage)),ya=typeof queueMicrotask<"u"?queueMicrotask.bind(Ce):typeof process<"u"&&process.nextTick||Ho,ba=t=>t!=null&&K(t[Ut]),a={isArray:Be,isArrayBuffer:jo,isBuffer:dt,isFormData:Wn,isArrayBufferView:Nn,isString:kn,isNumber:Bo,isBoolean:Mn,isObject:pt,isPlainObject:qt,isEmptyObject:qn,isReadableStream:Gn,isRequest:Qn,isResponse:$n,isHeaders:Zn,isUndefined:je,isDate:Un,isFile:jn,isBlob:Bn,isRegExp:la,isFunction:K,isStream:zn,isURLSearchParams:Hn,isTypedArray:oa,isFileList:Vn,forEach:mt,merge:br,extend:Kn,trim:Jn,stripBOM:Yn,inherits:Xn,toFlatObject:ea,kindOf:jt,kindOfTest:ne,endsWith:ta,toArray:ra,forEachEntry:ia,matchAll:sa,isHTMLForm:na,hasOwnProperty:qo,hasOwnProp:qo,reduceDescriptors:Wo,freezeMethods:ca,toObjectSet:ua,toCamelCase:aa,noop:da,toFiniteNumber:pa,findKey:Vo,global:Ce,isContextDefined:zo,isSpecCompliantForm:ma,toJSONObject:fa,isAsyncFn:ha,isThenable:ga,setImmediate:Ho,asap:ya,isIterable:ba};function Ve(t,e,r,o,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),r&&(this.config=r),o&&(this.request=o),i&&(this.response=i,this.status=i.status?i.status:null)}a.inherits(Ve,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 Go=Ve.prototype,Qo={};["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(t=>{Qo[t]={value:t}});Object.defineProperties(Ve,Qo);Object.defineProperty(Go,"isAxiosError",{value:!0});Ve.from=(t,e,r,o,i,n)=>{let s=Object.create(Go);a.toFlatObject(t,s,function(c){return c!==Error.prototype},p=>p!=="isAxiosError");let l=t&&t.message?t.message:"Error",u=e==null&&t?t.code:e;return Ve.call(s,l,u,r,o,i),t&&s.cause==null&&Object.defineProperty(s,"cause",{value:t,configurable:!0}),s.name=t&&t.name||"Error",n&&Object.assign(s,n),s};var g=Ve;import Ta from"form-data";var Vt=Ta;function wr(t){return a.isPlainObject(t)||a.isArray(t)}function Zo(t){return a.endsWith(t,"[]")?t.slice(0,-2):t}function $o(t,e,r){return t?t.concat(e).map(function(i,n){return i=Zo(i),!r&&n?"["+i+"]":i}).join(r?".":""):e}function wa(t){return a.isArray(t)&&!t.some(wr)}var Ea=a.toFlatObject(a,{},null,function(e){return/^is[A-Z]/.test(e)});function Aa(t,e,r){if(!a.isObject(t))throw new TypeError("target must be an object");e=e||new(Vt||FormData),r=a.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,T){return!a.isUndefined(T[y])});let o=r.metaTokens,i=r.visitor||c,n=r.dots,s=r.indexes,u=(r.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(e);if(!a.isFunction(i))throw new TypeError("visitor must be a function");function p(m){if(m===null)return"";if(a.isDate(m))return m.toISOString();if(a.isBoolean(m))return m.toString();if(!u&&a.isBlob(m))throw new g("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(m)||a.isTypedArray(m)?u&&typeof Blob=="function"?new Blob([m]):Buffer.from(m):m}function c(m,y,T){let _=m;if(m&&!T&&typeof m=="object"){if(a.endsWith(y,"{}"))y=o?y:y.slice(0,-2),m=JSON.stringify(m);else if(a.isArray(m)&&wa(m)||(a.isFileList(m)||a.endsWith(y,"[]"))&&(_=a.toArray(m)))return y=Zo(y),_.forEach(function(S,x){!(a.isUndefined(S)||S===null)&&e.append(s===!0?$o([y],x,n):s===null?y:y+"[]",p(S))}),!1}return wr(m)?!0:(e.append($o(T,y,n),p(m)),!1)}let h=[],b=Object.assign(Ea,{defaultVisitor:c,convertValue:p,isVisitable:wr});function E(m,y){if(!a.isUndefined(m)){if(h.indexOf(m)!==-1)throw Error("Circular reference detected in "+y.join("."));h.push(m),a.forEach(m,function(_,F){(!(a.isUndefined(_)||_===null)&&i.call(e,_,a.isString(F)?F.trim():F,y,b))===!0&&E(_,y?y.concat(F):[F])}),h.pop()}}if(!a.isObject(t))throw new TypeError("data must be an object");return E(t),e}var Te=Aa;function Jo(t){let e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(o){return e[o]})}function Ko(t,e){this._pairs=[],t&&Te(t,this,e)}var Yo=Ko.prototype;Yo.append=function(e,r){this._pairs.push([e,r])};Yo.toString=function(e){let r=e?function(o){return e.call(this,o,Jo)}:Jo;return this._pairs.map(function(i){return r(i[0])+"="+r(i[1])},"").join("&")};var Xo=Ko;function Sa(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function _e(t,e,r){if(!e)return t;let o=r&&r.encode||Sa;a.isFunction(r)&&(r={serialize:r});let i=r&&r.serialize,n;if(i?n=i(e,r):n=a.isURLSearchParams(e)?e.toString():new Xo(e,r).toString(o),n){let s=t.indexOf("#");s!==-1&&(t=t.slice(0,s)),t+=(t.indexOf("?")===-1?"?":"&")+n}return t}var Er=class{constructor(){this.handlers=[]}use(e,r,o){return this.handlers.push({fulfilled:e,rejected:r,synchronous:o?o.synchronous:!1,runWhen:o?o.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(o){o!==null&&e(o)})}},Ar=Er;var ze={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};import _a from"crypto";import Ca from"url";var ei=Ca.URLSearchParams;var Sr="abcdefghijklmnopqrstuvwxyz",ti="0123456789",ri={DIGIT:ti,ALPHA:Sr,ALPHA_DIGIT:Sr+Sr.toUpperCase()+ti},Ra=(t=16,e=ri.ALPHA_DIGIT)=>{let r="",{length:o}=e,i=new Uint32Array(t);_a.randomFillSync(i);for(let n=0;n<t;n++)r+=e[i[n]%o];return r},oi={isNode:!0,classes:{URLSearchParams:ei,FormData:Vt,Blob:typeof Blob<"u"&&Blob||null},ALPHABET:ri,generateString:Ra,protocols:["http","https","file","data"]};var Rr={};Xs(Rr,{hasBrowserEnv:()=>_r,hasStandardBrowserEnv:()=>xa,hasStandardBrowserWebWorkerEnv:()=>va,navigator:()=>Cr,origin:()=>La});var _r=typeof window<"u"&&typeof document<"u",Cr=typeof navigator=="object"&&navigator||void 0,xa=_r&&(!Cr||["ReactNative","NativeScript","NS"].indexOf(Cr.product)<0),va=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",La=_r&&window.location.href||"http://localhost";var I={...Rr,...oi};function xr(t,e){return Te(t,new I.classes.URLSearchParams,{visitor:function(r,o,i,n){return I.isNode&&a.isBuffer(r)?(this.append(o,r.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)},...e})}function Da(t){return a.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Ia(t){let e={},r=Object.keys(t),o,i=r.length,n;for(o=0;o<i;o++)n=r[o],e[n]=t[n];return e}function Oa(t){function e(r,o,i,n){let s=r[n++];if(s==="__proto__")return!0;let l=Number.isFinite(+s),u=n>=r.length;return s=!s&&a.isArray(i)?i.length:s,u?(a.hasOwnProp(i,s)?i[s]=[i[s],o]:i[s]=o,!l):((!i[s]||!a.isObject(i[s]))&&(i[s]=[]),e(r,o,i[s],n)&&a.isArray(i[s])&&(i[s]=Ia(i[s])),!l)}if(a.isFormData(t)&&a.isFunction(t.entries)){let r={};return a.forEachEntry(t,(o,i)=>{e(Da(o),i,r,0)}),r}return null}var zt=Oa;function Pa(t,e,r){if(a.isString(t))try{return(e||JSON.parse)(t),a.trim(t)}catch(o){if(o.name!=="SyntaxError")throw o}return(r||JSON.stringify)(t)}var vr={transitional:ze,adapter:["xhr","http","fetch"],transformRequest:[function(e,r){let o=r.getContentType()||"",i=o.indexOf("application/json")>-1,n=a.isObject(e);if(n&&a.isHTMLForm(e)&&(e=new FormData(e)),a.isFormData(e))return i?JSON.stringify(zt(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 r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let l;if(n){if(o.indexOf("application/x-www-form-urlencoded")>-1)return xr(e,this.formSerializer).toString();if((l=a.isFileList(e))||o.indexOf("multipart/form-data")>-1){let u=this.env&&this.env.FormData;return Te(l?{"files[]":e}:e,u&&new u,this.formSerializer)}}return n||i?(r.setContentType("application/json",!1),Pa(e)):e}],transformResponse:[function(e){let r=this.transitional||vr.transitional,o=r&&r.forcedJSONParsing,i=this.responseType==="json";if(a.isResponse(e)||a.isReadableStream(e))return e;if(e&&a.isString(e)&&(o&&!this.responseType||i)){let s=!(r&&r.silentJSONParsing)&&i;try{return JSON.parse(e,this.parseReviver)}catch(l){if(s)throw l.name==="SyntaxError"?g.from(l,g.ERR_BAD_RESPONSE,this,null,this.response):l}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:I.classes.FormData,Blob:I.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"],t=>{vr.headers[t]={}});var We=vr;var Fa=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"]),ii=t=>{let e={},r,o,i;return t&&t.split(`
|
|
4
|
+
`,process.stderr.write(t))},bo=({requestId:t,toolName:e,args:r})=>({type:"tool",requestId:t,tool:{name:e,...r!==void 0?{args:r}:{}}});function be(t){return async(e,r,{logger:o,requestId:i}={logger:e.name})=>{if(Ee(t))return e.server.notification({method:"notifications/message",params:{level:t,logger:o,message:JSON.stringify({timestamp:new Date().toISOString(),currentLogLevel:it,message:r},null,2)}},{relatedRequestId:i})}}import{McpServer as Su}from"@modelcontextprotocol/sdk/server/mcp.js";import{SetLevelRequestSchema as Cu}from"@modelcontextprotocol/sdk/types.js";var To={name:"@tableau/mcp-server",description:"An MCP server for Tableau, providing a suite of tools that will make it easier for developers to build AI applications that integrate with Tableau.",version:"1.9.3",repository:{type:"git",url:"git+https://github.com/tableau/tableau-mcp.git"},homepage:"https://github.com/tableau/tableau-mcp",bugs:"https://github.com/tableau/tableau-mcp/issues",author:"Tableau",type:"module",license:"Apache-2.0",keywords:["tableau","mcp"],bin:{"tableau-mcp-server":"./build/index.js"},scripts:{":build":"npx rimraf ./build && esbuild src/index.ts --bundle --packages=external --platform=node --format=esm --minify --outdir=build --sourcemap",build:"run-s :build exec-perms","build:watch":"npm run :build -- --watch","build:docker":"docker build -t tableau-mcp .",":build:mcpb":"npx -y @anthropic-ai/mcpb pack . tableau-mcp.mcpb","build:mcpb":"run-s build:manifest:script build:manifest :build:mcpb","build:manifest":"node build/scripts/createClaudeMcpBundleManifest.mjs","build:manifest:script":"esbuild src/scripts/createClaudeMcpBundleManifest.ts --bundle --platform=node --format=esm --outdir=build/scripts --sourcemap=inline --out-extension:.js=.mjs","start:http":"node build/index.js","start:http:docker":"docker run -p 3927:3927 -i --rm --env-file env.list tableau-mcp",lint:"npm exec eslint",inspect:"npx @modelcontextprotocol/inspector --config config.json --server tableau",":inspect:http":"npx @modelcontextprotocol/inspector --config config.http.json --server tableau","inspect:http":"run-p start:http :inspect:http","inspect:docker":"npx @modelcontextprotocol/inspector --config config.docker.json --server tableau","inspect:docker:http":"run-p start:http:docker :inspect:http","build:inspect":"run-s build inspect","build:inspect:docker":"run-s build:docker inspect:docker","build:inspect:docker:http":"run-s build:docker inspect:docker:http","exec-perms":"shx chmod +x build/*.js",test:"vitest --config ./vitest.config.ts","test:e2e":"vitest --config ./vitest.config.e2e.ts","test:eval":"vitest --config ./vitest.config.eval.ts",coverage:"vitest run --config ./vitest.config.ts --coverage","version:major":"npm version major --no-git-tag-version","version:minor":"npm version minor --no-git-tag-version","version:patch":"npm version patch --no-git-tag-version"},dependencies:{"@modelcontextprotocol/sdk":"^1.12.1","@zodios/core":"^10.9.6",cors:"^2.8.5",dotenv:"^16.5.0",express:"^5.1.0","fast-levenshtein":"^3.0.0",jose:"^6.0.12","ts-results-es":"^5.0.1",zod:"^3.24.3","zod-validation-error":"^4.0.1"},devDependencies:{"@anthropic-ai/mcpb":"^1.0.0","@eslint/eslintrc":"^3.3.1","@eslint/js":"^9.25.1","@modelcontextprotocol/inspector":"^0.16.6","@openai/agents":"^0.1.9","@types/cors":"^2.8.19","@types/eslint__js":"^8.42.3","@types/express":"^5.0.3","@types/fast-levenshtein":"^0.0.1","@types/node":"^22.15.3","@typescript-eslint/eslint-plugin":"^8.31.1","@typescript-eslint/parser":"^8.31.1","@vitest/coverage-v8":"^3.1.3",esbuild:"^0.25.5",eslint:"^9.25.1","eslint-config-prettier":"^10.1.2","eslint-plugin-prettier":"^5.2.6","eslint-plugin-simple-import-sort":"^12.1.1","npm-run-all":"^4.1.5",openai:"^5.23.2",prettier:"^3.5.3",rimraf:"^6.0.1",shx:"^0.4.0",typescript:"^5.8.3","typescript-eslint":"^8.31.1",vitest:"^3.1.3"},engines:{node:">=20"}};import{Ok as Ic}from"ts-results-es";import{z as as}from"zod";import{Err as wo,Ok as ln}from"ts-results-es";function he(t){if(t instanceof Error)return t.message;try{return JSON.stringify(t)??"undefined"}catch{return`${t}`}}var Eo=t=>{let e=So(t);if(e.isErr())return t;let r=e.value;return Ee("debug")?(r.data?.credentials&&(r.data.credentials="<redacted>"),Array.isArray(r?.data?.datasource?.connections)&&r.data.datasource.connections.forEach(i=>{i.connectionUsername="<redacted>",i.connectionPassword="<redacted>"}),r.headers?.["X-Tableau-Auth"]&&(r.headers["X-Tableau-Auth"]="<redacted>"),r.params?.user_id&&(r.params.user_id="<redacted>")):(delete r.data,delete r.headers,delete r.params),r},Ao=t=>{let e=So(t);if(e.isErr())return t;let r=e.value;return Ee("debug")?r.data?.credentials&&(r.data.credentials="<redacted>"):(delete r.data,delete r.headers),r};function So(t){try{return ln(structuredClone(t))}catch(e){if(e instanceof Error)return wo(e);let r=he(e);return st(`Could not clone object, notification may not be sanitized! Error: ${r}`),wo(new Error(r))}}function Ot(t){return{method:t.method??"UNKNOWN METHOD",url:t.url??"UNKNOWN URL",headers:t.headers,data:t.data,params:t.params}}function Pt(t){return{url:t.config.url??"UNKNOWN URL",status:t.status,headers:t.headers,data:t.data}}import{Zodios as xo}from"@zodios/core";import{randomUUID as cn}from"node:crypto";import{SignJWT as un}from"jose";async function Co({username:t,connectedApp:e,scopes:r,additionalPayload:o}){let i={alg:"HS256",typ:"JWT",kid:e.secretId},n={jti:cn(),iss:e.clientId,aud:"tableau",sub:t,scp:[...r],iat:Math.floor(Date.now()/1e3)-5,exp:Math.floor(Date.now()/1e3)+5*60,...o};return await new un(n).setProtectedHeader(i).sign(new TextEncoder().encode(e.secretValue))}import{makeApi as dn,makeEndpoint as Ro}from"@zodios/core";import{z as ce}from"zod";import{z as Ae}from"zod";var _o=Ae.object({credentials:Ae.object({site:Ae.object({id:Ae.string()}),user:Ae.object({id:Ae.string()}),token:Ae.string()})});var pn=ce.object({credentials:ce.object({site:ce.object({contentUrl:ce.string()})}).and(ce.object({personalAccessTokenName:ce.string(),personalAccessTokenSecret:ce.string()}).or(ce.object({jwt:ce.string()})))}),mn=Ro({method:"post",path:"/auth/signin",alias:"signIn",description:"Signs in with Tableau credentials.",response:_o,parameters:[{name:"credentials",type:"Body",schema:pn}]}),fn=Ro({method:"post",path:"/auth/signout",alias:"signOut",description:"Signs you out of the current session. This call invalidates the authentication token that is created by a call to Sign In.",response:ce.void()}),hn=dn([mn,fn]),hr=[...hn];var Se=class{_apiClient;constructor(e){this._apiClient=e}get interceptors(){return this._apiClient.axios.interceptors}};var z=class extends Se{_creds;get authHeader(){if(!this._creds)throw new Error("Authenticate by calling signIn() first");return{headers:{"X-Tableau-Auth":this._creds.token}}}get userId(){if(!this._creds)throw new Error("Authenticate by calling signIn() first");return this._creds.user.id}constructor(e,r){super(e),this._creds=r}};var nt=class extends Se{constructor(e){super(new xo(e,hr))}signIn=async e=>(await this._apiClient.signIn({credentials:{site:{contentUrl:e.siteName},...await(async()=>{switch(e.type){case"pat":return{personalAccessTokenName:e.patName,personalAccessTokenSecret:e.patValue};case"direct-trust":return{jwt:await Co({username:e.username,connectedApp:{clientId:e.clientId,secretId:e.secretId,secretValue:e.secretValue},scopes:e.scopes,additionalPayload:e.additionalPayload})}}})()}})).credentials},Ft=class extends z{constructor(e,r){super(new xo(e,hr),r)}signOut=async()=>{await this._apiClient.signOut(void 0,{...this.authHeader})}};import{Zodios as An}from"@zodios/core";import{makeApi as bn,makeEndpoint as Tn}from"@zodios/core";import{z as ke}from"zod";import{z as D}from"zod";var gn=D.enum(["hitsTotal","hitsSmallSpanTotal","hitsMediumSpanTotal","hitsLargeSpanTotal","downstreamWorkbookCount"]),vo=D.array(D.object({method:gn,sortDirection:D.enum(["asc","desc"]).default("asc").optional()})).nonempty(),Lo=D.enum(["lens","datasource","virtualconnection","collection","project","flow","datarole","table","database","view","workbook"]),Do=D.union([D.array(D.string().datetime()).nonempty(),D.object({startDate:D.string().datetime(),endDate:D.string().datetime().optional()}).strict(),D.object({startDate:D.string().datetime().optional(),endDate:D.string().datetime()}).strict()]),gr=D.object({contentTypes:D.array(Lo).nonempty(),ownerIds:D.array(D.number().int()).nonempty(),modifiedTime:Do}).partial(),Io=D.union([gr.extend({contentTypes:D.array(Lo).nonempty()}).strict(),gr.extend({ownerIds:D.array(D.number().int()).nonempty()}).strict(),gr.extend({modifiedTime:Do}).strict()]),yn=D.object({uri:D.string(),content:D.record(D.string(),D.unknown())}),Oo=D.object({next:D.string(),prev:D.string(),pageIndex:D.number().int(),startIndex:D.number().int(),total:D.number().int(),limit:D.number().int(),items:D.array(yn)}).partial();var wn=Tn({method:"get",path:"/search",alias:"searchContent",description:"Searches across all supported content types for objects relevant to the search expression specified in the querystring of the request URI.",parameters:[{name:"terms",type:"Query",schema:ke.string().optional()},{name:"page",type:"Query",schema:ke.number().int().optional()},{name:"limit",type:"Query",schema:ke.number().int().optional()},{name:"order_by",type:"Query",schema:ke.string().optional()},{name:"filter",type:"Query",schema:ke.string().optional()}],response:ke.object({hits:Oo})}),En=bn([wn]),Po=[...En];var at=class extends z{constructor(e,r){super(new An(e,Po),r)}searchContent=async e=>(Object.entries(e).forEach(([o,i])=>{i===void 0&&delete e[o]}),(await this._apiClient.searchContent({queries:e,...this.authHeader})).hits)};import{Zodios as xn}from"@zodios/core";import{makeApi as Sn,makeEndpoint as Cn}from"@zodios/core";import{z as Ue}from"zod";import{z as kt}from"zod";import{z as yr}from"zod";var Nt=yr.object({name:yr.string(),id:yr.string()});var Fo=kt.object({id:kt.string(),name:kt.string(),description:kt.string().optional(),project:Nt});import{z as Mt}from"zod";var Me=Mt.object({pageNumber:Mt.coerce.number(),pageSize:Mt.coerce.number(),totalAvailable:Mt.coerce.number()});import{z as No}from"zod";var qe=[{name:"pageSize",type:"Query",schema:No.number().optional(),description:"The number of items to return in one response. The minimum is 1. The maximum is 1000. The default is 100."},{name:"pageNumber",type:"Query",schema:No.number().optional(),description:"The offset for paging. The default is 1."}];var _n=Cn({method:"get",path:"/sites/:siteId/datasources",alias:"listDatasources",description:"Returns a list of published data sources on the specified site. Supports a filter string as a query parameter in the format field:operator:value.",parameters:[...qe,{name:"siteId",type:"Path",schema:Ue.string()},{name:"filter",type:"Query",schema:Ue.string().optional(),description:"Filter string in the format field:operator:value (e.g., name:eq:Project Views)"}],response:Ue.object({pagination:Me,datasources:Ue.object({datasource:Ue.optional(Ue.array(Fo))})})}),Rn=Sn([_n]),ko=[...Rn];var lt=class extends z{constructor(e,r){super(new xn(e,ko),r)}listDatasources=async({siteId:e,filter:r,pageSize:o,pageNumber:i})=>{let n=await this._apiClient.listDatasources({params:{siteId:e},queries:{filter:r,pageSize:o,pageNumber:i},...this.authHeader});return{pagination:n.pagination,datasources:n.datasources.datasource??[]}}};import{Zodios as Pn}from"@zodios/core";import{makeApi as vn,makeEndpoint as Ln}from"@zodios/core";import{z as w}from"zod";var Dn=w.object({data:w.object({publishedDatasources:w.array(w.object({name:w.string().or(w.null()),description:w.string().or(w.null()),owner:w.object({name:w.string().or(w.null())}),fields:w.array(w.object({name:w.string(),isHidden:w.boolean().or(w.null()),description:w.string().or(w.null()),descriptionInherited:w.array(w.object({attribute:w.string(),value:w.string().or(w.null())}).or(w.null())).or(w.null()),fullyQualifiedName:w.string(),__typename:w.string(),dataCategory:w.string().or(w.null()).optional(),role:w.string().or(w.null()).optional(),dataType:w.string().or(w.null()).optional(),defaultFormat:w.string().or(w.null()).optional(),semanticRole:w.string().or(w.null()).optional(),aggregation:w.string().or(w.null()).optional(),aggregationParam:w.string().or(w.null()).optional(),formula:w.string().or(w.null()).optional(),isAutoGenerated:w.boolean().or(w.null()).optional(),hasUserReference:w.boolean().or(w.null()).optional(),binSize:w.number().or(w.null()).optional(),hasOther:w.boolean().or(w.null()).optional(),delimiter:w.string().or(w.null()).optional(),combinationType:w.string().or(w.null()).optional()}))}))})}),In=Ln({method:"post",path:"/graphql",alias:"graphql",response:Dn,parameters:[{name:"query",type:"Body",schema:w.object({query:w.string()})}]}),On=vn([In]),Mo=[...On];var ct=class extends z{constructor(e,r){super(new Pn(e,Mo),r)}graphql=async e=>await this._apiClient.graphql({query:e},{...this.authHeader})};import{Zodios as Ul}from"@zodios/core";import{Err as Hi,Ok as jl}from"ts-results-es";function ut(t,e){return function(){return t.apply(e,arguments)}}var{toString:Fn}=Object.prototype,{getPrototypeOf:Tr}=Object,{iterator:Ut,toStringTag:Uo}=Symbol,jt=(t=>e=>{let r=Fn.call(e);return t[r]||(t[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),ne=t=>(t=t.toLowerCase(),e=>jt(e)===t),Bt=t=>e=>typeof e===t,{isArray:Be}=Array,je=Bt("undefined");function dt(t){return t!==null&&!je(t)&&t.constructor!==null&&!je(t.constructor)&&K(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}var jo=ne("ArrayBuffer");function Nn(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&jo(t.buffer),e}var kn=Bt("string"),K=Bt("function"),Bo=Bt("number"),pt=t=>t!==null&&typeof t=="object",Mn=t=>t===!0||t===!1,qt=t=>{if(jt(t)!=="object")return!1;let e=Tr(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Uo in t)&&!(Ut in t)},qn=t=>{if(!pt(t)||dt(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},Un=ne("Date"),jn=ne("File"),Bn=ne("Blob"),Vn=ne("FileList"),zn=t=>pt(t)&&K(t.pipe),Wn=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||K(t.append)&&((e=jt(t))==="formdata"||e==="object"&&K(t.toString)&&t.toString()==="[object FormData]"))},Hn=ne("URLSearchParams"),[Gn,Qn,$n,Zn]=["ReadableStream","Request","Response","Headers"].map(ne),Jn=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function mt(t,e,{allOwnKeys:r=!1}={}){if(t===null||typeof t>"u")return;let o,i;if(typeof t!="object"&&(t=[t]),Be(t))for(o=0,i=t.length;o<i;o++)e.call(null,t[o],o,t);else{if(dt(t))return;let n=r?Object.getOwnPropertyNames(t):Object.keys(t),s=n.length,l;for(o=0;o<s;o++)l=n[o],e.call(null,t[l],l,t)}}function Vo(t,e){if(dt(t))return null;e=e.toLowerCase();let r=Object.keys(t),o=r.length,i;for(;o-- >0;)if(i=r[o],e===i.toLowerCase())return i;return null}var Ce=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,zo=t=>!je(t)&&t!==Ce;function br(){let{caseless:t,skipUndefined:e}=zo(this)&&this||{},r={},o=(i,n)=>{let s=t&&Vo(r,n)||n;qt(r[s])&&qt(i)?r[s]=br(r[s],i):qt(i)?r[s]=br({},i):Be(i)?r[s]=i.slice():(!e||!je(i))&&(r[s]=i)};for(let i=0,n=arguments.length;i<n;i++)arguments[i]&&mt(arguments[i],o);return r}var Kn=(t,e,r,{allOwnKeys:o}={})=>(mt(e,(i,n)=>{r&&K(i)?t[n]=ut(i,r):t[n]=i},{allOwnKeys:o}),t),Yn=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),Xn=(t,e,r,o)=>{t.prototype=Object.create(e.prototype,o),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),r&&Object.assign(t.prototype,r)},ea=(t,e,r,o)=>{let i,n,s,l={};if(e=e||{},t==null)return e;do{for(i=Object.getOwnPropertyNames(t),n=i.length;n-- >0;)s=i[n],(!o||o(s,t,e))&&!l[s]&&(e[s]=t[s],l[s]=!0);t=r!==!1&&Tr(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},ta=(t,e,r)=>{t=String(t),(r===void 0||r>t.length)&&(r=t.length),r-=e.length;let o=t.indexOf(e,r);return o!==-1&&o===r},ra=t=>{if(!t)return null;if(Be(t))return t;let e=t.length;if(!Bo(e))return null;let r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},oa=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&Tr(Uint8Array)),ia=(t,e)=>{let o=(t&&t[Ut]).call(t),i;for(;(i=o.next())&&!i.done;){let n=i.value;e.call(t,n[0],n[1])}},sa=(t,e)=>{let r,o=[];for(;(r=t.exec(e))!==null;)o.push(r);return o},na=ne("HTMLFormElement"),aa=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,o,i){return o.toUpperCase()+i}),qo=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),la=ne("RegExp"),Wo=(t,e)=>{let r=Object.getOwnPropertyDescriptors(t),o={};mt(r,(i,n)=>{let s;(s=e(i,n,t))!==!1&&(o[n]=s||i)}),Object.defineProperties(t,o)},ca=t=>{Wo(t,(e,r)=>{if(K(t)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;let o=t[r];if(K(o)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},ua=(t,e)=>{let r={},o=i=>{i.forEach(n=>{r[n]=!0})};return Be(t)?o(t):o(String(t).split(e)),r},da=()=>{},pa=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function ma(t){return!!(t&&K(t.append)&&t[Uo]==="FormData"&&t[Ut])}var fa=t=>{let e=new Array(10),r=(o,i)=>{if(pt(o)){if(e.indexOf(o)>=0)return;if(dt(o))return o;if(!("toJSON"in o)){e[i]=o;let n=Be(o)?[]:{};return mt(o,(s,l)=>{let u=r(s,i+1);!je(u)&&(n[l]=u)}),e[i]=void 0,n}}return o};return r(t,0)},ha=ne("AsyncFunction"),ga=t=>t&&(pt(t)||K(t))&&K(t.then)&&K(t.catch),Ho=((t,e)=>t?setImmediate:e?((r,o)=>(Ce.addEventListener("message",({source:i,data:n})=>{i===Ce&&n===r&&o.length&&o.shift()()},!1),i=>{o.push(i),Ce.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",K(Ce.postMessage)),ya=typeof queueMicrotask<"u"?queueMicrotask.bind(Ce):typeof process<"u"&&process.nextTick||Ho,ba=t=>t!=null&&K(t[Ut]),a={isArray:Be,isArrayBuffer:jo,isBuffer:dt,isFormData:Wn,isArrayBufferView:Nn,isString:kn,isNumber:Bo,isBoolean:Mn,isObject:pt,isPlainObject:qt,isEmptyObject:qn,isReadableStream:Gn,isRequest:Qn,isResponse:$n,isHeaders:Zn,isUndefined:je,isDate:Un,isFile:jn,isBlob:Bn,isRegExp:la,isFunction:K,isStream:zn,isURLSearchParams:Hn,isTypedArray:oa,isFileList:Vn,forEach:mt,merge:br,extend:Kn,trim:Jn,stripBOM:Yn,inherits:Xn,toFlatObject:ea,kindOf:jt,kindOfTest:ne,endsWith:ta,toArray:ra,forEachEntry:ia,matchAll:sa,isHTMLForm:na,hasOwnProperty:qo,hasOwnProp:qo,reduceDescriptors:Wo,freezeMethods:ca,toObjectSet:ua,toCamelCase:aa,noop:da,toFiniteNumber:pa,findKey:Vo,global:Ce,isContextDefined:zo,isSpecCompliantForm:ma,toJSONObject:fa,isAsyncFn:ha,isThenable:ga,setImmediate:Ho,asap:ya,isIterable:ba};function Ve(t,e,r,o,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),r&&(this.config=r),o&&(this.request=o),i&&(this.response=i,this.status=i.status?i.status:null)}a.inherits(Ve,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 Go=Ve.prototype,Qo={};["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(t=>{Qo[t]={value:t}});Object.defineProperties(Ve,Qo);Object.defineProperty(Go,"isAxiosError",{value:!0});Ve.from=(t,e,r,o,i,n)=>{let s=Object.create(Go);a.toFlatObject(t,s,function(c){return c!==Error.prototype},p=>p!=="isAxiosError");let l=t&&t.message?t.message:"Error",u=e==null&&t?t.code:e;return Ve.call(s,l,u,r,o,i),t&&s.cause==null&&Object.defineProperty(s,"cause",{value:t,configurable:!0}),s.name=t&&t.name||"Error",n&&Object.assign(s,n),s};var g=Ve;import Ta from"form-data";var Vt=Ta;function wr(t){return a.isPlainObject(t)||a.isArray(t)}function Zo(t){return a.endsWith(t,"[]")?t.slice(0,-2):t}function $o(t,e,r){return t?t.concat(e).map(function(i,n){return i=Zo(i),!r&&n?"["+i+"]":i}).join(r?".":""):e}function wa(t){return a.isArray(t)&&!t.some(wr)}var Ea=a.toFlatObject(a,{},null,function(e){return/^is[A-Z]/.test(e)});function Aa(t,e,r){if(!a.isObject(t))throw new TypeError("target must be an object");e=e||new(Vt||FormData),r=a.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,T){return!a.isUndefined(T[y])});let o=r.metaTokens,i=r.visitor||c,n=r.dots,s=r.indexes,u=(r.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(e);if(!a.isFunction(i))throw new TypeError("visitor must be a function");function p(m){if(m===null)return"";if(a.isDate(m))return m.toISOString();if(a.isBoolean(m))return m.toString();if(!u&&a.isBlob(m))throw new g("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(m)||a.isTypedArray(m)?u&&typeof Blob=="function"?new Blob([m]):Buffer.from(m):m}function c(m,y,T){let _=m;if(m&&!T&&typeof m=="object"){if(a.endsWith(y,"{}"))y=o?y:y.slice(0,-2),m=JSON.stringify(m);else if(a.isArray(m)&&wa(m)||(a.isFileList(m)||a.endsWith(y,"[]"))&&(_=a.toArray(m)))return y=Zo(y),_.forEach(function(S,x){!(a.isUndefined(S)||S===null)&&e.append(s===!0?$o([y],x,n):s===null?y:y+"[]",p(S))}),!1}return wr(m)?!0:(e.append($o(T,y,n),p(m)),!1)}let h=[],b=Object.assign(Ea,{defaultVisitor:c,convertValue:p,isVisitable:wr});function E(m,y){if(!a.isUndefined(m)){if(h.indexOf(m)!==-1)throw Error("Circular reference detected in "+y.join("."));h.push(m),a.forEach(m,function(_,F){(!(a.isUndefined(_)||_===null)&&i.call(e,_,a.isString(F)?F.trim():F,y,b))===!0&&E(_,y?y.concat(F):[F])}),h.pop()}}if(!a.isObject(t))throw new TypeError("data must be an object");return E(t),e}var Te=Aa;function Jo(t){let e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(o){return e[o]})}function Ko(t,e){this._pairs=[],t&&Te(t,this,e)}var Yo=Ko.prototype;Yo.append=function(e,r){this._pairs.push([e,r])};Yo.toString=function(e){let r=e?function(o){return e.call(this,o,Jo)}:Jo;return this._pairs.map(function(i){return r(i[0])+"="+r(i[1])},"").join("&")};var Xo=Ko;function Sa(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function _e(t,e,r){if(!e)return t;let o=r&&r.encode||Sa;a.isFunction(r)&&(r={serialize:r});let i=r&&r.serialize,n;if(i?n=i(e,r):n=a.isURLSearchParams(e)?e.toString():new Xo(e,r).toString(o),n){let s=t.indexOf("#");s!==-1&&(t=t.slice(0,s)),t+=(t.indexOf("?")===-1?"?":"&")+n}return t}var Er=class{constructor(){this.handlers=[]}use(e,r,o){return this.handlers.push({fulfilled:e,rejected:r,synchronous:o?o.synchronous:!1,runWhen:o?o.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(o){o!==null&&e(o)})}},Ar=Er;var ze={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};import _a from"crypto";import Ca from"url";var ei=Ca.URLSearchParams;var Sr="abcdefghijklmnopqrstuvwxyz",ti="0123456789",ri={DIGIT:ti,ALPHA:Sr,ALPHA_DIGIT:Sr+Sr.toUpperCase()+ti},Ra=(t=16,e=ri.ALPHA_DIGIT)=>{let r="",{length:o}=e,i=new Uint32Array(t);_a.randomFillSync(i);for(let n=0;n<t;n++)r+=e[i[n]%o];return r},oi={isNode:!0,classes:{URLSearchParams:ei,FormData:Vt,Blob:typeof Blob<"u"&&Blob||null},ALPHABET:ri,generateString:Ra,protocols:["http","https","file","data"]};var Rr={};Xs(Rr,{hasBrowserEnv:()=>_r,hasStandardBrowserEnv:()=>xa,hasStandardBrowserWebWorkerEnv:()=>va,navigator:()=>Cr,origin:()=>La});var _r=typeof window<"u"&&typeof document<"u",Cr=typeof navigator=="object"&&navigator||void 0,xa=_r&&(!Cr||["ReactNative","NativeScript","NS"].indexOf(Cr.product)<0),va=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",La=_r&&window.location.href||"http://localhost";var I={...Rr,...oi};function xr(t,e){return Te(t,new I.classes.URLSearchParams,{visitor:function(r,o,i,n){return I.isNode&&a.isBuffer(r)?(this.append(o,r.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)},...e})}function Da(t){return a.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Ia(t){let e={},r=Object.keys(t),o,i=r.length,n;for(o=0;o<i;o++)n=r[o],e[n]=t[n];return e}function Oa(t){function e(r,o,i,n){let s=r[n++];if(s==="__proto__")return!0;let l=Number.isFinite(+s),u=n>=r.length;return s=!s&&a.isArray(i)?i.length:s,u?(a.hasOwnProp(i,s)?i[s]=[i[s],o]:i[s]=o,!l):((!i[s]||!a.isObject(i[s]))&&(i[s]=[]),e(r,o,i[s],n)&&a.isArray(i[s])&&(i[s]=Ia(i[s])),!l)}if(a.isFormData(t)&&a.isFunction(t.entries)){let r={};return a.forEachEntry(t,(o,i)=>{e(Da(o),i,r,0)}),r}return null}var zt=Oa;function Pa(t,e,r){if(a.isString(t))try{return(e||JSON.parse)(t),a.trim(t)}catch(o){if(o.name!=="SyntaxError")throw o}return(r||JSON.stringify)(t)}var vr={transitional:ze,adapter:["xhr","http","fetch"],transformRequest:[function(e,r){let o=r.getContentType()||"",i=o.indexOf("application/json")>-1,n=a.isObject(e);if(n&&a.isHTMLForm(e)&&(e=new FormData(e)),a.isFormData(e))return i?JSON.stringify(zt(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 r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let l;if(n){if(o.indexOf("application/x-www-form-urlencoded")>-1)return xr(e,this.formSerializer).toString();if((l=a.isFileList(e))||o.indexOf("multipart/form-data")>-1){let u=this.env&&this.env.FormData;return Te(l?{"files[]":e}:e,u&&new u,this.formSerializer)}}return n||i?(r.setContentType("application/json",!1),Pa(e)):e}],transformResponse:[function(e){let r=this.transitional||vr.transitional,o=r&&r.forcedJSONParsing,i=this.responseType==="json";if(a.isResponse(e)||a.isReadableStream(e))return e;if(e&&a.isString(e)&&(o&&!this.responseType||i)){let s=!(r&&r.silentJSONParsing)&&i;try{return JSON.parse(e,this.parseReviver)}catch(l){if(s)throw l.name==="SyntaxError"?g.from(l,g.ERR_BAD_RESPONSE,this,null,this.response):l}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:I.classes.FormData,Blob:I.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"],t=>{vr.headers[t]={}});var We=vr;var Fa=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"]),ii=t=>{let e={},r,o,i;return t&&t.split(`
|
|
5
5
|
`).forEach(function(s){i=s.indexOf(":"),r=s.substring(0,i).trim().toLowerCase(),o=s.substring(i+1).trim(),!(!r||e[r]&&Fa[r])&&(r==="set-cookie"?e[r]?e[r].push(o):e[r]=[o]:e[r]=e[r]?e[r]+", "+o:o)}),e};var si=Symbol("internals");function ft(t){return t&&String(t).trim().toLowerCase()}function Wt(t){return t===!1||t==null?t:a.isArray(t)?t.map(Wt):String(t)}function Na(t){let e=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,o;for(;o=r.exec(t);)e[o[1]]=o[2];return e}var ka=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function Lr(t,e,r,o,i){if(a.isFunction(o))return o.call(this,e,r);if(i&&(e=r),!!a.isString(e)){if(a.isString(o))return e.indexOf(o)!==-1;if(a.isRegExp(o))return o.test(e)}}function Ma(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,r,o)=>r.toUpperCase()+o)}function qa(t,e){let r=a.toCamelCase(" "+e);["get","set","has"].forEach(o=>{Object.defineProperty(t,o+r,{value:function(i,n,s){return this[o].call(this,e,i,n,s)},configurable:!0})})}var He=class{constructor(e){e&&this.set(e)}set(e,r,o){let i=this;function n(l,u,p){let c=ft(u);if(!c)throw new Error("header name must be a non-empty string");let h=a.findKey(i,c);(!h||i[h]===void 0||p===!0||p===void 0&&i[h]!==!1)&&(i[h||u]=Wt(l))}let s=(l,u)=>a.forEach(l,(p,c)=>n(p,c,u));if(a.isPlainObject(e)||e instanceof this.constructor)s(e,r);else if(a.isString(e)&&(e=e.trim())&&!ka(e))s(ii(e),r);else if(a.isObject(e)&&a.isIterable(e)){let l={},u,p;for(let c of e){if(!a.isArray(c))throw TypeError("Object iterator must return a key-value pair");l[p=c[0]]=(u=l[p])?a.isArray(u)?[...u,c[1]]:[u,c[1]]:c[1]}s(l,r)}else e!=null&&n(r,e,o);return this}get(e,r){if(e=ft(e),e){let o=a.findKey(this,e);if(o){let i=this[o];if(!r)return i;if(r===!0)return Na(i);if(a.isFunction(r))return r.call(this,i,o);if(a.isRegExp(r))return r.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,r){if(e=ft(e),e){let o=a.findKey(this,e);return!!(o&&this[o]!==void 0&&(!r||Lr(this,this[o],o,r)))}return!1}delete(e,r){let o=this,i=!1;function n(s){if(s=ft(s),s){let l=a.findKey(o,s);l&&(!r||Lr(o,o[l],l,r))&&(delete o[l],i=!0)}}return a.isArray(e)?e.forEach(n):n(e),i}clear(e){let r=Object.keys(this),o=r.length,i=!1;for(;o--;){let n=r[o];(!e||Lr(this,this[n],n,e,!0))&&(delete this[n],i=!0)}return i}normalize(e){let r=this,o={};return a.forEach(this,(i,n)=>{let s=a.findKey(o,n);if(s){r[s]=Wt(i),delete r[n];return}let l=e?Ma(n):String(n).trim();l!==n&&delete r[n],r[l]=Wt(i),o[l]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let r=Object.create(null);return a.forEach(this,(o,i)=>{o!=null&&o!==!1&&(r[i]=e&&a.isArray(o)?o.join(", "):o)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,r])=>e+": "+r).join(`
|
|
6
6
|
`)}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,...r){let o=new this(e);return r.forEach(i=>o.set(i)),o}static accessor(e){let o=(this[si]=this[si]={accessors:{}}).accessors,i=this.prototype;function n(s){let l=ft(s);o[l]||(qa(i,s),o[l]=!0)}return a.isArray(e)?e.forEach(n):n(e),this}};He.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);a.reduceDescriptors(He.prototype,({value:t},e)=>{let r=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(o){this[r]=o}}});a.freezeMethods(He);var q=He;function ht(t,e){let r=this||We,o=e||r,i=q.from(o.headers),n=o.data;return a.forEach(t,function(l){n=l.call(r,n,i.normalize(),e?e.status:void 0)}),i.normalize(),n}function gt(t){return!!(t&&t.__CANCEL__)}function ni(t,e,r){g.call(this,t??"canceled",g.ERR_CANCELED,e,r),this.name="CanceledError"}a.inherits(ni,g,{__CANCEL__:!0});var ee=ni;function ue(t,e,r){let o=r.config.validateStatus;!r.status||!o||o(r.status)?t(r):e(new g("Request failed with status code "+r.status,[g.ERR_BAD_REQUEST,g.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function Dr(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Ir(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function Re(t,e,r){let o=!Dr(e);return t&&(o||r==!1)?Ir(t,e):e}import Ya from"proxy-from-env";import Xa from"http";import el from"https";import tl from"util";import rl from"follow-redirects";import we from"zlib";var xe="1.12.1";function yt(t){let e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}var Ua=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;function Or(t,e,r){let o=r&&r.Blob||I.classes.Blob,i=yt(t);if(e===void 0&&o&&(e=!0),i==="data"){t=i.length?t.slice(i.length+1):t;let n=Ua.exec(t);if(!n)throw new g("Invalid URL",g.ERR_INVALID_URL);let s=n[1],l=n[2],u=n[3],p=Buffer.from(decodeURIComponent(u),l?"base64":"utf8");if(e){if(!o)throw new g("Blob is not supported",g.ERR_NOT_SUPPORT);return new o([p],{type:s})}return p}throw new g("Unsupported protocol "+i,g.ERR_NOT_SUPPORT)}import $e from"stream";import ja from"stream";var Pr=Symbol("internals"),Fr=class extends ja.Transform{constructor(e){e=a.toFlatObject(e,{maxRate:0,chunkSize:64*1024,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,(o,i)=>!a.isUndefined(i[o])),super({readableHighWaterMark:e.chunkSize});let r=this[Pr]={timeWindow:e.timeWindow,chunkSize:e.chunkSize,maxRate:e.maxRate,minChunkSize:e.minChunkSize,bytesSeen:0,isCaptured:!1,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null};this.on("newListener",o=>{o==="progress"&&(r.isCaptured||(r.isCaptured=!0))})}_read(e){let r=this[Pr];return r.onReadCallback&&r.onReadCallback(),super._read(e)}_transform(e,r,o){let i=this[Pr],n=i.maxRate,s=this.readableHighWaterMark,l=i.timeWindow,u=1e3/l,p=n/u,c=i.minChunkSize!==!1?Math.max(i.minChunkSize,p*.01):0,h=(E,m)=>{let y=Buffer.byteLength(E);i.bytesSeen+=y,i.bytes+=y,i.isCaptured&&this.emit("progress",i.bytesSeen),this.push(E)?process.nextTick(m):i.onReadCallback=()=>{i.onReadCallback=null,process.nextTick(m)}},b=(E,m)=>{let y=Buffer.byteLength(E),T=null,_=s,F,S=0;if(n){let x=Date.now();(!i.ts||(S=x-i.ts)>=l)&&(i.ts=x,F=p-i.bytes,i.bytes=F<0?-F:0,S=0),F=p-i.bytes}if(n){if(F<=0)return setTimeout(()=>{m(null,E)},l-S);F<_&&(_=F)}_&&y>_&&y-_>c&&(T=E.subarray(_),E=E.subarray(0,_)),h(E,T?()=>{process.nextTick(m,null,T)}:m)};b(e,function E(m,y){if(m)return o(m);y?b(y,E):o(null)})}},Nr=Fr;import{EventEmitter as ol}from"events";import Va from"util";import{Readable as za}from"stream";var{asyncIterator:ai}=Symbol,Ba=async function*(t){t.stream?yield*t.stream():t.arrayBuffer?yield await t.arrayBuffer():t[ai]?yield*t[ai]():yield t},Ht=Ba;var Wa=I.ALPHABET.ALPHA_DIGIT+"-_",bt=typeof TextEncoder=="function"?new TextEncoder:new Va.TextEncoder,ve=`\r
|
|
7
7
|
`,Ha=bt.encode(ve),Ga=2,kr=class{constructor(e,r){let{escapeName:o}=this.constructor,i=a.isString(r),n=`Content-Disposition: form-data; name="${o(e)}"${!i&&r.name?`; filename="${o(r.name)}"`:""}${ve}`;i?r=bt.encode(String(r).replace(/\r?\n|\r\n?/g,ve)):n+=`Content-Type: ${r.type||"application/octet-stream"}${ve}`,this.headers=bt.encode(n+ve),this.contentLength=i?r.byteLength:r.size,this.size=this.headers.byteLength+this.contentLength+Ga,this.name=e,this.value=r}async*encode(){yield this.headers;let{value:e}=this;a.isTypedArray(e)?yield e:yield*Ht(e),yield Ha}static escapeName(e){return String(e).replace(/[\r\n"]/g,r=>({"\r":"%0D","\n":"%0A",'"':"%22"})[r])}},Qa=(t,e,r)=>{let{tag:o="form-data-boundary",size:i=25,boundary:n=o+"-"+I.generateString(i,Wa)}=r||{};if(!a.isFormData(t))throw TypeError("FormData instance required");if(n.length<1||n.length>70)throw Error("boundary must be 10-70 characters long");let s=bt.encode("--"+n+ve),l=bt.encode("--"+n+"--"+ve),u=l.byteLength,p=Array.from(t.entries()).map(([h,b])=>{let E=new kr(h,b);return u+=E.size,E});u+=s.byteLength*p.length,u=a.toFiniteNumber(u);let c={"Content-Type":`multipart/form-data; boundary=${n}`};return Number.isFinite(u)&&(c["Content-Length"]=u),e&&e(c),za.from(async function*(){for(let h of p)yield s,yield*h.encode();yield l}())},li=Qa;import $a from"stream";var Mr=class extends $a.Transform{__transform(e,r,o){this.push(e),o()}_transform(e,r,o){if(e.length!==0&&(this._transform=this.__transform,e[0]!==120)){let i=Buffer.alloc(2);i[0]=120,i[1]=156,this.push(i,r)}this.__transform(e,r,o)}},ci=Mr;var Za=(t,e)=>a.isAsyncFn(t)?function(...r){let o=r.pop();t.apply(this,r).then(i=>{try{e?o(null,...e(i)):o(null,i)}catch(n){o(n)}},o)}:t,ui=Za;function Ja(t,e){t=t||10;let r=new Array(t),o=new Array(t),i=0,n=0,s;return e=e!==void 0?e:1e3,function(u){let p=Date.now(),c=o[n];s||(s=p),r[i]=u,o[i]=p;let h=n,b=0;for(;h!==i;)b+=r[h++],h=h%t;if(i=(i+1)%t,i===n&&(n=(n+1)%t),p-s<e)return;let E=c&&p-c;return E?Math.round(b*1e3/E):void 0}}var di=Ja;function Ka(t,e){let r=0,o=1e3/e,i,n,s=(p,c=Date.now())=>{r=c,i=null,n&&(clearTimeout(n),n=null),t(...p)};return[(...p)=>{let c=Date.now(),h=c-r;h>=o?s(p,c):(i=p,n||(n=setTimeout(()=>{n=null,s(i)},o-h)))},()=>i&&s(i)]}var pi=Ka;var ge=(t,e,r=3)=>{let o=0,i=di(50,250);return pi(n=>{let s=n.loaded,l=n.lengthComputable?n.total:void 0,u=s-o,p=i(u),c=s<=l;o=s;let h={loaded:s,total:l,progress:l?s/l:void 0,bytes:u,rate:p||void 0,estimated:p&&l&&c?(l-s)/p:void 0,event:n,lengthComputable:l!=null,[e?"download":"upload"]:!0};t(h)},r)},Ge=(t,e)=>{let r=t!=null;return[o=>e[0]({lengthComputable:r,total:t,loaded:o}),e[1]]},Qe=t=>(...e)=>a.asap(()=>t(...e));function qr(t){if(!t||typeof t!="string"||!t.startsWith("data:"))return 0;let e=t.indexOf(",");if(e<0)return 0;let r=t.slice(5,e),o=t.slice(e+1);if(/;base64/i.test(r)){let n=o.length,s=o.length;for(let b=0;b<s;b++)if(o.charCodeAt(b)===37&&b+2<s){let E=o.charCodeAt(b+1),m=o.charCodeAt(b+2);(E>=48&&E<=57||E>=65&&E<=70||E>=97&&E<=102)&&(m>=48&&m<=57||m>=65&&m<=70||m>=97&&m<=102)&&(n-=2,b+=2)}let l=0,u=s-1,p=b=>b>=2&&o.charCodeAt(b-2)===37&&o.charCodeAt(b-1)===51&&(o.charCodeAt(b)===68||o.charCodeAt(b)===100);u>=0&&(o.charCodeAt(u)===61?(l++,u--):p(u)&&(l++,u-=3)),l===1&&u>=0&&(o.charCodeAt(u)===61||p(u))&&l++;let h=Math.floor(n/4)*3-(l||0);return h>0?h:0}return Buffer.byteLength(o,"utf8")}var mi={flush:we.constants.Z_SYNC_FLUSH,finishFlush:we.constants.Z_SYNC_FLUSH},il={flush:we.constants.BROTLI_OPERATION_FLUSH,finishFlush:we.constants.BROTLI_OPERATION_FLUSH},fi=a.isFunction(we.createBrotliDecompress),{http:sl,https:nl}=rl,al=/https:?/,hi=I.protocols.map(t=>t+":"),gi=(t,[e,r])=>(t.on("end",r).on("error",r),e);function ll(t,e){t.beforeRedirects.proxy&&t.beforeRedirects.proxy(t),t.beforeRedirects.config&&t.beforeRedirects.config(t,e)}function bi(t,e,r){let o=e;if(!o&&o!==!1){let i=Ya.getProxyForUrl(r);i&&(o=new URL(i))}if(o){if(o.username&&(o.auth=(o.username||"")+":"+(o.password||"")),o.auth){(o.auth.username||o.auth.password)&&(o.auth=(o.auth.username||"")+":"+(o.auth.password||""));let n=Buffer.from(o.auth,"utf8").toString("base64");t.headers["Proxy-Authorization"]="Basic "+n}t.headers.host=t.hostname+(t.port?":"+t.port:"");let i=o.hostname||o.host;t.hostname=i,t.host=i,t.port=o.port,t.path=r,o.protocol&&(t.protocol=o.protocol.includes(":")?o.protocol:`${o.protocol}:`)}t.beforeRedirects.proxy=function(n){bi(n,e,n.href)}}var cl=typeof process<"u"&&a.kindOf(process)==="process",ul=t=>new Promise((e,r)=>{let o,i,n=(u,p)=>{i||(i=!0,o&&o(u,p))},s=u=>{n(u),e(u)},l=u=>{n(u,!0),r(u)};t(s,l,u=>o=u).catch(l)}),dl=({address:t,family:e})=>{if(!a.isString(t))throw TypeError("address must be a string");return{address:t,family:e||(t.indexOf(".")<0?6:4)}},yi=(t,e)=>dl(a.isObject(t)?t:{address:t,family:e}),Ti=cl&&function(e){return ul(async function(o,i,n){let{data:s,lookup:l,family:u}=e,{responseType:p,responseEncoding:c}=e,h=e.method.toUpperCase(),b,E=!1,m;if(l){let A=ui(l,C=>a.isArray(C)?C:[C]);l=(C,V,G)=>{A(C,V,(k,re,ye)=>{if(k)return G(k);let X=a.isArray(re)?re.map(oe=>yi(oe)):[yi(re,ye)];V.all?G(k,X):G(k,X[0].address,X[0].family)})}}let y=new ol,T=()=>{e.cancelToken&&e.cancelToken.unsubscribe(_),e.signal&&e.signal.removeEventListener("abort",_),y.removeAllListeners()};n((A,C)=>{b=!0,C&&(E=!0,T())});function _(A){y.emit("abort",!A||A.type?new ee(null,e,m):A)}y.once("abort",i),(e.cancelToken||e.signal)&&(e.cancelToken&&e.cancelToken.subscribe(_),e.signal&&(e.signal.aborted?_():e.signal.addEventListener("abort",_)));let F=Re(e.baseURL,e.url,e.allowAbsoluteUrls),S=new URL(F,I.hasBrowserEnv?I.origin:void 0),x=S.protocol||hi[0];if(x==="data:"){if(e.maxContentLength>-1){let C=String(e.url||F||"");if(qr(C)>e.maxContentLength)return i(new g("maxContentLength size of "+e.maxContentLength+" exceeded",g.ERR_BAD_RESPONSE,e))}let A;if(h!=="GET")return ue(o,i,{status:405,statusText:"method not allowed",headers:{},config:e});try{A=Or(e.url,p==="blob",{Blob:e.env&&e.env.Blob})}catch(C){throw g.from(C,g.ERR_BAD_REQUEST,e)}return p==="text"?(A=A.toString(c),(!c||c==="utf8")&&(A=a.stripBOM(A))):p==="stream"&&(A=$e.Readable.from(A)),ue(o,i,{data:A,status:200,statusText:"OK",headers:new q,config:e})}if(hi.indexOf(x)===-1)return i(new g("Unsupported protocol "+x,g.ERR_BAD_REQUEST,e));let L=q.from(e.headers).normalize();L.set("User-Agent","axios/"+xe,!1);let{onUploadProgress:U,onDownloadProgress:j}=e,le=e.maxRate,te,pe;if(a.isSpecCompliantForm(s)){let A=L.getContentType(/boundary=([-_\w\d]{10,70})/i);s=li(s,C=>{L.set(C)},{tag:`axios-${xe}-boundary`,boundary:A&&A[1]||void 0})}else if(a.isFormData(s)&&a.isFunction(s.getHeaders)){if(L.set(s.getHeaders()),!L.hasContentLength())try{let A=await tl.promisify(s.getLength).call(s);Number.isFinite(A)&&A>=0&&L.setContentLength(A)}catch{}}else if(a.isBlob(s)||a.isFile(s))s.size&&L.setContentType(s.type||"application/octet-stream"),L.setContentLength(s.size||0),s=$e.Readable.from(Ht(s));else if(s&&!a.isStream(s)){if(!Buffer.isBuffer(s))if(a.isArrayBuffer(s))s=Buffer.from(new Uint8Array(s));else if(a.isString(s))s=Buffer.from(s,"utf-8");else return i(new g("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",g.ERR_BAD_REQUEST,e));if(L.setContentLength(s.length,!1),e.maxBodyLength>-1&&s.length>e.maxBodyLength)return i(new g("Request body larger than maxBodyLength limit",g.ERR_BAD_REQUEST,e))}let me=a.toFiniteNumber(L.getContentLength());a.isArray(le)?(te=le[0],pe=le[1]):te=pe=le,s&&(U||te)&&(a.isStream(s)||(s=$e.Readable.from(s,{objectMode:!1})),s=$e.pipeline([s,new Nr({maxRate:a.toFiniteNumber(te)})],a.noop),U&&s.on("progress",gi(s,Ge(me,ge(Qe(U),!1,3)))));let Q;if(e.auth){let A=e.auth.username||"",C=e.auth.password||"";Q=A+":"+C}if(!Q&&S.username){let A=S.username,C=S.password;Q=A+":"+C}Q&&L.delete("authorization");let H;try{H=_e(S.pathname+S.search,e.params,e.paramsSerializer).replace(/^\?/,"")}catch(A){let C=new Error(A.message);return C.config=e,C.url=e.url,C.exists=!0,i(C)}L.set("Accept-Encoding","gzip, compress, deflate"+(fi?", br":""),!1);let N={path:H,method:h,headers:L.toJSON(),agents:{http:e.httpAgent,https:e.httpsAgent},auth:Q,protocol:x,family:u,beforeRedirect:ll,beforeRedirects:{}};!a.isUndefined(l)&&(N.lookup=l),e.socketPath?N.socketPath=e.socketPath:(N.hostname=S.hostname.startsWith("[")?S.hostname.slice(1,-1):S.hostname,N.port=S.port,bi(N,e.proxy,x+"//"+S.hostname+(S.port?":"+S.port:"")+N.path));let $,Fe=al.test(N.protocol);if(N.agent=Fe?e.httpsAgent:e.httpAgent,e.transport?$=e.transport:e.maxRedirects===0?$=Fe?el:Xa:(e.maxRedirects&&(N.maxRedirects=e.maxRedirects),e.beforeRedirect&&(N.beforeRedirects.config=e.beforeRedirect),$=Fe?nl:sl),e.maxBodyLength>-1?N.maxBodyLength=e.maxBodyLength:N.maxBodyLength=1/0,e.insecureHTTPParser&&(N.insecureHTTPParser=e.insecureHTTPParser),m=$.request(N,function(C){if(m.destroyed)return;let V=[C],G=+C.headers["content-length"];if(j||pe){let oe=new Nr({maxRate:a.toFiniteNumber(pe)});j&&oe.on("progress",gi(oe,Ge(G,ge(Qe(j),!0,3)))),V.push(oe)}let k=C,re=C.req||m;if(e.decompress!==!1&&C.headers["content-encoding"])switch((h==="HEAD"||C.statusCode===204)&&delete C.headers["content-encoding"],(C.headers["content-encoding"]||"").toLowerCase()){case"gzip":case"x-gzip":case"compress":case"x-compress":V.push(we.createUnzip(mi)),delete C.headers["content-encoding"];break;case"deflate":V.push(new ci),V.push(we.createUnzip(mi)),delete C.headers["content-encoding"];break;case"br":fi&&(V.push(we.createBrotliDecompress(il)),delete C.headers["content-encoding"])}k=V.length>1?$e.pipeline(V,a.noop):V[0];let ye=$e.finished(k,()=>{ye(),T()}),X={status:C.statusCode,statusText:C.statusMessage,headers:new q(C.headers),config:e,request:re};if(p==="stream")X.data=k,ue(o,i,X);else{let oe=[],ho=0;k.on("data",function(Z){oe.push(Z),ho+=Z.length,e.maxContentLength>-1&&ho>e.maxContentLength&&(E=!0,k.destroy(),i(new g("maxContentLength size of "+e.maxContentLength+" exceeded",g.ERR_BAD_RESPONSE,e,re)))}),k.on("aborted",function(){if(E)return;let Z=new g("stream has been aborted",g.ERR_BAD_RESPONSE,e,re);k.destroy(Z),i(Z)}),k.on("error",function(Z){m.destroyed||i(g.from(Z,null,e,re))}),k.on("end",function(){try{let Z=oe.length===1?oe[0]:Buffer.concat(oe);p!=="arraybuffer"&&(Z=Z.toString(c),(!c||c==="utf8")&&(Z=a.stripBOM(Z))),X.data=Z}catch(Z){return i(g.from(Z,null,e,X.request,X))}ue(o,i,X)})}y.once("abort",oe=>{k.destroyed||(k.emit("error",oe),k.destroy())})}),y.once("abort",A=>{i(A),m.destroy(A)}),m.on("error",function(C){i(g.from(C,null,e,m))}),m.on("socket",function(C){C.setKeepAlive(!0,1e3*60)}),e.timeout){let A=parseInt(e.timeout,10);if(Number.isNaN(A)){i(new g("error trying to parse `config.timeout` to int",g.ERR_BAD_OPTION_VALUE,e,m));return}m.setTimeout(A,function(){if(b)return;let V=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",G=e.transitional||ze;e.timeoutErrorMessage&&(V=e.timeoutErrorMessage),i(new g(V,G.clarifyTimeoutError?g.ETIMEDOUT:g.ECONNABORTED,e,m)),_()})}if(a.isStream(s)){let A=!1,C=!1;s.on("end",()=>{A=!0}),s.once("error",V=>{C=!0,m.destroy(V)}),s.on("close",()=>{!A&&!C&&_(new ee("Request stream has been aborted",e,m))}),s.pipe(m)}else m.end(s)})};var wi=I.hasStandardBrowserEnv?((t,e)=>r=>(r=new URL(r,I.origin),t.protocol===r.protocol&&t.host===r.host&&(e||t.port===r.port)))(new URL(I.origin),I.navigator&&/(msie|trident)/i.test(I.navigator.userAgent)):()=>!0;var Ei=I.hasStandardBrowserEnv?{write(t,e,r,o,i,n){let s=[t+"="+encodeURIComponent(e)];a.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),a.isString(o)&&s.push("path="+o),a.isString(i)&&s.push("domain="+i),n===!0&&s.push("secure"),document.cookie=s.join("; ")},read(t){let e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};var Ai=t=>t instanceof q?{...t}:t;function ae(t,e){e=e||{};let r={};function o(p,c,h,b){return a.isPlainObject(p)&&a.isPlainObject(c)?a.merge.call({caseless:b},p,c):a.isPlainObject(c)?a.merge({},c):a.isArray(c)?c.slice():c}function i(p,c,h,b){if(a.isUndefined(c)){if(!a.isUndefined(p))return o(void 0,p,h,b)}else return o(p,c,h,b)}function n(p,c){if(!a.isUndefined(c))return o(void 0,c)}function s(p,c){if(a.isUndefined(c)){if(!a.isUndefined(p))return o(void 0,p)}else return o(void 0,c)}function l(p,c,h){if(h in e)return o(p,c);if(h in t)return o(void 0,p)}let u={url:n,method:n,data:n,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:l,headers:(p,c,h)=>i(Ai(p),Ai(c),h,!0)};return a.forEach(Object.keys({...t,...e}),function(c){let h=u[c]||i,b=h(t[c],e[c],c);a.isUndefined(b)&&h!==l||(r[c]=b)}),r}var Gt=t=>{let e=ae({},t),{data:r,withXSRFToken:o,xsrfHeaderName:i,xsrfCookieName:n,headers:s,auth:l}=e;if(e.headers=s=q.from(s),e.url=_e(Re(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),l&&s.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),a.isFormData(r)){if(I.hasStandardBrowserEnv||I.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(a.isFunction(r.getHeaders)){let u=r.getHeaders(),p=["content-type","content-length"];Object.entries(u).forEach(([c,h])=>{p.includes(c.toLowerCase())&&s.set(c,h)})}}if(I.hasStandardBrowserEnv&&(o&&a.isFunction(o)&&(o=o(e)),o||o!==!1&&wi(e.url))){let u=i&&n&&Ei.read(n);u&&s.set(i,u)}return e};var pl=typeof XMLHttpRequest<"u",Si=pl&&function(t){return new Promise(function(r,o){let i=Gt(t),n=i.data,s=q.from(i.headers).normalize(),{responseType:l,onUploadProgress:u,onDownloadProgress:p}=i,c,h,b,E,m;function y(){E&&E(),m&&m(),i.cancelToken&&i.cancelToken.unsubscribe(c),i.signal&&i.signal.removeEventListener("abort",c)}let T=new XMLHttpRequest;T.open(i.method.toUpperCase(),i.url,!0),T.timeout=i.timeout;function _(){if(!T)return;let S=q.from("getAllResponseHeaders"in T&&T.getAllResponseHeaders()),L={data:!l||l==="text"||l==="json"?T.responseText:T.response,status:T.status,statusText:T.statusText,headers:S,config:t,request:T};ue(function(j){r(j),y()},function(j){o(j),y()},L),T=null}"onloadend"in T?T.onloadend=_:T.onreadystatechange=function(){!T||T.readyState!==4||T.status===0&&!(T.responseURL&&T.responseURL.indexOf("file:")===0)||setTimeout(_)},T.onabort=function(){T&&(o(new g("Request aborted",g.ECONNABORTED,t,T)),T=null)},T.onerror=function(x){let L=x&&x.message?x.message:"Network Error",U=new g(L,g.ERR_NETWORK,t,T);U.event=x||null,o(U),T=null},T.ontimeout=function(){let x=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded",L=i.transitional||ze;i.timeoutErrorMessage&&(x=i.timeoutErrorMessage),o(new g(x,L.clarifyTimeoutError?g.ETIMEDOUT:g.ECONNABORTED,t,T)),T=null},n===void 0&&s.setContentType(null),"setRequestHeader"in T&&a.forEach(s.toJSON(),function(x,L){T.setRequestHeader(L,x)}),a.isUndefined(i.withCredentials)||(T.withCredentials=!!i.withCredentials),l&&l!=="json"&&(T.responseType=i.responseType),p&&([b,m]=ge(p,!0),T.addEventListener("progress",b)),u&&T.upload&&([h,E]=ge(u),T.upload.addEventListener("progress",h),T.upload.addEventListener("loadend",E)),(i.cancelToken||i.signal)&&(c=S=>{T&&(o(!S||S.type?new ee(null,t,T):S),T.abort(),T=null)},i.cancelToken&&i.cancelToken.subscribe(c),i.signal&&(i.signal.aborted?c():i.signal.addEventListener("abort",c)));let F=yt(i.url);if(F&&I.protocols.indexOf(F)===-1){o(new g("Unsupported protocol "+F+":",g.ERR_BAD_REQUEST,t));return}T.send(n||null)})};var ml=(t,e)=>{let{length:r}=t=t?t.filter(Boolean):[];if(e||r){let o=new AbortController,i,n=function(p){if(!i){i=!0,l();let c=p instanceof Error?p:this.reason;o.abort(c instanceof g?c:new ee(c instanceof Error?c.message:c))}},s=e&&setTimeout(()=>{s=null,n(new g(`timeout ${e} of ms exceeded`,g.ETIMEDOUT))},e),l=()=>{t&&(s&&clearTimeout(s),s=null,t.forEach(p=>{p.unsubscribe?p.unsubscribe(n):p.removeEventListener("abort",n)}),t=null)};t.forEach(p=>p.addEventListener("abort",n));let{signal:u}=o;return u.unsubscribe=()=>a.asap(l),u}},Ci=ml;var fl=function*(t,e){let r=t.byteLength;if(!e||r<e){yield t;return}let o=0,i;for(;o<r;)i=o+e,yield t.slice(o,i),o=i},hl=async function*(t,e){for await(let r of gl(t))yield*fl(r,e)},gl=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}let e=t.getReader();try{for(;;){let{done:r,value:o}=await e.read();if(r)break;yield o}}finally{await e.cancel()}},Ur=(t,e,r,o)=>{let i=hl(t,e),n=0,s,l=u=>{s||(s=!0,o&&o(u))};return new ReadableStream({async pull(u){try{let{done:p,value:c}=await i.next();if(p){l(),u.close();return}let h=c.byteLength;if(r){let b=n+=h;r(b)}u.enqueue(new Uint8Array(c))}catch(p){throw l(p),p}},cancel(u){return l(u),i.return()}},{highWaterMark:2})};var _i=64*1024,{isFunction:Qt}=a,Li=(({fetch:t,Request:e,Response:r})=>({fetch:t,Request:e,Response:r}))(a.global),{ReadableStream:Ri,TextEncoder:xi}=a.global,vi=(t,...e)=>{try{return!!t(...e)}catch{return!1}},yl=t=>{let{fetch:e,Request:r,Response:o}=Object.assign({},Li,t),i=Qt(e),n=Qt(r),s=Qt(o);if(!i)return!1;let l=i&&Qt(Ri),u=i&&(typeof xi=="function"?(m=>y=>m.encode(y))(new xi):async m=>new Uint8Array(await new r(m).arrayBuffer())),p=n&&l&&vi(()=>{let m=!1,y=new r(I.origin,{body:new Ri,method:"POST",get duplex(){return m=!0,"half"}}).headers.has("Content-Type");return m&&!y}),c=s&&l&&vi(()=>a.isReadableStream(new o("").body)),h={stream:c&&(m=>m.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(m=>{!h[m]&&(h[m]=(y,T)=>{let _=y&&y[m];if(_)return _.call(y);throw new g(`Response type '${m}' is not supported`,g.ERR_NOT_SUPPORT,T)})});let b=async m=>{if(m==null)return 0;if(a.isBlob(m))return m.size;if(a.isSpecCompliantForm(m))return(await new r(I.origin,{method:"POST",body:m}).arrayBuffer()).byteLength;if(a.isArrayBufferView(m)||a.isArrayBuffer(m))return m.byteLength;if(a.isURLSearchParams(m)&&(m=m+""),a.isString(m))return(await u(m)).byteLength},E=async(m,y)=>{let T=a.toFiniteNumber(m.getContentLength());return T??b(y)};return async m=>{let{url:y,method:T,data:_,signal:F,cancelToken:S,timeout:x,onDownloadProgress:L,onUploadProgress:U,responseType:j,headers:le,withCredentials:te="same-origin",fetchOptions:pe}=Gt(m);j=j?(j+"").toLowerCase():"text";let me=Ci([F,S&&S.toAbortSignal()],x),Q=null,H=me&&me.unsubscribe&&(()=>{me.unsubscribe()}),N;try{if(U&&p&&T!=="get"&&T!=="head"&&(N=await E(le,_))!==0){let G=new r(y,{method:"POST",body:_,duplex:"half"}),k;if(a.isFormData(_)&&(k=G.headers.get("content-type"))&&le.setContentType(k),G.body){let[re,ye]=Ge(N,ge(Qe(U)));_=Ur(G.body,_i,re,ye)}}a.isString(te)||(te=te?"include":"omit");let $=n&&"credentials"in r.prototype,Fe={...pe,signal:me,method:T.toUpperCase(),headers:le.normalize().toJSON(),body:_,duplex:"half",credentials:$?te:void 0};Q=n&&new r(y,Fe);let A=await(n?e(Q,pe):e(y,Fe)),C=c&&(j==="stream"||j==="response");if(c&&(L||C&&H)){let G={};["status","statusText","headers"].forEach(X=>{G[X]=A[X]});let k=a.toFiniteNumber(A.headers.get("content-length")),[re,ye]=L&&Ge(k,ge(Qe(L),!0))||[];A=new o(Ur(A.body,_i,re,()=>{ye&&ye(),H&&H()}),G)}j=j||"text";let V=await h[a.findKey(h,j)||"text"](A,m);return!C&&H&&H(),await new Promise((G,k)=>{ue(G,k,{data:V,headers:q.from(A.headers),status:A.status,statusText:A.statusText,config:m,request:Q})})}catch($){throw H&&H(),$&&$.name==="TypeError"&&/Load failed|fetch/i.test($.message)?Object.assign(new g("Network Error",g.ERR_NETWORK,m,Q),{cause:$.cause||$}):g.from($,$&&$.code,m,Q)}}},bl=new Map,jr=t=>{let e=a.merge.call({skipUndefined:!0},Li,t?t.env:null),{fetch:r,Request:o,Response:i}=e,n=[o,i,r],s=n.length,l=s,u,p,c=bl;for(;l--;)u=n[l],p=c.get(u),p===void 0&&c.set(u,p=l?new Map:yl(e)),c=p;return p},eh=jr();var Br={http:Ti,xhr:Si,fetch:{get:jr}};a.forEach(Br,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});var Di=t=>`- ${t}`,wl=t=>a.isFunction(t)||t===null||t===!1,$t={getAdapter:(t,e)=>{t=a.isArray(t)?t:[t];let{length:r}=t,o,i,n={};for(let s=0;s<r;s++){o=t[s];let l;if(i=o,!wl(o)&&(i=Br[(l=String(o)).toLowerCase()],i===void 0))throw new g(`Unknown adapter '${l}'`);if(i&&(a.isFunction(i)||(i=i.get(e))))break;n[l||"#"+s]=i}if(!i){let s=Object.entries(n).map(([u,p])=>`adapter ${u} `+(p===!1?"is not supported by the environment":"is not available in the build")),l=r?s.length>1?`since :
|