@chatwillow/widget 0.0.3 → 0.0.4
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/chatwillow-widget.es.js +3936 -3180
- package/dist/chatwillow-widget.umd.js +23 -7
- package/dist/widget.css +1 -2
- package/package.json +24 -26
|
@@ -1,11 +1,27 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`react`)):typeof define==`function`&&define.amd?define([`exports`,`react`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.ChatWillow={},e.React))})(this,function(e,t){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var n=Object.create,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,c=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),l=(e,t)=>{let n={};for(var i in e)r(n,i,{get:e[i],enumerable:!0});return t||r(n,Symbol.toStringTag,{value:`Module`}),n},u=(e,t,n,o)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=a(t),l=0,u=c.length,d;l<u;l++)d=c[l],!s.call(e,d)&&d!==n&&r(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(o=i(t,d))||o.enumerable});return e};t=((e,t,i)=>(i=e==null?{}:n(o(e)),u(t||!e||!e.__esModule?r(i,`default`,{value:e,enumerable:!0}):i,e)))(t);var d=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},f={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},p=new class{#e=f;#t=!1;setTimeoutProvider(e){process.env.NODE_ENV!==`production`&&this.#t&&e!==this.#e&&console.error(`[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.`,{previous:this.#e,provider:e}),this.#e=e,process.env.NODE_ENV!==`production`&&(this.#t=!1)}setTimeout(e,t){return process.env.NODE_ENV!==`production`&&(this.#t=!0),this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return process.env.NODE_ENV!==`production`&&(this.#t=!0),this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function m(e){setTimeout(e,0)}var h=typeof window>`u`||`Deno`in globalThis;function g(){}function _(e,t){return typeof e==`function`?e(t):e}function v(e){return typeof e==`number`&&e>=0&&e!==1/0}function y(e,t){return Math.max(e+(t||0)-Date.now(),0)}function b(e,t){return typeof e==`function`?e(t):e}function ee(e,t){return typeof e==`function`?e(t):e}function x(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==C(o,t.options))return!1}else if(!T(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function S(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(w(t.options.mutationKey)!==w(a))return!1}else if(!T(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function C(e,t){return(t?.queryKeyHashFn||w)(e)}function w(e){return JSON.stringify(e,(e,t)=>ae(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function T(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>T(e[n],t[n])):!1}var te=Object.prototype.hasOwnProperty;function ne(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=ie(e)&&ie(t);if(!r&&!(ae(e)&&ae(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:te.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=ne(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function re(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function ie(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ae(e){if(!E(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!E(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function E(e){return Object.prototype.toString.call(e)===`[object Object]`}function oe(e){return new Promise(t=>{p.setTimeout(t,e)})}function se(e,t,n){if(typeof n.structuralSharing==`function`)return n.structuralSharing(e,t);if(n.structuralSharing!==!1){if(process.env.NODE_ENV!==`production`)try{return ne(e,t)}catch(e){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${n.queryHash}]: ${e}`),e}return ne(e,t)}return t}function ce(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function le(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var D=Symbol();function ue(e,t){return process.env.NODE_ENV!==`production`&&e.queryFn===D&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===D?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function de(e,t){return typeof e==`function`?e(...t):!!e}function fe(e,t,n){let r=!1,i;return Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var pe=new class extends d{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!h&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}};function me(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var he=m;function ge(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=he,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var O=ge(),k=new class extends d{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!h&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function _e(e){return Math.min(1e3*2**e,3e4)}function ve(e){return(e??`online`)===`online`?k.isOnline():!0}var ye=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function be(e){let t=!1,n=0,r,i=me(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new ye(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>pe.isFocused()&&(e.networkMode===`always`||k.isOnline())&&e.canRun(),u=()=>ve(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(d).catch(r=>{if(a())return;let i=e.retry??(h?0:3),o=e.retryDelay??_e,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){f(r);return}n++,e.onFail?.(n,r),oe(s).then(()=>l()?void 0:p()).then(()=>{t?f(r):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var xe=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),v(this.gcTime)&&(this.#e=p.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(h?1/0:300*1e3))}clearGcTimeout(){this.#e&&=(p.clearTimeout(this.#e),void 0)}},Se=class extends xe{#e;#t;#n;#r;#i;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#n=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=Te(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#i?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=Te(this.options);e.data!==void 0&&(this.setState(we(e.data,e.dataUpdatedAt)),this.#e=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#n.remove(this)}setData(e,t){let n=se(this.state.data,e,this.options);return this.#s({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#s({type:`setState`,state:e,setStateOptions:t})}cancel(e){let t=this.#i?.promise;return this.#i?.cancel(e),t?t.then(g).catch(g):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>ee(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===D||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>b(e.options.staleTime,this)===`static`):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!y(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#i&&(this.#o?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#n.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#i?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}process.env.NODE_ENV!==`production`&&(Array.isArray(this.options.queryKey)||console.error(`As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']`));let n=new AbortController,r=e=>{Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},i=()=>{let e=ue(this.options,t),n=(()=>{let e={client:this.#r,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#o=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:i};return r(e),e})();this.options.behavior?.onFetch(a,this),this.#t=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#s({type:`fetch`,meta:a.fetchOptions?.meta}),this.#i=be({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof ye&&e.revert&&this.setState({...this.#t,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#s({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#s({type:`pause`})},onContinue:()=>{this.#s({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#i.start();if(e===void 0)throw process.env.NODE_ENV!==`production`&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#n.config.onSuccess?.(e,this),this.#n.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof ye){if(e.silent)return this.#i.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#s({type:`error`,error:e}),this.#n.config.onError?.(e,this),this.#n.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#s(e){this.state=(t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...Ce(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...we(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}})(this.state),O.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#n.notify({query:this,type:`updated`,action:e})})}};function Ce(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ve(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function we(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Te(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}function Ee(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{fe(e,()=>t.signal,()=>n=!0)},u=ue(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject();if(r==null&&e.pages.length)return Promise.resolve(e);let a=await u((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})()),{maxPages:o}=t.options,s=i?le:ce;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?Oe:De,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:De(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function De(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Oe(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var ke=class extends xe{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Ae(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=be({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){this.state=(t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}})(this.state),O.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Ae(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var je=class extends d{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new ke({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=A(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=A(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=A(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=A(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){O.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>S(t,e))}findAll(e={}){return this.getAll().filter(t=>S(e,t))}notify(e){O.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return O.batch(()=>Promise.all(e.map(e=>e.continue().catch(g))))}};function A(e){return e.options.scope?.id}var Me=class extends d{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),re(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&w(t.mutationKey)!==w(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??Ae();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){O.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},Ne=class extends d{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??C(r,t),a=this.get(i);return a||(a=new Se({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){O.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>x(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>x(e,t)):t}notify(e){O.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){O.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){O.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Pe=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Ne,this.#t=e.mutationCache||new je,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=pe.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=k.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(b(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=_(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return O.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;O.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return O.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=O.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(g).catch(g)}invalidateQueries(e,t={}){return O.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=O.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(g)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(g)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(b(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(g).catch(g)}fetchInfiniteQuery(e){return e.behavior=Ee(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(g).catch(g)}ensureInfiniteQueryData(e){return e.behavior=Ee(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return k.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(w(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{T(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(w(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{T(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=C(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===D&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Fe=c((e=>{var t=Symbol.for(`react.transitional.element`);function n(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.jsx=n,e.jsxs=n})),Ie=c((e=>{process.env.NODE_ENV!==`production`&&(function(){function t(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ne?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case _:return`Fragment`;case y:return`Profiler`;case v:return`StrictMode`;case S:return`Suspense`;case C:return`SuspenseList`;case te:return`Activity`}if(typeof e==`object`)switch(typeof e.tag==`number`&&console.error(`Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.`),e.$$typeof){case g:return`Portal`;case ee:return e.displayName||`Context`;case b:return(e._context.displayName||`Context`)+`.Consumer`;case x:var n=e.render;return e=e.displayName,e||=(e=n.displayName||n.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case w:return n=e.displayName||null,n===null?t(e.type)||`Memo`:n;case T:n=e._payload,e=e._init;try{return t(e(n))}catch{}}return null}function n(e){return``+e}function r(e){try{n(e);var t=!1}catch{t=!0}if(t){t=console;var r=t.error,i=typeof Symbol==`function`&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||`Object`;return r.call(t,`The provided key is an unsupported type %s. This value must be coerced to a string before using it here.`,i),n(e)}}function i(e){if(e===_)return`<>`;if(typeof e==`object`&&e&&e.$$typeof===T)return`<...>`;try{var n=t(e);return n?`<`+n+`>`:`<...>`}catch{return`<...>`}}function a(){var e=re.A;return e===null?null:e.getOwner()}function o(){return Error(`react-stack-top-frame`)}function s(e){if(ie.call(e,`key`)){var t=Object.getOwnPropertyDescriptor(e,`key`).get;if(t&&t.isReactWarning)return!1}return e.key!==void 0}function c(e,t){function n(){oe||(oe=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",t))}n.isReactWarning=!0,Object.defineProperty(e,`key`,{get:n,configurable:!0})}function l(){var e=t(this.type);return se[e]||(se[e]=!0,console.error(`Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.`)),e=this.props.ref,e===void 0?null:e}function u(e,t,n,r,i,a){var o=n.ref;return e={$$typeof:h,type:e,key:t,props:n,_owner:r},(o===void 0?null:o)===null?Object.defineProperty(e,`ref`,{enumerable:!1,value:null}):Object.defineProperty(e,`ref`,{enumerable:!1,get:l}),e._store={},Object.defineProperty(e._store,`validated`,{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,`_debugInfo`,{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,`_debugStack`,{configurable:!1,enumerable:!1,writable:!0,value:i}),Object.defineProperty(e,`_debugTask`,{configurable:!1,enumerable:!1,writable:!0,value:a}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function d(e,n,i,o,l,d){var p=n.children;if(p!==void 0)if(o)if(ae(p)){for(o=0;o<p.length;o++)f(p[o]);Object.freeze&&Object.freeze(p)}else console.error(`React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.`);else f(p);if(ie.call(n,`key`)){p=t(e);var m=Object.keys(n).filter(function(e){return e!==`key`});o=0<m.length?`{key: someKey, `+m.join(`: ..., `)+`: ...}`:`{key: someKey}`,D[p+o]||(m=0<m.length?`{`+m.join(`: ..., `)+`: ...}`:`{}`,console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
1
|
+
(function(A,P){typeof exports=="object"&&typeof module<"u"?P(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],P):(A=typeof globalThis<"u"?globalThis:A||self,P(A.ChatWillow={},A.React))})(this,(function(A,P){"use strict";var ji=Object.defineProperty;var dn=A=>{throw TypeError(A)};var Di=(A,P,q)=>P in A?ji(A,P,{enumerable:!0,configurable:!0,writable:!0,value:q}):A[P]=q;var hn=(A,P,q)=>Di(A,typeof P!="symbol"?P+"":P,q),Zt=(A,P,q)=>P.has(A)||dn("Cannot "+q);var u=(A,P,q)=>(Zt(A,P,"read from private field"),q?q.call(A):P.get(A)),T=(A,P,q)=>P.has(A)?dn("Cannot add the same private member more than once"):P instanceof WeakSet?P.add(A):P.set(A,q),E=(A,P,q,X)=>(Zt(A,P,"write to private field"),X?X.call(A,q):P.set(A,q),q),B=(A,P,q)=>(Zt(A,P,"access private method"),q);var Pt=(A,P,q,X)=>({set _(Le){E(A,P,Le,q)},get _(){return u(A,P,X)}});var oe,Ce,tn,_e,ye,He,rn,$e,be,Qe,nn,Ne,sn,Fe,Ke,te,je,$,ut,De,ne,me,on,ct,ae,W,ke,ue,ve,an,le,se,lt,un,fe,ge,Y,de,he,Ct,er,cn,ce,ln,U,we,Ee,Ve,ze,Re,We,Je,fn;function q(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:()=>t[r]})}}return e.default=t,Object.freeze(e)}const X=q(P);var Le={exports:{}},Xe={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var tr;function yn(){if(tr)return Xe;tr=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function r(n,s,i){var o=null;if(i!==void 0&&(o=""+i),s.key!==void 0&&(o=""+s.key),"key"in s){i={};for(var a in s)a!=="key"&&(i[a]=s[a])}else i=s;return s=i.ref,{$$typeof:t,type:n,key:o,ref:s!==void 0?s:null,props:i}}return Xe.Fragment=e,Xe.jsx=r,Xe.jsxs=r,Xe}var Ze={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.development.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var rr;function bn(){return rr||(rr=1,process.env.NODE_ENV!=="production"&&(function(){function t(f){if(f==null)return null;if(typeof f=="function")return f.$$typeof===Me?null:f.displayName||f.name||null;if(typeof f=="string")return f;switch(f){case m:return"Fragment";case C:return"Profiler";case v:return"StrictMode";case I:return"Suspense";case M:return"SuspenseList";case Ue:return"Activity"}if(typeof f=="object")switch(typeof f.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),f.$$typeof){case b:return"Portal";case g:return f.displayName||"Context";case x:return(f._context.displayName||"Context")+".Consumer";case _:var O=f.render;return f=f.displayName,f||(f=O.displayName||O.name||"",f=f!==""?"ForwardRef("+f+")":"ForwardRef"),f;case k:return O=f.displayName||null,O!==null?O:t(f.type)||"Memo";case j:O=f._payload,f=f._init;try{return t(f(O))}catch{}}return null}function e(f){return""+f}function r(f){try{e(f);var O=!1}catch{O=!0}if(O){O=console;var N=O.error,D=typeof Symbol=="function"&&Symbol.toStringTag&&f[Symbol.toStringTag]||f.constructor.name||"Object";return N.call(O,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",D),e(f)}}function n(f){if(f===m)return"<>";if(typeof f=="object"&&f!==null&&f.$$typeof===j)return"<...>";try{var O=t(f);return O?"<"+O+">":"<...>"}catch{return"<...>"}}function s(){var f=Se.A;return f===null?null:f.getOwner()}function i(){return Error("react-stack-top-frame")}function o(f){if(Oe.call(f,"key")){var O=Object.getOwnPropertyDescriptor(f,"key").get;if(O&&O.isReactWarning)return!1}return f.key!==void 0}function a(f,O){function N(){V||(V=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",O))}N.isReactWarning=!0,Object.defineProperty(f,"key",{get:N,configurable:!0})}function h(){var f=t(this.type);return ft[f]||(ft[f]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),f=this.props.ref,f!==void 0?f:null}function d(f,O,N,D,qe,Yt){var H=N.ref;return f={$$typeof:p,type:f,key:O,props:N,_owner:D},(H!==void 0?H:null)!==null?Object.defineProperty(f,"ref",{enumerable:!1,get:h}):Object.defineProperty(f,"ref",{enumerable:!1,value:null}),f._store={},Object.defineProperty(f._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(f,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(f,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:qe}),Object.defineProperty(f,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Yt}),Object.freeze&&(Object.freeze(f.props),Object.freeze(f)),f}function l(f,O,N,D,qe,Yt){var H=O.children;if(H!==void 0)if(D)if(pe(H)){for(D=0;D<H.length;D++)y(H[D]);Object.freeze&&Object.freeze(H)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else y(H);if(Oe.call(O,"key")){H=t(f);var Ye=Object.keys(O).filter(function(Fi){return Fi!=="key"});D=0<Ye.length?"{key: someKey, "+Ye.join(": ..., ")+": ...}":"{key: someKey}",At[H+D]||(Ye=0<Ye.length?"{"+Ye.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
2
18
|
let props = %s;
|
|
3
19
|
<%s {...props} />
|
|
4
20
|
React keys must be passed directly to JSX without using spread:
|
|
5
21
|
let props = %s;
|
|
6
|
-
<%s key={someKey} {...props} />`,o,p,m,p),D[p+o]=!0)}if(p=null,i!==void 0&&(r(i),p=``+i),s(n)&&(r(n.key),p=``+n.key),`key`in n)for(var h in i={},n)h!==`key`&&(i[h]=n[h]);else i=n;return p&&c(i,typeof e==`function`?e.displayName||e.name||`Unknown`:e),u(e,p,i,a(),l,d)}function f(e){p(e)?e._store&&(e._store.validated=1):typeof e==`object`&&e&&e.$$typeof===T&&(e._payload.status===`fulfilled`?p(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function p(e){return typeof e==`object`&&!!e&&e.$$typeof===h}var m=require(`react`),h=Symbol.for(`react.transitional.element`),g=Symbol.for(`react.portal`),_=Symbol.for(`react.fragment`),v=Symbol.for(`react.strict_mode`),y=Symbol.for(`react.profiler`),b=Symbol.for(`react.consumer`),ee=Symbol.for(`react.context`),x=Symbol.for(`react.forward_ref`),S=Symbol.for(`react.suspense`),C=Symbol.for(`react.suspense_list`),w=Symbol.for(`react.memo`),T=Symbol.for(`react.lazy`),te=Symbol.for(`react.activity`),ne=Symbol.for(`react.client.reference`),re=m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ie=Object.prototype.hasOwnProperty,ae=Array.isArray,E=console.createTask?console.createTask:function(){return null};m={react_stack_bottom_frame:function(e){return e()}};var oe,se={},ce=m.react_stack_bottom_frame.bind(m,o)(),le=E(i(o)),D={};e.Fragment=_,e.jsx=function(e,t,n){var r=1e4>re.recentlyCreatedOwnerStacks++;return d(e,t,n,!1,r?Error(`react-stack-top-frame`):ce,r?E(i(e)):le)},e.jsxs=function(e,t,n){var r=1e4>re.recentlyCreatedOwnerStacks++;return d(e,t,n,!0,r?Error(`react-stack-top-frame`):ce,r?E(i(e)):le)}})()})),j=c(((e,t)=>{process.env.NODE_ENV===`production`?t.exports=Fe():t.exports=Ie()}))(),Le=t.createContext(void 0),Re=e=>{let n=t.useContext(Le);if(e)return e;if(!n)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return n},ze=({client:e,children:n})=>(t.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,j.jsx)(Le.Provider,{value:e,children:n}));function Be(e,n){let r=Re(n),[i]=t.useState(()=>new Me(r,e));t.useEffect(()=>{i.setOptions(e)},[i,e]);let a=t.useSyncExternalStore(t.useCallback(e=>i.subscribe(O.batchCalls(e)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),o=t.useCallback((e,t)=>{i.mutate(e,t).catch(g)},[i]);if(a.error&&de(i.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:o,mutateAsync:a.mutate}}function Ve({messages:e,onSendMessage:n,isSending:r,className:i,style:a}){let[o,s]=(0,t.useState)(``);return(0,j.jsxs)(`div`,{className:`fixed bottom-4 right-4 w-96 h-[500px] flex flex-col bg-white border border-gray-200 rounded-lg shadow-xl overflow-hidden font-sans ${i||``}`,style:a,children:[(0,j.jsxs)(`div`,{className:`bg-slate-800 text-white p-4 flex justify-between items-center`,children:[(0,j.jsx)(`h3`,{className:`font-semibold text-lg`,children:`ChatWillow`}),(0,j.jsx)(`span`,{className:`text-xs text-slate-300`,children:`Online`})]}),(0,j.jsxs)(`div`,{className:`flex-1 p-4 overflow-y-auto bg-gray-50 flex flex-col gap-3`,children:[e.length===0&&(0,j.jsx)(`div`,{className:`text-center text-gray-400 my-auto text-sm`,children:`Start a conversation...`}),e.map(e=>(0,j.jsx)(`div`,{className:`flex ${e.role===`user`?`justify-end`:`justify-start`}`,children:(0,j.jsx)(`div`,{className:`max-w-[80%] p-3 rounded-lg text-sm ${e.role===`user`?`bg-slate-800 text-white rounded-br-none`:`bg-white text-gray-800 border border-gray-200 rounded-bl-none shadow-sm`}`,children:e.content})},e.id)),r&&(0,j.jsx)(`div`,{className:`flex justify-start`,children:(0,j.jsx)(`div`,{className:`bg-white text-gray-800 border border-gray-200 p-3 rounded-lg rounded-bl-none shadow-sm`,children:(0,j.jsxs)(`span`,{className:`flex gap-1`,children:[(0,j.jsx)(`span`,{className:`w-1.5 h-1.5 bg-gray-400 rounded-full animate-bounce`}),(0,j.jsx)(`span`,{className:`w-1.5 h-1.5 bg-gray-400 rounded-full animate-bounce delay-75`}),(0,j.jsx)(`span`,{className:`w-1.5 h-1.5 bg-gray-400 rounded-full animate-bounce delay-150`})]})})})]}),(0,j.jsx)(`form`,{onSubmit:e=>{e.preventDefault(),o.trim()&&!r&&(n(o),s(``))},className:`p-3 bg-white border-t border-gray-100`,children:(0,j.jsxs)(`div`,{className:`flex gap-2`,children:[(0,j.jsx)(`input`,{type:`text`,value:o,onChange:e=>s(e.target.value),disabled:r,placeholder:`Type your message...`,className:`flex-1 px-4 py-2 bg-gray-100 border-0 rounded-full focus:ring-2 focus:ring-slate-800 focus:outline-none transition-all text-sm disabled:opacity-50`}),(0,j.jsx)(`button`,{type:`submit`,disabled:!o.trim()||r,className:`p-2 bg-slate-800 text-white rounded-full hover:bg-slate-700 disabled:opacity-50 disabled:cursor-not-allowed transition-colors`,children:(0,j.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:2,stroke:`currentColor`,className:`w-5 h-5`,children:(0,j.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M6 12L3.269 3.126A59.768 59.768 0 0121.485 12 59.77 59.77 0 013.27 20.876L5.999 12zm0 0h7.5`})})})]})})]})}function He(e,t){return function(){return e.apply(t,arguments)}}var{toString:Ue}=Object.prototype,{getPrototypeOf:We}=Object,{iterator:M,toStringTag:Ge}=Symbol,N=(e=>t=>{let n=Ue.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),P=e=>(e=e.toLowerCase(),t=>N(t)===e),Ke=e=>t=>typeof t===e,{isArray:F}=Array,I=Ke(`undefined`);function L(e){return e!==null&&!I(e)&&e.constructor!==null&&!I(e.constructor)&&R(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var qe=P(`ArrayBuffer`);function Je(e){let t;return t=typeof ArrayBuffer<`u`&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&qe(e.buffer),t}var Ye=Ke(`string`),R=Ke(`function`),Xe=Ke(`number`),z=e=>typeof e==`object`&&!!e,Ze=e=>e===!0||e===!1,Qe=e=>{if(N(e)!==`object`)return!1;let t=We(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Ge in e)&&!(M in e)},$e=e=>{if(!z(e)||L(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},et=P(`Date`),tt=P(`File`),nt=P(`Blob`),rt=P(`FileList`),it=e=>z(e)&&R(e.pipe),at=e=>{let t;return e&&(typeof FormData==`function`&&e instanceof FormData||R(e.append)&&((t=N(e))===`formdata`||t===`object`&&R(e.toString)&&e.toString()===`[object FormData]`))},ot=P(`URLSearchParams`),[st,ct,lt,ut]=[`ReadableStream`,`Request`,`Response`,`Headers`].map(P),dt=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,``);function B(e,t,{allOwnKeys:n=!1}={}){if(e==null)return;let r,i;if(typeof e!=`object`&&(e=[e]),F(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{if(L(e))return;let i=n?Object.getOwnPropertyNames(e):Object.keys(e),a=i.length,o;for(r=0;r<a;r++)o=i[r],t.call(null,e[o],o,e)}}function ft(e,t){if(L(e))return null;t=t.toLowerCase();let n=Object.keys(e),r=n.length,i;for(;r-- >0;)if(i=n[r],t===i.toLowerCase())return i;return null}var V=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:global,pt=e=>!I(e)&&e!==V;function mt(){let{caseless:e,skipUndefined:t}=pt(this)&&this||{},n={},r=(r,i)=>{if(i===`__proto__`||i===`constructor`||i===`prototype`)return;let a=e&&ft(n,i)||i;Qe(n[a])&&Qe(r)?n[a]=mt(n[a],r):Qe(r)?n[a]=mt({},r):F(r)?n[a]=r.slice():(!t||!I(r))&&(n[a]=r)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&B(arguments[e],r);return n}var ht=(e,t,n,{allOwnKeys:r}={})=>(B(t,(t,r)=>{n&&R(t)?Object.defineProperty(e,r,{value:He(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,r,{value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),e),gt=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),_t=(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)},vt=(e,t,n,r)=>{let i,a,o,s={};if(t||={},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)o=i[a],(!r||r(o,e,t))&&!s[o]&&(t[o]=e[o],s[o]=!0);e=n!==!1&&We(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},yt=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;let r=e.indexOf(t,n);return r!==-1&&r===n},bt=e=>{if(!e)return null;if(F(e))return e;let t=e.length;if(!Xe(t))return null;let n=Array(t);for(;t-- >0;)n[t]=e[t];return n},xt=(e=>t=>e&&t instanceof e)(typeof Uint8Array<`u`&&We(Uint8Array)),St=(e,t)=>{let n=(e&&e[M]).call(e),r;for(;(r=n.next())&&!r.done;){let n=r.value;t.call(e,n[0],n[1])}},Ct=(e,t)=>{let n,r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},wt=P(`HTMLFormElement`),Tt=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),Et=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Dt=P(`RegExp`),Ot=(e,t)=>{let n=Object.getOwnPropertyDescriptors(e),r={};B(n,(n,i)=>{let a;(a=t(n,i,e))!==!1&&(r[i]=a||n)}),Object.defineProperties(e,r)},kt=e=>{Ot(e,(t,n)=>{if(R(e)&&[`arguments`,`caller`,`callee`].indexOf(n)!==-1)return!1;let r=e[n];if(R(r)){if(t.enumerable=!1,`writable`in t){t.writable=!1;return}t.set||=()=>{throw Error(`Can not rewrite read-only method '`+n+`'`)}}})},At=(e,t)=>{let n={},r=e=>{e.forEach(e=>{n[e]=!0})};return F(e)?r(e):r(String(e).split(t)),n},jt=()=>{},Mt=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Nt(e){return!!(e&&R(e.append)&&e[Ge]===`FormData`&&e[M])}var Pt=e=>{let t=Array(10),n=(e,r)=>{if(z(e)){if(t.indexOf(e)>=0)return;if(L(e))return e;if(!(`toJSON`in e)){t[r]=e;let i=F(e)?[]:{};return B(e,(e,t)=>{let a=n(e,r+1);!I(a)&&(i[t]=a)}),t[r]=void 0,i}}return e};return n(e,0)},Ft=P(`AsyncFunction`),It=e=>e&&(z(e)||R(e))&&R(e.then)&&R(e.catch),Lt=((e,t)=>e?setImmediate:t?((e,t)=>(V.addEventListener(`message`,({source:n,data:r})=>{n===V&&r===e&&t.length&&t.shift()()},!1),n=>{t.push(n),V.postMessage(e,`*`)}))(`axios@${Math.random()}`,[]):e=>setTimeout(e))(typeof setImmediate==`function`,R(V.postMessage)),H={isArray:F,isArrayBuffer:qe,isBuffer:L,isFormData:at,isArrayBufferView:Je,isString:Ye,isNumber:Xe,isBoolean:Ze,isObject:z,isPlainObject:Qe,isEmptyObject:$e,isReadableStream:st,isRequest:ct,isResponse:lt,isHeaders:ut,isUndefined:I,isDate:et,isFile:tt,isBlob:nt,isRegExp:Dt,isFunction:R,isStream:it,isURLSearchParams:ot,isTypedArray:xt,isFileList:rt,forEach:B,merge:mt,extend:ht,trim:dt,stripBOM:gt,inherits:_t,toFlatObject:vt,kindOf:N,kindOfTest:P,endsWith:yt,toArray:bt,forEachEntry:St,matchAll:Ct,isHTMLForm:wt,hasOwnProperty:Et,hasOwnProp:Et,reduceDescriptors:Ot,freezeMethods:kt,toObjectSet:At,toCamelCase:Tt,noop:jt,toFiniteNumber:Mt,findKey:ft,global:V,isContextDefined:pt,isSpecCompliantForm:Nt,toJSONObject:Pt,isAsyncFn:Ft,isThenable:It,setImmediate:Lt,asap:typeof queueMicrotask<`u`?queueMicrotask.bind(V):typeof process<`u`&&process.nextTick||Lt,isIterable:e=>e!=null&&R(e[M])},U=class e extends Error{static from(t,n,r,i,a,o){let s=new e(t.message,n||t.code,r,i,a);return s.cause=t,s.name=t.name,o&&Object.assign(s,o),s}constructor(e,t,n,r,i){super(e),this.name=`AxiosError`,this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.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:H.toJSONObject(this.config),code:this.code,status:this.status}}};U.ERR_BAD_OPTION_VALUE=`ERR_BAD_OPTION_VALUE`,U.ERR_BAD_OPTION=`ERR_BAD_OPTION`,U.ECONNABORTED=`ECONNABORTED`,U.ETIMEDOUT=`ETIMEDOUT`,U.ERR_NETWORK=`ERR_NETWORK`,U.ERR_FR_TOO_MANY_REDIRECTS=`ERR_FR_TOO_MANY_REDIRECTS`,U.ERR_DEPRECATED=`ERR_DEPRECATED`,U.ERR_BAD_RESPONSE=`ERR_BAD_RESPONSE`,U.ERR_BAD_REQUEST=`ERR_BAD_REQUEST`,U.ERR_CANCELED=`ERR_CANCELED`,U.ERR_NOT_SUPPORT=`ERR_NOT_SUPPORT`,U.ERR_INVALID_URL=`ERR_INVALID_URL`;function Rt(e){return H.isPlainObject(e)||H.isArray(e)}function zt(e){return H.endsWith(e,`[]`)?e.slice(0,-2):e}function Bt(e,t,n){return e?e.concat(t).map(function(e,t){return e=zt(e),!n&&t?`[`+e+`]`:e}).join(n?`.`:``):t}function Vt(e){return H.isArray(e)&&!e.some(Rt)}var Ht=H.toFlatObject(H,{},null,function(e){return/^is[A-Z]/.test(e)});function Ut(e,t,n){if(!H.isObject(e))throw TypeError(`target must be an object`);t||=new FormData,n=H.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!H.isUndefined(t[e])});let r=n.metaTokens,i=n.visitor||l,a=n.dots,o=n.indexes,s=(n.Blob||typeof Blob<`u`&&Blob)&&H.isSpecCompliantForm(t);if(!H.isFunction(i))throw TypeError(`visitor must be a function`);function c(e){if(e===null)return``;if(H.isDate(e))return e.toISOString();if(H.isBoolean(e))return e.toString();if(!s&&H.isBlob(e))throw new U(`Blob is not supported. Use a Buffer instead.`);return H.isArrayBuffer(e)||H.isTypedArray(e)?s&&typeof Blob==`function`?new Blob([e]):Buffer.from(e):e}function l(e,n,i){let s=e;if(e&&!i&&typeof e==`object`){if(H.endsWith(n,`{}`))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(H.isArray(e)&&Vt(e)||(H.isFileList(e)||H.endsWith(n,`[]`))&&(s=H.toArray(e)))return n=zt(n),s.forEach(function(e,r){!(H.isUndefined(e)||e===null)&&t.append(o===!0?Bt([n],r,a):o===null?n:n+`[]`,c(e))}),!1}return Rt(e)?!0:(t.append(Bt(i,n,a),c(e)),!1)}let u=[],d=Object.assign(Ht,{defaultVisitor:l,convertValue:c,isVisitable:Rt});function f(e,n){if(!H.isUndefined(e)){if(u.indexOf(e)!==-1)throw Error(`Circular reference detected in `+n.join(`.`));u.push(e),H.forEach(e,function(e,r){(!(H.isUndefined(e)||e===null)&&i.call(t,e,H.isString(r)?r.trim():r,n,d))===!0&&f(e,n?n.concat(r):[r])}),u.pop()}}if(!H.isObject(e))throw TypeError(`data must be an object`);return f(e),t}function Wt(e){let t={"!":`%21`,"'":`%27`,"(":`%28`,")":`%29`,"~":`%7E`,"%20":`+`,"%00":`\0`};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function Gt(e,t){this._pairs=[],e&&Ut(e,this,t)}var Kt=Gt.prototype;Kt.append=function(e,t){this._pairs.push([e,t])},Kt.toString=function(e){let t=e?function(t){return e.call(this,t,Wt)}:Wt;return this._pairs.map(function(e){return t(e[0])+`=`+t(e[1])},``).join(`&`)};function qt(e){return encodeURIComponent(e).replace(/%3A/gi,`:`).replace(/%24/g,`$`).replace(/%2C/gi,`,`).replace(/%20/g,`+`)}function Jt(e,t,n){if(!t)return e;let r=n&&n.encode||qt,i=H.isFunction(n)?{serialize:n}:n,a=i&&i.serialize,o;if(o=a?a(t,i):H.isURLSearchParams(t)?t.toString():new Gt(t,i).toString(r),o){let t=e.indexOf(`#`);t!==-1&&(e=e.slice(0,t)),e+=(e.indexOf(`?`)===-1?`?`:`&`)+o}return e}var Yt=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&=[]}forEach(e){H.forEach(this.handlers,function(t){t!==null&&e(t)})}},Xt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},Zt={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<`u`?URLSearchParams:Gt,FormData:typeof FormData<`u`?FormData:null,Blob:typeof Blob<`u`?Blob:null},protocols:[`http`,`https`,`file`,`blob`,`url`,`data`]},Qt=l({hasBrowserEnv:()=>$t,hasStandardBrowserEnv:()=>tn,hasStandardBrowserWebWorkerEnv:()=>nn,navigator:()=>en,origin:()=>rn}),$t=typeof window<`u`&&typeof document<`u`,en=typeof navigator==`object`&&navigator||void 0,tn=$t&&(!en||[`ReactNative`,`NativeScript`,`NS`].indexOf(en.product)<0),nn=typeof WorkerGlobalScope<`u`&&self instanceof WorkerGlobalScope&&typeof self.importScripts==`function`,rn=$t&&window.location.href||`http://localhost`,W={...Qt,...Zt};function an(e,t){return Ut(e,new W.classes.URLSearchParams,{visitor:function(e,t,n,r){return W.isNode&&H.isBuffer(e)?(this.append(t,e.toString(`base64`)),!1):r.defaultVisitor.apply(this,arguments)},...t})}function on(e){return H.matchAll(/\w+|\[(\w*)]/g,e).map(e=>e[0]===`[]`?``:e[1]||e[0])}function sn(e){let t={},n=Object.keys(e),r,i=n.length,a;for(r=0;r<i;r++)a=n[r],t[a]=e[a];return t}function cn(e){function t(e,n,r,i){let a=e[i++];if(a===`__proto__`)return!0;let o=Number.isFinite(+a),s=i>=e.length;return a=!a&&H.isArray(r)?r.length:a,s?(H.hasOwnProp(r,a)?r[a]=[r[a],n]:r[a]=n,!o):((!r[a]||!H.isObject(r[a]))&&(r[a]=[]),t(e,n,r[a],i)&&H.isArray(r[a])&&(r[a]=sn(r[a])),!o)}if(H.isFormData(e)&&H.isFunction(e.entries)){let n={};return H.forEachEntry(e,(e,r)=>{t(on(e),r,n,0)}),n}return null}function ln(e,t,n){if(H.isString(e))try{return(t||JSON.parse)(e),H.trim(e)}catch(e){if(e.name!==`SyntaxError`)throw e}return(n||JSON.stringify)(e)}var G={transitional:Xt,adapter:[`xhr`,`http`,`fetch`],transformRequest:[function(e,t){let n=t.getContentType()||``,r=n.indexOf(`application/json`)>-1,i=H.isObject(e);if(i&&H.isHTMLForm(e)&&(e=new FormData(e)),H.isFormData(e))return r?JSON.stringify(cn(e)):e;if(H.isArrayBuffer(e)||H.isBuffer(e)||H.isStream(e)||H.isFile(e)||H.isBlob(e)||H.isReadableStream(e))return e;if(H.isArrayBufferView(e))return e.buffer;if(H.isURLSearchParams(e))return t.setContentType(`application/x-www-form-urlencoded;charset=utf-8`,!1),e.toString();let a;if(i){if(n.indexOf(`application/x-www-form-urlencoded`)>-1)return an(e,this.formSerializer).toString();if((a=H.isFileList(e))||n.indexOf(`multipart/form-data`)>-1){let t=this.env&&this.env.FormData;return Ut(a?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||r?(t.setContentType(`application/json`,!1),ln(e)):e}],transformResponse:[function(e){let t=this.transitional||G.transitional,n=t&&t.forcedJSONParsing,r=this.responseType===`json`;if(H.isResponse(e)||H.isReadableStream(e))return e;if(e&&H.isString(e)&&(n&&!this.responseType||r)){let n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(e){if(n)throw e.name===`SyntaxError`?U.from(e,U.ERR_BAD_RESPONSE,this,null,this.response):e}}return e}],timeout:0,xsrfCookieName:`XSRF-TOKEN`,xsrfHeaderName:`X-XSRF-TOKEN`,maxContentLength:-1,maxBodyLength:-1,env:{FormData:W.classes.FormData,Blob:W.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:`application/json, text/plain, */*`,"Content-Type":void 0}}};H.forEach([`delete`,`get`,`head`,`post`,`put`,`patch`],e=>{G.headers[e]={}});var un=H.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`]),dn=e=>{let t={},n,r,i;return e&&e.split(`
|
|
7
|
-
`).forEach(function(
|
|
8
|
-
`)}getSetCookie(){return this.get(`set-cookie`)||[]}get[Symbol.toStringTag](){return`AxiosHeaders`}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){let n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){let t=(this[fn]=this[fn]={accessors:{}}).accessors,n=this.prototype;function r(e){let r=K(e);t[r]||(vn(n,e),t[r]=!0)}return H.isArray(e)?e.forEach(r):r(e),this}};q.accessor([`Content-Type`,`Content-Length`,`Accept`,`Accept-Encoding`,`User-Agent`,`Authorization`]),H.reduceDescriptors(q.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),H.freezeMethods(q);function yn(e,t){let n=this||G,r=t||n,i=q.from(r.headers),a=r.data;return H.forEach(e,function(e){a=e.call(n,a,i.normalize(),t?t.status:void 0)}),i.normalize(),a}function bn(e){return!!(e&&e.__CANCEL__)}var J=class extends U{constructor(e,t,n){super(e??`canceled`,U.ERR_CANCELED,t,n),this.name=`CanceledError`,this.__CANCEL__=!0}};function xn(e,t,n){let r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new U(`Request failed with status code `+n.status,[U.ERR_BAD_REQUEST,U.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Sn(e){let t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||``}function Cn(e,t){e||=10;let n=Array(e),r=Array(e),i=0,a=0,o;return t=t===void 0?1e3:t,function(s){let c=Date.now(),l=r[a];o||=c,n[i]=s,r[i]=c;let u=a,d=0;for(;u!==i;)d+=n[u++],u%=e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),c-o<t)return;let f=l&&c-l;return f?Math.round(d*1e3/f):void 0}}function wn(e,t){let n=0,r=1e3/t,i,a,o=(t,r=Date.now())=>{n=r,i=null,a&&=(clearTimeout(a),null),e(...t)};return[(...e)=>{let t=Date.now(),s=t-n;s>=r?o(e,t):(i=e,a||=setTimeout(()=>{a=null,o(i)},r-s))},()=>i&&o(i)]}let Tn=(e,t,n=3)=>{let r=0,i=Cn(50,250);return wn(n=>{let a=n.loaded,o=n.lengthComputable?n.total:void 0,s=a-r,c=i(s),l=a<=o;r=a,e({loaded:a,total:o,progress:o?a/o:void 0,bytes:s,rate:c||void 0,estimated:c&&o&&l?(o-a)/c:void 0,event:n,lengthComputable:o!=null,[t?`download`:`upload`]:!0})},n)},En=(e,t)=>{let n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Dn=e=>(...t)=>H.asap(()=>e(...t));var On=W.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,W.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(W.origin),W.navigator&&/(msie|trident)/i.test(W.navigator.userAgent)):()=>!0,kn=W.hasStandardBrowserEnv?{write(e,t,n,r,i,a,o){if(typeof document>`u`)return;let s=[`${e}=${encodeURIComponent(t)}`];H.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),H.isString(r)&&s.push(`path=${r}`),H.isString(i)&&s.push(`domain=${i}`),a===!0&&s.push(`secure`),H.isString(o)&&s.push(`SameSite=${o}`),document.cookie=s.join(`; `)},read(e){if(typeof document>`u`)return null;let t=document.cookie.match(RegExp(`(?:^|; )`+e+`=([^;]*)`));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,``,Date.now()-864e5,`/`)}}:{write(){},read(){return null},remove(){}};function An(e){return typeof e==`string`?/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e):!1}function jn(e,t){return t?e.replace(/\/?\/$/,``)+`/`+t.replace(/^\/+/,``):e}function Mn(e,t,n){let r=!An(t);return e&&(r||n==0)?jn(e,t):t}var Nn=e=>e instanceof q?{...e}:e;function Y(e,t){t||={};let n={};function r(e,t,n,r){return H.isPlainObject(e)&&H.isPlainObject(t)?H.merge.call({caseless:r},e,t):H.isPlainObject(t)?H.merge({},t):H.isArray(t)?t.slice():t}function i(e,t,n,i){if(!H.isUndefined(t))return r(e,t,n,i);if(!H.isUndefined(e))return r(void 0,e,n,i)}function a(e,t){if(!H.isUndefined(t))return r(void 0,t)}function o(e,t){if(!H.isUndefined(t))return r(void 0,t);if(!H.isUndefined(e))return r(void 0,e)}function s(n,i,a){if(a in t)return r(n,i);if(a in e)return r(void 0,n)}let c={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:s,headers:(e,t,n)=>i(Nn(e),Nn(t),n,!0)};return H.forEach(Object.keys({...e,...t}),function(r){if(r===`__proto__`||r===`constructor`||r===`prototype`)return;let a=H.hasOwnProp(c,r)?c[r]:i,o=a(e[r],t[r],r);H.isUndefined(o)&&a!==s||(n[r]=o)}),n}var Pn=e=>{let t=Y({},e),{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:a,headers:o,auth:s}=t;if(t.headers=o=q.from(o),t.url=Jt(Mn(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),s&&o.set(`Authorization`,`Basic `+btoa((s.username||``)+`:`+(s.password?unescape(encodeURIComponent(s.password)):``))),H.isFormData(n)){if(W.hasStandardBrowserEnv||W.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(H.isFunction(n.getHeaders)){let e=n.getHeaders(),t=[`content-type`,`content-length`];Object.entries(e).forEach(([e,n])=>{t.includes(e.toLowerCase())&&o.set(e,n)})}}if(W.hasStandardBrowserEnv&&(r&&H.isFunction(r)&&(r=r(t)),r||r!==!1&&On(t.url))){let e=i&&a&&kn.read(a);e&&o.set(i,e)}return t},Fn=typeof XMLHttpRequest<`u`&&function(e){return new Promise(function(t,n){let r=Pn(e),i=r.data,a=q.from(r.headers).normalize(),{responseType:o,onUploadProgress:s,onDownloadProgress:c}=r,l,u,d,f,p;function m(){f&&f(),p&&p(),r.cancelToken&&r.cancelToken.unsubscribe(l),r.signal&&r.signal.removeEventListener(`abort`,l)}let h=new XMLHttpRequest;h.open(r.method.toUpperCase(),r.url,!0),h.timeout=r.timeout;function g(){if(!h)return;let r=q.from(`getAllResponseHeaders`in h&&h.getAllResponseHeaders());xn(function(e){t(e),m()},function(e){n(e),m()},{data:!o||o===`text`||o===`json`?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:r,config:e,request:h}),h=null}`onloadend`in h?h.onloadend=g:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf(`file:`)===0)||setTimeout(g)},h.onabort=function(){h&&=(n(new U(`Request aborted`,U.ECONNABORTED,e,h)),null)},h.onerror=function(t){let r=new U(t&&t.message?t.message:`Network Error`,U.ERR_NETWORK,e,h);r.event=t||null,n(r),h=null},h.ontimeout=function(){let t=r.timeout?`timeout of `+r.timeout+`ms exceeded`:`timeout exceeded`,i=r.transitional||Xt;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new U(t,i.clarifyTimeoutError?U.ETIMEDOUT:U.ECONNABORTED,e,h)),h=null},i===void 0&&a.setContentType(null),`setRequestHeader`in h&&H.forEach(a.toJSON(),function(e,t){h.setRequestHeader(t,e)}),H.isUndefined(r.withCredentials)||(h.withCredentials=!!r.withCredentials),o&&o!==`json`&&(h.responseType=r.responseType),c&&([d,p]=Tn(c,!0),h.addEventListener(`progress`,d)),s&&h.upload&&([u,f]=Tn(s),h.upload.addEventListener(`progress`,u),h.upload.addEventListener(`loadend`,f)),(r.cancelToken||r.signal)&&(l=t=>{h&&=(n(!t||t.type?new J(null,e,h):t),h.abort(),null)},r.cancelToken&&r.cancelToken.subscribe(l),r.signal&&(r.signal.aborted?l():r.signal.addEventListener(`abort`,l)));let _=Sn(r.url);if(_&&W.protocols.indexOf(_)===-1){n(new U(`Unsupported protocol `+_+`:`,U.ERR_BAD_REQUEST,e));return}h.send(i||null)})},In=(e,t)=>{let{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n=new AbortController,r,i=function(e){if(!r){r=!0,o();let t=e instanceof Error?e:this.reason;n.abort(t instanceof U?t:new J(t instanceof Error?t.message:t))}},a=t&&setTimeout(()=>{a=null,i(new U(`timeout of ${t}ms exceeded`,U.ETIMEDOUT))},t),o=()=>{e&&=(a&&clearTimeout(a),a=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener(`abort`,i)}),null)};e.forEach(e=>e.addEventListener(`abort`,i));let{signal:s}=n;return s.unsubscribe=()=>H.asap(o),s}};let Ln=function*(e,t){let n=e.byteLength;if(!t||n<t){yield e;return}let r=0,i;for(;r<n;)i=r+t,yield e.slice(r,i),r=i},Rn=async function*(e,t){for await(let n of zn(e))yield*Ln(n,t)};var zn=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}let t=e.getReader();try{for(;;){let{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}};let Bn=(e,t,n,r)=>{let i=Rn(e,t),a=0,o,s=e=>{o||(o=!0,r&&r(e))};return new ReadableStream({async pull(e){try{let{done:t,value:r}=await i.next();if(t){s(),e.close();return}let o=r.byteLength;n&&n(a+=o),e.enqueue(new Uint8Array(r))}catch(e){throw s(e),e}},cancel(e){return s(e),i.return()}},{highWaterMark:2})};var Vn=64*1024,{isFunction:Hn}=H,Un=(({Request:e,Response:t})=>({Request:e,Response:t}))(H.global),{ReadableStream:Wn,TextEncoder:Gn}=H.global,Kn=(e,...t)=>{try{return!!e(...t)}catch{return!1}},qn=e=>{e=H.merge.call({skipUndefined:!0},Un,e);let{fetch:t,Request:n,Response:r}=e,i=t?Hn(t):typeof fetch==`function`,a=Hn(n),o=Hn(r);if(!i)return!1;let s=i&&Hn(Wn),c=i&&(typeof Gn==`function`?(e=>t=>e.encode(t))(new Gn):async e=>new Uint8Array(await new n(e).arrayBuffer())),l=a&&s&&Kn(()=>{let e=!1,t=new n(W.origin,{body:new Wn,method:`POST`,get duplex(){return e=!0,`half`}}).headers.has(`Content-Type`);return e&&!t}),u=o&&s&&Kn(()=>H.isReadableStream(new r(``).body)),d={stream:u&&(e=>e.body)};i&&[`text`,`arrayBuffer`,`blob`,`formData`,`stream`].forEach(e=>{!d[e]&&(d[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new U(`Response type '${e}' is not supported`,U.ERR_NOT_SUPPORT,n)})});let f=async e=>{if(e==null)return 0;if(H.isBlob(e))return e.size;if(H.isSpecCompliantForm(e))return(await new n(W.origin,{method:`POST`,body:e}).arrayBuffer()).byteLength;if(H.isArrayBufferView(e)||H.isArrayBuffer(e))return e.byteLength;if(H.isURLSearchParams(e)&&(e+=``),H.isString(e))return(await c(e)).byteLength},p=async(e,t)=>H.toFiniteNumber(e.getContentLength())??f(t);return async e=>{let{url:i,method:o,data:s,signal:c,cancelToken:f,timeout:m,onDownloadProgress:h,onUploadProgress:g,responseType:_,headers:v,withCredentials:y=`same-origin`,fetchOptions:b}=Pn(e),ee=t||fetch;_=_?(_+``).toLowerCase():`text`;let x=In([c,f&&f.toAbortSignal()],m),S=null,C=x&&x.unsubscribe&&(()=>{x.unsubscribe()}),w;try{if(g&&l&&o!==`get`&&o!==`head`&&(w=await p(v,s))!==0){let e=new n(i,{method:`POST`,body:s,duplex:`half`}),t;if(H.isFormData(s)&&(t=e.headers.get(`content-type`))&&v.setContentType(t),e.body){let[t,n]=En(w,Tn(Dn(g)));s=Bn(e.body,Vn,t,n)}}H.isString(y)||(y=y?`include`:`omit`);let t=a&&`credentials`in n.prototype,c={...b,signal:x,method:o.toUpperCase(),headers:v.normalize().toJSON(),body:s,duplex:`half`,credentials:t?y:void 0};S=a&&new n(i,c);let f=await(a?ee(S,b):ee(i,c)),m=u&&(_===`stream`||_===`response`);if(u&&(h||m&&C)){let e={};[`status`,`statusText`,`headers`].forEach(t=>{e[t]=f[t]});let t=H.toFiniteNumber(f.headers.get(`content-length`)),[n,i]=h&&En(t,Tn(Dn(h),!0))||[];f=new r(Bn(f.body,Vn,n,()=>{i&&i(),C&&C()}),e)}_||=`text`;let T=await d[H.findKey(d,_)||`text`](f,e);return!m&&C&&C(),await new Promise((t,n)=>{xn(t,n,{data:T,headers:q.from(f.headers),status:f.status,statusText:f.statusText,config:e,request:S})})}catch(t){throw C&&C(),t&&t.name===`TypeError`&&/Load failed|fetch/i.test(t.message)?Object.assign(new U(`Network Error`,U.ERR_NETWORK,e,S,t&&t.response),{cause:t.cause||t}):U.from(t,t&&t.code,e,S,t&&t.response)}}},Jn=new Map;let Yn=e=>{let t=e&&e.env||{},{fetch:n,Request:r,Response:i}=t,a=[r,i,n],o=a.length,s,c,l=Jn;for(;o--;)s=a[o],c=l.get(s),c===void 0&&l.set(s,c=o?new Map:qn(t)),l=c;return c};Yn();var Xn={http:null,xhr:Fn,fetch:{get:Yn}};H.forEach(Xn,(e,t)=>{if(e){try{Object.defineProperty(e,`name`,{value:t})}catch{}Object.defineProperty(e,`adapterName`,{value:t})}});var Zn=e=>`- ${e}`,Qn=e=>H.isFunction(e)||e===null||e===!1;function $n(e,t){e=H.isArray(e)?e:[e];let{length:n}=e,r,i,a={};for(let o=0;o<n;o++){r=e[o];let n;if(i=r,!Qn(r)&&(i=Xn[(n=String(r)).toLowerCase()],i===void 0))throw new U(`Unknown adapter '${n}'`);if(i&&(H.isFunction(i)||(i=i.get(t))))break;a[n||`#`+o]=i}if(!i){let e=Object.entries(a).map(([e,t])=>`adapter ${e} `+(t===!1?`is not supported by the environment`:`is not available in the build`));throw new U(`There is no suitable adapter to dispatch the request `+(n?e.length>1?`since :
|
|
9
|
-
`+
|
|
10
|
-
`)
|
|
11
|
-
`+
|
|
22
|
+
<%s key={someKey} {...props} />`,D,H,Ye,H),At[H+D]=!0)}if(H=null,N!==void 0&&(r(N),H=""+N),o(O)&&(r(O.key),H=""+O.key),"key"in O){N={};for(var Xt in O)Xt!=="key"&&(N[Xt]=O[Xt])}else N=O;return H&&a(N,typeof f=="function"?f.displayName||f.name||"Unknown":f),d(f,H,N,s(),qe,Yt)}function y(f){w(f)?f._store&&(f._store.validated=1):typeof f=="object"&&f!==null&&f.$$typeof===j&&(f._payload.status==="fulfilled"?w(f._payload.value)&&f._payload.value._store&&(f._payload.value._store.validated=1):f._store&&(f._store.validated=1))}function w(f){return typeof f=="object"&&f!==null&&f.$$typeof===p}var S=P,p=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),m=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),x=Symbol.for("react.consumer"),g=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),k=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),Ue=Symbol.for("react.activity"),Me=Symbol.for("react.client.reference"),Se=S.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Oe=Object.prototype.hasOwnProperty,pe=Array.isArray,Ge=console.createTask?console.createTask:function(){return null};S={react_stack_bottom_frame:function(f){return f()}};var V,ft={},ie=S.react_stack_bottom_frame.bind(S,i)(),dt=Ge(n(i)),At={};Ze.Fragment=m,Ze.jsx=function(f,O,N){var D=1e4>Se.recentlyCreatedOwnerStacks++;return l(f,O,N,!1,D?Error("react-stack-top-frame"):ie,D?Ge(n(f)):dt)},Ze.jsxs=function(f,O,N){var D=1e4>Se.recentlyCreatedOwnerStacks++;return l(f,O,N,!0,D?Error("react-stack-top-frame"):ie,D?Ge(n(f)):dt)}})()),Ze}var nr;function gn(){return nr||(nr=1,process.env.NODE_ENV==="production"?Le.exports=yn():Le.exports=bn()),Le.exports}var F=gn(),et=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},wn={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},En=(tn=class{constructor(){T(this,oe,wn);T(this,Ce,!1)}setTimeoutProvider(t){process.env.NODE_ENV!=="production"&&u(this,Ce)&&t!==u(this,oe)&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:u(this,oe),provider:t}),E(this,oe,t),process.env.NODE_ENV!=="production"&&E(this,Ce,!1)}setTimeout(t,e){return process.env.NODE_ENV!=="production"&&E(this,Ce,!0),u(this,oe).setTimeout(t,e)}clearTimeout(t){u(this,oe).clearTimeout(t)}setInterval(t,e){return process.env.NODE_ENV!=="production"&&E(this,Ce,!0),u(this,oe).setInterval(t,e)}clearInterval(t){u(this,oe).clearInterval(t)}},oe=new WeakMap,Ce=new WeakMap,tn),_t=new En;function Rn(t){setTimeout(t,0)}var ht=typeof window>"u"||"Deno"in globalThis;function Z(){}function Sn(t,e){return typeof t=="function"?t(e):t}function On(t){return typeof t=="number"&&t>=0&&t!==1/0}function vn(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Nt(t,e){return typeof t=="function"?t(e):t}function xn(t,e){return typeof t=="function"?t(e):t}function sr(t,e){const{type:r="all",exact:n,fetchStatus:s,predicate:i,queryKey:o,stale:a}=t;if(o){if(n){if(e.queryHash!==Ft(o,e.options))return!1}else if(!tt(e.queryKey,o))return!1}if(r!=="all"){const h=e.isActive();if(r==="active"&&!h||r==="inactive"&&h)return!1}return!(typeof a=="boolean"&&e.isStale()!==a||s&&s!==e.state.fetchStatus||i&&!i(e))}function ir(t,e){const{exact:r,status:n,predicate:s,mutationKey:i}=t;if(i){if(!e.options.mutationKey)return!1;if(r){if(xe(e.options.mutationKey)!==xe(i))return!1}else if(!tt(e.options.mutationKey,i))return!1}return!(n&&e.state.status!==n||s&&!s(e))}function Ft(t,e){return((e==null?void 0:e.queryKeyHashFn)||xe)(t)}function xe(t){return JSON.stringify(t,(e,r)=>Dt(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}function tt(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(r=>tt(t[r],e[r])):!1}var Tn=Object.prototype.hasOwnProperty;function jt(t,e,r=0){if(t===e)return t;if(r>500)return e;const n=or(t)&&or(e);if(!n&&!(Dt(t)&&Dt(e)))return e;const i=(n?t:Object.keys(t)).length,o=n?e:Object.keys(e),a=o.length,h=n?new Array(a):{};let d=0;for(let l=0;l<a;l++){const y=n?l:o[l],w=t[y],S=e[y];if(w===S){h[y]=w,(n?l<i:Tn.call(t,y))&&d++;continue}if(w===null||S===null||typeof w!="object"||typeof S!="object"){h[y]=S;continue}const p=jt(w,S,r+1);h[y]=p,p===w&&d++}return i===a&&d===i?t:h}function An(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const r in t)if(t[r]!==e[r])return!1;return!0}function or(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function Dt(t){if(!ar(t))return!1;const e=t.constructor;if(e===void 0)return!0;const r=e.prototype;return!(!ar(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function ar(t){return Object.prototype.toString.call(t)==="[object Object]"}function Pn(t){return new Promise(e=>{_t.setTimeout(e,t)})}function Cn(t,e,r){if(typeof r.structuralSharing=="function")return r.structuralSharing(t,e);if(r.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return jt(t,e)}catch(n){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${r.queryHash}]: ${n}`),n}return jt(t,e)}return e}function _n(t,e,r=0){const n=[...t,e];return r&&n.length>r?n.slice(1):n}function Nn(t,e,r=0){const n=[e,...t];return r&&n.length>r?n.slice(0,-1):n}var pt=Symbol();function ur(t,e){return process.env.NODE_ENV!=="production"&&t.queryFn===pt&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${t.queryHash}'`),!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===pt?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function Fn(t,e){return typeof t=="function"?t(...e):!!t}function jn(t,e,r){let n=!1,s;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(s??(s=e()),n||(n=!0,s.aborted?r():s.addEventListener("abort",r,{once:!0})),s)}),t}var Dn=(rn=class extends et{constructor(){super();T(this,_e);T(this,ye);T(this,He);E(this,He,e=>{if(!ht&&window.addEventListener){const r=()=>e();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){u(this,ye)||this.setEventListener(u(this,He))}onUnsubscribe(){var e;this.hasListeners()||((e=u(this,ye))==null||e.call(this),E(this,ye,void 0))}setEventListener(e){var r;E(this,He,e),(r=u(this,ye))==null||r.call(this),E(this,ye,e(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(e){u(this,_e)!==e&&(E(this,_e,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(r=>{r(e)})}isFocused(){var e;return typeof u(this,_e)=="boolean"?u(this,_e):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},_e=new WeakMap,ye=new WeakMap,He=new WeakMap,rn),cr=new Dn;function kn(){let t,e;const r=new Promise((s,i)=>{t=s,e=i});r.status="pending",r.catch(()=>{});function n(s){Object.assign(r,s),delete r.resolve,delete r.reject}return r.resolve=s=>{n({status:"fulfilled",value:s}),t(s)},r.reject=s=>{n({status:"rejected",reason:s}),e(s)},r}var Un=Rn;function Mn(){let t=[],e=0,r=a=>{a()},n=a=>{a()},s=Un;const i=a=>{e?t.push(a):s(()=>{r(a)})},o=()=>{const a=t;t=[],a.length&&s(()=>{n(()=>{a.forEach(h=>{r(h)})})})};return{batch:a=>{let h;e++;try{h=a()}finally{e--,e||o()}return h},batchCalls:a=>(...h)=>{i(()=>{a(...h)})},schedule:i,setNotifyFunction:a=>{r=a},setBatchNotifyFunction:a=>{n=a},setScheduler:a=>{s=a}}}var Q=Mn(),qn=(nn=class extends et{constructor(){super();T(this,$e,!0);T(this,be);T(this,Qe);E(this,Qe,e=>{if(!ht&&window.addEventListener){const r=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){u(this,be)||this.setEventListener(u(this,Qe))}onUnsubscribe(){var e;this.hasListeners()||((e=u(this,be))==null||e.call(this),E(this,be,void 0))}setEventListener(e){var r;E(this,Qe,e),(r=u(this,be))==null||r.call(this),E(this,be,e(this.setOnline.bind(this)))}setOnline(e){u(this,$e)!==e&&(E(this,$e,e),this.listeners.forEach(n=>{n(e)}))}isOnline(){return u(this,$e)}},$e=new WeakMap,be=new WeakMap,Qe=new WeakMap,nn),mt=new qn;function Ln(t){return Math.min(1e3*2**t,3e4)}function lr(t){return(t??"online")==="online"?mt.isOnline():!0}var kt=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function fr(t){let e=!1,r=0,n;const s=kn(),i=()=>s.status!=="pending",o=b=>{var m;if(!i()){const v=new kt(b);w(v),(m=t.onCancel)==null||m.call(t,v)}},a=()=>{e=!0},h=()=>{e=!1},d=()=>cr.isFocused()&&(t.networkMode==="always"||mt.isOnline())&&t.canRun(),l=()=>lr(t.networkMode)&&t.canRun(),y=b=>{i()||(n==null||n(),s.resolve(b))},w=b=>{i()||(n==null||n(),s.reject(b))},S=()=>new Promise(b=>{var m;n=v=>{(i()||d())&&b(v)},(m=t.onPause)==null||m.call(t)}).then(()=>{var b;n=void 0,i()||(b=t.onContinue)==null||b.call(t)}),p=()=>{if(i())return;let b;const m=r===0?t.initialPromise:void 0;try{b=m??t.fn()}catch(v){b=Promise.reject(v)}Promise.resolve(b).then(y).catch(v=>{var I;if(i())return;const C=t.retry??(ht?0:3),x=t.retryDelay??Ln,g=typeof x=="function"?x(r,v):x,_=C===!0||typeof C=="number"&&r<C||typeof C=="function"&&C(r,v);if(e||!_){w(v);return}r++,(I=t.onFail)==null||I.call(t,r,v),Pn(g).then(()=>d()?void 0:S()).then(()=>{e?w(v):p()})})};return{promise:s,status:()=>s.status,cancel:o,continue:()=>(n==null||n(),s),cancelRetry:a,continueRetry:h,canStart:l,start:()=>(l()?p():S().then(p),s)}}var dr=(sn=class{constructor(){T(this,Ne)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),On(this.gcTime)&&E(this,Ne,_t.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(ht?1/0:300*1e3))}clearGcTimeout(){u(this,Ne)&&(_t.clearTimeout(u(this,Ne)),E(this,Ne,void 0))}},Ne=new WeakMap,sn),In=(on=class extends dr{constructor(e){super();T(this,ne);T(this,Fe);T(this,Ke);T(this,te);T(this,je);T(this,$);T(this,ut);T(this,De);E(this,De,!1),E(this,ut,e.defaultOptions),this.setOptions(e.options),this.observers=[],E(this,je,e.client),E(this,te,u(this,je).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,E(this,Fe,pr(this.options)),this.state=e.state??u(this,Fe),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=u(this,$))==null?void 0:e.promise}setOptions(e){if(this.options={...u(this,ut),...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=pr(this.options);r.data!==void 0&&(this.setState(hr(r.data,r.dataUpdatedAt)),E(this,Fe,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&u(this,te).remove(this)}setData(e,r){const n=Cn(this.state.data,e,this.options);return B(this,ne,me).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(e,r){B(this,ne,me).call(this,{type:"setState",state:e,setStateOptions:r})}cancel(e){var n,s;const r=(n=u(this,$))==null?void 0:n.promise;return(s=u(this,$))==null||s.cancel(e),r?r.then(Z).catch(Z):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(u(this,Fe))}isActive(){return this.observers.some(e=>xn(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===pt||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Nt(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!vn(this.state.dataUpdatedAt,e)}onFocus(){var r;const e=this.observers.find(n=>n.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(r=u(this,$))==null||r.continue()}onOnline(){var r;const e=this.observers.find(n=>n.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(r=u(this,$))==null||r.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),u(this,te).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(r=>r!==e),this.observers.length||(u(this,$)&&(u(this,De)?u(this,$).cancel({revert:!0}):u(this,$).cancelRetry()),this.scheduleGc()),u(this,te).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||B(this,ne,me).call(this,{type:"invalidate"})}async fetch(e,r){var h,d,l,y,w,S,p,b,m,v,C,x;if(this.state.fetchStatus!=="idle"&&((h=u(this,$))==null?void 0:h.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(u(this,$))return u(this,$).continueRetry(),u(this,$).promise}if(e&&this.setOptions(e),!this.options.queryFn){const g=this.observers.find(_=>_.options.queryFn);g&&this.setOptions(g.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const n=new AbortController,s=g=>{Object.defineProperty(g,"signal",{enumerable:!0,get:()=>(E(this,De,!0),n.signal)})},i=()=>{const g=ur(this.options,r),I=(()=>{const M={client:u(this,je),queryKey:this.queryKey,meta:this.meta};return s(M),M})();return E(this,De,!1),this.options.persister?this.options.persister(g,I,this):g(I)},a=(()=>{const g={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:u(this,je),state:this.state,fetchFn:i};return s(g),g})();(d=this.options.behavior)==null||d.onFetch(a,this),E(this,Ke,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((l=a.fetchOptions)==null?void 0:l.meta))&&B(this,ne,me).call(this,{type:"fetch",meta:(y=a.fetchOptions)==null?void 0:y.meta}),E(this,$,fr({initialPromise:r==null?void 0:r.initialPromise,fn:a.fetchFn,onCancel:g=>{g instanceof kt&&g.revert&&this.setState({...u(this,Ke),fetchStatus:"idle"}),n.abort()},onFail:(g,_)=>{B(this,ne,me).call(this,{type:"failed",failureCount:g,error:_})},onPause:()=>{B(this,ne,me).call(this,{type:"pause"})},onContinue:()=>{B(this,ne,me).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}));try{const g=await u(this,$).start();if(g===void 0)throw process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),new Error(`${this.queryHash} data is undefined`);return this.setData(g),(S=(w=u(this,te).config).onSuccess)==null||S.call(w,g,this),(b=(p=u(this,te).config).onSettled)==null||b.call(p,g,this.state.error,this),g}catch(g){if(g instanceof kt){if(g.silent)return u(this,$).promise;if(g.revert){if(this.state.data===void 0)throw g;return this.state.data}}throw B(this,ne,me).call(this,{type:"error",error:g}),(v=(m=u(this,te).config).onError)==null||v.call(m,g,this),(x=(C=u(this,te).config).onSettled)==null||x.call(C,this.state.data,g,this),g}finally{this.scheduleGc()}}},Fe=new WeakMap,Ke=new WeakMap,te=new WeakMap,je=new WeakMap,$=new WeakMap,ut=new WeakMap,De=new WeakMap,ne=new WeakSet,me=function(e){const r=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Bn(n.data,this.options),fetchMeta:e.meta??null};case"success":const s={...n,...hr(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return E(this,Ke,e.manual?s:void 0),s;case"error":const i=e.error;return{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=r(this.state),Q.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),u(this,te).notify({query:this,type:"updated",action:e})})},on);function Bn(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:lr(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function hr(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function pr(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,r=e!==void 0,n=r?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}function mr(t){return{onFetch:(e,r)=>{var l,y,w,S,p;const n=e.options,s=(w=(y=(l=e.fetchOptions)==null?void 0:l.meta)==null?void 0:y.fetchMore)==null?void 0:w.direction,i=((S=e.state.data)==null?void 0:S.pages)||[],o=((p=e.state.data)==null?void 0:p.pageParams)||[];let a={pages:[],pageParams:[]},h=0;const d=async()=>{let b=!1;const m=x=>{jn(x,()=>e.signal,()=>b=!0)},v=ur(e.options,e.fetchOptions),C=async(x,g,_)=>{if(b)return Promise.reject();if(g==null&&x.pages.length)return Promise.resolve(x);const M=(()=>{const Me={client:e.client,queryKey:e.queryKey,pageParam:g,direction:_?"backward":"forward",meta:e.options.meta};return m(Me),Me})(),k=await v(M),{maxPages:j}=e.options,Ue=_?Nn:_n;return{pages:Ue(x.pages,k,j),pageParams:Ue(x.pageParams,g,j)}};if(s&&i.length){const x=s==="backward",g=x?Hn:yr,_={pages:i,pageParams:o},I=g(n,_);a=await C(_,I,x)}else{const x=t??i.length;do{const g=h===0?o[0]??n.initialPageParam:yr(n,a);if(h>0&&g==null)break;a=await C(a,g),h++}while(h<x)}return a};e.options.persister?e.fetchFn=()=>{var b,m;return(m=(b=e.options).persister)==null?void 0:m.call(b,d,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},r)}:e.fetchFn=d}}}function yr(t,{pages:e,pageParams:r}){const n=e.length-1;return e.length>0?t.getNextPageParam(e[n],e,r[n],r):void 0}function Hn(t,{pages:e,pageParams:r}){var n;return e.length>0?(n=t.getPreviousPageParam)==null?void 0:n.call(t,e[0],e,r[0],r):void 0}var $n=(an=class extends dr{constructor(e){super();T(this,ue);T(this,ct);T(this,ae);T(this,W);T(this,ke);E(this,ct,e.client),this.mutationId=e.mutationId,E(this,W,e.mutationCache),E(this,ae,[]),this.state=e.state||br(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){u(this,ae).includes(e)||(u(this,ae).push(e),this.clearGcTimeout(),u(this,W).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){E(this,ae,u(this,ae).filter(r=>r!==e)),this.scheduleGc(),u(this,W).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){u(this,ae).length||(this.state.status==="pending"?this.scheduleGc():u(this,W).remove(this))}continue(){var e;return((e=u(this,ke))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var o,a,h,d,l,y,w,S,p,b,m,v,C,x,g,_,I,M;const r=()=>{B(this,ue,ve).call(this,{type:"continue"})},n={client:u(this,ct),meta:this.options.meta,mutationKey:this.options.mutationKey};E(this,ke,fr({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(k,j)=>{B(this,ue,ve).call(this,{type:"failed",failureCount:k,error:j})},onPause:()=>{B(this,ue,ve).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>u(this,W).canRun(this)}));const s=this.state.status==="pending",i=!u(this,ke).canStart();try{if(s)r();else{B(this,ue,ve).call(this,{type:"pending",variables:e,isPaused:i}),u(this,W).config.onMutate&&await u(this,W).config.onMutate(e,this,n);const j=await((a=(o=this.options).onMutate)==null?void 0:a.call(o,e,n));j!==this.state.context&&B(this,ue,ve).call(this,{type:"pending",context:j,variables:e,isPaused:i})}const k=await u(this,ke).start();return await((d=(h=u(this,W).config).onSuccess)==null?void 0:d.call(h,k,e,this.state.context,this,n)),await((y=(l=this.options).onSuccess)==null?void 0:y.call(l,k,e,this.state.context,n)),await((S=(w=u(this,W).config).onSettled)==null?void 0:S.call(w,k,null,this.state.variables,this.state.context,this,n)),await((b=(p=this.options).onSettled)==null?void 0:b.call(p,k,null,e,this.state.context,n)),B(this,ue,ve).call(this,{type:"success",data:k}),k}catch(k){try{await((v=(m=u(this,W).config).onError)==null?void 0:v.call(m,k,e,this.state.context,this,n))}catch(j){Promise.reject(j)}try{await((x=(C=this.options).onError)==null?void 0:x.call(C,k,e,this.state.context,n))}catch(j){Promise.reject(j)}try{await((_=(g=u(this,W).config).onSettled)==null?void 0:_.call(g,void 0,k,this.state.variables,this.state.context,this,n))}catch(j){Promise.reject(j)}try{await((M=(I=this.options).onSettled)==null?void 0:M.call(I,void 0,k,e,this.state.context,n))}catch(j){Promise.reject(j)}throw B(this,ue,ve).call(this,{type:"error",error:k}),k}finally{u(this,W).runNext(this)}}},ct=new WeakMap,ae=new WeakMap,W=new WeakMap,ke=new WeakMap,ue=new WeakSet,ve=function(e){const r=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=r(this.state),Q.batch(()=>{u(this,ae).forEach(n=>{n.onMutationUpdate(e)}),u(this,W).notify({mutation:this,type:"updated",action:e})})},an);function br(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Qn=(un=class extends et{constructor(e={}){super();T(this,le);T(this,se);T(this,lt);this.config=e,E(this,le,new Set),E(this,se,new Map),E(this,lt,0)}build(e,r,n){const s=new $n({client:e,mutationCache:this,mutationId:++Pt(this,lt)._,options:e.defaultMutationOptions(r),state:n});return this.add(s),s}add(e){u(this,le).add(e);const r=yt(e);if(typeof r=="string"){const n=u(this,se).get(r);n?n.push(e):u(this,se).set(r,[e])}this.notify({type:"added",mutation:e})}remove(e){if(u(this,le).delete(e)){const r=yt(e);if(typeof r=="string"){const n=u(this,se).get(r);if(n)if(n.length>1){const s=n.indexOf(e);s!==-1&&n.splice(s,1)}else n[0]===e&&u(this,se).delete(r)}}this.notify({type:"removed",mutation:e})}canRun(e){const r=yt(e);if(typeof r=="string"){const n=u(this,se).get(r),s=n==null?void 0:n.find(i=>i.state.status==="pending");return!s||s===e}else return!0}runNext(e){var n;const r=yt(e);if(typeof r=="string"){const s=(n=u(this,se).get(r))==null?void 0:n.find(i=>i!==e&&i.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Q.batch(()=>{u(this,le).forEach(e=>{this.notify({type:"removed",mutation:e})}),u(this,le).clear(),u(this,se).clear()})}getAll(){return Array.from(u(this,le))}find(e){const r={exact:!0,...e};return this.getAll().find(n=>ir(r,n))}findAll(e={}){return this.getAll().filter(r=>ir(e,r))}notify(e){Q.batch(()=>{this.listeners.forEach(r=>{r(e)})})}resumePausedMutations(){const e=this.getAll().filter(r=>r.state.isPaused);return Q.batch(()=>Promise.all(e.map(r=>r.continue().catch(Z))))}},le=new WeakMap,se=new WeakMap,lt=new WeakMap,un);function yt(t){var e;return(e=t.options.scope)==null?void 0:e.id}var Kn=(cn=class extends et{constructor(e,r){super();T(this,he);T(this,fe);T(this,ge);T(this,Y);T(this,de);E(this,fe,e),this.setOptions(r),this.bindMethods(),B(this,he,Ct).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){var n;const r=this.options;this.options=u(this,fe).defaultMutationOptions(e),An(this.options,r)||u(this,fe).getMutationCache().notify({type:"observerOptionsUpdated",mutation:u(this,Y),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&xe(r.mutationKey)!==xe(this.options.mutationKey)?this.reset():((n=u(this,Y))==null?void 0:n.state.status)==="pending"&&u(this,Y).setOptions(this.options)}onUnsubscribe(){var e;this.hasListeners()||(e=u(this,Y))==null||e.removeObserver(this)}onMutationUpdate(e){B(this,he,Ct).call(this),B(this,he,er).call(this,e)}getCurrentResult(){return u(this,ge)}reset(){var e;(e=u(this,Y))==null||e.removeObserver(this),E(this,Y,void 0),B(this,he,Ct).call(this),B(this,he,er).call(this)}mutate(e,r){var n;return E(this,de,r),(n=u(this,Y))==null||n.removeObserver(this),E(this,Y,u(this,fe).getMutationCache().build(u(this,fe),this.options)),u(this,Y).addObserver(this),u(this,Y).execute(e)}},fe=new WeakMap,ge=new WeakMap,Y=new WeakMap,de=new WeakMap,he=new WeakSet,Ct=function(){var r;const e=((r=u(this,Y))==null?void 0:r.state)??br();E(this,ge,{...e,isPending:e.status==="pending",isSuccess:e.status==="success",isError:e.status==="error",isIdle:e.status==="idle",mutate:this.mutate,reset:this.reset})},er=function(e){Q.batch(()=>{var r,n,s,i,o,a,h,d;if(u(this,de)&&this.hasListeners()){const l=u(this,ge).variables,y=u(this,ge).context,w={client:u(this,fe),meta:this.options.meta,mutationKey:this.options.mutationKey};if((e==null?void 0:e.type)==="success"){try{(n=(r=u(this,de)).onSuccess)==null||n.call(r,e.data,l,y,w)}catch(S){Promise.reject(S)}try{(i=(s=u(this,de)).onSettled)==null||i.call(s,e.data,null,l,y,w)}catch(S){Promise.reject(S)}}else if((e==null?void 0:e.type)==="error"){try{(a=(o=u(this,de)).onError)==null||a.call(o,e.error,l,y,w)}catch(S){Promise.reject(S)}try{(d=(h=u(this,de)).onSettled)==null||d.call(h,void 0,e.error,l,y,w)}catch(S){Promise.reject(S)}}}this.listeners.forEach(l=>{l(u(this,ge))})})},cn),Vn=(ln=class extends et{constructor(e={}){super();T(this,ce);this.config=e,E(this,ce,new Map)}build(e,r,n){const s=r.queryKey,i=r.queryHash??Ft(s,r);let o=this.get(i);return o||(o=new In({client:e,queryKey:s,queryHash:i,options:e.defaultQueryOptions(r),state:n,defaultOptions:e.getQueryDefaults(s)}),this.add(o)),o}add(e){u(this,ce).has(e.queryHash)||(u(this,ce).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const r=u(this,ce).get(e.queryHash);r&&(e.destroy(),r===e&&u(this,ce).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Q.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return u(this,ce).get(e)}getAll(){return[...u(this,ce).values()]}find(e){const r={exact:!0,...e};return this.getAll().find(n=>sr(r,n))}findAll(e={}){const r=this.getAll();return Object.keys(e).length>0?r.filter(n=>sr(e,n)):r}notify(e){Q.batch(()=>{this.listeners.forEach(r=>{r(e)})})}onFocus(){Q.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Q.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},ce=new WeakMap,ln),zn=(fn=class{constructor(t={}){T(this,U);T(this,we);T(this,Ee);T(this,Ve);T(this,ze);T(this,Re);T(this,We);T(this,Je);E(this,U,t.queryCache||new Vn),E(this,we,t.mutationCache||new Qn),E(this,Ee,t.defaultOptions||{}),E(this,Ve,new Map),E(this,ze,new Map),E(this,Re,0)}mount(){Pt(this,Re)._++,u(this,Re)===1&&(E(this,We,cr.subscribe(async t=>{t&&(await this.resumePausedMutations(),u(this,U).onFocus())})),E(this,Je,mt.subscribe(async t=>{t&&(await this.resumePausedMutations(),u(this,U).onOnline())})))}unmount(){var t,e;Pt(this,Re)._--,u(this,Re)===0&&((t=u(this,We))==null||t.call(this),E(this,We,void 0),(e=u(this,Je))==null||e.call(this),E(this,Je,void 0))}isFetching(t){return u(this,U).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return u(this,we).findAll({...t,status:"pending"}).length}getQueryData(t){var r;const e=this.defaultQueryOptions({queryKey:t});return(r=u(this,U).get(e.queryHash))==null?void 0:r.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),r=u(this,U).build(this,e),n=r.state.data;return n===void 0?this.fetchQuery(t):(t.revalidateIfStale&&r.isStaleByTime(Nt(e.staleTime,r))&&this.prefetchQuery(e),Promise.resolve(n))}getQueriesData(t){return u(this,U).findAll(t).map(({queryKey:e,state:r})=>{const n=r.data;return[e,n]})}setQueryData(t,e,r){const n=this.defaultQueryOptions({queryKey:t}),s=u(this,U).get(n.queryHash),i=s==null?void 0:s.state.data,o=Sn(e,i);if(o!==void 0)return u(this,U).build(this,n).setData(o,{...r,manual:!0})}setQueriesData(t,e,r){return Q.batch(()=>u(this,U).findAll(t).map(({queryKey:n})=>[n,this.setQueryData(n,e,r)]))}getQueryState(t){var r;const e=this.defaultQueryOptions({queryKey:t});return(r=u(this,U).get(e.queryHash))==null?void 0:r.state}removeQueries(t){const e=u(this,U);Q.batch(()=>{e.findAll(t).forEach(r=>{e.remove(r)})})}resetQueries(t,e){const r=u(this,U);return Q.batch(()=>(r.findAll(t).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const r={revert:!0,...e},n=Q.batch(()=>u(this,U).findAll(t).map(s=>s.cancel(r)));return Promise.all(n).then(Z).catch(Z)}invalidateQueries(t,e={}){return Q.batch(()=>(u(this,U).findAll(t).forEach(r=>{r.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},e)))}refetchQueries(t,e={}){const r={...e,cancelRefetch:e.cancelRefetch??!0},n=Q.batch(()=>u(this,U).findAll(t).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,r);return r.throwOnError||(i=i.catch(Z)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(n).then(Z)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const r=u(this,U).build(this,e);return r.isStaleByTime(Nt(e.staleTime,r))?r.fetch(e):Promise.resolve(r.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Z).catch(Z)}fetchInfiniteQuery(t){return t.behavior=mr(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Z).catch(Z)}ensureInfiniteQueryData(t){return t.behavior=mr(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return mt.isOnline()?u(this,we).resumePausedMutations():Promise.resolve()}getQueryCache(){return u(this,U)}getMutationCache(){return u(this,we)}getDefaultOptions(){return u(this,Ee)}setDefaultOptions(t){E(this,Ee,t)}setQueryDefaults(t,e){u(this,Ve).set(xe(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...u(this,Ve).values()],r={};return e.forEach(n=>{tt(t,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(t,e){u(this,ze).set(xe(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...u(this,ze).values()],r={};return e.forEach(n=>{tt(t,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(t){if(t._defaulted)return t;const e={...u(this,Ee).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=Ft(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===pt&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...u(this,Ee).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){u(this,U).clear(),u(this,we).clear()}},U=new WeakMap,we=new WeakMap,Ee=new WeakMap,Ve=new WeakMap,ze=new WeakMap,Re=new WeakMap,We=new WeakMap,Je=new WeakMap,fn),gr=X.createContext(void 0),Wn=t=>{const e=X.useContext(gr);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},Jn=({client:t,children:e})=>(X.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),F.jsx(gr.Provider,{value:t,children:e}));function Gn(t,e){const r=Wn(),[n]=X.useState(()=>new Kn(r,t));X.useEffect(()=>{n.setOptions(t)},[n,t]);const s=X.useSyncExternalStore(X.useCallback(o=>n.subscribe(Q.batchCalls(o)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),i=X.useCallback((o,a)=>{n.mutate(o,a).catch(Z)},[n]);if(s.error&&Fn(n.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:i,mutateAsync:s.mutate}}function Yn({messages:t,onSendMessage:e,isSending:r,className:n,style:s}){const[i,o]=P.useState(""),a=h=>{h.preventDefault(),i.trim()&&!r&&(e(i),o(""))};return F.jsxs("div",{className:`fixed bottom-4 right-4 w-96 h-[500px] flex flex-col bg-white border border-gray-200 rounded-lg shadow-xl overflow-hidden font-sans ${n||""}`,style:s,children:[F.jsxs("div",{className:"bg-slate-800 text-white p-4 flex justify-between items-center",children:[F.jsx("h3",{className:"font-semibold text-lg",children:"ChatWillow"}),F.jsx("span",{className:"text-xs text-slate-300",children:"Online"})]}),F.jsxs("div",{className:"flex-1 p-4 overflow-y-auto bg-gray-50 flex flex-col gap-3",children:[t.length===0&&F.jsx("div",{className:"text-center text-gray-400 my-auto text-sm",children:"Start a conversation..."}),t.map(h=>F.jsx("div",{className:`flex ${h.role==="user"?"justify-end":"justify-start"}`,children:F.jsx("div",{className:`max-w-[80%] p-3 rounded-lg text-sm ${h.role==="user"?"bg-slate-800 text-white rounded-br-none":"bg-white text-gray-800 border border-gray-200 rounded-bl-none shadow-sm"}`,children:h.content})},h.id)),r&&F.jsx("div",{className:"flex justify-start",children:F.jsx("div",{className:"bg-white text-gray-800 border border-gray-200 p-3 rounded-lg rounded-bl-none shadow-sm",children:F.jsxs("span",{className:"flex gap-1",children:[F.jsx("span",{className:"w-1.5 h-1.5 bg-gray-400 rounded-full animate-bounce"}),F.jsx("span",{className:"w-1.5 h-1.5 bg-gray-400 rounded-full animate-bounce delay-75"}),F.jsx("span",{className:"w-1.5 h-1.5 bg-gray-400 rounded-full animate-bounce delay-150"})]})})})]}),F.jsx("form",{onSubmit:a,className:"p-3 bg-white border-t border-gray-100",children:F.jsxs("div",{className:"flex gap-2",children:[F.jsx("input",{type:"text",value:i,onChange:h=>o(h.target.value),disabled:r,placeholder:"Type your message...",className:"flex-1 px-4 py-2 bg-gray-100 border-0 rounded-full focus:ring-2 focus:ring-slate-800 focus:outline-none transition-all text-sm disabled:opacity-50"}),F.jsx("button",{type:"submit",disabled:!i.trim()||r,className:"p-2 bg-slate-800 text-white rounded-full hover:bg-slate-700 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:F.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor",className:"w-5 h-5",children:F.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 12L3.269 3.126A59.768 59.768 0 0121.485 12 59.77 59.77 0 013.27 20.876L5.999 12zm0 0h7.5"})})})]})})]})}function wr(t,e){return function(){return t.apply(e,arguments)}}const{toString:Xn}=Object.prototype,{getPrototypeOf:Ut}=Object,{iterator:bt,toStringTag:Er}=Symbol,gt=(t=>e=>{const r=Xn.call(e);return t[r]||(t[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),re=t=>(t=t.toLowerCase(),e=>gt(e)===t),wt=t=>e=>typeof e===t,{isArray:Ie}=Array,Be=wt("undefined");function rt(t){return t!==null&&!Be(t)&&t.constructor!==null&&!Be(t.constructor)&&J(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const Rr=re("ArrayBuffer");function Zn(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&Rr(t.buffer),e}const es=wt("string"),J=wt("function"),Sr=wt("number"),nt=t=>t!==null&&typeof t=="object",ts=t=>t===!0||t===!1,Et=t=>{if(gt(t)!=="object")return!1;const e=Ut(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Er in t)&&!(bt in t)},rs=t=>{if(!nt(t)||rt(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},ns=re("Date"),ss=re("File"),is=re("Blob"),os=re("FileList"),as=t=>nt(t)&&J(t.pipe),us=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||J(t.append)&&((e=gt(t))==="formdata"||e==="object"&&J(t.toString)&&t.toString()==="[object FormData]"))},cs=re("URLSearchParams"),[ls,fs,ds,hs]=["ReadableStream","Request","Response","Headers"].map(re),ps=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function st(t,e,{allOwnKeys:r=!1}={}){if(t===null||typeof t>"u")return;let n,s;if(typeof t!="object"&&(t=[t]),Ie(t))for(n=0,s=t.length;n<s;n++)e.call(null,t[n],n,t);else{if(rt(t))return;const i=r?Object.getOwnPropertyNames(t):Object.keys(t),o=i.length;let a;for(n=0;n<o;n++)a=i[n],e.call(null,t[a],a,t)}}function Or(t,e){if(rt(t))return null;e=e.toLowerCase();const r=Object.keys(t);let n=r.length,s;for(;n-- >0;)if(s=r[n],e===s.toLowerCase())return s;return null}const Te=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,vr=t=>!Be(t)&&t!==Te;function Mt(){const{caseless:t,skipUndefined:e}=vr(this)&&this||{},r={},n=(s,i)=>{if(i==="__proto__"||i==="constructor"||i==="prototype")return;const o=t&&Or(r,i)||i;Et(r[o])&&Et(s)?r[o]=Mt(r[o],s):Et(s)?r[o]=Mt({},s):Ie(s)?r[o]=s.slice():(!e||!Be(s))&&(r[o]=s)};for(let s=0,i=arguments.length;s<i;s++)arguments[s]&&st(arguments[s],n);return r}const ms=(t,e,r,{allOwnKeys:n}={})=>(st(e,(s,i)=>{r&&J(s)?Object.defineProperty(t,i,{value:wr(s,r),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(t,i,{value:s,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:n}),t),ys=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),bs=(t,e,r,n)=>{t.prototype=Object.create(e.prototype,n),Object.defineProperty(t.prototype,"constructor",{value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t,"super",{value:e.prototype}),r&&Object.assign(t.prototype,r)},gs=(t,e,r,n)=>{let s,i,o;const a={};if(e=e||{},t==null)return e;do{for(s=Object.getOwnPropertyNames(t),i=s.length;i-- >0;)o=s[i],(!n||n(o,t,e))&&!a[o]&&(e[o]=t[o],a[o]=!0);t=r!==!1&&Ut(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},ws=(t,e,r)=>{t=String(t),(r===void 0||r>t.length)&&(r=t.length),r-=e.length;const n=t.indexOf(e,r);return n!==-1&&n===r},Es=t=>{if(!t)return null;if(Ie(t))return t;let e=t.length;if(!Sr(e))return null;const r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},Rs=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&Ut(Uint8Array)),Ss=(t,e)=>{const n=(t&&t[bt]).call(t);let s;for(;(s=n.next())&&!s.done;){const i=s.value;e.call(t,i[0],i[1])}},Os=(t,e)=>{let r;const n=[];for(;(r=t.exec(e))!==null;)n.push(r);return n},vs=re("HTMLFormElement"),xs=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,s){return n.toUpperCase()+s}),xr=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),Ts=re("RegExp"),Tr=(t,e)=>{const r=Object.getOwnPropertyDescriptors(t),n={};st(r,(s,i)=>{let o;(o=e(s,i,t))!==!1&&(n[i]=o||s)}),Object.defineProperties(t,n)},As=t=>{Tr(t,(e,r)=>{if(J(t)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=t[r];if(J(n)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},Ps=(t,e)=>{const r={},n=s=>{s.forEach(i=>{r[i]=!0})};return Ie(t)?n(t):n(String(t).split(e)),r},Cs=()=>{},_s=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function Ns(t){return!!(t&&J(t.append)&&t[Er]==="FormData"&&t[bt])}const Fs=t=>{const e=new Array(10),r=(n,s)=>{if(nt(n)){if(e.indexOf(n)>=0)return;if(rt(n))return n;if(!("toJSON"in n)){e[s]=n;const i=Ie(n)?[]:{};return st(n,(o,a)=>{const h=r(o,s+1);!Be(h)&&(i[a]=h)}),e[s]=void 0,i}}return n};return r(t,0)},js=re("AsyncFunction"),Ds=t=>t&&(nt(t)||J(t))&&J(t.then)&&J(t.catch),Ar=((t,e)=>t?setImmediate:e?((r,n)=>(Te.addEventListener("message",({source:s,data:i})=>{s===Te&&i===r&&n.length&&n.shift()()},!1),s=>{n.push(s),Te.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",J(Te.postMessage)),ks=typeof queueMicrotask<"u"?queueMicrotask.bind(Te):typeof process<"u"&&process.nextTick||Ar,c={isArray:Ie,isArrayBuffer:Rr,isBuffer:rt,isFormData:us,isArrayBufferView:Zn,isString:es,isNumber:Sr,isBoolean:ts,isObject:nt,isPlainObject:Et,isEmptyObject:rs,isReadableStream:ls,isRequest:fs,isResponse:ds,isHeaders:hs,isUndefined:Be,isDate:ns,isFile:ss,isBlob:is,isRegExp:Ts,isFunction:J,isStream:as,isURLSearchParams:cs,isTypedArray:Rs,isFileList:os,forEach:st,merge:Mt,extend:ms,trim:ps,stripBOM:ys,inherits:bs,toFlatObject:gs,kindOf:gt,kindOfTest:re,endsWith:ws,toArray:Es,forEachEntry:Ss,matchAll:Os,isHTMLForm:vs,hasOwnProperty:xr,hasOwnProp:xr,reduceDescriptors:Tr,freezeMethods:As,toObjectSet:Ps,toCamelCase:xs,noop:Cs,toFiniteNumber:_s,findKey:Or,global:Te,isContextDefined:vr,isSpecCompliantForm:Ns,toJSONObject:Fs,isAsyncFn:js,isThenable:Ds,setImmediate:Ar,asap:ks,isIterable:t=>t!=null&&J(t[bt])};let R=class pn extends Error{static from(e,r,n,s,i,o){const a=new pn(e.message,r||e.code,n,s,i);return a.cause=e,a.name=e.name,o&&Object.assign(a,o),a}constructor(e,r,n,s,i){super(e),this.name="AxiosError",this.isAxiosError=!0,r&&(this.code=r),n&&(this.config=n),s&&(this.request=s),i&&(this.response=i,this.status=i.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:c.toJSONObject(this.config),code:this.code,status:this.status}}};R.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",R.ERR_BAD_OPTION="ERR_BAD_OPTION",R.ECONNABORTED="ECONNABORTED",R.ETIMEDOUT="ETIMEDOUT",R.ERR_NETWORK="ERR_NETWORK",R.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",R.ERR_DEPRECATED="ERR_DEPRECATED",R.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",R.ERR_BAD_REQUEST="ERR_BAD_REQUEST",R.ERR_CANCELED="ERR_CANCELED",R.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",R.ERR_INVALID_URL="ERR_INVALID_URL";const Us=null;function qt(t){return c.isPlainObject(t)||c.isArray(t)}function Pr(t){return c.endsWith(t,"[]")?t.slice(0,-2):t}function Cr(t,e,r){return t?t.concat(e).map(function(s,i){return s=Pr(s),!r&&i?"["+s+"]":s}).join(r?".":""):e}function Ms(t){return c.isArray(t)&&!t.some(qt)}const qs=c.toFlatObject(c,{},null,function(e){return/^is[A-Z]/.test(e)});function Rt(t,e,r){if(!c.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,r=c.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(b,m){return!c.isUndefined(m[b])});const n=r.metaTokens,s=r.visitor||l,i=r.dots,o=r.indexes,h=(r.Blob||typeof Blob<"u"&&Blob)&&c.isSpecCompliantForm(e);if(!c.isFunction(s))throw new TypeError("visitor must be a function");function d(p){if(p===null)return"";if(c.isDate(p))return p.toISOString();if(c.isBoolean(p))return p.toString();if(!h&&c.isBlob(p))throw new R("Blob is not supported. Use a Buffer instead.");return c.isArrayBuffer(p)||c.isTypedArray(p)?h&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function l(p,b,m){let v=p;if(p&&!m&&typeof p=="object"){if(c.endsWith(b,"{}"))b=n?b:b.slice(0,-2),p=JSON.stringify(p);else if(c.isArray(p)&&Ms(p)||(c.isFileList(p)||c.endsWith(b,"[]"))&&(v=c.toArray(p)))return b=Pr(b),v.forEach(function(x,g){!(c.isUndefined(x)||x===null)&&e.append(o===!0?Cr([b],g,i):o===null?b:b+"[]",d(x))}),!1}return qt(p)?!0:(e.append(Cr(m,b,i),d(p)),!1)}const y=[],w=Object.assign(qs,{defaultVisitor:l,convertValue:d,isVisitable:qt});function S(p,b){if(!c.isUndefined(p)){if(y.indexOf(p)!==-1)throw Error("Circular reference detected in "+b.join("."));y.push(p),c.forEach(p,function(v,C){(!(c.isUndefined(v)||v===null)&&s.call(e,v,c.isString(C)?C.trim():C,b,w))===!0&&S(v,b?b.concat(C):[C])}),y.pop()}}if(!c.isObject(t))throw new TypeError("data must be an object");return S(t),e}function _r(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(n){return e[n]})}function Lt(t,e){this._pairs=[],t&&Rt(t,this,e)}const Nr=Lt.prototype;Nr.append=function(e,r){this._pairs.push([e,r])},Nr.toString=function(e){const r=e?function(n){return e.call(this,n,_r)}:_r;return this._pairs.map(function(s){return r(s[0])+"="+r(s[1])},"").join("&")};function Ls(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Fr(t,e,r){if(!e)return t;const n=r&&r.encode||Ls,s=c.isFunction(r)?{serialize:r}:r,i=s&&s.serialize;let o;if(i?o=i(e,s):o=c.isURLSearchParams(e)?e.toString():new Lt(e,s).toString(n),o){const a=t.indexOf("#");a!==-1&&(t=t.slice(0,a)),t+=(t.indexOf("?")===-1?"?":"&")+o}return t}class jr{constructor(){this.handlers=[]}use(e,r,n){return this.handlers.push({fulfilled:e,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){c.forEach(this.handlers,function(n){n!==null&&e(n)})}}const It={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},Is={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Lt,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Bt=typeof window<"u"&&typeof document<"u",Ht=typeof navigator=="object"&&navigator||void 0,Bs=Bt&&(!Ht||["ReactNative","NativeScript","NS"].indexOf(Ht.product)<0),Hs=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",$s=Bt&&window.location.href||"http://localhost",z={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Bt,hasStandardBrowserEnv:Bs,hasStandardBrowserWebWorkerEnv:Hs,navigator:Ht,origin:$s},Symbol.toStringTag,{value:"Module"})),...Is};function Qs(t,e){return Rt(t,new z.classes.URLSearchParams,{visitor:function(r,n,s,i){return z.isNode&&c.isBuffer(r)?(this.append(n,r.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...e})}function Ks(t){return c.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Vs(t){const e={},r=Object.keys(t);let n;const s=r.length;let i;for(n=0;n<s;n++)i=r[n],e[i]=t[i];return e}function Dr(t){function e(r,n,s,i){let o=r[i++];if(o==="__proto__")return!0;const a=Number.isFinite(+o),h=i>=r.length;return o=!o&&c.isArray(s)?s.length:o,h?(c.hasOwnProp(s,o)?s[o]=[s[o],n]:s[o]=n,!a):((!s[o]||!c.isObject(s[o]))&&(s[o]=[]),e(r,n,s[o],i)&&c.isArray(s[o])&&(s[o]=Vs(s[o])),!a)}if(c.isFormData(t)&&c.isFunction(t.entries)){const r={};return c.forEachEntry(t,(n,s)=>{e(Ks(n),s,r,0)}),r}return null}function zs(t,e,r){if(c.isString(t))try{return(e||JSON.parse)(t),c.trim(t)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(t)}const it={transitional:It,adapter:["xhr","http","fetch"],transformRequest:[function(e,r){const n=r.getContentType()||"",s=n.indexOf("application/json")>-1,i=c.isObject(e);if(i&&c.isHTMLForm(e)&&(e=new FormData(e)),c.isFormData(e))return s?JSON.stringify(Dr(e)):e;if(c.isArrayBuffer(e)||c.isBuffer(e)||c.isStream(e)||c.isFile(e)||c.isBlob(e)||c.isReadableStream(e))return e;if(c.isArrayBufferView(e))return e.buffer;if(c.isURLSearchParams(e))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return Qs(e,this.formSerializer).toString();if((a=c.isFileList(e))||n.indexOf("multipart/form-data")>-1){const h=this.env&&this.env.FormData;return Rt(a?{"files[]":e}:e,h&&new h,this.formSerializer)}}return i||s?(r.setContentType("application/json",!1),zs(e)):e}],transformResponse:[function(e){const r=this.transitional||it.transitional,n=r&&r.forcedJSONParsing,s=this.responseType==="json";if(c.isResponse(e)||c.isReadableStream(e))return e;if(e&&c.isString(e)&&(n&&!this.responseType||s)){const o=!(r&&r.silentJSONParsing)&&s;try{return JSON.parse(e,this.parseReviver)}catch(a){if(o)throw a.name==="SyntaxError"?R.from(a,R.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:z.classes.FormData,Blob:z.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};c.forEach(["delete","get","head","post","put","patch"],t=>{it.headers[t]={}});const Ws=c.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"]),Js=t=>{const e={};let r,n,s;return t&&t.split(`
|
|
23
|
+
`).forEach(function(o){s=o.indexOf(":"),r=o.substring(0,s).trim().toLowerCase(),n=o.substring(s+1).trim(),!(!r||e[r]&&Ws[r])&&(r==="set-cookie"?e[r]?e[r].push(n):e[r]=[n]:e[r]=e[r]?e[r]+", "+n:n)}),e},kr=Symbol("internals");function ot(t){return t&&String(t).trim().toLowerCase()}function St(t){return t===!1||t==null?t:c.isArray(t)?t.map(St):String(t)}function Gs(t){const e=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(t);)e[n[1]]=n[2];return e}const Ys=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function $t(t,e,r,n,s){if(c.isFunction(n))return n.call(this,e,r);if(s&&(e=r),!!c.isString(e)){if(c.isString(n))return e.indexOf(n)!==-1;if(c.isRegExp(n))return n.test(e)}}function Xs(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,r,n)=>r.toUpperCase()+n)}function Zs(t,e){const r=c.toCamelCase(" "+e);["get","set","has"].forEach(n=>{Object.defineProperty(t,n+r,{value:function(s,i,o){return this[n].call(this,e,s,i,o)},configurable:!0})})}let G=class{constructor(e){e&&this.set(e)}set(e,r,n){const s=this;function i(a,h,d){const l=ot(h);if(!l)throw new Error("header name must be a non-empty string");const y=c.findKey(s,l);(!y||s[y]===void 0||d===!0||d===void 0&&s[y]!==!1)&&(s[y||h]=St(a))}const o=(a,h)=>c.forEach(a,(d,l)=>i(d,l,h));if(c.isPlainObject(e)||e instanceof this.constructor)o(e,r);else if(c.isString(e)&&(e=e.trim())&&!Ys(e))o(Js(e),r);else if(c.isObject(e)&&c.isIterable(e)){let a={},h,d;for(const l of e){if(!c.isArray(l))throw TypeError("Object iterator must return a key-value pair");a[d=l[0]]=(h=a[d])?c.isArray(h)?[...h,l[1]]:[h,l[1]]:l[1]}o(a,r)}else e!=null&&i(r,e,n);return this}get(e,r){if(e=ot(e),e){const n=c.findKey(this,e);if(n){const s=this[n];if(!r)return s;if(r===!0)return Gs(s);if(c.isFunction(r))return r.call(this,s,n);if(c.isRegExp(r))return r.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,r){if(e=ot(e),e){const n=c.findKey(this,e);return!!(n&&this[n]!==void 0&&(!r||$t(this,this[n],n,r)))}return!1}delete(e,r){const n=this;let s=!1;function i(o){if(o=ot(o),o){const a=c.findKey(n,o);a&&(!r||$t(n,n[a],a,r))&&(delete n[a],s=!0)}}return c.isArray(e)?e.forEach(i):i(e),s}clear(e){const r=Object.keys(this);let n=r.length,s=!1;for(;n--;){const i=r[n];(!e||$t(this,this[i],i,e,!0))&&(delete this[i],s=!0)}return s}normalize(e){const r=this,n={};return c.forEach(this,(s,i)=>{const o=c.findKey(n,i);if(o){r[o]=St(s),delete r[i];return}const a=e?Xs(i):String(i).trim();a!==i&&delete r[i],r[a]=St(s),n[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const r=Object.create(null);return c.forEach(this,(n,s)=>{n!=null&&n!==!1&&(r[s]=e&&c.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,r])=>e+": "+r).join(`
|
|
24
|
+
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...r){const n=new this(e);return r.forEach(s=>n.set(s)),n}static accessor(e){const n=(this[kr]=this[kr]={accessors:{}}).accessors,s=this.prototype;function i(o){const a=ot(o);n[a]||(Zs(s,o),n[a]=!0)}return c.isArray(e)?e.forEach(i):i(e),this}};G.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),c.reduceDescriptors(G.prototype,({value:t},e)=>{let r=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(n){this[r]=n}}}),c.freezeMethods(G);function Qt(t,e){const r=this||it,n=e||r,s=G.from(n.headers);let i=n.data;return c.forEach(t,function(a){i=a.call(r,i,s.normalize(),e?e.status:void 0)}),s.normalize(),i}function Ur(t){return!!(t&&t.__CANCEL__)}let at=class extends R{constructor(e,r,n){super(e??"canceled",R.ERR_CANCELED,r,n),this.name="CanceledError",this.__CANCEL__=!0}};function Mr(t,e,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?t(r):e(new R("Request failed with status code "+r.status,[R.ERR_BAD_REQUEST,R.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function ei(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function ti(t,e){t=t||10;const r=new Array(t),n=new Array(t);let s=0,i=0,o;return e=e!==void 0?e:1e3,function(h){const d=Date.now(),l=n[i];o||(o=d),r[s]=h,n[s]=d;let y=i,w=0;for(;y!==s;)w+=r[y++],y=y%t;if(s=(s+1)%t,s===i&&(i=(i+1)%t),d-o<e)return;const S=l&&d-l;return S?Math.round(w*1e3/S):void 0}}function ri(t,e){let r=0,n=1e3/e,s,i;const o=(d,l=Date.now())=>{r=l,s=null,i&&(clearTimeout(i),i=null),t(...d)};return[(...d)=>{const l=Date.now(),y=l-r;y>=n?o(d,l):(s=d,i||(i=setTimeout(()=>{i=null,o(s)},n-y)))},()=>s&&o(s)]}const Ot=(t,e,r=3)=>{let n=0;const s=ti(50,250);return ri(i=>{const o=i.loaded,a=i.lengthComputable?i.total:void 0,h=o-n,d=s(h),l=o<=a;n=o;const y={loaded:o,total:a,progress:a?o/a:void 0,bytes:h,rate:d||void 0,estimated:d&&a&&l?(a-o)/d:void 0,event:i,lengthComputable:a!=null,[e?"download":"upload"]:!0};t(y)},r)},qr=(t,e)=>{const r=t!=null;return[n=>e[0]({lengthComputable:r,total:t,loaded:n}),e[1]]},Lr=t=>(...e)=>c.asap(()=>t(...e)),ni=z.hasStandardBrowserEnv?((t,e)=>r=>(r=new URL(r,z.origin),t.protocol===r.protocol&&t.host===r.host&&(e||t.port===r.port)))(new URL(z.origin),z.navigator&&/(msie|trident)/i.test(z.navigator.userAgent)):()=>!0,si=z.hasStandardBrowserEnv?{write(t,e,r,n,s,i,o){if(typeof document>"u")return;const a=[`${t}=${encodeURIComponent(e)}`];c.isNumber(r)&&a.push(`expires=${new Date(r).toUTCString()}`),c.isString(n)&&a.push(`path=${n}`),c.isString(s)&&a.push(`domain=${s}`),i===!0&&a.push("secure"),c.isString(o)&&a.push(`SameSite=${o}`),document.cookie=a.join("; ")},read(t){if(typeof document>"u")return null;const e=document.cookie.match(new RegExp("(?:^|; )"+t+"=([^;]*)"));return e?decodeURIComponent(e[1]):null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function ii(t){return typeof t!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function oi(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function Ir(t,e,r){let n=!ii(e);return t&&(n||r==!1)?oi(t,e):e}const Br=t=>t instanceof G?{...t}:t;function Ae(t,e){e=e||{};const r={};function n(d,l,y,w){return c.isPlainObject(d)&&c.isPlainObject(l)?c.merge.call({caseless:w},d,l):c.isPlainObject(l)?c.merge({},l):c.isArray(l)?l.slice():l}function s(d,l,y,w){if(c.isUndefined(l)){if(!c.isUndefined(d))return n(void 0,d,y,w)}else return n(d,l,y,w)}function i(d,l){if(!c.isUndefined(l))return n(void 0,l)}function o(d,l){if(c.isUndefined(l)){if(!c.isUndefined(d))return n(void 0,d)}else return n(void 0,l)}function a(d,l,y){if(y in e)return n(d,l);if(y in t)return n(void 0,d)}const h={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(d,l,y)=>s(Br(d),Br(l),y,!0)};return c.forEach(Object.keys({...t,...e}),function(l){if(l==="__proto__"||l==="constructor"||l==="prototype")return;const y=c.hasOwnProp(h,l)?h[l]:s,w=y(t[l],e[l],l);c.isUndefined(w)&&y!==a||(r[l]=w)}),r}const Hr=t=>{const e=Ae({},t);let{data:r,withXSRFToken:n,xsrfHeaderName:s,xsrfCookieName:i,headers:o,auth:a}=e;if(e.headers=o=G.from(o),e.url=Fr(Ir(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),c.isFormData(r)){if(z.hasStandardBrowserEnv||z.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(c.isFunction(r.getHeaders)){const h=r.getHeaders(),d=["content-type","content-length"];Object.entries(h).forEach(([l,y])=>{d.includes(l.toLowerCase())&&o.set(l,y)})}}if(z.hasStandardBrowserEnv&&(n&&c.isFunction(n)&&(n=n(e)),n||n!==!1&&ni(e.url))){const h=s&&i&&si.read(i);h&&o.set(s,h)}return e},ai=typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(r,n){const s=Hr(t);let i=s.data;const o=G.from(s.headers).normalize();let{responseType:a,onUploadProgress:h,onDownloadProgress:d}=s,l,y,w,S,p;function b(){S&&S(),p&&p(),s.cancelToken&&s.cancelToken.unsubscribe(l),s.signal&&s.signal.removeEventListener("abort",l)}let m=new XMLHttpRequest;m.open(s.method.toUpperCase(),s.url,!0),m.timeout=s.timeout;function v(){if(!m)return;const x=G.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders()),_={data:!a||a==="text"||a==="json"?m.responseText:m.response,status:m.status,statusText:m.statusText,headers:x,config:t,request:m};Mr(function(M){r(M),b()},function(M){n(M),b()},_),m=null}"onloadend"in m?m.onloadend=v:m.onreadystatechange=function(){!m||m.readyState!==4||m.status===0&&!(m.responseURL&&m.responseURL.indexOf("file:")===0)||setTimeout(v)},m.onabort=function(){m&&(n(new R("Request aborted",R.ECONNABORTED,t,m)),m=null)},m.onerror=function(g){const _=g&&g.message?g.message:"Network Error",I=new R(_,R.ERR_NETWORK,t,m);I.event=g||null,n(I),m=null},m.ontimeout=function(){let g=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const _=s.transitional||It;s.timeoutErrorMessage&&(g=s.timeoutErrorMessage),n(new R(g,_.clarifyTimeoutError?R.ETIMEDOUT:R.ECONNABORTED,t,m)),m=null},i===void 0&&o.setContentType(null),"setRequestHeader"in m&&c.forEach(o.toJSON(),function(g,_){m.setRequestHeader(_,g)}),c.isUndefined(s.withCredentials)||(m.withCredentials=!!s.withCredentials),a&&a!=="json"&&(m.responseType=s.responseType),d&&([w,p]=Ot(d,!0),m.addEventListener("progress",w)),h&&m.upload&&([y,S]=Ot(h),m.upload.addEventListener("progress",y),m.upload.addEventListener("loadend",S)),(s.cancelToken||s.signal)&&(l=x=>{m&&(n(!x||x.type?new at(null,t,m):x),m.abort(),m=null)},s.cancelToken&&s.cancelToken.subscribe(l),s.signal&&(s.signal.aborted?l():s.signal.addEventListener("abort",l)));const C=ei(s.url);if(C&&z.protocols.indexOf(C)===-1){n(new R("Unsupported protocol "+C+":",R.ERR_BAD_REQUEST,t));return}m.send(i||null)})},ui=(t,e)=>{const{length:r}=t=t?t.filter(Boolean):[];if(e||r){let n=new AbortController,s;const i=function(d){if(!s){s=!0,a();const l=d instanceof Error?d:this.reason;n.abort(l instanceof R?l:new at(l instanceof Error?l.message:l))}};let o=e&&setTimeout(()=>{o=null,i(new R(`timeout of ${e}ms exceeded`,R.ETIMEDOUT))},e);const a=()=>{t&&(o&&clearTimeout(o),o=null,t.forEach(d=>{d.unsubscribe?d.unsubscribe(i):d.removeEventListener("abort",i)}),t=null)};t.forEach(d=>d.addEventListener("abort",i));const{signal:h}=n;return h.unsubscribe=()=>c.asap(a),h}},ci=function*(t,e){let r=t.byteLength;if(r<e){yield t;return}let n=0,s;for(;n<r;)s=n+e,yield t.slice(n,s),n=s},li=async function*(t,e){for await(const r of fi(t))yield*ci(r,e)},fi=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:r,value:n}=await e.read();if(r)break;yield n}}finally{await e.cancel()}},$r=(t,e,r,n)=>{const s=li(t,e);let i=0,o,a=h=>{o||(o=!0,n&&n(h))};return new ReadableStream({async pull(h){try{const{done:d,value:l}=await s.next();if(d){a(),h.close();return}let y=l.byteLength;if(r){let w=i+=y;r(w)}h.enqueue(new Uint8Array(l))}catch(d){throw a(d),d}},cancel(h){return a(h),s.return()}},{highWaterMark:2})},Qr=64*1024,{isFunction:vt}=c,di=(({Request:t,Response:e})=>({Request:t,Response:e}))(c.global),{ReadableStream:Kr,TextEncoder:Vr}=c.global,zr=(t,...e)=>{try{return!!t(...e)}catch{return!1}},hi=t=>{t=c.merge.call({skipUndefined:!0},di,t);const{fetch:e,Request:r,Response:n}=t,s=e?vt(e):typeof fetch=="function",i=vt(r),o=vt(n);if(!s)return!1;const a=s&&vt(Kr),h=s&&(typeof Vr=="function"?(p=>b=>p.encode(b))(new Vr):async p=>new Uint8Array(await new r(p).arrayBuffer())),d=i&&a&&zr(()=>{let p=!1;const b=new r(z.origin,{body:new Kr,method:"POST",get duplex(){return p=!0,"half"}}).headers.has("Content-Type");return p&&!b}),l=o&&a&&zr(()=>c.isReadableStream(new n("").body)),y={stream:l&&(p=>p.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(p=>{!y[p]&&(y[p]=(b,m)=>{let v=b&&b[p];if(v)return v.call(b);throw new R(`Response type '${p}' is not supported`,R.ERR_NOT_SUPPORT,m)})});const w=async p=>{if(p==null)return 0;if(c.isBlob(p))return p.size;if(c.isSpecCompliantForm(p))return(await new r(z.origin,{method:"POST",body:p}).arrayBuffer()).byteLength;if(c.isArrayBufferView(p)||c.isArrayBuffer(p))return p.byteLength;if(c.isURLSearchParams(p)&&(p=p+""),c.isString(p))return(await h(p)).byteLength},S=async(p,b)=>{const m=c.toFiniteNumber(p.getContentLength());return m??w(b)};return async p=>{let{url:b,method:m,data:v,signal:C,cancelToken:x,timeout:g,onDownloadProgress:_,onUploadProgress:I,responseType:M,headers:k,withCredentials:j="same-origin",fetchOptions:Ue}=Hr(p),Me=e||fetch;M=M?(M+"").toLowerCase():"text";let Se=ui([C,x&&x.toAbortSignal()],g),Oe=null;const pe=Se&&Se.unsubscribe&&(()=>{Se.unsubscribe()});let Ge;try{if(I&&d&&m!=="get"&&m!=="head"&&(Ge=await S(k,v))!==0){let f=new r(b,{method:"POST",body:v,duplex:"half"}),O;if(c.isFormData(v)&&(O=f.headers.get("content-type"))&&k.setContentType(O),f.body){const[N,D]=qr(Ge,Ot(Lr(I)));v=$r(f.body,Qr,N,D)}}c.isString(j)||(j=j?"include":"omit");const V=i&&"credentials"in r.prototype,ft={...Ue,signal:Se,method:m.toUpperCase(),headers:k.normalize().toJSON(),body:v,duplex:"half",credentials:V?j:void 0};Oe=i&&new r(b,ft);let ie=await(i?Me(Oe,Ue):Me(b,ft));const dt=l&&(M==="stream"||M==="response");if(l&&(_||dt&&pe)){const f={};["status","statusText","headers"].forEach(qe=>{f[qe]=ie[qe]});const O=c.toFiniteNumber(ie.headers.get("content-length")),[N,D]=_&&qr(O,Ot(Lr(_),!0))||[];ie=new n($r(ie.body,Qr,N,()=>{D&&D(),pe&&pe()}),f)}M=M||"text";let At=await y[c.findKey(y,M)||"text"](ie,p);return!dt&&pe&&pe(),await new Promise((f,O)=>{Mr(f,O,{data:At,headers:G.from(ie.headers),status:ie.status,statusText:ie.statusText,config:p,request:Oe})})}catch(V){throw pe&&pe(),V&&V.name==="TypeError"&&/Load failed|fetch/i.test(V.message)?Object.assign(new R("Network Error",R.ERR_NETWORK,p,Oe,V&&V.response),{cause:V.cause||V}):R.from(V,V&&V.code,p,Oe,V&&V.response)}}},pi=new Map,Wr=t=>{let e=t&&t.env||{};const{fetch:r,Request:n,Response:s}=e,i=[n,s,r];let o=i.length,a=o,h,d,l=pi;for(;a--;)h=i[a],d=l.get(h),d===void 0&&l.set(h,d=a?new Map:hi(e)),l=d;return d};Wr();const Kt={http:Us,xhr:ai,fetch:{get:Wr}};c.forEach(Kt,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const Jr=t=>`- ${t}`,mi=t=>c.isFunction(t)||t===null||t===!1;function yi(t,e){t=c.isArray(t)?t:[t];const{length:r}=t;let n,s;const i={};for(let o=0;o<r;o++){n=t[o];let a;if(s=n,!mi(n)&&(s=Kt[(a=String(n)).toLowerCase()],s===void 0))throw new R(`Unknown adapter '${a}'`);if(s&&(c.isFunction(s)||(s=s.get(e))))break;i[a||"#"+o]=s}if(!s){const o=Object.entries(i).map(([h,d])=>`adapter ${h} `+(d===!1?"is not supported by the environment":"is not available in the build"));let a=r?o.length>1?`since :
|
|
25
|
+
`+o.map(Jr).join(`
|
|
26
|
+
`):" "+Jr(o[0]):"as no adapter specified";throw new R("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return s}const Gr={getAdapter:yi,adapters:Kt};function Vt(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new at(null,t)}function Yr(t){return Vt(t),t.headers=G.from(t.headers),t.data=Qt.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Gr.getAdapter(t.adapter||it.adapter,t)(t).then(function(n){return Vt(t),n.data=Qt.call(t,t.transformResponse,n),n.headers=G.from(n.headers),n},function(n){return Ur(n)||(Vt(t),n&&n.response&&(n.response.data=Qt.call(t,t.transformResponse,n.response),n.response.headers=G.from(n.response.headers))),Promise.reject(n)})}const Xr="1.13.5",xt={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{xt[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}});const Zr={};xt.transitional=function(e,r,n){function s(i,o){return"[Axios v"+Xr+"] Transitional option '"+i+"'"+o+(n?". "+n:"")}return(i,o,a)=>{if(e===!1)throw new R(s(o," has been removed"+(r?" in "+r:"")),R.ERR_DEPRECATED);return r&&!Zr[o]&&(Zr[o]=!0,console.warn(s(o," has been deprecated since v"+r+" and will be removed in the near future"))),e?e(i,o,a):!0}},xt.spelling=function(e){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};function bi(t,e,r){if(typeof t!="object")throw new R("options must be an object",R.ERR_BAD_OPTION_VALUE);const n=Object.keys(t);let s=n.length;for(;s-- >0;){const i=n[s],o=e[i];if(o){const a=t[i],h=a===void 0||o(a,i,t);if(h!==!0)throw new R("option "+i+" must be "+h,R.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new R("Unknown option "+i,R.ERR_BAD_OPTION)}}const Tt={assertOptions:bi,validators:xt},ee=Tt.validators;let Pe=class{constructor(e){this.defaults=e||{},this.interceptors={request:new jr,response:new jr}}async request(e,r){try{return await this._request(e,r)}catch(n){if(n instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const i=s.stack?s.stack.replace(/^.+\n/,""):"";try{n.stack?i&&!String(n.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(n.stack+=`
|
|
27
|
+
`+i):n.stack=i}catch{}}throw n}}_request(e,r){typeof e=="string"?(r=r||{},r.url=e):r=e||{},r=Ae(this.defaults,r);const{transitional:n,paramsSerializer:s,headers:i}=r;n!==void 0&&Tt.assertOptions(n,{silentJSONParsing:ee.transitional(ee.boolean),forcedJSONParsing:ee.transitional(ee.boolean),clarifyTimeoutError:ee.transitional(ee.boolean),legacyInterceptorReqResOrdering:ee.transitional(ee.boolean)},!1),s!=null&&(c.isFunction(s)?r.paramsSerializer={serialize:s}:Tt.assertOptions(s,{encode:ee.function,serialize:ee.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Tt.assertOptions(r,{baseUrl:ee.spelling("baseURL"),withXsrfToken:ee.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let o=i&&c.merge(i.common,i[r.method]);i&&c.forEach(["delete","get","head","post","put","patch","common"],p=>{delete i[p]}),r.headers=G.concat(o,i);const a=[];let h=!0;this.interceptors.request.forEach(function(b){if(typeof b.runWhen=="function"&&b.runWhen(r)===!1)return;h=h&&b.synchronous;const m=r.transitional||It;m&&m.legacyInterceptorReqResOrdering?a.unshift(b.fulfilled,b.rejected):a.push(b.fulfilled,b.rejected)});const d=[];this.interceptors.response.forEach(function(b){d.push(b.fulfilled,b.rejected)});let l,y=0,w;if(!h){const p=[Yr.bind(this),void 0];for(p.unshift(...a),p.push(...d),w=p.length,l=Promise.resolve(r);y<w;)l=l.then(p[y++],p[y++]);return l}w=a.length;let S=r;for(;y<w;){const p=a[y++],b=a[y++];try{S=p(S)}catch(m){b.call(this,m);break}}try{l=Yr.call(this,S)}catch(p){return Promise.reject(p)}for(y=0,w=d.length;y<w;)l=l.then(d[y++],d[y++]);return l}getUri(e){e=Ae(this.defaults,e);const r=Ir(e.baseURL,e.url,e.allowAbsoluteUrls);return Fr(r,e.params,e.paramsSerializer)}};c.forEach(["delete","get","head","options"],function(e){Pe.prototype[e]=function(r,n){return this.request(Ae(n||{},{method:e,url:r,data:(n||{}).data}))}}),c.forEach(["post","put","patch"],function(e){function r(n){return function(i,o,a){return this.request(Ae(a||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}Pe.prototype[e]=r(),Pe.prototype[e+"Form"]=r(!0)});let gi=class mn{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(i){r=i});const n=this;this.promise.then(s=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](s);n._listeners=null}),this.promise.then=s=>{let i;const o=new Promise(a=>{n.subscribe(a),i=a}).then(s);return o.cancel=function(){n.unsubscribe(i)},o},e(function(i,o,a){n.reason||(n.reason=new at(i,o,a),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const r=this._listeners.indexOf(e);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const e=new AbortController,r=n=>{e.abort(n)};return this.subscribe(r),e.signal.unsubscribe=()=>this.unsubscribe(r),e.signal}static source(){let e;return{token:new mn(function(s){e=s}),cancel:e}}};function wi(t){return function(r){return t.apply(null,r)}}function Ei(t){return c.isObject(t)&&t.isAxiosError===!0}const zt={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(zt).forEach(([t,e])=>{zt[e]=t});function en(t){const e=new Pe(t),r=wr(Pe.prototype.request,e);return c.extend(r,Pe.prototype,e,{allOwnKeys:!0}),c.extend(r,e,null,{allOwnKeys:!0}),r.create=function(s){return en(Ae(t,s))},r}const L=en(it);L.Axios=Pe,L.CanceledError=at,L.CancelToken=gi,L.isCancel=Ur,L.VERSION=Xr,L.toFormData=Rt,L.AxiosError=R,L.Cancel=L.CanceledError,L.all=function(e){return Promise.all(e)},L.spread=wi,L.isAxiosError=Ei,L.mergeConfig=Ae,L.AxiosHeaders=G,L.formToJSON=t=>Dr(c.isHTMLForm(t)?new FormData(t):t),L.getAdapter=Gr.getAdapter,L.HttpStatusCode=zt,L.default=L;const{Axios:Bi,AxiosError:Hi,CanceledError:$i,isCancel:Qi,CancelToken:Ki,VERSION:Vi,all:zi,Cancel:Wi,isAxiosError:Ji,spread:Gi,toFormData:Yi,AxiosHeaders:Xi,HttpStatusCode:Zi,formToJSON:eo,getAdapter:to,mergeConfig:ro}=L;class Ri{constructor(){hn(this,"baseUrl","http://localhost:9999")}async sendMessage(e){return(await L.post(`${this.baseUrl}/chat-module/send-message`,{message:e})).data}}const Si=new Ri;function Oi(){return Gn({mutationFn:t=>Si.sendMessage(t)})}const K=[];for(let t=0;t<256;++t)K.push((t+256).toString(16).slice(1));function vi(t,e=0){return(K[t[e+0]]+K[t[e+1]]+K[t[e+2]]+K[t[e+3]]+"-"+K[t[e+4]]+K[t[e+5]]+"-"+K[t[e+6]]+K[t[e+7]]+"-"+K[t[e+8]]+K[t[e+9]]+"-"+K[t[e+10]]+K[t[e+11]]+K[t[e+12]]+K[t[e+13]]+K[t[e+14]]+K[t[e+15]]).toLowerCase()}let Wt;const xi=new Uint8Array(16);function Ti(){if(!Wt){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Wt=crypto.getRandomValues.bind(crypto)}return Wt(xi)}const Jt={};function Gt(t,e,r){let n;{const s=Date.now(),i=Ti();Ai(Jt,s,i),n=Pi(i,Jt.msecs,Jt.seq,e,r)}return vi(n)}function Ai(t,e,r){return t.msecs??(t.msecs=-1/0),t.seq??(t.seq=0),e>t.msecs?(t.seq=r[6]<<23|r[7]<<16|r[8]<<8|r[9],t.msecs=e):(t.seq=t.seq+1|0,t.seq===0&&t.msecs++),t}function Pi(t,e,r,n,s=0){if(t.length<16)throw new Error("Random bytes length must be >= 16");if(!n)n=new Uint8Array(16),s=0;else if(s<0||s+16>n.length)throw new RangeError(`UUID byte range ${s}:${s+15} is out of buffer bounds`);return e??(e=Date.now()),r??(r=t[6]*127<<24|t[7]<<16|t[8]<<8|t[9]),n[s++]=e/1099511627776&255,n[s++]=e/4294967296&255,n[s++]=e/16777216&255,n[s++]=e/65536&255,n[s++]=e/256&255,n[s++]=e&255,n[s++]=112|r>>>28&15,n[s++]=r>>>20&255,n[s++]=128|r>>>14&63,n[s++]=r>>>6&255,n[s++]=r<<2&255|t[10]&3,n[s++]=t[11],n[s++]=t[12],n[s++]=t[13],n[s++]=t[14],n[s++]=t[15],n}function Ci({className:t,style:e}){const[r,n]=P.useState([{id:"1",role:"assistant",content:"Hi there! I'm ChatWillow. How can I help you today?",timestamp:new Date}]),{mutate:s,isPending:i}=Oi(),o=a=>{const h={id:Gt(),role:"user",content:a,timestamp:new Date};n(d=>[...d,h]),s(a,{onSuccess:d=>{const l=typeof d.data=="string"?d.data:d.message||"Error parsing response",y={id:Gt(),role:"assistant",content:l,timestamp:new Date};n(w=>[...w,y])},onError:d=>{const l={id:Gt(),role:"assistant",content:"Sorry, something went wrong. Please try again.",timestamp:new Date};n(y=>[...y,l]),console.error("Failed to send message:",d)}})};return F.jsx(Yn,{messages:r,onSendMessage:o,isSending:i,className:t,style:e})}const _i=new zn({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1}}});function Ni(t){return F.jsx(Jn,{client:_i,children:F.jsx(Ci,{...t})})}A.ChatWillowWidget=Ni,Object.defineProperty(A,Symbol.toStringTag,{value:"Module"})}));
|