bitmax-crm-widget 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -9
- package/dist/index.esm.js +2 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -21,13 +21,13 @@ Universal chat widget that works on **any website** - React, Vue, HTML, WordPres
|
|
|
21
21
|
### Option 1: NPM (for React/Vue/Node projects)
|
|
22
22
|
|
|
23
23
|
```bash
|
|
24
|
-
npm install
|
|
24
|
+
npm install bitmax-crm-widget
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
### Option 2: CDN (for HTML/WordPress/any website)
|
|
28
28
|
|
|
29
29
|
```html
|
|
30
|
-
<script src="https://unpkg.com
|
|
30
|
+
<script src="https://unpkg.com/bitmax-crm-widget/dist/chat-widget.min.js"></script>
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
---
|
|
@@ -37,7 +37,7 @@ npm install @bitmax-crm/widget
|
|
|
37
37
|
### React / MERN Application
|
|
38
38
|
|
|
39
39
|
```jsx
|
|
40
|
-
import { ChatCRMWidget } from '
|
|
40
|
+
import { ChatCRMWidget } from 'bitmax-crm-widget';
|
|
41
41
|
|
|
42
42
|
function App() {
|
|
43
43
|
return (
|
|
@@ -66,7 +66,7 @@ function App() {
|
|
|
66
66
|
<!-- Your website content -->
|
|
67
67
|
|
|
68
68
|
<!-- Chat Widget -->
|
|
69
|
-
<script src="https://unpkg.com
|
|
69
|
+
<script src="https://unpkg.com/bitmax-crm-widget/dist/chat-widget.min.js"></script>
|
|
70
70
|
<script>
|
|
71
71
|
ChatCRMWidget.init({
|
|
72
72
|
apiKey: 'your_api_key_here',
|
|
@@ -102,7 +102,7 @@ By default, all visitors are treated as guests:
|
|
|
102
102
|
Pass user data for logged-in customers:
|
|
103
103
|
|
|
104
104
|
```jsx
|
|
105
|
-
import { ChatCRMWidget } from '
|
|
105
|
+
import { ChatCRMWidget } from 'bitmax-crm-widget';
|
|
106
106
|
import { useAuth } from './context/AuthContext'; // Your auth system
|
|
107
107
|
|
|
108
108
|
function App() {
|
|
@@ -242,7 +242,7 @@ export default function RootLayout({ children }) {
|
|
|
242
242
|
</template>
|
|
243
243
|
|
|
244
244
|
<script>
|
|
245
|
-
import { ChatCRMWidget } from '
|
|
245
|
+
import { ChatCRMWidget } from 'bitmax-crm-widget';
|
|
246
246
|
|
|
247
247
|
export default {
|
|
248
248
|
components: { ChatCRMWidget },
|
|
@@ -262,7 +262,7 @@ Add to your theme's `footer.php`:
|
|
|
262
262
|
|
|
263
263
|
```php
|
|
264
264
|
<!-- Before </body> tag -->
|
|
265
|
-
<script src="https://unpkg.com
|
|
265
|
+
<script src="https://unpkg.com/bitmax-crm-widget/dist/chat-widget.min.js"></script>
|
|
266
266
|
<script>
|
|
267
267
|
ChatCRMWidget.init({
|
|
268
268
|
apiKey: '<?php echo get_option('chat_crm_api_key'); ?>',
|
|
@@ -289,7 +289,7 @@ import { WebView } from 'react-native-webview';
|
|
|
289
289
|
const injectedJS = `
|
|
290
290
|
(function() {
|
|
291
291
|
const script = document.createElement('script');
|
|
292
|
-
script.src = 'https://unpkg.com
|
|
292
|
+
script.src = 'https://unpkg.com/bitmax-crm-widget/dist/chat-widget.min.js';
|
|
293
293
|
script.onload = function() {
|
|
294
294
|
ChatCRMWidget.init({
|
|
295
295
|
apiKey: 'your_key',
|
|
@@ -383,7 +383,7 @@ Widget auto-updates when you refresh the page (CDN version).
|
|
|
383
383
|
|
|
384
384
|
For NPM version:
|
|
385
385
|
```bash
|
|
386
|
-
npm update
|
|
386
|
+
npm update bitmax-crm-widget
|
|
387
387
|
```
|
|
388
388
|
|
|
389
389
|
---
|
|
@@ -413,3 +413,4 @@ You now have a professional chat widget supporting both **guest users** and **lo
|
|
|
413
413
|
4. Reply from CRM - user sees it instantly!
|
|
414
414
|
|
|
415
415
|
Enjoy! 🚀
|
|
416
|
+
|
package/dist/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import e,{useState as t,useRef as
|
|
1
|
+
import e,{useState as t,useRef as r,useEffect as n}from"react";function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function o(e,t,r,n,s,o,i){try{var a=e[o](i),c=a.value}catch(e){return void r(e)}a.done?t(c):Promise.resolve(c).then(n,s)}function i(e){return function(){var t=this,r=arguments;return new Promise(function(n,s){var i=e.apply(t,r);function a(e){o(i,n,s,a,c,"next",e)}function c(e){o(i,n,s,a,c,"throw",e)}a(void 0)})}}function a(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?c(Object(r),!0).forEach(function(t){a(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function l(){
|
|
2
2
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
3
|
-
var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",s=n.toStringTag||"@@toStringTag";function o(n,r,s,o){var c=r&&r.prototype instanceof a?r:a,u=Object.create(c.prototype);return h(u,"_invoke",function(n,r,s){var o,a,c,u=0,l=s||[],h=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return o=t,a=0,c=e,d.n=n,i}};function p(n,r){for(a=n,c=r,t=0;!h&&u&&!s&&t<l.length;t++){var s,o=l[t],p=d.p,f=o[2];n>3?(s=f===r)&&(c=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=p&&((s=n<2&&p<o[1])?(a=0,d.v=r,d.n=o[1]):p<f&&(s=n<3||o[0]>r||r>f)&&(o[4]=n,o[5]=r,d.n=f,a=0))}if(s||n>1)return i;throw h=!0,r}return function(s,l,f){if(u>1)throw TypeError("Generator is already running");for(h&&1===l&&p(l,f),a=l,c=f;(t=a<2?e:c)||!h;){o||(a?a<3?(a>1&&(d.n=-1),p(a,c)):d.n=c:d.v=c);try{if(u=2,o){if(a||(s="next"),t=o[s]){if(!(t=t.call(o,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(c=TypeError("The iterator does not provide a '"+s+"' method"),a=1);o=e}else if((t=(h=d.n<0)?c:n.call(r,d))!==i)break}catch(t){o=e,a=1,c=t}finally{u=1}}return{value:t,done:h}}}(n,s,o),!0),u}var i={};function a(){}function c(){}function u(){}t=Object.getPrototypeOf;var d=[][r]?t(t([][r]())):(h(t={},r,function(){return this}),t),p=u.prototype=a.prototype=Object.create(d);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,h(e,s,"GeneratorFunction")),e.prototype=Object.create(p),e}return c.prototype=u,h(p,"constructor",u),h(u,"constructor",c),c.displayName="GeneratorFunction",h(u,s,"GeneratorFunction"),h(p),h(p,s,"Generator"),h(p,r,function(){return this}),h(p,"toString",function(){return"[object Generator]"}),(l=function(){return{w:o,m:f}})()}function h(e,t,n,r){var s=Object.defineProperty;try{s({},"",{})}catch(e){s=0}h=function(e,t,n,r){function o(t,n){h(e,t,function(e){return this._invoke(t,n,e)})}t?s?s(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},h(e,t,n,r)}function d(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,o,i,a=[],c=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t);else for(;!(c=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);c=!0);}catch(e){u=!0,s=e}finally{try{if(!c&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(u)throw s}}return a}}(e,t)||f(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 p(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||f(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 f(e,t){if(e){if("string"==typeof e)return s(e,t);var n={}.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)?s(e,t):void 0}}const m=Object.create(null);m.open="0",m.close="1",m.ping="2",m.pong="3",m.message="4",m.upgrade="5",m.noop="6";const g=Object.create(null);Object.keys(m).forEach(e=>{g[m[e]]=e});const y={type:"error",data:"parser error"},b="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),w="function"==typeof ArrayBuffer,v=e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,E=({type:e,data:t},n,r)=>b&&t instanceof Blob?n?r(t):_(t,r):w&&(t instanceof ArrayBuffer||v(t))?n?r(t):_(new Blob([t]),r):r(m[e]+(t||"")),_=(e,t)=>{const n=new FileReader;return n.onload=function(){const e=n.result.split(",")[1];t("b"+(e||""))},n.readAsDataURL(e)};function k(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let x;const O="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",S="undefined"==typeof Uint8Array?[]:new Uint8Array(256);for(let e=0;e<64;e++)S[O.charCodeAt(e)]=e;const R="function"==typeof ArrayBuffer,T=(e,t)=>{if("string"!=typeof e)return{type:"message",data:C(e,t)};const n=e.charAt(0);if("b"===n)return{type:"message",data:A(e.substring(1),t)};return g[n]?e.length>1?{type:g[n],data:e.substring(1)}:{type:g[n]}:y},A=(e,t)=>{if(R){const n=(e=>{let t,n,r,s,o,i=.75*e.length,a=e.length,c=0;"="===e[e.length-1]&&(i--,"="===e[e.length-2]&&i--);const u=new ArrayBuffer(i),l=new Uint8Array(u);for(t=0;t<a;t+=4)n=S[e.charCodeAt(t)],r=S[e.charCodeAt(t+1)],s=S[e.charCodeAt(t+2)],o=S[e.charCodeAt(t+3)],l[c++]=n<<2|r>>4,l[c++]=(15&r)<<4|s>>2,l[c++]=(3&s)<<6|63&o;return u})(e);return C(n,t)}return{base64:!0,data:e}},C=(e,t)=>"blob"===t?e instanceof Blob?e:new Blob([e]):e instanceof ArrayBuffer?e:e.buffer,N=String.fromCharCode(30);function j(){return new TransformStream({transform(e,t){!function(e,t){b&&e.data instanceof Blob?e.data.arrayBuffer().then(k).then(t):w&&(e.data instanceof ArrayBuffer||v(e.data))?t(k(e.data)):E(e,!1,e=>{x||(x=new TextEncoder),t(x.encode(e))})}(e,n=>{const r=n.length;let s;if(r<126)s=new Uint8Array(1),new DataView(s.buffer).setUint8(0,r);else if(r<65536){s=new Uint8Array(3);const e=new DataView(s.buffer);e.setUint8(0,126),e.setUint16(1,r)}else{s=new Uint8Array(9);const e=new DataView(s.buffer);e.setUint8(0,127),e.setBigUint64(1,BigInt(r))}e.data&&"string"!=typeof e.data&&(s[0]|=128),t.enqueue(s),t.enqueue(n)})}})}let B;function L(e){return e.reduce((e,t)=>e+t.length,0)}function P(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let s=0;s<t;s++)n[s]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function U(e){if(e)return function(e){for(var t in U.prototype)e[t]=U.prototype[t];return e}(e)}U.prototype.on=U.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},U.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},U.prototype.off=U.prototype.removeListener=U.prototype.removeAllListeners=U.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var s=0;s<r.length;s++)if((n=r[s])===t||n.fn===t){r.splice(s,1);break}return 0===r.length&&delete this._callbacks["$"+e],this},U.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){r=0;for(var s=(n=n.slice(0)).length;r<s;++r)n[r].apply(this,t)}return this},U.prototype.emitReserved=U.prototype.emit,U.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},U.prototype.hasListeners=function(e){return!!this.listeners(e).length};const F="function"==typeof Promise&&"function"==typeof Promise.resolve?e=>Promise.resolve().then(e):(e,t)=>t(e,0),D="undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this")();function q(e,...t){return t.reduce((t,n)=>(e.hasOwnProperty(n)&&(t[n]=e[n]),t),{})}const I=D.setTimeout,M=D.clearTimeout;function z(e,t){t.useNativeTimers?(e.setTimeoutFn=I.bind(D),e.clearTimeoutFn=M.bind(D)):(e.setTimeoutFn=D.setTimeout.bind(D),e.clearTimeoutFn=D.clearTimeout.bind(D))}function H(e){return"string"==typeof e?function(e){let t=0,n=0;for(let r=0,s=e.length;r<s;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}(e):Math.ceil(1.33*(e.byteLength||e.size))}function V(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}class W extends Error{constructor(e,t,n){super(e),this.description=t,this.context=n,this.type="TransportError"}}class K extends U{constructor(e){super(),this.writable=!1,z(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,t,n){return super.emitReserved("error",new W(e,t,n)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this}send(e){"open"===this.readyState&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const t=T(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,t={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){const e=this.opts.hostname;return-1===e.indexOf(":")?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(443!==this.opts.port)||!this.opts.secure&&80!==Number(this.opts.port))?":"+this.opts.port:""}_query(e){const t=function(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}(e);return t.length?"?"+t:""}}class J extends K{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";const t=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let e=0;this._polling&&(e++,this.once("pollComplete",function(){--e||t()})),this.writable||(e++,this.once("drain",function(){--e||t()}))}else t()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){((e,t)=>{const n=e.split(N),r=[];for(let e=0;e<n.length;e++){const s=T(n[e],t);if(r.push(s),"error"===s.type)break}return r})(e,this.socket.binaryType).forEach(e=>{if("opening"===this.readyState&&"open"===e.type&&this.onOpen(),"close"===e.type)return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(e)}),"closed"!==this.readyState&&(this._polling=!1,this.emitReserved("pollComplete"),"open"===this.readyState&&this._poll())}doClose(){const e=()=>{this.write([{type:"close"}])};"open"===this.readyState?e():this.once("open",e)}write(e){this.writable=!1,((e,t)=>{const n=e.length,r=new Array(n);let s=0;e.forEach((e,o)=>{E(e,!1,e=>{r[o]=e,++s===n&&t(r.join(N))})})})(e,e=>{this.doWrite(e,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",t=this.query||{};return!1!==this.opts.timestampRequests&&(t[this.opts.timestampParam]=V()),this.supportsBinary||t.sid||(t.b64=1),this.createUri(e,t)}}let $=!1;try{$="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(e){}const G=$;function Y(){}class X extends J{constructor(e){if(super(e),"undefined"!=typeof location){const t="https:"===location.protocol;let n=location.port;n||(n=t?"443":"80"),this.xd="undefined"!=typeof location&&e.hostname!==location.hostname||n!==e.port}}doWrite(e,t){const n=this.request({method:"POST",data:e});n.on("success",t),n.on("error",(e,t)=>{this.onError("xhr post error",e,t)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(e,t)=>{this.onError("xhr poll error",e,t)}),this.pollXhr=e}}class Q extends U{constructor(e,t,n){super(),this.createRequest=e,z(this,n),this._opts=n,this._method=n.method||"GET",this._uri=t,this._data=void 0!==n.data?n.data:null,this._create()}_create(){var e;const t=q(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this._opts.xd;const n=this._xhr=this.createRequest(t);try{n.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let e in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(e)&&n.setRequestHeader(e,this._opts.extraHeaders[e])}}catch(e){}if("POST"===this._method)try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(e){}try{n.setRequestHeader("Accept","*/*")}catch(e){}null===(e=this._opts.cookieJar)||void 0===e||e.addCookies(n),"withCredentials"in n&&(n.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(n.timeout=this._opts.requestTimeout),n.onreadystatechange=()=>{var e;3===n.readyState&&(null===(e=this._opts.cookieJar)||void 0===e||e.parseCookies(n.getResponseHeader("set-cookie"))),4===n.readyState&&(200===n.status||1223===n.status?this._onLoad():this.setTimeoutFn(()=>{this._onError("number"==typeof n.status?n.status:0)},0))},n.send(this._data)}catch(e){return void this.setTimeoutFn(()=>{this._onError(e)},0)}"undefined"!=typeof document&&(this._index=Q.requestsCount++,Q.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(void 0!==this._xhr&&null!==this._xhr){if(this._xhr.onreadystatechange=Y,e)try{this._xhr.abort()}catch(e){}"undefined"!=typeof document&&delete Q.requests[this._index],this._xhr=null}}_onLoad(){const e=this._xhr.responseText;null!==e&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}if(Q.requestsCount=0,Q.requests={},"undefined"!=typeof document)if("function"==typeof attachEvent)attachEvent("onunload",Z);else if("function"==typeof addEventListener){addEventListener("onpagehide"in D?"pagehide":"unload",Z,!1)}function Z(){for(let e in Q.requests)Q.requests.hasOwnProperty(e)&&Q.requests[e].abort()}const ee=function(){const e=te({xdomain:!1});return e&&null!==e.responseType}();function te(e){const t=e.xdomain;try{if("undefined"!=typeof XMLHttpRequest&&(!t||G))return new XMLHttpRequest}catch(e){}if(!t)try{return new(D[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(e){}}const ne="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();class re extends K{get name(){return"websocket"}doOpen(){const e=this.uri(),t=this.opts.protocols,n=ne?{}:q(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,t,n)}catch(e){return this.emitReserved("error",e)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const n=e[t],r=t===e.length-1;E(n,this.supportsBinary,e=>{try{this.doWrite(n,e)}catch(e){}r&&F(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){void 0!==this.ws&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=V()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}}const se=D.WebSocket||D.MozWebSocket;const oe={websocket:class extends re{createSocket(e,t,n){return ne?new se(e,t,n):t?new se(e,t):new se(e)}doWrite(e,t){this.ws.send(t)}},webtransport:class extends K{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{const t=function(e,t){B||(B=new TextDecoder);const n=[];let r=0,s=-1,o=!1;return new TransformStream({transform(i,a){for(n.push(i);;){if(0===r){if(L(n)<1)break;const e=P(n,1);o=!(128&~e[0]),s=127&e[0],r=s<126?3:126===s?1:2}else if(1===r){if(L(n)<2)break;const e=P(n,2);s=new DataView(e.buffer,e.byteOffset,e.length).getUint16(0),r=3}else if(2===r){if(L(n)<8)break;const e=P(n,8),t=new DataView(e.buffer,e.byteOffset,e.length),o=t.getUint32(0);if(o>Math.pow(2,21)-1){a.enqueue(y);break}s=o*Math.pow(2,32)+t.getUint32(4),r=3}else{if(L(n)<s)break;const e=P(n,s);a.enqueue(T(o?e:B.decode(e),t)),r=0}if(0===s||s>e){a.enqueue(y);break}}}})}(Number.MAX_SAFE_INTEGER,this.socket.binaryType),n=e.readable.pipeThrough(t).getReader(),r=j();r.readable.pipeTo(e.writable),this._writer=r.writable.getWriter();const s=()=>{n.read().then(({done:e,value:t})=>{e||(this.onPacket(t),s())}).catch(e=>{})};s();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const n=e[t],r=t===e.length-1;this._writer.write(n).then(()=>{r&&F(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;null===(e=this._transport)||void 0===e||e.close()}},polling:class extends X{constructor(e){super(e);const t=e&&e.forceBase64;this.supportsBinary=ee&&!t}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new Q(te,this.uri(),e)}}},ie=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,ae=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function ce(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");-1!=n&&-1!=r&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let s=ie.exec(e||""),o={},i=14;for(;i--;)o[ae[i]]=s[i]||"";return-1!=n&&-1!=r&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=function(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");"/"!=t.slice(0,1)&&0!==t.length||r.splice(0,1);"/"==t.slice(-1)&&r.splice(r.length-1,1);return r}(0,o.path),o.queryKey=function(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(e,t,r){t&&(n[t]=r)}),n}(0,o.query),o}const ue="function"==typeof addEventListener&&"function"==typeof removeEventListener,le=[];ue&&addEventListener("offline",()=>{le.forEach(e=>e())},!1);class he extends U{constructor(e,t){if(super(),this.binaryType="arraybuffer",this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&"object"==typeof e&&(t=e,e=null),e){const n=ce(e);t.hostname=n.host,t.secure="https"===n.protocol||"wss"===n.protocol,t.port=n.port,n.query&&(t.query=n.query)}else t.host&&(t.hostname=ce(t.host).host);z(this,t),this.secure=null!=t.secure?t.secure:"undefined"!=typeof location&&"https:"===location.protocol,t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=t.port||("undefined"!=typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},t.transports.forEach(e=>{const t=e.prototype.name;this.transports.push(t),this._transportsByName[t]=e}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},t),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),"string"==typeof this.opts.query&&(this.opts.query=function(e){let t={},n=e.split("&");for(let e=0,r=n.length;e<r;e++){let r=n[e].split("=");t[decodeURIComponent(r[0])]=decodeURIComponent(r[1])}return t}(this.opts.query)),ue&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),"localhost"!==this.hostname&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},le.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){const t=Object.assign({},this.opts.query);t.EIO=4,t.transport=e,this.id&&(t.sid=this.id);const n=Object.assign({},this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](n)}_open(){if(0===this.transports.length)return void this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);const e=this.opts.rememberUpgrade&&he.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket")?"websocket":this.transports[0];this.readyState="opening";const t=this.createTransport(e);t.open(),this.setTransport(t)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",e=>this._onClose("transport close",e))}onOpen(){this.readyState="open",he.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush()}_onPacket(e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const t=new Error("server error");t.code=e.data,this._onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data)}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),"closed"!==this.readyState&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},e),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}flush(){if("closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&"polling"===this.transport.name&&this.writeBuffer.length>1))return this.writeBuffer;let e=1;for(let t=0;t<this.writeBuffer.length;t++){const n=this.writeBuffer[t].data;if(n&&(e+=H(n)),t>0&&e>this._maxPayload)return this.writeBuffer.slice(0,t);e+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,F(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,t,n){return this._sendPacket("message",e,t,n),this}send(e,t,n){return this._sendPacket("message",e,t,n),this}_sendPacket(e,t,n,r){if("function"==typeof t&&(r=t,t=void 0),"function"==typeof n&&(r=n,n=null),"closing"===this.readyState||"closed"===this.readyState)return;(n=n||{}).compress=!1!==n.compress;const s={type:e,data:t,options:n};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),r&&this.once("flush",r),this.flush()}close(){const e=()=>{this._onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},n=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?n():e()}):this.upgrading?n():e()),this}_onError(e){if(he.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&"opening"===this.readyState)return this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,t){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),ue&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const e=le.indexOf(this._offlineEventListener);-1!==e&&le.splice(e,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this._prevBufferLen=0}}}he.protocol=4;class de extends he{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),"open"===this.readyState&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let t=this.createTransport(e),n=!1;he.priorWebsocketSuccess=!1;const r=()=>{n||(t.send([{type:"ping",data:"probe"}]),t.once("packet",e=>{if(!n)if("pong"===e.type&&"probe"===e.data){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;he.priorWebsocketSuccess="websocket"===t.name,this.transport.pause(()=>{n||"closed"!==this.readyState&&(u(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())})}else{const e=new Error("probe error");e.transport=t.name,this.emitReserved("upgradeError",e)}}))};function s(){n||(n=!0,u(),t.close(),t=null)}const o=e=>{const n=new Error("probe error: "+e);n.transport=t.name,s(),this.emitReserved("upgradeError",n)};function i(){o("transport closed")}function a(){o("socket closed")}function c(e){t&&e.name!==t.name&&s()}const u=()=>{t.removeListener("open",r),t.removeListener("error",o),t.removeListener("close",i),this.off("close",a),this.off("upgrading",c)};t.once("open",r),t.once("error",o),t.once("close",i),this.once("close",a),this.once("upgrading",c),-1!==this._upgrades.indexOf("webtransport")&&"webtransport"!==e?this.setTimeoutFn(()=>{n||t.open()},200):t.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){const t=[];for(let n=0;n<e.length;n++)~this.transports.indexOf(e[n])&&t.push(e[n]);return t}}let pe=class extends de{constructor(e,t={}){const n="object"==typeof e?e:t;(!n.transports||n.transports&&"string"==typeof n.transports[0])&&(n.transports=(n.transports||["polling","websocket","webtransport"]).map(e=>oe[e]).filter(e=>!!e)),super(e,n)}};const fe="function"==typeof ArrayBuffer,me=Object.prototype.toString,ge="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===me.call(Blob),ye="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===me.call(File);function be(e){return fe&&(e instanceof ArrayBuffer||(e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer)(e))||ge&&e instanceof Blob||ye&&e instanceof File}function we(e,t){if(!e||"object"!=typeof e)return!1;if(Array.isArray(e)){for(let t=0,n=e.length;t<n;t++)if(we(e[t]))return!0;return!1}if(be(e))return!0;if(e.toJSON&&"function"==typeof e.toJSON&&1===arguments.length)return we(e.toJSON(),!0);for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&we(e[t]))return!0;return!1}function ve(e){const t=[],n=e.data,r=e;return r.data=Ee(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Ee(e,t){if(!e)return e;if(be(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=Ee(e[r],t);return n}if("object"==typeof e&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=Ee(e[r],t));return n}return e}function _e(e,t){return e.data=ke(e.data,t),delete e.attachments,e}function ke(e,t){if(!e)return e;if(e&&!0===e._placeholder){if("number"==typeof e.num&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=ke(e[n],t);else if("object"==typeof e)for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=ke(e[n],t));return e}const xe=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var Oe;!function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"}(Oe||(Oe={}));function Se(e){return"[object Object]"===Object.prototype.toString.call(e)}class Re extends U{constructor(e){super(),this.reviver=e}add(e){let t;if("string"==typeof e){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);const n=t.type===Oe.BINARY_EVENT;n||t.type===Oe.BINARY_ACK?(t.type=n?Oe.EVENT:Oe.ACK,this.reconstructor=new Te(t),0===t.attachments&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else{if(!be(e)&&!e.base64)throw new Error("Unknown type: "+e);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t))}}decodeString(e){let t=0;const n={type:Number(e.charAt(0))};if(void 0===Oe[n.type])throw new Error("unknown packet type "+n.type);if(n.type===Oe.BINARY_EVENT||n.type===Oe.BINARY_ACK){const r=t+1;for(;"-"!==e.charAt(++t)&&t!=e.length;);const s=e.substring(r,t);if(s!=Number(s)||"-"!==e.charAt(t))throw new Error("Illegal attachments");n.attachments=Number(s)}if("/"===e.charAt(t+1)){const r=t+1;for(;++t;){if(","===e.charAt(t))break;if(t===e.length)break}n.nsp=e.substring(r,t)}else n.nsp="/";const r=e.charAt(t+1);if(""!==r&&Number(r)==r){const r=t+1;for(;++t;){const n=e.charAt(t);if(null==n||Number(n)!=n){--t;break}if(t===e.length)break}n.id=Number(e.substring(r,t+1))}if(e.charAt(++t)){const r=this.tryParse(e.substr(t));if(!Re.isPayloadValid(n.type,r))throw new Error("invalid payload");n.data=r}return n}tryParse(e){try{return JSON.parse(e,this.reviver)}catch(e){return!1}}static isPayloadValid(e,t){switch(e){case Oe.CONNECT:return Se(t);case Oe.DISCONNECT:return void 0===t;case Oe.CONNECT_ERROR:return"string"==typeof t||Se(t);case Oe.EVENT:case Oe.BINARY_EVENT:return Array.isArray(t)&&("number"==typeof t[0]||"string"==typeof t[0]&&-1===xe.indexOf(t[0]));case Oe.ACK:case Oe.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Te{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const e=_e(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}var Ae=Object.freeze({__proto__:null,Decoder:Re,Encoder:class{constructor(e){this.replacer=e}encode(e){return e.type!==Oe.EVENT&&e.type!==Oe.ACK||!we(e)?[this.encodeAsString(e)]:this.encodeAsBinary({type:e.type===Oe.EVENT?Oe.BINARY_EVENT:Oe.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id})}encodeAsString(e){let t=""+e.type;return e.type!==Oe.BINARY_EVENT&&e.type!==Oe.BINARY_ACK||(t+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(t+=e.nsp+","),null!=e.id&&(t+=e.id),null!=e.data&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){const t=ve(e),n=this.encodeAsString(t.packet),r=t.buffers;return r.unshift(n),r}},get PacketType(){return Oe},protocol:5});function Ce(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const Ne=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class je extends U{constructor(e,t,n){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,n&&n.auth&&(this.auth=n.auth),this._opts=Object.assign({},n),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[Ce(e,"open",this.onopen.bind(this)),Ce(e,"packet",this.onpacket.bind(this)),Ce(e,"error",this.onerror.bind(this)),Ce(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){var n,r,s;if(Ne.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;const o={type:Oe.EVENT,data:t,options:{}};if(o.options.compress=!1!==this.flags.compress,"function"==typeof t[t.length-1]){const e=this.ids++,n=t.pop();this._registerAckCallback(e,n),o.id=e}const i=null===(r=null===(n=this.io.engine)||void 0===n?void 0:n.transport)||void 0===r?void 0:r.writable,a=this.connected&&!(null===(s=this.io.engine)||void 0===s?void 0:s._hasPingExpired());return this.flags.volatile&&!i||(a?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(e,t){var n;const r=null!==(n=this.flags.timeout)&&void 0!==n?n:this._opts.ackTimeout;if(void 0===r)return void(this.acks[e]=t);const s=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let t=0;t<this.sendBuffer.length;t++)this.sendBuffer[t].id===e&&this.sendBuffer.splice(t,1);t.call(this,new Error("operation has timed out"))},r),o=(...e)=>{this.io.clearTimeoutFn(s),t.apply(this,e)};o.withError=!0,this.acks[e]=o}emitWithAck(e,...t){return new Promise((n,r)=>{const s=(e,t)=>e?r(e):n(t);s.withError=!0,t.push(s),this.emit(e,...t)})}_addToQueue(e){let t;"function"==typeof e[e.length-1]&&(t=e.pop());const n={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((e,...r)=>{if(n!==this._queue[0])return;return null!==e?n.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(e)):(this._queue.shift(),t&&t(null,...r)),n.pending=!1,this._drainQueue()}),this._queue.push(n),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||0===this._queue.length)return;const t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){"function"==typeof this.auth?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:Oe.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(t=>String(t.id)===e)){const t=this.acks[e];delete this.acks[e],t.withError&&t.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case Oe.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Oe.EVENT:case Oe.BINARY_EVENT:this.onevent(e);break;case Oe.ACK:case Oe.BINARY_ACK:this.onack(e);break;case Oe.DISCONNECT:this.ondisconnect();break;case Oe.CONNECT_ERROR:this.destroy();const t=new Error(e.data.message);t.data=e.data.data,this.emitReserved("connect_error",t)}}onevent(e){const t=e.data||[];null!=e.id&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const n of t)n.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&"string"==typeof e[e.length-1]&&(this._lastOffset=e[e.length-1])}ack(e){const t=this;let n=!1;return function(...r){n||(n=!0,t.packet({type:Oe.ACK,id:e,data:r}))}}onack(e){const t=this.acks[e.id];"function"==typeof t&&(delete this.acks[e.id],t.withError&&e.data.unshift(null),t.apply(this,e.data))}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Oe.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const t=this._anyOutgoingListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const t=this._anyOutgoingListeners.slice();for(const n of t)n.apply(this,e.data)}}}function Be(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Be.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=1&Math.floor(10*t)?e+n:e-n}return 0|Math.min(e,this.max)},Be.prototype.reset=function(){this.attempts=0},Be.prototype.setMin=function(e){this.ms=e},Be.prototype.setMax=function(e){this.max=e},Be.prototype.setJitter=function(e){this.jitter=e};class Le extends U{constructor(e,t){var n;super(),this.nsps={},this.subs=[],e&&"object"==typeof e&&(t=e,e=void 0),(t=t||{}).path=t.path||"/socket.io",this.opts=t,z(this,t),this.reconnection(!1!==t.reconnection),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor(null!==(n=t.randomizationFactor)&&void 0!==n?n:.5),this.backoff=new Be({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==t.timeout?2e4:t.timeout),this._readyState="closed",this.uri=e;const r=t.parser||Ae;this.encoder=new r.Encoder,this.decoder=new r.Decoder,this._autoConnect=!1!==t.autoConnect,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return void 0===e?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return void 0===e?this._reconnectionDelay:(this._reconnectionDelay=e,null===(t=this.backoff)||void 0===t||t.setMin(e),this)}randomizationFactor(e){var t;return void 0===e?this._randomizationFactor:(this._randomizationFactor=e,null===(t=this.backoff)||void 0===t||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return void 0===e?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,null===(t=this.backoff)||void 0===t||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new pe(this.uri,this.opts);const t=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const r=Ce(t,"open",function(){n.onopen(),e&&e()}),s=t=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",t),e?e(t):this.maybeReconnectOnOpen()},o=Ce(t,"error",s);if(!1!==this._timeout){const e=this._timeout,n=this.setTimeoutFn(()=>{r(),s(new Error("timeout")),t.close()},e);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}return this.subs.push(r),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(Ce(e,"ping",this.onping.bind(this)),Ce(e,"data",this.ondata.bind(this)),Ce(e,"error",this.onerror.bind(this)),Ce(e,"close",this.onclose.bind(this)),Ce(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(e){this.onclose("parse error",e)}}ondecoded(e){F(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let n=this.nsps[e];return n?this._autoConnect&&!n.active&&n.connect():(n=new je(this,e,t),this.nsps[e]=n),n}_destroy(e){const t=Object.keys(this.nsps);for(const e of t){if(this.nsps[e].active)return}this._close()}_packet(e){const t=this.encoder.encode(e);for(let n=0;n<t.length;n++)this.engine.write(t[n],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,t){var n;this.cleanup(),null===(n=this.engine)||void 0===n||n.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();this._reconnecting=!0;const n=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),e.skipReconnect||e.open(t=>{t?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",t)):e.onreconnect()}))},t);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const Pe={};function Ue(e,t){"object"==typeof e&&(t=e,e=void 0);const n=function(e,t="",n){let r=e;n=n||"undefined"!=typeof location&&location,null==e&&(e=n.protocol+"//"+n.host),"string"==typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?n.protocol+e:n.host+e),/^(https?|wss?):\/\//.test(e)||(e=void 0!==n?n.protocol+"//"+e:"https://"+e),r=ce(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const s=-1!==r.host.indexOf(":")?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+s+":"+r.port+t,r.href=r.protocol+"://"+s+(n&&n.port===r.port?"":":"+r.port),r}(e,(t=t||{}).path||"/socket.io"),r=n.source,s=n.id,o=n.path,i=Pe[s]&&o in Pe[s].nsps;let a;return t.forceNew||t["force new connection"]||!1===t.multiplex||i?a=new Le(r,t):(Pe[s]||(Pe[s]=new Le(r,t)),a=Pe[s]),n.query&&!t.query&&(t.query=n.queryKey),a.socket(n.path,t)}function Fe(e,t){return function(){return e.apply(t,arguments)}}Object.assign(Ue,{Manager:Le,Socket:je,io:Ue,connect:Ue});const{toString:De}=Object.prototype,{getPrototypeOf:qe}=Object,{iterator:Ie,toStringTag:Me}=Symbol,ze=(e=>t=>{const n=De.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),He=e=>(e=e.toLowerCase(),t=>ze(t)===e),Ve=e=>t=>typeof t===e,{isArray:We}=Array,Ke=Ve("undefined");function Je(e){return null!==e&&!Ke(e)&&null!==e.constructor&&!Ke(e.constructor)&&Ye(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const $e=He("ArrayBuffer");const Ge=Ve("string"),Ye=Ve("function"),Xe=Ve("number"),Qe=e=>null!==e&&"object"==typeof e,Ze=e=>{if("object"!==ze(e))return!1;const t=qe(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Me in e||Ie in e)},et=He("Date"),tt=He("File"),nt=He("Blob"),rt=He("FileList"),st=He("URLSearchParams"),[ot,it,at,ct]=["ReadableStream","Request","Response","Headers"].map(He);function ut(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,s;if("object"!=typeof e&&(e=[e]),We(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{if(Je(e))return;const s=n?Object.getOwnPropertyNames(e):Object.keys(e),o=s.length;let i;for(r=0;r<o;r++)i=s[r],t.call(null,e[i],i,e)}}function lt(e,t){if(Je(e))return null;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 ht="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,dt=e=>!Ke(e)&&e!==ht;const pt=(ft="undefined"!=typeof Uint8Array&&qe(Uint8Array),e=>ft&&e instanceof ft);var ft;const mt=He("HTMLFormElement"),gt=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),yt=He("RegExp"),bt=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};ut(n,(n,s)=>{let o;!1!==(o=t(n,s,e))&&(r[s]=o||n)}),Object.defineProperties(e,r)};const wt=He("AsyncFunction"),vt=(Et="function"==typeof setImmediate,_t=Ye(ht.postMessage),Et?setImmediate:_t?(kt=`axios@${Math.random()}`,xt=[],ht.addEventListener("message",({source:e,data:t})=>{e===ht&&t===kt&&xt.length&&xt.shift()()},!1),e=>{xt.push(e),ht.postMessage(kt,"*")}):e=>setTimeout(e));var Et,_t,kt,xt;const Ot="undefined"!=typeof queueMicrotask?queueMicrotask.bind(ht):"undefined"!=typeof process&&process.nextTick||vt;var St={isArray:We,isArrayBuffer:$e,isBuffer:Je,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||Ye(e.append)&&("formdata"===(t=ze(e))||"object"===t&&Ye(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&$e(e.buffer),t},isString:Ge,isNumber:Xe,isBoolean:e=>!0===e||!1===e,isObject:Qe,isPlainObject:Ze,isEmptyObject:e=>{if(!Qe(e)||Je(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:ot,isRequest:it,isResponse:at,isHeaders:ct,isUndefined:Ke,isDate:et,isFile:tt,isBlob:nt,isRegExp:yt,isFunction:Ye,isStream:e=>Qe(e)&&Ye(e.pipe),isURLSearchParams:st,isTypedArray:pt,isFileList:rt,forEach:ut,merge:function e(){const{caseless:t,skipUndefined:n}=dt(this)&&this||{},r={},s=(s,o)=>{const i=t&<(r,o)||o;Ze(r[i])&&Ze(s)?r[i]=e(r[i],s):Ze(s)?r[i]=e({},s):We(s)?r[i]=s.slice():n&&Ke(s)||(r[i]=s)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&ut(arguments[e],s);return r},extend:(e,t,n,{allOwnKeys:r}={})=>(ut(t,(t,r)=>{n&&Ye(t)?e[r]=Fe(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,o,i;const a={};if(t=t||{},null==e)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)i=s[o],r&&!r(i,e,t)||a[i]||(t[i]=e[i],a[i]=!0);e=!1!==n&&qe(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:ze,kindOfTest:He,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(We(e))return e;let t=e.length;if(!Xe(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Ie]).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:mt,hasOwnProperty:gt,hasOwnProp:gt,reduceDescriptors:bt,freezeMethods:e=>{bt(e,(t,n)=>{if(Ye(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];Ye(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 We(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)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:lt,global:ht,isContextDefined:dt,isSpecCompliantForm:function(e){return!!(e&&Ye(e.append)&&"FormData"===e[Me]&&e[Ie])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(Qe(e)){if(t.indexOf(e)>=0)return;if(Je(e))return e;if(!("toJSON"in e)){t[r]=e;const s=We(e)?[]:{};return ut(e,(e,t)=>{const o=n(e,r+1);!Ke(o)&&(s[t]=o)}),t[r]=void 0,s}}return e};return n(e,0)},isAsyncFn:wt,isThenable:e=>e&&(Qe(e)||Ye(e))&&Ye(e.then)&&Ye(e.catch),setImmediate:vt,asap:Ot,isIterable:e=>null!=e&&Ye(e[Ie])};function Rt(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,this.status=s.status?s.status:null)}St.inherits(Rt,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:St.toJSONObject(this.config),code:this.code,status:this.status}}});const Tt=Rt.prototype,At={};["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=>{At[e]={value:e}}),Object.defineProperties(Rt,At),Object.defineProperty(Tt,"isAxiosError",{value:!0}),Rt.from=(e,t,n,r,s,o)=>{const i=Object.create(Tt);St.toFlatObject(e,i,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e);const a=e&&e.message?e.message:"Error",c=null==t&&e?e.code:t;return Rt.call(i,a,c,n,r,s),e&&null==i.cause&&Object.defineProperty(i,"cause",{value:e,configurable:!0}),i.name=e&&e.name||"Error",o&&Object.assign(i,o),i};function Ct(e){return St.isPlainObject(e)||St.isArray(e)}function Nt(e){return St.endsWith(e,"[]")?e.slice(0,-2):e}function jt(e,t,n){return e?e.concat(t).map(function(e,t){return e=Nt(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const Bt=St.toFlatObject(St,{},null,function(e){return/^is[A-Z]/.test(e)});function Lt(e,t,n){if(!St.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=St.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!St.isUndefined(t[e])})).metaTokens,s=n.visitor||u,o=n.dots,i=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&St.isSpecCompliantForm(t);if(!St.isFunction(s))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(St.isDate(e))return e.toISOString();if(St.isBoolean(e))return e.toString();if(!a&&St.isBlob(e))throw new Rt("Blob is not supported. Use a Buffer instead.");return St.isArrayBuffer(e)||St.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function u(e,n,s){let a=e;if(e&&!s&&"object"==typeof e)if(St.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(St.isArray(e)&&function(e){return St.isArray(e)&&!e.some(Ct)}(e)||(St.isFileList(e)||St.endsWith(n,"[]"))&&(a=St.toArray(e)))return n=Nt(n),a.forEach(function(e,r){!St.isUndefined(e)&&null!==e&&t.append(!0===i?jt([n],r,o):null===i?n:n+"[]",c(e))}),!1;return!!Ct(e)||(t.append(jt(s,n,o),c(e)),!1)}const l=[],h=Object.assign(Bt,{defaultVisitor:u,convertValue:c,isVisitable:Ct});if(!St.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!St.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),St.forEach(n,function(n,o){!0===(!(St.isUndefined(n)||null===n)&&s.call(t,n,St.isString(o)?o.trim():o,r,h))&&e(n,r?r.concat(o):[o])}),l.pop()}}(e),t}function Pt(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function Ut(e,t){this._pairs=[],e&&Lt(e,this,t)}const Ft=Ut.prototype;function Dt(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function qt(e,t,n){if(!t)return e;const r=n&&n.encode||Dt;St.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let o;if(o=s?s(t,n):St.isURLSearchParams(t)?t.toString():new Ut(t,n).toString(r),o){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}Ft.append=function(e,t){this._pairs.push([e,t])},Ft.toString=function(e){const t=e?function(t){return e.call(this,t,Pt)}:Pt;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};class It{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){St.forEach(this.handlers,function(t){null!==t&&e(t)})}}var Mt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},zt={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Ut,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const Ht="undefined"!=typeof window&&"undefined"!=typeof document,Vt="object"==typeof navigator&&navigator||void 0,Wt=Ht&&(!Vt||["ReactNative","NativeScript","NS"].indexOf(Vt.product)<0),Kt="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Jt=Ht&&window.location.href||"http://localhost";var $t={...Object.freeze({__proto__:null,hasBrowserEnv:Ht,hasStandardBrowserEnv:Wt,hasStandardBrowserWebWorkerEnv:Kt,navigator:Vt,origin:Jt}),...zt};function Gt(e){function t(e,n,r,s){let o=e[s++];if("__proto__"===o)return!0;const i=Number.isFinite(+o),a=s>=e.length;if(o=!o&&St.isArray(r)?r.length:o,a)return St.hasOwnProp(r,o)?r[o]=[r[o],n]:r[o]=n,!i;r[o]&&St.isObject(r[o])||(r[o]=[]);return t(e,n,r[o],s)&&St.isArray(r[o])&&(r[o]=function(e){const t={},n=Object.keys(e);let r;const s=n.length;let o;for(r=0;r<s;r++)o=n[r],t[o]=e[o];return t}(r[o])),!i}if(St.isFormData(e)&&St.isFunction(e.entries)){const n={};return St.forEachEntry(e,(e,r)=>{t(function(e){return St.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null}const Yt={transitional:Mt,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,s=St.isObject(e);s&&St.isHTMLForm(e)&&(e=new FormData(e));if(St.isFormData(e))return r?JSON.stringify(Gt(e)):e;if(St.isArrayBuffer(e)||St.isBuffer(e)||St.isStream(e)||St.isFile(e)||St.isBlob(e)||St.isReadableStream(e))return e;if(St.isArrayBufferView(e))return e.buffer;if(St.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(s){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Lt(e,new $t.classes.URLSearchParams,{visitor:function(e,t,n,r){return $t.isNode&&St.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((o=St.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Lt(o?{"files[]":e}:e,t&&new t,this.formSerializer)}}return s||r?(t.setContentType("application/json",!1),function(e,t,n){if(St.isString(e))try{return(t||JSON.parse)(e),St.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||Yt.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(St.isResponse(e)||St.isReadableStream(e))return e;if(e&&St.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(e){if(n){if("SyntaxError"===e.name)throw Rt.from(e,Rt.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:$t.classes.FormData,Blob:$t.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};St.forEach(["delete","get","head","post","put","patch"],e=>{Yt.headers[e]={}});const Xt=St.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 Qt=Symbol("internals");function Zt(e){return e&&String(e).trim().toLowerCase()}function en(e){return!1===e||null==e?e:St.isArray(e)?e.map(en):String(e)}function tn(e,t,n,r,s){return St.isFunction(r)?r.call(this,t,n):(s&&(t=n),St.isString(t)?St.isString(r)?-1!==t.indexOf(r):St.isRegExp(r)?r.test(t):void 0:void 0)}let nn=class{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function s(e,t,n){const s=Zt(t);if(!s)throw new Error("header name must be a non-empty string");const o=St.findKey(r,s);(!o||void 0===r[o]||!0===n||void 0===n&&!1!==r[o])&&(r[o||t]=en(e))}const o=(e,t)=>St.forEach(e,(e,n)=>s(e,n,t));if(St.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if(St.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))o((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]&&Xt[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t})(e),t);else if(St.isObject(e)&&St.isIterable(e)){let n,r,s={};for(const t of e){if(!St.isArray(t))throw TypeError("Object iterator must return a key-value pair");s[r=t[0]]=(n=s[r])?St.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}o(s,t)}else null!=e&&s(t,e,n);return this}get(e,t){if(e=Zt(e)){const n=St.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(St.isFunction(t))return t.call(this,e,n);if(St.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Zt(e)){const n=St.findKey(this,e);return!(!n||void 0===this[n]||t&&!tn(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function s(e){if(e=Zt(e)){const s=St.findKey(n,e);!s||t&&!tn(0,n[s],s,t)||(delete n[s],r=!0)}}return St.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&&!tn(0,this[s],s,e,!0)||(delete this[s],r=!0)}return r}normalize(e){const t=this,n={};return St.forEach(this,(r,s)=>{const o=St.findKey(n,s);if(o)return t[o]=en(r),void delete t[s];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(s):String(s).trim();i!==s&&delete t[s],t[i]=en(r),n[i]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return St.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&St.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")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[Qt]=this[Qt]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=Zt(e);t[r]||(!function(e,t){const n=St.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 St.isArray(e)?e.forEach(r):r(e),this}};function rn(e,t){const n=this||Yt,r=t||n,s=nn.from(r.headers);let o=r.data;return St.forEach(e,function(e){o=e.call(n,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function sn(e){return!(!e||!e.__CANCEL__)}function on(e,t,n){Rt.call(this,null==e?"canceled":e,Rt.ERR_CANCELED,t,n),this.name="CanceledError"}function an(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new Rt("Request failed with status code "+n.status,[Rt.ERR_BAD_REQUEST,Rt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}nn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),St.reduceDescriptors(nn.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),St.freezeMethods(nn),St.inherits(on,Rt,{__CANCEL__:!0});const cn=(e,t,n=3)=>{let r=0;const s=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s,o=0,i=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),u=r[i];s||(s=c),n[o]=a,r[o]=c;let l=i,h=0;for(;l!==o;)h+=n[l++],l%=e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),c-s<t)return;const d=u&&c-u;return d?Math.round(1e3*h/d):void 0}}(50,250);return function(e,t){let n,r,s=0,o=1e3/t;const i=(t,o=Date.now())=>{s=o,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-s;a>=o?i(e,t):(n=e,r||(r=setTimeout(()=>{r=null,i(n)},o-a)))},()=>n&&i(n)]}(n=>{const o=n.loaded,i=n.lengthComputable?n.total:void 0,a=o-r,c=s(a);r=o;e({loaded:o,total:i,progress:i?o/i:void 0,bytes:a,rate:c||void 0,estimated:c&&i&&o<=i?(i-o)/c:void 0,event:n,lengthComputable:null!=i,[t?"download":"upload"]:!0})},n)},un=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},ln=e=>(...t)=>St.asap(()=>e(...t));var hn=$t.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,$t.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL($t.origin),$t.navigator&&/(msie|trident)/i.test($t.navigator.userAgent)):()=>!0,dn=$t.hasStandardBrowserEnv?{write(e,t,n,r,s,o,i){if("undefined"==typeof document)return;const a=[`${e}=${encodeURIComponent(t)}`];St.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),St.isString(r)&&a.push(`path=${r}`),St.isString(s)&&a.push(`domain=${s}`),!0===o&&a.push("secure"),St.isString(i)&&a.push(`SameSite=${i}`),document.cookie=a.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};function pn(e,t,n){let r=!function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}(t);return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const fn=e=>e instanceof nn?{...e}:e;function mn(e,t){t=t||{};const n={};function r(e,t,n,r){return St.isPlainObject(e)&&St.isPlainObject(t)?St.merge.call({caseless:r},e,t):St.isPlainObject(t)?St.merge({},t):St.isArray(t)?t.slice():t}function s(e,t,n,s){return St.isUndefined(t)?St.isUndefined(e)?void 0:r(void 0,e,0,s):r(e,t,0,s)}function o(e,t){if(!St.isUndefined(t))return r(void 0,t)}function i(e,t){return St.isUndefined(t)?St.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,s,o){return o in t?r(n,s):o in e?r(void 0,n):void 0}const c={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(e,t,n)=>s(fn(e),fn(t),0,!0)};return St.forEach(Object.keys({...e,...t}),function(r){const o=c[r]||s,i=o(e[r],t[r],r);St.isUndefined(i)&&o!==a||(n[r]=i)}),n}var gn=e=>{const t=mn({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:o,headers:i,auth:a}=t;if(t.headers=i=nn.from(i),t.url=qt(pn(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&i.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),St.isFormData(n))if($t.hasStandardBrowserEnv||$t.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(St.isFunction(n.getHeaders)){const e=n.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,n])=>{t.includes(e.toLowerCase())&&i.set(e,n)})}if($t.hasStandardBrowserEnv&&(r&&St.isFunction(r)&&(r=r(t)),r||!1!==r&&hn(t.url))){const e=s&&o&&dn.read(o);e&&i.set(s,e)}return t};var yn="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=gn(e);let s=r.data;const o=nn.from(r.headers).normalize();let i,a,c,u,l,{responseType:h,onUploadProgress:d,onDownloadProgress:p}=r;function f(){u&&u(),l&&l(),r.cancelToken&&r.cancelToken.unsubscribe(i),r.signal&&r.signal.removeEventListener("abort",i)}let m=new XMLHttpRequest;function g(){if(!m)return;const r=nn.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());an(function(e){t(e),f()},function(e){n(e),f()},{data:h&&"text"!==h&&"json"!==h?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:r,config:e,request:m}),m=null}m.open(r.method.toUpperCase(),r.url,!0),m.timeout=r.timeout,"onloadend"in m?m.onloadend=g:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(g)},m.onabort=function(){m&&(n(new Rt("Request aborted",Rt.ECONNABORTED,e,m)),m=null)},m.onerror=function(t){const r=new Rt(t&&t.message?t.message:"Network Error",Rt.ERR_NETWORK,e,m);r.event=t||null,n(r),m=null},m.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const s=r.transitional||Mt;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new Rt(t,s.clarifyTimeoutError?Rt.ETIMEDOUT:Rt.ECONNABORTED,e,m)),m=null},void 0===s&&o.setContentType(null),"setRequestHeader"in m&&St.forEach(o.toJSON(),function(e,t){m.setRequestHeader(t,e)}),St.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),h&&"json"!==h&&(m.responseType=r.responseType),p&&([c,l]=cn(p,!0),m.addEventListener("progress",c)),d&&m.upload&&([a,u]=cn(d),m.upload.addEventListener("progress",a),m.upload.addEventListener("loadend",u)),(r.cancelToken||r.signal)&&(i=t=>{m&&(n(!t||t.type?new on(null,e,m):t),m.abort(),m=null)},r.cancelToken&&r.cancelToken.subscribe(i),r.signal&&(r.signal.aborted?i():r.signal.addEventListener("abort",i)));const y=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);y&&-1===$t.protocols.indexOf(y)?n(new Rt("Unsupported protocol "+y+":",Rt.ERR_BAD_REQUEST,e)):m.send(s||null)})};const bn=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const s=function(e){if(!n){n=!0,i();const t=e instanceof Error?e:this.reason;r.abort(t instanceof Rt?t:new on(t instanceof Error?t.message:t))}};let o=t&&setTimeout(()=>{o=null,s(new Rt(`timeout ${t} of ms exceeded`,Rt.ETIMEDOUT))},t);const i=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(s):e.removeEventListener("abort",s)}),e=null)};e.forEach(e=>e.addEventListener("abort",s));const{signal:a}=r;return a.unsubscribe=()=>St.asap(i),a}},wn=function*(e,t){let n=e.byteLength;if(n<t)return void(yield e);let r,s=0;for(;s<n;)r=s+t,yield e.slice(s,r),s=r},vn=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},En=(e,t,n,r)=>{const s=async function*(e,t){for await(const n of vn(e))yield*wn(n,t)}(e,t);let o,i=0,a=e=>{o||(o=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await s.next();if(t)return a(),void e.close();let o=r.byteLength;if(n){let e=i+=o;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw a(e),e}},cancel:e=>(a(e),s.return())},{highWaterMark:2})},{isFunction:_n}=St,kn=(({Request:e,Response:t})=>({Request:e,Response:t}))(St.global),{ReadableStream:xn,TextEncoder:On}=St.global,Sn=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},Rn=e=>{e=St.merge.call({skipUndefined:!0},kn,e);const{fetch:t,Request:n,Response:r}=e,s=t?_n(t):"function"==typeof fetch,o=_n(n),i=_n(r);if(!s)return!1;const a=s&&_n(xn),c=s&&("function"==typeof On?(u=new On,e=>u.encode(e)):async e=>new Uint8Array(await new n(e).arrayBuffer()));var u;const l=o&&a&&Sn(()=>{let e=!1;const t=new n($t.origin,{body:new xn,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),h=i&&a&&Sn(()=>St.isReadableStream(new r("").body)),d={stream:h&&(e=>e.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!d[e]&&(d[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new Rt(`Response type '${e}' is not supported`,Rt.ERR_NOT_SUPPORT,n)})});const p=async(e,t)=>{const r=St.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if(St.isBlob(e))return e.size;if(St.isSpecCompliantForm(e)){const t=new n($t.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return St.isArrayBufferView(e)||St.isArrayBuffer(e)?e.byteLength:(St.isURLSearchParams(e)&&(e+=""),St.isString(e)?(await c(e)).byteLength:void 0)})(t):r};return async e=>{let{url:s,method:i,data:a,signal:c,cancelToken:u,timeout:f,onDownloadProgress:m,onUploadProgress:g,responseType:y,headers:b,withCredentials:w="same-origin",fetchOptions:v}=gn(e),E=t||fetch;y=y?(y+"").toLowerCase():"text";let _=bn([c,u&&u.toAbortSignal()],f),k=null;const x=_&&_.unsubscribe&&(()=>{_.unsubscribe()});let O;try{if(g&&l&&"get"!==i&&"head"!==i&&0!==(O=await p(b,a))){let e,t=new n(s,{method:"POST",body:a,duplex:"half"});if(St.isFormData(a)&&(e=t.headers.get("content-type"))&&b.setContentType(e),t.body){const[e,n]=un(O,cn(ln(g)));a=En(t.body,65536,e,n)}}St.isString(w)||(w=w?"include":"omit");const t=o&&"credentials"in n.prototype,c={...v,signal:_,method:i.toUpperCase(),headers:b.normalize().toJSON(),body:a,duplex:"half",credentials:t?w:void 0};k=o&&new n(s,c);let u=await(o?E(k,v):E(s,c));const f=h&&("stream"===y||"response"===y);if(h&&(m||f&&x)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=u[t]});const t=St.toFiniteNumber(u.headers.get("content-length")),[n,s]=m&&un(t,cn(ln(m),!0))||[];u=new r(En(u.body,65536,n,()=>{s&&s(),x&&x()}),e)}y=y||"text";let S=await d[St.findKey(d,y)||"text"](u,e);return!f&&x&&x(),await new Promise((t,n)=>{an(t,n,{data:S,headers:nn.from(u.headers),status:u.status,statusText:u.statusText,config:e,request:k})})}catch(t){if(x&&x(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new Rt("Network Error",Rt.ERR_NETWORK,e,k),{cause:t.cause||t});throw Rt.from(t,t&&t.code,e,k)}}},Tn=new Map,An=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:s}=t,o=[r,s,n];let i,a,c=o.length,u=Tn;for(;c--;)i=o[c],a=u.get(i),void 0===a&&u.set(i,a=c?new Map:Rn(t)),u=a;return a};An();const Cn={http:null,xhr:yn,fetch:{get:An}};St.forEach(Cn,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const Nn=e=>`- ${e}`,jn=e=>St.isFunction(e)||null===e||!1===e;var Bn={getAdapter:function(e,t){e=St.isArray(e)?e:[e];const{length:n}=e;let r,s;const o={};for(let i=0;i<n;i++){let n;if(r=e[i],s=r,!jn(r)&&(s=Cn[(n=String(r)).toLowerCase()],void 0===s))throw new Rt(`Unknown adapter '${n}'`);if(s&&(St.isFunction(s)||(s=s.get(t))))break;o[n||"#"+i]=s}if(!s){const e=Object.entries(o).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new Rt("There is no suitable adapter to dispatch the request "+(n?e.length>1?"since :\n"+e.map(Nn).join("\n"):" "+Nn(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return s},adapters:Cn};function Ln(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new on(null,e)}function Pn(e){Ln(e),e.headers=nn.from(e.headers),e.data=rn.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Bn.getAdapter(e.adapter||Yt.adapter,e)(e).then(function(t){return Ln(e),t.data=rn.call(e,e.transformResponse,t),t.headers=nn.from(t.headers),t},function(t){return sn(t)||(Ln(e),t&&t.response&&(t.response.data=rn.call(e,e.transformResponse,t.response),t.response.headers=nn.from(t.response.headers))),Promise.reject(t)})}const Un="1.13.2",Fn={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Fn[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Dn={};Fn.transitional=function(e,t,n){function r(e,t){return"[Axios v"+Un+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,s,o)=>{if(!1===e)throw new Rt(r(s," has been removed"+(t?" in "+t:"")),Rt.ERR_DEPRECATED);return t&&!Dn[s]&&(Dn[s]=!0,console.warn(r(s," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,s,o)}},Fn.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};var qn={assertOptions:function(e,t,n){if("object"!=typeof e)throw new Rt("options must be an object",Rt.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const o=r[s],i=t[o];if(i){const t=e[o],n=void 0===t||i(t,o,e);if(!0!==n)throw new Rt("option "+o+" must be "+n,Rt.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new Rt("Unknown option "+o,Rt.ERR_BAD_OPTION)}},validators:Fn};const In=qn.validators;let Mn=class{constructor(e){this.defaults=e||{},this.interceptors={request:new It,response:new It}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=mn(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:s}=t;void 0!==n&&qn.assertOptions(n,{silentJSONParsing:In.transitional(In.boolean),forcedJSONParsing:In.transitional(In.boolean),clarifyTimeoutError:In.transitional(In.boolean)},!1),null!=r&&(St.isFunction(r)?t.paramsSerializer={serialize:r}:qn.assertOptions(r,{encode:In.function,serialize:In.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),qn.assertOptions(t,{baseUrl:In.spelling("baseURL"),withXsrfToken:In.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=s&&St.merge(s.common,s[t.method]);s&&St.forEach(["delete","get","head","post","put","patch","common"],e=>{delete s[e]}),t.headers=nn.concat(o,s);const i=[];let a=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,i.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(!a){const e=[Pn.bind(this),void 0];for(e.unshift(...i),e.push(...c),l=e.length,u=Promise.resolve(t);h<l;)u=u.then(e[h++],e[h++]);return u}l=i.length;let d=t;for(;h<l;){const e=i[h++],t=i[h++];try{d=e(d)}catch(e){t.call(this,e);break}}try{u=Pn.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 qt(pn((e=mn(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};St.forEach(["delete","get","head","options"],function(e){Mn.prototype[e]=function(t,n){return this.request(mn(n||{},{method:e,url:t,data:(n||{}).data}))}}),St.forEach(["post","put","patch"],function(e){function t(t){return function(n,r,s){return this.request(mn(s||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Mn.prototype[e]=t(),Mn.prototype[e+"Form"]=t(!0)});const zn={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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(zn).forEach(([e,t])=>{zn[t]=e});const Hn=function e(t){const n=new Mn(t),r=Fe(Mn.prototype.request,n);return St.extend(r,Mn.prototype,n,{allOwnKeys:!0}),St.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(mn(t,n))},r}(Yt);Hn.Axios=Mn,Hn.CanceledError=on,Hn.CancelToken=class e{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 on(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)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}},Hn.isCancel=sn,Hn.VERSION=Un,Hn.toFormData=Lt,Hn.AxiosError=Rt,Hn.Cancel=Hn.CanceledError,Hn.all=function(e){return Promise.all(e)},Hn.spread=function(e){return function(t){return e.apply(null,t)}},Hn.isAxiosError=function(e){return St.isObject(e)&&!0===e.isAxiosError},Hn.mergeConfig=mn,Hn.AxiosHeaders=nn,Hn.formToJSON=e=>Gt(St.isHTMLForm(e)?new FormData(e):e),Hn.getAdapter=Bn.getAdapter,Hn.HttpStatusCode=zn,Hn.default=Hn;const{Axios:Vn,AxiosError:Wn,CanceledError:Kn,isCancel:Jn,CancelToken:$n,VERSION:Gn,all:Yn,Cancel:Xn,isAxiosError:Qn,spread:Zn,toFormData:er,AxiosHeaders:tr,HttpStatusCode:nr,formToJSON:rr,getAdapter:sr,mergeConfig:or}=Hn;!function(e,t){void 0===t&&(t={});var n=t.insertAt;if("undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css","top"===n&&r.firstChild?r.insertBefore(s,r.firstChild):r.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}}(".crm-widget-container{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif}.crm-chat-button{align-items:center;border:none;border-radius:50%;box-shadow:0 10px 25px rgba(0,0,0,.2);color:#fff;cursor:pointer;display:flex;font-size:24px;height:64px;justify-content:center;position:fixed;transition:all .2s;width:64px}.crm-chat-button:hover{transform:scale(1.1)}.crm-icon{height:32px;width:32px}.crm-icon-sm{height:24px;width:24px}.crm-badge{align-items:center;background-color:#ef4444;border-radius:50%;color:#fff;display:flex;font-size:12px;font-weight:600;height:20px;justify-content:center;position:absolute;right:-4px;top:-4px;width:20px}.crm-bottom-6{bottom:24px}.crm-right-6{right:24px}.crm-left-6{left:24px}.crm-top-6{top:24px}.crm-chat-window{background:#fff;border:1px solid #e5e7eb;border-radius:16px;box-shadow:0 20px 50px rgba(0,0,0,.3);display:flex;flex-direction:column;height:600px;max-width:448px;overflow:hidden;position:fixed;width:100%}.crm-chat-window.crm-dark{background:#1f2937;border-color:#374151}.crm-chat-window.crm-bottom-6{bottom:100px}.crm-chat-window.crm-right-6{right:24px}.crm-chat-window.crm-left-6{left:24px}.crm-chat-window.crm-top-6{top:100px}@media (max-width:640px){.crm-chat-window{border-radius:0;bottom:0!important;height:100vh;left:0!important;max-width:100%;right:0!important;top:0!important}}.crm-header{align-items:center;color:#fff;display:flex;justify-content:space-between;padding:16px 24px}.crm-header-content{align-items:center;display:flex;gap:12px}.crm-avatar{align-items:center;background:#fff;border-radius:50%;display:flex;font-size:20px;height:40px;justify-content:center;width:40px}.crm-title{font-size:18px;font-weight:600;margin:0}.crm-status{align-items:center;display:flex;font-size:14px;gap:8px;opacity:.9}.crm-status-dot{border-radius:50%;height:8px;width:8px}.crm-status-dot.crm-online{background-color:#10b981}.crm-status-dot.crm-offline{background-color:#ef4444}.crm-close-btn{background:hsla(0,0%,100%,.2);border:none;border-radius:50%;color:#fff;cursor:pointer;padding:8px;transition:background .2s}.crm-close-btn:hover{background:hsla(0,0%,100%,.3)}.crm-messages{background:#f9fafb;display:flex;flex:1;flex-direction:column;gap:16px;overflow-y:auto;padding:16px}.crm-dark .crm-messages{background:#111827}.crm-welcome-message{background:#fff;border:1px solid #e5e7eb;border-radius:8px;box-shadow:0 1px 3px rgba(0,0,0,.1);padding:16px}.crm-dark .crm-welcome-message{background:#1f2937;border-color:#374151;color:#d1d5db}.crm-welcome-message p{color:#374151;font-size:14px;margin:0}.crm-dark .crm-welcome-message p{color:#d1d5db}.crm-message{display:flex}.crm-message-guest{justify-content:flex-end}.crm-message-agent{justify-content:flex-start}.crm-message-bubble{border-radius:16px;box-shadow:0 1px 2px rgba(0,0,0,.1);max-width:75%;padding:10px 16px}.crm-message-guest .crm-message-bubble{border-bottom-right-radius:4px;color:#fff}.crm-message-agent .crm-message-bubble{background:#fff;border:1px solid #e5e7eb;border-bottom-left-radius:4px;color:#1f2937}.crm-dark .crm-message-agent .crm-message-bubble{background:#1f2937;border-color:#374151;color:#f3f4f6}.crm-agent-name{font-size:12px;font-weight:500;margin:0 0 4px;opacity:.7}.crm-message-text{font-size:14px;line-height:1.5;margin:0;white-space:pre-wrap;word-break:break-word}.crm-message-time{font-size:11px;margin:4px 0 0;opacity:.7}.crm-typing-indicator{display:flex;gap:4px;padding:4px 0}.crm-typing-dot{animation:typing 1.4s infinite;background:#9ca3af;border-radius:50%;height:8px;width:8px}.crm-typing-dot:nth-child(2){animation-delay:.2s}.crm-typing-dot:nth-child(3){animation-delay:.4s}@keyframes typing{0%,60%,to{transform:translateY(0)}30%{transform:translateY(-10px)}}.crm-input-container{background:#fff;border-top:1px solid #e5e7eb;padding:16px}.crm-dark .crm-input-container{background:#1f2937;border-color:#374151}.crm-input-wrapper{align-items:flex-end;display:flex;gap:8px}.crm-input{background:#f9fafb;border:1px solid #d1d5db;border-radius:12px;color:#1f2937;flex:1;font-family:inherit;font-size:14px;max-height:120px;min-height:48px;padding:12px 16px;resize:none}.crm-input:focus{border-color:#6366f1;box-shadow:0 0 0 3px rgba(99,102,241,.1);outline:none}.crm-input:disabled{cursor:not-allowed;opacity:.5}.crm-dark .crm-input{background:#111827;border-color:#4b5563;color:#f3f4f6}.crm-dark .crm-input::placeholder{color:#6b7280}.crm-send-btn{align-items:center;border:none;border-radius:12px;color:#fff;cursor:pointer;display:flex;flex-shrink:0;justify-content:center;padding:12px;transition:all .2s}.crm-send-btn:hover:not(:disabled){box-shadow:0 4px 12px rgba(0,0,0,.2)}.crm-send-btn:disabled{cursor:not-allowed;opacity:.5}.crm-input-hint{color:#9ca3af;font-size:11px;margin:8px 0 0;text-align:center}.crm-dark .crm-input-hint{color:#6b7280}.crm-messages::-webkit-scrollbar{width:6px}.crm-messages::-webkit-scrollbar-track{background:transparent}.crm-messages::-webkit-scrollbar-thumb{background:#d1d5db;border-radius:3px}.crm-dark .crm-messages::-webkit-scrollbar-thumb{background:#4b5563}.crm-messages::-webkit-scrollbar-thumb:hover{background:#9ca3af}");var ir=function(s){var o=s.apiKey,a=s.apiUrl,c=void 0===a?"https://chat-crm-backend-7mzo.onrender.com":a,h=s.primaryColor,f=void 0===h?"#4F46E5":h,m=s.position,g=void 0===m?"bottom-right":m,y=s.userData,b=void 0===y?null:y,w=s.welcomeMessage,v=void 0===w?"👋 Welcome! How can we help you today?":w,E=s.companyName,_=void 0===E?"Support":E,k=s.autoOpen,x=void 0!==k&&k,O=s.showNotifications,S=void 0===O||O,R=s.playSound,T=void 0!==R&&R,A=s.theme,C=void 0===A?"light":A,N=s.zIndex,j=void 0===N?9999:N,B=d(t(x),2),L=B[0],P=B[1],U=d(t([]),2),F=U[0],D=U[1],q=d(t(""),2),I=q[0],M=q[1],z=d(t(null),2),H=z[0],V=z[1],W=d(t(null),2),K=W[0],J=W[1],$=d(t(null),2),G=$[0],Y=$[1],X=d(t(!1),2),Q=X[0],Z=X[1],ee=d(t(!1),2),te=ee[0],ne=ee[1],re=d(t("Support Agent"),2),se=re[0],oe=re[1],ie=d(t(0),2),ae=ie[0],ce=ie[1],ue=n(null);r(function(){var e;null===(e=ue.current)||void 0===e||e.scrollIntoView({behavior:"smooth"})},[F]),r(function(){return L&&!H&&he(),function(){H&&H.disconnect()}},[L]);var le=function(){return b?{name:b.name||"Guest User",email:b.email||null,phone:b.phone||null,userId:b.userId||null}:{name:localStorage.getItem("chatGuestName")||"Guest User",email:localStorage.getItem("chatGuestEmail")||null,phone:localStorage.getItem("chatGuestPhone")||null,userId:localStorage.getItem("chatUserId")||null}},he=function(){var e=i(l().m(function e(){var t,n,r,s,i,a,h;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,t=le(),e.n=1,Hn.post("".concat(c,"/api/v1/webhook/guest-conversation"),{apiKey:o,guestName:t.name,guestEmail:t.email,guestPhone:t.phone,customUserId:t.userId});case 1:(n=e.v).data.status&&(r=n.data.data,s=r.guestId,i=r.conversationId,J(s),Y(i),localStorage.setItem("chatGuestId",s),localStorage.setItem("chatConversationId",i),(a=Ue(c,{query:{guestId:s,conversationId:i,apiKey:o},transports:["websocket","polling"]})).on("connect",function(){Z(!0),console.log("✅ Connected to Chat CRM")}),a.on("disconnect",function(){Z(!1)}),a.on("new-message",function(e){D(function(t){return[].concat(p(t),[u(u({},e),{},{sender:"agent",timestamp:new Date,read:!1})])}),ne(!1),!L&&S&&(ce(function(e){return e+1}),T&&pe())}),a.on("agent-typing",function(e){ne(!0),oe(e.agentName||"Support Agent"),setTimeout(function(){return ne(!1)},3e3)}),V(a)),e.n=3;break;case 2:e.p=2,h=e.v,console.error("❌ Chat initialization error:",h),alert("Failed to connect to chat. Please try again.");case 3:return e.a(2)}},e,null,[[0,2]])}));return function(){return e.apply(this,arguments)}}(),de=function(){var e=i(l().m(function e(){var t,n;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:if(I.trim()&&H&&Q){e.n=1;break}return e.a(2);case 1:return t={guestId:K,conversationId:G,message:I.trim(),timestamp:new Date},e.p=2,D(function(e){return[].concat(p(e),[u(u({},t),{},{sender:"guest",read:!0})])}),M(""),H.emit("send-message",t),e.n=3,Hn.post("".concat(c,"/api/v1/webhook/send-message"),{apiKey:o,guestId:K,conversationId:G,message:t.message});case 3:e.n=5;break;case 4:e.p=4,n=e.v,console.error("❌ Send message error:",n),D(function(e){return e.slice(0,-1)}),alert("Failed to send message. Please try again.");case 5:return e.a(2)}},e,null,[[2,4]])}));return function(){return e.apply(this,arguments)}}(),pe=function(){var e=new(window.AudioContext||window.webkitAudioContext),t=e.createOscillator(),n=e.createGain();t.connect(n),n.connect(e.destination),t.frequency.value=800,t.type="sine",n.gain.value=.1,t.start(),setTimeout(function(){return t.stop()},200)},fe=function(){var e={"bottom-right":"crm-bottom-6 crm-right-6","bottom-left":"crm-bottom-6 crm-left-6","top-right":"crm-top-6 crm-right-6","top-left":"crm-top-6 crm-left-6"};return e[g]||e["bottom-right"]},me="dark"===C||"auto"===C&&window.matchMedia("(prefers-color-scheme: dark)").matches;return e.createElement("div",{className:"crm-widget-container",style:{zIndex:j}},e.createElement("button",{onClick:function(){P(!0),ce(0)},className:"crm-chat-button ".concat(fe()),style:{backgroundColor:f},"aria-label":"Open chat"},L?e.createElement("svg",{className:"crm-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},e.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})):e.createElement("svg",{className:"crm-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},e.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})),!L&&ae>0&&e.createElement("span",{className:"crm-badge"},ae)),L&&e.createElement("div",{className:"crm-chat-window ".concat(fe()," ").concat(me?"crm-dark":"")},e.createElement("div",{className:"crm-header",style:{backgroundColor:f}},e.createElement("div",{className:"crm-header-content"},e.createElement("div",{className:"crm-avatar"},"💬"),e.createElement("div",null,e.createElement("h3",{className:"crm-title"},_),e.createElement("div",{className:"crm-status"},e.createElement("div",{className:"crm-status-dot ".concat(Q?"crm-online":"crm-offline")}),e.createElement("span",null,Q?"Online":"Connecting...")))),e.createElement("button",{onClick:function(){return P(!1)},className:"crm-close-btn"},e.createElement("svg",{className:"crm-icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},e.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})))),e.createElement("div",{className:"crm-messages"},0===F.length&&e.createElement("div",{className:"crm-welcome-message"},e.createElement("p",null,v)),F.map(function(t,n){return e.createElement("div",{key:n,className:"crm-message ".concat("guest"===t.sender?"crm-message-guest":"crm-message-agent")},e.createElement("div",{className:"crm-message-bubble",style:"guest"===t.sender?{backgroundColor:f}:{}},"agent"===t.sender&&e.createElement("p",{className:"crm-agent-name"},se),e.createElement("p",{className:"crm-message-text"},t.message),e.createElement("p",{className:"crm-message-time"},(r=t.timestamp,new Date(r).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"})))));var r}),te&&e.createElement("div",{className:"crm-message crm-message-agent"},e.createElement("div",{className:"crm-message-bubble"},e.createElement("div",{className:"crm-typing-indicator"},e.createElement("div",{className:"crm-typing-dot"}),e.createElement("div",{className:"crm-typing-dot"}),e.createElement("div",{className:"crm-typing-dot"})))),e.createElement("div",{ref:ue})),e.createElement("div",{className:"crm-input-container"},e.createElement("div",{className:"crm-input-wrapper"},e.createElement("textarea",{value:I,onChange:function(e){return M(e.target.value)},onKeyPress:function(e){"Enter"!==e.key||e.shiftKey||(e.preventDefault(),de())},placeholder:"Type your message...",rows:"1",className:"crm-input",disabled:!Q}),e.createElement("button",{onClick:de,disabled:!I.trim()||!Q,className:"crm-send-btn",style:{backgroundColor:f}},e.createElement("svg",{className:"crm-icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},e.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 19l9 2-9-18-9 18 9-2zm0 0v-8"})))),e.createElement("p",{className:"crm-input-hint"},"Press Enter to send • Shift+Enter for new line"))))};export{ir as ChatCRMWidget};
|
|
3
|
+
var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",s=r.toStringTag||"@@toStringTag";function o(r,n,s,o){var c=n&&n.prototype instanceof a?n:a,u=Object.create(c.prototype);return h(u,"_invoke",function(r,n,s){var o,a,c,u=0,l=s||[],h=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,r){return o=t,a=0,c=e,d.n=r,i}};function p(r,n){for(a=r,c=n,t=0;!h&&u&&!s&&t<l.length;t++){var s,o=l[t],p=d.p,f=o[2];r>3?(s=f===n)&&(c=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=p&&((s=r<2&&p<o[1])?(a=0,d.v=n,d.n=o[1]):p<f&&(s=r<3||o[0]>n||n>f)&&(o[4]=r,o[5]=n,d.n=f,a=0))}if(s||r>1)return i;throw h=!0,n}return function(s,l,f){if(u>1)throw TypeError("Generator is already running");for(h&&1===l&&p(l,f),a=l,c=f;(t=a<2?e:c)||!h;){o||(a?a<3?(a>1&&(d.n=-1),p(a,c)):d.n=c:d.v=c);try{if(u=2,o){if(a||(s="next"),t=o[s]){if(!(t=t.call(o,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(c=TypeError("The iterator does not provide a '"+s+"' method"),a=1);o=e}else if((t=(h=d.n<0)?c:r.call(n,d))!==i)break}catch(t){o=e,a=1,c=t}finally{u=1}}return{value:t,done:h}}}(r,s,o),!0),u}var i={};function a(){}function c(){}function u(){}t=Object.getPrototypeOf;var d=[][n]?t(t([][n]())):(h(t={},n,function(){return this}),t),p=u.prototype=a.prototype=Object.create(d);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,h(e,s,"GeneratorFunction")),e.prototype=Object.create(p),e}return c.prototype=u,h(p,"constructor",u),h(u,"constructor",c),c.displayName="GeneratorFunction",h(u,s,"GeneratorFunction"),h(p),h(p,s,"Generator"),h(p,n,function(){return this}),h(p,"toString",function(){return"[object Generator]"}),(l=function(){return{w:o,m:f}})()}function h(e,t,r,n){var s=Object.defineProperty;try{s({},"",{})}catch(e){s=0}h=function(e,t,r,n){function o(t,r){h(e,t,function(e){return this._invoke(t,r,e)})}t?s?s(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(o("next",0),o("throw",1),o("return",2))},h(e,t,r,n)}function d(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,s,o,i,a=[],c=!0,u=!1;try{if(o=(r=r.call(e)).next,0===t);else for(;!(c=(n=o.call(r)).done)&&(a.push(n.value),a.length!==t);c=!0);}catch(e){u=!0,s=e}finally{try{if(!c&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(u)throw s}}return a}}(e,t)||f(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 p(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||f(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 f(e,t){if(e){if("string"==typeof e)return s(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(e,t):void 0}}const m=Object.create(null);m.open="0",m.close="1",m.ping="2",m.pong="3",m.message="4",m.upgrade="5",m.noop="6";const g=Object.create(null);Object.keys(m).forEach(e=>{g[m[e]]=e});const y={type:"error",data:"parser error"},b="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),w="function"==typeof ArrayBuffer,v=e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,E=({type:e,data:t},r,n)=>b&&t instanceof Blob?r?n(t):_(t,n):w&&(t instanceof ArrayBuffer||v(t))?r?n(t):_(new Blob([t]),n):n(m[e]+(t||"")),_=(e,t)=>{const r=new FileReader;return r.onload=function(){const e=r.result.split(",")[1];t("b"+(e||""))},r.readAsDataURL(e)};function k(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let x;const O="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",S="undefined"==typeof Uint8Array?[]:new Uint8Array(256);for(let e=0;e<64;e++)S[O.charCodeAt(e)]=e;const R="function"==typeof ArrayBuffer,T=(e,t)=>{if("string"!=typeof e)return{type:"message",data:C(e,t)};const r=e.charAt(0);if("b"===r)return{type:"message",data:A(e.substring(1),t)};return g[r]?e.length>1?{type:g[r],data:e.substring(1)}:{type:g[r]}:y},A=(e,t)=>{if(R){const r=(e=>{let t,r,n,s,o,i=.75*e.length,a=e.length,c=0;"="===e[e.length-1]&&(i--,"="===e[e.length-2]&&i--);const u=new ArrayBuffer(i),l=new Uint8Array(u);for(t=0;t<a;t+=4)r=S[e.charCodeAt(t)],n=S[e.charCodeAt(t+1)],s=S[e.charCodeAt(t+2)],o=S[e.charCodeAt(t+3)],l[c++]=r<<2|n>>4,l[c++]=(15&n)<<4|s>>2,l[c++]=(3&s)<<6|63&o;return u})(e);return C(r,t)}return{base64:!0,data:e}},C=(e,t)=>"blob"===t?e instanceof Blob?e:new Blob([e]):e instanceof ArrayBuffer?e:e.buffer,N=String.fromCharCode(30);function j(){return new TransformStream({transform(e,t){!function(e,t){b&&e.data instanceof Blob?e.data.arrayBuffer().then(k).then(t):w&&(e.data instanceof ArrayBuffer||v(e.data))?t(k(e.data)):E(e,!1,e=>{x||(x=new TextEncoder),t(x.encode(e))})}(e,r=>{const n=r.length;let s;if(n<126)s=new Uint8Array(1),new DataView(s.buffer).setUint8(0,n);else if(n<65536){s=new Uint8Array(3);const e=new DataView(s.buffer);e.setUint8(0,126),e.setUint16(1,n)}else{s=new Uint8Array(9);const e=new DataView(s.buffer);e.setUint8(0,127),e.setBigUint64(1,BigInt(n))}e.data&&"string"!=typeof e.data&&(s[0]|=128),t.enqueue(s),t.enqueue(r)})}})}let B;function L(e){return e.reduce((e,t)=>e+t.length,0)}function P(e,t){if(e[0].length===t)return e.shift();const r=new Uint8Array(t);let n=0;for(let s=0;s<t;s++)r[s]=e[0][n++],n===e[0].length&&(e.shift(),n=0);return e.length&&n<e[0].length&&(e[0]=e[0].slice(n)),r}function U(e){if(e)return function(e){for(var t in U.prototype)e[t]=U.prototype[t];return e}(e)}U.prototype.on=U.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},U.prototype.once=function(e,t){function r(){this.off(e,r),t.apply(this,arguments)}return r.fn=t,this.on(e,r),this},U.prototype.off=U.prototype.removeListener=U.prototype.removeAllListeners=U.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,n=this._callbacks["$"+e];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var s=0;s<n.length;s++)if((r=n[s])===t||r.fn===t){n.splice(s,1);break}return 0===n.length&&delete this._callbacks["$"+e],this},U.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),r=this._callbacks["$"+e],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(r){n=0;for(var s=(r=r.slice(0)).length;n<s;++n)r[n].apply(this,t)}return this},U.prototype.emitReserved=U.prototype.emit,U.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},U.prototype.hasListeners=function(e){return!!this.listeners(e).length};const F="function"==typeof Promise&&"function"==typeof Promise.resolve?e=>Promise.resolve().then(e):(e,t)=>t(e,0),D="undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this")();function q(e,...t){return t.reduce((t,r)=>(e.hasOwnProperty(r)&&(t[r]=e[r]),t),{})}const I=D.setTimeout,M=D.clearTimeout;function z(e,t){t.useNativeTimers?(e.setTimeoutFn=I.bind(D),e.clearTimeoutFn=M.bind(D)):(e.setTimeoutFn=D.setTimeout.bind(D),e.clearTimeoutFn=D.clearTimeout.bind(D))}function H(e){return"string"==typeof e?function(e){let t=0,r=0;for(let n=0,s=e.length;n<s;n++)t=e.charCodeAt(n),t<128?r+=1:t<2048?r+=2:t<55296||t>=57344?r+=3:(n++,r+=4);return r}(e):Math.ceil(1.33*(e.byteLength||e.size))}function V(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}class W extends Error{constructor(e,t,r){super(e),this.description=t,this.context=r,this.type="TransportError"}}class K extends U{constructor(e){super(),this.writable=!1,z(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,t,r){return super.emitReserved("error",new W(e,t,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this}send(e){"open"===this.readyState&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const t=T(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,t={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){const e=this.opts.hostname;return-1===e.indexOf(":")?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(443!==this.opts.port)||!this.opts.secure&&80!==Number(this.opts.port))?":"+this.opts.port:""}_query(e){const t=function(e){let t="";for(let r in e)e.hasOwnProperty(r)&&(t.length&&(t+="&"),t+=encodeURIComponent(r)+"="+encodeURIComponent(e[r]));return t}(e);return t.length?"?"+t:""}}class J extends K{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";const t=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let e=0;this._polling&&(e++,this.once("pollComplete",function(){--e||t()})),this.writable||(e++,this.once("drain",function(){--e||t()}))}else t()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){((e,t)=>{const r=e.split(N),n=[];for(let e=0;e<r.length;e++){const s=T(r[e],t);if(n.push(s),"error"===s.type)break}return n})(e,this.socket.binaryType).forEach(e=>{if("opening"===this.readyState&&"open"===e.type&&this.onOpen(),"close"===e.type)return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(e)}),"closed"!==this.readyState&&(this._polling=!1,this.emitReserved("pollComplete"),"open"===this.readyState&&this._poll())}doClose(){const e=()=>{this.write([{type:"close"}])};"open"===this.readyState?e():this.once("open",e)}write(e){this.writable=!1,((e,t)=>{const r=e.length,n=new Array(r);let s=0;e.forEach((e,o)=>{E(e,!1,e=>{n[o]=e,++s===r&&t(n.join(N))})})})(e,e=>{this.doWrite(e,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",t=this.query||{};return!1!==this.opts.timestampRequests&&(t[this.opts.timestampParam]=V()),this.supportsBinary||t.sid||(t.b64=1),this.createUri(e,t)}}let $=!1;try{$="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(e){}const G=$;function Y(){}class X extends J{constructor(e){if(super(e),"undefined"!=typeof location){const t="https:"===location.protocol;let r=location.port;r||(r=t?"443":"80"),this.xd="undefined"!=typeof location&&e.hostname!==location.hostname||r!==e.port}}doWrite(e,t){const r=this.request({method:"POST",data:e});r.on("success",t),r.on("error",(e,t)=>{this.onError("xhr post error",e,t)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(e,t)=>{this.onError("xhr poll error",e,t)}),this.pollXhr=e}}class Q extends U{constructor(e,t,r){super(),this.createRequest=e,z(this,r),this._opts=r,this._method=r.method||"GET",this._uri=t,this._data=void 0!==r.data?r.data:null,this._create()}_create(){var e;const t=q(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(t);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let e in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(e)&&r.setRequestHeader(e,this._opts.extraHeaders[e])}}catch(e){}if("POST"===this._method)try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(e){}try{r.setRequestHeader("Accept","*/*")}catch(e){}null===(e=this._opts.cookieJar)||void 0===e||e.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var e;3===r.readyState&&(null===(e=this._opts.cookieJar)||void 0===e||e.parseCookies(r.getResponseHeader("set-cookie"))),4===r.readyState&&(200===r.status||1223===r.status?this._onLoad():this.setTimeoutFn(()=>{this._onError("number"==typeof r.status?r.status:0)},0))},r.send(this._data)}catch(e){return void this.setTimeoutFn(()=>{this._onError(e)},0)}"undefined"!=typeof document&&(this._index=Q.requestsCount++,Q.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(void 0!==this._xhr&&null!==this._xhr){if(this._xhr.onreadystatechange=Y,e)try{this._xhr.abort()}catch(e){}"undefined"!=typeof document&&delete Q.requests[this._index],this._xhr=null}}_onLoad(){const e=this._xhr.responseText;null!==e&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}if(Q.requestsCount=0,Q.requests={},"undefined"!=typeof document)if("function"==typeof attachEvent)attachEvent("onunload",Z);else if("function"==typeof addEventListener){addEventListener("onpagehide"in D?"pagehide":"unload",Z,!1)}function Z(){for(let e in Q.requests)Q.requests.hasOwnProperty(e)&&Q.requests[e].abort()}const ee=function(){const e=te({xdomain:!1});return e&&null!==e.responseType}();function te(e){const t=e.xdomain;try{if("undefined"!=typeof XMLHttpRequest&&(!t||G))return new XMLHttpRequest}catch(e){}if(!t)try{return new(D[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(e){}}const re="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();class ne extends K{get name(){return"websocket"}doOpen(){const e=this.uri(),t=this.opts.protocols,r=re?{}:q(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,t,r)}catch(e){return this.emitReserved("error",e)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const r=e[t],n=t===e.length-1;E(r,this.supportsBinary,e=>{try{this.doWrite(r,e)}catch(e){}n&&F(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){void 0!==this.ws&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=V()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}}const se=D.WebSocket||D.MozWebSocket;const oe={websocket:class extends ne{createSocket(e,t,r){return re?new se(e,t,r):t?new se(e,t):new se(e)}doWrite(e,t){this.ws.send(t)}},webtransport:class extends K{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{const t=function(e,t){B||(B=new TextDecoder);const r=[];let n=0,s=-1,o=!1;return new TransformStream({transform(i,a){for(r.push(i);;){if(0===n){if(L(r)<1)break;const e=P(r,1);o=!(128&~e[0]),s=127&e[0],n=s<126?3:126===s?1:2}else if(1===n){if(L(r)<2)break;const e=P(r,2);s=new DataView(e.buffer,e.byteOffset,e.length).getUint16(0),n=3}else if(2===n){if(L(r)<8)break;const e=P(r,8),t=new DataView(e.buffer,e.byteOffset,e.length),o=t.getUint32(0);if(o>Math.pow(2,21)-1){a.enqueue(y);break}s=o*Math.pow(2,32)+t.getUint32(4),n=3}else{if(L(r)<s)break;const e=P(r,s);a.enqueue(T(o?e:B.decode(e),t)),n=0}if(0===s||s>e){a.enqueue(y);break}}}})}(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=e.readable.pipeThrough(t).getReader(),n=j();n.readable.pipeTo(e.writable),this._writer=n.writable.getWriter();const s=()=>{r.read().then(({done:e,value:t})=>{e||(this.onPacket(t),s())}).catch(e=>{})};s();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const r=e[t],n=t===e.length-1;this._writer.write(r).then(()=>{n&&F(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;null===(e=this._transport)||void 0===e||e.close()}},polling:class extends X{constructor(e){super(e);const t=e&&e.forceBase64;this.supportsBinary=ee&&!t}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new Q(te,this.uri(),e)}}},ie=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,ae=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function ce(e){if(e.length>8e3)throw"URI too long";const t=e,r=e.indexOf("["),n=e.indexOf("]");-1!=r&&-1!=n&&(e=e.substring(0,r)+e.substring(r,n).replace(/:/g,";")+e.substring(n,e.length));let s=ie.exec(e||""),o={},i=14;for(;i--;)o[ae[i]]=s[i]||"";return-1!=r&&-1!=n&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=function(e,t){const r=/\/{2,9}/g,n=t.replace(r,"/").split("/");"/"!=t.slice(0,1)&&0!==t.length||n.splice(0,1);"/"==t.slice(-1)&&n.splice(n.length-1,1);return n}(0,o.path),o.queryKey=function(e,t){const r={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(e,t,n){t&&(r[t]=n)}),r}(0,o.query),o}const ue="function"==typeof addEventListener&&"function"==typeof removeEventListener,le=[];ue&&addEventListener("offline",()=>{le.forEach(e=>e())},!1);class he extends U{constructor(e,t){if(super(),this.binaryType="arraybuffer",this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&"object"==typeof e&&(t=e,e=null),e){const r=ce(e);t.hostname=r.host,t.secure="https"===r.protocol||"wss"===r.protocol,t.port=r.port,r.query&&(t.query=r.query)}else t.host&&(t.hostname=ce(t.host).host);z(this,t),this.secure=null!=t.secure?t.secure:"undefined"!=typeof location&&"https:"===location.protocol,t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=t.port||("undefined"!=typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},t.transports.forEach(e=>{const t=e.prototype.name;this.transports.push(t),this._transportsByName[t]=e}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},t),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),"string"==typeof this.opts.query&&(this.opts.query=function(e){let t={},r=e.split("&");for(let e=0,n=r.length;e<n;e++){let n=r[e].split("=");t[decodeURIComponent(n[0])]=decodeURIComponent(n[1])}return t}(this.opts.query)),ue&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),"localhost"!==this.hostname&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},le.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){const t=Object.assign({},this.opts.query);t.EIO=4,t.transport=e,this.id&&(t.sid=this.id);const r=Object.assign({},this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](r)}_open(){if(0===this.transports.length)return void this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);const e=this.opts.rememberUpgrade&&he.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket")?"websocket":this.transports[0];this.readyState="opening";const t=this.createTransport(e);t.open(),this.setTransport(t)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",e=>this._onClose("transport close",e))}onOpen(){this.readyState="open",he.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush()}_onPacket(e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const t=new Error("server error");t.code=e.data,this._onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data)}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),"closed"!==this.readyState&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},e),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}flush(){if("closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&"polling"===this.transport.name&&this.writeBuffer.length>1))return this.writeBuffer;let e=1;for(let t=0;t<this.writeBuffer.length;t++){const r=this.writeBuffer[t].data;if(r&&(e+=H(r)),t>0&&e>this._maxPayload)return this.writeBuffer.slice(0,t);e+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,F(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,t,r){return this._sendPacket("message",e,t,r),this}send(e,t,r){return this._sendPacket("message",e,t,r),this}_sendPacket(e,t,r,n){if("function"==typeof t&&(n=t,t=void 0),"function"==typeof r&&(n=r,r=null),"closing"===this.readyState||"closed"===this.readyState)return;(r=r||{}).compress=!1!==r.compress;const s={type:e,data:t,options:r};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),n&&this.once("flush",n),this.flush()}close(){const e=()=>{this._onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},r=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():e()}):this.upgrading?r():e()),this}_onError(e){if(he.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&"opening"===this.readyState)return this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,t){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),ue&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const e=le.indexOf(this._offlineEventListener);-1!==e&&le.splice(e,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this._prevBufferLen=0}}}he.protocol=4;class de extends he{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),"open"===this.readyState&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let t=this.createTransport(e),r=!1;he.priorWebsocketSuccess=!1;const n=()=>{r||(t.send([{type:"ping",data:"probe"}]),t.once("packet",e=>{if(!r)if("pong"===e.type&&"probe"===e.data){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;he.priorWebsocketSuccess="websocket"===t.name,this.transport.pause(()=>{r||"closed"!==this.readyState&&(u(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())})}else{const e=new Error("probe error");e.transport=t.name,this.emitReserved("upgradeError",e)}}))};function s(){r||(r=!0,u(),t.close(),t=null)}const o=e=>{const r=new Error("probe error: "+e);r.transport=t.name,s(),this.emitReserved("upgradeError",r)};function i(){o("transport closed")}function a(){o("socket closed")}function c(e){t&&e.name!==t.name&&s()}const u=()=>{t.removeListener("open",n),t.removeListener("error",o),t.removeListener("close",i),this.off("close",a),this.off("upgrading",c)};t.once("open",n),t.once("error",o),t.once("close",i),this.once("close",a),this.once("upgrading",c),-1!==this._upgrades.indexOf("webtransport")&&"webtransport"!==e?this.setTimeoutFn(()=>{r||t.open()},200):t.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){const t=[];for(let r=0;r<e.length;r++)~this.transports.indexOf(e[r])&&t.push(e[r]);return t}}let pe=class extends de{constructor(e,t={}){const r="object"==typeof e?e:t;(!r.transports||r.transports&&"string"==typeof r.transports[0])&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(e=>oe[e]).filter(e=>!!e)),super(e,r)}};const fe="function"==typeof ArrayBuffer,me=Object.prototype.toString,ge="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===me.call(Blob),ye="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===me.call(File);function be(e){return fe&&(e instanceof ArrayBuffer||(e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer)(e))||ge&&e instanceof Blob||ye&&e instanceof File}function we(e,t){if(!e||"object"!=typeof e)return!1;if(Array.isArray(e)){for(let t=0,r=e.length;t<r;t++)if(we(e[t]))return!0;return!1}if(be(e))return!0;if(e.toJSON&&"function"==typeof e.toJSON&&1===arguments.length)return we(e.toJSON(),!0);for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&we(e[t]))return!0;return!1}function ve(e){const t=[],r=e.data,n=e;return n.data=Ee(r,t),n.attachments=t.length,{packet:n,buffers:t}}function Ee(e,t){if(!e)return e;if(be(e)){const r={_placeholder:!0,num:t.length};return t.push(e),r}if(Array.isArray(e)){const r=new Array(e.length);for(let n=0;n<e.length;n++)r[n]=Ee(e[n],t);return r}if("object"==typeof e&&!(e instanceof Date)){const r={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=Ee(e[n],t));return r}return e}function _e(e,t){return e.data=ke(e.data,t),delete e.attachments,e}function ke(e,t){if(!e)return e;if(e&&!0===e._placeholder){if("number"==typeof e.num&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}if(Array.isArray(e))for(let r=0;r<e.length;r++)e[r]=ke(e[r],t);else if("object"==typeof e)for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(e[r]=ke(e[r],t));return e}const xe=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var Oe;!function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"}(Oe||(Oe={}));function Se(e){return"[object Object]"===Object.prototype.toString.call(e)}class Re extends U{constructor(e){super(),this.reviver=e}add(e){let t;if("string"==typeof e){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);const r=t.type===Oe.BINARY_EVENT;r||t.type===Oe.BINARY_ACK?(t.type=r?Oe.EVENT:Oe.ACK,this.reconstructor=new Te(t),0===t.attachments&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else{if(!be(e)&&!e.base64)throw new Error("Unknown type: "+e);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t))}}decodeString(e){let t=0;const r={type:Number(e.charAt(0))};if(void 0===Oe[r.type])throw new Error("unknown packet type "+r.type);if(r.type===Oe.BINARY_EVENT||r.type===Oe.BINARY_ACK){const n=t+1;for(;"-"!==e.charAt(++t)&&t!=e.length;);const s=e.substring(n,t);if(s!=Number(s)||"-"!==e.charAt(t))throw new Error("Illegal attachments");r.attachments=Number(s)}if("/"===e.charAt(t+1)){const n=t+1;for(;++t;){if(","===e.charAt(t))break;if(t===e.length)break}r.nsp=e.substring(n,t)}else r.nsp="/";const n=e.charAt(t+1);if(""!==n&&Number(n)==n){const n=t+1;for(;++t;){const r=e.charAt(t);if(null==r||Number(r)!=r){--t;break}if(t===e.length)break}r.id=Number(e.substring(n,t+1))}if(e.charAt(++t)){const n=this.tryParse(e.substr(t));if(!Re.isPayloadValid(r.type,n))throw new Error("invalid payload");r.data=n}return r}tryParse(e){try{return JSON.parse(e,this.reviver)}catch(e){return!1}}static isPayloadValid(e,t){switch(e){case Oe.CONNECT:return Se(t);case Oe.DISCONNECT:return void 0===t;case Oe.CONNECT_ERROR:return"string"==typeof t||Se(t);case Oe.EVENT:case Oe.BINARY_EVENT:return Array.isArray(t)&&("number"==typeof t[0]||"string"==typeof t[0]&&-1===xe.indexOf(t[0]));case Oe.ACK:case Oe.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Te{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const e=_e(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}var Ae=Object.freeze({__proto__:null,Decoder:Re,Encoder:class{constructor(e){this.replacer=e}encode(e){return e.type!==Oe.EVENT&&e.type!==Oe.ACK||!we(e)?[this.encodeAsString(e)]:this.encodeAsBinary({type:e.type===Oe.EVENT?Oe.BINARY_EVENT:Oe.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id})}encodeAsString(e){let t=""+e.type;return e.type!==Oe.BINARY_EVENT&&e.type!==Oe.BINARY_ACK||(t+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(t+=e.nsp+","),null!=e.id&&(t+=e.id),null!=e.data&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){const t=ve(e),r=this.encodeAsString(t.packet),n=t.buffers;return n.unshift(r),n}},get PacketType(){return Oe},protocol:5});function Ce(e,t,r){return e.on(t,r),function(){e.off(t,r)}}const Ne=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class je extends U{constructor(e,t,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[Ce(e,"open",this.onopen.bind(this)),Ce(e,"packet",this.onpacket.bind(this)),Ce(e,"error",this.onerror.bind(this)),Ce(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){var r,n,s;if(Ne.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;const o={type:Oe.EVENT,data:t,options:{}};if(o.options.compress=!1!==this.flags.compress,"function"==typeof t[t.length-1]){const e=this.ids++,r=t.pop();this._registerAckCallback(e,r),o.id=e}const i=null===(n=null===(r=this.io.engine)||void 0===r?void 0:r.transport)||void 0===n?void 0:n.writable,a=this.connected&&!(null===(s=this.io.engine)||void 0===s?void 0:s._hasPingExpired());return this.flags.volatile&&!i||(a?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(e,t){var r;const n=null!==(r=this.flags.timeout)&&void 0!==r?r:this._opts.ackTimeout;if(void 0===n)return void(this.acks[e]=t);const s=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let t=0;t<this.sendBuffer.length;t++)this.sendBuffer[t].id===e&&this.sendBuffer.splice(t,1);t.call(this,new Error("operation has timed out"))},n),o=(...e)=>{this.io.clearTimeoutFn(s),t.apply(this,e)};o.withError=!0,this.acks[e]=o}emitWithAck(e,...t){return new Promise((r,n)=>{const s=(e,t)=>e?n(e):r(t);s.withError=!0,t.push(s),this.emit(e,...t)})}_addToQueue(e){let t;"function"==typeof e[e.length-1]&&(t=e.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((e,...n)=>{if(r!==this._queue[0])return;return null!==e?r.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(e)):(this._queue.shift(),t&&t(null,...n)),r.pending=!1,this._drainQueue()}),this._queue.push(r),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||0===this._queue.length)return;const t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){"function"==typeof this.auth?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:Oe.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(t=>String(t.id)===e)){const t=this.acks[e];delete this.acks[e],t.withError&&t.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case Oe.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Oe.EVENT:case Oe.BINARY_EVENT:this.onevent(e);break;case Oe.ACK:case Oe.BINARY_ACK:this.onack(e);break;case Oe.DISCONNECT:this.ondisconnect();break;case Oe.CONNECT_ERROR:this.destroy();const t=new Error(e.data.message);t.data=e.data.data,this.emitReserved("connect_error",t)}}onevent(e){const t=e.data||[];null!=e.id&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const r of t)r.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&"string"==typeof e[e.length-1]&&(this._lastOffset=e[e.length-1])}ack(e){const t=this;let r=!1;return function(...n){r||(r=!0,t.packet({type:Oe.ACK,id:e,data:n}))}}onack(e){const t=this.acks[e.id];"function"==typeof t&&(delete this.acks[e.id],t.withError&&e.data.unshift(null),t.apply(this,e.data))}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Oe.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let r=0;r<t.length;r++)if(e===t[r])return t.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const t=this._anyOutgoingListeners;for(let r=0;r<t.length;r++)if(e===t[r])return t.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const t=this._anyOutgoingListeners.slice();for(const r of t)r.apply(this,e.data)}}}function Be(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Be.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),r=Math.floor(t*this.jitter*e);e=1&Math.floor(10*t)?e+r:e-r}return 0|Math.min(e,this.max)},Be.prototype.reset=function(){this.attempts=0},Be.prototype.setMin=function(e){this.ms=e},Be.prototype.setMax=function(e){this.max=e},Be.prototype.setJitter=function(e){this.jitter=e};class Le extends U{constructor(e,t){var r;super(),this.nsps={},this.subs=[],e&&"object"==typeof e&&(t=e,e=void 0),(t=t||{}).path=t.path||"/socket.io",this.opts=t,z(this,t),this.reconnection(!1!==t.reconnection),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor(null!==(r=t.randomizationFactor)&&void 0!==r?r:.5),this.backoff=new Be({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==t.timeout?2e4:t.timeout),this._readyState="closed",this.uri=e;const n=t.parser||Ae;this.encoder=new n.Encoder,this.decoder=new n.Decoder,this._autoConnect=!1!==t.autoConnect,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return void 0===e?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return void 0===e?this._reconnectionDelay:(this._reconnectionDelay=e,null===(t=this.backoff)||void 0===t||t.setMin(e),this)}randomizationFactor(e){var t;return void 0===e?this._randomizationFactor:(this._randomizationFactor=e,null===(t=this.backoff)||void 0===t||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return void 0===e?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,null===(t=this.backoff)||void 0===t||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new pe(this.uri,this.opts);const t=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const n=Ce(t,"open",function(){r.onopen(),e&&e()}),s=t=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",t),e?e(t):this.maybeReconnectOnOpen()},o=Ce(t,"error",s);if(!1!==this._timeout){const e=this._timeout,r=this.setTimeoutFn(()=>{n(),s(new Error("timeout")),t.close()},e);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}return this.subs.push(n),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(Ce(e,"ping",this.onping.bind(this)),Ce(e,"data",this.ondata.bind(this)),Ce(e,"error",this.onerror.bind(this)),Ce(e,"close",this.onclose.bind(this)),Ce(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(e){this.onclose("parse error",e)}}ondecoded(e){F(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let r=this.nsps[e];return r?this._autoConnect&&!r.active&&r.connect():(r=new je(this,e,t),this.nsps[e]=r),r}_destroy(e){const t=Object.keys(this.nsps);for(const e of t){if(this.nsps[e].active)return}this._close()}_packet(e){const t=this.encoder.encode(e);for(let r=0;r<t.length;r++)this.engine.write(t[r],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,t){var r;this.cleanup(),null===(r=this.engine)||void 0===r||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),e.skipReconnect||e.open(t=>{t?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",t)):e.onreconnect()}))},t);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const Pe={};function Ue(e,t){"object"==typeof e&&(t=e,e=void 0);const r=function(e,t="",r){let n=e;r=r||"undefined"!=typeof location&&location,null==e&&(e=r.protocol+"//"+r.host),"string"==typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?r.protocol+e:r.host+e),/^(https?|wss?):\/\//.test(e)||(e=void 0!==r?r.protocol+"//"+e:"https://"+e),n=ce(e)),n.port||(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443")),n.path=n.path||"/";const s=-1!==n.host.indexOf(":")?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+s+":"+n.port+t,n.href=n.protocol+"://"+s+(r&&r.port===n.port?"":":"+n.port),n}(e,(t=t||{}).path||"/socket.io"),n=r.source,s=r.id,o=r.path,i=Pe[s]&&o in Pe[s].nsps;let a;return t.forceNew||t["force new connection"]||!1===t.multiplex||i?a=new Le(n,t):(Pe[s]||(Pe[s]=new Le(n,t)),a=Pe[s]),r.query&&!t.query&&(t.query=r.queryKey),a.socket(r.path,t)}function Fe(e,t){return function(){return e.apply(t,arguments)}}Object.assign(Ue,{Manager:Le,Socket:je,io:Ue,connect:Ue});const{toString:De}=Object.prototype,{getPrototypeOf:qe}=Object,{iterator:Ie,toStringTag:Me}=Symbol,ze=(e=>t=>{const r=De.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),He=e=>(e=e.toLowerCase(),t=>ze(t)===e),Ve=e=>t=>typeof t===e,{isArray:We}=Array,Ke=Ve("undefined");function Je(e){return null!==e&&!Ke(e)&&null!==e.constructor&&!Ke(e.constructor)&&Ye(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const $e=He("ArrayBuffer");const Ge=Ve("string"),Ye=Ve("function"),Xe=Ve("number"),Qe=e=>null!==e&&"object"==typeof e,Ze=e=>{if("object"!==ze(e))return!1;const t=qe(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Me in e||Ie in e)},et=He("Date"),tt=He("File"),rt=He("Blob"),nt=He("FileList"),st=He("URLSearchParams"),[ot,it,at,ct]=["ReadableStream","Request","Response","Headers"].map(He);function ut(e,t,{allOwnKeys:r=!1}={}){if(null==e)return;let n,s;if("object"!=typeof e&&(e=[e]),We(e))for(n=0,s=e.length;n<s;n++)t.call(null,e[n],n,e);else{if(Je(e))return;const s=r?Object.getOwnPropertyNames(e):Object.keys(e),o=s.length;let i;for(n=0;n<o;n++)i=s[n],t.call(null,e[i],i,e)}}function lt(e,t){if(Je(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n,s=r.length;for(;s-- >0;)if(n=r[s],t===n.toLowerCase())return n;return null}const ht="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,dt=e=>!Ke(e)&&e!==ht;const pt=(ft="undefined"!=typeof Uint8Array&&qe(Uint8Array),e=>ft&&e instanceof ft);var ft;const mt=He("HTMLFormElement"),gt=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),yt=He("RegExp"),bt=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};ut(r,(r,s)=>{let o;!1!==(o=t(r,s,e))&&(n[s]=o||r)}),Object.defineProperties(e,n)};const wt=He("AsyncFunction"),vt=(Et="function"==typeof setImmediate,_t=Ye(ht.postMessage),Et?setImmediate:_t?(kt=`axios@${Math.random()}`,xt=[],ht.addEventListener("message",({source:e,data:t})=>{e===ht&&t===kt&&xt.length&&xt.shift()()},!1),e=>{xt.push(e),ht.postMessage(kt,"*")}):e=>setTimeout(e));var Et,_t,kt,xt;const Ot="undefined"!=typeof queueMicrotask?queueMicrotask.bind(ht):"undefined"!=typeof process&&process.nextTick||vt;var St={isArray:We,isArrayBuffer:$e,isBuffer:Je,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||Ye(e.append)&&("formdata"===(t=ze(e))||"object"===t&&Ye(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&$e(e.buffer),t},isString:Ge,isNumber:Xe,isBoolean:e=>!0===e||!1===e,isObject:Qe,isPlainObject:Ze,isEmptyObject:e=>{if(!Qe(e)||Je(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:ot,isRequest:it,isResponse:at,isHeaders:ct,isUndefined:Ke,isDate:et,isFile:tt,isBlob:rt,isRegExp:yt,isFunction:Ye,isStream:e=>Qe(e)&&Ye(e.pipe),isURLSearchParams:st,isTypedArray:pt,isFileList:nt,forEach:ut,merge:function e(){const{caseless:t,skipUndefined:r}=dt(this)&&this||{},n={},s=(s,o)=>{const i=t&<(n,o)||o;Ze(n[i])&&Ze(s)?n[i]=e(n[i],s):Ze(s)?n[i]=e({},s):We(s)?n[i]=s.slice():r&&Ke(s)||(n[i]=s)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&ut(arguments[e],s);return n},extend:(e,t,r,{allOwnKeys:n}={})=>(ut(t,(t,n)=>{r&&Ye(t)?e[n]=Fe(t,r):e[n]=t},{allOwnKeys:n}),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,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,n)=>{let s,o,i;const a={};if(t=t||{},null==e)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)i=s[o],n&&!n(i,e,t)||a[i]||(t[i]=e[i],a[i]=!0);e=!1!==r&&qe(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:ze,kindOfTest:He,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return-1!==n&&n===r},toArray:e=>{if(!e)return null;if(We(e))return e;let t=e.length;if(!Xe(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{const r=(e&&e[Ie]).call(e);let n;for(;(n=r.next())&&!n.done;){const r=n.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>{let r;const n=[];for(;null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:mt,hasOwnProperty:gt,hasOwnProp:gt,reduceDescriptors:bt,freezeMethods:e=>{bt(e,(t,r)=>{if(Ye(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=e[r];Ye(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))})},toObjectSet:(e,t)=>{const r={},n=e=>{e.forEach(e=>{r[e]=!0})};return We(e)?n(e):n(String(e).split(t)),r},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,r){return t.toUpperCase()+r}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:lt,global:ht,isContextDefined:dt,isSpecCompliantForm:function(e){return!!(e&&Ye(e.append)&&"FormData"===e[Me]&&e[Ie])},toJSONObject:e=>{const t=new Array(10),r=(e,n)=>{if(Qe(e)){if(t.indexOf(e)>=0)return;if(Je(e))return e;if(!("toJSON"in e)){t[n]=e;const s=We(e)?[]:{};return ut(e,(e,t)=>{const o=r(e,n+1);!Ke(o)&&(s[t]=o)}),t[n]=void 0,s}}return e};return r(e,0)},isAsyncFn:wt,isThenable:e=>e&&(Qe(e)||Ye(e))&&Ye(e.then)&&Ye(e.catch),setImmediate:vt,asap:Ot,isIterable:e=>null!=e&&Ye(e[Ie])};function Rt(e,t,r,n,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),r&&(this.config=r),n&&(this.request=n),s&&(this.response=s,this.status=s.status?s.status:null)}St.inherits(Rt,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:St.toJSONObject(this.config),code:this.code,status:this.status}}});const Tt=Rt.prototype,At={};["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=>{At[e]={value:e}}),Object.defineProperties(Rt,At),Object.defineProperty(Tt,"isAxiosError",{value:!0}),Rt.from=(e,t,r,n,s,o)=>{const i=Object.create(Tt);St.toFlatObject(e,i,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e);const a=e&&e.message?e.message:"Error",c=null==t&&e?e.code:t;return Rt.call(i,a,c,r,n,s),e&&null==i.cause&&Object.defineProperty(i,"cause",{value:e,configurable:!0}),i.name=e&&e.name||"Error",o&&Object.assign(i,o),i};function Ct(e){return St.isPlainObject(e)||St.isArray(e)}function Nt(e){return St.endsWith(e,"[]")?e.slice(0,-2):e}function jt(e,t,r){return e?e.concat(t).map(function(e,t){return e=Nt(e),!r&&t?"["+e+"]":e}).join(r?".":""):t}const Bt=St.toFlatObject(St,{},null,function(e){return/^is[A-Z]/.test(e)});function Lt(e,t,r){if(!St.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const n=(r=St.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!St.isUndefined(t[e])})).metaTokens,s=r.visitor||u,o=r.dots,i=r.indexes,a=(r.Blob||"undefined"!=typeof Blob&&Blob)&&St.isSpecCompliantForm(t);if(!St.isFunction(s))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(St.isDate(e))return e.toISOString();if(St.isBoolean(e))return e.toString();if(!a&&St.isBlob(e))throw new Rt("Blob is not supported. Use a Buffer instead.");return St.isArrayBuffer(e)||St.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function u(e,r,s){let a=e;if(e&&!s&&"object"==typeof e)if(St.endsWith(r,"{}"))r=n?r:r.slice(0,-2),e=JSON.stringify(e);else if(St.isArray(e)&&function(e){return St.isArray(e)&&!e.some(Ct)}(e)||(St.isFileList(e)||St.endsWith(r,"[]"))&&(a=St.toArray(e)))return r=Nt(r),a.forEach(function(e,n){!St.isUndefined(e)&&null!==e&&t.append(!0===i?jt([r],n,o):null===i?r:r+"[]",c(e))}),!1;return!!Ct(e)||(t.append(jt(s,r,o),c(e)),!1)}const l=[],h=Object.assign(Bt,{defaultVisitor:u,convertValue:c,isVisitable:Ct});if(!St.isObject(e))throw new TypeError("data must be an object");return function e(r,n){if(!St.isUndefined(r)){if(-1!==l.indexOf(r))throw Error("Circular reference detected in "+n.join("."));l.push(r),St.forEach(r,function(r,o){!0===(!(St.isUndefined(r)||null===r)&&s.call(t,r,St.isString(o)?o.trim():o,n,h))&&e(r,n?n.concat(o):[o])}),l.pop()}}(e),t}function Pt(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function Ut(e,t){this._pairs=[],e&&Lt(e,this,t)}const Ft=Ut.prototype;function Dt(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function qt(e,t,r){if(!t)return e;const n=r&&r.encode||Dt;St.isFunction(r)&&(r={serialize:r});const s=r&&r.serialize;let o;if(o=s?s(t,r):St.isURLSearchParams(t)?t.toString():new Ut(t,r).toString(n),o){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}Ft.append=function(e,t){this._pairs.push([e,t])},Ft.toString=function(e){const t=e?function(t){return e.call(this,t,Pt)}:Pt;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};class It{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){St.forEach(this.handlers,function(t){null!==t&&e(t)})}}var Mt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},zt={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Ut,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const Ht="undefined"!=typeof window&&"undefined"!=typeof document,Vt="object"==typeof navigator&&navigator||void 0,Wt=Ht&&(!Vt||["ReactNative","NativeScript","NS"].indexOf(Vt.product)<0),Kt="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Jt=Ht&&window.location.href||"http://localhost";var $t={...Object.freeze({__proto__:null,hasBrowserEnv:Ht,hasStandardBrowserEnv:Wt,hasStandardBrowserWebWorkerEnv:Kt,navigator:Vt,origin:Jt}),...zt};function Gt(e){function t(e,r,n,s){let o=e[s++];if("__proto__"===o)return!0;const i=Number.isFinite(+o),a=s>=e.length;if(o=!o&&St.isArray(n)?n.length:o,a)return St.hasOwnProp(n,o)?n[o]=[n[o],r]:n[o]=r,!i;n[o]&&St.isObject(n[o])||(n[o]=[]);return t(e,r,n[o],s)&&St.isArray(n[o])&&(n[o]=function(e){const t={},r=Object.keys(e);let n;const s=r.length;let o;for(n=0;n<s;n++)o=r[n],t[o]=e[o];return t}(n[o])),!i}if(St.isFormData(e)&&St.isFunction(e.entries)){const r={};return St.forEachEntry(e,(e,n)=>{t(function(e){return St.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),n,r,0)}),r}return null}const Yt={transitional:Mt,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const r=t.getContentType()||"",n=r.indexOf("application/json")>-1,s=St.isObject(e);s&&St.isHTMLForm(e)&&(e=new FormData(e));if(St.isFormData(e))return n?JSON.stringify(Gt(e)):e;if(St.isArrayBuffer(e)||St.isBuffer(e)||St.isStream(e)||St.isFile(e)||St.isBlob(e)||St.isReadableStream(e))return e;if(St.isArrayBufferView(e))return e.buffer;if(St.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Lt(e,new $t.classes.URLSearchParams,{visitor:function(e,t,r,n){return $t.isNode&&St.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((o=St.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Lt(o?{"files[]":e}:e,t&&new t,this.formSerializer)}}return s||n?(t.setContentType("application/json",!1),function(e,t,r){if(St.isString(e))try{return(t||JSON.parse)(e),St.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||Yt.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(St.isResponse(e)||St.isReadableStream(e))return e;if(e&&St.isString(e)&&(r&&!this.responseType||n)){const r=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e,this.parseReviver)}catch(e){if(r){if("SyntaxError"===e.name)throw Rt.from(e,Rt.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:$t.classes.FormData,Blob:$t.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};St.forEach(["delete","get","head","post","put","patch"],e=>{Yt.headers[e]={}});const Xt=St.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 Qt=Symbol("internals");function Zt(e){return e&&String(e).trim().toLowerCase()}function er(e){return!1===e||null==e?e:St.isArray(e)?e.map(er):String(e)}function tr(e,t,r,n,s){return St.isFunction(n)?n.call(this,t,r):(s&&(t=r),St.isString(t)?St.isString(n)?-1!==t.indexOf(n):St.isRegExp(n)?n.test(t):void 0:void 0)}let rr=class{constructor(e){e&&this.set(e)}set(e,t,r){const n=this;function s(e,t,r){const s=Zt(t);if(!s)throw new Error("header name must be a non-empty string");const o=St.findKey(n,s);(!o||void 0===n[o]||!0===r||void 0===r&&!1!==n[o])&&(n[o||t]=er(e))}const o=(e,t)=>St.forEach(e,(e,r)=>s(e,r,t));if(St.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if(St.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))o((e=>{const t={};let r,n,s;return e&&e.split("\n").forEach(function(e){s=e.indexOf(":"),r=e.substring(0,s).trim().toLowerCase(),n=e.substring(s+1).trim(),!r||t[r]&&Xt[r]||("set-cookie"===r?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t})(e),t);else if(St.isObject(e)&&St.isIterable(e)){let r,n,s={};for(const t of e){if(!St.isArray(t))throw TypeError("Object iterator must return a key-value pair");s[n=t[0]]=(r=s[n])?St.isArray(r)?[...r,t[1]]:[r,t[1]]:t[1]}o(s,t)}else null!=e&&s(t,e,r);return this}get(e,t){if(e=Zt(e)){const r=St.findKey(this,e);if(r){const e=this[r];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}(e);if(St.isFunction(t))return t.call(this,e,r);if(St.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Zt(e)){const r=St.findKey(this,e);return!(!r||void 0===this[r]||t&&!tr(0,this[r],r,t))}return!1}delete(e,t){const r=this;let n=!1;function s(e){if(e=Zt(e)){const s=St.findKey(r,e);!s||t&&!tr(0,r[s],s,t)||(delete r[s],n=!0)}}return St.isArray(e)?e.forEach(s):s(e),n}clear(e){const t=Object.keys(this);let r=t.length,n=!1;for(;r--;){const s=t[r];e&&!tr(0,this[s],s,e,!0)||(delete this[s],n=!0)}return n}normalize(e){const t=this,r={};return St.forEach(this,(n,s)=>{const o=St.findKey(r,s);if(o)return t[o]=er(n),void delete t[s];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,r)=>t.toUpperCase()+r)}(s):String(s).trim();i!==s&&delete t[s],t[i]=er(n),r[i]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return St.forEach(this,(r,n)=>{null!=r&&!1!==r&&(t[n]=e&&St.isArray(r)?r.join(", "):r)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const r=new this(e);return t.forEach(e=>r.set(e)),r}static accessor(e){const t=(this[Qt]=this[Qt]={accessors:{}}).accessors,r=this.prototype;function n(e){const n=Zt(e);t[n]||(!function(e,t){const r=St.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(e,r,s){return this[n].call(this,t,e,r,s)},configurable:!0})})}(r,e),t[n]=!0)}return St.isArray(e)?e.forEach(n):n(e),this}};function nr(e,t){const r=this||Yt,n=t||r,s=rr.from(n.headers);let o=n.data;return St.forEach(e,function(e){o=e.call(r,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function sr(e){return!(!e||!e.__CANCEL__)}function or(e,t,r){Rt.call(this,null==e?"canceled":e,Rt.ERR_CANCELED,t,r),this.name="CanceledError"}function ir(e,t,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(new Rt("Request failed with status code "+r.status,[Rt.ERR_BAD_REQUEST,Rt.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}rr.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),St.reduceDescriptors(rr.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[r]=e}}}),St.freezeMethods(rr),St.inherits(or,Rt,{__CANCEL__:!0});const ar=(e,t,r=3)=>{let n=0;const s=function(e,t){e=e||10;const r=new Array(e),n=new Array(e);let s,o=0,i=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),u=n[i];s||(s=c),r[o]=a,n[o]=c;let l=i,h=0;for(;l!==o;)h+=r[l++],l%=e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),c-s<t)return;const d=u&&c-u;return d?Math.round(1e3*h/d):void 0}}(50,250);return function(e,t){let r,n,s=0,o=1e3/t;const i=(t,o=Date.now())=>{s=o,r=null,n&&(clearTimeout(n),n=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-s;a>=o?i(e,t):(r=e,n||(n=setTimeout(()=>{n=null,i(r)},o-a)))},()=>r&&i(r)]}(r=>{const o=r.loaded,i=r.lengthComputable?r.total:void 0,a=o-n,c=s(a);n=o;e({loaded:o,total:i,progress:i?o/i:void 0,bytes:a,rate:c||void 0,estimated:c&&i&&o<=i?(i-o)/c:void 0,event:r,lengthComputable:null!=i,[t?"download":"upload"]:!0})},r)},cr=(e,t)=>{const r=null!=e;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},ur=e=>(...t)=>St.asap(()=>e(...t));var lr=$t.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,$t.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL($t.origin),$t.navigator&&/(msie|trident)/i.test($t.navigator.userAgent)):()=>!0,hr=$t.hasStandardBrowserEnv?{write(e,t,r,n,s,o,i){if("undefined"==typeof document)return;const a=[`${e}=${encodeURIComponent(t)}`];St.isNumber(r)&&a.push(`expires=${new Date(r).toUTCString()}`),St.isString(n)&&a.push(`path=${n}`),St.isString(s)&&a.push(`domain=${s}`),!0===o&&a.push("secure"),St.isString(i)&&a.push(`SameSite=${i}`),document.cookie=a.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};function dr(e,t,r){let n=!function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}(t);return e&&(n||0==r)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const pr=e=>e instanceof rr?{...e}:e;function fr(e,t){t=t||{};const r={};function n(e,t,r,n){return St.isPlainObject(e)&&St.isPlainObject(t)?St.merge.call({caseless:n},e,t):St.isPlainObject(t)?St.merge({},t):St.isArray(t)?t.slice():t}function s(e,t,r,s){return St.isUndefined(t)?St.isUndefined(e)?void 0:n(void 0,e,0,s):n(e,t,0,s)}function o(e,t){if(!St.isUndefined(t))return n(void 0,t)}function i(e,t){return St.isUndefined(t)?St.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function a(r,s,o){return o in t?n(r,s):o in e?n(void 0,r):void 0}const c={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(e,t,r)=>s(pr(e),pr(t),0,!0)};return St.forEach(Object.keys({...e,...t}),function(n){const o=c[n]||s,i=o(e[n],t[n],n);St.isUndefined(i)&&o!==a||(r[n]=i)}),r}var mr=e=>{const t=fr({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:s,xsrfCookieName:o,headers:i,auth:a}=t;if(t.headers=i=rr.from(i),t.url=qt(dr(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&i.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),St.isFormData(r))if($t.hasStandardBrowserEnv||$t.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(St.isFunction(r.getHeaders)){const e=r.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,r])=>{t.includes(e.toLowerCase())&&i.set(e,r)})}if($t.hasStandardBrowserEnv&&(n&&St.isFunction(n)&&(n=n(t)),n||!1!==n&&lr(t.url))){const e=s&&o&&hr.read(o);e&&i.set(s,e)}return t};var gr="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,r){const n=mr(e);let s=n.data;const o=rr.from(n.headers).normalize();let i,a,c,u,l,{responseType:h,onUploadProgress:d,onDownloadProgress:p}=n;function f(){u&&u(),l&&l(),n.cancelToken&&n.cancelToken.unsubscribe(i),n.signal&&n.signal.removeEventListener("abort",i)}let m=new XMLHttpRequest;function g(){if(!m)return;const n=rr.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());ir(function(e){t(e),f()},function(e){r(e),f()},{data:h&&"text"!==h&&"json"!==h?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:n,config:e,request:m}),m=null}m.open(n.method.toUpperCase(),n.url,!0),m.timeout=n.timeout,"onloadend"in m?m.onloadend=g:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(g)},m.onabort=function(){m&&(r(new Rt("Request aborted",Rt.ECONNABORTED,e,m)),m=null)},m.onerror=function(t){const n=new Rt(t&&t.message?t.message:"Network Error",Rt.ERR_NETWORK,e,m);n.event=t||null,r(n),m=null},m.ontimeout=function(){let t=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const s=n.transitional||Mt;n.timeoutErrorMessage&&(t=n.timeoutErrorMessage),r(new Rt(t,s.clarifyTimeoutError?Rt.ETIMEDOUT:Rt.ECONNABORTED,e,m)),m=null},void 0===s&&o.setContentType(null),"setRequestHeader"in m&&St.forEach(o.toJSON(),function(e,t){m.setRequestHeader(t,e)}),St.isUndefined(n.withCredentials)||(m.withCredentials=!!n.withCredentials),h&&"json"!==h&&(m.responseType=n.responseType),p&&([c,l]=ar(p,!0),m.addEventListener("progress",c)),d&&m.upload&&([a,u]=ar(d),m.upload.addEventListener("progress",a),m.upload.addEventListener("loadend",u)),(n.cancelToken||n.signal)&&(i=t=>{m&&(r(!t||t.type?new or(null,e,m):t),m.abort(),m=null)},n.cancelToken&&n.cancelToken.subscribe(i),n.signal&&(n.signal.aborted?i():n.signal.addEventListener("abort",i)));const y=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(n.url);y&&-1===$t.protocols.indexOf(y)?r(new Rt("Unsupported protocol "+y+":",Rt.ERR_BAD_REQUEST,e)):m.send(s||null)})};const yr=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let r,n=new AbortController;const s=function(e){if(!r){r=!0,i();const t=e instanceof Error?e:this.reason;n.abort(t instanceof Rt?t:new or(t instanceof Error?t.message:t))}};let o=t&&setTimeout(()=>{o=null,s(new Rt(`timeout ${t} of ms exceeded`,Rt.ETIMEDOUT))},t);const i=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(s):e.removeEventListener("abort",s)}),e=null)};e.forEach(e=>e.addEventListener("abort",s));const{signal:a}=n;return a.unsubscribe=()=>St.asap(i),a}},br=function*(e,t){let r=e.byteLength;if(r<t)return void(yield e);let n,s=0;for(;s<r;)n=s+t,yield e.slice(s,n),s=n},wr=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:r}=await t.read();if(e)break;yield r}}finally{await t.cancel()}},vr=(e,t,r,n)=>{const s=async function*(e,t){for await(const r of wr(e))yield*br(r,t)}(e,t);let o,i=0,a=e=>{o||(o=!0,n&&n(e))};return new ReadableStream({async pull(e){try{const{done:t,value:n}=await s.next();if(t)return a(),void e.close();let o=n.byteLength;if(r){let e=i+=o;r(e)}e.enqueue(new Uint8Array(n))}catch(e){throw a(e),e}},cancel:e=>(a(e),s.return())},{highWaterMark:2})},{isFunction:Er}=St,_r=(({Request:e,Response:t})=>({Request:e,Response:t}))(St.global),{ReadableStream:kr,TextEncoder:xr}=St.global,Or=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},Sr=e=>{e=St.merge.call({skipUndefined:!0},_r,e);const{fetch:t,Request:r,Response:n}=e,s=t?Er(t):"function"==typeof fetch,o=Er(r),i=Er(n);if(!s)return!1;const a=s&&Er(kr),c=s&&("function"==typeof xr?(u=new xr,e=>u.encode(e)):async e=>new Uint8Array(await new r(e).arrayBuffer()));var u;const l=o&&a&&Or(()=>{let e=!1;const t=new r($t.origin,{body:new kr,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),h=i&&a&&Or(()=>St.isReadableStream(new n("").body)),d={stream:h&&(e=>e.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!d[e]&&(d[e]=(t,r)=>{let n=t&&t[e];if(n)return n.call(t);throw new Rt(`Response type '${e}' is not supported`,Rt.ERR_NOT_SUPPORT,r)})});const p=async(e,t)=>{const n=St.toFiniteNumber(e.getContentLength());return null==n?(async e=>{if(null==e)return 0;if(St.isBlob(e))return e.size;if(St.isSpecCompliantForm(e)){const t=new r($t.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return St.isArrayBufferView(e)||St.isArrayBuffer(e)?e.byteLength:(St.isURLSearchParams(e)&&(e+=""),St.isString(e)?(await c(e)).byteLength:void 0)})(t):n};return async e=>{let{url:s,method:i,data:a,signal:c,cancelToken:u,timeout:f,onDownloadProgress:m,onUploadProgress:g,responseType:y,headers:b,withCredentials:w="same-origin",fetchOptions:v}=mr(e),E=t||fetch;y=y?(y+"").toLowerCase():"text";let _=yr([c,u&&u.toAbortSignal()],f),k=null;const x=_&&_.unsubscribe&&(()=>{_.unsubscribe()});let O;try{if(g&&l&&"get"!==i&&"head"!==i&&0!==(O=await p(b,a))){let e,t=new r(s,{method:"POST",body:a,duplex:"half"});if(St.isFormData(a)&&(e=t.headers.get("content-type"))&&b.setContentType(e),t.body){const[e,r]=cr(O,ar(ur(g)));a=vr(t.body,65536,e,r)}}St.isString(w)||(w=w?"include":"omit");const t=o&&"credentials"in r.prototype,c={...v,signal:_,method:i.toUpperCase(),headers:b.normalize().toJSON(),body:a,duplex:"half",credentials:t?w:void 0};k=o&&new r(s,c);let u=await(o?E(k,v):E(s,c));const f=h&&("stream"===y||"response"===y);if(h&&(m||f&&x)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=u[t]});const t=St.toFiniteNumber(u.headers.get("content-length")),[r,s]=m&&cr(t,ar(ur(m),!0))||[];u=new n(vr(u.body,65536,r,()=>{s&&s(),x&&x()}),e)}y=y||"text";let S=await d[St.findKey(d,y)||"text"](u,e);return!f&&x&&x(),await new Promise((t,r)=>{ir(t,r,{data:S,headers:rr.from(u.headers),status:u.status,statusText:u.statusText,config:e,request:k})})}catch(t){if(x&&x(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new Rt("Network Error",Rt.ERR_NETWORK,e,k),{cause:t.cause||t});throw Rt.from(t,t&&t.code,e,k)}}},Rr=new Map,Tr=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:s}=t,o=[n,s,r];let i,a,c=o.length,u=Rr;for(;c--;)i=o[c],a=u.get(i),void 0===a&&u.set(i,a=c?new Map:Sr(t)),u=a;return a};Tr();const Ar={http:null,xhr:gr,fetch:{get:Tr}};St.forEach(Ar,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const Cr=e=>`- ${e}`,Nr=e=>St.isFunction(e)||null===e||!1===e;var jr={getAdapter:function(e,t){e=St.isArray(e)?e:[e];const{length:r}=e;let n,s;const o={};for(let i=0;i<r;i++){let r;if(n=e[i],s=n,!Nr(n)&&(s=Ar[(r=String(n)).toLowerCase()],void 0===s))throw new Rt(`Unknown adapter '${r}'`);if(s&&(St.isFunction(s)||(s=s.get(t))))break;o[r||"#"+i]=s}if(!s){const e=Object.entries(o).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new Rt("There is no suitable adapter to dispatch the request "+(r?e.length>1?"since :\n"+e.map(Cr).join("\n"):" "+Cr(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return s},adapters:Ar};function Br(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new or(null,e)}function Lr(e){Br(e),e.headers=rr.from(e.headers),e.data=nr.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return jr.getAdapter(e.adapter||Yt.adapter,e)(e).then(function(t){return Br(e),t.data=nr.call(e,e.transformResponse,t),t.headers=rr.from(t.headers),t},function(t){return sr(t)||(Br(e),t&&t.response&&(t.response.data=nr.call(e,e.transformResponse,t.response),t.response.headers=rr.from(t.response.headers))),Promise.reject(t)})}const Pr="1.13.2",Ur={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Ur[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Fr={};Ur.transitional=function(e,t,r){function n(e,t){return"[Axios v"+Pr+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,s,o)=>{if(!1===e)throw new Rt(n(s," has been removed"+(t?" in "+t:"")),Rt.ERR_DEPRECATED);return t&&!Fr[s]&&(Fr[s]=!0,console.warn(n(s," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,s,o)}},Ur.spelling=function(e){return(t,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};var Dr={assertOptions:function(e,t,r){if("object"!=typeof e)throw new Rt("options must be an object",Rt.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let s=n.length;for(;s-- >0;){const o=n[s],i=t[o];if(i){const t=e[o],r=void 0===t||i(t,o,e);if(!0!==r)throw new Rt("option "+o+" must be "+r,Rt.ERR_BAD_OPTION_VALUE);continue}if(!0!==r)throw new Rt("Unknown option "+o,Rt.ERR_BAD_OPTION)}},validators:Ur};const qr=Dr.validators;let Ir=class{constructor(e){this.defaults=e||{},this.interceptors={request:new It,response:new It}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const r=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?r&&!String(e.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+r):e.stack=r}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=fr(this.defaults,t);const{transitional:r,paramsSerializer:n,headers:s}=t;void 0!==r&&Dr.assertOptions(r,{silentJSONParsing:qr.transitional(qr.boolean),forcedJSONParsing:qr.transitional(qr.boolean),clarifyTimeoutError:qr.transitional(qr.boolean)},!1),null!=n&&(St.isFunction(n)?t.paramsSerializer={serialize:n}:Dr.assertOptions(n,{encode:qr.function,serialize:qr.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Dr.assertOptions(t,{baseUrl:qr.spelling("baseURL"),withXsrfToken:qr.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=s&&St.merge(s.common,s[t.method]);s&&St.forEach(["delete","get","head","post","put","patch","common"],e=>{delete s[e]}),t.headers=rr.concat(o,s);const i=[];let a=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,i.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(!a){const e=[Lr.bind(this),void 0];for(e.unshift(...i),e.push(...c),l=e.length,u=Promise.resolve(t);h<l;)u=u.then(e[h++],e[h++]);return u}l=i.length;let d=t;for(;h<l;){const e=i[h++],t=i[h++];try{d=e(d)}catch(e){t.call(this,e);break}}try{u=Lr.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 qt(dr((e=fr(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};St.forEach(["delete","get","head","options"],function(e){Ir.prototype[e]=function(t,r){return this.request(fr(r||{},{method:e,url:t,data:(r||{}).data}))}}),St.forEach(["post","put","patch"],function(e){function t(t){return function(r,n,s){return this.request(fr(s||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}Ir.prototype[e]=t(),Ir.prototype[e+"Form"]=t(!0)});const Mr={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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Mr).forEach(([e,t])=>{Mr[t]=e});const zr=function e(t){const r=new Ir(t),n=Fe(Ir.prototype.request,r);return St.extend(n,Ir.prototype,r,{allOwnKeys:!0}),St.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return e(fr(t,r))},n}(Yt);zr.Axios=Ir,zr.CanceledError=or,zr.CancelToken=class e{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 r=this;this.promise.then(e=>{if(!r._listeners)return;let t=r._listeners.length;for(;t-- >0;)r._listeners[t](e);r._listeners=null}),this.promise.then=e=>{let t;const n=new Promise(e=>{r.subscribe(e),t=e}).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e(function(e,n,s){r.reason||(r.reason=new or(e,n,s),t(r.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)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}},zr.isCancel=sr,zr.VERSION=Pr,zr.toFormData=Lt,zr.AxiosError=Rt,zr.Cancel=zr.CanceledError,zr.all=function(e){return Promise.all(e)},zr.spread=function(e){return function(t){return e.apply(null,t)}},zr.isAxiosError=function(e){return St.isObject(e)&&!0===e.isAxiosError},zr.mergeConfig=fr,zr.AxiosHeaders=rr,zr.formToJSON=e=>Gt(St.isHTMLForm(e)?new FormData(e):e),zr.getAdapter=jr.getAdapter,zr.HttpStatusCode=Mr,zr.default=zr;const{Axios:Hr,AxiosError:Vr,CanceledError:Wr,isCancel:Kr,CancelToken:Jr,VERSION:$r,all:Gr,Cancel:Yr,isAxiosError:Xr,spread:Qr,toFormData:Zr,AxiosHeaders:en,HttpStatusCode:tn,formToJSON:rn,getAdapter:nn,mergeConfig:sn}=zr;!function(e,t){void 0===t&&(t={});var r=t.insertAt;if("undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css","top"===r&&n.firstChild?n.insertBefore(s,n.firstChild):n.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}}(".crm-widget-container{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif}.crm-chat-button{align-items:center;border:none;border-radius:50%;box-shadow:0 10px 25px rgba(0,0,0,.2);color:#fff;cursor:pointer;display:flex;font-size:24px;height:64px;justify-content:center;position:fixed;transition:all .2s;width:64px}.crm-chat-button:hover{transform:scale(1.1)}.crm-icon{height:32px;width:32px}.crm-icon-sm{height:24px;width:24px}.crm-badge{align-items:center;background-color:#ef4444;border-radius:50%;color:#fff;display:flex;font-size:12px;font-weight:600;height:20px;justify-content:center;position:absolute;right:-4px;top:-4px;width:20px}.crm-bottom-6{bottom:24px}.crm-right-6{right:24px}.crm-left-6{left:24px}.crm-top-6{top:24px}.crm-chat-window{background:#fff;border:1px solid #e5e7eb;border-radius:16px;box-shadow:0 20px 50px rgba(0,0,0,.3);display:flex;flex-direction:column;height:600px;max-width:448px;overflow:hidden;position:fixed;width:100%}.crm-chat-window.crm-dark{background:#1f2937;border-color:#374151}.crm-chat-window.crm-bottom-6{bottom:100px}.crm-chat-window.crm-right-6{right:24px}.crm-chat-window.crm-left-6{left:24px}.crm-chat-window.crm-top-6{top:100px}@media (max-width:640px){.crm-chat-window{border-radius:0;bottom:0!important;height:100vh;left:0!important;max-width:100%;right:0!important;top:0!important}}.crm-header{align-items:center;color:#fff;display:flex;justify-content:space-between;padding:16px 24px}.crm-header-content{align-items:center;display:flex;gap:12px}.crm-avatar{align-items:center;background:#fff;border-radius:50%;display:flex;font-size:20px;height:40px;justify-content:center;width:40px}.crm-title{font-size:18px;font-weight:600;margin:0}.crm-status{align-items:center;display:flex;font-size:14px;gap:8px;opacity:.9}.crm-status-dot{border-radius:50%;height:8px;width:8px}.crm-status-dot.crm-online{background-color:#10b981}.crm-status-dot.crm-offline{background-color:#ef4444}.crm-close-btn{background:hsla(0,0%,100%,.2);border:none;border-radius:50%;color:#fff;cursor:pointer;padding:8px;transition:background .2s}.crm-close-btn:hover{background:hsla(0,0%,100%,.3)}.crm-messages{background:#f9fafb;display:flex;flex:1;flex-direction:column;gap:16px;overflow-y:auto;padding:16px}.crm-dark .crm-messages{background:#111827}.crm-welcome-message{background:#fff;border:1px solid #e5e7eb;border-radius:8px;box-shadow:0 1px 3px rgba(0,0,0,.1);padding:16px}.crm-dark .crm-welcome-message{background:#1f2937;border-color:#374151;color:#d1d5db}.crm-welcome-message p{color:#374151;font-size:14px;margin:0}.crm-dark .crm-welcome-message p{color:#d1d5db}.crm-message{display:flex}.crm-message-guest{justify-content:flex-end}.crm-message-agent{justify-content:flex-start}.crm-message-bubble{border-radius:16px;box-shadow:0 1px 2px rgba(0,0,0,.1);max-width:75%;padding:10px 16px}.crm-message-guest .crm-message-bubble{border-bottom-right-radius:4px;color:#fff}.crm-message-agent .crm-message-bubble{background:#fff;border:1px solid #e5e7eb;border-bottom-left-radius:4px;color:#1f2937}.crm-dark .crm-message-agent .crm-message-bubble{background:#1f2937;border-color:#374151;color:#f3f4f6}.crm-agent-name{font-size:12px;font-weight:500;margin:0 0 4px;opacity:.7}.crm-message-text{font-size:14px;line-height:1.5;margin:0;white-space:pre-wrap;word-break:break-word}.crm-message-time{font-size:11px;margin:4px 0 0;opacity:.7}.crm-typing-indicator{display:flex;gap:4px;padding:4px 0}.crm-typing-dot{animation:typing 1.4s infinite;background:#9ca3af;border-radius:50%;height:8px;width:8px}.crm-typing-dot:nth-child(2){animation-delay:.2s}.crm-typing-dot:nth-child(3){animation-delay:.4s}@keyframes typing{0%,60%,to{transform:translateY(0)}30%{transform:translateY(-10px)}}.crm-input-container{background:#fff;border-top:1px solid #e5e7eb;padding:16px}.crm-dark .crm-input-container{background:#1f2937;border-color:#374151}.crm-input-wrapper{align-items:flex-end;display:flex;gap:8px}.crm-input{background:#f9fafb;border:1px solid #d1d5db;border-radius:12px;color:#1f2937;flex:1;font-family:inherit;font-size:14px;max-height:120px;min-height:48px;padding:12px 16px;resize:none}.crm-input:focus{border-color:#6366f1;box-shadow:0 0 0 3px rgba(99,102,241,.1);outline:none}.crm-input:disabled{cursor:not-allowed;opacity:.5}.crm-dark .crm-input{background:#111827;border-color:#4b5563;color:#f3f4f6}.crm-dark .crm-input::placeholder{color:#6b7280}.crm-send-btn{align-items:center;border:none;border-radius:12px;color:#fff;cursor:pointer;display:flex;flex-shrink:0;justify-content:center;padding:12px;transition:all .2s}.crm-send-btn:hover:not(:disabled){box-shadow:0 4px 12px rgba(0,0,0,.2)}.crm-send-btn:disabled{cursor:not-allowed;opacity:.5}.crm-input-hint{color:#9ca3af;font-size:11px;margin:8px 0 0;text-align:center}.crm-dark .crm-input-hint{color:#6b7280}.crm-messages::-webkit-scrollbar{width:6px}.crm-messages::-webkit-scrollbar-track{background:transparent}.crm-messages::-webkit-scrollbar-thumb{background:#d1d5db;border-radius:3px}.crm-dark .crm-messages::-webkit-scrollbar-thumb{background:#4b5563}.crm-messages::-webkit-scrollbar-thumb:hover{background:#9ca3af}");var on=function(s){var o=s.apiKey,a=s.apiUrl,c=void 0===a?"https://chat-crm-backend-7mzo.onrender.com":a,h=s.primaryColor,f=void 0===h?"#4F46E5":h,m=s.position,g=void 0===m?"bottom-right":m,y=s.userData,b=void 0===y?null:y,w=s.welcomeMessage,v=void 0===w?"👋 Welcome! How can we help you today?":w,E=s.companyName,_=void 0===E?"Support":E,k=s.autoOpen,x=void 0!==k&&k,O=s.showNotifications,S=void 0===O||O,R=s.playSound,T=void 0!==R&&R,A=s.theme,C=void 0===A?"light":A,N=s.zIndex,j=void 0===N?9999:N,B=d(t(x),2),L=B[0],P=B[1],U=d(t([]),2),F=U[0],D=U[1],q=d(t(""),2),I=q[0],M=q[1],z=d(t(null),2),H=z[0],V=z[1],W=d(t(null),2);W[0];var K=W[1],J=d(t(null),2),$=J[0],G=J[1],Y=d(t(!1),2),X=Y[0],Q=Y[1],Z=d(t(!1),2),ee=Z[0],te=Z[1],re=d(t("Support Agent"),2),ne=re[0],se=re[1],oe=d(t(0),2),ie=oe[0],ae=oe[1],ce=r(null);n(function(){var e;null===(e=ce.current)||void 0===e||e.scrollIntoView({behavior:"smooth"})},[F]),n(function(){return L&&!H&&le(),function(){H&&H.disconnect()}},[L,b]);var ue=function(){return b?{name:b.name||"Guest User",email:b.email||null,phone:b.phone||null,userId:b.userId||null}:{name:localStorage.getItem("chatGuestName")||"Guest User",email:localStorage.getItem("chatGuestEmail")||null,phone:localStorage.getItem("chatGuestPhone")||null,userId:localStorage.getItem("chatUserId")||null}},le=function(){var e=i(l().m(function e(){var t,r,n,s,i,a,h,d;return l().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,t=ue(),console.log("🔐 Widget User Data:",{hasUserDataProp:!!b,userData:b,extractedUser:t}),e.n=1,zr.post("".concat(c,"/api/v1/webhook/guest-conversation"),{apiKey:o,guestName:t.name,guestEmail:t.email,guestPhone:t.phone,customUserId:t.userId});case 1:(r=e.v).data.success&&(n=r.data,s=n.conversationId,i=n.petitionId,a=n.queryId,K(a),G(s),localStorage.setItem("chatGuestId",a),localStorage.setItem("chatConversationId",s),localStorage.setItem("chatPetitionId",i),(h=Ue("".concat(c,"/widget"),{query:{conversationId:s,petitionId:i,apiKey:o},transports:["websocket","polling"]})).on("connect",function(){Q(!0),console.log("✅ Connected to Chat CRM Widget Namespace")}),h.on("disconnect",function(){Q(!1),console.log("❌ Disconnected from Chat CRM")}),h.on("new-message",function(e){D(function(t){return[].concat(p(t),[u(u({},e),{},{sender:"agent",timestamp:new Date,read:!1})])}),te(!1),!L&&S&&(ae(function(e){return e+1}),T&&de())}),h.on("agent-typing",function(e){te(!0),se(e.agentName||"Support Agent"),setTimeout(function(){return te(!1)},3e3)}),V(h),D([{message:v,sender:"agent",timestamp:new Date,read:!0}])),e.n=3;break;case 2:e.p=2,d=e.v,console.error("❌ Chat initialization error:",d),alert("Failed to connect to chat. Please try again.");case 3:return e.a(2)}},e,null,[[0,2]])}));return function(){return e.apply(this,arguments)}}(),he=function(){var e=i(l().m(function e(){var t,r,n;return l().w(function(e){for(;;)switch(e.n){case 0:if(I.trim()&&H&&X){e.n=1;break}return e.a(2);case 1:t=ue(),r=localStorage.getItem("chatPetitionId"),n={conversationId:$,petitionId:r,message:I.trim(),senderName:t.name||"Guest User",senderType:"Customer",timestamp:new Date};try{D(function(e){return[].concat(p(e),[{message:I.trim(),sender:"guest",read:!0,timestamp:new Date}])}),M(""),H.emit("widget-message",n)}catch(e){console.error("❌ Send message error:",e),D(function(e){return e.slice(0,-1)}),alert("Failed to send message. Please try again.")}case 2:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}(),de=function(){var e=new(window.AudioContext||window.webkitAudioContext),t=e.createOscillator(),r=e.createGain();t.connect(r),r.connect(e.destination),t.frequency.value=800,t.type="sine",r.gain.value=.1,t.start(),setTimeout(function(){return t.stop()},200)},pe=function(){var e={"bottom-right":"crm-bottom-6 crm-right-6","bottom-left":"crm-bottom-6 crm-left-6","top-right":"crm-top-6 crm-right-6","top-left":"crm-top-6 crm-left-6"};return e[g]||e["bottom-right"]},fe="dark"===C||"auto"===C&&window.matchMedia("(prefers-color-scheme: dark)").matches;return e.createElement("div",{className:"crm-widget-container",style:{zIndex:j}},e.createElement("button",{onClick:function(){P(!0),ae(0)},className:"crm-chat-button ".concat(pe()),style:{backgroundColor:f},"aria-label":"Open chat"},L?e.createElement("svg",{className:"crm-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},e.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})):e.createElement("svg",{className:"crm-icon",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},e.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})),!L&&ie>0&&e.createElement("span",{className:"crm-badge"},ie)),L&&e.createElement("div",{className:"crm-chat-window ".concat(pe()," ").concat(fe?"crm-dark":"")},e.createElement("div",{className:"crm-header",style:{backgroundColor:f}},e.createElement("div",{className:"crm-header-content"},e.createElement("div",{className:"crm-avatar"},"💬"),e.createElement("div",null,e.createElement("h3",{className:"crm-title"},_),e.createElement("div",{className:"crm-status"},e.createElement("div",{className:"crm-status-dot ".concat(X?"crm-online":"crm-offline")}),e.createElement("span",null,X?"Online":"Connecting...")))),e.createElement("button",{onClick:function(){return P(!1)},className:"crm-close-btn"},e.createElement("svg",{className:"crm-icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},e.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})))),e.createElement("div",{className:"crm-messages"},0===F.length&&e.createElement("div",{className:"crm-welcome-message"},e.createElement("p",null,v)),F.map(function(t,r){return e.createElement("div",{key:r,className:"crm-message ".concat("guest"===t.sender?"crm-message-guest":"crm-message-agent")},e.createElement("div",{className:"crm-message-bubble",style:"guest"===t.sender?{backgroundColor:f}:{}},"agent"===t.sender&&e.createElement("p",{className:"crm-agent-name"},ne),e.createElement("p",{className:"crm-message-text"},t.message),e.createElement("p",{className:"crm-message-time"},(n=t.timestamp,new Date(n).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"})))));var n}),ee&&e.createElement("div",{className:"crm-message crm-message-agent"},e.createElement("div",{className:"crm-message-bubble"},e.createElement("div",{className:"crm-typing-indicator"},e.createElement("div",{className:"crm-typing-dot"}),e.createElement("div",{className:"crm-typing-dot"}),e.createElement("div",{className:"crm-typing-dot"})))),e.createElement("div",{ref:ce})),e.createElement("div",{className:"crm-input-container"},e.createElement("div",{className:"crm-input-wrapper"},e.createElement("textarea",{value:I,onChange:function(e){return M(e.target.value)},onKeyPress:function(e){"Enter"!==e.key||e.shiftKey||(e.preventDefault(),he())},placeholder:"Type your message...",rows:"1",className:"crm-input",disabled:!X}),e.createElement("button",{onClick:he,disabled:!I.trim()||!X,className:"crm-send-btn",style:{backgroundColor:f}},e.createElement("svg",{className:"crm-icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},e.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 19l9 2-9-18-9 18 9-2zm0 0v-8"})))),e.createElement("p",{className:"crm-input-hint"},"Press Enter to send • Shift+Enter for new line"))))};export{on as ChatCRMWidget};
|
|
4
4
|
//# sourceMappingURL=index.esm.js.map
|