UNPKG

figma-api

Version:

Thin typed wrapper around the Figma REST API

7 lines (6 loc) 42.6 kB
"use strict";var Figma=(()=>{var _e=Object.defineProperty;var Bs=Object.getOwnPropertyDescriptor;var Gs=Object.getOwnPropertyNames;var js=Object.prototype.hasOwnProperty;var pt=(e,t)=>{for(var s in t)_e(e,s,{get:t[s],enumerable:!0})},Vs=(e,t,s,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Gs(t))!js.call(e,o)&&o!==s&&_e(e,o,{get:()=>t[o],enumerable:!(r=Bs(t,o))||r.enumerable});return e};var Hs=e=>Vs(_e({},"__esModule",{value:!0}),e);var ao={};pt(ao,{API_DOMAIN:()=>g,API_VER:()=>y,API_VER_WEBHOOKS:()=>V,Api:()=>ot,oAuthLink:()=>no,oAuthToken:()=>io});var g="https://api.figma.com",y="v1",V="v2";function x(e){return e?Object.entries(e).map(([t,s])=>t&&s&&`${t}=${encodeURIComponent(s)}`).filter(Boolean).join("&"):""}var Y=class e extends Error{constructor(s){super(s.message);this.error=s;this.name="ApiError",Error.captureStackTrace&&Error.captureStackTrace(this,e)}};function mt(e,t){let s=x(t);return this.request(`${g}/${"v1"}/files/${e.file_key}?${s}`)}function ft(e,t){let s=x(t);return this.request(`${g}/${"v1"}/files/${e.file_key}/nodes?${s}`)}function dt(e,t){let s=x(t);return this.request(`${g}/${"v1"}/images/${e.file_key}?${s}`)}function ht(e){return this.request(`${g}/${"v1"}/files/${e.file_key}/images`)}function At(e){return this.request(`${g}/${"v1"}/files/${e.file_key}/comments`)}function gt(e,t){return this.request(`${g}/${"v1"}/files/${e.file_key}/comments`,{method:"POST",data:t})}function yt(e){return this.request(`${g}/${"v1"}/files/${e.file_key}/comments/${e.comment_id}`,{method:"DELETE",data:""})}function Pt(e,t){let s=x(t);return this.request(`${g}/${"v1"}/files/${e.file_key}/comments/${e.comment_id}/reactions?${s}`)}function Rt(e,t){return this.request(`${g}/${"v1"}/files/${e.file_key}/comments/${e.comment_id}/reactions`,{method:"POST",data:t})}function bt(e){return this.request(`${g}/${"v1"}/files/${e.file_key}/comments/${e.comment_id}/reactions`,{method:"DELETE",data:""})}function Et(){return this.request(`${g}/${"v1"}/me`)}function xt(e){return this.request(`${g}/${"v1"}/files/${e.file_key}/versions`)}function Ct(e){return this.request(`${g}/${"v1"}/teams/${e.team_id}/projects`)}function Ft(e,t){let s=x(t);return this.request(`${g}/${"v1"}/projects/${e.project_id}/files?${s}`)}function wt(e,t){let s=x(t);return this.request(`${g}/${"v1"}/teams/${e.team_id}/components?${s}`)}function St(e){return this.request(`${g}/${"v1"}/files/${e.file_key}/components`)}function Tt(e){return this.request(`${g}/${"v1"}/components/${e.key}`)}function Ot(e,t){let s=x(t);return this.request(`${g}/${"v1"}/teams/${e.team_id}/component_sets?${s}`)}function It(e){return this.request(`${g}/${"v1"}/files/${e.file_key}/component_sets`)}function kt(e){return this.request(`${g}/${"v1"}/component_sets/${e.key}`)}function $t(e,t){let s=x(t);return this.request(`${g}/${"v1"}/teams/${e.team_id}/styles?${s}`)}function _t(e){return this.request(`${g}/${"v1"}/files/${e.file_key}/styles`)}function Lt(e){return this.request(`${g}/${"v1"}/styles/${e.key}`)}function qt(e){return this.request(`${g}/${"v2"}/webhooks/${e.webhook_id}`)}function Dt(e){return this.request(`${g}/${"v2"}/webhooks`,{method:"POST",data:e})}function Ut(e,t){return this.request(`${g}/${"v2"}/webhooks/${e.webhook_id}`,{method:"PUT",data:t})}function Nt(e){return this.request(`${g}/${"v2"}/webhooks/${e.webhook_id}/`,{method:"DELETE",data:""})}function Bt(e){return this.request(`${g}/${"v2"}/teams/${e.team_id}/webhooks`)}function Gt(e){return this.request(`${g}/${"v2"}/webhooks/${e.webhook_id}/requests`)}function jt(e){return this.request(`${g}/${"v1"}/files/${e.file_key}/variables/local`)}function Vt(e){return this.request(`${g}/${"v1"}/files/${e.file_key}/variables/published`)}function Ht(e,t){return this.request(`${g}/${"v1"}/files/${e.file_key}/variables`,{method:"POST",data:t})}function Mt(e,t){let s=x(t);return this.request(`${g}/${"v1"}/files/${e.file_key}/dev_resources`)}function Wt(e){return this.request(`${g}/${"v1"}/dev_resources`,{method:"POST",data:e})}function vt(e){return this.request(`${g}/${"v1"}/dev_resources`,{method:"PUT",data:e})}function Qt(e){return this.request(`${g}/${"v1"}/files/${e.file_key}/dev_resources/${e.dev_resource_id}`,{method:"DELETE",data:""})}function zt(e,t){let s=x(t);return this.request(`${g}/${"v1"}/analytics/libraries/${e.file_key}/component/actions?${s}`)}function Jt(e,t){let s=x(t);return this.request(`${g}/${"v1"}/analytics/libraries/${e.file_key}/component/usages?${s}`)}function Kt(e,t){let s=x(t);return this.request(`${g}/${"v1"}/analytics/libraries/${e.file_key}/style/actions?${s}`)}function Xt(e,t){let s=x(t);return this.request(`${g}/${"v1"}/analytics/libraries/${e.file_key}/style/usages?${s}`)}function Zt(e,t){let s=x(t);return this.request(`${g}/${"v1"}/analytics/libraries/${e.file_key}/variable/actions?${s}`)}function Yt(e,t){let s=x(t);return this.request(`${g}/${"v1"}/analytics/libraries/${e.file_key}/variable/usages?${s}`)}function ee(e,t){return function(){return e.apply(t,arguments)}}var{toString:Ws}=Object.prototype,{getPrototypeOf:qe}=Object,{iterator:ge,toStringTag:ts}=Symbol,ye=(e=>t=>{let s=Ws.call(t);return e[s]||(e[s]=s.slice(8,-1).toLowerCase())})(Object.create(null)),$=e=>(e=e.toLowerCase(),t=>ye(t)===e),Pe=e=>t=>typeof t===e,{isArray:v}=Array,W=Pe("undefined");function te(e){return e!==null&&!W(e)&&e.constructor!==null&&!W(e.constructor)&&T(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var ss=$("ArrayBuffer");function vs(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&ss(e.buffer),t}var Qs=Pe("string"),T=Pe("function"),rs=Pe("number"),se=e=>e!==null&&typeof e=="object",zs=e=>e===!0||e===!1,Ae=e=>{if(ye(e)!=="object")return!1;let t=qe(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(ts in e)&&!(ge in e)},Js=e=>{if(!se(e)||te(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Ks=$("Date"),Xs=$("File"),Zs=$("Blob"),Ys=$("FileList"),er=e=>se(e)&&T(e.pipe),tr=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||T(e.append)&&((t=ye(e))==="formdata"||t==="object"&&T(e.toString)&&e.toString()==="[object FormData]"))},sr=$("URLSearchParams"),[rr,or,nr,ir]=["ReadableStream","Request","Response","Headers"].map($),ar=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function re(e,t,{allOwnKeys:s=!1}={}){if(e===null||typeof e>"u")return;let r,o;if(typeof e!="object"&&(e=[e]),v(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{if(te(e))return;let i=s?Object.getOwnPropertyNames(e):Object.keys(e),n=i.length,l;for(r=0;r<n;r++)l=i[r],t.call(null,e[l],l,e)}}function os(e,t){if(te(e))return null;t=t.toLowerCase();let s=Object.keys(e),r=s.length,o;for(;r-- >0;)if(o=s[r],t===o.toLowerCase())return o;return null}var H=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,ns=e=>!W(e)&&e!==H;function Le(){let{caseless:e,skipUndefined:t}=ns(this)&&this||{},s={},r=(o,i)=>{let n=e&&os(s,i)||i;Ae(s[n])&&Ae(o)?s[n]=Le(s[n],o):Ae(o)?s[n]=Le({},o):v(o)?s[n]=o.slice():(!t||!W(o))&&(s[n]=o)};for(let o=0,i=arguments.length;o<i;o++)arguments[o]&&re(arguments[o],r);return s}var lr=(e,t,s,{allOwnKeys:r}={})=>(re(t,(o,i)=>{s&&T(o)?e[i]=ee(o,s):e[i]=o},{allOwnKeys:r}),e),cr=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),ur=(e,t,s,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),s&&Object.assign(e.prototype,s)},pr=(e,t,s,r)=>{let o,i,n,l={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)n=o[i],(!r||r(n,e,t))&&!l[n]&&(t[n]=e[n],l[n]=!0);e=s!==!1&&qe(e)}while(e&&(!s||s(e,t))&&e!==Object.prototype);return t},mr=(e,t,s)=>{e=String(e),(s===void 0||s>e.length)&&(s=e.length),s-=t.length;let r=e.indexOf(t,s);return r!==-1&&r===s},fr=e=>{if(!e)return null;if(v(e))return e;let t=e.length;if(!rs(t))return null;let s=new Array(t);for(;t-- >0;)s[t]=e[t];return s},dr=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&qe(Uint8Array)),hr=(e,t)=>{let r=(e&&e[ge]).call(e),o;for(;(o=r.next())&&!o.done;){let i=o.value;t.call(e,i[0],i[1])}},Ar=(e,t)=>{let s,r=[];for(;(s=e.exec(t))!==null;)r.push(s);return r},gr=$("HTMLFormElement"),yr=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(s,r,o){return r.toUpperCase()+o}),es=(({hasOwnProperty:e})=>(t,s)=>e.call(t,s))(Object.prototype),Pr=$("RegExp"),is=(e,t)=>{let s=Object.getOwnPropertyDescriptors(e),r={};re(s,(o,i)=>{let n;(n=t(o,i,e))!==!1&&(r[i]=n||o)}),Object.defineProperties(e,r)},Rr=e=>{is(e,(t,s)=>{if(T(e)&&["arguments","caller","callee"].indexOf(s)!==-1)return!1;let r=e[s];if(T(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+s+"'")})}})},br=(e,t)=>{let s={},r=o=>{o.forEach(i=>{s[i]=!0})};return v(e)?r(e):r(String(e).split(t)),s},Er=()=>{},xr=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Cr(e){return!!(e&&T(e.append)&&e[ts]==="FormData"&&e[ge])}var Fr=e=>{let t=new Array(10),s=(r,o)=>{if(se(r)){if(t.indexOf(r)>=0)return;if(te(r))return r;if(!("toJSON"in r)){t[o]=r;let i=v(r)?[]:{};return re(r,(n,l)=>{let m=s(n,o+1);!W(m)&&(i[l]=m)}),t[o]=void 0,i}}return r};return s(e,0)},wr=$("AsyncFunction"),Sr=e=>e&&(se(e)||T(e))&&T(e.then)&&T(e.catch),as=((e,t)=>e?setImmediate:t?((s,r)=>(H.addEventListener("message",({source:o,data:i})=>{o===H&&i===s&&r.length&&r.shift()()},!1),o=>{r.push(o),H.postMessage(s,"*")}))(`axios@${Math.random()}`,[]):s=>setTimeout(s))(typeof setImmediate=="function",T(H.postMessage)),Tr=typeof queueMicrotask<"u"?queueMicrotask.bind(H):typeof process<"u"&&process.nextTick||as,Or=e=>e!=null&&T(e[ge]),a={isArray:v,isArrayBuffer:ss,isBuffer:te,isFormData:tr,isArrayBufferView:vs,isString:Qs,isNumber:rs,isBoolean:zs,isObject:se,isPlainObject:Ae,isEmptyObject:Js,isReadableStream:rr,isRequest:or,isResponse:nr,isHeaders:ir,isUndefined:W,isDate:Ks,isFile:Xs,isBlob:Zs,isRegExp:Pr,isFunction:T,isStream:er,isURLSearchParams:sr,isTypedArray:dr,isFileList:Ys,forEach:re,merge:Le,extend:lr,trim:ar,stripBOM:cr,inherits:ur,toFlatObject:pr,kindOf:ye,kindOfTest:$,endsWith:mr,toArray:fr,forEachEntry:hr,matchAll:Ar,isHTMLForm:gr,hasOwnProperty:es,hasOwnProp:es,reduceDescriptors:is,freezeMethods:Rr,toObjectSet:br,toCamelCase:yr,noop:Er,toFiniteNumber:xr,findKey:os,global:H,isContextDefined:ns,isSpecCompliantForm:Cr,toJSONObject:Fr,isAsyncFn:wr,isThenable:Sr,setImmediate:as,asap:Tr,isIterable:Or};function Q(e,t,s,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),s&&(this.config=s),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}a.inherits(Q,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 ls=Q.prototype,cs={};["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(e=>{cs[e]={value:e}});Object.defineProperties(Q,cs);Object.defineProperty(ls,"isAxiosError",{value:!0});Q.from=(e,t,s,r,o,i)=>{let n=Object.create(ls);a.toFlatObject(e,n,function(c){return c!==Error.prototype},p=>p!=="isAxiosError");let l=e&&e.message?e.message:"Error",m=t==null&&e?e.code:t;return Q.call(n,l,m,s,r,o),e&&n.cause==null&&Object.defineProperty(n,"cause",{value:e,configurable:!0}),n.name=e&&e.name||"Error",i&&Object.assign(n,i),n};var A=Q;var Re=null;function De(e){return a.isPlainObject(e)||a.isArray(e)}function ps(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function us(e,t,s){return e?e.concat(t).map(function(o,i){return o=ps(o),!s&&i?"["+o+"]":o}).join(s?".":""):t}function Ir(e){return a.isArray(e)&&!e.some(De)}var kr=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function $r(e,t,s){if(!a.isObject(e))throw new TypeError("target must be an object");t=t||new(Re||FormData),s=a.toFlatObject(s,{metaTokens:!0,dots:!1,indexes:!1},!1,function(h,f){return!a.isUndefined(f[h])});let r=s.metaTokens,o=s.visitor||c,i=s.dots,n=s.indexes,m=(s.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(o))throw new TypeError("visitor must be a function");function p(u){if(u===null)return"";if(a.isDate(u))return u.toISOString();if(a.isBoolean(u))return u.toString();if(!m&&a.isBlob(u))throw new A("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(u)||a.isTypedArray(u)?m&&typeof Blob=="function"?new Blob([u]):Buffer.from(u):u}function c(u,h,f){let E=u;if(u&&!f&&typeof u=="object"){if(a.endsWith(h,"{}"))h=r?h:h.slice(0,-2),u=JSON.stringify(u);else if(a.isArray(u)&&Ir(u)||(a.isFileList(u)||a.endsWith(h,"[]"))&&(E=a.toArray(u)))return h=ps(h),E.forEach(function(F,S){!(a.isUndefined(F)||F===null)&&t.append(n===!0?us([h],S,i):n===null?h:h+"[]",p(F))}),!1}return De(u)?!0:(t.append(us(f,h,i),p(u)),!1)}let d=[],P=Object.assign(kr,{defaultVisitor:c,convertValue:p,isVisitable:De});function w(u,h){if(!a.isUndefined(u)){if(d.indexOf(u)!==-1)throw Error("Circular reference detected in "+h.join("."));d.push(u),a.forEach(u,function(E,O){(!(a.isUndefined(E)||E===null)&&o.call(t,E,a.isString(O)?O.trim():O,h,P))===!0&&w(E,h?h.concat(O):[O])}),d.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return w(e),t}var B=$r;function ms(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function fs(e,t){this._pairs=[],e&&B(e,this,t)}var ds=fs.prototype;ds.append=function(t,s){this._pairs.push([t,s])};ds.toString=function(t){let s=t?function(r){return t.call(this,r,ms)}:ms;return this._pairs.map(function(o){return s(o[0])+"="+s(o[1])},"").join("&")};var be=fs;function _r(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function oe(e,t,s){if(!t)return e;let r=s&&s.encode||_r;a.isFunction(s)&&(s={serialize:s});let o=s&&s.serialize,i;if(o?i=o(t,s):i=a.isURLSearchParams(t)?t.toString():new be(t,s).toString(r),i){let n=e.indexOf("#");n!==-1&&(e=e.slice(0,n)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}var Ue=class{constructor(){this.handlers=[]}use(t,s,r){return this.handlers.push({fulfilled:t,rejected:s,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){a.forEach(this.handlers,function(r){r!==null&&t(r)})}},Ne=Ue;var Ee={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var hs=typeof URLSearchParams<"u"?URLSearchParams:be;var As=typeof FormData<"u"?FormData:null;var gs=typeof Blob<"u"?Blob:null;var ys={isBrowser:!0,classes:{URLSearchParams:hs,FormData:As,Blob:gs},protocols:["http","https","file","blob","url","data"]};var je={};pt(je,{hasBrowserEnv:()=>Ge,hasStandardBrowserEnv:()=>Lr,hasStandardBrowserWebWorkerEnv:()=>qr,navigator:()=>Be,origin:()=>Dr});var Ge=typeof window<"u"&&typeof document<"u",Be=typeof navigator=="object"&&navigator||void 0,Lr=Ge&&(!Be||["ReactNative","NativeScript","NS"].indexOf(Be.product)<0),qr=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Dr=Ge&&window.location.href||"http://localhost";var R={...je,...ys};function Ve(e,t){return B(e,new R.classes.URLSearchParams,{visitor:function(s,r,o,i){return R.isNode&&a.isBuffer(s)?(this.append(r,s.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function Ur(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Nr(e){let t={},s=Object.keys(e),r,o=s.length,i;for(r=0;r<o;r++)i=s[r],t[i]=e[i];return t}function Br(e){function t(s,r,o,i){let n=s[i++];if(n==="__proto__")return!0;let l=Number.isFinite(+n),m=i>=s.length;return n=!n&&a.isArray(o)?o.length:n,m?(a.hasOwnProp(o,n)?o[n]=[o[n],r]:o[n]=r,!l):((!o[n]||!a.isObject(o[n]))&&(o[n]=[]),t(s,r,o[n],i)&&a.isArray(o[n])&&(o[n]=Nr(o[n])),!l)}if(a.isFormData(e)&&a.isFunction(e.entries)){let s={};return a.forEachEntry(e,(r,o)=>{t(Ur(r),o,s,0)}),s}return null}var xe=Br;function Gr(e,t,s){if(a.isString(e))try{return(t||JSON.parse)(e),a.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(s||JSON.stringify)(e)}var He={transitional:Ee,adapter:["xhr","http","fetch"],transformRequest:[function(t,s){let r=s.getContentType()||"",o=r.indexOf("application/json")>-1,i=a.isObject(t);if(i&&a.isHTMLForm(t)&&(t=new FormData(t)),a.isFormData(t))return o?JSON.stringify(xe(t)):t;if(a.isArrayBuffer(t)||a.isBuffer(t)||a.isStream(t)||a.isFile(t)||a.isBlob(t)||a.isReadableStream(t))return t;if(a.isArrayBufferView(t))return t.buffer;if(a.isURLSearchParams(t))return s.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Ve(t,this.formSerializer).toString();if((l=a.isFileList(t))||r.indexOf("multipart/form-data")>-1){let m=this.env&&this.env.FormData;return B(l?{"files[]":t}:t,m&&new m,this.formSerializer)}}return i||o?(s.setContentType("application/json",!1),Gr(t)):t}],transformResponse:[function(t){let s=this.transitional||He.transitional,r=s&&s.forcedJSONParsing,o=this.responseType==="json";if(a.isResponse(t)||a.isReadableStream(t))return t;if(t&&a.isString(t)&&(r&&!this.responseType||o)){let n=!(s&&s.silentJSONParsing)&&o;try{return JSON.parse(t,this.parseReviver)}catch(l){if(n)throw l.name==="SyntaxError"?A.from(l,A.ERR_BAD_RESPONSE,this,null,this.response):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:R.classes.FormData,Blob:R.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a.forEach(["delete","get","head","post","put","patch"],e=>{He.headers[e]={}});var z=He;var jr=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"]),Ps=e=>{let t={},s,r,o;return e&&e.split(` `).forEach(function(n){o=n.indexOf(":"),s=n.substring(0,o).trim().toLowerCase(),r=n.substring(o+1).trim(),!(!s||t[s]&&jr[s])&&(s==="set-cookie"?t[s]?t[s].push(r):t[s]=[r]:t[s]=t[s]?t[s]+", "+r:r)}),t};var Rs=Symbol("internals");function ne(e){return e&&String(e).trim().toLowerCase()}function Ce(e){return e===!1||e==null?e:a.isArray(e)?e.map(Ce):String(e)}function Vr(e){let t=Object.create(null),s=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,r;for(;r=s.exec(e);)t[r[1]]=r[2];return t}var Hr=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Me(e,t,s,r,o){if(a.isFunction(r))return r.call(this,t,s);if(o&&(t=s),!!a.isString(t)){if(a.isString(r))return t.indexOf(r)!==-1;if(a.isRegExp(r))return r.test(t)}}function Mr(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,s,r)=>s.toUpperCase()+r)}function Wr(e,t){let s=a.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+s,{value:function(o,i,n){return this[r].call(this,t,o,i,n)},configurable:!0})})}var J=class{constructor(t){t&&this.set(t)}set(t,s,r){let o=this;function i(l,m,p){let c=ne(m);if(!c)throw new Error("header name must be a non-empty string");let d=a.findKey(o,c);(!d||o[d]===void 0||p===!0||p===void 0&&o[d]!==!1)&&(o[d||m]=Ce(l))}let n=(l,m)=>a.forEach(l,(p,c)=>i(p,c,m));if(a.isPlainObject(t)||t instanceof this.constructor)n(t,s);else if(a.isString(t)&&(t=t.trim())&&!Hr(t))n(Ps(t),s);else if(a.isObject(t)&&a.isIterable(t)){let l={},m,p;for(let c of t){if(!a.isArray(c))throw TypeError("Object iterator must return a key-value pair");l[p=c[0]]=(m=l[p])?a.isArray(m)?[...m,c[1]]:[m,c[1]]:c[1]}n(l,s)}else t!=null&&i(s,t,r);return this}get(t,s){if(t=ne(t),t){let r=a.findKey(this,t);if(r){let o=this[r];if(!s)return o;if(s===!0)return Vr(o);if(a.isFunction(s))return s.call(this,o,r);if(a.isRegExp(s))return s.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,s){if(t=ne(t),t){let r=a.findKey(this,t);return!!(r&&this[r]!==void 0&&(!s||Me(this,this[r],r,s)))}return!1}delete(t,s){let r=this,o=!1;function i(n){if(n=ne(n),n){let l=a.findKey(r,n);l&&(!s||Me(r,r[l],l,s))&&(delete r[l],o=!0)}}return a.isArray(t)?t.forEach(i):i(t),o}clear(t){let s=Object.keys(this),r=s.length,o=!1;for(;r--;){let i=s[r];(!t||Me(this,this[i],i,t,!0))&&(delete this[i],o=!0)}return o}normalize(t){let s=this,r={};return a.forEach(this,(o,i)=>{let n=a.findKey(r,i);if(n){s[n]=Ce(o),delete s[i];return}let l=t?Mr(i):String(i).trim();l!==i&&delete s[i],s[l]=Ce(o),r[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){let s=Object.create(null);return a.forEach(this,(r,o)=>{r!=null&&r!==!1&&(s[o]=t&&a.isArray(r)?r.join(", "):r)}),s}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,s])=>t+": "+s).join(` `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...s){let r=new this(t);return s.forEach(o=>r.set(o)),r}static accessor(t){let r=(this[Rs]=this[Rs]={accessors:{}}).accessors,o=this.prototype;function i(n){let l=ne(n);r[l]||(Wr(o,n),r[l]=!0)}return a.isArray(t)?t.forEach(i):i(t),this}};J.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);a.reduceDescriptors(J.prototype,({value:e},t)=>{let s=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[s]=r}}});a.freezeMethods(J);var C=J;function ie(e,t){let s=this||z,r=t||s,o=C.from(r.headers),i=r.data;return a.forEach(e,function(l){i=l.call(s,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function ae(e){return!!(e&&e.__CANCEL__)}function bs(e,t,s){A.call(this,e??"canceled",A.ERR_CANCELED,t,s),this.name="CanceledError"}a.inherits(bs,A,{__CANCEL__:!0});var q=bs;function le(e,t,s){let r=s.config.validateStatus;!s.status||!r||r(s.status)?e(s):t(new A("Request failed with status code "+s.status,[A.ERR_BAD_REQUEST,A.ERR_BAD_RESPONSE][Math.floor(s.status/100)-4],s.config,s.request,s))}function We(e){let t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function vr(e,t){e=e||10;let s=new Array(e),r=new Array(e),o=0,i=0,n;return t=t!==void 0?t:1e3,function(m){let p=Date.now(),c=r[i];n||(n=p),s[o]=m,r[o]=p;let d=i,P=0;for(;d!==o;)P+=s[d++],d=d%e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),p-n<t)return;let w=c&&p-c;return w?Math.round(P*1e3/w):void 0}}var Es=vr;function Qr(e,t){let s=0,r=1e3/t,o,i,n=(p,c=Date.now())=>{s=c,o=null,i&&(clearTimeout(i),i=null),e(...p)};return[(...p)=>{let c=Date.now(),d=c-s;d>=r?n(p,c):(o=p,i||(i=setTimeout(()=>{i=null,n(o)},r-d)))},()=>o&&n(o)]}var xs=Qr;var K=(e,t,s=3)=>{let r=0,o=Es(50,250);return xs(i=>{let n=i.loaded,l=i.lengthComputable?i.total:void 0,m=n-r,p=o(m),c=n<=l;r=n;let d={loaded:n,total:l,progress:l?n/l:void 0,bytes:m,rate:p||void 0,estimated:p&&l&&c?(l-n)/p:void 0,event:i,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(d)},s)},ve=(e,t)=>{let s=e!=null;return[r=>t[0]({lengthComputable:s,total:e,loaded:r}),t[1]]},Qe=e=>(...t)=>a.asap(()=>e(...t));var Cs=R.hasStandardBrowserEnv?((e,t)=>s=>(s=new URL(s,R.origin),e.protocol===s.protocol&&e.host===s.host&&(t||e.port===s.port)))(new URL(R.origin),R.navigator&&/(msie|trident)/i.test(R.navigator.userAgent)):()=>!0;var Fs=R.hasStandardBrowserEnv?{write(e,t,s,r,o,i){let n=[e+"="+encodeURIComponent(t)];a.isNumber(s)&&n.push("expires="+new Date(s).toGMTString()),a.isString(r)&&n.push("path="+r),a.isString(o)&&n.push("domain="+o),i===!0&&n.push("secure"),document.cookie=n.join("; ")},read(e){let t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function ze(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Je(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function ce(e,t,s){let r=!ze(t);return e&&(r||s==!1)?Je(e,t):t}var ws=e=>e instanceof C?{...e}:e;function _(e,t){t=t||{};let s={};function r(p,c,d,P){return a.isPlainObject(p)&&a.isPlainObject(c)?a.merge.call({caseless:P},p,c):a.isPlainObject(c)?a.merge({},c):a.isArray(c)?c.slice():c}function o(p,c,d,P){if(a.isUndefined(c)){if(!a.isUndefined(p))return r(void 0,p,d,P)}else return r(p,c,d,P)}function i(p,c){if(!a.isUndefined(c))return r(void 0,c)}function n(p,c){if(a.isUndefined(c)){if(!a.isUndefined(p))return r(void 0,p)}else return r(void 0,c)}function l(p,c,d){if(d in t)return r(p,c);if(d in e)return r(void 0,p)}let m={url:i,method:i,data:i,baseURL:n,transformRequest:n,transformResponse:n,paramsSerializer:n,timeout:n,timeoutMessage:n,withCredentials:n,withXSRFToken:n,adapter:n,responseType:n,xsrfCookieName:n,xsrfHeaderName:n,onUploadProgress:n,onDownloadProgress:n,decompress:n,maxContentLength:n,maxBodyLength:n,beforeRedirect:n,transport:n,httpAgent:n,httpsAgent:n,cancelToken:n,socketPath:n,responseEncoding:n,validateStatus:l,headers:(p,c,d)=>o(ws(p),ws(c),d,!0)};return a.forEach(Object.keys({...e,...t}),function(c){let d=m[c]||o,P=d(e[c],t[c],c);a.isUndefined(P)&&d!==l||(s[c]=P)}),s}var Fe=e=>{let t=_({},e),{data:s,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:i,headers:n,auth:l}=t;if(t.headers=n=C.from(n),t.url=oe(ce(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&n.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),a.isFormData(s)){if(R.hasStandardBrowserEnv||R.hasStandardBrowserWebWorkerEnv)n.setContentType(void 0);else if(a.isFunction(s.getHeaders)){let m=s.getHeaders(),p=["content-type","content-length"];Object.entries(m).forEach(([c,d])=>{p.includes(c.toLowerCase())&&n.set(c,d)})}}if(R.hasStandardBrowserEnv&&(r&&a.isFunction(r)&&(r=r(t)),r||r!==!1&&Cs(t.url))){let m=o&&i&&Fs.read(i);m&&n.set(o,m)}return t};var zr=typeof XMLHttpRequest<"u",Ss=zr&&function(e){return new Promise(function(s,r){let o=Fe(e),i=o.data,n=C.from(o.headers).normalize(),{responseType:l,onUploadProgress:m,onDownloadProgress:p}=o,c,d,P,w,u;function h(){w&&w(),u&&u(),o.cancelToken&&o.cancelToken.unsubscribe(c),o.signal&&o.signal.removeEventListener("abort",c)}let f=new XMLHttpRequest;f.open(o.method.toUpperCase(),o.url,!0),f.timeout=o.timeout;function E(){if(!f)return;let F=C.from("getAllResponseHeaders"in f&&f.getAllResponseHeaders()),k={data:!l||l==="text"||l==="json"?f.responseText:f.response,status:f.status,statusText:f.statusText,headers:F,config:e,request:f};le(function(I){s(I),h()},function(I){r(I),h()},k),f=null}"onloadend"in f?f.onloadend=E:f.onreadystatechange=function(){!f||f.readyState!==4||f.status===0&&!(f.responseURL&&f.responseURL.indexOf("file:")===0)||setTimeout(E)},f.onabort=function(){f&&(r(new A("Request aborted",A.ECONNABORTED,e,f)),f=null)},f.onerror=function(S){let k=S&&S.message?S.message:"Network Error",G=new A(k,A.ERR_NETWORK,e,f);G.event=S||null,r(G),f=null},f.ontimeout=function(){let S=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded",k=o.transitional||Ee;o.timeoutErrorMessage&&(S=o.timeoutErrorMessage),r(new A(S,k.clarifyTimeoutError?A.ETIMEDOUT:A.ECONNABORTED,e,f)),f=null},i===void 0&&n.setContentType(null),"setRequestHeader"in f&&a.forEach(n.toJSON(),function(S,k){f.setRequestHeader(k,S)}),a.isUndefined(o.withCredentials)||(f.withCredentials=!!o.withCredentials),l&&l!=="json"&&(f.responseType=o.responseType),p&&([P,u]=K(p,!0),f.addEventListener("progress",P)),m&&f.upload&&([d,w]=K(m),f.upload.addEventListener("progress",d),f.upload.addEventListener("loadend",w)),(o.cancelToken||o.signal)&&(c=F=>{f&&(r(!F||F.type?new q(null,e,f):F),f.abort(),f=null)},o.cancelToken&&o.cancelToken.subscribe(c),o.signal&&(o.signal.aborted?c():o.signal.addEventListener("abort",c)));let O=We(o.url);if(O&&R.protocols.indexOf(O)===-1){r(new A("Unsupported protocol "+O+":",A.ERR_BAD_REQUEST,e));return}f.send(i||null)})};var Jr=(e,t)=>{let{length:s}=e=e?e.filter(Boolean):[];if(t||s){let r=new AbortController,o,i=function(p){if(!o){o=!0,l();let c=p instanceof Error?p:this.reason;r.abort(c instanceof A?c:new q(c instanceof Error?c.message:c))}},n=t&&setTimeout(()=>{n=null,i(new A(`timeout ${t} of ms exceeded`,A.ETIMEDOUT))},t),l=()=>{e&&(n&&clearTimeout(n),n=null,e.forEach(p=>{p.unsubscribe?p.unsubscribe(i):p.removeEventListener("abort",i)}),e=null)};e.forEach(p=>p.addEventListener("abort",i));let{signal:m}=r;return m.unsubscribe=()=>a.asap(l),m}},Ts=Jr;var Kr=function*(e,t){let s=e.byteLength;if(!t||s<t){yield e;return}let r=0,o;for(;r<s;)o=r+t,yield e.slice(r,o),r=o},Xr=async function*(e,t){for await(let s of Zr(e))yield*Kr(s,t)},Zr=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}let t=e.getReader();try{for(;;){let{done:s,value:r}=await t.read();if(s)break;yield r}}finally{await t.cancel()}},Ke=(e,t,s,r)=>{let o=Xr(e,t),i=0,n,l=m=>{n||(n=!0,r&&r(m))};return new ReadableStream({async pull(m){try{let{done:p,value:c}=await o.next();if(p){l(),m.close();return}let d=c.byteLength;if(s){let P=i+=d;s(P)}m.enqueue(new Uint8Array(c))}catch(p){throw l(p),p}},cancel(m){return l(m),o.return()}},{highWaterMark:2})};var Os=64*1024,{isFunction:we}=a,Yr=(({Request:e,Response:t})=>({Request:e,Response:t}))(a.global),{ReadableStream:Is,TextEncoder:ks}=a.global,$s=(e,...t)=>{try{return!!e(...t)}catch{return!1}},eo=e=>{e=a.merge.call({skipUndefined:!0},Yr,e);let{fetch:t,Request:s,Response:r}=e,o=t?we(t):typeof fetch=="function",i=we(s),n=we(r);if(!o)return!1;let l=o&&we(Is),m=o&&(typeof ks=="function"?(u=>h=>u.encode(h))(new ks):async u=>new Uint8Array(await new s(u).arrayBuffer())),p=i&&l&&$s(()=>{let u=!1,h=new s(R.origin,{body:new Is,method:"POST",get duplex(){return u=!0,"half"}}).headers.has("Content-Type");return u&&!h}),c=n&&l&&$s(()=>a.isReadableStream(new r("").body)),d={stream:c&&(u=>u.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(u=>{!d[u]&&(d[u]=(h,f)=>{let E=h&&h[u];if(E)return E.call(h);throw new A(`Response type '${u}' is not supported`,A.ERR_NOT_SUPPORT,f)})});let P=async u=>{if(u==null)return 0;if(a.isBlob(u))return u.size;if(a.isSpecCompliantForm(u))return(await new s(R.origin,{method:"POST",body:u}).arrayBuffer()).byteLength;if(a.isArrayBufferView(u)||a.isArrayBuffer(u))return u.byteLength;if(a.isURLSearchParams(u)&&(u=u+""),a.isString(u))return(await m(u)).byteLength},w=async(u,h)=>{let f=a.toFiniteNumber(u.getContentLength());return f??P(h)};return async u=>{let{url:h,method:f,data:E,signal:O,cancelToken:F,timeout:S,onDownloadProgress:k,onUploadProgress:G,responseType:I,headers:ke,withCredentials:fe="same-origin",fetchOptions:nt}=Fe(u),it=t||fetch;I=I?(I+"").toLowerCase():"text";let de=Ts([O,F&&F.toAbortSignal()],S),Z=null,j=de&&de.unsubscribe&&(()=>{de.unsubscribe()}),at;try{if(G&&p&&f!=="get"&&f!=="head"&&(at=await w(ke,E))!==0){let N=new s(h,{method:"POST",body:E,duplex:"half"}),M;if(a.isFormData(E)&&(M=N.headers.get("content-type"))&&ke.setContentType(M),N.body){let[$e,he]=ve(at,K(Qe(G)));E=Ke(N.body,Os,$e,he)}}a.isString(fe)||(fe=fe?"include":"omit");let L=i&&"credentials"in s.prototype,lt={...nt,signal:de,method:f.toUpperCase(),headers:ke.normalize().toJSON(),body:E,duplex:"half",credentials:L?fe:void 0};Z=i&&new s(h,lt);let U=await(i?it(Z,nt):it(h,lt)),ct=c&&(I==="stream"||I==="response");if(c&&(k||ct&&j)){let N={};["status","statusText","headers"].forEach(ut=>{N[ut]=U[ut]});let M=a.toFiniteNumber(U.headers.get("content-length")),[$e,he]=k&&ve(M,K(Qe(k),!0))||[];U=new r(Ke(U.body,Os,$e,()=>{he&&he(),j&&j()}),N)}I=I||"text";let Ns=await d[a.findKey(d,I)||"text"](U,u);return!ct&&j&&j(),await new Promise((N,M)=>{le(N,M,{data:Ns,headers:C.from(U.headers),status:U.status,statusText:U.statusText,config:u,request:Z})})}catch(L){throw j&&j(),L&&L.name==="TypeError"&&/Load failed|fetch/i.test(L.message)?Object.assign(new A("Network Error",A.ERR_NETWORK,u,Z),{cause:L.cause||L}):A.from(L,L&&L.code,u,Z)}}},to=new Map,Xe=e=>{let t=e?e.env:{},{fetch:s,Request:r,Response:o}=t,i=[r,o,s],n=i.length,l=n,m,p,c=to;for(;l--;)m=i[l],p=c.get(m),p===void 0&&c.set(m,p=l?new Map:eo(t)),c=p;return p},Pi=Xe();var Ze={http:Re,xhr:Ss,fetch:{get:Xe}};a.forEach(Ze,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});var _s=e=>`- ${e}`,ro=e=>a.isFunction(e)||e===null||e===!1,Se={getAdapter:(e,t)=>{e=a.isArray(e)?e:[e];let{length:s}=e,r,o,i={};for(let n=0;n<s;n++){r=e[n];let l;if(o=r,!ro(r)&&(o=Ze[(l=String(r)).toLowerCase()],o===void 0))throw new A(`Unknown adapter '${l}'`);if(o&&(a.isFunction(o)||(o=o.get(t))))break;i[l||"#"+n]=o}if(!o){let n=Object.entries(i).map(([m,p])=>`adapter ${m} `+(p===!1?"is not supported by the environment":"is not available in the build")),l=s?n.length>1?`since : `+n.map(_s).join(` `):" "+_s(n[0]):"as no adapter specified";throw new A("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return o},adapters:Ze};function Ye(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new q(null,e)}function Te(e){return Ye(e),e.headers=C.from(e.headers),e.data=ie.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Se.getAdapter(e.adapter||z.adapter,e)(e).then(function(r){return Ye(e),r.data=ie.call(e,e.transformResponse,r),r.headers=C.from(r.headers),r},function(r){return ae(r)||(Ye(e),r&&r.response&&(r.response.data=ie.call(e,e.transformResponse,r.response),r.response.headers=C.from(r.response.headers))),Promise.reject(r)})}var Oe="1.12.2";var Ie={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Ie[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});var Ls={};Ie.transitional=function(t,s,r){function o(i,n){return"[Axios v"+Oe+"] Transitional option '"+i+"'"+n+(r?". "+r:"")}return(i,n,l)=>{if(t===!1)throw new A(o(n," has been removed"+(s?" in "+s:"")),A.ERR_DEPRECATED);return s&&!Ls[n]&&(Ls[n]=!0,console.warn(o(n," has been deprecated since v"+s+" and will be removed in the near future"))),t?t(i,n,l):!0}};Ie.spelling=function(t){return(s,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function oo(e,t,s){if(typeof e!="object")throw new A("options must be an object",A.ERR_BAD_OPTION_VALUE);let r=Object.keys(e),o=r.length;for(;o-- >0;){let i=r[o],n=t[i];if(n){let l=e[i],m=l===void 0||n(l,i,e);if(m!==!0)throw new A("option "+i+" must be "+m,A.ERR_BAD_OPTION_VALUE);continue}if(s!==!0)throw new A("Unknown option "+i,A.ERR_BAD_OPTION)}}var ue={assertOptions:oo,validators:Ie};var D=ue.validators,X=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Ne,response:new Ne}}async request(t,s){try{return await this._request(t,s)}catch(r){if(r instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;let i=o.stack?o.stack.replace(/^.+\n/,""):"";try{r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=` `+i):r.stack=i}catch{}}throw r}}_request(t,s){typeof t=="string"?(s=s||{},s.url=t):s=t||{},s=_(this.defaults,s);let{transitional:r,paramsSerializer:o,headers:i}=s;r!==void 0&&ue.assertOptions(r,{silentJSONParsing:D.transitional(D.boolean),forcedJSONParsing:D.transitional(D.boolean),clarifyTimeoutError:D.transitional(D.boolean)},!1),o!=null&&(a.isFunction(o)?s.paramsSerializer={serialize:o}:ue.assertOptions(o,{encode:D.function,serialize:D.function},!0)),s.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?s.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:s.allowAbsoluteUrls=!0),ue.assertOptions(s,{baseUrl:D.spelling("baseURL"),withXsrfToken:D.spelling("withXSRFToken")},!0),s.method=(s.method||this.defaults.method||"get").toLowerCase();let n=i&&a.merge(i.common,i[s.method]);i&&a.forEach(["delete","get","head","post","put","patch","common"],u=>{delete i[u]}),s.headers=C.concat(n,i);let l=[],m=!0;this.interceptors.request.forEach(function(h){typeof h.runWhen=="function"&&h.runWhen(s)===!1||(m=m&&h.synchronous,l.unshift(h.fulfilled,h.rejected))});let p=[];this.interceptors.response.forEach(function(h){p.push(h.fulfilled,h.rejected)});let c,d=0,P;if(!m){let u=[Te.bind(this),void 0];for(u.unshift(...l),u.push(...p),P=u.length,c=Promise.resolve(s);d<P;)c=c.then(u[d++],u[d++]);return c}P=l.length;let w=s;for(;d<P;){let u=l[d++],h=l[d++];try{w=u(w)}catch(f){h.call(this,f);break}}try{c=Te.call(this,w)}catch(u){return Promise.reject(u)}for(d=0,P=p.length;d<P;)c=c.then(p[d++],p[d++]);return c}getUri(t){t=_(this.defaults,t);let s=ce(t.baseURL,t.url,t.allowAbsoluteUrls);return oe(s,t.params,t.paramsSerializer)}};a.forEach(["delete","get","head","options"],function(t){X.prototype[t]=function(s,r){return this.request(_(r||{},{method:t,url:s,data:(r||{}).data}))}});a.forEach(["post","put","patch"],function(t){function s(r){return function(i,n,l){return this.request(_(l||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:n}))}}X.prototype[t]=s(),X.prototype[t+"Form"]=s(!0)});var pe=X;var et=class e{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let s;this.promise=new Promise(function(i){s=i});let r=this;this.promise.then(o=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](o);r._listeners=null}),this.promise.then=o=>{let i,n=new Promise(l=>{r.subscribe(l),i=l}).then(o);return n.cancel=function(){r.unsubscribe(i)},n},t(function(i,n,l){r.reason||(r.reason=new q(i,n,l),s(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;let s=this._listeners.indexOf(t);s!==-1&&this._listeners.splice(s,1)}toAbortSignal(){let t=new AbortController,s=r=>{t.abort(r)};return this.subscribe(s),t.signal.unsubscribe=()=>this.unsubscribe(s),t.signal}static source(){let t;return{token:new e(function(o){t=o}),cancel:t}}},qs=et;function tt(e){return function(s){return e.apply(null,s)}}function st(e){return a.isObject(e)&&e.isAxiosError===!0}var rt={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(rt).forEach(([e,t])=>{rt[t]=e});var Ds=rt;function Us(e){let t=new pe(e),s=ee(pe.prototype.request,t);return a.extend(s,pe.prototype,t,{allOwnKeys:!0}),a.extend(s,t,null,{allOwnKeys:!0}),s.create=function(o){return Us(_(e,o))},s}var b=Us(z);b.Axios=pe;b.CanceledError=q;b.CancelToken=qs;b.isCancel=ae;b.VERSION=Oe;b.toFormData=B;b.AxiosError=A;b.Cancel=b.CanceledError;b.all=function(t){return Promise.all(t)};b.spread=tt;b.isAxiosError=st;b.mergeConfig=_;b.AxiosHeaders=C;b.formToJSON=e=>xe(a.isHTMLForm(e)?new FormData(e):e);b.getAdapter=Se.getAdapter;b.HttpStatusCode=Ds;b.default=b;var me=b;var{Axios:Aa,AxiosError:ga,CanceledError:ya,isCancel:Pa,CancelToken:Ra,VERSION:ba,all:Ea,Cancel:xa,isAxiosError:Ca,spread:Fa,toFormData:wa,AxiosHeaders:Sa,HttpStatusCode:Ta,formToJSON:Oa,getAdapter:Ia,mergeConfig:ka}=me;var ot=class{constructor(t){this.appendHeaders=t=>{this.personalAccessToken&&(t["X-Figma-Token"]=this.personalAccessToken),this.oAuthToken&&(t.Authorization=`Bearer ${this.oAuthToken}`)};this.request=(t,s)=>{let r={};this.appendHeaders(r);let o={url:t,...s,headers:r};return me(o).then(i=>i.data).catch(i=>{throw new Y(i)})};this.getFile=mt;this.getFileNodes=ft;this.getImages=dt;this.getImageFills=ht;this.getComments=At;this.postComment=gt;this.deleteComment=yt;this.getCommentReactions=Pt;this.postCommentReaction=Rt;this.deleteCommentReactions=bt;this.getUserMe=Et;this.getFileVersions=xt;this.getTeamProjects=Ct;this.getProjectFiles=Ft;this.getTeamComponents=wt;this.getFileComponents=St;this.getComponent=Tt;this.getTeamComponentSets=Ot;this.getFileComponentSets=It;this.getComponentSet=kt;this.getTeamStyles=$t;this.getFileStyles=_t;this.getStyle=Lt;this.getWebhook=qt;this.postWebhook=Dt;this.putWebhook=Ut;this.deleteWebhook=Nt;this.getTeamWebhooks=Bt;this.getWebhookRequests=Gt;this.getLocalVariables=jt;this.getPublishedVariables=Vt;this.postVariables=Ht;this.getDevResources=Mt;this.postDevResources=Wt;this.putDevResources=vt;this.deleteDevResources=Qt;this.getLibraryAnalyticsComponentActions=zt;this.getLibraryAnalyticsComponentUsages=Jt;this.getLibraryAnalyticsStyleActions=Kt;this.getLibraryAnalyticsStyleUsages=Xt;this.getLibraryAnalyticsVariableActions=Zt;this.getLibraryAnalyticsVariableUsages=Yt;"personalAccessToken"in t&&(this.personalAccessToken=t.personalAccessToken),"oAuthToken"in t&&(this.oAuthToken=t.oAuthToken)}};function no(e,t,s,r,o){return`https://www.figma.com/oauth?${x({client_id:e,redirect_uri:t,scope:s,state:r,response_type:o})}`}async function io(e,t,s,r,o){let i={Authorization:`Basic ${Buffer.from(`${e}:${t}`).toString("base64")}`},l=`https://api.figma.com/v1/oauth/token?${x({redirect_uri:s,code:r,grant_type:o})}`,m=await me.post(l,null,{headers:i});if(m.status!==200)throw new Y(m);return m.data}return Hs(ao);})();