@tarxemo/customer_support 1.0.11 → 1.0.13

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/dist/index.umd.js CHANGED
@@ -1,7 +1,7 @@
1
- (function(T,p){typeof exports=="object"&&typeof module<"u"?p(exports,require("react"),require("lucide-react")):typeof define=="function"&&define.amd?define(["exports","react","lucide-react"],p):(T=typeof globalThis<"u"?globalThis:T||self,p(T.CustomerSupport={},T.React,T.lucideReact))})(this,(function(T,p,U){"use strict";var Yn=Object.defineProperty;var Zn=(T,p,U)=>p in T?Yn(T,p,{enumerable:!0,configurable:!0,writable:!0,value:U}):T[p]=U;var gt=(T,p,U)=>Zn(T,typeof p!="symbol"?p+"":p,U);function Ae(e,t){return function(){return e.apply(t,arguments)}}const{toString:Ot}=Object.prototype,{getPrototypeOf:fe}=Object,{iterator:Y,toStringTag:Ce}=Symbol,Z=(e=>t=>{const n=Ot.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),D=e=>(e=e.toLowerCase(),t=>Z(t)===e),ee=e=>t=>typeof t===e,{isArray:H}=Array,z=ee("undefined");function J(e){return e!==null&&!z(e)&&e.constructor!==null&&!z(e.constructor)&&N(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Re=D("ArrayBuffer");function Tt(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Re(e.buffer),t}const At=ee("string"),N=ee("function"),Ne=ee("number"),V=e=>e!==null&&typeof e=="object",Ct=e=>e===!0||e===!1,te=e=>{if(Z(e)!=="object")return!1;const t=fe(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Ce in e)&&!(Y in e)},Rt=e=>{if(!V(e)||J(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Nt=D("Date"),xt=D("File"),Pt=D("Blob"),Dt=D("FileList"),Ut=e=>V(e)&&N(e.pipe),Ft=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||N(e.append)&&((t=Z(e))==="formdata"||t==="object"&&N(e.toString)&&e.toString()==="[object FormData]"))},Lt=D("URLSearchParams"),[kt,Bt,It,jt]=["ReadableStream","Request","Response","Headers"].map(D),$t=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function K(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),H(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{if(J(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let c;for(r=0;r<i;r++)c=o[r],t.call(null,e[c],c,e)}}function xe(e,t){if(J(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const j=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Pe=e=>!z(e)&&e!==j;function de(){const{caseless:e,skipUndefined:t}=Pe(this)&&this||{},n={},r=(s,o)=>{const i=e&&xe(n,o)||o;te(n[i])&&te(s)?n[i]=de(n[i],s):te(s)?n[i]=de({},s):H(s)?n[i]=s.slice():(!t||!z(s))&&(n[i]=s)};for(let s=0,o=arguments.length;s<o;s++)arguments[s]&&K(arguments[s],r);return n}const Mt=(e,t,n,{allOwnKeys:r}={})=>(K(t,(s,o)=>{n&&N(s)?Object.defineProperty(e,o,{value:Ae(s,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),e),qt=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Ht=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},zt=(e,t,n,r)=>{let s,o,i;const c={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)i=s[o],(!r||r(i,e,t))&&!c[i]&&(t[i]=e[i],c[i]=!0);e=n!==!1&&fe(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},vt=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},Jt=e=>{if(!e)return null;if(H(e))return e;let t=e.length;if(!Ne(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Vt=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&fe(Uint8Array)),Kt=(e,t)=>{const r=(e&&e[Y]).call(e);let s;for(;(s=r.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},Wt=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Xt=D("HTMLFormElement"),Gt=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),De=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Qt=D("RegExp"),Ue=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};K(n,(s,o)=>{let i;(i=t(s,o,e))!==!1&&(r[o]=i||s)}),Object.defineProperties(e,r)},Yt=e=>{Ue(e,(t,n)=>{if(N(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(N(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Zt=(e,t)=>{const n={},r=s=>{s.forEach(o=>{n[o]=!0})};return H(e)?r(e):r(String(e).split(t)),n},en=()=>{},tn=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function nn(e){return!!(e&&N(e.append)&&e[Ce]==="FormData"&&e[Y])}const rn=e=>{const t=new Array(10),n=(r,s)=>{if(V(r)){if(t.indexOf(r)>=0)return;if(J(r))return r;if(!("toJSON"in r)){t[s]=r;const o=H(r)?[]:{};return K(r,(i,c)=>{const d=n(i,s+1);!z(d)&&(o[c]=d)}),t[s]=void 0,o}}return r};return n(e,0)},sn=D("AsyncFunction"),on=e=>e&&(V(e)||N(e))&&N(e.then)&&N(e.catch),Fe=((e,t)=>e?setImmediate:t?((n,r)=>(j.addEventListener("message",({source:s,data:o})=>{s===j&&o===n&&r.length&&r.shift()()},!1),s=>{r.push(s),j.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",N(j.postMessage)),an=typeof queueMicrotask<"u"?queueMicrotask.bind(j):typeof process<"u"&&process.nextTick||Fe,a={isArray:H,isArrayBuffer:Re,isBuffer:J,isFormData:Ft,isArrayBufferView:Tt,isString:At,isNumber:Ne,isBoolean:Ct,isObject:V,isPlainObject:te,isEmptyObject:Rt,isReadableStream:kt,isRequest:Bt,isResponse:It,isHeaders:jt,isUndefined:z,isDate:Nt,isFile:xt,isBlob:Pt,isRegExp:Qt,isFunction:N,isStream:Ut,isURLSearchParams:Lt,isTypedArray:Vt,isFileList:Dt,forEach:K,merge:de,extend:Mt,trim:$t,stripBOM:qt,inherits:Ht,toFlatObject:zt,kindOf:Z,kindOfTest:D,endsWith:vt,toArray:Jt,forEachEntry:Kt,matchAll:Wt,isHTMLForm:Xt,hasOwnProperty:De,hasOwnProp:De,reduceDescriptors:Ue,freezeMethods:Yt,toObjectSet:Zt,toCamelCase:Gt,noop:en,toFiniteNumber:tn,findKey:xe,global:j,isContextDefined:Pe,isSpecCompliantForm:nn,toJSONObject:rn,isAsyncFn:sn,isThenable:on,setImmediate:Fe,asap:an,isIterable:e=>e!=null&&N(e[Y])};let y=class St extends Error{static from(t,n,r,s,o,i){const c=new St(t.message,n||t.code,r,s,o);return c.cause=t,c.name=t.name,i&&Object.assign(c,i),c}constructor(t,n,r,s,o){super(t),this.name="AxiosError",this.isAxiosError=!0,n&&(this.code=n),r&&(this.config=r),s&&(this.request=s),o&&(this.response=o,this.status=o.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:a.toJSONObject(this.config),code:this.code,status:this.status}}};y.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",y.ERR_BAD_OPTION="ERR_BAD_OPTION",y.ECONNABORTED="ECONNABORTED",y.ETIMEDOUT="ETIMEDOUT",y.ERR_NETWORK="ERR_NETWORK",y.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",y.ERR_DEPRECATED="ERR_DEPRECATED",y.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",y.ERR_BAD_REQUEST="ERR_BAD_REQUEST",y.ERR_CANCELED="ERR_CANCELED",y.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",y.ERR_INVALID_URL="ERR_INVALID_URL";const cn=null;function pe(e){return a.isPlainObject(e)||a.isArray(e)}function Le(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function ke(e,t,n){return e?e.concat(t).map(function(s,o){return s=Le(s),!n&&o?"["+s+"]":s}).join(n?".":""):t}function ln(e){return a.isArray(e)&&!e.some(pe)}const un=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function ne(e,t,n){if(!a.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=a.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(w,h){return!a.isUndefined(h[w])});const r=n.metaTokens,s=n.visitor||l,o=n.dots,i=n.indexes,d=(n.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(s))throw new TypeError("visitor must be a function");function u(f){if(f===null)return"";if(a.isDate(f))return f.toISOString();if(a.isBoolean(f))return f.toString();if(!d&&a.isBlob(f))throw new y("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(f)||a.isTypedArray(f)?d&&typeof Blob=="function"?new Blob([f]):Buffer.from(f):f}function l(f,w,h){let S=f;if(f&&!h&&typeof f=="object"){if(a.endsWith(w,"{}"))w=r?w:w.slice(0,-2),f=JSON.stringify(f);else if(a.isArray(f)&&ln(f)||(a.isFileList(f)||a.endsWith(w,"[]"))&&(S=a.toArray(f)))return w=Le(w),S.forEach(function(g,E){!(a.isUndefined(g)||g===null)&&t.append(i===!0?ke([w],E,o):i===null?w:w+"[]",u(g))}),!1}return pe(f)?!0:(t.append(ke(h,w,o),u(f)),!1)}const m=[],b=Object.assign(un,{defaultVisitor:l,convertValue:u,isVisitable:pe});function A(f,w){if(!a.isUndefined(f)){if(m.indexOf(f)!==-1)throw Error("Circular reference detected in "+w.join("."));m.push(f),a.forEach(f,function(S,O){(!(a.isUndefined(S)||S===null)&&s.call(t,S,a.isString(O)?O.trim():O,w,b))===!0&&A(S,w?w.concat(O):[O])}),m.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return A(e),t}function Be(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function me(e,t){this._pairs=[],e&&ne(e,this,t)}const Ie=me.prototype;Ie.append=function(t,n){this._pairs.push([t,n])},Ie.toString=function(t){const n=t?function(r){return t.call(this,r,Be)}:Be;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function fn(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function je(e,t,n){if(!t)return e;const r=n&&n.encode||fn,s=a.isFunction(n)?{serialize:n}:n,o=s&&s.serialize;let i;if(o?i=o(t,s):i=a.isURLSearchParams(t)?t.toString():new me(t,s).toString(r),i){const c=e.indexOf("#");c!==-1&&(e=e.slice(0,c)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class $e{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){a.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Me={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},dn={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:me,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},he=typeof window<"u"&&typeof document<"u",we=typeof navigator=="object"&&navigator||void 0,pn=he&&(!we||["ReactNative","NativeScript","NS"].indexOf(we.product)<0),mn=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",hn=he&&window.location.href||"http://localhost",R={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:he,hasStandardBrowserEnv:pn,hasStandardBrowserWebWorkerEnv:mn,navigator:we,origin:hn},Symbol.toStringTag,{value:"Module"})),...dn};function wn(e,t){return ne(e,new R.classes.URLSearchParams,{visitor:function(n,r,s,o){return R.isNode&&a.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}function yn(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function En(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}function qe(e){function t(n,r,s,o){let i=n[o++];if(i==="__proto__")return!0;const c=Number.isFinite(+i),d=o>=n.length;return i=!i&&a.isArray(s)?s.length:i,d?(a.hasOwnProp(s,i)?s[i]=[s[i],r]:s[i]=r,!c):((!s[i]||!a.isObject(s[i]))&&(s[i]=[]),t(n,r,s[i],o)&&a.isArray(s[i])&&(s[i]=En(s[i])),!c)}if(a.isFormData(e)&&a.isFunction(e.entries)){const n={};return a.forEachEntry(e,(r,s)=>{t(yn(r),s,n,0)}),n}return null}function bn(e,t,n){if(a.isString(e))try{return(t||JSON.parse)(e),a.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const W={transitional:Me,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,o=a.isObject(t);if(o&&a.isHTMLForm(t)&&(t=new FormData(t)),a.isFormData(t))return s?JSON.stringify(qe(t)):t;if(a.isArrayBuffer(t)||a.isBuffer(t)||a.isStream(t)||a.isFile(t)||a.isBlob(t)||a.isReadableStream(t))return t;if(a.isArrayBufferView(t))return t.buffer;if(a.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return wn(t,this.formSerializer).toString();if((c=a.isFileList(t))||r.indexOf("multipart/form-data")>-1){const d=this.env&&this.env.FormData;return ne(c?{"files[]":t}:t,d&&new d,this.formSerializer)}}return o||s?(n.setContentType("application/json",!1),bn(t)):t}],transformResponse:[function(t){const n=this.transitional||W.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(a.isResponse(t)||a.isReadableStream(t))return t;if(t&&a.isString(t)&&(r&&!this.responseType||s)){const i=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t,this.parseReviver)}catch(c){if(i)throw c.name==="SyntaxError"?y.from(c,y.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:R.classes.FormData,Blob:R.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a.forEach(["delete","get","head","post","put","patch"],e=>{W.headers[e]={}});const gn=a.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Sn=e=>{const t={};let n,r,s;return e&&e.split(`
2
- `).forEach(function(i){s=i.indexOf(":"),n=i.substring(0,s).trim().toLowerCase(),r=i.substring(s+1).trim(),!(!n||t[n]&&gn[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},He=Symbol("internals");function X(e){return e&&String(e).trim().toLowerCase()}function re(e){return e===!1||e==null?e:a.isArray(e)?e.map(re):String(e)}function _n(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}const On=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function ye(e,t,n,r,s){if(a.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!a.isString(t)){if(a.isString(r))return t.indexOf(r)!==-1;if(a.isRegExp(r))return r.test(t)}}function Tn(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function An(e,t){const n=a.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,o,i){return this[r].call(this,t,s,o,i)},configurable:!0})})}let x=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function o(c,d,u){const l=X(d);if(!l)throw new Error("header name must be a non-empty string");const m=a.findKey(s,l);(!m||s[m]===void 0||u===!0||u===void 0&&s[m]!==!1)&&(s[m||d]=re(c))}const i=(c,d)=>a.forEach(c,(u,l)=>o(u,l,d));if(a.isPlainObject(t)||t instanceof this.constructor)i(t,n);else if(a.isString(t)&&(t=t.trim())&&!On(t))i(Sn(t),n);else if(a.isObject(t)&&a.isIterable(t)){let c={},d,u;for(const l of t){if(!a.isArray(l))throw TypeError("Object iterator must return a key-value pair");c[u=l[0]]=(d=c[u])?a.isArray(d)?[...d,l[1]]:[d,l[1]]:l[1]}i(c,n)}else t!=null&&o(n,t,r);return this}get(t,n){if(t=X(t),t){const r=a.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return _n(s);if(a.isFunction(n))return n.call(this,s,r);if(a.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=X(t),t){const r=a.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||ye(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function o(i){if(i=X(i),i){const c=a.findKey(r,i);c&&(!n||ye(r,r[c],c,n))&&(delete r[c],s=!0)}}return a.isArray(t)?t.forEach(o):o(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const o=n[r];(!t||ye(this,this[o],o,t,!0))&&(delete this[o],s=!0)}return s}normalize(t){const n=this,r={};return a.forEach(this,(s,o)=>{const i=a.findKey(r,o);if(i){n[i]=re(s),delete n[o];return}const c=t?Tn(o):String(o).trim();c!==o&&delete n[o],n[c]=re(s),r[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return a.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&a.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
3
- `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[He]=this[He]={accessors:{}}).accessors,s=this.prototype;function o(i){const c=X(i);r[c]||(An(s,i),r[c]=!0)}return a.isArray(t)?t.forEach(o):o(t),this}};x.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),a.reduceDescriptors(x.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),a.freezeMethods(x);function Ee(e,t){const n=this||W,r=t||n,s=x.from(r.headers);let o=r.data;return a.forEach(e,function(c){o=c.call(n,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function ze(e){return!!(e&&e.__CANCEL__)}let G=class extends y{constructor(t,n,r){super(t??"canceled",y.ERR_CANCELED,n,r),this.name="CanceledError",this.__CANCEL__=!0}};function ve(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new y("Request failed with status code "+n.status,[y.ERR_BAD_REQUEST,y.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Cn(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Rn(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,o=0,i;return t=t!==void 0?t:1e3,function(d){const u=Date.now(),l=r[o];i||(i=u),n[s]=d,r[s]=u;let m=o,b=0;for(;m!==s;)b+=n[m++],m=m%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),u-i<t)return;const A=l&&u-l;return A?Math.round(b*1e3/A):void 0}}function Nn(e,t){let n=0,r=1e3/t,s,o;const i=(u,l=Date.now())=>{n=l,s=null,o&&(clearTimeout(o),o=null),e(...u)};return[(...u)=>{const l=Date.now(),m=l-n;m>=r?i(u,l):(s=u,o||(o=setTimeout(()=>{o=null,i(s)},r-m)))},()=>s&&i(s)]}const se=(e,t,n=3)=>{let r=0;const s=Rn(50,250);return Nn(o=>{const i=o.loaded,c=o.lengthComputable?o.total:void 0,d=i-r,u=s(d),l=i<=c;r=i;const m={loaded:i,total:c,progress:c?i/c:void 0,bytes:d,rate:u||void 0,estimated:u&&c&&l?(c-i)/u:void 0,event:o,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(m)},n)},Je=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Ve=e=>(...t)=>a.asap(()=>e(...t)),xn=R.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,R.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(R.origin),R.navigator&&/(msie|trident)/i.test(R.navigator.userAgent)):()=>!0,Pn=R.hasStandardBrowserEnv?{write(e,t,n,r,s,o,i){if(typeof document>"u")return;const c=[`${e}=${encodeURIComponent(t)}`];a.isNumber(n)&&c.push(`expires=${new Date(n).toUTCString()}`),a.isString(r)&&c.push(`path=${r}`),a.isString(s)&&c.push(`domain=${s}`),o===!0&&c.push("secure"),a.isString(i)&&c.push(`SameSite=${i}`),document.cookie=c.join("; ")},read(e){if(typeof document>"u")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(){return null},remove(){}};function Dn(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Un(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Ke(e,t,n){let r=!Dn(t);return e&&(r||n==!1)?Un(e,t):t}const We=e=>e instanceof x?{...e}:e;function $(e,t){t=t||{};const n={};function r(u,l,m,b){return a.isPlainObject(u)&&a.isPlainObject(l)?a.merge.call({caseless:b},u,l):a.isPlainObject(l)?a.merge({},l):a.isArray(l)?l.slice():l}function s(u,l,m,b){if(a.isUndefined(l)){if(!a.isUndefined(u))return r(void 0,u,m,b)}else return r(u,l,m,b)}function o(u,l){if(!a.isUndefined(l))return r(void 0,l)}function i(u,l){if(a.isUndefined(l)){if(!a.isUndefined(u))return r(void 0,u)}else return r(void 0,l)}function c(u,l,m){if(m in t)return r(u,l);if(m in e)return r(void 0,u)}const d={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:c,headers:(u,l,m)=>s(We(u),We(l),m,!0)};return a.forEach(Object.keys({...e,...t}),function(l){const m=d[l]||s,b=m(e[l],t[l],l);a.isUndefined(b)&&m!==c||(n[l]=b)}),n}const Xe=e=>{const t=$({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:o,headers:i,auth:c}=t;if(t.headers=i=x.from(i),t.url=je(Ke(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&i.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),a.isFormData(n)){if(R.hasStandardBrowserEnv||R.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(a.isFunction(n.getHeaders)){const d=n.getHeaders(),u=["content-type","content-length"];Object.entries(d).forEach(([l,m])=>{u.includes(l.toLowerCase())&&i.set(l,m)})}}if(R.hasStandardBrowserEnv&&(r&&a.isFunction(r)&&(r=r(t)),r||r!==!1&&xn(t.url))){const d=s&&o&&Pn.read(o);d&&i.set(s,d)}return t},Fn=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const s=Xe(e);let o=s.data;const i=x.from(s.headers).normalize();let{responseType:c,onUploadProgress:d,onDownloadProgress:u}=s,l,m,b,A,f;function w(){A&&A(),f&&f(),s.cancelToken&&s.cancelToken.unsubscribe(l),s.signal&&s.signal.removeEventListener("abort",l)}let h=new XMLHttpRequest;h.open(s.method.toUpperCase(),s.url,!0),h.timeout=s.timeout;function S(){if(!h)return;const g=x.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),C={data:!c||c==="text"||c==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:g,config:e,request:h};ve(function(P){n(P),w()},function(P){r(P),w()},C),h=null}"onloadend"in h?h.onloadend=S:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(S)},h.onabort=function(){h&&(r(new y("Request aborted",y.ECONNABORTED,e,h)),h=null)},h.onerror=function(E){const C=E&&E.message?E.message:"Network Error",k=new y(C,y.ERR_NETWORK,e,h);k.event=E||null,r(k),h=null},h.ontimeout=function(){let E=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const C=s.transitional||Me;s.timeoutErrorMessage&&(E=s.timeoutErrorMessage),r(new y(E,C.clarifyTimeoutError?y.ETIMEDOUT:y.ECONNABORTED,e,h)),h=null},o===void 0&&i.setContentType(null),"setRequestHeader"in h&&a.forEach(i.toJSON(),function(E,C){h.setRequestHeader(C,E)}),a.isUndefined(s.withCredentials)||(h.withCredentials=!!s.withCredentials),c&&c!=="json"&&(h.responseType=s.responseType),u&&([b,f]=se(u,!0),h.addEventListener("progress",b)),d&&h.upload&&([m,A]=se(d),h.upload.addEventListener("progress",m),h.upload.addEventListener("loadend",A)),(s.cancelToken||s.signal)&&(l=g=>{h&&(r(!g||g.type?new G(null,e,h):g),h.abort(),h=null)},s.cancelToken&&s.cancelToken.subscribe(l),s.signal&&(s.signal.aborted?l():s.signal.addEventListener("abort",l)));const O=Cn(s.url);if(O&&R.protocols.indexOf(O)===-1){r(new y("Unsupported protocol "+O+":",y.ERR_BAD_REQUEST,e));return}h.send(o||null)})},Ln=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const o=function(u){if(!s){s=!0,c();const l=u instanceof Error?u:this.reason;r.abort(l instanceof y?l:new G(l instanceof Error?l.message:l))}};let i=t&&setTimeout(()=>{i=null,o(new y(`timeout of ${t}ms exceeded`,y.ETIMEDOUT))},t);const c=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(o):u.removeEventListener("abort",o)}),e=null)};e.forEach(u=>u.addEventListener("abort",o));const{signal:d}=r;return d.unsubscribe=()=>a.asap(c),d}},kn=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,s;for(;r<n;)s=r+t,yield e.slice(r,s),r=s},Bn=async function*(e,t){for await(const n of In(e))yield*kn(n,t)},In=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},Ge=(e,t,n,r)=>{const s=Bn(e,t);let o=0,i,c=d=>{i||(i=!0,r&&r(d))};return new ReadableStream({async pull(d){try{const{done:u,value:l}=await s.next();if(u){c(),d.close();return}let m=l.byteLength;if(n){let b=o+=m;n(b)}d.enqueue(new Uint8Array(l))}catch(u){throw c(u),u}},cancel(d){return c(d),s.return()}},{highWaterMark:2})},Qe=64*1024,{isFunction:oe}=a,jn=(({Request:e,Response:t})=>({Request:e,Response:t}))(a.global),{ReadableStream:Ye,TextEncoder:Ze}=a.global,et=(e,...t)=>{try{return!!e(...t)}catch{return!1}},$n=e=>{e=a.merge.call({skipUndefined:!0},jn,e);const{fetch:t,Request:n,Response:r}=e,s=t?oe(t):typeof fetch=="function",o=oe(n),i=oe(r);if(!s)return!1;const c=s&&oe(Ye),d=s&&(typeof Ze=="function"?(f=>w=>f.encode(w))(new Ze):async f=>new Uint8Array(await new n(f).arrayBuffer())),u=o&&c&&et(()=>{let f=!1;const w=new n(R.origin,{body:new Ye,method:"POST",get duplex(){return f=!0,"half"}}).headers.has("Content-Type");return f&&!w}),l=i&&c&&et(()=>a.isReadableStream(new r("").body)),m={stream:l&&(f=>f.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(f=>{!m[f]&&(m[f]=(w,h)=>{let S=w&&w[f];if(S)return S.call(w);throw new y(`Response type '${f}' is not supported`,y.ERR_NOT_SUPPORT,h)})});const b=async f=>{if(f==null)return 0;if(a.isBlob(f))return f.size;if(a.isSpecCompliantForm(f))return(await new n(R.origin,{method:"POST",body:f}).arrayBuffer()).byteLength;if(a.isArrayBufferView(f)||a.isArrayBuffer(f))return f.byteLength;if(a.isURLSearchParams(f)&&(f=f+""),a.isString(f))return(await d(f)).byteLength},A=async(f,w)=>{const h=a.toFiniteNumber(f.getContentLength());return h??b(w)};return async f=>{let{url:w,method:h,data:S,signal:O,cancelToken:g,timeout:E,onDownloadProgress:C,onUploadProgress:k,responseType:P,headers:Oe,withCredentials:ce="same-origin",fetchOptions:mt}=Xe(f),ht=t||fetch;P=P?(P+"").toLowerCase():"text";let le=Ln([O,g&&g.toAbortSignal()],E),Q=null;const q=le&&le.unsubscribe&&(()=>{le.unsubscribe()});let wt;try{if(k&&u&&h!=="get"&&h!=="head"&&(wt=await A(Oe,S))!==0){let I=new n(w,{method:"POST",body:S,duplex:"half"}),v;if(a.isFormData(S)&&(v=I.headers.get("content-type"))&&Oe.setContentType(v),I.body){const[Te,ue]=Je(wt,se(Ve(k)));S=Ge(I.body,Qe,Te,ue)}}a.isString(ce)||(ce=ce?"include":"omit");const L=o&&"credentials"in n.prototype,yt={...mt,signal:le,method:h.toUpperCase(),headers:Oe.normalize().toJSON(),body:S,duplex:"half",credentials:L?ce:void 0};Q=o&&new n(w,yt);let B=await(o?ht(Q,mt):ht(w,yt));const Et=l&&(P==="stream"||P==="response");if(l&&(C||Et&&q)){const I={};["status","statusText","headers"].forEach(bt=>{I[bt]=B[bt]});const v=a.toFiniteNumber(B.headers.get("content-length")),[Te,ue]=C&&Je(v,se(Ve(C),!0))||[];B=new r(Ge(B.body,Qe,Te,()=>{ue&&ue(),q&&q()}),I)}P=P||"text";let Qn=await m[a.findKey(m,P)||"text"](B,f);return!Et&&q&&q(),await new Promise((I,v)=>{ve(I,v,{data:Qn,headers:x.from(B.headers),status:B.status,statusText:B.statusText,config:f,request:Q})})}catch(L){throw q&&q(),L&&L.name==="TypeError"&&/Load failed|fetch/i.test(L.message)?Object.assign(new y("Network Error",y.ERR_NETWORK,f,Q),{cause:L.cause||L}):y.from(L,L&&L.code,f,Q)}}},Mn=new Map,tt=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:s}=t,o=[r,s,n];let i=o.length,c=i,d,u,l=Mn;for(;c--;)d=o[c],u=l.get(d),u===void 0&&l.set(d,u=c?new Map:$n(t)),l=u;return u};tt();const be={http:cn,xhr:Fn,fetch:{get:tt}};a.forEach(be,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const nt=e=>`- ${e}`,qn=e=>a.isFunction(e)||e===null||e===!1;function Hn(e,t){e=a.isArray(e)?e:[e];const{length:n}=e;let r,s;const o={};for(let i=0;i<n;i++){r=e[i];let c;if(s=r,!qn(r)&&(s=be[(c=String(r)).toLowerCase()],s===void 0))throw new y(`Unknown adapter '${c}'`);if(s&&(a.isFunction(s)||(s=s.get(t))))break;o[c||"#"+i]=s}if(!s){const i=Object.entries(o).map(([d,u])=>`adapter ${d} `+(u===!1?"is not supported by the environment":"is not available in the build"));let c=n?i.length>1?`since :
4
- `+i.map(nt).join(`
5
- `):" "+nt(i[0]):"as no adapter specified";throw new y("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return s}const rt={getAdapter:Hn,adapters:be};function ge(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new G(null,e)}function st(e){return ge(e),e.headers=x.from(e.headers),e.data=Ee.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),rt.getAdapter(e.adapter||W.adapter,e)(e).then(function(r){return ge(e),r.data=Ee.call(e,e.transformResponse,r),r.headers=x.from(r.headers),r},function(r){return ze(r)||(ge(e),r&&r.response&&(r.response.data=Ee.call(e,e.transformResponse,r.response),r.response.headers=x.from(r.response.headers))),Promise.reject(r)})}const ot="1.13.4",ie={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ie[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const it={};ie.transitional=function(t,n,r){function s(o,i){return"[Axios v"+ot+"] Transitional option '"+o+"'"+i+(r?". "+r:"")}return(o,i,c)=>{if(t===!1)throw new y(s(i," has been removed"+(n?" in "+n:"")),y.ERR_DEPRECATED);return n&&!it[i]&&(it[i]=!0,console.warn(s(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,i,c):!0}},ie.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function zn(e,t,n){if(typeof e!="object")throw new y("options must be an object",y.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 c=e[o],d=c===void 0||i(c,o,e);if(d!==!0)throw new y("option "+o+" must be "+d,y.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new y("Unknown option "+o,y.ERR_BAD_OPTION)}}const ae={assertOptions:zn,validators:ie},F=ae.validators;let M=class{constructor(t){this.defaults=t||{},this.interceptors={request:new $e,response:new $e}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const o=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=`
6
- `+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=$(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&ae.assertOptions(r,{silentJSONParsing:F.transitional(F.boolean),forcedJSONParsing:F.transitional(F.boolean),clarifyTimeoutError:F.transitional(F.boolean)},!1),s!=null&&(a.isFunction(s)?n.paramsSerializer={serialize:s}:ae.assertOptions(s,{encode:F.function,serialize:F.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),ae.assertOptions(n,{baseUrl:F.spelling("baseURL"),withXsrfToken:F.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=o&&a.merge(o.common,o[n.method]);o&&a.forEach(["delete","get","head","post","put","patch","common"],f=>{delete o[f]}),n.headers=x.concat(i,o);const c=[];let d=!0;this.interceptors.request.forEach(function(w){typeof w.runWhen=="function"&&w.runWhen(n)===!1||(d=d&&w.synchronous,c.unshift(w.fulfilled,w.rejected))});const u=[];this.interceptors.response.forEach(function(w){u.push(w.fulfilled,w.rejected)});let l,m=0,b;if(!d){const f=[st.bind(this),void 0];for(f.unshift(...c),f.push(...u),b=f.length,l=Promise.resolve(n);m<b;)l=l.then(f[m++],f[m++]);return l}b=c.length;let A=n;for(;m<b;){const f=c[m++],w=c[m++];try{A=f(A)}catch(h){w.call(this,h);break}}try{l=st.call(this,A)}catch(f){return Promise.reject(f)}for(m=0,b=u.length;m<b;)l=l.then(u[m++],u[m++]);return l}getUri(t){t=$(this.defaults,t);const n=Ke(t.baseURL,t.url,t.allowAbsoluteUrls);return je(n,t.params,t.paramsSerializer)}};a.forEach(["delete","get","head","options"],function(t){M.prototype[t]=function(n,r){return this.request($(r||{},{method:t,url:n,data:(r||{}).data}))}}),a.forEach(["post","put","patch"],function(t){function n(r){return function(o,i,c){return this.request($(c||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}M.prototype[t]=n(),M.prototype[t+"Form"]=n(!0)});let vn=class _t{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(s=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](s);r._listeners=null}),this.promise.then=s=>{let o;const i=new Promise(c=>{r.subscribe(c),o=c}).then(s);return i.cancel=function(){r.unsubscribe(o)},i},t(function(o,i,c){r.reason||(r.reason=new G(o,i,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new _t(function(s){t=s}),cancel:t}}};function Jn(e){return function(n){return e.apply(null,n)}}function Vn(e){return a.isObject(e)&&e.isAxiosError===!0}const Se={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(Se).forEach(([e,t])=>{Se[t]=e});function at(e){const t=new M(e),n=Ae(M.prototype.request,t);return a.extend(n,M.prototype,t,{allOwnKeys:!0}),a.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return at($(e,s))},n}const _=at(W);_.Axios=M,_.CanceledError=G,_.CancelToken=vn,_.isCancel=ze,_.VERSION=ot,_.toFormData=ne,_.AxiosError=y,_.Cancel=_.CanceledError,_.all=function(t){return Promise.all(t)},_.spread=Jn,_.isAxiosError=Vn,_.mergeConfig=$,_.AxiosHeaders=x,_.formToJSON=e=>qe(a.isHTMLForm(e)?new FormData(e):e),_.getAdapter=rt.getAdapter,_.HttpStatusCode=Se,_.default=_;const{Axios:ir,AxiosError:ar,CanceledError:cr,isCancel:lr,CancelToken:ur,VERSION:fr,all:dr,Cancel:pr,isAxiosError:mr,spread:hr,toFormData:wr,AxiosHeaders:yr,HttpStatusCode:Er,formToJSON:br,getAdapter:gr,mergeConfig:Sr}=_,Kn="https://customers-services.tarxemo.com/api";class ct{constructor(t,n=Kn){gt(this,"client");this.client=_.create({baseURL:n,headers:{"Content-Type":"application/json","X-API-Key":t},timeout:3e4}),this.client.interceptors.response.use(r=>r,r=>{var s,o;if((s=r.response)!=null&&s.data){const c=((o=r.response.data.response)==null?void 0:o.message)||"An unknown error occurred";throw new Error(c)}else throw r.request?new Error("No response from server. Please check your connection."):new Error(r.message||"Request failed")})}async sendMessage(t,n){try{const r=await this.client.post("/chat/",{question:t,session_id:n});if(r.data.response.status!=="success")throw new Error(r.data.response.message);return r.data.data}catch(r){throw r instanceof Error?r:new Error("Failed to send message")}}async getConversationHistory(t){try{const n=await this.client.get(`/chat/history/${t}/`);if(n.data.response.status!=="success")throw new Error(n.data.response.message);return n.data.data}catch(n){throw n instanceof Error?n:new Error("Failed to load conversation history")}}updateApiKey(t){this.client.defaults.headers.common["X-API-Key"]=t}updateBaseUrl(t){this.client.defaults.baseURL=t}}function _e(e,t){const[n,r]=p.useState(()=>{try{const o=window.localStorage.getItem(e);return o?JSON.parse(o):t}catch(o){return console.warn(`Error reading localStorage key "${e}":`,o),t}});return[n,o=>{try{const i=o instanceof Function?o(n):o;r(i),window.localStorage.setItem(e,JSON.stringify(i))}catch(i){console.warn(`Error setting localStorage key "${e}":`,i)}}]}function lt(){return`session_${Date.now()}_${Math.random().toString(36).substring(2,9)}`}const Wn="customer_support_session_id",Xn="customer_support_messages";function ut(e){const{apiKey:t,baseUrl:n,onError:r}=e,[s,o]=_e(Xn,[]),[i,c]=_e(Wn,lt()),[d,u]=p.useState(!1),[l,m]=p.useState(null),b=p.useRef(null);p.useEffect(()=>{b.current=new ct(t,n)},[t,n]);const A=p.useCallback(()=>{m(null)},[]),f=p.useCallback(async S=>{if(!b.current){const g=new Error("API client not initialized");m(g),r==null||r(g);return}if(!S.trim())return;const O={id:`user_${Date.now()}`,role:"USER",content:S,timestamp:new Date};o(g=>[...g,O]),u(!0),m(null);try{const g=await b.current.sendMessage(S,i),E={id:`assistant_${Date.now()}`,role:"ASSISTANT",content:g.answer,timestamp:new Date,sources:g.sources};o(C=>[...C,E]),g.session_id!==i&&c(g.session_id)}catch(g){const E=g instanceof Error?g:new Error("Failed to send message");m(E),r==null||r(E);const C={id:`error_${Date.now()}`,role:"ASSISTANT",content:`Sorry, I encountered an error: ${E.message}`,timestamp:new Date};o(k=>[...k,C])}finally{u(!1)}},[i,r,o,c]),w=p.useCallback(async()=>{if(!(!b.current||!i)){u(!0),m(null);try{const O=(await b.current.getConversationHistory(i)).messages.map((g,E)=>({id:`${g.role.toLowerCase()}_${E}_${Date.now()}`,role:g.role.toUpperCase(),content:g.content,timestamp:new Date(g.created_at)}));o(O)}catch(S){const O=S instanceof Error?S:new Error("Failed to load history");m(O),r==null||r(O)}finally{u(!1)}}},[i,r,o]),h=p.useCallback(()=>{o([]),c(lt())},[o,c]);return{messages:s,sendMessage:f,isLoading:d,error:l,clearError:A,sessionId:i,loadHistory:w,clearHistory:h}}const ft=({message:e})=>{const t=e.role.toUpperCase()==="USER",n=e.timestamp instanceof Date?e.timestamp:new Date(e.timestamp);return p.createElement("div",{className:`cs-message ${t?"cs-message--user":"cs-message--assistant"}`},p.createElement("div",{className:"cs-message__content"},p.createElement("p",{className:"cs-message__text"},e.content),e.sources&&e.sources.length>0&&p.createElement("div",{className:"cs-message__sources"},p.createElement("p",{className:"cs-message__sources-title"},"Sources:"),p.createElement("ul",{className:"cs-message__sources-list"},e.sources.map((r,s)=>p.createElement("li",{key:s,className:"cs-message__source-item"},p.createElement("a",{href:r.url,target:"_blank",rel:"noopener noreferrer",className:"cs-message__source-link"},p.createElement(U.ExternalLink,{size:12}),p.createElement("span",null,r.title)),p.createElement("span",{className:"cs-message__source-similarity"},Math.round(r.similarity*100),"% match")))))),p.createElement("time",{className:"cs-message__time",dateTime:n.toISOString()},n.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})))},dt=({onSendMessage:e,isLoading:t,placeholder:n="Type your message..."})=>{const[r,s]=p.useState(""),o=c=>{c.preventDefault(),r.trim()&&!t&&(e(r),s(""))},i=c=>{c.key==="Enter"&&!c.shiftKey&&(c.preventDefault(),o(c))};return p.createElement("form",{className:"cs-input",onSubmit:o},p.createElement("textarea",{className:"cs-input__textarea",value:r,onChange:c=>s(c.target.value),onKeyDown:i,placeholder:n,disabled:t,rows:1,"aria-label":"Message input"}),p.createElement("button",{type:"submit",className:"cs-input__button",disabled:!r.trim()||t,"aria-label":"Send message"},p.createElement(U.Send,{size:20})))},pt=({messages:e,onSendMessage:t,onClose:n,isLoading:r,error:s,placeholder:o,welcomeMessage:i="Hi! How can I help you today?"})=>{const c=p.useRef(null);return p.useEffect(()=>{var d;(d=c.current)==null||d.scrollIntoView({behavior:"smooth"})},[e]),p.createElement("div",{className:"cs-window"},p.createElement("div",{className:"cs-window__header"},p.createElement("div",{className:"cs-window__header-info"},p.createElement("h3",{className:"cs-window__title"},"Customer Support"),p.createElement("div",{className:"cs-window__status"},p.createElement("span",{className:"cs-window__status-dot"}),p.createElement("span",null,"Online"))),p.createElement("button",{className:"cs-window__close",onClick:n,"aria-label":"Close chat"},p.createElement(U.X,{size:20}))),p.createElement("div",{className:"cs-window__messages"},e.length===0&&!r&&p.createElement("div",{className:"cs-window__welcome"},p.createElement("p",null,i)),e.map(d=>p.createElement(ft,{key:d.id,message:d})),r&&p.createElement("div",{className:"cs-window__typing"},p.createElement(U.Loader2,{size:20,className:"cs-window__typing-icon"}),p.createElement("span",null,"Thinking...")),s&&p.createElement("div",{className:"cs-window__error"},p.createElement("p",null,s.message)),p.createElement("div",{ref:c})),p.createElement("div",{className:"cs-window__input-wrapper"},p.createElement(dt,{onSendMessage:t,isLoading:r,placeholder:o})))},Gn=({apiKey:e,baseUrl:t,theme:n,position:r="bottom-right",welcomeMessage:s,placeholder:o,className:i="",onError:c,onMessageSent:d,onMessageReceived:u})=>{const[l,m]=p.useState(!1),{messages:b,sendMessage:A,isLoading:f,error:w,clearError:h}=ut({apiKey:e,baseUrl:t,onError:c}),S=p.useMemo(()=>{const E={};return E["--cs-primary-color"]=(n==null?void 0:n.primaryColor)||"#6366f1",E["--cs-secondary-color"]=(n==null?void 0:n.secondaryColor)||(n==null?void 0:n.primaryColor)||"#8b5cf6",E["--cs-bg-color"]=(n==null?void 0:n.backgroundColor)||"#ffffff",E["--cs-text-color"]=(n==null?void 0:n.textColor)||"#1f2937",E["--cs-font-family"]=(n==null?void 0:n.fontFamily)||"inherit",E["--cs-border-radius"]=(n==null?void 0:n.borderRadius)||"12px",E["--cs-button-color"]=(n==null?void 0:n.buttonColor)||(n==null?void 0:n.primaryColor)||"#6366f1",E["--cs-user-message-color"]=(n==null?void 0:n.userMessageColor)||(n==null?void 0:n.primaryColor)||"#6366f1",E["--cs-assistant-message-color"]=(n==null?void 0:n.assistantMessageColor)||"#f3f4f6",n!=null&&n.primaryColor&&(E["--cs-focus-ring"]=`${n.primaryColor}33`),E},[n]),O=async E=>{if(d==null||d(E),await A(E),!w){const C=b[b.length-1];(C==null?void 0:C.role)==="ASSISTANT"&&(u==null||u(C.content))}},g=()=>{m(!l),w&&h()};return p.createElement("div",{className:`cs-widget cs-widget--${r} ${l?"cs-widget--open":""} ${i}`,style:S},l&&p.createElement(pt,{messages:b,onSendMessage:O,onClose:()=>m(!1),isLoading:f,error:w,placeholder:o,welcomeMessage:s}),p.createElement("button",{className:`cs-widget__toggle ${l?"cs-widget__toggle--open":""}`,onClick:g,"aria-label":l?"Close chat":"Open chat","aria-expanded":l},p.createElement(U.MessageCircle,{size:24}),!l&&b.length>0&&p.createElement("span",{className:"cs-widget__badge"},b.filter(E=>E.role==="ASSISTANT").length)))};T.ChatInput=dt,T.ChatMessage=ft,T.ChatWindow=pt,T.CustomerSupportAPIClient=ct,T.CustomerSupportWidget=Gn,T.useCustomerSupport=ut,T.useLocalStorage=_e,Object.defineProperty(T,Symbol.toStringTag,{value:"Module"})}));
1
+ (function(O,p){typeof exports=="object"&&typeof module<"u"?p(exports,require("react"),require("lucide-react")):typeof define=="function"&&define.amd?define(["exports","react","lucide-react"],p):(O=typeof globalThis<"u"?globalThis:O||self,p(O.CustomerSupport={},O.React,O.lucideReact))})(this,(function(O,p,U){"use strict";var Qr=Object.defineProperty;var Zr=(O,p,U)=>p in O?Qr(O,p,{enumerable:!0,configurable:!0,writable:!0,value:U}):O[p]=U;var xt=(O,p,U)=>Zr(O,typeof p!="symbol"?p+"":p,U);function Te(e,t){return function(){return e.apply(t,arguments)}}const{toString:St}=Object.prototype,{getPrototypeOf:de}=Object,{iterator:Q,toStringTag:Ae}=Symbol,Z=(e=>t=>{const r=St.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),P=e=>(e=e.toLowerCase(),t=>Z(t)===e),ee=e=>t=>typeof t===e,{isArray:H}=Array,q=ee("undefined");function J(e){return e!==null&&!q(e)&&e.constructor!==null&&!q(e.constructor)&&R(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Ce=P("ArrayBuffer");function Ot(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Ce(e.buffer),t}const Tt=ee("string"),R=ee("function"),Re=ee("number"),K=e=>e!==null&&typeof e=="object",At=e=>e===!0||e===!1,te=e=>{if(Z(e)!=="object")return!1;const t=de(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Ae in e)&&!(Q in e)},Ct=e=>{if(!K(e)||J(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Rt=P("Date"),Nt=P("File"),kt=P("Blob"),Pt=P("FileList"),Ut=e=>K(e)&&R(e.pipe),Dt=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||R(e.append)&&((t=Z(e))==="formdata"||t==="object"&&R(e.toString)&&e.toString()==="[object FormData]"))},Ft=P("URLSearchParams"),[Lt,vt,Bt,It]=["ReadableStream","Request","Response","Headers"].map(P),jt=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function V(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,s;if(typeof e!="object"&&(e=[e]),H(e))for(n=0,s=e.length;n<s;n++)t.call(null,e[n],n,e);else{if(J(e))return;const o=r?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let c;for(n=0;n<i;n++)c=o[n],t.call(null,e[c],c,e)}}function Ne(e,t){if(J(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n=r.length,s;for(;n-- >0;)if(s=r[n],t===s.toLowerCase())return s;return null}const I=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,ke=e=>!q(e)&&e!==I;function fe(){const{caseless:e,skipUndefined:t}=ke(this)&&this||{},r={},n=(s,o)=>{const i=e&&Ne(r,o)||o;te(r[i])&&te(s)?r[i]=fe(r[i],s):te(s)?r[i]=fe({},s):H(s)?r[i]=s.slice():(!t||!q(s))&&(r[i]=s)};for(let s=0,o=arguments.length;s<o;s++)arguments[s]&&V(arguments[s],n);return r}const $t=(e,t,r,{allOwnKeys:n}={})=>(V(t,(s,o)=>{r&&R(s)?Object.defineProperty(e,o,{value:Te(s,r),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:n}),e),Mt=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Ht=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},qt=(e,t,r,n)=>{let s,o,i;const c={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)i=s[o],(!n||n(i,e,t))&&!c[i]&&(t[i]=e[i],c[i]=!0);e=r!==!1&&de(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},zt=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},Jt=e=>{if(!e)return null;if(H(e))return e;let t=e.length;if(!Re(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},Kt=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&de(Uint8Array)),Vt=(e,t)=>{const n=(e&&e[Q]).call(e);let s;for(;(s=n.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},Wt=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},Xt=P("HTMLFormElement"),Gt=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,s){return n.toUpperCase()+s}),Pe=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),Yt=P("RegExp"),Ue=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};V(r,(s,o)=>{let i;(i=t(s,o,e))!==!1&&(n[o]=i||s)}),Object.defineProperties(e,n)},Qt=e=>{Ue(e,(t,r)=>{if(R(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(R(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},Zt=(e,t)=>{const r={},n=s=>{s.forEach(o=>{r[o]=!0})};return H(e)?n(e):n(String(e).split(t)),r},er=()=>{},tr=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function rr(e){return!!(e&&R(e.append)&&e[Ae]==="FormData"&&e[Q])}const nr=e=>{const t=new Array(10),r=(n,s)=>{if(K(n)){if(t.indexOf(n)>=0)return;if(J(n))return n;if(!("toJSON"in n)){t[s]=n;const o=H(n)?[]:{};return V(n,(i,c)=>{const f=r(i,s+1);!q(f)&&(o[c]=f)}),t[s]=void 0,o}}return n};return r(e,0)},sr=P("AsyncFunction"),or=e=>e&&(K(e)||R(e))&&R(e.then)&&R(e.catch),De=((e,t)=>e?setImmediate:t?((r,n)=>(I.addEventListener("message",({source:s,data:o})=>{s===I&&o===r&&n.length&&n.shift()()},!1),s=>{n.push(s),I.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",R(I.postMessage)),ir=typeof queueMicrotask<"u"?queueMicrotask.bind(I):typeof process<"u"&&process.nextTick||De,a={isArray:H,isArrayBuffer:Ce,isBuffer:J,isFormData:Dt,isArrayBufferView:Ot,isString:Tt,isNumber:Re,isBoolean:At,isObject:K,isPlainObject:te,isEmptyObject:Ct,isReadableStream:Lt,isRequest:vt,isResponse:Bt,isHeaders:It,isUndefined:q,isDate:Rt,isFile:Nt,isBlob:kt,isRegExp:Yt,isFunction:R,isStream:Ut,isURLSearchParams:Ft,isTypedArray:Kt,isFileList:Pt,forEach:V,merge:fe,extend:$t,trim:jt,stripBOM:Mt,inherits:Ht,toFlatObject:qt,kindOf:Z,kindOfTest:P,endsWith:zt,toArray:Jt,forEachEntry:Vt,matchAll:Wt,isHTMLForm:Xt,hasOwnProperty:Pe,hasOwnProp:Pe,reduceDescriptors:Ue,freezeMethods:Qt,toObjectSet:Zt,toCamelCase:Gt,noop:er,toFiniteNumber:tr,findKey:Ne,global:I,isContextDefined:ke,isSpecCompliantForm:rr,toJSONObject:nr,isAsyncFn:sr,isThenable:or,setImmediate:De,asap:ir,isIterable:e=>e!=null&&R(e[Q])};let w=class Et extends Error{static from(t,r,n,s,o,i){const c=new Et(t.message,r||t.code,n,s,o);return c.cause=t,c.name=t.name,i&&Object.assign(c,i),c}constructor(t,r,n,s,o){super(t),this.name="AxiosError",this.isAxiosError=!0,r&&(this.code=r),n&&(this.config=n),s&&(this.request=s),o&&(this.response=o,this.status=o.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:a.toJSONObject(this.config),code:this.code,status:this.status}}};w.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",w.ERR_BAD_OPTION="ERR_BAD_OPTION",w.ECONNABORTED="ECONNABORTED",w.ETIMEDOUT="ETIMEDOUT",w.ERR_NETWORK="ERR_NETWORK",w.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",w.ERR_DEPRECATED="ERR_DEPRECATED",w.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",w.ERR_BAD_REQUEST="ERR_BAD_REQUEST",w.ERR_CANCELED="ERR_CANCELED",w.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",w.ERR_INVALID_URL="ERR_INVALID_URL";const ar=null;function pe(e){return a.isPlainObject(e)||a.isArray(e)}function Fe(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function Le(e,t,r){return e?e.concat(t).map(function(s,o){return s=Fe(s),!r&&o?"["+s+"]":s}).join(r?".":""):t}function cr(e){return a.isArray(e)&&!e.some(pe)}const lr=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function re(e,t,r){if(!a.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=a.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(g,h){return!a.isUndefined(h[g])});const n=r.metaTokens,s=r.visitor||l,o=r.dots,i=r.indexes,f=(r.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(s))throw new TypeError("visitor must be a function");function u(d){if(d===null)return"";if(a.isDate(d))return d.toISOString();if(a.isBoolean(d))return d.toString();if(!f&&a.isBlob(d))throw new w("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(d)||a.isTypedArray(d)?f&&typeof Blob=="function"?new Blob([d]):Buffer.from(d):d}function l(d,g,h){let E=d;if(d&&!h&&typeof d=="object"){if(a.endsWith(g,"{}"))g=n?g:g.slice(0,-2),d=JSON.stringify(d);else if(a.isArray(d)&&cr(d)||(a.isFileList(d)||a.endsWith(g,"[]"))&&(E=a.toArray(d)))return g=Fe(g),E.forEach(function(x,b){!(a.isUndefined(x)||x===null)&&t.append(i===!0?Le([g],b,o):i===null?g:g+"[]",u(x))}),!1}return pe(d)?!0:(t.append(Le(h,g,o),u(d)),!1)}const m=[],y=Object.assign(lr,{defaultVisitor:l,convertValue:u,isVisitable:pe});function T(d,g){if(!a.isUndefined(d)){if(m.indexOf(d)!==-1)throw Error("Circular reference detected in "+g.join("."));m.push(d),a.forEach(d,function(E,S){(!(a.isUndefined(E)||E===null)&&s.call(t,E,a.isString(S)?S.trim():S,g,y))===!0&&T(E,g?g.concat(S):[S])}),m.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return T(e),t}function ve(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function me(e,t){this._pairs=[],e&&re(e,this,t)}const Be=me.prototype;Be.append=function(t,r){this._pairs.push([t,r])},Be.toString=function(t){const r=t?function(n){return t.call(this,n,ve)}:ve;return this._pairs.map(function(s){return r(s[0])+"="+r(s[1])},"").join("&")};function ur(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Ie(e,t,r){if(!t)return e;const n=r&&r.encode||ur,s=a.isFunction(r)?{serialize:r}:r,o=s&&s.serialize;let i;if(o?i=o(t,s):i=a.isURLSearchParams(t)?t.toString():new me(t,s).toString(n),i){const c=e.indexOf("#");c!==-1&&(e=e.slice(0,c)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class je{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){a.forEach(this.handlers,function(n){n!==null&&t(n)})}}const $e={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},dr={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:me,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},he=typeof window<"u"&&typeof document<"u",ge=typeof navigator=="object"&&navigator||void 0,fr=he&&(!ge||["ReactNative","NativeScript","NS"].indexOf(ge.product)<0),pr=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",mr=he&&window.location.href||"http://localhost",C={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:he,hasStandardBrowserEnv:fr,hasStandardBrowserWebWorkerEnv:pr,navigator:ge,origin:mr},Symbol.toStringTag,{value:"Module"})),...dr};function hr(e,t){return re(e,new C.classes.URLSearchParams,{visitor:function(r,n,s,o){return C.isNode&&a.isBuffer(r)?(this.append(n,r.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}function gr(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function wr(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}function Me(e){function t(r,n,s,o){let i=r[o++];if(i==="__proto__")return!0;const c=Number.isFinite(+i),f=o>=r.length;return i=!i&&a.isArray(s)?s.length:i,f?(a.hasOwnProp(s,i)?s[i]=[s[i],n]:s[i]=n,!c):((!s[i]||!a.isObject(s[i]))&&(s[i]=[]),t(r,n,s[i],o)&&a.isArray(s[i])&&(s[i]=wr(s[i])),!c)}if(a.isFormData(e)&&a.isFunction(e.entries)){const r={};return a.forEachEntry(e,(n,s)=>{t(gr(n),s,r,0)}),r}return null}function br(e,t,r){if(a.isString(e))try{return(t||JSON.parse)(e),a.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const W={transitional:$e,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",s=n.indexOf("application/json")>-1,o=a.isObject(t);if(o&&a.isHTMLForm(t)&&(t=new FormData(t)),a.isFormData(t))return s?JSON.stringify(Me(t)):t;if(a.isArrayBuffer(t)||a.isBuffer(t)||a.isStream(t)||a.isFile(t)||a.isBlob(t)||a.isReadableStream(t))return t;if(a.isArrayBufferView(t))return t.buffer;if(a.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return hr(t,this.formSerializer).toString();if((c=a.isFileList(t))||n.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return re(c?{"files[]":t}:t,f&&new f,this.formSerializer)}}return o||s?(r.setContentType("application/json",!1),br(t)):t}],transformResponse:[function(t){const r=this.transitional||W.transitional,n=r&&r.forcedJSONParsing,s=this.responseType==="json";if(a.isResponse(t)||a.isReadableStream(t))return t;if(t&&a.isString(t)&&(n&&!this.responseType||s)){const i=!(r&&r.silentJSONParsing)&&s;try{return JSON.parse(t,this.parseReviver)}catch(c){if(i)throw c.name==="SyntaxError"?w.from(c,w.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:C.classes.FormData,Blob:C.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a.forEach(["delete","get","head","post","put","patch"],e=>{W.headers[e]={}});const yr=a.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),xr=e=>{const t={};let r,n,s;return e&&e.split(`
2
+ `).forEach(function(i){s=i.indexOf(":"),r=i.substring(0,s).trim().toLowerCase(),n=i.substring(s+1).trim(),!(!r||t[r]&&yr[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},He=Symbol("internals");function X(e){return e&&String(e).trim().toLowerCase()}function ne(e){return e===!1||e==null?e:a.isArray(e)?e.map(ne):String(e)}function Er(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}const _r=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function we(e,t,r,n,s){if(a.isFunction(n))return n.call(this,t,r);if(s&&(t=r),!!a.isString(t)){if(a.isString(n))return t.indexOf(n)!==-1;if(a.isRegExp(n))return n.test(t)}}function Sr(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function Or(e,t){const r=a.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(s,o,i){return this[n].call(this,t,s,o,i)},configurable:!0})})}let N=class{constructor(t){t&&this.set(t)}set(t,r,n){const s=this;function o(c,f,u){const l=X(f);if(!l)throw new Error("header name must be a non-empty string");const m=a.findKey(s,l);(!m||s[m]===void 0||u===!0||u===void 0&&s[m]!==!1)&&(s[m||f]=ne(c))}const i=(c,f)=>a.forEach(c,(u,l)=>o(u,l,f));if(a.isPlainObject(t)||t instanceof this.constructor)i(t,r);else if(a.isString(t)&&(t=t.trim())&&!_r(t))i(xr(t),r);else if(a.isObject(t)&&a.isIterable(t)){let c={},f,u;for(const l of t){if(!a.isArray(l))throw TypeError("Object iterator must return a key-value pair");c[u=l[0]]=(f=c[u])?a.isArray(f)?[...f,l[1]]:[f,l[1]]:l[1]}i(c,r)}else t!=null&&o(r,t,n);return this}get(t,r){if(t=X(t),t){const n=a.findKey(this,t);if(n){const s=this[n];if(!r)return s;if(r===!0)return Er(s);if(a.isFunction(r))return r.call(this,s,n);if(a.isRegExp(r))return r.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=X(t),t){const n=a.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||we(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let s=!1;function o(i){if(i=X(i),i){const c=a.findKey(n,i);c&&(!r||we(n,n[c],c,r))&&(delete n[c],s=!0)}}return a.isArray(t)?t.forEach(o):o(t),s}clear(t){const r=Object.keys(this);let n=r.length,s=!1;for(;n--;){const o=r[n];(!t||we(this,this[o],o,t,!0))&&(delete this[o],s=!0)}return s}normalize(t){const r=this,n={};return a.forEach(this,(s,o)=>{const i=a.findKey(n,o);if(i){r[i]=ne(s),delete r[o];return}const c=t?Sr(o):String(o).trim();c!==o&&delete r[o],r[c]=ne(s),n[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return a.forEach(this,(n,s)=>{n!=null&&n!==!1&&(r[s]=t&&a.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
3
+ `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(s=>n.set(s)),n}static accessor(t){const n=(this[He]=this[He]={accessors:{}}).accessors,s=this.prototype;function o(i){const c=X(i);n[c]||(Or(s,i),n[c]=!0)}return a.isArray(t)?t.forEach(o):o(t),this}};N.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),a.reduceDescriptors(N.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}}),a.freezeMethods(N);function be(e,t){const r=this||W,n=t||r,s=N.from(n.headers);let o=n.data;return a.forEach(e,function(c){o=c.call(r,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function qe(e){return!!(e&&e.__CANCEL__)}let G=class extends w{constructor(t,r,n){super(t??"canceled",w.ERR_CANCELED,r,n),this.name="CanceledError",this.__CANCEL__=!0}};function ze(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new w("Request failed with status code "+r.status,[w.ERR_BAD_REQUEST,w.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function Tr(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Ar(e,t){e=e||10;const r=new Array(e),n=new Array(e);let s=0,o=0,i;return t=t!==void 0?t:1e3,function(f){const u=Date.now(),l=n[o];i||(i=u),r[s]=f,n[s]=u;let m=o,y=0;for(;m!==s;)y+=r[m++],m=m%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),u-i<t)return;const T=l&&u-l;return T?Math.round(y*1e3/T):void 0}}function Cr(e,t){let r=0,n=1e3/t,s,o;const i=(u,l=Date.now())=>{r=l,s=null,o&&(clearTimeout(o),o=null),e(...u)};return[(...u)=>{const l=Date.now(),m=l-r;m>=n?i(u,l):(s=u,o||(o=setTimeout(()=>{o=null,i(s)},n-m)))},()=>s&&i(s)]}const se=(e,t,r=3)=>{let n=0;const s=Ar(50,250);return Cr(o=>{const i=o.loaded,c=o.lengthComputable?o.total:void 0,f=i-n,u=s(f),l=i<=c;n=i;const m={loaded:i,total:c,progress:c?i/c:void 0,bytes:f,rate:u||void 0,estimated:u&&c&&l?(c-i)/u:void 0,event:o,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(m)},r)},Je=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Ke=e=>(...t)=>a.asap(()=>e(...t)),Rr=C.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,C.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(C.origin),C.navigator&&/(msie|trident)/i.test(C.navigator.userAgent)):()=>!0,Nr=C.hasStandardBrowserEnv?{write(e,t,r,n,s,o,i){if(typeof document>"u")return;const c=[`${e}=${encodeURIComponent(t)}`];a.isNumber(r)&&c.push(`expires=${new Date(r).toUTCString()}`),a.isString(n)&&c.push(`path=${n}`),a.isString(s)&&c.push(`domain=${s}`),o===!0&&c.push("secure"),a.isString(i)&&c.push(`SameSite=${i}`),document.cookie=c.join("; ")},read(e){if(typeof document>"u")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(){return null},remove(){}};function kr(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Pr(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Ve(e,t,r){let n=!kr(t);return e&&(n||r==!1)?Pr(e,t):t}const We=e=>e instanceof N?{...e}:e;function j(e,t){t=t||{};const r={};function n(u,l,m,y){return a.isPlainObject(u)&&a.isPlainObject(l)?a.merge.call({caseless:y},u,l):a.isPlainObject(l)?a.merge({},l):a.isArray(l)?l.slice():l}function s(u,l,m,y){if(a.isUndefined(l)){if(!a.isUndefined(u))return n(void 0,u,m,y)}else return n(u,l,m,y)}function o(u,l){if(!a.isUndefined(l))return n(void 0,l)}function i(u,l){if(a.isUndefined(l)){if(!a.isUndefined(u))return n(void 0,u)}else return n(void 0,l)}function c(u,l,m){if(m in t)return n(u,l);if(m in e)return n(void 0,u)}const f={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:c,headers:(u,l,m)=>s(We(u),We(l),m,!0)};return a.forEach(Object.keys({...e,...t}),function(l){const m=f[l]||s,y=m(e[l],t[l],l);a.isUndefined(y)&&m!==c||(r[l]=y)}),r}const Xe=e=>{const t=j({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:s,xsrfCookieName:o,headers:i,auth:c}=t;if(t.headers=i=N.from(i),t.url=Ie(Ve(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&i.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),a.isFormData(r)){if(C.hasStandardBrowserEnv||C.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(a.isFunction(r.getHeaders)){const f=r.getHeaders(),u=["content-type","content-length"];Object.entries(f).forEach(([l,m])=>{u.includes(l.toLowerCase())&&i.set(l,m)})}}if(C.hasStandardBrowserEnv&&(n&&a.isFunction(n)&&(n=n(t)),n||n!==!1&&Rr(t.url))){const f=s&&o&&Nr.read(o);f&&i.set(s,f)}return t},Ur=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(r,n){const s=Xe(e);let o=s.data;const i=N.from(s.headers).normalize();let{responseType:c,onUploadProgress:f,onDownloadProgress:u}=s,l,m,y,T,d;function g(){T&&T(),d&&d(),s.cancelToken&&s.cancelToken.unsubscribe(l),s.signal&&s.signal.removeEventListener("abort",l)}let h=new XMLHttpRequest;h.open(s.method.toUpperCase(),s.url,!0),h.timeout=s.timeout;function E(){if(!h)return;const x=N.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),A={data:!c||c==="text"||c==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:x,config:e,request:h};ze(function(k){r(k),g()},function(k){n(k),g()},A),h=null}"onloadend"in h?h.onloadend=E:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(E)},h.onabort=function(){h&&(n(new w("Request aborted",w.ECONNABORTED,e,h)),h=null)},h.onerror=function(b){const A=b&&b.message?b.message:"Network Error",L=new w(A,w.ERR_NETWORK,e,h);L.event=b||null,n(L),h=null},h.ontimeout=function(){let b=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const A=s.transitional||$e;s.timeoutErrorMessage&&(b=s.timeoutErrorMessage),n(new w(b,A.clarifyTimeoutError?w.ETIMEDOUT:w.ECONNABORTED,e,h)),h=null},o===void 0&&i.setContentType(null),"setRequestHeader"in h&&a.forEach(i.toJSON(),function(b,A){h.setRequestHeader(A,b)}),a.isUndefined(s.withCredentials)||(h.withCredentials=!!s.withCredentials),c&&c!=="json"&&(h.responseType=s.responseType),u&&([y,d]=se(u,!0),h.addEventListener("progress",y)),f&&h.upload&&([m,T]=se(f),h.upload.addEventListener("progress",m),h.upload.addEventListener("loadend",T)),(s.cancelToken||s.signal)&&(l=x=>{h&&(n(!x||x.type?new G(null,e,h):x),h.abort(),h=null)},s.cancelToken&&s.cancelToken.subscribe(l),s.signal&&(s.signal.aborted?l():s.signal.addEventListener("abort",l)));const S=Tr(s.url);if(S&&C.protocols.indexOf(S)===-1){n(new w("Unsupported protocol "+S+":",w.ERR_BAD_REQUEST,e));return}h.send(o||null)})},Dr=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,s;const o=function(u){if(!s){s=!0,c();const l=u instanceof Error?u:this.reason;n.abort(l instanceof w?l:new G(l instanceof Error?l.message:l))}};let i=t&&setTimeout(()=>{i=null,o(new w(`timeout of ${t}ms exceeded`,w.ETIMEDOUT))},t);const c=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(o):u.removeEventListener("abort",o)}),e=null)};e.forEach(u=>u.addEventListener("abort",o));const{signal:f}=n;return f.unsubscribe=()=>a.asap(c),f}},Fr=function*(e,t){let r=e.byteLength;if(r<t){yield e;return}let n=0,s;for(;n<r;)s=n+t,yield e.slice(n,s),n=s},Lr=async function*(e,t){for await(const r of vr(e))yield*Fr(r,t)},vr=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:r,value:n}=await t.read();if(r)break;yield n}}finally{await t.cancel()}},Ge=(e,t,r,n)=>{const s=Lr(e,t);let o=0,i,c=f=>{i||(i=!0,n&&n(f))};return new ReadableStream({async pull(f){try{const{done:u,value:l}=await s.next();if(u){c(),f.close();return}let m=l.byteLength;if(r){let y=o+=m;r(y)}f.enqueue(new Uint8Array(l))}catch(u){throw c(u),u}},cancel(f){return c(f),s.return()}},{highWaterMark:2})},Ye=64*1024,{isFunction:oe}=a,Br=(({Request:e,Response:t})=>({Request:e,Response:t}))(a.global),{ReadableStream:Qe,TextEncoder:Ze}=a.global,et=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Ir=e=>{e=a.merge.call({skipUndefined:!0},Br,e);const{fetch:t,Request:r,Response:n}=e,s=t?oe(t):typeof fetch=="function",o=oe(r),i=oe(n);if(!s)return!1;const c=s&&oe(Qe),f=s&&(typeof Ze=="function"?(d=>g=>d.encode(g))(new Ze):async d=>new Uint8Array(await new r(d).arrayBuffer())),u=o&&c&&et(()=>{let d=!1;const g=new r(C.origin,{body:new Qe,method:"POST",get duplex(){return d=!0,"half"}}).headers.has("Content-Type");return d&&!g}),l=i&&c&&et(()=>a.isReadableStream(new n("").body)),m={stream:l&&(d=>d.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(d=>{!m[d]&&(m[d]=(g,h)=>{let E=g&&g[d];if(E)return E.call(g);throw new w(`Response type '${d}' is not supported`,w.ERR_NOT_SUPPORT,h)})});const y=async d=>{if(d==null)return 0;if(a.isBlob(d))return d.size;if(a.isSpecCompliantForm(d))return(await new r(C.origin,{method:"POST",body:d}).arrayBuffer()).byteLength;if(a.isArrayBufferView(d)||a.isArrayBuffer(d))return d.byteLength;if(a.isURLSearchParams(d)&&(d=d+""),a.isString(d))return(await f(d)).byteLength},T=async(d,g)=>{const h=a.toFiniteNumber(d.getContentLength());return h??y(g)};return async d=>{let{url:g,method:h,data:E,signal:S,cancelToken:x,timeout:b,onDownloadProgress:A,onUploadProgress:L,responseType:k,headers:Se,withCredentials:ce="same-origin",fetchOptions:mt}=Xe(d),ht=t||fetch;k=k?(k+"").toLowerCase():"text";let le=Dr([S,x&&x.toAbortSignal()],b),Y=null;const M=le&&le.unsubscribe&&(()=>{le.unsubscribe()});let gt;try{if(L&&u&&h!=="get"&&h!=="head"&&(gt=await T(Se,E))!==0){let B=new r(g,{method:"POST",body:E,duplex:"half"}),z;if(a.isFormData(E)&&(z=B.headers.get("content-type"))&&Se.setContentType(z),B.body){const[Oe,ue]=Je(gt,se(Ke(L)));E=Ge(B.body,Ye,Oe,ue)}}a.isString(ce)||(ce=ce?"include":"omit");const F=o&&"credentials"in r.prototype,wt={...mt,signal:le,method:h.toUpperCase(),headers:Se.normalize().toJSON(),body:E,duplex:"half",credentials:F?ce:void 0};Y=o&&new r(g,wt);let v=await(o?ht(Y,mt):ht(g,wt));const bt=l&&(k==="stream"||k==="response");if(l&&(A||bt&&M)){const B={};["status","statusText","headers"].forEach(yt=>{B[yt]=v[yt]});const z=a.toFiniteNumber(v.headers.get("content-length")),[Oe,ue]=A&&Je(z,se(Ke(A),!0))||[];v=new n(Ge(v.body,Ye,Oe,()=>{ue&&ue(),M&&M()}),B)}k=k||"text";let Yr=await m[a.findKey(m,k)||"text"](v,d);return!bt&&M&&M(),await new Promise((B,z)=>{ze(B,z,{data:Yr,headers:N.from(v.headers),status:v.status,statusText:v.statusText,config:d,request:Y})})}catch(F){throw M&&M(),F&&F.name==="TypeError"&&/Load failed|fetch/i.test(F.message)?Object.assign(new w("Network Error",w.ERR_NETWORK,d,Y),{cause:F.cause||F}):w.from(F,F&&F.code,d,Y)}}},jr=new Map,tt=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:s}=t,o=[n,s,r];let i=o.length,c=i,f,u,l=jr;for(;c--;)f=o[c],u=l.get(f),u===void 0&&l.set(f,u=c?new Map:Ir(t)),l=u;return u};tt();const ye={http:ar,xhr:Ur,fetch:{get:tt}};a.forEach(ye,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const rt=e=>`- ${e}`,$r=e=>a.isFunction(e)||e===null||e===!1;function Mr(e,t){e=a.isArray(e)?e:[e];const{length:r}=e;let n,s;const o={};for(let i=0;i<r;i++){n=e[i];let c;if(s=n,!$r(n)&&(s=ye[(c=String(n)).toLowerCase()],s===void 0))throw new w(`Unknown adapter '${c}'`);if(s&&(a.isFunction(s)||(s=s.get(t))))break;o[c||"#"+i]=s}if(!s){const i=Object.entries(o).map(([f,u])=>`adapter ${f} `+(u===!1?"is not supported by the environment":"is not available in the build"));let c=r?i.length>1?`since :
4
+ `+i.map(rt).join(`
5
+ `):" "+rt(i[0]):"as no adapter specified";throw new w("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return s}const nt={getAdapter:Mr,adapters:ye};function xe(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new G(null,e)}function st(e){return xe(e),e.headers=N.from(e.headers),e.data=be.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),nt.getAdapter(e.adapter||W.adapter,e)(e).then(function(n){return xe(e),n.data=be.call(e,e.transformResponse,n),n.headers=N.from(n.headers),n},function(n){return qe(n)||(xe(e),n&&n.response&&(n.response.data=be.call(e,e.transformResponse,n.response),n.response.headers=N.from(n.response.headers))),Promise.reject(n)})}const ot="1.13.4",ie={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ie[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const it={};ie.transitional=function(t,r,n){function s(o,i){return"[Axios v"+ot+"] Transitional option '"+o+"'"+i+(n?". "+n:"")}return(o,i,c)=>{if(t===!1)throw new w(s(i," has been removed"+(r?" in "+r:"")),w.ERR_DEPRECATED);return r&&!it[i]&&(it[i]=!0,console.warn(s(i," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(o,i,c):!0}},ie.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function Hr(e,t,r){if(typeof e!="object")throw new w("options must be an object",w.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 c=e[o],f=c===void 0||i(c,o,e);if(f!==!0)throw new w("option "+o+" must be "+f,w.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new w("Unknown option "+o,w.ERR_BAD_OPTION)}}const ae={assertOptions:Hr,validators:ie},D=ae.validators;let $=class{constructor(t){this.defaults=t||{},this.interceptors={request:new je,response:new je}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const o=s.stack?s.stack.replace(/^.+\n/,""):"";try{n.stack?o&&!String(n.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(n.stack+=`
6
+ `+o):n.stack=o}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=j(this.defaults,r);const{transitional:n,paramsSerializer:s,headers:o}=r;n!==void 0&&ae.assertOptions(n,{silentJSONParsing:D.transitional(D.boolean),forcedJSONParsing:D.transitional(D.boolean),clarifyTimeoutError:D.transitional(D.boolean)},!1),s!=null&&(a.isFunction(s)?r.paramsSerializer={serialize:s}:ae.assertOptions(s,{encode:D.function,serialize:D.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),ae.assertOptions(r,{baseUrl:D.spelling("baseURL"),withXsrfToken:D.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let i=o&&a.merge(o.common,o[r.method]);o&&a.forEach(["delete","get","head","post","put","patch","common"],d=>{delete o[d]}),r.headers=N.concat(i,o);const c=[];let f=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(r)===!1||(f=f&&g.synchronous,c.unshift(g.fulfilled,g.rejected))});const u=[];this.interceptors.response.forEach(function(g){u.push(g.fulfilled,g.rejected)});let l,m=0,y;if(!f){const d=[st.bind(this),void 0];for(d.unshift(...c),d.push(...u),y=d.length,l=Promise.resolve(r);m<y;)l=l.then(d[m++],d[m++]);return l}y=c.length;let T=r;for(;m<y;){const d=c[m++],g=c[m++];try{T=d(T)}catch(h){g.call(this,h);break}}try{l=st.call(this,T)}catch(d){return Promise.reject(d)}for(m=0,y=u.length;m<y;)l=l.then(u[m++],u[m++]);return l}getUri(t){t=j(this.defaults,t);const r=Ve(t.baseURL,t.url,t.allowAbsoluteUrls);return Ie(r,t.params,t.paramsSerializer)}};a.forEach(["delete","get","head","options"],function(t){$.prototype[t]=function(r,n){return this.request(j(n||{},{method:t,url:r,data:(n||{}).data}))}}),a.forEach(["post","put","patch"],function(t){function r(n){return function(o,i,c){return this.request(j(c||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}$.prototype[t]=r(),$.prototype[t+"Form"]=r(!0)});let qr=class _t{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(o){r=o});const n=this;this.promise.then(s=>{if(!n._listeners)return;let o=n._listeners.length;for(;o-- >0;)n._listeners[o](s);n._listeners=null}),this.promise.then=s=>{let o;const i=new Promise(c=>{n.subscribe(c),o=c}).then(s);return i.cancel=function(){n.unsubscribe(o)},i},t(function(o,i,c){n.reason||(n.reason=new G(o,i,c),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new _t(function(s){t=s}),cancel:t}}};function zr(e){return function(r){return e.apply(null,r)}}function Jr(e){return a.isObject(e)&&e.isAxiosError===!0}const Ee={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(Ee).forEach(([e,t])=>{Ee[t]=e});function at(e){const t=new $(e),r=Te($.prototype.request,t);return a.extend(r,$.prototype,t,{allOwnKeys:!0}),a.extend(r,t,null,{allOwnKeys:!0}),r.create=function(s){return at(j(e,s))},r}const _=at(W);_.Axios=$,_.CanceledError=G,_.CancelToken=qr,_.isCancel=qe,_.VERSION=ot,_.toFormData=re,_.AxiosError=w,_.Cancel=_.CanceledError,_.all=function(t){return Promise.all(t)},_.spread=zr,_.isAxiosError=Jr,_.mergeConfig=j,_.AxiosHeaders=N,_.formToJSON=e=>Me(a.isHTMLForm(e)?new FormData(e):e),_.getAdapter=nt.getAdapter,_.HttpStatusCode=Ee,_.default=_;const{Axios:an,AxiosError:cn,CanceledError:ln,isCancel:un,CancelToken:dn,VERSION:fn,all:pn,Cancel:mn,isAxiosError:hn,spread:gn,toFormData:wn,AxiosHeaders:bn,HttpStatusCode:yn,formToJSON:xn,getAdapter:En,mergeConfig:_n}=_,Kr="https://customers-services.tarxemo.com/api";class ct{constructor(t,r=Kr){xt(this,"client");this.client=_.create({baseURL:r,headers:{"Content-Type":"application/json","X-API-Key":t},timeout:3e4}),this.client.interceptors.response.use(n=>n,n=>{var s,o;if((s=n.response)!=null&&s.data){const c=((o=n.response.data.response)==null?void 0:o.message)||"An unknown error occurred";throw new Error(c)}else throw n.request?new Error("No response from server. Please check your connection."):new Error(n.message||"Request failed")})}async sendMessage(t,r){try{const n=await this.client.post("/chat/",{question:t,session_id:r});if(n.data.response.status!=="success")throw new Error(n.data.response.message);return n.data.data}catch(n){throw n instanceof Error?n:new Error("Failed to send message")}}async getConversationHistory(t){try{const r=await this.client.get(`/chat/history/${t}/`);if(r.data.response.status!=="success")throw new Error(r.data.response.message);return r.data.data}catch(r){throw r instanceof Error?r:new Error("Failed to load conversation history")}}updateApiKey(t){this.client.defaults.headers.common["X-API-Key"]=t}updateBaseUrl(t){this.client.defaults.baseURL=t}}function _e(e,t){const[r,n]=p.useState(()=>{try{const s=window.localStorage.getItem(e);return s?JSON.parse(s):t}catch(s){return console.warn(`Error reading localStorage key "${e}":`,s),t}});return p.useEffect(()=>{try{window.localStorage.setItem(e,JSON.stringify(r))}catch(s){console.warn(`Error setting localStorage key "${e}":`,s)}},[e,r]),[r,n]}function lt(){return`session_${Date.now()}_${Math.random().toString(36).substring(2,9)}`}const Vr="customer_support_session_id",Wr="customer_support_messages";function ut(e){const{apiKey:t,baseUrl:r,onError:n}=e,[s,o]=_e(Wr,[]),[i,c]=_e(Vr,lt()),[f,u]=p.useState(!1),[l,m]=p.useState(null),y=p.useRef(null);p.useEffect(()=>{y.current=new ct(t,r)},[t,r]);const T=p.useCallback(()=>{m(null)},[]),d=p.useCallback(async E=>{if(!y.current){const x=new Error("API client not initialized");m(x),n==null||n(x);return}if(!E.trim())return;const S={id:`user_${Date.now()}`,role:"USER",content:E,timestamp:new Date};o(x=>[...x,S]),u(!0),m(null);try{const x=await y.current.sendMessage(E,i),b={id:`assistant_${Date.now()}`,role:"ASSISTANT",content:x.answer,timestamp:new Date,sources:x.sources};o(A=>[...A,b]),x.session_id!==i&&c(x.session_id)}catch(x){const b=x instanceof Error?x:new Error("Failed to send message");m(b),n==null||n(b);const A={id:`error_${Date.now()}`,role:"ASSISTANT",content:`Sorry, I encountered an error: ${b.message}`,timestamp:new Date};o(L=>[...L,A])}finally{u(!1)}},[i,n,o,c]),g=p.useCallback(async()=>{if(!(!y.current||!i)){u(!0),m(null);try{const S=(await y.current.getConversationHistory(i)).messages.map((x,b)=>({id:`${x.role.toLowerCase()}_${b}_${Date.now()}`,role:x.role.toUpperCase(),content:x.content,timestamp:new Date(x.created_at)}));o(S)}catch(E){const S=E instanceof Error?E:new Error("Failed to load history");m(S),n==null||n(S)}finally{u(!1)}}},[i,n,o]),h=p.useCallback(()=>{o([]),c(lt())},[o,c]);return{messages:s,sendMessage:d,isLoading:f,error:l,clearError:T,sessionId:i,loadHistory:g,clearHistory:h}}const dt=({message:e})=>{const t=e.role.toUpperCase()==="USER",r=e.timestamp instanceof Date?e.timestamp:new Date(e.timestamp);return p.createElement("div",{className:`cs-message ${t?"cs-message--user":"cs-message--assistant"}`},p.createElement("div",{className:"cs-message__content"},p.createElement("p",{className:"cs-message__text"},e.content),e.sources&&e.sources.length>0&&p.createElement("div",{className:"cs-message__sources"},p.createElement("p",{className:"cs-message__sources-title"},"Sources:"),p.createElement("ul",{className:"cs-message__sources-list"},e.sources.map((n,s)=>p.createElement("li",{key:s,className:"cs-message__source-item"},p.createElement("a",{href:n.url,target:"_blank",rel:"noopener noreferrer",className:"cs-message__source-link"},p.createElement(U.ExternalLink,{size:12}),p.createElement("span",null,n.title)),p.createElement("span",{className:"cs-message__source-similarity"},Math.round(n.similarity*100),"% match")))))),p.createElement("time",{className:"cs-message__time",dateTime:r.toISOString()},r.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})))},ft=({onSendMessage:e,isLoading:t,placeholder:r="Type your message..."})=>{const[n,s]=p.useState(""),o=c=>{c.preventDefault(),n.trim()&&!t&&(e(n),s(""))},i=c=>{c.key==="Enter"&&!c.shiftKey&&(c.preventDefault(),o(c))};return p.createElement("form",{className:"cs-input",onSubmit:o},p.createElement("textarea",{className:"cs-input__textarea",value:n,onChange:c=>s(c.target.value),onKeyDown:i,placeholder:r,disabled:t,rows:1,"aria-label":"Message input"}),p.createElement("button",{type:"submit",className:"cs-input__button",disabled:!n.trim()||t,"aria-label":"Send message"},p.createElement(U.Send,{size:20})))},pt=({messages:e,onSendMessage:t,onClose:r,isLoading:n,error:s,placeholder:o,welcomeMessage:i="Hi! How can I help you today?"})=>{const c=p.useRef(null);return p.useEffect(()=>{var f;(f=c.current)==null||f.scrollIntoView({behavior:"smooth"})},[e]),p.createElement("div",{className:"cs-window"},p.createElement("div",{className:"cs-window__header"},p.createElement("div",{className:"cs-window__header-info"},p.createElement("h3",{className:"cs-window__title"},"Customer Support"),p.createElement("div",{className:"cs-window__status"},p.createElement("span",{className:"cs-window__status-dot"}),p.createElement("span",null,"Online"))),p.createElement("button",{className:"cs-window__close",onClick:r,"aria-label":"Close chat"},p.createElement(U.X,{size:20}))),p.createElement("div",{className:"cs-window__messages"},e.length===0&&!n&&p.createElement("div",{className:"cs-window__welcome"},p.createElement("p",null,i)),e.map(f=>p.createElement(dt,{key:f.id,message:f})),n&&p.createElement("div",{className:"cs-window__typing"},p.createElement(U.Loader2,{size:20,className:"cs-window__typing-icon"}),p.createElement("span",null,"Thinking...")),s&&p.createElement("div",{className:"cs-window__error"},p.createElement("p",null,s.message)),p.createElement("div",{ref:c})),p.createElement("div",{className:"cs-window__input-wrapper"},p.createElement(ft,{onSendMessage:t,isLoading:n,placeholder:o})))},Xr=':root{--cs-primary-color: inherit;--cs-secondary-color: inherit;--cs-bg-color: inherit;--cs-text-color: inherit;--cs-font-family: inherit;--cs-border-radius: 12px;--cs-button-color: var(--cs-primary-color);--cs-user-message-color: var(--cs-primary-color);--cs-assistant-message-color: rgba(0, 0, 0, .05);--cs-header-gradient: linear-gradient(135deg, var(--cs-primary-color), var(--cs-secondary-color));--cs-focus-ring: rgba(0, 0, 0, .1);--cs-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, .05);--cs-shadow: 0 4px 6px -1px rgba(0, 0, 0, .1), 0 2px 4px -1px rgba(0, 0, 0, .06);--cs-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -2px rgba(0, 0, 0, .05);--cs-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, .1), 0 10px 10px -5px rgba(0, 0, 0, .04)}.cs-widget{position:fixed;z-index:9999;font-family:var(--cs-font-family)}.cs-widget,.cs-widget *{box-sizing:border-box}.cs-widget--bottom-right{bottom:20px;right:20px}.cs-widget--bottom-left{bottom:20px;left:20px}.cs-widget--top-right{top:20px;right:20px}.cs-widget--top-left{top:20px;left:20px}.cs-widget__toggle{position:relative;width:60px;height:60px;border-radius:50%;background:var(--cs-header-gradient);border:none;color:#fff;cursor:pointer;box-shadow:var(--cs-shadow-xl);transition:all .3s cubic-bezier(.4,0,.2,1);display:flex;align-items:center;justify-content:center}.cs-widget__toggle:hover{transform:scale(1.1);box-shadow:0 15px 25px -5px var(--cs-focus-ring)}.cs-widget__toggle:active{transform:scale(.95)}.cs-widget__toggle--open{background:#ef4444}.cs-widget__badge{position:absolute;top:-5px;right:-5px;background:#ef4444;color:#fff;border-radius:50%;width:24px;height:24px;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:600;box-shadow:var(--cs-shadow)}.cs-window{position:absolute;bottom:85px;right:0;width:380px;max-width:calc(100vw - 40px);height:600px;max-height:calc(100vh - 130px);background:var(--cs-bg-color);border-radius:var(--cs-border-radius);border:1px solid rgba(0,0,0,.1);box-shadow:var(--cs-shadow-xl);display:flex;flex-direction:column;overflow:visible;animation:slideUp .3s cubic-bezier(.4,0,.2,1);transform-origin:bottom right}.cs-window:after{content:"";position:absolute;bottom:-10px;right:25px;width:0;height:0;border-left:10px solid transparent;border-right:10px solid transparent;border-top:10px solid var(--cs-bg-color);filter:drop-shadow(0 5px 5px rgba(0,0,0,.1))}.cs-widget--bottom-left .cs-window{transform-origin:bottom left;right:auto;left:0}.cs-widget--bottom-left .cs-window:after{right:auto;left:25px}.cs-widget--top-right .cs-window{transform-origin:top right;bottom:auto;top:85px}.cs-widget--top-right .cs-window:after{bottom:auto;top:-10px;border-top:none;border-bottom:10px solid var(--cs-bg-color)}.cs-widget--top-left .cs-window{transform-origin:top left;bottom:auto;top:85px;right:auto;left:0}.cs-widget--top-left .cs-window:after{bottom:auto;top:-10px;border-top:none;border-bottom:10px solid var(--cs-bg-color);right:auto;left:25px}@keyframes slideUp{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}.cs-window__header{background:var(--cs-header-gradient);color:#fff;padding:16px 20px;display:flex;align-items:center;justify-content:space-between;flex-shrink:0}.cs-window__header-info{display:flex;flex-direction:column;gap:2px}.cs-window__title{margin:0;font-size:16px;font-weight:600}.cs-window__status{display:flex;align-items:center;gap:6px;font-size:12px;opacity:.9}.cs-window__status-dot{width:8px;height:8px;background:#4ade80;border-radius:50%;box-shadow:0 0 0 2px #fff3}.cs-window__close{background:#fff3;border:none;color:#fff;width:32px;height:32px;border-radius:50%;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background .2s}.cs-window__close:hover{background:#ffffff4d}.cs-window__messages{flex:1;overflow-y:auto;padding:20px;display:flex;flex-direction:column;gap:16px;background:var(--cs-bg-color)}.cs-window__messages::-webkit-scrollbar{width:6px}.cs-window__messages::-webkit-scrollbar-track{background:transparent}.cs-window__messages::-webkit-scrollbar-thumb{background:#d1d5db;border-radius:3px}.cs-window__messages::-webkit-scrollbar-thumb:hover{background:#9ca3af}.cs-window__welcome{text-align:center;padding:40px 20px;color:#6b7280}.cs-window__welcome p{margin:0;font-size:16px}.cs-window__typing{display:flex;align-items:center;gap:8px;padding:12px 16px;background:var(--cs-assistant-message-color);border-radius:var(--cs-border-radius);width:fit-content;color:var(--cs-text-color)}.cs-window__typing-icon{animation:spin 1s linear infinite}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.cs-window__error{background:#fee2e2;border:1px solid #ef4444;color:#991b1b;padding:12px 16px;border-radius:var(--cs-border-radius)}.cs-window__error p{margin:0}.cs-message{display:flex;flex-direction:column;gap:6px;max-width:85%;animation:fadeIn .3s ease-in-out}@keyframes fadeIn{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}.cs-message--user{align-self:flex-end;align-items:flex-end}.cs-message--assistant{align-self:flex-start;align-items:flex-start}.cs-message__content{background:var(--cs-assistant-message-color);padding:12px 16px;border-radius:var(--cs-border-radius);border-bottom-left-radius:4px;color:var(--cs-text-color);word-wrap:break-word;box-shadow:var(--cs-shadow-sm)}.cs-message--user .cs-message__content{background:var(--cs-user-message-color);color:#fff;border-radius:var(--cs-border-radius);border-bottom-right-radius:4px}.cs-message__text{margin:0;line-height:1.5;white-space:pre-wrap}.cs-message__time{font-size:11px;color:#9ca3af;padding:0 4px}.cs-message__sources{margin-top:12px;padding-top:12px;border-top:1px solid #e5e7eb}.cs-message__sources-title{margin:0 0 8px;font-size:12px;font-weight:600;color:#6b7280}.cs-message__sources-list{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:6px}.cs-message__source-item{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:12px}.cs-message__source-link{display:flex;align-items:center;gap:4px;color:var(--cs-primary-color);text-decoration:none;flex:1;min-width:0}.cs-message__source-link:hover{text-decoration:underline}.cs-message__source-link span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cs-message__source-similarity{color:#6b7280;font-size:11px;white-space:nowrap}.cs-window__input-wrapper{padding:16px;background:var(--cs-bg-color);border-top:1px solid #e5e7eb;flex-shrink:0}.cs-input{display:flex;gap:8px;align-items:flex-end}.cs-input__textarea{flex:1;padding:12px 16px;border:1px solid #d1d5db;border-radius:var(--cs-border-radius);font-family:var(--cs-font-family);font-size:14px;resize:none;max-height:120px;min-height:44px;transition:border-color .2s}.cs-input__textarea:focus{outline:none;border-color:var(--cs-primary-color);box-shadow:0 0 0 3px var(--cs-focus-ring);background-color:var(--cs-bg-color)}.cs-input__textarea:disabled{background:#f3f4f6;cursor:not-allowed}.cs-input__button{background:var(--cs-button-color);color:#fff;border:none;width:44px;height:44px;border-radius:var(--cs-border-radius);cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .2s;flex-shrink:0}.cs-input__button:hover:not(:disabled){background:var(--cs-secondary-color);transform:scale(1.05)}.cs-input__button:active:not(:disabled){transform:scale(.95)}.cs-input__button:disabled{background:#d1d5db;cursor:not-allowed}@media(max-width:480px){.cs-widget--open{position:fixed!important;inset:auto!important;bottom:20px!important;right:20px!important;width:auto!important;height:auto!important;z-index:10000!important}.cs-window{position:fixed!important;width:88vw!important;height:60vh!important;max-width:400px!important;max-height:500px!important;bottom:90px!important;right:5%!important;left:5%!important;top:auto!important;border-radius:var(--cs-border-radius)!important;box-shadow:var(--cs-shadow-xl)!important;display:flex!important;flex-direction:column!important;animation:slideUp .3s ease-out!important;overflow:visible!important}.cs-widget--open .cs-widget__toggle{display:flex!important;opacity:.8}.cs-window__messages{padding:16px}.cs-window__header{padding:12px 16px}.cs-window__input-wrapper{padding:12px}.cs-widget__toggle{width:50px;height:50px}}',Gr=({apiKey:e,baseUrl:t,theme:r,position:n="bottom-right",welcomeMessage:s,placeholder:o,className:i="",onError:c,onMessageSent:f,onMessageReceived:u})=>{const[l,m]=p.useState(!1),{messages:y,sendMessage:T,isLoading:d,error:g,clearError:h}=ut({apiKey:e,baseUrl:t,onError:c}),E=p.useMemo(()=>{const b={};return b["--cs-primary-color"]=(r==null?void 0:r.primaryColor)||"#6366f1",b["--cs-secondary-color"]=(r==null?void 0:r.secondaryColor)||(r==null?void 0:r.primaryColor)||"#8b5cf6",b["--cs-bg-color"]=(r==null?void 0:r.backgroundColor)||"#ffffff",b["--cs-text-color"]=(r==null?void 0:r.textColor)||"#1f2937",b["--cs-font-family"]=(r==null?void 0:r.fontFamily)||"inherit",b["--cs-border-radius"]=(r==null?void 0:r.borderRadius)||"12px",b["--cs-button-color"]=(r==null?void 0:r.buttonColor)||(r==null?void 0:r.primaryColor)||"#6366f1",b["--cs-user-message-color"]=(r==null?void 0:r.userMessageColor)||(r==null?void 0:r.primaryColor)||"#6366f1",b["--cs-assistant-message-color"]=(r==null?void 0:r.assistantMessageColor)||"rgba(0, 0, 0, 0.05)",r!=null&&r.primaryColor&&(b["--cs-focus-ring"]=`${r.primaryColor}33`),b},[r]),S=async b=>{if(f==null||f(b),await T(b),!g){const A=y[y.length-1];(A==null?void 0:A.role)==="ASSISTANT"&&(u==null||u(A.content))}},x=()=>{m(!l),g&&h()};return p.createElement("div",{className:`cs-widget cs-widget--${n} ${l?"cs-widget--open":""} ${i}`,style:E},p.createElement("style",{dangerouslySetInnerHTML:{__html:Xr}}),l&&p.createElement(pt,{messages:y,onSendMessage:S,onClose:()=>m(!1),isLoading:d,error:g,placeholder:o,welcomeMessage:s}),p.createElement("button",{className:`cs-widget__toggle ${l?"cs-widget__toggle--open":""}`,onClick:x,"aria-label":l?"Close chat":"Open chat","aria-expanded":l},p.createElement(U.MessageCircle,{size:24}),!l&&y.length>0&&p.createElement("span",{className:"cs-widget__badge"},y.filter(b=>b.role.toUpperCase()==="ASSISTANT").length)))};O.ChatInput=ft,O.ChatMessage=dt,O.ChatWindow=pt,O.CustomerSupportAPIClient=ct,O.CustomerSupportWidget=Gr,O.useCustomerSupport=ut,O.useLocalStorage=_e,Object.defineProperty(O,Symbol.toStringTag,{value:"Module"})}));
7
7
  //# sourceMappingURL=index.umd.js.map