@rtsdk/topia 0.0.21 → 0.0.22

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/LICENSE.md ADDED
@@ -0,0 +1,15 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2023, metaversecloud.com | topia.io
4
+ All rights reserved.
5
+
6
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
7
+
8
+ - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
9
+
10
+ - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
11
+
12
+ - Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
13
+
14
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
15
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package/README.md CHANGED
@@ -8,6 +8,32 @@ The Topia Client Library leverages the Topia Public API and allows users to inte
8
8
 
9
9
  A Topia provided API Key can be included with every object initialization as a parameter named `apiKey`. This API Key is used to in authorization headers in all calls to the Public API.
10
10
 
11
+ ### Want to build interactive assets? This is how you can get started:
12
+
13
+ - Email developers@metaversecloud.com and Topia wil send you a Public/Private key pair.
14
+ - When you want to make an asset “interactive” add your PUBLIC key to the integrations page of the asset editor. Now webhooks that fire from this asset and iframes that open from this asset include the following values:
15
+ - assetId
16
+ - interactivePublicKey
17
+ - interactiveNonce
18
+ - visitorId
19
+ - urlSlug
20
+ - The above values are included in the query params of the iframe URL as well as payload of the webhook.
21
+ - Once you have the above values you can pass them as credentials into the factory classes when creating class instances.
22
+
23
+ ```ts
24
+ await DroppedAsset.get(assetId, urlSlug, {
25
+ credentials: {
26
+ assetId,
27
+ interactivePublicKey,
28
+ interactiveNonce,
29
+ visitorId,
30
+ urlSlug,
31
+ },
32
+ });
33
+ ```
34
+
35
+ <br />
36
+
11
37
  ### Need an API Key to test locally? This is how you can create one:
12
38
 
