@opencx/widget 3.0.12 → 3.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/dist/designs.cjs +59 -59
  2. package/dist/designs.cjs.map +1 -1
  3. package/dist/designs.js +8192 -8082
  4. package/dist/designs.js.map +1 -1
  5. package/dist/index.cjs +1 -1
  6. package/dist/index.js +1 -1
  7. package/dist/react.cjs +1 -1
  8. package/dist/react.js +2 -2
  9. package/dist/src/designs/react/components/lib/button.d.ts +1 -1
  10. package/dist/src/designs/react/components/lib/loading.d.ts +4 -0
  11. package/dist/src/designs/react/screens/sessions/index.d.ts +2 -0
  12. package/dist/src/headless/core/context/session.ctx.d.ts +3 -1
  13. package/dist/src/headless/core/sdk/schema.d.ts +2 -0
  14. package/dist/src/headless/react/hooks/useSession.d.ts +2 -1
  15. package/dist/{useUploadFiles-CgV45e1z.cjs → useUploadFiles-CiUgziil.cjs} +2 -2
  16. package/dist/{useUploadFiles-CgV45e1z.cjs.map → useUploadFiles-CiUgziil.cjs.map} +1 -1
  17. package/dist/{useUploadFiles-BQkTgy3Z.js → useUploadFiles-ClUXwfKK.js} +3 -3
  18. package/dist/{useUploadFiles-BQkTgy3Z.js.map → useUploadFiles-ClUXwfKK.js.map} +1 -1
  19. package/dist/widget.ctx-C7UzbSii.cjs +2 -0
  20. package/dist/widget.ctx-C7UzbSii.cjs.map +1 -0
  21. package/dist/{widget.ctx-CKrjZfxE.js → widget.ctx-DkDwIMJZ.js} +16 -12
  22. package/dist/widget.ctx-DkDwIMJZ.js.map +1 -0
  23. package/dist-embed/script.js +112 -102
  24. package/dist-embed/script.js.map +1 -1
  25. package/package.json +1 -1
  26. package/dist/src/designs/react/components/lib/dialog.d.ts +0 -276
  27. package/dist/widget.ctx-BFXSWWWZ.cjs +0 -2
  28. package/dist/widget.ctx-BFXSWWWZ.cjs.map +0 -1
  29. package/dist/widget.ctx-CKrjZfxE.js.map +0 -1
package/dist/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./widget.ctx-BFXSWWWZ.cjs");exports.PrimitiveState=t.PrimitiveState;exports.WidgetCtx=t.WidgetCtx;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./widget.ctx-C7UzbSii.cjs");exports.PrimitiveState=t.PrimitiveState;exports.WidgetCtx=t.WidgetCtx;
2
2
  //# sourceMappingURL=index.cjs.map
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { P as i, W as a } from "./widget.ctx-CKrjZfxE.js";
1
+ import { P as i, W as a } from "./widget.ctx-DkDwIMJZ.js";
2
2
  export {
3
3
  i as PrimitiveState,
4
4
  a as WidgetCtx
package/dist/react.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./useUploadFiles-CgV45e1z.cjs");function a(t,s,u){const{widgetCtx:{api:i}}=e.useWidget();return e._default(async o=>o==="up"?i.vote({action:"upvote",messagePublicId:t,sessionId:s}).then(u):i.vote({action:"downvote",messagePublicId:t,sessionId:s}).then(u),[i,t,s,u])}exports.WidgetProvider=e.WidgetProvider;exports.useConfig=e.useConfig;exports.useContact=e.useContact;exports.useIsAwaitingBotReply=e.useIsAwaitingBotReply;exports.useMessages=e.useMessages;exports.usePreludeData=e.usePreludeData;exports.usePrimitiveState=e.usePrimitiveState;exports.useSession=e.useSession;exports.useUploadFiles=e.useUploadFiles;exports.useWidget=e.useWidget;exports.useVote=a;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./useUploadFiles-CiUgziil.cjs");function a(t,s,u){const{widgetCtx:{api:i}}=e.useWidget();return e._default(async o=>o==="up"?i.vote({action:"upvote",messagePublicId:t,sessionId:s}).then(u):i.vote({action:"downvote",messagePublicId:t,sessionId:s}).then(u),[i,t,s,u])}exports.WidgetProvider=e.WidgetProvider;exports.useConfig=e.useConfig;exports.useContact=e.useContact;exports.useIsAwaitingBotReply=e.useIsAwaitingBotReply;exports.useMessages=e.useMessages;exports.usePreludeData=e.usePreludeData;exports.usePrimitiveState=e.usePrimitiveState;exports.useSession=e.useSession;exports.useUploadFiles=e.useUploadFiles;exports.useWidget=e.useWidget;exports.useVote=a;
2
2
  //# sourceMappingURL=react.cjs.map
