@tableau/mcp-server 1.10.2 → 1.10.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 +1 -1
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
var nn=Object.defineProperty;var an=(t,e)=>{for(var r in e)nn(t,r,{get:e[r],enumerable:!0})};import{StdioServerTransport as Hu}from"@modelcontextprotocol/sdk/server/stdio.js";import Gu from"dotenv";import{join as un}from"path";import{fileURLToPath as dn}from"url";var dr=["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"],ln=["datasource","workbook","view","pulse","content-exploration"],pr={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 mr(t){return!!dr.find(e=>e===t)}function fr(t){return!!ln.find(e=>e===t)}var cn=["stdio","http"];function yi(t){return!!cn.find(e=>e===t)}function ge(t,e){if(!t)throw new Error(e||"Invariant Violation")}var pn=dn(new URL(".",import.meta.url)),mn=["pat","direct-trust"],hr=class{auth;server;transport;sslKey;sslCert;httpPort;corsOriginConfig;siteName;patName;patValue;jwtSubClaim;connectedAppClientId;connectedAppSecretId;connectedAppSecretValue;jwtAdditionalPayload;datasourceCredentials;defaultLogLevel;disableLogMasking;includeTools;excludeTools;maxResultLimit;disableQueryDatasourceFilterValidation;disableMetadataApiRequests;enableServerLogging;serverLogDirectory;constructor(){let e=gn(process.env),{AUTH:r,SERVER:i,SITE_NAME:o,TRANSPORT:n,SSL_KEY:s,SSL_CERT:l,HTTP_PORT_ENV_VAR_NAME:u,CORS_ORIGIN_CONFIG:m,PAT_NAME:c,PAT_VALUE:h,JWT_SUB_CLAIM:b,CONNECTED_APP_CLIENT_ID:w,CONNECTED_APP_SECRET_ID:f,CONNECTED_APP_SECRET_VALUE:y,JWT_ADDITIONAL_PAYLOAD:T,DATASOURCE_CREDENTIALS:C,DEFAULT_LOG_LEVEL:N,DISABLE_LOG_MASKING:A,INCLUDE_TOOLS:x,EXCLUDE_TOOLS:v,MAX_RESULT_LIMIT:q,DISABLE_QUERY_DATASOURCE_FILTER_VALIDATION:U,DISABLE_METADATA_API_REQUESTS:ue,ENABLE_SERVER_LOGGING:ne,SERVER_LOG_DIRECTORY:fe}=e,he=3927,Y=e[u?.trim()||"PORT"]||he.toString(),X=parseInt(Y,10);this.siteName=o??"",this.auth=mn.find(B=>B===r)??"pat",this.transport=yi(n)?n:"stdio",this.sslKey=s?.trim()??"",this.sslCert=l?.trim()??"",this.httpPort=isNaN(X)?he:X,this.corsOriginConfig=hn(m?.trim()??""),this.datasourceCredentials=C??"",this.defaultLogLevel=N??"debug",this.disableLogMasking=A==="true",this.disableQueryDatasourceFilterValidation=U==="true",this.disableMetadataApiRequests=ue==="true",this.enableServerLogging=ne==="true",this.serverLogDirectory=fe||un(pn,"logs");let j=q?parseInt(q):NaN;if(this.maxResultLimit=isNaN(j)||j<=0?null:j,this.includeTools=x?x.split(",").flatMap(B=>{let G=B.trim();return mr(G)?G:fr(G)?pr[G]:[]}):[],this.excludeTools=v?v.split(",").flatMap(B=>{let G=B.trim();return mr(G)?G:fr(G)?pr[G]:[]}):[],this.includeTools.length>0&&this.excludeTools.length>0)throw new Error("Cannot include and exclude tools simultaneously");ge(i,"The environment variable SERVER is not set"),fn(i),this.auth==="pat"?(ge(c,"The environment variable PAT_NAME is not set"),ge(h,"The environment variable PAT_VALUE is not set")):this.auth==="direct-trust"&&(ge(b,"The environment variable JWT_SUB_CLAIM is not set"),ge(w,"The environment variable CONNECTED_APP_CLIENT_ID is not set"),ge(f,"The environment variable CONNECTED_APP_SECRET_ID is not set"),ge(y,"The environment variable CONNECTED_APP_SECRET_VALUE is not set")),this.server=i,this.patName=c??"",this.patValue=h??"",this.jwtSubClaim=b??"",this.connectedAppClientId=w??"",this.connectedAppSecretId=f??"",this.connectedAppSecretValue=y??"",this.jwtAdditionalPayload=T||"{}"}};function fn(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 hn(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 gn(t){return Object.entries(t).reduce((e,[r,i])=>(i?.startsWith("${user_config.")?e[r]="":e[r]=i,e),{})}var R=()=>new hr;var gr=["debug","info","notice","warning","error","critical","alert","emergency"],st="debug",bi;function Ti(t){return!!gr.find(e=>e===t)}var ke=(t,e,{silent:r=!1}={})=>{st!==e&&(st=e,r||oe.notice(t,`Logging level set to: ${e}`))},wi=t=>{bi=t},oe={debug:Te("debug"),info:Te("info"),notice:Te("notice"),warning:Te("warning"),error:Te("error"),critical:Te("critical"),alert:Te("alert"),emergency:Te("emergency")},Ae=(t=st)=>gr.indexOf(t)>=gr.indexOf(st),Se=t=>{process.env.TABLEAU_MCP_TEST!=="true"&&(t=t.endsWith(`
|
|
3
3
|
`)?t:`${t}
|
|
4
4
|
`,process.stderr.write(t))},Ei=({requestId:t,toolName:e,args:r})=>({type:"tool",requestId:t,tool:{name:e,...r!==void 0?{args:r}:{}}});function Te(t){return async(e,r,{logger:i,requestId:o}={logger:e.name})=>{if(bi?.log({message:r,level:t,logger:i}),!!Ae(t))return e.server.notification({method:"notifications/message",params:{level:t,logger:i,data:JSON.stringify({timestamp:new Date().toISOString(),currentLogLevel:st,message:r},null,2)}},{relatedRequestId:o})}}import{appendFile as yn}from"node:fs/promises";import{existsSync as bn,mkdirSync as Tn}from"fs";import{join as wn}from"path";function ae(t){if(t instanceof Error)return t.message;try{return JSON.stringify(t)??"undefined"}catch{return`${t}`}}var Ot=class{_logDirectory;_fileMutexes=new Map;constructor({logDirectory:e}){this._logDirectory=e,bn(this._logDirectory)||Tn(this._logDirectory,{recursive:!0})}async log(e){let r=new Date().toISOString(),i=`${new Date(new Date().setMinutes(0,0,0)).toISOString().replace(/[:.]/g,"-")}.log`,o=wn(this._logDirectory,i),n=o,l=(this._fileMutexes.get(n)??Promise.resolve()).then(async()=>{try{await yn(o,JSON.stringify({timestamp:r,...e})+`
|
|
5
|
-
`)}catch(u){Se(`Failed to write to log file ${o}: ${ae(u)}`)}});this._fileMutexes.set(n,l),l.finally(()=>{this._fileMutexes.get(n)===l&&this._fileMutexes.delete(n)}),await l}};import{McpServer as Uu}from"@modelcontextprotocol/sdk/server/mcp.js";import{SetLevelRequestSchema as ju}from"@modelcontextprotocol/sdk/types.js";var Ai={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.10.2",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 Gc}from"ts-results-es";import{z as fs}from"zod";import{Err as Si,Ok as An}from"ts-results-es";var _i=t=>{let e=Ri(t);if(e.isErr())return t;let r=e.value;return Ae("debug")?(r.data?.credentials&&(r.data.credentials="<redacted>"),Array.isArray(r?.data?.datasource?.connections)&&r.data.datasource.connections.forEach(o=>{o.connectionUsername="<redacted>",o.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},Ci=t=>{let e=Ri(t);if(e.isErr())return t;let r=e.value;return Ae("debug")?r.data?.credentials&&(r.data.credentials="<redacted>"):(delete r.data,delete r.headers),r};function Ri(t){try{return An(structuredClone(t))}catch(e){if(e instanceof Error)return Si(e);let r=ae(e);return Se(`Could not clone object, notification may not be sanitized! Error: ${r}`),Si(new Error(r))}}function Pt(t){return{method:t.method??"UNKNOWN METHOD",url:t.url??"UNKNOWN URL",headers:t.headers,data:t.data,params:t.params}}function Nt(t){return{url:t.config.url??"UNKNOWN URL",status:t.status,headers:t.headers,data:t.data}}import{Zodios as Di}from"@zodios/core";import{randomUUID as Sn}from"node:crypto";import{SignJWT as _n}from"jose";async function xi({username:t,connectedApp:e,scopes:r,additionalPayload:i}){let o={alg:"HS256",typ:"JWT",kid:e.secretId},n={jti:Sn(),iss:e.clientId,aud:"tableau",sub:t,scp:[...r],iat:Math.floor(Date.now()/1e3)-5,exp:Math.floor(Date.now()/1e3)+5*60,...i};return await new _n(n).setProtectedHeader(o).sign(new TextEncoder().encode(e.secretValue))}import{makeApi as Cn,makeEndpoint as Li}from"@zodios/core";import{z as de}from"zod";import{z as _e}from"zod";var vi=_e.object({credentials:_e.object({site:_e.object({id:_e.string()}),user:_e.object({id:_e.string()}),token:_e.string()})});var Rn=de.object({credentials:de.object({site:de.object({contentUrl:de.string()})}).and(de.object({personalAccessTokenName:de.string(),personalAccessTokenSecret:de.string()}).or(de.object({jwt:de.string()})))}),xn=Li({method:"post",path:"/auth/signin",alias:"signIn",description:"Signs in with Tableau credentials.",response:vi,parameters:[{name:"credentials",type:"Body",schema:Rn}]}),vn=Li({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:de.void()}),Ln=Cn([xn,vn]),yr=[...Ln];var Ce=class{_apiClient;constructor(e){this._apiClient=e}get interceptors(){return this._apiClient.axios.interceptors}};var W=class extends Ce{_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 Ce{constructor(e){super(new Di(e,yr))}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 xi({username:e.username,connectedApp:{clientId:e.clientId,secretId:e.secretId,secretValue:e.secretValue},scopes:e.scopes,additionalPayload:e.additionalPayload})}}})()}})).credentials},Ft=class extends W{constructor(e,r){super(new Di(e,yr),r)}signOut=async()=>{await this._apiClient.signOut(void 0,{...this.authHeader})}};import{Zodios as kn}from"@zodios/core";import{makeApi as On,makeEndpoint as Pn}from"@zodios/core";import{z as Me}from"zod";import{z as L}from"zod";var Dn=L.enum(["hitsTotal","hitsSmallSpanTotal","hitsMediumSpanTotal","hitsLargeSpanTotal","downstreamWorkbookCount"]),Ii=L.array(L.object({method:Dn,sortDirection:L.enum(["asc","desc"]).default("asc").optional()})).nonempty(),Oi=L.enum(["lens","datasource","virtualconnection","collection","project","flow","datarole","table","database","view","workbook"]),Pi=L.union([L.array(L.string().datetime()).nonempty(),L.object({startDate:L.string().datetime(),endDate:L.string().datetime().optional()}).strict(),L.object({startDate:L.string().datetime().optional(),endDate:L.string().datetime()}).strict()]),br=L.object({contentTypes:L.array(Oi).nonempty(),ownerIds:L.array(L.number().int()).nonempty(),modifiedTime:Pi}).partial(),Ni=L.union([br.extend({contentTypes:L.array(Oi).nonempty()}).strict(),br.extend({ownerIds:L.array(L.number().int()).nonempty()}).strict(),br.extend({modifiedTime:Pi}).strict()]),In=L.object({uri:L.string(),content:L.record(L.string(),L.unknown())}),Fi=L.object({next:L.string(),prev:L.string(),pageIndex:L.number().int(),startIndex:L.number().int(),total:L.number().int(),limit:L.number().int(),items:L.array(In)}).partial();var Nn=Pn({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:Me.string().optional()},{name:"page",type:"Query",schema:Me.number().int().optional()},{name:"limit",type:"Query",schema:Me.number().int().optional()},{name:"order_by",type:"Query",schema:Me.string().optional()},{name:"filter",type:"Query",schema:Me.string().optional()}],response:Me.object({hits:Fi})}),Fn=On([Nn]),ki=[...Fn];var at=class extends W{constructor(e,r){super(new kn(e,ki),r)}searchContent=async e=>(Object.entries(e).forEach(([i,o])=>{o===void 0&&delete e[i]}),(await this._apiClient.searchContent({queries:e,...this.authHeader})).hits)};import{Zodios as Bn}from"@zodios/core";import{makeApi as Mn,makeEndpoint as qn}from"@zodios/core";import{z as je}from"zod";import{z as Mt}from"zod";import{z as Tr}from"zod";var kt=Tr.object({name:Tr.string(),id:Tr.string()});var Mi=Mt.object({id:Mt.string(),name:Mt.string(),description:Mt.string().optional(),project:kt});import{z as qt}from"zod";var qe=qt.object({pageNumber:qt.coerce.number(),pageSize:qt.coerce.number(),totalAvailable:qt.coerce.number()});import{z as qi}from"zod";var Ue=[{name:"pageSize",type:"Query",schema:qi.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:qi.number().optional(),description:"The offset for paging. The default is 1."}];var Un=qn({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:[...Ue,{name:"siteId",type:"Path",schema:je.string()},{name:"filter",type:"Query",schema:je.string().optional(),description:"Filter string in the format field:operator:value (e.g., name:eq:Project Views)"}],response:je.object({pagination:qe,datasources:je.object({datasource:je.optional(je.array(Mi))})})}),jn=Mn([Un]),Ui=[...jn];var lt=class extends W{constructor(e,r){super(new Bn(e,Ui),r)}listDatasources=async({siteId:e,filter:r,pageSize:i,pageNumber:o})=>{let n=await this._apiClient.listDatasources({params:{siteId:e},queries:{filter:r,pageSize:i,pageNumber:o},...this.authHeader});return{pagination:n.pagination,datasources:n.datasources.datasource??[]}}};import{Zodios as Qn}from"@zodios/core";import{makeApi as Vn,makeEndpoint as zn}from"@zodios/core";import{z as D}from"zod";var Wn=D.object({data:D.object({publishedDatasources:D.array(D.object({name:D.string().nullable(),description:D.string().nullable(),owner:D.object({name:D.string().nullable()}),fields:D.array(D.object({name:D.string(),isHidden:D.boolean().nullable(),description:D.string().nullable(),descriptionInherited:D.array(D.object({attribute:D.string(),value:D.string().nullable()}).nullable()).nullable(),fullyQualifiedName:D.string(),__typename:D.string(),dataCategory:D.string().nullish(),role:D.string().nullish(),dataType:D.string().nullish(),defaultFormat:D.string().nullish(),semanticRole:D.string().nullish(),aggregation:D.string().nullish(),aggregationParam:D.string().nullish(),formula:D.string().nullish(),isAutoGenerated:D.boolean().nullish(),hasUserReference:D.boolean().nullish(),binSize:D.number().nullish(),hasOther:D.boolean().nullish(),delimiter:D.string().nullish(),combinationType:D.string().nullish()}))}))})}),Hn=zn({method:"post",path:"/graphql",alias:"graphql",response:Wn,parameters:[{name:"query",type:"Body",schema:D.object({query:D.string()})}]}),Gn=Vn([Hn]),ji=[...Gn];var ct=class extends W{constructor(e,r){super(new Qn(e,ji),r)}graphql=async e=>await this._apiClient.graphql({query:e},{...this.authHeader})};import{Zodios as Xl}from"@zodios/core";import{Err as Zo,Ok as ec}from"ts-results-es";function ut(t,e){return function(){return t.apply(e,arguments)}}var{toString:$n}=Object.prototype,{getPrototypeOf:Er}=Object,{iterator:jt,toStringTag:Vi}=Symbol,Bt=(t=>e=>{let r=$n.call(e);return t[r]||(t[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),le=t=>(t=t.toLowerCase(),e=>Bt(e)===t),Vt=t=>e=>typeof e===t,{isArray:Ve}=Array,Be=Vt("undefined");function dt(t){return t!==null&&!Be(t)&&t.constructor!==null&&!Be(t.constructor)&&J(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}var zi=le("ArrayBuffer");function Zn(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&zi(t.buffer),e}var Jn=Vt("string"),J=Vt("function"),Wi=Vt("number"),pt=t=>t!==null&&typeof t=="object",Kn=t=>t===!0||t===!1,Ut=t=>{if(Bt(t)!=="object")return!1;let e=Er(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Vi in t)&&!(jt in t)},Yn=t=>{if(!pt(t)||dt(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},Xn=le("Date"),ea=le("File"),ta=le("Blob"),ra=le("FileList"),ia=t=>pt(t)&&J(t.pipe),oa=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||J(t.append)&&((e=Bt(t))==="formdata"||e==="object"&&J(t.toString)&&t.toString()==="[object FormData]"))},sa=le("URLSearchParams"),[na,aa,la,ca]=["ReadableStream","Request","Response","Headers"].map(le),ua=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 i,o;if(typeof t!="object"&&(t=[t]),Ve(t))for(i=0,o=t.length;i<o;i++)e.call(null,t[i],i,t);else{if(dt(t))return;let n=r?Object.getOwnPropertyNames(t):Object.keys(t),s=n.length,l;for(i=0;i<s;i++)l=n[i],e.call(null,t[l],l,t)}}function Hi(t,e){if(dt(t))return null;e=e.toLowerCase();let r=Object.keys(t),i=r.length,o;for(;i-- >0;)if(o=r[i],e===o.toLowerCase())return o;return null}var Re=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Gi=t=>!Be(t)&&t!==Re;function wr(){let{caseless:t,skipUndefined:e}=Gi(this)&&this||{},r={},i=(o,n)=>{let s=t&&Hi(r,n)||n;Ut(r[s])&&Ut(o)?r[s]=wr(r[s],o):Ut(o)?r[s]=wr({},o):Ve(o)?r[s]=o.slice():(!e||!Be(o))&&(r[s]=o)};for(let o=0,n=arguments.length;o<n;o++)arguments[o]&&mt(arguments[o],i);return r}var da=(t,e,r,{allOwnKeys:i}={})=>(mt(e,(o,n)=>{r&&J(o)?t[n]=ut(o,r):t[n]=o},{allOwnKeys:i}),t),pa=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),ma=(t,e,r,i)=>{t.prototype=Object.create(e.prototype,i),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),r&&Object.assign(t.prototype,r)},fa=(t,e,r,i)=>{let o,n,s,l={};if(e=e||{},t==null)return e;do{for(o=Object.getOwnPropertyNames(t),n=o.length;n-- >0;)s=o[n],(!i||i(s,t,e))&&!l[s]&&(e[s]=t[s],l[s]=!0);t=r!==!1&&Er(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},ha=(t,e,r)=>{t=String(t),(r===void 0||r>t.length)&&(r=t.length),r-=e.length;let i=t.indexOf(e,r);return i!==-1&&i===r},ga=t=>{if(!t)return null;if(Ve(t))return t;let e=t.length;if(!Wi(e))return null;let r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},ya=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&Er(Uint8Array)),ba=(t,e)=>{let i=(t&&t[jt]).call(t),o;for(;(o=i.next())&&!o.done;){let n=o.value;e.call(t,n[0],n[1])}},Ta=(t,e)=>{let r,i=[];for(;(r=t.exec(e))!==null;)i.push(r);return i},wa=le("HTMLFormElement"),Ea=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,i,o){return i.toUpperCase()+o}),Bi=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),Aa=le("RegExp"),Qi=(t,e)=>{let r=Object.getOwnPropertyDescriptors(t),i={};mt(r,(o,n)=>{let s;(s=e(o,n,t))!==!1&&(i[n]=s||o)}),Object.defineProperties(t,i)},Sa=t=>{Qi(t,(e,r)=>{if(J(t)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;let i=t[r];if(J(i)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},_a=(t,e)=>{let r={},i=o=>{o.forEach(n=>{r[n]=!0})};return Ve(t)?i(t):i(String(t).split(e)),r},Ca=()=>{},Ra=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function xa(t){return!!(t&&J(t.append)&&t[Vi]==="FormData"&&t[jt])}var va=t=>{let e=new Array(10),r=(i,o)=>{if(pt(i)){if(e.indexOf(i)>=0)return;if(dt(i))return i;if(!("toJSON"in i)){e[o]=i;let n=Ve(i)?[]:{};return mt(i,(s,l)=>{let u=r(s,o+1);!Be(u)&&(n[l]=u)}),e[o]=void 0,n}}return i};return r(t,0)},La=le("AsyncFunction"),Da=t=>t&&(pt(t)||J(t))&&J(t.then)&&J(t.catch),$i=((t,e)=>t?setImmediate:e?((r,i)=>(Re.addEventListener("message",({source:o,data:n})=>{o===Re&&n===r&&i.length&&i.shift()()},!1),o=>{i.push(o),Re.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",J(Re.postMessage)),Ia=typeof queueMicrotask<"u"?queueMicrotask.bind(Re):typeof process<"u"&&process.nextTick||$i,Oa=t=>t!=null&&J(t[jt]),a={isArray:Ve,isArrayBuffer:zi,isBuffer:dt,isFormData:oa,isArrayBufferView:Zn,isString:Jn,isNumber:Wi,isBoolean:Kn,isObject:pt,isPlainObject:Ut,isEmptyObject:Yn,isReadableStream:na,isRequest:aa,isResponse:la,isHeaders:ca,isUndefined:Be,isDate:Xn,isFile:ea,isBlob:ta,isRegExp:Aa,isFunction:J,isStream:ia,isURLSearchParams:sa,isTypedArray:ya,isFileList:ra,forEach:mt,merge:wr,extend:da,trim:ua,stripBOM:pa,inherits:ma,toFlatObject:fa,kindOf:Bt,kindOfTest:le,endsWith:ha,toArray:ga,forEachEntry:ba,matchAll:Ta,isHTMLForm:wa,hasOwnProperty:Bi,hasOwnProp:Bi,reduceDescriptors:Qi,freezeMethods:Sa,toObjectSet:_a,toCamelCase:Ea,noop:Ca,toFiniteNumber:Ra,findKey:Hi,global:Re,isContextDefined:Gi,isSpecCompliantForm:xa,toJSONObject:va,isAsyncFn:La,isThenable:Da,setImmediate:$i,asap:Ia,isIterable:Oa};function ze(t,e,r,i,o){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),i&&(this.request=i),o&&(this.response=o,this.status=o.status?o.status:null)}a.inherits(ze,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 Zi=ze.prototype,Ji={};["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=>{Ji[t]={value:t}});Object.defineProperties(ze,Ji);Object.defineProperty(Zi,"isAxiosError",{value:!0});ze.from=(t,e,r,i,o,n)=>{let s=Object.create(Zi);a.toFlatObject(t,s,function(c){return c!==Error.prototype},m=>m!=="isAxiosError");let l=t&&t.message?t.message:"Error",u=e==null&&t?t.code:e;return ze.call(s,l,u,r,i,o),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=ze;import Pa from"form-data";var zt=Pa;function Ar(t){return a.isPlainObject(t)||a.isArray(t)}function Yi(t){return a.endsWith(t,"[]")?t.slice(0,-2):t}function Ki(t,e,r){return t?t.concat(e).map(function(o,n){return o=Yi(o),!r&&n?"["+o+"]":o}).join(r?".":""):e}function Na(t){return a.isArray(t)&&!t.some(Ar)}var Fa=a.toFlatObject(a,{},null,function(e){return/^is[A-Z]/.test(e)});function ka(t,e,r){if(!a.isObject(t))throw new TypeError("target must be an object");e=e||new(zt||FormData),r=a.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,T){return!a.isUndefined(T[y])});let i=r.metaTokens,o=r.visitor||c,n=r.dots,s=r.indexes,u=(r.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(e);if(!a.isFunction(o))throw new TypeError("visitor must be a function");function m(f){if(f===null)return"";if(a.isDate(f))return f.toISOString();if(a.isBoolean(f))return f.toString();if(!u&&a.isBlob(f))throw new g("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(f)||a.isTypedArray(f)?u&&typeof Blob=="function"?new Blob([f]):Buffer.from(f):f}function c(f,y,T){let C=f;if(f&&!T&&typeof f=="object"){if(a.endsWith(y,"{}"))y=i?y:y.slice(0,-2),f=JSON.stringify(f);else if(a.isArray(f)&&Na(f)||(a.isFileList(f)||a.endsWith(y,"[]"))&&(C=a.toArray(f)))return y=Yi(y),C.forEach(function(A,x){!(a.isUndefined(A)||A===null)&&e.append(s===!0?Ki([y],x,n):s===null?y:y+"[]",m(A))}),!1}return Ar(f)?!0:(e.append(Ki(T,y,n),m(f)),!1)}let h=[],b=Object.assign(Fa,{defaultVisitor:c,convertValue:m,isVisitable:Ar});function w(f,y){if(!a.isUndefined(f)){if(h.indexOf(f)!==-1)throw Error("Circular reference detected in "+y.join("."));h.push(f),a.forEach(f,function(C,N){(!(a.isUndefined(C)||C===null)&&o.call(e,C,a.isString(N)?N.trim():N,y,b))===!0&&w(C,y?y.concat(N):[N])}),h.pop()}}if(!a.isObject(t))throw new TypeError("data must be an object");return w(t),e}var we=ka;function Xi(t){let e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(i){return e[i]})}function eo(t,e){this._pairs=[],t&&we(t,this,e)}var to=eo.prototype;to.append=function(e,r){this._pairs.push([e,r])};to.toString=function(e){let r=e?function(i){return e.call(this,i,Xi)}:Xi;return this._pairs.map(function(o){return r(o[0])+"="+r(o[1])},"").join("&")};var ro=eo;function Ma(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function xe(t,e,r){if(!e)return t;let i=r&&r.encode||Ma;a.isFunction(r)&&(r={serialize:r});let o=r&&r.serialize,n;if(o?n=o(e,r):n=a.isURLSearchParams(e)?e.toString():new ro(e,r).toString(i),n){let s=t.indexOf("#");s!==-1&&(t=t.slice(0,s)),t+=(t.indexOf("?")===-1?"?":"&")+n}return t}var Sr=class{constructor(){this.handlers=[]}use(e,r,i){return this.handlers.push({fulfilled:e,rejected:r,synchronous:i?i.synchronous:!1,runWhen:i?i.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(i){i!==null&&e(i)})}},_r=Sr;var We={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};import Ua from"crypto";import qa from"url";var io=qa.URLSearchParams;var Cr="abcdefghijklmnopqrstuvwxyz",oo="0123456789",so={DIGIT:oo,ALPHA:Cr,ALPHA_DIGIT:Cr+Cr.toUpperCase()+oo},ja=(t=16,e=so.ALPHA_DIGIT)=>{let r="",{length:i}=e,o=new Uint32Array(t);Ua.randomFillSync(o);for(let n=0;n<t;n++)r+=e[o[n]%i];return r},no={isNode:!0,classes:{URLSearchParams:io,FormData:zt,Blob:typeof Blob<"u"&&Blob||null},ALPHABET:so,generateString:ja,protocols:["http","https","file","data"]};var vr={};an(vr,{hasBrowserEnv:()=>xr,hasStandardBrowserEnv:()=>Ba,hasStandardBrowserWebWorkerEnv:()=>Va,navigator:()=>Rr,origin:()=>za});var xr=typeof window<"u"&&typeof document<"u",Rr=typeof navigator=="object"&&navigator||void 0,Ba=xr&&(!Rr||["ReactNative","NativeScript","NS"].indexOf(Rr.product)<0),Va=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",za=xr&&window.location.href||"http://localhost";var I={...vr,...no};function Lr(t,e){return we(t,new I.classes.URLSearchParams,{visitor:function(r,i,o,n){return I.isNode&&a.isBuffer(r)?(this.append(i,r.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)},...e})}function Wa(t){return a.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Ha(t){let e={},r=Object.keys(t),i,o=r.length,n;for(i=0;i<o;i++)n=r[i],e[n]=t[n];return e}function Ga(t){function e(r,i,o,n){let s=r[n++];if(s==="__proto__")return!0;let l=Number.isFinite(+s),u=n>=r.length;return s=!s&&a.isArray(o)?o.length:s,u?(a.hasOwnProp(o,s)?o[s]=[o[s],i]:o[s]=i,!l):((!o[s]||!a.isObject(o[s]))&&(o[s]=[]),e(r,i,o[s],n)&&a.isArray(o[s])&&(o[s]=Ha(o[s])),!l)}if(a.isFormData(t)&&a.isFunction(t.entries)){let r={};return a.forEachEntry(t,(i,o)=>{e(Wa(i),o,r,0)}),r}return null}var Wt=Ga;function Qa(t,e,r){if(a.isString(t))try{return(e||JSON.parse)(t),a.trim(t)}catch(i){if(i.name!=="SyntaxError")throw i}return(r||JSON.stringify)(t)}var Dr={transitional:We,adapter:["xhr","http","fetch"],transformRequest:[function(e,r){let i=r.getContentType()||"",o=i.indexOf("application/json")>-1,n=a.isObject(e);if(n&&a.isHTMLForm(e)&&(e=new FormData(e)),a.isFormData(e))return o?JSON.stringify(Wt(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(i.indexOf("application/x-www-form-urlencoded")>-1)return Lr(e,this.formSerializer).toString();if((l=a.isFileList(e))||i.indexOf("multipart/form-data")>-1){let u=this.env&&this.env.FormData;return we(l?{"files[]":e}:e,u&&new u,this.formSerializer)}}return n||o?(r.setContentType("application/json",!1),Qa(e)):e}],transformResponse:[function(e){let r=this.transitional||Dr.transitional,i=r&&r.forcedJSONParsing,o=this.responseType==="json";if(a.isResponse(e)||a.isReadableStream(e))return e;if(e&&a.isString(e)&&(i&&!this.responseType||o)){let s=!(r&&r.silentJSONParsing)&&o;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=>{Dr.headers[t]={}});var He=Dr;var $a=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"]),ao=t=>{let e={},r,i,o;return t&&t.split(`
|
|
5
|
+
`)}catch(u){Se(`Failed to write to log file ${o}: ${ae(u)}`)}});this._fileMutexes.set(n,l),l.finally(()=>{this._fileMutexes.get(n)===l&&this._fileMutexes.delete(n)}),await l}};import{McpServer as Uu}from"@modelcontextprotocol/sdk/server/mcp.js";import{SetLevelRequestSchema as ju}from"@modelcontextprotocol/sdk/types.js";var Ai={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.10.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 Gc}from"ts-results-es";import{z as fs}from"zod";import{Err as Si,Ok as An}from"ts-results-es";var _i=t=>{let e=Ri(t);if(e.isErr())return t;let r=e.value;return Ae("debug")?(r.data?.credentials&&(r.data.credentials="<redacted>"),Array.isArray(r?.data?.datasource?.connections)&&r.data.datasource.connections.forEach(o=>{o.connectionUsername="<redacted>",o.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},Ci=t=>{let e=Ri(t);if(e.isErr())return t;let r=e.value;return Ae("debug")?r.data?.credentials&&(r.data.credentials="<redacted>"):(delete r.data,delete r.headers),r};function Ri(t){try{return An(structuredClone(t))}catch(e){if(e instanceof Error)return Si(e);let r=ae(e);return Se(`Could not clone object, notification may not be sanitized! Error: ${r}`),Si(new Error(r))}}function Pt(t){return{method:t.method??"UNKNOWN METHOD",url:t.url??"UNKNOWN URL",headers:t.headers,data:t.data,params:t.params}}function Nt(t){return{url:t.config.url??"UNKNOWN URL",status:t.status,headers:t.headers,data:t.data}}import{Zodios as Di}from"@zodios/core";import{randomUUID as Sn}from"node:crypto";import{SignJWT as _n}from"jose";async function xi({username:t,connectedApp:e,scopes:r,additionalPayload:i}){let o={alg:"HS256",typ:"JWT",kid:e.secretId},n={jti:Sn(),iss:e.clientId,aud:"tableau",sub:t,scp:[...r],iat:Math.floor(Date.now()/1e3)-5,exp:Math.floor(Date.now()/1e3)+5*60,...i};return await new _n(n).setProtectedHeader(o).sign(new TextEncoder().encode(e.secretValue))}import{makeApi as Cn,makeEndpoint as Li}from"@zodios/core";import{z as de}from"zod";import{z as _e}from"zod";var vi=_e.object({credentials:_e.object({site:_e.object({id:_e.string()}),user:_e.object({id:_e.string()}),token:_e.string()})});var Rn=de.object({credentials:de.object({site:de.object({contentUrl:de.string()})}).and(de.object({personalAccessTokenName:de.string(),personalAccessTokenSecret:de.string()}).or(de.object({jwt:de.string()})))}),xn=Li({method:"post",path:"/auth/signin",alias:"signIn",description:"Signs in with Tableau credentials.",response:vi,parameters:[{name:"credentials",type:"Body",schema:Rn}]}),vn=Li({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:de.void()}),Ln=Cn([xn,vn]),yr=[...Ln];var Ce=class{_apiClient;constructor(e){this._apiClient=e}get interceptors(){return this._apiClient.axios.interceptors}};var W=class extends Ce{_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 Ce{constructor(e){super(new Di(e,yr))}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 xi({username:e.username,connectedApp:{clientId:e.clientId,secretId:e.secretId,secretValue:e.secretValue},scopes:e.scopes,additionalPayload:e.additionalPayload})}}})()}})).credentials},Ft=class extends W{constructor(e,r){super(new Di(e,yr),r)}signOut=async()=>{await this._apiClient.signOut(void 0,{...this.authHeader})}};import{Zodios as kn}from"@zodios/core";import{makeApi as On,makeEndpoint as Pn}from"@zodios/core";import{z as Me}from"zod";import{z as L}from"zod";var Dn=L.enum(["hitsTotal","hitsSmallSpanTotal","hitsMediumSpanTotal","hitsLargeSpanTotal","downstreamWorkbookCount"]),Ii=L.array(L.object({method:Dn,sortDirection:L.enum(["asc","desc"]).default("asc").optional()})).nonempty(),Oi=L.enum(["lens","datasource","virtualconnection","collection","project","flow","datarole","table","database","view","workbook"]),Pi=L.union([L.array(L.string().datetime()).nonempty(),L.object({startDate:L.string().datetime(),endDate:L.string().datetime().optional()}).strict(),L.object({startDate:L.string().datetime().optional(),endDate:L.string().datetime()}).strict()]),br=L.object({contentTypes:L.array(Oi).nonempty(),ownerIds:L.array(L.number().int()).nonempty(),modifiedTime:Pi}).partial(),Ni=L.union([br.extend({contentTypes:L.array(Oi).nonempty()}).strict(),br.extend({ownerIds:L.array(L.number().int()).nonempty()}).strict(),br.extend({modifiedTime:Pi}).strict()]),In=L.object({uri:L.string(),content:L.record(L.string(),L.unknown())}),Fi=L.object({next:L.string(),prev:L.string(),pageIndex:L.number().int(),startIndex:L.number().int(),total:L.number().int(),limit:L.number().int(),items:L.array(In)}).partial();var Nn=Pn({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:Me.string().optional()},{name:"page",type:"Query",schema:Me.number().int().optional()},{name:"limit",type:"Query",schema:Me.number().int().optional()},{name:"order_by",type:"Query",schema:Me.string().optional()},{name:"filter",type:"Query",schema:Me.string().optional()}],response:Me.object({hits:Fi})}),Fn=On([Nn]),ki=[...Fn];var at=class extends W{constructor(e,r){super(new kn(e,ki),r)}searchContent=async e=>(Object.entries(e).forEach(([i,o])=>{o===void 0&&delete e[i]}),(await this._apiClient.searchContent({queries:e,...this.authHeader})).hits)};import{Zodios as Bn}from"@zodios/core";import{makeApi as Mn,makeEndpoint as qn}from"@zodios/core";import{z as je}from"zod";import{z as Mt}from"zod";import{z as Tr}from"zod";var kt=Tr.object({name:Tr.string(),id:Tr.string()});var Mi=Mt.object({id:Mt.string(),name:Mt.string(),description:Mt.string().optional(),project:kt});import{z as qt}from"zod";var qe=qt.object({pageNumber:qt.coerce.number(),pageSize:qt.coerce.number(),totalAvailable:qt.coerce.number()});import{z as qi}from"zod";var Ue=[{name:"pageSize",type:"Query",schema:qi.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:qi.number().optional(),description:"The offset for paging. The default is 1."}];var Un=qn({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:[...Ue,{name:"siteId",type:"Path",schema:je.string()},{name:"filter",type:"Query",schema:je.string().optional(),description:"Filter string in the format field:operator:value (e.g., name:eq:Project Views)"}],response:je.object({pagination:qe,datasources:je.object({datasource:je.optional(je.array(Mi))})})}),jn=Mn([Un]),Ui=[...jn];var lt=class extends W{constructor(e,r){super(new Bn(e,Ui),r)}listDatasources=async({siteId:e,filter:r,pageSize:i,pageNumber:o})=>{let n=await this._apiClient.listDatasources({params:{siteId:e},queries:{filter:r,pageSize:i,pageNumber:o},...this.authHeader});return{pagination:n.pagination,datasources:n.datasources.datasource??[]}}};import{Zodios as Qn}from"@zodios/core";import{makeApi as Vn,makeEndpoint as zn}from"@zodios/core";import{z as D}from"zod";var Wn=D.object({data:D.object({publishedDatasources:D.array(D.object({name:D.string().nullable(),description:D.string().nullable(),owner:D.object({name:D.string().nullable()}),fields:D.array(D.object({name:D.string(),isHidden:D.boolean().nullable(),description:D.string().nullable(),descriptionInherited:D.array(D.object({attribute:D.string(),value:D.string().nullable()}).nullable()).nullable(),fullyQualifiedName:D.string(),__typename:D.string(),dataCategory:D.string().nullish(),role:D.string().nullish(),dataType:D.string().nullish(),defaultFormat:D.string().nullish(),semanticRole:D.string().nullish(),aggregation:D.string().nullish(),aggregationParam:D.string().nullish(),formula:D.string().nullish(),isAutoGenerated:D.boolean().nullish(),hasUserReference:D.boolean().nullish(),binSize:D.number().nullish(),hasOther:D.boolean().nullish(),delimiter:D.string().nullish(),combinationType:D.string().nullish()}))}))})}),Hn=zn({method:"post",path:"/graphql",alias:"graphql",response:Wn,parameters:[{name:"query",type:"Body",schema:D.object({query:D.string()})}]}),Gn=Vn([Hn]),ji=[...Gn];var ct=class extends W{constructor(e,r){super(new Qn(e,ji),r)}graphql=async e=>await this._apiClient.graphql({query:e},{...this.authHeader})};import{Zodios as Xl}from"@zodios/core";import{Err as Zo,Ok as ec}from"ts-results-es";function ut(t,e){return function(){return t.apply(e,arguments)}}var{toString:$n}=Object.prototype,{getPrototypeOf:Er}=Object,{iterator:jt,toStringTag:Vi}=Symbol,Bt=(t=>e=>{let r=$n.call(e);return t[r]||(t[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),le=t=>(t=t.toLowerCase(),e=>Bt(e)===t),Vt=t=>e=>typeof e===t,{isArray:Ve}=Array,Be=Vt("undefined");function dt(t){return t!==null&&!Be(t)&&t.constructor!==null&&!Be(t.constructor)&&J(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}var zi=le("ArrayBuffer");function Zn(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&zi(t.buffer),e}var Jn=Vt("string"),J=Vt("function"),Wi=Vt("number"),pt=t=>t!==null&&typeof t=="object",Kn=t=>t===!0||t===!1,Ut=t=>{if(Bt(t)!=="object")return!1;let e=Er(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Vi in t)&&!(jt in t)},Yn=t=>{if(!pt(t)||dt(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},Xn=le("Date"),ea=le("File"),ta=le("Blob"),ra=le("FileList"),ia=t=>pt(t)&&J(t.pipe),oa=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||J(t.append)&&((e=Bt(t))==="formdata"||e==="object"&&J(t.toString)&&t.toString()==="[object FormData]"))},sa=le("URLSearchParams"),[na,aa,la,ca]=["ReadableStream","Request","Response","Headers"].map(le),ua=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 i,o;if(typeof t!="object"&&(t=[t]),Ve(t))for(i=0,o=t.length;i<o;i++)e.call(null,t[i],i,t);else{if(dt(t))return;let n=r?Object.getOwnPropertyNames(t):Object.keys(t),s=n.length,l;for(i=0;i<s;i++)l=n[i],e.call(null,t[l],l,t)}}function Hi(t,e){if(dt(t))return null;e=e.toLowerCase();let r=Object.keys(t),i=r.length,o;for(;i-- >0;)if(o=r[i],e===o.toLowerCase())return o;return null}var Re=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Gi=t=>!Be(t)&&t!==Re;function wr(){let{caseless:t,skipUndefined:e}=Gi(this)&&this||{},r={},i=(o,n)=>{let s=t&&Hi(r,n)||n;Ut(r[s])&&Ut(o)?r[s]=wr(r[s],o):Ut(o)?r[s]=wr({},o):Ve(o)?r[s]=o.slice():(!e||!Be(o))&&(r[s]=o)};for(let o=0,n=arguments.length;o<n;o++)arguments[o]&&mt(arguments[o],i);return r}var da=(t,e,r,{allOwnKeys:i}={})=>(mt(e,(o,n)=>{r&&J(o)?t[n]=ut(o,r):t[n]=o},{allOwnKeys:i}),t),pa=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),ma=(t,e,r,i)=>{t.prototype=Object.create(e.prototype,i),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),r&&Object.assign(t.prototype,r)},fa=(t,e,r,i)=>{let o,n,s,l={};if(e=e||{},t==null)return e;do{for(o=Object.getOwnPropertyNames(t),n=o.length;n-- >0;)s=o[n],(!i||i(s,t,e))&&!l[s]&&(e[s]=t[s],l[s]=!0);t=r!==!1&&Er(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},ha=(t,e,r)=>{t=String(t),(r===void 0||r>t.length)&&(r=t.length),r-=e.length;let i=t.indexOf(e,r);return i!==-1&&i===r},ga=t=>{if(!t)return null;if(Ve(t))return t;let e=t.length;if(!Wi(e))return null;let r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},ya=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&Er(Uint8Array)),ba=(t,e)=>{let i=(t&&t[jt]).call(t),o;for(;(o=i.next())&&!o.done;){let n=o.value;e.call(t,n[0],n[1])}},Ta=(t,e)=>{let r,i=[];for(;(r=t.exec(e))!==null;)i.push(r);return i},wa=le("HTMLFormElement"),Ea=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,i,o){return i.toUpperCase()+o}),Bi=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),Aa=le("RegExp"),Qi=(t,e)=>{let r=Object.getOwnPropertyDescriptors(t),i={};mt(r,(o,n)=>{let s;(s=e(o,n,t))!==!1&&(i[n]=s||o)}),Object.defineProperties(t,i)},Sa=t=>{Qi(t,(e,r)=>{if(J(t)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;let i=t[r];if(J(i)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},_a=(t,e)=>{let r={},i=o=>{o.forEach(n=>{r[n]=!0})};return Ve(t)?i(t):i(String(t).split(e)),r},Ca=()=>{},Ra=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function xa(t){return!!(t&&J(t.append)&&t[Vi]==="FormData"&&t[jt])}var va=t=>{let e=new Array(10),r=(i,o)=>{if(pt(i)){if(e.indexOf(i)>=0)return;if(dt(i))return i;if(!("toJSON"in i)){e[o]=i;let n=Ve(i)?[]:{};return mt(i,(s,l)=>{let u=r(s,o+1);!Be(u)&&(n[l]=u)}),e[o]=void 0,n}}return i};return r(t,0)},La=le("AsyncFunction"),Da=t=>t&&(pt(t)||J(t))&&J(t.then)&&J(t.catch),$i=((t,e)=>t?setImmediate:e?((r,i)=>(Re.addEventListener("message",({source:o,data:n})=>{o===Re&&n===r&&i.length&&i.shift()()},!1),o=>{i.push(o),Re.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",J(Re.postMessage)),Ia=typeof queueMicrotask<"u"?queueMicrotask.bind(Re):typeof process<"u"&&process.nextTick||$i,Oa=t=>t!=null&&J(t[jt]),a={isArray:Ve,isArrayBuffer:zi,isBuffer:dt,isFormData:oa,isArrayBufferView:Zn,isString:Jn,isNumber:Wi,isBoolean:Kn,isObject:pt,isPlainObject:Ut,isEmptyObject:Yn,isReadableStream:na,isRequest:aa,isResponse:la,isHeaders:ca,isUndefined:Be,isDate:Xn,isFile:ea,isBlob:ta,isRegExp:Aa,isFunction:J,isStream:ia,isURLSearchParams:sa,isTypedArray:ya,isFileList:ra,forEach:mt,merge:wr,extend:da,trim:ua,stripBOM:pa,inherits:ma,toFlatObject:fa,kindOf:Bt,kindOfTest:le,endsWith:ha,toArray:ga,forEachEntry:ba,matchAll:Ta,isHTMLForm:wa,hasOwnProperty:Bi,hasOwnProp:Bi,reduceDescriptors:Qi,freezeMethods:Sa,toObjectSet:_a,toCamelCase:Ea,noop:Ca,toFiniteNumber:Ra,findKey:Hi,global:Re,isContextDefined:Gi,isSpecCompliantForm:xa,toJSONObject:va,isAsyncFn:La,isThenable:Da,setImmediate:$i,asap:Ia,isIterable:Oa};function ze(t,e,r,i,o){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),i&&(this.request=i),o&&(this.response=o,this.status=o.status?o.status:null)}a.inherits(ze,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 Zi=ze.prototype,Ji={};["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=>{Ji[t]={value:t}});Object.defineProperties(ze,Ji);Object.defineProperty(Zi,"isAxiosError",{value:!0});ze.from=(t,e,r,i,o,n)=>{let s=Object.create(Zi);a.toFlatObject(t,s,function(c){return c!==Error.prototype},m=>m!=="isAxiosError");let l=t&&t.message?t.message:"Error",u=e==null&&t?t.code:e;return ze.call(s,l,u,r,i,o),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=ze;import Pa from"form-data";var zt=Pa;function Ar(t){return a.isPlainObject(t)||a.isArray(t)}function Yi(t){return a.endsWith(t,"[]")?t.slice(0,-2):t}function Ki(t,e,r){return t?t.concat(e).map(function(o,n){return o=Yi(o),!r&&n?"["+o+"]":o}).join(r?".":""):e}function Na(t){return a.isArray(t)&&!t.some(Ar)}var Fa=a.toFlatObject(a,{},null,function(e){return/^is[A-Z]/.test(e)});function ka(t,e,r){if(!a.isObject(t))throw new TypeError("target must be an object");e=e||new(zt||FormData),r=a.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,T){return!a.isUndefined(T[y])});let i=r.metaTokens,o=r.visitor||c,n=r.dots,s=r.indexes,u=(r.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(e);if(!a.isFunction(o))throw new TypeError("visitor must be a function");function m(f){if(f===null)return"";if(a.isDate(f))return f.toISOString();if(a.isBoolean(f))return f.toString();if(!u&&a.isBlob(f))throw new g("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(f)||a.isTypedArray(f)?u&&typeof Blob=="function"?new Blob([f]):Buffer.from(f):f}function c(f,y,T){let C=f;if(f&&!T&&typeof f=="object"){if(a.endsWith(y,"{}"))y=i?y:y.slice(0,-2),f=JSON.stringify(f);else if(a.isArray(f)&&Na(f)||(a.isFileList(f)||a.endsWith(y,"[]"))&&(C=a.toArray(f)))return y=Yi(y),C.forEach(function(A,x){!(a.isUndefined(A)||A===null)&&e.append(s===!0?Ki([y],x,n):s===null?y:y+"[]",m(A))}),!1}return Ar(f)?!0:(e.append(Ki(T,y,n),m(f)),!1)}let h=[],b=Object.assign(Fa,{defaultVisitor:c,convertValue:m,isVisitable:Ar});function w(f,y){if(!a.isUndefined(f)){if(h.indexOf(f)!==-1)throw Error("Circular reference detected in "+y.join("."));h.push(f),a.forEach(f,function(C,N){(!(a.isUndefined(C)||C===null)&&o.call(e,C,a.isString(N)?N.trim():N,y,b))===!0&&w(C,y?y.concat(N):[N])}),h.pop()}}if(!a.isObject(t))throw new TypeError("data must be an object");return w(t),e}var we=ka;function Xi(t){let e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(i){return e[i]})}function eo(t,e){this._pairs=[],t&&we(t,this,e)}var to=eo.prototype;to.append=function(e,r){this._pairs.push([e,r])};to.toString=function(e){let r=e?function(i){return e.call(this,i,Xi)}:Xi;return this._pairs.map(function(o){return r(o[0])+"="+r(o[1])},"").join("&")};var ro=eo;function Ma(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function xe(t,e,r){if(!e)return t;let i=r&&r.encode||Ma;a.isFunction(r)&&(r={serialize:r});let o=r&&r.serialize,n;if(o?n=o(e,r):n=a.isURLSearchParams(e)?e.toString():new ro(e,r).toString(i),n){let s=t.indexOf("#");s!==-1&&(t=t.slice(0,s)),t+=(t.indexOf("?")===-1?"?":"&")+n}return t}var Sr=class{constructor(){this.handlers=[]}use(e,r,i){return this.handlers.push({fulfilled:e,rejected:r,synchronous:i?i.synchronous:!1,runWhen:i?i.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(i){i!==null&&e(i)})}},_r=Sr;var We={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};import Ua from"crypto";import qa from"url";var io=qa.URLSearchParams;var Cr="abcdefghijklmnopqrstuvwxyz",oo="0123456789",so={DIGIT:oo,ALPHA:Cr,ALPHA_DIGIT:Cr+Cr.toUpperCase()+oo},ja=(t=16,e=so.ALPHA_DIGIT)=>{let r="",{length:i}=e,o=new Uint32Array(t);Ua.randomFillSync(o);for(let n=0;n<t;n++)r+=e[o[n]%i];return r},no={isNode:!0,classes:{URLSearchParams:io,FormData:zt,Blob:typeof Blob<"u"&&Blob||null},ALPHABET:so,generateString:ja,protocols:["http","https","file","data"]};var vr={};an(vr,{hasBrowserEnv:()=>xr,hasStandardBrowserEnv:()=>Ba,hasStandardBrowserWebWorkerEnv:()=>Va,navigator:()=>Rr,origin:()=>za});var xr=typeof window<"u"&&typeof document<"u",Rr=typeof navigator=="object"&&navigator||void 0,Ba=xr&&(!Rr||["ReactNative","NativeScript","NS"].indexOf(Rr.product)<0),Va=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",za=xr&&window.location.href||"http://localhost";var I={...vr,...no};function Lr(t,e){return we(t,new I.classes.URLSearchParams,{visitor:function(r,i,o,n){return I.isNode&&a.isBuffer(r)?(this.append(i,r.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)},...e})}function Wa(t){return a.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Ha(t){let e={},r=Object.keys(t),i,o=r.length,n;for(i=0;i<o;i++)n=r[i],e[n]=t[n];return e}function Ga(t){function e(r,i,o,n){let s=r[n++];if(s==="__proto__")return!0;let l=Number.isFinite(+s),u=n>=r.length;return s=!s&&a.isArray(o)?o.length:s,u?(a.hasOwnProp(o,s)?o[s]=[o[s],i]:o[s]=i,!l):((!o[s]||!a.isObject(o[s]))&&(o[s]=[]),e(r,i,o[s],n)&&a.isArray(o[s])&&(o[s]=Ha(o[s])),!l)}if(a.isFormData(t)&&a.isFunction(t.entries)){let r={};return a.forEachEntry(t,(i,o)=>{e(Wa(i),o,r,0)}),r}return null}var Wt=Ga;function Qa(t,e,r){if(a.isString(t))try{return(e||JSON.parse)(t),a.trim(t)}catch(i){if(i.name!=="SyntaxError")throw i}return(r||JSON.stringify)(t)}var Dr={transitional:We,adapter:["xhr","http","fetch"],transformRequest:[function(e,r){let i=r.getContentType()||"",o=i.indexOf("application/json")>-1,n=a.isObject(e);if(n&&a.isHTMLForm(e)&&(e=new FormData(e)),a.isFormData(e))return o?JSON.stringify(Wt(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(i.indexOf("application/x-www-form-urlencoded")>-1)return Lr(e,this.formSerializer).toString();if((l=a.isFileList(e))||i.indexOf("multipart/form-data")>-1){let u=this.env&&this.env.FormData;return we(l?{"files[]":e}:e,u&&new u,this.formSerializer)}}return n||o?(r.setContentType("application/json",!1),Qa(e)):e}],transformResponse:[function(e){let r=this.transitional||Dr.transitional,i=r&&r.forcedJSONParsing,o=this.responseType==="json";if(a.isResponse(e)||a.isReadableStream(e))return e;if(e&&a.isString(e)&&(i&&!this.responseType||o)){let s=!(r&&r.silentJSONParsing)&&o;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=>{Dr.headers[t]={}});var He=Dr;var $a=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"]),ao=t=>{let e={},r,i,o;return t&&t.split(`
|
|
6
6
|
`).forEach(function(s){o=s.indexOf(":"),r=s.substring(0,o).trim().toLowerCase(),i=s.substring(o+1).trim(),!(!r||e[r]&&$a[r])&&(r==="set-cookie"?e[r]?e[r].push(i):e[r]=[i]:e[r]=e[r]?e[r]+", "+i:i)}),e};var lo=Symbol("internals");function ft(t){return t&&String(t).trim().toLowerCase()}function Ht(t){return t===!1||t==null?t:a.isArray(t)?t.map(Ht):String(t)}function Za(t){let e=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,i;for(;i=r.exec(t);)e[i[1]]=i[2];return e}var Ja=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function Ir(t,e,r,i,o){if(a.isFunction(i))return i.call(this,e,r);if(o&&(e=r),!!a.isString(e)){if(a.isString(i))return e.indexOf(i)!==-1;if(a.isRegExp(i))return i.test(e)}}function Ka(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,r,i)=>r.toUpperCase()+i)}function Ya(t,e){let r=a.toCamelCase(" "+e);["get","set","has"].forEach(i=>{Object.defineProperty(t,i+r,{value:function(o,n,s){return this[i].call(this,e,o,n,s)},configurable:!0})})}var Ge=class{constructor(e){e&&this.set(e)}set(e,r,i){let o=this;function n(l,u,m){let c=ft(u);if(!c)throw new Error("header name must be a non-empty string");let h=a.findKey(o,c);(!h||o[h]===void 0||m===!0||m===void 0&&o[h]!==!1)&&(o[h||u]=Ht(l))}let s=(l,u)=>a.forEach(l,(m,c)=>n(m,c,u));if(a.isPlainObject(e)||e instanceof this.constructor)s(e,r);else if(a.isString(e)&&(e=e.trim())&&!Ja(e))s(ao(e),r);else if(a.isObject(e)&&a.isIterable(e)){let l={},u,m;for(let c of e){if(!a.isArray(c))throw TypeError("Object iterator must return a key-value pair");l[m=c[0]]=(u=l[m])?a.isArray(u)?[...u,c[1]]:[u,c[1]]:c[1]}s(l,r)}else e!=null&&n(r,e,i);return this}get(e,r){if(e=ft(e),e){let i=a.findKey(this,e);if(i){let o=this[i];if(!r)return o;if(r===!0)return Za(o);if(a.isFunction(r))return r.call(this,o,i);if(a.isRegExp(r))return r.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,r){if(e=ft(e),e){let i=a.findKey(this,e);return!!(i&&this[i]!==void 0&&(!r||Ir(this,this[i],i,r)))}return!1}delete(e,r){let i=this,o=!1;function n(s){if(s=ft(s),s){let l=a.findKey(i,s);l&&(!r||Ir(i,i[l],l,r))&&(delete i[l],o=!0)}}return a.isArray(e)?e.forEach(n):n(e),o}clear(e){let r=Object.keys(this),i=r.length,o=!1;for(;i--;){let n=r[i];(!e||Ir(this,this[n],n,e,!0))&&(delete this[n],o=!0)}return o}normalize(e){let r=this,i={};return a.forEach(this,(o,n)=>{let s=a.findKey(i,n);if(s){r[s]=Ht(o),delete r[n];return}let l=e?Ka(n):String(n).trim();l!==n&&delete r[n],r[l]=Ht(o),i[l]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let r=Object.create(null);return a.forEach(this,(i,o)=>{i!=null&&i!==!1&&(r[o]=e&&a.isArray(i)?i.join(", "):i)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,r])=>e+": "+r).join(`
|
|
7
7
|
`)}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 i=new this(e);return r.forEach(o=>i.set(o)),i}static accessor(e){let i=(this[lo]=this[lo]={accessors:{}}).accessors,o=this.prototype;function n(s){let l=ft(s);i[l]||(Ya(o,s),i[l]=!0)}return a.isArray(e)?e.forEach(n):n(e),this}};Ge.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);a.reduceDescriptors(Ge.prototype,({value:t},e)=>{let r=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(i){this[r]=i}}});a.freezeMethods(Ge);var M=Ge;function ht(t,e){let r=this||He,i=e||r,o=M.from(i.headers),n=i.data;return a.forEach(t,function(l){n=l.call(r,n,o.normalize(),e?e.status:void 0)}),o.normalize(),n}function gt(t){return!!(t&&t.__CANCEL__)}function co(t,e,r){g.call(this,t??"canceled",g.ERR_CANCELED,e,r),this.name="CanceledError"}a.inherits(co,g,{__CANCEL__:!0});var te=co;function pe(t,e,r){let i=r.config.validateStatus;!r.status||!i||i(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 Or(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Pr(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function ve(t,e,r){let i=!Or(e);return t&&(i||r==!1)?Pr(t,e):e}import pl from"proxy-from-env";import ml from"http";import fl from"https";import hl from"util";import gl from"follow-redirects";import Ee from"zlib";var Le="1.12.1";function yt(t){let e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}var Xa=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;function Nr(t,e,r){let i=r&&r.Blob||I.classes.Blob,o=yt(t);if(e===void 0&&i&&(e=!0),o==="data"){t=o.length?t.slice(o.length+1):t;let n=Xa.exec(t);if(!n)throw new g("Invalid URL",g.ERR_INVALID_URL);let s=n[1],l=n[2],u=n[3],m=Buffer.from(decodeURIComponent(u),l?"base64":"utf8");if(e){if(!i)throw new g("Blob is not supported",g.ERR_NOT_SUPPORT);return new i([m],{type:s})}return m}throw new g("Unsupported protocol "+o,g.ERR_NOT_SUPPORT)}import Ze from"stream";import el from"stream";var Fr=Symbol("internals"),kr=class extends el.Transform{constructor(e){e=a.toFlatObject(e,{maxRate:0,chunkSize:64*1024,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,(i,o)=>!a.isUndefined(o[i])),super({readableHighWaterMark:e.chunkSize});let r=this[Fr]={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",i=>{i==="progress"&&(r.isCaptured||(r.isCaptured=!0))})}_read(e){let r=this[Fr];return r.onReadCallback&&r.onReadCallback(),super._read(e)}_transform(e,r,i){let o=this[Fr],n=o.maxRate,s=this.readableHighWaterMark,l=o.timeWindow,u=1e3/l,m=n/u,c=o.minChunkSize!==!1?Math.max(o.minChunkSize,m*.01):0,h=(w,f)=>{let y=Buffer.byteLength(w);o.bytesSeen+=y,o.bytes+=y,o.isCaptured&&this.emit("progress",o.bytesSeen),this.push(w)?process.nextTick(f):o.onReadCallback=()=>{o.onReadCallback=null,process.nextTick(f)}},b=(w,f)=>{let y=Buffer.byteLength(w),T=null,C=s,N,A=0;if(n){let x=Date.now();(!o.ts||(A=x-o.ts)>=l)&&(o.ts=x,N=m-o.bytes,o.bytes=N<0?-N:0,A=0),N=m-o.bytes}if(n){if(N<=0)return setTimeout(()=>{f(null,w)},l-A);N<C&&(C=N)}C&&y>C&&y-C>c&&(T=w.subarray(C),w=w.subarray(0,C)),h(w,T?()=>{process.nextTick(f,null,T)}:f)};b(e,function w(f,y){if(f)return i(f);y?b(y,w):i(null)})}},Mr=kr;import{EventEmitter as yl}from"events";import rl from"util";import{Readable as il}from"stream";var{asyncIterator:uo}=Symbol,tl=async function*(t){t.stream?yield*t.stream():t.arrayBuffer?yield await t.arrayBuffer():t[uo]?yield*t[uo]():yield t},Gt=tl;var ol=I.ALPHABET.ALPHA_DIGIT+"-_",bt=typeof TextEncoder=="function"?new TextEncoder:new rl.TextEncoder,De=`\r
|
|
8
8
|
`,sl=bt.encode(De),nl=2,qr=class{constructor(e,r){let{escapeName:i}=this.constructor,o=a.isString(r),n=`Content-Disposition: form-data; name="${i(e)}"${!o&&r.name?`; filename="${i(r.name)}"`:""}${De}`;o?r=bt.encode(String(r).replace(/\r?\n|\r\n?/g,De)):n+=`Content-Type: ${r.type||"application/octet-stream"}${De}`,this.headers=bt.encode(n+De),this.contentLength=o?r.byteLength:r.size,this.size=this.headers.byteLength+this.contentLength+nl,this.name=e,this.value=r}async*encode(){yield this.headers;let{value:e}=this;a.isTypedArray(e)?yield e:yield*Gt(e),yield sl}static escapeName(e){return String(e).replace(/[\r\n"]/g,r=>({"\r":"%0D","\n":"%0A",'"':"%22"})[r])}},al=(t,e,r)=>{let{tag:i="form-data-boundary",size:o=25,boundary:n=i+"-"+I.generateString(o,ol)}=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+De),l=bt.encode("--"+n+"--"+De),u=l.byteLength,m=Array.from(t.entries()).map(([h,b])=>{let w=new qr(h,b);return u+=w.size,w});u+=s.byteLength*m.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),il.from(async function*(){for(let h of m)yield s,yield*h.encode();yield l}())},po=al;import ll from"stream";var Ur=class extends ll.Transform{__transform(e,r,i){this.push(e),i()}_transform(e,r,i){if(e.length!==0&&(this._transform=this.__transform,e[0]!==120)){let o=Buffer.alloc(2);o[0]=120,o[1]=156,this.push(o,r)}this.__transform(e,r,i)}},mo=Ur;var cl=(t,e)=>a.isAsyncFn(t)?function(...r){let i=r.pop();t.apply(this,r).then(o=>{try{e?i(null,...e(o)):i(null,o)}catch(n){i(n)}},i)}:t,fo=cl;function ul(t,e){t=t||10;let r=new Array(t),i=new Array(t),o=0,n=0,s;return e=e!==void 0?e:1e3,function(u){let m=Date.now(),c=i[n];s||(s=m),r[o]=u,i[o]=m;let h=n,b=0;for(;h!==o;)b+=r[h++],h=h%t;if(o=(o+1)%t,o===n&&(n=(n+1)%t),m-s<e)return;let w=c&&m-c;return w?Math.round(b*1e3/w):void 0}}var ho=ul;function dl(t,e){let r=0,i=1e3/e,o,n,s=(m,c=Date.now())=>{r=c,o=null,n&&(clearTimeout(n),n=null),t(...m)};return[(...m)=>{let c=Date.now(),h=c-r;h>=i?s(m,c):(o=m,n||(n=setTimeout(()=>{n=null,s(o)},i-h)))},()=>o&&s(o)]}var go=dl;var ye=(t,e,r=3)=>{let i=0,o=ho(50,250);return go(n=>{let s=n.loaded,l=n.lengthComputable?n.total:void 0,u=s-i,m=o(u),c=s<=l;i=s;let h={loaded:s,total:l,progress:l?s/l:void 0,bytes:u,rate:m||void 0,estimated:m&&l&&c?(l-s)/m:void 0,event:n,lengthComputable:l!=null,[e?"download":"upload"]:!0};t(h)},r)},Qe=(t,e)=>{let r=t!=null;return[i=>e[0]({lengthComputable:r,total:t,loaded:i}),e[1]]},$e=t=>(...e)=>a.asap(()=>t(...e));function jr(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),i=t.slice(e+1);if(/;base64/i.test(r)){let n=i.length,s=i.length;for(let b=0;b<s;b++)if(i.charCodeAt(b)===37&&b+2<s){let w=i.charCodeAt(b+1),f=i.charCodeAt(b+2);(w>=48&&w<=57||w>=65&&w<=70||w>=97&&w<=102)&&(f>=48&&f<=57||f>=65&&f<=70||f>=97&&f<=102)&&(n-=2,b+=2)}let l=0,u=s-1,m=b=>b>=2&&i.charCodeAt(b-2)===37&&i.charCodeAt(b-1)===51&&(i.charCodeAt(b)===68||i.charCodeAt(b)===100);u>=0&&(i.charCodeAt(u)===61?(l++,u--):m(u)&&(l++,u-=3)),l===1&&u>=0&&(i.charCodeAt(u)===61||m(u))&&l++;let h=Math.floor(n/4)*3-(l||0);return h>0?h:0}return Buffer.byteLength(i,"utf8")}var yo={flush:Ee.constants.Z_SYNC_FLUSH,finishFlush:Ee.constants.Z_SYNC_FLUSH},bl={flush:Ee.constants.BROTLI_OPERATION_FLUSH,finishFlush:Ee.constants.BROTLI_OPERATION_FLUSH},bo=a.isFunction(Ee.createBrotliDecompress),{http:Tl,https:wl}=gl,El=/https:?/,To=I.protocols.map(t=>t+":"),wo=(t,[e,r])=>(t.on("end",r).on("error",r),e);function Al(t,e){t.beforeRedirects.proxy&&t.beforeRedirects.proxy(t),t.beforeRedirects.config&&t.beforeRedirects.config(t,e)}function Ao(t,e,r){let i=e;if(!i&&i!==!1){let o=pl.getProxyForUrl(r);o&&(i=new URL(o))}if(i){if(i.username&&(i.auth=(i.username||"")+":"+(i.password||"")),i.auth){(i.auth.username||i.auth.password)&&(i.auth=(i.auth.username||"")+":"+(i.auth.password||""));let n=Buffer.from(i.auth,"utf8").toString("base64");t.headers["Proxy-Authorization"]="Basic "+n}t.headers.host=t.hostname+(t.port?":"+t.port:"");let o=i.hostname||i.host;t.hostname=o,t.host=o,t.port=i.port,t.path=r,i.protocol&&(t.protocol=i.protocol.includes(":")?i.protocol:`${i.protocol}:`)}t.beforeRedirects.proxy=function(n){Ao(n,e,n.href)}}var Sl=typeof process<"u"&&a.kindOf(process)==="process",_l=t=>new Promise((e,r)=>{let i,o,n=(u,m)=>{o||(o=!0,i&&i(u,m))},s=u=>{n(u),e(u)},l=u=>{n(u,!0),r(u)};t(s,l,u=>i=u).catch(l)}),Cl=({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)}},Eo=(t,e)=>Cl(a.isObject(t)?t:{address:t,family:e}),So=Sl&&function(e){return _l(async function(i,o,n){let{data:s,lookup:l,family:u}=e,{responseType:m,responseEncoding:c}=e,h=e.method.toUpperCase(),b,w=!1,f;if(l){let E=fo(l,S=>a.isArray(S)?S:[S]);l=(S,z,Q)=>{E(S,z,(F,re,be)=>{if(F)return Q(F);let ee=a.isArray(re)?re.map(ie=>Eo(ie)):[Eo(re,be)];z.all?Q(F,ee):Q(F,ee[0].address,ee[0].family)})}}let y=new yl,T=()=>{e.cancelToken&&e.cancelToken.unsubscribe(C),e.signal&&e.signal.removeEventListener("abort",C),y.removeAllListeners()};n((E,S)=>{b=!0,S&&(w=!0,T())});function C(E){y.emit("abort",!E||E.type?new te(null,e,f):E)}y.once("abort",o),(e.cancelToken||e.signal)&&(e.cancelToken&&e.cancelToken.subscribe(C),e.signal&&(e.signal.aborted?C():e.signal.addEventListener("abort",C)));let N=ve(e.baseURL,e.url,e.allowAbsoluteUrls),A=new URL(N,I.hasBrowserEnv?I.origin:void 0),x=A.protocol||To[0];if(x==="data:"){if(e.maxContentLength>-1){let S=String(e.url||N||"");if(jr(S)>e.maxContentLength)return o(new g("maxContentLength size of "+e.maxContentLength+" exceeded",g.ERR_BAD_RESPONSE,e))}let E;if(h!=="GET")return pe(i,o,{status:405,statusText:"method not allowed",headers:{},config:e});try{E=Nr(e.url,m==="blob",{Blob:e.env&&e.env.Blob})}catch(S){throw g.from(S,g.ERR_BAD_REQUEST,e)}return m==="text"?(E=E.toString(c),(!c||c==="utf8")&&(E=a.stripBOM(E))):m==="stream"&&(E=Ze.Readable.from(E)),pe(i,o,{data:E,status:200,statusText:"OK",headers:new M,config:e})}if(To.indexOf(x)===-1)return o(new g("Unsupported protocol "+x,g.ERR_BAD_REQUEST,e));let v=M.from(e.headers).normalize();v.set("User-Agent","axios/"+Le,!1);let{onUploadProgress:q,onDownloadProgress:U}=e,ue=e.maxRate,ne,fe;if(a.isSpecCompliantForm(s)){let E=v.getContentType(/boundary=([-_\w\d]{10,70})/i);s=po(s,S=>{v.set(S)},{tag:`axios-${Le}-boundary`,boundary:E&&E[1]||void 0})}else if(a.isFormData(s)&&a.isFunction(s.getHeaders)){if(v.set(s.getHeaders()),!v.hasContentLength())try{let E=await hl.promisify(s.getLength).call(s);Number.isFinite(E)&&E>=0&&v.setContentLength(E)}catch{}}else if(a.isBlob(s)||a.isFile(s))s.size&&v.setContentType(s.type||"application/octet-stream"),v.setContentLength(s.size||0),s=Ze.Readable.from(Gt(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 o(new g("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",g.ERR_BAD_REQUEST,e));if(v.setContentLength(s.length,!1),e.maxBodyLength>-1&&s.length>e.maxBodyLength)return o(new g("Request body larger than maxBodyLength limit",g.ERR_BAD_REQUEST,e))}let he=a.toFiniteNumber(v.getContentLength());a.isArray(ue)?(ne=ue[0],fe=ue[1]):ne=fe=ue,s&&(q||ne)&&(a.isStream(s)||(s=Ze.Readable.from(s,{objectMode:!1})),s=Ze.pipeline([s,new Mr({maxRate:a.toFiniteNumber(ne)})],a.noop),q&&s.on("progress",wo(s,Qe(he,ye($e(q),!1,3)))));let Y;if(e.auth){let E=e.auth.username||"",S=e.auth.password||"";Y=E+":"+S}if(!Y&&A.username){let E=A.username,S=A.password;Y=E+":"+S}Y&&v.delete("authorization");let X;try{X=xe(A.pathname+A.search,e.params,e.paramsSerializer).replace(/^\?/,"")}catch(E){let S=new Error(E.message);return S.config=e,S.url=e.url,S.exists=!0,o(S)}v.set("Accept-Encoding","gzip, compress, deflate"+(bo?", br":""),!1);let j={path:X,method:h,headers:v.toJSON(),agents:{http:e.httpAgent,https:e.httpsAgent},auth:Y,protocol:x,family:u,beforeRedirect:Al,beforeRedirects:{}};!a.isUndefined(l)&&(j.lookup=l),e.socketPath?j.socketPath=e.socketPath:(j.hostname=A.hostname.startsWith("[")?A.hostname.slice(1,-1):A.hostname,j.port=A.port,Ao(j,e.proxy,x+"//"+A.hostname+(A.port?":"+A.port:"")+j.path));let B,G=El.test(j.protocol);if(j.agent=G?e.httpsAgent:e.httpAgent,e.transport?B=e.transport:e.maxRedirects===0?B=G?fl:ml:(e.maxRedirects&&(j.maxRedirects=e.maxRedirects),e.beforeRedirect&&(j.beforeRedirects.config=e.beforeRedirect),B=G?wl:Tl),e.maxBodyLength>-1?j.maxBodyLength=e.maxBodyLength:j.maxBodyLength=1/0,e.insecureHTTPParser&&(j.insecureHTTPParser=e.insecureHTTPParser),f=B.request(j,function(S){if(f.destroyed)return;let z=[S],Q=+S.headers["content-length"];if(U||fe){let ie=new Mr({maxRate:a.toFiniteNumber(fe)});U&&ie.on("progress",wo(ie,Qe(Q,ye($e(U),!0,3)))),z.push(ie)}let F=S,re=S.req||f;if(e.decompress!==!1&&S.headers["content-encoding"])switch((h==="HEAD"||S.statusCode===204)&&delete S.headers["content-encoding"],(S.headers["content-encoding"]||"").toLowerCase()){case"gzip":case"x-gzip":case"compress":case"x-compress":z.push(Ee.createUnzip(yo)),delete S.headers["content-encoding"];break;case"deflate":z.push(new mo),z.push(Ee.createUnzip(yo)),delete S.headers["content-encoding"];break;case"br":bo&&(z.push(Ee.createBrotliDecompress(bl)),delete S.headers["content-encoding"])}F=z.length>1?Ze.pipeline(z,a.noop):z[0];let be=Ze.finished(F,()=>{be(),T()}),ee={status:S.statusCode,statusText:S.statusMessage,headers:new M(S.headers),config:e,request:re};if(m==="stream")ee.data=F,pe(i,o,ee);else{let ie=[],gi=0;F.on("data",function($){ie.push($),gi+=$.length,e.maxContentLength>-1&&gi>e.maxContentLength&&(w=!0,F.destroy(),o(new g("maxContentLength size of "+e.maxContentLength+" exceeded",g.ERR_BAD_RESPONSE,e,re)))}),F.on("aborted",function(){if(w)return;let $=new g("stream has been aborted",g.ERR_BAD_RESPONSE,e,re);F.destroy($),o($)}),F.on("error",function($){f.destroyed||o(g.from($,null,e,re))}),F.on("end",function(){try{let $=ie.length===1?ie[0]:Buffer.concat(ie);m!=="arraybuffer"&&($=$.toString(c),(!c||c==="utf8")&&($=a.stripBOM($))),ee.data=$}catch($){return o(g.from($,null,e,ee.request,ee))}pe(i,o,ee)})}y.once("abort",ie=>{F.destroyed||(F.emit("error",ie),F.destroy())})}),y.once("abort",E=>{o(E),f.destroy(E)}),f.on("error",function(S){o(g.from(S,null,e,f))}),f.on("socket",function(S){S.setKeepAlive(!0,1e3*60)}),e.timeout){let E=parseInt(e.timeout,10);if(Number.isNaN(E)){o(new g("error trying to parse `config.timeout` to int",g.ERR_BAD_OPTION_VALUE,e,f));return}f.setTimeout(E,function(){if(b)return;let z=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",Q=e.transitional||We;e.timeoutErrorMessage&&(z=e.timeoutErrorMessage),o(new g(z,Q.clarifyTimeoutError?g.ETIMEDOUT:g.ECONNABORTED,e,f)),C()})}if(a.isStream(s)){let E=!1,S=!1;s.on("end",()=>{E=!0}),s.once("error",z=>{S=!0,f.destroy(z)}),s.on("close",()=>{!E&&!S&&C(new te("Request stream has been aborted",e,f))}),s.pipe(f)}else f.end(s)})};var _o=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 Co=I.hasStandardBrowserEnv?{write(t,e,r,i,o,n){let s=[t+"="+encodeURIComponent(e)];a.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),a.isString(i)&&s.push("path="+i),a.isString(o)&&s.push("domain="+o),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 Ro=t=>t instanceof M?{...t}:t;function ce(t,e){e=e||{};let r={};function i(m,c,h,b){return a.isPlainObject(m)&&a.isPlainObject(c)?a.merge.call({caseless:b},m,c):a.isPlainObject(c)?a.merge({},c):a.isArray(c)?c.slice():c}function o(m,c,h,b){if(a.isUndefined(c)){if(!a.isUndefined(m))return i(void 0,m,h,b)}else return i(m,c,h,b)}function n(m,c){if(!a.isUndefined(c))return i(void 0,c)}function s(m,c){if(a.isUndefined(c)){if(!a.isUndefined(m))return i(void 0,m)}else return i(void 0,c)}function l(m,c,h){if(h in e)return i(m,c);if(h in t)return i(void 0,m)}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:(m,c,h)=>o(Ro(m),Ro(c),h,!0)};return a.forEach(Object.keys({...t,...e}),function(c){let h=u[c]||o,b=h(t[c],e[c],c);a.isUndefined(b)&&h!==l||(r[c]=b)}),r}var Qt=t=>{let e=ce({},t),{data:r,withXSRFToken:i,xsrfHeaderName:o,xsrfCookieName:n,headers:s,auth:l}=e;if(e.headers=s=M.from(s),e.url=xe(ve(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(),m=["content-type","content-length"];Object.entries(u).forEach(([c,h])=>{m.includes(c.toLowerCase())&&s.set(c,h)})}}if(I.hasStandardBrowserEnv&&(i&&a.isFunction(i)&&(i=i(e)),i||i!==!1&&_o(e.url))){let u=o&&n&&Co.read(n);u&&s.set(o,u)}return e};var Rl=typeof XMLHttpRequest<"u",xo=Rl&&function(t){return new Promise(function(r,i){let o=Qt(t),n=o.data,s=M.from(o.headers).normalize(),{responseType:l,onUploadProgress:u,onDownloadProgress:m}=o,c,h,b,w,f;function y(){w&&w(),f&&f(),o.cancelToken&&o.cancelToken.unsubscribe(c),o.signal&&o.signal.removeEventListener("abort",c)}let T=new XMLHttpRequest;T.open(o.method.toUpperCase(),o.url,!0),T.timeout=o.timeout;function C(){if(!T)return;let A=M.from("getAllResponseHeaders"in T&&T.getAllResponseHeaders()),v={data:!l||l==="text"||l==="json"?T.responseText:T.response,status:T.status,statusText:T.statusText,headers:A,config:t,request:T};pe(function(U){r(U),y()},function(U){i(U),y()},v),T=null}"onloadend"in T?T.onloadend=C:T.onreadystatechange=function(){!T||T.readyState!==4||T.status===0&&!(T.responseURL&&T.responseURL.indexOf("file:")===0)||setTimeout(C)},T.onabort=function(){T&&(i(new g("Request aborted",g.ECONNABORTED,t,T)),T=null)},T.onerror=function(x){let v=x&&x.message?x.message:"Network Error",q=new g(v,g.ERR_NETWORK,t,T);q.event=x||null,i(q),T=null},T.ontimeout=function(){let x=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded",v=o.transitional||We;o.timeoutErrorMessage&&(x=o.timeoutErrorMessage),i(new g(x,v.clarifyTimeoutError?g.ETIMEDOUT:g.ECONNABORTED,t,T)),T=null},n===void 0&&s.setContentType(null),"setRequestHeader"in T&&a.forEach(s.toJSON(),function(x,v){T.setRequestHeader(v,x)}),a.isUndefined(o.withCredentials)||(T.withCredentials=!!o.withCredentials),l&&l!=="json"&&(T.responseType=o.responseType),m&&([b,f]=ye(m,!0),T.addEventListener("progress",b)),u&&T.upload&&([h,w]=ye(u),T.upload.addEventListener("progress",h),T.upload.addEventListener("loadend",w)),(o.cancelToken||o.signal)&&(c=A=>{T&&(i(!A||A.type?new te(null,t,T):A),T.abort(),T=null)},o.cancelToken&&o.cancelToken.subscribe(c),o.signal&&(o.signal.aborted?c():o.signal.addEventListener("abort",c)));let N=yt(o.url);if(N&&I.protocols.indexOf(N)===-1){i(new g("Unsupported protocol "+N+":",g.ERR_BAD_REQUEST,t));return}T.send(n||null)})};var xl=(t,e)=>{let{length:r}=t=t?t.filter(Boolean):[];if(e||r){let i=new AbortController,o,n=function(m){if(!o){o=!0,l();let c=m instanceof Error?m:this.reason;i.abort(c instanceof g?c:new te(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(m=>{m.unsubscribe?m.unsubscribe(n):m.removeEventListener("abort",n)}),t=null)};t.forEach(m=>m.addEventListener("abort",n));let{signal:u}=i;return u.unsubscribe=()=>a.asap(l),u}},vo=xl;var vl=function*(t,e){let r=t.byteLength;if(!e||r<e){yield t;return}let i=0,o;for(;i<r;)o=i+e,yield t.slice(i,o),i=o},Ll=async function*(t,e){for await(let r of Dl(t))yield*vl(r,e)},Dl=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}let e=t.getReader();try{for(;;){let{done:r,value:i}=await e.read();if(r)break;yield i}}finally{await e.cancel()}},Br=(t,e,r,i)=>{let o=Ll(t,e),n=0,s,l=u=>{s||(s=!0,i&&i(u))};return new ReadableStream({async pull(u){try{let{done:m,value:c}=await o.next();if(m){l(),u.close();return}let h=c.byteLength;if(r){let b=n+=h;r(b)}u.enqueue(new Uint8Array(c))}catch(m){throw l(m),m}},cancel(u){return l(u),o.return()}},{highWaterMark:2})};var Lo=64*1024,{isFunction:$t}=a,Po=(({fetch:t,Request:e,Response:r})=>({fetch:t,Request:e,Response:r}))(a.global),{ReadableStream:Do,TextEncoder:Io}=a.global,Oo=(t,...e)=>{try{return!!t(...e)}catch{return!1}},Il=t=>{let{fetch:e,Request:r,Response:i}=Object.assign({},Po,t),o=$t(e),n=$t(r),s=$t(i);if(!o)return!1;let l=o&&$t(Do),u=o&&(typeof Io=="function"?(f=>y=>f.encode(y))(new Io):async f=>new Uint8Array(await new r(f).arrayBuffer())),m=n&&l&&Oo(()=>{let f=!1,y=new r(I.origin,{body:new Do,method:"POST",get duplex(){return f=!0,"half"}}).headers.has("Content-Type");return f&&!y}),c=s&&l&&Oo(()=>a.isReadableStream(new i("").body)),h={stream:c&&(f=>f.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(f=>{!h[f]&&(h[f]=(y,T)=>{let C=y&&y[f];if(C)return C.call(y);throw new g(`Response type '${f}' is not supported`,g.ERR_NOT_SUPPORT,T)})});let b=async f=>{if(f==null)return 0;if(a.isBlob(f))return f.size;if(a.isSpecCompliantForm(f))return(await new r(I.origin,{method:"POST",body:f}).arrayBuffer()).byteLength;if(a.isArrayBufferView(f)||a.isArrayBuffer(f))return f.byteLength;if(a.isURLSearchParams(f)&&(f=f+""),a.isString(f))return(await u(f)).byteLength},w=async(f,y)=>{let T=a.toFiniteNumber(f.getContentLength());return T??b(y)};return async f=>{let{url:y,method:T,data:C,signal:N,cancelToken:A,timeout:x,onDownloadProgress:v,onUploadProgress:q,responseType:U,headers:ue,withCredentials:ne="same-origin",fetchOptions:fe}=Qt(f);U=U?(U+"").toLowerCase():"text";let he=vo([N,A&&A.toAbortSignal()],x),Y=null,X=he&&he.unsubscribe&&(()=>{he.unsubscribe()}),j;try{if(q&&m&&T!=="get"&&T!=="head"&&(j=await w(ue,C))!==0){let Q=new r(y,{method:"POST",body:C,duplex:"half"}),F;if(a.isFormData(C)&&(F=Q.headers.get("content-type"))&&ue.setContentType(F),Q.body){let[re,be]=Qe(j,ye($e(q)));C=Br(Q.body,Lo,re,be)}}a.isString(ne)||(ne=ne?"include":"omit");let B=n&&"credentials"in r.prototype,G={...fe,signal:he,method:T.toUpperCase(),headers:ue.normalize().toJSON(),body:C,duplex:"half",credentials:B?ne:void 0};Y=n&&new r(y,G);let E=await(n?e(Y,fe):e(y,G)),S=c&&(U==="stream"||U==="response");if(c&&(v||S&&X)){let Q={};["status","statusText","headers"].forEach(ee=>{Q[ee]=E[ee]});let F=a.toFiniteNumber(E.headers.get("content-length")),[re,be]=v&&Qe(F,ye($e(v),!0))||[];E=new i(Br(E.body,Lo,re,()=>{be&&be(),X&&X()}),Q)}U=U||"text";let z=await h[a.findKey(h,U)||"text"](E,f);return!S&&X&&X(),await new Promise((Q,F)=>{pe(Q,F,{data:z,headers:M.from(E.headers),status:E.status,statusText:E.statusText,config:f,request:Y})})}catch(B){throw X&&X(),B&&B.name==="TypeError"&&/Load failed|fetch/i.test(B.message)?Object.assign(new g("Network Error",g.ERR_NETWORK,f,Y),{cause:B.cause||B}):g.from(B,B&&B.code,f,Y)}}},Ol=new Map,Vr=t=>{let e=a.merge.call({skipUndefined:!0},Po,t?t.env:null),{fetch:r,Request:i,Response:o}=e,n=[i,o,r],s=n.length,l=s,u,m,c=Ol;for(;l--;)u=n[l],m=c.get(u),m===void 0&&c.set(u,m=l?new Map:Il(e)),c=m;return m},_h=Vr();var zr={http:So,xhr:xo,fetch:{get:Vr}};a.forEach(zr,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});var No=t=>`- ${t}`,Nl=t=>a.isFunction(t)||t===null||t===!1,Zt={getAdapter:(t,e)=>{t=a.isArray(t)?t:[t];let{length:r}=t,i,o,n={};for(let s=0;s<r;s++){i=t[s];let l;if(o=i,!Nl(i)&&(o=zr[(l=String(i)).toLowerCase()],o===void 0))throw new g(`Unknown adapter '${l}'`);if(o&&(a.isFunction(o)||(o=o.get(e))))break;n[l||"#"+s]=o}if(!o){let s=Object.entries(n).map(([u,m])=>`adapter ${u} `+(m===!1?"is not supported by the environment":"is not available in the build")),l=r?s.length>1?`since :
|