stream-chat
Version:
JS SDK for the Stream Chat API
1 lines • 284 kB
JavaScript
!function(e){"use strict";for(var t=function(e){for(var t,r=e.length,s=r%3,i=[],a=16383,c=0,u=r-s;c<u;c+=a)i.push(o(e,c,c+a>u?u:c+a));1===s?(t=e[r-1],i.push(n[t>>2]+n[t<<4&63]+"==")):2===s&&(t=(e[r-2]<<8)+e[r-1],i.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return i.join("")},n=[],r=[],s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,a=s.length;i<a;++i)n[i]=s[i],r[s.charCodeAt(i)]=i;function o(e,t,r){for(var s,i,a=[],o=t;o<r;o+=3)s=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]),a.push(n[(i=s)>>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return a.join("")}function c(e){return"string"==typeof e}function u(e,t){return!!t&&c(e)}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63;var l=function(e){return t(new Uint8Array(function(e,t){var n=[];if(c(e)&&u(e,t)){for(var r=0,s=e.length;r<s;r++)if(e.charAt(r)){var i=t(e.charAt(r),r,e);n[r]=i}}else if(!c(e)&&!u(e,t))for(var a=0,o=e.length;a<o;a++)if(a in e){var l=t(e[a],a,e);n[a]=l}return n}(e,(function(e){return e.charCodeAt(0)}))))},h=function(e){var t,n,r,s={},i=String.fromCharCode,a=e.length,o=0,c=0,u="";for(t=0;t<64;t++)s["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t)]=t;for(n=0;n<a;n++)for(o=(o<<6)+s[e.charAt(n)],c+=6;c>=8;)((r=o>>>(c-=8)&255)||n<a-2)&&(u+=i(r));return u};function d(e,t,n,r,s,i,a){try{var o=e[i](a),c=o.value}catch(e){return void n(e)}o.done?t(c):Promise.resolve(c).then(r,s)}function p(e){return function(){var t=this,n=arguments;return new Promise((function(r,s){var i=e.apply(t,n);function a(e){d(i,r,s,a,o,"next",e)}function o(e){d(i,r,s,a,o,"throw",e)}a(void 0)}))}}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function v(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function g(e,t,n){return t&&v(e.prototype,t),n&&v(e,n),e}function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var y="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var b,w,_=(b=function(e){var t=function(e){var t,n=Object.prototype,r=n.hasOwnProperty,s="function"==typeof Symbol?Symbol:{},i=s.iterator||"@@iterator",a=s.asyncIterator||"@@asyncIterator",o=s.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var s=t&&t.prototype instanceof g?t:g,i=Object.create(s.prototype),a=new U(r||[]);return i._invoke=function(e,t,n){var r=h;return function(s,i){if(r===p)throw new Error("Generator is already running");if(r===f){if("throw"===s)throw i;return A()}for(n.method=s,n.arg=i;;){var a=n.delegate;if(a){var o=S(a,n);if(o){if(o===v)continue;return o}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===h)throw r=f,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=p;var c=l(e,t,n);if("normal"===c.type){if(r=n.done?f:d,c.arg===v)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r=f,n.method="throw",n.arg=c.arg)}}}(e,n,a),i}function l(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var h="suspendedStart",d="suspendedYield",p="executing",f="completed",v={};function g(){}function m(){}function y(){}var b={};b[i]=function(){return this};var w=Object.getPrototypeOf,_=w&&w(w(E([])));_&&_!==n&&r.call(_,i)&&(b=_);var k=y.prototype=g.prototype=Object.create(b);function x(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(s,i,a,o){var c=l(e[s],e,i);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==typeof h&&r.call(h,"__await")?t.resolve(h.__await).then((function(e){n("next",e,a,o)}),(function(e){n("throw",e,a,o)})):t.resolve(h).then((function(e){u.value=e,a(u)}),(function(e){return n("throw",e,a,o)}))}o(c.arg)}var s;this._invoke=function(e,r){function i(){return new t((function(t,s){n(e,r,t,s)}))}return s=s?s.then(i,i):i()}}function S(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,S(e,n),"throw"===n.method))return v;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var s=l(r,e.iterator,n.arg);if("throw"===s.type)return n.method="throw",n.arg=s.arg,n.delegate=null,v;var i=s.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function U(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function E(e){if(e){var n=e[i];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var s=-1,a=function n(){for(;++s<e.length;)if(r.call(e,s))return n.value=e[s],n.done=!1,n;return n.value=t,n.done=!0,n};return a.next=a}}return{next:A}}function A(){return{value:t,done:!0}}return m.prototype=k.constructor=y,y.constructor=m,m.displayName=c(y,o,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,c(e,o,"GeneratorFunction")),e.prototype=Object.create(k),e},e.awrap=function(e){return{__await:e}},x(C.prototype),C.prototype[a]=function(){return this},e.AsyncIterator=C,e.async=function(t,n,r,s,i){void 0===i&&(i=Promise);var a=new C(u(t,n,r,s),i);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},x(k),c(k,o,"Generator"),k[i]=function(){return this},k.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=E,U.prototype={constructor:U,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(R),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function s(r,s){return o.type="throw",o.arg=e,n.next=r,s&&(n.method="next",n.arg=t),!!s}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],o=a.completion;if("root"===a.tryLoc)return s("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return s(a.catchLoc,!0);if(this.prev<a.finallyLoc)return s(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return s(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return s(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var s=this.tryEntries[n];if(s.tryLoc<=this.prev&&r.call(s,"finallyLoc")&&this.prev<s.finallyLoc){var i=s;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),R(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var s=r.arg;R(n)}return s}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:E(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}(e.exports);try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}},b(w={exports:{}},w.exports),w.exports),k=_,x=function(){function e(t,n,r){f(this,e),m(this,"id",void 0),m(this,"data",void 0),m(this,"client",void 0),this.client=t,this.id=n,this.data=r}var t,n,r,s,i,a;return g(e,[{key:"create",value:(a=p(k.mark((function e(){var t,n,r,s,i,a,o,c,u,l,h;return k.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l={id:this.id,message_template:null===(t=this.data)||void 0===t?void 0:t.message_template,segment_ids:null===(n=this.data)||void 0===n?void 0:n.segment_ids,sender_id:null===(r=this.data)||void 0===r?void 0:r.sender_id,sender_mode:null===(s=this.data)||void 0===s?void 0:s.sender_mode,channel_template:null===(i=this.data)||void 0===i?void 0:i.channel_template,create_channels:null===(a=this.data)||void 0===a?void 0:a.create_channels,description:null===(o=this.data)||void 0===o?void 0:o.description,name:null===(c=this.data)||void 0===c?void 0:c.name,user_ids:null===(u=this.data)||void 0===u?void 0:u.user_ids},e.next=3,this.client.createCampaign(l);case 3:return h=e.sent,this.id=h.campaign.id,this.data=h.campaign,e.abrupt("return",h);case 7:case"end":return e.stop()}}),e,this)}))),function(){return a.apply(this,arguments)})},{key:"verifyCampaignId",value:function(){if(!this.id)throw new Error("Campaign id is missing. Either create the campaign using campaign.create() or set the id during instantiation - const campaign = client.campaign(id)")}},{key:"start",value:(i=p(k.mark((function e(t){return k.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.verifyCampaignId(),e.next=3,this.client.startCampaign(this.id,t);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"update",value:(s=p(k.mark((function e(t){return k.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.verifyCampaignId(),e.abrupt("return",this.client.updateCampaign(this.id,t));case 2:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"delete",value:(r=p(k.mark((function e(){return k.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.verifyCampaignId(),e.next=3,this.client.deleteCampaign(this.id);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"stop",value:(n=p(k.mark((function e(){return k.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.verifyCampaignId(),e.abrupt("return",this.client.stopCampaign(this.id));case 2:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"get",value:(t=p(k.mark((function e(t){return k.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.verifyCampaignId(),e.abrupt("return",this.client.getCampaign(this.id,t));case 2:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})}]),e}();function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function S(e,t){if(e){if("string"==typeof e)return C(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?C(e,t):void 0}}function O(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,s,i=[],a=!0,o=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){o=!0,s=e}finally{try{a||null==n.return||n.return()}finally{if(o)throw s}}return i}}(e,t)||S(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function R(){return R=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},R.apply(this,arguments)}function U(e){return U="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},U(e)}function E(e,t){if(null==e)return{};var n,r,s=function(e,t){if(null==e)return{};var n,r,s={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(s[n]=e[n]);return s}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}function A(e){return function(e){if(Array.isArray(e))return C(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||S(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function P(e,t){return function(){return e.apply(t,arguments)}}const{toString:I}=Object.prototype,{getPrototypeOf:L}=Object,T=(D=Object.create(null),e=>{const t=I.call(e);return D[t]||(D[t]=t.slice(8,-1).toLowerCase())});var D;const M=e=>(e=e.toLowerCase(),t=>T(t)===e),j=e=>t=>typeof t===e,{isArray:F}=Array,N=j("undefined");const q=M("ArrayBuffer");const B=j("string"),V=j("function"),H=j("number"),W=e=>null!==e&&"object"==typeof e,z=e=>{if("object"!==T(e))return!1;const t=L(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},Q=M("Date"),J=M("File"),G=M("Blob"),K=M("FileList"),$=M("URLSearchParams");function X(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,s;if("object"!=typeof e&&(e=[e]),F(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{const s=n?Object.getOwnPropertyNames(e):Object.keys(e),i=s.length;let a;for(r=0;r<i;r++)a=s[r],t.call(null,e[a],a,e)}}function Y(e,t){t=t.toLowerCase();const n=Object.keys(e);let r,s=n.length;for(;s-- >0;)if(r=n[s],t===r.toLowerCase())return r;return null}const Z="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,ee=e=>!N(e)&&e!==Z;const te=(ne="undefined"!=typeof Uint8Array&&L(Uint8Array),e=>ne&&e instanceof ne);var ne;const re=M("HTMLFormElement"),se=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),ie=M("RegExp"),ae=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};X(n,((n,s)=>{let i;!1!==(i=t(n,s,e))&&(r[s]=i||n)})),Object.defineProperties(e,r)},oe="abcdefghijklmnopqrstuvwxyz",ce="0123456789",ue={DIGIT:ce,ALPHA:oe,ALPHA_DIGIT:oe+oe.toUpperCase()+ce};const le=M("AsyncFunction");var he={isArray:F,isArrayBuffer:q,isBuffer:function(e){return null!==e&&!N(e)&&null!==e.constructor&&!N(e.constructor)&&V(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||V(e.append)&&("formdata"===(t=T(e))||"object"===t&&V(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&q(e.buffer),t},isString:B,isNumber:H,isBoolean:e=>!0===e||!1===e,isObject:W,isPlainObject:z,isUndefined:N,isDate:Q,isFile:J,isBlob:G,isRegExp:ie,isFunction:V,isStream:e=>W(e)&&V(e.pipe),isURLSearchParams:$,isTypedArray:te,isFileList:K,forEach:X,merge:function e(){const{caseless:t}=ee(this)&&this||{},n={},r=(r,s)=>{const i=t&&Y(n,s)||s;z(n[i])&&z(r)?n[i]=e(n[i],r):z(r)?n[i]=e({},r):F(r)?n[i]=r.slice():n[i]=r};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&X(arguments[e],r);return n},extend:(e,t,n,{allOwnKeys:r}={})=>(X(t,((t,r)=>{n&&V(t)?e[r]=P(t,n):e[r]=t}),{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let s,i,a;const o={};if(t=t||{},null==e)return t;do{for(s=Object.getOwnPropertyNames(e),i=s.length;i-- >0;)a=s[i],r&&!r(a,e,t)||o[a]||(t[a]=e[a],o[a]=!0);e=!1!==n&&L(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:T,kindOfTest:M,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(F(e))return e;let t=e.length;if(!H(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:re,hasOwnProperty:se,hasOwnProp:se,reduceDescriptors:ae,freezeMethods:e=>{ae(e,((t,n)=>{if(V(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];V(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return F(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:Y,global:Z,isContextDefined:ee,ALPHABET:ue,generateString:(e=16,t=ue.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n},isSpecCompliantForm:function(e){return!!(e&&V(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(W(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const s=F(e)?[]:{};return X(e,((e,t)=>{const i=n(e,r+1);!N(i)&&(s[t]=i)})),t[r]=void 0,s}}return e};return n(e,0)},isAsyncFn:le,isThenable:e=>e&&(W(e)||V(e))&&V(e.then)&&V(e.catch)};function de(e,t,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s)}he.inherits(de,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:he.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const pe=de.prototype,fe={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{fe[e]={value:e}})),Object.defineProperties(de,fe),Object.defineProperty(pe,"isAxiosError",{value:!0}),de.from=(e,t,n,r,s,i)=>{const a=Object.create(pe);return he.toFlatObject(e,a,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),de.call(a,e.message,t,n,r,s),a.cause=e,a.name=e.name,i&&Object.assign(a,i),a};function ve(e){return he.isPlainObject(e)||he.isArray(e)}function ge(e){return he.endsWith(e,"[]")?e.slice(0,-2):e}function me(e,t,n){return e?e.concat(t).map((function(e,t){return e=ge(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const ye=he.toFlatObject(he,{},null,(function(e){return/^is[A-Z]/.test(e)}));function be(e,t,n){if(!he.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=he.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!he.isUndefined(t[e])}))).metaTokens,s=n.visitor||u,i=n.dots,a=n.indexes,o=(n.Blob||"undefined"!=typeof Blob&&Blob)&&he.isSpecCompliantForm(t);if(!he.isFunction(s))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(he.isDate(e))return e.toISOString();if(!o&&he.isBlob(e))throw new de("Blob is not supported. Use a Buffer instead.");return he.isArrayBuffer(e)||he.isTypedArray(e)?o&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function u(e,n,s){let o=e;if(e&&!s&&"object"==typeof e)if(he.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(he.isArray(e)&&function(e){return he.isArray(e)&&!e.some(ve)}(e)||(he.isFileList(e)||he.endsWith(n,"[]"))&&(o=he.toArray(e)))return n=ge(n),o.forEach((function(e,r){!he.isUndefined(e)&&null!==e&&t.append(!0===a?me([n],r,i):null===a?n:n+"[]",c(e))})),!1;return!!ve(e)||(t.append(me(s,n,i),c(e)),!1)}const l=[],h=Object.assign(ye,{defaultVisitor:u,convertValue:c,isVisitable:ve});if(!he.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!he.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),he.forEach(n,(function(n,i){!0===(!(he.isUndefined(n)||null===n)&&s.call(t,n,he.isString(i)?i.trim():i,r,h))&&e(n,r?r.concat(i):[i])})),l.pop()}}(e),t}function we(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function _e(e,t){this._pairs=[],e&&be(e,this,t)}const ke=_e.prototype;function xe(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Ce(e,t,n){if(!t)return e;const r=n&&n.encode||xe,s=n&&n.serialize;let i;if(i=s?s(t,n):he.isURLSearchParams(t)?t.toString():new _e(t,n).toString(r),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}ke.append=function(e,t){this._pairs.push([e,t])},ke.toString=function(e){const t=e?function(t){return e.call(this,t,we)}:we;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};class Se{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){he.forEach(this.handlers,(function(t){null!==t&&e(t)}))}}var Oe={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var Re={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:_e,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},isStandardBrowserEnv:(()=>{let e;return("undefined"==typeof navigator||"ReactNative"!==(e=navigator.product)&&"NativeScript"!==e&&"NS"!==e)&&("undefined"!=typeof window&&"undefined"!=typeof document)})(),isStandardBrowserWebWorkerEnv:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,protocols:["http","https","file","blob","url","data"]};function Ue(e){function t(e,n,r,s){let i=e[s++];const a=Number.isFinite(+i),o=s>=e.length;if(i=!i&&he.isArray(r)?r.length:i,o)return he.hasOwnProp(r,i)?r[i]=[r[i],n]:r[i]=n,!a;r[i]&&he.isObject(r[i])||(r[i]=[]);return t(e,n,r[i],s)&&he.isArray(r[i])&&(r[i]=function(e){const t={},n=Object.keys(e);let r;const s=n.length;let i;for(r=0;r<s;r++)i=n[r],t[i]=e[i];return t}(r[i])),!a}if(he.isFormData(e)&&he.isFunction(e.entries)){const n={};return he.forEachEntry(e,((e,r)=>{t(function(e){return he.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null}const Ee={transitional:Oe,adapter:["xhr","http"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,s=he.isObject(e);s&&he.isHTMLForm(e)&&(e=new FormData(e));if(he.isFormData(e))return r&&r?JSON.stringify(Ue(e)):e;if(he.isArrayBuffer(e)||he.isBuffer(e)||he.isStream(e)||he.isFile(e)||he.isBlob(e))return e;if(he.isArrayBufferView(e))return e.buffer;if(he.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(s){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return be(e,new Re.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((i=he.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return be(i?{"files[]":e}:e,t&&new t,this.formSerializer)}}return s||r?(t.setContentType("application/json",!1),function(e,t,n){if(he.isString(e))try{return(t||JSON.parse)(e),he.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||Ee.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(e&&he.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw de.from(e,de.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:Re.classes.FormData,Blob:Re.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};he.forEach(["delete","get","head","post","put","patch"],(e=>{Ee.headers[e]={}}));const Ae=he.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 Pe=Symbol("internals");function Ie(e){return e&&String(e).trim().toLowerCase()}function Le(e){return!1===e||null==e?e:he.isArray(e)?e.map(Le):String(e)}function Te(e,t,n,r,s){return he.isFunction(r)?r.call(this,t,n):(s&&(t=n),he.isString(t)?he.isString(r)?-1!==t.indexOf(r):he.isRegExp(r)?r.test(t):void 0:void 0)}class De{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function s(e,t,n){const s=Ie(t);if(!s)throw new Error("header name must be a non-empty string");const i=he.findKey(r,s);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||t]=Le(e))}const i=(e,t)=>he.forEach(e,((e,n)=>s(e,n,t)));return he.isPlainObject(e)||e instanceof this.constructor?i(e,t):he.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?i((e=>{const t={};let n,r,s;return e&&e.split("\n").forEach((function(e){s=e.indexOf(":"),n=e.substring(0,s).trim().toLowerCase(),r=e.substring(s+1).trim(),!n||t[n]&&Ae[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t):null!=e&&s(t,e,n),this}get(e,t){if(e=Ie(e)){const n=he.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(he.isFunction(t))return t.call(this,e,n);if(he.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Ie(e)){const n=he.findKey(this,e);return!(!n||void 0===this[n]||t&&!Te(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function s(e){if(e=Ie(e)){const s=he.findKey(n,e);!s||t&&!Te(0,n[s],s,t)||(delete n[s],r=!0)}}return he.isArray(e)?e.forEach(s):s(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const s=t[n];e&&!Te(0,this[s],s,e,!0)||(delete this[s],r=!0)}return r}normalize(e){const t=this,n={};return he.forEach(this,((r,s)=>{const i=he.findKey(n,s);if(i)return t[i]=Le(r),void delete t[s];const a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(s):String(s).trim();a!==s&&delete t[s],t[a]=Le(r),n[a]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return he.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&he.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[Pe]=this[Pe]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=Ie(e);t[r]||(!function(e,t){const n=he.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,s){return this[r].call(this,t,e,n,s)},configurable:!0})}))}(n,e),t[r]=!0)}return he.isArray(e)?e.forEach(r):r(e),this}}function Me(e,t){const n=this||Ee,r=t||n,s=De.from(r.headers);let i=r.data;return he.forEach(e,(function(e){i=e.call(n,i,s.normalize(),t?t.status:void 0)})),s.normalize(),i}function je(e){return!(!e||!e.__CANCEL__)}function Fe(e,t,n){de.call(this,null==e?"canceled":e,de.ERR_CANCELED,t,n),this.name="CanceledError"}De.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),he.reduceDescriptors(De.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),he.freezeMethods(De),he.inherits(Fe,de,{__CANCEL__:!0});var Ne=Re.isStandardBrowserEnv?{write:function(e,t,n,r,s,i){const a=[];a.push(e+"="+encodeURIComponent(t)),he.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),he.isString(r)&&a.push("path="+r),he.isString(s)&&a.push("domain="+s),!0===i&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};function qe(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}var Be=Re.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let n;function r(n){let r=n;return e&&(t.setAttribute("href",r),r=t.href),t.setAttribute("href",r),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return n=r(window.location.href),function(e){const t=he.isString(e)?r(e):e;return t.protocol===n.protocol&&t.host===n.host}}():function(){return!0};function Ve(e,t){let n=0;const r=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s,i=0,a=0;return t=void 0!==t?t:1e3,function(o){const c=Date.now(),u=r[a];s||(s=c),n[i]=o,r[i]=c;let l=a,h=0;for(;l!==i;)h+=n[l++],l%=e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),c-s<t)return;const d=u&&c-u;return d?Math.round(1e3*h/d):void 0}}(50,250);return s=>{const i=s.loaded,a=s.lengthComputable?s.total:void 0,o=i-n,c=r(o);n=i;const u={loaded:i,total:a,progress:a?i/a:void 0,bytes:o,rate:c||void 0,estimated:c&&a&&i<=a?(a-i)/c:void 0,event:s};u[t?"download":"upload"]=!0,e(u)}}const He={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){let r=e.data;const s=De.from(e.headers).normalize(),i=e.responseType;let a,o;function c(){e.cancelToken&&e.cancelToken.unsubscribe(a),e.signal&&e.signal.removeEventListener("abort",a)}he.isFormData(r)&&(Re.isStandardBrowserEnv||Re.isStandardBrowserWebWorkerEnv?s.setContentType(!1):s.getContentType(/^\s*multipart\/form-data/)?he.isString(o=s.getContentType())&&s.setContentType(o.replace(/^\s*(multipart\/form-data);+/,"$1")):s.setContentType("multipart/form-data"));let u=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",n=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";s.set("Authorization","Basic "+btoa(t+":"+n))}const l=qe(e.baseURL,e.url);function h(){if(!u)return;const r=De.from("getAllResponseHeaders"in u&&u.getAllResponseHeaders());!function(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new de("Request failed with status code "+n.status,[de.ERR_BAD_REQUEST,de.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}((function(e){t(e),c()}),(function(e){n(e),c()}),{data:i&&"text"!==i&&"json"!==i?u.response:u.responseText,status:u.status,statusText:u.statusText,headers:r,config:e,request:u}),u=null}if(u.open(e.method.toUpperCase(),Ce(l,e.params,e.paramsSerializer),!0),u.timeout=e.timeout,"onloadend"in u?u.onloadend=h:u.onreadystatechange=function(){u&&4===u.readyState&&(0!==u.status||u.responseURL&&0===u.responseURL.indexOf("file:"))&&setTimeout(h)},u.onabort=function(){u&&(n(new de("Request aborted",de.ECONNABORTED,e,u)),u=null)},u.onerror=function(){n(new de("Network Error",de.ERR_NETWORK,e,u)),u=null},u.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const r=e.transitional||Oe;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(new de(t,r.clarifyTimeoutError?de.ETIMEDOUT:de.ECONNABORTED,e,u)),u=null},Re.isStandardBrowserEnv){const t=Be(l)&&e.xsrfCookieName&&Ne.read(e.xsrfCookieName);t&&s.set(e.xsrfHeaderName,t)}void 0===r&&s.setContentType(null),"setRequestHeader"in u&&he.forEach(s.toJSON(),(function(e,t){u.setRequestHeader(t,e)})),he.isUndefined(e.withCredentials)||(u.withCredentials=!!e.withCredentials),i&&"json"!==i&&(u.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&u.addEventListener("progress",Ve(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&u.upload&&u.upload.addEventListener("progress",Ve(e.onUploadProgress)),(e.cancelToken||e.signal)&&(a=t=>{u&&(n(!t||t.type?new Fe(null,e,u):t),u.abort(),u=null)},e.cancelToken&&e.cancelToken.subscribe(a),e.signal&&(e.signal.aborted?a():e.signal.addEventListener("abort",a)));const d=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(l);d&&-1===Re.protocols.indexOf(d)?n(new de("Unsupported protocol "+d+":",de.ERR_BAD_REQUEST,e)):u.send(r||null)}))}};he.forEach(He,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const We=e=>`- ${e}`,ze=e=>he.isFunction(e)||null===e||!1===e;var Qe=e=>{e=he.isArray(e)?e:[e];const{length:t}=e;let n,r;const s={};for(let i=0;i<t;i++){let t;if(n=e[i],r=n,!ze(n)&&(r=He[(t=String(n)).toLowerCase()],void 0===r))throw new de(`Unknown adapter '${t}'`);if(r)break;s[t||"#"+i]=r}if(!r){const e=Object.entries(s).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));throw new de("There is no suitable adapter to dispatch the request "+(t?e.length>1?"since :\n"+e.map(We).join("\n"):" "+We(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return r};function Je(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Fe(null,e)}function Ge(e){Je(e),e.headers=De.from(e.headers),e.data=Me.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Qe(e.adapter||Ee.adapter)(e).then((function(t){return Je(e),t.data=Me.call(e,e.transformResponse,t),t.headers=De.from(t.headers),t}),(function(t){return je(t)||(Je(e),t&&t.response&&(t.response.data=Me.call(e,e.transformResponse,t.response),t.response.headers=De.from(t.response.headers))),Promise.reject(t)}))}const Ke=e=>e instanceof De?e.toJSON():e;function $e(e,t){t=t||{};const n={};function r(e,t,n){return he.isPlainObject(e)&&he.isPlainObject(t)?he.merge.call({caseless:n},e,t):he.isPlainObject(t)?he.merge({},t):he.isArray(t)?t.slice():t}function s(e,t,n){return he.isUndefined(t)?he.isUndefined(e)?void 0:r(void 0,e,n):r(e,t,n)}function i(e,t){if(!he.isUndefined(t))return r(void 0,t)}function a(e,t){return he.isUndefined(t)?he.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function o(n,s,i){return i in t?r(n,s):i in e?r(void 0,n):void 0}const c={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:o,headers:(e,t)=>s(Ke(e),Ke(t),!0)};return he.forEach(Object.keys(Object.assign({},e,t)),(function(r){const i=c[r]||s,a=i(e[r],t[r],r);he.isUndefined(a)&&i!==o||(n[r]=a)})),n}const Xe="1.6.0",Ye={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Ye[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const Ze={};Ye.transitional=function(e,t,n){function r(e,t){return"[Axios v1.6.0] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,s,i)=>{if(!1===e)throw new de(r(s," has been removed"+(t?" in "+t:"")),de.ERR_DEPRECATED);return t&&!Ze[s]&&(Ze[s]=!0,console.warn(r(s," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,s,i)}};var et={assertOptions:function(e,t,n){if("object"!=typeof e)throw new de("options must be an object",de.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const i=r[s],a=t[i];if(a){const t=e[i],n=void 0===t||a(t,i,e);if(!0!==n)throw new de("option "+i+" must be "+n,de.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new de("Unknown option "+i,de.ERR_BAD_OPTION)}},validators:Ye};const tt=et.validators;class nt{constructor(e){this.defaults=e,this.interceptors={request:new Se,response:new Se}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=$e(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:s}=t;void 0!==n&&et.assertOptions(n,{silentJSONParsing:tt.transitional(tt.boolean),forcedJSONParsing:tt.transitional(tt.boolean),clarifyTimeoutError:tt.transitional(tt.boolean)},!1),null!=r&&(he.isFunction(r)?t.paramsSerializer={serialize:r}:et.assertOptions(r,{encode:tt.function,serialize:tt.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=s&&he.merge(s.common,s[t.method]);s&&he.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete s[e]})),t.headers=De.concat(i,s);const a=[];let o=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(o=o&&e.synchronous,a.unshift(e.fulfilled,e.rejected))}));const c=[];let u;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let l,h=0;if(!o){const e=[Ge.bind(this),void 0];for(e.unshift.apply(e,a),e.push.apply(e,c),l=e.length,u=Promise.resolve(t);h<l;)u=u.then(e[h++],e[h++]);return u}l=a.length;let d=t;for(h=0;h<l;){const e=a[h++],t=a[h++];try{d=e(d)}catch(e){t.call(this,e);break}}try{u=Ge.call(this,d)}catch(e){return Promise.reject(e)}for(h=0,l=c.length;h<l;)u=u.then(c[h++],c[h++]);return u}getUri(e){return Ce(qe((e=$e(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}he.forEach(["delete","get","head","options"],(function(e){nt.prototype[e]=function(t,n){return this.request($e(n||{},{method:e,url:t,data:(n||{}).data}))}})),he.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,s){return this.request($e(s||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}nt.prototype[e]=t(),nt.prototype[e+"Form"]=t(!0)}));class rt{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,s){n.reason||(n.reason=new Fe(e,r,s),t(n.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 t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;return{token:new rt((function(t){e=t})),cancel:e}}}const st={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(st).forEach((([e,t])=>{st[t]=e}));const it=function e(t){const n=new nt(t),r=P(nt.prototype.request,n);return he.extend(r,nt.prototype,n,{allOwnKeys:!0}),he.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e($e(t,n))},r}(Ee);it.Axios=nt,it.CanceledError=Fe,it.CancelToken=rt,it.isCancel=je,it.VERSION=Xe,it.toFormData=be,it.AxiosError=de,it.Cancel=it.CanceledError,it.all=function(e){return Promise.all(e)},it.spread=function(e){return function(t){return e.apply(null,t)}},it.isAxiosError=function(e){return he.isObject(e)&&!0===e.isAxiosError},it.mergeConfig=$e,it.AxiosHeaders=De,it.formToJSON=e=>Ue(he.isHTMLForm(e)?new FormData(e):e),it.getAdapter=Qe,it.HttpStatusCode=st,it.default=it;var at="object"==typeof self?self.FormData:window.FormData;function ot(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ct(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ot(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ot(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ut(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return lt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return lt(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,s=function(){};return{s:s,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){throw e})),f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,o=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){o=!0,i=e})),f:function(){try{a||null==n.return||n.return()}finally{if(o)throw i}}}}function lt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ht(e,t){e.then().catch((function(e){console.warn("failed to do ".concat(t,", ran into error: "),e)}))}var dt=function(e){return new Promise((function(t){return setTimeout(t,e)}))};function pt(e){return e&&("[object Function]"===Object.prototype.toString.call(e)||"function"==typeof e||e instanceof Function)}var ft={TOKEN_EXPIRED:40,WS_CLOSED_SUCCESS:1e3};function vt(e,t,n){var r,s=new at;return null!==(r=e)&&"object"===U(r)&&(r.readable||"function"==typeof r._read)||function(e){return null!=e&&null!=e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}(e)||function(e){return"undefined"!=typeof window&&"File"in window&&e instanceof File}(e)||function(e){return"undefined"!=typeof window&&"Blob"in window&&e instanceof Blob}(e)?t?s.append("file",e,t):s.append("file",e):s.append("file",{uri:e,name:t||e.split("/").reverse()[0],contentType:n||void 0,type:n||void 0}),s}function gt(e){var t,n=[],r=ut(Array.isArray(e)?e:[e]);try{for(r.s();!(t=r.n()).done;){var s=t.value,i=Object.entries(s);i.length>1&&console.warn("client._buildSort() - multiple fields in a single sort object detected. Object's field order is not guaranteed");for(var a=0,o=i;a<o.length;a++){var c=O(o[a],2),u=c[0],l=c[1];n.push({field:u,direction:l})}}}catch(e){r.e(e)}finally{r.f()}return n}function mt(e){var t=Math.min(500+2e3*e,25e3),n=Math.min(Math.max(250,2e3*(e-1)),25e3);return Math.floor(Math.random()*(t-n)+n)}function yt(){return(e=function(e){var t=new Uint8Array(e);return kt(t),t}(16))[6]=15&e[6]|64,e[8]=191&e[8]|128,bt(e.subarray(0,4))+"-"+bt(e.subarray(4,6))+"-"+bt(e.subarray(6,8))+"-"+bt(e.subarray(8,10))+"-"+bt(e.subarray(10,16));var e}function bt(e){for(var t="",n=0;n<e.length;n++)t+=e[n].toString(16).padStart(2,"0");return t}function wt(e){for(var t=Math.pow(2,8*e.byteLength/e.length),n=0;n<e.length;n++)e[n]=Math.random()*t}var _t,kt="undefined"!=typeof crypto&&void 0!==(null===(_t=crypto)||void 0===_t?void 0:_t.getRandomValues)?crypto.getRandomValues.bind(crypto):"undefined"!=typeof msCrypto?msCrypto.getRandomValues.bind(msCrypto):wt;function xt(e){var t={};if(!e)return t;try{Object.getOwnPropertyNames(e).forEach((function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)}))}catch(e){return{error:"failed to serialize the error"}}return t}function Ct(e){"undefined"!=typeof window&&window.addEventListener&&(window.addEventListener("offline",e),window.addEventListener("online",e))}function St(e){"undefined"!=typeof window&&window.removeEventListener&&(window.removeEventListener("offline",e),window.removeEventListener("online",e))}var Ot=function(e){var t=[];for(var n in e)void 0!==e[n]&&(Array.isArray(e[n])||"object"===U(e[n])?t.push("".concat(n,"=").concat(encodeURIComponent(JSON.stringify(e[n])))):t.push("".concat(n,"=").concat(encodeURIComponent(e[n]))));return t.join("&")};function Rt(e){return ct(ct({},e),{},{__html:e.html,pinned_at:e.pinned_at?new Date(e.pinned_at):null,created_at:e.created_at?new Date(e.created_at):new Date,updated_at:e.updated_at?new Date(e.updated_at):new Date,deleted_at:e.deleted_at?new Date(e.deleted_at):null,status:e.status||"received",reaction_groups:At(e.reaction_groups,e.reaction_counts,e.reaction_scores)})}var Ut=function(e){var t=e.needle,n=e.sortedArray,r=e.selectKey,s=e.selectValueToCompare,i=void 0===s?function(e){return e}:s,a=e.sortDirection,o=void 0===a?"ascending":a;if(!n.length)return 0;for(var c=0,u=n.length-1,l=0,h=i(t);c<=u;){var d=i(n[l=Math.round((c+u)/2)]);"ascending"===o&&h<d||"descending"===o&&h>=d?u=l-1:c=l+1}if(r)for(var p=r(t),f="ascending"===o?-1:1,v=c+f;0<=v&&v<n.length&&i(n[v])===h;v+=f)if(r(n[v])===p)return v;return c};function Et(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"created_at",s=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],i=s||n,a=A(e);if(n&&(a=a.filter((function(e){return!(e.id&&t.id===e.id)}))),0===a.length&&i)return a.concat(t);if(0===a.length)return a;var o=t[r].getTime(),c=a.at(-1)[r].getTime()<o;if(c&&i)return a.concat(t);if(c)return a;var u=Ut({needle:t,sortedArray:a,sortDirection:"ascending",selectValueToCompare:function(e){return e[r].getTime()},selectKey:function(e){return e.id}});return!n&&t.id&&a[u]&&t.id===a[u].id?(a[u]=t,a):(i&&a.splice(u,0,t),a)}function At(e,t,n){if(e)return e;if(t&&n){for(var r={},s=0,i=Object.keys(t);s<i.length;s++){var a=i[s];r[a]={count:t[a],sum_scores:n[a]}}return r}return null}var Pt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:200,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.leading,s=void 0===r||r,i=n.trailing,a=void 0!==i&&i,o=null,c=null;return function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];if(o)a&&(c=r);else{s&&e.apply(void 0,r);var u=function n(){if(c)return e.apply(void 0,A(c)),c=null,void(o=setTimeout(n,t));o=null};o=setTimeout(u,t)}}},It=function(e,t){if(!Array.isArray(e))return[];var n=new Set;return e.filter((function(e){var r,s="function"==typeof t?t(e):(r=e,t.split(".").reduce((function(e,t){if(e&&"object"===U(e)&&t in e)return e[t]}),r));return!n.has(s)&&(n.add(s),!0)}))};var Lt=function(e){var t,n,r,s,i=e.parentSet,a=e.requestedPageSize,o=e.returnedPage,c=e.messagePaginationOptions,u=ct({},i.pagination);i