package/dist/react.js CHANGED
@@ -1,5 +1,5 @@
1
- import { u as o, _ as i } from "./useUploadFiles-BQkTgy3Z.js";
2
- import { W as p, a as d, b as f, c as m, d as v, e as c, f as P, g as b, h } from "./useUploadFiles-BQkTgy3Z.js";
1
+ import { u as o, _ as i } from "./useUploadFiles-ClUXwfKK.js";
2
+ import { W as p, a as d, b as f, c as m, d as v, e as c, f as P, g as b, h } from "./useUploadFiles-ClUXwfKK.js";
3
3
  function n(e, t, a) {
4
4
  const { widgetCtx: { api: s } } = o();
5
5
  return i(
@@ -2,7 +2,7 @@ import { VariantProps } from 'class-variance-authority';
2
2
  import * as React from "react";
3
3
  declare const buttonVariants: (props?: ({
4
4
  variant?: "default" | "link" | "outline" | "destructive" | "secondary" | "ghost" | null | undefined;
5
- size?: "default" | "icon" | "sm" | "lg" | "fit" | null | undefined;
5
+ size?: "default" | "icon" | "sm" | "lg" | "fit" | "free" | null | undefined;
6
6
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
7
7
  export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
8
8
  asChild?: boolean;
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ export declare function Loading({ className }: {
3
+ className?: string;
4
+ }): React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { default as React } from 'react';
2
+ export declare function SessionsScreen(): React.JSX.Element;
@@ -19,7 +19,8 @@ type SessionsState = {
19
19
  /** Indicates if no more pages are left */
20
20
  isLastPage: boolean;
21
21
  /** Did fetch for the first time */
22
- didInitialFetch: boolean;
22
+ didStartInitialFetch: boolean;
23
+ isInitialFetchLoading: boolean;
23
24
  };
24
25
  export declare class SessionCtx {
25
26
  private config;
@@ -50,6 +51,7 @@ export declare class SessionCtx {
50
51
  };
51
52
  channel: string;
52
53
  isVerified: boolean;
54
+ lastMessage: string | null;
53
55
  } | null>;
54
56
  loadMoreSessions: () => Promise<void>;
55
57
  }
@@ -249,6 +249,7 @@ export interface components {
249
249
  };
250
250
  channel: string;
251
251
  isVerified: boolean;
252
+ lastMessage: string | null;
252
253
  }[];
253
254
  /** @description The `cursor` for the request to get the next set of items. Null if there is no more data. */
254
255
  next: string | null;
@@ -352,6 +353,7 @@ export interface components {
352
353
  };
353
354
  channel: string;
354
355
  isVerified: boolean;
356
+ lastMessage: string | null;
355
357
  };
356
358
  WidgetVoteDto: {
357
359
  /** @enum {string} */
@@ -7,7 +7,8 @@ export declare function useSession(): {
7
7
  data: import('../../core').SessionDto[];
8
8
  cursor: string | undefined;
9
9
  isLastPage: boolean;
10
- didInitialFetch: boolean;
10
+ didStartInitialFetch: boolean;
11
+ isInitialFetchLoading: boolean;
11
12
  };
12
13
  loadMoreSessions: () => Promise<void>;
13
14
  };
@@ -1,4 +1,4 @@
1
- "use strict";var qt=Object.defineProperty;var Bt=(e,t,n)=>t in e?qt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ke=(e,t,n)=>Bt(e,typeof t!="symbol"?t+"":t,n);const E=require("react"),Ht=require("react/jsx-runtime"),Gt=require("./widget.ctx-BFXSWWWZ.cjs"),$t=require("uuid");class kt{constructor(t){Ke(this,"components",[{key:"fallback",component:t=>"fallback"},{key:"loading",component:t=>"loading"}]);const{components:n}=t;if(n&&n.forEach(r=>this.register(r)),this.components.length===0)throw new Error("No components registered");if(!this.get("fallback"))throw new Error("No fallback component registered")}register(t){const n=this.components.findIndex(r=>r.key===t.key);return n!==-1?this.components[n]=t:this.components.push(t),this}get(t){const n=this.components.find(r=>r.key.toUpperCase()===t.toUpperCase());return n||null}getOrFallback(t){return t?this.get(t)||this.get("fallback"):this.get("fallback")}getComponent(t,n){var r;return n?this.getOrFallback(t).component:(r=this.get(t))==null?void 0:r.component}}function Kt(e){const t=E.createContext({});return[()=>{const r=E.useContext(t);if(r===void 0)throw new Error("useSafeContext must be used within a Provider");return r},t.Provider]}const zt="3.0.12",[K,Yt]=Kt();function Jt({options:e,children:t,components:n}){const r=E.useMemo(()=>new Gt.WidgetCtx({config:e}),[e]),o=E.useMemo(()=>new kt({components:n}),[n]);return Ht.jsx(Yt,{value:{widgetCtx:r,components:n,componentStore:o,version:zt},children:t})}function Xt(){const{widgetCtx:e}=K();return e.config}function re(e){return E.useSyncExternalStore(e.subscribe,e.get,e.get)}function Qt(){const{widgetCtx:e}=K();return{contactState:re(e.contactCtx.state),createUnverifiedContact:e.contactCtx.createUnverifiedContact}}function tt(){const{widgetCtx:e}=K();return{messagesState:re(e.messageCtx.state),sendMessage:e.messageCtx.sendMessage}}function nt(){const{widgetCtx:e}=K(),t=re(e.sessionCtx.sessionState),n=re(e.sessionCtx.sessionsState);return{sessionState:t,sessionsState:n,loadMoreSessions:e.sessionCtx.loadMoreSessions}}function Zt(){var r;const{sessionState:e}=nt(),{messagesState:t}=tt();return{isAwaitingBotReply:(!((r=e.session)!=null&&r.isHandedOff)||e.session.assignee.kind==="ai"||e.isCreatingSession)&&t.isSendingMessage}}var en=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function tn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function nn(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var Oe={exports:{}},ye={};/**
1
+ "use strict";var qt=Object.defineProperty;var Bt=(e,t,n)=>t in e?qt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ke=(e,t,n)=>Bt(e,typeof t!="symbol"?t+"":t,n);const E=require("react"),Ht=require("react/jsx-runtime"),Gt=require("./widget.ctx-C7UzbSii.cjs"),$t=require("uuid");class kt{constructor(t){Ke(this,"components",[{key:"fallback",component:t=>"fallback"},{key:"loading",component:t=>"loading"}]);const{components:n}=t;if(n&&n.forEach(r=>this.register(r)),this.components.length===0)throw new Error("No components registered");if(!this.get("fallback"))throw new Error("No fallback component registered")}register(t){const n=this.components.findIndex(r=>r.key===t.key);return n!==-1?this.components[n]=t:this.components.push(t),this}get(t){const n=this.components.find(r=>r.key.toUpperCase()===t.toUpperCase());return n||null}getOrFallback(t){return t?this.get(t)||this.get("fallback"):this.get("fallback")}getComponent(t,n){var r;return n?this.getOrFallback(t).component:(r=this.get(t))==null?void 0:r.component}}function Kt(e){const t=E.createContext({});return[()=>{const r=E.useContext(t);if(r===void 0)throw new Error("useSafeContext must be used within a Provider");return r},t.Provider]}const zt="3.0.13",[K,Yt]=Kt();function Jt({options:e,children:t,components:n}){const r=E.useMemo(()=>new Gt.WidgetCtx({config:e}),[e]),o=E.useMemo(()=>new kt({components:n}),[n]);return Ht.jsx(Yt,{value:{widgetCtx:r,components:n,componentStore:o,version:zt},children:t})}function Xt(){const{widgetCtx:e}=K();return e.config}function re(e){return E.useSyncExternalStore(e.subscribe,e.get,e.get)}function Qt(){const{widgetCtx:e}=K();return{contactState:re(e.contactCtx.state),createUnverifiedContact:e.contactCtx.createUnverifiedContact}}function tt(){const{widgetCtx:e}=K();return{messagesState:re(e.messageCtx.state),sendMessage:e.messageCtx.sendMessage}}function nt(){const{widgetCtx:e}=K(),t=re(e.sessionCtx.sessionState),n=re(e.sessionCtx.sessionsState);return{sessionState:t,sessionsState:n,loadMoreSessions:e.sessionCtx.loadMoreSessions}}function Zt(){var r;const{sessionState:e}=nt(),{messagesState:t}=tt();return{isAwaitingBotReply:(!((r=e.session)!=null&&r.isHandedOff)||e.session.assignee.kind==="ai"||e.isCreatingSession)&&t.isSendingMessage}}var en=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function tn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function nn(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var Oe={exports:{}},ye={};/**
2
2
  * @license React
3
3
  * use-sync-external-store-shim.production.min.js
4
4
  *
@@ -15,4 +15,4 @@
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
17
  */var Ye;function on(){return Ye||(Ye=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=E,t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(R){{for(var v=arguments.length,S=new Array(v>1?v-1:0),w=1;w<v;w++)S[w-1]=arguments[w];r("error",R,S)}}function r(R,v,S){{var w=t.ReactDebugCurrentFrame,I=w.getStackAddendum();I!==""&&(v+="%s",S=S.concat([I]));var m=S.map(function(D){return String(D)});m.unshift("Warning: "+v),Function.prototype.apply.call(console[R],console,m)}}function o(R,v){return R===v&&(R!==0||1/R===1/v)||R!==R&&v!==v}var s=typeof Object.is=="function"?Object.is:o,i=e.useState,d=e.useEffect,_=e.useLayoutEffect,f=e.useDebugValue,a=!1,u=!1;function l(R,v,S){a||e.startTransition!==void 0&&(a=!0,n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var w=v();if(!u){var I=v();s(w,I)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),u=!0)}var m=i({inst:{value:w,getSnapshot:v}}),D=m[0].inst,P=m[1];return _(function(){D.value=w,D.getSnapshot=v,c(D)&&P({inst:D})},[R,w,v]),d(function(){c(D)&&P({inst:D});var B=function(){c(D)&&P({inst:D})};return R(B)},[R]),f(w),w}function c(R){var v=R.getSnapshot,S=R.value;try{var w=v();return!s(S,w)}catch{return!0}}function y(R,v,S){return v()}var h=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",T=!h,p=T?y:l,z=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p;ge.useSyncExternalStore=z,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),ge}process.env.NODE_ENV==="production"?Oe.exports=rn():Oe.exports=on();var sn=Oe.exports;const G=()=>{},L=G(),Ee=Object,g=e=>e===L,N=e=>typeof e=="function",$=(e,t)=>({...e,...t}),an=e=>N(e.then),ue=new WeakMap;let un=0;const oe=e=>{const t=typeof e,n=e&&e.constructor,r=n==Date;let o,s;if(Ee(e)===e&&!r&&n!=RegExp){if(o=ue.get(e),o)return o;if(o=++un+"~",ue.set(e,o),n==Array){for(o="@",s=0;s<e.length;s++)o+=oe(e[s])+",";ue.set(e,o)}if(n==Ee){o="#";const i=Ee.keys(e).sort();for(;!g(s=i.pop());)g(e[s])||(o+=s+":"+oe(e[s])+",");ue.set(e,o)}}else o=r?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return o},q=new WeakMap,ve={},ce={},Pe="undefined",de=typeof window!=Pe,Re=typeof document!=Pe,cn=()=>de&&typeof window.requestAnimationFrame!=Pe,rt=(e,t)=>{const n=q.get(e);return[()=>!g(t)&&e.get(t)||ve,r=>{if(!g(t)){const o=e.get(t);t in ce||(ce[t]=o),n[5](t,$(o,r),o||ve)}},n[6],()=>!g(t)&&t in ce?ce[t]:!g(t)&&e.get(t)||ve]};let Ce=!0;const fn=()=>Ce,[Te,De]=de&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[G,G],ln=()=>{const e=Re&&document.visibilityState;return g(e)||e!=="hidden"},dn=e=>(Re&&document.addEventListener("visibilitychange",e),Te("focus",e),()=>{Re&&document.removeEventListener("visibilitychange",e),De("focus",e)}),pn=e=>{const t=()=>{Ce=!0,e()},n=()=>{Ce=!1};return Te("online",t),Te("offline",n),()=>{De("online",t),De("offline",n)}},_n={isOnline:fn,isVisible:ln},hn={initFocus:dn,initReconnect:pn},Je=!E.useId,se=!de||"Deno"in window,yn=e=>cn()?window.requestAnimationFrame(e):setTimeout(e,1),we=se?E.useEffect:E.useLayoutEffect,Se=typeof navigator<"u"&&navigator.connection,Xe=!se&&Se&&(["slow-2g","2g"].includes(Se.effectiveType)||Se.saveData),Le=e=>{if(N(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?oe(e):"",[e,t]};let gn=0;const Ae=()=>++gn,ot=0,st=1,it=2,En=3;var ne={__proto__:null,ERROR_REVALIDATE_EVENT:En,FOCUS_EVENT:ot,MUTATE_EVENT:it,RECONNECT_EVENT:st};async function at(...e){const[t,n,r,o]=e,s=$({populateCache:!0,throwOnError:!0},typeof o=="boolean"?{revalidate:o}:o||{});let i=s.populateCache;const d=s.rollbackOnError;let _=s.optimisticData;const f=l=>typeof d=="function"?d(l):d!==!1,a=s.throwOnError;if(N(n)){const l=n,c=[],y=t.keys();for(const h of y)!/^\$(inf|sub)\$/.test(h)&&l(t.get(h)._k)&&c.push(h);return Promise.all(c.map(u))}return u(n);async function u(l){const[c]=Le(l);if(!c)return;const[y,h]=rt(t,c),[T,p,z,R]=q.get(t),v=()=>{const F=T[c];return(N(s.revalidate)?s.revalidate(y().data,l):s.revalidate!==!1)&&(delete z[c],delete R[c],F&&F[0])?F[0](it).then(()=>y().data):y().data};if(e.length<3)return v();let S=r,w;const I=Ae();p[c]=[I,0];const m=!g(_),D=y(),P=D.data,B=D._c,k=g(B)?P:B;if(m&&(_=N(_)?_(k,P):_,h({data:_,_c:k})),N(S))try{S=S(k)}catch(F){w=F}if(S&&an(S))if(S=await S.catch(F=>{w=F}),I!==p[c][0]){if(w)throw w;return S}else w&&m&&f(w)&&(i=!0,h({data:k,_c:L}));if(i&&!w)if(N(i)){const F=i(S,k);h({data:F,error:L,_c:L})}else h({data:S,error:L,_c:L});if(p[c][1]=Ae(),Promise.resolve(v()).then(()=>{h({_c:L})}),w){if(a)throw w;return}return S}}const Qe=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},vn=(e,t)=>{if(!q.has(e)){const n=$(hn,t),r={},o=at.bind(L,e);let s=G;const i={},d=(a,u)=>{const l=i[a]||[];return i[a]=l,l.push(u),()=>l.splice(l.indexOf(u),1)},_=(a,u,l)=>{e.set(a,u);const c=i[a];if(c)for(const y of c)y(u,l)},f=()=>{if(!q.has(e)&&(q.set(e,[r,{},{},{},o,_,d]),!se)){const a=n.initFocus(setTimeout.bind(L,Qe.bind(L,r,ot))),u=n.initReconnect(setTimeout.bind(L,Qe.bind(L,r,st)));s=()=>{a&&a(),u&&u(),q.delete(e)}}};return f(),[e,o,f,s]}return[e,q.get(e)[4]]},wn=(e,t,n,r,o)=>{const s=n.errorRetryCount,i=o.retryCount,d=~~((Math.random()+.5)*(1<<(i<8?i:8)))*n.errorRetryInterval;!g(s)&&i>s||setTimeout(r,d,o)},Sn=(e,t)=>oe(e)==oe(t),[ut,mn]=vn(new Map),bn=$({onLoadingSlow:G,onSuccess:G,onError:G,onErrorRetry:wn,onDiscarded:G,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:Xe?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:Xe?5e3:3e3,compare:Sn,isPaused:()=>!1,cache:ut,mutate:mn,fallback:{}},_n),On=(e,t)=>{const n=$(e,t);if(t){const{use:r,fallback:o}=e,{use:s,fallback:i}=t;r&&s&&(n.use=r.concat(s)),o&&i&&(n.fallback=$(o,i))}return n},Rn=E.createContext({}),Cn="$inf$",ct=de&&window.__SWR_DEVTOOLS_USE__,Tn=ct?window.__SWR_DEVTOOLS_USE__:[],Dn=()=>{ct&&(window.__SWR_DEVTOOLS_REACT__=E)},An=e=>N(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],xn=()=>$(bn,E.useContext(Rn)),jn=e=>(t,n,r)=>e(t,n&&((...s)=>{const[i]=Le(t),[,,,d]=q.get(ut);if(i.startsWith(Cn))return n(...s);const _=d[i];return g(_)?n(...s):(delete d[i],_)}),r),Pn=Tn.concat(jn),Ln=e=>function(...n){const r=xn(),[o,s,i]=An(n),d=On(r,i);let _=e;const{use:f}=d,a=(f||[]).concat(Pn);for(let u=a.length;u--;)_=a[u](_);return _(o,s||d.fetcher||null,d)},In=(e,t,n)=>{const r=t[e]||(t[e]=[]);return r.push(n),()=>{const o=r.indexOf(n);o>=0&&(r[o]=r[r.length-1],r.pop())}};Dn();const Ze=E.use||(e=>{if(e.status==="pending")throw e;if(e.status==="fulfilled")return e.value;throw e.status==="rejected"?e.reason:(e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e)}),me={dedupe:!0},Vn=(e,t,n)=>{const{cache:r,compare:o,suspense:s,fallbackData:i,revalidateOnMount:d,revalidateIfStale:_,refreshInterval:f,refreshWhenHidden:a,refreshWhenOffline:u,keepPreviousData:l}=n,[c,y,h,T]=q.get(r),[p,z]=Le(e),R=E.useRef(!1),v=E.useRef(!1),S=E.useRef(p),w=E.useRef(t),I=E.useRef(n),m=()=>I.current,D=()=>m().isVisible()&&m().isOnline(),[P,B,k,F]=rt(r,p),Y=E.useRef({}).current,Ft=g(i)?n.fallback[p]:i,Me=(b,O)=>{for(const x in Y){const C=x;if(C==="data"){if(!o(b[C],O[C])&&(!g(b[C])||!o(ae,O[C])))return!1}else if(O[C]!==b[C])return!1}return!0},Ne=E.useMemo(()=>{const b=!p||!t?!1:g(d)?m().isPaused()||s?!1:g(_)?!0:_:d,O=j=>{const U=$(j);return delete U._k,b?{isValidating:!0,isLoading:!0,...U}:U},x=P(),C=F(),M=O(x),Z=x===C?M:O(C);let A=M;return[()=>{const j=O(P());return Me(j,A)?(A.data=j.data,A.isLoading=j.isLoading,A.isValidating=j.isValidating,A.error=j.error,A):(A=j,j)},()=>Z]},[r,p]),J=sn.useSyncExternalStore(E.useCallback(b=>k(p,(O,x)=>{Me(x,O)||b()}),[r,p]),Ne[0],Ne[1]),Ue=!R.current,Mt=c[p]&&c[p].length>0,X=J.data,Q=g(X)?Ft:X,ie=J.error,We=E.useRef(Q),ae=l?g(X)?We.current:X:Q,qe=Mt&&!g(ie)?!1:Ue&&!g(d)?d:m().isPaused()?!1:s?g(Q)?!1:_:g(Q)||_,Be=!!(p&&t&&Ue&&qe),Nt=g(J.isValidating)?Be:J.isValidating,Ut=g(J.isLoading)?Be:J.isLoading,te=E.useCallback(async b=>{const O=w.current;if(!p||!O||v.current||m().isPaused())return!1;let x,C,M=!0;const Z=b||{},A=!h[p]||!Z.dedupe,j=()=>Je?!v.current&&p===S.current&&R.current:p===S.current,U={isValidating:!1,isLoading:!1},Ge=()=>{B(U)},$e=()=>{const V=h[p];V&&V[1]===C&&delete h[p]},ke={isValidating:!0};g(P().data)&&(ke.isLoading=!0);try{if(A&&(B(ke),n.loadingTimeout&&g(P().data)&&setTimeout(()=>{M&&j()&&m().onLoadingSlow(p,n)},n.loadingTimeout),h[p]=[O(z),Ae()]),[x,C]=h[p],x=await x,A&&setTimeout($e,n.dedupingInterval),!h[p]||h[p][1]!==C)return A&&j()&&m().onDiscarded(p),!1;U.error=L;const V=y[p];if(!g(V)&&(C<=V[0]||C<=V[1]||V[1]===0))return Ge(),A&&j()&&m().onDiscarded(p),!1;const W=P().data;U.data=o(W,x)?W:x,A&&j()&&m().onSuccess(x,p,n)}catch(V){$e();const W=m(),{shouldRetryOnError:_e}=W;W.isPaused()||(U.error=V,A&&j()&&(W.onError(V,p,W),(_e===!0||N(_e)&&_e(V))&&(!m().revalidateOnFocus||!m().revalidateOnReconnect||D())&&W.onErrorRetry(V,p,W,Wt=>{const he=c[p];he&&he[0]&&he[0](ne.ERROR_REVALIDATE_EVENT,Wt)},{retryCount:(Z.retryCount||0)+1,dedupe:!0})))}return M=!1,Ge(),!0},[p,r]),He=E.useCallback((...b)=>at(r,S.current,...b),[]);if(we(()=>{w.current=t,I.current=n,g(X)||(We.current=X)}),we(()=>{if(!p)return;const b=te.bind(L,me);let O=0;const C=In(p,c,(M,Z={})=>{if(M==ne.FOCUS_EVENT){const A=Date.now();m().revalidateOnFocus&&A>O&&D()&&(O=A+m().focusThrottleInterval,b())}else if(M==ne.RECONNECT_EVENT)m().revalidateOnReconnect&&D()&&b();else{if(M==ne.MUTATE_EVENT)return te();if(M==ne.ERROR_REVALIDATE_EVENT)return te(Z)}});return v.current=!1,S.current=p,R.current=!0,B({_k:z}),qe&&(g(Q)||se?b():yn(b)),()=>{v.current=!0,C()}},[p]),we(()=>{let b;function O(){const C=N(f)?f(P().data):f;C&&b!==-1&&(b=setTimeout(x,C))}function x(){!P().error&&(a||m().isVisible())&&(u||m().isOnline())?te(me).then(O):O()}return O(),()=>{b&&(clearTimeout(b),b=-1)}},[f,a,u,p]),E.useDebugValue(ae),s&&g(Q)&&p){if(!Je&&se)throw new Error("Fallback data is required when using suspense in SSR.");w.current=t,I.current=n,v.current=!1;const b=T[p];if(!g(b)){const O=He(b);Ze(O)}if(g(ie)){const O=te(me);g(ae)||(O.status="fulfilled",O.value=!0),Ze(O)}else throw ie}return{mutate:He,get data(){return Y.data=!0,ae},get error(){return Y.error=!0,ie},get isValidating(){return Y.isValidating=!0,Nt},get isLoading(){return Y.isLoading=!0,Ut}}},Fn=Ln(Vn);function Mn(){const{widgetCtx:e}=K();return Fn([e.config.token],e.api.widgetPrelude,{revalidateOnFocus:!1})}var ft={},xe=function(e,t){return xe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[o]=r[o])},xe(e,t)};function lt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");xe(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}exports.__assign=function(){return exports.__assign=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},exports.__assign.apply(this,arguments)};function Ie(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function dt(e,t,n,r){var o=arguments.length,s=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,n,r);else for(var d=e.length-1;d>=0;d--)(i=e[d])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s}function pt(e,t){return function(n,r){t(n,r,e)}}function _t(e,t,n,r,o,s){function i(p){if(p!==void 0&&typeof p!="function")throw new TypeError("Function expected");return p}for(var d=r.kind,_=d==="getter"?"get":d==="setter"?"set":"value",f=!t&&e?r.static?e:e.prototype:null,a=t||(f?Object.getOwnPropertyDescriptor(f,r.name):{}),u,l=!1,c=n.length-1;c>=0;c--){var y={};for(var h in r)y[h]=h==="access"?{}:r[h];for(var h in r.access)y.access[h]=r.access[h];y.addInitializer=function(p){if(l)throw new TypeError("Cannot add initializers after decoration has completed");s.push(i(p||null))};var T=(0,n[c])(d==="accessor"?{get:a.get,set:a.set}:a[_],y);if(d==="accessor"){if(T===void 0)continue;if(T===null||typeof T!="object")throw new TypeError("Object expected");(u=i(T.get))&&(a.get=u),(u=i(T.set))&&(a.set=u),(u=i(T.init))&&o.unshift(u)}else(u=i(T))&&(d==="field"?o.unshift(u):a[_]=u)}f&&Object.defineProperty(f,r.name,a),l=!0}function ht(e,t,n){for(var r=arguments.length>2,o=0;o<t.length;o++)n=r?t[o].call(e,n):t[o].call(e);return r?n:void 0}function yt(e){return typeof e=="symbol"?e:"".concat(e)}function gt(e,t,n){return typeof t=="symbol"&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:n?"".concat(n," ",t):t})}function Et(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function vt(e,t,n,r){function o(s){return s instanceof n?s:new n(function(i){i(s)})}return new(n||(n=Promise))(function(s,i){function d(a){try{f(r.next(a))}catch(u){i(u)}}function _(a){try{f(r.throw(a))}catch(u){i(u)}}function f(a){a.done?s(a.value):o(a.value).then(d,_)}f((r=r.apply(e,t||[])).next())})}function wt(e,t){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,o,s,i=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return i.next=d(0),i.throw=d(1),i.return=d(2),typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function d(f){return function(a){return _([f,a])}}function _(f){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,f[0]&&(n=0)),n;)try{if(r=1,o&&(s=f[0]&2?o.return:f[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,f[1])).done)return s;switch(o=0,s&&(f=[f[0]&2,s.value]),f[0]){case 0:case 1:s=f;break;case 4:return n.label++,{value:f[1],done:!1};case 5:n.label++,o=f[1],f=[0];continue;case 7:f=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(f[0]===6||f[0]===2)){n=0;continue}if(f[0]===3&&(!s||f[1]>s[0]&&f[1]<s[3])){n.label=f[1];break}if(f[0]===6&&n.label<s[1]){n.label=s[1],s=f;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(f);break}s[2]&&n.ops.pop(),n.trys.pop();continue}f=t.call(e,n)}catch(a){f=[6,a],o=0}finally{r=s=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}var pe=Object.create?function(e,t,n,r){r===void 0&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]};function St(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&pe(t,e,n)}function le(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ve(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),o,s=[],i;try{for(;(t===void 0||t-- >0)&&!(o=r.next()).done;)s.push(o.value)}catch(d){i={error:d}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return s}function mt(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Ve(arguments[t]));return e}function bt(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var r=Array(e),o=0,t=0;t<n;t++)for(var s=arguments[t],i=0,d=s.length;i<d;i++,o++)r[o]=s[i];return r}function Fe(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}function ee(e){return this instanceof ee?(this.v=e,this):new ee(e)}function Ot(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(e,t||[]),o,s=[];return o=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),d("next"),d("throw"),d("return",i),o[Symbol.asyncIterator]=function(){return this},o;function i(c){return function(y){return Promise.resolve(y).then(c,u)}}function d(c,y){r[c]&&(o[c]=function(h){return new Promise(function(T,p){s.push([c,h,T,p])>1||_(c,h)})},y&&(o[c]=y(o[c])))}function _(c,y){try{f(r[c](y))}catch(h){l(s[0][3],h)}}function f(c){c.value instanceof ee?Promise.resolve(c.value.v).then(a,u):l(s[0][2],c)}function a(c){_("next",c)}function u(c){_("throw",c)}function l(c,y){c(y),s.shift(),s.length&&_(s[0][0],s[0][1])}}function Rt(e){var t,n;return t={},r("next"),r("throw",function(o){throw o}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(o,s){t[o]=e[o]?function(i){return(n=!n)?{value:ee(e[o](i)),done:!1}:s?s(i):i}:s}}function Ct(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof le=="function"?le(e):e[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(s){n[s]=e[s]&&function(i){return new Promise(function(d,_){i=e[s](i),o(d,_,i.done,i.value)})}}function o(s,i,d,_){Promise.resolve(_).then(function(f){s({value:f,done:d})},i)}}function Tt(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var Nn=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function Dt(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&pe(t,e,n);return Nn(t,e),t}function At(e){return e&&e.__esModule?e:{default:e}}function xt(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)}function jt(e,t,n,r,o){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?o.call(e,n):o?o.value=n:t.set(e,n),n}function Pt(e,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e=="function"?t===e:e.has(t)}function Lt(e,t,n){if(t!=null){if(typeof t!="object"&&typeof t!="function")throw new TypeError("Object expected.");var r,o;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=t[Symbol.asyncDispose]}if(r===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=t[Symbol.dispose],n&&(o=r)}if(typeof r!="function")throw new TypeError("Object not disposable.");o&&(r=function(){try{o.call(this)}catch(s){return Promise.reject(s)}}),e.stack.push({value:t,dispose:r,async:n})}else n&&e.stack.push({async:!0});return t}var Un=typeof SuppressedError=="function"?SuppressedError:function(e,t,n){var r=new Error(n);return r.name="SuppressedError",r.error=e,r.suppressed=t,r};function It(e){function t(s){e.error=e.hasError?new Un(s,e.error,"An error was suppressed during disposal."):s,e.hasError=!0}var n,r=0;function o(){for(;n=e.stack.pop();)try{if(!n.async&&r===1)return r=0,e.stack.push(n),Promise.resolve().then(o);if(n.dispose){var s=n.dispose.call(n.value);if(n.async)return r|=2,Promise.resolve(s).then(o,function(i){return t(i),o()})}else r|=1}catch(i){t(i)}if(r===1)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}return o()}function Vt(e,t){return typeof e=="string"&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(n,r,o,s,i){return r?t?".jsx":".js":o&&(!s||!i)?n:o+s+"."+i.toLowerCase()+"js"}):e}const Wn={__extends:lt,__assign:exports.__assign,__rest:Ie,__decorate:dt,__param:pt,__esDecorate:_t,__runInitializers:ht,__propKey:yt,__setFunctionName:gt,__metadata:Et,__awaiter:vt,__generator:wt,__createBinding:pe,__exportStar:St,__values:le,__read:Ve,__spread:mt,__spreadArrays:bt,__spreadArray:Fe,__await:ee,__asyncGenerator:Ot,__asyncDelegator:Rt,__asyncValues:Ct,__makeTemplateObject:Tt,__importStar:Dt,__importDefault:At,__classPrivateFieldGet:xt,__classPrivateFieldSet:jt,__classPrivateFieldIn:Pt,__addDisposableResource:Lt,__disposeResources:It,__rewriteRelativeImportExtension:Vt},qn=Object.freeze(Object.defineProperty({__proto__:null,__addDisposableResource:Lt,get __assign(){return exports.__assign},__asyncDelegator:Rt,__asyncGenerator:Ot,__asyncValues:Ct,__await:ee,__awaiter:vt,__classPrivateFieldGet:xt,__classPrivateFieldIn:Pt,__classPrivateFieldSet:jt,__createBinding:pe,__decorate:dt,__disposeResources:It,__esDecorate:_t,__exportStar:St,__extends:lt,__generator:wt,__importDefault:At,__importStar:Dt,__makeTemplateObject:Tt,__metadata:Et,__param:pt,__propKey:yt,__read:Ve,__rest:Ie,__rewriteRelativeImportExtension:Vt,__runInitializers:ht,__setFunctionName:gt,__spread:mt,__spreadArray:Fe,__spreadArrays:bt,__values:le,default:Wn},Symbol.toStringTag,{value:"Module"})),Bn=nn(qn);var fe={},et;function Hn(){if(et)return fe;et=1,Object.defineProperty(fe,"__esModule",{value:!0});var e=E;function t(){var n=e.useRef(!1),r=e.useCallback(function(){return n.current},[]);return e.useEffect(function(){return n.current=!0,function(){n.current=!1}},[]),r}return fe.default=t,fe}Object.defineProperty(ft,"__esModule",{value:!0});var je=Bn,be=E,Gn=je.__importDefault(Hn());function $n(e,t,n){t===void 0&&(t=[]),n===void 0&&(n={loading:!1});var r=be.useRef(0),o=Gn.default(),s=be.useState(n),i=s[0],d=s[1],_=be.useCallback(function(){for(var f=[],a=0;a<arguments.length;a++)f[a]=arguments[a];var u=++r.current;return i.loading||d(function(l){return je.__assign(je.__assign({},l),{loading:!0})}),e.apply(void 0,f).then(function(l){return o()&&u===r.current&&d({value:l,loading:!1}),l},function(l){return o()&&u===r.current&&d({error:l,loading:!1}),l})},t);return[i,_]}var kn=ft.default=$n;const H=new Map;function Kn(){const[e,t]=E.useState([]),{widgetCtx:{api:n}}=K();function r(a){const u=a.map(l=>({file:l,id:$t.v4(),status:"pending",progress:0}));t(l=>[...l,...u]),u.forEach(i)}function o(a,u){t(l=>l.map(c=>c.id===a?{...c,...u}:c))}function s(a){t(u=>u.filter(l=>l.id!==a))}const i=async a=>{const u=new AbortController;H.set(a.id,u);try{t(c=>c.map(y=>y.id===a.id?{...y,status:"uploading",progress:0}:y));const l=await n.uploadFile(a,{signal:u.signal,onUploadProgress:c=>{if(!c.total)return;const y=Math.round(c.loaded*100/c.total);o(a.id,{progress:y})}});o(a.id,{status:"success",fileUrl:l.fileUrl,progress:100})}catch(l){u.signal.aborted||o(a.id,{status:"error",error:l instanceof Error?l.message:"Upload failed",progress:0})}finally{H.delete(a.id)}},d=a=>{const u=H.get(a);u&&(u.abort(),H.delete(a)),s(a)},_=E.useMemo(()=>e.filter(a=>a.status==="success"&&a.fileUrl),[e]);function f(){H.forEach(a=>a.abort()),H.clear(),t([])}return E.useEffect(()=>()=>{H.forEach(a=>a.abort()),H.clear()},[]),{allFiles:e,appendFiles:r,handleCancelUpload:d,successFiles:_,emptyTheFiles:f,getFileById:a=>e.find(u=>u.id===a),getUploadProgress:a=>{var u;return((u=e.find(l=>l.id===a))==null?void 0:u.progress)??0},getUploadStatus:a=>{var u;return(u=e.find(l=>l.id===a))==null?void 0:u.status},hasErrors:e.some(a=>a.status==="error"),isUploading:e.some(a=>a.status==="uploading")}}exports.WidgetProvider=Jt;exports.__rest=Ie;exports.__spreadArray=Fe;exports._default=kn;exports.commonjsGlobal=en;exports.getDefaultExportFromCjs=tn;exports.useConfig=Xt;exports.useContact=Qt;exports.useIsAwaitingBotReply=Zt;exports.useMessages=tt;exports.usePreludeData=Mn;exports.usePrimitiveState=re;exports.useSession=nt;exports.useUploadFiles=Kn;exports.useWidget=K;
18
- //# sourceMappingURL=useUploadFiles-CgV45e1z.cjs.map
18
+ //# sourceMappingURL=useUploadFiles-CiUgziil.cjs.map