13
39
  - While logged in to [topia.io](https://topia.io/), click on your image (or gray circle) in the top left of the screen to open My Account
package/dist/example.js CHANGED
@@ -20,13 +20,13 @@ const DroppedAsset = new DroppedAssetFactory(myTopiaInstance);
20
20
  const TopiaWorld = new TopiaWorldFactory(myTopiaInstance);
21
21
  export default { myTopiaInstance, DroppedAsset, TopiaWorld };
22
22
  const setTextOnAsset = (req, res) => __awaiter(void 0, void 0, void 0, function* () {
23
- const asset = yield DroppedAsset.get(req.body.assetId, req.body.urlSlug, { creds: req.body });
23
+ const asset = yield DroppedAsset.get(req.body.assetId, req.body.urlSlug, { credentials: req.body });
24
24
  yield asset.setAssetText(req.body.text);
25
25
  });
26
26
  import { myTopiaInterface } from "./src";
27
27
  const setTextOnAsset = (req, res) => __awaiter(void 0, void 0, void 0, function* () {
28
28
  const asset = yield new DroppedAssetFactory(myTopiaInterface).get(req.body.assetId, req.body.urlSlug, {
29
- creds: req.body,
29
+ credentials: req.body,
30
30
  });
31
31
  yield asset.setAssetText(req.body.text);
32
32
  });
package/dist/index.js CHANGED
@@ -16,4 +16,4 @@ ta=ra,aa=ra.exports,function(){var e,n="Expected a function",i="__lodash_hash_un
16
16
  * Copyright(c) 2015 Douglas Christopher Wilson
17
17
  * MIT Licensed
18
18
  */
19
- function(e){var n,i,t,o=vo.exports,r=a.extname,s=/^\s*([^;\s]*)(?:;|\s|$)/,c=/^text\//i;function p(e){if(!e||"string"!=typeof e)return!1;var n=s.exec(e),i=n&&o[n[1].toLowerCase()];return i&&i.charset?i.charset:!(!n||!c.test(n[1]))&&"UTF-8"}e.charset=p,e.charsets={lookup:p},e.contentType=function(n){if(!n||"string"!=typeof n)return!1;var i=-1===n.indexOf("/")?e.lookup(n):n;if(!i)return!1;if(-1===i.indexOf("charset")){var t=e.charset(i);t&&(i+="; charset="+t.toLowerCase())}return i},e.extension=function(n){if(!n||"string"!=typeof n)return!1;var i=s.exec(n),t=i&&e.extensions[i[1].toLowerCase()];if(!t||!t.length)return!1;return t[0]},e.extensions=Object.create(null),e.lookup=function(n){if(!n||"string"!=typeof n)return!1;var i=r("x."+n).toLowerCase().substr(1);if(!i)return!1;return e.types[i]||!1},e.types=Object.create(null),n=e.extensions,i=e.types,t=["nginx","apache",void 0,"iana"],Object.keys(o).forEach((function(e){var a=o[e],r=a.extensions;if(r&&r.length){n[e]=r;for(var s=0;s<r.length;s++){var c=r[s];if(i[c]){var p=t.indexOf(o[i[c]].source),l=t.indexOf(a.source);if("application/octet-stream"!==i[c]&&(p>l||p===l&&"application/"===i[c].substr(0,12)))continue}i[c]=e}}}))}(ho);var xo=function(e){var n="function"==typeof setImmediate?setImmediate:"object"==typeof process&&"function"==typeof process.nextTick?process.nextTick:null;n?n(e):setTimeout(e,0)},go=function(e){var n=!1;return xo((function(){n=!0})),function(i,t){n?e(i,t):xo((function(){e(i,t)}))}};var bo=function(e){Object.keys(e.jobs).forEach(yo.bind(e)),e.jobs={}};function yo(e){"function"==typeof this.jobs[e]&&this.jobs[e]()}var wo=go,_o=bo,Eo=function(e,n,i,t){var a=i.keyedList?i.keyedList[i.index]:i.index;i.jobs[a]=function(e,n,i,t){var a;a=2==e.length?e(i,wo(t)):e(i,n,wo(t));return a}(n,a,e[a],(function(e,n){a in i.jobs&&(delete i.jobs[a],e?_o(i):i.results[a]=n,t(e,i.results))}))};var ko=function(e,n){var i=!Array.isArray(e),t={index:0,keyedList:i||n?Object.keys(e):null,jobs:{},results:i?{}:[],size:i?Object.keys(e).length:e.length};n&&t.keyedList.sort(i?n:function(i,t){return n(e[i],e[t])});return t};var jo=bo,So=go,Ro=function(e){if(!Object.keys(this.jobs).length)return;this.index=this.size,jo(this),So(e)(null,this.results)};var Oo=Eo,Ao=ko,To=Ro,Co=function(e,n,i){var t=Ao(e);for(;t.index<(t.keyedList||e).length;)Oo(e,n,t,(function(e,n){e?i(e,n):0!==Object.keys(t.jobs).length||i(null,t.results)})),t.index++;return To.bind(t,i)};var Io={exports:{}},Lo=Eo,No=ko,$o=Ro;function Po(e,n){return e<n?-1:e>n?1:0}Io.exports=function(e,n,i,t){var a=No(e,i);return Lo(e,n,a,(function i(o,r){o?t(o,r):(a.index++,a.index<(a.keyedList||e).length?Lo(e,n,a,i):t(null,a.results))})),$o.bind(a,t)},Io.exports.ascending=Po,Io.exports.descending=function(e,n){return-1*Po(e,n)};var zo=Io.exports,Bo=function(e,n,i){return zo(e,n,null,i)};var Fo={parallel:Co,serial:Bo,serialOrdered:Io.exports},Do=mo,Uo=i,qo=a,Mo=o,Ho=r,Vo=s.parse,Ko=c,Go=n.Stream,Wo=ho,Xo=Fo,Jo=function(e,n){return Object.keys(n).forEach((function(i){e[i]=e[i]||n[i]})),e},Zo=Yo;function Yo(e){if(!(this instanceof Yo))return new Yo(e);for(var n in this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],Do.call(this),e=e||{})this[n]=e[n]}function Qo(e){return io.isPlainObject(e)||io.isArray(e)}function er(e){return io.endsWith(e,"[]")?e.slice(0,-2):e}function nr(e,n,i){return e?e.concat(n).map((function(e,n){return e=er(e),!i&&n?"["+e+"]":e})).join(i?".":""):n}Uo.inherits(Yo,Do),Yo.LINE_BREAK="\r\n",Yo.DEFAULT_CONTENT_TYPE="application/octet-stream",Yo.prototype.append=function(e,n,i){"string"==typeof(i=i||{})&&(i={filename:i});var t=Do.prototype.append.bind(this);if("number"==typeof n&&(n=""+n),Uo.isArray(n))this._error(new Error("Arrays are not supported."));else{var a=this._multiPartHeader(e,n,i),o=this._multiPartFooter();t(a),t(n),t(o),this._trackLength(a,n,i)}},Yo.prototype._trackLength=function(e,n,i){var t=0;null!=i.knownLength?t+=+i.knownLength:Buffer.isBuffer(n)?t=n.length:"string"==typeof n&&(t=Buffer.byteLength(n)),this._valueLength+=t,this._overheadLength+=Buffer.byteLength(e)+Yo.LINE_BREAK.length,n&&(n.path||n.readable&&n.hasOwnProperty("httpVersion")||n instanceof Go)&&(i.knownLength||this._valuesToMeasure.push(n))},Yo.prototype._lengthRetriever=function(e,n){e.hasOwnProperty("fd")?null!=e.end&&e.end!=1/0&&null!=e.start?n(null,e.end+1-(e.start?e.start:0)):Ko.stat(e.path,(function(i,t){var a;i?n(i):(a=t.size-(e.start?e.start:0),n(null,a))})):e.hasOwnProperty("httpVersion")?n(null,+e.headers["content-length"]):e.hasOwnProperty("httpModule")?(e.on("response",(function(i){e.pause(),n(null,+i.headers["content-length"])})),e.resume()):n("Unknown stream")},Yo.prototype._multiPartHeader=function(e,n,i){if("string"==typeof i.header)return i.header;var t,a=this._getContentDisposition(n,i),o=this._getContentType(n,i),r="",s={"Content-Disposition":["form-data",'name="'+e+'"'].concat(a||[]),"Content-Type":[].concat(o||[])};for(var c in"object"==typeof i.header&&Jo(s,i.header),s)s.hasOwnProperty(c)&&null!=(t=s[c])&&(Array.isArray(t)||(t=[t]),t.length&&(r+=c+": "+t.join("; ")+Yo.LINE_BREAK));return"--"+this.getBoundary()+Yo.LINE_BREAK+r+Yo.LINE_BREAK},Yo.prototype._getContentDisposition=function(e,n){var i,t;return"string"==typeof n.filepath?i=qo.normalize(n.filepath).replace(/\\/g,"/"):n.filename||e.name||e.path?i=qo.basename(n.filename||e.name||e.path):e.readable&&e.hasOwnProperty("httpVersion")&&(i=qo.basename(e.client._httpMessage.path||"")),i&&(t='filename="'+i+'"'),t},Yo.prototype._getContentType=function(e,n){var i=n.contentType;return!i&&e.name&&(i=Wo.lookup(e.name)),!i&&e.path&&(i=Wo.lookup(e.path)),!i&&e.readable&&e.hasOwnProperty("httpVersion")&&(i=e.headers["content-type"]),i||!n.filepath&&!n.filename||(i=Wo.lookup(n.filepath||n.filename)),i||"object"!=typeof e||(i=Yo.DEFAULT_CONTENT_TYPE),i},Yo.prototype._multiPartFooter=function(){return function(e){var n=Yo.LINE_BREAK;0===this._streams.length&&(n+=this._lastBoundary()),e(n)}.bind(this)},Yo.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+Yo.LINE_BREAK},Yo.prototype.getHeaders=function(e){var n,i={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(n in e)e.hasOwnProperty(n)&&(i[n.toLowerCase()]=e[n]);return i},Yo.prototype.setBoundary=function(e){this._boundary=e},Yo.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary},Yo.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),n=this.getBoundary(),i=0,t=this._streams.length;i<t;i++)"function"!=typeof this._streams[i]&&(e=Buffer.isBuffer(this._streams[i])?Buffer.concat([e,this._streams[i]]):Buffer.concat([e,Buffer.from(this._streams[i])]),"string"==typeof this._streams[i]&&this._streams[i].substring(2,n.length+2)===n||(e=Buffer.concat([e,Buffer.from(Yo.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])},Yo.prototype._generateBoundary=function(){for(var e="--------------------------",n=0;n<24;n++)e+=Math.floor(10*Math.random()).toString(16);this._boundary=e},Yo.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e},Yo.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e},Yo.prototype.getLength=function(e){var n=this._overheadLength+this._valueLength;this._streams.length&&(n+=this._lastBoundary().length),this._valuesToMeasure.length?Xo.parallel(this._valuesToMeasure,this._lengthRetriever,(function(i,t){i?e(i):(t.forEach((function(e){n+=e})),e(null,n))})):process.nextTick(e.bind(this,null,n))},Yo.prototype.submit=function(e,n){var i,t,a={method:"post"};return"string"==typeof e?(e=Vo(e),t=Jo({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},a)):(t=Jo(e,a)).port||(t.port="https:"==t.protocol?443:80),t.headers=this.getHeaders(e.headers),i="https:"==t.protocol?Ho.request(t):Mo.request(t),this.getLength(function(e,t){if(e&&"Unknown stream"!==e)this._error(e);else if(t&&i.setHeader("Content-Length",t),this.pipe(i),n){var a,o=function(e,t){return i.removeListener("error",o),i.removeListener("response",a),n.call(this,e,t)};a=o.bind(this,null),i.on("error",o),i.on("response",a)}}.bind(this)),i},Yo.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))},Yo.prototype.toString=function(){return"[object FormData]"};const ir=io.toFlatObject(io,{},null,(function(e){return/^is[A-Z]/.test(e)}));function tr(e,n,i){if(!io.isObject(e))throw new TypeError("target must be an object");n=n||new(Zo||FormData);const t=(i=io.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,n){return!io.isUndefined(n[e])}))).metaTokens,a=i.visitor||l,o=i.dots,r=i.indexes,s=(i.Blob||"undefined"!=typeof Blob&&Blob)&&((c=n)&&io.isFunction(c.append)&&"FormData"===c[Symbol.toStringTag]&&c[Symbol.iterator]);var c;if(!io.isFunction(a))throw new TypeError("visitor must be a function");function p(e){if(null===e)return"";if(io.isDate(e))return e.toISOString();if(!s&&io.isBlob(e))throw new to("Blob is not supported. Use a Buffer instead.");return io.isArrayBuffer(e)||io.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,i,a){let s=e;if(e&&!a&&"object"==typeof e)if(io.endsWith(i,"{}"))i=t?i:i.slice(0,-2),e=JSON.stringify(e);else if(io.isArray(e)&&function(e){return io.isArray(e)&&!e.some(Qo)}(e)||io.isFileList(e)||io.endsWith(i,"[]")&&(s=io.toArray(e)))return i=er(i),s.forEach((function(e,t){!io.isUndefined(e)&&null!==e&&n.append(!0===r?nr([i],t,o):null===r?i:i+"[]",p(e))})),!1;return!!Qo(e)||(n.append(nr(a,i,o),p(e)),!1)}const u=[],d=Object.assign(ir,{defaultVisitor:l,convertValue:p,isVisitable:Qo});if(!io.isObject(e))throw new TypeError("data must be an object");return function e(i,t){if(!io.isUndefined(i)){if(-1!==u.indexOf(i))throw Error("Circular reference detected in "+t.join("."));u.push(i),io.forEach(i,(function(i,o){!0===(!(io.isUndefined(i)||null===i)&&a.call(n,i,io.isString(o)?o.trim():o,t,d))&&e(i,t?t.concat(o):[o])})),u.pop()}}(e),n}function ar(e){const n={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return n[e]}))}function or(e,n){this._pairs=[],e&&tr(e,this,n)}const rr=or.prototype;function sr(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function cr(e,n,i){if(!n)return e;const t=i&&i.encode||sr,a=i&&i.serialize;let o;if(o=a?a(n,i):io.isURLSearchParams(n)?n.toString():new or(n,i).toString(t),o){const n=e.indexOf("#");-1!==n&&(e=e.slice(0,n)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}rr.append=function(e,n){this._pairs.push([e,n])},rr.toString=function(e){const n=e?function(n){return e.call(this,n,ar)}:ar;return this._pairs.map((function(e){return n(e[0])+"="+n(e[1])}),"").join("&")};class pr{constructor(){this.handlers=[]}use(e,n,i){return this.handlers.push({fulfilled:e,rejected:n,synchronous:!!i&&i.synchronous,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){io.forEach(this.handlers,(function(n){null!==n&&e(n)}))}}var lr={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ur={isNode:!0,classes:{URLSearchParams:s.URLSearchParams,FormData:Zo,Blob:"undefined"!=typeof Blob&&Blob||null},protocols:["http","https","file","data"]};function dr(e){function n(e,i,t,a){let o=e[a++];const r=Number.isFinite(+o),s=a>=e.length;if(o=!o&&io.isArray(t)?t.length:o,s)return io.hasOwnProp(t,o)?t[o]=[t[o],i]:t[o]=i,!r;t[o]&&io.isObject(t[o])||(t[o]=[]);return n(e,i,t[o],a)&&io.isArray(t[o])&&(t[o]=function(e){const n={},i=Object.keys(e);let t;const a=i.length;let o;for(t=0;t<a;t++)o=i[t],n[o]=e[o];return n}(t[o])),!r}if(io.isFormData(e)&&io.isFunction(e.entries)){const i={};return io.forEachEntry(e,((e,t)=>{n(function(e){return io.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),t,i,0)})),i}return null}function mr(e,n,i){const t=i.config.validateStatus;i.status&&t&&!t(i.status)?n(new to("Request failed with status code "+i.status,[to.ERR_BAD_REQUEST,to.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i)):e(i)}function fr(e,n){return e&&!function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}(n)?function(e,n){return n?e.replace(/\/+$/,"")+"/"+n.replace(/^\/+/,""):e}(e,n):n}var hr=s.parse,vr={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443},xr=String.prototype.endsWith||function(e){return e.length<=this.length&&-1!==this.indexOf(e,this.length-e.length)};function gr(e){return process.env[e.toLowerCase()]||process.env[e.toUpperCase()]||""}var br,yr,wr,_r,Er,kr=function(e){var n="string"==typeof e?hr(e):e||{},i=n.protocol,t=n.host,a=n.port;if("string"!=typeof t||!t||"string"!=typeof i)return"";if(i=i.split(":",1)[0],!function(e,n){var i=(gr("npm_config_no_proxy")||gr("no_proxy")).toLowerCase();if(!i)return!0;if("*"===i)return!1;return i.split(/[,\s]/).every((function(i){if(!i)return!0;var t=i.match(/^(.+):(\d+)$/),a=t?t[1]:i,o=t?parseInt(t[2]):0;return!(!o||o===n)||(/^[.*]/.test(a)?("*"===a.charAt(0)&&(a=a.slice(1)),!xr.call(e,a)):e!==a)}))}(t=t.replace(/:\d*$/,""),a=parseInt(a)||vr[i]||0))return"";var o=gr("npm_config_"+i+"_proxy")||gr(i+"_proxy")||gr("npm_config_proxy")||gr("all_proxy");return o&&-1===o.indexOf("://")&&(o=i+"://"+o),o},jr={exports:{}},Sr={exports:{}},Rr={exports:{}};function Or(){if(yr)return br;yr=1;var e=1e3,n=60*e,i=60*n,t=24*i,a=7*t,o=365.25*t;function r(e,n,i,t){var a=n>=1.5*i;return Math.round(e/i)+" "+t+(a?"s":"")}return br=function(s,c){c=c||{};var p=typeof s;if("string"===p&&s.length>0)return function(r){if((r=String(r)).length>100)return;var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(r);if(!s)return;var c=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*a;case"days":case"day":case"d":return c*t;case"hours":case"hour":case"hrs":case"hr":case"h":return c*i;case"minutes":case"minute":case"mins":case"min":case"m":return c*n;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(s);if("number"===p&&isFinite(s))return c.long?function(a){var o=Math.abs(a);if(o>=t)return r(a,o,t,"day");if(o>=i)return r(a,o,i,"hour");if(o>=n)return r(a,o,n,"minute");if(o>=e)return r(a,o,e,"second");return a+" ms"}(s):function(a){var o=Math.abs(a);if(o>=t)return Math.round(a/t)+"d";if(o>=i)return Math.round(a/i)+"h";if(o>=n)return Math.round(a/n)+"m";if(o>=e)return Math.round(a/e)+"s";return a+"ms"}(s);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(s))}}function Ar(){if(_r)return wr;return _r=1,wr=function(e){function n(e){let t,a,o,r=null;function s(...e){if(!s.enabled)return;const i=s,a=Number(new Date),o=a-(t||a);i.diff=o,i.prev=t,i.curr=a,t=a,e[0]=n.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let r=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((t,a)=>{if("%%"===t)return"%";r++;const o=n.formatters[a];if("function"==typeof o){const n=e[r];t=o.call(i,n),e.splice(r,1),r--}return t})),n.formatArgs.call(i,e);(i.log||n.log).apply(i,e)}return s.namespace=e,s.useColors=n.useColors(),s.color=n.selectColor(e),s.extend=i,s.destroy=n.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==r?r:(a!==n.namespaces&&(a=n.namespaces,o=n.enabled(e)),o),set:e=>{r=e}}),"function"==typeof n.init&&n.init(s),s}function i(e,i){const t=n(this.namespace+(void 0===i?":":i)+e);return t.log=this.log,t}function t(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return n.debug=n,n.default=n,n.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},n.disable=function(){const e=[...n.names.map(t),...n.skips.map(t).map((e=>"-"+e))].join(",");return n.enable(""),e},n.enable=function(e){let i;n.save(e),n.namespaces=e,n.names=[],n.skips=[];const t=("string"==typeof e?e:"").split(/[\s,]+/),a=t.length;for(i=0;i<a;i++)t[i]&&("-"===(e=t[i].replace(/\*/g,".*?"))[0]?n.skips.push(new RegExp("^"+e.slice(1)+"$")):n.names.push(new RegExp("^"+e+"$")))},n.enabled=function(e){if("*"===e[e.length-1])return!0;let i,t;for(i=0,t=n.skips.length;i<t;i++)if(n.skips[i].test(e))return!1;for(i=0,t=n.names.length;i<t;i++)if(n.names[i].test(e))return!0;return!1},n.humanize=Or(),n.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((i=>{n[i]=e[i]})),n.names=[],n.skips=[],n.formatters={},n.selectColor=function(e){let i=0;for(let n=0;n<e.length;n++)i=(i<<5)-i+e.charCodeAt(n),i|=0;return n.colors[Math.abs(i)%n.colors.length]},n.enable(n.load()),n},wr}var Tr,Cr,Ir,Lr,Nr,$r,Pr,zr={exports:{}};function Br(){return Cr?Tr:(Cr=1,Tr=(e,n=process.argv)=>{const i=e.startsWith("-")?"":1===e.length?"-":"--",t=n.indexOf(i+e),a=n.indexOf("--");return-1!==t&&(-1===a||t<a)})}function Fr(){return Nr||(Nr=1,function(e,n){const t=l,a=i;n.init=function(e){e.inspectOpts={};const i=Object.keys(n.inspectOpts);for(let t=0;t<i.length;t++)e.inspectOpts[i[t]]=n.inspectOpts[i[t]]},n.log=function(...e){return process.stderr.write(a.format(...e)+"\n")},n.formatArgs=function(i){const{namespace:t,useColors:a}=this;if(a){const n=this.color,a="[3"+(n<8?n:"8;5;"+n),o=` ${a};1m${t} `;i[0]=o+i[0].split("\n").join("\n"+o),i.push(a+"m+"+e.exports.humanize(this.diff)+"")}else i[0]=function(){if(n.inspectOpts.hideDate)return"";return(new Date).toISOString()+" "}()+t+" "+i[0]},n.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},n.load=function(){return process.env.DEBUG},n.useColors=function(){return"colors"in n.inspectOpts?Boolean(n.inspectOpts.colors):t.isatty(process.stderr.fd)},n.destroy=a.deprecate((()=>{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),n.colors=[6,2,3,4,5,1];try{const e=function(){if(Lr)return Ir;Lr=1;const e=u,n=l,i=Br(),{env:t}=process;let a;function o(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function r(n,o){if(0===a)return 0;if(i("color=16m")||i("color=full")||i("color=truecolor"))return 3;if(i("color=256"))return 2;if(n&&!o&&void 0===a)return 0;const r=a||0;if("dumb"===t.TERM)return r;if("win32"===process.platform){const n=e.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in t)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((e=>e in t))||"codeship"===t.CI_NAME?1:r;if("TEAMCITY_VERSION"in t)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(t.TEAMCITY_VERSION)?1:0;if("truecolor"===t.COLORTERM)return 3;if("TERM_PROGRAM"in t){const e=parseInt((t.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(t.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(t.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(t.TERM)||"COLORTERM"in t?1:r}return i("no-color")||i("no-colors")||i("color=false")||i("color=never")?a=0:(i("color")||i("colors")||i("color=true")||i("color=always"))&&(a=1),"FORCE_COLOR"in t&&(a="true"===t.FORCE_COLOR?1:"false"===t.FORCE_COLOR?0:0===t.FORCE_COLOR.length?1:Math.min(parseInt(t.FORCE_COLOR,10),3)),Ir={supportsColor:function(e){return o(r(e,e&&e.isTTY))},stdout:o(r(!0,n.isatty(1))),stderr:o(r(!0,n.isatty(2)))},Ir}();e&&(e.stderr||e).level>=2&&(n.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}n.inspectOpts=Object.keys(process.env).filter((e=>/^debug_/i.test(e))).reduce(((e,n)=>{const i=n.substring(6).toLowerCase().replace(/_([a-z])/g,((e,n)=>n.toUpperCase()));let t=process.env[n];return t=!!/^(yes|on|true|enabled)$/i.test(t)||!/^(no|off|false|disabled)$/i.test(t)&&("null"===t?null:Number(t)),e[i]=t,e}),{}),e.exports=Ar()(n);const{formatters:o}=e.exports;o.o=function(e){return this.inspectOpts.colors=this.useColors,a.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")},o.O=function(e){return this.inspectOpts.colors=this.useColors,a.inspect(e,this.inspectOpts)}}(zr,zr.exports)),zr.exports}function Dr(){return $r||($r=1,function(e){"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?e.exports=(Er||(Er=1,function(e,n){n.formatArgs=function(n){if(n[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+n[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const i="color: "+this.color;n.splice(1,0,i,"color: inherit");let t=0,a=0;n[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(t++,"%c"===e&&(a=t))})),n.splice(a,0,i)},n.save=function(e){try{e?n.storage.setItem("debug",e):n.storage.removeItem("debug")}catch(e){}},n.load=function(){let e;try{e=n.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},n.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},n.storage=function(){try{return localStorage}catch(e){}}(),n.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),n.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],n.log=console.debug||console.log||(()=>{}),e.exports=Ar()(n);const{formatters:i}=e.exports;i.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(Rr,Rr.exports)),Rr.exports):e.exports=Fr()}(Sr)),Sr.exports}var Ur=s,qr=Ur.URL,Mr=o,Hr=r,Vr=n.Writable,Kr=p,Gr=function(){if(!Pr){try{Pr=Dr()("follow-redirects")}catch(e){}"function"!=typeof Pr&&(Pr=function(){})}Pr.apply(null,arguments)},Wr=["abort","aborted","connect","error","socket","timeout"],Xr=Object.create(null);Wr.forEach((function(e){Xr[e]=function(n,i,t){this._redirectable.emit(e,n,i,t)}}));var Jr=rs("ERR_INVALID_URL","Invalid URL",TypeError),Zr=rs("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),Yr=rs("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded"),Qr=rs("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),es=rs("ERR_STREAM_WRITE_AFTER_END","write after end");function ns(e,n){Vr.call(this),this._sanitizeOptions(e),this._options=e,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],n&&this.on("response",n);var i=this;this._onNativeResponse=function(e){i._processResponse(e)},this._performRequest()}function is(e){var n={maxRedirects:21,maxBodyLength:10485760},i={};return Object.keys(e).forEach((function(t){var a=t+":",o=i[a]=e[t],r=n[t]=Object.create(o);Object.defineProperties(r,{request:{value:function(e,t,o){if(cs(e)){var r;try{r=as(new qr(e))}catch(n){r=Ur.parse(e)}if(!cs(r.protocol))throw new Jr({input:e});e=r}else qr&&e instanceof qr?e=as(e):(o=t,t=e,e={protocol:a});return ps(t)&&(o=t,t=null),(t=Object.assign({maxRedirects:n.maxRedirects,maxBodyLength:n.maxBodyLength},e,t)).nativeProtocols=i,cs(t.host)||cs(t.hostname)||(t.hostname="::1"),Kr.equal(t.protocol,a,"protocol mismatch"),Gr("options",t),new ns(t,o)},configurable:!0,enumerable:!0,writable:!0},get:{value:function(e,n,i){var t=r.request(e,n,i);return t.end(),t},configurable:!0,enumerable:!0,writable:!0}})})),n}function ts(){}function as(e){var n={protocol:e.protocol,hostname:e.hostname.startsWith("[")?e.hostname.slice(1,-1):e.hostname,hash:e.hash,search:e.search,pathname:e.pathname,path:e.pathname+e.search,href:e.href};return""!==e.port&&(n.port=Number(e.port)),n}function os(e,n){var i;for(var t in n)e.test(t)&&(i=n[t],delete n[t]);return null==i?void 0:String(i).trim()}function rs(e,n,i){function t(i){Error.captureStackTrace(this,this.constructor),Object.assign(this,i||{}),this.code=e,this.message=this.cause?n+": "+this.cause.message:n}return t.prototype=new(i||Error),t.prototype.constructor=t,t.prototype.name="Error ["+e+"]",t}function ss(e){for(var n of Wr)e.removeListener(n,Xr[n]);e.on("error",ts),e.abort()}function cs(e){return"string"==typeof e||e instanceof String}function ps(e){return"function"==typeof e}ns.prototype=Object.create(Vr.prototype),ns.prototype.abort=function(){ss(this._currentRequest),this.emit("abort")},ns.prototype.write=function(e,n,i){if(this._ending)throw new es;if(!cs(e)&&("object"!=typeof(t=e)||!("length"in t)))throw new TypeError("data should be a string, Buffer or Uint8Array");var t;ps(n)&&(i=n,n=null),0!==e.length?this._requestBodyLength+e.length<=this._options.maxBodyLength?(this._requestBodyLength+=e.length,this._requestBodyBuffers.push({data:e,encoding:n}),this._currentRequest.write(e,n,i)):(this.emit("error",new Qr),this.abort()):i&&i()},ns.prototype.end=function(e,n,i){if(ps(e)?(i=e,e=n=null):ps(n)&&(i=n,n=null),e){var t=this,a=this._currentRequest;this.write(e,n,(function(){t._ended=!0,a.end(null,null,i)})),this._ending=!0}else this._ended=this._ending=!0,this._currentRequest.end(null,null,i)},ns.prototype.setHeader=function(e,n){this._options.headers[e]=n,this._currentRequest.setHeader(e,n)},ns.prototype.removeHeader=function(e){delete this._options.headers[e],this._currentRequest.removeHeader(e)},ns.prototype.setTimeout=function(e,n){var i=this;function t(n){n.setTimeout(e),n.removeListener("timeout",n.destroy),n.addListener("timeout",n.destroy)}function a(n){i._timeout&&clearTimeout(i._timeout),i._timeout=setTimeout((function(){i.emit("timeout"),o()}),e),t(n)}function o(){i._timeout&&(clearTimeout(i._timeout),i._timeout=null),i.removeListener("abort",o),i.removeListener("error",o),i.removeListener("response",o),n&&i.removeListener("timeout",n),i.socket||i._currentRequest.removeListener("socket",a)}return n&&this.on("timeout",n),this.socket?a(this.socket):this._currentRequest.once("socket",a),this.on("socket",t),this.on("abort",o),this.on("error",o),this.on("response",o),this},["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach((function(e){ns.prototype[e]=function(n,i){return this._currentRequest[e](n,i)}})),["aborted","connection","socket"].forEach((function(e){Object.defineProperty(ns.prototype,e,{get:function(){return this._currentRequest[e]}})})),ns.prototype._sanitizeOptions=function(e){if(e.headers||(e.headers={}),e.host&&(e.hostname||(e.hostname=e.host),delete e.host),!e.pathname&&e.path){var n=e.path.indexOf("?");n<0?e.pathname=e.path:(e.pathname=e.path.substring(0,n),e.search=e.path.substring(n))}},ns.prototype._performRequest=function(){var e=this._options.protocol,n=this._options.nativeProtocols[e];if(n){if(this._options.agents){var i=e.slice(0,-1);this._options.agent=this._options.agents[i]}var t=this._currentRequest=n.request(this._options,this._onNativeResponse);for(var a of(t._redirectable=this,Wr))t.on(a,Xr[a]);if(this._currentUrl=/^\//.test(this._options.path)?Ur.format(this._options):this._options.path,this._isRedirect){var o=0,r=this,s=this._requestBodyBuffers;!function e(n){if(t===r._currentRequest)if(n)r.emit("error",n);else if(o<s.length){var i=s[o++];t.finished||t.write(i.data,i.encoding,e)}else r._ended&&t.end()}()}}else this.emit("error",new TypeError("Unsupported protocol "+e))},ns.prototype._processResponse=function(e){var n=e.statusCode;this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:e.headers,statusCode:n});var i=e.headers.location;if(!i||!1===this._options.followRedirects||n<300||n>=400)return e.responseUrl=this._currentUrl,e.redirects=this._redirects,this.emit("response",e),void(this._requestBodyBuffers=[]);if(ss(this._currentRequest),e.destroy(),++this._redirectCount>this._options.maxRedirects)this.emit("error",new Yr);else{var t,a=this._options.beforeRedirect;a&&(t=Object.assign({Host:e.req.getHeader("host")},this._options.headers));var o=this._options.method;((301===n||302===n)&&"POST"===this._options.method||303===n&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],os(/^content-/i,this._options.headers));var r,s=os(/^host$/i,this._options.headers),c=Ur.parse(this._currentUrl),p=s||c.host,l=/^\w+:/.test(i)?this._currentUrl:Ur.format(Object.assign(c,{host:p}));try{r=Ur.resolve(l,i)}catch(e){return void this.emit("error",new Zr({cause:e}))}Gr("redirecting to",r),this._isRedirect=!0;var u=Ur.parse(r);if(Object.assign(this._options,u),(u.protocol!==c.protocol&&"https:"!==u.protocol||u.host!==p&&!function(e,n){Kr(cs(e)&&cs(n));var i=e.length-n.length-1;return i>0&&"."===e[i]&&e.endsWith(n)}(u.host,p))&&os(/^(?:authorization|cookie)$/i,this._options.headers),ps(a)){var d={headers:e.headers,statusCode:n},m={url:l,method:o,headers:t};try{a(this._options,d,m)}catch(e){return void this.emit("error",e)}this._sanitizeOptions(this._options)}try{this._performRequest()}catch(e){this.emit("error",new Zr({cause:e}))}}},jr.exports=is({http:Mr,https:Hr}),jr.exports.wrap=is;const ls="1.1.3";function us(e,n,i){to.call(this,null==e?"canceled":e,to.ERR_CANCELED,n,i),this.name="CanceledError"}function ds(e){const n=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return n&&n[1]||""}io.inherits(us,to,{__CANCEL__:!0});const ms=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;const fs=io.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"]);const hs=Symbol("internals"),vs=Symbol("defaults");function xs(e){return e&&String(e).trim().toLowerCase()}function gs(e){return!1===e||null==e?e:io.isArray(e)?e.map(gs):String(e)}function bs(e,n,i,t){return io.isFunction(t)?t.call(this,n,i):io.isString(n)?io.isString(t)?-1!==n.indexOf(t):io.isRegExp(t)?t.test(n):void 0:void 0}function ys(e,n){n=n.toLowerCase();const i=Object.keys(e);let t,a=i.length;for(;a-- >0;)if(t=i[a],n===t.toLowerCase())return t;return null}function ws(e,n){e&&this.set(e),this[vs]=n||null}function _s(e,n){e=e||10;const i=new Array(e),t=new Array(e);let a,o=0,r=0;return n=void 0!==n?n:1e3,function(s){const c=Date.now(),p=t[r];a||(a=c),i[o]=s,t[o]=c;let l=r,u=0;for(;l!==o;)u+=i[l++],l%=e;if(o=(o+1)%e,o===r&&(r=(r+1)%e),c-a<n)return;const d=p&&c-p;return d?Math.round(1e3*u/d):void 0}}Object.assign(ws.prototype,{set:function(e,n,i){const t=this;function a(e,n,i){const a=xs(n);if(!a)throw new Error("header name must be a non-empty string");const o=ys(t,a);(!o||!0===i||!1!==t[o]&&!1!==i)&&(t[o||n]=gs(e))}return io.isPlainObject(e)?io.forEach(e,((e,i)=>{a(e,i,n)})):a(n,e,i),this},get:function(e,n){if(!(e=xs(e)))return;const i=ys(this,e);if(i){const e=this[i];if(!n)return e;if(!0===n)return function(e){const n=Object.create(null),i=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let t;for(;t=i.exec(e);)n[t[1]]=t[2];return n}(e);if(io.isFunction(n))return n.call(this,e,i);if(io.isRegExp(n))return n.exec(e);throw new TypeError("parser must be boolean|regexp|function")}},has:function(e,n){if(e=xs(e)){const i=ys(this,e);return!(!i||n&&!bs(0,this[i],i,n))}return!1},delete:function(e,n){const i=this;let t=!1;function a(e){if(e=xs(e)){const a=ys(i,e);!a||n&&!bs(0,i[a],a,n)||(delete i[a],t=!0)}}return io.isArray(e)?e.forEach(a):a(e),t},clear:function(){return Object.keys(this).forEach(this.delete.bind(this))},normalize:function(e){const n=this,i={};return io.forEach(this,((t,a)=>{const o=ys(i,a);if(o)return n[o]=gs(t),void delete n[a];const r=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,n,i)=>n.toUpperCase()+i))}(a):String(a).trim();r!==a&&delete n[a],n[r]=gs(t),i[r]=!0})),this},toJSON:function(e){const n=Object.create(null);return io.forEach(Object.assign({},this[vs]||null,this),((i,t)=>{null!=i&&!1!==i&&(n[t]=e&&io.isArray(i)?i.join(", "):i)})),n}}),Object.assign(ws,{from:function(e){return io.isString(e)?new this((e=>{const n={};let i,t,a;return e&&e.split("\n").forEach((function(e){a=e.indexOf(":"),i=e.substring(0,a).trim().toLowerCase(),t=e.substring(a+1).trim(),!i||n[i]&&fs[i]||("set-cookie"===i?n[i]?n[i].push(t):n[i]=[t]:n[i]=n[i]?n[i]+", "+t:t)})),n})(e)):e instanceof this?e:new this(e)},accessor:function(e){const n=(this[hs]=this[hs]={accessors:{}}).accessors,i=this.prototype;function t(e){const t=xs(e);n[t]||(!function(e,n){const i=io.toCamelCase(" "+n);["get","set","has"].forEach((t=>{Object.defineProperty(e,t+i,{value:function(e,i,a){return this[t].call(this,n,e,i,a)},configurable:!0})}))}(i,e),n[t]=!0)}return io.isArray(e)?e.forEach(t):t(e),this}}),ws.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent"]),io.freezeMethods(ws.prototype),io.freezeMethods(ws);const Es=Symbol("internals");class ks extends n.Transform{constructor(e){super({readableHighWaterMark:(e=io.toFlatObject(e,{maxRate:0,chunkSize:65536,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,((e,n)=>!io.isUndefined(n[e])))).chunkSize});const n=this,i=this[Es]={length:e.length,timeWindow:e.timeWindow,ticksRate:e.ticksRate,chunkSize:e.chunkSize,maxRate:e.maxRate,minChunkSize:e.minChunkSize,bytesSeen:0,isCaptured:!1,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null},t=_s(i.ticksRate*e.samplesCount,i.timeWindow);this.on("newListener",(e=>{"progress"===e&&(i.isCaptured||(i.isCaptured=!0))}));let a=0;i.updateProgress=function(e,n){let i=0;const t=1e3/n;let a=null;return function(n,o){const r=Date.now();if(n||r-i>t)return a&&(clearTimeout(a),a=null),i=r,e.apply(null,o);a||(a=setTimeout((()=>(a=null,i=Date.now(),e.apply(null,o))),t-(r-i)))}}((function(){const e=i.length,o=i.bytesSeen,r=o-a;if(!r||n.destroyed)return;const s=t(r);a=o,process.nextTick((()=>{n.emit("progress",{loaded:o,total:e,progress:e?o/e:void 0,bytes:r,rate:s||void 0,estimated:s&&e&&o<=e?(e-o)/s:void 0})}))}),i.ticksRate);const o=()=>{i.updateProgress(!0)};this.once("end",o),this.once("error",o)}_read(e){const n=this[Es];return n.onReadCallback&&n.onReadCallback(),super._read(e)}_transform(e,n,i){const t=this,a=this[Es],o=a.maxRate,r=this.readableHighWaterMark,s=a.timeWindow,c=o/(1e3/s),p=!1!==a.minChunkSize?Math.max(a.minChunkSize,.01*c):0;const l=(e,n)=>{const i=Buffer.byteLength(e);let l,u=null,d=r,m=0;if(o){const e=Date.now();(!a.ts||(m=e-a.ts)>=s)&&(a.ts=e,l=c-a.bytes,a.bytes=l<0?-l:0,m=0),l=c-a.bytes}if(o){if(l<=0)return setTimeout((()=>{n(null,e)}),s-m);l<d&&(d=l)}d&&i>d&&i-d>p&&(u=e.subarray(d),e=e.subarray(0,d)),function(e,n){const i=Buffer.byteLength(e);a.bytesSeen+=i,a.bytes+=i,a.isCaptured&&a.updateProgress(),t.push(e)?process.nextTick(n):a.onReadCallback=()=>{a.onReadCallback=null,process.nextTick(n)}}(e,u?()=>{process.nextTick(n,null,u)}:n)};l(e,(function e(n,t){if(n)return i(n);t?l(t,e):i(null)}))}setLength(e){return this[Es].length=+e,this}}const js=io.isFunction(d.createBrotliDecompress),{http:Ss,https:Rs}=jr.exports,Os=/https:?/,As=ur.protocols.map((e=>e+":"));function Ts(e){e.beforeRedirects.proxy&&e.beforeRedirects.proxy(e),e.beforeRedirects.config&&e.beforeRedirects.config(e)}function Cs(e,n,i){let t=n;if(!t&&!1!==t){const e=kr(i);e&&(t=new URL(e))}if(t){if(t.username&&(t.auth=(t.username||"")+":"+(t.password||"")),t.auth){(t.auth.username||t.auth.password)&&(t.auth=(t.auth.username||"")+":"+(t.auth.password||""));const n=Buffer.from(t.auth,"utf8").toString("base64");e.headers["Proxy-Authorization"]="Basic "+n}e.headers.host=e.hostname+(e.port?":"+e.port:"");const n=t.hostname||t.host;e.hostname=n,e.host=n,e.port=t.port,e.path=i,t.protocol&&(e.protocol=t.protocol.includes(":")?t.protocol:`${t.protocol}:`)}e.beforeRedirects.proxy=function(e){Cs(e,n,e.href)}}var Is=ur.isStandardBrowserEnv?{write:function(e,n,i,t,a,o){const r=[];r.push(e+"="+encodeURIComponent(n)),io.isNumber(i)&&r.push("expires="+new Date(i).toGMTString()),io.isString(t)&&r.push("path="+t),io.isString(a)&&r.push("domain="+a),!0===o&&r.push("secure"),document.cookie=r.join("; ")},read:function(e){const n=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},Ls=ur.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let i;function t(i){let t=i;return e&&(n.setAttribute("href",t),t=n.href),n.setAttribute("href",t),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return i=t(window.location.href),function(e){const n=io.isString(e)?t(e):e;return n.protocol===i.protocol&&n.host===i.host}}():function(){return!0};function Ns(e,n){let i=0;const t=_s(50,250);return a=>{const o=a.loaded,r=a.lengthComputable?a.total:void 0,s=o-i,c=t(s);i=o;const p={loaded:o,total:r,progress:r?o/r:void 0,bytes:s,rate:c||void 0,estimated:c&&r&&o<=r?(r-o)/c:void 0};p[n?"download":"upload"]=!0,e(p)}}const $s={http:function(e){return new Promise((function(i,t){let a=e.data;const s=e.responseType,c=e.responseEncoding,p=e.method.toUpperCase();let l,u,f,h=!1;const v=new m;function x(){l||(l=!0,e.cancelToken&&e.cancelToken.unsubscribe(w),e.signal&&e.signal.removeEventListener("abort",w),v.removeAllListeners())}function g(e,n){u||(u=!0,n&&(h=!0,x()),n?t(e):i(e))}const b=function(e){g(e)},y=function(e){g(e,!0)};function w(n){v.emit("abort",!n||n.type?new us(null,e,f):n)}v.once("abort",y),(e.cancelToken||e.signal)&&(e.cancelToken&&e.cancelToken.subscribe(w),e.signal&&(e.signal.aborted?w():e.signal.addEventListener("abort",w)));const _=fr(e.baseURL,e.url),E=new URL(_),k=E.protocol||As[0];if("data:"===k){let i;if("GET"!==p)return mr(b,y,{status:405,statusText:"method not allowed",headers:{},config:e});try{i=function(e,n,i){const t=i&&i.Blob||ur.classes.Blob,a=ds(e);if(void 0===n&&t&&(n=!0),"data"===a){e=a.length?e.slice(a.length+1):e;const i=ms.exec(e);if(!i)throw new to("Invalid URL",to.ERR_INVALID_URL);const o=i[1],r=i[2],s=i[3],c=Buffer.from(decodeURIComponent(s),r?"base64":"utf8");if(n){if(!t)throw new to("Blob is not supported",to.ERR_NOT_SUPPORT);return new t([c],{type:o})}return c}throw new to("Unsupported protocol "+a,to.ERR_NOT_SUPPORT)}(e.url,"blob"===s,{Blob:e.env&&e.env.Blob})}catch(n){throw to.from(n,to.ERR_BAD_REQUEST,e)}return"text"===s?(i=i.toString(c),c&&"utf8"!==c||(a=io.stripBOM(i))):"stream"===s&&(i=n.Readable.from(i)),mr(b,y,{data:i,status:200,statusText:"OK",headers:{},config:e})}if(-1===As.indexOf(k))return y(new to("Unsupported protocol "+k,to.ERR_BAD_REQUEST,e));const j=ws.from(e.headers).normalize();j.set("User-Agent","axios/"+ls,!1);const S=e.onDownloadProgress,R=e.onUploadProgress,O=e.maxRate;let A,T;if(io.isFormData(a)&&io.isFunction(a.getHeaders))j.set(a.getHeaders());else if(a&&!io.isStream(a)){if(Buffer.isBuffer(a));else if(io.isArrayBuffer(a))a=Buffer.from(new Uint8Array(a));else{if(!io.isString(a))return y(new to("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",to.ERR_BAD_REQUEST,e));a=Buffer.from(a,"utf-8")}if(j.set("Content-Length",a.length,!1),e.maxBodyLength>-1&&a.length>e.maxBodyLength)return y(new to("Request body larger than maxBodyLength limit",to.ERR_BAD_REQUEST,e))}const C=+j.getContentLength();let I,L;if(io.isArray(O)?(A=O[0],T=O[1]):A=T=O,a&&(R||A)&&(io.isStream(a)||(a=n.Readable.from(a,{objectMode:!1})),a=n.pipeline([a,new ks({length:io.toFiniteNumber(C),maxRate:io.toFiniteNumber(A)})],io.noop),R&&a.on("progress",(e=>{R(Object.assign(e,{upload:!0}))}))),e.auth){I=(e.auth.username||"")+":"+(e.auth.password||"")}if(!I&&E.username){I=E.username+":"+E.password}I&&j.delete("authorization");try{L=cr(E.pathname+E.search,e.params,e.paramsSerializer).replace(/^\?/,"")}catch(n){const i=new Error(n.message);return i.config=e,i.url=e.url,i.exists=!0,y(i)}j.set("Accept-Encoding","gzip, deflate, br",!1);const N={path:L,method:p,headers:j.toJSON(),agents:{http:e.httpAgent,https:e.httpsAgent},auth:I,protocol:k,beforeRedirect:Ts,beforeRedirects:{}};let $;e.socketPath?N.socketPath=e.socketPath:(N.hostname=E.hostname,N.port=E.port,Cs(N,e.proxy,k+"//"+E.hostname+(E.port?":"+E.port:"")+N.path));const P=Os.test(N.protocol);if(N.agent=P?e.httpsAgent:e.httpAgent,e.transport?$=e.transport:0===e.maxRedirects?$=P?r:o:(e.maxRedirects&&(N.maxRedirects=e.maxRedirects),e.beforeRedirect&&(N.beforeRedirects.config=e.beforeRedirect),$=P?Rs:Ss),e.maxBodyLength>-1?N.maxBodyLength=e.maxBodyLength:N.maxBodyLength=1/0,e.insecureHTTPParser&&(N.insecureHTTPParser=e.insecureHTTPParser),f=$.request(N,(function(i){if(f.destroyed)return;const t=[i];let o=i;const r=i.req||f;if(!1!==e.decompress)switch(a&&0===a.length&&i.headers["content-encoding"]&&delete i.headers["content-encoding"],i.headers["content-encoding"]){case"gzip":case"compress":case"deflate":t.push(d.createUnzip()),delete i.headers["content-encoding"];break;case"br":js&&(t.push(d.createBrotliDecompress()),delete i.headers["content-encoding"])}if(S){const e=+i.headers["content-length"],n=new ks({length:io.toFiniteNumber(e),maxRate:io.toFiniteNumber(T)});S&&n.on("progress",(e=>{S(Object.assign(e,{download:!0}))})),t.push(n)}o=t.length>1?n.pipeline(t,io.noop):t[0];const p=n.finished(o,(()=>{p(),x()})),l={status:i.statusCode,statusText:i.statusMessage,headers:new ws(i.headers),config:e,request:r};if("stream"===s)l.data=o,mr(b,y,l);else{const n=[];let i=0;o.on("data",(function(t){n.push(t),i+=t.length,e.maxContentLength>-1&&i>e.maxContentLength&&(h=!0,o.destroy(),y(new to("maxContentLength size of "+e.maxContentLength+" exceeded",to.ERR_BAD_RESPONSE,e,r)))})),o.on("aborted",(function(){if(h)return;const n=new to("maxContentLength size of "+e.maxContentLength+" exceeded",to.ERR_BAD_RESPONSE,e,r);o.destroy(n),y(n)})),o.on("error",(function(n){f.destroyed||y(to.from(n,null,e,r))})),o.on("end",(function(){try{let e=1===n.length?n[0]:Buffer.concat(n);"arraybuffer"!==s&&(e=e.toString(c),c&&"utf8"!==c||(e=io.stripBOM(e))),l.data=e}catch(n){y(to.from(n,null,e,l.request,l))}mr(b,y,l)}))}v.once("abort",(e=>{o.destroyed||(o.emit("error",e),o.destroy())}))})),v.once("abort",(e=>{y(e),f.destroy(e)})),f.on("error",(function(n){y(to.from(n,null,e,f))})),f.on("socket",(function(e){e.setKeepAlive(!0,6e4)})),e.timeout){const n=parseInt(e.timeout,10);if(isNaN(n))return void y(new to("error trying to parse `config.timeout` to int",to.ERR_BAD_OPTION_VALUE,e,f));f.setTimeout(n,(function(){if(u)return;let n=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const i=e.transitional||lr;e.timeoutErrorMessage&&(n=e.timeoutErrorMessage),y(new to(n,i.clarifyTimeoutError?to.ETIMEDOUT:to.ECONNABORTED,e,f)),w()}))}if(io.isStream(a)){let n=!1,i=!1;a.on("end",(()=>{n=!0})),a.once("error",(e=>{i=!0,f.destroy(e)})),a.on("close",(()=>{n||i||w(new us("Request stream has been aborted",e,f))})),a.pipe(f)}else f.end(a)}))},xhr:function(e){return new Promise((function(n,i){let t=e.data;const a=ws.from(e.headers).normalize(),o=e.responseType;let r;function s(){e.cancelToken&&e.cancelToken.unsubscribe(r),e.signal&&e.signal.removeEventListener("abort",r)}io.isFormData(t)&&ur.isStandardBrowserEnv&&a.setContentType(!1);let c=new XMLHttpRequest;if(e.auth){const n=e.auth.username||"",i=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";a.set("Authorization","Basic "+btoa(n+":"+i))}const p=fr(e.baseURL,e.url);function l(){if(!c)return;const t=ws.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders());mr((function(e){n(e),s()}),(function(e){i(e),s()}),{data:o&&"text"!==o&&"json"!==o?c.response:c.responseText,status:c.status,statusText:c.statusText,headers:t,config:e,request:c}),c=null}if(c.open(e.method.toUpperCase(),cr(p,e.params,e.paramsSerializer),!0),c.timeout=e.timeout,"onloadend"in c?c.onloadend=l:c.onreadystatechange=function(){c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(l)},c.onabort=function(){c&&(i(new to("Request aborted",to.ECONNABORTED,e,c)),c=null)},c.onerror=function(){i(new to("Network Error",to.ERR_NETWORK,e,c)),c=null},c.ontimeout=function(){let n=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const t=e.transitional||lr;e.timeoutErrorMessage&&(n=e.timeoutErrorMessage),i(new to(n,t.clarifyTimeoutError?to.ETIMEDOUT:to.ECONNABORTED,e,c)),c=null},ur.isStandardBrowserEnv){const n=(e.withCredentials||Ls(p))&&e.xsrfCookieName&&Is.read(e.xsrfCookieName);n&&a.set(e.xsrfHeaderName,n)}void 0===t&&a.setContentType(null),"setRequestHeader"in c&&io.forEach(a.toJSON(),(function(e,n){c.setRequestHeader(n,e)})),io.isUndefined(e.withCredentials)||(c.withCredentials=!!e.withCredentials),o&&"json"!==o&&(c.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&c.addEventListener("progress",Ns(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&c.upload&&c.upload.addEventListener("progress",Ns(e.onUploadProgress)),(e.cancelToken||e.signal)&&(r=n=>{c&&(i(!n||n.type?new us(null,e,c):n),c.abort(),c=null)},e.cancelToken&&e.cancelToken.subscribe(r),e.signal&&(e.signal.aborted?r():e.signal.addEventListener("abort",r)));const u=ds(p);u&&-1===ur.protocols.indexOf(u)?i(new to("Unsupported protocol "+u+":",to.ERR_BAD_REQUEST,e)):c.send(t||null)}))}};var Ps=e=>{if(io.isString(e)){const n=$s[e];if(!e)throw Error(io.hasOwnProp(e)?`Adapter '${e}' is not available in the build`:`Can not resolve adapter '${e}'`);return n}if(!io.isFunction(e))throw new TypeError("adapter is not a function");return e};const zs={"Content-Type":"application/x-www-form-urlencoded"};const Bs={transitional:lr,adapter:function(){let e;return"undefined"!=typeof XMLHttpRequest?e=Ps("xhr"):"undefined"!=typeof process&&"process"===io.kindOf(process)&&(e=Ps("http")),e}(),transformRequest:[function(e,n){const i=n.getContentType()||"",t=i.indexOf("application/json")>-1,a=io.isObject(e);a&&io.isHTMLForm(e)&&(e=new FormData(e));if(io.isFormData(e))return t&&t?JSON.stringify(dr(e)):e;if(io.isArrayBuffer(e)||io.isBuffer(e)||io.isStream(e)||io.isFile(e)||io.isBlob(e))return e;if(io.isArrayBufferView(e))return e.buffer;if(io.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(a){if(i.indexOf("application/x-www-form-urlencoded")>-1)return function(e,n){return tr(e,new ur.classes.URLSearchParams,Object.assign({visitor:function(e,n,i,t){return io.isBuffer(e)?(this.append(n,e.toString("base64")),!1):t.defaultVisitor.apply(this,arguments)}},n))}(e,this.formSerializer).toString();if((o=io.isFileList(e))||i.indexOf("multipart/form-data")>-1){const n=this.env&&this.env.FormData;return tr(o?{"files[]":e}:e,n&&new n,this.formSerializer)}}return a||t?(n.setContentType("application/json",!1),function(e,n,i){if(io.isString(e))try{return(n||JSON.parse)(e),io.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(i||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const n=this.transitional||Bs.transitional,i=n&&n.forcedJSONParsing,t="json"===this.responseType;if(e&&io.isString(e)&&(i&&!this.responseType||t)){const i=!(n&&n.silentJSONParsing)&&t;try{return JSON.parse(e)}catch(e){if(i){if("SyntaxError"===e.name)throw to.from(e,to.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ur.classes.FormData,Blob:ur.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};function Fs(e,n){const i=this||Bs,t=n||i,a=ws.from(t.headers);let o=t.data;return io.forEach(e,(function(e){o=e.call(i,o,a.normalize(),n?n.status:void 0)})),a.normalize(),o}function Ds(e){return!(!e||!e.__CANCEL__)}function Us(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new us}function qs(e){Us(e),e.headers=ws.from(e.headers),e.data=Fs.call(e,e.transformRequest);return(e.adapter||Bs.adapter)(e).then((function(n){return Us(e),n.data=Fs.call(e,e.transformResponse,n),n.headers=ws.from(n.headers),n}),(function(n){return Ds(n)||(Us(e),n&&n.response&&(n.response.data=Fs.call(e,e.transformResponse,n.response),n.response.headers=ws.from(n.response.headers))),Promise.reject(n)}))}function Ms(e,n){n=n||{};const i={};function t(e,n){return io.isPlainObject(e)&&io.isPlainObject(n)?io.merge(e,n):io.isPlainObject(n)?io.merge({},n):io.isArray(n)?n.slice():n}function a(i){return io.isUndefined(n[i])?io.isUndefined(e[i])?void 0:t(void 0,e[i]):t(e[i],n[i])}function o(e){if(!io.isUndefined(n[e]))return t(void 0,n[e])}function r(i){return io.isUndefined(n[i])?io.isUndefined(e[i])?void 0:t(void 0,e[i]):t(void 0,n[i])}function s(i){return i in n?t(e[i],n[i]):i in e?t(void 0,e[i]):void 0}const c={url:o,method:o,data:o,baseURL:r,transformRequest:r,transformResponse:r,paramsSerializer:r,timeout:r,timeoutMessage:r,withCredentials:r,adapter:r,responseType:r,xsrfCookieName:r,xsrfHeaderName:r,onUploadProgress:r,onDownloadProgress:r,decompress:r,maxContentLength:r,maxBodyLength:r,beforeRedirect:r,transport:r,httpAgent:r,httpsAgent:r,cancelToken:r,socketPath:r,responseEncoding:r,validateStatus:s};return io.forEach(Object.keys(e).concat(Object.keys(n)),(function(e){const n=c[e]||a,t=n(e);io.isUndefined(t)&&n!==s||(i[e]=t)})),i}io.forEach(["delete","get","head"],(function(e){Bs.headers[e]={}})),io.forEach(["post","put","patch"],(function(e){Bs.headers[e]=io.merge(zs)}));const Hs={};["object","boolean","number","function","string","symbol"].forEach(((e,n)=>{Hs[e]=function(i){return typeof i===e||"a"+(n<1?"n ":" ")+e}}));const Vs={};Hs.transitional=function(e,n,i){function t(e,n){return"[Axios v1.1.3] Transitional option '"+e+"'"+n+(i?". "+i:"")}return(i,a,o)=>{if(!1===e)throw new to(t(a," has been removed"+(n?" in "+n:"")),to.ERR_DEPRECATED);return n&&!Vs[a]&&(Vs[a]=!0,console.warn(t(a," has been deprecated since v"+n+" and will be removed in the near future"))),!e||e(i,a,o)}};var Ks={assertOptions:function(e,n,i){if("object"!=typeof e)throw new to("options must be an object",to.ERR_BAD_OPTION_VALUE);const t=Object.keys(e);let a=t.length;for(;a-- >0;){const o=t[a],r=n[o];if(r){const n=e[o],i=void 0===n||r(n,o,e);if(!0!==i)throw new to("option "+o+" must be "+i,to.ERR_BAD_OPTION_VALUE)}else if(!0!==i)throw new to("Unknown option "+o,to.ERR_BAD_OPTION)}},validators:Hs};const Gs=Ks.validators;let Ws=class{constructor(e){this.defaults=e,this.interceptors={request:new pr,response:new pr}}request(e,n){"string"==typeof e?(n=n||{}).url=e:n=e||{},n=Ms(this.defaults,n);const{transitional:i,paramsSerializer:t}=n;void 0!==i&&Ks.assertOptions(i,{silentJSONParsing:Gs.transitional(Gs.boolean),forcedJSONParsing:Gs.transitional(Gs.boolean),clarifyTimeoutError:Gs.transitional(Gs.boolean)},!1),void 0!==t&&Ks.assertOptions(t,{encode:Gs.function,serialize:Gs.function},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();const a=n.headers&&io.merge(n.headers.common,n.headers[n.method]);a&&io.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete n.headers[e]})),n.headers=new ws(n.headers,a);const o=[];let r=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(n)||(r=r&&e.synchronous,o.unshift(e.fulfilled,e.rejected))}));const s=[];let c;this.interceptors.response.forEach((function(e){s.push(e.fulfilled,e.rejected)}));let p,l=0;if(!r){const e=[qs.bind(this),void 0];for(e.unshift.apply(e,o),e.push.apply(e,s),p=e.length,c=Promise.resolve(n);l<p;)c=c.then(e[l++],e[l++]);return c}p=o.length;let u=n;for(l=0;l<p;){const e=o[l++],n=o[l++];try{u=e(u)}catch(e){n.call(this,e);break}}try{c=qs.call(this,u)}catch(e){return Promise.reject(e)}for(l=0,p=s.length;l<p;)c=c.then(s[l++],s[l++]);return c}getUri(e){return cr(fr((e=Ms(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}};io.forEach(["delete","get","head","options"],(function(e){Ws.prototype[e]=function(n,i){return this.request(Ms(i||{},{method:e,url:n,data:(i||{}).data}))}})),io.forEach(["post","put","patch"],(function(e){function n(n){return function(i,t,a){return this.request(Ms(a||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:t}))}}Ws.prototype[e]=n(),Ws.prototype[e+"Form"]=n(!0)}));let Xs=class{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let n;this.promise=new Promise((function(e){n=e}));const i=this;this.promise.then((e=>{if(!i._listeners)return;let n=i._listeners.length;for(;n-- >0;)i._listeners[n](e);i._listeners=null})),this.promise.then=e=>{let n;const t=new Promise((e=>{i.subscribe(e),n=e})).then(e);return t.cancel=function(){i.unsubscribe(n)},t},e((function(e,t,a){i.reason||(i.reason=new us(e,t,a),n(i.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);-1!==n&&this._listeners.splice(n,1)}static source(){let e;return{token:new Xs((function(n){e=n})),cancel:e}}};const Js=function e(n){const i=new Ws(n),t=Aa(Ws.prototype.request,i);return io.extend(t,Ws.prototype,i,{allOwnKeys:!0}),io.extend(t,i,null,{allOwnKeys:!0}),t.create=function(i){return e(Ms(n,i))},t}(Bs);Js.Axios=Ws,Js.CanceledError=us,Js.CancelToken=Xs,Js.isCancel=Ds,Js.VERSION=ls,Js.toFormData=tr,Js.AxiosError=to,Js.Cancel=Js.CanceledError,Js.all=function(e){return Promise.all(e)},Js.spread=function(e){return function(n){return e.apply(null,n)}},Js.isAxiosError=function(e){return io.isObject(e)&&!0===e.isAxiosError},Js.formToJSON=e=>dr(io.isHTMLForm(e)?new FormData(e):e);const{Axios:Zs,AxiosError:Ys,CanceledError:Qs,isCancel:ec,CancelToken:nc,VERSION:ic,all:tc,Cancel:ac,isAxiosError:oc,spread:rc,toFormData:sc}=Js;class cc{constructor(e,n={}){const{assetId:i,interactiveNonce:t,visitorId:a,apiKey:o}=n;this.topia=e,this.credentials=n,this.requestOptions={};let r={};const s={};a&&i&&t&&(r={interactiveNonce:t,visitorId:a,assetId:i},this.jwt=Oa.sign(r,e.interactiveSecret),s.Interactivejwt=this.jwt),o&&(s.Authorization=o),this.requestOptions={headers:s}}topiaPublicApi(){return this.stackTrace=new Error("Thrown here:"),this.topia.axios}errorHandler({error:e,message:n="Something went wrong. Please try again or contact support."}){var i,t,a,o;let r={},s=n,c=500,p="unknown",l="unknown",u="empty";return e instanceof Ys?(s=(null==e?void 0:e.message)||n,e.response&&(c=e.response.status,r=e.response.data),(null===(i=null==e?void 0:e.config)||void 0===i?void 0:i.url)&&(p=e.config.url),(null===(t=null==e?void 0:e.config)||void 0===t?void 0:t.method)&&(l=e.config.method),(null===(a=this.stackTrace)||void 0===a?void 0:a.stack)&&(u=`${e.stack}\n${this.stackTrace.stack}`)):e instanceof Error&&(s=(null==e?void 0:e.message)||n,(null===(o=this.stackTrace)||void 0===o?void 0:o.stack)&&(u=`${e.stack}\n${this.stackTrace.stack}`)),{success:!1,status:c,url:p,method:l,message:s,data:r,stack:u}}}class pc extends cc{constructor(e,n,i={attributes:{},credentials:{}}){super(e,i.credentials),this.id=n,Object.assign(this,i.attributes)}fetchPlatformAssets(){return f(this,void 0,void 0,(function*(){try{return(yield this.topiaPublicApi().get("/assets/topia-assets",this.requestOptions)).data}catch(e){throw this.errorHandler({error:e})}}))}}var lc;class uc extends pc{constructor(e,n,i,t={attributes:{text:""},credentials:{}}){var a;super(e,n,t),lc.set(this,((e,n)=>f(this,void 0,void 0,(function*(){try{yield this.topiaPublicApi().put(`/world/${this.urlSlug}/assets/${this.id}/${n}`,Object.assign({},e),this.requestOptions)}catch(e){throw this.errorHandler({error:e})}})))),this.id=n,this.text=null===(a=t.attributes)||void 0===a?void 0:a.text,this.urlSlug=i,Object.assign(this,t.attributes)}fetchDroppedAssetById(){return f(this,void 0,void 0,(function*(){try{const e=yield this.topiaPublicApi().get(`/world/${this.urlSlug}/assets/${this.id}`,this.requestOptions);Object.assign(this,e.data)}catch(e){throw this.errorHandler({error:e})}}))}deleteDroppedAsset(){return f(this,void 0,void 0,(function*(){try{yield this.topiaPublicApi().delete(`/world/${this.urlSlug}/assets/${this.id}`,this.requestOptions)}catch(e){throw this.errorHandler({error:e})}}))}fetchDroppedAssetDataObject(){return f(this,void 0,void 0,(function*(){try{const e=yield this.topiaPublicApi().get(`/world/${this.urlSlug}/assets/${this.id}/data-object`,this.requestOptions);this.dataObject=e.data}catch(e){throw this.errorHandler({error:e})}}))}setDroppedAssetDataObject(e,n={}){return f(this,void 0,void 0,(function*(){try{const{lock:i={}}=n;yield this.topiaPublicApi().put(`/world/${this.urlSlug}/assets/${this.id}/set-data-object`,{dataObject:e,lock:i},this.requestOptions),this.dataObject=e}catch(e){throw this.errorHandler({error:e})}}))}updateDroppedAssetDataObject(e,n={}){return f(this,void 0,void 0,(function*(){try{const{lock:i={}}=n;yield this.topiaPublicApi().put(`/world/${this.urlSlug}/assets/${this.id}/update-data-object`,{dataObject:e,lock:i},this.requestOptions),this.dataObject=e}catch(e){throw this.errorHandler({error:e})}}))}updateBroadcast({assetBroadcast:e,assetBroadcastAll:n,broadcasterEmail:i}){try{return h(this,lc,"f").call(this,{assetBroadcast:e,assetBroadcastAll:n,broadcasterEmail:i},"set-asset-broadcast")}catch(e){throw this.errorHandler({error:e})}}updateClickType({clickType:e,clickableLink:n,clickableLinkTitle:i,clickableDisplayTextDescription:t,clickableDisplayTextHeadline:a,portalName:o,position:r}){try{return h(this,lc,"f").call(this,{clickType:e,clickableLink:n,clickableLinkTitle:i,clickableDisplayTextDescription:t,clickableDisplayTextHeadline:a,portalName:o,position:r},"change-click-type")}catch(e){throw this.errorHandler({error:e})}}updateCustomTextAsset(e,n){try{return h(this,lc,"f").call(this,{style:e,text:n},"set-custom-text")}catch(e){throw this.errorHandler({error:e})}}updateMediaType({audioRadius:e,audioSliderVolume:n,isVideo:i,mediaLink:t,mediaName:a,mediaType:o,portalName:r,syncUserMedia:s}){try{return h(this,lc,"f").call(this,{audioRadius:e,audioSliderVolume:n,isVideo:i,mediaLink:t,mediaName:a,mediaType:o,portalName:r,syncUserMedia:s},"change-media-type")}catch(e){throw this.errorHandler({error:e})}}updateMuteZone(e){try{return h(this,lc,"f").call(this,{isMutezone:e},"set-mute-zone")}catch(e){throw this.errorHandler({error:e})}}updatePosition(e,n){try{return h(this,lc,"f").call(this,{x:e,y:n},"set-position")}catch(e){throw this.errorHandler({error:e})}}updatePrivateZone({isPrivateZone:e,isPrivateZoneChatDisabled:n,privateZoneUserCap:i}){try{return h(this,lc,"f").call(this,{isPrivateZone:e,isPrivateZoneChatDisabled:n,privateZoneUserCap:i},"set-private-zone")}catch(e){throw this.errorHandler({error:e})}}updateScale(e){try{return h(this,lc,"f").call(this,{assetScale:e},"change-scale")}catch(e){throw this.errorHandler({error:e})}}updateUploadedMediaSelected(e){try{return h(this,lc,"f").call(this,{mediaId:e},"change-uploaded-media-selected")}catch(e){throw this.errorHandler({error:e})}}updateWebImageLayers(e,n){try{return h(this,lc,"f").call(this,{bottom:e,top:n},"set-webimage-layers")}catch(e){throw this.errorHandler({error:e})}}addWebhook({dataObject:e,description:n,isUniqueOnly:i,title:t,type:a,url:o}){return f(this,void 0,void 0,(function*(){try{yield this.topiaPublicApi().post(`/world/${this.urlSlug}/webhooks`,{active:!0,assetId:this.id,dataObject:e,description:n,enteredBy:"",isUniqueOnly:i,title:t,type:a,url:o,urlSlug:this.urlSlug},this.requestOptions)}catch(e){throw this.errorHandler({error:e})}}))}setInteractiveSettings({isInteractive:e=!1,interactivePublicKey:n=""}){return f(this,void 0,void 0,(function*(){try{yield this.topiaPublicApi().put(`/world/${this.urlSlug}/assets/${this.id}/set-asset-interactive-settings`,{interactivePublicKey:n,isInteractive:e},this.requestOptions),this.isInteractive=e,this.interactivePublicKey=n}catch(e){throw this.errorHandler({error:e})}}))}}lc=new WeakMap;class dc extends cc{constructor(e,n,i,t={attributes:{},credentials:{}}){super(e,t.credentials),Object.assign(this,t.attributes),this.id=n,this.urlSlug=i}fetchVisitor(){return f(this,void 0,void 0,(function*(){try{const e=yield this.topiaPublicApi().get(`/world/${this.urlSlug}/visitors/${this.id}`,this.requestOptions);if(!e.data.success)throw"This visitor is not active";Object.assign(this,e.data).players[0]}catch(e){throw this.errorHandler({error:e})}}))}moveVisitor({shouldTeleportVisitor:e,x:n,y:i}){return f(this,void 0,void 0,(function*(){try{yield this.topiaPublicApi().put(`/world/${this.urlSlug}/visitors/${this.id}/move`,{moveTo:{x:n,y:i},teleport:e},this.requestOptions)}catch(e){throw this.errorHandler({error:e})}}))}}const mc=(e,n)=>{const i=e-n,t=e+n;return Math.floor(Math.random()*(t-i)+i)};var fc,hc,vc;class xc extends cc{constructor(e,n,i={attributes:{},credentials:{}}){super(e,i.credentials),fc.set(this,void 0),hc.set(this,void 0),Object.assign(this,i.attributes),v(this,fc,{},"f"),v(this,hc,{},"f"),this.urlSlug=n}get droppedAssets(){return h(this,fc,"f")}get visitors(){return h(this,hc,"f")}fetchDetails(){return f(this,void 0,void 0,(function*(){try{const e=yield this.topiaPublicApi().get(`/world/${this.urlSlug}/world-details`,this.requestOptions);Object.assign(this,e.data)}catch(e){throw this.errorHandler({error:e})}}))}updateDetails({controls:e,description:n,forceAuthOnLogin:i,height:t,name:a,spawnPosition:o,width:r}){return f(this,void 0,void 0,(function*(){const s={controls:e,description:n,forceAuthOnLogin:i,height:t,name:a,spawnPosition:o,width:r};try{yield this.topiaPublicApi().put(`/world/${this.urlSlug}/world-details`,s,this.requestOptions);const e=(c=s,Object.keys(c).forEach((e=>{void 0===c[e]&&delete c[e]})),c);Object.assign(this,e)}catch(e){throw this.errorHandler({error:e})}var c}))}fetchVisitors(){return f(this,void 0,void 0,(function*(){try{const e=yield this.topiaPublicApi().get(`/world/${this.urlSlug}/visitors`,this.requestOptions),n={};for(const i in e.data)n[i]=new dc(this.topia,e.data[i].playerId,this.urlSlug,{attributes:e.data[i]});v(this,hc,n,"f")}catch(e){throw this.errorHandler({error:e})}}))}currentVisitors(){return f(this,void 0,void 0,(function*(){try{return yield this.fetchVisitors(),this.visitors}catch(e){return e}}))}moveAllVisitors({shouldFetchVisitors:e=!0,shouldTeleportVisitors:n=!0,scatterVisitorsBy:i=0,x:t,y:a}){return f(this,void 0,void 0,(function*(){e&&(yield this.fetchVisitors());const o=[];if(!this.visitors)return;Object.keys(this.visitors).forEach((e=>o.push(h(this,hc,"f")[e].moveVisitor({shouldTeleportVisitor:n,x:mc(t,i),y:mc(a,i)}))));return yield Promise.all(o)}))}moveVisitors(e){return f(this,void 0,void 0,(function*(){const n=[];e.forEach((e=>{n.push(e.visitorObj.moveVisitor({shouldTeleportVisitor:e.shouldTeleportVisitor,x:e.x,y:e.y}))}));return yield Promise.all(n)}))}fetchDroppedAssets(){return f(this,void 0,void 0,(function*(){try{const e=yield this.topiaPublicApi().get(`/world/${this.urlSlug}/assets`,this.requestOptions),n={};for(const i in e.data)n[i]=new uc(this.topia,e.data[i].id,this.urlSlug,{attributes:e.data[i]});v(this,fc,n,"f")}catch(e){throw this.errorHandler({error:e})}}))}updateCustomTextDroppedAssets(e,n){return f(this,void 0,void 0,(function*(){const i=[];e.forEach((e=>{i.push(e.updateCustomTextAsset(n,e.text))}));return yield Promise.all(i)}))}replaceScene(e){return f(this,void 0,void 0,(function*(){try{yield this.topiaPublicApi().put(`/world/${this.urlSlug}/change-scene`,{sceneId:e},this.requestOptions)}catch(e){throw this.errorHandler({error:e})}}))}fetchDroppedAssetsWithUniqueName({uniqueName:e,isPartial:n=!1,isReversed:i=!1}){return f(this,void 0,void 0,(function*(){try{const t=yield this.topiaPublicApi().get(`/world/${this.urlSlug}/assets-with-unique-name/${e}?${n?`partial=${n}&`:""}${i?`reversed=${i}`:""}`,this.requestOptions),a=[];for(const e of t.data.assets)a.push(new uc(this.topia,e.id,this.urlSlug,{attributes:e}));return a}catch(e){throw this.errorHandler({error:e})}}))}}fc=new WeakMap,hc=new WeakMap;class gc extends cc{constructor(e,n,i={credentials:{}}){super(e,i.credentials),vc.set(this,void 0),v(this,vc,{},"f"),this.email=n}get worlds(){return h(this,vc,"f")}fetchAssetsByEmail(e){return f(this,void 0,void 0,(function*(){try{return(yield this.topiaPublicApi().get(`/assets/my-assets?email=${e}`,this.requestOptions)).data}catch(e){throw this.errorHandler({error:e})}}))}fetchScenesByEmail(){return f(this,void 0,void 0,(function*(){try{if(!this.email)throw this.errorHandler({error:new Error("There is no email associated with this user.")});return(yield this.topiaPublicApi().get(`/scenes/my-scenes?email=${this.email}`,this.requestOptions)).data}catch(e){throw this.errorHandler({error:e})}}))}fetchWorldsByKey(){return f(this,void 0,void 0,(function*(){try{const e=yield this.topiaPublicApi().get("/user/worlds",this.requestOptions),n={};for(const i in e.data){const t=e.data[i];n[t.urlSlug]=new xc(this.topia,t.urlSlug,{attributes:t})}v(this,vc,n,"f")}catch(e){throw this.errorHandler({error:e})}}))}}vc=new WeakMap;class bc{constructor({apiKey:e,apiDomain:n,interactiveKey:i,interactiveSecret:t}){"undefined"!=typeof window&&console.warn("Please use extreme caution when passing sensitive information such as API keys from a client side application."),this.apiKey=e,this.apiDomain=n||"api.topia.io",this.interactiveSecret=t;const a={"Content-Type":"application/json"};e&&(a.Authorization=e),i&&(a.Publickey=i),this.axios=Js.create({baseURL:`https://${this.apiDomain}/api`,headers:a})}}class yc{constructor(e){this.topia=e,this.create}create(e,n){return new pc(this.topia,e,n)}}class wc extends cc{constructor(e){super(e)}create(e,n,i){return new uc(this.topia,e,n,i)}get(e,n,i){return f(this,void 0,void 0,(function*(){const t=new uc(this.topia,e,n,i);return yield t.fetchDroppedAssetById(),t}))}drop(e,{position:{x:n,y:i},uniqueName:t,urlSlug:a}){return f(this,void 0,void 0,(function*(){try{const o=yield this.topiaPublicApi().post(`/world/${a}/assets`,{assetId:e.id,position:{x:n,y:i},uniqueName:t},e.requestOptions),{id:r}=o.data;return new uc(this.topia,r,a,{credentials:e.credentials})}catch(e){throw this.errorHandler({error:e})}}))}}class _c{constructor(e){this.topia=e}create(e,n){return new gc(this.topia,e,n)}}class Ec{constructor(e){this.topia=e}get(e,n,i){return f(this,void 0,void 0,(function*(){const t=new dc(this.topia,e,n,i);return yield t.fetchVisitor(),t}))}create(e,n,i){return new dc(this.topia,e,n,i)}}class kc{constructor(e){this.topia=e}create(e,n){return new xc(this.topia,e,n)}}Error.stackTraceLimit=20,process.on("unhandledRejection",(e=>{if(e.data){const{errors:n}=e.data;if(Array.isArray(n))for(const e of n)console.error(e)}console.error((null==e?void 0:e.stack)||"no stack"),delete e.stack,console.error(e),console.error("Please surround your use of the RTSDK with a try/catch block."),process.exit(1)})),process.on("uncaughtException",(function(e){console.trace(e),process.exit(1)}));export{yc as AssetFactory,wc as DroppedAssetFactory,bc as Topia,_c as UserFactory,Ec as VisitorFactory,kc as WorldFactory};
19
+ function(e){var n,i,t,o=vo.exports,r=a.extname,s=/^\s*([^;\s]*)(?:;|\s|$)/,c=/^text\//i;function p(e){if(!e||"string"!=typeof e)return!1;var n=s.exec(e),i=n&&o[n[1].toLowerCase()];return i&&i.charset?i.charset:!(!n||!c.test(n[1]))&&"UTF-8"}e.charset=p,e.charsets={lookup:p},e.contentType=function(n){if(!n||"string"!=typeof n)return!1;var i=-1===n.indexOf("/")?e.lookup(n):n;if(!i)return!1;if(-1===i.indexOf("charset")){var t=e.charset(i);t&&(i+="; charset="+t.toLowerCase())}return i},e.extension=function(n){if(!n||"string"!=typeof n)return!1;var i=s.exec(n),t=i&&e.extensions[i[1].toLowerCase()];if(!t||!t.length)return!1;return t[0]},e.extensions=Object.create(null),e.lookup=function(n){if(!n||"string"!=typeof n)return!1;var i=r("x."+n).toLowerCase().substr(1);if(!i)return!1;return e.types[i]||!1},e.types=Object.create(null),n=e.extensions,i=e.types,t=["nginx","apache",void 0,"iana"],Object.keys(o).forEach((function(e){var a=o[e],r=a.extensions;if(r&&r.length){n[e]=r;for(var s=0;s<r.length;s++){var c=r[s];if(i[c]){var p=t.indexOf(o[i[c]].source),l=t.indexOf(a.source);if("application/octet-stream"!==i[c]&&(p>l||p===l&&"application/"===i[c].substr(0,12)))continue}i[c]=e}}}))}(ho);var xo=function(e){var n="function"==typeof setImmediate?setImmediate:"object"==typeof process&&"function"==typeof process.nextTick?process.nextTick:null;n?n(e):setTimeout(e,0)},go=function(e){var n=!1;return xo((function(){n=!0})),function(i,t){n?e(i,t):xo((function(){e(i,t)}))}};var bo=function(e){Object.keys(e.jobs).forEach(yo.bind(e)),e.jobs={}};function yo(e){"function"==typeof this.jobs[e]&&this.jobs[e]()}var wo=go,_o=bo,Eo=function(e,n,i,t){var a=i.keyedList?i.keyedList[i.index]:i.index;i.jobs[a]=function(e,n,i,t){var a;a=2==e.length?e(i,wo(t)):e(i,n,wo(t));return a}(n,a,e[a],(function(e,n){a in i.jobs&&(delete i.jobs[a],e?_o(i):i.results[a]=n,t(e,i.results))}))};var ko=function(e,n){var i=!Array.isArray(e),t={index:0,keyedList:i||n?Object.keys(e):null,jobs:{},results:i?{}:[],size:i?Object.keys(e).length:e.length};n&&t.keyedList.sort(i?n:function(i,t){return n(e[i],e[t])});return t};var jo=bo,So=go,Ro=function(e){if(!Object.keys(this.jobs).length)return;this.index=this.size,jo(this),So(e)(null,this.results)};var Oo=Eo,Ao=ko,To=Ro,Co=function(e,n,i){var t=Ao(e);for(;t.index<(t.keyedList||e).length;)Oo(e,n,t,(function(e,n){e?i(e,n):0!==Object.keys(t.jobs).length||i(null,t.results)})),t.index++;return To.bind(t,i)};var Io={exports:{}},Lo=Eo,No=ko,$o=Ro;function Po(e,n){return e<n?-1:e>n?1:0}Io.exports=function(e,n,i,t){var a=No(e,i);return Lo(e,n,a,(function i(o,r){o?t(o,r):(a.index++,a.index<(a.keyedList||e).length?Lo(e,n,a,i):t(null,a.results))})),$o.bind(a,t)},Io.exports.ascending=Po,Io.exports.descending=function(e,n){return-1*Po(e,n)};var zo=Io.exports,Bo=function(e,n,i){return zo(e,n,null,i)};var Fo={parallel:Co,serial:Bo,serialOrdered:Io.exports},Do=mo,Uo=i,qo=a,Mo=o,Ho=r,Vo=s.parse,Ko=c,Go=n.Stream,Wo=ho,Xo=Fo,Jo=function(e,n){return Object.keys(n).forEach((function(i){e[i]=e[i]||n[i]})),e},Zo=Yo;function Yo(e){if(!(this instanceof Yo))return new Yo(e);for(var n in this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],Do.call(this),e=e||{})this[n]=e[n]}function Qo(e){return io.isPlainObject(e)||io.isArray(e)}function er(e){return io.endsWith(e,"[]")?e.slice(0,-2):e}function nr(e,n,i){return e?e.concat(n).map((function(e,n){return e=er(e),!i&&n?"["+e+"]":e})).join(i?".":""):n}Uo.inherits(Yo,Do),Yo.LINE_BREAK="\r\n",Yo.DEFAULT_CONTENT_TYPE="application/octet-stream",Yo.prototype.append=function(e,n,i){"string"==typeof(i=i||{})&&(i={filename:i});var t=Do.prototype.append.bind(this);if("number"==typeof n&&(n=""+n),Uo.isArray(n))this._error(new Error("Arrays are not supported."));else{var a=this._multiPartHeader(e,n,i),o=this._multiPartFooter();t(a),t(n),t(o),this._trackLength(a,n,i)}},Yo.prototype._trackLength=function(e,n,i){var t=0;null!=i.knownLength?t+=+i.knownLength:Buffer.isBuffer(n)?t=n.length:"string"==typeof n&&(t=Buffer.byteLength(n)),this._valueLength+=t,this._overheadLength+=Buffer.byteLength(e)+Yo.LINE_BREAK.length,n&&(n.path||n.readable&&n.hasOwnProperty("httpVersion")||n instanceof Go)&&(i.knownLength||this._valuesToMeasure.push(n))},Yo.prototype._lengthRetriever=function(e,n){e.hasOwnProperty("fd")?null!=e.end&&e.end!=1/0&&null!=e.start?n(null,e.end+1-(e.start?e.start:0)):Ko.stat(e.path,(function(i,t){var a;i?n(i):(a=t.size-(e.start?e.start:0),n(null,a))})):e.hasOwnProperty("httpVersion")?n(null,+e.headers["content-length"]):e.hasOwnProperty("httpModule")?(e.on("response",(function(i){e.pause(),n(null,+i.headers["content-length"])})),e.resume()):n("Unknown stream")},Yo.prototype._multiPartHeader=function(e,n,i){if("string"==typeof i.header)return i.header;var t,a=this._getContentDisposition(n,i),o=this._getContentType(n,i),r="",s={"Content-Disposition":["form-data",'name="'+e+'"'].concat(a||[]),"Content-Type":[].concat(o||[])};for(var c in"object"==typeof i.header&&Jo(s,i.header),s)s.hasOwnProperty(c)&&null!=(t=s[c])&&(Array.isArray(t)||(t=[t]),t.length&&(r+=c+": "+t.join("; ")+Yo.LINE_BREAK));return"--"+this.getBoundary()+Yo.LINE_BREAK+r+Yo.LINE_BREAK},Yo.prototype._getContentDisposition=function(e,n){var i,t;return"string"==typeof n.filepath?i=qo.normalize(n.filepath).replace(/\\/g,"/"):n.filename||e.name||e.path?i=qo.basename(n.filename||e.name||e.path):e.readable&&e.hasOwnProperty("httpVersion")&&(i=qo.basename(e.client._httpMessage.path||"")),i&&(t='filename="'+i+'"'),t},Yo.prototype._getContentType=function(e,n){var i=n.contentType;return!i&&e.name&&(i=Wo.lookup(e.name)),!i&&e.path&&(i=Wo.lookup(e.path)),!i&&e.readable&&e.hasOwnProperty("httpVersion")&&(i=e.headers["content-type"]),i||!n.filepath&&!n.filename||(i=Wo.lookup(n.filepath||n.filename)),i||"object"!=typeof e||(i=Yo.DEFAULT_CONTENT_TYPE),i},Yo.prototype._multiPartFooter=function(){return function(e){var n=Yo.LINE_BREAK;0===this._streams.length&&(n+=this._lastBoundary()),e(n)}.bind(this)},Yo.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+Yo.LINE_BREAK},Yo.prototype.getHeaders=function(e){var n,i={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(n in e)e.hasOwnProperty(n)&&(i[n.toLowerCase()]=e[n]);return i},Yo.prototype.setBoundary=function(e){this._boundary=e},Yo.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary},Yo.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),n=this.getBoundary(),i=0,t=this._streams.length;i<t;i++)"function"!=typeof this._streams[i]&&(e=Buffer.isBuffer(this._streams[i])?Buffer.concat([e,this._streams[i]]):Buffer.concat([e,Buffer.from(this._streams[i])]),"string"==typeof this._streams[i]&&this._streams[i].substring(2,n.length+2)===n||(e=Buffer.concat([e,Buffer.from(Yo.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])},Yo.prototype._generateBoundary=function(){for(var e="--------------------------",n=0;n<24;n++)e+=Math.floor(10*Math.random()).toString(16);this._boundary=e},Yo.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e},Yo.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e},Yo.prototype.getLength=function(e){var n=this._overheadLength+this._valueLength;this._streams.length&&(n+=this._lastBoundary().length),this._valuesToMeasure.length?Xo.parallel(this._valuesToMeasure,this._lengthRetriever,(function(i,t){i?e(i):(t.forEach((function(e){n+=e})),e(null,n))})):process.nextTick(e.bind(this,null,n))},Yo.prototype.submit=function(e,n){var i,t,a={method:"post"};return"string"==typeof e?(e=Vo(e),t=Jo({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},a)):(t=Jo(e,a)).port||(t.port="https:"==t.protocol?443:80),t.headers=this.getHeaders(e.headers),i="https:"==t.protocol?Ho.request(t):Mo.request(t),this.getLength(function(e,t){if(e&&"Unknown stream"!==e)this._error(e);else if(t&&i.setHeader("Content-Length",t),this.pipe(i),n){var a,o=function(e,t){return i.removeListener("error",o),i.removeListener("response",a),n.call(this,e,t)};a=o.bind(this,null),i.on("error",o),i.on("response",a)}}.bind(this)),i},Yo.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))},Yo.prototype.toString=function(){return"[object FormData]"};const ir=io.toFlatObject(io,{},null,(function(e){return/^is[A-Z]/.test(e)}));function tr(e,n,i){if(!io.isObject(e))throw new TypeError("target must be an object");n=n||new(Zo||FormData);const t=(i=io.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,n){return!io.isUndefined(n[e])}))).metaTokens,a=i.visitor||l,o=i.dots,r=i.indexes,s=(i.Blob||"undefined"!=typeof Blob&&Blob)&&((c=n)&&io.isFunction(c.append)&&"FormData"===c[Symbol.toStringTag]&&c[Symbol.iterator]);var c;if(!io.isFunction(a))throw new TypeError("visitor must be a function");function p(e){if(null===e)return"";if(io.isDate(e))return e.toISOString();if(!s&&io.isBlob(e))throw new to("Blob is not supported. Use a Buffer instead.");return io.isArrayBuffer(e)||io.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function l(e,i,a){let s=e;if(e&&!a&&"object"==typeof e)if(io.endsWith(i,"{}"))i=t?i:i.slice(0,-2),e=JSON.stringify(e);else if(io.isArray(e)&&function(e){return io.isArray(e)&&!e.some(Qo)}(e)||io.isFileList(e)||io.endsWith(i,"[]")&&(s=io.toArray(e)))return i=er(i),s.forEach((function(e,t){!io.isUndefined(e)&&null!==e&&n.append(!0===r?nr([i],t,o):null===r?i:i+"[]",p(e))})),!1;return!!Qo(e)||(n.append(nr(a,i,o),p(e)),!1)}const u=[],d=Object.assign(ir,{defaultVisitor:l,convertValue:p,isVisitable:Qo});if(!io.isObject(e))throw new TypeError("data must be an object");return function e(i,t){if(!io.isUndefined(i)){if(-1!==u.indexOf(i))throw Error("Circular reference detected in "+t.join("."));u.push(i),io.forEach(i,(function(i,o){!0===(!(io.isUndefined(i)||null===i)&&a.call(n,i,io.isString(o)?o.trim():o,t,d))&&e(i,t?t.concat(o):[o])})),u.pop()}}(e),n}function ar(e){const n={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return n[e]}))}function or(e,n){this._pairs=[],e&&tr(e,this,n)}const rr=or.prototype;function sr(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function cr(e,n,i){if(!n)return e;const t=i&&i.encode||sr,a=i&&i.serialize;let o;if(o=a?a(n,i):io.isURLSearchParams(n)?n.toString():new or(n,i).toString(t),o){const n=e.indexOf("#");-1!==n&&(e=e.slice(0,n)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}rr.append=function(e,n){this._pairs.push([e,n])},rr.toString=function(e){const n=e?function(n){return e.call(this,n,ar)}:ar;return this._pairs.map((function(e){return n(e[0])+"="+n(e[1])}),"").join("&")};class pr{constructor(){this.handlers=[]}use(e,n,i){return this.handlers.push({fulfilled:e,rejected:n,synchronous:!!i&&i.synchronous,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){io.forEach(this.handlers,(function(n){null!==n&&e(n)}))}}var lr={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ur={isNode:!0,classes:{URLSearchParams:s.URLSearchParams,FormData:Zo,Blob:"undefined"!=typeof Blob&&Blob||null},protocols:["http","https","file","data"]};function dr(e){function n(e,i,t,a){let o=e[a++];const r=Number.isFinite(+o),s=a>=e.length;if(o=!o&&io.isArray(t)?t.length:o,s)return io.hasOwnProp(t,o)?t[o]=[t[o],i]:t[o]=i,!r;t[o]&&io.isObject(t[o])||(t[o]=[]);return n(e,i,t[o],a)&&io.isArray(t[o])&&(t[o]=function(e){const n={},i=Object.keys(e);let t;const a=i.length;let o;for(t=0;t<a;t++)o=i[t],n[o]=e[o];return n}(t[o])),!r}if(io.isFormData(e)&&io.isFunction(e.entries)){const i={};return io.forEachEntry(e,((e,t)=>{n(function(e){return io.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),t,i,0)})),i}return null}function mr(e,n,i){const t=i.config.validateStatus;i.status&&t&&!t(i.status)?n(new to("Request failed with status code "+i.status,[to.ERR_BAD_REQUEST,to.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i)):e(i)}function fr(e,n){return e&&!function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}(n)?function(e,n){return n?e.replace(/\/+$/,"")+"/"+n.replace(/^\/+/,""):e}(e,n):n}var hr=s.parse,vr={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443},xr=String.prototype.endsWith||function(e){return e.length<=this.length&&-1!==this.indexOf(e,this.length-e.length)};function gr(e){return process.env[e.toLowerCase()]||process.env[e.toUpperCase()]||""}var br,yr,wr,_r,Er,kr=function(e){var n="string"==typeof e?hr(e):e||{},i=n.protocol,t=n.host,a=n.port;if("string"!=typeof t||!t||"string"!=typeof i)return"";if(i=i.split(":",1)[0],!function(e,n){var i=(gr("npm_config_no_proxy")||gr("no_proxy")).toLowerCase();if(!i)return!0;if("*"===i)return!1;return i.split(/[,\s]/).every((function(i){if(!i)return!0;var t=i.match(/^(.+):(\d+)$/),a=t?t[1]:i,o=t?parseInt(t[2]):0;return!(!o||o===n)||(/^[.*]/.test(a)?("*"===a.charAt(0)&&(a=a.slice(1)),!xr.call(e,a)):e!==a)}))}(t=t.replace(/:\d*$/,""),a=parseInt(a)||vr[i]||0))return"";var o=gr("npm_config_"+i+"_proxy")||gr(i+"_proxy")||gr("npm_config_proxy")||gr("all_proxy");return o&&-1===o.indexOf("://")&&(o=i+"://"+o),o},jr={exports:{}},Sr={exports:{}},Rr={exports:{}};function Or(){if(yr)return br;yr=1;var e=1e3,n=60*e,i=60*n,t=24*i,a=7*t,o=365.25*t;function r(e,n,i,t){var a=n>=1.5*i;return Math.round(e/i)+" "+t+(a?"s":"")}return br=function(s,c){c=c||{};var p=typeof s;if("string"===p&&s.length>0)return function(r){if((r=String(r)).length>100)return;var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(r);if(!s)return;var c=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*a;case"days":case"day":case"d":return c*t;case"hours":case"hour":case"hrs":case"hr":case"h":return c*i;case"minutes":case"minute":case"mins":case"min":case"m":return c*n;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(s);if("number"===p&&isFinite(s))return c.long?function(a){var o=Math.abs(a);if(o>=t)return r(a,o,t,"day");if(o>=i)return r(a,o,i,"hour");if(o>=n)return r(a,o,n,"minute");if(o>=e)return r(a,o,e,"second");return a+" ms"}(s):function(a){var o=Math.abs(a);if(o>=t)return Math.round(a/t)+"d";if(o>=i)return Math.round(a/i)+"h";if(o>=n)return Math.round(a/n)+"m";if(o>=e)return Math.round(a/e)+"s";return a+"ms"}(s);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(s))}}function Ar(){if(_r)return wr;return _r=1,wr=function(e){function n(e){let t,a,o,r=null;function s(...e){if(!s.enabled)return;const i=s,a=Number(new Date),o=a-(t||a);i.diff=o,i.prev=t,i.curr=a,t=a,e[0]=n.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let r=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((t,a)=>{if("%%"===t)return"%";r++;const o=n.formatters[a];if("function"==typeof o){const n=e[r];t=o.call(i,n),e.splice(r,1),r--}return t})),n.formatArgs.call(i,e);(i.log||n.log).apply(i,e)}return s.namespace=e,s.useColors=n.useColors(),s.color=n.selectColor(e),s.extend=i,s.destroy=n.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==r?r:(a!==n.namespaces&&(a=n.namespaces,o=n.enabled(e)),o),set:e=>{r=e}}),"function"==typeof n.init&&n.init(s),s}function i(e,i){const t=n(this.namespace+(void 0===i?":":i)+e);return t.log=this.log,t}function t(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return n.debug=n,n.default=n,n.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},n.disable=function(){const e=[...n.names.map(t),...n.skips.map(t).map((e=>"-"+e))].join(",");return n.enable(""),e},n.enable=function(e){let i;n.save(e),n.namespaces=e,n.names=[],n.skips=[];const t=("string"==typeof e?e:"").split(/[\s,]+/),a=t.length;for(i=0;i<a;i++)t[i]&&("-"===(e=t[i].replace(/\*/g,".*?"))[0]?n.skips.push(new RegExp("^"+e.slice(1)+"$")):n.names.push(new RegExp("^"+e+"$")))},n.enabled=function(e){if("*"===e[e.length-1])return!0;let i,t;for(i=0,t=n.skips.length;i<t;i++)if(n.skips[i].test(e))return!1;for(i=0,t=n.names.length;i<t;i++)if(n.names[i].test(e))return!0;return!1},n.humanize=Or(),n.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((i=>{n[i]=e[i]})),n.names=[],n.skips=[],n.formatters={},n.selectColor=function(e){let i=0;for(let n=0;n<e.length;n++)i=(i<<5)-i+e.charCodeAt(n),i|=0;return n.colors[Math.abs(i)%n.colors.length]},n.enable(n.load()),n},wr}var Tr,Cr,Ir,Lr,Nr,$r,Pr,zr={exports:{}};function Br(){return Cr?Tr:(Cr=1,Tr=(e,n=process.argv)=>{const i=e.startsWith("-")?"":1===e.length?"-":"--",t=n.indexOf(i+e),a=n.indexOf("--");return-1!==t&&(-1===a||t<a)})}function Fr(){return Nr||(Nr=1,function(e,n){const t=l,a=i;n.init=function(e){e.inspectOpts={};const i=Object.keys(n.inspectOpts);for(let t=0;t<i.length;t++)e.inspectOpts[i[t]]=n.inspectOpts[i[t]]},n.log=function(...e){return process.stderr.write(a.format(...e)+"\n")},n.formatArgs=function(i){const{namespace:t,useColors:a}=this;if(a){const n=this.color,a="[3"+(n<8?n:"8;5;"+n),o=` ${a};1m${t} `;i[0]=o+i[0].split("\n").join("\n"+o),i.push(a+"m+"+e.exports.humanize(this.diff)+"")}else i[0]=function(){if(n.inspectOpts.hideDate)return"";return(new Date).toISOString()+" "}()+t+" "+i[0]},n.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},n.load=function(){return process.env.DEBUG},n.useColors=function(){return"colors"in n.inspectOpts?Boolean(n.inspectOpts.colors):t.isatty(process.stderr.fd)},n.destroy=a.deprecate((()=>{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),n.colors=[6,2,3,4,5,1];try{const e=function(){if(Lr)return Ir;Lr=1;const e=u,n=l,i=Br(),{env:t}=process;let a;function o(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function r(n,o){if(0===a)return 0;if(i("color=16m")||i("color=full")||i("color=truecolor"))return 3;if(i("color=256"))return 2;if(n&&!o&&void 0===a)return 0;const r=a||0;if("dumb"===t.TERM)return r;if("win32"===process.platform){const n=e.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in t)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((e=>e in t))||"codeship"===t.CI_NAME?1:r;if("TEAMCITY_VERSION"in t)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(t.TEAMCITY_VERSION)?1:0;if("truecolor"===t.COLORTERM)return 3;if("TERM_PROGRAM"in t){const e=parseInt((t.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(t.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(t.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(t.TERM)||"COLORTERM"in t?1:r}return i("no-color")||i("no-colors")||i("color=false")||i("color=never")?a=0:(i("color")||i("colors")||i("color=true")||i("color=always"))&&(a=1),"FORCE_COLOR"in t&&(a="true"===t.FORCE_COLOR?1:"false"===t.FORCE_COLOR?0:0===t.FORCE_COLOR.length?1:Math.min(parseInt(t.FORCE_COLOR,10),3)),Ir={supportsColor:function(e){return o(r(e,e&&e.isTTY))},stdout:o(r(!0,n.isatty(1))),stderr:o(r(!0,n.isatty(2)))},Ir}();e&&(e.stderr||e).level>=2&&(n.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}n.inspectOpts=Object.keys(process.env).filter((e=>/^debug_/i.test(e))).reduce(((e,n)=>{const i=n.substring(6).toLowerCase().replace(/_([a-z])/g,((e,n)=>n.toUpperCase()));let t=process.env[n];return t=!!/^(yes|on|true|enabled)$/i.test(t)||!/^(no|off|false|disabled)$/i.test(t)&&("null"===t?null:Number(t)),e[i]=t,e}),{}),e.exports=Ar()(n);const{formatters:o}=e.exports;o.o=function(e){return this.inspectOpts.colors=this.useColors,a.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")},o.O=function(e){return this.inspectOpts.colors=this.useColors,a.inspect(e,this.inspectOpts)}}(zr,zr.exports)),zr.exports}function Dr(){return $r||($r=1,function(e){"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?e.exports=(Er||(Er=1,function(e,n){n.formatArgs=function(n){if(n[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+n[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const i="color: "+this.color;n.splice(1,0,i,"color: inherit");let t=0,a=0;n[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(t++,"%c"===e&&(a=t))})),n.splice(a,0,i)},n.save=function(e){try{e?n.storage.setItem("debug",e):n.storage.removeItem("debug")}catch(e){}},n.load=function(){let e;try{e=n.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},n.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},n.storage=function(){try{return localStorage}catch(e){}}(),n.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),n.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],n.log=console.debug||console.log||(()=>{}),e.exports=Ar()(n);const{formatters:i}=e.exports;i.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(Rr,Rr.exports)),Rr.exports):e.exports=Fr()}(Sr)),Sr.exports}var Ur=s,qr=Ur.URL,Mr=o,Hr=r,Vr=n.Writable,Kr=p,Gr=function(){if(!Pr){try{Pr=Dr()("follow-redirects")}catch(e){}"function"!=typeof Pr&&(Pr=function(){})}Pr.apply(null,arguments)},Wr=["abort","aborted","connect","error","socket","timeout"],Xr=Object.create(null);Wr.forEach((function(e){Xr[e]=function(n,i,t){this._redirectable.emit(e,n,i,t)}}));var Jr=rs("ERR_INVALID_URL","Invalid URL",TypeError),Zr=rs("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),Yr=rs("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded"),Qr=rs("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),es=rs("ERR_STREAM_WRITE_AFTER_END","write after end");function ns(e,n){Vr.call(this),this._sanitizeOptions(e),this._options=e,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],n&&this.on("response",n);var i=this;this._onNativeResponse=function(e){i._processResponse(e)},this._performRequest()}function is(e){var n={maxRedirects:21,maxBodyLength:10485760},i={};return Object.keys(e).forEach((function(t){var a=t+":",o=i[a]=e[t],r=n[t]=Object.create(o);Object.defineProperties(r,{request:{value:function(e,t,o){if(cs(e)){var r;try{r=as(new qr(e))}catch(n){r=Ur.parse(e)}if(!cs(r.protocol))throw new Jr({input:e});e=r}else qr&&e instanceof qr?e=as(e):(o=t,t=e,e={protocol:a});return ps(t)&&(o=t,t=null),(t=Object.assign({maxRedirects:n.maxRedirects,maxBodyLength:n.maxBodyLength},e,t)).nativeProtocols=i,cs(t.host)||cs(t.hostname)||(t.hostname="::1"),Kr.equal(t.protocol,a,"protocol mismatch"),Gr("options",t),new ns(t,o)},configurable:!0,enumerable:!0,writable:!0},get:{value:function(e,n,i){var t=r.request(e,n,i);return t.end(),t},configurable:!0,enumerable:!0,writable:!0}})})),n}function ts(){}function as(e){var n={protocol:e.protocol,hostname:e.hostname.startsWith("[")?e.hostname.slice(1,-1):e.hostname,hash:e.hash,search:e.search,pathname:e.pathname,path:e.pathname+e.search,href:e.href};return""!==e.port&&(n.port=Number(e.port)),n}function os(e,n){var i;for(var t in n)e.test(t)&&(i=n[t],delete n[t]);return null==i?void 0:String(i).trim()}function rs(e,n,i){function t(i){Error.captureStackTrace(this,this.constructor),Object.assign(this,i||{}),this.code=e,this.message=this.cause?n+": "+this.cause.message:n}return t.prototype=new(i||Error),t.prototype.constructor=t,t.prototype.name="Error ["+e+"]",t}function ss(e){for(var n of Wr)e.removeListener(n,Xr[n]);e.on("error",ts),e.abort()}function cs(e){return"string"==typeof e||e instanceof String}function ps(e){return"function"==typeof e}ns.prototype=Object.create(Vr.prototype),ns.prototype.abort=function(){ss(this._currentRequest),this.emit("abort")},ns.prototype.write=function(e,n,i){if(this._ending)throw new es;if(!cs(e)&&("object"!=typeof(t=e)||!("length"in t)))throw new TypeError("data should be a string, Buffer or Uint8Array");var t;ps(n)&&(i=n,n=null),0!==e.length?this._requestBodyLength+e.length<=this._options.maxBodyLength?(this._requestBodyLength+=e.length,this._requestBodyBuffers.push({data:e,encoding:n}),this._currentRequest.write(e,n,i)):(this.emit("error",new Qr),this.abort()):i&&i()},ns.prototype.end=function(e,n,i){if(ps(e)?(i=e,e=n=null):ps(n)&&(i=n,n=null),e){var t=this,a=this._currentRequest;this.write(e,n,(function(){t._ended=!0,a.end(null,null,i)})),this._ending=!0}else this._ended=this._ending=!0,this._currentRequest.end(null,null,i)},ns.prototype.setHeader=function(e,n){this._options.headers[e]=n,this._currentRequest.setHeader(e,n)},ns.prototype.removeHeader=function(e){delete this._options.headers[e],this._currentRequest.removeHeader(e)},ns.prototype.setTimeout=function(e,n){var i=this;function t(n){n.setTimeout(e),n.removeListener("timeout",n.destroy),n.addListener("timeout",n.destroy)}function a(n){i._timeout&&clearTimeout(i._timeout),i._timeout=setTimeout((function(){i.emit("timeout"),o()}),e),t(n)}function o(){i._timeout&&(clearTimeout(i._timeout),i._timeout=null),i.removeListener("abort",o),i.removeListener("error",o),i.removeListener("response",o),n&&i.removeListener("timeout",n),i.socket||i._currentRequest.removeListener("socket",a)}return n&&this.on("timeout",n),this.socket?a(this.socket):this._currentRequest.once("socket",a),this.on("socket",t),this.on("abort",o),this.on("error",o),this.on("response",o),this},["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach((function(e){ns.prototype[e]=function(n,i){return this._currentRequest[e](n,i)}})),["aborted","connection","socket"].forEach((function(e){Object.defineProperty(ns.prototype,e,{get:function(){return this._currentRequest[e]}})})),ns.prototype._sanitizeOptions=function(e){if(e.headers||(e.headers={}),e.host&&(e.hostname||(e.hostname=e.host),delete e.host),!e.pathname&&e.path){var n=e.path.indexOf("?");n<0?e.pathname=e.path:(e.pathname=e.path.substring(0,n),e.search=e.path.substring(n))}},ns.prototype._performRequest=function(){var e=this._options.protocol,n=this._options.nativeProtocols[e];if(n){if(this._options.agents){var i=e.slice(0,-1);this._options.agent=this._options.agents[i]}var t=this._currentRequest=n.request(this._options,this._onNativeResponse);for(var a of(t._redirectable=this,Wr))t.on(a,Xr[a]);if(this._currentUrl=/^\//.test(this._options.path)?Ur.format(this._options):this._options.path,this._isRedirect){var o=0,r=this,s=this._requestBodyBuffers;!function e(n){if(t===r._currentRequest)if(n)r.emit("error",n);else if(o<s.length){var i=s[o++];t.finished||t.write(i.data,i.encoding,e)}else r._ended&&t.end()}()}}else this.emit("error",new TypeError("Unsupported protocol "+e))},ns.prototype._processResponse=function(e){var n=e.statusCode;this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:e.headers,statusCode:n});var i=e.headers.location;if(!i||!1===this._options.followRedirects||n<300||n>=400)return e.responseUrl=this._currentUrl,e.redirects=this._redirects,this.emit("response",e),void(this._requestBodyBuffers=[]);if(ss(this._currentRequest),e.destroy(),++this._redirectCount>this._options.maxRedirects)this.emit("error",new Yr);else{var t,a=this._options.beforeRedirect;a&&(t=Object.assign({Host:e.req.getHeader("host")},this._options.headers));var o=this._options.method;((301===n||302===n)&&"POST"===this._options.method||303===n&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],os(/^content-/i,this._options.headers));var r,s=os(/^host$/i,this._options.headers),c=Ur.parse(this._currentUrl),p=s||c.host,l=/^\w+:/.test(i)?this._currentUrl:Ur.format(Object.assign(c,{host:p}));try{r=Ur.resolve(l,i)}catch(e){return void this.emit("error",new Zr({cause:e}))}Gr("redirecting to",r),this._isRedirect=!0;var u=Ur.parse(r);if(Object.assign(this._options,u),(u.protocol!==c.protocol&&"https:"!==u.protocol||u.host!==p&&!function(e,n){Kr(cs(e)&&cs(n));var i=e.length-n.length-1;return i>0&&"."===e[i]&&e.endsWith(n)}(u.host,p))&&os(/^(?:authorization|cookie)$/i,this._options.headers),ps(a)){var d={headers:e.headers,statusCode:n},m={url:l,method:o,headers:t};try{a(this._options,d,m)}catch(e){return void this.emit("error",e)}this._sanitizeOptions(this._options)}try{this._performRequest()}catch(e){this.emit("error",new Zr({cause:e}))}}},jr.exports=is({http:Mr,https:Hr}),jr.exports.wrap=is;const ls="1.1.3";function us(e,n,i){to.call(this,null==e?"canceled":e,to.ERR_CANCELED,n,i),this.name="CanceledError"}function ds(e){const n=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return n&&n[1]||""}io.inherits(us,to,{__CANCEL__:!0});const ms=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;const fs=io.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"]);const hs=Symbol("internals"),vs=Symbol("defaults");function xs(e){return e&&String(e).trim().toLowerCase()}function gs(e){return!1===e||null==e?e:io.isArray(e)?e.map(gs):String(e)}function bs(e,n,i,t){return io.isFunction(t)?t.call(this,n,i):io.isString(n)?io.isString(t)?-1!==n.indexOf(t):io.isRegExp(t)?t.test(n):void 0:void 0}function ys(e,n){n=n.toLowerCase();const i=Object.keys(e);let t,a=i.length;for(;a-- >0;)if(t=i[a],n===t.toLowerCase())return t;return null}function ws(e,n){e&&this.set(e),this[vs]=n||null}function _s(e,n){e=e||10;const i=new Array(e),t=new Array(e);let a,o=0,r=0;return n=void 0!==n?n:1e3,function(s){const c=Date.now(),p=t[r];a||(a=c),i[o]=s,t[o]=c;let l=r,u=0;for(;l!==o;)u+=i[l++],l%=e;if(o=(o+1)%e,o===r&&(r=(r+1)%e),c-a<n)return;const d=p&&c-p;return d?Math.round(1e3*u/d):void 0}}Object.assign(ws.prototype,{set:function(e,n,i){const t=this;function a(e,n,i){const a=xs(n);if(!a)throw new Error("header name must be a non-empty string");const o=ys(t,a);(!o||!0===i||!1!==t[o]&&!1!==i)&&(t[o||n]=gs(e))}return io.isPlainObject(e)?io.forEach(e,((e,i)=>{a(e,i,n)})):a(n,e,i),this},get:function(e,n){if(!(e=xs(e)))return;const i=ys(this,e);if(i){const e=this[i];if(!n)return e;if(!0===n)return function(e){const n=Object.create(null),i=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let t;for(;t=i.exec(e);)n[t[1]]=t[2];return n}(e);if(io.isFunction(n))return n.call(this,e,i);if(io.isRegExp(n))return n.exec(e);throw new TypeError("parser must be boolean|regexp|function")}},has:function(e,n){if(e=xs(e)){const i=ys(this,e);return!(!i||n&&!bs(0,this[i],i,n))}return!1},delete:function(e,n){const i=this;let t=!1;function a(e){if(e=xs(e)){const a=ys(i,e);!a||n&&!bs(0,i[a],a,n)||(delete i[a],t=!0)}}return io.isArray(e)?e.forEach(a):a(e),t},clear:function(){return Object.keys(this).forEach(this.delete.bind(this))},normalize:function(e){const n=this,i={};return io.forEach(this,((t,a)=>{const o=ys(i,a);if(o)return n[o]=gs(t),void delete n[a];const r=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,n,i)=>n.toUpperCase()+i))}(a):String(a).trim();r!==a&&delete n[a],n[r]=gs(t),i[r]=!0})),this},toJSON:function(e){const n=Object.create(null);return io.forEach(Object.assign({},this[vs]||null,this),((i,t)=>{null!=i&&!1!==i&&(n[t]=e&&io.isArray(i)?i.join(", "):i)})),n}}),Object.assign(ws,{from:function(e){return io.isString(e)?new this((e=>{const n={};let i,t,a;return e&&e.split("\n").forEach((function(e){a=e.indexOf(":"),i=e.substring(0,a).trim().toLowerCase(),t=e.substring(a+1).trim(),!i||n[i]&&fs[i]||("set-cookie"===i?n[i]?n[i].push(t):n[i]=[t]:n[i]=n[i]?n[i]+", "+t:t)})),n})(e)):e instanceof this?e:new this(e)},accessor:function(e){const n=(this[hs]=this[hs]={accessors:{}}).accessors,i=this.prototype;function t(e){const t=xs(e);n[t]||(!function(e,n){const i=io.toCamelCase(" "+n);["get","set","has"].forEach((t=>{Object.defineProperty(e,t+i,{value:function(e,i,a){return this[t].call(this,n,e,i,a)},configurable:!0})}))}(i,e),n[t]=!0)}return io.isArray(e)?e.forEach(t):t(e),this}}),ws.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent"]),io.freezeMethods(ws.prototype),io.freezeMethods(ws);const Es=Symbol("internals");class ks extends n.Transform{constructor(e){super({readableHighWaterMark:(e=io.toFlatObject(e,{maxRate:0,chunkSize:65536,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,((e,n)=>!io.isUndefined(n[e])))).chunkSize});const n=this,i=this[Es]={length:e.length,timeWindow:e.timeWindow,ticksRate:e.ticksRate,chunkSize:e.chunkSize,maxRate:e.maxRate,minChunkSize:e.minChunkSize,bytesSeen:0,isCaptured:!1,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null},t=_s(i.ticksRate*e.samplesCount,i.timeWindow);this.on("newListener",(e=>{"progress"===e&&(i.isCaptured||(i.isCaptured=!0))}));let a=0;i.updateProgress=function(e,n){let i=0;const t=1e3/n;let a=null;return function(n,o){const r=Date.now();if(n||r-i>t)return a&&(clearTimeout(a),a=null),i=r,e.apply(null,o);a||(a=setTimeout((()=>(a=null,i=Date.now(),e.apply(null,o))),t-(r-i)))}}((function(){const e=i.length,o=i.bytesSeen,r=o-a;if(!r||n.destroyed)return;const s=t(r);a=o,process.nextTick((()=>{n.emit("progress",{loaded:o,total:e,progress:e?o/e:void 0,bytes:r,rate:s||void 0,estimated:s&&e&&o<=e?(e-o)/s:void 0})}))}),i.ticksRate);const o=()=>{i.updateProgress(!0)};this.once("end",o),this.once("error",o)}_read(e){const n=this[Es];return n.onReadCallback&&n.onReadCallback(),super._read(e)}_transform(e,n,i){const t=this,a=this[Es],o=a.maxRate,r=this.readableHighWaterMark,s=a.timeWindow,c=o/(1e3/s),p=!1!==a.minChunkSize?Math.max(a.minChunkSize,.01*c):0;const l=(e,n)=>{const i=Buffer.byteLength(e);let l,u=null,d=r,m=0;if(o){const e=Date.now();(!a.ts||(m=e-a.ts)>=s)&&(a.ts=e,l=c-a.bytes,a.bytes=l<0?-l:0,m=0),l=c-a.bytes}if(o){if(l<=0)return setTimeout((()=>{n(null,e)}),s-m);l<d&&(d=l)}d&&i>d&&i-d>p&&(u=e.subarray(d),e=e.subarray(0,d)),function(e,n){const i=Buffer.byteLength(e);a.bytesSeen+=i,a.bytes+=i,a.isCaptured&&a.updateProgress(),t.push(e)?process.nextTick(n):a.onReadCallback=()=>{a.onReadCallback=null,process.nextTick(n)}}(e,u?()=>{process.nextTick(n,null,u)}:n)};l(e,(function e(n,t){if(n)return i(n);t?l(t,e):i(null)}))}setLength(e){return this[Es].length=+e,this}}const js=io.isFunction(d.createBrotliDecompress),{http:Ss,https:Rs}=jr.exports,Os=/https:?/,As=ur.protocols.map((e=>e+":"));function Ts(e){e.beforeRedirects.proxy&&e.beforeRedirects.proxy(e),e.beforeRedirects.config&&e.beforeRedirects.config(e)}function Cs(e,n,i){let t=n;if(!t&&!1!==t){const e=kr(i);e&&(t=new URL(e))}if(t){if(t.username&&(t.auth=(t.username||"")+":"+(t.password||"")),t.auth){(t.auth.username||t.auth.password)&&(t.auth=(t.auth.username||"")+":"+(t.auth.password||""));const n=Buffer.from(t.auth,"utf8").toString("base64");e.headers["Proxy-Authorization"]="Basic "+n}e.headers.host=e.hostname+(e.port?":"+e.port:"");const n=t.hostname||t.host;e.hostname=n,e.host=n,e.port=t.port,e.path=i,t.protocol&&(e.protocol=t.protocol.includes(":")?t.protocol:`${t.protocol}:`)}e.beforeRedirects.proxy=function(e){Cs(e,n,e.href)}}var Is=ur.isStandardBrowserEnv?{write:function(e,n,i,t,a,o){const r=[];r.push(e+"="+encodeURIComponent(n)),io.isNumber(i)&&r.push("expires="+new Date(i).toGMTString()),io.isString(t)&&r.push("path="+t),io.isString(a)&&r.push("domain="+a),!0===o&&r.push("secure"),document.cookie=r.join("; ")},read:function(e){const n=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},Ls=ur.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let i;function t(i){let t=i;return e&&(n.setAttribute("href",t),t=n.href),n.setAttribute("href",t),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return i=t(window.location.href),function(e){const n=io.isString(e)?t(e):e;return n.protocol===i.protocol&&n.host===i.host}}():function(){return!0};function Ns(e,n){let i=0;const t=_s(50,250);return a=>{const o=a.loaded,r=a.lengthComputable?a.total:void 0,s=o-i,c=t(s);i=o;const p={loaded:o,total:r,progress:r?o/r:void 0,bytes:s,rate:c||void 0,estimated:c&&r&&o<=r?(r-o)/c:void 0};p[n?"download":"upload"]=!0,e(p)}}const $s={http:function(e){return new Promise((function(i,t){let a=e.data;const s=e.responseType,c=e.responseEncoding,p=e.method.toUpperCase();let l,u,f,h=!1;const v=new m;function x(){l||(l=!0,e.cancelToken&&e.cancelToken.unsubscribe(w),e.signal&&e.signal.removeEventListener("abort",w),v.removeAllListeners())}function g(e,n){u||(u=!0,n&&(h=!0,x()),n?t(e):i(e))}const b=function(e){g(e)},y=function(e){g(e,!0)};function w(n){v.emit("abort",!n||n.type?new us(null,e,f):n)}v.once("abort",y),(e.cancelToken||e.signal)&&(e.cancelToken&&e.cancelToken.subscribe(w),e.signal&&(e.signal.aborted?w():e.signal.addEventListener("abort",w)));const _=fr(e.baseURL,e.url),E=new URL(_),k=E.protocol||As[0];if("data:"===k){let i;if("GET"!==p)return mr(b,y,{status:405,statusText:"method not allowed",headers:{},config:e});try{i=function(e,n,i){const t=i&&i.Blob||ur.classes.Blob,a=ds(e);if(void 0===n&&t&&(n=!0),"data"===a){e=a.length?e.slice(a.length+1):e;const i=ms.exec(e);if(!i)throw new to("Invalid URL",to.ERR_INVALID_URL);const o=i[1],r=i[2],s=i[3],c=Buffer.from(decodeURIComponent(s),r?"base64":"utf8");if(n){if(!t)throw new to("Blob is not supported",to.ERR_NOT_SUPPORT);return new t([c],{type:o})}return c}throw new to("Unsupported protocol "+a,to.ERR_NOT_SUPPORT)}(e.url,"blob"===s,{Blob:e.env&&e.env.Blob})}catch(n){throw to.from(n,to.ERR_BAD_REQUEST,e)}return"text"===s?(i=i.toString(c),c&&"utf8"!==c||(a=io.stripBOM(i))):"stream"===s&&(i=n.Readable.from(i)),mr(b,y,{data:i,status:200,statusText:"OK",headers:{},config:e})}if(-1===As.indexOf(k))return y(new to("Unsupported protocol "+k,to.ERR_BAD_REQUEST,e));const j=ws.from(e.headers).normalize();j.set("User-Agent","axios/"+ls,!1);const S=e.onDownloadProgress,R=e.onUploadProgress,O=e.maxRate;let A,T;if(io.isFormData(a)&&io.isFunction(a.getHeaders))j.set(a.getHeaders());else if(a&&!io.isStream(a)){if(Buffer.isBuffer(a));else if(io.isArrayBuffer(a))a=Buffer.from(new Uint8Array(a));else{if(!io.isString(a))return y(new to("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",to.ERR_BAD_REQUEST,e));a=Buffer.from(a,"utf-8")}if(j.set("Content-Length",a.length,!1),e.maxBodyLength>-1&&a.length>e.maxBodyLength)return y(new to("Request body larger than maxBodyLength limit",to.ERR_BAD_REQUEST,e))}const C=+j.getContentLength();let I,L;if(io.isArray(O)?(A=O[0],T=O[1]):A=T=O,a&&(R||A)&&(io.isStream(a)||(a=n.Readable.from(a,{objectMode:!1})),a=n.pipeline([a,new ks({length:io.toFiniteNumber(C),maxRate:io.toFiniteNumber(A)})],io.noop),R&&a.on("progress",(e=>{R(Object.assign(e,{upload:!0}))}))),e.auth){I=(e.auth.username||"")+":"+(e.auth.password||"")}if(!I&&E.username){I=E.username+":"+E.password}I&&j.delete("authorization");try{L=cr(E.pathname+E.search,e.params,e.paramsSerializer).replace(/^\?/,"")}catch(n){const i=new Error(n.message);return i.config=e,i.url=e.url,i.exists=!0,y(i)}j.set("Accept-Encoding","gzip, deflate, br",!1);const N={path:L,method:p,headers:j.toJSON(),agents:{http:e.httpAgent,https:e.httpsAgent},auth:I,protocol:k,beforeRedirect:Ts,beforeRedirects:{}};let $;e.socketPath?N.socketPath=e.socketPath:(N.hostname=E.hostname,N.port=E.port,Cs(N,e.proxy,k+"//"+E.hostname+(E.port?":"+E.port:"")+N.path));const P=Os.test(N.protocol);if(N.agent=P?e.httpsAgent:e.httpAgent,e.transport?$=e.transport:0===e.maxRedirects?$=P?r:o:(e.maxRedirects&&(N.maxRedirects=e.maxRedirects),e.beforeRedirect&&(N.beforeRedirects.config=e.beforeRedirect),$=P?Rs:Ss),e.maxBodyLength>-1?N.maxBodyLength=e.maxBodyLength:N.maxBodyLength=1/0,e.insecureHTTPParser&&(N.insecureHTTPParser=e.insecureHTTPParser),f=$.request(N,(function(i){if(f.destroyed)return;const t=[i];let o=i;const r=i.req||f;if(!1!==e.decompress)switch(a&&0===a.length&&i.headers["content-encoding"]&&delete i.headers["content-encoding"],i.headers["content-encoding"]){case"gzip":case"compress":case"deflate":t.push(d.createUnzip()),delete i.headers["content-encoding"];break;case"br":js&&(t.push(d.createBrotliDecompress()),delete i.headers["content-encoding"])}if(S){const e=+i.headers["content-length"],n=new ks({length:io.toFiniteNumber(e),maxRate:io.toFiniteNumber(T)});S&&n.on("progress",(e=>{S(Object.assign(e,{download:!0}))})),t.push(n)}o=t.length>1?n.pipeline(t,io.noop):t[0];const p=n.finished(o,(()=>{p(),x()})),l={status:i.statusCode,statusText:i.statusMessage,headers:new ws(i.headers),config:e,request:r};if("stream"===s)l.data=o,mr(b,y,l);else{const n=[];let i=0;o.on("data",(function(t){n.push(t),i+=t.length,e.maxContentLength>-1&&i>e.maxContentLength&&(h=!0,o.destroy(),y(new to("maxContentLength size of "+e.maxContentLength+" exceeded",to.ERR_BAD_RESPONSE,e,r)))})),o.on("aborted",(function(){if(h)return;const n=new to("maxContentLength size of "+e.maxContentLength+" exceeded",to.ERR_BAD_RESPONSE,e,r);o.destroy(n),y(n)})),o.on("error",(function(n){f.destroyed||y(to.from(n,null,e,r))})),o.on("end",(function(){try{let e=1===n.length?n[0]:Buffer.concat(n);"arraybuffer"!==s&&(e=e.toString(c),c&&"utf8"!==c||(e=io.stripBOM(e))),l.data=e}catch(n){y(to.from(n,null,e,l.request,l))}mr(b,y,l)}))}v.once("abort",(e=>{o.destroyed||(o.emit("error",e),o.destroy())}))})),v.once("abort",(e=>{y(e),f.destroy(e)})),f.on("error",(function(n){y(to.from(n,null,e,f))})),f.on("socket",(function(e){e.setKeepAlive(!0,6e4)})),e.timeout){const n=parseInt(e.timeout,10);if(isNaN(n))return void y(new to("error trying to parse `config.timeout` to int",to.ERR_BAD_OPTION_VALUE,e,f));f.setTimeout(n,(function(){if(u)return;let n=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const i=e.transitional||lr;e.timeoutErrorMessage&&(n=e.timeoutErrorMessage),y(new to(n,i.clarifyTimeoutError?to.ETIMEDOUT:to.ECONNABORTED,e,f)),w()}))}if(io.isStream(a)){let n=!1,i=!1;a.on("end",(()=>{n=!0})),a.once("error",(e=>{i=!0,f.destroy(e)})),a.on("close",(()=>{n||i||w(new us("Request stream has been aborted",e,f))})),a.pipe(f)}else f.end(a)}))},xhr:function(e){return new Promise((function(n,i){let t=e.data;const a=ws.from(e.headers).normalize(),o=e.responseType;let r;function s(){e.cancelToken&&e.cancelToken.unsubscribe(r),e.signal&&e.signal.removeEventListener("abort",r)}io.isFormData(t)&&ur.isStandardBrowserEnv&&a.setContentType(!1);let c=new XMLHttpRequest;if(e.auth){const n=e.auth.username||"",i=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";a.set("Authorization","Basic "+btoa(n+":"+i))}const p=fr(e.baseURL,e.url);function l(){if(!c)return;const t=ws.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders());mr((function(e){n(e),s()}),(function(e){i(e),s()}),{data:o&&"text"!==o&&"json"!==o?c.response:c.responseText,status:c.status,statusText:c.statusText,headers:t,config:e,request:c}),c=null}if(c.open(e.method.toUpperCase(),cr(p,e.params,e.paramsSerializer),!0),c.timeout=e.timeout,"onloadend"in c?c.onloadend=l:c.onreadystatechange=function(){c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(l)},c.onabort=function(){c&&(i(new to("Request aborted",to.ECONNABORTED,e,c)),c=null)},c.onerror=function(){i(new to("Network Error",to.ERR_NETWORK,e,c)),c=null},c.ontimeout=function(){let n=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const t=e.transitional||lr;e.timeoutErrorMessage&&(n=e.timeoutErrorMessage),i(new to(n,t.clarifyTimeoutError?to.ETIMEDOUT:to.ECONNABORTED,e,c)),c=null},ur.isStandardBrowserEnv){const n=(e.withCredentials||Ls(p))&&e.xsrfCookieName&&Is.read(e.xsrfCookieName);n&&a.set(e.xsrfHeaderName,n)}void 0===t&&a.setContentType(null),"setRequestHeader"in c&&io.forEach(a.toJSON(),(function(e,n){c.setRequestHeader(n,e)})),io.isUndefined(e.withCredentials)||(c.withCredentials=!!e.withCredentials),o&&"json"!==o&&(c.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&c.addEventListener("progress",Ns(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&c.upload&&c.upload.addEventListener("progress",Ns(e.onUploadProgress)),(e.cancelToken||e.signal)&&(r=n=>{c&&(i(!n||n.type?new us(null,e,c):n),c.abort(),c=null)},e.cancelToken&&e.cancelToken.subscribe(r),e.signal&&(e.signal.aborted?r():e.signal.addEventListener("abort",r)));const u=ds(p);u&&-1===ur.protocols.indexOf(u)?i(new to("Unsupported protocol "+u+":",to.ERR_BAD_REQUEST,e)):c.send(t||null)}))}};var Ps=e=>{if(io.isString(e)){const n=$s[e];if(!e)throw Error(io.hasOwnProp(e)?`Adapter '${e}' is not available in the build`:`Can not resolve adapter '${e}'`);return n}if(!io.isFunction(e))throw new TypeError("adapter is not a function");return e};const zs={"Content-Type":"application/x-www-form-urlencoded"};const Bs={transitional:lr,adapter:function(){let e;return"undefined"!=typeof XMLHttpRequest?e=Ps("xhr"):"undefined"!=typeof process&&"process"===io.kindOf(process)&&(e=Ps("http")),e}(),transformRequest:[function(e,n){const i=n.getContentType()||"",t=i.indexOf("application/json")>-1,a=io.isObject(e);a&&io.isHTMLForm(e)&&(e=new FormData(e));if(io.isFormData(e))return t&&t?JSON.stringify(dr(e)):e;if(io.isArrayBuffer(e)||io.isBuffer(e)||io.isStream(e)||io.isFile(e)||io.isBlob(e))return e;if(io.isArrayBufferView(e))return e.buffer;if(io.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(a){if(i.indexOf("application/x-www-form-urlencoded")>-1)return function(e,n){return tr(e,new ur.classes.URLSearchParams,Object.assign({visitor:function(e,n,i,t){return io.isBuffer(e)?(this.append(n,e.toString("base64")),!1):t.defaultVisitor.apply(this,arguments)}},n))}(e,this.formSerializer).toString();if((o=io.isFileList(e))||i.indexOf("multipart/form-data")>-1){const n=this.env&&this.env.FormData;return tr(o?{"files[]":e}:e,n&&new n,this.formSerializer)}}return a||t?(n.setContentType("application/json",!1),function(e,n,i){if(io.isString(e))try{return(n||JSON.parse)(e),io.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(i||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const n=this.transitional||Bs.transitional,i=n&&n.forcedJSONParsing,t="json"===this.responseType;if(e&&io.isString(e)&&(i&&!this.responseType||t)){const i=!(n&&n.silentJSONParsing)&&t;try{return JSON.parse(e)}catch(e){if(i){if("SyntaxError"===e.name)throw to.from(e,to.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ur.classes.FormData,Blob:ur.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};function Fs(e,n){const i=this||Bs,t=n||i,a=ws.from(t.headers);let o=t.data;return io.forEach(e,(function(e){o=e.call(i,o,a.normalize(),n?n.status:void 0)})),a.normalize(),o}function Ds(e){return!(!e||!e.__CANCEL__)}function Us(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new us}function qs(e){Us(e),e.headers=ws.from(e.headers),e.data=Fs.call(e,e.transformRequest);return(e.adapter||Bs.adapter)(e).then((function(n){return Us(e),n.data=Fs.call(e,e.transformResponse,n),n.headers=ws.from(n.headers),n}),(function(n){return Ds(n)||(Us(e),n&&n.response&&(n.response.data=Fs.call(e,e.transformResponse,n.response),n.response.headers=ws.from(n.response.headers))),Promise.reject(n)}))}function Ms(e,n){n=n||{};const i={};function t(e,n){return io.isPlainObject(e)&&io.isPlainObject(n)?io.merge(e,n):io.isPlainObject(n)?io.merge({},n):io.isArray(n)?n.slice():n}function a(i){return io.isUndefined(n[i])?io.isUndefined(e[i])?void 0:t(void 0,e[i]):t(e[i],n[i])}function o(e){if(!io.isUndefined(n[e]))return t(void 0,n[e])}function r(i){return io.isUndefined(n[i])?io.isUndefined(e[i])?void 0:t(void 0,e[i]):t(void 0,n[i])}function s(i){return i in n?t(e[i],n[i]):i in e?t(void 0,e[i]):void 0}const c={url:o,method:o,data:o,baseURL:r,transformRequest:r,transformResponse:r,paramsSerializer:r,timeout:r,timeoutMessage:r,withCredentials:r,adapter:r,responseType:r,xsrfCookieName:r,xsrfHeaderName:r,onUploadProgress:r,onDownloadProgress:r,decompress:r,maxContentLength:r,maxBodyLength:r,beforeRedirect:r,transport:r,httpAgent:r,httpsAgent:r,cancelToken:r,socketPath:r,responseEncoding:r,validateStatus:s};return io.forEach(Object.keys(e).concat(Object.keys(n)),(function(e){const n=c[e]||a,t=n(e);io.isUndefined(t)&&n!==s||(i[e]=t)})),i}io.forEach(["delete","get","head"],(function(e){Bs.headers[e]={}})),io.forEach(["post","put","patch"],(function(e){Bs.headers[e]=io.merge(zs)}));const Hs={};["object","boolean","number","function","string","symbol"].forEach(((e,n)=>{Hs[e]=function(i){return typeof i===e||"a"+(n<1?"n ":" ")+e}}));const Vs={};Hs.transitional=function(e,n,i){function t(e,n){return"[Axios v1.1.3] Transitional option '"+e+"'"+n+(i?". "+i:"")}return(i,a,o)=>{if(!1===e)throw new to(t(a," has been removed"+(n?" in "+n:"")),to.ERR_DEPRECATED);return n&&!Vs[a]&&(Vs[a]=!0,console.warn(t(a," has been deprecated since v"+n+" and will be removed in the near future"))),!e||e(i,a,o)}};var Ks={assertOptions:function(e,n,i){if("object"!=typeof e)throw new to("options must be an object",to.ERR_BAD_OPTION_VALUE);const t=Object.keys(e);let a=t.length;for(;a-- >0;){const o=t[a],r=n[o];if(r){const n=e[o],i=void 0===n||r(n,o,e);if(!0!==i)throw new to("option "+o+" must be "+i,to.ERR_BAD_OPTION_VALUE)}else if(!0!==i)throw new to("Unknown option "+o,to.ERR_BAD_OPTION)}},validators:Hs};const Gs=Ks.validators;let Ws=class{constructor(e){this.defaults=e,this.interceptors={request:new pr,response:new pr}}request(e,n){"string"==typeof e?(n=n||{}).url=e:n=e||{},n=Ms(this.defaults,n);const{transitional:i,paramsSerializer:t}=n;void 0!==i&&Ks.assertOptions(i,{silentJSONParsing:Gs.transitional(Gs.boolean),forcedJSONParsing:Gs.transitional(Gs.boolean),clarifyTimeoutError:Gs.transitional(Gs.boolean)},!1),void 0!==t&&Ks.assertOptions(t,{encode:Gs.function,serialize:Gs.function},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();const a=n.headers&&io.merge(n.headers.common,n.headers[n.method]);a&&io.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete n.headers[e]})),n.headers=new ws(n.headers,a);const o=[];let r=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(n)||(r=r&&e.synchronous,o.unshift(e.fulfilled,e.rejected))}));const s=[];let c;this.interceptors.response.forEach((function(e){s.push(e.fulfilled,e.rejected)}));let p,l=0;if(!r){const e=[qs.bind(this),void 0];for(e.unshift.apply(e,o),e.push.apply(e,s),p=e.length,c=Promise.resolve(n);l<p;)c=c.then(e[l++],e[l++]);return c}p=o.length;let u=n;for(l=0;l<p;){const e=o[l++],n=o[l++];try{u=e(u)}catch(e){n.call(this,e);break}}try{c=qs.call(this,u)}catch(e){return Promise.reject(e)}for(l=0,p=s.length;l<p;)c=c.then(s[l++],s[l++]);return c}getUri(e){return cr(fr((e=Ms(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}};io.forEach(["delete","get","head","options"],(function(e){Ws.prototype[e]=function(n,i){return this.request(Ms(i||{},{method:e,url:n,data:(i||{}).data}))}})),io.forEach(["post","put","patch"],(function(e){function n(n){return function(i,t,a){return this.request(Ms(a||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:t}))}}Ws.prototype[e]=n(),Ws.prototype[e+"Form"]=n(!0)}));let Xs=class{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let n;this.promise=new Promise((function(e){n=e}));const i=this;this.promise.then((e=>{if(!i._listeners)return;let n=i._listeners.length;for(;n-- >0;)i._listeners[n](e);i._listeners=null})),this.promise.then=e=>{let n;const t=new Promise((e=>{i.subscribe(e),n=e})).then(e);return t.cancel=function(){i.unsubscribe(n)},t},e((function(e,t,a){i.reason||(i.reason=new us(e,t,a),n(i.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);-1!==n&&this._listeners.splice(n,1)}static source(){let e;return{token:new Xs((function(n){e=n})),cancel:e}}};const Js=function e(n){const i=new Ws(n),t=Aa(Ws.prototype.request,i);return io.extend(t,Ws.prototype,i,{allOwnKeys:!0}),io.extend(t,i,null,{allOwnKeys:!0}),t.create=function(i){return e(Ms(n,i))},t}(Bs);Js.Axios=Ws,Js.CanceledError=us,Js.CancelToken=Xs,Js.isCancel=Ds,Js.VERSION=ls,Js.toFormData=tr,Js.AxiosError=to,Js.Cancel=Js.CanceledError,Js.all=function(e){return Promise.all(e)},Js.spread=function(e){return function(n){return e.apply(null,n)}},Js.isAxiosError=function(e){return io.isObject(e)&&!0===e.isAxiosError},Js.formToJSON=e=>dr(io.isHTMLForm(e)?new FormData(e):e);const{Axios:Zs,AxiosError:Ys,CanceledError:Qs,isCancel:ec,CancelToken:nc,VERSION:ic,all:tc,Cancel:ac,isAxiosError:oc,spread:rc,toFormData:sc}=Js;class cc{constructor(e,n={}){const{assetId:i,interactiveNonce:t,visitorId:a,apiKey:o}=n;this.topia=e,this.credentials=n,this.requestOptions={};let r={};const s={};a&&i&&t&&(r={interactiveNonce:t,visitorId:a,assetId:i},this.jwt=Oa.sign(r,e.interactiveSecret),s.Interactivejwt=this.jwt),o&&(s.Authorization=o),this.requestOptions={headers:s}}topiaPublicApi(){return this.stackTrace=new Error("Thrown here:"),this.topia.axios}errorHandler({error:e,message:n="Something went wrong. Please try again or contact support."}){var i,t,a,o;let r={},s=n,c=500,p="unknown",l="unknown",u="empty";return e instanceof Ys?(s=(null==e?void 0:e.message)||n,e.response&&(c=e.response.status,r=e.response.data),(null===(i=null==e?void 0:e.config)||void 0===i?void 0:i.url)&&(p=e.config.url),(null===(t=null==e?void 0:e.config)||void 0===t?void 0:t.method)&&(l=e.config.method),(null===(a=this.stackTrace)||void 0===a?void 0:a.stack)&&(u=`${e.stack}\n${this.stackTrace.stack}`)):e instanceof Error&&(s=(null==e?void 0:e.message)||n,(null===(o=this.stackTrace)||void 0===o?void 0:o.stack)&&(u=`${e.stack}\n${this.stackTrace.stack}`)),{success:!1,status:c,url:p,method:l,message:s,data:r,stack:u}}}class pc extends cc{constructor(e,n,i={attributes:{},credentials:{}}){super(e,i.credentials),this.id=n,Object.assign(this,i.attributes)}fetchPlatformAssets(){return f(this,void 0,void 0,(function*(){try{return(yield this.topiaPublicApi().get("/assets/topia-assets",this.requestOptions)).data}catch(e){throw this.errorHandler({error:e})}}))}}var lc;class uc extends pc{constructor(e,n,i,t={attributes:{text:""},credentials:{}}){var a;super(e,n,t),lc.set(this,((e,n)=>f(this,void 0,void 0,(function*(){try{yield this.topiaPublicApi().put(`/world/${this.urlSlug}/assets/${this.id}/${n}`,Object.assign({},e),this.requestOptions)}catch(e){throw this.errorHandler({error:e})}})))),this.id=n,this.text=null===(a=t.attributes)||void 0===a?void 0:a.text,this.urlSlug=i,Object.assign(this,t.attributes)}fetchDroppedAssetById(){return f(this,void 0,void 0,(function*(){try{const e=yield this.topiaPublicApi().get(`/world/${this.urlSlug}/assets/${this.id}`,this.requestOptions);Object.assign(this,e.data)}catch(e){throw this.errorHandler({error:e})}}))}deleteDroppedAsset(){return f(this,void 0,void 0,(function*(){try{yield this.topiaPublicApi().delete(`/world/${this.urlSlug}/assets/${this.id}`,this.requestOptions)}catch(e){throw this.errorHandler({error:e})}}))}fetchDroppedAssetDataObject(){return f(this,void 0,void 0,(function*(){try{const e=yield this.topiaPublicApi().get(`/world/${this.urlSlug}/assets/${this.id}/data-object`,this.requestOptions);this.dataObject=e.data}catch(e){throw this.errorHandler({error:e})}}))}setDroppedAssetDataObject(e,n={}){return f(this,void 0,void 0,(function*(){try{const{lock:i={}}=n;yield this.topiaPublicApi().put(`/world/${this.urlSlug}/assets/${this.id}/set-data-object`,{dataObject:e,lock:i},this.requestOptions),this.dataObject=e}catch(e){throw this.errorHandler({error:e})}}))}updateDroppedAssetDataObject(e,n={}){return f(this,void 0,void 0,(function*(){try{const{lock:i={}}=n;yield this.topiaPublicApi().put(`/world/${this.urlSlug}/assets/${this.id}/update-data-object`,{dataObject:e,lock:i},this.requestOptions),this.dataObject=e}catch(e){throw this.errorHandler({error:e})}}))}updateBroadcast({assetBroadcast:e,assetBroadcastAll:n,broadcasterEmail:i}){try{return h(this,lc,"f").call(this,{assetBroadcast:e,assetBroadcastAll:n,broadcasterEmail:i},"set-asset-broadcast")}catch(e){throw this.errorHandler({error:e})}}updateClickType({clickType:e,clickableLink:n,clickableLinkTitle:i,clickableDisplayTextDescription:t,clickableDisplayTextHeadline:a,portalName:o,position:r}){try{return h(this,lc,"f").call(this,{clickType:e,clickableLink:n,clickableLinkTitle:i,clickableDisplayTextDescription:t,clickableDisplayTextHeadline:a,portalName:o,position:r},"change-click-type")}catch(e){throw this.errorHandler({error:e})}}updateCustomTextAsset(e,n){try{return h(this,lc,"f").call(this,{style:e,text:n},"set-custom-text")}catch(e){throw this.errorHandler({error:e})}}updateMediaType({audioRadius:e,audioSliderVolume:n,isVideo:i,mediaLink:t,mediaName:a,mediaType:o,portalName:r,syncUserMedia:s}){try{return h(this,lc,"f").call(this,{audioRadius:e,audioSliderVolume:n,isVideo:i,mediaLink:t,mediaName:a,mediaType:o,portalName:r,syncUserMedia:s},"change-media-type")}catch(e){throw this.errorHandler({error:e})}}updateMuteZone(e){try{return h(this,lc,"f").call(this,{isMutezone:e},"set-mute-zone")}catch(e){throw this.errorHandler({error:e})}}updatePosition(e,n){try{return h(this,lc,"f").call(this,{x:e,y:n},"set-position")}catch(e){throw this.errorHandler({error:e})}}updatePrivateZone({isPrivateZone:e,isPrivateZoneChatDisabled:n,privateZoneUserCap:i}){try{return h(this,lc,"f").call(this,{isPrivateZone:e,isPrivateZoneChatDisabled:n,privateZoneUserCap:i},"set-private-zone")}catch(e){throw this.errorHandler({error:e})}}updateScale(e){try{return h(this,lc,"f").call(this,{assetScale:e},"change-scale")}catch(e){throw this.errorHandler({error:e})}}updateUploadedMediaSelected(e){try{return h(this,lc,"f").call(this,{mediaId:e},"change-uploaded-media-selected")}catch(e){throw this.errorHandler({error:e})}}updateWebImageLayers(e,n){try{return h(this,lc,"f").call(this,{bottom:e,top:n},"set-webimage-layers")}catch(e){throw this.errorHandler({error:e})}}addWebhook({dataObject:e,description:n,isUniqueOnly:i,title:t,type:a,url:o}){return f(this,void 0,void 0,(function*(){try{yield this.topiaPublicApi().post(`/world/${this.urlSlug}/webhooks`,{active:!0,assetId:this.id,dataObject:e,description:n,enteredBy:"",isUniqueOnly:i,title:t,type:a,url:o,urlSlug:this.urlSlug},this.requestOptions)}catch(e){throw this.errorHandler({error:e})}}))}setInteractiveSettings({isInteractive:e=!1,interactivePublicKey:n=""}){return f(this,void 0,void 0,(function*(){try{yield this.topiaPublicApi().put(`/world/${this.urlSlug}/assets/${this.id}/set-asset-interactive-settings`,{interactivePublicKey:n,isInteractive:e},this.requestOptions),this.isInteractive=e,this.interactivePublicKey=n}catch(e){throw this.errorHandler({error:e})}}))}}lc=new WeakMap;class dc extends cc{constructor(e,n,i,t={attributes:{},credentials:{}}){super(e,t.credentials),Object.assign(this,t.attributes),this.id=n,this.urlSlug=i}fetchVisitor(){return f(this,void 0,void 0,(function*(){try{const e=yield this.topiaPublicApi().get(`/world/${this.urlSlug}/visitors/${this.id}`,this.requestOptions);if(!e.data.success)throw"This visitor is not active";Object.assign(this,e.data).players[0]}catch(e){throw this.errorHandler({error:e})}}))}moveVisitor({shouldTeleportVisitor:e,x:n,y:i}){return f(this,void 0,void 0,(function*(){try{yield this.topiaPublicApi().put(`/world/${this.urlSlug}/visitors/${this.id}/move`,{moveTo:{x:n,y:i},teleport:e},this.requestOptions)}catch(e){throw this.errorHandler({error:e})}}))}}const mc=(e,n)=>{const i=e-n,t=e+n;return Math.floor(Math.random()*(t-i)+i)};var fc,hc,vc;class xc extends cc{constructor(e,n,i={attributes:{},credentials:{}}){super(e,i.credentials),fc.set(this,void 0),hc.set(this,void 0),Object.assign(this,i.attributes),v(this,fc,{},"f"),v(this,hc,{},"f"),this.urlSlug=n}get droppedAssets(){return h(this,fc,"f")}get visitors(){return h(this,hc,"f")}fetchDetails(){return f(this,void 0,void 0,(function*(){try{const e=yield this.topiaPublicApi().get(`/world/${this.urlSlug}/world-details`,this.requestOptions);Object.assign(this,e.data)}catch(e){throw this.errorHandler({error:e})}}))}updateDetails({controls:e,description:n,forceAuthOnLogin:i,height:t,name:a,spawnPosition:o,width:r}){return f(this,void 0,void 0,(function*(){const s={controls:e,description:n,forceAuthOnLogin:i,height:t,name:a,spawnPosition:o,width:r};try{yield this.topiaPublicApi().put(`/world/${this.urlSlug}/world-details`,s,this.requestOptions);const e=(c=s,Object.keys(c).forEach((e=>{void 0===c[e]&&delete c[e]})),c);Object.assign(this,e)}catch(e){throw this.errorHandler({error:e})}var c}))}fetchVisitors(){return f(this,void 0,void 0,(function*(){try{const e=yield this.topiaPublicApi().get(`/world/${this.urlSlug}/visitors`,this.requestOptions),n={};for(const i in e.data)n[i]=new dc(this.topia,e.data[i].playerId,this.urlSlug,{attributes:e.data[i]});v(this,hc,n,"f")}catch(e){throw this.errorHandler({error:e})}}))}currentVisitors(){return f(this,void 0,void 0,(function*(){try{return yield this.fetchVisitors(),this.visitors}catch(e){return e}}))}moveAllVisitors({shouldFetchVisitors:e=!0,shouldTeleportVisitors:n=!0,scatterVisitorsBy:i=0,x:t,y:a}){return f(this,void 0,void 0,(function*(){e&&(yield this.fetchVisitors());const o=[];if(!this.visitors)return;Object.keys(this.visitors).forEach((e=>o.push(h(this,hc,"f")[e].moveVisitor({shouldTeleportVisitor:n,x:mc(t,i),y:mc(a,i)}))));return yield Promise.all(o)}))}moveVisitors(e){return f(this,void 0,void 0,(function*(){const n=[];e.forEach((e=>{n.push(e.visitorObj.moveVisitor({shouldTeleportVisitor:e.shouldTeleportVisitor,x:e.x,y:e.y}))}));return yield Promise.all(n)}))}fetchDroppedAssets(){return f(this,void 0,void 0,(function*(){try{const e=yield this.topiaPublicApi().get(`/world/${this.urlSlug}/assets`,this.requestOptions),n={};for(const i in e.data)n[i]=new uc(this.topia,e.data[i].id,this.urlSlug,{attributes:e.data[i]});v(this,fc,n,"f")}catch(e){throw this.errorHandler({error:e})}}))}updateCustomTextDroppedAssets(e,n){return f(this,void 0,void 0,(function*(){const i=[];e.forEach((e=>{i.push(e.updateCustomTextAsset(n,e.text))}));return yield Promise.all(i)}))}replaceScene(e){return f(this,void 0,void 0,(function*(){try{yield this.topiaPublicApi().put(`/world/${this.urlSlug}/change-scene`,{sceneId:e},this.requestOptions)}catch(e){throw this.errorHandler({error:e})}}))}fetchDroppedAssetsWithUniqueName({uniqueName:e,isPartial:n=!1,isReversed:i=!1}){return f(this,void 0,void 0,(function*(){try{const t=yield this.topiaPublicApi().get(`/world/${this.urlSlug}/assets-with-unique-name/${e}?${n?`partial=${n}&`:""}${i?`reversed=${i}`:""}`,this.requestOptions),a=[];for(const e of t.data.assets)a.push(new uc(this.topia,e.id,this.urlSlug,{attributes:e}));return a}catch(e){throw this.errorHandler({error:e})}}))}}fc=new WeakMap,hc=new WeakMap;class gc extends cc{constructor(e,n,i={credentials:{}}){super(e,i.credentials),vc.set(this,void 0),v(this,vc,{},"f"),this.email=n}get worlds(){return h(this,vc,"f")}fetchAssetsByEmail(e){return f(this,void 0,void 0,(function*(){try{return(yield this.topiaPublicApi().get(`/assets/my-assets?email=${e}`,this.requestOptions)).data}catch(e){throw this.errorHandler({error:e})}}))}fetchScenesByEmail(){return f(this,void 0,void 0,(function*(){try{if(!this.email)throw this.errorHandler({error:new Error("There is no email associated with this user.")});return(yield this.topiaPublicApi().get(`/scenes/my-scenes?email=${this.email}`,this.requestOptions)).data}catch(e){throw this.errorHandler({error:e})}}))}fetchWorldsByKey(){return f(this,void 0,void 0,(function*(){try{const e=yield this.topiaPublicApi().get("/user/worlds",this.requestOptions),n={};for(const i in e.data){const t=e.data[i];n[t.urlSlug]=new xc(this.topia,t.urlSlug,{attributes:t})}v(this,vc,n,"f")}catch(e){throw this.errorHandler({error:e})}}))}}vc=new WeakMap;class bc{constructor({apiKey:e,apiDomain:n,interactiveKey:i,interactiveSecret:t}){"undefined"!=typeof window&&console.warn("Please use extreme caution when passing sensitive information such as API keys from a client side application."),this.apiKey=e,this.apiDomain=n||"api.topia.io",this.interactiveSecret=t;const a={ApplicationId:"sdk-js-topia","Content-Type":"application/json"};e&&(a.Authorization=e),i&&(a.Publickey=i),this.axios=Js.create({baseURL:`https://${this.apiDomain}/api`,headers:a})}}class yc{constructor(e){this.topia=e,this.create}create(e,n){return new pc(this.topia,e,n)}}class wc extends cc{constructor(e){super(e)}create(e,n,i){return new uc(this.topia,e,n,i)}get(e,n,i){return f(this,void 0,void 0,(function*(){const t=new uc(this.topia,e,n,i);return yield t.fetchDroppedAssetById(),t}))}drop(e,{position:{x:n,y:i},uniqueName:t,urlSlug:a}){return f(this,void 0,void 0,(function*(){try{const o=yield this.topiaPublicApi().post(`/world/${a}/assets`,{assetId:e.id,position:{x:n,y:i},uniqueName:t},e.requestOptions),{id:r}=o.data;return new uc(this.topia,r,a,{credentials:e.credentials})}catch(e){throw this.errorHandler({error:e})}}))}}class _c{constructor(e){this.topia=e}create(e,n){return new gc(this.topia,e,n)}}class Ec{constructor(e){this.topia=e}get(e,n,i){return f(this,void 0,void 0,(function*(){const t=new dc(this.topia,e,n,i);return yield t.fetchVisitor(),t}))}create(e,n,i){return new dc(this.topia,e,n,i)}}class kc{constructor(e){this.topia=e}create(e,n){return new xc(this.topia,e,n)}}Error.stackTraceLimit=20,process.on("unhandledRejection",(e=>{if(e.data){const{errors:n}=e.data;if(Array.isArray(n))for(const e of n)console.error(e)}console.error((null==e?void 0:e.stack)||"no stack"),delete e.stack,console.error(e),console.error("Please surround your use of the RTSDK with a try/catch block."),process.exit(1)})),process.on("uncaughtException",(function(e){console.trace(e),process.exit(1)}));export{yc as AssetFactory,wc as DroppedAssetFactory,bc as Topia,_c as UserFactory,Ec as VisitorFactory,kc as WorldFactory};
@@ -22,6 +22,7 @@ export class Topia {
22
22
  this.apiDomain = apiDomain || "api.topia.io";
23
23
  this.interactiveSecret = interactiveSecret;
24
24
  const headers = {
25
+ "ApplicationId": "sdk-js-topia",
25
26
  "Content-Type": "application/json",
26
27
  };
27
28
  if (apiKey)
package/package.json CHANGED
@@ -22,6 +22,7 @@
22
22
  "jsonwebtoken": "^9.0.0",
23
23
  "prettier": "^2.7.1",
24
24
  "rollup": "^3.4.0",
25
+ "rollup-plugin-license": "^3.0.1",
25
26
  "rollup-plugin-terser": "^7.0.2",
26
27
  "rollup-plugin-typescript2": "^0.34.1",
27
28
  "ts-jest": "^29.0.3",
@@ -34,7 +35,7 @@
34
35
  ],
35
36
  "gitHead": "7eef1f7fd9b3b0af395f95cb908add3011abf808",
36
37
  "homepage": "https://github.com/metaversecloud-com/mc-sdk-js/tree/main/clients/client-topia",
37
- "license": "ISC",
38
+ "license": "bsd-3-clause",
38
39
  "keywords": [],
39
40
  "name": "@rtsdk/topia",
40
41
  "main": "dist/index.js",
@@ -56,5 +57,5 @@
56
57
  "local-publish": "yarn build && yalc publish --push --no-scripts"
57
58
  },
58
59
  "type": "module",
59
- "version": "0.0.21"
60
+ "version": "0.0.22"
60
61
  }
@@ -1,22 +0,0 @@
1
- /**
2
- * Parses error object and returns message if available, otherwise returns generic error message.
3
- */
4
- import { AxiosError } from "axios";
5
- export const getErrorResponse = ({ error, message = "Something went wrong. Please try again or contact support.", }) => {
6
- var _a;
7
- let data = {}, errorMessage = message, status = 500, url = "unknown";
8
- if (error instanceof AxiosError) {
9
- errorMessage = (error === null || error === void 0 ? void 0 : error.message) || message;
10
- if (error.response) {
11
- status = error.response.status;
12
- data = error.response.data;
13
- }
14
- if ((_a = error === null || error === void 0 ? void 0 : error.config) === null || _a === void 0 ? void 0 : _a.url)
15
- url = error.config.url;
16
- }
17
- else if (error instanceof Error) {
18
- errorMessage = (error === null || error === void 0 ? void 0 : error.message) || message;
19
- }
20
- errorMessage = `${errorMessage}. Please surround your use of the RTSDK with a try/catch block.`;
21
- return { success: false, status, url, message: errorMessage, data };
22
- };