chainlit 1.1.300rc1__py3-none-any.whl → 1.1.300rc2__py3-none-any.whl

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.

Potentially problematic release.


This version of chainlit might be problematic. Click here for more details.

Files changed (26) hide show
  1. chainlit/copilot/dist/index.js +75 -75
  2. chainlit/data/dynamodb.py +586 -0
  3. chainlit/frontend/dist/assets/{DailyMotion-acaf0251.js → DailyMotion-875f8ae4.js} +1 -1
  4. chainlit/frontend/dist/assets/{Facebook-7e85d6cd.js → Facebook-5a236c6a.js} +1 -1
  5. chainlit/frontend/dist/assets/{FilePlayer-548ab948.js → FilePlayer-139fc89f.js} +1 -1
  6. chainlit/frontend/dist/assets/{Kaltura-63c33135.js → Kaltura-091e82f4.js} +1 -1
  7. chainlit/frontend/dist/assets/{Mixcloud-553956db.js → Mixcloud-2a11761c.js} +1 -1
  8. chainlit/frontend/dist/assets/{Mux-823ded93.js → Mux-e9439155.js} +1 -1
  9. chainlit/frontend/dist/assets/{Preview-47f5b210.js → Preview-4a1f503b.js} +1 -1
  10. chainlit/frontend/dist/assets/{SoundCloud-e5e98e65.js → SoundCloud-56125978.js} +1 -1
  11. chainlit/frontend/dist/assets/{Streamable-14812f3b.js → Streamable-9aff4ba5.js} +1 -1
  12. chainlit/frontend/dist/assets/{Twitch-3e4a9570.js → Twitch-ea748d1d.js} +1 -1
  13. chainlit/frontend/dist/assets/{Vidyard-63580b33.js → Vidyard-8106a931.js} +1 -1
  14. chainlit/frontend/dist/assets/{Vimeo-1c2b5c4c.js → Vimeo-1f0b6b55.js} +1 -1
  15. chainlit/frontend/dist/assets/{Wistia-3dc1d7c3.js → Wistia-c18b0bba.js} +1 -1
  16. chainlit/frontend/dist/assets/{YouTube-d92466dc.js → YouTube-9114d4e0.js} +1 -1
  17. chainlit/frontend/dist/assets/{index-53c62926.css → index-67745611.css} +1 -1
  18. chainlit/frontend/dist/assets/{index-89bf1895.js → index-b8523620.js} +7 -7
  19. chainlit/frontend/dist/assets/{react-plotly-691f8eab.js → react-plotly-68456fe1.js} +1 -1
  20. chainlit/frontend/dist/index.html +2 -2
  21. chainlit/oauth_providers.py +56 -0
  22. chainlit/socket.py +4 -1
  23. {chainlit-1.1.300rc1.dist-info → chainlit-1.1.300rc2.dist-info}/METADATA +1 -1
  24. {chainlit-1.1.300rc1.dist-info → chainlit-1.1.300rc2.dist-info}/RECORD +26 -25
  25. {chainlit-1.1.300rc1.dist-info → chainlit-1.1.300rc2.dist-info}/WHEEL +0 -0
  26. {chainlit-1.1.300rc1.dist-info → chainlit-1.1.300rc2.dist-info}/entry_points.txt +0 -0
@@ -73,7 +73,7 @@ function print() { __p += __j.call(arguments, '') }
73
73
  *
74
74
  * This source code is licensed under the MIT license found in the
75
75
  * LICENSE file in the root directory of this source tree.
76
- */var hf=x;function Ebe(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var bbe=typeof Object.is=="function"?Object.is:Ebe,Sbe=hf.useState,vbe=hf.useEffect,ybe=hf.useLayoutEffect,Tbe=hf.useDebugValue;function Cbe(e,t){var n=t(),r=Sbe({inst:{value:n,getSnapshot:t}}),a=r[0].inst,i=r[1];return ybe(function(){a.value=n,a.getSnapshot=t,d2(a)&&i({inst:a})},[e,n,t]),vbe(function(){return d2(a)&&i({inst:a}),e(function(){d2(a)&&i({inst:a})})},[e]),Tbe(n),n}function d2(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!bbe(e,n)}catch{return!0}}function Rbe(e,t){return t()}var xbe=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Rbe:Cbe;wj.useSyncExternalStore=hf.useSyncExternalStore!==void 0?hf.useSyncExternalStore:xbe;Ij.exports=wj;var Abe=Ij.exports;const Tc=()=>{},gi=Tc(),p2=Object,vn=e=>e===gi,yl=e=>typeof e=="function",Hc=(e,t)=>({...e,...t}),Obe=e=>yl(e.then),k1=new WeakMap;let Nbe=0;const Lh=e=>{const t=typeof e,n=e&&e.constructor,r=n==Date;let a,i;if(p2(e)===e&&!r&&n!=RegExp){if(a=k1.get(e),a)return a;if(a=++Nbe+"~",k1.set(e,a),n==Array){for(a="@",i=0;i<e.length;i++)a+=Lh(e[i])+",";k1.set(e,a)}if(n==p2){a="#";const o=p2.keys(e).sort();for(;!vn(i=o.pop());)vn(e[i])||(a+=i+":"+Lh(e[i])+",");k1.set(e,a)}}else a=r?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return a},_l=new WeakMap,f2={},P1={},Pw="undefined",lv=typeof window!=Pw,OI=typeof document!=Pw,Ibe=()=>lv&&typeof window.requestAnimationFrame!=Pw,Dj=(e,t)=>{const n=_l.get(e);return[()=>!vn(t)&&e.get(t)||f2,r=>{if(!vn(t)){const a=e.get(t);t in P1||(P1[t]=a),n[5](t,Hc(a,r),a||f2)}},n[6],()=>!vn(t)&&t in P1?P1[t]:!vn(t)&&e.get(t)||f2]};let NI=!0;const wbe=()=>NI,[II,wI]=lv&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[Tc,Tc],Dbe=()=>{const e=OI&&document.visibilityState;return vn(e)||e!=="hidden"},Lbe=e=>(OI&&document.addEventListener("visibilitychange",e),II("focus",e),()=>{OI&&document.removeEventListener("visibilitychange",e),wI("focus",e)}),Mbe=e=>{const t=()=>{NI=!0,e()},n=()=>{NI=!1};return II("online",t),II("offline",n),()=>{wI("online",t),wI("offline",n)}},kbe={isOnline:wbe,isVisible:Dbe},Pbe={initFocus:Lbe,initReconnect:Mbe},iP=!Oe.useId,Mh=!lv||"Deno"in window,Fbe=e=>Ibe()?window.requestAnimationFrame(e):setTimeout(e,1),m2=Mh?x.useEffect:x.useLayoutEffect,h2=typeof navigator<"u"&&navigator.connection,oP=!Mh&&h2&&(["slow-2g","2g"].includes(h2.effectiveType)||h2.saveData),Fw=e=>{if(yl(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?Lh(e):"",[e,t]};let Bbe=0;const DI=()=>++Bbe,Lj=0,Mj=1,kj=2,Ube=3;var em={__proto__:null,ERROR_REVALIDATE_EVENT:Ube,FOCUS_EVENT:Lj,MUTATE_EVENT:kj,RECONNECT_EVENT:Mj};async function Pj(...e){const[t,n,r,a]=e,i=Hc({populateCache:!0,throwOnError:!0},typeof a=="boolean"?{revalidate:a}:a||{});let o=i.populateCache;const s=i.rollbackOnError;let l=i.optimisticData;const c=i.revalidate!==!1,u=h=>typeof s=="function"?s(h):s!==!1,p=i.throwOnError;if(yl(n)){const h=n,g=[],E=t.keys();for(const y of E)!/^\$(inf|sub)\$/.test(y)&&h(t.get(y)._k)&&g.push(y);return Promise.all(g.map(f))}return f(n);async function f(h){const[g]=Fw(h);if(!g)return;const[E,y]=Dj(t,g),[b,v,C,T]=_l.get(t),N=()=>{const W=b[g];return c&&(delete C[g],delete T[g],W&&W[0])?W[0](kj).then(()=>E().data):E().data};if(e.length<3)return N();let A=r,O;const M=DI();v[g]=[M,0];const P=!vn(l),D=E(),$=D.data,V=D._c,Z=vn(V)?$:V;if(P&&(l=yl(l)?l(Z,$):l,y({data:l,_c:Z})),yl(A))try{A=A(Z)}catch(W){O=W}if(A&&Obe(A))if(A=await A.catch(W=>{O=W}),M!==v[g][0]){if(O)throw O;return A}else O&&P&&u(O)&&(o=!0,y({data:Z,_c:gi}));if(o&&!O)if(yl(o)){const W=o(A,Z);y({data:W,error:gi,_c:gi})}else y({data:A,error:gi,_c:gi});if(v[g][1]=DI(),Promise.resolve(N()).then(()=>{y({_c:gi})}),O){if(p)throw O;return}return A}}const sP=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},$be=(e,t)=>{if(!_l.has(e)){const n=Hc(Pbe,t),r={},a=Pj.bind(gi,e);let i=Tc;const o={},s=(u,p)=>{const f=o[u]||[];return o[u]=f,f.push(p),()=>f.splice(f.indexOf(p),1)},l=(u,p,f)=>{e.set(u,p);const h=o[u];if(h)for(const g of h)g(p,f)},c=()=>{if(!_l.has(e)&&(_l.set(e,[r,{},{},{},a,l,s]),!Mh)){const u=n.initFocus(setTimeout.bind(gi,sP.bind(gi,r,Lj))),p=n.initReconnect(setTimeout.bind(gi,sP.bind(gi,r,Mj)));i=()=>{u&&u(),p&&p(),_l.delete(e)}}};return c(),[e,a,c,i]}return[e,_l.get(e)[4]]},zbe=(e,t,n,r,a)=>{const i=n.errorRetryCount,o=a.retryCount,s=~~((Math.random()+.5)*(1<<(o<8?o:8)))*n.errorRetryInterval;!vn(i)&&o>i||setTimeout(r,s,a)},Hbe=(e,t)=>Lh(e)==Lh(t),[Fj,Gbe]=$be(new Map),Vbe=Hc({onLoadingSlow:Tc,onSuccess:Tc,onError:Tc,onErrorRetry:zbe,onDiscarded:Tc,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:oP?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:oP?5e3:3e3,compare:Hbe,isPaused:()=>!1,cache:Fj,mutate:Gbe,fallback:{}},kbe),Ybe=(e,t)=>{const n=Hc(e,t);if(t){const{use:r,fallback:a}=e,{use:i,fallback:o}=t;r&&i&&(n.use=r.concat(i)),a&&o&&(n.fallback=Hc(a,o))}return n},qbe=x.createContext({}),Wbe="$inf$",Bj=lv&&window.__SWR_DEVTOOLS_USE__,jbe=Bj?window.__SWR_DEVTOOLS_USE__:[],Kbe=()=>{Bj&&(window.__SWR_DEVTOOLS_REACT__=Oe)},Qbe=e=>yl(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],Xbe=()=>Hc(Vbe,x.useContext(qbe)),Zbe=e=>(t,n,r)=>e(t,n&&((...i)=>{const[o]=Fw(t),[,,,s]=_l.get(Fj);if(o.startsWith(Wbe))return n(...i);const l=s[o];return vn(l)?n(...i):(delete s[o],l)}),r),Jbe=jbe.concat(Zbe),eSe=e=>function(...n){const r=Xbe(),[a,i,o]=Qbe(n),s=Ybe(r,o);let l=e;const{use:c}=s,u=(c||[]).concat(Jbe);for(let p=u.length;p--;)l=u[p](l);return l(a,i||s.fetcher||null,s)},tSe=(e,t,n)=>{const r=t[e]||(t[e]=[]);return r.push(n),()=>{const a=r.indexOf(n);a>=0&&(r[a]=r[r.length-1],r.pop())}};Kbe();const lP=Oe.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)}),g2={dedupe:!0},nSe=(e,t,n)=>{const{cache:r,compare:a,suspense:i,fallbackData:o,revalidateOnMount:s,revalidateIfStale:l,refreshInterval:c,refreshWhenHidden:u,refreshWhenOffline:p,keepPreviousData:f}=n,[h,g,E,y]=_l.get(r),[b,v]=Fw(e),C=x.useRef(!1),T=x.useRef(!1),N=x.useRef(b),A=x.useRef(t),O=x.useRef(n),M=()=>O.current,P=()=>M().isVisible()&&M().isOnline(),[D,$,V,Z]=Dj(r,b),W=x.useRef({}).current,ae=vn(o)?n.fallback[b]:o,he=(Le,we)=>{for(const Pe in W){const Me=Pe;if(Me==="data"){if(!a(Le[Me],we[Me])&&(!vn(Le[Me])||!a(Te,we[Me])))return!1}else if(we[Me]!==Le[Me])return!1}return!0},q=x.useMemo(()=>{const Le=(()=>!b||!t?!1:vn(s)?M().isPaused()||i?!1:vn(l)?!0:l:s)(),we=Ge=>{const at=Hc(Ge);return delete at._k,Le?{isValidating:!0,isLoading:!0,...at}:at},Pe=D(),Me=Z(),lt=we(Pe),it=Pe===Me?lt:we(Me);let nt=lt;return[()=>{const Ge=we(D());return he(Ge,nt)?(nt.data=Ge.data,nt.isLoading=Ge.isLoading,nt.isValidating=Ge.isValidating,nt.error=Ge.error,nt):(nt=Ge,Ge)},()=>it]},[r,b]),G=Abe.useSyncExternalStore(x.useCallback(Le=>V(b,(we,Pe)=>{he(Pe,we)||Le()}),[r,b]),q[0],q[1]),H=!C.current,k=h[b]&&h[b].length>0,ie=G.data,j=vn(ie)?ae:ie,F=G.error,le=x.useRef(j),Te=f?vn(ie)?le.current:ie:j,fe=(()=>k&&!vn(F)?!1:H&&!vn(s)?s:M().isPaused()?!1:i?vn(j)?!1:l:vn(j)||l)(),Ae=!!(b&&t&&H&&fe),Ce=vn(G.isValidating)?Ae:G.isValidating,Ne=vn(G.isLoading)?Ae:G.isLoading,ze=x.useCallback(async Le=>{const we=A.current;if(!b||!we||T.current||M().isPaused())return!1;let Pe,Me,lt=!0;const it=Le||{},nt=!E[b]||!it.dedupe,Ge=()=>iP?!T.current&&b===N.current&&C.current:b===N.current,at={isValidating:!1,isLoading:!1},ct=()=>{$(at)},se=()=>{const ge=E[b];ge&&ge[1]===Me&&delete E[b]},Fe={isValidating:!0};vn(D().data)&&(Fe.isLoading=!0);try{if(nt&&($(Fe),n.loadingTimeout&&vn(D().data)&&setTimeout(()=>{lt&&Ge()&&M().onLoadingSlow(b,n)},n.loadingTimeout),E[b]=[we(v),DI()]),[Pe,Me]=E[b],Pe=await Pe,nt&&setTimeout(se,n.dedupingInterval),!E[b]||E[b][1]!==Me)return nt&&Ge()&&M().onDiscarded(b),!1;at.error=gi;const ge=g[b];if(!vn(ge)&&(Me<=ge[0]||Me<=ge[1]||ge[1]===0))return ct(),nt&&Ge()&&M().onDiscarded(b),!1;const oe=D().data;at.data=a(oe,Pe)?oe:Pe,nt&&Ge()&&M().onSuccess(Pe,b,n)}catch(ge){se();const oe=M(),{shouldRetryOnError:re}=oe;oe.isPaused()||(at.error=ge,nt&&Ge()&&(oe.onError(ge,b,oe),(re===!0||yl(re)&&re(ge))&&P()&&oe.onErrorRetry(ge,b,oe,J=>{const ue=h[b];ue&&ue[0]&&ue[0](em.ERROR_REVALIDATE_EVENT,J)},{retryCount:(it.retryCount||0)+1,dedupe:!0})))}return lt=!1,ct(),!0},[b,r]),Ue=x.useCallback((...Le)=>Pj(r,N.current,...Le),[]);if(m2(()=>{A.current=t,O.current=n,vn(ie)||(le.current=ie)}),m2(()=>{if(!b)return;const Le=ze.bind(gi,g2);let we=0;const Me=tSe(b,h,(lt,it={})=>{if(lt==em.FOCUS_EVENT){const nt=Date.now();M().revalidateOnFocus&&nt>we&&P()&&(we=nt+M().focusThrottleInterval,Le())}else if(lt==em.RECONNECT_EVENT)M().revalidateOnReconnect&&P()&&Le();else{if(lt==em.MUTATE_EVENT)return ze();if(lt==em.ERROR_REVALIDATE_EVENT)return ze(it)}});return T.current=!1,N.current=b,C.current=!0,$({_k:v}),fe&&(vn(j)||Mh?Le():Fbe(Le)),()=>{T.current=!0,Me()}},[b]),m2(()=>{let Le;function we(){const Me=yl(c)?c(D().data):c;Me&&Le!==-1&&(Le=setTimeout(Pe,Me))}function Pe(){!D().error&&(u||M().isVisible())&&(p||M().isOnline())?ze(g2).then(we):we()}return we(),()=>{Le&&(clearTimeout(Le),Le=-1)}},[c,u,p,b]),x.useDebugValue(Te),i&&vn(j)&&b){if(!iP&&Mh)throw new Error("Fallback data is required when using suspense in SSR.");A.current=t,O.current=n,T.current=!1;const Le=y[b];if(!vn(Le)){const we=Ue(Le);lP(we)}if(vn(F)){const we=ze(g2);vn(Te)||(we.status="fulfilled",we.value=!0),lP(we)}else throw F}return{mutate:Ue,get data(){return W.data=!0,Te},get error(){return W.error=!0,F},get isValidating(){return W.isValidating=!0,Ce},get isLoading(){return W.isLoading=!0,Ne}}},rSe=eSe(nSe);var aSe=e=>{let t={},n=new Date,r=new Date;r.setDate(n.getDate()-1);let a=new Date;a.setDate(n.getDate()-7);let i=new Date;return i.setDate(n.getDate()-30),e.forEach(o=>{let s=new Date(o.createdAt),l=s.toDateString()===n.toDateString(),c=s.toDateString()===r.toDateString(),u=s>=a,p=s>=i,f;l?f="Today":c?f="Yesterday":u?f="Previous 7 days":p?f="Previous 30 days":f=s.toLocaleString("default",{month:"long",year:"numeric"}).split(" ").slice(0,1).join(" "),t[f]||(t[f]=[]),t[f].push(o)}),t},Uj=kn({key:"ThreadIdToResume",default:void 0}),iSe=kn({key:"ChatProfile",default:void 0}),cP=kn({key:"SessionId",default:hj()}),LI=mj({key:"SessionIdSelector",get:({get:e})=>e(cP),set:({set:e},t)=>e(cP,t instanceof vEe?hj():t)}),Bw=kn({key:"Session",dangerouslyAllowMutability:!0,default:void 0}),Uw=kn({key:"Actions",default:[]}),cv=kn({key:"Messages",dangerouslyAllowMutability:!0,default:[]}),$j=kn({key:"TokenCount",default:0}),$w=kn({key:"Loading",default:!1}),uv=kn({key:"AskUser",default:void 0}),oSe=kn({key:"CallFn",default:void 0}),dv=kn({key:"ChatSettings",default:[]}),zj=mj({key:"ChatSettingsValue/Default",get:({get:e})=>e(dv).reduce((t,n)=>(t[n.id]=n.initial,t),{})}),zw=kn({key:"ChatSettingsValue",default:zj}),Hw=kn({key:"DisplayElements",default:[]}),Gw=kn({key:"TasklistElements",default:[]}),pv=kn({key:"FirstUserInteraction",default:void 0}),vd=kn({key:"AccessToken",default:void 0}),sSe=kn({key:"User",default:null}),fv=kn({key:"ThreadHistory",default:{threads:void 0,currentThreadId:void 0,timeGroupedThreads:void 0,pageInfo:void 0},effects:[({setSelf:e,onSet:t})=>{t((n,r)=>{let a=n==null?void 0:n.timeGroupedThreads;n!=null&&n.threads&&!zf.isEqual(n.threads,r==null?void 0:r.timeGroupedThreads)&&(a=aSe(n.threads)),e({...n,timeGroupedThreads:a})})}]}),mv=kn({key:"SideView",default:void 0}),Vw=kn({key:"CurrentThreadId",default:void 0}),au=()=>{let e=yt($w),t=yt(Hw),n=yt(Gw),r=yt(Uw),a=yt(Bw),i=yt(uv),o=yt(dv),s=yt(zw),l=yt(zj),c=(a==null?void 0:a.socket.connected)&&!(a!=null&&a.error),u=!c||e||(i==null?void 0:i.spec.type)==="file"||(i==null?void 0:i.spec.type)==="action";return{actions:r,askUser:i,chatSettingsDefaultValue:l,chatSettingsInputs:o,chatSettingsValue:s,connected:c,disabled:u,elements:t,error:a==null?void 0:a.error,loading:e,tasklists:n}},lSe=e=>{let t=[];for(let n of e)t=Vu(t,n);return t},Vu=(e,t)=>{let n=["assistant_message","user_message","tool"].includes(t.type),r=!t.parentId;if(r&&!n)return e;let a=r?void 0:Yw(e,t.parentId),i=(r||(a==null?void 0:a.type)!=="assistant_message")&&t.type==="tool";if(hv(e,t.id))return kh(e,t.id,t);if(i){let o=e.length>0?e[e.length-1]:void 0,s=(o==null?void 0:o.type)==="assistant_message"&&(o==null?void 0:o.id.startsWith("wrap_"));return o&&s?[...e.slice(0,e.length-1),{...o,steps:[...o.steps||[],t]}]:[...e,{...t,name:"",input:"",output:"",id:"wrap_"+t.id,type:"assistant_message",steps:[t]}]}else return"parentId"in t&&t.parentId?Gj(e,t.parentId,t):"indent"in t&&t.indent&&t.indent>0?Hj(e,t.indent,t):[...e,t]},Hj=(e,t,n,r=0)=>{let a=[...e];if(a.length===0)return[...a,n];{let i=a.length-1,o=a[i];return o.steps=o.steps||[],r+1===t?(o.steps=[...o.steps,n],a[i]={...o},a):(o.steps=Hj(o.steps,t,n,r+1),a[i]={...o},a)}},Gj=(e,t,n)=>{let r=[...e];for(let a=0;a<r.length;a++){let i=r[a];zf.isEqual(i.id,t)?(i.steps=i.steps?[...i.steps,n]:[n],r[a]={...i}):hv(r,t)&&i.steps&&(i.steps=Gj(i.steps,t,n),r[a]={...i})}return r},Yw=(e,t)=>{for(let n of e){if(zf.isEqual(n.id,t))return n;if(n.steps&&n.steps.length>0){let r=Yw(n.steps,t);if(r)return r}}},hv=(e,t)=>Yw(e,t)!==void 0,kh=(e,t,n)=>{let r=[...e];for(let a=0;a<r.length;a++){let i=r[a];zf.isEqual(i.id,t)?r[a]={steps:i.steps,...n}:hv(r,t)&&i.steps&&(i.steps=kh(i.steps,t,n),r[a]={...i})}return r},Vj=(e,t)=>{let n=[...e];for(let r=0;r<n.length;r++){let a=n[r];a.id===t?n=[...n.slice(0,r),...n.slice(r+1)]:hv(n,t)&&a.steps&&(a.steps=Vj(a.steps,t),n[r]={...a})}return n},Yj=(e,t,n,r)=>{let a=[...e];for(let i=0;i<a.length;i++){let o=a[i];zf.isEqual(o.id,t)?("content"in o&&o.content!==void 0?r?o.content=n:o.content+=n:"output"in o&&o.output!==void 0&&(r?o.output=n:o.output+=n),a[i]={...o}):o.steps&&(o.steps=Yj(o.steps,t,n,r),a[i]={...o})}return a},Uo=()=>{let e=yt(vd),t=yt(Bw),n=yt(uv),r=yt(LI),a=PE(dv),i=PE(LI),o=PE(zw),s=Tn(pv),l=Tn($w),c=Tn(cv),u=Tn(Hw),p=Tn(Gw),f=Tn(Uw),h=Tn($j),g=Tn(Uj),E=Tn(mv),y=Tn(Vw),b=x.useCallback(()=>{t==null||t.socket.emit("clear_session"),t==null||t.socket.disconnect(),g(void 0),i(),s(void 0),c([]),u([]),p([]),f([]),h(0),a(),o(),E(void 0),y(void 0)},[t]),v=x.useCallback((P,D)=>{c($=>Vu($,P)),t==null||t.socket.emit("ui_message",{message:P,fileReferences:D})},[t==null?void 0:t.socket]),C=x.useCallback((P,D,$,V)=>{t==null||t.socket.emit("audio_chunk",{isStart:P,mimeType:D,elapsedTime:$,data:V})},[t==null?void 0:t.socket]),T=x.useCallback(P=>{t==null||t.socket.emit("audio_end",{fileReferences:P})},[t==null?void 0:t.socket]),N=x.useCallback(P=>{n&&(c(D=>Vu(D,P)),n.callback(P))},[n]),A=x.useCallback(P=>{t==null||t.socket.emit("chat_settings_change",P)},[t==null?void 0:t.socket]),O=x.useCallback(()=>{c(P=>P.map(D=>(D.streaming=!1,D))),l(!1),t==null||t.socket.emit("stop")},[t==null?void 0:t.socket]),M=x.useCallback(P=>{let D=t==null?void 0:t.socket;if(!D)return;let $=new Promise((V,Z)=>{D.once("action_response",W=>{W.status?V(W):Z(W)})});return D.emit("action_call",P),$},[t==null?void 0:t.socket]);return{uploadFile:x.useCallback((P,D,$)=>P.uploadFile(D,$,r,e),[r,e]),callAction:M,clear:b,replyMessage:N,sendMessage:v,sendAudioChunk:C,endAudioStream:T,stopTask:O,setIdToResume:g,updateChatSettings:A}},hs=()=>{let e=yt(cv),t=yt(pv);return{threadId:yt(Vw),messages:e,firstInteraction:t}},Ul=()=>{let e=yt(LI),[t,n]=xa(Bw),r=PE(zw),a=Tn(pv),i=Tn($w),o=Tn(cv),s=Tn(uv),l=Tn(oSe),c=Tn(Hw),u=Tn(Gw),p=Tn(Uw),f=Tn(dv),h=Tn($j),[g,E]=xa(iSe),y=yt(Uj),b=Tn(Vw),v=x.useCallback(({client:N,userEnv:A,accessToken:O})=>{let M=new URL(N.httpEndpoint).pathname,P=M.endsWith("/")?"ws/socket.io":"/ws/socket.io",D=$E(N.httpEndpoint,{path:`${M}${P}`,extraHeaders:{Authorization:O||"","X-Chainlit-Client-Type":N.type,"X-Chainlit-Session-Id":e,"X-Chainlit-Thread-Id":y||"","user-env":JSON.stringify(A),"X-Chainlit-Chat-Profile":g||""}});n($=>{var V,Z;return(V=$==null?void 0:$.socket)==null||V.removeAllListeners(),(Z=$==null?void 0:$.socket)==null||Z.close(),{socket:D}}),D.on("connect",()=>{D.emit("connection_successful"),n($=>({...$,error:!1}))}),D.on("connect_error",$=>{n(V=>({...V,error:!0}))}),D.on("task_start",()=>{i(!0)}),D.on("task_end",()=>{i(!1)}),D.on("reload",()=>{D.emit("clear_session"),window.location.reload()}),D.on("resume_thread",$=>{var W,ae;let V=[];for(let he of $.steps)V=Vu(V,he);(W=$.metadata)!=null&&W.chat_profile&&E((ae=$.metadata)==null?void 0:ae.chat_profile),o(V);let Z=$.elements||[];u(Z.filter(he=>he.type==="tasklist")),c(Z.filter(he=>["avatar","tasklist"].indexOf(he.type)===-1))}),D.on("new_message",$=>{o(V=>Vu(V,$))}),D.on("first_interaction",$=>{a($.interaction),b($.thread_id)}),D.on("update_message",$=>{o(V=>kh(V,$.id,$))}),D.on("delete_message",$=>{o(V=>Vj(V,$.id))}),D.on("stream_start",$=>{o(V=>Vu(V,$))}),D.on("stream_token",({id:$,token:V,isSequence:Z})=>{o(W=>Yj(W,$,V,Z))}),D.on("ask",({msg:$,spec:V},Z)=>{s({spec:V,callback:Z}),o(W=>Vu(W,$)),i(!1)}),D.on("ask_timeout",()=>{s(void 0),i(!1)}),D.on("clear_ask",()=>{s(void 0)}),D.on("call_fn",({name:$,args:V},Z)=>{let W=new CustomEvent("chainlit-call-fn",{detail:{name:$,args:V,callback:Z}});window.dispatchEvent(W),l({name:$,args:V,callback:Z})}),D.on("clear_call_fn",()=>{l(void 0)}),D.on("call_fn_timeout",()=>{l(void 0)}),D.on("chat_settings",$=>{f($),r()}),D.on("element",$=>{!$.url&&$.chainlitKey&&($.url=N.getElementUrl($.chainlitKey,e)),$.type==="tasklist"?u(V=>{let Z=V.findIndex(W=>W.id===$.id);return Z===-1?[...V,$]:[...V.slice(0,Z),$,...V.slice(Z+1)]}):c(V=>{let Z=V.findIndex(W=>W.id===$.id);return Z===-1?[...V,$]:[...V.slice(0,Z),$,...V.slice(Z+1)]})}),D.on("remove_element",$=>{c(V=>V.filter(Z=>Z.id!==$.id)),u(V=>V.filter(Z=>Z.id!==$.id))}),D.on("action",$=>{p(V=>[...V,$])}),D.on("remove_action",$=>{p(V=>{let Z=V.findIndex(W=>W.id===$.id);return Z===-1?V:[...V.slice(0,Z),...V.slice(Z+1)]})}),D.on("token_usage",$=>{h(V=>V+$)})},[n,e,g]),C=x.useCallback(zf.debounce(v,200),[v]),T=x.useCallback(()=>{t!=null&&t.socket&&(t.socket.removeAllListeners(),t.socket.close())},[t]);return{connect:C,disconnect:T,session:t,sessionId:e,chatProfile:g,idToResume:y,setChatProfile:E}},qw="token";function uP(){try{return localStorage.getItem(qw)}catch{return}}function cSe(e){try{return localStorage.setItem(qw,e)}catch{return}}function qj(){try{return localStorage.removeItem(qw)}catch{return}}var uSe=async(e,t,n)=>{var r;return(r=await e.get(t,n))==null?void 0:r.json()};function gf(e,t,n){let r=yt(vd);return rSe(t?[t,r]:null,([a,i])=>uSe(e,a,i),n)}var dSe=e=>{let{data:t,isLoading:n}=gf(e,"/auth/config"),[r,a]=xa(vd),i=Tn(fv),[o,s]=xa(sSe),l=!!(!n&&t),c=async()=>{await e.logout(),s(null),qj(),a(""),i(void 0)},u=f=>{if(!f){c();return}try{let{exp:h,...g}=_be(f);cSe(f),a(`Bearer ${f}`),s(g)}catch(h){console.error("Invalid token, clearing token from local storage","error:",h),c()}};x.useEffect(()=>{if(!o&&uP()){u(uP());return}},[]);let p=!!r;return t&&!t.requireLogin?{data:t,user:null,isReady:l,isAuthenticated:!0,accessToken:"",logout:()=>{},setAccessToken:()=>{}}:{data:t,user:o,isAuthenticated:p,isReady:l,accessToken:r,logout:c,setAccessToken:u}},MI=class extends Error{constructor(e,t){super(e),this.detail=t}toString(){return this.detail?`${this.message}: ${this.detail}`:this.message}},pSe=class{constructor(e,t,n,r){this.httpEndpoint=e,this.type=t,this.on401=n,this.onError=r}buildEndpoint(e){return this.httpEndpoint.endsWith("/")?`${this.httpEndpoint.slice(0,-1)}${e}`:`${this.httpEndpoint}${e}`}checkToken(e){let t="Bearer ";return e.startsWith(t)?e:t+e}async fetch(e,t,n,r,a){try{let i={};n&&(i.Authorization=this.checkToken(n));let o;r instanceof FormData?o=r:(i["Content-Type"]="application/json",o=r?JSON.stringify(r):null);let s=await fetch(this.buildEndpoint(t),{method:e,headers:i,signal:a,body:o});if(!s.ok){let l=await s.json();throw s.status===401&&this.on401&&(qj(),this.on401()),new MI(s.statusText,l.detail)}return s}catch(i){throw i instanceof MI&&this.onError&&this.onError(i),console.error(i),i}}async get(e,t){return await this.fetch("GET",e,t)}async post(e,t,n,r){return await this.fetch("POST",e,n,t,r)}async put(e,t,n){return await this.fetch("PUT",e,n,t)}async patch(e,t,n){return await this.fetch("PATCH",e,n,t)}async delete(e,t,n){return await this.fetch("DELETE",e,n,t)}},fSe=class extends pSe{async headerAuth(){return(await this.post("/auth/header",{})).json()}async passwordAuth(t){return(await this.post("/login",t)).json()}async logout(){return(await this.post("/logout",{})).json()}async setFeedback(t,n){return(await this.put("/feedback",{feedback:t},n)).json()}async deleteFeedback(t,n){return(await this.delete("/feedback",{feedbackId:t},n)).json()}async listThreads(t,n,r){return(await this.post("/project/threads",{pagination:t,filter:n},r)).json()}async deleteThread(t,n){return(await this.delete("/project/thread",{threadId:t},n)).json()}uploadFile(t,n,r,a){let i=new XMLHttpRequest,o=new Promise((s,l)=>{let c=new FormData;c.append("file",t),i.open("POST",this.buildEndpoint(`/project/file?session_id=${r}`),!0),a&&i.setRequestHeader("Authorization",this.checkToken(a)),i.upload.onprogress=function(u){if(u.lengthComputable){let p=u.loaded/u.total*100;n(p)}},i.onload=function(){if(i.status===200){let u=JSON.parse(i.responseText);s(u)}else l("Upload failed")},i.onerror=function(){l("Upload error")},i.send(c)});return{xhr:i,promise:o}}getElementUrl(t,n){let r=`?session_id=${n}`;return this.buildEndpoint(`/project/file/${t}${r}`)}getLogoEndpoint(t){return this.buildEndpoint(`/logo?theme=${t}`)}getOAuthEndpoint(t){return this.buildEndpoint(`/auth/oauth/${t}`)}};function mSe(e,{insertAt:t}={}){if(!e||typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}mSe(`html[dir=ltr],[data-sonner-toaster][dir=ltr]{--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}html[dir=rtl],[data-sonner-toaster][dir=rtl]{--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999}[data-sonner-toaster][data-x-position=right]{right:max(var(--offset),env(safe-area-inset-right))}[data-sonner-toaster][data-x-position=left]{left:max(var(--offset),env(safe-area-inset-left))}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translate(-50%)}[data-sonner-toaster][data-y-position=top]{top:max(var(--offset),env(safe-area-inset-top))}[data-sonner-toaster][data-y-position=bottom]{bottom:max(var(--offset),env(safe-area-inset-bottom))}[data-sonner-toast]{--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;will-change:transform,opacity,height;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}[data-sonner-toast][data-y-position=top]{top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}[data-sonner-toast] [data-description]{font-weight:400;line-height:1.4;color:inherit}[data-sonner-toast] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast] [data-icon]>*{flex-shrink:0}[data-sonner-toast] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast] [data-button]:focus-visible{box-shadow:0 0 0 2px #0006}[data-sonner-toast] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toast][data-theme=dark] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;background:var(--gray1);color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;opacity:0;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]:focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}[data-sonner-toast] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast]:hover [data-close-button]{opacity:1}[data-sonner-toast]:focus [data-close-button]{opacity:1}[data-sonner-toast]:focus-within [data-close-button]{opacity:1}[data-sonner-toast]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]:before{content:"";position:absolute;left:0;right:0;height:100%}[data-sonner-toast][data-y-position=top][data-swiping=true]:before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]:before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]:before{content:"";position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast]:after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y: translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y: translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]:before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount, 0px));transition:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation:swipe-out .2s ease-out forwards}@keyframes swipe-out{0%{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount)));opacity:1}to{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount) + var(--lift) * -100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;--mobile-offset: 16px;right:var(--mobile-offset);left:var(--mobile-offset);width:100%}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - 32px)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset)}[data-sonner-toaster][data-y-position=bottom]{bottom:20px}[data-sonner-toaster][data-y-position=top]{top:20px}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset);right:var(--mobile-offset);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-rich-colors=true] [data-sonner-toast][data-type=success],[data-rich-colors=true] [data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true] [data-sonner-toast][data-type=info],[data-rich-colors=true] [data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true] [data-sonner-toast][data-type=warning],[data-rich-colors=true] [data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true] [data-sonner-toast][data-type=error],[data-rich-colors=true] [data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
76
+ */var hf=x;function Ebe(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var bbe=typeof Object.is=="function"?Object.is:Ebe,Sbe=hf.useState,vbe=hf.useEffect,ybe=hf.useLayoutEffect,Tbe=hf.useDebugValue;function Cbe(e,t){var n=t(),r=Sbe({inst:{value:n,getSnapshot:t}}),a=r[0].inst,i=r[1];return ybe(function(){a.value=n,a.getSnapshot=t,d2(a)&&i({inst:a})},[e,n,t]),vbe(function(){return d2(a)&&i({inst:a}),e(function(){d2(a)&&i({inst:a})})},[e]),Tbe(n),n}function d2(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!bbe(e,n)}catch{return!0}}function Rbe(e,t){return t()}var xbe=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Rbe:Cbe;wj.useSyncExternalStore=hf.useSyncExternalStore!==void 0?hf.useSyncExternalStore:xbe;Ij.exports=wj;var Abe=Ij.exports;const Tc=()=>{},gi=Tc(),p2=Object,vn=e=>e===gi,yl=e=>typeof e=="function",Hc=(e,t)=>({...e,...t}),Obe=e=>yl(e.then),k1=new WeakMap;let Nbe=0;const Lh=e=>{const t=typeof e,n=e&&e.constructor,r=n==Date;let a,i;if(p2(e)===e&&!r&&n!=RegExp){if(a=k1.get(e),a)return a;if(a=++Nbe+"~",k1.set(e,a),n==Array){for(a="@",i=0;i<e.length;i++)a+=Lh(e[i])+",";k1.set(e,a)}if(n==p2){a="#";const o=p2.keys(e).sort();for(;!vn(i=o.pop());)vn(e[i])||(a+=i+":"+Lh(e[i])+",");k1.set(e,a)}}else a=r?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return a},_l=new WeakMap,f2={},P1={},Pw="undefined",lv=typeof window!=Pw,OI=typeof document!=Pw,Ibe=()=>lv&&typeof window.requestAnimationFrame!=Pw,Dj=(e,t)=>{const n=_l.get(e);return[()=>!vn(t)&&e.get(t)||f2,r=>{if(!vn(t)){const a=e.get(t);t in P1||(P1[t]=a),n[5](t,Hc(a,r),a||f2)}},n[6],()=>!vn(t)&&t in P1?P1[t]:!vn(t)&&e.get(t)||f2]};let NI=!0;const wbe=()=>NI,[II,wI]=lv&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[Tc,Tc],Dbe=()=>{const e=OI&&document.visibilityState;return vn(e)||e!=="hidden"},Lbe=e=>(OI&&document.addEventListener("visibilitychange",e),II("focus",e),()=>{OI&&document.removeEventListener("visibilitychange",e),wI("focus",e)}),Mbe=e=>{const t=()=>{NI=!0,e()},n=()=>{NI=!1};return II("online",t),II("offline",n),()=>{wI("online",t),wI("offline",n)}},kbe={isOnline:wbe,isVisible:Dbe},Pbe={initFocus:Lbe,initReconnect:Mbe},iP=!Oe.useId,Mh=!lv||"Deno"in window,Fbe=e=>Ibe()?window.requestAnimationFrame(e):setTimeout(e,1),m2=Mh?x.useEffect:x.useLayoutEffect,h2=typeof navigator<"u"&&navigator.connection,oP=!Mh&&h2&&(["slow-2g","2g"].includes(h2.effectiveType)||h2.saveData),Fw=e=>{if(yl(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?Lh(e):"",[e,t]};let Bbe=0;const DI=()=>++Bbe,Lj=0,Mj=1,kj=2,Ube=3;var em={__proto__:null,ERROR_REVALIDATE_EVENT:Ube,FOCUS_EVENT:Lj,MUTATE_EVENT:kj,RECONNECT_EVENT:Mj};async function Pj(...e){const[t,n,r,a]=e,i=Hc({populateCache:!0,throwOnError:!0},typeof a=="boolean"?{revalidate:a}:a||{});let o=i.populateCache;const s=i.rollbackOnError;let l=i.optimisticData;const c=i.revalidate!==!1,u=h=>typeof s=="function"?s(h):s!==!1,p=i.throwOnError;if(yl(n)){const h=n,g=[],E=t.keys();for(const y of E)!/^\$(inf|sub)\$/.test(y)&&h(t.get(y)._k)&&g.push(y);return Promise.all(g.map(f))}return f(n);async function f(h){const[g]=Fw(h);if(!g)return;const[E,y]=Dj(t,g),[b,v,C,T]=_l.get(t),N=()=>{const W=b[g];return c&&(delete C[g],delete T[g],W&&W[0])?W[0](kj).then(()=>E().data):E().data};if(e.length<3)return N();let A=r,O;const M=DI();v[g]=[M,0];const P=!vn(l),D=E(),$=D.data,V=D._c,Z=vn(V)?$:V;if(P&&(l=yl(l)?l(Z,$):l,y({data:l,_c:Z})),yl(A))try{A=A(Z)}catch(W){O=W}if(A&&Obe(A))if(A=await A.catch(W=>{O=W}),M!==v[g][0]){if(O)throw O;return A}else O&&P&&u(O)&&(o=!0,y({data:Z,_c:gi}));if(o&&!O)if(yl(o)){const W=o(A,Z);y({data:W,error:gi,_c:gi})}else y({data:A,error:gi,_c:gi});if(v[g][1]=DI(),Promise.resolve(N()).then(()=>{y({_c:gi})}),O){if(p)throw O;return}return A}}const sP=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},$be=(e,t)=>{if(!_l.has(e)){const n=Hc(Pbe,t),r={},a=Pj.bind(gi,e);let i=Tc;const o={},s=(u,p)=>{const f=o[u]||[];return o[u]=f,f.push(p),()=>f.splice(f.indexOf(p),1)},l=(u,p,f)=>{e.set(u,p);const h=o[u];if(h)for(const g of h)g(p,f)},c=()=>{if(!_l.has(e)&&(_l.set(e,[r,{},{},{},a,l,s]),!Mh)){const u=n.initFocus(setTimeout.bind(gi,sP.bind(gi,r,Lj))),p=n.initReconnect(setTimeout.bind(gi,sP.bind(gi,r,Mj)));i=()=>{u&&u(),p&&p(),_l.delete(e)}}};return c(),[e,a,c,i]}return[e,_l.get(e)[4]]},zbe=(e,t,n,r,a)=>{const i=n.errorRetryCount,o=a.retryCount,s=~~((Math.random()+.5)*(1<<(o<8?o:8)))*n.errorRetryInterval;!vn(i)&&o>i||setTimeout(r,s,a)},Hbe=(e,t)=>Lh(e)==Lh(t),[Fj,Gbe]=$be(new Map),Vbe=Hc({onLoadingSlow:Tc,onSuccess:Tc,onError:Tc,onErrorRetry:zbe,onDiscarded:Tc,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:oP?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:oP?5e3:3e3,compare:Hbe,isPaused:()=>!1,cache:Fj,mutate:Gbe,fallback:{}},kbe),Ybe=(e,t)=>{const n=Hc(e,t);if(t){const{use:r,fallback:a}=e,{use:i,fallback:o}=t;r&&i&&(n.use=r.concat(i)),a&&o&&(n.fallback=Hc(a,o))}return n},qbe=x.createContext({}),Wbe="$inf$",Bj=lv&&window.__SWR_DEVTOOLS_USE__,jbe=Bj?window.__SWR_DEVTOOLS_USE__:[],Kbe=()=>{Bj&&(window.__SWR_DEVTOOLS_REACT__=Oe)},Qbe=e=>yl(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],Xbe=()=>Hc(Vbe,x.useContext(qbe)),Zbe=e=>(t,n,r)=>e(t,n&&((...i)=>{const[o]=Fw(t),[,,,s]=_l.get(Fj);if(o.startsWith(Wbe))return n(...i);const l=s[o];return vn(l)?n(...i):(delete s[o],l)}),r),Jbe=jbe.concat(Zbe),eSe=e=>function(...n){const r=Xbe(),[a,i,o]=Qbe(n),s=Ybe(r,o);let l=e;const{use:c}=s,u=(c||[]).concat(Jbe);for(let p=u.length;p--;)l=u[p](l);return l(a,i||s.fetcher||null,s)},tSe=(e,t,n)=>{const r=t[e]||(t[e]=[]);return r.push(n),()=>{const a=r.indexOf(n);a>=0&&(r[a]=r[r.length-1],r.pop())}};Kbe();const lP=Oe.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)}),g2={dedupe:!0},nSe=(e,t,n)=>{const{cache:r,compare:a,suspense:i,fallbackData:o,revalidateOnMount:s,revalidateIfStale:l,refreshInterval:c,refreshWhenHidden:u,refreshWhenOffline:p,keepPreviousData:f}=n,[h,g,E,y]=_l.get(r),[b,v]=Fw(e),C=x.useRef(!1),T=x.useRef(!1),N=x.useRef(b),A=x.useRef(t),O=x.useRef(n),M=()=>O.current,P=()=>M().isVisible()&&M().isOnline(),[D,$,V,Z]=Dj(r,b),W=x.useRef({}).current,ae=vn(o)?n.fallback[b]:o,he=(Le,we)=>{for(const Pe in W){const Me=Pe;if(Me==="data"){if(!a(Le[Me],we[Me])&&(!vn(Le[Me])||!a(Te,we[Me])))return!1}else if(we[Me]!==Le[Me])return!1}return!0},q=x.useMemo(()=>{const Le=(()=>!b||!t?!1:vn(s)?M().isPaused()||i?!1:vn(l)?!0:l:s)(),we=Ge=>{const at=Hc(Ge);return delete at._k,Le?{isValidating:!0,isLoading:!0,...at}:at},Pe=D(),Me=Z(),lt=we(Pe),it=Pe===Me?lt:we(Me);let nt=lt;return[()=>{const Ge=we(D());return he(Ge,nt)?(nt.data=Ge.data,nt.isLoading=Ge.isLoading,nt.isValidating=Ge.isValidating,nt.error=Ge.error,nt):(nt=Ge,Ge)},()=>it]},[r,b]),G=Abe.useSyncExternalStore(x.useCallback(Le=>V(b,(we,Pe)=>{he(Pe,we)||Le()}),[r,b]),q[0],q[1]),H=!C.current,k=h[b]&&h[b].length>0,ie=G.data,j=vn(ie)?ae:ie,F=G.error,le=x.useRef(j),Te=f?vn(ie)?le.current:ie:j,fe=(()=>k&&!vn(F)?!1:H&&!vn(s)?s:M().isPaused()?!1:i?vn(j)?!1:l:vn(j)||l)(),Ae=!!(b&&t&&H&&fe),Ce=vn(G.isValidating)?Ae:G.isValidating,Ne=vn(G.isLoading)?Ae:G.isLoading,ze=x.useCallback(async Le=>{const we=A.current;if(!b||!we||T.current||M().isPaused())return!1;let Pe,Me,lt=!0;const it=Le||{},nt=!E[b]||!it.dedupe,Ge=()=>iP?!T.current&&b===N.current&&C.current:b===N.current,at={isValidating:!1,isLoading:!1},ct=()=>{$(at)},se=()=>{const ge=E[b];ge&&ge[1]===Me&&delete E[b]},Fe={isValidating:!0};vn(D().data)&&(Fe.isLoading=!0);try{if(nt&&($(Fe),n.loadingTimeout&&vn(D().data)&&setTimeout(()=>{lt&&Ge()&&M().onLoadingSlow(b,n)},n.loadingTimeout),E[b]=[we(v),DI()]),[Pe,Me]=E[b],Pe=await Pe,nt&&setTimeout(se,n.dedupingInterval),!E[b]||E[b][1]!==Me)return nt&&Ge()&&M().onDiscarded(b),!1;at.error=gi;const ge=g[b];if(!vn(ge)&&(Me<=ge[0]||Me<=ge[1]||ge[1]===0))return ct(),nt&&Ge()&&M().onDiscarded(b),!1;const oe=D().data;at.data=a(oe,Pe)?oe:Pe,nt&&Ge()&&M().onSuccess(Pe,b,n)}catch(ge){se();const oe=M(),{shouldRetryOnError:re}=oe;oe.isPaused()||(at.error=ge,nt&&Ge()&&(oe.onError(ge,b,oe),(re===!0||yl(re)&&re(ge))&&P()&&oe.onErrorRetry(ge,b,oe,J=>{const ue=h[b];ue&&ue[0]&&ue[0](em.ERROR_REVALIDATE_EVENT,J)},{retryCount:(it.retryCount||0)+1,dedupe:!0})))}return lt=!1,ct(),!0},[b,r]),Ue=x.useCallback((...Le)=>Pj(r,N.current,...Le),[]);if(m2(()=>{A.current=t,O.current=n,vn(ie)||(le.current=ie)}),m2(()=>{if(!b)return;const Le=ze.bind(gi,g2);let we=0;const Me=tSe(b,h,(lt,it={})=>{if(lt==em.FOCUS_EVENT){const nt=Date.now();M().revalidateOnFocus&&nt>we&&P()&&(we=nt+M().focusThrottleInterval,Le())}else if(lt==em.RECONNECT_EVENT)M().revalidateOnReconnect&&P()&&Le();else{if(lt==em.MUTATE_EVENT)return ze();if(lt==em.ERROR_REVALIDATE_EVENT)return ze(it)}});return T.current=!1,N.current=b,C.current=!0,$({_k:v}),fe&&(vn(j)||Mh?Le():Fbe(Le)),()=>{T.current=!0,Me()}},[b]),m2(()=>{let Le;function we(){const Me=yl(c)?c(D().data):c;Me&&Le!==-1&&(Le=setTimeout(Pe,Me))}function Pe(){!D().error&&(u||M().isVisible())&&(p||M().isOnline())?ze(g2).then(we):we()}return we(),()=>{Le&&(clearTimeout(Le),Le=-1)}},[c,u,p,b]),x.useDebugValue(Te),i&&vn(j)&&b){if(!iP&&Mh)throw new Error("Fallback data is required when using suspense in SSR.");A.current=t,O.current=n,T.current=!1;const Le=y[b];if(!vn(Le)){const we=Ue(Le);lP(we)}if(vn(F)){const we=ze(g2);vn(Te)||(we.status="fulfilled",we.value=!0),lP(we)}else throw F}return{mutate:Ue,get data(){return W.data=!0,Te},get error(){return W.error=!0,F},get isValidating(){return W.isValidating=!0,Ce},get isLoading(){return W.isLoading=!0,Ne}}},rSe=eSe(nSe);var aSe=e=>{let t={},n=new Date,r=new Date;r.setDate(n.getDate()-1);let a=new Date;a.setDate(n.getDate()-7);let i=new Date;return i.setDate(n.getDate()-30),e.forEach(o=>{let s=new Date(o.createdAt),l=s.toDateString()===n.toDateString(),c=s.toDateString()===r.toDateString(),u=s>=a,p=s>=i,f;l?f="Today":c?f="Yesterday":u?f="Previous 7 days":p?f="Previous 30 days":f=s.toLocaleString("default",{month:"long",year:"numeric"}).split(" ").slice(0,1).join(" "),t[f]||(t[f]=[]),t[f].push(o)}),t},Uj=kn({key:"ThreadIdToResume",default:void 0}),iSe=kn({key:"ChatProfile",default:void 0}),cP=kn({key:"SessionId",default:hj()}),LI=mj({key:"SessionIdSelector",get:({get:e})=>e(cP),set:({set:e},t)=>e(cP,t instanceof vEe?hj():t)}),Bw=kn({key:"Session",dangerouslyAllowMutability:!0,default:void 0}),Uw=kn({key:"Actions",default:[]}),cv=kn({key:"Messages",dangerouslyAllowMutability:!0,default:[]}),$j=kn({key:"TokenCount",default:0}),$w=kn({key:"Loading",default:!1}),uv=kn({key:"AskUser",default:void 0}),oSe=kn({key:"CallFn",default:void 0}),dv=kn({key:"ChatSettings",default:[]}),zj=mj({key:"ChatSettingsValue/Default",get:({get:e})=>e(dv).reduce((t,n)=>(t[n.id]=n.initial,t),{})}),zw=kn({key:"ChatSettingsValue",default:zj}),Hw=kn({key:"DisplayElements",default:[]}),Gw=kn({key:"TasklistElements",default:[]}),pv=kn({key:"FirstUserInteraction",default:void 0}),vd=kn({key:"AccessToken",default:void 0}),sSe=kn({key:"User",default:null}),fv=kn({key:"ThreadHistory",default:{threads:void 0,currentThreadId:void 0,timeGroupedThreads:void 0,pageInfo:void 0},effects:[({setSelf:e,onSet:t})=>{t((n,r)=>{let a=n==null?void 0:n.timeGroupedThreads;n!=null&&n.threads&&!zf.isEqual(n.threads,r==null?void 0:r.timeGroupedThreads)&&(a=aSe(n.threads)),e({...n,timeGroupedThreads:a})})}]}),mv=kn({key:"SideView",default:void 0}),Vw=kn({key:"CurrentThreadId",default:void 0}),au=()=>{let e=yt($w),t=yt(Hw),n=yt(Gw),r=yt(Uw),a=yt(Bw),i=yt(uv),o=yt(dv),s=yt(zw),l=yt(zj),c=(a==null?void 0:a.socket.connected)&&!(a!=null&&a.error),u=!c||e||(i==null?void 0:i.spec.type)==="file"||(i==null?void 0:i.spec.type)==="action";return{actions:r,askUser:i,chatSettingsDefaultValue:l,chatSettingsInputs:o,chatSettingsValue:s,connected:c,disabled:u,elements:t,error:a==null?void 0:a.error,loading:e,tasklists:n}},lSe=e=>{let t=[];for(let n of e)t=Vu(t,n);return t},Vu=(e,t)=>{let n=["assistant_message","user_message","tool"].includes(t.type),r=!t.parentId;if(r&&!n)return e;let a=r?void 0:Yw(e,t.parentId),i=(r||(a==null?void 0:a.type)!=="assistant_message")&&t.type==="tool";if(hv(e,t.id))return kh(e,t.id,t);if(i){let o=e.length>0?e[e.length-1]:void 0,s=(o==null?void 0:o.type)==="assistant_message"&&(o==null?void 0:o.id.startsWith("wrap_"));return o&&s?[...e.slice(0,e.length-1),{...o,steps:[...o.steps||[],t]}]:[...e,{...t,name:"",input:"",output:"",id:"wrap_"+t.id,type:"assistant_message",steps:[t]}]}else return"parentId"in t&&t.parentId?Gj(e,t.parentId,t):"indent"in t&&t.indent&&t.indent>0?Hj(e,t.indent,t):[...e,t]},Hj=(e,t,n,r=0)=>{let a=[...e];if(a.length===0)return[...a,n];{let i=a.length-1,o=a[i];return o.steps=o.steps||[],r+1===t?(o.steps=[...o.steps,n],a[i]={...o},a):(o.steps=Hj(o.steps,t,n,r+1),a[i]={...o},a)}},Gj=(e,t,n)=>{let r=[...e];for(let a=0;a<r.length;a++){let i=r[a];zf.isEqual(i.id,t)?(i.steps=i.steps?[...i.steps,n]:[n],r[a]={...i}):hv(r,t)&&i.steps&&(i.steps=Gj(i.steps,t,n),r[a]={...i})}return r},Yw=(e,t)=>{for(let n of e){if(zf.isEqual(n.id,t))return n;if(n.steps&&n.steps.length>0){let r=Yw(n.steps,t);if(r)return r}}},hv=(e,t)=>Yw(e,t)!==void 0,kh=(e,t,n)=>{let r=[...e];for(let a=0;a<r.length;a++){let i=r[a];zf.isEqual(i.id,t)?r[a]={steps:i.steps,...n}:hv(r,t)&&i.steps&&(i.steps=kh(i.steps,t,n),r[a]={...i})}return r},Vj=(e,t)=>{let n=[...e];for(let r=0;r<n.length;r++){let a=n[r];a.id===t?n=[...n.slice(0,r),...n.slice(r+1)]:hv(n,t)&&a.steps&&(a.steps=Vj(a.steps,t),n[r]={...a})}return n},Yj=(e,t,n,r)=>{let a=[...e];for(let i=0;i<a.length;i++){let o=a[i];zf.isEqual(o.id,t)?("content"in o&&o.content!==void 0?r?o.content=n:o.content+=n:"output"in o&&o.output!==void 0&&(r?o.output=n:o.output+=n),a[i]={...o}):o.steps&&(o.steps=Yj(o.steps,t,n,r),a[i]={...o})}return a},Uo=()=>{let e=yt(vd),t=yt(Bw),n=yt(uv),r=yt(LI),a=PE(dv),i=PE(LI),o=PE(zw),s=Tn(pv),l=Tn($w),c=Tn(cv),u=Tn(Hw),p=Tn(Gw),f=Tn(Uw),h=Tn($j),g=Tn(Uj),E=Tn(mv),y=Tn(Vw),b=x.useCallback(()=>{t==null||t.socket.emit("clear_session"),t==null||t.socket.disconnect(),g(void 0),i(),s(void 0),c([]),u([]),p([]),f([]),h(0),a(),o(),E(void 0),y(void 0)},[t]),v=x.useCallback((P,D)=>{c($=>Vu($,P)),t==null||t.socket.emit("ui_message",{message:P,fileReferences:D})},[t==null?void 0:t.socket]),C=x.useCallback((P,D,$,V)=>{t==null||t.socket.emit("audio_chunk",{isStart:P,mimeType:D,elapsedTime:$,data:V})},[t==null?void 0:t.socket]),T=x.useCallback(P=>{t==null||t.socket.emit("audio_end",{fileReferences:P})},[t==null?void 0:t.socket]),N=x.useCallback(P=>{n&&(c(D=>Vu(D,P)),n.callback(P))},[n]),A=x.useCallback(P=>{t==null||t.socket.emit("chat_settings_change",P)},[t==null?void 0:t.socket]),O=x.useCallback(()=>{c(P=>P.map(D=>(D.streaming=!1,D))),l(!1),t==null||t.socket.emit("stop")},[t==null?void 0:t.socket]),M=x.useCallback(P=>{let D=t==null?void 0:t.socket;if(!D)return;let $=new Promise((V,Z)=>{D.once("action_response",W=>{W.status?V(W):Z(W)})});return D.emit("action_call",P),$},[t==null?void 0:t.socket]);return{uploadFile:x.useCallback((P,D,$)=>P.uploadFile(D,$,r,e),[r,e]),callAction:M,clear:b,replyMessage:N,sendMessage:v,sendAudioChunk:C,endAudioStream:T,stopTask:O,setIdToResume:g,updateChatSettings:A}},hs=()=>{let e=yt(cv),t=yt(pv);return{threadId:yt(Vw),messages:e,firstInteraction:t}},Ul=()=>{let e=yt(LI),[t,n]=xa(Bw),r=PE(zw),a=Tn(pv),i=Tn($w),o=Tn(cv),s=Tn(uv),l=Tn(oSe),c=Tn(Hw),u=Tn(Gw),p=Tn(Uw),f=Tn(dv),h=Tn($j),[g,E]=xa(iSe),y=yt(Uj),b=Tn(Vw),v=x.useCallback(({client:N,userEnv:A,accessToken:O})=>{let M=new URL(N.httpEndpoint).pathname,P=M.endsWith("/")?"ws/socket.io":"/ws/socket.io",D=$E(N.httpEndpoint,{path:`${M}${P}`,extraHeaders:{Authorization:O||"","X-Chainlit-Client-Type":N.type,"X-Chainlit-Session-Id":e,"X-Chainlit-Thread-Id":y||"","user-env":JSON.stringify(A),"X-Chainlit-Chat-Profile":g?encodeURIComponent(g):""}});n($=>{var V,Z;return(V=$==null?void 0:$.socket)==null||V.removeAllListeners(),(Z=$==null?void 0:$.socket)==null||Z.close(),{socket:D}}),D.on("connect",()=>{D.emit("connection_successful"),n($=>({...$,error:!1}))}),D.on("connect_error",$=>{n(V=>({...V,error:!0}))}),D.on("task_start",()=>{i(!0)}),D.on("task_end",()=>{i(!1)}),D.on("reload",()=>{D.emit("clear_session"),window.location.reload()}),D.on("resume_thread",$=>{var W,ae;let V=[];for(let he of $.steps)V=Vu(V,he);(W=$.metadata)!=null&&W.chat_profile&&E((ae=$.metadata)==null?void 0:ae.chat_profile),o(V);let Z=$.elements||[];u(Z.filter(he=>he.type==="tasklist")),c(Z.filter(he=>["avatar","tasklist"].indexOf(he.type)===-1))}),D.on("new_message",$=>{o(V=>Vu(V,$))}),D.on("first_interaction",$=>{a($.interaction),b($.thread_id)}),D.on("update_message",$=>{o(V=>kh(V,$.id,$))}),D.on("delete_message",$=>{o(V=>Vj(V,$.id))}),D.on("stream_start",$=>{o(V=>Vu(V,$))}),D.on("stream_token",({id:$,token:V,isSequence:Z})=>{o(W=>Yj(W,$,V,Z))}),D.on("ask",({msg:$,spec:V},Z)=>{s({spec:V,callback:Z}),o(W=>Vu(W,$)),i(!1)}),D.on("ask_timeout",()=>{s(void 0),i(!1)}),D.on("clear_ask",()=>{s(void 0)}),D.on("call_fn",({name:$,args:V},Z)=>{let W=new CustomEvent("chainlit-call-fn",{detail:{name:$,args:V,callback:Z}});window.dispatchEvent(W),l({name:$,args:V,callback:Z})}),D.on("clear_call_fn",()=>{l(void 0)}),D.on("call_fn_timeout",()=>{l(void 0)}),D.on("chat_settings",$=>{f($),r()}),D.on("element",$=>{!$.url&&$.chainlitKey&&($.url=N.getElementUrl($.chainlitKey,e)),$.type==="tasklist"?u(V=>{let Z=V.findIndex(W=>W.id===$.id);return Z===-1?[...V,$]:[...V.slice(0,Z),$,...V.slice(Z+1)]}):c(V=>{let Z=V.findIndex(W=>W.id===$.id);return Z===-1?[...V,$]:[...V.slice(0,Z),$,...V.slice(Z+1)]})}),D.on("remove_element",$=>{c(V=>V.filter(Z=>Z.id!==$.id)),u(V=>V.filter(Z=>Z.id!==$.id))}),D.on("action",$=>{p(V=>[...V,$])}),D.on("remove_action",$=>{p(V=>{let Z=V.findIndex(W=>W.id===$.id);return Z===-1?V:[...V.slice(0,Z),...V.slice(Z+1)]})}),D.on("token_usage",$=>{h(V=>V+$)})},[n,e,g]),C=x.useCallback(zf.debounce(v,200),[v]),T=x.useCallback(()=>{t!=null&&t.socket&&(t.socket.removeAllListeners(),t.socket.close())},[t]);return{connect:C,disconnect:T,session:t,sessionId:e,chatProfile:g,idToResume:y,setChatProfile:E}},qw="token";function uP(){try{return localStorage.getItem(qw)}catch{return}}function cSe(e){try{return localStorage.setItem(qw,e)}catch{return}}function qj(){try{return localStorage.removeItem(qw)}catch{return}}var uSe=async(e,t,n)=>{var r;return(r=await e.get(t,n))==null?void 0:r.json()};function gf(e,t,n){let r=yt(vd);return rSe(t?[t,r]:null,([a,i])=>uSe(e,a,i),n)}var dSe=e=>{let{data:t,isLoading:n}=gf(e,"/auth/config"),[r,a]=xa(vd),i=Tn(fv),[o,s]=xa(sSe),l=!!(!n&&t),c=async()=>{await e.logout(),s(null),qj(),a(""),i(void 0)},u=f=>{if(!f){c();return}try{let{exp:h,...g}=_be(f);cSe(f),a(`Bearer ${f}`),s(g)}catch(h){console.error("Invalid token, clearing token from local storage","error:",h),c()}};x.useEffect(()=>{if(!o&&uP()){u(uP());return}},[]);let p=!!r;return t&&!t.requireLogin?{data:t,user:null,isReady:l,isAuthenticated:!0,accessToken:"",logout:()=>{},setAccessToken:()=>{}}:{data:t,user:o,isAuthenticated:p,isReady:l,accessToken:r,logout:c,setAccessToken:u}},MI=class extends Error{constructor(e,t){super(e),this.detail=t}toString(){return this.detail?`${this.message}: ${this.detail}`:this.message}},pSe=class{constructor(e,t,n,r){this.httpEndpoint=e,this.type=t,this.on401=n,this.onError=r}buildEndpoint(e){return this.httpEndpoint.endsWith("/")?`${this.httpEndpoint.slice(0,-1)}${e}`:`${this.httpEndpoint}${e}`}checkToken(e){let t="Bearer ";return e.startsWith(t)?e:t+e}async fetch(e,t,n,r,a){try{let i={};n&&(i.Authorization=this.checkToken(n));let o;r instanceof FormData?o=r:(i["Content-Type"]="application/json",o=r?JSON.stringify(r):null);let s=await fetch(this.buildEndpoint(t),{method:e,headers:i,signal:a,body:o});if(!s.ok){let l=await s.json();throw s.status===401&&this.on401&&(qj(),this.on401()),new MI(s.statusText,l.detail)}return s}catch(i){throw i instanceof MI&&this.onError&&this.onError(i),console.error(i),i}}async get(e,t){return await this.fetch("GET",e,t)}async post(e,t,n,r){return await this.fetch("POST",e,n,t,r)}async put(e,t,n){return await this.fetch("PUT",e,n,t)}async patch(e,t,n){return await this.fetch("PATCH",e,n,t)}async delete(e,t,n){return await this.fetch("DELETE",e,n,t)}},fSe=class extends pSe{async headerAuth(){return(await this.post("/auth/header",{})).json()}async passwordAuth(t){return(await this.post("/login",t)).json()}async logout(){return(await this.post("/logout",{})).json()}async setFeedback(t,n){return(await this.put("/feedback",{feedback:t},n)).json()}async deleteFeedback(t,n){return(await this.delete("/feedback",{feedbackId:t},n)).json()}async listThreads(t,n,r){return(await this.post("/project/threads",{pagination:t,filter:n},r)).json()}async deleteThread(t,n){return(await this.delete("/project/thread",{threadId:t},n)).json()}uploadFile(t,n,r,a){let i=new XMLHttpRequest,o=new Promise((s,l)=>{let c=new FormData;c.append("file",t),i.open("POST",this.buildEndpoint(`/project/file?session_id=${r}`),!0),a&&i.setRequestHeader("Authorization",this.checkToken(a)),i.upload.onprogress=function(u){if(u.lengthComputable){let p=u.loaded/u.total*100;n(p)}},i.onload=function(){if(i.status===200){let u=JSON.parse(i.responseText);s(u)}else l("Upload failed")},i.onerror=function(){l("Upload error")},i.send(c)});return{xhr:i,promise:o}}getElementUrl(t,n){let r=`?session_id=${n}`;return this.buildEndpoint(`/project/file/${t}${r}`)}getLogoEndpoint(t){return this.buildEndpoint(`/logo?theme=${t}`)}getOAuthEndpoint(t){return this.buildEndpoint(`/auth/oauth/${t}`)}};function mSe(e,{insertAt:t}={}){if(!e||typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}mSe(`html[dir=ltr],[data-sonner-toaster][dir=ltr]{--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}html[dir=rtl],[data-sonner-toaster][dir=rtl]{--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999}[data-sonner-toaster][data-x-position=right]{right:max(var(--offset),env(safe-area-inset-right))}[data-sonner-toaster][data-x-position=left]{left:max(var(--offset),env(safe-area-inset-left))}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translate(-50%)}[data-sonner-toaster][data-y-position=top]{top:max(var(--offset),env(safe-area-inset-top))}[data-sonner-toaster][data-y-position=bottom]{bottom:max(var(--offset),env(safe-area-inset-bottom))}[data-sonner-toast]{--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;will-change:transform,opacity,height;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}[data-sonner-toast][data-y-position=top]{top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}[data-sonner-toast] [data-description]{font-weight:400;line-height:1.4;color:inherit}[data-sonner-toast] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast] [data-icon]>*{flex-shrink:0}[data-sonner-toast] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast] [data-button]:focus-visible{box-shadow:0 0 0 2px #0006}[data-sonner-toast] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toast][data-theme=dark] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;background:var(--gray1);color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;opacity:0;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]:focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}[data-sonner-toast] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast]:hover [data-close-button]{opacity:1}[data-sonner-toast]:focus [data-close-button]{opacity:1}[data-sonner-toast]:focus-within [data-close-button]{opacity:1}[data-sonner-toast]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]:before{content:"";position:absolute;left:0;right:0;height:100%}[data-sonner-toast][data-y-position=top][data-swiping=true]:before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]:before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]:before{content:"";position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast]:after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y: translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y: translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]:before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount, 0px));transition:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation:swipe-out .2s ease-out forwards}@keyframes swipe-out{0%{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount)));opacity:1}to{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount) + var(--lift) * -100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;--mobile-offset: 16px;right:var(--mobile-offset);left:var(--mobile-offset);width:100%}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - 32px)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset)}[data-sonner-toaster][data-y-position=bottom]{bottom:20px}[data-sonner-toaster][data-y-position=top]{top:20px}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset);right:var(--mobile-offset);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-rich-colors=true] [data-sonner-toast][data-type=success],[data-rich-colors=true] [data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true] [data-sonner-toast][data-type=info],[data-rich-colors=true] [data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true] [data-sonner-toast][data-type=warning],[data-rich-colors=true] [data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true] [data-sonner-toast][data-type=error],[data-rich-colors=true] [data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
77
77
  `);var hSe=e=>{switch(e){case"success":return ESe;case"info":return SSe;case"warning":return bSe;case"error":return vSe;default:return null}},gSe=Array(12).fill(0),_Se=({visible:e})=>Oe.createElement("div",{className:"sonner-loading-wrapper","data-visible":e},Oe.createElement("div",{className:"sonner-spinner"},gSe.map((t,n)=>Oe.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),ESe=Oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Oe.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),bSe=Oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Oe.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),SSe=Oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Oe.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),vSe=Oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Oe.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),kI=1,ySe=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,a=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:kI++,i=this.toasts.find(s=>s.id===a),o=e.dismissible===void 0?!0:e.dismissible;return i?this.toasts=this.toasts.map(s=>s.id===a?(this.publish({...s,...e,id:a,title:n}),{...s,...e,id:a,dismissible:o,title:n}):s):this.addToast({title:n,...r,dismissible:o,id:a}),a},this.dismiss=e=>(e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading}));let r=e instanceof Promise?e:e(),a=n!==void 0;return r.then(i=>{if(i&&typeof i.ok=="boolean"&&!i.ok){a=!1;let o=typeof t.error=="function"?t.error(`HTTP error! status: ${i.status}`):t.error;this.create({id:n,type:"error",message:o})}else if(t.success!==void 0){a=!1;let o=typeof t.success=="function"?t.success(i):t.success;this.create({id:n,type:"success",message:o})}}).catch(i=>{if(t.error!==void 0){a=!1;let o=typeof t.error=="function"?t.error(i):t.error;this.create({id:n,type:"error",message:o})}}).finally(()=>{var i;a&&(this.dismiss(n),n=void 0),(i=t.finally)==null||i.call(t)}),n},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||kI++;return this.create({jsx:e(n),id:n,...t}),n},this.subscribers=[],this.toasts=[]}},es=new ySe,TSe=(e,t)=>{let n=(t==null?void 0:t.id)||kI++;return es.addToast({title:e,...t,id:n}),n},CSe=TSe,oa=Object.assign(CSe,{success:es.success,info:es.info,warning:es.warning,error:es.error,custom:es.custom,message:es.message,promise:es.promise,dismiss:es.dismiss,loading:es.loading}),RSe=3,xSe="32px",ASe=4e3,OSe=356,Wj=14,NSe=20,ISe=200;function Cu(...e){return e.filter(Boolean).join(" ")}var wSe=e=>{var t,n,r,a,i,o,s;let{invert:l,toast:c,interacting:u,setHeights:p,visibleToasts:f,heights:h,index:g,toasts:E,expanded:y,removeToast:b,closeButton:v,style:C,cancelButtonStyle:T,actionButtonStyle:N,className:A="",descriptionClassName:O="",duration:M,position:P,gap:D=Wj,loadingIcon:$,expandByDefault:V,classNames:Z}=e,[W,ae]=Oe.useState(!1),[he,q]=Oe.useState(!1),[G,H]=Oe.useState(!1),[k,ie]=Oe.useState(!1),[j,F]=Oe.useState(0),[le,Te]=Oe.useState(0),fe=Oe.useRef(null),Ae=Oe.useRef(null),Ce=g===0,Ne=g+1<=f,ze=c.type,Ue=c.dismissible!==!1,Le=c.className||"",we=c.descriptionClassName||"",Pe=Oe.useMemo(()=>h.findIndex(J=>J.toastId===c.id)||0,[h,c.id]),Me=Oe.useMemo(()=>c.duration||M||ASe,[c.duration,M]),lt=Oe.useRef(0),it=Oe.useRef(0);Oe.useRef(Me);let nt=Oe.useRef(0),Ge=Oe.useRef(null),[at,ct]=P.split("-"),se=Oe.useMemo(()=>h.reduce((J,ue,ve)=>ve>=Pe?J:J+ue.height,0),[h,Pe]),Fe=c.invert||l,ge=ze==="loading";it.current=Oe.useMemo(()=>Pe*D+se,[Pe,se]),Oe.useEffect(()=>{ae(!0)},[]),Oe.useLayoutEffect(()=>{if(!W)return;let J=Ae.current,ue=J.style.height;J.style.height="auto";let ve=J.getBoundingClientRect().height;J.style.height=ue,Te(ve),p(Ve=>Ve.find(ot=>ot.toastId===c.id)?Ve.map(ot=>ot.toastId===c.id?{...ot,height:ve}:ot):[{toastId:c.id,height:ve},...Ve])},[W,c.title,c.description,p,c.id]);let oe=Oe.useCallback(()=>{q(!0),F(it.current),p(J=>J.filter(ue=>ue.toastId!==c.id)),setTimeout(()=>{b(c)},ISe)},[c,b,p,it]);Oe.useEffect(()=>{if(c.promise&&ze==="loading"||c.duration===1/0)return;let J,ue=Me;return y||u?(()=>{if(nt.current<lt.current){let ve=new Date().getTime()-lt.current;ue=ue-ve}nt.current=new Date().getTime()})():(lt.current=new Date().getTime(),J=setTimeout(()=>{var ve;(ve=c.onAutoClose)==null||ve.call(c,c),oe()},ue)),()=>clearTimeout(J)},[y,u,V,c,Me,oe,c.promise,ze]),Oe.useEffect(()=>{let J=Ae.current;if(J){let ue=J.getBoundingClientRect().height;return Te(ue),p(ve=>[{toastId:c.id,height:ue},...ve]),()=>p(ve=>ve.filter(Ve=>Ve.toastId!==c.id))}},[p,c.id]),Oe.useEffect(()=>{c.delete&&oe()},[oe,c.delete]);function re(){var J;return $?Oe.createElement("div",{className:Cu("loader",Z==null?void 0:Z.toast,(J=c==null?void 0:c.classNames)==null?void 0:J.toast),"data-visible":ze==="loading"},$):Oe.createElement(_Se,{visible:ze==="loading"})}return Oe.createElement("li",{"aria-live":c.important?"assertive":"polite","aria-atomic":"true",role:"status",tabIndex:0,ref:Ae,className:Cu(A,Le,Z==null?void 0:Z.toast,(t=c==null?void 0:c.classNames)==null?void 0:t.toast,Z==null?void 0:Z[ze],(n=c==null?void 0:c.classNames)==null?void 0:n[ze]),"data-sonner-toast":"","data-styled":!(c.jsx||c.unstyled),"data-mounted":W,"data-promise":!!c.promise,"data-removed":he,"data-visible":Ne,"data-y-position":at,"data-x-position":ct,"data-index":g,"data-front":Ce,"data-swiping":G,"data-dismissible":Ue,"data-type":ze,"data-invert":Fe,"data-swipe-out":k,"data-expanded":!!(y||V&&W),style:{"--index":g,"--toasts-before":g,"--z-index":E.length-g,"--offset":`${he?j:it.current}px`,"--initial-height":V?"auto":`${le}px`,...C,...c.style},onPointerDown:J=>{ge||!Ue||(fe.current=new Date,F(it.current),J.target.setPointerCapture(J.pointerId),J.target.tagName!=="BUTTON"&&(H(!0),Ge.current={x:J.clientX,y:J.clientY}))},onPointerUp:()=>{var J,ue,ve,Ve;if(k||!Ue)return;Ge.current=null;let ot=Number(((J=Ae.current)==null?void 0:J.style.getPropertyValue("--swipe-amount").replace("px",""))||0),qe=new Date().getTime()-((ue=fe.current)==null?void 0:ue.getTime()),Et=Math.abs(ot)/qe;if(Math.abs(ot)>=NSe||Et>.11){F(it.current),(ve=c.onDismiss)==null||ve.call(c,c),oe(),ie(!0);return}(Ve=Ae.current)==null||Ve.style.setProperty("--swipe-amount","0px"),H(!1)},onPointerMove:J=>{var ue;if(!Ge.current||!Ue)return;let ve=J.clientY-Ge.current.y,Ve=J.clientX-Ge.current.x,ot=(at==="top"?Math.min:Math.max)(0,ve),qe=J.pointerType==="touch"?10:2;Math.abs(ot)>qe?(ue=Ae.current)==null||ue.style.setProperty("--swipe-amount",`${ve}px`):Math.abs(Ve)>qe&&(Ge.current=null)}},v&&!c.jsx?Oe.createElement("button",{"aria-label":"Close toast","data-disabled":ge,"data-close-button":!0,onClick:ge||!Ue?()=>{}:()=>{var J;oe(),(J=c.onDismiss)==null||J.call(c,c)},className:Cu(Z==null?void 0:Z.closeButton,(r=c==null?void 0:c.classNames)==null?void 0:r.closeButton)},Oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},Oe.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Oe.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))):null,c.jsx||Oe.isValidElement(c.title)?c.jsx||c.title:Oe.createElement(Oe.Fragment,null,ze||c.icon||c.promise?Oe.createElement("div",{"data-icon":""},(c.promise||c.type==="loading")&&!c.icon?re():null,c.icon||hSe(ze)):null,Oe.createElement("div",{"data-content":""},Oe.createElement("div",{"data-title":"",className:Cu(Z==null?void 0:Z.title,(a=c==null?void 0:c.classNames)==null?void 0:a.title)},c.title),c.description?Oe.createElement("div",{"data-description":"",className:Cu(O,we,Z==null?void 0:Z.description,(i=c==null?void 0:c.classNames)==null?void 0:i.description)},c.description):null),c.cancel?Oe.createElement("button",{"data-button":!0,"data-cancel":!0,style:c.cancelButtonStyle||T,onClick:()=>{var J;Ue&&(oe(),(J=c.cancel)!=null&&J.onClick&&c.cancel.onClick())},className:Cu(Z==null?void 0:Z.cancelButton,(o=c==null?void 0:c.classNames)==null?void 0:o.cancelButton)},c.cancel.label):null,c.action?Oe.createElement("button",{"data-button":"",style:c.actionButtonStyle||N,onClick:J=>{var ue;(ue=c.action)==null||ue.onClick(J),!J.defaultPrevented&&oe()},className:Cu(Z==null?void 0:Z.actionButton,(s=c==null?void 0:c.classNames)==null?void 0:s.actionButton)},c.action.label):null))};function dP(){if(typeof window>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}var DSe=e=>{let{invert:t,position:n="bottom-right",hotkey:r=["altKey","KeyT"],expand:a,closeButton:i,className:o,offset:s,theme:l="light",richColors:c,duration:u,style:p,visibleToasts:f=RSe,toastOptions:h,dir:g=dP(),gap:E,loadingIcon:y}=e,[b,v]=Oe.useState([]),C=Oe.useMemo(()=>Array.from(new Set([n].concat(b.filter(q=>q.position).map(q=>q.position)))),[b,n]),[T,N]=Oe.useState([]),[A,O]=Oe.useState(!1),[M,P]=Oe.useState(!1),[D,$]=Oe.useState(l!=="system"?l:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),V=Oe.useRef(null),Z=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),W=Oe.useRef(null),ae=Oe.useRef(!1),he=Oe.useCallback(q=>v(G=>G.filter(({id:H})=>H!==q.id)),[]);return Oe.useEffect(()=>es.subscribe(q=>{if(q.dismiss){v(G=>G.map(H=>H.id===q.id?{...H,delete:!0}:H));return}setTimeout(()=>{Lp.flushSync(()=>{v(G=>{let H=G.findIndex(k=>k.id===q.id);return H!==-1?[...G.slice(0,H),{...G[H],...q},...G.slice(H+1)]:[q,...G]})})})}),[]),Oe.useEffect(()=>{if(l!=="system"){$(l);return}l==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?$("dark"):$("light")),typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",({matches:q})=>{$(q?"dark":"light")})},[l]),Oe.useEffect(()=>{b.length<=1&&O(!1)},[b]),Oe.useEffect(()=>{let q=G=>{var H,k;r.every(ie=>G[ie]||G.code===ie)&&(O(!0),(H=V.current)==null||H.focus()),G.code==="Escape"&&(document.activeElement===V.current||(k=V.current)!=null&&k.contains(document.activeElement))&&O(!1)};return document.addEventListener("keydown",q),()=>document.removeEventListener("keydown",q)},[r]),Oe.useEffect(()=>{if(V.current)return()=>{W.current&&(W.current.focus({preventScroll:!0}),W.current=null,ae.current=!1)}},[V.current]),b.length?Oe.createElement("section",{"aria-label":`Notifications ${Z}`,tabIndex:-1},C.map((q,G)=>{var H;let[k,ie]=q.split("-");return Oe.createElement("ol",{key:q,dir:g==="auto"?dP():g,tabIndex:-1,ref:V,className:o,"data-sonner-toaster":!0,"data-theme":D,"data-rich-colors":c,"data-y-position":k,"data-x-position":ie,style:{"--front-toast-height":`${(H=T[0])==null?void 0:H.height}px`,"--offset":typeof s=="number"?`${s}px`:s||xSe,"--width":`${OSe}px`,"--gap":`${Wj}px`,...p},onBlur:j=>{ae.current&&!j.currentTarget.contains(j.relatedTarget)&&(ae.current=!1,W.current&&(W.current.focus({preventScroll:!0}),W.current=null))},onFocus:j=>{j.target instanceof HTMLElement&&j.target.dataset.dismissible==="false"||ae.current||(ae.current=!0,W.current=j.relatedTarget)},onMouseEnter:()=>O(!0),onMouseMove:()=>O(!0),onMouseLeave:()=>{M||O(!1)},onPointerDown:j=>{j.target instanceof HTMLElement&&j.target.dataset.dismissible==="false"||P(!0)},onPointerUp:()=>P(!1)},b.filter(j=>!j.position&&G===0||j.position===q).map((j,F)=>{var le;return Oe.createElement(wSe,{key:j.id,index:F,toast:j,duration:(le=h==null?void 0:h.duration)!=null?le:u,className:h==null?void 0:h.className,descriptionClassName:h==null?void 0:h.descriptionClassName,invert:t,visibleToasts:f,closeButton:i,interacting:M,position:q,style:h==null?void 0:h.style,classNames:h==null?void 0:h.classNames,cancelButtonStyle:h==null?void 0:h.cancelButtonStyle,actionButtonStyle:h==null?void 0:h.actionButtonStyle,removeToast:he,toasts:b,heights:T,setHeights:N,expandByDefault:a,gap:E,loadingIcon:y,expanded:A})}))})):null};const LSe=window.origin,pP=new URL(LSe),MSe=`${pP.protocol}//${pP.host}`,kSe=()=>{window.location.pathname!=="/login"&&(window.location.href="/login")},PSe=e=>{oa.error(e.toString())},FSe=new fSe(MSe,"webapp",kSe,PSe),ca=kn({key:"ApiClient",default:FSe});function gs(){const e=yt(ca);return dSe(e)}/**
78
78
  * @remix-run/router v1.8.0
79
79
  *
@@ -336,7 +336,7 @@ function print() { __p += __j.call(arguments, '') }
336
336
  *
337
337
  * This source code is licensed under the MIT license found in the
338
338
  * LICENSE file in the root directory of this source tree.
339
- */var xf=x;function F6e(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var B6e=typeof Object.is=="function"?Object.is:F6e,U6e=xf.useState,$6e=xf.useEffect,z6e=xf.useLayoutEffect,H6e=xf.useDebugValue;function G6e(e,t){var n=t(),r=U6e({inst:{value:n,getSnapshot:t}}),a=r[0].inst,i=r[1];return z6e(function(){a.value=n,a.getSnapshot=t,L2(a)&&i({inst:a})},[e,n,t]),$6e(function(){return L2(a)&&i({inst:a}),e(function(){L2(a)&&i({inst:a})})},[e]),H6e(n),n}function L2(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!B6e(e,n)}catch{return!0}}function V6e(e,t){return t()}var Y6e=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?V6e:G6e;ZQ.useSyncExternalStore=xf.useSyncExternalStore!==void 0?xf.useSyncExternalStore:Y6e;XQ.exports=ZQ;var q6e=XQ.exports;const Rc=()=>{},_i=Rc(),M2=Object,yn=e=>e===_i,Tl=e=>typeof e=="function",Wc=(e,t)=>({...e,...t}),W6e=e=>Tl(e.then),X1=new WeakMap;let j6e=0;const Yh=e=>{const t=typeof e,n=e&&e.constructor,r=n==Date;let a,i;if(M2(e)===e&&!r&&n!=RegExp){if(a=X1.get(e),a)return a;if(a=++j6e+"~",X1.set(e,a),n==Array){for(a="@",i=0;i<e.length;i++)a+=Yh(e[i])+",";X1.set(e,a)}if(n==M2){a="#";const o=M2.keys(e).sort();for(;!yn(i=o.pop());)yn(e[i])||(a+=i+":"+Yh(e[i])+",");X1.set(e,a)}}else a=r?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return a},bl=new WeakMap,k2={},Z1={},k5="undefined",gy=typeof window!=k5,a4=typeof document!=k5,K6e=()=>gy&&typeof window.requestAnimationFrame!=k5,JQ=(e,t)=>{const n=bl.get(e);return[()=>!yn(t)&&e.get(t)||k2,r=>{if(!yn(t)){const a=e.get(t);t in Z1||(Z1[t]=a),n[5](t,Wc(a,r),a||k2)}},n[6],()=>!yn(t)&&t in Z1?Z1[t]:!yn(t)&&e.get(t)||k2]};let i4=!0;const Q6e=()=>i4,[o4,s4]=gy&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[Rc,Rc],X6e=()=>{const e=a4&&document.visibilityState;return yn(e)||e!=="hidden"},Z6e=e=>(a4&&document.addEventListener("visibilitychange",e),o4("focus",e),()=>{a4&&document.removeEventListener("visibilitychange",e),s4("focus",e)}),J6e=e=>{const t=()=>{i4=!0,e()},n=()=>{i4=!1};return o4("online",t),o4("offline",n),()=>{s4("online",t),s4("offline",n)}},eLe={isOnline:Q6e,isVisible:X6e},tLe={initFocus:Z6e,initReconnect:J6e},y9=!Oe.useId,qh=!gy||"Deno"in window,nLe=e=>K6e()?window.requestAnimationFrame(e):setTimeout(e,1),P2=qh?x.useEffect:x.useLayoutEffect,F2=typeof navigator<"u"&&navigator.connection,T9=!qh&&F2&&(["slow-2g","2g"].includes(F2.effectiveType)||F2.saveData),P5=e=>{if(Tl(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?Yh(e):"",[e,t]};let rLe=0;const l4=()=>++rLe,eX=0,tX=1,nX=2,aLe=3;var hm={__proto__:null,ERROR_REVALIDATE_EVENT:aLe,FOCUS_EVENT:eX,MUTATE_EVENT:nX,RECONNECT_EVENT:tX};async function rX(...e){const[t,n,r,a]=e,i=Wc({populateCache:!0,throwOnError:!0},typeof a=="boolean"?{revalidate:a}:a||{});let o=i.populateCache;const s=i.rollbackOnError;let l=i.optimisticData;const c=i.revalidate!==!1,u=h=>typeof s=="function"?s(h):s!==!1,p=i.throwOnError;if(Tl(n)){const h=n,g=[],E=t.keys();for(const y of E)!/^\$(inf|sub)\$/.test(y)&&h(t.get(y)._k)&&g.push(y);return Promise.all(g.map(f))}return f(n);async function f(h){const[g]=P5(h);if(!g)return;const[E,y]=JQ(t,g),[b,v,C,T]=bl.get(t),N=()=>{const W=b[g];return c&&(delete C[g],delete T[g],W&&W[0])?W[0](nX).then(()=>E().data):E().data};if(e.length<3)return N();let A=r,O;const M=l4();v[g]=[M,0];const P=!yn(l),D=E(),$=D.data,V=D._c,Z=yn(V)?$:V;if(P&&(l=Tl(l)?l(Z,$):l,y({data:l,_c:Z})),Tl(A))try{A=A(Z)}catch(W){O=W}if(A&&W6e(A))if(A=await A.catch(W=>{O=W}),M!==v[g][0]){if(O)throw O;return A}else O&&P&&u(O)&&(o=!0,y({data:Z,_c:_i}));if(o&&!O)if(Tl(o)){const W=o(A,Z);y({data:W,error:_i,_c:_i})}else y({data:A,error:_i,_c:_i});if(v[g][1]=l4(),Promise.resolve(N()).then(()=>{y({_c:_i})}),O){if(p)throw O;return}return A}}const C9=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},iLe=(e,t)=>{if(!bl.has(e)){const n=Wc(tLe,t),r={},a=rX.bind(_i,e);let i=Rc;const o={},s=(u,p)=>{const f=o[u]||[];return o[u]=f,f.push(p),()=>f.splice(f.indexOf(p),1)},l=(u,p,f)=>{e.set(u,p);const h=o[u];if(h)for(const g of h)g(p,f)},c=()=>{if(!bl.has(e)&&(bl.set(e,[r,{},{},{},a,l,s]),!qh)){const u=n.initFocus(setTimeout.bind(_i,C9.bind(_i,r,eX))),p=n.initReconnect(setTimeout.bind(_i,C9.bind(_i,r,tX)));i=()=>{u&&u(),p&&p(),bl.delete(e)}}};return c(),[e,a,c,i]}return[e,bl.get(e)[4]]},oLe=(e,t,n,r,a)=>{const i=n.errorRetryCount,o=a.retryCount,s=~~((Math.random()+.5)*(1<<(o<8?o:8)))*n.errorRetryInterval;!yn(i)&&o>i||setTimeout(r,s,a)},sLe=(e,t)=>Yh(e)==Yh(t),[aX,lLe]=iLe(new Map),cLe=Wc({onLoadingSlow:Rc,onSuccess:Rc,onError:Rc,onErrorRetry:oLe,onDiscarded:Rc,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:T9?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:T9?5e3:3e3,compare:sLe,isPaused:()=>!1,cache:aX,mutate:lLe,fallback:{}},eLe),uLe=(e,t)=>{const n=Wc(e,t);if(t){const{use:r,fallback:a}=e,{use:i,fallback:o}=t;r&&i&&(n.use=r.concat(i)),a&&o&&(n.fallback=Wc(a,o))}return n},dLe=x.createContext({}),pLe="$inf$",iX=gy&&window.__SWR_DEVTOOLS_USE__,fLe=iX?window.__SWR_DEVTOOLS_USE__:[],mLe=()=>{iX&&(window.__SWR_DEVTOOLS_REACT__=Oe)},hLe=e=>Tl(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],gLe=()=>Wc(cLe,x.useContext(dLe)),_Le=e=>(t,n,r)=>e(t,n&&((...i)=>{const[o]=P5(t),[,,,s]=bl.get(aX);if(o.startsWith(pLe))return n(...i);const l=s[o];return yn(l)?n(...i):(delete s[o],l)}),r),ELe=fLe.concat(_Le),bLe=e=>function(...n){const r=gLe(),[a,i,o]=hLe(n),s=uLe(r,o);let l=e;const{use:c}=s,u=(c||[]).concat(ELe);for(let p=u.length;p--;)l=u[p](l);return l(a,i||s.fetcher||null,s)},SLe=(e,t,n)=>{const r=t[e]||(t[e]=[]);return r.push(n),()=>{const a=r.indexOf(n);a>=0&&(r[a]=r[r.length-1],r.pop())}};mLe();const R9=Oe.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)}),B2={dedupe:!0},vLe=(e,t,n)=>{const{cache:r,compare:a,suspense:i,fallbackData:o,revalidateOnMount:s,revalidateIfStale:l,refreshInterval:c,refreshWhenHidden:u,refreshWhenOffline:p,keepPreviousData:f}=n,[h,g,E,y]=bl.get(r),[b,v]=P5(e),C=x.useRef(!1),T=x.useRef(!1),N=x.useRef(b),A=x.useRef(t),O=x.useRef(n),M=()=>O.current,P=()=>M().isVisible()&&M().isOnline(),[D,$,V,Z]=JQ(r,b),W=x.useRef({}).current,ae=yn(o)?n.fallback[b]:o,he=(Le,we)=>{for(const Pe in W){const Me=Pe;if(Me==="data"){if(!a(Le[Me],we[Me])&&(!yn(Le[Me])||!a(Te,we[Me])))return!1}else if(we[Me]!==Le[Me])return!1}return!0},q=x.useMemo(()=>{const Le=(()=>!b||!t?!1:yn(s)?M().isPaused()||i?!1:yn(l)?!0:l:s)(),we=Ge=>{const at=Wc(Ge);return delete at._k,Le?{isValidating:!0,isLoading:!0,...at}:at},Pe=D(),Me=Z(),lt=we(Pe),it=Pe===Me?lt:we(Me);let nt=lt;return[()=>{const Ge=we(D());return he(Ge,nt)?(nt.data=Ge.data,nt.isLoading=Ge.isLoading,nt.isValidating=Ge.isValidating,nt.error=Ge.error,nt):(nt=Ge,Ge)},()=>it]},[r,b]),G=q6e.useSyncExternalStore(x.useCallback(Le=>V(b,(we,Pe)=>{he(Pe,we)||Le()}),[r,b]),q[0],q[1]),H=!C.current,k=h[b]&&h[b].length>0,ie=G.data,j=yn(ie)?ae:ie,F=G.error,le=x.useRef(j),Te=f?yn(ie)?le.current:ie:j,fe=(()=>k&&!yn(F)?!1:H&&!yn(s)?s:M().isPaused()?!1:i?yn(j)?!1:l:yn(j)||l)(),Ae=!!(b&&t&&H&&fe),Ce=yn(G.isValidating)?Ae:G.isValidating,Ne=yn(G.isLoading)?Ae:G.isLoading,ze=x.useCallback(async Le=>{const we=A.current;if(!b||!we||T.current||M().isPaused())return!1;let Pe,Me,lt=!0;const it=Le||{},nt=!E[b]||!it.dedupe,Ge=()=>y9?!T.current&&b===N.current&&C.current:b===N.current,at={isValidating:!1,isLoading:!1},ct=()=>{$(at)},se=()=>{const ge=E[b];ge&&ge[1]===Me&&delete E[b]},Fe={isValidating:!0};yn(D().data)&&(Fe.isLoading=!0);try{if(nt&&($(Fe),n.loadingTimeout&&yn(D().data)&&setTimeout(()=>{lt&&Ge()&&M().onLoadingSlow(b,n)},n.loadingTimeout),E[b]=[we(v),l4()]),[Pe,Me]=E[b],Pe=await Pe,nt&&setTimeout(se,n.dedupingInterval),!E[b]||E[b][1]!==Me)return nt&&Ge()&&M().onDiscarded(b),!1;at.error=_i;const ge=g[b];if(!yn(ge)&&(Me<=ge[0]||Me<=ge[1]||ge[1]===0))return ct(),nt&&Ge()&&M().onDiscarded(b),!1;const oe=D().data;at.data=a(oe,Pe)?oe:Pe,nt&&Ge()&&M().onSuccess(Pe,b,n)}catch(ge){se();const oe=M(),{shouldRetryOnError:re}=oe;oe.isPaused()||(at.error=ge,nt&&Ge()&&(oe.onError(ge,b,oe),(re===!0||Tl(re)&&re(ge))&&P()&&oe.onErrorRetry(ge,b,oe,J=>{const ue=h[b];ue&&ue[0]&&ue[0](hm.ERROR_REVALIDATE_EVENT,J)},{retryCount:(it.retryCount||0)+1,dedupe:!0})))}return lt=!1,ct(),!0},[b,r]),Ue=x.useCallback((...Le)=>rX(r,N.current,...Le),[]);if(P2(()=>{A.current=t,O.current=n,yn(ie)||(le.current=ie)}),P2(()=>{if(!b)return;const Le=ze.bind(_i,B2);let we=0;const Me=SLe(b,h,(lt,it={})=>{if(lt==hm.FOCUS_EVENT){const nt=Date.now();M().revalidateOnFocus&&nt>we&&P()&&(we=nt+M().focusThrottleInterval,Le())}else if(lt==hm.RECONNECT_EVENT)M().revalidateOnReconnect&&P()&&Le();else{if(lt==hm.MUTATE_EVENT)return ze();if(lt==hm.ERROR_REVALIDATE_EVENT)return ze(it)}});return T.current=!1,N.current=b,C.current=!0,$({_k:v}),fe&&(yn(j)||qh?Le():nLe(Le)),()=>{T.current=!0,Me()}},[b]),P2(()=>{let Le;function we(){const Me=Tl(c)?c(D().data):c;Me&&Le!==-1&&(Le=setTimeout(Pe,Me))}function Pe(){!D().error&&(u||M().isVisible())&&(p||M().isOnline())?ze(B2).then(we):we()}return we(),()=>{Le&&(clearTimeout(Le),Le=-1)}},[c,u,p,b]),x.useDebugValue(Te),i&&yn(j)&&b){if(!y9&&qh)throw new Error("Fallback data is required when using suspense in SSR.");A.current=t,O.current=n,T.current=!1;const Le=y[b];if(!yn(Le)){const we=Ue(Le);R9(we)}if(yn(F)){const we=ze(B2);yn(Te)||(we.status="fulfilled",we.value=!0),R9(we)}else throw F}return{mutate:Ue,get data(){return W.data=!0,Te},get error(){return W.error=!0,F},get isValidating(){return W.isValidating=!0,Ce},get isLoading(){return W.isLoading=!0,Ne}}},yLe=bLe(vLe),TLe=async e=>{const t=await fetch(e);if(!t.ok)throw new Error("Network response was not ok");const n=t.headers.get("content-type");return n&&n.includes("application/json")?t.json():t.text()},oX=e=>yLe(e,TLe),CLe=x.lazy(()=>ja(()=>import("./react-plotly-691f8eab.js").then(e=>e.r),[])),RLe=({element:e})=>{const{data:t,error:n,isLoading:r}=oX(e.url||null);if(r)return _.jsx("div",{children:"Loading..."});if(n)return _.jsx("div",{children:"An error occured"});let a;if(t)a=t;else return null;return _.jsx(x.Suspense,{fallback:_.jsx("div",{children:"Loading..."}),children:_.jsx(CLe,{className:`${e.display}-plotly`,data:a.data,layout:a.layout,frames:a.frames,config:a.config,style:{width:"100%",height:"100%"},useResizeHandler:!0})})},sX=e=>_.jsx(QQ,{prefix:"Failed to load chart.",children:_.jsx(RLe,{...e})});function x9(e){const t=[],n=String(e||"");let r=n.indexOf(","),a=0,i=!1;for(;!i;){r===-1&&(r=n.length,i=!0);const o=n.slice(a,r).trim();(o||!i)&&t.push(o),a=r+1,r=n.indexOf(",",a)}return t}function lX(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const xLe=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ALe=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,OLe={};function A9(e,t){return((t||OLe).jsx?ALe:xLe).test(e)}const NLe=/[ \t\n\f\r]/g;function ILe(e){return typeof e=="object"?e.type==="text"?O9(e.value):!1:O9(e)}function O9(e){return e.replace(NLe,"")===""}let Mg=class{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}};Mg.prototype.property={};Mg.prototype.normal={};Mg.prototype.space=null;function cX(e,t){const n={},r={};let a=-1;for(;++a<e.length;)Object.assign(n,e[a].property),Object.assign(r,e[a].normal);return new Mg(n,r,t)}function Wh(e){return e.toLowerCase()}let Go=class{constructor(t,n){this.property=t,this.attribute=n}};Go.prototype.space=null;Go.prototype.boolean=!1;Go.prototype.booleanish=!1;Go.prototype.overloadedBoolean=!1;Go.prototype.number=!1;Go.prototype.commaSeparated=!1;Go.prototype.spaceSeparated=!1;Go.prototype.commaOrSpaceSeparated=!1;Go.prototype.mustUseProperty=!1;Go.prototype.defined=!1;let wLe=0;const Xt=yd(),$r=yd(),uX=yd(),ht=yd(),Wn=yd(),Jp=yd(),$i=yd();function yd(){return 2**++wLe}const c4=Object.freeze(Object.defineProperty({__proto__:null,boolean:Xt,booleanish:$r,commaOrSpaceSeparated:$i,commaSeparated:Jp,number:ht,overloadedBoolean:uX,spaceSeparated:Wn},Symbol.toStringTag,{value:"Module"})),U2=Object.keys(c4);class F5 extends Go{constructor(t,n,r,a){let i=-1;if(super(t,n),N9(this,"space",a),typeof r=="number")for(;++i<U2.length;){const o=U2[i];N9(this,U2[i],(r&c4[o])===c4[o])}}}F5.prototype.defined=!0;function N9(e,t,n){n&&(e[t]=n)}const DLe={}.hasOwnProperty;function Jf(e){const t={},n={};let r;for(r in e.properties)if(DLe.call(e.properties,r)){const a=e.properties[r],i=new F5(r,e.transform(e.attributes||{},r),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[Wh(r)]=r,n[Wh(i.attribute)]=r}return new Mg(t,n,e.space)}const dX=Jf({space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()},properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),pX=Jf({space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function fX(e,t){return t in e?e[t]:t}function mX(e,t){return fX(e,t.toLowerCase())}const hX=Jf({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:mX,properties:{xmlns:null,xmlnsXLink:null}}),gX=Jf({transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:$r,ariaAutoComplete:null,ariaBusy:$r,ariaChecked:$r,ariaColCount:ht,ariaColIndex:ht,ariaColSpan:ht,ariaControls:Wn,ariaCurrent:null,ariaDescribedBy:Wn,ariaDetails:null,ariaDisabled:$r,ariaDropEffect:Wn,ariaErrorMessage:null,ariaExpanded:$r,ariaFlowTo:Wn,ariaGrabbed:$r,ariaHasPopup:null,ariaHidden:$r,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Wn,ariaLevel:ht,ariaLive:null,ariaModal:$r,ariaMultiLine:$r,ariaMultiSelectable:$r,ariaOrientation:null,ariaOwns:Wn,ariaPlaceholder:null,ariaPosInSet:ht,ariaPressed:$r,ariaReadOnly:$r,ariaRelevant:null,ariaRequired:$r,ariaRoleDescription:Wn,ariaRowCount:ht,ariaRowIndex:ht,ariaRowSpan:ht,ariaSelected:$r,ariaSetSize:ht,ariaSort:null,ariaValueMax:ht,ariaValueMin:ht,ariaValueNow:ht,ariaValueText:null,role:null}}),LLe=Jf({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:mX,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Jp,acceptCharset:Wn,accessKey:Wn,action:null,allow:null,allowFullScreen:Xt,allowPaymentRequest:Xt,allowUserMedia:Xt,alt:null,as:null,async:Xt,autoCapitalize:null,autoComplete:Wn,autoFocus:Xt,autoPlay:Xt,blocking:Wn,capture:null,charSet:null,checked:Xt,cite:null,className:Wn,cols:ht,colSpan:null,content:null,contentEditable:$r,controls:Xt,controlsList:Wn,coords:ht|Jp,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Xt,defer:Xt,dir:null,dirName:null,disabled:Xt,download:uX,draggable:$r,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Xt,formTarget:null,headers:Wn,height:ht,hidden:Xt,high:ht,href:null,hrefLang:null,htmlFor:Wn,httpEquiv:Wn,id:null,imageSizes:null,imageSrcSet:null,inert:Xt,inputMode:null,integrity:null,is:null,isMap:Xt,itemId:null,itemProp:Wn,itemRef:Wn,itemScope:Xt,itemType:Wn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Xt,low:ht,manifest:null,max:null,maxLength:ht,media:null,method:null,min:null,minLength:ht,multiple:Xt,muted:Xt,name:null,nonce:null,noModule:Xt,noValidate:Xt,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Xt,optimum:ht,pattern:null,ping:Wn,placeholder:null,playsInline:Xt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Xt,referrerPolicy:null,rel:Wn,required:Xt,reversed:Xt,rows:ht,rowSpan:ht,sandbox:Wn,scope:null,scoped:Xt,seamless:Xt,selected:Xt,shadowRootClonable:Xt,shadowRootDelegatesFocus:Xt,shadowRootMode:null,shape:null,size:ht,sizes:null,slot:null,span:ht,spellCheck:$r,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ht,step:null,style:null,tabIndex:ht,target:null,title:null,translate:null,type:null,typeMustMatch:Xt,useMap:null,value:$r,width:ht,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Wn,axis:null,background:null,bgColor:null,border:ht,borderColor:null,bottomMargin:ht,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Xt,declare:Xt,event:null,face:null,frame:null,frameBorder:null,hSpace:ht,leftMargin:ht,link:null,longDesc:null,lowSrc:null,marginHeight:ht,marginWidth:ht,noResize:Xt,noHref:Xt,noShade:Xt,noWrap:Xt,object:null,profile:null,prompt:null,rev:null,rightMargin:ht,rules:null,scheme:null,scrolling:$r,standby:null,summary:null,text:null,topMargin:ht,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ht,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Xt,disableRemotePlayback:Xt,prefix:null,property:null,results:ht,security:null,unselectable:null}}),MLe=Jf({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:fX,properties:{about:$i,accentHeight:ht,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ht,amplitude:ht,arabicForm:null,ascent:ht,attributeName:null,attributeType:null,azimuth:ht,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ht,by:null,calcMode:null,capHeight:ht,className:Wn,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ht,diffuseConstant:ht,direction:null,display:null,dur:null,divisor:ht,dominantBaseline:null,download:Xt,dx:null,dy:null,edgeMode:null,editable:null,elevation:ht,enableBackground:null,end:null,event:null,exponent:ht,externalResourcesRequired:null,fill:null,fillOpacity:ht,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Jp,g2:Jp,glyphName:Jp,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ht,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ht,horizOriginX:ht,horizOriginY:ht,id:null,ideographic:ht,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ht,k:ht,k1:ht,k2:ht,k3:ht,k4:ht,kernelMatrix:$i,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ht,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ht,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:ht,overlineThickness:ht,paintOrder:null,panose1:null,path:null,pathLength:ht,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Wn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ht,pointsAtY:ht,pointsAtZ:ht,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:$i,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:$i,rev:$i,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:$i,requiredFeatures:$i,requiredFonts:$i,requiredFormats:$i,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:ht,specularExponent:ht,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ht,strikethroughThickness:ht,string:null,stroke:null,strokeDashArray:$i,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ht,strokeOpacity:ht,strokeWidth:null,style:null,surfaceScale:ht,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:$i,tabIndex:ht,tableValues:null,target:null,targetX:ht,targetY:ht,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:$i,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ht,underlineThickness:ht,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ht,values:null,vAlphabetic:ht,vMathematical:ht,vectorEffect:null,vHanging:ht,vIdeographic:ht,version:null,vertAdvY:ht,vertOriginX:ht,vertOriginY:ht,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ht,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),kLe=/^data[-\w.:]+$/i,I9=/-[a-z]/g,PLe=/[A-Z]/g;function _y(e,t){const n=Wh(t);let r=t,a=Go;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&kLe.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(I9,BLe);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!I9.test(i)){let o=i.replace(PLe,FLe);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}a=F5}return new a(r,t)}function FLe(e){return"-"+e.toLowerCase()}function BLe(e){return e.charAt(1).toUpperCase()}const ULe={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},kg=cX([pX,dX,hX,gX,LLe],"html"),su=cX([pX,dX,hX,gX,MLe],"svg");function w9(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function _X(e){return e.join(" ").trim()}var EX={},D9=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,$Le=/\n/g,zLe=/^\s*/,HLe=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,GLe=/^:\s*/,VLe=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,YLe=/^[;\s]*/,qLe=/^\s+|\s+$/g,WLe=`
339
+ */var xf=x;function F6e(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var B6e=typeof Object.is=="function"?Object.is:F6e,U6e=xf.useState,$6e=xf.useEffect,z6e=xf.useLayoutEffect,H6e=xf.useDebugValue;function G6e(e,t){var n=t(),r=U6e({inst:{value:n,getSnapshot:t}}),a=r[0].inst,i=r[1];return z6e(function(){a.value=n,a.getSnapshot=t,L2(a)&&i({inst:a})},[e,n,t]),$6e(function(){return L2(a)&&i({inst:a}),e(function(){L2(a)&&i({inst:a})})},[e]),H6e(n),n}function L2(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!B6e(e,n)}catch{return!0}}function V6e(e,t){return t()}var Y6e=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?V6e:G6e;ZQ.useSyncExternalStore=xf.useSyncExternalStore!==void 0?xf.useSyncExternalStore:Y6e;XQ.exports=ZQ;var q6e=XQ.exports;const Rc=()=>{},_i=Rc(),M2=Object,yn=e=>e===_i,Tl=e=>typeof e=="function",Wc=(e,t)=>({...e,...t}),W6e=e=>Tl(e.then),X1=new WeakMap;let j6e=0;const Yh=e=>{const t=typeof e,n=e&&e.constructor,r=n==Date;let a,i;if(M2(e)===e&&!r&&n!=RegExp){if(a=X1.get(e),a)return a;if(a=++j6e+"~",X1.set(e,a),n==Array){for(a="@",i=0;i<e.length;i++)a+=Yh(e[i])+",";X1.set(e,a)}if(n==M2){a="#";const o=M2.keys(e).sort();for(;!yn(i=o.pop());)yn(e[i])||(a+=i+":"+Yh(e[i])+",");X1.set(e,a)}}else a=r?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return a},bl=new WeakMap,k2={},Z1={},k5="undefined",gy=typeof window!=k5,a4=typeof document!=k5,K6e=()=>gy&&typeof window.requestAnimationFrame!=k5,JQ=(e,t)=>{const n=bl.get(e);return[()=>!yn(t)&&e.get(t)||k2,r=>{if(!yn(t)){const a=e.get(t);t in Z1||(Z1[t]=a),n[5](t,Wc(a,r),a||k2)}},n[6],()=>!yn(t)&&t in Z1?Z1[t]:!yn(t)&&e.get(t)||k2]};let i4=!0;const Q6e=()=>i4,[o4,s4]=gy&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[Rc,Rc],X6e=()=>{const e=a4&&document.visibilityState;return yn(e)||e!=="hidden"},Z6e=e=>(a4&&document.addEventListener("visibilitychange",e),o4("focus",e),()=>{a4&&document.removeEventListener("visibilitychange",e),s4("focus",e)}),J6e=e=>{const t=()=>{i4=!0,e()},n=()=>{i4=!1};return o4("online",t),o4("offline",n),()=>{s4("online",t),s4("offline",n)}},eLe={isOnline:Q6e,isVisible:X6e},tLe={initFocus:Z6e,initReconnect:J6e},y9=!Oe.useId,qh=!gy||"Deno"in window,nLe=e=>K6e()?window.requestAnimationFrame(e):setTimeout(e,1),P2=qh?x.useEffect:x.useLayoutEffect,F2=typeof navigator<"u"&&navigator.connection,T9=!qh&&F2&&(["slow-2g","2g"].includes(F2.effectiveType)||F2.saveData),P5=e=>{if(Tl(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?Yh(e):"",[e,t]};let rLe=0;const l4=()=>++rLe,eX=0,tX=1,nX=2,aLe=3;var hm={__proto__:null,ERROR_REVALIDATE_EVENT:aLe,FOCUS_EVENT:eX,MUTATE_EVENT:nX,RECONNECT_EVENT:tX};async function rX(...e){const[t,n,r,a]=e,i=Wc({populateCache:!0,throwOnError:!0},typeof a=="boolean"?{revalidate:a}:a||{});let o=i.populateCache;const s=i.rollbackOnError;let l=i.optimisticData;const c=i.revalidate!==!1,u=h=>typeof s=="function"?s(h):s!==!1,p=i.throwOnError;if(Tl(n)){const h=n,g=[],E=t.keys();for(const y of E)!/^\$(inf|sub)\$/.test(y)&&h(t.get(y)._k)&&g.push(y);return Promise.all(g.map(f))}return f(n);async function f(h){const[g]=P5(h);if(!g)return;const[E,y]=JQ(t,g),[b,v,C,T]=bl.get(t),N=()=>{const W=b[g];return c&&(delete C[g],delete T[g],W&&W[0])?W[0](nX).then(()=>E().data):E().data};if(e.length<3)return N();let A=r,O;const M=l4();v[g]=[M,0];const P=!yn(l),D=E(),$=D.data,V=D._c,Z=yn(V)?$:V;if(P&&(l=Tl(l)?l(Z,$):l,y({data:l,_c:Z})),Tl(A))try{A=A(Z)}catch(W){O=W}if(A&&W6e(A))if(A=await A.catch(W=>{O=W}),M!==v[g][0]){if(O)throw O;return A}else O&&P&&u(O)&&(o=!0,y({data:Z,_c:_i}));if(o&&!O)if(Tl(o)){const W=o(A,Z);y({data:W,error:_i,_c:_i})}else y({data:A,error:_i,_c:_i});if(v[g][1]=l4(),Promise.resolve(N()).then(()=>{y({_c:_i})}),O){if(p)throw O;return}return A}}const C9=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},iLe=(e,t)=>{if(!bl.has(e)){const n=Wc(tLe,t),r={},a=rX.bind(_i,e);let i=Rc;const o={},s=(u,p)=>{const f=o[u]||[];return o[u]=f,f.push(p),()=>f.splice(f.indexOf(p),1)},l=(u,p,f)=>{e.set(u,p);const h=o[u];if(h)for(const g of h)g(p,f)},c=()=>{if(!bl.has(e)&&(bl.set(e,[r,{},{},{},a,l,s]),!qh)){const u=n.initFocus(setTimeout.bind(_i,C9.bind(_i,r,eX))),p=n.initReconnect(setTimeout.bind(_i,C9.bind(_i,r,tX)));i=()=>{u&&u(),p&&p(),bl.delete(e)}}};return c(),[e,a,c,i]}return[e,bl.get(e)[4]]},oLe=(e,t,n,r,a)=>{const i=n.errorRetryCount,o=a.retryCount,s=~~((Math.random()+.5)*(1<<(o<8?o:8)))*n.errorRetryInterval;!yn(i)&&o>i||setTimeout(r,s,a)},sLe=(e,t)=>Yh(e)==Yh(t),[aX,lLe]=iLe(new Map),cLe=Wc({onLoadingSlow:Rc,onSuccess:Rc,onError:Rc,onErrorRetry:oLe,onDiscarded:Rc,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:T9?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:T9?5e3:3e3,compare:sLe,isPaused:()=>!1,cache:aX,mutate:lLe,fallback:{}},eLe),uLe=(e,t)=>{const n=Wc(e,t);if(t){const{use:r,fallback:a}=e,{use:i,fallback:o}=t;r&&i&&(n.use=r.concat(i)),a&&o&&(n.fallback=Wc(a,o))}return n},dLe=x.createContext({}),pLe="$inf$",iX=gy&&window.__SWR_DEVTOOLS_USE__,fLe=iX?window.__SWR_DEVTOOLS_USE__:[],mLe=()=>{iX&&(window.__SWR_DEVTOOLS_REACT__=Oe)},hLe=e=>Tl(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],gLe=()=>Wc(cLe,x.useContext(dLe)),_Le=e=>(t,n,r)=>e(t,n&&((...i)=>{const[o]=P5(t),[,,,s]=bl.get(aX);if(o.startsWith(pLe))return n(...i);const l=s[o];return yn(l)?n(...i):(delete s[o],l)}),r),ELe=fLe.concat(_Le),bLe=e=>function(...n){const r=gLe(),[a,i,o]=hLe(n),s=uLe(r,o);let l=e;const{use:c}=s,u=(c||[]).concat(ELe);for(let p=u.length;p--;)l=u[p](l);return l(a,i||s.fetcher||null,s)},SLe=(e,t,n)=>{const r=t[e]||(t[e]=[]);return r.push(n),()=>{const a=r.indexOf(n);a>=0&&(r[a]=r[r.length-1],r.pop())}};mLe();const R9=Oe.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)}),B2={dedupe:!0},vLe=(e,t,n)=>{const{cache:r,compare:a,suspense:i,fallbackData:o,revalidateOnMount:s,revalidateIfStale:l,refreshInterval:c,refreshWhenHidden:u,refreshWhenOffline:p,keepPreviousData:f}=n,[h,g,E,y]=bl.get(r),[b,v]=P5(e),C=x.useRef(!1),T=x.useRef(!1),N=x.useRef(b),A=x.useRef(t),O=x.useRef(n),M=()=>O.current,P=()=>M().isVisible()&&M().isOnline(),[D,$,V,Z]=JQ(r,b),W=x.useRef({}).current,ae=yn(o)?n.fallback[b]:o,he=(Le,we)=>{for(const Pe in W){const Me=Pe;if(Me==="data"){if(!a(Le[Me],we[Me])&&(!yn(Le[Me])||!a(Te,we[Me])))return!1}else if(we[Me]!==Le[Me])return!1}return!0},q=x.useMemo(()=>{const Le=(()=>!b||!t?!1:yn(s)?M().isPaused()||i?!1:yn(l)?!0:l:s)(),we=Ge=>{const at=Wc(Ge);return delete at._k,Le?{isValidating:!0,isLoading:!0,...at}:at},Pe=D(),Me=Z(),lt=we(Pe),it=Pe===Me?lt:we(Me);let nt=lt;return[()=>{const Ge=we(D());return he(Ge,nt)?(nt.data=Ge.data,nt.isLoading=Ge.isLoading,nt.isValidating=Ge.isValidating,nt.error=Ge.error,nt):(nt=Ge,Ge)},()=>it]},[r,b]),G=q6e.useSyncExternalStore(x.useCallback(Le=>V(b,(we,Pe)=>{he(Pe,we)||Le()}),[r,b]),q[0],q[1]),H=!C.current,k=h[b]&&h[b].length>0,ie=G.data,j=yn(ie)?ae:ie,F=G.error,le=x.useRef(j),Te=f?yn(ie)?le.current:ie:j,fe=(()=>k&&!yn(F)?!1:H&&!yn(s)?s:M().isPaused()?!1:i?yn(j)?!1:l:yn(j)||l)(),Ae=!!(b&&t&&H&&fe),Ce=yn(G.isValidating)?Ae:G.isValidating,Ne=yn(G.isLoading)?Ae:G.isLoading,ze=x.useCallback(async Le=>{const we=A.current;if(!b||!we||T.current||M().isPaused())return!1;let Pe,Me,lt=!0;const it=Le||{},nt=!E[b]||!it.dedupe,Ge=()=>y9?!T.current&&b===N.current&&C.current:b===N.current,at={isValidating:!1,isLoading:!1},ct=()=>{$(at)},se=()=>{const ge=E[b];ge&&ge[1]===Me&&delete E[b]},Fe={isValidating:!0};yn(D().data)&&(Fe.isLoading=!0);try{if(nt&&($(Fe),n.loadingTimeout&&yn(D().data)&&setTimeout(()=>{lt&&Ge()&&M().onLoadingSlow(b,n)},n.loadingTimeout),E[b]=[we(v),l4()]),[Pe,Me]=E[b],Pe=await Pe,nt&&setTimeout(se,n.dedupingInterval),!E[b]||E[b][1]!==Me)return nt&&Ge()&&M().onDiscarded(b),!1;at.error=_i;const ge=g[b];if(!yn(ge)&&(Me<=ge[0]||Me<=ge[1]||ge[1]===0))return ct(),nt&&Ge()&&M().onDiscarded(b),!1;const oe=D().data;at.data=a(oe,Pe)?oe:Pe,nt&&Ge()&&M().onSuccess(Pe,b,n)}catch(ge){se();const oe=M(),{shouldRetryOnError:re}=oe;oe.isPaused()||(at.error=ge,nt&&Ge()&&(oe.onError(ge,b,oe),(re===!0||Tl(re)&&re(ge))&&P()&&oe.onErrorRetry(ge,b,oe,J=>{const ue=h[b];ue&&ue[0]&&ue[0](hm.ERROR_REVALIDATE_EVENT,J)},{retryCount:(it.retryCount||0)+1,dedupe:!0})))}return lt=!1,ct(),!0},[b,r]),Ue=x.useCallback((...Le)=>rX(r,N.current,...Le),[]);if(P2(()=>{A.current=t,O.current=n,yn(ie)||(le.current=ie)}),P2(()=>{if(!b)return;const Le=ze.bind(_i,B2);let we=0;const Me=SLe(b,h,(lt,it={})=>{if(lt==hm.FOCUS_EVENT){const nt=Date.now();M().revalidateOnFocus&&nt>we&&P()&&(we=nt+M().focusThrottleInterval,Le())}else if(lt==hm.RECONNECT_EVENT)M().revalidateOnReconnect&&P()&&Le();else{if(lt==hm.MUTATE_EVENT)return ze();if(lt==hm.ERROR_REVALIDATE_EVENT)return ze(it)}});return T.current=!1,N.current=b,C.current=!0,$({_k:v}),fe&&(yn(j)||qh?Le():nLe(Le)),()=>{T.current=!0,Me()}},[b]),P2(()=>{let Le;function we(){const Me=Tl(c)?c(D().data):c;Me&&Le!==-1&&(Le=setTimeout(Pe,Me))}function Pe(){!D().error&&(u||M().isVisible())&&(p||M().isOnline())?ze(B2).then(we):we()}return we(),()=>{Le&&(clearTimeout(Le),Le=-1)}},[c,u,p,b]),x.useDebugValue(Te),i&&yn(j)&&b){if(!y9&&qh)throw new Error("Fallback data is required when using suspense in SSR.");A.current=t,O.current=n,T.current=!1;const Le=y[b];if(!yn(Le)){const we=Ue(Le);R9(we)}if(yn(F)){const we=ze(B2);yn(Te)||(we.status="fulfilled",we.value=!0),R9(we)}else throw F}return{mutate:Ue,get data(){return W.data=!0,Te},get error(){return W.error=!0,F},get isValidating(){return W.isValidating=!0,Ce},get isLoading(){return W.isLoading=!0,Ne}}},yLe=bLe(vLe),TLe=async e=>{const t=await fetch(e);if(!t.ok)throw new Error("Network response was not ok");const n=t.headers.get("content-type");return n&&n.includes("application/json")?t.json():t.text()},oX=e=>yLe(e,TLe),CLe=x.lazy(()=>ja(()=>import("./react-plotly-68456fe1.js").then(e=>e.r),[])),RLe=({element:e})=>{const{data:t,error:n,isLoading:r}=oX(e.url||null);if(r)return _.jsx("div",{children:"Loading..."});if(n)return _.jsx("div",{children:"An error occured"});let a;if(t)a=t;else return null;return _.jsx(x.Suspense,{fallback:_.jsx("div",{children:"Loading..."}),children:_.jsx(CLe,{className:`${e.display}-plotly`,data:a.data,layout:a.layout,frames:a.frames,config:a.config,style:{width:"100%",height:"100%"},useResizeHandler:!0})})},sX=e=>_.jsx(QQ,{prefix:"Failed to load chart.",children:_.jsx(RLe,{...e})});function x9(e){const t=[],n=String(e||"");let r=n.indexOf(","),a=0,i=!1;for(;!i;){r===-1&&(r=n.length,i=!0);const o=n.slice(a,r).trim();(o||!i)&&t.push(o),a=r+1,r=n.indexOf(",",a)}return t}function lX(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const xLe=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ALe=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,OLe={};function A9(e,t){return((t||OLe).jsx?ALe:xLe).test(e)}const NLe=/[ \t\n\f\r]/g;function ILe(e){return typeof e=="object"?e.type==="text"?O9(e.value):!1:O9(e)}function O9(e){return e.replace(NLe,"")===""}let Mg=class{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}};Mg.prototype.property={};Mg.prototype.normal={};Mg.prototype.space=null;function cX(e,t){const n={},r={};let a=-1;for(;++a<e.length;)Object.assign(n,e[a].property),Object.assign(r,e[a].normal);return new Mg(n,r,t)}function Wh(e){return e.toLowerCase()}let Go=class{constructor(t,n){this.property=t,this.attribute=n}};Go.prototype.space=null;Go.prototype.boolean=!1;Go.prototype.booleanish=!1;Go.prototype.overloadedBoolean=!1;Go.prototype.number=!1;Go.prototype.commaSeparated=!1;Go.prototype.spaceSeparated=!1;Go.prototype.commaOrSpaceSeparated=!1;Go.prototype.mustUseProperty=!1;Go.prototype.defined=!1;let wLe=0;const Xt=yd(),$r=yd(),uX=yd(),ht=yd(),Wn=yd(),Jp=yd(),$i=yd();function yd(){return 2**++wLe}const c4=Object.freeze(Object.defineProperty({__proto__:null,boolean:Xt,booleanish:$r,commaOrSpaceSeparated:$i,commaSeparated:Jp,number:ht,overloadedBoolean:uX,spaceSeparated:Wn},Symbol.toStringTag,{value:"Module"})),U2=Object.keys(c4);class F5 extends Go{constructor(t,n,r,a){let i=-1;if(super(t,n),N9(this,"space",a),typeof r=="number")for(;++i<U2.length;){const o=U2[i];N9(this,U2[i],(r&c4[o])===c4[o])}}}F5.prototype.defined=!0;function N9(e,t,n){n&&(e[t]=n)}const DLe={}.hasOwnProperty;function Jf(e){const t={},n={};let r;for(r in e.properties)if(DLe.call(e.properties,r)){const a=e.properties[r],i=new F5(r,e.transform(e.attributes||{},r),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[Wh(r)]=r,n[Wh(i.attribute)]=r}return new Mg(t,n,e.space)}const dX=Jf({space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()},properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),pX=Jf({space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function fX(e,t){return t in e?e[t]:t}function mX(e,t){return fX(e,t.toLowerCase())}const hX=Jf({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:mX,properties:{xmlns:null,xmlnsXLink:null}}),gX=Jf({transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:$r,ariaAutoComplete:null,ariaBusy:$r,ariaChecked:$r,ariaColCount:ht,ariaColIndex:ht,ariaColSpan:ht,ariaControls:Wn,ariaCurrent:null,ariaDescribedBy:Wn,ariaDetails:null,ariaDisabled:$r,ariaDropEffect:Wn,ariaErrorMessage:null,ariaExpanded:$r,ariaFlowTo:Wn,ariaGrabbed:$r,ariaHasPopup:null,ariaHidden:$r,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Wn,ariaLevel:ht,ariaLive:null,ariaModal:$r,ariaMultiLine:$r,ariaMultiSelectable:$r,ariaOrientation:null,ariaOwns:Wn,ariaPlaceholder:null,ariaPosInSet:ht,ariaPressed:$r,ariaReadOnly:$r,ariaRelevant:null,ariaRequired:$r,ariaRoleDescription:Wn,ariaRowCount:ht,ariaRowIndex:ht,ariaRowSpan:ht,ariaSelected:$r,ariaSetSize:ht,ariaSort:null,ariaValueMax:ht,ariaValueMin:ht,ariaValueNow:ht,ariaValueText:null,role:null}}),LLe=Jf({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:mX,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Jp,acceptCharset:Wn,accessKey:Wn,action:null,allow:null,allowFullScreen:Xt,allowPaymentRequest:Xt,allowUserMedia:Xt,alt:null,as:null,async:Xt,autoCapitalize:null,autoComplete:Wn,autoFocus:Xt,autoPlay:Xt,blocking:Wn,capture:null,charSet:null,checked:Xt,cite:null,className:Wn,cols:ht,colSpan:null,content:null,contentEditable:$r,controls:Xt,controlsList:Wn,coords:ht|Jp,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Xt,defer:Xt,dir:null,dirName:null,disabled:Xt,download:uX,draggable:$r,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Xt,formTarget:null,headers:Wn,height:ht,hidden:Xt,high:ht,href:null,hrefLang:null,htmlFor:Wn,httpEquiv:Wn,id:null,imageSizes:null,imageSrcSet:null,inert:Xt,inputMode:null,integrity:null,is:null,isMap:Xt,itemId:null,itemProp:Wn,itemRef:Wn,itemScope:Xt,itemType:Wn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Xt,low:ht,manifest:null,max:null,maxLength:ht,media:null,method:null,min:null,minLength:ht,multiple:Xt,muted:Xt,name:null,nonce:null,noModule:Xt,noValidate:Xt,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Xt,optimum:ht,pattern:null,ping:Wn,placeholder:null,playsInline:Xt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Xt,referrerPolicy:null,rel:Wn,required:Xt,reversed:Xt,rows:ht,rowSpan:ht,sandbox:Wn,scope:null,scoped:Xt,seamless:Xt,selected:Xt,shadowRootClonable:Xt,shadowRootDelegatesFocus:Xt,shadowRootMode:null,shape:null,size:ht,sizes:null,slot:null,span:ht,spellCheck:$r,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ht,step:null,style:null,tabIndex:ht,target:null,title:null,translate:null,type:null,typeMustMatch:Xt,useMap:null,value:$r,width:ht,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Wn,axis:null,background:null,bgColor:null,border:ht,borderColor:null,bottomMargin:ht,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Xt,declare:Xt,event:null,face:null,frame:null,frameBorder:null,hSpace:ht,leftMargin:ht,link:null,longDesc:null,lowSrc:null,marginHeight:ht,marginWidth:ht,noResize:Xt,noHref:Xt,noShade:Xt,noWrap:Xt,object:null,profile:null,prompt:null,rev:null,rightMargin:ht,rules:null,scheme:null,scrolling:$r,standby:null,summary:null,text:null,topMargin:ht,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ht,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Xt,disableRemotePlayback:Xt,prefix:null,property:null,results:ht,security:null,unselectable:null}}),MLe=Jf({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:fX,properties:{about:$i,accentHeight:ht,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ht,amplitude:ht,arabicForm:null,ascent:ht,attributeName:null,attributeType:null,azimuth:ht,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ht,by:null,calcMode:null,capHeight:ht,className:Wn,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ht,diffuseConstant:ht,direction:null,display:null,dur:null,divisor:ht,dominantBaseline:null,download:Xt,dx:null,dy:null,edgeMode:null,editable:null,elevation:ht,enableBackground:null,end:null,event:null,exponent:ht,externalResourcesRequired:null,fill:null,fillOpacity:ht,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Jp,g2:Jp,glyphName:Jp,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ht,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ht,horizOriginX:ht,horizOriginY:ht,id:null,ideographic:ht,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ht,k:ht,k1:ht,k2:ht,k3:ht,k4:ht,kernelMatrix:$i,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ht,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ht,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:ht,overlineThickness:ht,paintOrder:null,panose1:null,path:null,pathLength:ht,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Wn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ht,pointsAtY:ht,pointsAtZ:ht,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:$i,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:$i,rev:$i,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:$i,requiredFeatures:$i,requiredFonts:$i,requiredFormats:$i,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:ht,specularExponent:ht,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ht,strikethroughThickness:ht,string:null,stroke:null,strokeDashArray:$i,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ht,strokeOpacity:ht,strokeWidth:null,style:null,surfaceScale:ht,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:$i,tabIndex:ht,tableValues:null,target:null,targetX:ht,targetY:ht,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:$i,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ht,underlineThickness:ht,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ht,values:null,vAlphabetic:ht,vMathematical:ht,vectorEffect:null,vHanging:ht,vIdeographic:ht,version:null,vertAdvY:ht,vertOriginX:ht,vertOriginY:ht,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ht,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),kLe=/^data[-\w.:]+$/i,I9=/-[a-z]/g,PLe=/[A-Z]/g;function _y(e,t){const n=Wh(t);let r=t,a=Go;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&kLe.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(I9,BLe);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!I9.test(i)){let o=i.replace(PLe,FLe);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}a=F5}return new a(r,t)}function FLe(e){return"-"+e.toLowerCase()}function BLe(e){return e.charAt(1).toUpperCase()}const ULe={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},kg=cX([pX,dX,hX,gX,LLe],"html"),su=cX([pX,dX,hX,gX,MLe],"svg");function w9(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function _X(e){return e.join(" ").trim()}var EX={},D9=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,$Le=/\n/g,zLe=/^\s*/,HLe=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,GLe=/^:\s*/,VLe=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,YLe=/^[;\s]*/,qLe=/^\s+|\s+$/g,WLe=`
340
340
  `,L9="/",M9="*",Bu="",jLe="comment",KLe="declaration",QLe=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function a(g){var E=g.match($Le);E&&(n+=E.length);var y=g.lastIndexOf(WLe);r=~y?g.length-y:r+g.length}function i(){var g={line:n,column:r};return function(E){return E.position=new o(g),c(),E}}function o(g){this.start=g,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function s(g){var E=new Error(t.source+":"+n+":"+r+": "+g);if(E.reason=g,E.filename=t.source,E.line=n,E.column=r,E.source=e,!t.silent)throw E}function l(g){var E=g.exec(e);if(E){var y=E[0];return a(y),e=e.slice(y.length),E}}function c(){l(zLe)}function u(g){var E;for(g=g||[];E=p();)E!==!1&&g.push(E);return g}function p(){var g=i();if(!(L9!=e.charAt(0)||M9!=e.charAt(1))){for(var E=2;Bu!=e.charAt(E)&&(M9!=e.charAt(E)||L9!=e.charAt(E+1));)++E;if(E+=2,Bu===e.charAt(E-1))return s("End of comment missing");var y=e.slice(2,E-2);return r+=2,a(y),e=e.slice(E),r+=2,g({type:jLe,comment:y})}}function f(){var g=i(),E=l(HLe);if(E){if(p(),!l(GLe))return s("property missing ':'");var y=l(VLe),b=g({type:KLe,property:k9(E[0].replace(D9,Bu)),value:y?k9(y[0].replace(D9,Bu)):Bu});return l(YLe),b}}function h(){var g=[];u(g);for(var E;E=f();)E!==!1&&(g.push(E),u(g));return g}return c(),h()};function k9(e){return e?e.replace(qLe,Bu):Bu}var XLe=aa&&aa.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(EX,"__esModule",{value:!0});var ZLe=XLe(QLe);function JLe(e,t){var n=null;if(!e||typeof e!="string")return n;var r=(0,ZLe.default)(e),a=typeof t=="function";return r.forEach(function(i){if(i.type==="declaration"){var o=i.property,s=i.value;a?t(o,s,i):s&&(n=n||{},n[o]=s)}}),n}var P9=EX.default=JLe;const eMe=P9.default||P9,Ey=bX("end"),qs=bX("start");function bX(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function tMe(e){const t=qs(e),n=Ey(e);if(t&&n)return{start:t,end:n}}function ah(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?F9(e.position):"start"in e||"end"in e?F9(e):"line"in e||"column"in e?u4(e):""}function u4(e){return B9(e&&e.line)+":"+B9(e&&e.column)}function F9(e){return u4(e&&e.start)+"-"+u4(e&&e.end)}function B9(e){return e&&typeof e=="number"?e:1}class Ua extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let a="",i={},o=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof t=="string"?a=t:!i.cause&&t&&(o=!0,a=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?i.ruleId=r:(i.source=r.slice(0,l),i.ruleId=r.slice(l+1))}if(!i.place&&i.ancestors&&i.ancestors){const l=i.ancestors[i.ancestors.length-1];l&&(i.place=l.position)}const s=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file,this.message=a,this.line=s?s.line:void 0,this.name=ah(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=o&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual,this.expected,this.note,this.url}}Ua.prototype.file="";Ua.prototype.name="";Ua.prototype.reason="";Ua.prototype.message="";Ua.prototype.stack="";Ua.prototype.column=void 0;Ua.prototype.line=void 0;Ua.prototype.ancestors=void 0;Ua.prototype.cause=void 0;Ua.prototype.fatal=void 0;Ua.prototype.place=void 0;Ua.prototype.ruleId=void 0;Ua.prototype.source=void 0;const B5={}.hasOwnProperty,nMe=new Map,rMe=/[A-Z]/g,aMe=/-([a-z])/g,iMe=new Set(["table","tbody","thead","tfoot","tr"]),oMe=new Set(["td","th"]),SX="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function sMe(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=hMe(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=mMe(n,t.jsx,t.jsxs)}const a={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?su:kg,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=vX(a,e,void 0);return i&&typeof i!="string"?i:a.create(e,a.Fragment,{children:i||void 0},void 0)}function vX(e,t,n){if(t.type==="element")return lMe(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return cMe(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return dMe(e,t,n);if(t.type==="mdxjsEsm")return uMe(e,t);if(t.type==="root")return pMe(e,t,n);if(t.type==="text")return fMe(e,t)}function lMe(e,t,n){const r=e.schema;let a=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(a=su,e.schema=a),e.ancestors.push(t);const i=TX(e,t.tagName,!1),o=gMe(e,t);let s=$5(e,t);return iMe.has(t.tagName)&&(s=s.filter(function(l){return typeof l=="string"?!ILe(l):!0})),yX(e,o,i,t),U5(o,s),e.ancestors.pop(),e.schema=r,e.create(t,i,o,n)}function cMe(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}jh(e,t.position)}function uMe(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);jh(e,t.position)}function dMe(e,t,n){const r=e.schema;let a=r;t.name==="svg"&&r.space==="html"&&(a=su,e.schema=a),e.ancestors.push(t);const i=t.name===null?e.Fragment:TX(e,t.name,!0),o=_Me(e,t),s=$5(e,t);return yX(e,o,i,t),U5(o,s),e.ancestors.pop(),e.schema=r,e.create(t,i,o,n)}function pMe(e,t,n){const r={};return U5(r,$5(e,t)),e.create(t,e.Fragment,r,n)}function fMe(e,t){return t.value}function yX(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function U5(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function mMe(e,t,n){return r;function r(a,i,o,s){const c=Array.isArray(o.children)?n:t;return s?c(i,o,s):c(i,o)}}function hMe(e,t){return n;function n(r,a,i,o){const s=Array.isArray(i.children),l=qs(r);return t(a,i,o,s,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function gMe(e,t){const n={};let r,a;for(a in t.properties)if(a!=="children"&&B5.call(t.properties,a)){const i=EMe(e,a,t.properties[a]);if(i){const[o,s]=i;e.tableCellAlignToStyle&&o==="align"&&typeof s=="string"&&oMe.has(t.tagName)?r=s:n[o]=s}}if(r){const i=n.style||(n.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function _Me(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const i=r.data.estree.body[0];i.type;const o=i.expression;o.type;const s=o.properties[0];s.type,Object.assign(n,e.evaluater.evaluateExpression(s.argument))}else jh(e,t.position);else{const a=r.name;let i;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const s=r.value.data.estree.body[0];s.type,i=e.evaluater.evaluateExpression(s.expression)}else jh(e,t.position);else i=r.value===null?!0:r.value;n[a]=i}return n}function $5(e,t){const n=[];let r=-1;const a=e.passKeys?new Map:nMe;for(;++r<t.children.length;){const i=t.children[r];let o;if(e.passKeys){const l=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(l){const c=a.get(l)||0;o=l+"-"+c,a.set(l,c+1)}}const s=vX(e,i,o);s!==void 0&&n.push(s)}return n}function EMe(e,t,n){const r=_y(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?lX(n):_X(n)),r.property==="style"){let a=typeof n=="object"?n:bMe(e,String(n));return e.stylePropertyNameCase==="css"&&(a=SMe(a)),["style",a]}return[e.elementAttributeNameCase==="react"&&r.space?ULe[r.property]||r.property:r.attribute,n]}}function bMe(e,t){const n={};try{eMe(t,r)}catch(a){if(!e.ignoreInvalidStyle){const i=a,o=new Ua("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:i,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=SX+"#cannot-parse-style-attribute",o}}return n;function r(a,i){let o=a;o.slice(0,2)!=="--"&&(o.slice(0,4)==="-ms-"&&(o="ms-"+o.slice(4)),o=o.replace(aMe,yMe)),n[o]=i}}function TX(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const a=t.split(".");let i=-1,o;for(;++i<a.length;){const s=A9(a[i])?{type:"Identifier",name:a[i]}:{type:"Literal",value:a[i]};o=o?{type:"MemberExpression",object:o,property:s,computed:!!(i&&s.type==="Literal"),optional:!1}:s}r=o}else r=A9(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const a=r.value;return B5.call(e.components,a)?e.components[a]:a}if(e.evaluater)return e.evaluater.evaluateExpression(r);jh(e)}function jh(e,t){const n=new Ua("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=SX+"#cannot-handle-mdx-estrees-without-createevaluater",n}function SMe(e){const t={};let n;for(n in e)B5.call(e,n)&&(t[vMe(n)]=e[n]);return t}function vMe(e){let t=e.replace(rMe,TMe);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function yMe(e,t){return t.toUpperCase()}function TMe(e){return"-"+e.toLowerCase()}const $2={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},CMe={};function z5(e,t){const n=t||CMe,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,a=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return CX(e,r,a)}function CX(e,t,n){if(RMe(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return U9(e.children,t,n)}return Array.isArray(e)?U9(e,t,n):""}function U9(e,t,n){const r=[];let a=-1;for(;++a<e.length;)r[a]=CX(e[a],t,n);return r.join("")}function RMe(e){return!!(e&&typeof e=="object")}const $9=document.createElement("i");function H5(e){const t="&"+e+";";$9.innerHTML=t;const n=$9.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function wo(e,t,n,r){const a=e.length;let i=0,o;if(t<0?t=-t>a?0:a+t:t=t>a?a:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);i<r.length;)o=r.slice(i,i+1e4),o.unshift(t,0),e.splice(...o),i+=1e4,t+=1e4}function To(e,t){return e.length>0?(wo(e,e.length,0,t),e):t}const z9={}.hasOwnProperty;function RX(e){const t={};let n=-1;for(;++n<e.length;)xMe(t,e[n]);return t}function xMe(e,t){let n;for(n in t){const a=(z9.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let o;if(i)for(o in i){z9.call(a,o)||(a[o]=[]);const s=i[o];AMe(a[o],Array.isArray(s)?s:s?[s]:[])}}}function AMe(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);wo(e,0,0,r)}function xX(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function ps(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ja=lu(/[A-Za-z]/),Fa=lu(/[\dA-Za-z]/),OMe=lu(/[#-'*+\--9=?A-Z^-~]/);function Wb(e){return e!==null&&(e<32||e===127)}const d4=lu(/\d/),NMe=lu(/[\dA-Fa-f]/),IMe=lu(/[!-/:-@[-`{-~]/);function Lt(e){return e!==null&&e<-2}function Hn(e){return e!==null&&(e<0||e===32)}function pn(e){return e===-2||e===-1||e===32}const by=lu(/\p{P}|\p{S}/u),hd=lu(/\s/);function lu(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function e0(e){const t=[];let n=-1,r=0,a=0;for(;++n<e.length;){const i=e.charCodeAt(n);let o="";if(i===37&&Fa(e.charCodeAt(n+1))&&Fa(e.charCodeAt(n+2)))a=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(o=String.fromCharCode(i));else if(i>55295&&i<57344){const s=e.charCodeAt(n+1);i<56320&&s>56319&&s<57344?(o=String.fromCharCode(i,s),a=1):o="�"}else o=String.fromCharCode(i);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+a+1,o=""),a&&(n+=a,a=0)}return t.join("")+e.slice(r)}function un(e,t,n,r){const a=r?r-1:Number.POSITIVE_INFINITY;let i=0;return o;function o(l){return pn(l)?(e.enter(n),s(l)):t(l)}function s(l){return pn(l)&&i++<a?(e.consume(l),s):(e.exit(n),t(l))}}const wMe={tokenize:DMe};function DMe(e){const t=e.attempt(this.parser.constructs.contentInitial,r,a);let n;return t;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),un(e,t,"linePrefix")}function a(s){return e.enter("paragraph"),i(s)}function i(s){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,o(s)}function o(s){if(s===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(s);return}return Lt(s)?(e.consume(s),e.exit("chunkText"),i):(e.consume(s),o)}}const LMe={tokenize:MMe},H9={tokenize:kMe};function MMe(e){const t=this,n=[];let r=0,a,i,o;return s;function s(C){if(r<n.length){const T=n[r];return t.containerState=T[1],e.attempt(T[0].continuation,l,c)(C)}return c(C)}function l(C){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,a&&v();const T=t.events.length;let N=T,A;for(;N--;)if(t.events[N][0]==="exit"&&t.events[N][1].type==="chunkFlow"){A=t.events[N][1].end;break}b(r);let O=T;for(;O<t.events.length;)t.events[O][1].end=Object.assign({},A),O++;return wo(t.events,N+1,0,t.events.slice(T)),t.events.length=O,c(C)}return s(C)}function c(C){if(r===n.length){if(!a)return f(C);if(a.currentConstruct&&a.currentConstruct.concrete)return g(C);t.interrupt=!!(a.currentConstruct&&!a._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(H9,u,p)(C)}function u(C){return a&&v(),b(r),f(C)}function p(C){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,g(C)}function f(C){return t.containerState={},e.attempt(H9,h,g)(C)}function h(C){return r++,n.push([t.currentConstruct,t.containerState]),f(C)}function g(C){if(C===null){a&&v(),b(0),e.consume(C);return}return a=a||t.parser.flow(t.now()),e.enter("chunkFlow",{contentType:"flow",previous:i,_tokenizer:a}),E(C)}function E(C){if(C===null){y(e.exit("chunkFlow"),!0),b(0),e.consume(C);return}return Lt(C)?(e.consume(C),y(e.exit("chunkFlow")),r=0,t.interrupt=void 0,s):(e.consume(C),E)}function y(C,T){const N=t.sliceStream(C);if(T&&N.push(null),C.previous=i,i&&(i.next=C),i=C,a.defineSkip(C.start),a.write(N),t.parser.lazy[C.start.line]){let A=a.events.length;for(;A--;)if(a.events[A][1].start.offset<o&&(!a.events[A][1].end||a.events[A][1].end.offset>o))return;const O=t.events.length;let M=O,P,D;for(;M--;)if(t.events[M][0]==="exit"&&t.events[M][1].type==="chunkFlow"){if(P){D=t.events[M][1].end;break}P=!0}for(b(r),A=O;A<t.events.length;)t.events[A][1].end=Object.assign({},D),A++;wo(t.events,M+1,0,t.events.slice(O)),t.events.length=A}}function b(C){let T=n.length;for(;T-- >C;){const N=n[T];t.containerState=N[1],N[0].exit.call(t,e)}n.length=C}function v(){a.write([null]),i=void 0,a=void 0,t.containerState._closeFlow=void 0}}function kMe(e,t,n){return un(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function jb(e){if(e===null||Hn(e)||hd(e))return 1;if(by(e))return 2}function Sy(e,t,n){const r=[];let a=-1;for(;++a<e.length;){const i=e[a].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}const p4={name:"attention",tokenize:FMe,resolveAll:PMe};function PMe(e,t){let n=-1,r,a,i,o,s,l,c,u;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const p=Object.assign({},e[r][1].end),f=Object.assign({},e[n][1].start);G9(p,-l),G9(f,l),o={type:l>1?"strongSequence":"emphasisSequence",start:p,end:Object.assign({},e[r][1].end)},s={type:l>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[n][1].start),end:f},i={type:l>1?"strongText":"emphasisText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},a={type:l>1?"strong":"emphasis",start:Object.assign({},o.start),end:Object.assign({},s.end)},e[r][1].end=Object.assign({},o.start),e[n][1].start=Object.assign({},s.end),c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=To(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=To(c,[["enter",a,t],["enter",o,t],["exit",o,t],["enter",i,t]]),c=To(c,Sy(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=To(c,[["exit",i,t],["enter",s,t],["exit",s,t],["exit",a,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,c=To(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,wo(e,r-1,n-r+3,c),n=r+c.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function FMe(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,a=jb(r);let i;return o;function o(l){return i=l,e.enter("attentionSequence"),s(l)}function s(l){if(l===i)return e.consume(l),s;const c=e.exit("attentionSequence"),u=jb(l),p=!u||u===2&&a||n.includes(l),f=!a||a===2&&u||n.includes(r);return c._open=!!(i===42?p:p&&(a||!f)),c._close=!!(i===42?f:f&&(u||!p)),t(l)}}function G9(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const BMe={name:"autolink",tokenize:UMe};function UMe(e,t,n){let r=0;return a;function a(h){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(h){return Ja(h)?(e.consume(h),o):h===64?n(h):c(h)}function o(h){return h===43||h===45||h===46||Fa(h)?(r=1,s(h)):c(h)}function s(h){return h===58?(e.consume(h),r=0,l):(h===43||h===45||h===46||Fa(h))&&r++<32?(e.consume(h),s):(r=0,c(h))}function l(h){return h===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):h===null||h===32||h===60||Wb(h)?n(h):(e.consume(h),l)}function c(h){return h===64?(e.consume(h),u):OMe(h)?(e.consume(h),c):n(h)}function u(h){return Fa(h)?p(h):n(h)}function p(h){return h===46?(e.consume(h),r=0,u):h===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):f(h)}function f(h){if((h===45||Fa(h))&&r++<63){const g=h===45?f:p;return e.consume(h),g}return n(h)}}const Pg={tokenize:$Me,partial:!0};function $Me(e,t,n){return r;function r(i){return pn(i)?un(e,a,"linePrefix")(i):a(i)}function a(i){return i===null||Lt(i)?t(i):n(i)}}const AX={name:"blockQuote",tokenize:zMe,continuation:{tokenize:HMe},exit:GMe};function zMe(e,t,n){const r=this;return a;function a(o){if(o===62){const s=r.containerState;return s.open||(e.enter("blockQuote",{_container:!0}),s.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),i}return n(o)}function i(o){return pn(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function HMe(e,t,n){const r=this;return a;function a(o){return pn(o)?un(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):i(o)}function i(o){return e.attempt(AX,t,n)(o)}}function GMe(e){e.exit("blockQuote")}const OX={name:"characterEscape",tokenize:VMe};function VMe(e,t,n){return r;function r(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),a}function a(i){return IMe(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const NX={name:"characterReference",tokenize:YMe};function YMe(e,t,n){const r=this;let a=0,i,o;return s;function s(p){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),l}function l(p){return p===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(p),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),i=31,o=Fa,u(p))}function c(p){return p===88||p===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(p),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,o=NMe,u):(e.enter("characterReferenceValue"),i=7,o=d4,u(p))}function u(p){if(p===59&&a){const f=e.exit("characterReferenceValue");return o===Fa&&!H5(r.sliceSerialize(f))?n(p):(e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(p)&&a++<i?(e.consume(p),u):n(p)}}const V9={tokenize:WMe,partial:!0},Y9={name:"codeFenced",tokenize:qMe,concrete:!0};function qMe(e,t,n){const r=this,a={tokenize:N,partial:!0};let i=0,o=0,s;return l;function l(A){return c(A)}function c(A){const O=r.events[r.events.length-1];return i=O&&O[1].type==="linePrefix"?O[2].sliceSerialize(O[1],!0).length:0,s=A,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(A)}function u(A){return A===s?(o++,e.consume(A),u):o<3?n(A):(e.exit("codeFencedFenceSequence"),pn(A)?un(e,p,"whitespace")(A):p(A))}function p(A){return A===null||Lt(A)?(e.exit("codeFencedFence"),r.interrupt?t(A):e.check(V9,E,T)(A)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),f(A))}function f(A){return A===null||Lt(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),p(A)):pn(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),un(e,h,"whitespace")(A)):A===96&&A===s?n(A):(e.consume(A),f)}function h(A){return A===null||Lt(A)?p(A):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(A))}function g(A){return A===null||Lt(A)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),p(A)):A===96&&A===s?n(A):(e.consume(A),g)}function E(A){return e.attempt(a,T,y)(A)}function y(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),b}function b(A){return i>0&&pn(A)?un(e,v,"linePrefix",i+1)(A):v(A)}function v(A){return A===null||Lt(A)?e.check(V9,E,T)(A):(e.enter("codeFlowValue"),C(A))}function C(A){return A===null||Lt(A)?(e.exit("codeFlowValue"),v(A)):(e.consume(A),C)}function T(A){return e.exit("codeFenced"),t(A)}function N(A,O,M){let P=0;return D;function D(ae){return A.enter("lineEnding"),A.consume(ae),A.exit("lineEnding"),$}function $(ae){return A.enter("codeFencedFence"),pn(ae)?un(A,V,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(ae):V(ae)}function V(ae){return ae===s?(A.enter("codeFencedFenceSequence"),Z(ae)):M(ae)}function Z(ae){return ae===s?(P++,A.consume(ae),Z):P>=o?(A.exit("codeFencedFenceSequence"),pn(ae)?un(A,W,"whitespace")(ae):W(ae)):M(ae)}function W(ae){return ae===null||Lt(ae)?(A.exit("codeFencedFence"),O(ae)):M(ae)}}}function WMe(e,t,n){const r=this;return a;function a(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i)}function i(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const z2={name:"codeIndented",tokenize:KMe},jMe={tokenize:QMe,partial:!0};function KMe(e,t,n){const r=this;return a;function a(c){return e.enter("codeIndented"),un(e,i,"linePrefix",4+1)(c)}function i(c){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?o(c):n(c)}function o(c){return c===null?l(c):Lt(c)?e.attempt(jMe,o,l)(c):(e.enter("codeFlowValue"),s(c))}function s(c){return c===null||Lt(c)?(e.exit("codeFlowValue"),o(c)):(e.consume(c),s)}function l(c){return e.exit("codeIndented"),t(c)}}function QMe(e,t,n){const r=this;return a;function a(o){return r.parser.lazy[r.now().line]?n(o):Lt(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a):un(e,i,"linePrefix",4+1)(o)}function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(o):Lt(o)?a(o):n(o)}}const XMe={name:"codeText",tokenize:e8e,resolve:ZMe,previous:JMe};function ZMe(e){let t=e.length-4,n=3,r,a;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)a===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(a=r):(r===t||e[r][1].type==="lineEnding")&&(e[a][1].type="codeTextData",r!==a+2&&(e[a][1].end=e[r-1][1].end,e.splice(a+2,r-a-2),t-=r-a-2,r=a+2),a=void 0);return e}function JMe(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function e8e(e,t,n){let r=0,a,i;return o;function o(p){return e.enter("codeText"),e.enter("codeTextSequence"),s(p)}function s(p){return p===96?(e.consume(p),r++,s):(e.exit("codeTextSequence"),l(p))}function l(p){return p===null?n(p):p===32?(e.enter("space"),e.consume(p),e.exit("space"),l):p===96?(i=e.enter("codeTextSequence"),a=0,u(p)):Lt(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(p))}function c(p){return p===null||p===32||p===96||Lt(p)?(e.exit("codeTextData"),l(p)):(e.consume(p),c)}function u(p){return p===96?(e.consume(p),a++,u):a===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(p)):(i.type="codeTextData",c(p))}}class t8e{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const a=n||0;this.setCursor(Math.trunc(t));const i=this.right.splice(this.right.length-a,Number.POSITIVE_INFINITY);return r&&gm(this.left,r),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),gm(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),gm(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);gm(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);gm(this.left,n.reverse())}}}function gm(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function IX(e){const t={};let n=-1,r,a,i,o,s,l,c;const u=new t8e(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type==="chunkFlow"&&u.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,i=0,i<l.length&&l[i][1].type==="lineEndingBlank"&&(i+=2),i<l.length&&l[i][1].type==="content"))for(;++i<l.length&&l[i][1].type!=="content";)l[i][1].type==="chunkText"&&(l[i][1]._isInFirstContentOfListItem=!0,i++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,n8e(u,n)),n=t[n],c=!0);else if(r[1]._container){for(i=n,a=void 0;i--&&(o=u.get(i),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank");)o[0]==="enter"&&(a&&(u.get(a)[1].type="lineEndingBlank"),o[1].type="lineEnding",a=i);a&&(r[1].end=Object.assign({},u.get(a)[1].start),s=u.slice(a,n),s.unshift(r),u.splice(a,n-a+1,s))}}return wo(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function n8e(e,t){const n=e.get(t)[1],r=e.get(t)[2];let a=t-1;const i=[],o=n._tokenizer||r.parser[n.contentType](n.start),s=o.events,l=[],c={};let u,p,f=-1,h=n,g=0,E=0;const y=[E];for(;h;){for(;e.get(++a)[1]!==h;);i.push(a),h._tokenizer||(u=r.sliceStream(h),h.next||u.push(null),p&&o.defineSkip(h.start),h._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),h._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),p=h,h=h.next}for(h=n;++f<s.length;)s[f][0]==="exit"&&s[f-1][0]==="enter"&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(E=f+1,y.push(E),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(o.events=[],h?(h._tokenizer=void 0,h.previous=void 0):y.pop(),f=y.length;f--;){const b=s.slice(y[f],y[f+1]),v=i.pop();l.push([v,v+b.length-1]),e.splice(v,2,b)}for(l.reverse(),f=-1;++f<l.length;)c[g+l[f][0]]=g+l[f][1],g+=l[f][1]-l[f][0]-1;return c}const r8e={tokenize:o8e,resolve:i8e},a8e={tokenize:s8e,partial:!0};function i8e(e){return IX(e),e}function o8e(e,t){let n;return r;function r(s){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),a(s)}function a(s){return s===null?i(s):Lt(s)?e.check(a8e,o,i)(s):(e.consume(s),a)}function i(s){return e.exit("chunkContent"),e.exit("content"),t(s)}function o(s){return e.consume(s),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,a}}function s8e(e,t,n){const r=this;return a;function a(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),un(e,i,"linePrefix")}function i(o){if(o===null||Lt(o))return n(o);const s=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function wX(e,t,n,r,a,i,o,s,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return p;function p(b){return b===60?(e.enter(r),e.enter(a),e.enter(i),e.consume(b),e.exit(i),f):b===null||b===32||b===41||Wb(b)?n(b):(e.enter(r),e.enter(o),e.enter(s),e.enter("chunkString",{contentType:"string"}),E(b))}function f(b){return b===62?(e.enter(i),e.consume(b),e.exit(i),e.exit(a),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),h(b))}function h(b){return b===62?(e.exit("chunkString"),e.exit(s),f(b)):b===null||b===60||Lt(b)?n(b):(e.consume(b),b===92?g:h)}function g(b){return b===60||b===62||b===92?(e.consume(b),h):h(b)}function E(b){return!u&&(b===null||b===41||Hn(b))?(e.exit("chunkString"),e.exit(s),e.exit(o),e.exit(r),t(b)):u<c&&b===40?(e.consume(b),u++,E):b===41?(e.consume(b),u--,E):b===null||b===32||b===40||Wb(b)?n(b):(e.consume(b),b===92?y:E)}function y(b){return b===40||b===41||b===92?(e.consume(b),E):E(b)}}function DX(e,t,n,r,a,i){const o=this;let s=0,l;return c;function c(h){return e.enter(r),e.enter(a),e.consume(h),e.exit(a),e.enter(i),u}function u(h){return s>999||h===null||h===91||h===93&&!l||h===94&&!s&&"_hiddenFootnoteSupport"in o.parser.constructs?n(h):h===93?(e.exit(i),e.enter(a),e.consume(h),e.exit(a),e.exit(r),t):Lt(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),p(h))}function p(h){return h===null||h===91||h===93||Lt(h)||s++>999?(e.exit("chunkString"),u(h)):(e.consume(h),l||(l=!pn(h)),h===92?f:p)}function f(h){return h===91||h===92||h===93?(e.consume(h),s++,p):p(h)}}function LX(e,t,n,r,a,i){let o;return s;function s(f){return f===34||f===39||f===40?(e.enter(r),e.enter(a),e.consume(f),e.exit(a),o=f===40?41:f,l):n(f)}function l(f){return f===o?(e.enter(a),e.consume(f),e.exit(a),e.exit(r),t):(e.enter(i),c(f))}function c(f){return f===o?(e.exit(i),l(o)):f===null?n(f):Lt(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),un(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(f))}function u(f){return f===o||f===null||Lt(f)?(e.exit("chunkString"),c(f)):(e.consume(f),f===92?p:u)}function p(f){return f===o||f===92?(e.consume(f),u):u(f)}}function ih(e,t){let n;return r;function r(a){return Lt(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n=!0,r):pn(a)?un(e,r,n?"linePrefix":"lineSuffix")(a):t(a)}}const l8e={name:"definition",tokenize:u8e},c8e={tokenize:d8e,partial:!0};function u8e(e,t,n){const r=this;let a;return i;function i(h){return e.enter("definition"),o(h)}function o(h){return DX.call(r,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function s(h){return a=ps(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),l):n(h)}function l(h){return Hn(h)?ih(e,c)(h):c(h)}function c(h){return wX(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function u(h){return e.attempt(c8e,p,p)(h)}function p(h){return pn(h)?un(e,f,"whitespace")(h):f(h)}function f(h){return h===null||Lt(h)?(e.exit("definition"),r.parser.defined.push(a),t(h)):n(h)}}function d8e(e,t,n){return r;function r(s){return Hn(s)?ih(e,a)(s):n(s)}function a(s){return LX(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function i(s){return pn(s)?un(e,o,"whitespace")(s):o(s)}function o(s){return s===null||Lt(s)?t(s):n(s)}}const p8e={name:"hardBreakEscape",tokenize:f8e};function f8e(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),a}function a(i){return Lt(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const m8e={name:"headingAtx",tokenize:g8e,resolve:h8e};function h8e(e,t){let n=e.length-2,r=3,a,i;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(a={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},i={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},wo(e,r,n-r+1,[["enter",a,t],["enter",i,t],["exit",i,t],["exit",a,t]])),e}function g8e(e,t,n){let r=0;return a;function a(u){return e.enter("atxHeading"),i(u)}function i(u){return e.enter("atxHeadingSequence"),o(u)}function o(u){return u===35&&r++<6?(e.consume(u),o):u===null||Hn(u)?(e.exit("atxHeadingSequence"),s(u)):n(u)}function s(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||Lt(u)?(e.exit("atxHeading"),t(u)):pn(u)?un(e,s,"whitespace")(u):(e.enter("atxHeadingText"),c(u))}function l(u){return u===35?(e.consume(u),l):(e.exit("atxHeadingSequence"),s(u))}function c(u){return u===null||u===35||Hn(u)?(e.exit("atxHeadingText"),s(u)):(e.consume(u),c)}}const _8e=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],q9=["pre","script","style","textarea"],E8e={name:"htmlFlow",tokenize:y8e,resolveTo:v8e,concrete:!0},b8e={tokenize:C8e,partial:!0},S8e={tokenize:T8e,partial:!0};function v8e(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function y8e(e,t,n){const r=this;let a,i,o,s,l;return c;function c(F){return u(F)}function u(F){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(F),p}function p(F){return F===33?(e.consume(F),f):F===47?(e.consume(F),i=!0,E):F===63?(e.consume(F),a=3,r.interrupt?t:k):Ja(F)?(e.consume(F),o=String.fromCharCode(F),y):n(F)}function f(F){return F===45?(e.consume(F),a=2,h):F===91?(e.consume(F),a=5,s=0,g):Ja(F)?(e.consume(F),a=4,r.interrupt?t:k):n(F)}function h(F){return F===45?(e.consume(F),r.interrupt?t:k):n(F)}function g(F){const le="CDATA[";return F===le.charCodeAt(s++)?(e.consume(F),s===le.length?r.interrupt?t:V:g):n(F)}function E(F){return Ja(F)?(e.consume(F),o=String.fromCharCode(F),y):n(F)}function y(F){if(F===null||F===47||F===62||Hn(F)){const le=F===47,Te=o.toLowerCase();return!le&&!i&&q9.includes(Te)?(a=1,r.interrupt?t(F):V(F)):_8e.includes(o.toLowerCase())?(a=6,le?(e.consume(F),b):r.interrupt?t(F):V(F)):(a=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(F):i?v(F):C(F))}return F===45||Fa(F)?(e.consume(F),o+=String.fromCharCode(F),y):n(F)}function b(F){return F===62?(e.consume(F),r.interrupt?t:V):n(F)}function v(F){return pn(F)?(e.consume(F),v):D(F)}function C(F){return F===47?(e.consume(F),D):F===58||F===95||Ja(F)?(e.consume(F),T):pn(F)?(e.consume(F),C):D(F)}function T(F){return F===45||F===46||F===58||F===95||Fa(F)?(e.consume(F),T):N(F)}function N(F){return F===61?(e.consume(F),A):pn(F)?(e.consume(F),N):C(F)}function A(F){return F===null||F===60||F===61||F===62||F===96?n(F):F===34||F===39?(e.consume(F),l=F,O):pn(F)?(e.consume(F),A):M(F)}function O(F){return F===l?(e.consume(F),l=null,P):F===null||Lt(F)?n(F):(e.consume(F),O)}function M(F){return F===null||F===34||F===39||F===47||F===60||F===61||F===62||F===96||Hn(F)?N(F):(e.consume(F),M)}function P(F){return F===47||F===62||pn(F)?C(F):n(F)}function D(F){return F===62?(e.consume(F),$):n(F)}function $(F){return F===null||Lt(F)?V(F):pn(F)?(e.consume(F),$):n(F)}function V(F){return F===45&&a===2?(e.consume(F),he):F===60&&a===1?(e.consume(F),q):F===62&&a===4?(e.consume(F),ie):F===63&&a===3?(e.consume(F),k):F===93&&a===5?(e.consume(F),H):Lt(F)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(b8e,j,Z)(F)):F===null||Lt(F)?(e.exit("htmlFlowData"),Z(F)):(e.consume(F),V)}function Z(F){return e.check(S8e,W,j)(F)}function W(F){return e.enter("lineEnding"),e.consume(F),e.exit("lineEnding"),ae}function ae(F){return F===null||Lt(F)?Z(F):(e.enter("htmlFlowData"),V(F))}function he(F){return F===45?(e.consume(F),k):V(F)}function q(F){return F===47?(e.consume(F),o="",G):V(F)}function G(F){if(F===62){const le=o.toLowerCase();return q9.includes(le)?(e.consume(F),ie):V(F)}return Ja(F)&&o.length<8?(e.consume(F),o+=String.fromCharCode(F),G):V(F)}function H(F){return F===93?(e.consume(F),k):V(F)}function k(F){return F===62?(e.consume(F),ie):F===45&&a===2?(e.consume(F),k):V(F)}function ie(F){return F===null||Lt(F)?(e.exit("htmlFlowData"),j(F)):(e.consume(F),ie)}function j(F){return e.exit("htmlFlow"),t(F)}}function T8e(e,t,n){const r=this;return a;function a(o){return Lt(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):n(o)}function i(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function C8e(e,t,n){return r;function r(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(Pg,t,n)}}const R8e={name:"htmlText",tokenize:x8e};function x8e(e,t,n){const r=this;let a,i,o;return s;function s(k){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(k),l}function l(k){return k===33?(e.consume(k),c):k===47?(e.consume(k),N):k===63?(e.consume(k),C):Ja(k)?(e.consume(k),M):n(k)}function c(k){return k===45?(e.consume(k),u):k===91?(e.consume(k),i=0,g):Ja(k)?(e.consume(k),v):n(k)}function u(k){return k===45?(e.consume(k),h):n(k)}function p(k){return k===null?n(k):k===45?(e.consume(k),f):Lt(k)?(o=p,q(k)):(e.consume(k),p)}function f(k){return k===45?(e.consume(k),h):p(k)}function h(k){return k===62?he(k):k===45?f(k):p(k)}function g(k){const ie="CDATA[";return k===ie.charCodeAt(i++)?(e.consume(k),i===ie.length?E:g):n(k)}function E(k){return k===null?n(k):k===93?(e.consume(k),y):Lt(k)?(o=E,q(k)):(e.consume(k),E)}function y(k){return k===93?(e.consume(k),b):E(k)}function b(k){return k===62?he(k):k===93?(e.consume(k),b):E(k)}function v(k){return k===null||k===62?he(k):Lt(k)?(o=v,q(k)):(e.consume(k),v)}function C(k){return k===null?n(k):k===63?(e.consume(k),T):Lt(k)?(o=C,q(k)):(e.consume(k),C)}function T(k){return k===62?he(k):C(k)}function N(k){return Ja(k)?(e.consume(k),A):n(k)}function A(k){return k===45||Fa(k)?(e.consume(k),A):O(k)}function O(k){return Lt(k)?(o=O,q(k)):pn(k)?(e.consume(k),O):he(k)}function M(k){return k===45||Fa(k)?(e.consume(k),M):k===47||k===62||Hn(k)?P(k):n(k)}function P(k){return k===47?(e.consume(k),he):k===58||k===95||Ja(k)?(e.consume(k),D):Lt(k)?(o=P,q(k)):pn(k)?(e.consume(k),P):he(k)}function D(k){return k===45||k===46||k===58||k===95||Fa(k)?(e.consume(k),D):$(k)}function $(k){return k===61?(e.consume(k),V):Lt(k)?(o=$,q(k)):pn(k)?(e.consume(k),$):P(k)}function V(k){return k===null||k===60||k===61||k===62||k===96?n(k):k===34||k===39?(e.consume(k),a=k,Z):Lt(k)?(o=V,q(k)):pn(k)?(e.consume(k),V):(e.consume(k),W)}function Z(k){return k===a?(e.consume(k),a=void 0,ae):k===null?n(k):Lt(k)?(o=Z,q(k)):(e.consume(k),Z)}function W(k){return k===null||k===34||k===39||k===60||k===61||k===96?n(k):k===47||k===62||Hn(k)?P(k):(e.consume(k),W)}function ae(k){return k===47||k===62||Hn(k)?P(k):n(k)}function he(k){return k===62?(e.consume(k),e.exit("htmlTextData"),e.exit("htmlText"),t):n(k)}function q(k){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),G}function G(k){return pn(k)?un(e,H,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):H(k)}function H(k){return e.enter("htmlTextData"),o(k)}}const G5={name:"labelEnd",tokenize:D8e,resolveTo:w8e,resolveAll:I8e},A8e={tokenize:L8e},O8e={tokenize:M8e},N8e={tokenize:k8e};function I8e(e){let t=-1;for(;++t<e.length;){const n=e[t][1];(n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd")&&(e.splice(t+1,n.type==="labelImage"?4:2),n.type="data",t++)}return e}function w8e(e,t){let n=e.length,r=0,a,i,o,s;for(;n--;)if(a=e[n][1],i){if(a.type==="link"||a.type==="labelLink"&&a._inactive)break;e[n][0]==="enter"&&a.type==="labelLink"&&(a._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(a.type==="labelImage"||a.type==="labelLink")&&!a._balanced&&(i=n,a.type!=="labelLink")){r=2;break}}else a.type==="labelEnd"&&(o=n);const l={type:e[i][1].type==="labelLink"?"link":"image",start:Object.assign({},e[i][1].start),end:Object.assign({},e[e.length-1][1].end)},c={type:"label",start:Object.assign({},e[i][1].start),end:Object.assign({},e[o][1].end)},u={type:"labelText",start:Object.assign({},e[i+r+2][1].end),end:Object.assign({},e[o-2][1].start)};return s=[["enter",l,t],["enter",c,t]],s=To(s,e.slice(i+1,i+r+3)),s=To(s,[["enter",u,t]]),s=To(s,Sy(t.parser.constructs.insideSpan.null,e.slice(i+r+4,o-3),t)),s=To(s,[["exit",u,t],e[o-2],e[o-1],["exit",c,t]]),s=To(s,e.slice(o+1)),s=To(s,[["exit",l,t]]),wo(e,i,e.length,s),e}function D8e(e,t,n){const r=this;let a=r.events.length,i,o;for(;a--;)if((r.events[a][1].type==="labelImage"||r.events[a][1].type==="labelLink")&&!r.events[a][1]._balanced){i=r.events[a][1];break}return s;function s(f){return i?i._inactive?p(f):(o=r.parser.defined.includes(ps(r.sliceSerialize({start:i.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelEnd"),l):n(f)}function l(f){return f===40?e.attempt(A8e,u,o?u:p)(f):f===91?e.attempt(O8e,u,o?c:p)(f):o?u(f):p(f)}function c(f){return e.attempt(N8e,u,p)(f)}function u(f){return t(f)}function p(f){return i._balanced=!0,n(f)}}function L8e(e,t,n){return r;function r(p){return e.enter("resource"),e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),a}function a(p){return Hn(p)?ih(e,i)(p):i(p)}function i(p){return p===41?u(p):wX(e,o,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function o(p){return Hn(p)?ih(e,l)(p):u(p)}function s(p){return n(p)}function l(p){return p===34||p===39||p===40?LX(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):u(p)}function c(p){return Hn(p)?ih(e,u)(p):u(p)}function u(p){return p===41?(e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),e.exit("resource"),t):n(p)}}function M8e(e,t,n){const r=this;return a;function a(s){return DX.call(r,e,i,o,"reference","referenceMarker","referenceString")(s)}function i(s){return r.parser.defined.includes(ps(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(s):n(s)}function o(s){return n(s)}}function k8e(e,t,n){return r;function r(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),a}function a(i){return i===93?(e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),e.exit("reference"),t):n(i)}}const P8e={name:"labelStartImage",tokenize:F8e,resolveAll:G5.resolveAll};function F8e(e,t,n){const r=this;return a;function a(s){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(s),e.exit("labelImageMarker"),i}function i(s){return s===91?(e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelImage"),o):n(s)}function o(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const B8e={name:"labelStartLink",tokenize:U8e,resolveAll:G5.resolveAll};function U8e(e,t,n){const r=this;return a;function a(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),i}function i(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const H2={name:"lineEnding",tokenize:$8e};function $8e(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),un(e,t,"linePrefix")}}const qE={name:"thematicBreak",tokenize:z8e};function z8e(e,t,n){let r=0,a;return i;function i(c){return e.enter("thematicBreak"),o(c)}function o(c){return a=c,s(c)}function s(c){return c===a?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||Lt(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===a?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),pn(c)?un(e,s,"whitespace")(c):s(c))}}const fi={name:"list",tokenize:V8e,continuation:{tokenize:Y8e},exit:W8e},H8e={tokenize:j8e,partial:!0},G8e={tokenize:q8e,partial:!0};function V8e(e,t,n){const r=this,a=r.events[r.events.length-1];let i=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0,o=0;return s;function s(h){const g=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:d4(h)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(qE,n,c)(h):c(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(h)}return n(h)}function l(h){return d4(h)&&++o<10?(e.consume(h),l):(!r.interrupt||o<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),c(h)):n(h)}function c(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,e.check(Pg,r.interrupt?n:u,e.attempt(H8e,f,p))}function u(h){return r.containerState.initialBlankLine=!0,i++,f(h)}function p(h){return pn(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),f):n(h)}function f(h){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function Y8e(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Pg,a,i);function a(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,un(e,t,"listItemIndent",r.containerState.size+1)(s)}function i(s){return r.containerState.furtherBlankLines||!pn(s)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(s)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(G8e,t,o)(s))}function o(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,un(e,e.attempt(fi,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function q8e(e,t,n){const r=this;return un(e,a,"listItemIndent",r.containerState.size+1);function a(i){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(i):n(i)}}function W8e(e){e.exit(this.containerState.type)}function j8e(e,t,n){const r=this;return un(e,a,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4+1);function a(i){const o=r.events[r.events.length-1];return!pn(i)&&o&&o[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const W9={name:"setextUnderline",tokenize:Q8e,resolveTo:K8e};function K8e(e,t){let n=e.length,r,a,i;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(a=n)}else e[n][1].type==="content"&&e.splice(n,1),!i&&e[n][1].type==="definition"&&(i=n);const o={type:"setextHeading",start:Object.assign({},e[a][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[a][1].type="setextHeadingText",i?(e.splice(a,0,["enter",o,t]),e.splice(i+1,0,["exit",e[r][1],t]),e[r][1].end=Object.assign({},e[i][1].end)):e[r][1]=o,e.push(["exit",o,t]),e}function Q8e(e,t,n){const r=this;let a;return i;function i(c){let u=r.events.length,p;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){p=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||p)?(e.enter("setextHeadingLine"),a=c,o(c)):n(c)}function o(c){return e.enter("setextHeadingLineSequence"),s(c)}function s(c){return c===a?(e.consume(c),s):(e.exit("setextHeadingLineSequence"),pn(c)?un(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||Lt(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const X8e={tokenize:Z8e};function Z8e(e){const t=this,n=e.attempt(Pg,r,e.attempt(this.parser.constructs.flowInitial,a,un(e,e.attempt(this.parser.constructs.flow,a,e.attempt(r8e,a)),"linePrefix")));return n;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function a(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const J8e={resolveAll:kX()},eke=MX("string"),tke=MX("text");function MX(e){return{tokenize:t,resolveAll:kX(e==="text"?nke:void 0)};function t(n){const r=this,a=this.parser.constructs[e],i=n.attempt(a,o,s);return o;function o(u){return c(u)?i(u):s(u)}function s(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),l}function l(u){return c(u)?(n.exit("data"),i(u)):(n.consume(u),l)}function c(u){if(u===null)return!0;const p=a[u];let f=-1;if(p)for(;++f<p.length;){const h=p[f];if(!h.previous||h.previous.call(r,r.previous))return!0}return!1}}}function kX(e){return t;function t(n,r){let a=-1,i;for(;++a<=n.length;)i===void 0?n[a]&&n[a][1].type==="data"&&(i=a,a++):(!n[a]||n[a][1].type!=="data")&&(a!==i+2&&(n[i][1].end=n[a-1][1].end,n.splice(i+2,a-i-2),a=i+2),i=void 0);return e?e(n,r):n}}function nke(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],a=t.sliceStream(r);let i=a.length,o=-1,s=0,l;for(;i--;){const c=a[i];if(typeof c=="string"){for(o=c.length;c.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(c===-2)l=!0,s++;else if(c!==-1){i++;break}}if(s){const c={type:n===e.length||l||s<2?"lineSuffix":"hardBreakTrailing",start:{line:r.end.line,column:r.end.column-s,offset:r.end.offset-s,_index:r.start._index+i,_bufferIndex:i?o:r.start._bufferIndex+o},end:Object.assign({},r.end)};r.end=Object.assign({},c.start),r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}function rke(e,t,n){let r=Object.assign(n?Object.assign({},n):{line:1,column:1,offset:0},{_index:0,_bufferIndex:-1});const a={},i=[];let o=[],s=[];const l={consume:v,enter:C,exit:T,attempt:O(N),check:O(A),interrupt:O(A,{interrupt:!0})},c={previous:null,code:null,containerState:{},events:[],parser:e,sliceStream:h,sliceSerialize:f,now:g,defineSkip:E,write:p};let u=t.tokenize.call(c,l);return t.resolveAll&&i.push(t),c;function p($){return o=To(o,$),y(),o[o.length-1]!==null?[]:(M(t,0),c.events=Sy(i,c.events,c),c.events)}function f($,V){return ike(h($),V)}function h($){return ake(o,$)}function g(){const{line:$,column:V,offset:Z,_index:W,_bufferIndex:ae}=r;return{line:$,column:V,offset:Z,_index:W,_bufferIndex:ae}}function E($){a[$.line]=$.column,D()}function y(){let $;for(;r._index<o.length;){const V=o[r._index];if(typeof V=="string")for($=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===$&&r._bufferIndex<V.length;)b(V.charCodeAt(r._bufferIndex));else b(V)}}function b($){u=u($)}function v($){Lt($)?(r.line++,r.column=1,r.offset+=$===-3?2:1,D()):$!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=$}function C($,V){const Z=V||{};return Z.type=$,Z.start=g(),c.events.push(["enter",Z,c]),s.push(Z),Z}function T($){const V=s.pop();return V.end=g(),c.events.push(["exit",V,c]),V}function N($,V){M($,V.from)}function A($,V){V.restore()}function O($,V){return Z;function Z(W,ae,he){let q,G,H,k;return Array.isArray(W)?j(W):"tokenize"in W?j([W]):ie(W);function ie(fe){return Ae;function Ae(Ce){const Ne=Ce!==null&&fe[Ce],ze=Ce!==null&&fe.null,Ue=[...Array.isArray(Ne)?Ne:Ne?[Ne]:[],...Array.isArray(ze)?ze:ze?[ze]:[]];return j(Ue)(Ce)}}function j(fe){return q=fe,G=0,fe.length===0?he:F(fe[G])}function F(fe){return Ae;function Ae(Ce){return k=P(),H=fe,fe.partial||(c.currentConstruct=fe),fe.name&&c.parser.constructs.disable.null.includes(fe.name)?Te():fe.tokenize.call(V?Object.assign(Object.create(c),V):c,l,le,Te)(Ce)}}function le(fe){return $(H,k),ae}function Te(fe){return k.restore(),++G<q.length?F(q[G]):he}}}function M($,V){$.resolveAll&&!i.includes($)&&i.push($),$.resolve&&wo(c.events,V,c.events.length-V,$.resolve(c.events.slice(V),c)),$.resolveTo&&(c.events=$.resolveTo(c.events,c))}function P(){const $=g(),V=c.previous,Z=c.currentConstruct,W=c.events.length,ae=Array.from(s);return{restore:he,from:W};function he(){r=$,c.previous=V,c.currentConstruct=Z,c.events.length=W,s=ae,D()}}function D(){r.line in a&&r.column<2&&(r.column=a[r.line],r.offset+=a[r.line]-1)}}function ake(e,t){const n=t.start._index,r=t.start._bufferIndex,a=t.end._index,i=t.end._bufferIndex;let o;if(n===a)o=[e[n].slice(r,i)];else{if(o=e.slice(n,a),r>-1){const s=o[0];typeof s=="string"?o[0]=s.slice(r):o.shift()}i>0&&o.push(e[a].slice(0,i))}return o}function ike(e,t){let n=-1;const r=[];let a;for(;++n<e.length;){const i=e[n];let o;if(typeof i=="string")o=i;else switch(i){case-5:{o="\r";break}case-4:{o=`
341
341
  `;break}case-3:{o=`\r
342
342
  `;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&a)continue;o=" ";break}default:o=String.fromCharCode(i)}a=i===-2,r.push(o)}return r.join("")}const oke={42:fi,43:fi,45:fi,48:fi,49:fi,50:fi,51:fi,52:fi,53:fi,54:fi,55:fi,56:fi,57:fi,62:AX},ske={91:l8e},lke={[-2]:z2,[-1]:z2,32:z2},cke={35:m8e,42:qE,45:[W9,qE],60:E8e,61:W9,95:qE,96:Y9,126:Y9},uke={38:NX,92:OX},dke={[-5]:H2,[-4]:H2,[-3]:H2,33:P8e,38:NX,42:p4,60:[BMe,R8e],91:B8e,92:[p8e,OX],93:G5,95:p4,96:XMe},pke={null:[p4,J8e]},fke={null:[42,95]},mke={null:[]},hke=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:fke,contentInitial:ske,disable:mke,document:oke,flow:cke,flowInitial:lke,insideSpan:pke,string:uke,text:dke},Symbol.toStringTag,{value:"Module"}));function gke(e){const n=RX([hke,...(e||{}).extensions||[]]),r={defined:[],lazy:{},constructs:n,content:a(wMe),document:a(LMe),flow:a(X8e),string:a(eke),text:a(tke)};return r;function a(i){return o;function o(s){return rke(r,i,s)}}}function _ke(e){for(;!IX(e););return e}const j9=/[\0\t\n\r]/g;function Eke(){let e=1,t="",n=!0,r;return a;function a(i,o,s){const l=[];let c,u,p,f,h;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(o||void 0).decode(i)),p=0,t="",n&&(i.charCodeAt(0)===65279&&p++,n=void 0);p<i.length;){if(j9.lastIndex=p,c=j9.exec(i),f=c&&c.index!==void 0?c.index:i.length,h=i.charCodeAt(f),!c){t=i.slice(p);break}if(h===10&&p===f&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),p<f&&(l.push(i.slice(p,f)),e+=f-p),h){case 0:{l.push(65533),e++;break}case 9:{for(u=Math.ceil(e/4)*4,l.push(-2);e++<u;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}p=f+1}return s&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const bke=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Ske(e){return e.replace(bke,vke)}function vke(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const a=n.charCodeAt(1),i=a===120||a===88;return xX(n.slice(i?2:1),i?16:10)}return H5(n)||e}const PX={}.hasOwnProperty;function yke(e,t,n){return typeof t!="string"&&(n=t,t=void 0),Tke(n)(_ke(gke(n).document().write(Eke()(e,t,!0))))}function Tke(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(Ge),autolinkProtocol:P,autolinkEmail:P,atxHeading:i(Me),blockQuote:i(ze),characterEscape:P,characterReference:P,codeFenced:i(Ue),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:i(Ue,o),codeText:i(Le,o),codeTextData:P,data:P,codeFlowValue:P,definition:i(we),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:i(Pe),hardBreakEscape:i(lt),hardBreakTrailing:i(lt),htmlFlow:i(it,o),htmlFlowData:P,htmlText:i(it,o),htmlTextData:P,image:i(nt),label:o,link:i(Ge),listItem:i(ct),listItemValue:f,listOrdered:i(at,p),listUnordered:i(at),paragraph:i(se),reference:F,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:i(Me),strong:i(Fe),thematicBreak:i(oe)},exit:{atxHeading:l(),atxHeadingSequence:N,autolink:l(),autolinkEmail:Ne,autolinkProtocol:Ce,blockQuote:l(),characterEscapeValue:D,characterReferenceMarkerHexadecimal:Te,characterReferenceMarkerNumeric:Te,characterReferenceValue:fe,characterReference:Ae,codeFenced:l(y),codeFencedFence:E,codeFencedFenceInfo:h,codeFencedFenceMeta:g,codeFlowValue:D,codeIndented:l(b),codeText:l(ae),codeTextData:D,data:D,definition:l(),definitionDestinationString:T,definitionLabelString:v,definitionTitleString:C,emphasis:l(),hardBreakEscape:l(V),hardBreakTrailing:l(V),htmlFlow:l(Z),htmlFlowData:D,htmlText:l(W),htmlTextData:D,image:l(q),label:H,labelText:G,lineEnding:$,link:l(he),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:le,resourceDestinationString:k,resourceTitleString:ie,resource:j,setextHeading:l(M),setextHeadingLineSequence:O,setextHeadingText:A,strong:l(),thematicBreak:l()}};FX(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(re){let J={type:"root",children:[]};const ue={stack:[J],tokenStack:[],config:t,enter:s,exit:c,buffer:o,resume:u,data:n},ve=[];let Ve=-1;for(;++Ve<re.length;)if(re[Ve][1].type==="listOrdered"||re[Ve][1].type==="listUnordered")if(re[Ve][0]==="enter")ve.push(Ve);else{const ot=ve.pop();Ve=a(re,ot,Ve)}for(Ve=-1;++Ve<re.length;){const ot=t[re[Ve][0]];PX.call(ot,re[Ve][1].type)&&ot[re[Ve][1].type].call(Object.assign({sliceSerialize:re[Ve][2].sliceSerialize},ue),re[Ve][1])}if(ue.tokenStack.length>0){const ot=ue.tokenStack[ue.tokenStack.length-1];(ot[1]||K9).call(ue,void 0,ot[0])}for(J.position={start:lc(re.length>0?re[0][1].start:{line:1,column:1,offset:0}),end:lc(re.length>0?re[re.length-2][1].end:{line:1,column:1,offset:0})},Ve=-1;++Ve<t.transforms.length;)J=t.transforms[Ve](J)||J;return J}function a(re,J,ue){let ve=J-1,Ve=-1,ot=!1,qe,Et,be,Q;for(;++ve<=ue;){const X=re[ve];switch(X[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{X[0]==="enter"?Ve++:Ve--,Q=void 0;break}case"lineEndingBlank":{X[0]==="enter"&&(qe&&!Q&&!Ve&&!be&&(be=ve),Q=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Q=void 0}if(!Ve&&X[0]==="enter"&&X[1].type==="listItemPrefix"||Ve===-1&&X[0]==="exit"&&(X[1].type==="listUnordered"||X[1].type==="listOrdered")){if(qe){let _e=ve;for(Et=void 0;_e--;){const ke=re[_e];if(ke[1].type==="lineEnding"||ke[1].type==="lineEndingBlank"){if(ke[0]==="exit")continue;Et&&(re[Et][1].type="lineEndingBlank",ot=!0),ke[1].type="lineEnding",Et=_e}else if(!(ke[1].type==="linePrefix"||ke[1].type==="blockQuotePrefix"||ke[1].type==="blockQuotePrefixWhitespace"||ke[1].type==="blockQuoteMarker"||ke[1].type==="listItemIndent"))break}be&&(!Et||be<Et)&&(qe._spread=!0),qe.end=Object.assign({},Et?re[Et][1].start:X[1].end),re.splice(Et||ve,0,["exit",qe,X[2]]),ve++,ue++}if(X[1].type==="listItemPrefix"){const _e={type:"listItem",_spread:!1,start:Object.assign({},X[1].start),end:void 0};qe=_e,re.splice(ve,0,["enter",_e,X[2]]),ve++,ue++,be=void 0,Q=!0}}}return re[J][1]._spread=ot,ue}function i(re,J){return ue;function ue(ve){s.call(this,re(ve),ve),J&&J.call(this,ve)}}function o(){this.stack.push({type:"fragment",children:[]})}function s(re,J,ue){this.stack[this.stack.length-1].children.push(re),this.stack.push(re),this.tokenStack.push([J,ue]),re.position={start:lc(J.start),end:void 0}}function l(re){return J;function J(ue){re&&re.call(this,ue),c.call(this,ue)}}function c(re,J){const ue=this.stack.pop(),ve=this.tokenStack.pop();if(ve)ve[0].type!==re.type&&(J?J.call(this,re,ve[0]):(ve[1]||K9).call(this,re,ve[0]));else throw new Error("Cannot close `"+re.type+"` ("+ah({start:re.start,end:re.end})+"): it’s not open");ue.position.end=lc(re.end)}function u(){return z5(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function f(re){if(this.data.expectingFirstListItemValue){const J=this.stack[this.stack.length-2];J.start=Number.parseInt(this.sliceSerialize(re),10),this.data.expectingFirstListItemValue=void 0}}function h(){const re=this.resume(),J=this.stack[this.stack.length-1];J.lang=re}function g(){const re=this.resume(),J=this.stack[this.stack.length-1];J.meta=re}function E(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const re=this.resume(),J=this.stack[this.stack.length-1];J.value=re.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function b(){const re=this.resume(),J=this.stack[this.stack.length-1];J.value=re.replace(/(\r?\n|\r)$/g,"")}function v(re){const J=this.resume(),ue=this.stack[this.stack.length-1];ue.label=J,ue.identifier=ps(this.sliceSerialize(re)).toLowerCase()}function C(){const re=this.resume(),J=this.stack[this.stack.length-1];J.title=re}function T(){const re=this.resume(),J=this.stack[this.stack.length-1];J.url=re}function N(re){const J=this.stack[this.stack.length-1];if(!J.depth){const ue=this.sliceSerialize(re).length;J.depth=ue}}function A(){this.data.setextHeadingSlurpLineEnding=!0}function O(re){const J=this.stack[this.stack.length-1];J.depth=this.sliceSerialize(re).codePointAt(0)===61?1:2}function M(){this.data.setextHeadingSlurpLineEnding=void 0}function P(re){const ue=this.stack[this.stack.length-1].children;let ve=ue[ue.length-1];(!ve||ve.type!=="text")&&(ve=ge(),ve.position={start:lc(re.start),end:void 0},ue.push(ve)),this.stack.push(ve)}function D(re){const J=this.stack.pop();J.value+=this.sliceSerialize(re),J.position.end=lc(re.end)}function $(re){const J=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ue=J.children[J.children.length-1];ue.position.end=lc(re.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(J.type)&&(P.call(this,re),D.call(this,re))}function V(){this.data.atHardBreak=!0}function Z(){const re=this.resume(),J=this.stack[this.stack.length-1];J.value=re}function W(){const re=this.resume(),J=this.stack[this.stack.length-1];J.value=re}function ae(){const re=this.resume(),J=this.stack[this.stack.length-1];J.value=re}function he(){const re=this.stack[this.stack.length-1];if(this.data.inReference){const J=this.data.referenceType||"shortcut";re.type+="Reference",re.referenceType=J,delete re.url,delete re.title}else delete re.identifier,delete re.label;this.data.referenceType=void 0}function q(){const re=this.stack[this.stack.length-1];if(this.data.inReference){const J=this.data.referenceType||"shortcut";re.type+="Reference",re.referenceType=J,delete re.url,delete re.title}else delete re.identifier,delete re.label;this.data.referenceType=void 0}function G(re){const J=this.sliceSerialize(re),ue=this.stack[this.stack.length-2];ue.label=Ske(J),ue.identifier=ps(J).toLowerCase()}function H(){const re=this.stack[this.stack.length-1],J=this.resume(),ue=this.stack[this.stack.length-1];if(this.data.inReference=!0,ue.type==="link"){const ve=re.children;ue.children=ve}else ue.alt=J}function k(){const re=this.resume(),J=this.stack[this.stack.length-1];J.url=re}function ie(){const re=this.resume(),J=this.stack[this.stack.length-1];J.title=re}function j(){this.data.inReference=void 0}function F(){this.data.referenceType="collapsed"}function le(re){const J=this.resume(),ue=this.stack[this.stack.length-1];ue.label=J,ue.identifier=ps(this.sliceSerialize(re)).toLowerCase(),this.data.referenceType="full"}function Te(re){this.data.characterReferenceType=re.type}function fe(re){const J=this.sliceSerialize(re),ue=this.data.characterReferenceType;let ve;ue?(ve=xX(J,ue==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ve=H5(J);const Ve=this.stack[this.stack.length-1];Ve.value+=ve}function Ae(re){const J=this.stack.pop();J.position.end=lc(re.end)}function Ce(re){D.call(this,re);const J=this.stack[this.stack.length-1];J.url=this.sliceSerialize(re)}function Ne(re){D.call(this,re);const J=this.stack[this.stack.length-1];J.url="mailto:"+this.sliceSerialize(re)}function ze(){return{type:"blockquote",children:[]}}function Ue(){return{type:"code",lang:null,meta:null,value:""}}function Le(){return{type:"inlineCode",value:""}}function we(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Pe(){return{type:"emphasis",children:[]}}function Me(){return{type:"heading",depth:0,children:[]}}function lt(){return{type:"break"}}function it(){return{type:"html",value:""}}function nt(){return{type:"image",title:null,url:"",alt:null}}function Ge(){return{type:"link",title:null,url:"",children:[]}}function at(re){return{type:"list",ordered:re.type==="listOrdered",start:null,spread:re._spread,children:[]}}function ct(re){return{type:"listItem",spread:re._spread,checked:null,children:[]}}function se(){return{type:"paragraph",children:[]}}function Fe(){return{type:"strong",children:[]}}function ge(){return{type:"text",value:""}}function oe(){return{type:"thematicBreak"}}}function lc(e){return{line:e.line,column:e.column,offset:e.offset}}function FX(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?FX(e,r):Cke(e,r)}}function Cke(e,t){let n;for(n in t)if(PX.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function K9(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+ah({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+ah({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+ah({start:t.start,end:t.end})+") is still open")}function Rke(e){const t=this;t.parser=n;function n(r){return yke(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function xke(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Ake(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
@@ -647,9 +647,9 @@ https://github.com/highlightjs/highlight.js/issues/2277`),ie=q,k=G),H===void 0&&
647
647
  to {
648
648
  opacity: 1;
649
649
  }
650
- `,TWe="​";function k4(){return _.jsx(_t,{component:"span",sx:{display:"inline-block",width:"12px",height:"12px",backgroundColor:"text.primary",borderRadius:"50%",animation:`1s ease-in-out 0.1s ${yWe} infinite`}})}const CWe=()=>e=>{Bg(e,"text",(t,n,r)=>{var o;const a=/\u200B/g,i=[...((o=t.value)==null?void 0:o.matchAll(a))||[]];if(i.length>0){const s=[];let l=0;i.forEach(c=>{const[u]=c,p=c.index,f=p+u.length;p>l&&s.push({type:"text",value:t.value.slice(l,p)}),s.push({type:"blinkingCursor",data:{hName:"blinkingCursor",hProperties:{text:"Blinking Cursor"}}}),l=f}),l<t.value.length&&s.push({type:"text",value:t.value.slice(l)}),r.children.splice(n,1,...s)}})};function eg({refElements:e,allowHtml:t,latex:n,children:r}){const a=x.useMemo(()=>{let o=[];return t&&(o=[v$e,...o]),n&&(o=[EFe,...o]),o},[t,n]);window.renderingCodeBlock=!1;const i=x.useMemo(()=>{let o=[CWe,IHe];return n&&(o=[...o,zHe]),o},[n]);return _.jsx(HPe,{remarkPlugins:i,rehypePlugins:a,className:"markdown-body",components:{a({children:o,...s}){const l=o,c=e==null?void 0:e.find(u=>u.name===l);return c?_.jsx(vWe,{element:c}):_.jsx(Zp,{...s,target:"_blank",children:o})},code({...o}){return _.jsx(HHe,{...o})},pre({...o}){return window.renderingCodeBlock=!0,_.jsx(SWe,{...o})},table({children:o,...s}){return _.jsx(UDe,{sx:{width:"fit-content",minWidth:"300px"},elevation:0,component:Qf,children:_.jsx(EDe,{...s,children:o})})},thead({children:o,...s}){return _.jsx(qDe,{...s,children:o})},tr({children:o,...s}){return _.jsx(JDe,{...s,children:o})},th({children:o,...s}){return _.jsx(o9,{...s,align:"right",sx:{padding:1},children:o})},td({children:o,...s}){return _.jsx(o9,{...s,align:"right",sx:{padding:1},children:o})},tbody({children:o,...s}){return _.jsx(xDe,{...s,children:o})},blinkingCursor:()=>_.jsx(k4,{})},children:r})}const Zr=kn({key:"ProjectSettings",default:void 0}),Tee=kn({key:"HighlightMessage",default:null}),Cee=kn({key:"chatSettingsOpen",default:!1}),Ree=({element:e})=>{var l,c;const{data:t,error:n,isLoading:r}=oX(e.url||null),a=yt(Zr),i=(l=a==null?void 0:a.features)==null?void 0:l.unsafe_allow_html,o=(c=a==null?void 0:a.features)==null?void 0:c.latex;let s="";return r?s="Loading...":n?s="An error occured":t&&(s=t),!r&&!n&&e.language&&(s=`\`\`\`${e.language}
650
+ `,TWe="​";function k4({whitespace:e}){return _.jsx(_t,{component:"span",sx:{display:"inline-block",width:"12px",height:"12px",backgroundColor:"text.primary",borderRadius:"50%",animation:`1s ease-in-out 0.1s ${yWe} infinite`,ml:e?"0.5em":0}})}const CWe=()=>e=>{Bg(e,"text",(t,n,r)=>{var o;const a=/\u200B/g,i=[...((o=t.value)==null?void 0:o.matchAll(a))||[]];if(i.length>0){const s=[];let l=0;i.forEach(c=>{const[u]=c,p=c.index,f=p+u.length;p>l&&s.push({type:"text",value:t.value.slice(l,p)}),s.push({type:"blinkingCursor",data:{hName:"blinkingCursor",hProperties:{text:"Blinking Cursor"}}}),l=f}),l<t.value.length&&s.push({type:"text",value:t.value.slice(l)}),r.children.splice(n,1,...s)}})};function eg({refElements:e,allowHtml:t,latex:n,children:r}){const a=x.useMemo(()=>{let o=[];return t&&(o=[v$e,...o]),n&&(o=[EFe,...o]),o},[t,n]),i=x.useMemo(()=>{let o=[CWe,IHe];return n&&(o=[...o,zHe]),o},[n]);return _.jsx(HPe,{remarkPlugins:i,rehypePlugins:a,className:"markdown-body",components:{a({children:o,...s}){const l=o,c=e==null?void 0:e.find(u=>u.name===l);return c?_.jsx(vWe,{element:c}):_.jsx(Zp,{...s,target:"_blank",children:o})},code({...o}){return _.jsx(HHe,{...o})},pre({...o}){return _.jsx(SWe,{...o})},table({children:o,...s}){return _.jsx(UDe,{sx:{width:"fit-content",minWidth:"300px"},elevation:0,component:Qf,children:_.jsx(EDe,{...s,children:o})})},thead({children:o,...s}){return _.jsx(qDe,{...s,children:o})},tr({children:o,...s}){return _.jsx(JDe,{...s,children:o})},th({children:o,...s}){return _.jsx(o9,{...s,align:"right",sx:{padding:1},children:o})},td({children:o,...s}){return _.jsx(o9,{...s,align:"right",sx:{padding:1},children:o})},tbody({children:o,...s}){return _.jsx(xDe,{...s,children:o})},blinkingCursor:()=>_.jsx(k4,{whitespace:!0})},children:r})}const Zr=kn({key:"ProjectSettings",default:void 0}),Tee=kn({key:"HighlightMessage",default:null}),Cee=kn({key:"chatSettingsOpen",default:!1}),Ree=({element:e})=>{var l,c;const{data:t,error:n,isLoading:r}=oX(e.url||null),a=yt(Zr),i=(l=a==null?void 0:a.features)==null?void 0:l.unsafe_allow_html,o=(c=a==null?void 0:a.features)==null?void 0:c.latex;let s="";return r?s="Loading...":n?s="An error occured":t&&(s=t),!r&&!n&&e.language&&(s=`\`\`\`${e.language}
651
651
  ${s}
652
- \`\`\``),_.jsx(_t,{sx:{fontFamily:u=>u.typography.fontFamily},children:_.jsx(eg,{allowHtml:i,latex:o,children:s})})};var RWe=function(t,n,r){var a=document.head||document.getElementsByTagName("head")[0],i=document.createElement("script");typeof n=="function"&&(r=n,n={}),n=n||{},r=r||function(){},i.type=n.type||"text/javascript",i.charset=n.charset||"utf8",i.async="async"in n?!!n.async:!0,i.src=t,n.attrs&&xWe(i,n.attrs),n.text&&(i.text=""+n.text);var o="onload"in i?cH:AWe;o(i,r),i.onload||cH(i,r),a.appendChild(i)};function xWe(e,t){for(var n in t)e.setAttribute(n,t[n])}function cH(e,t){e.onload=function(){this.onerror=this.onload=null,t(null,e)},e.onerror=function(){this.onerror=this.onload=null,t(new Error("Failed to load "+this.src),e)}}function AWe(e,t){e.onreadystatechange=function(){this.readyState!="complete"&&this.readyState!="loaded"||(this.onreadystatechange=null,t(null,e))}}var OWe=function(t){return NWe(t)&&!IWe(t)};function NWe(e){return!!e&&typeof e=="object"}function IWe(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||LWe(e)}var wWe=typeof Symbol=="function"&&Symbol.for,DWe=wWe?Symbol.for("react.element"):60103;function LWe(e){return e.$$typeof===DWe}function MWe(e){return Array.isArray(e)?[]:{}}function tg(e,t){return t.clone!==!1&&t.isMergeableObject(e)?wf(MWe(e),e,t):e}function kWe(e,t,n){return e.concat(t).map(function(r){return tg(r,n)})}function PWe(e,t){if(!t.customMerge)return wf;var n=t.customMerge(e);return typeof n=="function"?n:wf}function FWe(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function uH(e){return Object.keys(e).concat(FWe(e))}function xee(e,t){try{return t in e}catch{return!1}}function BWe(e,t){return xee(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function UWe(e,t,n){var r={};return n.isMergeableObject(e)&&uH(e).forEach(function(a){r[a]=tg(e[a],n)}),uH(t).forEach(function(a){BWe(e,a)||(xee(e,a)&&n.isMergeableObject(t[a])?r[a]=PWe(a,n)(e[a],t[a],n):r[a]=tg(t[a],n))}),r}function wf(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||kWe,n.isMergeableObject=n.isMergeableObject||OWe,n.cloneUnlessOtherwiseSpecified=tg;var r=Array.isArray(t),a=Array.isArray(e),i=r===a;return i?r?n.arrayMerge(e,t,n):UWe(e,t,n):tg(t,n)}wf.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,a){return wf(r,a,n)},{})};var $We=wf,Aee=$We,zWe=Object.create,ky=Object.defineProperty,HWe=Object.getOwnPropertyDescriptor,GWe=Object.getOwnPropertyNames,VWe=Object.getPrototypeOf,YWe=Object.prototype.hasOwnProperty,qWe=(e,t)=>{for(var n in t)ky(e,n,{get:t[n],enumerable:!0})},Oee=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of GWe(t))!YWe.call(e,a)&&a!==n&&ky(e,a,{get:()=>t[a],enumerable:!(r=HWe(t,a))||r.enumerable});return e},ID=(e,t,n)=>(n=e!=null?zWe(VWe(e)):{},Oee(t||!e||!e.__esModule?ky(n,"default",{value:e,enumerable:!0}):n,e)),WWe=e=>Oee(ky({},"__esModule",{value:!0}),e),Nee={};qWe(Nee,{callPlayer:()=>cje,getConfig:()=>sje,getSDK:()=>oje,isBlobUrl:()=>dje,isMediaStream:()=>uje,lazy:()=>XWe,omit:()=>lje,parseEndTime:()=>rje,parseStartTime:()=>nje,queryString:()=>ije,randomString:()=>aje,supportsWebKitPresentationMode:()=>pje});var Py=WWe(Nee),jWe=ID(x),KWe=ID(RWe),QWe=ID(Aee);const XWe=e=>jWe.default.lazy(async()=>{const t=await e();return typeof t.default=="function"?t:t.default}),ZWe=/[?&#](?:start|t)=([0-9hms]+)/,JWe=/[?&#]end=([0-9hms]+)/,P4=/(\d+)(h|m|s)/g,eje=/^\d+$/;function Iee(e,t){if(e instanceof Array)return;const n=e.match(t);if(n){const r=n[1];if(r.match(P4))return tje(r);if(eje.test(r))return parseInt(r)}}function tje(e){let t=0,n=P4.exec(e);for(;n!==null;){const[,r,a]=n;a==="h"&&(t+=parseInt(r,10)*60*60),a==="m"&&(t+=parseInt(r,10)*60),a==="s"&&(t+=parseInt(r,10)),n=P4.exec(e)}return t}function nje(e){return Iee(e,ZWe)}function rje(e){return Iee(e,JWe)}function aje(){return Math.random().toString(36).substr(2,5)}function ije(e){return Object.keys(e).map(t=>`${t}=${e[t]}`).join("&")}function KO(e){return window[e]?window[e]:window.exports&&window.exports[e]?window.exports[e]:window.module&&window.module.exports&&window.module.exports[e]?window.module.exports[e]:null}const lp={},oje=function(t,n,r=null,a=()=>!0,i=KWe.default){const o=KO(n);return o&&a(o)?Promise.resolve(o):new Promise((s,l)=>{if(lp[t]){lp[t].push({resolve:s,reject:l});return}lp[t]=[{resolve:s,reject:l}];const c=u=>{lp[t].forEach(p=>p.resolve(u))};if(r){const u=window[r];window[r]=function(){u&&u(),c(KO(n))}}i(t,u=>{u?(lp[t].forEach(p=>p.reject(u)),lp[t]=null):r||c(KO(n))})})};function sje(e,t){return(0,QWe.default)(t.config,e.config)}function lje(e,...t){const n=[].concat(...t),r={},a=Object.keys(e);for(const i of a)n.indexOf(i)===-1&&(r[i]=e[i]);return r}function cje(e,...t){if(!this.player||!this.player[e]){let n=`ReactPlayer: ${this.constructor.displayName} player could not call %c${e}%c – `;return this.player?this.player[e]||(n+="The method was not available"):n+="The player was not available",console.warn(n,"font-weight: bold",""),null}return this.player[e](...t)}function uje(e){return typeof window<"u"&&typeof window.MediaStream<"u"&&e instanceof window.MediaStream}function dje(e){return/^blob:/.test(e)}function pje(e=document.createElement("video")){const t=/iPhone|iPod/.test(navigator.userAgent)===!1;return e.webkitSupportsPresentationMode&&typeof e.webkitSetPresentationMode=="function"&&t}var wD=Object.defineProperty,fje=Object.getOwnPropertyDescriptor,mje=Object.getOwnPropertyNames,hje=Object.prototype.hasOwnProperty,gje=(e,t)=>{for(var n in t)wD(e,n,{get:t[n],enumerable:!0})},_je=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of mje(t))!hje.call(e,a)&&a!==n&&wD(e,a,{get:()=>t[a],enumerable:!(r=fje(t,a))||r.enumerable});return e},Eje=e=>_je(wD({},"__esModule",{value:!0}),e),wee={};gje(wee,{AUDIO_EXTENSIONS:()=>DD,DASH_EXTENSIONS:()=>Yee,FLV_EXTENSIONS:()=>qee,HLS_EXTENSIONS:()=>MD,MATCH_URL_DAILYMOTION:()=>zee,MATCH_URL_FACEBOOK:()=>kee,MATCH_URL_FACEBOOK_WATCH:()=>Pee,MATCH_URL_KALTURA:()=>Vee,MATCH_URL_MIXCLOUD:()=>Hee,MATCH_URL_MUX:()=>Mee,MATCH_URL_SOUNDCLOUD:()=>Dee,MATCH_URL_STREAMABLE:()=>Fee,MATCH_URL_TWITCH_CHANNEL:()=>$ee,MATCH_URL_TWITCH_VIDEO:()=>Uee,MATCH_URL_VIDYARD:()=>Gee,MATCH_URL_VIMEO:()=>Lee,MATCH_URL_WISTIA:()=>Bee,MATCH_URL_YOUTUBE:()=>F4,VIDEO_EXTENSIONS:()=>LD,canPlay:()=>Sje});var bje=Eje(wee),dH=Py;const F4=/(?:youtu\.be\/|youtube(?:-nocookie|education)?\.com\/(?:embed\/|v\/|watch\/|watch\?v=|watch\?.+&v=|shorts\/|live\/))((\w|-){11})|youtube\.com\/playlist\?list=|youtube\.com\/user\//,Dee=/(?:soundcloud\.com|snd\.sc)\/[^.]+$/,Lee=/vimeo\.com\/(?!progressive_redirect).+/,Mee=/stream\.mux\.com\/(?!\w+\.m3u8)(\w+)/,kee=/^https?:\/\/(www\.)?facebook\.com.*\/(video(s)?|watch|story)(\.php?|\/).+$/,Pee=/^https?:\/\/fb\.watch\/.+$/,Fee=/streamable\.com\/([a-z0-9]+)$/,Bee=/(?:wistia\.(?:com|net)|wi\.st)\/(?:medias|embed)\/(?:iframe\/)?([^?]+)/,Uee=/(?:www\.|go\.)?twitch\.tv\/videos\/(\d+)($|\?)/,$ee=/(?:www\.|go\.)?twitch\.tv\/([a-zA-Z0-9_]+)($|\?)/,zee=/^(?:(?:https?):)?(?:\/\/)?(?:www\.)?(?:(?:dailymotion\.com(?:\/embed)?\/video)|dai\.ly)\/([a-zA-Z0-9]+)(?:_[\w_-]+)?(?:[\w.#_-]+)?/,Hee=/mixcloud\.com\/([^/]+\/[^/]+)/,Gee=/vidyard.com\/(?:watch\/)?([a-zA-Z0-9-_]+)/,Vee=/^https?:\/\/[a-zA-Z]+\.kaltura.(com|org)\/p\/([0-9]+)\/sp\/([0-9]+)00\/embedIframeJs\/uiconf_id\/([0-9]+)\/partner_id\/([0-9]+)(.*)entry_id.([a-zA-Z0-9-_].*)$/,DD=/\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx)($|\?)/i,LD=/\.(mp4|og[gv]|webm|mov|m4v)(#t=[,\d+]+)?($|\?)/i,MD=/\.(m3u8)($|\?)/i,Yee=/\.(mpd)($|\?)/i,qee=/\.(flv)($|\?)/i,B4=e=>{if(e instanceof Array){for(const t of e)if(typeof t=="string"&&B4(t)||B4(t.src))return!0;return!1}return(0,dH.isMediaStream)(e)||(0,dH.isBlobUrl)(e)?!0:DD.test(e)||LD.test(e)||MD.test(e)||Yee.test(e)||qee.test(e)},Sje={youtube:e=>e instanceof Array?e.every(t=>F4.test(t)):F4.test(e),soundcloud:e=>Dee.test(e)&&!DD.test(e),vimeo:e=>Lee.test(e)&&!LD.test(e)&&!MD.test(e),mux:e=>Mee.test(e),facebook:e=>kee.test(e)||Pee.test(e),streamable:e=>Fee.test(e),wistia:e=>Bee.test(e),twitch:e=>Uee.test(e)||$ee.test(e),dailymotion:e=>zee.test(e),mixcloud:e=>Hee.test(e),vidyard:e=>Gee.test(e),kaltura:e=>Vee.test(e),file:B4};var kD=Object.defineProperty,vje=Object.getOwnPropertyDescriptor,yje=Object.getOwnPropertyNames,Tje=Object.prototype.hasOwnProperty,Cje=(e,t)=>{for(var n in t)kD(e,n,{get:t[n],enumerable:!0})},Rje=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of yje(t))!Tje.call(e,a)&&a!==n&&kD(e,a,{get:()=>t[a],enumerable:!(r=vje(t,a))||r.enumerable});return e},xje=e=>Rje(kD({},"__esModule",{value:!0}),e),Wee={};Cje(Wee,{default:()=>Oje});var Aje=xje(Wee),di=Py,qa=bje,Oje=[{key:"youtube",name:"YouTube",canPlay:qa.canPlay.youtube,lazyPlayer:(0,di.lazy)(()=>ja(()=>import("./YouTube-d92466dc.js").then(e=>e.Y),[]))},{key:"soundcloud",name:"SoundCloud",canPlay:qa.canPlay.soundcloud,lazyPlayer:(0,di.lazy)(()=>ja(()=>import("./SoundCloud-e5e98e65.js").then(e=>e.S),[]))},{key:"vimeo",name:"Vimeo",canPlay:qa.canPlay.vimeo,lazyPlayer:(0,di.lazy)(()=>ja(()=>import("./Vimeo-1c2b5c4c.js").then(e=>e.V),[]))},{key:"mux",name:"Mux",canPlay:qa.canPlay.mux,lazyPlayer:(0,di.lazy)(()=>ja(()=>import("./Mux-823ded93.js").then(e=>e.M),[]))},{key:"facebook",name:"Facebook",canPlay:qa.canPlay.facebook,lazyPlayer:(0,di.lazy)(()=>ja(()=>import("./Facebook-7e85d6cd.js").then(e=>e.F),[]))},{key:"streamable",name:"Streamable",canPlay:qa.canPlay.streamable,lazyPlayer:(0,di.lazy)(()=>ja(()=>import("./Streamable-14812f3b.js").then(e=>e.S),[]))},{key:"wistia",name:"Wistia",canPlay:qa.canPlay.wistia,lazyPlayer:(0,di.lazy)(()=>ja(()=>import("./Wistia-3dc1d7c3.js").then(e=>e.W),[]))},{key:"twitch",name:"Twitch",canPlay:qa.canPlay.twitch,lazyPlayer:(0,di.lazy)(()=>ja(()=>import("./Twitch-3e4a9570.js").then(e=>e.T),[]))},{key:"dailymotion",name:"DailyMotion",canPlay:qa.canPlay.dailymotion,lazyPlayer:(0,di.lazy)(()=>ja(()=>import("./DailyMotion-acaf0251.js").then(e=>e.D),[]))},{key:"mixcloud",name:"Mixcloud",canPlay:qa.canPlay.mixcloud,lazyPlayer:(0,di.lazy)(()=>ja(()=>import("./Mixcloud-553956db.js").then(e=>e.M),[]))},{key:"vidyard",name:"Vidyard",canPlay:qa.canPlay.vidyard,lazyPlayer:(0,di.lazy)(()=>ja(()=>import("./Vidyard-63580b33.js").then(e=>e.V),[]))},{key:"kaltura",name:"Kaltura",canPlay:qa.canPlay.kaltura,lazyPlayer:(0,di.lazy)(()=>ja(()=>import("./Kaltura-63c33135.js").then(e=>e.K),[]))},{key:"file",name:"FilePlayer",canPlay:qa.canPlay.file,canEnablePIP:e=>qa.canPlay.file(e)&&(document.pictureInPictureEnabled||(0,di.supportsWebKitPresentationMode)())&&!qa.AUDIO_EXTENSIONS.test(e),lazyPlayer:(0,di.lazy)(()=>ja(()=>import("./FilePlayer-548ab948.js").then(e=>e.F),[]))}],pH=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function Nje(e,t){return!!(e===t||pH(e)&&pH(t))}function Ije(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!Nje(e[n],t[n]))return!1;return!0}function wje(e,t){t===void 0&&(t=Ije);var n,r=[],a,i=!1;function o(){for(var s=[],l=0;l<arguments.length;l++)s[l]=arguments[l];return i&&n===this&&t(s,r)||(a=e.apply(this,s),i=!0,n=this,r=s),a}return o}const Dje=Object.freeze(Object.defineProperty({__proto__:null,default:wje},Symbol.toStringTag,{value:"Module"})),Lje=b3(Dje);var Mje=typeof Element<"u",kje=typeof Map=="function",Pje=typeof Set=="function",Fje=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function ZE(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,r,a;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!ZE(e[r],t[r]))return!1;return!0}var i;if(kje&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(i=e.entries();!(r=i.next()).done;)if(!t.has(r.value[0]))return!1;for(i=e.entries();!(r=i.next()).done;)if(!ZE(r.value[1],t.get(r.value[0])))return!1;return!0}if(Pje&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(i=e.entries();!(r=i.next()).done;)if(!t.has(r.value[0]))return!1;return!0}if(Fje&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,a[r]))return!1;if(Mje&&e instanceof Element)return!1;for(r=n;r--!==0;)if(!((a[r]==="_owner"||a[r]==="__v"||a[r]==="__o")&&e.$$typeof)&&!ZE(e[a[r]],t[a[r]]))return!1;return!0}return e!==e&&t!==t}var jee=function(t,n){try{return ZE(t,n)}catch(r){if((r.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw r}},Bje=Object.create,Fy=Object.defineProperty,Uje=Object.getOwnPropertyDescriptor,$je=Object.getOwnPropertyNames,zje=Object.getPrototypeOf,Hje=Object.prototype.hasOwnProperty,Gje=(e,t)=>{for(var n in t)Fy(e,n,{get:t[n],enumerable:!0})},Kee=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of $je(t))!Hje.call(e,a)&&a!==n&&Fy(e,a,{get:()=>t[a],enumerable:!(r=Uje(t,a))||r.enumerable});return e},Vje=(e,t,n)=>(n=e!=null?Bje(zje(e)):{},Kee(t||!e||!e.__esModule?Fy(n,"default",{value:e,enumerable:!0}):n,e)),Yje=e=>Kee(Fy({},"__esModule",{value:!0}),e),Qee={};Gje(Qee,{defaultProps:()=>jje,propTypes:()=>Wje});var Xee=Yje(Qee),qje=Vje(Wf);const{string:_a,bool:Wa,number:cp,array:QO,oneOfType:Sm,shape:Ui,object:La,func:jr,node:fH}=qje.default,Wje={url:Sm([_a,QO,La]),playing:Wa,loop:Wa,controls:Wa,volume:cp,muted:Wa,playbackRate:cp,width:Sm([_a,cp]),height:Sm([_a,cp]),style:La,progressInterval:cp,playsinline:Wa,pip:Wa,stopOnUnmount:Wa,light:Sm([Wa,_a,La]),playIcon:fH,previewTabIndex:cp,previewAriaLabel:_a,fallback:fH,oEmbedUrl:_a,wrapper:Sm([_a,jr,Ui({render:jr.isRequired})]),config:Ui({soundcloud:Ui({options:La}),youtube:Ui({playerVars:La,embedOptions:La,onUnstarted:jr}),facebook:Ui({appId:_a,version:_a,playerId:_a,attributes:La}),dailymotion:Ui({params:La}),vimeo:Ui({playerOptions:La,title:_a}),mux:Ui({attributes:La,version:_a}),file:Ui({attributes:La,tracks:QO,forceVideo:Wa,forceAudio:Wa,forceHLS:Wa,forceSafariHLS:Wa,forceDisableHls:Wa,forceDASH:Wa,forceFLV:Wa,hlsOptions:La,hlsVersion:_a,dashVersion:_a,flvVersion:_a}),wistia:Ui({options:La,playerId:_a,customControls:QO}),mixcloud:Ui({options:La}),twitch:Ui({options:La,playerId:_a}),vidyard:Ui({options:La})}),onReady:jr,onStart:jr,onPlay:jr,onPause:jr,onBuffer:jr,onBufferEnd:jr,onEnded:jr,onError:jr,onDuration:jr,onSeek:jr,onPlaybackRateChange:jr,onPlaybackQualityChange:jr,onProgress:jr,onClickPreview:jr,onEnablePIP:jr,onDisablePIP:jr},Ea=()=>{},jje={playing:!1,loop:!1,controls:!1,volume:null,muted:!1,playbackRate:1,width:"640px",height:"360px",style:{},progressInterval:1e3,playsinline:!1,pip:!1,stopOnUnmount:!0,light:!1,fallback:null,wrapper:"div",previewTabIndex:0,previewAriaLabel:"",oEmbedUrl:"https://noembed.com/embed?url={url}",config:{soundcloud:{options:{visual:!0,buying:!1,liking:!1,download:!1,sharing:!1,show_comments:!1,show_playcount:!1}},youtube:{playerVars:{playsinline:1,showinfo:0,rel:0,iv_load_policy:3,modestbranding:1},embedOptions:{},onUnstarted:Ea},facebook:{appId:"1309697205772819",version:"v3.3",playerId:null,attributes:{}},dailymotion:{params:{api:1,"endscreen-enable":!1}},vimeo:{playerOptions:{autopause:!1,byline:!1,portrait:!1,title:!1},title:null},mux:{attributes:{},version:"2"},file:{attributes:{},tracks:[],forceVideo:!1,forceAudio:!1,forceHLS:!1,forceDASH:!1,forceFLV:!1,hlsOptions:{},hlsVersion:"1.1.4",dashVersion:"3.1.3",flvVersion:"1.5.0",forceDisableHls:!1},wistia:{options:{},playerId:null,customControls:null},mixcloud:{options:{hide_cover:1}},twitch:{options:{},playerId:null},vidyard:{options:{}}},onReady:Ea,onStart:Ea,onPlay:Ea,onPause:Ea,onBuffer:Ea,onBufferEnd:Ea,onEnded:Ea,onError:Ea,onDuration:Ea,onSeek:Ea,onPlaybackRateChange:Ea,onPlaybackQualityChange:Ea,onProgress:Ea,onClickPreview:Ea,onEnablePIP:Ea,onDisablePIP:Ea};var Kje=Object.create,Yg=Object.defineProperty,Qje=Object.getOwnPropertyDescriptor,Xje=Object.getOwnPropertyNames,Zje=Object.getPrototypeOf,Jje=Object.prototype.hasOwnProperty,eKe=(e,t,n)=>t in e?Yg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,tKe=(e,t)=>{for(var n in t)Yg(e,n,{get:t[n],enumerable:!0})},Zee=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Xje(t))!Jje.call(e,a)&&a!==n&&Yg(e,a,{get:()=>t[a],enumerable:!(r=Qje(t,a))||r.enumerable});return e},Jee=(e,t,n)=>(n=e!=null?Kje(Zje(e)):{},Zee(t||!e||!e.__esModule?Yg(n,"default",{value:e,enumerable:!0}):n,e)),nKe=e=>Zee(Yg({},"__esModule",{value:!0}),e),wr=(e,t,n)=>(eKe(e,typeof t!="symbol"?t+"":t,n),n),ete={};tKe(ete,{default:()=>By});var rKe=nKe(ete),mH=Jee(x),aKe=Jee(jee),tte=Xee,iKe=Py;const oKe=5e3;class By extends mH.Component{constructor(){super(...arguments),wr(this,"mounted",!1),wr(this,"isReady",!1),wr(this,"isPlaying",!1),wr(this,"isLoading",!0),wr(this,"loadOnReady",null),wr(this,"startOnPlay",!0),wr(this,"seekOnPlay",null),wr(this,"onDurationCalled",!1),wr(this,"handlePlayerMount",t=>{if(this.player){this.progress();return}this.player=t,this.player.load(this.props.url),this.progress()}),wr(this,"getInternalPlayer",t=>this.player?this.player[t]:null),wr(this,"progress",()=>{if(this.props.url&&this.player&&this.isReady){const t=this.getCurrentTime()||0,n=this.getSecondsLoaded(),r=this.getDuration();if(r){const a={playedSeconds:t,played:t/r};n!==null&&(a.loadedSeconds=n,a.loaded=n/r),(a.playedSeconds!==this.prevPlayed||a.loadedSeconds!==this.prevLoaded)&&this.props.onProgress(a),this.prevPlayed=a.playedSeconds,this.prevLoaded=a.loadedSeconds}}this.progressTimeout=setTimeout(this.progress,this.props.progressFrequency||this.props.progressInterval)}),wr(this,"handleReady",()=>{if(!this.mounted)return;this.isReady=!0,this.isLoading=!1;const{onReady:t,playing:n,volume:r,muted:a}=this.props;t(),!a&&r!==null&&this.player.setVolume(r),this.loadOnReady?(this.player.load(this.loadOnReady,!0),this.loadOnReady=null):n&&this.player.play(),this.handleDurationCheck()}),wr(this,"handlePlay",()=>{this.isPlaying=!0,this.isLoading=!1;const{onStart:t,onPlay:n,playbackRate:r}=this.props;this.startOnPlay&&(this.player.setPlaybackRate&&r!==1&&this.player.setPlaybackRate(r),t(),this.startOnPlay=!1),n(),this.seekOnPlay&&(this.seekTo(this.seekOnPlay),this.seekOnPlay=null),this.handleDurationCheck()}),wr(this,"handlePause",t=>{this.isPlaying=!1,this.isLoading||this.props.onPause(t)}),wr(this,"handleEnded",()=>{const{activePlayer:t,loop:n,onEnded:r}=this.props;t.loopOnEnded&&n&&this.seekTo(0),n||(this.isPlaying=!1,r())}),wr(this,"handleError",(...t)=>{this.isLoading=!1,this.props.onError(...t)}),wr(this,"handleDurationCheck",()=>{clearTimeout(this.durationCheckTimeout);const t=this.getDuration();t?this.onDurationCalled||(this.props.onDuration(t),this.onDurationCalled=!0):this.durationCheckTimeout=setTimeout(this.handleDurationCheck,100)}),wr(this,"handleLoaded",()=>{this.isLoading=!1})}componentDidMount(){this.mounted=!0}componentWillUnmount(){clearTimeout(this.progressTimeout),clearTimeout(this.durationCheckTimeout),this.isReady&&this.props.stopOnUnmount&&(this.player.stop(),this.player.disablePIP&&this.player.disablePIP()),this.mounted=!1}componentDidUpdate(t){if(!this.player)return;const{url:n,playing:r,volume:a,muted:i,playbackRate:o,pip:s,loop:l,activePlayer:c,disableDeferredLoading:u}=this.props;if(!(0,aKe.default)(t.url,n)){if(this.isLoading&&!c.forceLoad&&!u&&!(0,iKe.isMediaStream)(n)){console.warn(`ReactPlayer: the attempt to load ${n} is being deferred until the player has loaded`),this.loadOnReady=n;return}this.isLoading=!0,this.startOnPlay=!0,this.onDurationCalled=!1,this.player.load(n,this.isReady)}!t.playing&&r&&!this.isPlaying&&this.player.play(),t.playing&&!r&&this.isPlaying&&this.player.pause(),!t.pip&&s&&this.player.enablePIP&&this.player.enablePIP(),t.pip&&!s&&this.player.disablePIP&&this.player.disablePIP(),t.volume!==a&&a!==null&&this.player.setVolume(a),t.muted!==i&&(i?this.player.mute():(this.player.unmute(),a!==null&&setTimeout(()=>this.player.setVolume(a)))),t.playbackRate!==o&&this.player.setPlaybackRate&&this.player.setPlaybackRate(o),t.loop!==l&&this.player.setLoop&&this.player.setLoop(l)}getDuration(){return this.isReady?this.player.getDuration():null}getCurrentTime(){return this.isReady?this.player.getCurrentTime():null}getSecondsLoaded(){return this.isReady?this.player.getSecondsLoaded():null}seekTo(t,n,r){if(!this.isReady){t!==0&&(this.seekOnPlay=t,setTimeout(()=>{this.seekOnPlay=null},oKe));return}if(n?n==="fraction":t>0&&t<1){const i=this.player.getDuration();if(!i){console.warn("ReactPlayer: could not seek using fraction – duration not yet available");return}this.player.seekTo(i*t,r);return}this.player.seekTo(t,r)}render(){const t=this.props.activePlayer;return t?mH.default.createElement(t,{...this.props,onMount:this.handlePlayerMount,onReady:this.handleReady,onPlay:this.handlePlay,onPause:this.handlePause,onEnded:this.handleEnded,onLoaded:this.handleLoaded,onError:this.handleError}):null}}wr(By,"displayName","Player");wr(By,"propTypes",tte.propTypes);wr(By,"defaultProps",tte.defaultProps);var sKe=Object.create,qg=Object.defineProperty,lKe=Object.getOwnPropertyDescriptor,cKe=Object.getOwnPropertyNames,uKe=Object.getPrototypeOf,dKe=Object.prototype.hasOwnProperty,pKe=(e,t,n)=>t in e?qg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,fKe=(e,t)=>{for(var n in t)qg(e,n,{get:t[n],enumerable:!0})},nte=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of cKe(t))!dKe.call(e,a)&&a!==n&&qg(e,a,{get:()=>t[a],enumerable:!(r=lKe(t,a))||r.enumerable});return e},Wg=(e,t,n)=>(n=e!=null?sKe(uKe(e)):{},nte(t||!e||!e.__esModule?qg(n,"default",{value:e,enumerable:!0}):n,e)),mKe=e=>nte(qg({},"__esModule",{value:!0}),e),Ir=(e,t,n)=>(pKe(e,typeof t!="symbol"?t+"":t,n),n),rte={};fKe(rte,{createReactPlayer:()=>TKe});var hKe=mKe(rte),Sp=Wg(x),gKe=Wg(Aee),XO=Wg(Lje),hH=Wg(jee),Fm=Xee,ate=Py,_Ke=Wg(rKe);const EKe=(0,ate.lazy)(()=>ja(()=>import("./Preview-47f5b210.js").then(e=>e.P),[])),bKe=typeof window<"u"&&window.document&&typeof document<"u",SKe=typeof aa<"u"&&aa.window&&aa.window.document,vKe=Object.keys(Fm.propTypes),yKe=bKe||SKe?Sp.Suspense:()=>null,vm=[],TKe=(e,t)=>{var n;return n=class extends Sp.Component{constructor(){super(...arguments),Ir(this,"state",{showPreview:!!this.props.light}),Ir(this,"references",{wrapper:r=>{this.wrapper=r},player:r=>{this.player=r}}),Ir(this,"handleClickPreview",r=>{this.setState({showPreview:!1}),this.props.onClickPreview(r)}),Ir(this,"showPreview",()=>{this.setState({showPreview:!0})}),Ir(this,"getDuration",()=>this.player?this.player.getDuration():null),Ir(this,"getCurrentTime",()=>this.player?this.player.getCurrentTime():null),Ir(this,"getSecondsLoaded",()=>this.player?this.player.getSecondsLoaded():null),Ir(this,"getInternalPlayer",(r="player")=>this.player?this.player.getInternalPlayer(r):null),Ir(this,"seekTo",(r,a,i)=>{if(!this.player)return null;this.player.seekTo(r,a,i)}),Ir(this,"handleReady",()=>{this.props.onReady(this)}),Ir(this,"getActivePlayer",(0,XO.default)(r=>{for(const a of[...vm,...e])if(a.canPlay(r))return a;return t||null})),Ir(this,"getConfig",(0,XO.default)((r,a)=>{const{config:i}=this.props;return gKe.default.all([Fm.defaultProps.config,Fm.defaultProps.config[a]||{},i,i[a]||{}])})),Ir(this,"getAttributes",(0,XO.default)(r=>(0,ate.omit)(this.props,vKe))),Ir(this,"renderActivePlayer",r=>{if(!r)return null;const a=this.getActivePlayer(r);if(!a)return null;const i=this.getConfig(r,a.key);return Sp.default.createElement(_Ke.default,{...this.props,key:a.key,ref:this.references.player,config:i,activePlayer:a.lazyPlayer||a,onReady:this.handleReady})})}shouldComponentUpdate(r,a){return!(0,hH.default)(this.props,r)||!(0,hH.default)(this.state,a)}componentDidUpdate(r){const{light:a}=this.props;!r.light&&a&&this.setState({showPreview:!0}),r.light&&!a&&this.setState({showPreview:!1})}renderPreview(r){if(!r)return null;const{light:a,playIcon:i,previewTabIndex:o,oEmbedUrl:s,previewAriaLabel:l}=this.props;return Sp.default.createElement(EKe,{url:r,light:a,playIcon:i,previewTabIndex:o,previewAriaLabel:l,oEmbedUrl:s,onClick:this.handleClickPreview})}render(){const{url:r,style:a,width:i,height:o,fallback:s,wrapper:l}=this.props,{showPreview:c}=this.state,u=this.getAttributes(r),p=typeof l=="string"?this.references.wrapper:void 0;return Sp.default.createElement(l,{ref:p,style:{...a,width:i,height:o},...u},Sp.default.createElement(yKe,{fallback:s},c?this.renderPreview(r):this.renderActivePlayer(r)))}},Ir(n,"displayName","ReactPlayer"),Ir(n,"propTypes",Fm.propTypes),Ir(n,"defaultProps",Fm.defaultProps),Ir(n,"addCustomPlayer",r=>{vm.push(r)}),Ir(n,"removeCustomPlayers",()=>{vm.length=0}),Ir(n,"canPlay",r=>{for(const a of[...vm,...e])if(a.canPlay(r))return!0;return!1}),Ir(n,"canEnablePIP",r=>{for(const a of[...vm,...e])if(a.canEnablePIP&&a.canEnablePIP(r))return!0;return!1}),n};var CKe=Object.create,Uy=Object.defineProperty,RKe=Object.getOwnPropertyDescriptor,xKe=Object.getOwnPropertyNames,AKe=Object.getPrototypeOf,OKe=Object.prototype.hasOwnProperty,NKe=(e,t)=>{for(var n in t)Uy(e,n,{get:t[n],enumerable:!0})},ite=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of xKe(t))!OKe.call(e,a)&&a!==n&&Uy(e,a,{get:()=>t[a],enumerable:!(r=RKe(t,a))||r.enumerable});return e},IKe=(e,t,n)=>(n=e!=null?CKe(AKe(e)):{},ite(t||!e||!e.__esModule?Uy(n,"default",{value:e,enumerable:!0}):n,e)),wKe=e=>ite(Uy({},"__esModule",{value:!0}),e),ote={};NKe(ote,{default:()=>kKe});var DKe=wKe(ote),U4=IKe(Aje),LKe=hKe;const MKe=U4.default[U4.default.length-1];var kKe=(0,LKe.createReactPlayer)(U4.default,MKe);const PKe=Aa(DKe),ste=({element:e})=>e.url?_.jsx(PKe,{className:`${e.display}-video`,width:"100%",controls:!0,url:e.url,config:e.playerConfig||{}}):null,lte=({element:e})=>{switch(e==null?void 0:e.type){case"file":return _.jsx(WQ,{element:e});case"image":return _.jsx(jQ,{element:e});case"text":return _.jsx(Ree,{element:e});case"pdf":return _.jsx(KQ,{element:e});case"audio":return _.jsx(zQ,{element:e});case"video":return _.jsx(ste,{element:e});case"plotly":return _.jsx(sX,{element:e});default:return null}};var PD={exports:{}},jg={},$y={exports:{}},cte={};function ute(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=ute(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function gH(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=ute(e))&&(r&&(r+=" "),r+=t);return r}const FKe=Object.freeze(Object.defineProperty({__proto__:null,clsx:gH,default:gH},Symbol.toStringTag,{value:"Module"})),BKe=b3(FKe);var xr={},Xs={};Object.defineProperty(Xs,"__esModule",{value:!0});Xs.dontSetMe=GKe;Xs.findInArray=UKe;Xs.int=HKe;Xs.isFunction=$Ke;Xs.isNum=zKe;function UKe(e,t){for(let n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]}function $Ke(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function zKe(e){return typeof e=="number"&&!isNaN(e)}function HKe(e){return parseInt(e,10)}function GKe(e,t,n){if(e[t])return new Error("Invalid prop ".concat(t," passed to ").concat(n," - do not set this, set it on the child."))}var Ad={};Object.defineProperty(Ad,"__esModule",{value:!0});Ad.browserPrefixToKey=pte;Ad.browserPrefixToStyle=VKe;Ad.default=void 0;Ad.getPrefix=dte;const ZO=["Moz","Webkit","O","ms"];function dte(){var e;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const n=(e=window.document)===null||e===void 0||(e=e.documentElement)===null||e===void 0?void 0:e.style;if(!n||t in n)return"";for(let r=0;r<ZO.length;r++)if(pte(t,ZO[r])in n)return ZO[r];return""}function pte(e,t){return t?"".concat(t).concat(YKe(e)):e}function VKe(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e}function YKe(e){let t="",n=!0;for(let r=0;r<e.length;r++)n?(t+=e[r].toUpperCase(),n=!1):e[r]==="-"?n=!0:t+=e[r];return t}Ad.default=dte();Object.defineProperty(xr,"__esModule",{value:!0});xr.addClassName=hte;xr.addEvent=jKe;xr.addUserSelectStyles=iQe;xr.createCSSTransform=tQe;xr.createSVGTransform=nQe;xr.getTouch=rQe;xr.getTouchIdentifier=aQe;xr.getTranslation=FD;xr.innerHeight=ZKe;xr.innerWidth=JKe;xr.matchesSelector=mte;xr.matchesSelectorAndParentsTo=WKe;xr.offsetXYFromParent=eQe;xr.outerHeight=QKe;xr.outerWidth=XKe;xr.removeClassName=gte;xr.removeEvent=KKe;xr.removeUserSelectStyles=oQe;var Xi=Xs,_H=qKe(Ad);function fte(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(fte=function(r){return r?n:t})(e)}function qKe(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=fte(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var o=a?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(r,i,o):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}let hE="";function mte(e,t){return hE||(hE=(0,Xi.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(n){return(0,Xi.isFunction)(e[n])})),(0,Xi.isFunction)(e[hE])?e[hE](t):!1}function WKe(e,t,n){let r=e;do{if(mte(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function jKe(e,t,n,r){if(!e)return;const a={capture:!0,...r};e.addEventListener?e.addEventListener(t,n,a):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n}function KKe(e,t,n,r){if(!e)return;const a={capture:!0,...r};e.removeEventListener?e.removeEventListener(t,n,a):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null}function QKe(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,Xi.int)(n.borderTopWidth),t+=(0,Xi.int)(n.borderBottomWidth),t}function XKe(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,Xi.int)(n.borderLeftWidth),t+=(0,Xi.int)(n.borderRightWidth),t}function ZKe(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,Xi.int)(n.paddingTop),t-=(0,Xi.int)(n.paddingBottom),t}function JKe(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,Xi.int)(n.paddingLeft),t-=(0,Xi.int)(n.paddingRight),t}function eQe(e,t,n){const a=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect(),i=(e.clientX+t.scrollLeft-a.left)/n,o=(e.clientY+t.scrollTop-a.top)/n;return{x:i,y:o}}function tQe(e,t){const n=FD(e,t,"px");return{[(0,_H.browserPrefixToKey)("transform",_H.default)]:n}}function nQe(e,t){return FD(e,t,"")}function FD(e,t,n){let{x:r,y:a}=e,i="translate(".concat(r).concat(n,",").concat(a).concat(n,")");if(t){const o="".concat(typeof t.x=="string"?t.x:t.x+n),s="".concat(typeof t.y=="string"?t.y:t.y+n);i="translate(".concat(o,", ").concat(s,")")+i}return i}function rQe(e,t){return e.targetTouches&&(0,Xi.findInArray)(e.targetTouches,n=>t===n.identifier)||e.changedTouches&&(0,Xi.findInArray)(e.changedTouches,n=>t===n.identifier)}function aQe(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function iQe(e){if(!e)return;let t=e.getElementById("react-draggable-style-el");t||(t=e.createElement("style"),t.type="text/css",t.id="react-draggable-style-el",t.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
652
+ \`\`\``),_.jsx(_t,{sx:{fontFamily:u=>u.typography.fontFamily},children:_.jsx(eg,{allowHtml:i,latex:o,children:s})})};var RWe=function(t,n,r){var a=document.head||document.getElementsByTagName("head")[0],i=document.createElement("script");typeof n=="function"&&(r=n,n={}),n=n||{},r=r||function(){},i.type=n.type||"text/javascript",i.charset=n.charset||"utf8",i.async="async"in n?!!n.async:!0,i.src=t,n.attrs&&xWe(i,n.attrs),n.text&&(i.text=""+n.text);var o="onload"in i?cH:AWe;o(i,r),i.onload||cH(i,r),a.appendChild(i)};function xWe(e,t){for(var n in t)e.setAttribute(n,t[n])}function cH(e,t){e.onload=function(){this.onerror=this.onload=null,t(null,e)},e.onerror=function(){this.onerror=this.onload=null,t(new Error("Failed to load "+this.src),e)}}function AWe(e,t){e.onreadystatechange=function(){this.readyState!="complete"&&this.readyState!="loaded"||(this.onreadystatechange=null,t(null,e))}}var OWe=function(t){return NWe(t)&&!IWe(t)};function NWe(e){return!!e&&typeof e=="object"}function IWe(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||LWe(e)}var wWe=typeof Symbol=="function"&&Symbol.for,DWe=wWe?Symbol.for("react.element"):60103;function LWe(e){return e.$$typeof===DWe}function MWe(e){return Array.isArray(e)?[]:{}}function tg(e,t){return t.clone!==!1&&t.isMergeableObject(e)?wf(MWe(e),e,t):e}function kWe(e,t,n){return e.concat(t).map(function(r){return tg(r,n)})}function PWe(e,t){if(!t.customMerge)return wf;var n=t.customMerge(e);return typeof n=="function"?n:wf}function FWe(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function uH(e){return Object.keys(e).concat(FWe(e))}function xee(e,t){try{return t in e}catch{return!1}}function BWe(e,t){return xee(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function UWe(e,t,n){var r={};return n.isMergeableObject(e)&&uH(e).forEach(function(a){r[a]=tg(e[a],n)}),uH(t).forEach(function(a){BWe(e,a)||(xee(e,a)&&n.isMergeableObject(t[a])?r[a]=PWe(a,n)(e[a],t[a],n):r[a]=tg(t[a],n))}),r}function wf(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||kWe,n.isMergeableObject=n.isMergeableObject||OWe,n.cloneUnlessOtherwiseSpecified=tg;var r=Array.isArray(t),a=Array.isArray(e),i=r===a;return i?r?n.arrayMerge(e,t,n):UWe(e,t,n):tg(t,n)}wf.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,a){return wf(r,a,n)},{})};var $We=wf,Aee=$We,zWe=Object.create,ky=Object.defineProperty,HWe=Object.getOwnPropertyDescriptor,GWe=Object.getOwnPropertyNames,VWe=Object.getPrototypeOf,YWe=Object.prototype.hasOwnProperty,qWe=(e,t)=>{for(var n in t)ky(e,n,{get:t[n],enumerable:!0})},Oee=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of GWe(t))!YWe.call(e,a)&&a!==n&&ky(e,a,{get:()=>t[a],enumerable:!(r=HWe(t,a))||r.enumerable});return e},ID=(e,t,n)=>(n=e!=null?zWe(VWe(e)):{},Oee(t||!e||!e.__esModule?ky(n,"default",{value:e,enumerable:!0}):n,e)),WWe=e=>Oee(ky({},"__esModule",{value:!0}),e),Nee={};qWe(Nee,{callPlayer:()=>cje,getConfig:()=>sje,getSDK:()=>oje,isBlobUrl:()=>dje,isMediaStream:()=>uje,lazy:()=>XWe,omit:()=>lje,parseEndTime:()=>rje,parseStartTime:()=>nje,queryString:()=>ije,randomString:()=>aje,supportsWebKitPresentationMode:()=>pje});var Py=WWe(Nee),jWe=ID(x),KWe=ID(RWe),QWe=ID(Aee);const XWe=e=>jWe.default.lazy(async()=>{const t=await e();return typeof t.default=="function"?t:t.default}),ZWe=/[?&#](?:start|t)=([0-9hms]+)/,JWe=/[?&#]end=([0-9hms]+)/,P4=/(\d+)(h|m|s)/g,eje=/^\d+$/;function Iee(e,t){if(e instanceof Array)return;const n=e.match(t);if(n){const r=n[1];if(r.match(P4))return tje(r);if(eje.test(r))return parseInt(r)}}function tje(e){let t=0,n=P4.exec(e);for(;n!==null;){const[,r,a]=n;a==="h"&&(t+=parseInt(r,10)*60*60),a==="m"&&(t+=parseInt(r,10)*60),a==="s"&&(t+=parseInt(r,10)),n=P4.exec(e)}return t}function nje(e){return Iee(e,ZWe)}function rje(e){return Iee(e,JWe)}function aje(){return Math.random().toString(36).substr(2,5)}function ije(e){return Object.keys(e).map(t=>`${t}=${e[t]}`).join("&")}function KO(e){return window[e]?window[e]:window.exports&&window.exports[e]?window.exports[e]:window.module&&window.module.exports&&window.module.exports[e]?window.module.exports[e]:null}const lp={},oje=function(t,n,r=null,a=()=>!0,i=KWe.default){const o=KO(n);return o&&a(o)?Promise.resolve(o):new Promise((s,l)=>{if(lp[t]){lp[t].push({resolve:s,reject:l});return}lp[t]=[{resolve:s,reject:l}];const c=u=>{lp[t].forEach(p=>p.resolve(u))};if(r){const u=window[r];window[r]=function(){u&&u(),c(KO(n))}}i(t,u=>{u?(lp[t].forEach(p=>p.reject(u)),lp[t]=null):r||c(KO(n))})})};function sje(e,t){return(0,QWe.default)(t.config,e.config)}function lje(e,...t){const n=[].concat(...t),r={},a=Object.keys(e);for(const i of a)n.indexOf(i)===-1&&(r[i]=e[i]);return r}function cje(e,...t){if(!this.player||!this.player[e]){let n=`ReactPlayer: ${this.constructor.displayName} player could not call %c${e}%c – `;return this.player?this.player[e]||(n+="The method was not available"):n+="The player was not available",console.warn(n,"font-weight: bold",""),null}return this.player[e](...t)}function uje(e){return typeof window<"u"&&typeof window.MediaStream<"u"&&e instanceof window.MediaStream}function dje(e){return/^blob:/.test(e)}function pje(e=document.createElement("video")){const t=/iPhone|iPod/.test(navigator.userAgent)===!1;return e.webkitSupportsPresentationMode&&typeof e.webkitSetPresentationMode=="function"&&t}var wD=Object.defineProperty,fje=Object.getOwnPropertyDescriptor,mje=Object.getOwnPropertyNames,hje=Object.prototype.hasOwnProperty,gje=(e,t)=>{for(var n in t)wD(e,n,{get:t[n],enumerable:!0})},_je=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of mje(t))!hje.call(e,a)&&a!==n&&wD(e,a,{get:()=>t[a],enumerable:!(r=fje(t,a))||r.enumerable});return e},Eje=e=>_je(wD({},"__esModule",{value:!0}),e),wee={};gje(wee,{AUDIO_EXTENSIONS:()=>DD,DASH_EXTENSIONS:()=>Yee,FLV_EXTENSIONS:()=>qee,HLS_EXTENSIONS:()=>MD,MATCH_URL_DAILYMOTION:()=>zee,MATCH_URL_FACEBOOK:()=>kee,MATCH_URL_FACEBOOK_WATCH:()=>Pee,MATCH_URL_KALTURA:()=>Vee,MATCH_URL_MIXCLOUD:()=>Hee,MATCH_URL_MUX:()=>Mee,MATCH_URL_SOUNDCLOUD:()=>Dee,MATCH_URL_STREAMABLE:()=>Fee,MATCH_URL_TWITCH_CHANNEL:()=>$ee,MATCH_URL_TWITCH_VIDEO:()=>Uee,MATCH_URL_VIDYARD:()=>Gee,MATCH_URL_VIMEO:()=>Lee,MATCH_URL_WISTIA:()=>Bee,MATCH_URL_YOUTUBE:()=>F4,VIDEO_EXTENSIONS:()=>LD,canPlay:()=>Sje});var bje=Eje(wee),dH=Py;const F4=/(?:youtu\.be\/|youtube(?:-nocookie|education)?\.com\/(?:embed\/|v\/|watch\/|watch\?v=|watch\?.+&v=|shorts\/|live\/))((\w|-){11})|youtube\.com\/playlist\?list=|youtube\.com\/user\//,Dee=/(?:soundcloud\.com|snd\.sc)\/[^.]+$/,Lee=/vimeo\.com\/(?!progressive_redirect).+/,Mee=/stream\.mux\.com\/(?!\w+\.m3u8)(\w+)/,kee=/^https?:\/\/(www\.)?facebook\.com.*\/(video(s)?|watch|story)(\.php?|\/).+$/,Pee=/^https?:\/\/fb\.watch\/.+$/,Fee=/streamable\.com\/([a-z0-9]+)$/,Bee=/(?:wistia\.(?:com|net)|wi\.st)\/(?:medias|embed)\/(?:iframe\/)?([^?]+)/,Uee=/(?:www\.|go\.)?twitch\.tv\/videos\/(\d+)($|\?)/,$ee=/(?:www\.|go\.)?twitch\.tv\/([a-zA-Z0-9_]+)($|\?)/,zee=/^(?:(?:https?):)?(?:\/\/)?(?:www\.)?(?:(?:dailymotion\.com(?:\/embed)?\/video)|dai\.ly)\/([a-zA-Z0-9]+)(?:_[\w_-]+)?(?:[\w.#_-]+)?/,Hee=/mixcloud\.com\/([^/]+\/[^/]+)/,Gee=/vidyard.com\/(?:watch\/)?([a-zA-Z0-9-_]+)/,Vee=/^https?:\/\/[a-zA-Z]+\.kaltura.(com|org)\/p\/([0-9]+)\/sp\/([0-9]+)00\/embedIframeJs\/uiconf_id\/([0-9]+)\/partner_id\/([0-9]+)(.*)entry_id.([a-zA-Z0-9-_].*)$/,DD=/\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx)($|\?)/i,LD=/\.(mp4|og[gv]|webm|mov|m4v)(#t=[,\d+]+)?($|\?)/i,MD=/\.(m3u8)($|\?)/i,Yee=/\.(mpd)($|\?)/i,qee=/\.(flv)($|\?)/i,B4=e=>{if(e instanceof Array){for(const t of e)if(typeof t=="string"&&B4(t)||B4(t.src))return!0;return!1}return(0,dH.isMediaStream)(e)||(0,dH.isBlobUrl)(e)?!0:DD.test(e)||LD.test(e)||MD.test(e)||Yee.test(e)||qee.test(e)},Sje={youtube:e=>e instanceof Array?e.every(t=>F4.test(t)):F4.test(e),soundcloud:e=>Dee.test(e)&&!DD.test(e),vimeo:e=>Lee.test(e)&&!LD.test(e)&&!MD.test(e),mux:e=>Mee.test(e),facebook:e=>kee.test(e)||Pee.test(e),streamable:e=>Fee.test(e),wistia:e=>Bee.test(e),twitch:e=>Uee.test(e)||$ee.test(e),dailymotion:e=>zee.test(e),mixcloud:e=>Hee.test(e),vidyard:e=>Gee.test(e),kaltura:e=>Vee.test(e),file:B4};var kD=Object.defineProperty,vje=Object.getOwnPropertyDescriptor,yje=Object.getOwnPropertyNames,Tje=Object.prototype.hasOwnProperty,Cje=(e,t)=>{for(var n in t)kD(e,n,{get:t[n],enumerable:!0})},Rje=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of yje(t))!Tje.call(e,a)&&a!==n&&kD(e,a,{get:()=>t[a],enumerable:!(r=vje(t,a))||r.enumerable});return e},xje=e=>Rje(kD({},"__esModule",{value:!0}),e),Wee={};Cje(Wee,{default:()=>Oje});var Aje=xje(Wee),di=Py,qa=bje,Oje=[{key:"youtube",name:"YouTube",canPlay:qa.canPlay.youtube,lazyPlayer:(0,di.lazy)(()=>ja(()=>import("./YouTube-9114d4e0.js").then(e=>e.Y),[]))},{key:"soundcloud",name:"SoundCloud",canPlay:qa.canPlay.soundcloud,lazyPlayer:(0,di.lazy)(()=>ja(()=>import("./SoundCloud-56125978.js").then(e=>e.S),[]))},{key:"vimeo",name:"Vimeo",canPlay:qa.canPlay.vimeo,lazyPlayer:(0,di.lazy)(()=>ja(()=>import("./Vimeo-1f0b6b55.js").then(e=>e.V),[]))},{key:"mux",name:"Mux",canPlay:qa.canPlay.mux,lazyPlayer:(0,di.lazy)(()=>ja(()=>import("./Mux-e9439155.js").then(e=>e.M),[]))},{key:"facebook",name:"Facebook",canPlay:qa.canPlay.facebook,lazyPlayer:(0,di.lazy)(()=>ja(()=>import("./Facebook-5a236c6a.js").then(e=>e.F),[]))},{key:"streamable",name:"Streamable",canPlay:qa.canPlay.streamable,lazyPlayer:(0,di.lazy)(()=>ja(()=>import("./Streamable-9aff4ba5.js").then(e=>e.S),[]))},{key:"wistia",name:"Wistia",canPlay:qa.canPlay.wistia,lazyPlayer:(0,di.lazy)(()=>ja(()=>import("./Wistia-c18b0bba.js").then(e=>e.W),[]))},{key:"twitch",name:"Twitch",canPlay:qa.canPlay.twitch,lazyPlayer:(0,di.lazy)(()=>ja(()=>import("./Twitch-ea748d1d.js").then(e=>e.T),[]))},{key:"dailymotion",name:"DailyMotion",canPlay:qa.canPlay.dailymotion,lazyPlayer:(0,di.lazy)(()=>ja(()=>import("./DailyMotion-875f8ae4.js").then(e=>e.D),[]))},{key:"mixcloud",name:"Mixcloud",canPlay:qa.canPlay.mixcloud,lazyPlayer:(0,di.lazy)(()=>ja(()=>import("./Mixcloud-2a11761c.js").then(e=>e.M),[]))},{key:"vidyard",name:"Vidyard",canPlay:qa.canPlay.vidyard,lazyPlayer:(0,di.lazy)(()=>ja(()=>import("./Vidyard-8106a931.js").then(e=>e.V),[]))},{key:"kaltura",name:"Kaltura",canPlay:qa.canPlay.kaltura,lazyPlayer:(0,di.lazy)(()=>ja(()=>import("./Kaltura-091e82f4.js").then(e=>e.K),[]))},{key:"file",name:"FilePlayer",canPlay:qa.canPlay.file,canEnablePIP:e=>qa.canPlay.file(e)&&(document.pictureInPictureEnabled||(0,di.supportsWebKitPresentationMode)())&&!qa.AUDIO_EXTENSIONS.test(e),lazyPlayer:(0,di.lazy)(()=>ja(()=>import("./FilePlayer-139fc89f.js").then(e=>e.F),[]))}],pH=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function Nje(e,t){return!!(e===t||pH(e)&&pH(t))}function Ije(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!Nje(e[n],t[n]))return!1;return!0}function wje(e,t){t===void 0&&(t=Ije);var n,r=[],a,i=!1;function o(){for(var s=[],l=0;l<arguments.length;l++)s[l]=arguments[l];return i&&n===this&&t(s,r)||(a=e.apply(this,s),i=!0,n=this,r=s),a}return o}const Dje=Object.freeze(Object.defineProperty({__proto__:null,default:wje},Symbol.toStringTag,{value:"Module"})),Lje=b3(Dje);var Mje=typeof Element<"u",kje=typeof Map=="function",Pje=typeof Set=="function",Fje=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function ZE(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,r,a;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!ZE(e[r],t[r]))return!1;return!0}var i;if(kje&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(i=e.entries();!(r=i.next()).done;)if(!t.has(r.value[0]))return!1;for(i=e.entries();!(r=i.next()).done;)if(!ZE(r.value[1],t.get(r.value[0])))return!1;return!0}if(Pje&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(i=e.entries();!(r=i.next()).done;)if(!t.has(r.value[0]))return!1;return!0}if(Fje&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,a[r]))return!1;if(Mje&&e instanceof Element)return!1;for(r=n;r--!==0;)if(!((a[r]==="_owner"||a[r]==="__v"||a[r]==="__o")&&e.$$typeof)&&!ZE(e[a[r]],t[a[r]]))return!1;return!0}return e!==e&&t!==t}var jee=function(t,n){try{return ZE(t,n)}catch(r){if((r.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw r}},Bje=Object.create,Fy=Object.defineProperty,Uje=Object.getOwnPropertyDescriptor,$je=Object.getOwnPropertyNames,zje=Object.getPrototypeOf,Hje=Object.prototype.hasOwnProperty,Gje=(e,t)=>{for(var n in t)Fy(e,n,{get:t[n],enumerable:!0})},Kee=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of $je(t))!Hje.call(e,a)&&a!==n&&Fy(e,a,{get:()=>t[a],enumerable:!(r=Uje(t,a))||r.enumerable});return e},Vje=(e,t,n)=>(n=e!=null?Bje(zje(e)):{},Kee(t||!e||!e.__esModule?Fy(n,"default",{value:e,enumerable:!0}):n,e)),Yje=e=>Kee(Fy({},"__esModule",{value:!0}),e),Qee={};Gje(Qee,{defaultProps:()=>jje,propTypes:()=>Wje});var Xee=Yje(Qee),qje=Vje(Wf);const{string:_a,bool:Wa,number:cp,array:QO,oneOfType:Sm,shape:Ui,object:La,func:jr,node:fH}=qje.default,Wje={url:Sm([_a,QO,La]),playing:Wa,loop:Wa,controls:Wa,volume:cp,muted:Wa,playbackRate:cp,width:Sm([_a,cp]),height:Sm([_a,cp]),style:La,progressInterval:cp,playsinline:Wa,pip:Wa,stopOnUnmount:Wa,light:Sm([Wa,_a,La]),playIcon:fH,previewTabIndex:cp,previewAriaLabel:_a,fallback:fH,oEmbedUrl:_a,wrapper:Sm([_a,jr,Ui({render:jr.isRequired})]),config:Ui({soundcloud:Ui({options:La}),youtube:Ui({playerVars:La,embedOptions:La,onUnstarted:jr}),facebook:Ui({appId:_a,version:_a,playerId:_a,attributes:La}),dailymotion:Ui({params:La}),vimeo:Ui({playerOptions:La,title:_a}),mux:Ui({attributes:La,version:_a}),file:Ui({attributes:La,tracks:QO,forceVideo:Wa,forceAudio:Wa,forceHLS:Wa,forceSafariHLS:Wa,forceDisableHls:Wa,forceDASH:Wa,forceFLV:Wa,hlsOptions:La,hlsVersion:_a,dashVersion:_a,flvVersion:_a}),wistia:Ui({options:La,playerId:_a,customControls:QO}),mixcloud:Ui({options:La}),twitch:Ui({options:La,playerId:_a}),vidyard:Ui({options:La})}),onReady:jr,onStart:jr,onPlay:jr,onPause:jr,onBuffer:jr,onBufferEnd:jr,onEnded:jr,onError:jr,onDuration:jr,onSeek:jr,onPlaybackRateChange:jr,onPlaybackQualityChange:jr,onProgress:jr,onClickPreview:jr,onEnablePIP:jr,onDisablePIP:jr},Ea=()=>{},jje={playing:!1,loop:!1,controls:!1,volume:null,muted:!1,playbackRate:1,width:"640px",height:"360px",style:{},progressInterval:1e3,playsinline:!1,pip:!1,stopOnUnmount:!0,light:!1,fallback:null,wrapper:"div",previewTabIndex:0,previewAriaLabel:"",oEmbedUrl:"https://noembed.com/embed?url={url}",config:{soundcloud:{options:{visual:!0,buying:!1,liking:!1,download:!1,sharing:!1,show_comments:!1,show_playcount:!1}},youtube:{playerVars:{playsinline:1,showinfo:0,rel:0,iv_load_policy:3,modestbranding:1},embedOptions:{},onUnstarted:Ea},facebook:{appId:"1309697205772819",version:"v3.3",playerId:null,attributes:{}},dailymotion:{params:{api:1,"endscreen-enable":!1}},vimeo:{playerOptions:{autopause:!1,byline:!1,portrait:!1,title:!1},title:null},mux:{attributes:{},version:"2"},file:{attributes:{},tracks:[],forceVideo:!1,forceAudio:!1,forceHLS:!1,forceDASH:!1,forceFLV:!1,hlsOptions:{},hlsVersion:"1.1.4",dashVersion:"3.1.3",flvVersion:"1.5.0",forceDisableHls:!1},wistia:{options:{},playerId:null,customControls:null},mixcloud:{options:{hide_cover:1}},twitch:{options:{},playerId:null},vidyard:{options:{}}},onReady:Ea,onStart:Ea,onPlay:Ea,onPause:Ea,onBuffer:Ea,onBufferEnd:Ea,onEnded:Ea,onError:Ea,onDuration:Ea,onSeek:Ea,onPlaybackRateChange:Ea,onPlaybackQualityChange:Ea,onProgress:Ea,onClickPreview:Ea,onEnablePIP:Ea,onDisablePIP:Ea};var Kje=Object.create,Yg=Object.defineProperty,Qje=Object.getOwnPropertyDescriptor,Xje=Object.getOwnPropertyNames,Zje=Object.getPrototypeOf,Jje=Object.prototype.hasOwnProperty,eKe=(e,t,n)=>t in e?Yg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,tKe=(e,t)=>{for(var n in t)Yg(e,n,{get:t[n],enumerable:!0})},Zee=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Xje(t))!Jje.call(e,a)&&a!==n&&Yg(e,a,{get:()=>t[a],enumerable:!(r=Qje(t,a))||r.enumerable});return e},Jee=(e,t,n)=>(n=e!=null?Kje(Zje(e)):{},Zee(t||!e||!e.__esModule?Yg(n,"default",{value:e,enumerable:!0}):n,e)),nKe=e=>Zee(Yg({},"__esModule",{value:!0}),e),wr=(e,t,n)=>(eKe(e,typeof t!="symbol"?t+"":t,n),n),ete={};tKe(ete,{default:()=>By});var rKe=nKe(ete),mH=Jee(x),aKe=Jee(jee),tte=Xee,iKe=Py;const oKe=5e3;class By extends mH.Component{constructor(){super(...arguments),wr(this,"mounted",!1),wr(this,"isReady",!1),wr(this,"isPlaying",!1),wr(this,"isLoading",!0),wr(this,"loadOnReady",null),wr(this,"startOnPlay",!0),wr(this,"seekOnPlay",null),wr(this,"onDurationCalled",!1),wr(this,"handlePlayerMount",t=>{if(this.player){this.progress();return}this.player=t,this.player.load(this.props.url),this.progress()}),wr(this,"getInternalPlayer",t=>this.player?this.player[t]:null),wr(this,"progress",()=>{if(this.props.url&&this.player&&this.isReady){const t=this.getCurrentTime()||0,n=this.getSecondsLoaded(),r=this.getDuration();if(r){const a={playedSeconds:t,played:t/r};n!==null&&(a.loadedSeconds=n,a.loaded=n/r),(a.playedSeconds!==this.prevPlayed||a.loadedSeconds!==this.prevLoaded)&&this.props.onProgress(a),this.prevPlayed=a.playedSeconds,this.prevLoaded=a.loadedSeconds}}this.progressTimeout=setTimeout(this.progress,this.props.progressFrequency||this.props.progressInterval)}),wr(this,"handleReady",()=>{if(!this.mounted)return;this.isReady=!0,this.isLoading=!1;const{onReady:t,playing:n,volume:r,muted:a}=this.props;t(),!a&&r!==null&&this.player.setVolume(r),this.loadOnReady?(this.player.load(this.loadOnReady,!0),this.loadOnReady=null):n&&this.player.play(),this.handleDurationCheck()}),wr(this,"handlePlay",()=>{this.isPlaying=!0,this.isLoading=!1;const{onStart:t,onPlay:n,playbackRate:r}=this.props;this.startOnPlay&&(this.player.setPlaybackRate&&r!==1&&this.player.setPlaybackRate(r),t(),this.startOnPlay=!1),n(),this.seekOnPlay&&(this.seekTo(this.seekOnPlay),this.seekOnPlay=null),this.handleDurationCheck()}),wr(this,"handlePause",t=>{this.isPlaying=!1,this.isLoading||this.props.onPause(t)}),wr(this,"handleEnded",()=>{const{activePlayer:t,loop:n,onEnded:r}=this.props;t.loopOnEnded&&n&&this.seekTo(0),n||(this.isPlaying=!1,r())}),wr(this,"handleError",(...t)=>{this.isLoading=!1,this.props.onError(...t)}),wr(this,"handleDurationCheck",()=>{clearTimeout(this.durationCheckTimeout);const t=this.getDuration();t?this.onDurationCalled||(this.props.onDuration(t),this.onDurationCalled=!0):this.durationCheckTimeout=setTimeout(this.handleDurationCheck,100)}),wr(this,"handleLoaded",()=>{this.isLoading=!1})}componentDidMount(){this.mounted=!0}componentWillUnmount(){clearTimeout(this.progressTimeout),clearTimeout(this.durationCheckTimeout),this.isReady&&this.props.stopOnUnmount&&(this.player.stop(),this.player.disablePIP&&this.player.disablePIP()),this.mounted=!1}componentDidUpdate(t){if(!this.player)return;const{url:n,playing:r,volume:a,muted:i,playbackRate:o,pip:s,loop:l,activePlayer:c,disableDeferredLoading:u}=this.props;if(!(0,aKe.default)(t.url,n)){if(this.isLoading&&!c.forceLoad&&!u&&!(0,iKe.isMediaStream)(n)){console.warn(`ReactPlayer: the attempt to load ${n} is being deferred until the player has loaded`),this.loadOnReady=n;return}this.isLoading=!0,this.startOnPlay=!0,this.onDurationCalled=!1,this.player.load(n,this.isReady)}!t.playing&&r&&!this.isPlaying&&this.player.play(),t.playing&&!r&&this.isPlaying&&this.player.pause(),!t.pip&&s&&this.player.enablePIP&&this.player.enablePIP(),t.pip&&!s&&this.player.disablePIP&&this.player.disablePIP(),t.volume!==a&&a!==null&&this.player.setVolume(a),t.muted!==i&&(i?this.player.mute():(this.player.unmute(),a!==null&&setTimeout(()=>this.player.setVolume(a)))),t.playbackRate!==o&&this.player.setPlaybackRate&&this.player.setPlaybackRate(o),t.loop!==l&&this.player.setLoop&&this.player.setLoop(l)}getDuration(){return this.isReady?this.player.getDuration():null}getCurrentTime(){return this.isReady?this.player.getCurrentTime():null}getSecondsLoaded(){return this.isReady?this.player.getSecondsLoaded():null}seekTo(t,n,r){if(!this.isReady){t!==0&&(this.seekOnPlay=t,setTimeout(()=>{this.seekOnPlay=null},oKe));return}if(n?n==="fraction":t>0&&t<1){const i=this.player.getDuration();if(!i){console.warn("ReactPlayer: could not seek using fraction – duration not yet available");return}this.player.seekTo(i*t,r);return}this.player.seekTo(t,r)}render(){const t=this.props.activePlayer;return t?mH.default.createElement(t,{...this.props,onMount:this.handlePlayerMount,onReady:this.handleReady,onPlay:this.handlePlay,onPause:this.handlePause,onEnded:this.handleEnded,onLoaded:this.handleLoaded,onError:this.handleError}):null}}wr(By,"displayName","Player");wr(By,"propTypes",tte.propTypes);wr(By,"defaultProps",tte.defaultProps);var sKe=Object.create,qg=Object.defineProperty,lKe=Object.getOwnPropertyDescriptor,cKe=Object.getOwnPropertyNames,uKe=Object.getPrototypeOf,dKe=Object.prototype.hasOwnProperty,pKe=(e,t,n)=>t in e?qg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,fKe=(e,t)=>{for(var n in t)qg(e,n,{get:t[n],enumerable:!0})},nte=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of cKe(t))!dKe.call(e,a)&&a!==n&&qg(e,a,{get:()=>t[a],enumerable:!(r=lKe(t,a))||r.enumerable});return e},Wg=(e,t,n)=>(n=e!=null?sKe(uKe(e)):{},nte(t||!e||!e.__esModule?qg(n,"default",{value:e,enumerable:!0}):n,e)),mKe=e=>nte(qg({},"__esModule",{value:!0}),e),Ir=(e,t,n)=>(pKe(e,typeof t!="symbol"?t+"":t,n),n),rte={};fKe(rte,{createReactPlayer:()=>TKe});var hKe=mKe(rte),Sp=Wg(x),gKe=Wg(Aee),XO=Wg(Lje),hH=Wg(jee),Fm=Xee,ate=Py,_Ke=Wg(rKe);const EKe=(0,ate.lazy)(()=>ja(()=>import("./Preview-4a1f503b.js").then(e=>e.P),[])),bKe=typeof window<"u"&&window.document&&typeof document<"u",SKe=typeof aa<"u"&&aa.window&&aa.window.document,vKe=Object.keys(Fm.propTypes),yKe=bKe||SKe?Sp.Suspense:()=>null,vm=[],TKe=(e,t)=>{var n;return n=class extends Sp.Component{constructor(){super(...arguments),Ir(this,"state",{showPreview:!!this.props.light}),Ir(this,"references",{wrapper:r=>{this.wrapper=r},player:r=>{this.player=r}}),Ir(this,"handleClickPreview",r=>{this.setState({showPreview:!1}),this.props.onClickPreview(r)}),Ir(this,"showPreview",()=>{this.setState({showPreview:!0})}),Ir(this,"getDuration",()=>this.player?this.player.getDuration():null),Ir(this,"getCurrentTime",()=>this.player?this.player.getCurrentTime():null),Ir(this,"getSecondsLoaded",()=>this.player?this.player.getSecondsLoaded():null),Ir(this,"getInternalPlayer",(r="player")=>this.player?this.player.getInternalPlayer(r):null),Ir(this,"seekTo",(r,a,i)=>{if(!this.player)return null;this.player.seekTo(r,a,i)}),Ir(this,"handleReady",()=>{this.props.onReady(this)}),Ir(this,"getActivePlayer",(0,XO.default)(r=>{for(const a of[...vm,...e])if(a.canPlay(r))return a;return t||null})),Ir(this,"getConfig",(0,XO.default)((r,a)=>{const{config:i}=this.props;return gKe.default.all([Fm.defaultProps.config,Fm.defaultProps.config[a]||{},i,i[a]||{}])})),Ir(this,"getAttributes",(0,XO.default)(r=>(0,ate.omit)(this.props,vKe))),Ir(this,"renderActivePlayer",r=>{if(!r)return null;const a=this.getActivePlayer(r);if(!a)return null;const i=this.getConfig(r,a.key);return Sp.default.createElement(_Ke.default,{...this.props,key:a.key,ref:this.references.player,config:i,activePlayer:a.lazyPlayer||a,onReady:this.handleReady})})}shouldComponentUpdate(r,a){return!(0,hH.default)(this.props,r)||!(0,hH.default)(this.state,a)}componentDidUpdate(r){const{light:a}=this.props;!r.light&&a&&this.setState({showPreview:!0}),r.light&&!a&&this.setState({showPreview:!1})}renderPreview(r){if(!r)return null;const{light:a,playIcon:i,previewTabIndex:o,oEmbedUrl:s,previewAriaLabel:l}=this.props;return Sp.default.createElement(EKe,{url:r,light:a,playIcon:i,previewTabIndex:o,previewAriaLabel:l,oEmbedUrl:s,onClick:this.handleClickPreview})}render(){const{url:r,style:a,width:i,height:o,fallback:s,wrapper:l}=this.props,{showPreview:c}=this.state,u=this.getAttributes(r),p=typeof l=="string"?this.references.wrapper:void 0;return Sp.default.createElement(l,{ref:p,style:{...a,width:i,height:o},...u},Sp.default.createElement(yKe,{fallback:s},c?this.renderPreview(r):this.renderActivePlayer(r)))}},Ir(n,"displayName","ReactPlayer"),Ir(n,"propTypes",Fm.propTypes),Ir(n,"defaultProps",Fm.defaultProps),Ir(n,"addCustomPlayer",r=>{vm.push(r)}),Ir(n,"removeCustomPlayers",()=>{vm.length=0}),Ir(n,"canPlay",r=>{for(const a of[...vm,...e])if(a.canPlay(r))return!0;return!1}),Ir(n,"canEnablePIP",r=>{for(const a of[...vm,...e])if(a.canEnablePIP&&a.canEnablePIP(r))return!0;return!1}),n};var CKe=Object.create,Uy=Object.defineProperty,RKe=Object.getOwnPropertyDescriptor,xKe=Object.getOwnPropertyNames,AKe=Object.getPrototypeOf,OKe=Object.prototype.hasOwnProperty,NKe=(e,t)=>{for(var n in t)Uy(e,n,{get:t[n],enumerable:!0})},ite=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of xKe(t))!OKe.call(e,a)&&a!==n&&Uy(e,a,{get:()=>t[a],enumerable:!(r=RKe(t,a))||r.enumerable});return e},IKe=(e,t,n)=>(n=e!=null?CKe(AKe(e)):{},ite(t||!e||!e.__esModule?Uy(n,"default",{value:e,enumerable:!0}):n,e)),wKe=e=>ite(Uy({},"__esModule",{value:!0}),e),ote={};NKe(ote,{default:()=>kKe});var DKe=wKe(ote),U4=IKe(Aje),LKe=hKe;const MKe=U4.default[U4.default.length-1];var kKe=(0,LKe.createReactPlayer)(U4.default,MKe);const PKe=Aa(DKe),ste=({element:e})=>e.url?_.jsx(PKe,{className:`${e.display}-video`,width:"100%",controls:!0,url:e.url,config:e.playerConfig||{}}):null,lte=({element:e})=>{switch(e==null?void 0:e.type){case"file":return _.jsx(WQ,{element:e});case"image":return _.jsx(jQ,{element:e});case"text":return _.jsx(Ree,{element:e});case"pdf":return _.jsx(KQ,{element:e});case"audio":return _.jsx(zQ,{element:e});case"video":return _.jsx(ste,{element:e});case"plotly":return _.jsx(sX,{element:e});default:return null}};var PD={exports:{}},jg={},$y={exports:{}},cte={};function ute(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=ute(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function gH(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=ute(e))&&(r&&(r+=" "),r+=t);return r}const FKe=Object.freeze(Object.defineProperty({__proto__:null,clsx:gH,default:gH},Symbol.toStringTag,{value:"Module"})),BKe=b3(FKe);var xr={},Xs={};Object.defineProperty(Xs,"__esModule",{value:!0});Xs.dontSetMe=GKe;Xs.findInArray=UKe;Xs.int=HKe;Xs.isFunction=$Ke;Xs.isNum=zKe;function UKe(e,t){for(let n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]}function $Ke(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function zKe(e){return typeof e=="number"&&!isNaN(e)}function HKe(e){return parseInt(e,10)}function GKe(e,t,n){if(e[t])return new Error("Invalid prop ".concat(t," passed to ").concat(n," - do not set this, set it on the child."))}var Ad={};Object.defineProperty(Ad,"__esModule",{value:!0});Ad.browserPrefixToKey=pte;Ad.browserPrefixToStyle=VKe;Ad.default=void 0;Ad.getPrefix=dte;const ZO=["Moz","Webkit","O","ms"];function dte(){var e;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const n=(e=window.document)===null||e===void 0||(e=e.documentElement)===null||e===void 0?void 0:e.style;if(!n||t in n)return"";for(let r=0;r<ZO.length;r++)if(pte(t,ZO[r])in n)return ZO[r];return""}function pte(e,t){return t?"".concat(t).concat(YKe(e)):e}function VKe(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e}function YKe(e){let t="",n=!0;for(let r=0;r<e.length;r++)n?(t+=e[r].toUpperCase(),n=!1):e[r]==="-"?n=!0:t+=e[r];return t}Ad.default=dte();Object.defineProperty(xr,"__esModule",{value:!0});xr.addClassName=hte;xr.addEvent=jKe;xr.addUserSelectStyles=iQe;xr.createCSSTransform=tQe;xr.createSVGTransform=nQe;xr.getTouch=rQe;xr.getTouchIdentifier=aQe;xr.getTranslation=FD;xr.innerHeight=ZKe;xr.innerWidth=JKe;xr.matchesSelector=mte;xr.matchesSelectorAndParentsTo=WKe;xr.offsetXYFromParent=eQe;xr.outerHeight=QKe;xr.outerWidth=XKe;xr.removeClassName=gte;xr.removeEvent=KKe;xr.removeUserSelectStyles=oQe;var Xi=Xs,_H=qKe(Ad);function fte(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(fte=function(r){return r?n:t})(e)}function qKe(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=fte(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var o=a?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(r,i,o):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}let hE="";function mte(e,t){return hE||(hE=(0,Xi.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(n){return(0,Xi.isFunction)(e[n])})),(0,Xi.isFunction)(e[hE])?e[hE](t):!1}function WKe(e,t,n){let r=e;do{if(mte(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function jKe(e,t,n,r){if(!e)return;const a={capture:!0,...r};e.addEventListener?e.addEventListener(t,n,a):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n}function KKe(e,t,n,r){if(!e)return;const a={capture:!0,...r};e.removeEventListener?e.removeEventListener(t,n,a):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null}function QKe(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,Xi.int)(n.borderTopWidth),t+=(0,Xi.int)(n.borderBottomWidth),t}function XKe(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,Xi.int)(n.borderLeftWidth),t+=(0,Xi.int)(n.borderRightWidth),t}function ZKe(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,Xi.int)(n.paddingTop),t-=(0,Xi.int)(n.paddingBottom),t}function JKe(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,Xi.int)(n.paddingLeft),t-=(0,Xi.int)(n.paddingRight),t}function eQe(e,t,n){const a=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect(),i=(e.clientX+t.scrollLeft-a.left)/n,o=(e.clientY+t.scrollTop-a.top)/n;return{x:i,y:o}}function tQe(e,t){const n=FD(e,t,"px");return{[(0,_H.browserPrefixToKey)("transform",_H.default)]:n}}function nQe(e,t){return FD(e,t,"")}function FD(e,t,n){let{x:r,y:a}=e,i="translate(".concat(r).concat(n,",").concat(a).concat(n,")");if(t){const o="".concat(typeof t.x=="string"?t.x:t.x+n),s="".concat(typeof t.y=="string"?t.y:t.y+n);i="translate(".concat(o,", ").concat(s,")")+i}return i}function rQe(e,t){return e.targetTouches&&(0,Xi.findInArray)(e.targetTouches,n=>t===n.identifier)||e.changedTouches&&(0,Xi.findInArray)(e.changedTouches,n=>t===n.identifier)}function aQe(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function iQe(e){if(!e)return;let t=e.getElementById("react-draggable-style-el");t||(t=e.createElement("style"),t.type="text/css",t.id="react-draggable-style-el",t.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
653
653
  `,t.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
654
654
  `,e.getElementsByTagName("head")[0].appendChild(t)),e.body&&hte(e.body,"react-draggable-transparent-selection")}function oQe(e){if(e)try{if(e.body&&gte(e.body,"react-draggable-transparent-selection"),e.selection)e.selection.empty();else{const t=(e.defaultView||window).getSelection();t&&t.type!=="Caret"&&t.removeAllRanges()}}catch{}}function hte(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function gte(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}var Zs={};Object.defineProperty(Zs,"__esModule",{value:!0});Zs.canDragX=cQe;Zs.canDragY=uQe;Zs.createCoreData=pQe;Zs.createDraggableData=fQe;Zs.getBoundPosition=sQe;Zs.getControlPosition=dQe;Zs.snapToGrid=lQe;var zi=Xs,Fp=xr;function sQe(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r=="string"?r:mQe(r);const a=BD(e);if(typeof r=="string"){const{ownerDocument:i}=a,o=i.defaultView;let s;if(r==="parent"?s=a.parentNode:s=i.querySelector(r),!(s instanceof o.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');const l=s,c=o.getComputedStyle(a),u=o.getComputedStyle(l);r={left:-a.offsetLeft+(0,zi.int)(u.paddingLeft)+(0,zi.int)(c.marginLeft),top:-a.offsetTop+(0,zi.int)(u.paddingTop)+(0,zi.int)(c.marginTop),right:(0,Fp.innerWidth)(l)-(0,Fp.outerWidth)(a)-a.offsetLeft+(0,zi.int)(u.paddingRight)-(0,zi.int)(c.marginRight),bottom:(0,Fp.innerHeight)(l)-(0,Fp.outerHeight)(a)-a.offsetTop+(0,zi.int)(u.paddingBottom)-(0,zi.int)(c.marginBottom)}}return(0,zi.isNum)(r.right)&&(t=Math.min(t,r.right)),(0,zi.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,zi.isNum)(r.left)&&(t=Math.max(t,r.left)),(0,zi.isNum)(r.top)&&(n=Math.max(n,r.top)),[t,n]}function lQe(e,t,n){const r=Math.round(t/e[0])*e[0],a=Math.round(n/e[1])*e[1];return[r,a]}function cQe(e){return e.props.axis==="both"||e.props.axis==="x"}function uQe(e){return e.props.axis==="both"||e.props.axis==="y"}function dQe(e,t,n){const r=typeof t=="number"?(0,Fp.getTouch)(e,t):null;if(typeof t=="number"&&!r)return null;const a=BD(n),i=n.props.offsetParent||a.offsetParent||a.ownerDocument.body;return(0,Fp.offsetXYFromParent)(r||e,i,n.props.scale)}function pQe(e,t,n){const r=!(0,zi.isNum)(e.lastX),a=BD(e);return r?{node:a,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:a,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function fQe(e,t){const n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}}function mQe(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function BD(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}var zy={},Hy={};Object.defineProperty(Hy,"__esModule",{value:!0});Hy.default=hQe;function hQe(){}Object.defineProperty(zy,"__esModule",{value:!0});zy.default=void 0;var JO=_Qe(x),pi=UD(Wf),gQe=UD(Bf),Ma=xr,dc=Zs,eN=Xs,ym=UD(Hy);function UD(e){return e&&e.__esModule?e:{default:e}}function _te(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(_te=function(r){return r?n:t})(e)}function _Qe(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=_te(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var o=a?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(r,i,o):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function Qa(e,t,n){return t=EQe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function EQe(e){var t=bQe(e,"string");return typeof t=="symbol"?t:String(t)}function bQe(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const Xo={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let pc=Xo.mouse,Gy=class extends JO.Component{constructor(){super(...arguments),Qa(this,"dragging",!1),Qa(this,"lastX",NaN),Qa(this,"lastY",NaN),Qa(this,"touchIdentifier",null),Qa(this,"mounted",!1),Qa(this,"handleDragStart",t=>{if(this.props.onMouseDown(t),!this.props.allowAnyClick&&typeof t.button=="number"&&t.button!==0)return!1;const n=this.findDOMNode();if(!n||!n.ownerDocument||!n.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:r}=n;if(this.props.disabled||!(t.target instanceof r.defaultView.Node)||this.props.handle&&!(0,Ma.matchesSelectorAndParentsTo)(t.target,this.props.handle,n)||this.props.cancel&&(0,Ma.matchesSelectorAndParentsTo)(t.target,this.props.cancel,n))return;t.type==="touchstart"&&t.preventDefault();const a=(0,Ma.getTouchIdentifier)(t);this.touchIdentifier=a;const i=(0,dc.getControlPosition)(t,a,this);if(i==null)return;const{x:o,y:s}=i,l=(0,dc.createCoreData)(this,o,s);(0,ym.default)("DraggableCore: handleDragStart: %j",l),(0,ym.default)("calling",this.props.onStart),!(this.props.onStart(t,l)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,Ma.addUserSelectStyles)(r),this.dragging=!0,this.lastX=o,this.lastY=s,(0,Ma.addEvent)(r,pc.move,this.handleDrag),(0,Ma.addEvent)(r,pc.stop,this.handleDragStop))}),Qa(this,"handleDrag",t=>{const n=(0,dc.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:a}=n;if(Array.isArray(this.props.grid)){let s=r-this.lastX,l=a-this.lastY;if([s,l]=(0,dc.snapToGrid)(this.props.grid,s,l),!s&&!l)return;r=this.lastX+s,a=this.lastY+l}const i=(0,dc.createCoreData)(this,r,a);if((0,ym.default)("DraggableCore: handleDrag: %j",i),this.props.onDrag(t,i)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const l=document.createEvent("MouseEvents");l.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(l)}return}this.lastX=r,this.lastY=a}),Qa(this,"handleDragStop",t=>{if(!this.dragging)return;const n=(0,dc.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:a}=n;if(Array.isArray(this.props.grid)){let l=r-this.lastX||0,c=a-this.lastY||0;[l,c]=(0,dc.snapToGrid)(this.props.grid,l,c),r=this.lastX+l,a=this.lastY+c}const i=(0,dc.createCoreData)(this,r,a);if(this.props.onStop(t,i)===!1||this.mounted===!1)return!1;const s=this.findDOMNode();s&&this.props.enableUserSelectHack&&(0,Ma.removeUserSelectStyles)(s.ownerDocument),(0,ym.default)("DraggableCore: handleDragStop: %j",i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,s&&((0,ym.default)("DraggableCore: Removing handlers"),(0,Ma.removeEvent)(s.ownerDocument,pc.move,this.handleDrag),(0,Ma.removeEvent)(s.ownerDocument,pc.stop,this.handleDragStop))}),Qa(this,"onMouseDown",t=>(pc=Xo.mouse,this.handleDragStart(t))),Qa(this,"onMouseUp",t=>(pc=Xo.mouse,this.handleDragStop(t))),Qa(this,"onTouchStart",t=>(pc=Xo.touch,this.handleDragStart(t))),Qa(this,"onTouchEnd",t=>(pc=Xo.touch,this.handleDragStop(t)))}componentDidMount(){this.mounted=!0;const t=this.findDOMNode();t&&(0,Ma.addEvent)(t,Xo.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const t=this.findDOMNode();if(t){const{ownerDocument:n}=t;(0,Ma.removeEvent)(n,Xo.mouse.move,this.handleDrag),(0,Ma.removeEvent)(n,Xo.touch.move,this.handleDrag),(0,Ma.removeEvent)(n,Xo.mouse.stop,this.handleDragStop),(0,Ma.removeEvent)(n,Xo.touch.stop,this.handleDragStop),(0,Ma.removeEvent)(t,Xo.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,Ma.removeUserSelectStyles)(n)}}findDOMNode(){var t,n;return(t=this.props)!==null&&t!==void 0&&t.nodeRef?(n=this.props)===null||n===void 0||(n=n.nodeRef)===null||n===void 0?void 0:n.current:gQe.default.findDOMNode(this)}render(){return JO.cloneElement(JO.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};zy.default=Gy;Qa(Gy,"displayName","DraggableCore");Qa(Gy,"propTypes",{allowAnyClick:pi.default.bool,children:pi.default.node.isRequired,disabled:pi.default.bool,enableUserSelectHack:pi.default.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:pi.default.arrayOf(pi.default.number),handle:pi.default.string,cancel:pi.default.string,nodeRef:pi.default.object,onStart:pi.default.func,onDrag:pi.default.func,onStop:pi.default.func,onMouseDown:pi.default.func,scale:pi.default.number,className:eN.dontSetMe,style:eN.dontSetMe,transform:eN.dontSetMe});Qa(Gy,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1});(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return l.default}}),e.default=void 0;var t=f(x),n=u(Wf),r=u(Bf),a=u(BKe),i=xr,o=Zs,s=Xs,l=u(zy),c=u(Hy);function u(v){return v&&v.__esModule?v:{default:v}}function p(v){if(typeof WeakMap!="function")return null;var C=new WeakMap,T=new WeakMap;return(p=function(N){return N?T:C})(v)}function f(v,C){if(!C&&v&&v.__esModule)return v;if(v===null||typeof v!="object"&&typeof v!="function")return{default:v};var T=p(C);if(T&&T.has(v))return T.get(v);var N={},A=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var O in v)if(O!=="default"&&Object.prototype.hasOwnProperty.call(v,O)){var M=A?Object.getOwnPropertyDescriptor(v,O):null;M&&(M.get||M.set)?Object.defineProperty(N,O,M):N[O]=v[O]}return N.default=v,T&&T.set(v,N),N}function h(){return h=Object.assign?Object.assign.bind():function(v){for(var C=1;C<arguments.length;C++){var T=arguments[C];for(var N in T)Object.prototype.hasOwnProperty.call(T,N)&&(v[N]=T[N])}return v},h.apply(this,arguments)}function g(v,C,T){return C=E(C),C in v?Object.defineProperty(v,C,{value:T,enumerable:!0,configurable:!0,writable:!0}):v[C]=T,v}function E(v){var C=y(v,"string");return typeof C=="symbol"?C:String(C)}function y(v,C){if(typeof v!="object"||v===null)return v;var T=v[Symbol.toPrimitive];if(T!==void 0){var N=T.call(v,C||"default");if(typeof N!="object")return N;throw new TypeError("@@toPrimitive must return a primitive value.")}return(C==="string"?String:Number)(v)}class b extends t.Component{static getDerivedStateFromProps(C,T){let{position:N}=C,{prevPropsPosition:A}=T;return N&&(!A||N.x!==A.x||N.y!==A.y)?((0,c.default)("Draggable: getDerivedStateFromProps %j",{position:N,prevPropsPosition:A}),{x:N.x,y:N.y,prevPropsPosition:{...N}}):null}constructor(C){super(C),g(this,"onDragStart",(T,N)=>{if((0,c.default)("Draggable: onDragStart: %j",N),this.props.onStart(T,(0,o.createDraggableData)(this,N))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),g(this,"onDrag",(T,N)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",N);const A=(0,o.createDraggableData)(this,N),O={x:A.x,y:A.y,slackX:0,slackY:0};if(this.props.bounds){const{x:P,y:D}=O;O.x+=this.state.slackX,O.y+=this.state.slackY;const[$,V]=(0,o.getBoundPosition)(this,O.x,O.y);O.x=$,O.y=V,O.slackX=this.state.slackX+(P-O.x),O.slackY=this.state.slackY+(D-O.y),A.x=O.x,A.y=O.y,A.deltaX=O.x-this.state.x,A.deltaY=O.y-this.state.y}if(this.props.onDrag(T,A)===!1)return!1;this.setState(O)}),g(this,"onDragStop",(T,N)=>{if(!this.state.dragging||this.props.onStop(T,(0,o.createDraggableData)(this,N))===!1)return!1;(0,c.default)("Draggable: onDragStop: %j",N);const O={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:P,y:D}=this.props.position;O.x=P,O.y=D}this.setState(O)}),this.state={dragging:!1,dragged:!1,x:C.position?C.position.x:C.defaultPosition.x,y:C.position?C.position.y:C.defaultPosition.y,prevPropsPosition:{...C.position},slackX:0,slackY:0,isElementSVG:!1},C.position&&!(C.onDrag||C.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var C,T;return(C=(T=this.props)===null||T===void 0||(T=T.nodeRef)===null||T===void 0?void 0:T.current)!==null&&C!==void 0?C:r.default.findDOMNode(this)}render(){const{axis:C,bounds:T,children:N,defaultPosition:A,defaultClassName:O,defaultClassNameDragging:M,defaultClassNameDragged:P,position:D,positionOffset:$,scale:V,...Z}=this.props;let W={},ae=null;const q=!!!D||this.state.dragging,G=D||A,H={x:(0,o.canDragX)(this)&&q?this.state.x:G.x,y:(0,o.canDragY)(this)&&q?this.state.y:G.y};this.state.isElementSVG?ae=(0,i.createSVGTransform)(H,$):W=(0,i.createCSSTransform)(H,$);const k=(0,a.default)(N.props.className||"",O,{[M]:this.state.dragging,[P]:this.state.dragged});return t.createElement(l.default,h({},Z,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(N),{className:k,style:{...N.props.style,...W},transform:ae}))}}e.default=b,g(b,"displayName","Draggable"),g(b,"propTypes",{...l.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:s.dontSetMe,style:s.dontSetMe,transform:s.dontSetMe}),g(b,"defaultProps",{...l.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})})(cte);const{default:Ete,DraggableCore:SQe}=cte;$y.exports=Ete;$y.exports.default=Ete;$y.exports.DraggableCore=SQe;var vQe=$y.exports,$D={};$D.__esModule=!0;$D.cloneElement=AQe;var yQe=TQe(x);function TQe(e){return e&&e.__esModule?e:{default:e}}function EH(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function bH(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?EH(Object(n),!0).forEach(function(r){CQe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):EH(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function CQe(e,t,n){return t=RQe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function RQe(e){var t=xQe(e,"string");return typeof t=="symbol"?t:String(t)}function xQe(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function AQe(e,t){return t.style&&e.props.style&&(t.style=bH(bH({},e.props.style),t.style)),t.className&&e.props.className&&(t.className=e.props.className+" "+t.className),yQe.default.cloneElement(e,t)}var Kg={};Kg.__esModule=!0;Kg.resizableProps=void 0;var en=OQe(Wf);function OQe(e){return e&&e.__esModule?e:{default:e}}var NQe={axis:en.default.oneOf(["both","x","y","none"]),className:en.default.string,children:en.default.element.isRequired,draggableOpts:en.default.shape({allowAnyClick:en.default.bool,cancel:en.default.string,children:en.default.node,disabled:en.default.bool,enableUserSelectHack:en.default.bool,offsetParent:en.default.node,grid:en.default.arrayOf(en.default.number),handle:en.default.string,nodeRef:en.default.object,onStart:en.default.func,onDrag:en.default.func,onStop:en.default.func,onMouseDown:en.default.func,scale:en.default.number}),height:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var a=n[0];if(a.axis==="both"||a.axis==="y"){var i;return(i=en.default.number).isRequired.apply(i,n)}return en.default.number.apply(en.default,n)},handle:en.default.oneOfType([en.default.node,en.default.func]),handleSize:en.default.arrayOf(en.default.number),lockAspectRatio:en.default.bool,maxConstraints:en.default.arrayOf(en.default.number),minConstraints:en.default.arrayOf(en.default.number),onResizeStop:en.default.func,onResizeStart:en.default.func,onResize:en.default.func,resizeHandles:en.default.arrayOf(en.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:en.default.number,width:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var a=n[0];if(a.axis==="both"||a.axis==="x"){var i;return(i=en.default.number).isRequired.apply(i,n)}return en.default.number.apply(en.default,n)}};Kg.resizableProps=NQe;jg.__esModule=!0;jg.default=void 0;var Tm=MQe(x),IQe=vQe,wQe=$D,DQe=Kg,LQe=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function bte(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(bte=function(a){return a?n:t})(e)}function MQe(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=bte(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var o=a?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(r,i,o):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function $4(){return $4=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$4.apply(this,arguments)}function kQe(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,i;for(i=0;i<r.length;i++)a=r[i],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function SH(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function tN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?SH(Object(n),!0).forEach(function(r){PQe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SH(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function PQe(e,t,n){return t=FQe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function FQe(e){var t=BQe(e,"string");return typeof t=="symbol"?t:String(t)}function BQe(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function UQe(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,z4(e,t)}function z4(e,t){return z4=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},z4(e,t)}var zD=function(e){UQe(t,e);function t(){for(var r,a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return r=e.call.apply(e,[this].concat(i))||this,r.handleRefs={},r.lastHandleRect=null,r.slack=null,r}var n=t.prototype;return n.componentWillUnmount=function(){this.resetData()},n.resetData=function(){this.lastHandleRect=this.slack=null},n.runConstraints=function(a,i){var o=this.props,s=o.minConstraints,l=o.maxConstraints,c=o.lockAspectRatio;if(!s&&!l&&!c)return[a,i];if(c){var u=this.props.width/this.props.height,p=a-this.props.width,f=i-this.props.height;Math.abs(p)>Math.abs(f*u)?i=a/u:a=i*u}var h=a,g=i,E=this.slack||[0,0],y=E[0],b=E[1];return a+=y,i+=b,s&&(a=Math.max(s[0],a),i=Math.max(s[1],i)),l&&(a=Math.min(l[0],a),i=Math.min(l[1],i)),this.slack=[y+(h-a),b+(g-i)],[a,i]},n.resizeHandler=function(a,i){var o=this;return function(s,l){var c=l.node,u=l.deltaX,p=l.deltaY;a==="onResizeStart"&&o.resetData();var f=(o.props.axis==="both"||o.props.axis==="x")&&i!=="n"&&i!=="s",h=(o.props.axis==="both"||o.props.axis==="y")&&i!=="e"&&i!=="w";if(!(!f&&!h)){var g=i[0],E=i[i.length-1],y=c.getBoundingClientRect();if(o.lastHandleRect!=null){if(E==="w"){var b=y.left-o.lastHandleRect.left;u+=b}if(g==="n"){var v=y.top-o.lastHandleRect.top;p+=v}}o.lastHandleRect=y,E==="w"&&(u=-u),g==="n"&&(p=-p);var C=o.props.width+(f?u/o.props.transformScale:0),T=o.props.height+(h?p/o.props.transformScale:0),N=o.runConstraints(C,T);C=N[0],T=N[1];var A=C!==o.props.width||T!==o.props.height,O=typeof o.props[a]=="function"?o.props[a]:null,M=a==="onResize"&&!A;O&&!M&&(s.persist==null||s.persist(),O(s,{node:c,size:{width:C,height:T},handle:i})),a==="onResizeStop"&&o.resetData()}}},n.renderResizeHandle=function(a,i){var o=this.props.handle;if(!o)return Tm.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+a,ref:i});if(typeof o=="function")return o(a,i);var s=typeof o.type=="string",l=tN({ref:i},s?{}:{handleAxis:a});return Tm.cloneElement(o,l)},n.render=function(){var a=this,i=this.props,o=i.children,s=i.className,l=i.draggableOpts;i.width,i.height,i.handle,i.handleSize,i.lockAspectRatio,i.axis,i.minConstraints,i.maxConstraints,i.onResize,i.onResizeStop,i.onResizeStart;var c=i.resizeHandles;i.transformScale;var u=kQe(i,LQe);return(0,wQe.cloneElement)(o,tN(tN({},u),{},{className:(s?s+" ":"")+"react-resizable",children:[].concat(o.props.children,c.map(function(p){var f,h=(f=a.handleRefs[p])!=null?f:a.handleRefs[p]=Tm.createRef();return Tm.createElement(IQe.DraggableCore,$4({},l,{nodeRef:h,key:"resizableHandle-"+p,onStop:a.resizeHandler("onResizeStop",p),onStart:a.resizeHandler("onResizeStart",p),onDrag:a.resizeHandler("onResize",p)}),a.renderResizeHandle(p,h))}))}))},t}(Tm.Component);jg.default=zD;zD.propTypes=DQe.resizableProps;zD.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var Vy={};Vy.__esModule=!0;Vy.default=void 0;var nN=VQe(x),$Qe=Ste(Wf),zQe=Ste(jg),HQe=Kg,GQe=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function Ste(e){return e&&e.__esModule?e:{default:e}}function vte(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(vte=function(a){return a?n:t})(e)}function VQe(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=vte(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var o=a?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(r,i,o):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function H4(){return H4=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},H4.apply(this,arguments)}function vH(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function iS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vH(Object(n),!0).forEach(function(r){YQe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vH(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function YQe(e,t,n){return t=qQe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qQe(e){var t=WQe(e,"string");return typeof t=="symbol"?t:String(t)}function WQe(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function jQe(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,i;for(i=0;i<r.length;i++)a=r[i],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function KQe(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,G4(e,t)}function G4(e,t){return G4=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},G4(e,t)}var yte=function(e){KQe(t,e);function t(){for(var r,a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return r=e.call.apply(e,[this].concat(i))||this,r.state={width:r.props.width,height:r.props.height,propsWidth:r.props.width,propsHeight:r.props.height},r.onResize=function(s,l){var c=l.size;r.props.onResize?(s.persist==null||s.persist(),r.setState(c,function(){return r.props.onResize&&r.props.onResize(s,l)})):r.setState(c)},r}t.getDerivedStateFromProps=function(a,i){return i.propsWidth!==a.width||i.propsHeight!==a.height?{width:a.width,height:a.height,propsWidth:a.width,propsHeight:a.height}:null};var n=t.prototype;return n.render=function(){var a=this.props,i=a.handle,o=a.handleSize;a.onResize;var s=a.onResizeStart,l=a.onResizeStop,c=a.draggableOpts,u=a.minConstraints,p=a.maxConstraints,f=a.lockAspectRatio,h=a.axis;a.width,a.height;var g=a.resizeHandles,E=a.style,y=a.transformScale,b=jQe(a,GQe);return nN.createElement(zQe.default,{axis:h,draggableOpts:c,handle:i,handleSize:o,height:this.state.height,lockAspectRatio:f,maxConstraints:p,minConstraints:u,onResizeStart:s,onResize:this.onResize,onResizeStop:l,resizeHandles:g,transformScale:y,width:this.state.width},nN.createElement("div",H4({},b,{style:iS(iS({},E),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},t}(nN.Component);Vy.default=yte;yte.propTypes=iS(iS({},HQe.resizableProps),{},{children:$Qe.default.element});PD.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")};var QQe=PD.exports.Resizable=jg.default;PD.exports.ResizableBox=Vy.default;var HD={},Tte={exports:{}};(function(e){function t(n){return n&&n.__esModule?n:{default:n}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(Tte);var Qn=Tte.exports,rN={};const XQe=b3(Z2e);var yH;function Xn(){return yH||(yH=1,function(e){"use client";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.createSvgIcon}});var t=XQe}(rN)),rN}var ZQe=Qn;Object.defineProperty(HD,"__esModule",{value:!0});var Df=HD.default=void 0,JQe=ZQe(Xn()),eXe=_,tXe=(0,JQe.default)((0,eXe.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");Df=HD.default=tXe;const aN=400,nXe=x.forwardRef(function({...t},n){return delete t.handleAxis,_.jsx(_t,{sx:{boxSizing:"content-box",width:"4px",height:"24px",position:"absolute",top:"50%",marginTop:"-12px",left:0,cursor:"ew-resize",padding:"10px 5px"},ref:n,...t,children:_.jsx(_t,{sx:{boxSizing:"content-box",width:"100%",height:"100%",backgroundColor:"grey.300",borderRadius:"4px"}})})}),rXe=()=>{const[e,t]=x.useState(!1),[n,r]=x.useState(aN),[a,i]=xa(mv),o=(c,u)=>r(u.size.width),{width:s}=_We(),l=wg(c=>c.breakpoints.down("sm"));return n<aN&&l&&r(aN),_.jsx(QQe,{width:n,height:0,onResize:o,onResizeStart:()=>t(!0),onResizeStop:()=>t(!1),resizeHandles:["w"],handle:l?_.jsx(_.Fragment,{}):_.jsx(nXe,{}),axis:"x",minConstraints:[100,0],maxConstraints:[s/2,0],children:_.jsxs(aXe,{anchor:"right",isSmallScreen:l,open:!!a,variant:l?"temporary":"persistent",width:n,children:[_.jsxs(kt,{direction:"row",alignItems:"center",children:[_.jsx(fn,{noWrap:!0,fontSize:"20px",fontWeight:500,id:"side-view-title",children:a==null?void 0:a.name}),_.jsx(zn,{edge:"end",sx:{ml:"auto"},onClick:()=>i(void 0),children:_.jsx(Df,{})})]}),_.jsx(_t,{mt:"1.5rem",id:"side-view-content",sx:{height:"100%",pointerEvents:e?"none":"auto"},children:_.jsx(lte,{element:a})})]})})},aXe=je(_Q,{shouldForwardProp:e=>e!=="isSmallScreen"})(({theme:e,open:t,width:n,isSmallScreen:r})=>({width:n,flexShrink:0,display:t?"flex":"none","& .MuiDrawer-paper":{position:"inherit",width:n,maxWidth:r?"80%":"100%",backgroundColor:e.palette.background.paper,borderLeft:`1px solid ${e.palette.divider}`,flexDirection:"column",borderRadius:0,color:e.palette.text.primary,whiteSpace:"nowrap",boxSizing:"border-box",padding:"1.5rem",paddingTop:".5rem",overflowX:"hidden"}}));var GD={},iXe=Qn;Object.defineProperty(GD,"__esModule",{value:!0});var Cte=GD.default=void 0,oXe=iXe(Xn()),sXe=_,lXe=(0,oXe.default)((0,sXe.jsx)("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"}),"ArrowBack");Cte=GD.default=lXe;const du=()=>{var e;return((e=window.theme)==null?void 0:e.layout)==="wide"?"min(60rem, 100vw)":"min(48rem, 100vw)"},cXe=({element:e,onGoBack:t})=>{const n=du();return _.jsxs(_t,{display:"flex",flexDirection:"column",flexGrow:1,p:3,gap:2,boxSizing:"border-box",mx:"auto",sx:{width:"100%",maxWidth:n,color:"text.primary"},id:"element-view",children:[_.jsxs(kt,{direction:"row",gap:1,children:[t?_.jsx(zn,{edge:"start",onClick:t,children:_.jsx(Cte,{})}):null,_.jsx(fn,{fontWeight:700,fontSize:"25px",children:e.name})]}),_.jsx(lte,{element:e})]})},uXe=({items:e})=>_.jsx(kt,{spacing:1,children:e.map((t,n)=>_.jsx(_t,{pt:.5,children:_.jsx(zQ,{element:t})},n))}),dXe=({items:e})=>_.jsx(kt,{spacing:1,direction:"row",children:e.map((t,n)=>_.jsx("div",{children:_.jsx(WQ,{element:t})},n))}),TH=e=>{switch(e.size){case"small":return 1;case"medium":return 2;case"large":return 4;default:return 2}},Rte=({elements:e,renderElement:t})=>_.jsx(F4e,{sx:{margin:0,transform:"translateZ(0)",width:"100%",maxWidth:600,overflowY:"hidden"},variant:"quilted",cols:4,gap:8,children:e.map((n,r)=>{const a=TH(n),i=TH(n);return _.jsx(V4e,{cols:a,rows:i,children:_.jsx(t,{element:n})},r)})}),pXe=({items:e})=>_.jsx(Rte,{elements:e,renderElement:t=>_.jsx(jQ,{element:t.element})}),fXe=({items:e})=>_.jsx(kt,{spacing:1,children:e.map((t,n)=>_.jsx("div",{style:{maxWidth:"600px",height:"400px"},children:_.jsx(KQ,{element:t})},n))}),mXe=({items:e})=>_.jsx(kt,{spacing:1,children:e.map((t,n)=>_.jsx("div",{style:{maxWidth:"600px",height:"400px"},children:_.jsx(sX,{element:t})},n))}),hXe=({items:e})=>_.jsx(kt,{spacing:1,children:e.map((t,n)=>_.jsxs(ms,{color:"info",icon:!1,children:[_.jsx(hxe,{children:t.name}),_.jsx(Ree,{element:t})]},n))}),gXe=({items:e})=>_.jsx(Rte,{elements:e,renderElement:t=>_.jsx(ste,{element:t.element})}),_Xe=({elements:e})=>{var n,r,a,i,o,s,l;if(!e.length)return null;const t=e.reduce((c,u)=>(c[u.type]||(c[u.type]=[]),c[u.type].push(u),c),{});return _.jsxs(kt,{gap:1,mt:1,children:[(n=t.image)!=null&&n.length?_.jsx(pXe,{items:t.image}):null,(r=t.text)!=null&&r.length?_.jsx(hXe,{items:t.text}):null,(a=t.pdf)!=null&&a.length?_.jsx(fXe,{items:t.pdf}):null,(i=t.audio)!=null&&i.length?_.jsx(uXe,{items:t.audio}):null,(o=t.video)!=null&&o.length?_.jsx(gXe,{items:t.video}):null,(s=t.file)!=null&&s.length?_.jsx(dXe,{items:t.file}):null,(l=t.plotly)!=null&&l.length?_.jsx(mXe,{items:t.plotly}):null]})};function EXe(){if(console&&console.warn){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];typeof t[0]=="string"&&(t[0]=`react-i18next:: ${t[0]}`),console.warn(...t)}}const CH={};function V4(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];typeof t[0]=="string"&&CH[t[0]]||(typeof t[0]=="string"&&(CH[t[0]]=new Date),EXe(...t))}const xte=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}};function RH(e,t,n){e.loadNamespaces(t,xte(e,n))}function xH(e,t,n,r){typeof n=="string"&&(n=[n]),n.forEach(a=>{e.options.ns.indexOf(a)<0&&e.options.ns.push(a)}),e.loadLanguages(t,xte(e,r))}function bXe(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=t.languages[0],a=t.options?t.options.fallbackLng:!1,i=t.languages[t.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const o=(s,l)=>{const c=t.services.backendConnector.state[`${s}|${l}`];return c===-1||c===2};return n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!o(t.isLanguageChangingTo,e)?!1:!!(t.hasResourceBundle(r,e)||!t.services.backendConnector.backend||t.options.resources&&!t.options.partialBundledLanguages||o(r,e)&&(!a||o(i,e)))}function SXe(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return!t.languages||!t.languages.length?(V4("i18n.languages were undefined or empty",t.languages),!0):t.options.ignoreJSONStructure!==void 0?t.hasLoadedNamespace(e,{lng:n.lng,precheck:(a,i)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&a.services.backendConnector.backend&&a.isLanguageChangingTo&&!i(a.isLanguageChangingTo,e))return!1}}):bXe(e,t,n)}const vXe=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,yXe={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},TXe=e=>yXe[e],CXe=e=>e.replace(vXe,TXe);let Y4={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:CXe};function RXe(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Y4={...Y4,...e}}function xXe(){return Y4}let Ate;function AXe(e){Ate=e}function OXe(){return Ate}const NXe={type:"3rdParty",init(e){RXe(e.options.react),AXe(e)}},IXe=x.createContext();class wXe{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const DXe=(e,t)=>{const n=x.useRef();return x.useEffect(()=>{n.current=t?n.current:e},[e,t]),n.current};function Yy(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{i18n:n}=t,{i18n:r,defaultNS:a}=x.useContext(IXe)||{},i=n||r||OXe();if(i&&!i.reportNamespaces&&(i.reportNamespaces=new wXe),!i){V4("You will need to pass in an i18next instance by using initReactI18next");const C=(N,A)=>typeof A=="string"?A:A&&typeof A=="object"&&typeof A.defaultValue=="string"?A.defaultValue:Array.isArray(N)?N[N.length-1]:N,T=[C,{},!1];return T.t=C,T.i18n={},T.ready=!1,T}i.options.react&&i.options.react.wait!==void 0&&V4("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const o={...xXe(),...i.options.react,...t},{useSuspense:s,keyPrefix:l}=o;let c=e||a||i.options&&i.options.defaultNS;c=typeof c=="string"?[c]:c||["translation"],i.reportNamespaces.addUsedNamespaces&&i.reportNamespaces.addUsedNamespaces(c);const u=(i.isInitialized||i.initializedStoreOnce)&&c.every(C=>SXe(C,i,o));function p(){return i.getFixedT(t.lng||null,o.nsMode==="fallback"?c:c[0],l)}const[f,h]=x.useState(p);let g=c.join();t.lng&&(g=`${t.lng}${g}`);const E=DXe(g),y=x.useRef(!0);x.useEffect(()=>{const{bindI18n:C,bindI18nStore:T}=o;y.current=!0,!u&&!s&&(t.lng?xH(i,t.lng,c,()=>{y.current&&h(p)}):RH(i,c,()=>{y.current&&h(p)})),u&&E&&E!==g&&y.current&&h(p);function N(){y.current&&h(p)}return C&&i&&i.on(C,N),T&&i&&i.store.on(T,N),()=>{y.current=!1,C&&i&&C.split(" ").forEach(A=>i.off(A,N)),T&&i&&T.split(" ").forEach(A=>i.store.off(A,N))}},[i,g]);const b=x.useRef(!0);x.useEffect(()=>{y.current&&!b.current&&h(p),b.current=!1},[i,l]);const v=[f,i,u];if(v.t=f,v.i18n=i,v.ready=u,u||!u&&!s)return v;throw new Promise(C=>{t.lng?xH(i,t.lng,c,()=>C()):RH(i,c,()=>C())})}const Pt=({path:e,options:t,suffix:n})=>{const{t:r,i18n:a}=Yy();return a.exists(e,t)?_.jsxs("span",{children:[r(e,t),n]}):_.jsx(Bc,{variant:"text",width:20})},ql=()=>{const{t:e,ready:t,i18n:n}=Yy();return{t:(r,a)=>n.exists(r,a)?e(r,a):"...",ready:t,i18n:n}},qy={fontFamily:["Inter","sans-serif"].join(",")},Wy={MuiButton:{defaultProps:{disableElevation:!0,disableRipple:!0,sx:{textTransform:"none"}}},MuiLink:{defaultProps:{fontWeight:500}},MuiFormHelperText:{defaultProps:{sx:{m:0,fontWeight:400,color:Mt[500]}}},MuiTooltip:{styleOverrides:{tooltip:{backgroundColor:"black"}}}},jy={borderRadius:8},Ote={main:M5[500],contrastText:xl},Nte={main:"rgba(239, 65, 70, 1)",contrastText:xl},LXe=(e,t)=>Kf({typography:e?{fontFamily:e}:qy,components:Wy,shape:jy,breakpoints:t,palette:{mode:"dark",success:Ote,error:Nte,background:{default:Mt[850],paper:Mt[900]},primary:{main:"#F80061",dark:El[800],light:"#FFE7EB",contrastText:xl},secondary:{main:"#9757D7",dark:"#763FB8",light:"#B87FE7",contrastText:xl},divider:Mt[800],text:{primary:Mt[200],secondary:Mt[400]}}}),MXe=(e,t)=>Kf({typography:e?{fontFamily:e}:qy,components:Wy,shape:jy,breakpoints:t,palette:{mode:"light",success:Ote,error:Nte,background:{default:Mt[50],paper:xl},primary:{main:"#F80061",dark:El[800],light:"#FFE7EB",contrastText:xl},secondary:{main:"#9757D7",dark:"#763FB8",light:"#B87FE7",contrastText:xl},divider:Mt[200],text:{primary:Mt[900],secondary:Mt[700]}}}),kXe=(e,t,n)=>e==="dark"?LXe(t,n):MXe(t,n);Kf({typography:qy,components:Wy,shape:jy,palette:{primary:{main:Mt[900]}}});Kf({typography:qy,components:Wy,shape:jy,palette:{primary:{main:Mt[200]}}});const PXe=({status:e})=>e==="running"?_.jsx(_t,{sx:{marginTop:"-2px",width:"24px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center",color:Mt[700]},children:_.jsx(Ag,{color:"inherit",size:18})}):_.jsxs(la,{width:24,height:24,sx:{marginTop:"-2px",fill:"none"},children:[e==="done"&&_.jsxs(_.Fragment,{children:[_.jsx("circle",{cx:12,cy:12,r:9,fill:M5[500]}),_.jsx("path",{stroke:xl,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"m15.333 9.5-4.583 4.583L8.667 12"})]}),e==="ready"&&_.jsx("circle",{cx:12,cy:12,r:8.25,stroke:Mt[700],strokeWidth:1.5}),e==="failed"&&_.jsxs(_.Fragment,{children:[_.jsx("circle",{cx:12,cy:12,r:9,fill:El[500]}),_.jsx("path",{stroke:xl,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"m14.5 9.5-5 5m0-5 5 5"})]})]}),AH=({index:e,task:t})=>{const n=Tn(Tee),r=da();return _.jsx(t4,{disableGutters:!0,className:`task task-status-${t.status}`,children:_.jsxs(V3e,{disableRipple:!t.forId,sx:{color:{ready:r.palette.mode==="dark"?Mt[300]:Mt[700],running:r.palette.mode==="dark"?Mt[100]:Mt[850],done:Mt[500],failed:Mt[500]}[t.status]||r.palette.text.secondary,fontWeight:t.status==="running"?"700":"500",alignItems:"flex-start",fontSize:"14px",lineHeight:1.36,cursor:t.forId?"pointer":"default"},onClick:()=>{if(t.forId){n(t.forId);const a=document.getElementById(`message-${t.forId}`);a&&a.scrollIntoView({behavior:"smooth",block:"start",inline:"start"})}},children:[_.jsx(_t,{sx:{paddingRight:r.spacing(1),flex:"0 0 18px",width:"18px"},children:e}),_.jsx(PXe,{status:t.status}),_.jsx(_t,{sx:{paddingLeft:r.spacing(2)},children:t.title})]})})},OH=({status:e})=>{const t=da();return _.jsxs(_t,{sx:{display:"flex",alignItems:"center",flexDirection:"row",padding:t.spacing(2)},children:[_.jsx(_t,{sx:{flexGrow:"1",fontWeight:"600",paddingLeft:t.spacing(1),fontFamily:t.typography.fontFamily},children:_.jsx(Pt,{path:"components.molecules.tasklist.TaskList.title"})}),_.jsx(x5,{label:e||"?",sx:{fontWeight:"500",borderRadius:"4px",backgroundColor:t.palette.background.default,color:t.palette.mode==="dark"?Mt[500]:Mt[600]}})]})},NH=e=>({background:e.palette.background.paper,borderLeft:`1px solid ${e.palette.divider}`,width:"100%",display:"flex",flexDirection:"column",fontFamily:e.typography.fontFamily,boxShadow:e.palette.mode==="dark"?"0px 4px 20px 0px rgba(0, 0, 0, 0.20)":"0px 4px 20px 0px rgba(0, 0, 0, 0.05)"}),Ite=({isMobile:e})=>{const t=da(),{tasklists:n}=au(),r=yt(ca),a=n[n.length-1],i=x.useMemo(()=>{if(!(a!=null&&a.url))return null;const p=new URL(a.url);return p.pathname+p.search},[a==null?void 0:a.url]),{isLoading:o,error:s,data:l}=gf(r,i||null,{keepPreviousData:!0});if(!i)return null;if(o&&!l)return _.jsx("div",{children:_.jsx(Pt,{path:"components.molecules.tasklist.TaskList.loading"})});if(s)return _.jsx("div",{children:_.jsx(Pt,{path:"components.molecules.tasklist.TaskList.error"})});const c=l;if(!c)return null;const u=c.tasks;if(e){let p=u.length-1;for(let h=0;h<u.length;h++)if(u[h].status==="running"||u[h].status==="ready"){p=h;break}const f=u==null?void 0:u[p];return _.jsx(_t,{component:"aside",sx:{color:t.palette.text.primary,padding:t.spacing(2),width:"100%",boxSizing:"border-box",display:{xs:"flex",md:"none"}},className:"tasklist tasklist-mobile",children:_.jsxs(_t,{sx:{...NH(t)},children:[_.jsx(OH,{status:c.status}),f&&_.jsx(Hb,{children:_.jsx(AH,{index:p+1,task:f})})]})})}return _.jsx(_t,{component:"aside",sx:{color:t.palette.text.primary,width:"380px",flexShrink:"0",display:{xs:"none",md:"flex"}},className:"tasklist tasklist-desktop",children:_.jsxs(_t,{sx:{...NH(t)},children:[_.jsx(OH,{status:c==null?void 0:c.status}),_.jsx(_t,{sx:{overflowY:"auto"},children:_.jsx(Hb,{children:u==null?void 0:u.map((p,f)=>_.jsx(AH,{index:f+1,task:p},f))})})]})})},FXe=e=>_.jsx(la,{children:_.jsxs("svg",{...e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[_.jsx("path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"}),_.jsx("circle",{cx:"12",cy:"7",r:"4"})]})});function BXe(e){var n,r,a;const{user:t}=gs();return _.jsx(zn,{...e,children:_.jsx(O5,{sx:{width:32,height:32,bgcolor:"primary.main",color:"primary.contrastText"},src:((n=t==null?void 0:t.metadata)==null?void 0:n.image)||void 0,children:t?(a=(r=t.identifier)==null?void 0:r[0])==null?void 0:a.toUpperCase():_.jsx(FXe,{sx:{height:20,width:20}})})})}var VD={},UXe=Qn;Object.defineProperty(VD,"__esModule",{value:!0});var wte=VD.default=void 0,$Xe=UXe(Xn()),zXe=_,HXe=(0,$Xe.default)((0,zXe.jsx)("path",{d:"M9.37 5.51c-.18.64-.27 1.31-.27 1.99 0 4.08 3.32 7.4 7.4 7.4.68 0 1.35-.09 1.99-.27C17.45 17.19 14.93 19 12 19c-3.86 0-7-3.14-7-7 0-2.93 1.81-5.45 4.37-6.49zM12 3c-4.97 0-9 4.03-9 9s4.03 9 9 9 9-4.03 9-9c0-.46-.04-.92-.1-1.36-.98 1.37-2.58 2.26-4.4 2.26-2.98 0-5.4-2.42-5.4-5.4 0-1.81.89-3.42 2.26-4.4-.44-.06-.9-.1-1.36-.1z"}),"DarkModeOutlined");wte=VD.default=HXe;var YD={},GXe=Qn;Object.defineProperty(YD,"__esModule",{value:!0});var Dte=YD.default=void 0,VXe=GXe(Xn()),YXe=_,qXe=(0,VXe.default)((0,YXe.jsx)("path",{d:"M21 10h-8.35C11.83 7.67 9.61 6 7 6c-3.31 0-6 2.69-6 6s2.69 6 6 6c2.61 0 4.83-1.67 5.65-4H13l2 2 2-2 2 2 4-4.04L21 10zM7 15c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3z"}),"Key");Dte=YD.default=qXe;var qD={},WXe=Qn;Object.defineProperty(qD,"__esModule",{value:!0});var Lte=qD.default=void 0,jXe=WXe(Xn()),KXe=_,QXe=(0,jXe.default)((0,KXe.jsx)("path",{d:"m17 7-1.41 1.41L18.17 11H8v2h10.17l-2.58 2.58L17 17l5-5zM4 5h8V3H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h8v-2H4V5z"}),"Logout");Lte=qD.default=QXe;var WD={},XXe=Qn;Object.defineProperty(WD,"__esModule",{value:!0});var Mte=WD.default=void 0,ZXe=XXe(Xn()),JXe=_,eZe=(0,ZXe.default)((0,JXe.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"}),"Info");Mte=WD.default=eZe;const kte=({count:e,inputProps:t})=>{const n=da();return e?t?(()=>{const i=o=>{const s=e.toString();let l=s.length*8+(o?22:0);return(s.includes(".")||s.includes(","))&&(l-=6),`${l}px`};return t?_.jsx(Lg,{id:t.id,inputProps:{type:"number",max:t.max,min:t.min,step:t.step||1,sx:{width:i(),padding:o=>o.spacing(.5,1),fontSize:"12px",fontWeight:600,color:"text.secondary",MozAppearance:"textfield","&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{display:"none"},"&:focus":{width:i(!0),MozAppearance:"auto","&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{display:"flex"}}}},sx:{borderRadius:"6px",backgroundColor:o=>o.palette.mode==="light"?"grey.100":"grey.800","& fieldset":{border:"none"}},value:e,onChange:t.onChange}):null})():(()=>_.jsx(_t,{display:"flex",alignItems:"center",className:"notification-count",sx:{borderRadius:"6px",padding:"4px 8px",backgroundColor:n.palette.mode==="light"?"grey.100":"grey.800"},children:_.jsx(fn,{className:"notification-count",color:"text.secondary",sx:{fontSize:"12px",fontWeight:600},children:e})}))():null},tZe=({id:e,label:t,tooltip:n,notificationsProps:r})=>_.jsxs(_t,{display:"flex",justifyContent:"space-between",width:"100%",children:[_.jsxs(_t,{display:"flex",gap:.5,alignItems:"center",children:[_.jsx(OQ,{htmlFor:e,sx:{fontWeight:600,fontSize:"12px",color:"grey.500"},children:t}),n?_.jsx(Ca,{title:n,children:_.jsx(Mte,{sx:{fontSize:12,color:"grey.600"}})}):null]}),r?_.jsx(kte,{...r}):null]}),Qg=e=>{const{children:t,description:n,hasError:r,id:a,label:i,notificationsProps:o,tooltip:s,sx:l}=e;return _.jsxs(kt,{sx:l,gap:.5,children:[i?_.jsx(tZe,{id:a,label:i,tooltip:s,notificationsProps:o}):null,_.jsxs(SQ,{error:r,fullWidth:!0,children:[t,n?_.jsx(vQ,{children:n}):null]})]})},Pte=e=>{const{checked:t,description:n,disabled:r,hasError:a,id:i,inputProps:o,label:s,onChange:l,tooltip:c}=e;return _.jsx(Qg,{description:n,hasError:a,id:i,label:s,tooltip:c,children:_.jsx(nZe,{name:i,disabled:r,edge:"end",onChange:l,checked:t,inputProps:o})})},nZe=je(e=>_.jsx(dDe,{focusVisibleClassName:".Mui-focusVisible",disableRipple:!0,...e}))(({theme:e})=>{const t=e.palette.mode==="dark";return{width:40,height:24,padding:0,"& .MuiSwitch-switchBase":{margin:0,padding:"4px",transitionDuration:"300ms","&.Mui-checked":{transform:"translateX(16px)",color:"#fff","& + .MuiSwitch-track":{backgroundColor:M5[500],opacity:1,border:0},"&.Mui-disabled + .MuiSwitch-track":{opacity:.5}},"&.Mui-disabled .MuiSwitch-thumb":{color:t?e.palette.grey[600]:e.palette.grey[100]},"&.Mui-disabled + .MuiSwitch-track":{opacity:t?.3:.7}},"& .MuiSwitch-thumb":{boxSizing:"border-box",width:16,height:16,boxShadow:"unset"},"& .MuiSwitch-track":{borderRadius:26/2,backgroundColor:e.palette.grey[400],opacity:1,transition:e.transitions.create(["background-color"],{duration:500})}}});var PV;const rZe=((PV=window.theme)==null?void 0:PV.default)||"dark",IH=localStorage.getItem("themeVariant"),aZe=IH||rZe,iZe={open:!1,defaultCollapseContent:!0,isChatHistoryOpen:!0,language:"en-US",theme:aZe},Wl=kn({key:"AppSettings",default:iZe});function oZe({anchorEl:e,open:t,handleClose:n}){var E;const{user:r,logout:a}=gs(),[i,o]=xa(Wl),s=yt(Zr),l=!!((E=s==null?void 0:s.userEnv)!=null&&E.length),c=r&&_.jsxs(t4,{sx:{display:"flex",flexDirection:"column"},children:[_.jsx(fn,{width:"100%",fontSize:"14px",fontWeight:700,children:r.id}),_.jsx(fn,{width:"100%",fontSize:"13px",fontWeight:400,children:r.identifier})]},"user-name"),u=_.jsxs(t4,{sx:{display:"flex",gap:1},children:[_.jsx(x2,{children:_.jsx(wte,{})}),_.jsx(hwe,{id:"switch-theme",secondary:_.jsx(Pt,{path:"components.molecules.settingsModal.darkMode"})}),_.jsx(_t,{children:_.jsx(Pte,{id:"switch-theme",onChange:()=>{const y=i.theme==="light"?"dark":"light";localStorage.setItem("themeVariant",y),o(b=>({...b,theme:y}))},checked:i.theme==="dark",inputProps:{"aria-labelledby":"switch-theme"}})})]},"theme"),h=[c,u,l&&_.jsxs(Vb,{component:Kw,to:"/env",children:[_.jsx(x2,{children:_.jsx(Dte,{fontSize:"small"})}),_.jsx(Pt,{path:"components.atoms.buttons.userButton.menu.APIKeys"})]},"env"),r&&_.jsxs(Vb,{onClick:()=>{a(),n()},children:[_.jsx(x2,{children:_.jsx(Lte,{fontSize:"small"})}),_.jsx(Pt,{path:"components.atoms.buttons.userButton.menu.logout"})]},"logout")].filter(y=>!!y),g=h.reduce((y,b,v)=>v===h.length-1?[...y,b]:[...y,b,_.jsx(mQ,{sx:{my:1}},`divider-${v}`)],[]);return _.jsx(Dg,{anchorEl:e,id:"account-menu",open:t,onClose:n,PaperProps:{sx:{width:220,overflow:"visible",mt:1.5,backgroundImage:"none",border:y=>`1px solid ${y.palette.divider}`,boxShadow:y=>y.palette.mode==="light"?"0px 2px 4px 0px #0000000D":"0px 10px 10px 0px #0000000D","& .MuiAvatar-root":{width:32,height:32,ml:-.5,mr:1},"&:before":{content:'""',display:"block",position:"absolute",top:0,right:14,width:10,height:10,bgcolor:"background.default",transform:"translateY(-50%) rotate(45deg)",zIndex:0}}},transformOrigin:{horizontal:"center",vertical:"top"},anchorOrigin:{horizontal:"center",vertical:"bottom"},children:g})}function sZe(){const[e,t]=x.useState(null),n=!!e,r=i=>{t(i.currentTarget)},a=()=>{t(null)};return _.jsxs(_.Fragment,{children:[_.jsx(BXe,{onClick:r,"aria-controls":n?"account-menu":void 0,"aria-haspopup":"true","aria-expanded":n?"true":void 0}),_.jsx(oZe,{open:n,anchorEl:e,handleClose:a})]})}const jD=({style:e})=>{const{theme:t}=yt(Wl),n=yt(ca);return _.jsx("img",{src:n.getLogoEndpoint(t),alt:"logo",style:e})};var lZe=Object.prototype;function cZe(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||lZe;return e===n}var KD=cZe;function uZe(e,t){return function(n){return e(t(n))}}var Fte=uZe,dZe=Fte,pZe=dZe(Object.keys,Object),fZe=pZe,mZe=KD,hZe=fZe,gZe=Object.prototype,_Ze=gZe.hasOwnProperty;function EZe(e){if(!mZe(e))return hZe(e);var t=[];for(var n in Object(e))_Ze.call(e,n)&&n!="constructor"&&t.push(n);return t}var Bte=EZe,bZe=typeof aa=="object"&&aa&&aa.Object===Object&&aa,Ute=bZe,SZe=Ute,vZe=typeof self=="object"&&self&&self.Object===Object&&self,yZe=SZe||vZe||Function("return this")(),Es=yZe,TZe=Es,CZe=TZe.Symbol,Xg=CZe,wH=Xg,$te=Object.prototype,RZe=$te.hasOwnProperty,xZe=$te.toString,Cm=wH?wH.toStringTag:void 0;function AZe(e){var t=RZe.call(e,Cm),n=e[Cm];try{e[Cm]=void 0;var r=!0}catch{}var a=xZe.call(e);return r&&(t?e[Cm]=n:delete e[Cm]),a}var OZe=AZe,NZe=Object.prototype,IZe=NZe.toString;function wZe(e){return IZe.call(e)}var DZe=wZe,DH=Xg,LZe=OZe,MZe=DZe,kZe="[object Null]",PZe="[object Undefined]",LH=DH?DH.toStringTag:void 0;function FZe(e){return e==null?e===void 0?PZe:kZe:LH&&LH in Object(e)?LZe(e):MZe(e)}var o0=FZe;function BZe(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var pu=BZe,UZe=o0,$Ze=pu,zZe="[object AsyncFunction]",HZe="[object Function]",GZe="[object GeneratorFunction]",VZe="[object Proxy]";function YZe(e){if(!$Ze(e))return!1;var t=UZe(e);return t==HZe||t==GZe||t==zZe||t==VZe}var zte=YZe,qZe=Es,WZe=qZe["__core-js_shared__"],jZe=WZe,iN=jZe,MH=function(){var e=/[^.]+$/.exec(iN&&iN.keys&&iN.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function KZe(e){return!!MH&&MH in e}var QZe=KZe,XZe=Function.prototype,ZZe=XZe.toString;function JZe(e){if(e!=null){try{return ZZe.call(e)}catch{}try{return e+""}catch{}}return""}var Hte=JZe,eJe=zte,tJe=QZe,nJe=pu,rJe=Hte,aJe=/[\\^$.*+?()[\]{}|]/g,iJe=/^\[object .+?Constructor\]$/,oJe=Function.prototype,sJe=Object.prototype,lJe=oJe.toString,cJe=sJe.hasOwnProperty,uJe=RegExp("^"+lJe.call(cJe).replace(aJe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function dJe(e){if(!nJe(e)||tJe(e))return!1;var t=eJe(e)?uJe:iJe;return t.test(rJe(e))}var pJe=dJe;function fJe(e,t){return e==null?void 0:e[t]}var mJe=fJe,hJe=pJe,gJe=mJe;function _Je(e,t){var n=gJe(e,t);return hJe(n)?n:void 0}var Od=_Je,EJe=Od,bJe=Es,SJe=EJe(bJe,"DataView"),vJe=SJe,yJe=Od,TJe=Es,CJe=yJe(TJe,"Map"),QD=CJe,RJe=Od,xJe=Es,AJe=RJe(xJe,"Promise"),OJe=AJe,NJe=Od,IJe=Es,wJe=NJe(IJe,"Set"),Gte=wJe,DJe=Od,LJe=Es,MJe=DJe(LJe,"WeakMap"),kJe=MJe,q4=vJe,W4=QD,j4=OJe,K4=Gte,Q4=kJe,Vte=o0,s0=Hte,kH="[object Map]",PJe="[object Object]",PH="[object Promise]",FH="[object Set]",BH="[object WeakMap]",UH="[object DataView]",FJe=s0(q4),BJe=s0(W4),UJe=s0(j4),$Je=s0(K4),zJe=s0(Q4),Mu=Vte;(q4&&Mu(new q4(new ArrayBuffer(1)))!=UH||W4&&Mu(new W4)!=kH||j4&&Mu(j4.resolve())!=PH||K4&&Mu(new K4)!=FH||Q4&&Mu(new Q4)!=BH)&&(Mu=function(e){var t=Vte(e),n=t==PJe?e.constructor:void 0,r=n?s0(n):"";if(r)switch(r){case FJe:return UH;case BJe:return kH;case UJe:return PH;case $Je:return FH;case zJe:return BH}return t});var Zg=Mu,HJe=9007199254740991;function GJe(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=HJe}var XD=GJe,VJe=zte,YJe=XD;function qJe(e){return e!=null&&YJe(e.length)&&!VJe(e)}var Jg=qJe,WJe=Array.isArray,bs=WJe;function jJe(e){return e!=null&&typeof e=="object"}var fu=jJe,KJe=o0,QJe=bs,XJe=fu,ZJe="[object String]";function JJe(e){return typeof e=="string"||!QJe(e)&&XJe(e)&&KJe(e)==ZJe}var eet=JJe;function tet(e){return function(t){return t==null?void 0:t[e]}}var Yte=tet,net=Yte,ret=net("length"),aet=ret,iet="\\ud800-\\udfff",oet="\\u0300-\\u036f",set="\\ufe20-\\ufe2f",cet="\\u20d0-\\u20ff",uet=oet+set+cet,det="\\ufe0e\\ufe0f",pet="\\u200d",fet=RegExp("["+pet+iet+uet+det+"]");function met(e){return fet.test(e)}var ZD=met,qte="\\ud800-\\udfff",het="\\u0300-\\u036f",get="\\ufe20-\\ufe2f",_et="\\u20d0-\\u20ff",Eet=het+get+_et,bet="\\ufe0e\\ufe0f",vet="["+qte+"]",X4="["+Eet+"]",Z4="\\ud83c[\\udffb-\\udfff]",yet="(?:"+X4+"|"+Z4+")",Wte="[^"+qte+"]",jte="(?:\\ud83c[\\udde6-\\uddff]){2}",Kte="[\\ud800-\\udbff][\\udc00-\\udfff]",Tet="\\u200d",Qte=yet+"?",Xte="["+bet+"]?",Cet="(?:"+Tet+"(?:"+[Wte,jte,Kte].join("|")+")"+Xte+Qte+")*",Ret=Xte+Qte+Cet,xet="(?:"+[Wte+X4+"?",X4,jte,Kte,vet].join("|")+")",$H=RegExp(Z4+"(?="+Z4+")|"+xet+Ret,"g");function Aet(e){for(var t=$H.lastIndex=0;$H.test(e);)++t;return t}var Oet=Aet,Net=aet,Iet=ZD,wet=Oet;function Det(e){return Iet(e)?wet(e):Net(e)}var Let=Det,Met=Bte,ket=Zg,Pet=Jg,Fet=eet,Bet=Let,Uet="[object Map]",$et="[object Set]";function zet(e){if(e==null)return 0;if(Pet(e))return Fet(e)?Bet(e):e.length;var t=ket(e);return t==Uet||t==$et?e.size:Met(e).length}var Het=zet;const Zte=Aa(Het),gE=(e,...t)=>{const n={...e};for(const r of t)delete n[r];return n},Get=({description:e,hasError:t,id:n,label:r,tooltip:a,setField:i,...o})=>{var l;const s=c=>{const u=parseFloat(c.target.value),{min:p,max:f,onChange:h}=o;f&&u>f?i&&i(n,f):p&&u<p?i&&i(n,p):h&&h(c,u,0)};return _.jsx(Qg,{description:e,hasError:t,id:n,label:r,tooltip:a,notificationsProps:{count:((l=o.value)==null?void 0:l.toString())||"0",inputProps:{id:n,max:o.max,min:o.min,step:o.step||1,onChange:s}},children:_.jsx(Vet,{...o,id:n,name:n})})},Vet=je(q5e)(({theme:e})=>{const t=e.palette.mode==="light";return{width:"calc(100% - 18px)",marginLeft:"8px",color:Mt[t?300:850],height:3,"& .MuiSlider-track":{border:"none",color:Mt[500]},"& .MuiSlider-thumb":{height:15,width:15,backgroundColor:t?Mt[600]:"white",border:`4px solid ${t?Mt[300]:Mt[800]}`,"&:focus, &:hover, &.Mui-active, &.Mui-focusVisible":{boxShadow:"inherit"},"&:before":{display:"none"}},"& .MuiSlider-valueLabel":{lineHeight:1.2,fontSize:12,background:"unset",padding:0,width:32,height:32,borderRadius:"50% 50% 50% 0",backgroundColor:"#52af77",transformOrigin:"bottom left",transform:"translate(50%, -100%) rotate(-45deg) scale(0)","&:before":{display:"none"},"&.MuiSlider-valueLabelOpen":{transform:"translate(50%, -100%) rotate(-45deg) scale(1)"},"& > *":{transform:"rotate(45deg)"}}}}),ng={enter:"Enter",backspace:"Backspace"},Yet={ime:229},qet=je(x5)(({theme:e,size:t})=>`
655
655
  max-width: 100%;
@@ -709,11 +709,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
709
709
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pne(e,t){if(e){if(typeof e=="string")return t3(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return t3(e,t)}}function t3(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Jtt(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],a=!0,i=!1,o,s;try{for(n=n.call(e);!(a=(o=n.next()).done)&&(r.push(o.value),!(t&&r.length===t));a=!0);}catch(l){i=!0,s=l}finally{try{!a&&n.return!=null&&n.return()}finally{if(i)throw s}}return r}}function ent(e){if(Array.isArray(e))return e}function JH(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function hr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?JH(Object(n),!0).forEach(function(r){n3(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):JH(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function n3(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cS(e,t){if(e==null)return{};var n=tnt(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function tnt(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,i;for(i=0;i<r.length;i++)a=r[i],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}var e6=x.forwardRef(function(e,t){var n=e.children,r=cS(e,Vtt),a=mne(r),i=a.open,o=cS(a,Ytt);return x.useImperativeHandle(t,function(){return{open:i}},[i]),Oe.createElement(x.Fragment,null,n(hr(hr({},o),{},{open:i})))});e6.displayName="Dropzone";var fne={disabled:!1,getFilesFromEvent:ftt,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0,autoFocus:!1};e6.defaultProps=fne;e6.propTypes={children:sn.func,accept:sn.objectOf(sn.arrayOf(sn.string)),multiple:sn.bool,preventDropOnDocument:sn.bool,noClick:sn.bool,noKeyboard:sn.bool,noDrag:sn.bool,noDragEventsBubbling:sn.bool,minSize:sn.number,maxSize:sn.number,maxFiles:sn.number,disabled:sn.bool,getFilesFromEvent:sn.func,onFileDialogCancel:sn.func,onFileDialogOpen:sn.func,useFsAccessApi:sn.bool,autoFocus:sn.bool,onDragEnter:sn.func,onDragLeave:sn.func,onDragOver:sn.func,onDrop:sn.func,onDropAccepted:sn.func,onDropRejected:sn.func,onError:sn.func,validator:sn.func};var r3={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function mne(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=hr(hr({},fne),e),n=t.accept,r=t.disabled,a=t.getFilesFromEvent,i=t.maxSize,o=t.minSize,s=t.multiple,l=t.maxFiles,c=t.onDragEnter,u=t.onDragLeave,p=t.onDragOver,f=t.onDrop,h=t.onDropAccepted,g=t.onDropRejected,E=t.onFileDialogCancel,y=t.onFileDialogOpen,b=t.useFsAccessApi,v=t.autoFocus,C=t.preventDropOnDocument,T=t.noClick,N=t.noKeyboard,A=t.noDrag,O=t.noDragEventsBubbling,M=t.onError,P=t.validator,D=x.useMemo(function(){return ztt(n)},[n]),$=x.useMemo(function(){return $tt(n)},[n]),V=x.useMemo(function(){return typeof y=="function"?y:eG},[y]),Z=x.useMemo(function(){return typeof E=="function"?E:eG},[E]),W=x.useRef(null),ae=x.useRef(null),he=x.useReducer(nnt,r3),q=oN(he,2),G=q[0],H=q[1],k=G.isFocused,ie=G.isFileDialogActive,j=x.useRef(typeof window<"u"&&window.isSecureContext&&b&&Utt()),F=function(){!j.current&&ie&&setTimeout(function(){if(ae.current){var oe=ae.current.files;oe.length||(H({type:"closeDialog"}),Z())}},300)};x.useEffect(function(){return window.addEventListener("focus",F,!1),function(){window.removeEventListener("focus",F,!1)}},[ae,ie,Z,j]);var le=x.useRef([]),Te=function(oe){W.current&&W.current.contains(oe.target)||(oe.preventDefault(),le.current=[])};x.useEffect(function(){return C&&(document.addEventListener("dragover",ZH,!1),document.addEventListener("drop",Te,!1)),function(){C&&(document.removeEventListener("dragover",ZH),document.removeEventListener("drop",Te))}},[W,C]),x.useEffect(function(){return!r&&v&&W.current&&W.current.focus(),function(){}},[W,v,r]);var fe=x.useCallback(function(ge){M?M(ge):console.error(ge)},[M]),Ae=x.useCallback(function(ge){ge.preventDefault(),ge.persist(),at(ge),le.current=[].concat(jtt(le.current),[ge.target]),_E(ge)&&Promise.resolve(a(ge)).then(function(oe){if(!(lS(ge)&&!O)){var re=oe.length,J=re>0&&ktt({files:oe,accept:D,minSize:o,maxSize:i,multiple:s,maxFiles:l,validator:P}),ue=re>0&&!J;H({isDragAccept:J,isDragReject:ue,isDragActive:!0,type:"setDraggedFiles"}),c&&c(ge)}}).catch(function(oe){return fe(oe)})},[a,c,fe,O,D,o,i,s,l,P]),Ce=x.useCallback(function(ge){ge.preventDefault(),ge.persist(),at(ge);var oe=_E(ge);if(oe&&ge.dataTransfer)try{ge.dataTransfer.dropEffect="copy"}catch{}return oe&&p&&p(ge),!1},[p,O]),Ne=x.useCallback(function(ge){ge.preventDefault(),ge.persist(),at(ge);var oe=le.current.filter(function(J){return W.current&&W.current.contains(J)}),re=oe.indexOf(ge.target);re!==-1&&oe.splice(re,1),le.current=oe,!(oe.length>0)&&(H({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),_E(ge)&&u&&u(ge))},[W,u,O]),ze=x.useCallback(function(ge,oe){var re=[],J=[];ge.forEach(function(ue){var ve=lne(ue,D),Ve=oN(ve,2),ot=Ve[0],qe=Ve[1],Et=cne(ue,o,i),be=oN(Et,2),Q=be[0],X=be[1],_e=P?P(ue):null;if(ot&&Q&&!_e)re.push(ue);else{var ke=[qe,X];_e&&(ke=ke.concat(_e)),J.push({file:ue,errors:ke.filter(function(He){return He})})}}),(!s&&re.length>1||s&&l>=1&&re.length>l)&&(re.forEach(function(ue){J.push({file:ue,errors:[Mtt]})}),re.splice(0)),H({acceptedFiles:re,fileRejections:J,type:"setFiles"}),f&&f(re,J,oe),J.length>0&&g&&g(J,oe),re.length>0&&h&&h(re,oe)},[H,s,D,o,i,l,f,h,g,P]),Ue=x.useCallback(function(ge){ge.preventDefault(),ge.persist(),at(ge),le.current=[],_E(ge)&&Promise.resolve(a(ge)).then(function(oe){lS(ge)&&!O||ze(oe,ge)}).catch(function(oe){return fe(oe)}),H({type:"reset"})},[a,ze,fe,O]),Le=x.useCallback(function(){if(j.current){H({type:"openDialog"}),V();var ge={multiple:s,types:$};window.showOpenFilePicker(ge).then(function(oe){return a(oe)}).then(function(oe){ze(oe,null),H({type:"closeDialog"})}).catch(function(oe){Htt(oe)?(Z(oe),H({type:"closeDialog"})):Gtt(oe)?(j.current=!1,ae.current?(ae.current.value=null,ae.current.click()):fe(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):fe(oe)});return}ae.current&&(H({type:"openDialog"}),V(),ae.current.value=null,ae.current.click())},[H,V,Z,b,ze,fe,$,s]),we=x.useCallback(function(ge){!W.current||!W.current.isEqualNode(ge.target)||(ge.key===" "||ge.key==="Enter"||ge.keyCode===32||ge.keyCode===13)&&(ge.preventDefault(),Le())},[W,Le]),Pe=x.useCallback(function(){H({type:"focus"})},[]),Me=x.useCallback(function(){H({type:"blur"})},[]),lt=x.useCallback(function(){T||(Btt()?setTimeout(Le,0):Le())},[T,Le]),it=function(oe){return r?null:oe},nt=function(oe){return N?null:it(oe)},Ge=function(oe){return A?null:it(oe)},at=function(oe){O&&oe.stopPropagation()},ct=x.useMemo(function(){return function(){var ge=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},oe=ge.refKey,re=oe===void 0?"ref":oe,J=ge.role,ue=ge.onKeyDown,ve=ge.onFocus,Ve=ge.onBlur,ot=ge.onClick,qe=ge.onDragEnter,Et=ge.onDragOver,be=ge.onDragLeave,Q=ge.onDrop,X=cS(ge,qtt);return hr(hr(n3({onKeyDown:nt(Cs(ue,we)),onFocus:nt(Cs(ve,Pe)),onBlur:nt(Cs(Ve,Me)),onClick:it(Cs(ot,lt)),onDragEnter:Ge(Cs(qe,Ae)),onDragOver:Ge(Cs(Et,Ce)),onDragLeave:Ge(Cs(be,Ne)),onDrop:Ge(Cs(Q,Ue)),role:typeof J=="string"&&J!==""?J:"presentation"},re,W),!r&&!N?{tabIndex:0}:{}),X)}},[W,we,Pe,Me,lt,Ae,Ce,Ne,Ue,N,A,r]),se=x.useCallback(function(ge){ge.stopPropagation()},[]),Fe=x.useMemo(function(){return function(){var ge=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},oe=ge.refKey,re=oe===void 0?"ref":oe,J=ge.onChange,ue=ge.onClick,ve=cS(ge,Wtt),Ve=n3({accept:D,multiple:s,type:"file",style:{display:"none"},onChange:it(Cs(J,Ue)),onClick:it(Cs(ue,se)),tabIndex:-1},re,ae);return hr(hr({},Ve),ve)}},[ae,n,s,Ue,r]);return hr(hr({},G),{},{isFocused:k&&!r,getRootProps:ct,getInputProps:Fe,rootRef:W,inputRef:ae,open:it(Le)})}function nnt(e,t){switch(t.type){case"focus":return hr(hr({},e),{},{isFocused:!0});case"blur":return hr(hr({},e),{},{isFocused:!1});case"openDialog":return hr(hr({},r3),{},{isFileDialogActive:!0});case"closeDialog":return hr(hr({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return hr(hr({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return hr(hr({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return hr({},r3);default:return e}}function eG(){}const t6=({onError:e,onResolved:t,options:n,spec:r})=>{const a=x.useCallback((u,p)=>{if(p.length>0&&(p[0].errors[0].code==="file-too-large"?e&&e(`File is larger than ${r.max_size_mb} MB`):e&&e(p[0].errors[0].message)),!!u.length)return t(u)},[r]);let i={};const o=r.accept;Array.isArray(o)?o.forEach(u=>{typeof u=="string"&&(i[u]=[])}):typeof o=="object"&&(i=o);const{getRootProps:s,getInputProps:l,isDragActive:c}=mne({onDrop:a,maxFiles:r.max_files||void 0,accept:i,maxSize:(r.max_size_mb||2)*1e6,...n});return{getInputProps:l,getRootProps:s,isDragActive:c}};function hne({open:e,handleClose:t,handleConfirm:n}){return _.jsxs(Og,{open:e,onClose:t,id:"new-chat-dialog",PaperProps:{sx:{backgroundImage:"none"}},children:[_.jsx(Ig,{id:"alert-dialog-title",children:_.jsx(Pt,{path:"components.molecules.newChatDialog.createNewChat"})}),_.jsx(Ng,{children:_.jsx(pQ,{id:"alert-dialog-description",children:_.jsx(Pt,{path:"components.molecules.newChatDialog.clearChat"})})}),_.jsxs(my,{sx:{p:2},children:[_.jsx(rne,{onClick:t,children:_.jsx(Pt,{path:"components.molecules.newChatDialog.cancel"})}),_.jsx(oS,{id:"confirm",variant:"outlined",onClick:n,autoFocus:!0,children:_.jsx(Pt,{path:"components.molecules.newChatDialog.confirm"})})]})]})}function rnt(){var N,A;const e=yt(ca),t=yt(Zr),{chatProfile:n,setChatProfile:r}=Ul(),{firstInteraction:a}=hs(),[i,o]=x.useState(null),[s,l]=x.useState(""),{clear:c}=Uo(),[u,p]=x.useState(null),[f,h]=x.useState(!1),g=no(),E=()=>{h(!1),p(null),g("/")},y=O=>{const M=O||u;if(!M)throw new Error("Retry clicking on a profile before starting a new chat");r(M),p(null),c(),E()};if(!n&&Zte(t==null?void 0:t.chatProfiles)>0&&r(t==null?void 0:t.chatProfiles[0].name),typeof t>"u"||t.chatProfiles.length<=1)return null;const b=(N=t==null?void 0:t.features)==null?void 0:N.unsafe_allow_html,v=(A=t==null?void 0:t.features)==null?void 0:A.latex,C=!!i,T=t.chatProfiles.map(O=>{var P;const M=(P=O.icon)!=null&&P.startsWith("/public")?e.buildEndpoint(O.icon):O.icon;return{label:O.name,value:O.name,icon:M?_.jsx("img",{src:M,className:"chat-profile-icon",style:{width:"24px",height:"24px",borderRadius:"50%",objectFit:"cover"}}):void 0}});return _.jsxs(_.Fragment,{children:[_.jsx(LQ,{id:"chat-profile-description",anchorEl:i,open:C,PaperProps:{sx:{boxShadow:O=>O.palette.mode==="light"?"0px 2px 4px 0px #0000000D":"0px 10px 10px 0px #0000000D",ml:2}},sx:{pointerEvents:"none",marginTop:1.5},anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},disableRestoreFocus:!0,children:_.jsx(_t,{p:2,sx:{fontFamily:O=>O.typography.fontFamily},maxWidth:"20rem",children:_.jsx(eg,{allowHtml:b,latex:v,children:s})})}),_.jsx(nne,{value:n||"",items:T,id:"chat-profile-selector",onItemMouseEnter:(O,M)=>{const P=t.chatProfiles.find(D=>D.name===M);P&&(l(P.markdown_description),o(O.currentTarget))},onItemMouseLeave:()=>o(null),onChange:O=>{const M=O.target.value;p(M),a?h(!0):y(M)},onClose:()=>o(null)}),_.jsx(hne,{open:f,handleClose:E,handleConfirm:()=>y()})]})}const ant=e=>_.jsx(la,{children:_.jsxs("svg",{...e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[_.jsx("path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),_.jsx("path",{d:"M18.375 2.625a2.121 2.121 0 1 1 3 3L12 15l-4 1 1-4Z"})]})});function int(e){const[t,n]=x.useState(!1),r=no(),{clear:a}=Uo(),i=()=>{n(!0)},o=()=>{n(!1)},s=()=>{a(),r("/"),o()};return _.jsxs(_t,{children:[_.jsx(Ca,{title:_.jsx(Pt,{path:"components.molecules.newChatButton.newChat"}),children:_.jsx(zn,{id:"new-chat-button",onClick:i,...e,children:_.jsx(ant,{sx:{height:20,width:20}})})}),_.jsx(hne,{open:t,handleClose:o,handleConfirm:s})]})}var n6={},ont=Qn;Object.defineProperty(n6,"__esModule",{value:!0});var gne=n6.default=void 0,snt=ont(Xn()),lnt=_,cnt=(0,snt.default)((0,lnt.jsx)("path",{d:"M3 18h6v-2H3v2zM3 6v2h18V6H3zm0 7h12v-2H3v2z"}),"Sort");gne=n6.default=cnt;const unt=()=>{const e=Tn(Wl);return _.jsx(_t,{children:_.jsx(zn,{onClick:()=>e(t=>({...t,isChatHistoryOpen:!0})),children:_.jsx(gne,{})})})},_ne=x.memo(()=>{const e=wg("(max-width: 66rem)"),{isChatHistoryOpen:t}=yt(Wl);return _.jsxs(_t,{px:1,py:1,display:"flex",height:"45px",alignItems:"center",flexDirection:"row",justifyContent:"space-between",color:"text.primary",gap:2,id:"header",position:"relative",children:[_.jsx(_t,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"},children:_.jsx(rnt,{})}),e?_.jsx(unt,{}):t?null:_.jsx(jD,{style:{maxHeight:"25px",marginLeft:"8px"}}),_.jsx(_t,{}),_.jsxs(kt,{direction:"row",alignItems:"center",children:[_.jsx(int,{}),_.jsx(sZe,{})]})]})}),dnt=e=>_.jsx(la,{...e,viewBox:"0 0 98 96",children:_.jsx("path",{d:"M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z"})});function pnt({...e}){const t=yt(Zr),n=t==null?void 0:t.ui.github;return n?_.jsx(Ii,{href:n,target:"_blank",color:"inherit",sx:{justifyContent:"start",textTransform:"none"},startIcon:_.jsx(dnt,{sx:{height:20,width:20}}),...e,children:"Repo"}):null}var r6={},fnt=Qn;Object.defineProperty(r6,"__esModule",{value:!0});var Ene=r6.default=void 0,mnt=fnt(Xn()),hnt=_,gnt=(0,mnt.default)((0,hnt.jsx)("path",{d:"M11 18h2v-2h-2v2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4z"}),"HelpOutline");Ene=r6.default=gnt;const _nt=x.memo(({markdown:e,allowHtml:t,latex:n})=>{const r=du();return e?_.jsx(_t,{overflow:"auto",flexGrow:1,children:_.jsx(_t,{id:"welcome-screen",sx:{boxSizing:"border-box",maxWidth:r,width:"100%",mx:"auto",color:"text.primary",fontFamily:"-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji",display:"flex",flexDirection:"column"},children:_.jsx(eg,{allowHtml:t,latex:n,children:e})})}):_.jsx(_t,{flexGrow:1})});function Ent(){var a,i;const[e,t]=x.useState(!1),n=yt(Zr);if(!(n!=null&&n.markdown))return null;const r=()=>{t(!1)};return _.jsxs(_.Fragment,{children:[_.jsx(Ii,{id:"readme-button",onClick:()=>t(!0),color:"inherit",sx:{textTransform:"none",justifyContent:"start"},startIcon:_.jsx(Ene,{}),children:_.jsx(Pt,{path:"components.organisms.header.readme"})}),_.jsxs(Og,{open:e,maxWidth:"lg",onClose:r,scroll:"paper","aria-labelledby":"instructions","aria-describedby":"how-to-use-this-app",PaperProps:{sx:{backgroundImage:"none"}},children:[_.jsx(Ig,{id:"instructions-dialog",children:_.jsx(Pt,{path:"components.organisms.header.readme"})}),_.jsx(Ng,{dividers:!0,children:_.jsx(_nt,{markdown:n==null?void 0:n.markdown,allowHtml:(a=n==null?void 0:n.features)==null?void 0:a.unsafe_allow_html,latex:(i=n==null?void 0:n.features)==null?void 0:i.latex})})]})]})}const tG={height:"0.75rem",width:"0.25rem",backgroundColor:"text.primary",borderRadius:"20px",transition:"transform 0.3s ease"},bnt=({onClick:e,open:t})=>{const{t:n}=ql();return _.jsx(Ca,{title:n(t?"components.organisms.threadHistory.sidebar.TriggerButton.closeSidebar":"components.organisms.threadHistory.sidebar.TriggerButton.openSidebar"),placement:"right",children:_.jsxs(_t,{id:"open-sidebar-button",sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:"pointer",padding:2,"&:hover div:nth-child(1)":{transform:t?"rotate(15deg)":"rotate(-15deg)"},"&:hover div:nth-child(2)":{transform:t?"rotate(-15deg)":"rotate(15deg)"}},onClick:e,children:[_.jsx(_t,{sx:{...tG,marginTop:"0.25rem"}}),_.jsx(_t,{sx:{...tG,marginTop:"-0.25rem"}})]})})};function Snt(){this.__data__=[],this.size=0}var vnt=Snt;function ynt(e,t){return e===t||e!==e&&t!==t}var a6=ynt,Tnt=a6;function Cnt(e,t){for(var n=e.length;n--;)if(Tnt(e[n][0],t))return n;return-1}var Ky=Cnt,Rnt=Ky,xnt=Array.prototype,Ant=xnt.splice;function Ont(e){var t=this.__data__,n=Rnt(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():Ant.call(t,n,1),--this.size,!0}var Nnt=Ont,Int=Ky;function wnt(e){var t=this.__data__,n=Int(t,e);return n<0?void 0:t[n][1]}var Dnt=wnt,Lnt=Ky;function Mnt(e){return Lnt(this.__data__,e)>-1}var knt=Mnt,Pnt=Ky;function Fnt(e,t){var n=this.__data__,r=Pnt(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var Bnt=Fnt,Unt=vnt,$nt=Nnt,znt=Dnt,Hnt=knt,Gnt=Bnt;function u0(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}u0.prototype.clear=Unt;u0.prototype.delete=$nt;u0.prototype.get=znt;u0.prototype.has=Hnt;u0.prototype.set=Gnt;var Qy=u0,Vnt=Qy;function Ynt(){this.__data__=new Vnt,this.size=0}var qnt=Ynt;function Wnt(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}var jnt=Wnt;function Knt(e){return this.__data__.get(e)}var Qnt=Knt;function Xnt(e){return this.__data__.has(e)}var Znt=Xnt,Jnt=Od,ert=Jnt(Object,"create"),Xy=ert,nG=Xy;function trt(){this.__data__=nG?nG(null):{},this.size=0}var nrt=trt;function rrt(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var art=rrt,irt=Xy,ort="__lodash_hash_undefined__",srt=Object.prototype,lrt=srt.hasOwnProperty;function crt(e){var t=this.__data__;if(irt){var n=t[e];return n===ort?void 0:n}return lrt.call(t,e)?t[e]:void 0}var urt=crt,drt=Xy,prt=Object.prototype,frt=prt.hasOwnProperty;function mrt(e){var t=this.__data__;return drt?t[e]!==void 0:frt.call(t,e)}var hrt=mrt,grt=Xy,_rt="__lodash_hash_undefined__";function Ert(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=grt&&t===void 0?_rt:t,this}var brt=Ert,Srt=nrt,vrt=art,yrt=urt,Trt=hrt,Crt=brt;function d0(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}d0.prototype.clear=Srt;d0.prototype.delete=vrt;d0.prototype.get=yrt;d0.prototype.has=Trt;d0.prototype.set=Crt;var Rrt=d0,rG=Rrt,xrt=Qy,Art=QD;function Ort(){this.size=0,this.__data__={hash:new rG,map:new(Art||xrt),string:new rG}}var Nrt=Ort;function Irt(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var wrt=Irt,Drt=wrt;function Lrt(e,t){var n=e.__data__;return Drt(t)?n[typeof t=="string"?"string":"hash"]:n.map}var Zy=Lrt,Mrt=Zy;function krt(e){var t=Mrt(this,e).delete(e);return this.size-=t?1:0,t}var Prt=krt,Frt=Zy;function Brt(e){return Frt(this,e).get(e)}var Urt=Brt,$rt=Zy;function zrt(e){return $rt(this,e).has(e)}var Hrt=zrt,Grt=Zy;function Vrt(e,t){var n=Grt(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var Yrt=Vrt,qrt=Nrt,Wrt=Prt,jrt=Urt,Krt=Hrt,Qrt=Yrt;function p0(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}p0.prototype.clear=qrt;p0.prototype.delete=Wrt;p0.prototype.get=jrt;p0.prototype.has=Krt;p0.prototype.set=Qrt;var i6=p0,Xrt=Qy,Zrt=QD,Jrt=i6,eat=200;function tat(e,t){var n=this.__data__;if(n instanceof Xrt){var r=n.__data__;if(!Zrt||r.length<eat-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Jrt(r)}return n.set(e,t),this.size=n.size,this}var nat=tat,rat=Qy,aat=qnt,iat=jnt,oat=Qnt,sat=Znt,lat=nat;function f0(e){var t=this.__data__=new rat(e);this.size=t.size}f0.prototype.clear=aat;f0.prototype.delete=iat;f0.prototype.get=oat;f0.prototype.has=sat;f0.prototype.set=lat;var o6=f0,cat="__lodash_hash_undefined__";function uat(e){return this.__data__.set(e,cat),this}var dat=uat;function pat(e){return this.__data__.has(e)}var fat=pat,mat=i6,hat=dat,gat=fat;function uS(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new mat;++t<n;)this.add(e[t])}uS.prototype.add=uS.prototype.push=hat;uS.prototype.has=gat;var bne=uS;function _at(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var Eat=_at;function bat(e,t){return e.has(t)}var Sne=bat,Sat=bne,vat=Eat,yat=Sne,Tat=1,Cat=2;function Rat(e,t,n,r,a,i){var o=n&Tat,s=e.length,l=t.length;if(s!=l&&!(o&&l>s))return!1;var c=i.get(e),u=i.get(t);if(c&&u)return c==t&&u==e;var p=-1,f=!0,h=n&Cat?new Sat:void 0;for(i.set(e,t),i.set(t,e);++p<s;){var g=e[p],E=t[p];if(r)var y=o?r(E,g,p,t,e,i):r(g,E,p,e,t,i);if(y!==void 0){if(y)continue;f=!1;break}if(h){if(!vat(t,function(b,v){if(!yat(h,v)&&(g===b||a(g,b,n,r,i)))return h.push(v)})){f=!1;break}}else if(!(g===E||a(g,E,n,r,i))){f=!1;break}}return i.delete(e),i.delete(t),f}var vne=Rat,xat=Es,Aat=xat.Uint8Array,yne=Aat;function Oat(e){var t=-1,n=Array(e.size);return e.forEach(function(r,a){n[++t]=[a,r]}),n}var Nat=Oat;function Iat(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var s6=Iat,aG=Xg,iG=yne,wat=a6,Dat=vne,Lat=Nat,Mat=s6,kat=1,Pat=2,Fat="[object Boolean]",Bat="[object Date]",Uat="[object Error]",$at="[object Map]",zat="[object Number]",Hat="[object RegExp]",Gat="[object Set]",Vat="[object String]",Yat="[object Symbol]",qat="[object ArrayBuffer]",Wat="[object DataView]",oG=aG?aG.prototype:void 0,sN=oG?oG.valueOf:void 0;function jat(e,t,n,r,a,i,o){switch(n){case Wat:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case qat:return!(e.byteLength!=t.byteLength||!i(new iG(e),new iG(t)));case Fat:case Bat:case zat:return wat(+e,+t);case Uat:return e.name==t.name&&e.message==t.message;case Hat:case Vat:return e==t+"";case $at:var s=Lat;case Gat:var l=r&kat;if(s||(s=Mat),e.size!=t.size&&!l)return!1;var c=o.get(e);if(c)return c==t;r|=Pat,o.set(e,t);var u=Dat(s(e),s(t),r,a,i,o);return o.delete(e),u;case Yat:if(sN)return sN.call(e)==sN.call(t)}return!1}var Kat=jat;function Qat(e,t){for(var n=-1,r=t.length,a=e.length;++n<r;)e[a+n]=t[n];return e}var Tne=Qat,Xat=Tne,Zat=bs;function Jat(e,t,n){var r=t(e);return Zat(e)?r:Xat(r,n(e))}var Cne=Jat;function eit(e,t){for(var n=-1,r=e==null?0:e.length,a=0,i=[];++n<r;){var o=e[n];t(o,n,e)&&(i[a++]=o)}return i}var tit=eit;function nit(){return[]}var Rne=nit,rit=tit,ait=Rne,iit=Object.prototype,oit=iit.propertyIsEnumerable,sG=Object.getOwnPropertySymbols,sit=sG?function(e){return e==null?[]:(e=Object(e),rit(sG(e),function(t){return oit.call(e,t)}))}:ait,l6=sit;function lit(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var cit=lit,uit=o0,dit=fu,pit="[object Arguments]";function fit(e){return dit(e)&&uit(e)==pit}var mit=fit,lG=mit,hit=fu,xne=Object.prototype,git=xne.hasOwnProperty,_it=xne.propertyIsEnumerable,Eit=lG(function(){return arguments}())?lG:function(e){return hit(e)&&git.call(e,"callee")&&!_it.call(e,"callee")},Ane=Eit,dS={exports:{}};function bit(){return!1}var Sit=bit;dS.exports;(function(e,t){var n=Es,r=Sit,a=t&&!t.nodeType&&t,i=a&&!0&&e&&!e.nodeType&&e,o=i&&i.exports===a,s=o?n.Buffer:void 0,l=s?s.isBuffer:void 0,c=l||r;e.exports=c})(dS,dS.exports);var c6=dS.exports,vit=9007199254740991,yit=/^(?:0|[1-9]\d*)$/;function Tit(e,t){var n=typeof e;return t=t??vit,!!t&&(n=="number"||n!="symbol"&&yit.test(e))&&e>-1&&e%1==0&&e<t}var One=Tit,Cit=o0,Rit=XD,xit=fu,Ait="[object Arguments]",Oit="[object Array]",Nit="[object Boolean]",Iit="[object Date]",wit="[object Error]",Dit="[object Function]",Lit="[object Map]",Mit="[object Number]",kit="[object Object]",Pit="[object RegExp]",Fit="[object Set]",Bit="[object String]",Uit="[object WeakMap]",$it="[object ArrayBuffer]",zit="[object DataView]",Hit="[object Float32Array]",Git="[object Float64Array]",Vit="[object Int8Array]",Yit="[object Int16Array]",qit="[object Int32Array]",Wit="[object Uint8Array]",jit="[object Uint8ClampedArray]",Kit="[object Uint16Array]",Qit="[object Uint32Array]",er={};er[Hit]=er[Git]=er[Vit]=er[Yit]=er[qit]=er[Wit]=er[jit]=er[Kit]=er[Qit]=!0;er[Ait]=er[Oit]=er[$it]=er[Nit]=er[zit]=er[Iit]=er[wit]=er[Dit]=er[Lit]=er[Mit]=er[kit]=er[Pit]=er[Fit]=er[Bit]=er[Uit]=!1;function Xit(e){return xit(e)&&Rit(e.length)&&!!er[Cit(e)]}var Zit=Xit;function Jit(e){return function(t){return e(t)}}var u6=Jit,pS={exports:{}};pS.exports;(function(e,t){var n=Ute,r=t&&!t.nodeType&&t,a=r&&!0&&e&&!e.nodeType&&e,i=a&&a.exports===r,o=i&&n.process,s=function(){try{var l=a&&a.require&&a.require("util").types;return l||o&&o.binding&&o.binding("util")}catch{}}();e.exports=s})(pS,pS.exports);var d6=pS.exports,eot=Zit,tot=u6,cG=d6,uG=cG&&cG.isTypedArray,not=uG?tot(uG):eot,Nne=not,rot=cit,aot=Ane,iot=bs,oot=c6,sot=One,lot=Nne,cot=Object.prototype,uot=cot.hasOwnProperty;function dot(e,t){var n=iot(e),r=!n&&aot(e),a=!n&&!r&&oot(e),i=!n&&!r&&!a&&lot(e),o=n||r||a||i,s=o?rot(e.length,String):[],l=s.length;for(var c in e)(t||uot.call(e,c))&&!(o&&(c=="length"||a&&(c=="offset"||c=="parent")||i&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||sot(c,l)))&&s.push(c);return s}var Ine=dot,pot=Ine,fot=Bte,mot=Jg;function hot(e){return mot(e)?pot(e):fot(e)}var t_=hot,got=Cne,_ot=l6,Eot=t_;function bot(e){return got(e,Eot,_ot)}var wne=bot,dG=wne,Sot=1,vot=Object.prototype,yot=vot.hasOwnProperty;function Tot(e,t,n,r,a,i){var o=n&Sot,s=dG(e),l=s.length,c=dG(t),u=c.length;if(l!=u&&!o)return!1;for(var p=l;p--;){var f=s[p];if(!(o?f in t:yot.call(t,f)))return!1}var h=i.get(e),g=i.get(t);if(h&&g)return h==t&&g==e;var E=!0;i.set(e,t),i.set(t,e);for(var y=o;++p<l;){f=s[p];var b=e[f],v=t[f];if(r)var C=o?r(v,b,f,t,e,i):r(b,v,f,e,t,i);if(!(C===void 0?b===v||a(b,v,n,r,i):C)){E=!1;break}y||(y=f=="constructor")}if(E&&!y){var T=e.constructor,N=t.constructor;T!=N&&"constructor"in e&&"constructor"in t&&!(typeof T=="function"&&T instanceof T&&typeof N=="function"&&N instanceof N)&&(E=!1)}return i.delete(e),i.delete(t),E}var Cot=Tot,lN=o6,Rot=vne,xot=Kat,Aot=Cot,pG=Zg,fG=bs,mG=c6,Oot=Nne,Not=1,hG="[object Arguments]",gG="[object Array]",EE="[object Object]",Iot=Object.prototype,_G=Iot.hasOwnProperty;function wot(e,t,n,r,a,i){var o=fG(e),s=fG(t),l=o?gG:pG(e),c=s?gG:pG(t);l=l==hG?EE:l,c=c==hG?EE:c;var u=l==EE,p=c==EE,f=l==c;if(f&&mG(e)){if(!mG(t))return!1;o=!0,u=!1}if(f&&!u)return i||(i=new lN),o||Oot(e)?Rot(e,t,n,r,a,i):xot(e,t,l,n,r,a,i);if(!(n&Not)){var h=u&&_G.call(e,"__wrapped__"),g=p&&_G.call(t,"__wrapped__");if(h||g){var E=h?e.value():e,y=g?t.value():t;return i||(i=new lN),a(E,y,n,r,i)}}return f?(i||(i=new lN),Aot(e,t,n,r,a,i)):!1}var Dot=wot,Lot=Dot,EG=fu;function Dne(e,t,n,r,a){return e===t?!0:e==null||t==null||!EG(e)&&!EG(t)?e!==e&&t!==t:Lot(e,t,n,r,Dne,a)}var p6=Dne,Mot=p6;function kot(e,t){return Mot(e,t)}var Pot=kot;const Fot=Aa(Pot);var Bot=o6,Uot=p6,$ot=1,zot=2;function Hot(e,t,n,r){var a=n.length,i=a,o=!r;if(e==null)return!i;for(e=Object(e);a--;){var s=n[a];if(o&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++a<i;){s=n[a];var l=s[0],c=e[l],u=s[1];if(o&&s[2]){if(c===void 0&&!(l in e))return!1}else{var p=new Bot;if(r)var f=r(c,u,l,e,t,p);if(!(f===void 0?Uot(u,c,$ot|zot,r,p):f))return!1}}return!0}var Got=Hot,Vot=pu;function Yot(e){return e===e&&!Vot(e)}var Lne=Yot,qot=Lne,Wot=t_;function jot(e){for(var t=Wot(e),n=t.length;n--;){var r=t[n],a=e[r];t[n]=[r,a,qot(a)]}return t}var Kot=jot;function Qot(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}var Mne=Qot,Xot=Got,Zot=Kot,Jot=Mne;function est(e){var t=Zot(e);return t.length==1&&t[0][2]?Jot(t[0][0],t[0][1]):function(n){return n===e||Xot(n,e,t)}}var tst=est,nst=o0,rst=fu,ast="[object Symbol]";function ist(e){return typeof e=="symbol"||rst(e)&&nst(e)==ast}var Jy=ist,ost=bs,sst=Jy,lst=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,cst=/^\w*$/;function ust(e,t){if(ost(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||sst(e)?!0:cst.test(e)||!lst.test(e)||t!=null&&e in Object(t)}var f6=ust,kne=i6,dst="Expected a function";function m6(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(dst);var n=function(){var r=arguments,a=t?t.apply(this,r):r[0],i=n.cache;if(i.has(a))return i.get(a);var o=e.apply(this,r);return n.cache=i.set(a,o)||i,o};return n.cache=new(m6.Cache||kne),n}m6.Cache=kne;var pst=m6,fst=pst,mst=500;function hst(e){var t=fst(e,function(r){return n.size===mst&&n.clear(),r}),n=t.cache;return t}var gst=hst,_st=gst,Est=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,bst=/\\(\\)?/g,Sst=_st(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Est,function(n,r,a,i){t.push(a?i.replace(bst,"$1"):r||n)}),t}),vst=Sst;function yst(e,t){for(var n=-1,r=e==null?0:e.length,a=Array(r);++n<r;)a[n]=t(e[n],n,e);return a}var Pne=yst,bG=Xg,Tst=Pne,Cst=bs,Rst=Jy,xst=1/0,SG=bG?bG.prototype:void 0,vG=SG?SG.toString:void 0;function Fne(e){if(typeof e=="string")return e;if(Cst(e))return Tst(e,Fne)+"";if(Rst(e))return vG?vG.call(e):"";var t=e+"";return t=="0"&&1/e==-xst?"-0":t}var Ast=Fne,Ost=Ast;function Nst(e){return e==null?"":Ost(e)}var h6=Nst,Ist=bs,wst=f6,Dst=vst,Lst=h6;function Mst(e,t){return Ist(e)?e:wst(e,t)?[e]:Dst(Lst(e))}var Bne=Mst,kst=Jy,Pst=1/0;function Fst(e){if(typeof e=="string"||kst(e))return e;var t=e+"";return t=="0"&&1/e==-Pst?"-0":t}var eT=Fst,Bst=Bne,Ust=eT;function $st(e,t){t=Bst(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[Ust(t[n++])];return n&&n==r?e:void 0}var Une=$st,zst=Une;function Hst(e,t,n){var r=e==null?void 0:zst(e,t);return r===void 0?n:r}var Gst=Hst;function Vst(e,t){return e!=null&&t in Object(e)}var Yst=Vst,qst=Bne,Wst=Ane,jst=bs,Kst=One,Qst=XD,Xst=eT;function Zst(e,t,n){t=qst(t,e);for(var r=-1,a=t.length,i=!1;++r<a;){var o=Xst(t[r]);if(!(i=e!=null&&n(e,o)))break;e=e[o]}return i||++r!=a?i:(a=e==null?0:e.length,!!a&&Qst(a)&&Kst(o,a)&&(jst(e)||Wst(e)))}var Jst=Zst,elt=Yst,tlt=Jst;function nlt(e,t){return e!=null&&tlt(e,t,elt)}var rlt=nlt,alt=p6,ilt=Gst,olt=rlt,slt=f6,llt=Lne,clt=Mne,ult=eT,dlt=1,plt=2;function flt(e,t){return slt(e)&&llt(t)?clt(ult(e),t):function(n){var r=ilt(n,e);return r===void 0&&r===t?olt(n,e):alt(t,r,dlt|plt)}}var mlt=flt;function hlt(e){return e}var glt=hlt,_lt=Une;function Elt(e){return function(t){return _lt(t,e)}}var blt=Elt,Slt=Yte,vlt=blt,ylt=f6,Tlt=eT;function Clt(e){return ylt(e)?Slt(Tlt(e)):vlt(e)}var Rlt=Clt,xlt=tst,Alt=mlt,Olt=glt,Nlt=bs,Ilt=Rlt;function wlt(e){return typeof e=="function"?e:e==null?Olt:typeof e=="object"?Nlt(e)?Alt(e[0],e[1]):xlt(e):Ilt(e)}var g6=wlt;function Dlt(e,t,n,r){for(var a=e.length,i=n+(r?1:-1);r?i--:++i<a;)if(t(e[i],i,e))return i;return-1}var Llt=Dlt;function Mlt(e){return e!==e}var klt=Mlt;function Plt(e,t,n){for(var r=n-1,a=e.length;++r<a;)if(e[r]===t)return r;return-1}var Flt=Plt,Blt=Llt,Ult=klt,$lt=Flt;function zlt(e,t,n){return t===t?$lt(e,t,n):Blt(e,Ult,n)}var Hlt=zlt,Glt=Hlt;function Vlt(e,t){var n=e==null?0:e.length;return!!n&&Glt(e,t,0)>-1}var Ylt=Vlt;function qlt(e,t,n){for(var r=-1,a=e==null?0:e.length;++r<a;)if(n(t,e[r]))return!0;return!1}var Wlt=qlt;function jlt(){}var Klt=jlt,cN=Gte,Qlt=Klt,Xlt=s6,Zlt=1/0,Jlt=cN&&1/Xlt(new cN([,-0]))[1]==Zlt?function(e){return new cN(e)}:Qlt,ect=Jlt,tct=bne,nct=Ylt,rct=Wlt,act=Sne,ict=ect,oct=s6,sct=200;function lct(e,t,n){var r=-1,a=nct,i=e.length,o=!0,s=[],l=s;if(n)o=!1,a=rct;else if(i>=sct){var c=t?null:ict(e);if(c)return oct(c);o=!1,a=act,l=new tct}else l=t?[]:s;e:for(;++r<i;){var u=e[r],p=t?t(u):u;if(u=n||u!==0?u:0,o&&p===p){for(var f=l.length;f--;)if(l[f]===p)continue e;t&&l.push(p),s.push(u)}else a(l,p,n)||(l!==s&&l.push(p),s.push(u))}return s}var cct=lct,uct=g6,dct=cct;function pct(e,t){return e&&e.length?dct(e,uct(t)):[]}var fct=pct;const mct=Aa(fct),_6=kn({key:"ThreadsFilters",default:{}});function hct(e,t,n){var r=-1,a=e.length;t<0&&(t=-t>a?0:a+t),n=n>a?a:n,n<0&&(n+=a),a=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(a);++r<a;)i[r]=e[r+t];return i}var gct=hct,_ct=gct;function Ect(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:_ct(e,t,n)}var bct=Ect;function Sct(e){return e.split("")}var vct=Sct,$ne="\\ud800-\\udfff",yct="\\u0300-\\u036f",Tct="\\ufe20-\\ufe2f",Cct="\\u20d0-\\u20ff",Rct=yct+Tct+Cct,xct="\\ufe0e\\ufe0f",Act="["+$ne+"]",a3="["+Rct+"]",i3="\\ud83c[\\udffb-\\udfff]",Oct="(?:"+a3+"|"+i3+")",zne="[^"+$ne+"]",Hne="(?:\\ud83c[\\udde6-\\uddff]){2}",Gne="[\\ud800-\\udbff][\\udc00-\\udfff]",Nct="\\u200d",Vne=Oct+"?",Yne="["+xct+"]?",Ict="(?:"+Nct+"(?:"+[zne,Hne,Gne].join("|")+")"+Yne+Vne+")*",wct=Yne+Vne+Ict,Dct="(?:"+[zne+a3+"?",a3,Hne,Gne,Act].join("|")+")",Lct=RegExp(i3+"(?="+i3+")|"+Dct+wct,"g");function Mct(e){return e.match(Lct)||[]}var kct=Mct,Pct=vct,Fct=ZD,Bct=kct;function Uct(e){return Fct(e)?Bct(e):Pct(e)}var $ct=Uct,zct=bct,Hct=ZD,Gct=$ct,Vct=h6;function Yct(e){return function(t){t=Vct(t);var n=Hct(t)?Gct(t):void 0,r=n?n[0]:t.charAt(0),a=n?zct(n,1).join(""):t.slice(1);return r[e]()+a}}var qct=Yct,Wct=qct,jct=Wct("toUpperCase"),Kct=jct,Qct=h6,Xct=Kct;function Zct(e){return Xct(Qct(e).toLowerCase())}var Jct=Zct;const eut=Aa(Jct);function tut(e){return function(t,n,r){for(var a=-1,i=Object(t),o=r(t),s=o.length;s--;){var l=o[e?s:++a];if(n(i[l],l,i)===!1)break}return t}}var nut=tut,rut=nut,aut=rut(),iut=aut,out=iut,sut=t_;function lut(e,t){return e&&out(e,t,sut)}var qne=lut,cut=Jg;function uut(e,t){return function(n,r){if(n==null)return n;if(!cut(n))return e(n,r);for(var a=n.length,i=t?a:-1,o=Object(n);(t?i--:++i<a)&&r(o[i],i,o)!==!1;);return n}}var dut=uut,put=qne,fut=dut,mut=fut(put),hut=mut,gut=hut,_ut=Jg;function Eut(e,t){var n=-1,r=_ut(e)?Array(e.length):[];return gut(e,function(a,i,o){r[++n]=t(a,i,o)}),r}var but=Eut,Sut=Pne,vut=g6,yut=but,Tut=bs;function Cut(e,t){var n=Tut(e)?Sut:yut;return n(e,vut(t))}var Rut=Cut;const yG=Aa(Rut);var E6={},xut=Qn;Object.defineProperty(E6,"__esModule",{value:!0});var Wne=E6.default=void 0,Aut=xut(Xn()),Out=_,Nut=(0,Aut.default)((0,Out.jsx)("path",{d:"M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H6l-2 2V4h16v12z"}),"ChatBubbleOutline");Wne=E6.default=Nut;var b6={},Iut=Qn;Object.defineProperty(b6,"__esModule",{value:!0});var jne=b6.default=void 0,wut=Iut(Xn()),Dut=_,Lut=(0,wut.default)((0,Dut.jsx)("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM8 9h8v10H8V9zm7.5-5-1-1h-5l-1 1H5v2h14V4z"}),"DeleteOutline");jne=b6.default=Lut;function Mut(e){return Ot("MuiLoadingButton",e)}const kut=It("MuiLoadingButton",["root","loading","loadingIndicator","loadingIndicatorCenter","loadingIndicatorStart","loadingIndicatorEnd","endIconLoadingEnd","startIconLoadingStart"]),pl=kut,Put=["children","disabled","id","loading","loadingIndicator","loadingPosition","variant"],Fut=e=>{const{loading:t,loadingPosition:n,classes:r}=e,a={root:["root",t&&"loading"],startIcon:[t&&`startIconLoading${Ye(n)}`],endIcon:[t&&`endIconLoading${Ye(n)}`],loadingIndicator:["loadingIndicator",t&&`loadingIndicator${Ye(n)}`]},i=Nt(a,Mut,r);return B({},r,i)},But=e=>e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"&&e!=="classes",Uut=je(Ii,{shouldForwardProp:e=>But(e)||e==="classes",name:"MuiLoadingButton",slot:"Root",overridesResolver:(e,t)=>[t.root,t.startIconLoadingStart&&{[`& .${pl.startIconLoadingStart}`]:t.startIconLoadingStart},t.endIconLoadingEnd&&{[`& .${pl.endIconLoadingEnd}`]:t.endIconLoadingEnd}]})(({ownerState:e,theme:t})=>B({[`& .${pl.startIconLoadingStart}, & .${pl.endIconLoadingEnd}`]:{transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.short}),opacity:0}},e.loadingPosition==="center"&&{transition:t.transitions.create(["background-color","box-shadow","border-color"],{duration:t.transitions.duration.short}),[`&.${pl.loading}`]:{color:"transparent"}},e.loadingPosition==="start"&&e.fullWidth&&{[`& .${pl.startIconLoadingStart}, & .${pl.endIconLoadingEnd}`]:{transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.short}),opacity:0,marginRight:-8}},e.loadingPosition==="end"&&e.fullWidth&&{[`& .${pl.startIconLoadingStart}, & .${pl.endIconLoadingEnd}`]:{transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.short}),opacity:0,marginLeft:-8}})),$ut=je("div",{name:"MuiLoadingButton",slot:"LoadingIndicator",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.loadingIndicator,t[`loadingIndicator${Ye(n.loadingPosition)}`]]}})(({theme:e,ownerState:t})=>B({position:"absolute",visibility:"visible",display:"flex"},t.loadingPosition==="start"&&(t.variant==="outlined"||t.variant==="contained")&&{left:t.size==="small"?10:14},t.loadingPosition==="start"&&t.variant==="text"&&{left:6},t.loadingPosition==="center"&&{left:"50%",transform:"translate(-50%)",color:(e.vars||e).palette.action.disabled},t.loadingPosition==="end"&&(t.variant==="outlined"||t.variant==="contained")&&{right:t.size==="small"?10:14},t.loadingPosition==="end"&&t.variant==="text"&&{right:6},t.loadingPosition==="start"&&t.fullWidth&&{position:"relative",left:-10},t.loadingPosition==="end"&&t.fullWidth&&{position:"relative",right:-10})),zut=x.forwardRef(function(t,n){const r=wt({props:t,name:"MuiLoadingButton"}),{children:a,disabled:i=!1,id:o,loading:s=!1,loadingIndicator:l,loadingPosition:c="center",variant:u="text"}=r,p=pt(r,Put),f=vg(o),h=l??_.jsx(Ag,{"aria-labelledby":f,color:"inherit",size:16}),g=B({},r,{disabled:i,loading:s,loadingIndicator:h,loadingPosition:c,variant:u}),E=Fut(g),y=s?_.jsx($ut,{className:E.loadingIndicator,ownerState:g,children:h}):null;return _.jsxs(Uut,B({disabled:i||s,id:f,ref:n},p,{variant:u,classes:E,ownerState:g,children:[g.loadingPosition==="end"?a:y,g.loadingPosition==="end"?y:a]}))}),Hut=zut,Gut=({threadId:e,onDelete:t})=>{const[n,r]=x.useState(!1),a=yt(vd),i=yt(ca),o=()=>{r(!0)},s=()=>{r(!1)},l=async()=>{oa.promise(i.deleteThread(e,a),{loading:_.jsx(Pt,{path:"components.organisms.threadHistory.sidebar.DeleteThreadButton.deletingChat"}),success:()=>(t(),_.jsx(Pt,{path:"components.organisms.threadHistory.sidebar.DeleteThreadButton.chatDeleted"})),error:c=>c instanceof MI?_.jsx("span",{children:c.message}):_.jsx("span",{})}),s()};return _.jsxs("div",{children:[_.jsx(zn,{size:"small",onClick:o,sx:{p:"2px"},children:_.jsx(jne,{sx:{width:16,height:16}})}),n&&_.jsxs(Og,{open:n,onClose:s,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",PaperProps:{sx:{backgroundImage:"none"}},children:[_.jsx(Ig,{id:"alert-dialog-title",children:"Delete Thread?"}),_.jsx(Ng,{children:_.jsx(pQ,{id:"alert-dialog-description",children:_.jsx(Pt,{path:"components.organisms.threadHistory.sidebar.DeleteThreadButton.confirmMessage"})})}),_.jsxs(my,{sx:{color:"text.secondary",p:2},children:[_.jsx(Ii,{variant:"outlined",color:"inherit",onClick:s,children:_.jsx(Pt,{path:"components.organisms.threadHistory.sidebar.DeleteThreadButton.cancel"})}),_.jsx(Hut,{variant:"outlined",color:"primary",onClick:l,autoFocus:!0,children:_.jsx(Pt,{path:"components.organisms.threadHistory.sidebar.DeleteThreadButton.confirm"})})]})]})]})},Vut=({threadHistory:e,error:t,fetchThreads:n,isFetching:r,isLoadingMore:a})=>{const{idToResume:i}=Ul(),{clear:o}=Uo(),{threadId:s}=hs(),l=no();if(r||!(e!=null&&e.timeGroupedThreads)&&a)return _.jsx(_.Fragment,{children:[1,2,3].map(u=>_.jsxs(_t,{sx:{mt:2},children:[_.jsx(Bc,{width:100}),[1,2].map(p=>_.jsxs(kt,{sx:{py:2,flexDirection:"row",alignItems:"center",gap:1.5},children:[_.jsx(Bc,{width:30}),_.jsx(Bc,{width:"100%"})]},`threads-skeleton-${u}-${p}`))]},`threads-skeleton-${u}`))});if(t)return _.jsx(ms,{severity:"error",children:t.message});if(!e)return null;if(Zte(e==null?void 0:e.timeGroupedThreads)===0)return _.jsx(ms,{variant:"standard",severity:"info",children:_.jsx(Pt,{path:"components.organisms.threadHistory.sidebar.ThreadList.empty"})});const c=u=>{(u===i||u===s)&&o(),u===e.currentThreadId&&l("/"),n()};return _.jsxs(Hb,{sx:{height:0,bgcolor:"background.paper","& ul":{padding:0}},subheader:_.jsx("li",{}),children:[yG(e.timeGroupedThreads,(u,p)=>_.jsx("li",{children:_.jsxs("ul",{children:[_.jsx(SOe,{sx:{px:0},children:_.jsx(fn,{sx:{py:1,color:"text.secondary",fontWeight:600,fontSize:"12px",backgroundColor:f=>f.palette.background.paper},children:(()=>p==="Today"?_.jsx(Pt,{path:"components.organisms.threadHistory.sidebar.ThreadList.today"}):p==="Yesterday"?_.jsx(Pt,{path:"components.organisms.threadHistory.sidebar.ThreadList.yesterday"}):p==="Previous 7 days"?_.jsx(Pt,{path:"components.organisms.threadHistory.sidebar.ThreadList.previous7days"}):p==="Previous 30 days"?_.jsx(Pt,{path:"components.organisms.threadHistory.sidebar.ThreadList.previous30days"}):_.jsx(_.Fragment,{children:p}))()})}),yG(u,f=>{const h=i===f.id&&!e.currentThreadId,g=h||e.currentThreadId===f.id;return _.jsx(kt,{component:Kw,id:`thread-${f.id}`,sx:E=>({textDecoration:"none",cursor:"pointer",p:1.5,mb:.5,gap:.5,flexDirection:"row",justifyContent:"space-between",borderRadius:1,backgroundColor:g?E.palette.mode==="dark"?Mt[800]:"grey.200":E.palette.background.paper,"&:hover":{backgroundColor:E.palette.mode==="dark"?Mt[800]:"grey.200"}}),to:h?"":`/thread/${f.id}`,children:_.jsxs(kt,{direction:"row",width:"100%",justifyContent:"space-between",children:[_.jsxs(kt,{sx:{alignItems:"center",flexDirection:"row",gap:1.5,overflow:"hidden",color:E=>E.palette.text.primary},children:[_.jsx(Wne,{sx:{width:"14px",height:"14px"}}),_.jsx(fn,{sx:{fontWeight:500,fontSize:"13px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:eut(f.name||"Unknown")})]}),g?_.jsx(Gut,{threadId:f.id,onDelete:()=>c(f.id)}):null]})},`thread-${f.id}`)})]})},`section-${p}`)),_.jsx(kt,{alignItems:"center",children:_.jsx(Ag,{id:"chat-history-loader",size:30,sx:{my:1,opacity:a?1:0}})})]})};var S6={},Yut=Qn;Object.defineProperty(S6,"__esModule",{value:!0});var Kne=S6.default=void 0,qut=Yut(Xn()),Wut=_,jut=(0,qut.default)((0,Wut.jsx)("path",{d:"M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z"}),"FilterList");Kne=S6.default=jut;var v6={},Kut=Qn;Object.defineProperty(v6,"__esModule",{value:!0});var Qne=v6.default=void 0,Qut=Kut(Xn()),Xut=_,Zut=(0,Qut.default)((0,Xut.jsx)("path",{d:"M15 3H6c-.83 0-1.54.5-1.84 1.22l-3.02 7.05c-.09.23-.14.47-.14.73v2c0 1.1.9 2 2 2h6.31l-.95 4.57-.03.32c0 .41.17.79.44 1.06L9.83 23l6.59-6.59c.36-.36.58-.86.58-1.41V5c0-1.1-.9-2-2-2zm4 0v12h4V3h-4z"}),"ThumbDown");Qne=v6.default=Zut;var y6={},Jut=Qn;Object.defineProperty(y6,"__esModule",{value:!0});var Xne=y6.default=void 0,edt=Jut(Xn()),tdt=_,ndt=(0,edt.default)((0,tdt.jsx)("path",{d:"M1 21h4V9H1v12zm22-11c0-1.1-.9-2-2-2h-6.31l.95-4.57.03-.32c0-.41-.17-.79-.44-1.06L14.17 1 7.59 7.59C7.22 7.95 7 8.45 7 9v10c0 1.1.9 2 2 2h9c.83 0 1.54-.5 1.84-1.22l3.02-7.05c.09-.23.14-.47.14-.73v-2z"}),"ThumbUp");Xne=y6.default=ndt;function rdt(){const[e,t]=xa(_6),[n,r]=x.useState(null),{t:a}=ql(),i=l=>{t(c=>({...c,feedback:l})),r(null)},o=(l,c)=>_.jsx(_t,{onClick:()=>i(c),sx:{cursor:"pointer",px:1.5,py:1,borderRadius:1,"&:hover":{background:u=>u.palette.background.default}},children:l}),s=()=>{const l={width:20,height:20,color:"text.secondary"};switch(e.feedback){case 1:return _.jsx(Xne,{sx:l});case 0:return _.jsx(Qne,{sx:l});default:return _.jsx(Kne,{sx:l})}};return _.jsxs(_.Fragment,{children:[_.jsx(zn,{disableRipple:!0,onClick:l=>r(l.currentTarget),edge:"end",children:s()}),_.jsx(Dg,{id:"feedback-filter-select",autoFocus:!0,anchorEl:n,open:!!n,onClose:()=>r(null),sx:{mt:1},MenuListProps:{sx:{p:.5}},slotProps:{paper:{sx:{background:l=>l.palette.background.paper,border:l=>`1px solid ${l.palette.divider}`,boxShadow:l=>l.palette.mode==="light"?"0px 2px 4px 0px #0000000D":"0px 10px 10px 0px #0000000D"}}},children:_.jsxs(kt,{children:[o(a("components.organisms.threadHistory.sidebar.filters.FeedbackSelect.feedbackAll"),void 0),o(a("components.organisms.threadHistory.sidebar.filters.FeedbackSelect.feedbackPositive"),1),o(a("components.organisms.threadHistory.sidebar.filters.FeedbackSelect.feedbackNegative"),0)]})})]})}var adt=Es,idt=function(){return adt.Date.now()},odt=idt,sdt=/\s/;function ldt(e){for(var t=e.length;t--&&sdt.test(e.charAt(t)););return t}var cdt=ldt,udt=cdt,ddt=/^\s+/;function pdt(e){return e&&e.slice(0,udt(e)+1).replace(ddt,"")}var fdt=pdt,mdt=fdt,TG=pu,hdt=Jy,CG=0/0,gdt=/^[-+]0x[0-9a-f]+$/i,_dt=/^0b[01]+$/i,Edt=/^0o[0-7]+$/i,bdt=parseInt;function Sdt(e){if(typeof e=="number")return e;if(hdt(e))return CG;if(TG(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=TG(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=mdt(e);var n=_dt.test(e);return n||Edt.test(e)?bdt(e.slice(2),n?2:8):gdt.test(e)?CG:+e}var vdt=Sdt,ydt=pu,uN=odt,RG=vdt,Tdt="Expected a function",Cdt=Math.max,Rdt=Math.min;function xdt(e,t,n){var r,a,i,o,s,l,c=0,u=!1,p=!1,f=!0;if(typeof e!="function")throw new TypeError(Tdt);t=RG(t)||0,ydt(n)&&(u=!!n.leading,p="maxWait"in n,i=p?Cdt(RG(n.maxWait)||0,t):i,f="trailing"in n?!!n.trailing:f);function h(A){var O=r,M=a;return r=a=void 0,c=A,o=e.apply(M,O),o}function g(A){return c=A,s=setTimeout(b,t),u?h(A):o}function E(A){var O=A-l,M=A-c,P=t-O;return p?Rdt(P,i-M):P}function y(A){var O=A-l,M=A-c;return l===void 0||O>=t||O<0||p&&M>=i}function b(){var A=uN();if(y(A))return v(A);s=setTimeout(b,E(A))}function v(A){return s=void 0,f&&r?h(A):(r=a=void 0,o)}function C(){s!==void 0&&clearTimeout(s),c=0,r=l=a=s=void 0}function T(){return s===void 0?o:v(uN())}function N(){var A=uN(),O=y(A);if(r=arguments,a=this,l=A,O){if(s===void 0)return g(l);if(p)return clearTimeout(s),s=setTimeout(b,t),h(l)}return s===void 0&&(s=setTimeout(b,t)),o}return N.cancel=C,N.flush=T,N}var Adt=xdt;const Odt=Aa(Adt);var T6={},Ndt=Qn;Object.defineProperty(T6,"__esModule",{value:!0});var Zne=T6.default=void 0,Idt=Ndt(Xn()),wdt=_,Ddt=(0,Idt.default)((0,wdt.jsx)("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),"Search");Zne=T6.default=Ddt;function Ldt(){const[e,t]=xa(_6),{t:n}=ql(),a=Odt(s=>{s=s.trim();const l=s===""?void 0:s;t(c=>({...c,search:l}))},300),i=x.useRef(),o=()=>{a(""),i.current&&(i.current.value="")};return _.jsx(Lg,{variant:"standard",sx:{width:"100%",border:"none",borderRadius:1,backgroundColor:s=>s.palette.mode==="dark"?Mt[850]:"grey.100"},InputProps:{sx:{px:1.5,py:1},disableUnderline:!0,startAdornment:_.jsx(I5,{position:"end",sx:{color:"text.secondary",mr:1,ml:0},children:_.jsx(Zne,{sx:{height:20,width:20}})}),endAdornment:e.search?_.jsx(zn,{onClick:o,sx:{p:"2px"},children:_.jsx(Df,{sx:{height:18,width:18}})}):null},placeholder:n("components.organisms.threadHistory.sidebar.filters.SearchBar.search"),inputProps:{"aria-label":"search",ref:i,sx:{p:0}},onChange:s=>a(s.target.value)})}function Mdt(){return _.jsxs(kt,{sx:{flexDirection:"row",gap:1},children:[_.jsx(Ldt,{}),_.jsx(rdt,{})]})}const kdt=20;let xG=0;function Pdt(){const e=yt(_6),t=x.useRef(null),[n,r]=x.useState(e),a=!Fot(n,e),[i,o]=xa(fv),s=yt(vd),[l,c]=x.useState(!1),[u,p]=x.useState(void 0),[f,h]=x.useState(!1),[g,E]=x.useState(!1),y=yt(ca),{firstInteraction:b,messages:v,threadId:C}=hs(),T=no();x.useEffect(()=>{t.current&&(t.current.scrollTop=xG)},[]),x.useEffect(()=>{var M;!b||b==="resume"&&((M=v.at(0))==null?void 0:M.output.toLowerCase())!=="resume"||A(void 0,!0).then(()=>{const P=new URL(window.location.href);C&&P.pathname==="/"&&T(`/thread/${C}`)})},[b]);const N=()=>{if(!t.current)return;const{scrollHeight:O,clientHeight:M,scrollTop:P}=t.current,D=P+M>=O-10;xG=P,c(D)},A=async(O,M)=>{var P;try{O||M?h(!0):E(!0);const{pageInfo:D,data:$}=await y.listThreads({first:kdt,cursor:O},e,s);p(void 0);const V=mct(O?(P=i==null?void 0:i.threads)==null?void 0:P.concat($):$,"id");V&&o(Z=>({...Z,pageInfo:D,threads:V}))}catch(D){D instanceof Error&&p(D.message)}finally{c(!1),h(!1),E(!1)}};if(s&&!g&&!(i!=null&&i.threads)&&!u&&A(),i!=null&&i.pageInfo){const{hasNextPage:O,endCursor:M}=i.pageInfo;l&&!f&&O&&M&&A(M)}return a&&(r(e),A()),_.jsxs(_.Fragment,{children:[_.jsx(Mdt,{}),i?_.jsx(_t,{sx:{flexGrow:1,overflow:"auto"},onScroll:N,ref:t,children:_.jsx(Vut,{threadHistory:i,error:u,isFetching:g,isLoadingMore:f,fetchThreads:A})}):null]})}const Fdt=260,Bdt=()=>{const e=gs(),t=wg("(max-width:66rem)"),[n,r]=xa(Wl),a=yt(Zr),i=!!e.accessToken&&!!(a!=null&&a.dataPersistence);x.useEffect(()=>{o(t?!1:i)},[i]);const o=s=>r(l=>({...l,isChatHistoryOpen:s}));return _.jsxs(_t,{display:"flex",position:"relative",children:[_.jsxs(_Q,{className:"chat-history-drawer",anchor:"left",open:n.isChatHistoryOpen,variant:t?"temporary":"persistent",transitionDuration:0,hideBackdrop:!t,onClose:()=>o(!1),sx:{width:n.isChatHistoryOpen?"auto":0,"& .MuiDrawer-paper":{width:n.isChatHistoryOpen?Fdt:0,position:"inherit",gap:1,display:"flex",flexDirection:"column",padding:"0px 4px",backgroundImage:"none",borderRight:"none",px:2,boxSizing:"border-box",boxShadow:s=>s.palette.mode==="dark"?"0px 4px 20px 0px rgba(0, 0, 0, 0.20)":"0px 4px 20px 0px rgba(0, 0, 0, 0.05)"}},children:[_.jsx(kt,{sx:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",height:"45px",mt:1},children:_.jsx(jD,{style:{maxHeight:"25px"}})}),i?_.jsx(Pdt,{}):_.jsx(_t,{sx:{flexGrow:1,overflow:"auto"},children:_.jsx(ms,{severity:"info",children:"Conversations are not persisted."})}),_.jsxs(kt,{mb:2,children:[_.jsx(Ent,{}),_.jsx(pnt,{})]})]}),t?null:_.jsx(_t,{position:"absolute",sx:{top:"50%",transform:"translateY(-100%)",right:-30,zIndex:10},children:_.jsx(bnt,{onClick:()=>o(!n.isChatHistoryOpen),open:n.isChatHistoryOpen})})]})},AG=localStorage.getItem("userEnv"),C6=kn({key:"UserEnv",default:AG?JSON.parse(AG):{}}),R6=({children:e})=>{const{isAuthenticated:t}=gs(),n=yt(Zr),r=yt(C6),a=yt(mv);if(n!=null&&n.userEnv){for(const i of n.userEnv||[])if(!r[i])return _.jsx($I,{to:"/env"})}return t?_.jsx(_t,{sx:{display:"flex",flexDirection:"column",width:"100%"},children:t?_.jsxs(kt,{direction:"row",height:"100%",width:"100%",children:[_.jsx(Bdt,{}),_.jsxs(kt,{flexGrow:1,children:[_.jsx(_ne,{}),_.jsx(kt,{direction:"row",flexGrow:1,overflow:"auto",children:e})]}),a?null:_.jsx(Ite,{isMobile:!1}),_.jsx(rXe,{})]}):_.jsx(ms,{severity:"error",children:_.jsx(Pt,{path:"pages.Page.notPartOfProject"})})}):_.jsx($I,{to:"/login"})};function Udt(){const{id:e}=iK(),t=Qw(),{elements:n}=au(),r=yt(Zr),a=yt(ca),[i,o]=x.useState(null),s=no(),l=t.get("thread"),c=r==null?void 0:r.dataPersistence,{data:u,error:p}=gf(a,e&&l&&c?`/project/thread/${l}/element/${e}`:null);return x.useEffect(()=>{if(u)o(u);else if(e&&!c&&!i){const f=n.find(h=>h.id===e);f&&o(f)}},[u,i,n,e,l]),!i||p?null:_.jsx(R6,{children:_.jsx(cXe,{element:i,onGoBack:()=>s("/")})})}var $dt=function(t){return zdt(t)&&!Hdt(t)};function zdt(e){return!!e&&typeof e=="object"}function Hdt(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||Ydt(e)}var Gdt=typeof Symbol=="function"&&Symbol.for,Vdt=Gdt?Symbol.for("react.element"):60103;function Ydt(e){return e.$$typeof===Vdt}function qdt(e){return Array.isArray(e)?[]:{}}function fS(e,t){return t.clone!==!1&&t.isMergeableObject(e)?ag(qdt(e),e,t):e}function Wdt(e,t,n){return e.concat(t).map(function(r){return fS(r,n)})}function jdt(e,t,n){var r={};return n.isMergeableObject(e)&&Object.keys(e).forEach(function(a){r[a]=fS(e[a],n)}),Object.keys(t).forEach(function(a){!n.isMergeableObject(t[a])||!e[a]?r[a]=fS(t[a],n):r[a]=ag(e[a],t[a],n)}),r}function ag(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||Wdt,n.isMergeableObject=n.isMergeableObject||$dt;var r=Array.isArray(t),a=Array.isArray(e),i=r===a;return i?r?n.arrayMerge(e,t,n):jdt(e,t,n):fS(t,n)}ag.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,a){return ag(r,a,n)},{})};var o3=ag,Kdt=typeof global=="object"&&global&&global.Object===Object&&global;const Jne=Kdt;var Qdt=typeof self=="object"&&self&&self.Object===Object&&self,Xdt=Jne||Qdt||Function("return this")();const Js=Xdt;var Zdt=Js.Symbol;const Xc=Zdt;var ere=Object.prototype,Jdt=ere.hasOwnProperty,ept=ere.toString,Rm=Xc?Xc.toStringTag:void 0;function tpt(e){var t=Jdt.call(e,Rm),n=e[Rm];try{e[Rm]=void 0;var r=!0}catch{}var a=ept.call(e);return r&&(t?e[Rm]=n:delete e[Rm]),a}var npt=Object.prototype,rpt=npt.toString;function apt(e){return rpt.call(e)}var ipt="[object Null]",opt="[object Undefined]",OG=Xc?Xc.toStringTag:void 0;function Nd(e){return e==null?e===void 0?opt:ipt:OG&&OG in Object(e)?tpt(e):apt(e)}function tre(e,t){return function(n){return e(t(n))}}var spt=tre(Object.getPrototypeOf,Object);const x6=spt;function Id(e){return e!=null&&typeof e=="object"}var lpt="[object Object]",cpt=Function.prototype,upt=Object.prototype,nre=cpt.toString,dpt=upt.hasOwnProperty,ppt=nre.call(Object);function NG(e){if(!Id(e)||Nd(e)!=lpt)return!1;var t=x6(e);if(t===null)return!0;var n=dpt.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&nre.call(n)==ppt}var IG=Array.isArray,wG=Object.keys,fpt=Object.prototype.hasOwnProperty,mpt=typeof Element<"u";function s3(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var n=IG(e),r=IG(t),a,i,o;if(n&&r){if(i=e.length,i!=t.length)return!1;for(a=i;a--!==0;)if(!s3(e[a],t[a]))return!1;return!0}if(n!=r)return!1;var s=e instanceof Date,l=t instanceof Date;if(s!=l)return!1;if(s&&l)return e.getTime()==t.getTime();var c=e instanceof RegExp,u=t instanceof RegExp;if(c!=u)return!1;if(c&&u)return e.toString()==t.toString();var p=wG(e);if(i=p.length,i!==wG(t).length)return!1;for(a=i;a--!==0;)if(!fpt.call(t,p[a]))return!1;if(mpt&&e instanceof Element&&t instanceof Element)return e===t;for(a=i;a--!==0;)if(o=p[a],!(o==="_owner"&&e.$$typeof)&&!s3(e[o],t[o]))return!1;return!0}return e!==e&&t!==t}var hpt=function(t,n){try{return s3(t,n)}catch(r){if(r.message&&r.message.match(/stack|recursion/i)||r.number===-2146828260)return console.warn("Warning: react-fast-compare does not handle circular references.",r.name,r.message),!1;throw r}};const ku=Aa(hpt);var gpt=!0;function _pt(e,t){if(!gpt){if(e)return;var n="Warning: "+t;typeof console<"u"&&console.warn(n);try{throw Error(n)}catch{}}}function Ept(){this.__data__=[],this.size=0}function rre(e,t){return e===t||e!==e&&t!==t}function tT(e,t){for(var n=e.length;n--;)if(rre(e[n][0],t))return n;return-1}var bpt=Array.prototype,Spt=bpt.splice;function vpt(e){var t=this.__data__,n=tT(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():Spt.call(t,n,1),--this.size,!0}function ypt(e){var t=this.__data__,n=tT(t,e);return n<0?void 0:t[n][1]}function Tpt(e){return tT(this.__data__,e)>-1}function Cpt(e,t){var n=this.__data__,r=tT(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function jl(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}jl.prototype.clear=Ept;jl.prototype.delete=vpt;jl.prototype.get=ypt;jl.prototype.has=Tpt;jl.prototype.set=Cpt;function Rpt(){this.__data__=new jl,this.size=0}function xpt(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function Apt(e){return this.__data__.get(e)}function Opt(e){return this.__data__.has(e)}function n_(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Npt="[object AsyncFunction]",Ipt="[object Function]",wpt="[object GeneratorFunction]",Dpt="[object Proxy]";function are(e){if(!n_(e))return!1;var t=Nd(e);return t==Ipt||t==wpt||t==Npt||t==Dpt}var Lpt=Js["__core-js_shared__"];const dN=Lpt;var DG=function(){var e=/[^.]+$/.exec(dN&&dN.keys&&dN.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Mpt(e){return!!DG&&DG in e}var kpt=Function.prototype,Ppt=kpt.toString;function wd(e){if(e!=null){try{return Ppt.call(e)}catch{}try{return e+""}catch{}}return""}var Fpt=/[\\^$.*+?()[\]{}|]/g,Bpt=/^\[object .+?Constructor\]$/,Upt=Function.prototype,$pt=Object.prototype,zpt=Upt.toString,Hpt=$pt.hasOwnProperty,Gpt=RegExp("^"+zpt.call(Hpt).replace(Fpt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Vpt(e){if(!n_(e)||Mpt(e))return!1;var t=are(e)?Gpt:Bpt;return t.test(wd(e))}function Ypt(e,t){return e==null?void 0:e[t]}function Dd(e,t){var n=Ypt(e,t);return Vpt(n)?n:void 0}var qpt=Dd(Js,"Map");const ig=qpt;var Wpt=Dd(Object,"create");const og=Wpt;function jpt(){this.__data__=og?og(null):{},this.size=0}function Kpt(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Qpt="__lodash_hash_undefined__",Xpt=Object.prototype,Zpt=Xpt.hasOwnProperty;function Jpt(e){var t=this.__data__;if(og){var n=t[e];return n===Qpt?void 0:n}return Zpt.call(t,e)?t[e]:void 0}var eft=Object.prototype,tft=eft.hasOwnProperty;function nft(e){var t=this.__data__;return og?t[e]!==void 0:tft.call(t,e)}var rft="__lodash_hash_undefined__";function aft(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=og&&t===void 0?rft:t,this}function gd(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}gd.prototype.clear=jpt;gd.prototype.delete=Kpt;gd.prototype.get=Jpt;gd.prototype.has=nft;gd.prototype.set=aft;function ift(){this.size=0,this.__data__={hash:new gd,map:new(ig||jl),string:new gd}}function oft(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function nT(e,t){var n=e.__data__;return oft(t)?n[typeof t=="string"?"string":"hash"]:n.map}function sft(e){var t=nT(this,e).delete(e);return this.size-=t?1:0,t}function lft(e){return nT(this,e).get(e)}function cft(e){return nT(this,e).has(e)}function uft(e,t){var n=nT(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function mu(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}mu.prototype.clear=ift;mu.prototype.delete=sft;mu.prototype.get=lft;mu.prototype.has=cft;mu.prototype.set=uft;var dft=200;function pft(e,t){var n=this.__data__;if(n instanceof jl){var r=n.__data__;if(!ig||r.length<dft-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new mu(r)}return n.set(e,t),this.size=n.size,this}function m0(e){var t=this.__data__=new jl(e);this.size=t.size}m0.prototype.clear=Rpt;m0.prototype.delete=xpt;m0.prototype.get=Apt;m0.prototype.has=Opt;m0.prototype.set=pft;function fft(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var mft=function(){try{var e=Dd(Object,"defineProperty");return e({},"",{}),e}catch{}}();const LG=mft;function ire(e,t,n){t=="__proto__"&&LG?LG(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var hft=Object.prototype,gft=hft.hasOwnProperty;function ore(e,t,n){var r=e[t];(!(gft.call(e,t)&&rre(r,n))||n===void 0&&!(t in e))&&ire(e,t,n)}function rT(e,t,n,r){var a=!n;n||(n={});for(var i=-1,o=t.length;++i<o;){var s=t[i],l=r?r(n[s],e[s],s,n,e):void 0;l===void 0&&(l=e[s]),a?ire(n,s,l):ore(n,s,l)}return n}function _ft(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var Eft="[object Arguments]";function MG(e){return Id(e)&&Nd(e)==Eft}var sre=Object.prototype,bft=sre.hasOwnProperty,Sft=sre.propertyIsEnumerable,vft=MG(function(){return arguments}())?MG:function(e){return Id(e)&&bft.call(e,"callee")&&!Sft.call(e,"callee")};const yft=vft;var Tft=Array.isArray;const r_=Tft;function Cft(){return!1}var lre=typeof exports=="object"&&exports&&!exports.nodeType&&exports,kG=lre&&typeof module=="object"&&module&&!module.nodeType&&module,Rft=kG&&kG.exports===lre,PG=Rft?Js.Buffer:void 0,xft=PG?PG.isBuffer:void 0,Aft=xft||Cft;const cre=Aft;var Oft=9007199254740991,Nft=/^(?:0|[1-9]\d*)$/;function Ift(e,t){var n=typeof e;return t=t??Oft,!!t&&(n=="number"||n!="symbol"&&Nft.test(e))&&e>-1&&e%1==0&&e<t}var wft=9007199254740991;function ure(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=wft}var Dft="[object Arguments]",Lft="[object Array]",Mft="[object Boolean]",kft="[object Date]",Pft="[object Error]",Fft="[object Function]",Bft="[object Map]",Uft="[object Number]",$ft="[object Object]",zft="[object RegExp]",Hft="[object Set]",Gft="[object String]",Vft="[object WeakMap]",Yft="[object ArrayBuffer]",qft="[object DataView]",Wft="[object Float32Array]",jft="[object Float64Array]",Kft="[object Int8Array]",Qft="[object Int16Array]",Xft="[object Int32Array]",Zft="[object Uint8Array]",Jft="[object Uint8ClampedArray]",e0t="[object Uint16Array]",t0t="[object Uint32Array]",tr={};tr[Wft]=tr[jft]=tr[Kft]=tr[Qft]=tr[Xft]=tr[Zft]=tr[Jft]=tr[e0t]=tr[t0t]=!0;tr[Dft]=tr[Lft]=tr[Yft]=tr[Mft]=tr[qft]=tr[kft]=tr[Pft]=tr[Fft]=tr[Bft]=tr[Uft]=tr[$ft]=tr[zft]=tr[Hft]=tr[Gft]=tr[Vft]=!1;function n0t(e){return Id(e)&&ure(e.length)&&!!tr[Nd(e)]}function A6(e){return function(t){return e(t)}}var dre=typeof exports=="object"&&exports&&!exports.nodeType&&exports,mh=dre&&typeof module=="object"&&module&&!module.nodeType&&module,r0t=mh&&mh.exports===dre,pN=r0t&&Jne.process,a0t=function(){try{var e=mh&&mh.require&&mh.require("util").types;return e||pN&&pN.binding&&pN.binding("util")}catch{}}();const Mf=a0t;var FG=Mf&&Mf.isTypedArray,i0t=FG?A6(FG):n0t;const o0t=i0t;var s0t=Object.prototype,l0t=s0t.hasOwnProperty;function pre(e,t){var n=r_(e),r=!n&&yft(e),a=!n&&!r&&cre(e),i=!n&&!r&&!a&&o0t(e),o=n||r||a||i,s=o?_ft(e.length,String):[],l=s.length;for(var c in e)(t||l0t.call(e,c))&&!(o&&(c=="length"||a&&(c=="offset"||c=="parent")||i&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Ift(c,l)))&&s.push(c);return s}var c0t=Object.prototype;function O6(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||c0t;return e===n}var u0t=tre(Object.keys,Object);const d0t=u0t;var p0t=Object.prototype,f0t=p0t.hasOwnProperty;function m0t(e){if(!O6(e))return d0t(e);var t=[];for(var n in Object(e))f0t.call(e,n)&&n!="constructor"&&t.push(n);return t}function fre(e){return e!=null&&ure(e.length)&&!are(e)}function N6(e){return fre(e)?pre(e):m0t(e)}function h0t(e,t){return e&&rT(t,N6(t),e)}function g0t(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var _0t=Object.prototype,E0t=_0t.hasOwnProperty;function b0t(e){if(!n_(e))return g0t(e);var t=O6(e),n=[];for(var r in e)r=="constructor"&&(t||!E0t.call(e,r))||n.push(r);return n}function I6(e){return fre(e)?pre(e,!0):b0t(e)}function S0t(e,t){return e&&rT(t,I6(t),e)}var mre=typeof exports=="object"&&exports&&!exports.nodeType&&exports,BG=mre&&typeof module=="object"&&module&&!module.nodeType&&module,v0t=BG&&BG.exports===mre,UG=v0t?Js.Buffer:void 0,$G=UG?UG.allocUnsafe:void 0;function y0t(e,t){if(t)return e.slice();var n=e.length,r=$G?$G(n):new e.constructor(n);return e.copy(r),r}function hre(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}function T0t(e,t){for(var n=-1,r=e==null?0:e.length,a=0,i=[];++n<r;){var o=e[n];t(o,n,e)&&(i[a++]=o)}return i}function gre(){return[]}var C0t=Object.prototype,R0t=C0t.propertyIsEnumerable,zG=Object.getOwnPropertySymbols,x0t=zG?function(e){return e==null?[]:(e=Object(e),T0t(zG(e),function(t){return R0t.call(e,t)}))}:gre;const w6=x0t;function A0t(e,t){return rT(e,w6(e),t)}function _re(e,t){for(var n=-1,r=t.length,a=e.length;++n<r;)e[a+n]=t[n];return e}var O0t=Object.getOwnPropertySymbols,N0t=O0t?function(e){for(var t=[];e;)_re(t,w6(e)),e=x6(e);return t}:gre;const Ere=N0t;function I0t(e,t){return rT(e,Ere(e),t)}function bre(e,t,n){var r=t(e);return r_(e)?r:_re(r,n(e))}function w0t(e){return bre(e,N6,w6)}function D0t(e){return bre(e,I6,Ere)}var L0t=Dd(Js,"DataView");const l3=L0t;var M0t=Dd(Js,"Promise");const c3=M0t;var k0t=Dd(Js,"Set");const u3=k0t;var P0t=Dd(Js,"WeakMap");const d3=P0t;var HG="[object Map]",F0t="[object Object]",GG="[object Promise]",VG="[object Set]",YG="[object WeakMap]",qG="[object DataView]",B0t=wd(l3),U0t=wd(ig),$0t=wd(c3),z0t=wd(u3),H0t=wd(d3),Pu=Nd;(l3&&Pu(new l3(new ArrayBuffer(1)))!=qG||ig&&Pu(new ig)!=HG||c3&&Pu(c3.resolve())!=GG||u3&&Pu(new u3)!=VG||d3&&Pu(new d3)!=YG)&&(Pu=function(e){var t=Nd(e),n=t==F0t?e.constructor:void 0,r=n?wd(n):"";if(r)switch(r){case B0t:return qG;case U0t:return HG;case $0t:return GG;case z0t:return VG;case H0t:return YG}return t});const D6=Pu;var G0t=Object.prototype,V0t=G0t.hasOwnProperty;function Y0t(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&V0t.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var q0t=Js.Uint8Array;const WG=q0t;function L6(e){var t=new e.constructor(e.byteLength);return new WG(t).set(new WG(e)),t}function W0t(e,t){var n=t?L6(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var j0t=/\w*$/;function K0t(e){var t=new e.constructor(e.source,j0t.exec(e));return t.lastIndex=e.lastIndex,t}var jG=Xc?Xc.prototype:void 0,KG=jG?jG.valueOf:void 0;function Q0t(e){return KG?Object(KG.call(e)):{}}function X0t(e,t){var n=t?L6(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var Z0t="[object Boolean]",J0t="[object Date]",emt="[object Map]",tmt="[object Number]",nmt="[object RegExp]",rmt="[object Set]",amt="[object String]",imt="[object Symbol]",omt="[object ArrayBuffer]",smt="[object DataView]",lmt="[object Float32Array]",cmt="[object Float64Array]",umt="[object Int8Array]",dmt="[object Int16Array]",pmt="[object Int32Array]",fmt="[object Uint8Array]",mmt="[object Uint8ClampedArray]",hmt="[object Uint16Array]",gmt="[object Uint32Array]";function _mt(e,t,n){var r=e.constructor;switch(t){case omt:return L6(e);case Z0t:case J0t:return new r(+e);case smt:return W0t(e,n);case lmt:case cmt:case umt:case dmt:case pmt:case fmt:case mmt:case hmt:case gmt:return X0t(e,n);case emt:return new r;case tmt:case amt:return new r(e);case nmt:return K0t(e);case rmt:return new r;case imt:return Q0t(e)}}var QG=Object.create,Emt=function(){function e(){}return function(t){if(!n_(t))return{};if(QG)return QG(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();const bmt=Emt;function Smt(e){return typeof e.constructor=="function"&&!O6(e)?bmt(x6(e)):{}}var vmt="[object Map]";function ymt(e){return Id(e)&&D6(e)==vmt}var XG=Mf&&Mf.isMap,Tmt=XG?A6(XG):ymt;const Cmt=Tmt;var Rmt="[object Set]";function xmt(e){return Id(e)&&D6(e)==Rmt}var ZG=Mf&&Mf.isSet,Amt=ZG?A6(ZG):xmt;const Omt=Amt;var Nmt=1,Imt=2,wmt=4,Sre="[object Arguments]",Dmt="[object Array]",Lmt="[object Boolean]",Mmt="[object Date]",kmt="[object Error]",vre="[object Function]",Pmt="[object GeneratorFunction]",Fmt="[object Map]",Bmt="[object Number]",yre="[object Object]",Umt="[object RegExp]",$mt="[object Set]",zmt="[object String]",Hmt="[object Symbol]",Gmt="[object WeakMap]",Vmt="[object ArrayBuffer]",Ymt="[object DataView]",qmt="[object Float32Array]",Wmt="[object Float64Array]",jmt="[object Int8Array]",Kmt="[object Int16Array]",Qmt="[object Int32Array]",Xmt="[object Uint8Array]",Zmt="[object Uint8ClampedArray]",Jmt="[object Uint16Array]",eht="[object Uint32Array]",Yn={};Yn[Sre]=Yn[Dmt]=Yn[Vmt]=Yn[Ymt]=Yn[Lmt]=Yn[Mmt]=Yn[qmt]=Yn[Wmt]=Yn[jmt]=Yn[Kmt]=Yn[Qmt]=Yn[Fmt]=Yn[Bmt]=Yn[yre]=Yn[Umt]=Yn[$mt]=Yn[zmt]=Yn[Hmt]=Yn[Xmt]=Yn[Zmt]=Yn[Jmt]=Yn[eht]=!0;Yn[kmt]=Yn[vre]=Yn[Gmt]=!1;function JE(e,t,n,r,a,i){var o,s=t&Nmt,l=t&Imt,c=t&wmt;if(n&&(o=a?n(e,r,a,i):n(e)),o!==void 0)return o;if(!n_(e))return e;var u=r_(e);if(u){if(o=Y0t(e),!s)return hre(e,o)}else{var p=D6(e),f=p==vre||p==Pmt;if(cre(e))return y0t(e,s);if(p==yre||p==Sre||f&&!a){if(o=l||f?{}:Smt(e),!s)return l?I0t(e,S0t(o,e)):A0t(e,h0t(o,e))}else{if(!Yn[p])return a?e:{};o=_mt(e,p,s)}}i||(i=new m0);var h=i.get(e);if(h)return h;i.set(e,o),Omt(e)?e.forEach(function(y){o.add(JE(y,t,n,y,e,i))}):Cmt(e)&&e.forEach(function(y,b){o.set(b,JE(y,t,n,b,e,i))});var g=c?l?D0t:w0t:l?I6:N6,E=u?void 0:g(e);return fft(E||e,function(y,b){E&&(b=y,y=e[b]),ore(o,b,JE(y,t,n,b,e,i))}),o}var tht=4;function JG(e){return JE(e,tht)}function Tre(e,t){for(var n=-1,r=e==null?0:e.length,a=Array(r);++n<r;)a[n]=t(e[n],n,e);return a}var nht="[object Symbol]";function M6(e){return typeof e=="symbol"||Id(e)&&Nd(e)==nht}var rht="Expected a function";function k6(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(rht);var n=function(){var r=arguments,a=t?t.apply(this,r):r[0],i=n.cache;if(i.has(a))return i.get(a);var o=e.apply(this,r);return n.cache=i.set(a,o)||i,o};return n.cache=new(k6.Cache||mu),n}k6.Cache=mu;var aht=500;function iht(e){var t=k6(e,function(r){return n.size===aht&&n.clear(),r}),n=t.cache;return t}var oht=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,sht=/\\(\\)?/g,lht=iht(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(oht,function(n,r,a,i){t.push(a?i.replace(sht,"$1"):r||n)}),t});const cht=lht;var uht=1/0;function dht(e){if(typeof e=="string"||M6(e))return e;var t=e+"";return t=="0"&&1/e==-uht?"-0":t}var pht=1/0,eV=Xc?Xc.prototype:void 0,tV=eV?eV.toString:void 0;function Cre(e){if(typeof e=="string")return e;if(r_(e))return Tre(e,Cre)+"";if(M6(e))return tV?tV.call(e):"";var t=e+"";return t=="0"&&1/e==-pht?"-0":t}function fht(e){return e==null?"":Cre(e)}function Rre(e){return r_(e)?Tre(e,dht):M6(e)?[e]:hre(cht(fht(e)))}function ta(){return ta=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ta.apply(this,arguments)}function xre(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,i;for(i=0;i<r.length;i++)a=r[i],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}var aT=x.createContext(void 0);aT.displayName="FormikContext";aT.Provider;aT.Consumer;function mht(){var e=x.useContext(aT);return e||_pt(!1),e}var Zo=function(t){return typeof t=="function"},iT=function(t){return t!==null&&typeof t=="object"},hht=function(t){return String(Math.floor(Number(t)))===t},fN=function(t){return Object.prototype.toString.call(t)==="[object String]"},mN=function(t){return iT(t)&&Zo(t.then)};function Hi(e,t,n,r){r===void 0&&(r=0);for(var a=Rre(t);e&&r<a.length;)e=e[a[r++]];return r!==a.length&&!e||e===void 0?n:e}function Ju(e,t,n){for(var r=JG(e),a=r,i=0,o=Rre(t);i<o.length-1;i++){var s=o[i],l=Hi(e,o.slice(0,i+1));if(l&&(iT(l)||Array.isArray(l)))a=a[s]=JG(l);else{var c=o[i+1];a=a[s]=hht(c)&&Number(c)>=0?[]:{}}}return(i===0?e:a)[o[i]]===n?e:(n===void 0?delete a[o[i]]:a[o[i]]=n,i===0&&n===void 0&&delete r[o[i]],r)}function Are(e,t,n,r){n===void 0&&(n=new WeakMap),r===void 0&&(r={});for(var a=0,i=Object.keys(e);a<i.length;a++){var o=i[a],s=e[o];iT(s)?n.get(s)||(n.set(s,!0),r[o]=Array.isArray(s)?[]:{},Are(s,t,n,r[o])):r[o]=t}return r}function ght(e,t){switch(t.type){case"SET_VALUES":return ta({},e,{values:t.payload});case"SET_TOUCHED":return ta({},e,{touched:t.payload});case"SET_ERRORS":return ku(e.errors,t.payload)?e:ta({},e,{errors:t.payload});case"SET_STATUS":return ta({},e,{status:t.payload});case"SET_ISSUBMITTING":return ta({},e,{isSubmitting:t.payload});case"SET_ISVALIDATING":return ta({},e,{isValidating:t.payload});case"SET_FIELD_VALUE":return ta({},e,{values:Ju(e.values,t.payload.field,t.payload.value)});case"SET_FIELD_TOUCHED":return ta({},e,{touched:Ju(e.touched,t.payload.field,t.payload.value)});case"SET_FIELD_ERROR":return ta({},e,{errors:Ju(e.errors,t.payload.field,t.payload.value)});case"RESET_FORM":return ta({},e,t.payload);case"SET_FORMIK_STATE":return t.payload(e);case"SUBMIT_ATTEMPT":return ta({},e,{touched:Are(e.values,!0),isSubmitting:!0,submitCount:e.submitCount+1});case"SUBMIT_FAILURE":return ta({},e,{isSubmitting:!1});case"SUBMIT_SUCCESS":return ta({},e,{isSubmitting:!1});default:return e}}var Nu={},bE={};function P6(e){var t=e.validateOnChange,n=t===void 0?!0:t,r=e.validateOnBlur,a=r===void 0?!0:r,i=e.validateOnMount,o=i===void 0?!1:i,s=e.isInitialValid,l=e.enableReinitialize,c=l===void 0?!1:l,u=e.onSubmit,p=xre(e,["validateOnChange","validateOnBlur","validateOnMount","isInitialValid","enableReinitialize","onSubmit"]),f=ta({validateOnChange:n,validateOnBlur:a,validateOnMount:o,onSubmit:u},p),h=x.useRef(f.initialValues),g=x.useRef(f.initialErrors||Nu),E=x.useRef(f.initialTouched||bE),y=x.useRef(f.initialStatus),b=x.useRef(!1),v=x.useRef({});x.useEffect(function(){return b.current=!0,function(){b.current=!1}},[]);var C=x.useState(0),T=C[1],N=x.useRef({values:f.initialValues,errors:f.initialErrors||Nu,touched:f.initialTouched||bE,status:f.initialStatus,isSubmitting:!1,isValidating:!1,submitCount:0}),A=N.current,O=x.useCallback(function(se){var Fe=N.current;N.current=ght(Fe,se),Fe!==N.current&&T(function(ge){return ge+1})},[]),M=x.useCallback(function(se,Fe){return new Promise(function(ge,oe){var re=f.validate(se,Fe);re==null?ge(Nu):mN(re)?re.then(function(J){ge(J||Nu)},function(J){oe(J)}):ge(re)})},[f.validate]),P=x.useCallback(function(se,Fe){var ge=f.validationSchema,oe=Zo(ge)?ge(Fe):ge,re=Fe&&oe.validateAt?oe.validateAt(Fe,se):Eht(se,oe);return new Promise(function(J,ue){re.then(function(){J(Nu)},function(ve){ve.name==="ValidationError"?J(_ht(ve)):ue(ve)})})},[f.validationSchema]),D=x.useCallback(function(se,Fe){return new Promise(function(ge){return ge(v.current[se].validate(Fe))})},[]),$=x.useCallback(function(se){var Fe=Object.keys(v.current).filter(function(oe){return Zo(v.current[oe].validate)}),ge=Fe.length>0?Fe.map(function(oe){return D(oe,Hi(se,oe))}):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(ge).then(function(oe){return oe.reduce(function(re,J,ue){return J==="DO_NOT_DELETE_YOU_WILL_BE_FIRED"||J&&(re=Ju(re,Fe[ue],J)),re},{})})},[D]),V=x.useCallback(function(se){return Promise.all([$(se),f.validationSchema?P(se):{},f.validate?M(se):{}]).then(function(Fe){var ge=Fe[0],oe=Fe[1],re=Fe[2],J=o3.all([ge,oe,re],{arrayMerge:bht});return J})},[f.validate,f.validationSchema,$,M,P]),Z=ho(function(se){return se===void 0&&(se=A.values),O({type:"SET_ISVALIDATING",payload:!0}),V(se).then(function(Fe){return b.current&&(O({type:"SET_ISVALIDATING",payload:!1}),O({type:"SET_ERRORS",payload:Fe})),Fe})});x.useEffect(function(){o&&b.current===!0&&ku(h.current,f.initialValues)&&Z(h.current)},[o,Z]);var W=x.useCallback(function(se){var Fe=se&&se.values?se.values:h.current,ge=se&&se.errors?se.errors:g.current?g.current:f.initialErrors||{},oe=se&&se.touched?se.touched:E.current?E.current:f.initialTouched||{},re=se&&se.status?se.status:y.current?y.current:f.initialStatus;h.current=Fe,g.current=ge,E.current=oe,y.current=re;var J=function(){O({type:"RESET_FORM",payload:{isSubmitting:!!se&&!!se.isSubmitting,errors:ge,touched:oe,status:re,values:Fe,isValidating:!!se&&!!se.isValidating,submitCount:se&&se.submitCount&&typeof se.submitCount=="number"?se.submitCount:0}})};if(f.onReset){var ue=f.onReset(A.values,we);mN(ue)?ue.then(J):J()}else J()},[f.initialErrors,f.initialStatus,f.initialTouched]);x.useEffect(function(){b.current===!0&&!ku(h.current,f.initialValues)&&c&&(h.current=f.initialValues,W(),o&&Z(h.current))},[c,f.initialValues,W,o,Z]),x.useEffect(function(){c&&b.current===!0&&!ku(g.current,f.initialErrors)&&(g.current=f.initialErrors||Nu,O({type:"SET_ERRORS",payload:f.initialErrors||Nu}))},[c,f.initialErrors]),x.useEffect(function(){c&&b.current===!0&&!ku(E.current,f.initialTouched)&&(E.current=f.initialTouched||bE,O({type:"SET_TOUCHED",payload:f.initialTouched||bE}))},[c,f.initialTouched]),x.useEffect(function(){c&&b.current===!0&&!ku(y.current,f.initialStatus)&&(y.current=f.initialStatus,O({type:"SET_STATUS",payload:f.initialStatus}))},[c,f.initialStatus,f.initialTouched]);var ae=ho(function(se){if(v.current[se]&&Zo(v.current[se].validate)){var Fe=Hi(A.values,se),ge=v.current[se].validate(Fe);return mN(ge)?(O({type:"SET_ISVALIDATING",payload:!0}),ge.then(function(oe){return oe}).then(function(oe){O({type:"SET_FIELD_ERROR",payload:{field:se,value:oe}}),O({type:"SET_ISVALIDATING",payload:!1})})):(O({type:"SET_FIELD_ERROR",payload:{field:se,value:ge}}),Promise.resolve(ge))}else if(f.validationSchema)return O({type:"SET_ISVALIDATING",payload:!0}),P(A.values,se).then(function(oe){return oe}).then(function(oe){O({type:"SET_FIELD_ERROR",payload:{field:se,value:Hi(oe,se)}}),O({type:"SET_ISVALIDATING",payload:!1})});return Promise.resolve()}),he=x.useCallback(function(se,Fe){var ge=Fe.validate;v.current[se]={validate:ge}},[]),q=x.useCallback(function(se){delete v.current[se]},[]),G=ho(function(se,Fe){O({type:"SET_TOUCHED",payload:se});var ge=Fe===void 0?a:Fe;return ge?Z(A.values):Promise.resolve()}),H=x.useCallback(function(se){O({type:"SET_ERRORS",payload:se})},[]),k=ho(function(se,Fe){var ge=Zo(se)?se(A.values):se;O({type:"SET_VALUES",payload:ge});var oe=Fe===void 0?n:Fe;return oe?Z(ge):Promise.resolve()}),ie=x.useCallback(function(se,Fe){O({type:"SET_FIELD_ERROR",payload:{field:se,value:Fe}})},[]),j=ho(function(se,Fe,ge){O({type:"SET_FIELD_VALUE",payload:{field:se,value:Fe}});var oe=ge===void 0?n:ge;return oe?Z(Ju(A.values,se,Fe)):Promise.resolve()}),F=x.useCallback(function(se,Fe){var ge=Fe,oe=se,re;if(!fN(se)){se.persist&&se.persist();var J=se.target?se.target:se.currentTarget,ue=J.type,ve=J.name,Ve=J.id,ot=J.value,qe=J.checked,Et=J.outerHTML,be=J.options,Q=J.multiple;ge=Fe||ve||Ve,oe=/number|range/.test(ue)?(re=parseFloat(ot),isNaN(re)?"":re):/checkbox/.test(ue)?vht(Hi(A.values,ge),qe,ot):be&&Q?Sht(be):ot}ge&&j(ge,oe)},[j,A.values]),le=ho(function(se){if(fN(se))return function(Fe){return F(Fe,se)};F(se)}),Te=ho(function(se,Fe,ge){Fe===void 0&&(Fe=!0),O({type:"SET_FIELD_TOUCHED",payload:{field:se,value:Fe}});var oe=ge===void 0?a:ge;return oe?Z(A.values):Promise.resolve()}),fe=x.useCallback(function(se,Fe){se.persist&&se.persist();var ge=se.target,oe=ge.name,re=ge.id,J=ge.outerHTML,ue=Fe||oe||re;Te(ue,!0)},[Te]),Ae=ho(function(se){if(fN(se))return function(Fe){return fe(Fe,se)};fe(se)}),Ce=x.useCallback(function(se){Zo(se)?O({type:"SET_FORMIK_STATE",payload:se}):O({type:"SET_FORMIK_STATE",payload:function(){return se}})},[]),Ne=x.useCallback(function(se){O({type:"SET_STATUS",payload:se})},[]),ze=x.useCallback(function(se){O({type:"SET_ISSUBMITTING",payload:se})},[]),Ue=ho(function(){return O({type:"SUBMIT_ATTEMPT"}),Z().then(function(se){var Fe=se instanceof Error,ge=!Fe&&Object.keys(se).length===0;if(ge){var oe;try{if(oe=Pe(),oe===void 0)return}catch(re){throw re}return Promise.resolve(oe).then(function(re){return b.current&&O({type:"SUBMIT_SUCCESS"}),re}).catch(function(re){if(b.current)throw O({type:"SUBMIT_FAILURE"}),re})}else if(b.current&&(O({type:"SUBMIT_FAILURE"}),Fe))throw se})}),Le=ho(function(se){se&&se.preventDefault&&Zo(se.preventDefault)&&se.preventDefault(),se&&se.stopPropagation&&Zo(se.stopPropagation)&&se.stopPropagation(),Ue().catch(function(Fe){console.warn("Warning: An unhandled error was caught from submitForm()",Fe)})}),we={resetForm:W,validateForm:Z,validateField:ae,setErrors:H,setFieldError:ie,setFieldTouched:Te,setFieldValue:j,setStatus:Ne,setSubmitting:ze,setTouched:G,setValues:k,setFormikState:Ce,submitForm:Ue},Pe=ho(function(){return u(A.values,we)}),Me=ho(function(se){se&&se.preventDefault&&Zo(se.preventDefault)&&se.preventDefault(),se&&se.stopPropagation&&Zo(se.stopPropagation)&&se.stopPropagation(),W()}),lt=x.useCallback(function(se){return{value:Hi(A.values,se),error:Hi(A.errors,se),touched:!!Hi(A.touched,se),initialValue:Hi(h.current,se),initialTouched:!!Hi(E.current,se),initialError:Hi(g.current,se)}},[A.errors,A.touched,A.values]),it=x.useCallback(function(se){return{setValue:function(ge,oe){return j(se,ge,oe)},setTouched:function(ge,oe){return Te(se,ge,oe)},setError:function(ge){return ie(se,ge)}}},[j,Te,ie]),nt=x.useCallback(function(se){var Fe=iT(se),ge=Fe?se.name:se,oe=Hi(A.values,ge),re={name:ge,value:oe,onChange:le,onBlur:Ae};if(Fe){var J=se.type,ue=se.value,ve=se.as,Ve=se.multiple;J==="checkbox"?ue===void 0?re.checked=!!oe:(re.checked=!!(Array.isArray(oe)&&~oe.indexOf(ue)),re.value=ue):J==="radio"?(re.checked=oe===ue,re.value=ue):ve==="select"&&Ve&&(re.value=re.value||[],re.multiple=!0)}return re},[Ae,le,A.values]),Ge=x.useMemo(function(){return!ku(h.current,A.values)},[h.current,A.values]),at=x.useMemo(function(){return typeof s<"u"?Ge?A.errors&&Object.keys(A.errors).length===0:s!==!1&&Zo(s)?s(f):s:A.errors&&Object.keys(A.errors).length===0},[s,Ge,A.errors,f]),ct=ta({},A,{initialValues:h.current,initialErrors:g.current,initialTouched:E.current,initialStatus:y.current,handleBlur:Ae,handleChange:le,handleReset:Me,handleSubmit:Le,resetForm:W,setErrors:H,setFormikState:Ce,setFieldTouched:Te,setFieldValue:j,setFieldError:ie,setStatus:Ne,setSubmitting:ze,setTouched:G,setValues:k,submitForm:Ue,validateForm:Z,validateField:ae,isValid:at,dirty:Ge,unregisterField:q,registerField:he,getFieldProps:nt,getFieldMeta:lt,getFieldHelpers:it,validateOnBlur:a,validateOnChange:n,validateOnMount:o});return ct}function _ht(e){var t={};if(e.inner){if(e.inner.length===0)return Ju(t,e.path,e.message);for(var a=e.inner,n=Array.isArray(a),r=0,a=n?a:a[Symbol.iterator]();;){var i;if(n){if(r>=a.length)break;i=a[r++]}else{if(r=a.next(),r.done)break;i=r.value}var o=i;Hi(t,o.path)||(t=Ju(t,o.path,o.message))}}return t}function Eht(e,t,n,r){n===void 0&&(n=!1);var a=p3(e);return t[n?"validateSync":"validate"](a,{abortEarly:!1,context:r||a})}function p3(e){var t=Array.isArray(e)?[]:{};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=String(n);Array.isArray(e[r])===!0?t[r]=e[r].map(function(a){return Array.isArray(a)===!0||NG(a)?p3(a):a!==""?a:void 0}):NG(e[r])?t[r]=p3(e[r]):t[r]=e[r]!==""?e[r]:void 0}return t}function bht(e,t,n){var r=e.slice();return t.forEach(function(i,o){if(typeof r[o]>"u"){var s=n.clone!==!1,l=s&&n.isMergeableObject(i);r[o]=l?o3(Array.isArray(i)?[]:{},i,n):i}else n.isMergeableObject(i)?r[o]=o3(e[o],i,n):e.indexOf(i)===-1&&r.push(i)}),r}function Sht(e){return Array.from(e).filter(function(t){return t.selected}).map(function(t){return t.value})}function vht(e,t,n){if(typeof e=="boolean")return!!t;var r=[],a=!1,i=-1;if(Array.isArray(e))r=e,i=e.indexOf(n),a=i>=0;else if(!n||n=="true"||n=="false")return!!t;return t&&n&&!a?r.concat(n):a?r.slice(0,i).concat(r.slice(i+1)):r}var yht=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?x.useLayoutEffect:x.useEffect;function ho(e){var t=x.useRef(e);return yht(function(){t.current=e}),x.useCallback(function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return t.current.apply(void 0,r)},[])}var Tht=x.forwardRef(function(e,t){var n=e.action,r=xre(e,["action"]),a=n??"#",i=mht(),o=i.handleReset,s=i.handleSubmit;return x.createElement("form",ta({onSubmit:s,ref:t,onReset:o,action:a},r))});Tht.displayName="Form";function Ld(e){this._maxSize=e,this.clear()}Ld.prototype.clear=function(){this._size=0,this._values=Object.create(null)};Ld.prototype.get=function(e){return this._values[e]};Ld.prototype.set=function(e,t){return this._size>=this._maxSize&&this.clear(),e in this._values||this._size++,this._values[e]=t};var Cht=/[^.^\]^[]+|(?=\[\]|\.\.)/g,Ore=/^\d+$/,Rht=/^\d/,xht=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,Aht=/^\s*(['"]?)(.*?)(\1)\s*$/,F6=512,nV=new Ld(F6),rV=new Ld(F6),aV=new Ld(F6),ed={Cache:Ld,split:f3,normalizePath:hN,setter:function(e){var t=hN(e);return rV.get(e)||rV.set(e,function(r,a){for(var i=0,o=t.length,s=r;i<o-1;){var l=t[i];if(l==="__proto__"||l==="constructor"||l==="prototype")return r;s=s[t[i++]]}s[t[i]]=a})},getter:function(e,t){var n=hN(e);return aV.get(e)||aV.set(e,function(a){for(var i=0,o=n.length;i<o;)if(a!=null||!t)a=a[n[i++]];else return;return a})},join:function(e){return e.reduce(function(t,n){return t+(B6(n)||Ore.test(n)?"["+n+"]":(t?".":"")+n)},"")},forEach:function(e,t,n){Oht(Array.isArray(e)?e:f3(e),t,n)}};function hN(e){return nV.get(e)||nV.set(e,f3(e).map(function(t){return t.replace(Aht,"$2")}))}function f3(e){return e.match(Cht)||[""]}function Oht(e,t,n){var r=e.length,a,i,o,s;for(i=0;i<r;i++)a=e[i],a&&(wht(a)&&(a='"'+a+'"'),s=B6(a),o=!s&&/^\d+$/.test(a),t.call(n,a,s,o,i,e))}function B6(e){return typeof e=="string"&&e&&["'",'"'].indexOf(e.charAt(0))!==-1}function Nht(e){return e.match(Rht)&&!e.match(Ore)}function Iht(e){return xht.test(e)}function wht(e){return!B6(e)&&(Nht(e)||Iht(e))}const Dht=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,oT=e=>e.match(Dht)||[],sT=e=>e[0].toUpperCase()+e.slice(1),U6=(e,t)=>oT(e).join(t).toLowerCase(),Nre=e=>oT(e).reduce((t,n)=>`${t}${t?n[0].toUpperCase()+n.slice(1).toLowerCase():n.toLowerCase()}`,""),Lht=e=>sT(Nre(e)),Mht=e=>U6(e,"_"),kht=e=>U6(e,"-"),Pht=e=>sT(U6(e," ")),Fht=e=>oT(e).map(sT).join(" ");var gN={words:oT,upperFirst:sT,camelCase:Nre,pascalCase:Lht,snakeCase:Mht,kebabCase:kht,sentenceCase:Pht,titleCase:Fht},$6={exports:{}};$6.exports=function(e){return Ire(Bht(e),e)};$6.exports.array=Ire;function Ire(e,t){var n=e.length,r=new Array(n),a={},i=n,o=Uht(t),s=$ht(e);for(t.forEach(function(c){if(!s.has(c[0])||!s.has(c[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});i--;)a[i]||l(e[i],i,new Set);return r;function l(c,u,p){if(p.has(c)){var f;try{f=", node was:"+JSON.stringify(c)}catch{f=""}throw new Error("Cyclic dependency"+f)}if(!s.has(c))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(c));if(!a[u]){a[u]=!0;var h=o.get(c)||new Set;if(h=Array.from(h),u=h.length){p.add(c);do{var g=h[--u];l(g,s.get(g),p)}while(u);p.delete(c)}r[--n]=c}}}function Bht(e){for(var t=new Set,n=0,r=e.length;n<r;n++){var a=e[n];t.add(a[0]),t.add(a[1])}return Array.from(t)}function Uht(e){for(var t=new Map,n=0,r=e.length;n<r;n++){var a=e[n];t.has(a[0])||t.set(a[0],new Set),t.has(a[1])||t.set(a[1],new Set),t.get(a[0]).add(a[1])}return t}function $ht(e){for(var t=new Map,n=0,r=e.length;n<r;n++)t.set(e[n],n);return t}var zht=$6.exports;const Hht=Aa(zht),Ght=Object.prototype.toString,Vht=Error.prototype.toString,Yht=RegExp.prototype.toString,qht=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",Wht=/^Symbol\((.*)\)(.*)$/;function jht(e){return e!=+e?"NaN":e===0&&1/e<0?"-0":""+e}function iV(e,t=!1){if(e==null||e===!0||e===!1)return""+e;const n=typeof e;if(n==="number")return jht(e);if(n==="string")return t?`"${e}"`:e;if(n==="function")return"[Function "+(e.name||"anonymous")+"]";if(n==="symbol")return qht.call(e).replace(Wht,"Symbol($1)");const r=Ght.call(e).slice(8,-1);return r==="Date"?isNaN(e.getTime())?""+e:e.toISOString(e):r==="Error"||e instanceof Error?"["+Vht.call(e)+"]":r==="RegExp"?Yht.call(e):null}function tf(e,t){let n=iV(e,t);return n!==null?n:JSON.stringify(e,function(r,a){let i=iV(this[r],t);return i!==null?i:a},2)}function wre(e){return e==null?[]:[].concat(e)}let Kht=/\$\{\s*(\w+)\s*\}/g;class qi extends Error{static formatError(t,n){const r=n.label||n.path||"this";return r!==n.path&&(n=Object.assign({},n,{path:r})),typeof t=="string"?t.replace(Kht,(a,i)=>tf(n[i])):typeof t=="function"?t(n):t}static isError(t){return t&&t.name==="ValidationError"}constructor(t,n,r,a){super(),this.value=void 0,this.path=void 0,this.type=void 0,this.errors=void 0,this.params=void 0,this.inner=void 0,this.name="ValidationError",this.value=n,this.path=r,this.type=a,this.errors=[],this.inner=[],wre(t).forEach(i=>{qi.isError(i)?(this.errors.push(...i.errors),this.inner=this.inner.concat(i.inner.length?i.inner:i)):this.errors.push(i)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0],Error.captureStackTrace&&Error.captureStackTrace(this,qi)}}let ml={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:e,type:t,value:n,originalValue:r})=>{const a=r!=null&&r!==n?` (cast from the value \`${tf(r,!0)}\`).`:".";return t!=="mixed"?`${e} must be a \`${t}\` type, but the final value was: \`${tf(n,!0)}\``+a:`${e} must match the configured type. The validated value was: \`${tf(n,!0)}\``+a}},Jo={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},Qht={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},m3={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},Xht={isValue:"${path} field must be ${value}"},h3={noUnknown:"${path} field has unspecified keys: ${unknown}"},Zht={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"};Object.assign(Object.create(null),{mixed:ml,string:Jo,number:Qht,date:m3,object:h3,array:Zht,boolean:Xht});const z6=e=>e&&e.__isYupSchema__;class mS{static fromOptions(t,n){if(!n.then&&!n.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:r,then:a,otherwise:i}=n,o=typeof r=="function"?r:(...s)=>s.every(l=>l===r);return new mS(t,(s,l)=>{var c;let u=o(...s)?a:i;return(c=u==null?void 0:u(l))!=null?c:l})}constructor(t,n){this.fn=void 0,this.refs=t,this.refs=t,this.fn=n}resolve(t,n){let r=this.refs.map(i=>i.getValue(n==null?void 0:n.value,n==null?void 0:n.parent,n==null?void 0:n.context)),a=this.fn(r,t,n);if(a===void 0||a===t)return t;if(!z6(a))throw new TypeError("conditions must return a schema object");return a.resolve(n)}}const SE={context:"$",value:"."};class Md{constructor(t,n={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof t!="string")throw new TypeError("ref must be a string, got: "+t);if(this.key=t.trim(),t==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===SE.context,this.isValue=this.key[0]===SE.value,this.isSibling=!this.isContext&&!this.isValue;let r=this.isContext?SE.context:this.isValue?SE.value:"";this.path=this.key.slice(r.length),this.getter=this.path&&ed.getter(this.path,!0),this.map=n.map}getValue(t,n,r){let a=this.isContext?r:this.isValue?t:n;return this.getter&&(a=this.getter(a||{})),this.map&&(a=this.map(a)),a}cast(t,n){return this.getValue(t,n==null?void 0:n.parent,n==null?void 0:n.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(t){return t&&t.__isYupRef}}Md.prototype.__isYupRef=!0;const Wu=e=>e==null;function up(e){function t({value:n,path:r="",options:a,originalValue:i,schema:o},s,l){const{name:c,test:u,params:p,message:f,skipAbsent:h}=e;let{parent:g,context:E,abortEarly:y=o.spec.abortEarly}=a;function b(D){return Md.isRef(D)?D.getValue(n,g,E):D}function v(D={}){const $=Object.assign({value:n,originalValue:i,label:o.spec.label,path:D.path||r,spec:o.spec},p,D.params);for(const Z of Object.keys($))$[Z]=b($[Z]);const V=new qi(qi.formatError(D.message||f,$),n,$.path,D.type||c);return V.params=$,V}const C=y?s:l;let T={path:r,parent:g,type:c,from:a.from,createError:v,resolve:b,options:a,originalValue:i,schema:o};const N=D=>{qi.isError(D)?C(D):D?l(null):C(v())},A=D=>{qi.isError(D)?C(D):s(D)},O=h&&Wu(n);if(!a.sync){try{Promise.resolve(O?!0:u.call(T,n,T)).then(N,A)}catch(D){A(D)}return}let M;try{var P;if(M=O?!0:u.call(T,n,T),typeof((P=M)==null?void 0:P.then)=="function")throw new Error(`Validation test of type: "${T.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`)}catch(D){A(D);return}N(M)}return t.OPTIONS=e,t}function Jht(e,t,n,r=n){let a,i,o;return t?(ed.forEach(t,(s,l,c)=>{let u=l?s.slice(1,s.length-1):s;e=e.resolve({context:r,parent:a,value:n});let p=e.type==="tuple",f=c?parseInt(u,10):0;if(e.innerType||p){if(p&&!c)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${o}" must contain an index to the tuple element, e.g. "${o}[0]"`);if(n&&f>=n.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${s}, in the path: ${t}. because there is no value at that index. `);a=n,n=n&&n[f],e=p?e.spec.types[f]:e.innerType}if(!c){if(!e.fields||!e.fields[u])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${o} which is a type: "${e.type}")`);a=n,n=n&&n[u],e=e.fields[u]}i=u,o=l?"["+s+"]":"."+s}),{schema:e,parent:a,parentPath:i}):{parent:a,parentPath:t,schema:e}}class hS extends Set{describe(){const t=[];for(const n of this.values())t.push(Md.isRef(n)?n.describe():n);return t}resolveAll(t){let n=[];for(const r of this.values())n.push(t(r));return n}clone(){return new hS(this.values())}merge(t,n){const r=this.clone();return t.forEach(a=>r.add(a)),n.forEach(a=>r.delete(a)),r}}function Bp(e,t=new Map){if(z6(e)||!e||typeof e!="object")return e;if(t.has(e))return t.get(e);let n;if(e instanceof Date)n=new Date(e.getTime()),t.set(e,n);else if(e instanceof RegExp)n=new RegExp(e),t.set(e,n);else if(Array.isArray(e)){n=new Array(e.length),t.set(e,n);for(let r=0;r<e.length;r++)n[r]=Bp(e[r],t)}else if(e instanceof Map){n=new Map,t.set(e,n);for(const[r,a]of e.entries())n.set(r,Bp(a,t))}else if(e instanceof Set){n=new Set,t.set(e,n);for(const r of e)n.add(Bp(r,t))}else if(e instanceof Object){n={},t.set(e,n);for(const[r,a]of Object.entries(e))n[r]=Bp(a,t)}else throw Error(`Unable to clone ${e}`);return n}class Gs{constructor(t){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new hS,this._blacklist=new hS,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(ml.notType)}),this.type=t.type,this._typeCheck=t.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,nullable:!1,optional:!0,coerce:!0},t==null?void 0:t.spec),this.withMutation(n=>{n.nonNullable()})}get _type(){return this.type}clone(t){if(this._mutate)return t&&Object.assign(this.spec,t),this;const n=Object.create(Object.getPrototypeOf(this));return n.type=this.type,n._typeCheck=this._typeCheck,n._whitelist=this._whitelist.clone(),n._blacklist=this._blacklist.clone(),n.internalTests=Object.assign({},this.internalTests),n.exclusiveTests=Object.assign({},this.exclusiveTests),n.deps=[...this.deps],n.conditions=[...this.conditions],n.tests=[...this.tests],n.transforms=[...this.transforms],n.spec=Bp(Object.assign({},this.spec,t)),n}label(t){let n=this.clone();return n.spec.label=t,n}meta(...t){if(t.length===0)return this.spec.meta;let n=this.clone();return n.spec.meta=Object.assign(n.spec.meta||{},t[0]),n}withMutation(t){let n=this._mutate;this._mutate=!0;let r=t(this);return this._mutate=n,r}concat(t){if(!t||t===this)return this;if(t.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${t.type}`);let n=this,r=t.clone();const a=Object.assign({},n.spec,r.spec);return r.spec=a,r.internalTests=Object.assign({},n.internalTests,r.internalTests),r._whitelist=n._whitelist.merge(t._whitelist,t._blacklist),r._blacklist=n._blacklist.merge(t._blacklist,t._whitelist),r.tests=n.tests,r.exclusiveTests=n.exclusiveTests,r.withMutation(i=>{t.tests.forEach(o=>{i.test(o.OPTIONS)})}),r.transforms=[...n.transforms,...r.transforms],r}isType(t){return t==null?!!(this.spec.nullable&&t===null||this.spec.optional&&t===void 0):this._typeCheck(t)}resolve(t){let n=this;if(n.conditions.length){let r=n.conditions;n=n.clone(),n.conditions=[],n=r.reduce((a,i)=>i.resolve(a,t),n),n=n.resolve(t)}return n}resolveOptions(t){var n,r,a;return Object.assign({},t,{from:t.from||[],strict:(n=t.strict)!=null?n:this.spec.strict,abortEarly:(r=t.abortEarly)!=null?r:this.spec.abortEarly,recursive:(a=t.recursive)!=null?a:this.spec.recursive})}cast(t,n={}){let r=this.resolve(Object.assign({value:t},n)),a=n.assert==="ignore-optionality",i=r._cast(t,n);if(n.assert!==!1&&!r.isType(i)){if(a&&Wu(i))return i;let o=tf(t),s=tf(i);throw new TypeError(`The value of ${n.path||"field"} could not be cast to a value that satisfies the schema type: "${r.type}".
710
710
 
711
711
  attempted value: ${o}
712
- `+(s!==o?`result of cast: ${s}`:""))}return i}_cast(t,n){let r=t===void 0?t:this.transforms.reduce((a,i)=>i.call(this,a,t,this),t);return r===void 0&&(r=this.getDefault(n)),r}_validate(t,n={},r,a){let{path:i,originalValue:o=t,strict:s=this.spec.strict}=n,l=t;s||(l=this._cast(l,Object.assign({assert:!1},n)));let c=[];for(let u of Object.values(this.internalTests))u&&c.push(u);this.runTests({path:i,value:l,originalValue:o,options:n,tests:c},r,u=>{if(u.length)return a(u,l);this.runTests({path:i,value:l,originalValue:o,options:n,tests:this.tests},r,a)})}runTests(t,n,r){let a=!1,{tests:i,value:o,originalValue:s,path:l,options:c}=t,u=E=>{a||(a=!0,n(E,o))},p=E=>{a||(a=!0,r(E,o))},f=i.length,h=[];if(!f)return p([]);let g={value:o,originalValue:s,path:l,options:c,schema:this};for(let E=0;E<i.length;E++){const y=i[E];y(g,u,function(v){v&&(h=h.concat(v)),--f<=0&&p(h)})}}asNestedTest({key:t,index:n,parent:r,parentPath:a,originalParent:i,options:o}){const s=t??n;if(s==null)throw TypeError("Must include `key` or `index` for nested validations");const l=typeof s=="number";let c=r[s];const u=Object.assign({},o,{strict:!0,parent:r,value:c,originalValue:i[s],key:void 0,[l?"index":"key"]:s,path:l||s.includes(".")?`${a||""}[${c?s:`"${s}"`}]`:(a?`${a}.`:"")+t});return(p,f,h)=>this.resolve(u)._validate(c,u,f,h)}validate(t,n){let r=this.resolve(Object.assign({},n,{value:t}));return new Promise((a,i)=>r._validate(t,n,(o,s)=>{qi.isError(o)&&(o.value=s),i(o)},(o,s)=>{o.length?i(new qi(o,s)):a(s)}))}validateSync(t,n){let r=this.resolve(Object.assign({},n,{value:t})),a;return r._validate(t,Object.assign({},n,{sync:!0}),(i,o)=>{throw qi.isError(i)&&(i.value=o),i},(i,o)=>{if(i.length)throw new qi(i,t);a=o}),a}isValid(t,n){return this.validate(t,n).then(()=>!0,r=>{if(qi.isError(r))return!1;throw r})}isValidSync(t,n){try{return this.validateSync(t,n),!0}catch(r){if(qi.isError(r))return!1;throw r}}_getDefault(t){let n=this.spec.default;return n==null?n:typeof n=="function"?n.call(this,t):Bp(n)}getDefault(t){return this.resolve(t||{})._getDefault(t)}default(t){return arguments.length===0?this._getDefault():this.clone({default:t})}strict(t=!0){return this.clone({strict:t})}nullability(t,n){const r=this.clone({nullable:t});return r.internalTests.nullable=up({message:n,name:"nullable",test(a){return a===null?this.schema.spec.nullable:!0}}),r}optionality(t,n){const r=this.clone({optional:t});return r.internalTests.optionality=up({message:n,name:"optionality",test(a){return a===void 0?this.schema.spec.optional:!0}}),r}optional(){return this.optionality(!0)}defined(t=ml.defined){return this.optionality(!1,t)}nullable(){return this.nullability(!0)}nonNullable(t=ml.notNull){return this.nullability(!1,t)}required(t=ml.required){return this.clone().withMutation(n=>n.nonNullable(t).defined(t))}notRequired(){return this.clone().withMutation(t=>t.nullable().optional())}transform(t){let n=this.clone();return n.transforms.push(t),n}test(...t){let n;if(t.length===1?typeof t[0]=="function"?n={test:t[0]}:n=t[0]:t.length===2?n={name:t[0],test:t[1]}:n={name:t[0],message:t[1],test:t[2]},n.message===void 0&&(n.message=ml.default),typeof n.test!="function")throw new TypeError("`test` is a required parameters");let r=this.clone(),a=up(n),i=n.exclusive||n.name&&r.exclusiveTests[n.name]===!0;if(n.exclusive&&!n.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return n.name&&(r.exclusiveTests[n.name]=!!n.exclusive),r.tests=r.tests.filter(o=>!(o.OPTIONS.name===n.name&&(i||o.OPTIONS.test===a.OPTIONS.test))),r.tests.push(a),r}when(t,n){!Array.isArray(t)&&typeof t!="string"&&(n=t,t=".");let r=this.clone(),a=wre(t).map(i=>new Md(i));return a.forEach(i=>{i.isSibling&&r.deps.push(i.key)}),r.conditions.push(typeof n=="function"?new mS(a,n):mS.fromOptions(a,n)),r}typeError(t){let n=this.clone();return n.internalTests.typeError=up({message:t,name:"typeError",skipAbsent:!0,test(r){return this.schema._typeCheck(r)?!0:this.createError({params:{type:this.schema.type}})}}),n}oneOf(t,n=ml.oneOf){let r=this.clone();return t.forEach(a=>{r._whitelist.add(a),r._blacklist.delete(a)}),r.internalTests.whiteList=up({message:n,name:"oneOf",skipAbsent:!0,test(a){let i=this.schema._whitelist,o=i.resolveAll(this.resolve);return o.includes(a)?!0:this.createError({params:{values:Array.from(i).join(", "),resolved:o}})}}),r}notOneOf(t,n=ml.notOneOf){let r=this.clone();return t.forEach(a=>{r._blacklist.add(a),r._whitelist.delete(a)}),r.internalTests.blacklist=up({message:n,name:"notOneOf",test(a){let i=this.schema._blacklist,o=i.resolveAll(this.resolve);return o.includes(a)?this.createError({params:{values:Array.from(i).join(", "),resolved:o}}):!0}}),r}strip(t=!0){let n=this.clone();return n.spec.strip=t,n}describe(t){const n=(t?this.resolve(t):this).clone(),{label:r,meta:a,optional:i,nullable:o}=n.spec;return{meta:a,label:r,optional:i,nullable:o,default:n.getDefault(t),type:n.type,oneOf:n._whitelist.describe(),notOneOf:n._blacklist.describe(),tests:n.tests.map(l=>({name:l.OPTIONS.name,params:l.OPTIONS.params})).filter((l,c,u)=>u.findIndex(p=>p.name===l.name)===c)}}}Gs.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])Gs.prototype[`${e}At`]=function(t,n,r={}){const{parent:a,parentPath:i,schema:o}=Jht(this,t,n,r.context);return o[e](a&&a[i],Object.assign({},r,{parent:a,path:t}))};for(const e of["equals","is"])Gs.prototype[e]=Gs.prototype.oneOf;for(const e of["not","nope"])Gs.prototype[e]=Gs.prototype.notOneOf;let egt=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,tgt=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,ngt=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,rgt=e=>Wu(e)||e===e.trim(),agt={}.toString();function gS(){return new Dre}class Dre extends Gs{constructor(){super({type:"string",check(t){return t instanceof String&&(t=t.valueOf()),typeof t=="string"}}),this.withMutation(()=>{this.transform((t,n,r)=>{if(!r.spec.coerce||r.isType(t)||Array.isArray(t))return t;const a=t!=null&&t.toString?t.toString():t;return a===agt?t:a})})}required(t){return super.required(t).withMutation(n=>n.test({message:t||ml.required,name:"required",skipAbsent:!0,test:r=>!!r.length}))}notRequired(){return super.notRequired().withMutation(t=>(t.tests=t.tests.filter(n=>n.OPTIONS.name!=="required"),t))}length(t,n=Jo.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(r){return r.length===this.resolve(t)}})}min(t,n=Jo.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(r){return r.length>=this.resolve(t)}})}max(t,n=Jo.max){return this.test({name:"max",exclusive:!0,message:n,params:{max:t},skipAbsent:!0,test(r){return r.length<=this.resolve(t)}})}matches(t,n){let r=!1,a,i;return n&&(typeof n=="object"?{excludeEmptyString:r=!1,message:a,name:i}=n:a=n),this.test({name:i||"matches",message:a||Jo.matches,params:{regex:t},skipAbsent:!0,test:o=>o===""&&r||o.search(t)!==-1})}email(t=Jo.email){return this.matches(egt,{name:"email",message:t,excludeEmptyString:!0})}url(t=Jo.url){return this.matches(tgt,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=Jo.uuid){return this.matches(ngt,{name:"uuid",message:t,excludeEmptyString:!1})}ensure(){return this.default("").transform(t=>t===null?"":t)}trim(t=Jo.trim){return this.transform(n=>n!=null?n.trim():n).test({message:t,name:"trim",test:rgt})}lowercase(t=Jo.lowercase){return this.transform(n=>Wu(n)?n:n.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>Wu(n)||n===n.toLowerCase()})}uppercase(t=Jo.uppercase){return this.transform(n=>Wu(n)?n:n.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>Wu(n)||n===n.toUpperCase()})}}gS.prototype=Dre.prototype;var igt=/^(\d{4}|[+\-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,\.](\d{1,}))?)?(?:(Z)|([+\-])(\d{2})(?::?(\d{2}))?)?)?$/;function ogt(e){var t=[1,4,5,6,7,10,11],n=0,r,a;if(a=igt.exec(e)){for(var i=0,o;o=t[i];++i)a[o]=+a[o]||0;a[2]=(+a[2]||1)-1,a[3]=+a[3]||1,a[7]=a[7]?String(a[7]).substr(0,3):0,(a[8]===void 0||a[8]==="")&&(a[9]===void 0||a[9]==="")?r=+new Date(a[1],a[2],a[3],a[4],a[5],a[6],a[7]):(a[8]!=="Z"&&a[9]!==void 0&&(n=a[10]*60+a[11],a[9]==="+"&&(n=0-n)),r=Date.UTC(a[1],a[2],a[3],a[4],a[5]+n,a[6],a[7]))}else r=Date.parse?Date.parse(e):NaN;return r}let sgt=new Date(""),lgt=e=>Object.prototype.toString.call(e)==="[object Date]";class lT extends Gs{constructor(){super({type:"date",check(t){return lgt(t)&&!isNaN(t.getTime())}}),this.withMutation(()=>{this.transform((t,n,r)=>!r.spec.coerce||r.isType(t)||t===null?t:(t=ogt(t),isNaN(t)?lT.INVALID_DATE:new Date(t)))})}prepareParam(t,n){let r;if(Md.isRef(t))r=t;else{let a=this.cast(t);if(!this._typeCheck(a))throw new TypeError(`\`${n}\` must be a Date or a value that can be \`cast()\` to a Date`);r=a}return r}min(t,n=m3.min){let r=this.prepareParam(t,"min");return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(a){return a>=this.resolve(r)}})}max(t,n=m3.max){let r=this.prepareParam(t,"max");return this.test({message:n,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(a){return a<=this.resolve(r)}})}}lT.INVALID_DATE=sgt;lT.prototype;function cgt(e,t=[]){let n=[],r=new Set,a=new Set(t.map(([o,s])=>`${o}-${s}`));function i(o,s){let l=ed.split(o)[0];r.add(l),a.has(`${s}-${l}`)||n.push([s,l])}for(const o of Object.keys(e)){let s=e[o];r.add(o),Md.isRef(s)&&s.isSibling?i(s.path,o):z6(s)&&"deps"in s&&s.deps.forEach(l=>i(l,o))}return Hht.array(Array.from(r),n).reverse()}function oV(e,t){let n=1/0;return e.some((r,a)=>{var i;if((i=t.path)!=null&&i.includes(r))return n=a,!0}),n}function Lre(e){return(t,n)=>oV(e,t)-oV(e,n)}const ugt=(e,t,n)=>{if(typeof e!="string")return e;let r=e;try{r=JSON.parse(e)}catch{}return n.isType(r)?r:e};function eb(e){if("fields"in e){const t={};for(const[n,r]of Object.entries(e.fields))t[n]=eb(r);return e.setFields(t)}if(e.type==="array"){const t=e.optional();return t.innerType&&(t.innerType=eb(t.innerType)),t}return e.type==="tuple"?e.optional().clone({types:e.spec.types.map(eb)}):"optional"in e?e.optional():e}const dgt=(e,t)=>{const n=[...ed.normalizePath(t)];if(n.length===1)return n[0]in e;let r=n.pop(),a=ed.getter(ed.join(n),!0)(e);return!!(a&&r in a)};let sV=e=>Object.prototype.toString.call(e)==="[object Object]";function pgt(e,t){let n=Object.keys(e.fields);return Object.keys(t).filter(r=>n.indexOf(r)===-1)}const fgt=Lre([]);function H6(e){return new Mre(e)}class Mre extends Gs{constructor(t){super({type:"object",check(n){return sV(n)||typeof n=="function"}}),this.fields=Object.create(null),this._sortErrors=fgt,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{t&&this.shape(t)})}_cast(t,n={}){var r;let a=super._cast(t,n);if(a===void 0)return this.getDefault(n);if(!this._typeCheck(a))return a;let i=this.fields,o=(r=n.stripUnknown)!=null?r:this.spec.noUnknown,s=[].concat(this._nodes,Object.keys(a).filter(p=>!this._nodes.includes(p))),l={},c=Object.assign({},n,{parent:l,__validating:n.__validating||!1}),u=!1;for(const p of s){let f=i[p],h=p in a;if(f){let g,E=a[p];c.path=(n.path?`${n.path}.`:"")+p,f=f.resolve({value:E,context:n.context,parent:l});let y=f instanceof Gs?f.spec:void 0,b=y==null?void 0:y.strict;if(y!=null&&y.strip){u=u||p in a;continue}g=!n.__validating||!b?f.cast(a[p],c):a[p],g!==void 0&&(l[p]=g)}else h&&!o&&(l[p]=a[p]);(h!==p in l||l[p]!==a[p])&&(u=!0)}return u?l:a}_validate(t,n={},r,a){let{from:i=[],originalValue:o=t,recursive:s=this.spec.recursive}=n;n.from=[{schema:this,value:o},...i],n.__validating=!0,n.originalValue=o,super._validate(t,n,r,(l,c)=>{if(!s||!sV(c)){a(l,c);return}o=o||c;let u=[];for(let p of this._nodes){let f=this.fields[p];!f||Md.isRef(f)||u.push(f.asNestedTest({options:n,key:p,parent:c,parentPath:n.path,originalParent:o}))}this.runTests({tests:u,value:c,originalValue:o,options:n},r,p=>{a(p.sort(this._sortErrors).concat(l),c)})})}clone(t){const n=super.clone(t);return n.fields=Object.assign({},this.fields),n._nodes=this._nodes,n._excludedEdges=this._excludedEdges,n._sortErrors=this._sortErrors,n}concat(t){let n=super.concat(t),r=n.fields;for(let[a,i]of Object.entries(this.fields)){const o=r[a];r[a]=o===void 0?i:o}return n.withMutation(a=>a.setFields(r,[...this._excludedEdges,...t._excludedEdges]))}_getDefault(t){if("default"in this.spec)return super._getDefault(t);if(!this._nodes.length)return;let n={};return this._nodes.forEach(r=>{var a;const i=this.fields[r];let o=t;(a=o)!=null&&a.value&&(o=Object.assign({},o,{parent:o.value,value:o.value[r]})),n[r]=i&&"getDefault"in i?i.getDefault(o):void 0}),n}setFields(t,n){let r=this.clone();return r.fields=t,r._nodes=cgt(t,n),r._sortErrors=Lre(Object.keys(t)),n&&(r._excludedEdges=n),r}shape(t,n=[]){return this.clone().withMutation(r=>{let a=r._excludedEdges;return n.length&&(Array.isArray(n[0])||(n=[n]),a=[...r._excludedEdges,...n]),r.setFields(Object.assign(r.fields,t),a)})}partial(){const t={};for(const[n,r]of Object.entries(this.fields))t[n]="optional"in r&&r.optional instanceof Function?r.optional():r;return this.setFields(t)}deepPartial(){return eb(this)}pick(t){const n={};for(const r of t)this.fields[r]&&(n[r]=this.fields[r]);return this.setFields(n)}omit(t){const n=Object.assign({},this.fields);for(const r of t)delete n[r];return this.setFields(n)}from(t,n,r){let a=ed.getter(t,!0);return this.transform(i=>{if(!i)return i;let o=i;return dgt(i,t)&&(o=Object.assign({},i),r||delete o[t],o[n]=a(i)),o})}json(){return this.transform(ugt)}noUnknown(t=!0,n=h3.noUnknown){typeof t!="boolean"&&(n=t,t=!0);let r=this.test({name:"noUnknown",exclusive:!0,message:n,test(a){if(a==null)return!0;const i=pgt(this.schema,a);return!t||i.length===0||this.createError({params:{unknown:i.join(", ")}})}});return r.spec.noUnknown=t,r}unknown(t=!0,n=h3.noUnknown){return this.noUnknown(!t,n)}transformKeys(t){return this.transform(n=>{if(!n)return n;const r={};for(const a of Object.keys(n))r[t(a)]=n[a];return r})}camelCase(){return this.transformKeys(gN.camelCase)}snakeCase(){return this.transformKeys(gN.snakeCase)}constantCase(){return this.transformKeys(t=>gN.snakeCase(t).toUpperCase())}describe(t){let n=super.describe(t);n.fields={};for(const[a,i]of Object.entries(this.fields)){var r;let o=t;(r=o)!=null&&r.value&&(o=Object.assign({},o,{parent:o.value,value:o.value[a]})),n.fields[a]=i.describe(o)}return n}}H6.prototype=Mre.prototype;function mgt(){const[e,t]=xa(C6),n=yt(Zr),r=du(),a=no(),{t:i}=ql(),o=(n==null?void 0:n.userEnv)||[],s={},l={};o.forEach(f=>{s[f]=e[f]||"",l[f]=gS().required()});const c=H6(l),u=P6({initialValues:s,validationSchema:c,onSubmit:async f=>(localStorage.setItem("userEnv",JSON.stringify(f)),t(f),oa.success(i("pages.Env.savedSuccessfully")),a("/"))});o.length===0&&a("/");const p=f=>{const h=!!u.errors[f];return _.jsx(Lf,{id:f,className:f,label:f,value:u.values[f],size:"medium",hasError:h,description:h?u.errors[f]:"",onChange:g=>u.setFieldValue(f,g.target.value)})};return _.jsxs(_t,{sx:{display:"flex",flexDirection:"column",flexGrow:1},children:[_.jsx(_ne,{}),_.jsxs(_t,{id:"env",display:"flex",flexDirection:"column",flexGrow:1,gap:2,sx:{maxWidth:r,width:"100%",mx:"auto"},children:[_.jsx(fn,{mt:5,fontSize:"18px",fontWeight:700,color:"text.primary",children:_.jsx(Pt,{path:"pages.Env.requiredApiKeys"})}),_.jsx(ms,{severity:"info",children:_.jsx(Pt,{path:"pages.Env.requiredApiKeysInfo"})}),_.jsxs("form",{onSubmit:u.handleSubmit,children:[o.map(f=>p(f)),_.jsx(Ii,{id:"submit-env",fullWidth:!0,type:"submit",variant:"contained",sx:{mt:1},children:"Save"})]})]})]})}let vE;const hgt=new Uint8Array(16);function ggt(){if(!vE&&(vE=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!vE))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return vE(hgt)}const Sa=[];for(let e=0;e<256;++e)Sa.push((e+256).toString(16).slice(1));function _gt(e,t=0){return(Sa[e[t+0]]+Sa[e[t+1]]+Sa[e[t+2]]+Sa[e[t+3]]+"-"+Sa[e[t+4]]+Sa[e[t+5]]+"-"+Sa[e[t+6]]+Sa[e[t+7]]+"-"+Sa[e[t+8]]+Sa[e[t+9]]+"-"+Sa[e[t+10]]+Sa[e[t+11]]+Sa[e[t+12]]+Sa[e[t+13]]+Sa[e[t+14]]+Sa[e[t+15]]).toLowerCase()}const Egt=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),lV={randomUUID:Egt};function _S(e,t,n){if(lV.randomUUID&&!t&&!e)return lV.randomUUID();e=e||{};const r=e.random||(e.rng||ggt)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let a=0;a<16;++a)t[n+a]=r[a];return t}return _gt(r)}function kre({setAutoScroll:e,autoScroll:t,children:n}){const r=x.useRef(),{messages:a}=hs(),{session:i}=Ul();x.useEffect(()=>{e==null||e(!0)},[i==null?void 0:i.socket.id]),x.useEffect(()=>{!r.current||!t||(r.current.scrollTop=r.current.scrollHeight)},[a,t]);const o=()=>{if(!r.current||!e)return;const{scrollTop:s,scrollHeight:l,clientHeight:c}=r.current,u=s+c>=l-10;e(u)};return _.jsx(_t,{ref:r,position:"relative",display:"flex",flexDirection:"column",flexGrow:1,sx:{overflowY:"auto"},onScroll:o,children:n})}const cT=kn({key:"Attachments",default:[]}),bgt=({askUser:e,uploadFile:t,onError:n})=>{const[r,a]=x.useState([]),i=r.some(p=>!p.uploaded),o=r.reduce((p,f)=>p+f.progress/r.length,0),s=p=>{if(i)return;const f=[],h=p.map((g,E)=>{const{xhr:y,promise:b}=t(g,v=>{a(C=>C.map((T,N)=>N===E?{...T,progress:v}:T))});return f.push(b),{progress:0,uploaded:!1,cancel:()=>y.abort()}});Promise.all(f).then(g=>e.callback(g)).catch(g=>{n(`Failed to upload: ${g.message}`),a(E=>(E.forEach(y=>y.cancel()),[]))}),a(h)},l=t6({spec:e.spec,onResolved:s,onError:p=>n(p)});if(!l)return null;const{getRootProps:c,getInputProps:u}=l;return _.jsxs(kt,{sx:{width:"100%",borderRadius:1,backgroundColor:p=>p.palette.background.paper,boxSizing:"border-box",mt:1},direction:"row",alignItems:"center",padding:2,...c({className:"dropzone"}),children:[_.jsx("input",{id:"ask-button-input",...u()}),_.jsxs(kt,{children:[_.jsx(fn,{color:"text.primary",children:"Drag and drop files here"}),_.jsxs(fn,{variant:"caption",color:"text.secondary",children:["Limit ",e.spec.max_size_mb,"mb."]})]}),_.jsx(Ii,{id:i?"ask-upload-button-loading":"ask-upload-button",disabled:i,sx:{ml:"auto !important",textTransform:"capitalize"},variant:"contained",children:i?_.jsx(Ag,{variant:"determinate",value:o,size:20}):"Browse Files"})]})},Sgt=({onError:e})=>{var n;const t=x.useContext(uu);return((n=t.askUser)==null?void 0:n.spec.type)!=="file"||!(t!=null&&t.uploadFile)?null:_.jsx(bgt,{onError:e,uploadFile:t.uploadFile,askUser:t.askUser})},vgt=({author:e,hide:t})=>{const{chatProfile:n}=Ul(),r=yt(Zr),a=x.useMemo(()=>r==null?void 0:r.chatProfiles.find(s=>s.name===n),[r,n]),i=yt(ca),o=x.useMemo(()=>(!e||e===(r==null?void 0:r.ui.name))&&(a!=null&&a.icon)?a.icon:i==null?void 0:i.buildEndpoint(`/avatars/${e||"default"}`),[i,a,r,e]);return _.jsx("span",{className:"message-avatar",children:_.jsx(O5,{sx:{width:"1.6rem",height:"1.6rem",bgcolor:"transparent"},src:t?void 0:o})})},Pre=({action:e,margin:t,onClick:n})=>{var l;const{askUser:r,loading:a}=x.useContext(uu),i=(r==null?void 0:r.spec.type)==="action",o=i&&!((l=r==null?void 0:r.spec.keys)!=null&&l.includes(e.id)),s=()=>{i?r==null||r.callback(e):(e.onClick(),n==null||n())};return _.jsx(Ca,{title:e.description,placement:"top",children:_.jsx("span",{children:_.jsx(Ii,{size:"small",variant:"outlined",sx:{textTransform:"none",margin:t},id:e.id,onClick:s,disabled:a||o,children:e.label||e.name})})})};var G6={},ygt=Qn;Object.defineProperty(G6,"__esModule",{value:!0});var Fre=G6.default=void 0,Tgt=ygt(Xn()),Cgt=_,Rgt=(0,Tgt.default)((0,Cgt.jsx)("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"MoreVert");Fre=G6.default=Rgt;const cV="16px",xgt=({actions:e})=>{const[t,n]=x.useState(null);return _.jsxs(_.Fragment,{children:[_.jsx(Ca,{title:"More Actions",children:_.jsx(zn,{id:"actions-drawer-button",onClick:r=>n(r.currentTarget),children:_.jsx(Fre,{sx:{width:cV,height:cV}})})}),_.jsx(Dg,{id:"actions-menu",anchorEl:t,open:!!t,onClose:()=>n(null),sx:{marginTop:1},slotProps:{paper:{sx:{boxShadow:r=>r.palette.mode==="light"?"0px 2px 4px 0px #0000000D":"0px 10px 10px 0px #0000000D"}}},children:_.jsx(kt,{direction:"column",paddingX:2,gap:1,children:e.map(r=>_.jsx(Pre,{onClick:()=>n(null),action:r,margin:0},r.id))})})]})},Agt=({message:e,actions:t})=>{const n=t.filter(o=>o.forId?o.forId===e.id:!0),r=n.filter(o=>!o.collapsed),a=n.filter(o=>o.collapsed);return r.length||a.length?_.jsx(kt,{direction:"row",spacing:1,alignItems:"start",justifyContent:"space-between",width:"100%",children:_.jsxs(_t,{id:"actions-list",children:[r.map(o=>_.jsx(Pre,{action:o,margin:"2px 8px 6px 0"},o.id)),a.length?_.jsx(xgt,{actions:a}):null]})}):null},Ogt=e=>_.jsx(la,{children:_.jsxs("svg",{...e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[_.jsx("path",{d:"m8 2 1.88 1.88"}),_.jsx("path",{d:"M14.12 3.88 16 2"}),_.jsx("path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1"}),_.jsx("path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6"}),_.jsx("path",{d:"M12 20v-9"}),_.jsx("path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5"}),_.jsx("path",{d:"M6 13H2"}),_.jsx("path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4"}),_.jsx("path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4"}),_.jsx("path",{d:"M22 13h-4"}),_.jsx("path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4"})," "]})}),Ngt=({step:e,debugUrl:t})=>{let n=e.id;n.startsWith("wrap_")&&(n=n.replace("wrap_",""));const r=t.replace("[thread_id]",e.threadId).replace("[step_id]",n);return _.jsx(Ca,{title:"Debug in Literal AI",children:_.jsx(zn,{color:"inherit",className:"debug-button",href:r,target:"_blank",children:_.jsx(Ogt,{sx:{width:"18px",height:"18px"}})})})},Igt=({actions:e,content:t,title:n,...r})=>_.jsx(Og,{...r,fullWidth:!0,sx:{border:a=>a.palette.mode==="dark"?`1px solid ${cK[800]}`:null,borderRadius:1},children:_.jsxs(_t,{bgcolor:"background.paper",children:[n?_.jsx(Ig,{children:_.jsx(_.Fragment,{children:n})}):null,t?_.jsx(Ng,{children:t}):null,e?_.jsx(my,{sx:{padding:a=>a.spacing(0,3,2)},children:_.jsx(_.Fragment,{children:e})}):null]})}),wgt=e=>_.jsx(la,{children:_.jsxs("svg",{...e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[_.jsx("path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z"})," "]})}),Dgt=e=>_.jsx(la,{children:_.jsxs("svg",{...e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[_.jsx("path",{d:"M17 14V2"}),_.jsx("path",{d:"M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22h0a3.13 3.13 0 0 1-3-3.88Z"})]})}),Lgt=e=>_.jsx(la,{children:_.jsxs("svg",{...e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[_.jsx("path",{d:"M7 10v12"}),_.jsx("path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2h0a3.13 3.13 0 0 1 3 3.88Z"})," "]})}),Mgt=e=>_.jsx(la,{children:_.jsxs("svg",{...e,viewBox:"0 0 24 24",fill:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",children:[_.jsx("path",{d:"M17 14V2"}),_.jsx("path",{d:"M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22h0a3.13 3.13 0 0 1-3-3.88Z"})]})}),kgt=e=>_.jsx(la,{children:_.jsxs("svg",{...e,viewBox:"0 0 24 24",fill:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",children:[_.jsx("path",{d:"M7 10v12"}),_.jsx("path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2h0a3.13 3.13 0 0 1 3 3.88Z"})," "]})}),uV="16px",Pgt=({message:e})=>{var N,A;const{onFeedbackUpdated:t,onFeedbackDeleted:n}=x.useContext(uu),[r,a]=x.useState(),[i,o]=x.useState(),s=yt(pv),{idToResume:l}=Ul(),[c,u]=x.useState((N=e.feedback)==null?void 0:N.value),[p,f]=x.useState((A=e.feedback)==null?void 0:A.comment),h=c===0?Mgt:Dgt,g=c===1?kgt:Lgt,E=(O,M)=>{var P;O===void 0?n&&((P=e.feedback)!=null&&P.id)&&n(e,()=>{u(void 0),f(void 0)},e.feedback.id):t&&t(e,()=>{u(O),f(M)},{...e.feedback||{},forId:e.id,threadId:e.threadId,value:O,comment:M})},y=O=>{c===O?E(void 0):a(O)},b=s||l,C=!!e.streaming||!b,T=x.useMemo(()=>{const O={width:uV,height:uV},M=[()=>_.jsx(Ca,{title:"Helpful",children:_.jsx("span",{children:_.jsx(zn,{color:"inherit",disabled:C,className:`positive-feedback-${c===1?"on":"off"}`,onClick:()=>{y(1)},children:_.jsx(g,{sx:O})})})}),()=>_.jsx(Ca,{title:"Not helpful",children:_.jsx("span",{children:_.jsx(zn,{color:"inherit",disabled:C,className:`negative-feedback-${c===-1?"on":"off"}`,onClick:()=>{y(0)},children:_.jsx(h,{sx:O})})})})];return p&&M.push(()=>_.jsx(Ca,{title:"Feedback",children:_.jsx("span",{children:_.jsx(zn,{color:"inherit",disabled:C,onClick:()=>{a(c),o(p)},className:"feedback-comment-edit",children:_.jsx(wgt,{sx:O})})})})),M},[c,p,C]);return _.jsxs(_.Fragment,{children:[_.jsx(kt,{direction:"row",children:T.map((O,M)=>_.jsx(O,{},`feedback-button-${M}`))}),_.jsx(Igt,{maxWidth:"xs",onClose:()=>{a(void 0)},open:r!==void 0,title:_.jsxs(kt,{direction:"row",alignItems:"center",gap:2,children:[r===0?_.jsx(h,{}):_.jsx(g,{}),"Add a comment"]}),content:_.jsx(Lf,{id:"feedbackDescription",value:i,multiline:!0,size:"medium",onChange:O=>{O.target.value===""?o(void 0):o(O.target.value)}}),actions:_.jsx(oS,{id:"feedbackSubmit",type:"submit",variant:"outlined",onClick:()=>{r!=null&&E(r,i),a(void 0),o(void 0)},autoFocus:!0,children:"Submit feedback"})})]})},Fgt=({message:e})=>{const t=Ly(),{showFeedbackButtons:n}=x.useContext(uu),r=yt(Zr),{firstInteraction:a}=hs(),i=e.type==="user_message",o=e.waitForAnswer,s=!!e.output,l=s&&!i&&!o&&!e.disableFeedback,c=n&&!e.disableFeedback&&!i&&!o&&s,u=!!(r!=null&&r.debugUrl)&&!!e.threadId&&!!a;return!(l||u||c)||e.streaming?null:_.jsxs(kt,{sx:{marginLeft:"-8px !important"},alignItems:"center",direction:"row",color:t?Mt[400]:Mt[600],children:[l?_.jsx(vee,{value:e.output}):null,c?_.jsx(Pgt,{message:e}):null,u?_.jsx(Ngt,{debugUrl:r.debugUrl,step:e}):null]})},dV=(e,t)=>!t||!e?!1:t===e.toString(),Bgt=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),pV=({elements:e,content:t,id:n,language:r})=>{const a=e.map(c=>Bgt(c.name));a.sort((c,u)=>u.length-c.length);const i=a.length?new RegExp(`(${a.join("|")})`,"g"):void 0;let o=t?t.trim():"";const s=e.filter(c=>dV(n,c==null?void 0:c.forId)&&c.display==="inline"),l=[];if(i&&(o=o.replaceAll(i,c=>{const u=e.find(h=>{const g=h.name===c,E=dV(n,h==null?void 0:h.forId);return g&&E}),p=!!u,f=(u==null?void 0:u.display)==="inline";return p?f?(s.indexOf(u)===-1&&s.push(u),c):(l.push(u),`[${c}](${c.replaceAll(" ","_")})`):c})),r&&o){const c=`\`\`\`${r}`,u="```";o.startsWith("```")||(o=`${c}
712
+ `+(s!==o?`result of cast: ${s}`:""))}return i}_cast(t,n){let r=t===void 0?t:this.transforms.reduce((a,i)=>i.call(this,a,t,this),t);return r===void 0&&(r=this.getDefault(n)),r}_validate(t,n={},r,a){let{path:i,originalValue:o=t,strict:s=this.spec.strict}=n,l=t;s||(l=this._cast(l,Object.assign({assert:!1},n)));let c=[];for(let u of Object.values(this.internalTests))u&&c.push(u);this.runTests({path:i,value:l,originalValue:o,options:n,tests:c},r,u=>{if(u.length)return a(u,l);this.runTests({path:i,value:l,originalValue:o,options:n,tests:this.tests},r,a)})}runTests(t,n,r){let a=!1,{tests:i,value:o,originalValue:s,path:l,options:c}=t,u=E=>{a||(a=!0,n(E,o))},p=E=>{a||(a=!0,r(E,o))},f=i.length,h=[];if(!f)return p([]);let g={value:o,originalValue:s,path:l,options:c,schema:this};for(let E=0;E<i.length;E++){const y=i[E];y(g,u,function(v){v&&(h=h.concat(v)),--f<=0&&p(h)})}}asNestedTest({key:t,index:n,parent:r,parentPath:a,originalParent:i,options:o}){const s=t??n;if(s==null)throw TypeError("Must include `key` or `index` for nested validations");const l=typeof s=="number";let c=r[s];const u=Object.assign({},o,{strict:!0,parent:r,value:c,originalValue:i[s],key:void 0,[l?"index":"key"]:s,path:l||s.includes(".")?`${a||""}[${c?s:`"${s}"`}]`:(a?`${a}.`:"")+t});return(p,f,h)=>this.resolve(u)._validate(c,u,f,h)}validate(t,n){let r=this.resolve(Object.assign({},n,{value:t}));return new Promise((a,i)=>r._validate(t,n,(o,s)=>{qi.isError(o)&&(o.value=s),i(o)},(o,s)=>{o.length?i(new qi(o,s)):a(s)}))}validateSync(t,n){let r=this.resolve(Object.assign({},n,{value:t})),a;return r._validate(t,Object.assign({},n,{sync:!0}),(i,o)=>{throw qi.isError(i)&&(i.value=o),i},(i,o)=>{if(i.length)throw new qi(i,t);a=o}),a}isValid(t,n){return this.validate(t,n).then(()=>!0,r=>{if(qi.isError(r))return!1;throw r})}isValidSync(t,n){try{return this.validateSync(t,n),!0}catch(r){if(qi.isError(r))return!1;throw r}}_getDefault(t){let n=this.spec.default;return n==null?n:typeof n=="function"?n.call(this,t):Bp(n)}getDefault(t){return this.resolve(t||{})._getDefault(t)}default(t){return arguments.length===0?this._getDefault():this.clone({default:t})}strict(t=!0){return this.clone({strict:t})}nullability(t,n){const r=this.clone({nullable:t});return r.internalTests.nullable=up({message:n,name:"nullable",test(a){return a===null?this.schema.spec.nullable:!0}}),r}optionality(t,n){const r=this.clone({optional:t});return r.internalTests.optionality=up({message:n,name:"optionality",test(a){return a===void 0?this.schema.spec.optional:!0}}),r}optional(){return this.optionality(!0)}defined(t=ml.defined){return this.optionality(!1,t)}nullable(){return this.nullability(!0)}nonNullable(t=ml.notNull){return this.nullability(!1,t)}required(t=ml.required){return this.clone().withMutation(n=>n.nonNullable(t).defined(t))}notRequired(){return this.clone().withMutation(t=>t.nullable().optional())}transform(t){let n=this.clone();return n.transforms.push(t),n}test(...t){let n;if(t.length===1?typeof t[0]=="function"?n={test:t[0]}:n=t[0]:t.length===2?n={name:t[0],test:t[1]}:n={name:t[0],message:t[1],test:t[2]},n.message===void 0&&(n.message=ml.default),typeof n.test!="function")throw new TypeError("`test` is a required parameters");let r=this.clone(),a=up(n),i=n.exclusive||n.name&&r.exclusiveTests[n.name]===!0;if(n.exclusive&&!n.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return n.name&&(r.exclusiveTests[n.name]=!!n.exclusive),r.tests=r.tests.filter(o=>!(o.OPTIONS.name===n.name&&(i||o.OPTIONS.test===a.OPTIONS.test))),r.tests.push(a),r}when(t,n){!Array.isArray(t)&&typeof t!="string"&&(n=t,t=".");let r=this.clone(),a=wre(t).map(i=>new Md(i));return a.forEach(i=>{i.isSibling&&r.deps.push(i.key)}),r.conditions.push(typeof n=="function"?new mS(a,n):mS.fromOptions(a,n)),r}typeError(t){let n=this.clone();return n.internalTests.typeError=up({message:t,name:"typeError",skipAbsent:!0,test(r){return this.schema._typeCheck(r)?!0:this.createError({params:{type:this.schema.type}})}}),n}oneOf(t,n=ml.oneOf){let r=this.clone();return t.forEach(a=>{r._whitelist.add(a),r._blacklist.delete(a)}),r.internalTests.whiteList=up({message:n,name:"oneOf",skipAbsent:!0,test(a){let i=this.schema._whitelist,o=i.resolveAll(this.resolve);return o.includes(a)?!0:this.createError({params:{values:Array.from(i).join(", "),resolved:o}})}}),r}notOneOf(t,n=ml.notOneOf){let r=this.clone();return t.forEach(a=>{r._blacklist.add(a),r._whitelist.delete(a)}),r.internalTests.blacklist=up({message:n,name:"notOneOf",test(a){let i=this.schema._blacklist,o=i.resolveAll(this.resolve);return o.includes(a)?this.createError({params:{values:Array.from(i).join(", "),resolved:o}}):!0}}),r}strip(t=!0){let n=this.clone();return n.spec.strip=t,n}describe(t){const n=(t?this.resolve(t):this).clone(),{label:r,meta:a,optional:i,nullable:o}=n.spec;return{meta:a,label:r,optional:i,nullable:o,default:n.getDefault(t),type:n.type,oneOf:n._whitelist.describe(),notOneOf:n._blacklist.describe(),tests:n.tests.map(l=>({name:l.OPTIONS.name,params:l.OPTIONS.params})).filter((l,c,u)=>u.findIndex(p=>p.name===l.name)===c)}}}Gs.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])Gs.prototype[`${e}At`]=function(t,n,r={}){const{parent:a,parentPath:i,schema:o}=Jht(this,t,n,r.context);return o[e](a&&a[i],Object.assign({},r,{parent:a,path:t}))};for(const e of["equals","is"])Gs.prototype[e]=Gs.prototype.oneOf;for(const e of["not","nope"])Gs.prototype[e]=Gs.prototype.notOneOf;let egt=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,tgt=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,ngt=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,rgt=e=>Wu(e)||e===e.trim(),agt={}.toString();function gS(){return new Dre}class Dre extends Gs{constructor(){super({type:"string",check(t){return t instanceof String&&(t=t.valueOf()),typeof t=="string"}}),this.withMutation(()=>{this.transform((t,n,r)=>{if(!r.spec.coerce||r.isType(t)||Array.isArray(t))return t;const a=t!=null&&t.toString?t.toString():t;return a===agt?t:a})})}required(t){return super.required(t).withMutation(n=>n.test({message:t||ml.required,name:"required",skipAbsent:!0,test:r=>!!r.length}))}notRequired(){return super.notRequired().withMutation(t=>(t.tests=t.tests.filter(n=>n.OPTIONS.name!=="required"),t))}length(t,n=Jo.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(r){return r.length===this.resolve(t)}})}min(t,n=Jo.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(r){return r.length>=this.resolve(t)}})}max(t,n=Jo.max){return this.test({name:"max",exclusive:!0,message:n,params:{max:t},skipAbsent:!0,test(r){return r.length<=this.resolve(t)}})}matches(t,n){let r=!1,a,i;return n&&(typeof n=="object"?{excludeEmptyString:r=!1,message:a,name:i}=n:a=n),this.test({name:i||"matches",message:a||Jo.matches,params:{regex:t},skipAbsent:!0,test:o=>o===""&&r||o.search(t)!==-1})}email(t=Jo.email){return this.matches(egt,{name:"email",message:t,excludeEmptyString:!0})}url(t=Jo.url){return this.matches(tgt,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=Jo.uuid){return this.matches(ngt,{name:"uuid",message:t,excludeEmptyString:!1})}ensure(){return this.default("").transform(t=>t===null?"":t)}trim(t=Jo.trim){return this.transform(n=>n!=null?n.trim():n).test({message:t,name:"trim",test:rgt})}lowercase(t=Jo.lowercase){return this.transform(n=>Wu(n)?n:n.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>Wu(n)||n===n.toLowerCase()})}uppercase(t=Jo.uppercase){return this.transform(n=>Wu(n)?n:n.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>Wu(n)||n===n.toUpperCase()})}}gS.prototype=Dre.prototype;var igt=/^(\d{4}|[+\-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,\.](\d{1,}))?)?(?:(Z)|([+\-])(\d{2})(?::?(\d{2}))?)?)?$/;function ogt(e){var t=[1,4,5,6,7,10,11],n=0,r,a;if(a=igt.exec(e)){for(var i=0,o;o=t[i];++i)a[o]=+a[o]||0;a[2]=(+a[2]||1)-1,a[3]=+a[3]||1,a[7]=a[7]?String(a[7]).substr(0,3):0,(a[8]===void 0||a[8]==="")&&(a[9]===void 0||a[9]==="")?r=+new Date(a[1],a[2],a[3],a[4],a[5],a[6],a[7]):(a[8]!=="Z"&&a[9]!==void 0&&(n=a[10]*60+a[11],a[9]==="+"&&(n=0-n)),r=Date.UTC(a[1],a[2],a[3],a[4],a[5]+n,a[6],a[7]))}else r=Date.parse?Date.parse(e):NaN;return r}let sgt=new Date(""),lgt=e=>Object.prototype.toString.call(e)==="[object Date]";class lT extends Gs{constructor(){super({type:"date",check(t){return lgt(t)&&!isNaN(t.getTime())}}),this.withMutation(()=>{this.transform((t,n,r)=>!r.spec.coerce||r.isType(t)||t===null?t:(t=ogt(t),isNaN(t)?lT.INVALID_DATE:new Date(t)))})}prepareParam(t,n){let r;if(Md.isRef(t))r=t;else{let a=this.cast(t);if(!this._typeCheck(a))throw new TypeError(`\`${n}\` must be a Date or a value that can be \`cast()\` to a Date`);r=a}return r}min(t,n=m3.min){let r=this.prepareParam(t,"min");return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(a){return a>=this.resolve(r)}})}max(t,n=m3.max){let r=this.prepareParam(t,"max");return this.test({message:n,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(a){return a<=this.resolve(r)}})}}lT.INVALID_DATE=sgt;lT.prototype;function cgt(e,t=[]){let n=[],r=new Set,a=new Set(t.map(([o,s])=>`${o}-${s}`));function i(o,s){let l=ed.split(o)[0];r.add(l),a.has(`${s}-${l}`)||n.push([s,l])}for(const o of Object.keys(e)){let s=e[o];r.add(o),Md.isRef(s)&&s.isSibling?i(s.path,o):z6(s)&&"deps"in s&&s.deps.forEach(l=>i(l,o))}return Hht.array(Array.from(r),n).reverse()}function oV(e,t){let n=1/0;return e.some((r,a)=>{var i;if((i=t.path)!=null&&i.includes(r))return n=a,!0}),n}function Lre(e){return(t,n)=>oV(e,t)-oV(e,n)}const ugt=(e,t,n)=>{if(typeof e!="string")return e;let r=e;try{r=JSON.parse(e)}catch{}return n.isType(r)?r:e};function eb(e){if("fields"in e){const t={};for(const[n,r]of Object.entries(e.fields))t[n]=eb(r);return e.setFields(t)}if(e.type==="array"){const t=e.optional();return t.innerType&&(t.innerType=eb(t.innerType)),t}return e.type==="tuple"?e.optional().clone({types:e.spec.types.map(eb)}):"optional"in e?e.optional():e}const dgt=(e,t)=>{const n=[...ed.normalizePath(t)];if(n.length===1)return n[0]in e;let r=n.pop(),a=ed.getter(ed.join(n),!0)(e);return!!(a&&r in a)};let sV=e=>Object.prototype.toString.call(e)==="[object Object]";function pgt(e,t){let n=Object.keys(e.fields);return Object.keys(t).filter(r=>n.indexOf(r)===-1)}const fgt=Lre([]);function H6(e){return new Mre(e)}class Mre extends Gs{constructor(t){super({type:"object",check(n){return sV(n)||typeof n=="function"}}),this.fields=Object.create(null),this._sortErrors=fgt,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{t&&this.shape(t)})}_cast(t,n={}){var r;let a=super._cast(t,n);if(a===void 0)return this.getDefault(n);if(!this._typeCheck(a))return a;let i=this.fields,o=(r=n.stripUnknown)!=null?r:this.spec.noUnknown,s=[].concat(this._nodes,Object.keys(a).filter(p=>!this._nodes.includes(p))),l={},c=Object.assign({},n,{parent:l,__validating:n.__validating||!1}),u=!1;for(const p of s){let f=i[p],h=p in a;if(f){let g,E=a[p];c.path=(n.path?`${n.path}.`:"")+p,f=f.resolve({value:E,context:n.context,parent:l});let y=f instanceof Gs?f.spec:void 0,b=y==null?void 0:y.strict;if(y!=null&&y.strip){u=u||p in a;continue}g=!n.__validating||!b?f.cast(a[p],c):a[p],g!==void 0&&(l[p]=g)}else h&&!o&&(l[p]=a[p]);(h!==p in l||l[p]!==a[p])&&(u=!0)}return u?l:a}_validate(t,n={},r,a){let{from:i=[],originalValue:o=t,recursive:s=this.spec.recursive}=n;n.from=[{schema:this,value:o},...i],n.__validating=!0,n.originalValue=o,super._validate(t,n,r,(l,c)=>{if(!s||!sV(c)){a(l,c);return}o=o||c;let u=[];for(let p of this._nodes){let f=this.fields[p];!f||Md.isRef(f)||u.push(f.asNestedTest({options:n,key:p,parent:c,parentPath:n.path,originalParent:o}))}this.runTests({tests:u,value:c,originalValue:o,options:n},r,p=>{a(p.sort(this._sortErrors).concat(l),c)})})}clone(t){const n=super.clone(t);return n.fields=Object.assign({},this.fields),n._nodes=this._nodes,n._excludedEdges=this._excludedEdges,n._sortErrors=this._sortErrors,n}concat(t){let n=super.concat(t),r=n.fields;for(let[a,i]of Object.entries(this.fields)){const o=r[a];r[a]=o===void 0?i:o}return n.withMutation(a=>a.setFields(r,[...this._excludedEdges,...t._excludedEdges]))}_getDefault(t){if("default"in this.spec)return super._getDefault(t);if(!this._nodes.length)return;let n={};return this._nodes.forEach(r=>{var a;const i=this.fields[r];let o=t;(a=o)!=null&&a.value&&(o=Object.assign({},o,{parent:o.value,value:o.value[r]})),n[r]=i&&"getDefault"in i?i.getDefault(o):void 0}),n}setFields(t,n){let r=this.clone();return r.fields=t,r._nodes=cgt(t,n),r._sortErrors=Lre(Object.keys(t)),n&&(r._excludedEdges=n),r}shape(t,n=[]){return this.clone().withMutation(r=>{let a=r._excludedEdges;return n.length&&(Array.isArray(n[0])||(n=[n]),a=[...r._excludedEdges,...n]),r.setFields(Object.assign(r.fields,t),a)})}partial(){const t={};for(const[n,r]of Object.entries(this.fields))t[n]="optional"in r&&r.optional instanceof Function?r.optional():r;return this.setFields(t)}deepPartial(){return eb(this)}pick(t){const n={};for(const r of t)this.fields[r]&&(n[r]=this.fields[r]);return this.setFields(n)}omit(t){const n=Object.assign({},this.fields);for(const r of t)delete n[r];return this.setFields(n)}from(t,n,r){let a=ed.getter(t,!0);return this.transform(i=>{if(!i)return i;let o=i;return dgt(i,t)&&(o=Object.assign({},i),r||delete o[t],o[n]=a(i)),o})}json(){return this.transform(ugt)}noUnknown(t=!0,n=h3.noUnknown){typeof t!="boolean"&&(n=t,t=!0);let r=this.test({name:"noUnknown",exclusive:!0,message:n,test(a){if(a==null)return!0;const i=pgt(this.schema,a);return!t||i.length===0||this.createError({params:{unknown:i.join(", ")}})}});return r.spec.noUnknown=t,r}unknown(t=!0,n=h3.noUnknown){return this.noUnknown(!t,n)}transformKeys(t){return this.transform(n=>{if(!n)return n;const r={};for(const a of Object.keys(n))r[t(a)]=n[a];return r})}camelCase(){return this.transformKeys(gN.camelCase)}snakeCase(){return this.transformKeys(gN.snakeCase)}constantCase(){return this.transformKeys(t=>gN.snakeCase(t).toUpperCase())}describe(t){let n=super.describe(t);n.fields={};for(const[a,i]of Object.entries(this.fields)){var r;let o=t;(r=o)!=null&&r.value&&(o=Object.assign({},o,{parent:o.value,value:o.value[a]})),n.fields[a]=i.describe(o)}return n}}H6.prototype=Mre.prototype;function mgt(){const[e,t]=xa(C6),n=yt(Zr),r=du(),a=no(),{t:i}=ql(),o=(n==null?void 0:n.userEnv)||[],s={},l={};o.forEach(f=>{s[f]=e[f]||"",l[f]=gS().required()});const c=H6(l),u=P6({initialValues:s,validationSchema:c,onSubmit:async f=>(localStorage.setItem("userEnv",JSON.stringify(f)),t(f),oa.success(i("pages.Env.savedSuccessfully")),a("/"))});o.length===0&&a("/");const p=f=>{const h=!!u.errors[f];return _.jsx(Lf,{id:f,className:f,label:f,value:u.values[f],size:"medium",hasError:h,description:h?u.errors[f]:"",onChange:g=>u.setFieldValue(f,g.target.value)})};return _.jsxs(_t,{sx:{display:"flex",flexDirection:"column",flexGrow:1},children:[_.jsx(_ne,{}),_.jsxs(_t,{id:"env",display:"flex",flexDirection:"column",flexGrow:1,gap:2,sx:{maxWidth:r,width:"100%",mx:"auto"},children:[_.jsx(fn,{mt:5,fontSize:"18px",fontWeight:700,color:"text.primary",children:_.jsx(Pt,{path:"pages.Env.requiredApiKeys"})}),_.jsx(ms,{severity:"info",children:_.jsx(Pt,{path:"pages.Env.requiredApiKeysInfo"})}),_.jsxs("form",{onSubmit:u.handleSubmit,children:[o.map(f=>p(f)),_.jsx(Ii,{id:"submit-env",fullWidth:!0,type:"submit",variant:"contained",sx:{mt:1},children:"Save"})]})]})]})}let vE;const hgt=new Uint8Array(16);function ggt(){if(!vE&&(vE=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!vE))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return vE(hgt)}const Sa=[];for(let e=0;e<256;++e)Sa.push((e+256).toString(16).slice(1));function _gt(e,t=0){return(Sa[e[t+0]]+Sa[e[t+1]]+Sa[e[t+2]]+Sa[e[t+3]]+"-"+Sa[e[t+4]]+Sa[e[t+5]]+"-"+Sa[e[t+6]]+Sa[e[t+7]]+"-"+Sa[e[t+8]]+Sa[e[t+9]]+"-"+Sa[e[t+10]]+Sa[e[t+11]]+Sa[e[t+12]]+Sa[e[t+13]]+Sa[e[t+14]]+Sa[e[t+15]]).toLowerCase()}const Egt=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),lV={randomUUID:Egt};function _S(e,t,n){if(lV.randomUUID&&!t&&!e)return lV.randomUUID();e=e||{};const r=e.random||(e.rng||ggt)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let a=0;a<16;++a)t[n+a]=r[a];return t}return _gt(r)}function kre({setAutoScroll:e,autoScroll:t,children:n}){const r=x.useRef(),{messages:a}=hs(),{session:i}=Ul();x.useEffect(()=>{e==null||e(!0)},[i==null?void 0:i.socket.id]),x.useEffect(()=>{!r.current||!t||(r.current.scrollTop=r.current.scrollHeight)},[a,t]);const o=()=>{if(!r.current||!e)return;const{scrollTop:s,scrollHeight:l,clientHeight:c}=r.current,u=s+c>=l-10;e(u)};return _.jsx(_t,{ref:r,position:"relative",display:"flex",flexDirection:"column",flexGrow:1,sx:{overflowY:"auto"},onScroll:o,children:n})}const cT=kn({key:"Attachments",default:[]}),bgt=({askUser:e,uploadFile:t,onError:n})=>{const[r,a]=x.useState([]),i=r.some(p=>!p.uploaded),o=r.reduce((p,f)=>p+f.progress/r.length,0),s=p=>{if(i)return;const f=[],h=p.map((g,E)=>{const{xhr:y,promise:b}=t(g,v=>{a(C=>C.map((T,N)=>N===E?{...T,progress:v}:T))});return f.push(b),{progress:0,uploaded:!1,cancel:()=>y.abort()}});Promise.all(f).then(g=>e.callback(g)).catch(g=>{n(`Failed to upload: ${g.message}`),a(E=>(E.forEach(y=>y.cancel()),[]))}),a(h)},l=t6({spec:e.spec,onResolved:s,onError:p=>n(p)});if(!l)return null;const{getRootProps:c,getInputProps:u}=l;return _.jsxs(kt,{sx:{width:"100%",borderRadius:1,backgroundColor:p=>p.palette.background.paper,boxSizing:"border-box",mt:1},direction:"row",alignItems:"center",padding:2,...c({className:"dropzone"}),children:[_.jsx("input",{id:"ask-button-input",...u()}),_.jsxs(kt,{children:[_.jsx(fn,{color:"text.primary",children:"Drag and drop files here"}),_.jsxs(fn,{variant:"caption",color:"text.secondary",children:["Limit ",e.spec.max_size_mb,"mb."]})]}),_.jsx(Ii,{id:i?"ask-upload-button-loading":"ask-upload-button",disabled:i,sx:{ml:"auto !important",textTransform:"capitalize"},variant:"contained",children:i?_.jsx(Ag,{variant:"determinate",value:o,size:20}):"Browse Files"})]})},Sgt=({onError:e})=>{var n;const t=x.useContext(uu);return((n=t.askUser)==null?void 0:n.spec.type)!=="file"||!(t!=null&&t.uploadFile)?null:_.jsx(bgt,{onError:e,uploadFile:t.uploadFile,askUser:t.askUser})},vgt=({author:e,hide:t})=>{const{chatProfile:n}=Ul(),r=yt(Zr),a=x.useMemo(()=>r==null?void 0:r.chatProfiles.find(s=>s.name===n),[r,n]),i=yt(ca),o=x.useMemo(()=>(!e||e===(r==null?void 0:r.ui.name))&&(a!=null&&a.icon)?a.icon:i==null?void 0:i.buildEndpoint(`/avatars/${e||"default"}`),[i,a,r,e]);return _.jsx("span",{className:"message-avatar",children:_.jsx(O5,{sx:{width:"1.6rem",height:"1.6rem",bgcolor:"transparent"},src:t?void 0:o})})},Pre=({action:e,margin:t,onClick:n})=>{var l;const{askUser:r,loading:a}=x.useContext(uu),i=(r==null?void 0:r.spec.type)==="action",o=i&&!((l=r==null?void 0:r.spec.keys)!=null&&l.includes(e.id)),s=()=>{i?r==null||r.callback(e):(e.onClick(),n==null||n())};return _.jsx(Ca,{title:e.description,placement:"top",children:_.jsx("span",{children:_.jsx(Ii,{size:"small",variant:"outlined",sx:{textTransform:"none",margin:t},id:e.id,onClick:s,disabled:a||o,children:e.label||e.name})})})};var G6={},ygt=Qn;Object.defineProperty(G6,"__esModule",{value:!0});var Fre=G6.default=void 0,Tgt=ygt(Xn()),Cgt=_,Rgt=(0,Tgt.default)((0,Cgt.jsx)("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"MoreVert");Fre=G6.default=Rgt;const cV="16px",xgt=({actions:e})=>{const[t,n]=x.useState(null);return _.jsxs(_.Fragment,{children:[_.jsx(Ca,{title:"More Actions",children:_.jsx(zn,{id:"actions-drawer-button",onClick:r=>n(r.currentTarget),children:_.jsx(Fre,{sx:{width:cV,height:cV}})})}),_.jsx(Dg,{id:"actions-menu",anchorEl:t,open:!!t,onClose:()=>n(null),sx:{marginTop:1},slotProps:{paper:{sx:{boxShadow:r=>r.palette.mode==="light"?"0px 2px 4px 0px #0000000D":"0px 10px 10px 0px #0000000D"}}},children:_.jsx(kt,{direction:"column",paddingX:2,gap:1,children:e.map(r=>_.jsx(Pre,{onClick:()=>n(null),action:r,margin:0},r.id))})})]})},Agt=({message:e,actions:t})=>{const n=t.filter(o=>o.forId?o.forId===e.id:!0),r=n.filter(o=>!o.collapsed),a=n.filter(o=>o.collapsed);return!(r.length||a.length)||e.streaming?null:_.jsx(kt,{direction:"row",spacing:1,alignItems:"start",justifyContent:"space-between",width:"100%",children:_.jsxs(_t,{id:"actions-list",children:[r.map(o=>_.jsx(Pre,{action:o,margin:"2px 8px 6px 0"},o.id)),a.length?_.jsx(xgt,{actions:a}):null]})})},Ogt=e=>_.jsx(la,{children:_.jsxs("svg",{...e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[_.jsx("path",{d:"m8 2 1.88 1.88"}),_.jsx("path",{d:"M14.12 3.88 16 2"}),_.jsx("path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1"}),_.jsx("path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6"}),_.jsx("path",{d:"M12 20v-9"}),_.jsx("path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5"}),_.jsx("path",{d:"M6 13H2"}),_.jsx("path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4"}),_.jsx("path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4"}),_.jsx("path",{d:"M22 13h-4"}),_.jsx("path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4"})," "]})}),Ngt=({step:e,debugUrl:t})=>{let n=e.id;n.startsWith("wrap_")&&(n=n.replace("wrap_",""));const r=t.replace("[thread_id]",e.threadId).replace("[step_id]",n);return _.jsx(Ca,{title:"Debug in Literal AI",children:_.jsx(zn,{color:"inherit",className:"debug-button",href:r,target:"_blank",children:_.jsx(Ogt,{sx:{width:"18px",height:"18px"}})})})},Igt=({actions:e,content:t,title:n,...r})=>_.jsx(Og,{...r,fullWidth:!0,sx:{border:a=>a.palette.mode==="dark"?`1px solid ${cK[800]}`:null,borderRadius:1},children:_.jsxs(_t,{bgcolor:"background.paper",children:[n?_.jsx(Ig,{children:_.jsx(_.Fragment,{children:n})}):null,t?_.jsx(Ng,{children:t}):null,e?_.jsx(my,{sx:{padding:a=>a.spacing(0,3,2)},children:_.jsx(_.Fragment,{children:e})}):null]})}),wgt=e=>_.jsx(la,{children:_.jsxs("svg",{...e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[_.jsx("path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z"})," "]})}),Dgt=e=>_.jsx(la,{children:_.jsxs("svg",{...e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[_.jsx("path",{d:"M17 14V2"}),_.jsx("path",{d:"M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22h0a3.13 3.13 0 0 1-3-3.88Z"})]})}),Lgt=e=>_.jsx(la,{children:_.jsxs("svg",{...e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[_.jsx("path",{d:"M7 10v12"}),_.jsx("path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2h0a3.13 3.13 0 0 1 3 3.88Z"})," "]})}),Mgt=e=>_.jsx(la,{children:_.jsxs("svg",{...e,viewBox:"0 0 24 24",fill:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",children:[_.jsx("path",{d:"M17 14V2"}),_.jsx("path",{d:"M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22h0a3.13 3.13 0 0 1-3-3.88Z"})]})}),kgt=e=>_.jsx(la,{children:_.jsxs("svg",{...e,viewBox:"0 0 24 24",fill:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",children:[_.jsx("path",{d:"M7 10v12"}),_.jsx("path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2h0a3.13 3.13 0 0 1 3 3.88Z"})," "]})}),uV="16px",Pgt=({message:e})=>{var N,A;const{onFeedbackUpdated:t,onFeedbackDeleted:n}=x.useContext(uu),[r,a]=x.useState(),[i,o]=x.useState(),s=yt(pv),{idToResume:l}=Ul(),[c,u]=x.useState((N=e.feedback)==null?void 0:N.value),[p,f]=x.useState((A=e.feedback)==null?void 0:A.comment),h=c===0?Mgt:Dgt,g=c===1?kgt:Lgt,E=(O,M)=>{var P;O===void 0?n&&((P=e.feedback)!=null&&P.id)&&n(e,()=>{u(void 0),f(void 0)},e.feedback.id):t&&t(e,()=>{u(O),f(M)},{...e.feedback||{},forId:e.id,threadId:e.threadId,value:O,comment:M})},y=O=>{c===O?E(void 0):a(O)},b=s||l,C=!!e.streaming||!b,T=x.useMemo(()=>{const O={width:uV,height:uV},M=[()=>_.jsx(Ca,{title:"Helpful",children:_.jsx("span",{children:_.jsx(zn,{color:"inherit",disabled:C,className:`positive-feedback-${c===1?"on":"off"}`,onClick:()=>{y(1)},children:_.jsx(g,{sx:O})})})}),()=>_.jsx(Ca,{title:"Not helpful",children:_.jsx("span",{children:_.jsx(zn,{color:"inherit",disabled:C,className:`negative-feedback-${c===-1?"on":"off"}`,onClick:()=>{y(0)},children:_.jsx(h,{sx:O})})})})];return p&&M.push(()=>_.jsx(Ca,{title:"Feedback",children:_.jsx("span",{children:_.jsx(zn,{color:"inherit",disabled:C,onClick:()=>{a(c),o(p)},className:"feedback-comment-edit",children:_.jsx(wgt,{sx:O})})})})),M},[c,p,C]);return _.jsxs(_.Fragment,{children:[_.jsx(kt,{direction:"row",children:T.map((O,M)=>_.jsx(O,{},`feedback-button-${M}`))}),_.jsx(Igt,{maxWidth:"xs",onClose:()=>{a(void 0)},open:r!==void 0,title:_.jsxs(kt,{direction:"row",alignItems:"center",gap:2,children:[r===0?_.jsx(h,{}):_.jsx(g,{}),"Add a comment"]}),content:_.jsx(Lf,{id:"feedbackDescription",value:i,multiline:!0,size:"medium",onChange:O=>{O.target.value===""?o(void 0):o(O.target.value)}}),actions:_.jsx(oS,{id:"feedbackSubmit",type:"submit",variant:"outlined",onClick:()=>{r!=null&&E(r,i),a(void 0),o(void 0)},autoFocus:!0,children:"Submit feedback"})})]})},Fgt=({message:e})=>{const t=Ly(),{showFeedbackButtons:n}=x.useContext(uu),r=yt(Zr),{firstInteraction:a}=hs(),i=e.type==="user_message",o=e.waitForAnswer,s=!!e.output,l=s&&!i&&!o&&!e.disableFeedback,c=n&&!e.disableFeedback&&!i&&!o&&s,u=!!(r!=null&&r.debugUrl)&&!!e.threadId&&!!a;return!(l||u||c)||e.streaming?null:_.jsxs(kt,{sx:{marginLeft:"-8px !important"},alignItems:"center",direction:"row",color:t?Mt[400]:Mt[600],children:[l?_.jsx(vee,{value:e.output}):null,c?_.jsx(Pgt,{message:e}):null,u?_.jsx(Ngt,{debugUrl:r.debugUrl,step:e}):null]})},dV=(e,t)=>!t||!e?!1:t===e.toString(),Bgt=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),pV=({elements:e,content:t,id:n,language:r})=>{const a=e.map(c=>Bgt(c.name));a.sort((c,u)=>u.length-c.length);const i=a.length?new RegExp(`(${a.join("|")})`,"g"):void 0;let o=t?t.trim():"";const s=e.filter(c=>dV(n,c==null?void 0:c.forId)&&c.display==="inline"),l=[];if(i&&(o=o.replaceAll(i,c=>{const u=e.find(h=>{const g=h.name===c,E=dV(n,h==null?void 0:h.forId);return g&&E}),p=!!u,f=(u==null?void 0:u.display)==="inline";return p?f?(s.indexOf(u)===-1&&s.push(u),c):(l.push(u),`[${c}](${c.replaceAll(" ","_")})`):c})),r&&o){const c=`\`\`\`${r}`,u="```";o.startsWith("```")||(o=`${c}
713
713
  ${o}
714
714
  ${u}`)}return{preparedContent:o,inlinedElements:s,refElements:l}},V6=e=>_.jsx(la,{children:_.jsx("svg",{...e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:_.jsx("path",{d:"m6 9 6 6 6-6"})})}),Bre=e=>_.jsx(la,{children:_.jsx("svg",{...e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:_.jsx("path",{d:"m18 15-6-6-6 6"})})}),Ugt=({children:e,defaultExpandAll:t=!1})=>{const[n,r]=M4(t),a=_.jsx(_t,{height:n?"auto":100,position:"relative",children:_.jsx(_t,{position:n?"relative":"absolute",top:0,left:0,right:0,bottom:0,children:e})});return _.jsxs(_t,{children:[_.jsx(fRe,{in:n,collapsedSize:100,timeout:0,children:a}),_.jsx(kt,{direction:"row",justifyContent:"end",children:_.jsx(Ca,{title:n?"Collapse":"Expand",children:_.jsx(zn,{onClick:r,children:n?_.jsx(Bre,{}):_.jsx(V6,{})})})})]})},$gt=25,zgt=3e3,g3=x.memo(({message:e,elements:t,preserveSize:n,allowHtml:r,latex:a})=>{let i=0,o=0;const s=e.streaming&&e.output?e.output+TWe:e.output,{preparedContent:l,inlinedElements:c,refElements:u}=pV({elements:t,id:e.id,content:s,language:e.language});i+=l.split(`
715
715
  `).length,o+=l.length;const p=_.jsx(eg,{allowHtml:r,latex:a,refElements:u,children:l});let f;if(e.input&&e.showInput){const{preparedContent:y,refElements:b}=pV({elements:t,id:e.id,content:e.input,language:typeof e.showInput=="string"?e.showInput:void 0});i+=y.split(`
716
- `).length,o+=y.length,f=_.jsx(eg,{allowHtml:r,latex:a,refElements:b,children:y})}const h=_.jsxs(fn,{sx:{width:"100%",minHeight:"20px",fontSize:"1rem",fontFamily:y=>y.typography.fontFamily},component:"div",children:[f,f&&p?_.jsx(mQ,{sx:{my:1}}):null,p]}),E=!e.type.includes("message")&&(i>$gt||o>zgt)?_.jsx(Ugt,{defaultExpandAll:n,children:h}):h;return _.jsx(kt,{width:"100%",direction:"row",className:"message-content",children:_.jsxs(_t,{width:"100%",children:[l?E:null,_.jsx(_Xe,{elements:c})]})})});function Hgt({steps:e,elements:t,isRunning:n}){const[r,a]=x.useState(!1),[i,o]=x.useState(!1),s=x.useMemo(()=>n&&e.find(p=>p.start&&!p.end&&!p.isError),[e,n]),l=e.some(p=>p.output),c=e.length?e[e.length-1].isError:!1;if(!e.length)return null;const u=e[0].name;return _.jsxs(kt,{width:"100%",direction:"column",alignItems:"start",gap:1,children:[_.jsxs(_t,{display:"flex",alignItems:"center",onMouseOver:()=>o(!0),onMouseOut:()=>o(!1),onClick:()=>a(!r),id:`tool-call-${u}`,children:[_.jsxs(_t,{children:[_.jsx(fn,{variant:"button",sx:{textTransform:"none",cursor:l?"pointer":"default",color:c?"error.main":i?"text.primary":"text.secondary",fontFamily:p=>p.typography.fontFamily},children:s?_.jsxs(_.Fragment,{children:[_.jsx(Pt,{path:"components.molecules.detailsButton.using"})," ",u]}):_.jsxs(_.Fragment,{children:[_.jsx(Pt,{path:"components.molecules.detailsButton.used"})," ",u]})})," ",s&&_.jsx(E3e,{color:"inherit",sx:{borderRadius:"1rem",height:"3px"}})]}),l&&(i||r)?r?_.jsx(Bre,{sx:{height:18,with:18,cursor:"pointer"}}):_.jsx(V6,{sx:{height:18,with:18,cursor:"pointer"}}):null]}),r&&_.jsx(kt,{width:"100%",direction:"column",gap:2,sx:{borderLeft:p=>`1px solid ${p.palette.primary.main}`,boxSizing:"border-box",pl:1},children:e.filter(p=>p.output).map(p=>_.jsx(g3,{elements:t,message:p,preserveSize:!0},p.id))})]})}function Ggt(e){const t=[];let n=[];function r(a){if(a.type==="tool"&&(n.length===0||n[0].name===a.name?n.push(a):(t.push(n),n=[a])),a.steps)for(const i of a.steps)r(i)}return r(e),n.length>0&&t.push(n),t}function Vgt({message:e,elements:t,isRunning:n}){const r=x.useMemo(()=>e.steps?Ggt(e):[],[e]);return r.length?_.jsx(kt,{width:"100%",direction:"column",gap:1,mb:1,children:r.map((a,i)=>_.jsx(Hgt,{steps:a,elements:t,isRunning:n},i))}):null}const Ygt=x.memo(({message:e,showAvatar:t,elements:n,actions:r,isRunning:a,isLast:i})=>{const{highlightedMessage:o,defaultCollapseContent:s,allowHtml:l,latex:c,onError:u}=x.useContext(uu),p=du(),f=e.waitForAnswer,h=e.type==="user_message",g=i&&a&&(!e.streaming||window.renderingCodeBlock);return _.jsx(_t,{sx:{color:"text.primary",position:"relative"},className:"step",children:_.jsx(_t,{sx:{boxSizing:"border-box",mx:"auto",maxWidth:p,px:2,display:"flex",flexDirection:"column",position:"relative"},children:_.jsx(kt,{id:`step-${e.id}`,direction:"row",sx:{pb:2,animation:e.id&&o===e.id?`3s ease-in-out 0.1s ${qgt}`:"none",overflowX:"auto"},children:h?_.jsxs(_t,{display:"flex",flexDirection:"column",width:"100%",children:[_.jsx(_t,{sx:{px:2.5,py:1,borderRadius:"1.5rem",backgroundColor:"background.paper",maxWidth:"90%",ml:"auto"},children:_.jsx(g3,{elements:n,message:e,preserveSize:!!e.streaming||!s,allowHtml:l,latex:c})}),g&&_.jsx(_t,{my:1,children:_.jsx(k4,{})})]}):_.jsxs(kt,{direction:"row",gap:"1rem",width:"100%",children:[_.jsx(vgt,{author:e.name,hide:!t}),_.jsxs(kt,{alignItems:"flex-start",minWidth:150,flexGrow:1,position:"relative",children:[_.jsx(Vgt,{elements:n,message:e,isRunning:a}),_.jsx(g3,{elements:n,message:e,preserveSize:!!e.streaming||!s,allowHtml:l,latex:c}),!a&&i&&f&&_.jsx(Sgt,{onError:u}),_.jsx(_t,{my:1}),g&&_.jsx(_t,{position:"absolute",bottom:0,children:_.jsx(k4,{})}),r!=null&&r.length?_.jsx(Agt,{message:e,actions:r}):null,_.jsx(Fgt,{message:e})]})]})})})})}),qgt=zo`
716
+ `).length,o+=y.length,f=_.jsx(eg,{allowHtml:r,latex:a,refElements:b,children:y})}const h=_.jsxs(fn,{sx:{width:"100%",minHeight:"20px",fontSize:"1rem",fontFamily:y=>y.typography.fontFamily},component:"div",children:[f,f&&p?_.jsx(mQ,{sx:{my:1}}):null,p]}),E=!e.type.includes("message")&&(i>$gt||o>zgt)?_.jsx(Ugt,{defaultExpandAll:n,children:h}):h;return _.jsx(kt,{width:"100%",direction:"row",className:"message-content",children:_.jsxs(_t,{width:"100%",children:[l?E:null,_.jsx(_Xe,{elements:c})]})})});function Hgt({steps:e,elements:t,isRunning:n}){const[r,a]=x.useState(!1),[i,o]=x.useState(!1),s=x.useMemo(()=>n&&e.find(p=>p.start&&!p.end&&!p.isError),[e,n]),l=e.some(p=>p.output),c=e.length?e[e.length-1].isError:!1;if(!e.length)return null;const u=e[0].name;return _.jsxs(kt,{width:"100%",direction:"column",alignItems:"start",gap:1,children:[_.jsxs(_t,{display:"flex",alignItems:"center",onMouseOver:()=>o(!0),onMouseOut:()=>o(!1),onClick:()=>a(!r),id:`tool-call-${u}`,children:[_.jsxs(_t,{children:[_.jsx(fn,{variant:"button",sx:{textTransform:"none",cursor:l?"pointer":"default",color:c?"error.main":i?"text.primary":"text.secondary",fontFamily:p=>p.typography.fontFamily},children:s?_.jsxs(_.Fragment,{children:[_.jsx(Pt,{path:"components.molecules.detailsButton.using"})," ",u]}):_.jsxs(_.Fragment,{children:[_.jsx(Pt,{path:"components.molecules.detailsButton.used"})," ",u]})})," ",s&&_.jsx(E3e,{color:"inherit",sx:{borderRadius:"1rem",height:"3px"}})]}),l&&(i||r)?r?_.jsx(Bre,{sx:{height:18,with:18,cursor:"pointer"}}):_.jsx(V6,{sx:{height:18,with:18,cursor:"pointer"}}):null]}),r&&_.jsx(kt,{width:"100%",direction:"column",gap:2,sx:{borderLeft:p=>`1px solid ${p.palette.primary.main}`,boxSizing:"border-box",pl:1},children:e.filter(p=>p.output).map(p=>_.jsx(g3,{elements:t,message:p,preserveSize:!0},p.id))})]})}function Ggt(e){const t=[];let n=[];function r(a){if(a.type==="tool"&&(n.length===0||n[0].name===a.name?n.push(a):(t.push(n),n=[a])),a.steps)for(const i of a.steps)r(i)}return r(e),n.length>0&&t.push(n),t}function Vgt({message:e,elements:t,isRunning:n}){const r=x.useMemo(()=>e.steps?Ggt(e):[],[e]);return r.length?_.jsx(kt,{width:"100%",direction:"column",gap:1,children:r.map((a,i)=>_.jsx(Hgt,{steps:a,elements:t,isRunning:n},i))}):null}const Ygt=x.memo(({message:e,showAvatar:t,elements:n,actions:r,isRunning:a,isLast:i})=>{const{highlightedMessage:o,defaultCollapseContent:s,allowHtml:l,latex:c,onError:u}=x.useContext(uu),p=du(),f=e.waitForAnswer,h=e.type==="user_message",g=i&&a&&!e.streaming;return _.jsx(_t,{sx:{color:"text.primary",position:"relative"},className:"step",children:_.jsx(_t,{sx:{boxSizing:"border-box",mx:"auto",maxWidth:p,px:2,display:"flex",flexDirection:"column",position:"relative"},children:_.jsx(kt,{id:`step-${e.id}`,direction:"row",sx:{pb:2,animation:e.id&&o===e.id?`3s ease-in-out 0.1s ${qgt}`:"none",overflowX:"auto"},children:h?_.jsxs(_t,{display:"flex",flexDirection:"column",width:"100%",children:[_.jsx(_t,{sx:{px:2.5,borderRadius:"1.5rem",backgroundColor:"background.paper",maxWidth:"70%",ml:"auto"},children:_.jsx(g3,{elements:n,message:e,preserveSize:!!e.streaming||!s,allowHtml:l,latex:c})}),g&&_.jsx(_t,{mt:1,children:_.jsx(k4,{})})]}):_.jsxs(kt,{direction:"row",gap:"1rem",width:"100%",children:[_.jsx(vgt,{author:e.name,hide:!t}),_.jsxs(kt,{alignItems:"flex-start",minWidth:150,flexGrow:1,position:"relative",children:[_.jsx(Vgt,{elements:n,message:e,isRunning:a}),_.jsx(g3,{elements:n,message:e,preserveSize:!!e.streaming||!s,allowHtml:l,latex:c}),!a&&i&&f&&_.jsx(Sgt,{onError:u}),r!=null&&r.length?_.jsx(Agt,{message:e,actions:r}):null,_.jsx(Fgt,{message:e}),g&&_.jsx(_t,{my:.5,children:_.jsx(k4,{})})]})]})})})})}),qgt=zo`
717
717
  from {
718
718
  background-color: transparent;
719
719
  }
@@ -724,4 +724,4 @@ ${u}`)}return{preparedContent:o,inlinedElements:s,refElements:l}},V6=e=>_.jsx(la
724
724
  background-color: transparent;
725
725
  }
726
726
  `,Wgt=x.memo(({messages:e,elements:t,actions:n,indent:r,isRunning:a})=>{const i=x.useContext(uu),o=r===0,s=e.filter((l,c)=>{var y;const p=!!l.output,f=t.find(b=>b.display==="inline"&&b.forId===l.id),h=!!((y=l.steps)!=null&&y.length),g=c===e.length-1,E=a===void 0?i.loading&&g:a&&g;return p||f||h||!p&&E});return _.jsx(_.Fragment,{children:s.map((l,c)=>{const u=c>0?s[c-1]:void 0,p=(u==null?void 0:u.type)!==l.type,f=!!l.name&&!!(u!=null&&u.name)&&u.name!==l.name,h=p||f,g=s.length-1===c;let E=a===void 0?i.loading:a;return o&&(E=E&&g),_.jsx(Ygt,{message:l,showAvatar:h,elements:t,actions:n,indent:r,isRunning:E,isLast:g},l.id)})})}),jgt=x.memo(({actions:e,context:t,elements:n,messages:r})=>_.jsx(uu.Provider,{value:t||yee,children:_.jsx(Wgt,{indent:0,messages:r,elements:n,actions:e})})),Ure=x.memo(({askUser:e,loading:t,actions:n,elements:r,messages:a,onFeedbackUpdated:i,onFeedbackDeleted:o,callAction:s})=>{var N,A;const l=yt(Wl),c=yt(Zr),u=Tn(mv),p=yt(Tee),{uploadFile:f}=Uo(),h=yt(ca),g=x.useCallback((O,M)=>f(h,O,M),[f]),E=!!(c!=null&&c.dataPersistence),y=no(),b=x.useCallback(O=>{let M=`/element/${O.id}`;if(O.display==="side"){u(O);return}return O.threadId&&(M+=`?thread=${O.threadId}`),y(O.display==="page"?M:"#")},[u,y]),v=x.useMemo(()=>n.map(O=>({...O,onClick:async()=>{try{s==null||s(O)}catch(M){M instanceof Error&&oa.error(M.message)}}})),[n]),C=x.useCallback(O=>oa.error(O),[oa]),T=x.useMemo(()=>{var O,M,P;return{uploadFile:g,askUser:e,allowHtml:(O=c==null?void 0:c.features)==null?void 0:O.unsafe_allow_html,latex:(M=c==null?void 0:c.features)==null?void 0:M.latex,defaultCollapseContent:l.defaultCollapseContent,highlightedMessage:p,loading:t,showFeedbackButtons:E,uiName:((P=c==null?void 0:c.ui)==null?void 0:P.name)||"",onElementRefClick:b,onError:C,onFeedbackUpdated:i,onFeedbackDeleted:o}},[l.defaultCollapseContent,e,E,p,t,(N=c==null?void 0:c.ui)==null?void 0:N.name,(A=c==null?void 0:c.features)==null?void 0:A.unsafe_allow_html,b,C,i]);return _.jsx(jgt,{actions:v,elements:r,messages:a,context:T})}),Kgt=()=>{const{elements:e,askUser:t,loading:n,actions:r}=au(),{messages:a}=hs(),{callAction:i}=Uo(),o=yt(vd),s=Tn(cv),l=yt(ca),{t:c}=ql(),u=x.useCallback(h=>{const g=i(h);g&&oa.promise(g,{loading:`${c("components.organisms.chat.Messages.index.running")} ${h.name}`,success:E=>E.response?E.response:`${h.name} ${c("components.organisms.chat.Messages.index.executedSuccessfully")}`,error:E=>E.response?E.response:`${h.name} ${c("components.organisms.chat.Messages.index.failed")}`})},[i]),p=x.useCallback(async(h,g,E)=>{try{oa.promise(l.setFeedback(E,o),{loading:c("components.organisms.chat.Messages.index.updating"),success:y=>(s(b=>kh(b,h.id,{...h,feedback:{...E,id:y.feedbackId}})),g(),c("components.organisms.chat.Messages.index.feedbackUpdated")),error:y=>_.jsx("span",{children:y.message})})}catch(y){console.log(y)}},[]),f=x.useCallback(async(h,g,E)=>{try{oa.promise(l.deleteFeedback(E,o),{loading:c("components.organisms.chat.Messages.index.updating"),success:()=>(s(y=>kh(y,h.id,{...h,feedback:void 0})),g(),c("components.organisms.chat.Messages.index.feedbackUpdated")),error:y=>_.jsx("span",{children:y.message})})}catch(y){console.log(y)}},[]);return _.jsx(Ure,{loading:n,askUser:t,actions:r,elements:e,messages:a,onFeedbackUpdated:p,onFeedbackDeleted:f,callAction:u})},Qgt=e=>_.jsxs(la,{...e,style:{fill:"currentColor"},viewBox:"0 0 24 24",children:[_.jsx("path",{d:"M12.588 11.646a1.5 1.5 0 1 1-2.97.418 1.5 1.5 0 0 1 2.97-.418Z"}),_.jsx("path",{fillRule:"evenodd",d:"M11.297 1.03c-1.732-.232-3.403.918-3.66 2.674L7.04 7.759l-3.33.468a3.148 3.148 0 0 0-2.68 3.555l1.197 8.508a3.148 3.148 0 0 0 3.555 2.68l8.508-1.197a3.148 3.148 0 0 0 2.68-3.555l-.2-1.42 1.285.172c1.732.233 3.403-.918 3.661-2.674l1.251-8.508c.26-1.766-1.03-3.329-2.769-3.562L11.297 1.03Zm5.183 13.71 1.842.248c.727.097 1.328-.389 1.415-.983l1.252-8.508c.085-.582-.338-1.192-1.057-1.289l-8.901-1.196c-.727-.097-1.329.389-1.416.983l-.51 3.474 3.113-.438a3.148 3.148 0 0 1 3.555 2.68l.707 5.03Zm-2.687-4.752a1.148 1.148 0 0 0-1.297-.977l-8.508 1.196a1.148 1.148 0 0 0-.977 1.297l.619 4.4 1.068-1.063a3.148 3.148 0 0 1 4.115-.283l6.08 4.582c.09-.195.128-.416.096-.644l-1.196-8.508Zm-1.109 9.991L7.61 16.155a1.148 1.148 0 0 0-1.5.103L3.978 18.38l.23 1.632a1.148 1.148 0 0 0 1.296.977l7.18-1.01Z",clipRule:"evenodd"})]});function Xgt(){return _.jsx(py,{open:!0,sx:{zIndex:10},children:_.jsxs(kt,{alignItems:"center",gap:2,color:"grey.400",children:[_.jsx(Qgt,{sx:{width:"100px",height:"100px"}}),_.jsx(fn,{fontWeight:600,fontSize:"1.5rem",children:_.jsx(Pt,{path:"components.organisms.chat.dropScreen.dropYourFilesHere"})})]})})}function Zgt({onClick:e}){return _.jsx(zn,{size:"small",sx:{width:"fit-content",margin:"auto",position:"absolute",backgroundColor:"text.primary",color:"background.paper",zIndex:1,transform:"translateY(-100%)",top:-20,left:0,right:0,"&:hover":{backgroundColor:"text.primary"}},onClick:e,children:_.jsx(V6,{fontSize:"large"})})}const Jgt="input_history",e_t=e=>({setSelf:t,onSet:n})=>{const r=localStorage.getItem(e);r!=null&&t(JSON.parse(r)),n((a,i,o)=>{o?localStorage.removeItem(e):localStorage.setItem(e,JSON.stringify(a))})},Y6=kn({key:"UserInputHistory",default:{open:!1,inputs:[]},effects:[e_t(Jgt)]});var t_t={exports:{}};(function(e){var t=function(n){var r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(H,k,ie){H[k]=ie.value},o,s=typeof Symbol=="function"?Symbol:{},l=s.iterator||"@@iterator",c=s.asyncIterator||"@@asyncIterator",u=s.toStringTag||"@@toStringTag";function p(H,k,ie){return Object.defineProperty(H,k,{value:ie,enumerable:!0,configurable:!0,writable:!0}),H[k]}try{p({},"")}catch{p=function(k,ie,j){return k[ie]=j}}function f(H,k,ie,j){var F=k&&k.prototype instanceof C?k:C,le=Object.create(F.prototype),Te=new he(j||[]);return i(le,"_invoke",{value:V(H,ie,Te)}),le}n.wrap=f;function h(H,k,ie){try{return{type:"normal",arg:H.call(k,ie)}}catch(j){return{type:"throw",arg:j}}}var g="suspendedStart",E="suspendedYield",y="executing",b="completed",v={};function C(){}function T(){}function N(){}var A={};p(A,l,function(){return this});var O=Object.getPrototypeOf,M=O&&O(O(q([])));M&&M!==r&&a.call(M,l)&&(A=M);var P=N.prototype=C.prototype=Object.create(A);T.prototype=N,i(P,"constructor",{value:N,configurable:!0}),i(N,"constructor",{value:T,configurable:!0}),T.displayName=p(N,u,"GeneratorFunction");function D(H){["next","throw","return"].forEach(function(k){p(H,k,function(ie){return this._invoke(k,ie)})})}n.isGeneratorFunction=function(H){var k=typeof H=="function"&&H.constructor;return k?k===T||(k.displayName||k.name)==="GeneratorFunction":!1},n.mark=function(H){return Object.setPrototypeOf?Object.setPrototypeOf(H,N):(H.__proto__=N,p(H,u,"GeneratorFunction")),H.prototype=Object.create(P),H},n.awrap=function(H){return{__await:H}};function $(H,k){function ie(le,Te,fe,Ae){var Ce=h(H[le],H,Te);if(Ce.type==="throw")Ae(Ce.arg);else{var Ne=Ce.arg,ze=Ne.value;return ze&&typeof ze=="object"&&a.call(ze,"__await")?k.resolve(ze.__await).then(function(Ue){ie("next",Ue,fe,Ae)},function(Ue){ie("throw",Ue,fe,Ae)}):k.resolve(ze).then(function(Ue){Ne.value=Ue,fe(Ne)},function(Ue){return ie("throw",Ue,fe,Ae)})}}var j;function F(le,Te){function fe(){return new k(function(Ae,Ce){ie(le,Te,Ae,Ce)})}return j=j?j.then(fe,fe):fe()}i(this,"_invoke",{value:F})}D($.prototype),p($.prototype,c,function(){return this}),n.AsyncIterator=$,n.async=function(H,k,ie,j,F){F===void 0&&(F=Promise);var le=new $(f(H,k,ie,j),F);return n.isGeneratorFunction(k)?le:le.next().then(function(Te){return Te.done?Te.value:le.next()})};function V(H,k,ie){var j=g;return function(le,Te){if(j===y)throw new Error("Generator is already running");if(j===b){if(le==="throw")throw Te;return G()}for(ie.method=le,ie.arg=Te;;){var fe=ie.delegate;if(fe){var Ae=Z(fe,ie);if(Ae){if(Ae===v)continue;return Ae}}if(ie.method==="next")ie.sent=ie._sent=ie.arg;else if(ie.method==="throw"){if(j===g)throw j=b,ie.arg;ie.dispatchException(ie.arg)}else ie.method==="return"&&ie.abrupt("return",ie.arg);j=y;var Ce=h(H,k,ie);if(Ce.type==="normal"){if(j=ie.done?b:E,Ce.arg===v)continue;return{value:Ce.arg,done:ie.done}}else Ce.type==="throw"&&(j=b,ie.method="throw",ie.arg=Ce.arg)}}}function Z(H,k){var ie=k.method,j=H.iterator[ie];if(j===o)return k.delegate=null,ie==="throw"&&H.iterator.return&&(k.method="return",k.arg=o,Z(H,k),k.method==="throw")||ie!=="return"&&(k.method="throw",k.arg=new TypeError("The iterator does not provide a '"+ie+"' method")),v;var F=h(j,H.iterator,k.arg);if(F.type==="throw")return k.method="throw",k.arg=F.arg,k.delegate=null,v;var le=F.arg;if(!le)return k.method="throw",k.arg=new TypeError("iterator result is not an object"),k.delegate=null,v;if(le.done)k[H.resultName]=le.value,k.next=H.nextLoc,k.method!=="return"&&(k.method="next",k.arg=o);else return le;return k.delegate=null,v}D(P),p(P,u,"Generator"),p(P,l,function(){return this}),p(P,"toString",function(){return"[object Generator]"});function W(H){var k={tryLoc:H[0]};1 in H&&(k.catchLoc=H[1]),2 in H&&(k.finallyLoc=H[2],k.afterLoc=H[3]),this.tryEntries.push(k)}function ae(H){var k=H.completion||{};k.type="normal",delete k.arg,H.completion=k}function he(H){this.tryEntries=[{tryLoc:"root"}],H.forEach(W,this),this.reset(!0)}n.keys=function(H){var k=Object(H),ie=[];for(var j in k)ie.push(j);return ie.reverse(),function F(){for(;ie.length;){var le=ie.pop();if(le in k)return F.value=le,F.done=!1,F}return F.done=!0,F}};function q(H){if(H||H===""){var k=H[l];if(k)return k.call(H);if(typeof H.next=="function")return H;if(!isNaN(H.length)){var ie=-1,j=function F(){for(;++ie<H.length;)if(a.call(H,ie))return F.value=H[ie],F.done=!1,F;return F.value=o,F.done=!0,F};return j.next=j}}throw new TypeError(typeof H+" is not iterable")}n.values=q;function G(){return{value:o,done:!0}}return he.prototype={constructor:he,reset:function(H){if(this.prev=0,this.next=0,this.sent=this._sent=o,this.done=!1,this.delegate=null,this.method="next",this.arg=o,this.tryEntries.forEach(ae),!H)for(var k in this)k.charAt(0)==="t"&&a.call(this,k)&&!isNaN(+k.slice(1))&&(this[k]=o)},stop:function(){this.done=!0;var H=this.tryEntries[0],k=H.completion;if(k.type==="throw")throw k.arg;return this.rval},dispatchException:function(H){if(this.done)throw H;var k=this;function ie(Ae,Ce){return le.type="throw",le.arg=H,k.next=Ae,Ce&&(k.method="next",k.arg=o),!!Ce}for(var j=this.tryEntries.length-1;j>=0;--j){var F=this.tryEntries[j],le=F.completion;if(F.tryLoc==="root")return ie("end");if(F.tryLoc<=this.prev){var Te=a.call(F,"catchLoc"),fe=a.call(F,"finallyLoc");if(Te&&fe){if(this.prev<F.catchLoc)return ie(F.catchLoc,!0);if(this.prev<F.finallyLoc)return ie(F.finallyLoc)}else if(Te){if(this.prev<F.catchLoc)return ie(F.catchLoc,!0)}else if(fe){if(this.prev<F.finallyLoc)return ie(F.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(H,k){for(var ie=this.tryEntries.length-1;ie>=0;--ie){var j=this.tryEntries[ie];if(j.tryLoc<=this.prev&&a.call(j,"finallyLoc")&&this.prev<j.finallyLoc){var F=j;break}}F&&(H==="break"||H==="continue")&&F.tryLoc<=k&&k<=F.finallyLoc&&(F=null);var le=F?F.completion:{};return le.type=H,le.arg=k,F?(this.method="next",this.next=F.finallyLoc,v):this.complete(le)},complete:function(H,k){if(H.type==="throw")throw H.arg;return H.type==="break"||H.type==="continue"?this.next=H.arg:H.type==="return"?(this.rval=this.arg=H.arg,this.method="return",this.next="end"):H.type==="normal"&&k&&(this.next=k),v},finish:function(H){for(var k=this.tryEntries.length-1;k>=0;--k){var ie=this.tryEntries[k];if(ie.finallyLoc===H)return this.complete(ie.completion,ie.afterLoc),ae(ie),v}},catch:function(H){for(var k=this.tryEntries.length-1;k>=0;--k){var ie=this.tryEntries[k];if(ie.tryLoc===H){var j=ie.completion;if(j.type==="throw"){var F=j.arg;ae(ie)}return F}}throw new Error("illegal catch attempt")},delegateYield:function(H,k,ie){return this.delegate={iterator:q(H),resultName:k,nextLoc:ie},this.method==="next"&&(this.arg=o),v}},n}(e.exports);try{regeneratorRuntime=t}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}})(t_t);var q6={},n_t=Qn;Object.defineProperty(q6,"__esModule",{value:!0});var $re=q6.default=void 0,r_t=n_t(Xn()),a_t=_,i_t=(0,r_t.default)((0,a_t.jsx)("path",{d:"M3 17v2h6v-2H3zM3 5v2h10V5H3zm10 16v-2h8v-2h-8v-2h-2v6h2zM7 9v2H3v2h4v2h2V9H7zm14 4v-2H11v2h10zm-6-4h2V7h4V5h-4V3h-2v6z"}),"Tune");$re=q6.default=i_t;function o_t({progress:e,children:t,...n}){return _.jsxs("div",{style:{position:"relative",display:"inline-flex"},children:[_.jsx(zn,{...n,children:t}),e<100&&_.jsx(Ag,{variant:"determinate",value:e,size:30,style:{position:"absolute",top:0,left:0,pointerEvents:"none"}})]})}const s_t=()=>{const e=yt(cT);return e.length===0?_.jsx(_.Fragment,{}):_.jsx(kt,{id:"attachments",sx:{flexDirection:"row",gap:2,width:"fit-content",flexWrap:"wrap"},children:e.map(t=>{const n=!t.uploaded&&t.cancel,r=n?_.jsx(Ca,{title:_.jsx(Pt,{path:"components.molecules.attachments.cancelUpload"}),children:_.jsx(_t,{sx:{position:"absolute",right:-10,top:-10},children:_.jsx(o_t,{progress:t.uploadProgress||0,onClick:t.cancel,sx:{p:.5,background:"white",backgroundColor:"background.paper",border:i=>`1px solid ${i.palette.divider}`,"&:hover":{backgroundColor:"background.default"}},children:_.jsx(Df,{sx:i=>({height:20,width:20,[i.breakpoints.down("sm")]:{height:12,width:12}})})})})}):null,a=!n&&t.remove?_.jsx(Ca,{title:_.jsx(Pt,{path:"components.molecules.attachments.removeAttachment"}),children:_.jsx(zn,{sx:{position:"absolute",p:.5,right:-10,top:-10,background:"white",backgroundColor:"background.paper",border:i=>`1px solid ${i.palette.divider}`,"&:hover":{backgroundColor:"background.default"}},onClick:t.remove,children:_.jsx(Df,{sx:i=>({height:20,width:20,[i.breakpoints.down("sm")]:{height:12,width:12}})})})}):null;return _.jsxs(qQ,{name:t.name,mime:t.type,children:[r,a]},t.id)})})};function l_t(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var c_t=l_t,u_t=Od,d_t=function(){try{var e=u_t(Object,"defineProperty");return e({},"",{}),e}catch{}}(),p_t=d_t,fV=p_t;function f_t(e,t,n){t=="__proto__"&&fV?fV(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var W6=f_t,m_t=W6,h_t=a6,g_t=Object.prototype,__t=g_t.hasOwnProperty;function E_t(e,t,n){var r=e[t];(!(__t.call(e,t)&&h_t(r,n))||n===void 0&&!(t in e))&&m_t(e,t,n)}var zre=E_t,b_t=zre,S_t=W6;function v_t(e,t,n,r){var a=!n;n||(n={});for(var i=-1,o=t.length;++i<o;){var s=t[i],l=r?r(n[s],e[s],s,n,e):void 0;l===void 0&&(l=e[s]),a?S_t(n,s,l):b_t(n,s,l)}return n}var uT=v_t,y_t=uT,T_t=t_;function C_t(e,t){return e&&y_t(t,T_t(t),e)}var R_t=C_t;function x_t(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var A_t=x_t,O_t=pu,N_t=KD,I_t=A_t,w_t=Object.prototype,D_t=w_t.hasOwnProperty;function L_t(e){if(!O_t(e))return I_t(e);var t=N_t(e),n=[];for(var r in e)r=="constructor"&&(t||!D_t.call(e,r))||n.push(r);return n}var M_t=L_t,k_t=Ine,P_t=M_t,F_t=Jg;function B_t(e){return F_t(e)?k_t(e,!0):P_t(e)}var j6=B_t,U_t=uT,$_t=j6;function z_t(e,t){return e&&U_t(t,$_t(t),e)}var H_t=z_t,ES={exports:{}};ES.exports;(function(e,t){var n=Es,r=t&&!t.nodeType&&t,a=r&&!0&&e&&!e.nodeType&&e,i=a&&a.exports===r,o=i?n.Buffer:void 0,s=o?o.allocUnsafe:void 0;function l(c,u){if(u)return c.slice();var p=c.length,f=s?s(p):new c.constructor(p);return c.copy(f),f}e.exports=l})(ES,ES.exports);var G_t=ES.exports;function V_t(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var Y_t=V_t,q_t=uT,W_t=l6;function j_t(e,t){return q_t(e,W_t(e),t)}var K_t=j_t,Q_t=Fte,X_t=Q_t(Object.getPrototypeOf,Object),Hre=X_t,Z_t=Tne,J_t=Hre,e1t=l6,t1t=Rne,n1t=Object.getOwnPropertySymbols,r1t=n1t?function(e){for(var t=[];e;)Z_t(t,e1t(e)),e=J_t(e);return t}:t1t,Gre=r1t,a1t=uT,i1t=Gre;function o1t(e,t){return a1t(e,i1t(e),t)}var s1t=o1t,l1t=Cne,c1t=Gre,u1t=j6;function d1t(e){return l1t(e,u1t,c1t)}var p1t=d1t,f1t=Object.prototype,m1t=f1t.hasOwnProperty;function h1t(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&m1t.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var g1t=h1t,mV=yne;function _1t(e){var t=new e.constructor(e.byteLength);return new mV(t).set(new mV(e)),t}var K6=_1t,E1t=K6;function b1t(e,t){var n=t?E1t(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var S1t=b1t,v1t=/\w*$/;function y1t(e){var t=new e.constructor(e.source,v1t.exec(e));return t.lastIndex=e.lastIndex,t}var T1t=y1t,hV=Xg,gV=hV?hV.prototype:void 0,_V=gV?gV.valueOf:void 0;function C1t(e){return _V?Object(_V.call(e)):{}}var R1t=C1t,x1t=K6;function A1t(e,t){var n=t?x1t(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var O1t=A1t,N1t=K6,I1t=S1t,w1t=T1t,D1t=R1t,L1t=O1t,M1t="[object Boolean]",k1t="[object Date]",P1t="[object Map]",F1t="[object Number]",B1t="[object RegExp]",U1t="[object Set]",$1t="[object String]",z1t="[object Symbol]",H1t="[object ArrayBuffer]",G1t="[object DataView]",V1t="[object Float32Array]",Y1t="[object Float64Array]",q1t="[object Int8Array]",W1t="[object Int16Array]",j1t="[object Int32Array]",K1t="[object Uint8Array]",Q1t="[object Uint8ClampedArray]",X1t="[object Uint16Array]",Z1t="[object Uint32Array]";function J1t(e,t,n){var r=e.constructor;switch(t){case H1t:return N1t(e);case M1t:case k1t:return new r(+e);case G1t:return I1t(e,n);case V1t:case Y1t:case q1t:case W1t:case j1t:case K1t:case Q1t:case X1t:case Z1t:return L1t(e,n);case P1t:return new r;case F1t:case $1t:return new r(e);case B1t:return w1t(e);case U1t:return new r;case z1t:return D1t(e)}}var eEt=J1t,tEt=pu,EV=Object.create,nEt=function(){function e(){}return function(t){if(!tEt(t))return{};if(EV)return EV(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),rEt=nEt,aEt=rEt,iEt=Hre,oEt=KD;function sEt(e){return typeof e.constructor=="function"&&!oEt(e)?aEt(iEt(e)):{}}var lEt=sEt,cEt=Zg,uEt=fu,dEt="[object Map]";function pEt(e){return uEt(e)&&cEt(e)==dEt}var fEt=pEt,mEt=fEt,hEt=u6,bV=d6,SV=bV&&bV.isMap,gEt=SV?hEt(SV):mEt,_Et=gEt,EEt=Zg,bEt=fu,SEt="[object Set]";function vEt(e){return bEt(e)&&EEt(e)==SEt}var yEt=vEt,TEt=yEt,CEt=u6,vV=d6,yV=vV&&vV.isSet,REt=yV?CEt(yV):TEt,xEt=REt,AEt=o6,OEt=c_t,NEt=zre,IEt=R_t,wEt=H_t,DEt=G_t,LEt=Y_t,MEt=K_t,kEt=s1t,PEt=wne,FEt=p1t,BEt=Zg,UEt=g1t,$Et=eEt,zEt=lEt,HEt=bs,GEt=c6,VEt=_Et,YEt=pu,qEt=xEt,WEt=t_,jEt=j6,KEt=1,QEt=2,XEt=4,Vre="[object Arguments]",ZEt="[object Array]",JEt="[object Boolean]",ebt="[object Date]",tbt="[object Error]",Yre="[object Function]",nbt="[object GeneratorFunction]",rbt="[object Map]",abt="[object Number]",qre="[object Object]",ibt="[object RegExp]",obt="[object Set]",sbt="[object String]",lbt="[object Symbol]",cbt="[object WeakMap]",ubt="[object ArrayBuffer]",dbt="[object DataView]",pbt="[object Float32Array]",fbt="[object Float64Array]",mbt="[object Int8Array]",hbt="[object Int16Array]",gbt="[object Int32Array]",_bt="[object Uint8Array]",Ebt="[object Uint8ClampedArray]",bbt="[object Uint16Array]",Sbt="[object Uint32Array]",qn={};qn[Vre]=qn[ZEt]=qn[ubt]=qn[dbt]=qn[JEt]=qn[ebt]=qn[pbt]=qn[fbt]=qn[mbt]=qn[hbt]=qn[gbt]=qn[rbt]=qn[abt]=qn[qre]=qn[ibt]=qn[obt]=qn[sbt]=qn[lbt]=qn[_bt]=qn[Ebt]=qn[bbt]=qn[Sbt]=!0;qn[tbt]=qn[Yre]=qn[cbt]=!1;function tb(e,t,n,r,a,i){var o,s=t&KEt,l=t&QEt,c=t&XEt;if(n&&(o=a?n(e,r,a,i):n(e)),o!==void 0)return o;if(!YEt(e))return e;var u=HEt(e);if(u){if(o=UEt(e),!s)return LEt(e,o)}else{var p=BEt(e),f=p==Yre||p==nbt;if(GEt(e))return DEt(e,s);if(p==qre||p==Vre||f&&!a){if(o=l||f?{}:zEt(e),!s)return l?kEt(e,wEt(o,e)):MEt(e,IEt(o,e))}else{if(!qn[p])return a?e:{};o=$Et(e,p,s)}}i||(i=new AEt);var h=i.get(e);if(h)return h;i.set(e,o),qEt(e)?e.forEach(function(y){o.add(tb(y,t,n,y,e,i))}):VEt(e)&&e.forEach(function(y,b){o.set(b,tb(y,t,n,b,e,i))});var g=c?l?FEt:PEt:l?jEt:WEt,E=u?void 0:g(e);return OEt(E||e,function(y,b){E&&(b=y,y=e[b]),NEt(o,b,tb(y,t,n,b,e,i))}),o}var vbt=tb,ybt=vbt,Tbt=1,Cbt=4;function Rbt(e){return ybt(e,Tbt|Cbt)}var xbt=Rbt;const Abt=Aa(xbt);var Q6={},Obt=Qn;Object.defineProperty(Q6,"__esModule",{value:!0});var Wre=Q6.default=void 0,Nbt=Obt(Xn()),TV=_,Ibt=(0,Nbt.default)([(0,TV.jsx)("path",{d:"M15 2h-3.5l-1-1h-5l-1 1H1v2h14zm1 7c-.7 0-1.37.1-2 .29V5H2v12c0 1.1.9 2 2 2h5.68c1.12 2.36 3.53 4 6.32 4 3.87 0 7-3.13 7-7s-3.13-7-7-7zm0 12c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5z"},"0"),(0,TV.jsx)("path",{d:"M16.5 12H15v5l3.6 2.1.8-1.2-2.9-1.7z"},"1")],"AutoDelete");Wre=Q6.default=Ibt;function wbt(e){const t={},n=Abt(e).reverse();return n==null||n.forEach(r=>{const{createdAt:a,content:i}=r,o={day:"numeric",month:"numeric",year:"numeric"},s=new Date(a).toLocaleDateString(void 0,o);t[s]||(t[s]=[]);const l={hour:"numeric",minute:"numeric"};t[s].push({key:a,hour:new Date(a).toLocaleTimeString(void 0,l),content:i})}),t}function Dbt({onClick:e}){const[t,n]=xa(Y6),r=x.useRef(),[a,i]=x.useState(null);t.open&&!a&&r.current&&i(r.current);const o=f=>n(h=>({...h,open:f})),s=_.jsxs(kt,{disabled:!0,direction:"row",p:1,justifyContent:"space-between",alignItems:"center",children:[_.jsx(fn,{color:"text.primary",sx:{fontSize:"14px",fontWeight:700},children:_.jsx(Pt,{path:"components.organisms.chat.history.index.lastInputs"})}),_.jsx(zn,{onClick:()=>n(f=>({...f,inputs:[]})),children:_.jsx(Wre,{})})]},"title"),l=(t==null?void 0:t.inputs.length)===0?_.jsx("div",{id:"history-empty",disabled:!0,children:_.jsx(fn,{color:"text.secondary",sx:{fontSize:"12px",fontWeight:700,padding:"16px 12px",textTransform:"uppercase"},children:_.jsx(Pt,{path:"components.organisms.chat.history.index.noInputs"})})},"empty"):null,c=t.inputs?null:_.jsx("div",{id:"history-loading",disabled:!0,children:_.jsx(fn,{color:"text.secondary",sx:{fontSize:"12px",fontWeight:700,padding:"16px 12px",textTransform:"uppercase"},children:_.jsx(Pt,{path:"components.organisms.chat.history.index.loading"})})},"loading"),u=[s,l,c];if(t.inputs){const f=wbt(t.inputs);Object.keys(f).forEach(h=>{u.push(_.jsx("div",{disabled:!0,children:_.jsx(fn,{color:"text.primary",sx:{p:1,fontSize:"10px",fontWeight:700,color:Mt[500]},children:h})},h));let g="";f[h].forEach(E=>{g!==E.content&&(g=E.content,u.push(_.jsx(Vb,{className:"history-item",onClick:y=>{y.stopPropagation(),y.preventDefault(),o(!1),e(E.content)},disableRipple:!0,sx:{p:1,alignItems:"baseline",borderRadius:"4px"},children:_.jsx(fn,{color:"text.primary",sx:{whiteSpace:"pre-wrap",fontSize:"14px",maxHeight:"50px",display:"-webkit-box",WebkitLineClamp:"2",WebkitBoxOrient:"vertical",flexGrow:0,overflow:"hidden",textOverflow:"ellipsis",lineHeight:"24px"},children:E.content})},E.key)))})})}const p=a?_.jsx(Dg,{autoFocus:!0,anchorEl:a,open:t.open,onClose:()=>o(!1),PaperProps:{sx:{p:1,backgroundImage:"none",mt:-4,ml:-1,overflow:"visible",maxHeight:"314px",width:"334px",overflowY:"auto",border:f=>`1px solid ${f.palette.divider}`,boxShadow:f=>f.palette.mode==="light"?"0px 2px 4px 0px #0000000D":"0px 10px 10px 0px #0000000D"}},anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"bottom",horizontal:"left"},children:u}):null;return _.jsx("div",{ref:r,children:p})}function _3(){return _3=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_3.apply(this,arguments)}var jre=["shift","alt","meta","mod","ctrl"],Lbt={esc:"escape",return:"enter",".":"period",",":"comma","-":"slash"," ":"space","`":"backquote","#":"backslash","+":"bracketright",ShiftLeft:"shift",ShiftRight:"shift",AltLeft:"alt",AltRight:"alt",MetaLeft:"meta",MetaRight:"meta",OSLeft:"meta",OSRight:"meta",ControlLeft:"ctrl",ControlRight:"ctrl"};function Oc(e){return(Lbt[e]||e).trim().toLowerCase().replace(/key|digit|numpad|arrow/,"")}function Mbt(e){return jre.includes(e)}function _N(e,t){return t===void 0&&(t=","),e.split(t)}function EN(e,t,n){t===void 0&&(t="+");var r=e.toLocaleLowerCase().split(t).map(function(o){return Oc(o)}),a={alt:r.includes("alt"),ctrl:r.includes("ctrl")||r.includes("control"),shift:r.includes("shift"),meta:r.includes("meta"),mod:r.includes("mod")},i=r.filter(function(o){return!jre.includes(o)});return _3({},a,{keys:i,description:n})}(function(){typeof document<"u"&&(document.addEventListener("keydown",function(e){e.key!==void 0&&Kre([Oc(e.key),Oc(e.code)])}),document.addEventListener("keyup",function(e){e.key!==void 0&&Qre([Oc(e.key),Oc(e.code)])})),typeof window<"u"&&window.addEventListener("blur",function(){Nc.clear()})})();var Nc=new Set;function X6(e){return Array.isArray(e)}function kbt(e,t){t===void 0&&(t=",");var n=X6(e)?e:e.split(t);return n.every(function(r){return Nc.has(r.trim().toLowerCase())})}function Kre(e){var t=Array.isArray(e)?e:[e];Nc.has("meta")&&Nc.forEach(function(n){return!Mbt(n)&&Nc.delete(n.toLowerCase())}),t.forEach(function(n){return Nc.add(n.toLowerCase())})}function Qre(e){var t=Array.isArray(e)?e:[e];e==="meta"?Nc.clear():t.forEach(function(n){return Nc.delete(n.toLowerCase())})}function Pbt(e,t,n){(typeof n=="function"&&n(e,t)||n===!0)&&e.preventDefault()}function Fbt(e,t,n){return typeof n=="function"?n(e,t):n===!0||n===void 0}function Bbt(e){return Xre(e,["input","textarea","select"])}function Xre(e,t){var n=e.target;t===void 0&&(t=!1);var r=n&&n.tagName;return X6(t)?!!(r&&t&&t.some(function(a){return a.toLowerCase()===r.toLowerCase()})):!!(r&&t&&t===!0)}function Ubt(e,t){return e.length===0&&t?(console.warn('A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a <HotkeysProvider>'),!0):t?e.some(function(n){return t.includes(n)})||e.includes("*"):!0}var $bt=function(t,n,r){r===void 0&&(r=!1);var a=n.alt,i=n.meta,o=n.mod,s=n.shift,l=n.ctrl,c=n.keys,u=t.key,p=t.code,f=t.ctrlKey,h=t.metaKey,g=t.shiftKey,E=t.altKey,y=Oc(p),b=u.toLowerCase();if(!r){if(a===!E&&b!=="alt"||s===!g&&b!=="shift")return!1;if(o){if(!h&&!f)return!1}else if(i===!h&&b!=="meta"&&b!=="os"||l===!f&&b!=="ctrl"&&b!=="control")return!1}return c&&c.length===1&&(c.includes(b)||c.includes(y))?!0:c?kbt(c):!c},zbt=x.createContext(void 0),Hbt=function(){return x.useContext(zbt)};function Zre(e,t){return e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(e).length===Object.keys(t).length&&Object.keys(e).reduce(function(n,r){return n&&Zre(e[r],t[r])},!0):e===t}var Gbt=x.createContext({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}}),Vbt=function(){return x.useContext(Gbt)};function Ybt(e){var t=x.useRef(void 0);return Zre(t.current,e)||(t.current=e),t.current}var CV=function(t){t.stopPropagation(),t.preventDefault(),t.stopImmediatePropagation()},qbt=typeof window<"u"?x.useLayoutEffect:x.useEffect;function Wbt(e,t,n,r){var a=x.useRef(null),i=x.useRef(!1),o=n instanceof Array?r instanceof Array?void 0:r:n,s=X6(e)?e.join(o==null?void 0:o.splitKey):e,l=n instanceof Array?n:r instanceof Array?r:void 0,c=x.useCallback(t,l??[]),u=x.useRef(c);l?u.current=c:u.current=t;var p=Ybt(o),f=Vbt(),h=f.enabledScopes,g=Hbt();return qbt(function(){if(!((p==null?void 0:p.enabled)===!1||!Ubt(h,p==null?void 0:p.scopes))){var E=function(T,N){var A;if(N===void 0&&(N=!1),!(Bbt(T)&&!Xre(T,p==null?void 0:p.enableOnFormTags))&&!(p!=null&&p.ignoreEventWhen!=null&&p.ignoreEventWhen(T))){if(a.current!==null&&document.activeElement!==a.current&&!a.current.contains(document.activeElement)){CV(T);return}(A=T.target)!=null&&A.isContentEditable&&!(p!=null&&p.enableOnContentEditable)||_N(s,p==null?void 0:p.splitKey).forEach(function(O){var M,P=EN(O,p==null?void 0:p.combinationKey);if($bt(T,P,p==null?void 0:p.ignoreModifiers)||(M=P.keys)!=null&&M.includes("*")){if(N&&i.current)return;if(Pbt(T,P,p==null?void 0:p.preventDefault),!Fbt(T,P,p==null?void 0:p.enabled)){CV(T);return}u.current(T,P),N||(i.current=!0)}})}},y=function(T){T.key!==void 0&&(Kre(Oc(T.code)),((p==null?void 0:p.keydown)===void 0&&(p==null?void 0:p.keyup)!==!0||p!=null&&p.keydown)&&E(T))},b=function(T){T.key!==void 0&&(Qre(Oc(T.code)),i.current=!1,p!=null&&p.keyup&&E(T,!0))},v=a.current||(o==null?void 0:o.document)||document;return v.addEventListener("keyup",b),v.addEventListener("keydown",y),g&&_N(s,p==null?void 0:p.splitKey).forEach(function(C){return g.addHotkey(EN(C,p==null?void 0:p.combinationKey,p==null?void 0:p.description))}),function(){v.removeEventListener("keyup",b),v.removeEventListener("keydown",y),g&&_N(s,p==null?void 0:p.splitKey).forEach(function(C){return g.removeHotkey(EN(C,p==null?void 0:p.combinationKey,p==null?void 0:p.description))})}}},[s,p,h]),a}const Jre=e=>_.jsxs(la,{...e,style:{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,fill:"none",stroke:"currentColor"},viewBox:"0 0 24 24",children:[_.jsx("path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z"}),_.jsx("path",{d:"M19 10v2a7 7 0 0 1-14 0v-2"}),_.jsx("line",{x1:"12",x2:"12",y1:"19",y2:"22"})," "]});function jbt({open:e,isSpeaking:t}){return _.jsx(py,{sx:{color:"#fff",zIndex:n=>n.zIndex.drawer+1},open:!!e,children:_.jsxs(_t,{height:300,width:300,position:"relative",display:"flex",justifyContent:"center",alignItems:"center",children:[_.jsx("svg",{height:"160",width:"160",xmlns:"http://www.w3.org/2000/svg",children:_.jsx("circle",{r:"80",cx:"80",cy:"80",fill:Mt[50]})}),_.jsx("svg",{height:"240",width:"240",xmlns:"http://www.w3.org/2000/svg",style:{position:"absolute",zIndex:-1,transition:"transform 500ms ease-in-out",opacity:.5,transform:t?"scale(1)":"scale(0)"},children:_.jsx("circle",{r:"120",cx:"120",cy:"120",fill:Mt[50]})}),_.jsx(Jre,{sx:{height:87,width:87,color:"primary.main",position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"}})]})})}const Kbt=({disabled:e})=>{const t=yt(uv),[n,r]=x.useState(!1),[a,i]=x.useState(void 0),[o,s]=x.useState(!1),{sendAudioChunk:l,endAudioStream:c}=Uo(),u=yt(Zr),[p,f]=xa(cT);e=e||!!t;const h=x.useCallback(()=>{if(n||e||(clearTimeout(a),!u))return;const{min_decibels:E,silence_timeout:y,initial_silence_timeout:b,chunk_duration:v,max_duration:C}=u.features.audio;navigator.mediaDevices.getUserMedia({audio:!0}).then(T=>{let N=!1,A=!1,O=!0,M=null,P=Date.now();const D=new MediaRecorder(T);D.addEventListener("start",()=>{r(!0),P=Date.now()}),D.addEventListener("dataavailable",async q=>{if(N||(M?M=new Blob([M,q.data],{type:q.data.type}):M=new Blob([q.data],{type:q.data.type})),D.state==="inactive")return;const G=Date.now()-P;if(G>=C){D.stop(),T.getTracks().forEach(ie=>ie.stop());return}s(A);const[H,k]=D.mimeType.split(";");M?(await l(O,H,G,new Blob([M,q.data])),M=null):await l(O,H,G,q.data),O&&(O=!1)}),D.addEventListener("stop",async()=>{if(r(!1),s(!1),N){const q=p==null?void 0:p.filter(G=>!!G.serverId).map(G=>({id:G.serverId}));await c(q),f([])}});const $=new AudioContext,V=$.createMediaStreamSource(T),Z=$.createAnalyser();Z.minDecibels=E,V.connect(Z);const W=Z.frequencyBinCount,ae=new Uint8Array(W);D.start(v);const he=()=>{if(D.state==="inactive")return;Z.getByteFrequencyData(ae);const q=ae.some(G=>G>0);A||(A=q),!N&&q&&(s(A),N=!0),requestAnimationFrame(he)};he(),setTimeout(()=>{N?i(setInterval(()=>{A?A=!1:(D.stop(),T.getTracks().forEach(q=>q.stop()))},y)):(D.stop(),T.getTracks().forEach(q=>q.stop()))},b)}).catch(T=>{oa.error("Failed to start recording: "+T.message)})},[u,a,n,e,p]);Wbt("p",h);const g=wg(E=>E.breakpoints.down("sm"))?"small":"medium";return u!=null&&u.features.audio.enabled?_.jsxs(_.Fragment,{children:[_.jsx(jbt,{open:n,isSpeaking:o}),_.jsx(Ca,{title:_.jsx(Pt,{path:"components.organisms.chat.inputBox.speechButton.start",suffix:" (P)"}),children:_.jsx("span",{children:_.jsx(zn,{disabled:e||n,color:"inherit",size:g,onClick:h,children:_.jsx(Jre,{fontSize:g})})})})]}):null};var Z6={},Qbt=Qn;Object.defineProperty(Z6,"__esModule",{value:!0});var eae=Z6.default=void 0,Xbt=Qbt(Xn()),Zbt=_,Jbt=(0,Xbt.default)((0,Zbt.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm4 14H8V8h8v8z"}),"StopCircle");eae=Z6.default=Jbt;var J6={},eSt=Qn;Object.defineProperty(J6,"__esModule",{value:!0});var tae=J6.default=void 0;rSt(x);var tSt=eSt(Xn()),nSt=_;function nae(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(nae=function(r){return r?n:t})(e)}function rSt(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=nae(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var o=a?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(r,i,o):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}var aSt=(0,tSt.default)((0,nSt.jsx)("path",{d:"M9.78 18.65l.28-4.23 7.68-6.92c.34-.31-.07-.46-.52-.19L7.74 13.3 3.64 12c-.88-.25-.89-.86.2-1.3l15.97-6.16c.73-.33 1.43.18 1.15 1.3l-2.72 12.81c-.19.91-.74 1.13-1.5.71L12.6 16.3l-1.99 1.93c-.23.23-.42.42-.83.42z"}),"Telegram");tae=J6.default=aSt;const iSt=({disabled:e,onSubmit:t})=>{const{loading:n}=au(),{firstInteraction:r}=hs(),{stopTask:a}=Uo(),i=()=>{a()};return _.jsx(_t,{sx:{mr:1,color:"text.secondary"},children:n&&r?_.jsx(Ca,{title:_.jsx(Pt,{path:"components.organisms.chat.inputBox.SubmitButton.stopTask"}),children:_.jsx(zn,{id:"stop-button",onClick:i,children:_.jsx(eae,{})})}):_.jsx(Ca,{title:_.jsx(Pt,{path:"components.organisms.chat.inputBox.SubmitButton.sendMessage"}),children:_.jsx(zn,{disabled:e,color:"inherit",onClick:t,children:_.jsx(tae,{})})})})},oSt=e=>_.jsx(la,{...e,style:{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,fill:"none",stroke:"currentColor"},viewBox:"0 0 24 24",children:_.jsx("path",{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48"})}),sSt=({disabled:e,fileSpec:t,onFileUpload:n,onFileUploadError:r})=>{var c,u;const a=yt(Zr),i=t6({spec:t,onResolved:p=>n(p),onError:r,options:{noDrag:!0}}),o=wg(p=>p.breakpoints.down("sm"))?"small":"medium";if(!i||!((u=(c=a==null?void 0:a.features)==null?void 0:c.spontaneous_file_upload)!=null&&u.enabled))return null;const{getRootProps:s,getInputProps:l}=i;return _.jsx(Ca,{title:_.jsx(Pt,{path:"components.organisms.chat.inputBox.UploadButton.attachFiles"}),children:_.jsxs("span",{children:[_.jsx("input",{id:"upload-button-input",...l()}),_.jsx(zn,{id:e?"upload-button-loading":"upload-button",disabled:e,color:"inherit",size:o,...s({className:"dropzone"}),children:_.jsx(oSt,{fontSize:o})})]})})};function lSt(e){const t=e.querySelector("textarea");return t?t.value.split(`
727
- `).length:0}const cSt=x.memo(({fileSpec:e,onFileUpload:t,onFileUploadError:n,onSubmit:r,onReply:a})=>{const[i,o]=xa(cT),s=Tn(Y6),l=Tn(Cee),c=x.useRef(null),{loading:u,askUser:p,chatSettingsInputs:f,disabled:h}=au(),g=h||!!i.find(M=>!M.uploaded),[E,y]=x.useState(""),[b,v]=x.useState(!1),{t:C}=ql();x.useEffect(()=>{const M=D=>{if(D.clipboardData&&D.clipboardData.items){const $=Array.from(D.clipboardData.items);if(D.clipboardData.getData("text/plain"))return;$.forEach(Z=>{if(Z.kind==="file"){const W=Z.getAsFile();W&&t([W])}})}};if(!c.current)return;const P=c.current;return P.addEventListener("paste",M),()=>{P.removeEventListener("paste",M)}},[]),x.useEffect(()=>{c.current&&!u&&!g&&c.current.focus()},[u,g]);const T=x.useCallback(()=>{E===""||g||(p?a(E):r(E,i),o([]),y(""))},[E,g,y,p,i,o,r]),N=x.useCallback(M=>{M.key==="Enter"&&!M.shiftKey?b||(M.preventDefault(),T()):M.key==="ArrowUp"&&lSt(M.currentTarget)<=1&&s(D=>({...D,open:!0}))},[T,s,b]),A=x.useCallback(M=>{c.current&&y(M)},[]),O=_.jsxs(_.Fragment,{children:[_.jsx(Dbt,{disabled:g,onClick:A}),_.jsx(sSt,{disabled:g,fileSpec:e,onFileUploadError:n,onFileUpload:t}),f.length>0&&_.jsx(zn,{id:"chat-settings-open-modal",disabled:g,color:"inherit",onClick:()=>l(!0),children:_.jsx($re,{})}),_.jsx(Kbt,{disabled:g})]});return _.jsxs(kt,{sx:{backgroundColor:"background.paper",borderRadius:"1.5rem",boxShadow:"box-shadow: 0px 2px 4px 0px #0000000D",textarea:{height:"34px",maxHeight:"30vh",overflowY:"auto !important",resize:"none",paddingBottom:"0.7rem",paddingTop:"0.7rem",color:"text.primary",lineHeight:"24px"}},children:[i.length>0?_.jsx(_t,{sx:{mt:2,mx:2,padding:"2px"},children:_.jsx(s_t,{})}):null,_.jsx(Lg,{inputRef:c,id:"chat-input",autoFocus:!0,multiline:!0,variant:"standard",autoComplete:"false",placeholder:C("components.organisms.chat.inputBox.input.placeholder"),disabled:g,onChange:M=>y(M.target.value),onKeyDown:N,onCompositionStart:()=>v(!0),onCompositionEnd:()=>v(!1),value:E,fullWidth:!0,InputProps:{disableUnderline:!0,startAdornment:_.jsx(I5,{sx:{ml:1,color:"text.secondary"},position:"start",children:O}),endAdornment:_.jsx(iSt,{onSubmit:T,disabled:g||!E})}})]})}),uSt=e=>x.createElement("svg",{width:1143,height:266,viewBox:"0 0 1143 266",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},x.createElement("path",{d:"M342.542 133.753C342.542 85.5861 378.512 59.1252 416.55 59.7454C445.698 59.7454 476.707 75.4565 483.322 111.22H453.347C446.938 94.8888 433.915 87.6533 416.55 87.6533C390.916 87.6533 373.757 106.259 373.757 133.753C373.757 158.56 390.502 179.233 416.343 179.233C434.328 179.233 449.006 170.757 453.967 153.185H483.735C477.534 191.43 446.732 207.347 416.55 207.347C378.512 207.347 342.542 181.713 342.542 133.753ZM533.503 148.844V206.107H504.561V54.784H533.503V119.696C541.565 107.499 553.555 103.778 566.166 104.398C588.492 105.432 598.622 117.835 601.722 136.647C602.343 141.402 602.549 145.95 602.549 150.911V177.579C602.549 186.468 603.996 188.535 613.713 187.915V205.28C589.732 210.242 573.608 205.28 573.608 179.026V160.007C573.608 153.392 573.608 147.81 572.988 143.056C571.334 132.513 566.993 126.931 554.796 126.931C543.633 126.931 533.503 134.787 533.503 148.844ZM726.013 113.287V173.858C726.013 182.334 725.6 186.882 735.522 186.261V204.867C722.085 207.761 702.653 208.795 702.653 188.329C697.071 200.732 684.254 207.554 671.024 207.554C640.222 206.934 625.958 183.161 625.958 154.839C626.991 121.143 649.938 103.364 683.634 103.985C698.312 104.191 712.783 107.706 726.013 113.287ZM697.898 155.873V130.032C692.317 127.758 686.322 127.138 681.36 127.138C665.649 127.138 655.52 135.82 654.899 154.839C654.899 170.55 662.341 182.127 677.226 181.92C691.076 181.92 697.278 170.964 697.898 155.873ZM753.629 77.5238C753.629 55.4042 787.532 55.4042 787.532 77.5238C787.532 99.8502 753.629 99.8502 753.629 77.5238ZM785.051 107.499V205.9H756.109V107.499H785.051ZM804.992 122.797V105.845C819.669 103.158 843.029 101.711 843.029 120.936C849.438 109.153 861.221 103.985 874.452 103.985C902.566 103.985 914.35 123.21 913.73 148.017V175.098C913.73 184.401 914.143 188.949 924.273 188.329V205.28C904.634 210.242 884.995 207.761 884.995 182.954V148.017C885.201 134.167 876.312 126.931 865.769 126.931C855.019 126.311 844.89 134.787 844.89 148.637V205.9H815.948V137.061C815.948 126.104 816.155 122.177 804.992 122.797ZM942.017 54.5773H970.545V168.07C970.545 183.367 976.54 186.468 990.391 184.194L991.424 205.9C960.622 211.482 942.017 203.833 942.017 168.07V54.5773ZM1004.36 77.5238C1004.36 55.4042 1038.27 55.4042 1038.27 77.5238C1038.27 99.8502 1004.36 99.8502 1004.36 77.5238ZM1035.79 107.499V205.9H1006.84V107.499H1035.79ZM1101 75.4565V106.465H1133.46V128.172H1101V166.829C1101 187.502 1118.16 188.535 1134.7 182.54L1137.38 204.453C1103.07 213.963 1072.68 208.381 1072.68 167.449V128.172L1053.87 126.311V106.465H1074.75L1077.85 75.4565H1101Z",fill:"white"}),x.createElement("path",{d:"M80.0961 121.626C78.244 115.214 74.7914 109.167 69.7384 104.114C53.7848 88.16 27.9188 88.16 11.9652 104.114C-3.98841 120.067 -3.98841 145.933 11.9652 161.887C17.0183 166.94 23.0657 170.392 29.4777 172.245C32.8124 173.307 36.6495 174.133 40.8349 175.034C54.6805 178.016 72.3375 181.818 88.2258 197.706C88.2258 197.706 90.5368 192.507 95.4475 187.596C100.358 182.685 105.558 180.374 105.558 180.374C89.6695 164.486 85.8674 146.829 82.8861 132.983C81.9848 128.798 81.1586 124.961 80.0961 121.626Z",fill:"url(#paint0_linear_361_1664)"}),x.createElement("path",{d:"M185.904 144.375C187.756 150.786 191.209 156.834 196.262 161.887C212.215 177.84 238.081 177.84 254.035 161.887C269.988 145.933 269.988 120.067 254.035 104.114C248.982 99.0605 242.934 95.608 236.522 93.7559C233.188 92.6934 229.351 91.8672 225.165 90.966C211.32 87.9846 193.662 84.1825 177.774 68.2942C177.774 68.2942 175.463 73.4938 170.553 78.4045C165.642 83.3153 160.442 85.6262 160.442 85.6262C176.331 101.514 180.133 119.172 183.114 133.017C184.015 137.203 184.841 141.04 185.904 144.375Z",fill:"url(#paint1_linear_361_1664)"}),x.createElement("path",{d:"M93.7559 29.4775C95.608 23.0656 99.0606 17.0182 104.114 11.9652C120.067 -3.98841 145.933 -3.98841 161.887 11.9652C177.84 27.9188 177.84 53.7848 161.887 69.7384C156.834 74.7915 150.786 78.244 144.374 80.0962C141.04 81.1586 137.203 81.9848 133.017 82.8861C119.172 85.8674 101.514 89.6695 85.6262 105.558C85.6262 105.558 83.3153 100.358 78.4045 95.4475C73.4938 90.5368 68.2942 88.2258 68.2942 88.2258C84.1825 72.3375 87.9846 54.6805 90.966 40.8349C91.8672 36.6494 92.6935 32.8122 93.7559 29.4775Z",fill:"url(#paint2_linear_361_1664)"}),x.createElement("path",{d:"M172.244 236.523C170.392 242.935 166.939 248.982 161.886 254.035C145.933 269.989 120.067 269.989 104.113 254.035C88.1596 238.082 88.1596 212.216 104.113 196.262C109.166 191.209 115.214 187.756 121.626 185.904C124.96 184.842 128.797 184.016 132.983 183.114C146.828 180.133 164.486 176.331 180.374 160.443C180.374 160.443 182.685 165.642 187.595 170.553C192.506 175.464 197.706 177.775 197.706 177.775C181.817 193.663 178.015 211.32 175.034 225.165C174.133 229.351 173.307 233.188 172.244 236.523Z",fill:"url(#paint3_linear_361_1664)"}),x.createElement("path",{d:"M79.6157 121.765L79.6156 121.765L79.6197 121.778C80.6734 125.085 81.4946 128.897 82.3973 133.089L82.4019 133.11C85.3524 146.812 89.1323 164.366 104.71 180.229C104.626 180.271 104.536 180.318 104.438 180.368C103.864 180.667 103.049 181.116 102.08 181.719C100.143 182.925 97.5829 184.753 95.0939 187.242C92.605 189.731 90.7768 192.291 89.5707 194.228C88.9673 195.197 88.5186 196.012 88.22 196.586C88.1692 196.684 88.1227 196.775 88.0806 196.858C72.218 181.281 54.664 177.501 40.9618 174.55L40.9401 174.546C36.7483 173.643 32.9366 172.822 29.6295 171.768L29.6295 171.768L29.6164 171.764C23.2836 169.935 17.3106 166.525 12.3188 161.533C-3.43959 145.775 -3.43959 120.226 12.3188 104.467C28.0771 88.7088 53.6265 88.7088 69.3849 104.467C74.3766 109.459 77.7865 115.432 79.6157 121.765ZM186.384 144.236L186.384 144.236L186.38 144.223C185.327 140.916 184.505 137.104 183.603 132.912L183.598 132.89C180.648 119.188 176.868 101.634 161.29 85.7715C161.374 85.7293 161.464 85.6828 161.562 85.632C162.136 85.3334 162.951 84.8847 163.92 84.2813C165.857 83.0752 168.417 81.247 170.906 78.7581C173.395 76.2692 175.223 73.7092 176.429 71.7721C177.033 70.803 177.481 69.9883 177.78 69.4141C177.831 69.3163 177.877 69.2255 177.919 69.1421C193.782 84.7197 211.336 88.4996 225.038 91.4501L225.06 91.4548C229.252 92.3574 233.063 93.1786 236.371 94.2323L236.37 94.2324L236.384 94.2362C242.716 96.0655 248.689 99.4753 253.681 104.467C269.44 120.226 269.44 145.775 253.681 161.533C237.923 177.292 212.374 177.292 196.615 161.533C191.623 156.541 188.214 150.569 186.384 144.236ZM94.2323 29.6293L94.2325 29.6293L94.2363 29.6162C96.0655 23.2835 99.4754 17.3105 104.467 12.3188C120.226 -3.43959 145.775 -3.43959 161.533 12.3188C177.292 28.0771 177.292 53.6265 161.533 69.3849C156.541 74.3767 150.568 77.7865 144.236 79.6158L144.236 79.6156L144.223 79.6198C140.915 80.6734 137.104 81.4946 132.912 82.3973L132.89 82.4019C119.188 85.3524 101.634 89.1323 85.7715 104.71C85.7293 104.626 85.6828 104.536 85.632 104.438C85.3334 103.864 84.8847 103.049 84.2813 102.08C83.0752 100.143 81.247 97.5829 78.7581 95.0939C76.2692 92.605 73.7092 90.7768 71.7721 89.5707C70.803 88.9673 69.9883 88.5186 69.4141 88.22C69.3163 88.1692 69.2255 88.1227 69.1421 88.0806C84.7197 72.218 88.4996 54.664 91.4501 40.9618L91.4548 40.9401C92.3574 36.7482 93.1786 32.9364 94.2323 29.6293ZM171.768 236.371L171.768 236.371L171.764 236.384C169.934 242.717 166.525 248.69 161.533 253.682C145.774 269.44 120.225 269.44 104.467 253.682C88.7084 237.923 88.7084 212.374 104.467 196.616C109.459 191.624 115.432 188.214 121.764 186.385L121.764 186.385L121.777 186.381C125.085 185.327 128.896 184.506 133.088 183.603L133.11 183.598C146.812 180.648 164.366 176.868 180.229 161.29C180.271 161.374 180.317 161.465 180.368 161.562C180.667 162.137 181.115 162.951 181.719 163.92C182.925 165.858 184.753 168.418 187.242 170.906C189.731 173.395 192.291 175.224 194.228 176.43C195.197 177.033 196.012 177.482 196.586 177.78C196.684 177.831 196.774 177.878 196.858 177.92C181.28 193.782 177.5 211.336 174.55 225.039L174.545 225.06C173.643 229.252 172.821 233.064 171.768 236.371Z",stroke:"black",strokeOpacity:.1,strokeLinejoin:"round"}),x.createElement("defs",null,x.createElement("linearGradient",{id:"paint0_linear_361_1664",x1:119.251,y1:276.386,x2:112.859,y2:-28.0325,gradientUnits:"userSpaceOnUse"},x.createElement("stop",{stopColor:"#FF004F"}),x.createElement("stop",{offset:1,stopColor:"#FF0581"})),x.createElement("linearGradient",{id:"paint1_linear_361_1664",x1:119.251,y1:276.386,x2:112.859,y2:-28.0325,gradientUnits:"userSpaceOnUse"},x.createElement("stop",{stopColor:"#FF004F"}),x.createElement("stop",{offset:1,stopColor:"#FF0581"})),x.createElement("linearGradient",{id:"paint2_linear_361_1664",x1:119.251,y1:276.386,x2:112.859,y2:-28.0325,gradientUnits:"userSpaceOnUse"},x.createElement("stop",{stopColor:"#FF004F"}),x.createElement("stop",{offset:1,stopColor:"#FF0581"})),x.createElement("linearGradient",{id:"paint3_linear_361_1664",x1:119.251,y1:276.386,x2:112.859,y2:-28.0325,gradientUnits:"userSpaceOnUse"},x.createElement("stop",{stopColor:"#FF004F"}),x.createElement("stop",{offset:1,stopColor:"#FF0581"})))),dSt=e=>x.createElement("svg",{width:1143,height:266,viewBox:"0 0 1143 266",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},x.createElement("path",{d:"M342.542 133.753C342.542 181.713 378.512 207.347 416.55 207.347C446.732 207.347 477.534 191.43 483.735 153.185H453.967C449.006 170.757 434.328 179.233 416.343 179.233C390.502 179.233 373.757 158.56 373.757 133.753C373.757 106.259 390.916 87.6533 416.55 87.6533C433.915 87.6533 446.938 94.8888 453.347 111.22H483.322C476.707 75.4565 445.698 59.7454 416.55 59.7454C378.512 59.1252 342.542 85.5861 342.542 133.753ZM533.503 148.844C533.503 134.787 543.633 126.931 554.796 126.931C566.993 126.931 571.334 132.513 572.988 143.056C573.608 147.81 573.608 153.392 573.608 160.007V179.026C573.608 205.28 589.732 210.242 613.713 205.28V187.915C603.996 188.535 602.549 186.468 602.549 177.579V150.911C602.549 145.95 602.343 141.402 601.722 136.647C598.622 117.835 588.492 105.432 566.166 104.398C553.555 103.778 541.565 107.499 533.503 119.696V54.784H504.561V206.107H533.503V148.844ZM726.013 113.287C712.783 107.706 698.312 104.191 683.634 103.985C649.938 103.364 626.991 121.143 625.958 154.839C625.958 183.161 640.222 206.934 671.024 207.554C684.254 207.554 697.071 200.732 702.653 188.329C702.653 208.795 722.085 207.761 735.522 204.867V186.261C725.6 186.882 726.013 182.334 726.013 173.858V113.287ZM697.898 155.873C697.278 170.964 691.076 181.92 677.226 181.92C662.341 182.127 654.899 170.55 654.899 154.839C655.52 135.82 665.649 127.138 681.36 127.138C686.322 127.138 692.317 127.758 697.898 130.032V155.873ZM753.629 77.5238C753.629 99.8502 787.532 99.8502 787.532 77.5238C787.532 55.4042 753.629 55.4042 753.629 77.5238ZM785.051 107.499H756.109V205.9H785.051V107.499ZM804.992 122.797C816.155 122.177 815.948 126.104 815.948 137.061V205.9H844.89V148.637C844.89 134.787 855.019 126.311 865.769 126.931C876.312 126.931 885.201 134.167 884.995 148.017V182.954C884.995 207.761 904.634 210.242 924.273 205.28V188.329C914.143 188.949 913.73 184.401 913.73 175.098V148.017C914.35 123.21 902.566 103.985 874.452 103.985C861.221 103.985 849.438 109.153 843.029 120.936C843.029 101.711 819.669 103.158 804.992 105.845V122.797ZM942.017 54.5773V168.07C942.017 203.833 960.622 211.482 991.424 205.9L990.391 184.194C976.54 186.468 970.545 183.367 970.545 168.07V54.5773H942.017ZM1004.36 77.5238C1004.36 99.8502 1038.27 99.8502 1038.27 77.5238C1038.27 55.4042 1004.36 55.4042 1004.36 77.5238ZM1035.79 107.499H1006.84V205.9H1035.79V107.499ZM1101 75.4565H1077.85L1074.75 106.465H1053.87V126.311L1072.68 128.172V167.449C1072.68 208.381 1103.07 213.963 1137.38 204.453L1134.7 182.54C1118.16 188.535 1101 187.502 1101 166.829V128.172H1133.46V106.465H1101V75.4565Z",fill:"#2A1351"}),x.createElement("path",{d:"M80.0961 121.626C78.244 115.214 74.7914 109.167 69.7384 104.114C53.7848 88.16 27.9188 88.16 11.9652 104.114C-3.98841 120.067 -3.98841 145.933 11.9652 161.887C17.0183 166.94 23.0657 170.392 29.4777 172.245C32.8124 173.307 36.6495 174.133 40.8349 175.034C54.6805 178.016 72.3375 181.818 88.2258 197.706C88.2258 197.706 90.5368 192.507 95.4475 187.596C100.358 182.685 105.558 180.374 105.558 180.374C89.6695 164.486 85.8674 146.829 82.8861 132.983C81.9848 128.798 81.1586 124.961 80.0961 121.626Z",fill:"url(#paint0_linear_361_1534)"}),x.createElement("path",{d:"M185.904 144.375C187.756 150.786 191.209 156.834 196.262 161.887C212.215 177.84 238.081 177.84 254.035 161.887C269.988 145.933 269.988 120.067 254.035 104.114C248.982 99.0605 242.934 95.608 236.522 93.7559C233.188 92.6934 229.351 91.8672 225.165 90.966C211.32 87.9846 193.662 84.1825 177.774 68.2942C177.774 68.2942 175.463 73.4938 170.553 78.4045C165.642 83.3153 160.442 85.6262 160.442 85.6262C176.331 101.514 180.133 119.172 183.114 133.017C184.015 137.203 184.841 141.04 185.904 144.375Z",fill:"url(#paint1_linear_361_1534)"}),x.createElement("path",{d:"M93.7559 29.4775C95.608 23.0656 99.0606 17.0182 104.114 11.9652C120.067 -3.98841 145.933 -3.98841 161.887 11.9652C177.84 27.9188 177.84 53.7848 161.887 69.7384C156.834 74.7915 150.786 78.244 144.374 80.0962C141.04 81.1586 137.203 81.9848 133.017 82.8861C119.172 85.8674 101.514 89.6695 85.6262 105.558C85.6262 105.558 83.3153 100.358 78.4045 95.4475C73.4938 90.5368 68.2942 88.2258 68.2942 88.2258C84.1825 72.3375 87.9846 54.6805 90.966 40.8349C91.8672 36.6494 92.6935 32.8122 93.7559 29.4775Z",fill:"url(#paint2_linear_361_1534)"}),x.createElement("path",{d:"M172.244 236.523C170.392 242.935 166.939 248.982 161.886 254.035C145.933 269.989 120.067 269.989 104.113 254.035C88.1596 238.082 88.1596 212.216 104.113 196.262C109.166 191.209 115.214 187.756 121.626 185.904C124.96 184.842 128.797 184.016 132.983 183.114C146.828 180.133 164.486 176.331 180.374 160.443C180.374 160.443 182.685 165.642 187.595 170.553C192.506 175.464 197.706 177.775 197.706 177.775C181.817 193.663 178.015 211.32 175.034 225.165C174.133 229.351 173.307 233.188 172.244 236.523Z",fill:"url(#paint3_linear_361_1534)"}),x.createElement("path",{d:"M79.6157 121.765L79.6156 121.765L79.6197 121.778C80.6734 125.085 81.4946 128.897 82.3973 133.089L82.4019 133.11C85.3524 146.812 89.1323 164.366 104.71 180.229C104.626 180.271 104.536 180.318 104.438 180.368C103.864 180.667 103.049 181.116 102.08 181.719C100.143 182.925 97.5829 184.753 95.0939 187.242C92.605 189.731 90.7768 192.291 89.5707 194.228C88.9673 195.197 88.5186 196.012 88.22 196.586C88.1692 196.684 88.1227 196.775 88.0806 196.858C72.218 181.281 54.664 177.501 40.9618 174.55L40.9401 174.546C36.7483 173.643 32.9366 172.822 29.6295 171.768L29.6295 171.768L29.6164 171.764C23.2836 169.935 17.3106 166.525 12.3188 161.533C-3.43959 145.775 -3.43959 120.226 12.3188 104.467C28.0771 88.7088 53.6265 88.7088 69.3849 104.467C74.3766 109.459 77.7865 115.432 79.6157 121.765ZM186.384 144.236L186.384 144.236L186.38 144.223C185.327 140.916 184.505 137.104 183.603 132.912L183.598 132.89C180.648 119.188 176.868 101.634 161.29 85.7715C161.374 85.7293 161.464 85.6828 161.562 85.632C162.136 85.3334 162.951 84.8847 163.92 84.2813C165.857 83.0752 168.417 81.247 170.906 78.7581C173.395 76.2692 175.223 73.7092 176.429 71.7721C177.033 70.803 177.481 69.9883 177.78 69.4141C177.831 69.3163 177.877 69.2255 177.919 69.1421C193.782 84.7197 211.336 88.4996 225.038 91.4501L225.06 91.4548C229.252 92.3574 233.063 93.1786 236.371 94.2323L236.37 94.2324L236.384 94.2362C242.716 96.0655 248.689 99.4753 253.681 104.467C269.44 120.226 269.44 145.775 253.681 161.533C237.923 177.292 212.374 177.292 196.615 161.533C191.623 156.541 188.214 150.569 186.384 144.236ZM94.2323 29.6293L94.2325 29.6293L94.2363 29.6162C96.0655 23.2835 99.4754 17.3105 104.467 12.3188C120.226 -3.43959 145.775 -3.43959 161.533 12.3188C177.292 28.0771 177.292 53.6265 161.533 69.3849C156.541 74.3767 150.568 77.7865 144.236 79.6158L144.236 79.6156L144.223 79.6198C140.915 80.6734 137.104 81.4946 132.912 82.3973L132.89 82.4019C119.188 85.3524 101.634 89.1323 85.7715 104.71C85.7293 104.626 85.6828 104.536 85.632 104.438C85.3334 103.864 84.8847 103.049 84.2813 102.08C83.0752 100.143 81.247 97.5829 78.7581 95.0939C76.2692 92.605 73.7092 90.7768 71.7721 89.5707C70.803 88.9673 69.9883 88.5186 69.4141 88.22C69.3163 88.1692 69.2255 88.1227 69.1421 88.0806C84.7197 72.218 88.4996 54.664 91.4501 40.9618L91.4548 40.9401C92.3574 36.7482 93.1786 32.9364 94.2323 29.6293ZM171.768 236.371L171.768 236.371L171.764 236.384C169.934 242.717 166.525 248.69 161.533 253.682C145.774 269.44 120.225 269.44 104.467 253.682C88.7084 237.923 88.7084 212.374 104.467 196.616C109.459 191.624 115.432 188.214 121.764 186.385L121.764 186.385L121.777 186.381C125.085 185.327 128.896 184.506 133.088 183.603L133.11 183.598C146.812 180.648 164.366 176.868 180.229 161.29C180.271 161.374 180.317 161.465 180.368 161.562C180.667 162.137 181.115 162.951 181.719 163.92C182.925 165.858 184.753 168.418 187.242 170.906C189.731 173.395 192.291 175.224 194.228 176.43C195.197 177.033 196.012 177.482 196.586 177.78C196.684 177.831 196.774 177.878 196.858 177.92C181.28 193.782 177.5 211.336 174.55 225.039L174.545 225.06C173.643 229.252 172.821 233.064 171.768 236.371Z",stroke:"black",strokeOpacity:.1,strokeLinejoin:"round"}),x.createElement("defs",null,x.createElement("linearGradient",{id:"paint0_linear_361_1534",x1:119.251,y1:276.386,x2:112.859,y2:-28.0325,gradientUnits:"userSpaceOnUse"},x.createElement("stop",{stopColor:"#FF004F"}),x.createElement("stop",{offset:1,stopColor:"#FF0581"})),x.createElement("linearGradient",{id:"paint1_linear_361_1534",x1:119.251,y1:276.386,x2:112.859,y2:-28.0325,gradientUnits:"userSpaceOnUse"},x.createElement("stop",{stopColor:"#FF004F"}),x.createElement("stop",{offset:1,stopColor:"#FF0581"})),x.createElement("linearGradient",{id:"paint2_linear_361_1534",x1:119.251,y1:276.386,x2:112.859,y2:-28.0325,gradientUnits:"userSpaceOnUse"},x.createElement("stop",{stopColor:"#FF004F"}),x.createElement("stop",{offset:1,stopColor:"#FF0581"})),x.createElement("linearGradient",{id:"paint3_linear_361_1534",x1:119.251,y1:276.386,x2:112.859,y2:-28.0325,gradientUnits:"userSpaceOnUse"},x.createElement("stop",{stopColor:"#FF004F"}),x.createElement("stop",{offset:1,stopColor:"#FF0581"}))));function rae(){const{theme:e}=yt(Wl),t=e==="light"?dSt:uSt;return _.jsx(kt,{mx:"auto",className:"watermark",children:_.jsxs("a",{href:"https://github.com/Chainlit/chainlit",target:"_blank",style:{display:"flex",alignItems:"center",textDecoration:"none"},children:[_.jsx(fn,{fontSize:"12px",color:"text.secondary",children:_.jsx(Pt,{path:"components.organisms.chat.inputBox.waterMark.text"})}),_.jsx(t,{style:{width:65,height:"auto",filter:"grayscale(1)",marginLeft:"4px"}})]})})}const pSt=x.memo(({fileSpec:e,onFileUpload:t,onFileUploadError:n,setAutoScroll:r,autoScroll:a,projectSettings:i})=>{const o=du(),s=Tn(Y6),{user:l}=gs(),{sendMessage:c,replyMessage:u}=Uo(),p=x.useCallback(async(h,g)=>{const E={threadId:"",id:_S(),name:(l==null?void 0:l.identifier)||"User",type:"user_message",output:h,createdAt:new Date().toISOString()};s(b=>{const C=[...b.inputs||[]];return C.push({content:h,createdAt:new Date().getTime()}),{...b,inputs:C.length>50?C.slice(C.length-50):C}});const y=g==null?void 0:g.filter(b=>!!b.serverId).map(b=>({id:b.serverId}));r(!0),c(E,y)},[l,i,c]),f=x.useCallback(async h=>{const g={threadId:"",id:_S(),name:(l==null?void 0:l.identifier)||"User",type:"user_message",output:h,createdAt:new Date().toISOString()};u(g),r(!0)},[l,u]);return _.jsxs(_t,{display:"flex",position:"relative",flexDirection:"column",gap:1,pb:2,px:2,sx:{boxSizing:"border-box",width:"100%",maxWidth:o,m:"auto",justifyContent:"center"},children:[a?null:_.jsx(Zgt,{onClick:()=>r(!0)}),_.jsx(_t,{children:_.jsx(cSt,{fileSpec:e,onFileUpload:t,onFileUploadError:n,onSubmit:p,onReply:f})}),_.jsx(rae,{})]})});function fSt({starter:e}){var o;const t=yt(ca),{sendMessage:n}=Uo(),{loading:r}=au(),{user:a}=gs(),i=x.useCallback(async()=>{const s={threadId:"",id:_S(),name:(a==null?void 0:a.identifier)||"User",type:"user_message",output:e.message,createdAt:new Date().toISOString()};n(s,[])},[a,n,e]);return _.jsx(Ii,{id:`starter-${e.label.trim().toLowerCase().replaceAll(" ","-")}`,fullWidth:!0,disabled:r,color:"inherit",sx:{border:s=>`1px solid ${s.palette.divider}`,borderRadius:"1rem",height:100,p:2,textTransform:"none",justifyContent:"flex-start"},onClick:i,children:_.jsxs(kt,{gap:.5,flexGrow:1,height:"100%",children:[e.icon?_.jsx("img",{style:{borderRadius:"50%"},src:(o=e.icon)!=null&&o.startsWith("/public")?t.buildEndpoint(e.icon):e.icon,alt:e.label,height:20,width:20}):_.jsx(_t,{sx:{height:20,width:20}}),_.jsx(fn,{sx:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:"2",WebkitBoxOrient:"vertical",fontSize:"14px"},color:"text.secondary",align:"left",children:e.label})]})})}function mSt({hideLogo:e}){const{messages:t}=hs(),[n,r]=x.useState(!0),{chatProfile:a}=Ul(),i=yt(Zr),o=yt(ca),s=o==null?void 0:o.buildEndpoint("/avatars/default");x.useEffect(()=>{t.length>0?r(!1):r(!0)},[t]);const l=x.useMemo(()=>i==null?void 0:i.chatProfiles.find(p=>p.name===a),[i,a]),c=x.useMemo(()=>{const p=l==null?void 0:l.name;let f=(l==null?void 0:l.icon)||s;return f!=null&&f.startsWith("/public")&&(f=o.buildEndpoint(f)),_.jsxs(kt,{gap:2,alignItems:"center",children:[_.jsx(O5,{sx:{height:48,width:48},src:f}),p?_.jsx(fn,{color:"text.primary",sx:{fontSize:"1.1rem",fontWeight:600},children:p}):null]})},[i,a,l]),u=x.useMemo(()=>{if(a){const p=i==null?void 0:i.chatProfiles.find(f=>f.name===a);if(p!=null&&p.starters)return p.starters.slice(0,4)}return i==null?void 0:i.starters},[i,a]);return u!=null&&u.length?_.jsx(zb,{in:n,children:_.jsxs(kt,{position:"absolute",zIndex:n?1:-1,width:"100%",height:"100%",mx:"auto",left:0,right:0,sx:{overflowY:"auto"},maxWidth:"min(48rem, 80vw)",justifyContent:e?"end":"center",alignItems:"center",gap:6,px:2,boxSizing:"border-box",children:[e?null:_.jsx(kt,{children:c}),_.jsx(k7,{container:!0,spacing:2,minHeight:100,justifyContent:"center",children:u==null?void 0:u.map((p,f)=>_.jsx(zb,{in:n,timeout:f*300,children:_.jsx(k7,{item:!0,xs:6,sm:3,children:_.jsx(fSt,{starter:p})})},f))})]})}):null}const aae=()=>{var N,A;const{user:e}=gs(),{idToResume:t}=Ul(),n=yt(Zr),r=Tn(cT),a=Tn(fv),i=yt(ca),[o,s]=x.useState(!0),{error:l,disabled:c}=au(),{uploadFile:u}=Uo(),p=x.useRef(u),f=no(),h=x.useMemo(()=>{var O,M,P,D,$,V;return{max_size_mb:((M=(O=n==null?void 0:n.features)==null?void 0:O.spontaneous_file_upload)==null?void 0:M.max_size_mb)||500,max_files:((D=(P=n==null?void 0:n.features)==null?void 0:P.spontaneous_file_upload)==null?void 0:D.max_files)||20,accept:((V=($=n==null?void 0:n.features)==null?void 0:$.spontaneous_file_upload)==null?void 0:V.accept)||["*/*"]}},[n]),{t:g}=ql(),E=du();x.useEffect(()=>{p.current=u},[u]);const y=x.useCallback(O=>{const M=O.map(P=>{const D=_S(),{xhr:$,promise:V}=p.current(i,P,Z=>{r(W=>W.map(ae=>ae.id===D?{...ae,uploadProgress:Z}:ae))});return V.then(Z=>{r(W=>W.map(ae=>ae.id===D?{...ae,serverId:Z.id,uploaded:!0,uploadProgress:100,cancel:void 0}:ae))}).catch(Z=>{oa.error(`${g("components.organisms.chat.index.failedToUpload")} ${P.name}: ${Z.message}`),r(W=>W.filter(ae=>ae.id!==D))}),{id:D,type:P.type,name:P.name,size:P.size,uploadProgress:0,cancel:()=>{oa.info(`${g("components.organisms.chat.index.cancelledUploadOf")} ${P.name}`),$.abort(),r(Z=>Z.filter(W=>W.id!==D))},remove:()=>{r(Z=>Z.filter(W=>W.id!==D))}}});r(P=>P.concat(M))},[u]),b=x.useCallback(O=>oa.error(O),[oa]),v=t6({spec:h,onResolved:y,onError:b,options:{noClick:!0}}),{threadId:C}=hs();x.useEffect(()=>{const O=new URL(window.location.href);e&&(n!=null&&n.dataPersistence)&&C&&O.pathname==="/"?f(`/thread/${C}`):a(M=>({...M,currentThreadId:C}))},[]);const T=!c&&((A=(N=n==null?void 0:n.features)==null?void 0:N.spontaneous_file_upload)==null?void 0:A.enabled);return _.jsxs(_t,{...T?v==null?void 0:v.getRootProps({className:"dropzone"}):{},onBlur:void 0,onFocus:void 0,display:"flex",width:"100%",flexGrow:1,position:"relative",children:[v?_.jsxs(_.Fragment,{children:[_.jsx("input",{id:"#upload-drop-input",...v.getInputProps()}),v!=null&&v.isDragActive?_.jsx(Xgt,{}):null]}):null,_.jsxs(kt,{width:"100%",children:[l?_.jsx(_t,{sx:{width:"100%",maxWidth:E,mx:"auto",my:2},children:_.jsx(ms,{sx:{mx:2},id:"session-error",severity:"error",children:_.jsx(Pt,{path:"components.organisms.chat.index.couldNotReachServer"})})}):null,t?_.jsx(_t,{sx:{width:"100%",maxWidth:E,mx:"auto",my:2},children:_.jsx(ms,{sx:{mx:2},severity:"info",children:_.jsx(Pt,{path:"components.organisms.chat.index.continuingChat"})})}):null,_.jsx(Ite,{isMobile:!0}),_.jsxs(QQ,{children:[_.jsxs(kre,{autoScroll:o,setAutoScroll:s,children:[_.jsx(mSt,{}),_.jsx(_t,{py:2}),_.jsx(Kgt,{})]}),_.jsx(pSt,{fileSpec:h,onFileUpload:y,onFileUploadError:b,autoScroll:o,setAutoScroll:s,projectSettings:n})]})]})]})};function hSt(){return _.jsx(R6,{children:_.jsx(aae,{})})}var bS=globalThis&&globalThis.__assign||function(){return bS=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},bS.apply(this,arguments)},gSt=globalThis&&globalThis.__rest||function(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 a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n},_St=function(e){var t=e.className,n=e.style,r=e.rules,a=e.value,i=e.valueAgain,o=e.minLength,s=e.maxLength,l=e.rtl,c=e.onChange,u=e.specialCharsRegex,p=u===void 0?/[~`¿¡!#$%\^&*€£@+÷=\-\[\]\\';,/{}\(\)|\\":<>\?\.\_]/g:u,f=e.messages,h=f===void 0?{}:f,g=gSt(e,["className","style","rules","value","valueAgain","minLength","maxLength","rtl","onChange","specialCharsRegex","messages"]),E=x.useState(!1),y=E[0],b=E[1],v={minLength:{valid:a.length>=(o||100),message:h.minLength||"Password has at least ".concat(o," characters.")},specialChar:{valid:p.test(a),message:h.specialChar||"Password has special characters."},number:{valid:/\d/g.test(a),message:h.number||"Password has a number."},capital:{valid:function(){var T=0;if(a.length===0)return!1;for(;T<a.length;){var N=a.charAt(T);if(N!=N.toLowerCase()){if(N==N.toUpperCase())return!0}T++}return!1}(),message:h.capital||"Password has a capital letter."},match:{valid:a.length>0&&a===i,message:h.match||"Passwords match."},lowercase:{valid:function(){var T=0;if(a.length===0)return!1;for(;T<a.length;){var N=a.charAt(T);if(N!=N.toUpperCase()){if(N==N.toLowerCase())return!0}T++}return!1}(),message:h.lowercase||"Password has a lowercase letter."},letter:{valid:/[a-zA-Z]/g.test(a),message:h.letter||"Password has a letter."},maxLength:{valid:a.length<=(s||16),message:h.maxLength||"Password has no more than ".concat(s," characters.")},notEmpty:{valid:!!(a.length>0&&i&&i.length>0),message:h.notEmpty||"Password fields are not empty."}},C=r.filter(function(T){return!!v[T]});return x.useEffect(function(){C.every(function(T){return v[T].valid})?b(!0):b(!1)},[a,i]),x.useEffect(function(){typeof c=="function"&&c(y,C.filter(function(T){return!v[T].valid}))},[y]),l&&(t=t?t+" rtl":"rtl"),Oe.createElement("ul",{className:t,style:bS({margin:0,padding:0},n)},C.map(function(T){var N=v[T],A=N.message,O=N.valid;return Oe.createElement(ESt,bS({key:T,valid:O,iconSize:18,validColor:"#4BCA81",invalidColor:"#FF0033",rtl:l},g),A)}))},ESt=function(e){var t=e.valid,n=e.iconSize,r=e.validColor,a=e.invalidColor,i=e.validTextColor,o=e.invalidTextColor,s=e.iconComponents,l=e.hideIcon,c=e.rtl,u=e.children;return Oe.createElement("li",{className:t?"valid":"invalid",style:{listStyleType:"none",display:"flex",alignItems:"flex-start",margin:"2px 0"}},l?null:s?t?s.ValidIcon:s.InvalidIcon:Oe.createElement("svg",{className:"checklist-icon",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:n,height:n,viewBox:"0 0 512 512",style:{marginRight:c?0:5,marginLeft:c?5:0}},Oe.createElement("path",{fill:t?r:a,d:t?"M432 64l-240 240-112-112-80 80 192 192 320-320z":"M507.331 411.33c-0.002-0.002-0.004-0.004-0.006-0.005l-155.322-155.325 155.322-155.325c0.002-0.002 0.004-0.003 0.006-0.005 1.672-1.673 2.881-3.627 3.656-5.708 2.123-5.688 0.912-12.341-3.662-16.915l-73.373-73.373c-4.574-4.573-11.225-5.783-16.914-3.66-2.080 0.775-4.035 1.984-5.709 3.655 0 0.002-0.002 0.003-0.004 0.005l-155.324 155.326-155.324-155.325c-0.002-0.002-0.003-0.003-0.005-0.005-1.673-1.671-3.627-2.88-5.707-3.655-5.69-2.124-12.341-0.913-16.915 3.66l-73.374 73.374c-4.574 4.574-5.784 11.226-3.661 16.914 0.776 2.080 1.985 4.036 3.656 5.708 0.002 0.001 0.003 0.003 0.005 0.005l155.325 155.324-155.325 155.326c-0.001 0.002-0.003 0.003-0.004 0.005-1.671 1.673-2.88 3.627-3.657 5.707-2.124 5.688-0.913 12.341 3.661 16.915l73.374 73.373c4.575 4.574 11.226 5.784 16.915 3.661 2.080-0.776 4.035-1.985 5.708-3.656 0.001-0.002 0.003-0.003 0.005-0.005l155.324-155.325 155.324 155.325c0.002 0.001 0.004 0.003 0.006 0.004 1.674 1.672 3.627 2.881 5.707 3.657 5.689 2.123 12.342 0.913 16.914-3.661l73.373-73.374c4.574-4.574 5.785-11.227 3.662-16.915-0.776-2.080-1.985-4.034-3.657-5.707z"})),Oe.createElement("span",{style:{paddingTop:2,opacity:t?1:o?void 0:.5,flex:1,color:t?i:o}},u))},eL={},bSt=Qn;Object.defineProperty(eL,"__esModule",{value:!0});var iae=eL.default=void 0,SSt=bSt(Xn()),vSt=_,ySt=(0,SSt.default)((0,vSt.jsx)("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"}),"Visibility");iae=eL.default=ySt;var tL={},TSt=Qn;Object.defineProperty(tL,"__esModule",{value:!0});var oae=tL.default=void 0,CSt=TSt(Xn()),RSt=_,xSt=(0,CSt.default)((0,RSt.jsx)("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z"}),"VisibilityOff");oae=tL.default=xSt;const ASt=({title:e,children:t,renderLogo:n})=>_.jsx(kt,{sx:{backgroundColor:r=>r.palette.background.default,height:"100vh",width:"100vw",alignItems:"center",justifyContent:"center"},children:_.jsxs(_t,{sx:r=>({backgroundColor:a=>a.palette.background.paper,border:a=>`1px solid ${a.palette.divider}`,borderRadius:1,padding:r.spacing(5,5),maxWidth:"400px",width:"90%",height:"auto",maxHeight:"90%",[r.breakpoints.down("sm")]:{maxWidth:"unset",width:"100%",height:"100%"}}),children:[_.jsxs(kt,{sx:{alignItems:"center",gap:3,marginBottom:3},children:[n,e?_.jsx(fn,{textAlign:"center",color:"text.primary",children:e}):null]}),_.jsx(kt,{gap:1,paddingX:3,children:t})]})});var nL={},OSt=Qn;Object.defineProperty(nL,"__esModule",{value:!0});var sae=nL.default=void 0;wSt(x);var NSt=OSt(Xn()),ISt=_;function lae(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(lae=function(r){return r?n:t})(e)}function wSt(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=lae(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var o=a?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(r,i,o):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}var DSt=(0,NSt.default)((0,ISt.jsx)("path",{d:"M12 1.27a11 11 0 00-3.48 21.46c.55.09.73-.28.73-.55v-1.84c-3.03.64-3.67-1.46-3.67-1.46-.55-1.29-1.28-1.65-1.28-1.65-.92-.65.1-.65.1-.65 1.1 0 1.73 1.1 1.73 1.1.92 1.65 2.57 1.2 3.21.92a2 2 0 01.64-1.47c-2.47-.27-5.04-1.19-5.04-5.5 0-1.1.46-2.1 1.2-2.84a3.76 3.76 0 010-2.93s.91-.28 3.11 1.1c1.8-.49 3.7-.49 5.5 0 2.1-1.38 3.02-1.1 3.02-1.1a3.76 3.76 0 010 2.93c.83.74 1.2 1.74 1.2 2.94 0 4.21-2.57 5.13-5.04 5.4.45.37.82.92.82 2.02v3.03c0 .27.1.64.73.55A11 11 0 0012 1.27"}),"GitHub");sae=nL.default=DSt;var rL={},LSt=Qn;Object.defineProperty(rL,"__esModule",{value:!0});var cae=rL.default=void 0;PSt(x);var MSt=LSt(Xn()),kSt=_;function uae(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(uae=function(r){return r?n:t})(e)}function PSt(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=uae(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var o=a?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(r,i,o):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}var FSt=(0,MSt.default)((0,kSt.jsx)("path",{d:"M12.545,10.239v3.821h5.445c-0.712,2.315-2.647,3.972-5.445,3.972c-3.332,0-6.033-2.701-6.033-6.032s2.701-6.032,6.033-6.032c1.498,0,2.866,0.549,3.921,1.453l2.814-2.814C17.503,2.988,15.139,2,12.545,2C7.021,2,2.543,6.477,2.543,12s4.478,10,10.002,10c8.396,0,10.249-7.85,9.426-11.748L12.545,10.239z"}),"Google");cae=rL.default=FSt;var aL={},BSt=Qn;Object.defineProperty(aL,"__esModule",{value:!0});var dae=aL.default=void 0;zSt(x);var USt=BSt(Xn()),$St=_;function pae(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(pae=function(r){return r?n:t})(e)}function zSt(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=pae(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var o=a?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(r,i,o):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}var HSt=(0,USt.default)((0,$St.jsx)("path",{d:"M2 3h9v9H2V3m9 19H2v-9h9v9M21 3v9h-9V3h9m0 19h-9v-9h9v9Z"}),"Microsoft");dae=aL.default=HSt;const GSt=()=>_.jsx("svg",{width:"24",height:"24",viewBox:"0 0 256 287",style:{fill:"inherit"},xmlns:"http://www.w3.org/2000/svg",preserveAspectRatio:"xMinYMin meet",children:_.jsx("path",{d:"M203.24 231.531l-28.73-88.434 75.208-54.64h-92.966L128.019.025l-.009-.024h92.98l28.74 88.446.002-.002.024-.013c16.69 51.31-.5 109.67-46.516 143.098zm-150.45 0l-.023.017 75.228 54.655 75.245-54.67-75.221-54.656-75.228 54.654zM6.295 88.434c-17.57 54.088 2.825 111.4 46.481 143.108l.007-.028 28.735-88.429-75.192-54.63h92.944L128.004.024 128.01 0H35.025L6.294 88.434z"})}),VSt=()=>_.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 256 299",xmlns:"http://www.w3.org/2000/svg",preserveAspectRatio:"xMidYMid",children:[_.jsx("path",{d:"M208.752 58.061l25.771-6.636.192.283.651 155.607-.843.846-5.31.227-20.159-3.138-.302-.794V58.061M59.705 218.971l.095.007 68.027 19.767.173.133.296.236-.096 59.232-.2.252-68.295-33.178v-46.449",fill:"#7A3E65"}),_.jsx("path",{d:"M208.752 204.456l-80.64 19.312-40.488-9.773-27.919 4.976L128 238.878l105.405-28.537 1.118-2.18-25.771-3.705",fill:"#CFB2C1"}),_.jsx("path",{d:"M196.295 79.626l-.657-.749-66.904-19.44-.734.283-.672-.343L22.052 89.734l-.575.703.845.463 24.075 3.53.851-.289 80.64-19.311 40.488 9.773 27.919-4.977",fill:"#512843"}),_.jsx("path",{d:"M47.248 240.537l-25.771 6.221-.045-.149-1.015-155.026 1.06-1.146 25.771 3.704v146.396",fill:"#C17B9E"}),_.jsx("path",{d:"M82.04 180.403l45.96 5.391.345-.515.187-71.887-.532-.589-45.96 5.392v62.208",fill:"#7A3E65"}),_.jsx("path",{d:"M173.96 180.403L128 185.794v-72.991l45.96 5.392v62.208M196.295 79.626L128 59.72V0l68.295 33.177v46.449",fill:"#C17B9E"}),_.jsx("path",{d:"M128 0L0 61.793v175.011l21.477 9.954V90.437L128 59.72V0",fill:"#7A3E65"}),_.jsx("path",{d:"M234.523 51.425v156.736L128 238.878v59.72l128-61.794V61.793l-21.477-10.368",fill:"#C17B9E"})]}),YSt=()=>_.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",version:"1.1",viewBox:"0 0 196 216",xmlSpace:"preserve",children:[_.jsx("path",{fill:"#0198B8",d:"M66.841 183.009c.049 4.355.097 8.71-.27 13.485-11.818-6.767-23.167-14.04-34.66-21.077-3.023-1.85-6.494-2.968-9.759-4.421-1.994-5.399-3.99-10.797-5.564-16.59 2.378.369 4.526.837 6.264 1.947 12.42 7.933 24.72 16.054 37.157 23.961 2.028 1.29 4.543 1.816 6.832 2.695z",opacity:"1"}),_.jsx("path",{fill:"#0BE5DA",d:"M56.298 102c.85-.912 1.624-2.505 2.565-2.611 3.038-.343 6.137-.139 9.679.29 1.212 1.44 1.753 2.758 2.736 3.396 17.255 11.216 34.541 22.386 51.898 33.444 1.855 1.182 4.195 1.604 6.31 2.38-.19 1.28.077 3.15-.662 3.723-1.792 1.39-4.052 2.174-6.483 2.884-1.164-1.446-1.731-2.93-2.809-3.643-7.175-4.742-14.43-9.367-21.72-13.934-4.877-3.057-9.855-5.954-14.788-8.923-1.091-.413-2.182-.827-3.71-1.653-7.963-5.393-15.49-10.373-23.016-15.353z",opacity:"1"}),_.jsx("path",{fill:"#13E5D1",d:"M129.377 138.545c-2.006-.422-4.346-.844-6.201-2.026-17.357-11.058-34.643-22.228-51.898-33.444-.983-.638-1.524-1.957-2.285-3.3 3.358-.406 6.73-.473 10.563-.1 1.243 1.615 1.78 3.14 2.856 3.903 3.597 2.547 7.509 4.656 11.063 7.256 2.387 1.748 4.374 4.043 6.254 6.143-.431.113-.606.145-.713.247-.096.092-.118.261-.172.397l5.186 1.336c1.656.136 3.312.279 4.968.406 7.268.557 12.628 3.671 15.482 10.766 1.153 2.866 3.167 5.386 4.897 8.416z",opacity:"1"}),_.jsx("path",{fill:"#07E4E3",d:"M82.727 119.17a257.804 257.804 0 0115.086 8.759c7.29 4.567 14.544 9.192 21.719 13.934 1.078.713 1.645 2.197 2.45 3.691-2.826 1.962-5.652 3.557-9.194 5.557-2.288-4.191-4.438-7.98-6.446-11.841-3.98-7.655-7.928-7.877-13.248-.74-5.877-3.234-11.26-6.38-16.642-9.524 1.993-3.225 3.986-6.449 6.275-9.837z",opacity:"1"}),_.jsx("path",{fill:"#57DB45",d:"M180.423 56.014c.762 2.732 1.524 5.464 1.853 8.58-1.646-.019-3-.2-4.05-.863-9.341-5.915-18.569-12.013-27.954-17.857-6.12-3.811-12.448-7.29-18.682-10.92-.078-2.364-.156-4.729.227-7.511 11.469 6.52 22.417 13.556 33.511 20.353 4.879 2.989 10.054 5.493 15.095 8.218z",opacity:"1"}),_.jsx("path",{fill:"#06A3BE",d:"M66.914 182.573c-2.362-.443-4.877-.97-6.905-2.259-12.437-7.907-24.737-16.028-37.157-23.96-1.738-1.11-3.886-1.58-6.217-2.344-.464-.472-.555-.944-.662-2.2.014-2.802.045-4.819.445-6.821 4.9 2.647 9.35 5.428 13.983 7.865 3.738 1.966 7.696 3.516 11.557 5.25 5.502 9.625 13.99 15.097 25.029 17.64 0 2.146 0 4.27-.073 6.83z",opacity:"1"}),_.jsx("path",{fill:"#088FB2",d:"M22.181 171.339c3.236 1.11 6.707 2.227 9.73 4.078 11.493 7.036 22.842 14.31 34.591 21.536.346 1.483.346 2.924.346 4.552-19.021-2.271-32.731-12.099-42.868-27.5-.534-.811-1.177-1.55-1.799-2.666z",opacity:"1"}),_.jsx("path",{fill:"#5CDB3C",d:"M180.408 55.677c-5.026-2.388-10.201-4.892-15.08-7.881-11.094-6.797-22.042-13.833-33.376-20.778-.418-2.055-.51-4.103-.145-6.568 1.673.084 3 .414 4.09 1.112 10.474 6.71 20.862 13.554 31.389 20.18 2.318 1.459 5.084 2.206 7.644 3.281 1.821 3.44 3.642 6.878 5.478 10.654z",opacity:"1"}),_.jsx("path",{fill:"#59DD55",d:"M131.458 35.376c6.366 3.207 12.693 6.687 18.814 10.498 9.385 5.844 18.613 11.942 27.954 17.857 1.05.664 2.404.844 3.974 1.244.501 2.046.646 4.098.38 6.545-7.279-3.892-14.065-8.316-21.058-12.385-2.192-1.275-4.942-1.59-7.436-2.346-5.384-3.857-10.328-8.777-16.286-11.25-5.178-2.148-7.703-4.195-6.342-10.163z",opacity:"1"}),_.jsx("path",{fill:"#01E3E3",d:"M15.447 90.994c-.065-4.355-.131-8.71.255-13.521 2.615.575 4.824 1.524 6.932 2.657 5.425 2.916 10.805 5.913 16.203 8.878.046 4.358.092 8.716-.295 13.527-3.835-1.435-7.207-3.382-10.647-5.197-4.118-2.173-8.296-4.234-12.448-6.344z",opacity:"1"}),_.jsx("path",{fill:"#22E3B4",d:"M100.982 92.49c-5.371.802-10.758 1.513-16.107 2.443-2.781.484-4.543-.264-5.988-2.802-3.166-5.56-6.618-10.957-10.33-17.038 2.094-1.064 3.92-1.994 6.137-2.627 1.35 1.37 2.138 2.71 3.302 3.476 6.054 3.99 12.27 7.737 18.282 11.79 1.813 1.222 3.15 3.153 4.704 4.759z",opacity:"1"}),_.jsx("path",{fill:"#66DB3A",d:"M174.883 44.68c-2.513-.732-5.279-1.48-7.597-2.938-10.527-6.626-20.915-13.47-31.39-20.18-1.09-.698-2.416-1.028-3.964-1.533-1.176-3.157-.493-4.067 3.096-3.379 17.434 3.343 30.305 13.045 39.855 28.03z",opacity:"1"}),_.jsx("path",{fill:"#07E4E3",d:"M173.516 175.205c-2.971 3.499-5.943 6.998-9.27 10.29-4.452-3.19-8.447-6.328-12.682-9.1-2.676-1.75-5.71-2.954-8.585-4.403 3.165-2.552 6.33-5.105 10.158-7.814 2.674.924 4.708 1.962 6.688 3.095 4.578 2.62 9.13 5.285 13.691 7.932z",opacity:"1"}),_.jsx("path",{fill:"#19E3BC",d:"M128.157 117.563c-5.08.066-10.162.133-15.708-.24-1.486-1.621-2.32-3.067-3.56-3.937-4.746-3.333-9.7-6.372-14.403-9.762-1.448-1.044-2.341-2.857-3.488-4.318 5.015-.057 10.03-.114 15.524.242 1.13 1.272 1.615 2.373 2.46 2.95 4.987 3.41 10.154 6.566 15.047 10.101 1.69 1.22 2.77 3.285 4.128 4.964z",opacity:"1"}),_.jsx("path",{fill:"#26E2A8",d:"M101.374 92.561c-1.947-1.676-3.283-3.607-5.096-4.83-6.011-4.052-12.228-7.798-18.282-11.789-1.164-.767-1.951-2.106-2.947-3.525 2.391-1.668 4.817-2.992 7.748-4.059 2.898 1.398 5.29 2.537 7.683 3.677 1.158 2.159 2.405 4.276 3.453 6.487 1.481 3.128 3.688 4.935 8.075 4.528 3.838 2.53 6.91 5.09 9.981 7.649-3.408.644-6.815 1.289-10.615 1.862z",opacity:"1"}),_.jsx("path",{fill:"#52DD5A",d:"M154.217 57.132c2.363.412 5.113.728 7.305 2.003 6.993 4.069 13.78 8.493 20.991 12.823.386 3.074.426 6.106.057 9.544-8.285-4.232-16.162-8.87-24.038-13.508a10797.74 10797.74 0 01-4.315-10.862z",opacity:"1"}),_.jsx("path",{fill:"#00CFD8",d:"M16.05 144.975c-.032 2.016-.063 4.033-.11 6.474-.266-1.494-.726-3.41-.731-5.328-.036-15.064.016-30.13.484-45.645 2.058.335 3.731 1.02 5.277 1.925 5.976 3.495 11.912 7.06 17.863 10.6.047 2.703.095 5.406-.273 8.51-7.515-3.888-14.615-8.178-22.472-12.926 0 3.858 0 6.64-.026 9.87-.011 3.147.004 5.844-.011 8.991-.014 3.152.002 5.853-.008 9.004-.015 3.14-.004 5.833.006 8.525z",opacity:"1"}),_.jsx("path",{fill:"#22E2AA",d:"M112.026 99.266c3.355-.08 6.71-.16 10.58.153 7.661 4.795 14.808 9.196 21.955 13.596v4.757c-3.706 0-7.16 0-11.087-.418-1.152-1.264-1.678-2.334-2.536-2.918-5.006-3.407-10.197-6.553-15.088-10.114-1.635-1.19-2.57-3.343-3.824-5.056z",opacity:"1"}),_.jsx("path",{fill:"#0BE5DA",d:"M38.909 88.559c-5.47-2.516-10.85-5.513-16.275-8.429-2.108-1.133-4.317-2.082-6.836-3.111-.392-3.025-.428-6.053-.01-9.536 2.605.583 4.8 1.543 6.903 2.674 5.414 2.913 10.786 5.902 16.176 8.86.038 3.03.076 6.062.042 9.542z",opacity:"1"}),_.jsx("path",{fill:"#04D9DF",d:"M142.637 172.105c3.216 1.336 6.251 2.54 8.927 4.29 4.235 2.772 8.23 5.91 12.376 9.23-1.94 2.225-3.928 4.112-6.416 5.68-2.805-2.126-5.087-3.967-7.423-5.736-4.688-3.55-9.406-7.062-14.111-10.59 2.101-.92 4.203-1.841 6.647-2.874z",opacity:"1"}),_.jsx("path",{fill:"#07E4E3",d:"M56.216 102.46c7.609 4.52 15.135 9.5 22.722 14.795-7.345.314-14.751.314-22.804.314 0-4.869 0-9.758.082-15.108z",opacity:"1"}),_.jsx("path",{fill:"#00D9DE",d:"M38.904 112.552c-6.022-3.09-11.958-6.656-17.934-10.151-1.546-.904-3.22-1.59-5.178-2.382-.41-2.718-.475-5.43-.443-8.582 4.25 1.667 8.428 3.728 12.546 5.9 3.44 1.816 6.812 3.763 10.576 5.658.41 3.04.456 6.074.433 9.557z",opacity:"1"}),_.jsx("path",{fill:"#02ABC3",d:"M16.418 144.989c-.38-2.706-.39-5.398-.012-8.534 2.24.512 4.135 1.395 5.936 2.439 5.769 3.34 11.503 6.74 17.25 10.117.75 2.772 1.498 5.544 2.306 8.705-3.801-1.346-7.759-2.896-11.497-4.862-4.633-2.437-9.084-5.218-13.983-7.865z",opacity:"1"}),_.jsx("path",{fill:"#14E4C7",d:"M90.544 99.234c1.6 1.533 2.494 3.346 3.942 4.39 4.703 3.39 9.657 6.43 14.404 9.762 1.239.87 2.073 2.316 3.106 3.838-2.395.419-4.804.497-7.903.314-1.82-.378-2.949-.495-4.078-.611-2.166-2.05-4.153-4.345-6.54-6.093-3.554-2.6-7.466-4.71-11.063-7.256-1.077-.763-1.613-2.288-2.409-3.804 3.355-.43 6.722-.521 10.541-.54z",opacity:"1"}),_.jsx("path",{fill:"#00BDCD",d:"M16.08 126.997c-.014-2.698-.029-5.395.343-8.539 2.267.537 4.164 1.488 6.024 2.508 5.47 2.998 10.925 6.023 16.386 9.038.048 3.032.096 6.064-.268 9.501-7.769-3.9-15.127-8.204-22.484-12.508z",opacity:"1"}),_.jsx("path",{fill:"#14E4C7",d:"M39.985 66.998c-.326 2.73-.653 5.46-1.395 8.557-1.717-.33-3.022-1.016-4.317-1.721-6.023-3.282-12.043-6.569-18.064-9.854.57-2.436 1.14-4.873 2.25-7.643a29.74 29.74 0 017.06 2.707c4.853 2.594 9.648 5.296 14.466 7.954z",opacity:"1"}),_.jsx("path",{fill:"#02B4C8",d:"M16.05 127.446c7.388 3.855 14.746 8.16 22.445 12.509.642 2.778.942 5.511 1.17 8.65-5.82-2.971-11.554-6.371-17.323-9.711-1.801-1.044-3.695-1.927-5.91-2.888-.379-2.707-.395-5.408-.381-8.56z",opacity:"1"}),_.jsx("path",{fill:"#00C6D3",d:"M38.904 129.564c-5.532-2.575-10.987-5.6-16.457-8.598a74.807 74.807 0 00-5.998-2.956c-.36-2.785-.36-5.567-.36-9.425 7.856 4.748 14.956 9.038 22.4 13.372.391 2.418.439 4.792.415 7.607z",opacity:"1"}),_.jsx("path",{fill:"#19E3BC",d:"M159.333 145.996c0-2.371 0-4.742.456-7.537 2.769.814 5.081 2.052 7.395 3.286 5.17 2.758 10.34 5.513 15.511 8.27-.218 2.093-.435 4.186-1.201 6.632-2.487-.413-4.517-1.009-6.349-1.978-5.313-2.81-10.547-5.771-15.812-8.673z",opacity:"1"}),_.jsx("path",{fill:"#36E087",d:"M43.012 25.04c1.452-.952 2.904-1.903 4.846-2.6 6.652 4.024 12.816 7.791 18.98 11.558-.346 3.21-.692 6.42-1.446 9.266-1.63-1.61-2.685-3.108-4.105-4.06-4.952-3.319-10.12-6.323-15.008-9.73-1.426-.994-2.196-2.93-3.267-4.434z",opacity:"1"}),_.jsx("path",{fill:"#22E2AA",d:"M182.848 137.005c.043 2.042.085 4.084-.298 6.554-5.814-2.777-11.152-6.073-16.617-9.141-1.954-1.097-4.217-1.646-6.338-2.445-.083-2.362-.166-4.724.204-7.511 1.925.273 3.46.865 4.857 1.688 6.086 3.582 12.132 7.23 18.192 10.855z",opacity:"1"}),_.jsx("path",{fill:"#10D2DA",d:"M135.591 174.997c5.104 3.51 9.822 7.021 14.51 10.572 2.336 1.769 4.618 3.61 7.07 5.788-1.752 1.637-3.65 2.903-5.878 3.865-6.792-4.604-13.253-8.903-19.714-13.201-.304-3.114-1.881-6.883 4.012-7.024z",opacity:"1"}),_.jsx("path",{fill:"#2EE29A",d:"M182.85 123.001c.044 2.044.088 4.087-.298 6.559-2.865-.817-5.323-2.023-7.734-3.316-5.092-2.732-10.158-5.51-15.235-8.268-.083-2.367-.165-4.733.205-7.523 1.196-.108 1.986.128 2.677.533 6.804 3.99 13.593 8.006 20.386 12.015z",opacity:"1"}),_.jsx("path",{fill:"#34E192",d:"M42.672 25.09c1.41 1.454 2.181 3.39 3.607 4.384 4.889 3.407 10.056 6.411 15.008 9.73 1.42.952 2.475 2.45 3.713 4.031a22.66 22.66 0 01-6.684 2.299c-1.223-1.3-1.863-2.572-2.894-3.245-6.364-4.15-12.816-8.163-19.239-12.223 2.05-1.641 4.1-3.283 6.489-4.975z",opacity:"1"}),_.jsx("path",{fill:"#2EE29A",d:"M35.89 30.195a473.368 473.368 0 0119.532 12.094c1.031.673 1.67 1.946 2.525 3.284-1.092.995-2.22 1.647-4.042 2.354a312.328 312.328 0 01-19.87-11.69c-.703-.449-.679-2.038-.991-3.097.85-.94 1.7-1.878 2.845-2.945z",opacity:"1"}),_.jsx("path",{fill:"#3CDF74",d:"M182.838 95.002c.044 2.044.087 4.087-.3 6.558-3.87-1.491-7.28-3.461-10.755-5.314-4.021-2.144-8.098-4.185-12.151-6.27-.091-2.039-.182-4.078.203-6.542a33.016 33.016 0 018.01 3.094c5.042 2.744 10 5.64 14.993 8.474z",opacity:"1"}),_.jsx("path",{fill:"#38DF7C",d:"M159.495 90.398c4.19 1.663 8.267 3.704 12.288 5.848 3.474 1.853 6.886 3.823 10.687 5.747.41 2.048.456 4.09.076 6.562-3.872-1.488-7.29-3.459-10.77-5.313-4.032-2.148-8.117-4.193-12.179-6.283-.08-2.046-.159-4.092-.102-6.56z",opacity:"1"}),_.jsx("path",{fill:"#04D9DF",d:"M76.254 129.3c5.58 2.85 10.963 5.996 16.54 9.41-.633 2.14-1.462 4.01-2.936 6.076-6.049-3.127-11.451-6.45-16.854-9.775a537.765 537.765 0 013.25-5.712z",opacity:"1"}),_.jsx("path",{fill:"#44DE6C",d:"M182.906 94.568c-5.06-2.4-10.019-5.296-15.06-8.04-2.43-1.322-5.018-2.355-7.879-3.514-.47-2.047-.597-4.1-.263-6.583 3.218.886 6.032 2.098 8.72 3.542 4.845 2.602 9.615 5.343 14.416 8.026.045 2.045.09 4.09.066 6.57z",opacity:"1"}),_.jsx("path",{fill:"#34E192",d:"M182.917 122.567c-6.86-3.575-13.648-7.592-20.452-11.581-.691-.405-1.48-.641-2.552-.96-.413-1.73-.498-3.454-.111-5.598 3.012.683 5.653 1.602 8.073 2.927 5.055 2.769 9.993 5.751 14.98 8.646.043 2.044.086 4.088.062 6.566z",opacity:"1"}),_.jsx("path",{fill:"#0BE5DA",d:"M173.79 175.063c-4.836-2.505-9.387-5.17-13.965-7.79a75.774 75.774 0 00-6.388-3.251 24.082 24.082 0 013.526-6.486c6.92 4.175 13.374 8.288 19.829 12.401-.91 1.662-1.818 3.323-3.001 5.126z",opacity:"1"}),_.jsx("path",{fill:"#00C6D3",d:"M131.465 182.46c6.575 3.86 13.036 8.158 19.505 12.8-2.413 1.401-4.832 2.458-7.663 3.16-4.167-2.713-7.922-5.073-11.677-7.433-.093-2.696-.186-5.393-.165-8.528z",opacity:"1"}),_.jsx("path",{fill:"#14E4C7",d:"M159.236 146.383c5.362 2.515 10.596 5.475 15.909 8.286 1.832.97 3.862 1.565 6.17 2.331-.242 2.213-.853 4.426-2.005 6.782-4.846-2.523-9.07-5.332-13.486-7.796-2.34-1.306-5.014-2.011-7.537-2.988.284-2.076.568-4.152.949-6.615z",opacity:"1"}),_.jsx("path",{fill:"#48DD63",d:"M182.907 87.574c-4.868-2.258-9.638-5-14.482-7.601-2.69-1.444-5.503-2.656-8.62-3.972-.713-2.409-1.067-4.818-1.347-7.617 7.95 4.248 15.827 8.886 24.044 13.568.385 1.761.428 3.479.405 5.622z",opacity:"1"}),_.jsx("path",{fill:"#3BE189",d:"M182.921 115.566c-5.053-2.46-9.99-5.442-15.046-8.21-2.42-1.326-5.061-2.245-7.952-3.343-.431-2.064-.513-4.132-.46-6.628 4.196 1.664 8.281 3.71 12.312 5.857 3.48 1.854 6.899 3.825 10.708 5.747.41 2.05.457 4.096.438 6.577z",opacity:"1"}),_.jsx("path",{fill:"#22E2AA",d:"M47.885 52.757c-.817.965-1.634 1.931-3.08 3.02-7.014-4.162-13.399-8.447-19.784-12.732.813-1.245 1.626-2.49 3.083-3.849 4.956 2.48 9.387 4.9 13.535 7.734 2.324 1.588 4.18 3.862 6.246 5.827z",opacity:"1"}),_.jsx("path",{fill:"#19E3BC",d:"M40.25 66.76c-5.083-2.42-9.878-5.122-14.731-7.716-2.112-1.129-4.343-2.034-6.888-3.041.25-1.793.87-3.585 2.047-5.683 2.473.551 4.455 1.287 6.292 2.287 5.016 2.732 9.972 5.576 14.952 8.376-.47 1.846-.939 3.692-1.673 5.776z",opacity:"1"}),_.jsx("path",{fill:"#22E3B4",d:"M42.186 60.792c-5.244-2.609-10.2-5.453-15.216-8.185-1.837-1-3.819-1.736-6.082-2.585.951-2.219 2.25-4.445 3.84-6.824 6.678 4.132 13.063 8.417 19.794 12.73-.46 1.576-1.266 3.124-2.336 4.864zM159.464 132.392c2.252.38 4.515.929 6.469 2.026 5.465 3.068 10.803 6.364 16.552 9.575.379 1.73.397 3.455.313 5.601-5.273-2.336-10.444-5.091-15.614-7.849-2.314-1.234-4.626-2.472-7.27-3.712-.414-1.743-.497-3.483-.45-5.641z",opacity:"1"}),_.jsx("path",{fill:"#2CE2A4",d:"M159.455 118.395c5.205 2.34 10.271 5.117 15.363 7.849a115.926 115.926 0 007.67 3.75c.408 2.051.453 4.097.429 6.578-6.13-3.191-12.175-6.84-18.26-10.422-1.399-.823-2.933-1.415-4.735-2.115-.418-1.742-.506-3.481-.467-5.64z",opacity:"1"}),_.jsx("path",{fill:"#34E192",d:"M107.005 77c.83-1.862 1.66-3.724 3.114-5.754 6.028 3.442 11.431 7.05 16.835 10.66-.85 1.562-1.7 3.124-3.171 4.838-6.008-3.147-11.393-6.445-16.778-9.743z",opacity:"1"}),_.jsx("path",{fill:"#13E5D1",d:"M158.124 153.32c2.686.655 5.36 1.36 7.7 2.666 4.416 2.464 8.64 5.273 13.304 8.085-.331 1.922-1.024 3.697-2.027 5.67-6.764-3.917-13.219-8.03-19.872-12.406.112-1.406.422-2.55.895-4.015z",opacity:"1"}),_.jsx("path",{fill:"#10D2DA",d:"M72.707 135.176c5.7 3.16 11.102 6.483 16.876 9.808-.464 1.924-1.298 3.846-2.388 6.357l-18.676-9.997c1.469-2.266 2.68-4.134 4.188-6.168z",opacity:"1"}),_.jsx("path",{fill:"#40E28D",d:"M127.235 81.727c-5.685-3.43-11.088-7.04-16.845-10.681.36-1.67 1.074-3.307 2.092-5.642l18.892 9.704c-1.531 2.556-2.695 4.498-4.14 6.619z",opacity:"1"}),_.jsx("path",{fill:"#32E29F",d:"M106.734 77.187c5.656 3.112 11.04 6.41 16.77 9.736-2.041 4.98-6.953 2.77-11.099 3.845-3.487-2.629-6.559-5.188-9.995-7.75 1.108-1.883 2.581-3.764 4.324-5.83z",opacity:"1"}),_.jsx("path",{fill:"#26E2A8",d:"M144.662 112.586c-7.248-3.971-14.395-8.372-21.603-13.101 3.302-.374 6.663-.42 10.541-.073 4.004 2.466 7.492 4.54 10.98 6.613.06 2.044.121 4.088.082 6.561z",opacity:"1"}),_.jsx("path",{fill:"#2CE2A4",d:"M48.197 52.661c-2.379-1.87-4.234-4.143-6.558-5.731-4.148-2.835-8.579-5.255-13.244-7.882 1.117-1.9 2.587-3.768 4.353-5.772.608.923.584 2.512 1.287 2.96 6.318 4.029 12.765 7.857 19.54 11.745-1.446 1.528-3.256 3.057-5.378 4.68z",opacity:"1"}),_.jsx("path",{fill:"#38DF7C",d:"M66.904 33.565c-6.23-3.334-12.394-7.101-18.71-11.163a27.463 27.463 0 017.47-3.006c3.998 2.755 7.584 5.18 11.17 7.604.045 2.043.09 4.087.07 6.565z",opacity:"1"}),_.jsx("path",{fill:"#00BDCD",d:"M131.497 191.427c3.888 1.92 7.643 4.28 11.448 6.969-3.55 1.412-7.15 2.496-11.582 3.83 0-3.906 0-7.133.134-10.8z",opacity:"1"}),_.jsx("path",{fill:"#32E6BE",d:"M111.61 99.179c1.67 1.8 2.605 3.952 4.24 5.143 4.89 3.56 10.082 6.707 15.088 10.114.858.584 1.384 1.654 2.086 2.837-1.387.386-2.797.437-4.537.388-1.688-1.777-2.768-3.841-4.458-5.062-4.893-3.535-10.06-6.69-15.047-10.1-.845-.578-1.33-1.68-2-2.884 1.392-.404 2.802-.464 4.628-.436z",opacity:"1"}),_.jsx("path",{fill:"#3CDF74",d:"M66.901 26.546c-3.653-1.97-7.239-4.395-10.86-7.165 3.35-1.367 6.735-2.387 10.928-3.65 0 3.915 0 7.138-.068 10.815z",opacity:"1"}),_.jsx("path",{fill:"#23E0D5",d:"M16.109 64.287c6.121 2.978 12.14 6.265 18.164 9.547 1.295.705 2.6 1.392 4.249 2.12.395.793.442 1.553.417 2.688-5.462-2.583-10.834-5.572-16.248-8.485-2.103-1.131-4.298-2.09-6.798-3.113-.193-.806-.039-1.628.216-2.757z",opacity:"1"}),_.jsx("path",{fill:"#32E29F",d:"M144.68 105.59c-3.588-1.639-7.076-3.712-10.626-6.115 3.355-.33 6.772-.33 10.726-.33 0 2.18 0 4.094-.1 6.444zM90.45 71.705c-2.363-.81-4.755-1.95-7.3-3.396.974-1.133 2.102-1.96 3.466-2.96 1.41 2.235 2.607 4.13 3.834 6.356z",opacity:"1"}),_.jsx("path",{fill:"#32E6BE",d:"M99.73 116.977c1.414.066 2.543.183 3.91.537.249.441.26.644.33 1.145-1.669-.147-3.397-.593-5.126-1.038.054-.136.076-.305.172-.397.107-.102.282-.134.713-.247z",opacity:"1"})]}),qSt=()=>_.jsx("svg",{version:"1.2",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1594 1595",width:"24",height:"24",style:{fill:"inherit"},children:_.jsx("path",{fillRule:"evenodd",d:"m877 11.5l-32.8 403.8c-15.5-1.8-31-2.7-46.9-2.7-19.9 0-39.4 1.3-58.5 4.4l-18.6-195.6c-0.4-6.2 4.5-11.6 10.7-11.6h33.2l-16-197.8c-0.4-6.2 4.5-11.6 10.2-11.6h108.5c6.2 0 11.1 5.4 10.2 11.1zm-166.1 410.4c-35 8-68.2 20.8-98.8 37.6l-84.6-177.5c-2.6-5.3 0-11.9 5.8-14.2l31.4-11.5-82.8-180.6c-2.6-5.3 0-11.9 5.8-14.2l101.9-37.2c5.7-2.2 11.9 1.4 13.7 7.1 0.4 0 107.6 390.5 107.6 390.5zm-357.4-278l234.3 330.2c-29.7 19.5-56.7 42.5-79.7 69.1l-140.5-138.1c-4.4-4.4-3.9-11.5 0.5-15.5l25.7-21.3-139.6-141.2c-4.4-4.4-3.9-11.5 0.9-15.5l82.9-69.5c4.8-4 11.5-3.1 15 1.8zm136.9 421.4c-21.3 27.9-38.5 58.9-51.4 92.1l-178.9-81.9c-5.8-2.2-8-9.3-4.9-14.6l16.8-28.8-179.8-85c-5.3-2.6-7.5-9.3-4.4-14.6l54-93.8c3.1-5.3 10.2-7.1 15.1-3.6zm-466 24.8c0.9-6.2 7.1-9.7 12.8-8.4l392 102.3c-10.2 33.2-15.9 68.2-16.8 104.5l-196.2-16c-6.2-0.4-10.7-6.2-9.3-12.4l5.7-32.7-198-18.6c-6.2-0.5-10.1-6.2-9.3-12.4l18.6-106.7zm-15 264.7l403.5-37.2c1.8 35.9 8.9 70.9 19.9 103.6l-189.5 52.3c-5.8 1.3-12-2.2-12.9-8.4l-5.7-32.8-192.3 50c-5.7 1.4-11.9-2.2-12.8-8.4l-19.1-106.7c-0.9-6.2 3.1-11.9 9.3-12.4zm63.4 280.7c-3.1-5.3-0.9-11.9 4.4-14.6l365.9-173.5c13.7 32.7 32.3 63.3 54.4 90.7l-160.3 114.2c-4.9 3.6-12 2.2-15.1-3.1l-16.8-29.2-163.4 112.9c-4.9 3.5-12 1.8-15.1-3.5 0 0-54.5-93.9-54-93.9zm525.7-9.3l-111.6 162c-3.5 5.4-10.6 6.2-15.5 2.3l-25.7-21.7-115.1 162c-3.6 4.9-10.2 5.8-15.1 1.8l-83.3-69.5c-4.8-4-5.3-11.1-0.9-15.5l284.8-288.2c24.4 25.6 52.3 48.2 82.4 66.8zm-138.6 395.8c-5.8-2.2-8.4-8.9-5.8-14.2l168.8-368.3c31 15.9 64.7 27.9 99.7 34.5l-49.7 190.4c-1.3 5.7-7.9 9.3-13.7 7.1l-31.4-11.5-52.7 191.7c-1.8 5.7-8 9.3-13.8 7l-101.8-37.1zm337.5-340c19.9 0 39.4-1.4 58.4-4.5l18.6 195.7c0.5 6.2-4.4 11.5-10.6 11.5h-33.2l15.9 197.9c0.9 6.2-3.9 11.5-10.1 11.5h-108.6c-5.7 0-10.6-5.3-10.2-11.5l32.8-403.7c15.5 2.2 31 3.1 47 3.1zm174.5-728.3c-31-15.5-64.2-27.5-99.7-34.5l49.6-190.4c1.8-5.8 8-9.3 13.8-7.1l31.4 11.5 52.7-191.7c1.8-5.7 8-9.3 13.8-7.1l101.8 37.2c5.8 2.2 8.5 8.4 5.8 14.2zm391.6-207.2l-284.9 288.2c-23.9-25.7-51.3-48.2-81.9-66.8l111.6-162.1c3.6-4.8 10.7-6.2 15.5-2.2l25.7 21.7 115.2-162c3.5-4.9 10.6-5.8 15-1.8l83.3 69.5c4.9 4 4.9 11.1 0.5 15.5zm153.7 227.1l-365.9 173.6c-14.2-32.8-32.3-63.4-54.5-90.8l160.3-114.2c4.9-4 12-2.2 15.1 3.1l16.8 28.8 163.5-112.9c4.9-3.1 11.9-1.8 15 3.5l54.5 93.9c3.1 5.3 1.4 11.9-4.4 14.6zm58 146.5l18.6 106.7c0.9 6.2-3.1 11.5-9.3 12.4l-403.5 37.6c-1.8-36.3-8.9-70.8-19.9-103.6l189.6-52.2c5.7-1.8 11.9 2.2 12.8 8.4l5.8 32.8 192.2-50.1c5.8-1.3 12 2.3 12.8 8.5zm-18.6 391.3l-392-102.3c10.2-33.2 16-68.1 16.9-104.4l196.2 15.9c6.2 0.9 10.2 6.2 9.3 12.4l-5.8 32.8 198 18.6c6.2 0.8 10.2 6.1 9.3 12.3l-18.6 106.7c-0.9 6.2-7.1 9.8-12.8 8.5zm-104.1 243.9c-3.1 5.3-10.2 6.6-15.1 3.5l-333.5-230.2c21.3-27.9 38.5-58.9 51.4-92.1l178.9 81.9c5.8 2.7 8 9.3 4.9 14.6l-16.8 28.8 179.8 85c5.3 2.7 7.5 9.3 4.4 14.6zm-446.5-135.9c29.7-19 56.3-42.5 79.8-69l140.4 138.1c4.4 4.4 4.4 11.5-0.5 15.5l-25.7 21.2 139.6 141.3c4 4.4 4 11.5-0.9 15.4l-82.8 69.6c-4.5 3.9-11.6 3.1-15.1-1.8l-234.3-330.3zm-1.8 449.8c-5.7 2.2-11.9-1.3-13.7-7.1l-107.2-390.4c35-8 68.2-20.8 98.8-37.7l84.6 177.6c2.6 5.7 0 12.4-5.8 14.1l-31.4 11.5 82.8 180.7c2.6 5.7 0 11.9-5.8 14.1l-101.8 37.2z"})});function WSt(e){return e.charAt(0).toUpperCase()+e.slice(1)}function RV(e){switch(e){case"azure-ad":return"Microsoft";case"github":return"GitHub";case"okta":return"Okta";case"descope":return"Descope";case"aws-cognito":return"Cognito";default:return WSt(e)}}function jSt(e){switch(e){case"google":return _.jsx(cae,{});case"github":return _.jsx(sae,{});case"azure-ad":return _.jsx(dae,{});case"okta":return _.jsx(qSt,{});case"auth0":return _.jsx(GSt,{});case"descope":return _.jsx(YSt,{});case"aws-cognito":return _.jsx(VSt,{});default:return null}}const KSt=({provider:e,onClick:t,isSignIn:n})=>{const{t:r}=ql();return _.jsx(Ii,{variant:"outlined",color:"inherit",startIcon:jSt(e.toLowerCase()),onClick:t,sx:{width:"100%",textTransform:"none",borderColor:Mt[400],padding:1.5,paddingLeft:3,justifyContent:"flex-start"},children:n?r("components.molecules.auth.providerButton.continue",{provider:RV(e)}):r("components.molecules.auth.providerButton.signup",{provider:RV(e)})})},QSt=({title:e,error:t,providers:n,callbackUrl:r,onPasswordSignIn:a,onOAuthSignIn:i,onForgotPassword:o,onSignUp:s,renderLogo:l,passwordChecklistSettings:c})=>{const[u,p]=x.useState(!1),[f,h]=x.useState(!c),[g,E]=M4(!0),[y,b]=M4(),[v,C]=x.useState(t),{t:T}=ql(),N=i&&n.length;x.useEffect(()=>{C(void 0),A.resetForm()},[g]),x.useEffect(()=>{C(t)},[t]),x.useEffect(()=>{!a&&i&&n.length===1&&i(n[0],r)},[a,i,n]);const A=P6({initialValues:{email:"",password:""},validationSchema:H6({email:gS().required(T("components.molecules.auth.authLogin.form.emailRequired")),password:gS().required(T("components.molecules.auth.authLogin.form.passwordRequired"))}),onSubmit:async({email:O,password:M})=>{if(p(!0),!!a)try{g?await a(O,M,r):s&&await s(O,M,r)}catch(P){P instanceof Error&&C(P.message)}finally{p(!1)}},validateOnBlur:!0});return _.jsxs(ASt,{title:e,renderLogo:l,children:[v?_.jsx(ms,{sx:{my:1},severity:"error",children:T([`components.molecules.auth.authLogin.error.${v.toLowerCase()}`,"components.molecules.auth.authLogin.error.default"])}):null,a?_.jsxs("form",{onSubmit:A.handleSubmit,children:[_.jsx(Lf,{id:"email",placeholder:T("components.molecules.auth.authLogin.form.email"),size:"medium",value:A.values.email,hasError:!!A.errors.email,description:A.touched.email?A.errors.email:void 0,onBlur:A.handleBlur,onChange:O=>A.setFieldValue("email",O.target.value)}),_.jsx(Lf,{id:"password",placeholder:T("components.molecules.auth.authLogin.form.password"),value:A.values.password,hasError:!!A.errors.password,description:A.touched.password?A.errors.password:void 0,onBlur:A.handleBlur,onChange:O=>A.setFieldValue("password",O.target.value),type:y?"text":"password",size:"medium",endAdornment:_.jsx(I5,{position:"end",children:_.jsx(zn,{"aria-label":"toggle password visibility",onClick:b,children:y?_.jsx(oae,{}):_.jsx(iae,{})})})}),!g&&A.values.password.length&&c?_.jsxs(_t,{sx:{border:1,marginTop:1,padding:1.5,borderRadius:1,borderColor:"grey.400","& .checklist-icon":{marginTop:.5},fontSize:14},children:[_.jsx(Pt,{path:"components.molecules.auth.authLogin.form.passwordMustContain"}),_.jsx(_St,{rules:c.rules,minLength:c.minLength,maxLength:c.maxLength,value:A.values.password,messages:c.messages,onChange:h})]}):null,g&&o?_.jsx(Zp,{href:"#",marginTop:1,onClick:o,children:_.jsx(Pt,{path:"components.molecules.auth.authLogin.form.forgotPassword"})}):null,_.jsx(Ii,{type:"submit",disabled:u||!g&&!f,variant:"contained",sx:{marginTop:3,width:"100%"},children:_.jsx(Pt,{path:"components.molecules.auth.authLogin.form.continue"})})]}):null,s?_.jsx(kt,{direction:"row",alignItems:"center",gap:.5,marginTop:1,children:g?_.jsxs(_.Fragment,{children:[_.jsx(fn,{color:"text.primary",children:_.jsx(Pt,{path:"components.molecules.auth.authLogin.form.noAccount"})}),_.jsx(Zp,{component:"button",onClick:E,children:_.jsx(Pt,{path:"components.molecules.auth.authLogin.form.signup"})})]}):_.jsxs(_.Fragment,{children:[_.jsx(fn,{color:"text.primary",children:_.jsx(Pt,{path:"components.molecules.auth.authLogin.form.alreadyHaveAccount"})}),_.jsx(Zp,{component:"button",onClick:E,children:_.jsx(Pt,{path:"components.molecules.auth.authLogin.form.signin"})})]})}):null,a&&N?_.jsx(fn,{color:"text.primary",sx:{alignItems:"center",direction:"row",display:"flex",gap:2,marginTop:1,width:"100%",":before, :after":{content:'""',borderBottom:`1px solid ${Mt[400]}`,height:"0.5px",flex:"1 0 auto"}},children:_.jsx(Pt,{path:"components.molecules.auth.authLogin.form.or"})}):null,N?_.jsx(kt,{color:"text.primary",marginTop:1,gap:1,children:n.map((O,M)=>_.jsx(KSt,{isSignIn:g,provider:O,onClick:()=>i(O,r)},`provider-${M}`))}):null]})};var iL={},XSt=Qn;Object.defineProperty(iL,"__esModule",{value:!0});iL.default=void 0;var ZSt=XSt(Xn()),JSt=_,evt=(0,ZSt.default)((0,JSt.jsx)("path",{d:"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 14H4V8l8 5 8-5v10zm-8-7L4 6h16l-8 5z"}),"MailOutline");iL.default=evt;function tvt(){const e=Qw(),{data:t,setAccessToken:n,user:r}=gs(),[a,i]=x.useState(""),o=yt(ca),s=no(),l=async()=>{try{const u=await o.headerAuth();n(u.access_token),s("/")}catch(u){i(u.message)}},c=async(u,p,f)=>{const h=new FormData;h.append("username",u),h.append("password",p);try{const g=await o.passwordAuth(h);n(g.access_token),s(f)}catch(g){i(g.message)}};return x.useEffect(()=>{i(e.get("error")||"")},[e]),x.useEffect(()=>{t&&(t.requireLogin||s("/"),t.headerAuth&&l(),r&&s("/"))},[t,r]),_.jsx(QSt,{title:_.jsx(Pt,{path:"components.molecules.auth.authLogin.title"}),error:a,callbackUrl:"/",providers:(t==null?void 0:t.oauthProviders)||[],onPasswordSignIn:t!=null&&t.passwordAuth?c:void 0,onOAuthSignIn:async u=>{window.location.href=o.getOAuthEndpoint(u)},renderLogo:_.jsx(jD,{style:{maxWidth:"60%",maxHeight:"90px"}})})}const nvt=({thread:e,error:t,isLoading:n})=>{const r=yt(vd),[a,i]=x.useState([]),o=yt(ca),{t:s}=Yy(),{threadId:l}=hs(),c=du();x.useEffect(()=>{e&&i(e.steps)},[e]);const u=x.useCallback(async(E,y,b)=>{try{oa.promise(o.setFeedback(b,r),{loading:"Updating",success:v=>(i(C=>C.map(T=>T.id===E.id?{...T,feedback:{...b,id:v.feedbackId}}:T)),y(),"Feedback updated!"),error:v=>_.jsx("span",{children:v.message})})}catch(v){console.log(v)}},[]),p=x.useCallback(async(E,y,b)=>{try{oa.promise(o.deleteFeedback(b,r),{loading:s("components.organisms.chat.Messages.index.updating"),success:()=>(i(v=>v.map(C=>C.id===E.id?{...C,feedback:void 0}:C)),y(),s("components.organisms.chat.Messages.index.feedbackUpdated")),error:v=>_.jsx("span",{children:v.message})})}catch(v){console.log(v)}},[]);if(n)return _.jsx(_.Fragment,{children:[1,2,3].map(E=>_.jsxs(kt,{sx:{px:2,gap:4,mt:5,flexDirection:"row",justifyContent:"center"},children:[_.jsxs(kt,{children:[_.jsx(Bc,{width:50}),_.jsx(Bc,{width:50})]}),_.jsx(Bc,{variant:"rounded",sx:{maxWidth:c,width:"100%",height:100}})]},`thread-skeleton-${E}`))});if(!e||t)return null;const f=e.elements,h=[],g=lSe(a);return _.jsxs(kt,{flexGrow:1,width:"100%",height:"100%",children:[_.jsx(_t,{sx:{width:"100%",maxWidth:c,mx:"auto",my:2},children:_.jsxs(ms,{sx:{mx:2},id:"thread-info",severity:"info",action:_.jsx(Ii,{component:Kw,color:"inherit",size:"small",to:l?`/thread/${l}`:"/",children:_.jsx(Pt,{path:"components.organisms.threadHistory.Thread.backToChat"})}),children:[_.jsx(Pt,{path:"components.organisms.threadHistory.Thread.chatCreatedOn"})," ",new Intl.DateTimeFormat(void 0,{day:"numeric",month:"numeric",year:"numeric",hour:"numeric",minute:"numeric"}).format(new Date(e.createdAt)),"."]})}),_.jsx(kre,{autoScroll:!0,children:_.jsx(Ure,{loading:!1,actions:h,elements:f||[],onFeedbackUpdated:u,onFeedbackDeleted:p,messages:g})})]})};function rvt({threadId:e}){const t=no(),n=du(),r=yt(Zr),{clear:a,setIdToResume:i}=Uo(),{session:o,idToResume:s}=Ul();if(x.useEffect(()=>{e===s&&(o!=null&&o.socket.connected?oa.success("Chat resumed successfully"):o!=null&&o.error&&oa.error("Couldn't resume chat"))},[o,s,e]),!e||!(r!=null&&r.threadResumable))return null;const l=()=>{a(),i(e),r!=null&&r.dataPersistence||t("/")};return _.jsxs(_t,{display:"flex",flexDirection:"column",gap:1,p:2,sx:{boxSizing:"border-box",width:"100%",maxWidth:n,m:"auto",justifyContent:"center"},children:[_.jsx(Ii,{id:"resumeThread",onClick:l,variant:"contained",children:_.jsx(Pt,{path:"pages.ResumeButton.resumeChat"})}),_.jsx(rae,{})]})}function avt(){const{id:e}=iK(),t=yt(ca),{data:n,error:r,isLoading:a}=gf(t,e?`/project/thread/${e}`:null,{revalidateOnFocus:!1}),[i,o]=xa(fv),{threadId:s}=hs(),l=s===e;return x.useEffect(()=>{(i==null?void 0:i.currentThreadId)!==e&&o(c=>({...c,currentThreadId:e}))},[e]),_.jsx(R6,{children:_.jsxs(_.Fragment,{children:[l&&_.jsx(aae,{}),!l&&_.jsxs(_t,{sx:{display:"flex",flexDirection:"column",flexGrow:1,gap:2},children:[_.jsx(_t,{sx:{width:"100%",flexGrow:1,overflow:"auto"},children:_.jsx(nvt,{thread:n,error:r,isLoading:a})}),_.jsx(rvt,{threadId:e})]})]})})}const ivt=Kve([{path:"/",element:_.jsx(hSt,{})},{path:"/env",element:_.jsx(mgt,{})},{path:"/thread/:id?",element:_.jsx(avt,{})},{path:"/element/:id",element:_.jsx(Udt,{})},{path:"/login",element:_.jsx(tvt,{})},{path:"/login/callback",element:_.jsx(tye,{})},{path:"*",element:_.jsx($I,{replace:!0,to:"/"})}]);var ovt=W6,svt=qne,lvt=g6;function cvt(e,t){var n={};return t=lvt(t),svt(e,function(r,a,i){ovt(n,a,t(r,a,i))}),n}var uvt=cvt;const dvt=Aa(uvt);function pvt(){const{chatSettingsValue:e,chatSettingsInputs:t,chatSettingsDefaultValue:n}=au(),{updateChatSettings:r}=Uo(),[a,i]=xa(Cee),o=P6({initialValues:e,enableReinitialize:!0,onSubmit:async()=>{}}),s=()=>i(!1),l=()=>{const u=dvt(o.values,p=>p!==""?p:null);r(u),s()},c=()=>{o.setValues(n)};return _.jsxs(Og,{open:a,onClose:s,id:"chat-settings-dialog",PaperProps:{sx:{backgroundImage:"none"}},children:[_.jsx(Ig,{id:"alert-dialog-title",children:_.jsx(Pt,{path:"components.organisms.chat.settings.settingsPanel"})}),_.jsx(Ng,{children:_.jsx(_t,{sx:{display:"flex",flexDirection:"column",minWidth:"20vw",maxHeight:"70vh",gap:"15px"},children:t.map(u=>_.jsx(ctt,{element:{...u,value:o.values[u.id],onChange:o.handleChange,setField:o.setFieldValue}},u.id))})}),_.jsxs(my,{sx:{p:2},children:[_.jsx(oS,{onClick:c,color:"primary",variant:"outlined",children:_.jsx(Pt,{path:"components.organisms.chat.settings.reset"})}),_.jsx("div",{style:{flex:"1 0 0"}}),_.jsx(rne,{onClick:s,children:_.jsx(Pt,{path:"components.organisms.chat.settings.cancel"})}),_.jsx(oS,{id:"confirm",variant:"outlined",onClick:l,autoFocus:!0,children:_.jsx(Pt,{path:"components.organisms.chat.settings.confirm"})})]})]})}function fvt(e){var r,a,i,o,s,l;const t=e.palette.mode,n=(r=window==null?void 0:window.theme)==null?void 0:r[t];return n!=null&&n.background&&(e.palette.background.default=n.background),n!=null&&n.paper&&(e.palette.background.paper=n.paper),(a=n==null?void 0:n.primary)!=null&&a.main&&(e.palette.primary.main=n.primary.main),(i=n==null?void 0:n.primary)!=null&&i.dark&&(e.palette.primary.dark=n.primary.dark),(o=n==null?void 0:n.primary)!=null&&o.light&&(e.palette.primary.light=n.primary.light),(s=n==null?void 0:n.text)!=null&&s.primary&&(e.palette.text.primary=n.text.primary),(l=n==null?void 0:n.text)!=null&&l.secondary&&(e.palette.text.secondary=n.text.secondary),e}function mvt(){var h;const{theme:e}=yt(Wl),t=yt(Zr),n=(h=window.theme)==null?void 0:h.font_family,r=fvt(kXe(e,n)),{isAuthenticated:a,accessToken:i}=gs(),o=yt(C6),{connect:s,chatProfile:l,setChatProfile:c}=Ul(),u=yt(ca),p=!!t,f=p?t.chatProfiles.length?!!l:!0:!1;if(x.useEffect(()=>{if(a)if(f)s({client:u,userEnv:o,accessToken:i});else return;else return},[o,i,a,s,f]),p&&t.chatProfiles.length&&!l){const g=t.chatProfiles.find(E=>E.default);c(g?g.name:t.chatProfiles[0].name)}return _.jsxs(Y2e,{theme:r,children:[_.jsx(cQ,{styles:{body:{backgroundColor:r.palette.background.default}}}),_.jsx(DSe,{className:"toast",position:"top-right",toastOptions:{style:{fontFamily:r.typography.fontFamily,background:r.palette.background.paper,border:`1px solid ${r.palette.divider}`,color:r.palette.text.primary}}}),_.jsxs(_t,{display:"flex",height:"100vh",maxHeight:"-webkit-fill-available",width:"100vw",sx:{overflowX:"hidden"},children:[_.jsx(pvt,{}),_.jsx(zve,{router:ivt})]})]})}function hvt(){const e=yt(ca),[t,n]=xa(Zr),r=Tn(Wl),{isAuthenticated:a,isReady:i}=gs(),{i18n:o}=Yy(),s=navigator.language||"en-US";function l(p){o.addResourceBundle(s,"translation",p),o.changeLanguage(s)}const{data:c}=gf(e,t===void 0&&a?`/project/settings?language=${s}`:null),{data:u}=gf(e,`/project/translations?language=${s}`);return i&&!a&&window.location.pathname!=="/login"&&window.location.pathname!=="/login/callback"&&(window.location.href="/login"),x.useEffect(()=>{c&&(n(c),r(p=>({...p,defaultCollapseContent:c.ui.default_collapse_content??!0})))},[c,n,r]),x.useEffect(()=>{u&&l(u.translation)},[u]),i?_.jsx(mvt,{}):null}var E3={},xV=Bf;E3.createRoot=xV.createRoot,E3.hydrateRoot=xV.hydrateRoot;const gvt={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console&&console[e]&&console[e].apply(console,t)}};class SS{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(t,n)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=t||gvt,this.options=n,this.debug=n.debug}log(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"log","",!0)}warn(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"warn","",!0)}error(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"error","")}deprecate(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,r,a){return a&&!this.debug?null:(typeof t[0]=="string"&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new SS(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new SS(this.logger,t)}}var Ms=new SS;class dT{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(r=>{this.observers[r]=this.observers[r]||[],this.observers[r].push(n)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t]=this.observers[t].filter(r=>r!==n)}}emit(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];this.observers[t]&&[].concat(this.observers[t]).forEach(o=>{o(...r)}),this.observers["*"]&&[].concat(this.observers["*"]).forEach(o=>{o.apply(o,[t,...r])})}}function xm(){let e,t;const n=new Promise((r,a)=>{e=r,t=a});return n.resolve=e,n.reject=t,n}function AV(e){return e==null?"":""+e}function _vt(e,t,n){e.forEach(r=>{t[r]&&(n[r]=t[r])})}function oL(e,t,n){function r(o){return o&&o.indexOf("###")>-1?o.replace(/###/g,"."):o}function a(){return!e||typeof e=="string"}const i=typeof t!="string"?[].concat(t):t.split(".");for(;i.length>1;){if(a())return{};const o=r(i.shift());!e[o]&&n&&(e[o]=new n),Object.prototype.hasOwnProperty.call(e,o)?e=e[o]:e={}}return a()?{}:{obj:e,k:r(i.shift())}}function OV(e,t,n){const{obj:r,k:a}=oL(e,t,Object);r[a]=n}function Evt(e,t,n,r){const{obj:a,k:i}=oL(e,t,Object);a[i]=a[i]||[],r&&(a[i]=a[i].concat(n)),r||a[i].push(n)}function vS(e,t){const{obj:n,k:r}=oL(e,t);if(n)return n[r]}function bvt(e,t,n){const r=vS(e,n);return r!==void 0?r:vS(t,n)}function fae(e,t,n){for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?typeof e[r]=="string"||e[r]instanceof String||typeof t[r]=="string"||t[r]instanceof String?n&&(e[r]=t[r]):fae(e[r],t[r],n):e[r]=t[r]);return e}function dp(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var Svt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function vvt(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,t=>Svt[t]):e}const yvt=[" ",",","?","!",";"];function Tvt(e,t,n){t=t||"",n=n||"";const r=yvt.filter(o=>t.indexOf(o)<0&&n.indexOf(o)<0);if(r.length===0)return!0;const a=new RegExp(`(${r.map(o=>o==="?"?"\\?":o).join("|")})`);let i=!a.test(e);if(!i){const o=e.indexOf(n);o>0&&!a.test(e.substring(0,o))&&(i=!0)}return i}function yS(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!e)return;if(e[t])return e[t];const r=t.split(n);let a=e;for(let i=0;i<r.length;++i){if(!a||typeof a[r[i]]=="string"&&i+1<r.length)return;if(a[r[i]]===void 0){let o=2,s=r.slice(i,i+o).join(n),l=a[s];for(;l===void 0&&r.length>i+o;)o++,s=r.slice(i,i+o).join(n),l=a[s];if(l===void 0)return;if(l===null)return null;if(t.endsWith(s)){if(typeof l=="string")return l;if(s&&typeof l[s]=="string")return l[s]}const c=r.slice(i+o).join(n);return c?yS(l,c,n):void 0}a=a[r[i]]}return a}function TS(e){return e&&e.indexOf("_")>0?e.replace("_","-"):e}class NV extends dT{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r){let a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const i=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,o=a.ignoreJSONStructure!==void 0?a.ignoreJSONStructure:this.options.ignoreJSONStructure;let s=[t,n];r&&typeof r!="string"&&(s=s.concat(r)),r&&typeof r=="string"&&(s=s.concat(i?r.split(i):r)),t.indexOf(".")>-1&&(s=t.split("."));const l=vS(this.data,s);return l||!o||typeof r!="string"?l:yS(this.data&&this.data[t]&&this.data[t][n],r,i)}addResource(t,n,r,a){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator;let s=[t,n];r&&(s=s.concat(o?r.split(o):r)),t.indexOf(".")>-1&&(s=t.split("."),a=n,n=s[1]),this.addNamespaces(n),OV(this.data,s,a),i.silent||this.emit("added",t,n,r,a)}addResources(t,n,r){let a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const i in r)(typeof r[i]=="string"||Object.prototype.toString.apply(r[i])==="[object Array]")&&this.addResource(t,n,i,r[i],{silent:!0});a.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,a,i){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},s=[t,n];t.indexOf(".")>-1&&(s=t.split("."),a=r,r=n,n=s[1]),this.addNamespaces(n);let l=vS(this.data,s)||{};a?fae(l,r,i):l={...l,...r},OV(this.data,s,l),o.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(t,n)}:this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(a=>n[a]&&Object.keys(n[a]).length>0)}toJSON(){return this.data}}var mae={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,a){return e.forEach(i=>{this.processors[i]&&(t=this.processors[i].process(t,n,r,a))}),t}};const IV={};class CS extends dT{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),_vt(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Ms.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(t==null)return!1;const r=this.resolve(t,n);return r&&r.res!==void 0}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const a=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let i=n.ns||this.options.defaultNS||[];const o=r&&t.indexOf(r)>-1,s=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!Tvt(t,r,a);if(o&&!s){const l=t.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:t,namespaces:i};const c=t.split(r);(r!==a||r===a&&this.options.ns.indexOf(c[0])>-1)&&(i=c.shift()),t=c.join(a)}return typeof i=="string"&&(i=[i]),{key:t,namespaces:i}}translate(t,n,r){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const a=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,i=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:o,namespaces:s}=this.extractFromKey(t[t.length-1],n),l=s[s.length-1],c=n.lng||this.language,u=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(c&&c.toLowerCase()==="cimode"){if(u){const T=n.nsSeparator||this.options.nsSeparator;return a?{res:`${l}${T}${o}`,usedKey:o,exactUsedKey:o,usedLng:c,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:`${l}${T}${o}`}return a?{res:o,usedKey:o,exactUsedKey:o,usedLng:c,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:o}const p=this.resolve(t,n);let f=p&&p.res;const h=p&&p.usedKey||o,g=p&&p.exactUsedKey||o,E=Object.prototype.toString.apply(f),y=["[object Number]","[object Function]","[object RegExp]"],b=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,v=!this.i18nFormat||this.i18nFormat.handleAsObject;if(v&&f&&(typeof f!="string"&&typeof f!="boolean"&&typeof f!="number")&&y.indexOf(E)<0&&!(typeof b=="string"&&E==="[object Array]")){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const T=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,f,{...n,ns:s}):`key '${o} (${this.language})' returned an object instead of string.`;return a?(p.res=T,p.usedParams=this.getUsedParamsDetails(n),p):T}if(i){const T=E==="[object Array]",N=T?[]:{},A=T?g:h;for(const O in f)if(Object.prototype.hasOwnProperty.call(f,O)){const M=`${A}${i}${O}`;N[O]=this.translate(M,{...n,joinArrays:!1,ns:s}),N[O]===M&&(N[O]=f[O])}f=N}}else if(v&&typeof b=="string"&&E==="[object Array]")f=f.join(b),f&&(f=this.extendTranslation(f,t,n,r));else{let T=!1,N=!1;const A=n.count!==void 0&&typeof n.count!="string",O=CS.hasDefaultValue(n),M=A?this.pluralResolver.getSuffix(c,n.count,n):"",P=n.ordinal&&A?this.pluralResolver.getSuffix(c,n.count,{ordinal:!1}):"",D=n[`defaultValue${M}`]||n[`defaultValue${P}`]||n.defaultValue;!this.isValidLookup(f)&&O&&(T=!0,f=D),this.isValidLookup(f)||(N=!0,f=o);const V=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&N?void 0:f,Z=O&&D!==f&&this.options.updateMissing;if(N||T||Z){if(this.logger.log(Z?"updateKey":"missingKey",c,l,o,Z?D:f),i){const q=this.resolve(o,{...n,keySeparator:!1});q&&q.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let W=[];const ae=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&ae&&ae[0])for(let q=0;q<ae.length;q++)W.push(ae[q]);else this.options.saveMissingTo==="all"?W=this.languageUtils.toResolveHierarchy(n.lng||this.language):W.push(n.lng||this.language);const he=(q,G,H)=>{const k=O&&H!==f?H:V;this.options.missingKeyHandler?this.options.missingKeyHandler(q,l,G,k,Z,n):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(q,l,G,k,Z,n),this.emit("missingKey",q,l,G,f)};this.options.saveMissing&&(this.options.saveMissingPlurals&&A?W.forEach(q=>{this.pluralResolver.getSuffixes(q,n).forEach(G=>{he([q],o+G,n[`defaultValue${G}`]||D)})}):he(W,o,D))}f=this.extendTranslation(f,t,n,p,r),N&&f===o&&this.options.appendNamespaceToMissingKey&&(f=`${l}:${o}`),(N||T)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?f=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}:${o}`:o,T?f:void 0):f=this.options.parseMissingKeyHandler(f))}return a?(p.res=f,p.usedParams=this.getUsedParamsDetails(n),p):f}extendTranslation(t,n,r,a,i){var o=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||a.usedLng,a.usedNS,a.usedKey,{resolved:a});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const c=typeof t=="string"&&(r&&r.interpolation&&r.interpolation.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let u;if(c){const f=t.match(this.interpolator.nestingRegexp);u=f&&f.length}let p=r.replace&&typeof r.replace!="string"?r.replace:r;if(this.options.interpolation.defaultVariables&&(p={...this.options.interpolation.defaultVariables,...p}),t=this.interpolator.interpolate(t,p,r.lng||this.language,r),c){const f=t.match(this.interpolator.nestingRegexp),h=f&&f.length;u<h&&(r.nest=!1)}!r.lng&&this.options.compatibilityAPI!=="v1"&&a&&a.res&&(r.lng=a.usedLng),r.nest!==!1&&(t=this.interpolator.nest(t,function(){for(var f=arguments.length,h=new Array(f),g=0;g<f;g++)h[g]=arguments[g];return i&&i[0]===h[0]&&!r.context?(o.logger.warn(`It seems you are nesting recursively key: ${h[0]} in key: ${n[0]}`),null):o.translate(...h,n)},r)),r.interpolation&&this.interpolator.reset()}const s=r.postProcess||this.options.postProcess,l=typeof s=="string"?[s]:s;return t!=null&&l&&l.length&&r.applyPostProcessor!==!1&&(t=mae.handle(l,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...a,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),t}resolve(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r,a,i,o,s;return typeof t=="string"&&(t=[t]),t.forEach(l=>{if(this.isValidLookup(r))return;const c=this.extractFromKey(l,n),u=c.key;a=u;let p=c.namespaces;this.options.fallbackNS&&(p=p.concat(this.options.fallbackNS));const f=n.count!==void 0&&typeof n.count!="string",h=f&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),g=n.context!==void 0&&(typeof n.context=="string"||typeof n.context=="number")&&n.context!=="",E=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);p.forEach(y=>{this.isValidLookup(r)||(s=y,!IV[`${E[0]}-${y}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(s)&&(IV[`${E[0]}-${y}`]=!0,this.logger.warn(`key "${a}" for languages "${E.join(", ")}" won't get resolved as namespace "${s}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),E.forEach(b=>{if(this.isValidLookup(r))return;o=b;const v=[u];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(v,u,b,y,n);else{let T;f&&(T=this.pluralResolver.getSuffix(b,n.count,n));const N=`${this.options.pluralSeparator}zero`,A=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(f&&(v.push(u+T),n.ordinal&&T.indexOf(A)===0&&v.push(u+T.replace(A,this.options.pluralSeparator)),h&&v.push(u+N)),g){const O=`${u}${this.options.contextSeparator}${n.context}`;v.push(O),f&&(v.push(O+T),n.ordinal&&T.indexOf(A)===0&&v.push(O+T.replace(A,this.options.pluralSeparator)),h&&v.push(O+N))}}let C;for(;C=v.pop();)this.isValidLookup(r)||(i=C,r=this.getResource(b,y,C,n))}))})}),{res:r,usedKey:a,exactUsedKey:i,usedLng:o,usedNS:s}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r){let a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,n,r,a):this.resourceStore.getResource(t,n,r,a)}getUsedParamsDetails(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&typeof t.replace!="string";let a=r?t.replace:t;if(r&&typeof t.count<"u"&&(a.count=t.count),this.options.interpolation.defaultVariables&&(a={...this.options.interpolation.defaultVariables,...a}),!r){a={...a};for(const i of n)delete a[i]}return a}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}function bN(e){return e.charAt(0).toUpperCase()+e.slice(1)}class wV{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Ms.create("languageUtils")}getScriptPartFromCode(t){if(t=TS(t),!t||t.indexOf("-")<0)return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=TS(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(typeof t=="string"&&t.indexOf("-")>-1){const n=["hans","hant","latn","cyrl","cans","mong","arab"];let r=t.split("-");return this.options.lowerCaseLng?r=r.map(a=>a.toLowerCase()):r.length===2?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=bN(r[1].toLowerCase()))):r.length===3&&(r[0]=r[0].toLowerCase(),r[1].length===2&&(r[1]=r[1].toUpperCase()),r[0]!=="sgn"&&r[2].length===2&&(r[2]=r[2].toUpperCase()),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=bN(r[1].toLowerCase())),n.indexOf(r[2].toLowerCase())>-1&&(r[2]=bN(r[2].toLowerCase()))),r.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const a=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(a))&&(n=a)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const a=this.getLanguagePartFromCode(r);if(this.isSupportedCode(a))return n=a;n=this.options.supportedLngs.find(i=>{if(i===a)return i;if(!(i.indexOf("-")<0&&a.indexOf("-")<0)&&i.indexOf(a)===0)return i})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),typeof t=="string"&&(t=[t]),Object.prototype.toString.apply(t)==="[object Array]")return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes(n||this.options.fallbackLng||[],t),a=[],i=o=>{o&&(this.isSupportedCode(o)?a.push(o):this.logger.warn(`rejecting language code not found in supportedLngs: ${o}`))};return typeof t=="string"&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&i(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&i(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&i(this.getLanguagePartFromCode(t))):typeof t=="string"&&i(this.formatLanguageCode(t)),r.forEach(o=>{a.indexOf(o)<0&&i(this.formatLanguageCode(o))}),a}}let Cvt=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],Rvt={1:function(e){return+(e>1)},2:function(e){return+(e!=1)},3:function(e){return 0},4:function(e){return e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2},5:function(e){return e==0?0:e==1?1:e==2?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},6:function(e){return e==1?0:e>=2&&e<=4?1:2},7:function(e){return e==1?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2},8:function(e){return e==1?0:e==2?1:e!=8&&e!=11?2:3},9:function(e){return+(e>=2)},10:function(e){return e==1?0:e==2?1:e<7?2:e<11?3:4},11:function(e){return e==1||e==11?0:e==2||e==12?1:e>2&&e<20?2:3},12:function(e){return+(e%10!=1||e%100==11)},13:function(e){return+(e!==0)},14:function(e){return e==1?0:e==2?1:e==3?2:3},15:function(e){return e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2},16:function(e){return e%10==1&&e%100!=11?0:e!==0?1:2},17:function(e){return e==1||e%10==1&&e%100!=11?0:1},18:function(e){return e==0?0:e==1?1:2},19:function(e){return e==1?0:e==0||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3},20:function(e){return e==1?0:e==0||e%100>0&&e%100<20?1:2},21:function(e){return e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0},22:function(e){return e==1?0:e==2?1:(e<0||e>10)&&e%10==0?2:3}};const xvt=["v1","v2","v3"],Avt=["v4"],DV={zero:0,one:1,two:2,few:3,many:4,other:5};function Ovt(){const e={};return Cvt.forEach(t=>{t.lngs.forEach(n=>{e[n]={numbers:t.nr,plurals:Rvt[t.fc]}})}),e}class Nvt{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=n,this.logger=Ms.create("pluralResolver"),(!this.options.compatibilityJSON||Avt.includes(this.options.compatibilityJSON))&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=Ovt()}addRule(t,n){this.rules[t]=n}getRule(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(TS(t),{type:n.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}needsPlural(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(t,n);return this.shouldUseIntlApi()?r&&r.resolvedOptions().pluralCategories.length>1:r&&r.numbers.length>1}getPluralFormsOfKey(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,r).map(a=>`${n}${a}`)}getSuffixes(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(t,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((a,i)=>DV[a]-DV[i]).map(a=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${a}`):r.numbers.map(a=>this.getSuffix(t,a,n)):[]}getSuffix(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const a=this.getRule(t,r);return a?this.shouldUseIntlApi()?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${a.select(n)}`:this.getSuffixRetroCompatible(a,n):(this.logger.warn(`no plural rule found for: ${t}`),"")}getSuffixRetroCompatible(t,n){const r=t.noAbs?t.plurals(n):t.plurals(Math.abs(n));let a=t.numbers[r];this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1&&(a===2?a="plural":a===1&&(a=""));const i=()=>this.options.prepend&&a.toString()?this.options.prepend+a.toString():a.toString();return this.options.compatibilityJSON==="v1"?a===1?"":typeof a=="number"?`_plural_${a.toString()}`:i():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1?i():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}shouldUseIntlApi(){return!xvt.includes(this.options.compatibilityJSON)}}function LV(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=bvt(e,t,n);return!i&&a&&typeof n=="string"&&(i=yS(e,n,r),i===void 0&&(i=yS(t,n,r))),i}class Ivt{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Ms.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||(n=>n),this.init(t)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const n=t.interpolation;this.escape=n.escape!==void 0?n.escape:vvt,this.escapeValue=n.escapeValue!==void 0?n.escapeValue:!0,this.useRawValueToEscape=n.useRawValueToEscape!==void 0?n.useRawValueToEscape:!1,this.prefix=n.prefix?dp(n.prefix):n.prefixEscaped||"{{",this.suffix=n.suffix?dp(n.suffix):n.suffixEscaped||"}}",this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||",",this.unescapePrefix=n.unescapeSuffix?"":n.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":n.unescapeSuffix||"",this.nestingPrefix=n.nestingPrefix?dp(n.nestingPrefix):n.nestingPrefixEscaped||dp("$t("),this.nestingSuffix=n.nestingSuffix?dp(n.nestingSuffix):n.nestingSuffixEscaped||dp(")"),this.nestingOptionsSeparator=n.nestingOptionsSeparator?n.nestingOptionsSeparator:n.nestingOptionsSeparator||",",this.maxReplaces=n.maxReplaces?n.maxReplaces:1e3,this.alwaysFormat=n.alwaysFormat!==void 0?n.alwaysFormat:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=`${this.prefix}(.+?)${this.suffix}`;this.regexp=new RegExp(t,"g");const n=`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`;this.regexpUnescape=new RegExp(n,"g");const r=`${this.nestingPrefix}(.+?)${this.nestingSuffix}`;this.nestingRegexp=new RegExp(r,"g")}interpolate(t,n,r,a){let i,o,s;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function c(g){return g.replace(/\$/g,"$$$$")}const u=g=>{if(g.indexOf(this.formatSeparator)<0){const v=LV(n,l,g,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(v,void 0,r,{...a,...n,interpolationkey:g}):v}const E=g.split(this.formatSeparator),y=E.shift().trim(),b=E.join(this.formatSeparator).trim();return this.format(LV(n,l,y,this.options.keySeparator,this.options.ignoreJSONStructure),b,r,{...a,...n,interpolationkey:y})};this.resetRegExp();const p=a&&a.missingInterpolationHandler||this.options.missingInterpolationHandler,f=a&&a.interpolation&&a.interpolation.skipOnVariables!==void 0?a.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:g=>c(g)},{regex:this.regexp,safeValue:g=>this.escapeValue?c(this.escape(g)):c(g)}].forEach(g=>{for(s=0;i=g.regex.exec(t);){const E=i[1].trim();if(o=u(E),o===void 0)if(typeof p=="function"){const b=p(t,i,a);o=typeof b=="string"?b:""}else if(a&&Object.prototype.hasOwnProperty.call(a,E))o="";else if(f){o=i[0];continue}else this.logger.warn(`missed to pass in variable ${E} for interpolating ${t}`),o="";else typeof o!="string"&&!this.useRawValueToEscape&&(o=AV(o));const y=g.safeValue(o);if(t=t.replace(i[0],y),f?(g.regex.lastIndex+=o.length,g.regex.lastIndex-=i[0].length):g.regex.lastIndex=0,s++,s>=this.maxReplaces)break}}),t}nest(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a,i,o;function s(l,c){const u=this.nestingOptionsSeparator;if(l.indexOf(u)<0)return l;const p=l.split(new RegExp(`${u}[ ]*{`));let f=`{${p[1]}`;l=p[0],f=this.interpolate(f,o);const h=f.match(/'/g),g=f.match(/"/g);(h&&h.length%2===0&&!g||g.length%2!==0)&&(f=f.replace(/'/g,'"'));try{o=JSON.parse(f),c&&(o={...c,...o})}catch(E){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,E),`${l}${u}${f}`}return delete o.defaultValue,l}for(;a=this.nestingRegexp.exec(t);){let l=[];o={...r},o=o.replace&&typeof o.replace!="string"?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;let c=!1;if(a[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(a[1])){const u=a[1].split(this.formatSeparator).map(p=>p.trim());a[1]=u.shift(),l=u,c=!0}if(i=n(s.call(this,a[1].trim(),o),o),i&&a[0]===t&&typeof i!="string")return i;typeof i!="string"&&(i=AV(i)),i||(this.logger.warn(`missed to resolve ${a[1]} for nesting ${t}`),i=""),c&&(i=l.reduce((u,p)=>this.format(u,p,r.lng,{...r,interpolationkey:a[1].trim()}),i.trim())),t=t.replace(a[0],i),this.regexp.lastIndex=0}return t}}function wvt(e){let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const a=r[1].substring(0,r[1].length-1);t==="currency"&&a.indexOf(":")<0?n.currency||(n.currency=a.trim()):t==="relativetime"&&a.indexOf(":")<0?n.range||(n.range=a.trim()):a.split(";").forEach(o=>{if(!o)return;const[s,...l]=o.split(":"),c=l.join(":").trim().replace(/^'+|'+$/g,"");n[s.trim()]||(n[s.trim()]=c),c==="false"&&(n[s.trim()]=!1),c==="true"&&(n[s.trim()]=!0),isNaN(c)||(n[s.trim()]=parseInt(c,10))})}return{formatName:t,formatOptions:n}}function pp(e){const t={};return function(r,a,i){const o=a+JSON.stringify(i);let s=t[o];return s||(s=e(TS(a),i),t[o]=s),s(r)}}class Dvt{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Ms.create("formatter"),this.options=t,this.formats={number:pp((n,r)=>{const a=new Intl.NumberFormat(n,{...r});return i=>a.format(i)}),currency:pp((n,r)=>{const a=new Intl.NumberFormat(n,{...r,style:"currency"});return i=>a.format(i)}),datetime:pp((n,r)=>{const a=new Intl.DateTimeFormat(n,{...r});return i=>a.format(i)}),relativetime:pp((n,r)=>{const a=new Intl.RelativeTimeFormat(n,{...r});return i=>a.format(i,r.range||"day")}),list:pp((n,r)=>{const a=new Intl.ListFormat(n,{...r});return i=>a.format(i)})},this.init(t)}init(t){const r=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||","}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=pp(n)}format(t,n,r){let a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return n.split(this.formatSeparator).reduce((s,l)=>{const{formatName:c,formatOptions:u}=wvt(l);if(this.formats[c]){let p=s;try{const f=a&&a.formatParams&&a.formatParams[a.interpolationkey]||{},h=f.locale||f.lng||a.locale||a.lng||r;p=this.formats[c](s,h,{...u,...a,...f})}catch(f){this.logger.warn(f)}return p}else this.logger.warn(`there was no format function for ${c}`);return s},t)}}function Lvt(e,t){e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)}class Mvt extends dT{constructor(t,n,r){let a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=a,this.logger=Ms.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=a.maxParallelReads||10,this.readingCalls=0,this.maxRetries=a.maxRetries>=0?a.maxRetries:5,this.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(r,a.backend,a)}queueLoad(t,n,r,a){const i={},o={},s={},l={};return t.forEach(c=>{let u=!0;n.forEach(p=>{const f=`${c}|${p}`;!r.reload&&this.store.hasResourceBundle(c,p)?this.state[f]=2:this.state[f]<0||(this.state[f]===1?o[f]===void 0&&(o[f]=!0):(this.state[f]=1,u=!1,o[f]===void 0&&(o[f]=!0),i[f]===void 0&&(i[f]=!0),l[p]===void 0&&(l[p]=!0)))}),u||(s[c]=!0)}),(Object.keys(i).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:a}),{toLoad:Object.keys(i),pending:Object.keys(o),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(l)}}loaded(t,n,r){const a=t.split("|"),i=a[0],o=a[1];n&&this.emit("failedLoading",i,o,n),r&&this.store.addResourceBundle(i,o,r),this.state[t]=n?-1:2;const s={};this.queue.forEach(l=>{Evt(l.loaded,[i],o),Lvt(l,t),n&&l.errors.push(n),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(c=>{s[c]||(s[c]={});const u=l.loaded[c];u.length&&u.forEach(p=>{s[c][p]===void 0&&(s[c][p]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",s),this.queue=this.queue.filter(l=>!l.done)}read(t,n,r){let a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,o=arguments.length>5?arguments[5]:void 0;if(!t.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:a,wait:i,callback:o});return}this.readingCalls++;const s=(c,u)=>{if(this.readingCalls--,this.waitingReads.length>0){const p=this.waitingReads.shift();this.read(p.lng,p.ns,p.fcName,p.tried,p.wait,p.callback)}if(c&&u&&a<this.maxRetries){setTimeout(()=>{this.read.call(this,t,n,r,a+1,i*2,o)},i);return}o(c,u)},l=this.backend[r].bind(this.backend);if(l.length===2){try{const c=l(t,n);c&&typeof c.then=="function"?c.then(u=>s(null,u)).catch(s):s(null,c)}catch(c){s(c)}return}return l(t,n,s)}prepareLoading(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),a&&a();typeof t=="string"&&(t=this.languageUtils.toResolveHierarchy(t)),typeof n=="string"&&(n=[n]);const i=this.queueLoad(t,n,r,a);if(!i.toLoad.length)return i.pending.length||a(),null;i.toLoad.forEach(o=>{this.loadOne(o)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=t.split("|"),a=r[0],i=r[1];this.read(a,i,"read",void 0,void 0,(o,s)=>{o&&this.logger.warn(`${n}loading namespace ${i} for language ${a} failed`,o),!o&&s&&this.logger.log(`${n}loaded namespace ${i} for language ${a}`,s),this.loaded(t,o,s)})}saveMissing(t,n,r,a,i){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},s=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if(this.backend&&this.backend.create){const l={...o,isUpdate:i},c=this.backend.create.bind(this.backend);if(c.length<6)try{let u;c.length===5?u=c(t,n,r,a,l):u=c(t,n,r,a),u&&typeof u.then=="function"?u.then(p=>s(null,p)).catch(s):s(null,u)}catch(u){s(u)}else c(t,n,r,a,s,l)}!t||!t[0]||this.store.addResource(t[0],n,r,a)}}}function MV(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){let n={};if(typeof t[1]=="object"&&(n=t[1]),typeof t[1]=="string"&&(n.defaultValue=t[1]),typeof t[2]=="string"&&(n.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const r=t[3]||t[2];Object.keys(r).forEach(a=>{n[a]=r[a]})}return n},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function kV(e){return typeof e.ns=="string"&&(e.ns=[e.ns]),typeof e.fallbackLng=="string"&&(e.fallbackLng=[e.fallbackLng]),typeof e.fallbackNS=="string"&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function yE(){}function kvt(e){Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})}class sg extends dT{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=kV(t),this.services={},this.logger=Ms,this.modules={external:[]},kvt(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initImmediate)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(){var t=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;typeof n=="function"&&(r=n,n={}),!n.defaultNS&&n.defaultNS!==!1&&n.ns&&(typeof n.ns=="string"?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const a=MV();this.options={...a,...this.options,...kV(n)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...a.interpolation,...this.options.interpolation}),n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);function i(u){return u?typeof u=="function"?new u:u:null}if(!this.options.isClone){this.modules.logger?Ms.init(i(this.modules.logger),this.options):Ms.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:typeof Intl<"u"&&(u=Dvt);const p=new wV(this.options);this.store=new NV(this.options.resources,this.options);const f=this.services;f.logger=Ms,f.resourceStore=this.store,f.languageUtils=p,f.pluralResolver=new Nvt(p,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),u&&(!this.options.interpolation.format||this.options.interpolation.format===a.interpolation.format)&&(f.formatter=i(u),f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new Ivt(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new Mvt(i(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",function(h){for(var g=arguments.length,E=new Array(g>1?g-1:0),y=1;y<g;y++)E[y-1]=arguments[y];t.emit(h,...E)}),this.modules.languageDetector&&(f.languageDetector=i(this.modules.languageDetector),f.languageDetector.init&&f.languageDetector.init(f,this.options.detection,this.options)),this.modules.i18nFormat&&(f.i18nFormat=i(this.modules.i18nFormat),f.i18nFormat.init&&f.i18nFormat.init(this)),this.translator=new CS(this.services,this.options),this.translator.on("*",function(h){for(var g=arguments.length,E=new Array(g>1?g-1:0),y=1;y<g;y++)E[y-1]=arguments[y];t.emit(h,...E)}),this.modules.external.forEach(h=>{h.init&&h.init(this)})}if(this.format=this.options.interpolation.format,r||(r=yE),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.length>0&&u[0]!=="dev"&&(this.options.lng=u[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(u=>{this[u]=function(){return t.store[u](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(u=>{this[u]=function(){return t.store[u](...arguments),t}});const l=xm(),c=()=>{const u=(p,f)=>{this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),l.resolve(f),r(p,f)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return u(null,this.t.bind(this));this.changeLanguage(this.options.lng,u)};return this.options.resources||!this.options.initImmediate?c():setTimeout(c,0),l}loadResources(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:yE;const a=typeof t=="string"?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(a&&a.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const i=[],o=s=>{if(!s||s==="cimode")return;this.services.languageUtils.toResolveHierarchy(s).forEach(c=>{c!=="cimode"&&i.indexOf(c)<0&&i.push(c)})};a?o(a):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(l=>o(l)),this.options.preload&&this.options.preload.forEach(s=>o(s)),this.services.backendConnector.load(i,this.options.ns,s=>{!s&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(s)})}else r(null)}reloadResources(t,n,r){const a=xm();return t||(t=this.languages),n||(n=this.options.ns),r||(r=yE),this.services.backendConnector.reload(t,n,i=>{a.resolve(),r(i)}),a}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&mae.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1))for(let n=0;n<this.languages.length;n++){const r=this.languages[n];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}changeLanguage(t,n){var r=this;this.isLanguageChangingTo=t;const a=xm();this.emit("languageChanging",t);const i=l=>{this.language=l,this.languages=this.services.languageUtils.toResolveHierarchy(l),this.resolvedLanguage=void 0,this.setResolvedLanguage(l)},o=(l,c)=>{c?(i(c),this.translator.changeLanguage(c),this.isLanguageChangingTo=void 0,this.emit("languageChanged",c),this.logger.log("languageChanged",c)):this.isLanguageChangingTo=void 0,a.resolve(function(){return r.t(...arguments)}),n&&n(l,function(){return r.t(...arguments)})},s=l=>{!t&&!l&&this.services.languageDetector&&(l=[]);const c=typeof l=="string"?l:this.services.languageUtils.getBestMatchFromCodes(l);c&&(this.language||i(c),this.translator.language||this.translator.changeLanguage(c),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(c)),this.loadResources(c,u=>{o(u,c)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?s(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(s):this.services.languageDetector.detect(s):s(t),a}getFixedT(t,n,r){var a=this;const i=function(o,s){let l;if(typeof s!="object"){for(var c=arguments.length,u=new Array(c>2?c-2:0),p=2;p<c;p++)u[p-2]=arguments[p];l=a.options.overloadTranslationOptionHandler([o,s].concat(u))}else l={...s};l.lng=l.lng||i.lng,l.lngs=l.lngs||i.lngs,l.ns=l.ns||i.ns,l.keyPrefix=l.keyPrefix||r||i.keyPrefix;const f=a.options.keySeparator||".";let h;return l.keyPrefix&&Array.isArray(o)?h=o.map(g=>`${l.keyPrefix}${f}${g}`):h=l.keyPrefix?`${l.keyPrefix}${f}${o}`:o,a.t(h,l)};return typeof t=="string"?i.lng=t:i.lngs=t,i.ns=n,i.keyPrefix=r,i}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],a=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const o=(s,l)=>{const c=this.services.backendConnector.state[`${s}|${l}`];return c===-1||c===2};if(n.precheck){const s=n.precheck(this,o);if(s!==void 0)return s}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(r,t)&&(!a||o(i,t)))}loadNamespaces(t,n){const r=xm();return this.options.ns?(typeof t=="string"&&(t=[t]),t.forEach(a=>{this.options.ns.indexOf(a)<0&&this.options.ns.push(a)}),this.loadResources(a=>{r.resolve(),n&&n(a)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=xm();typeof t=="string"&&(t=[t]);const a=this.options.preload||[],i=t.filter(o=>a.indexOf(o)<0);return i.length?(this.options.preload=a.concat(i),this.loadResources(o=>{r.resolve(),n&&n(o)}),r):(n&&n(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!t)return"rtl";const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=this.services&&this.services.languageUtils||new wV(MV());return n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new sg(t,n)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:yE;const r=t.forkResourceStore;r&&delete t.forkResourceStore;const a={...this.options,...t,isClone:!0},i=new sg(a);return(t.debug!==void 0||t.prefix!==void 0)&&(i.logger=i.logger.clone(t)),["store","services","language"].forEach(s=>{i[s]=this[s]}),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},r&&(i.store=new NV(this.store.data,a),i.services.resourceStore=i.store),i.translator=new CS(i.services,a),i.translator.on("*",function(s){for(var l=arguments.length,c=new Array(l>1?l-1:0),u=1;u<l;u++)c[u-1]=arguments[u];i.emit(s,...c)}),i.init(a,n),i.translator.options=a,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const za=sg.createInstance();za.createInstance=sg.createInstance;za.createInstance;za.dir;za.init;za.loadResources;za.reloadResources;za.use;za.changeLanguage;za.getFixedT;za.t;za.exists;za.setDefaultNamespace;za.hasLoadedNamespace;za.loadNamespaces;za.loadLanguages;const Pvt={fallbackLng:"en-US",defaultNS:"translation"};function Fvt(){za.use(NXe).init(Pvt).catch(e=>console.error("[i18n] Failed to setup localization.",e))}Fvt();E3.createRoot(document.getElementById("root")).render(_.jsx(Oe.StrictMode,{children:_.jsx(yEe,{children:_.jsx(hvt,{})})}));export{ja as _,bje as a,Aa as g,Wf as p,x as r,Py as u};
727
+ `).length:0}const cSt=x.memo(({fileSpec:e,onFileUpload:t,onFileUploadError:n,onSubmit:r,onReply:a})=>{const[i,o]=xa(cT),s=Tn(Y6),l=Tn(Cee),c=x.useRef(null),{loading:u,askUser:p,chatSettingsInputs:f,disabled:h}=au(),g=h||!!i.find(M=>!M.uploaded),[E,y]=x.useState(""),[b,v]=x.useState(!1),{t:C}=ql();x.useEffect(()=>{const M=D=>{if(D.clipboardData&&D.clipboardData.items){const $=Array.from(D.clipboardData.items);if(D.clipboardData.getData("text/plain"))return;$.forEach(Z=>{if(Z.kind==="file"){const W=Z.getAsFile();W&&t([W])}})}};if(!c.current)return;const P=c.current;return P.addEventListener("paste",M),()=>{P.removeEventListener("paste",M)}},[]),x.useEffect(()=>{c.current&&!u&&!g&&c.current.focus()},[u,g]);const T=x.useCallback(()=>{E===""||g||(p?a(E):r(E,i),o([]),y(""))},[E,g,y,p,i,o,r]),N=x.useCallback(M=>{M.key==="Enter"&&!M.shiftKey?b||(M.preventDefault(),T()):M.key==="ArrowUp"&&lSt(M.currentTarget)<=1&&s(D=>({...D,open:!0}))},[T,s,b]),A=x.useCallback(M=>{c.current&&y(M)},[]),O=_.jsxs(_.Fragment,{children:[_.jsx(Dbt,{disabled:g,onClick:A}),_.jsx(sSt,{disabled:g,fileSpec:e,onFileUploadError:n,onFileUpload:t}),f.length>0&&_.jsx(zn,{id:"chat-settings-open-modal",disabled:g,color:"inherit",onClick:()=>l(!0),children:_.jsx($re,{})}),_.jsx(Kbt,{disabled:g})]});return _.jsxs(kt,{sx:{backgroundColor:"background.paper",borderRadius:"1.5rem",boxShadow:"box-shadow: 0px 2px 4px 0px #0000000D",textarea:{height:"34px",maxHeight:"30vh",overflowY:"auto !important",resize:"none",paddingBottom:"0.7rem",paddingTop:"0.7rem",color:"text.primary",lineHeight:"24px"}},children:[i.length>0?_.jsx(_t,{sx:{mt:2,mx:2,padding:"2px"},children:_.jsx(s_t,{})}):null,_.jsx(Lg,{inputRef:c,id:"chat-input",autoFocus:!0,multiline:!0,variant:"standard",autoComplete:"false",placeholder:C("components.organisms.chat.inputBox.input.placeholder"),disabled:g,onChange:M=>y(M.target.value),onKeyDown:N,onCompositionStart:()=>v(!0),onCompositionEnd:()=>v(!1),value:E,fullWidth:!0,InputProps:{disableUnderline:!0,startAdornment:_.jsx(I5,{sx:{ml:1,color:"text.secondary"},position:"start",children:O}),endAdornment:_.jsx(iSt,{onSubmit:T,disabled:g||!E})}})]})}),uSt=e=>x.createElement("svg",{width:1143,height:266,viewBox:"0 0 1143 266",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},x.createElement("path",{d:"M342.542 133.753C342.542 85.5861 378.512 59.1252 416.55 59.7454C445.698 59.7454 476.707 75.4565 483.322 111.22H453.347C446.938 94.8888 433.915 87.6533 416.55 87.6533C390.916 87.6533 373.757 106.259 373.757 133.753C373.757 158.56 390.502 179.233 416.343 179.233C434.328 179.233 449.006 170.757 453.967 153.185H483.735C477.534 191.43 446.732 207.347 416.55 207.347C378.512 207.347 342.542 181.713 342.542 133.753ZM533.503 148.844V206.107H504.561V54.784H533.503V119.696C541.565 107.499 553.555 103.778 566.166 104.398C588.492 105.432 598.622 117.835 601.722 136.647C602.343 141.402 602.549 145.95 602.549 150.911V177.579C602.549 186.468 603.996 188.535 613.713 187.915V205.28C589.732 210.242 573.608 205.28 573.608 179.026V160.007C573.608 153.392 573.608 147.81 572.988 143.056C571.334 132.513 566.993 126.931 554.796 126.931C543.633 126.931 533.503 134.787 533.503 148.844ZM726.013 113.287V173.858C726.013 182.334 725.6 186.882 735.522 186.261V204.867C722.085 207.761 702.653 208.795 702.653 188.329C697.071 200.732 684.254 207.554 671.024 207.554C640.222 206.934 625.958 183.161 625.958 154.839C626.991 121.143 649.938 103.364 683.634 103.985C698.312 104.191 712.783 107.706 726.013 113.287ZM697.898 155.873V130.032C692.317 127.758 686.322 127.138 681.36 127.138C665.649 127.138 655.52 135.82 654.899 154.839C654.899 170.55 662.341 182.127 677.226 181.92C691.076 181.92 697.278 170.964 697.898 155.873ZM753.629 77.5238C753.629 55.4042 787.532 55.4042 787.532 77.5238C787.532 99.8502 753.629 99.8502 753.629 77.5238ZM785.051 107.499V205.9H756.109V107.499H785.051ZM804.992 122.797V105.845C819.669 103.158 843.029 101.711 843.029 120.936C849.438 109.153 861.221 103.985 874.452 103.985C902.566 103.985 914.35 123.21 913.73 148.017V175.098C913.73 184.401 914.143 188.949 924.273 188.329V205.28C904.634 210.242 884.995 207.761 884.995 182.954V148.017C885.201 134.167 876.312 126.931 865.769 126.931C855.019 126.311 844.89 134.787 844.89 148.637V205.9H815.948V137.061C815.948 126.104 816.155 122.177 804.992 122.797ZM942.017 54.5773H970.545V168.07C970.545 183.367 976.54 186.468 990.391 184.194L991.424 205.9C960.622 211.482 942.017 203.833 942.017 168.07V54.5773ZM1004.36 77.5238C1004.36 55.4042 1038.27 55.4042 1038.27 77.5238C1038.27 99.8502 1004.36 99.8502 1004.36 77.5238ZM1035.79 107.499V205.9H1006.84V107.499H1035.79ZM1101 75.4565V106.465H1133.46V128.172H1101V166.829C1101 187.502 1118.16 188.535 1134.7 182.54L1137.38 204.453C1103.07 213.963 1072.68 208.381 1072.68 167.449V128.172L1053.87 126.311V106.465H1074.75L1077.85 75.4565H1101Z",fill:"white"}),x.createElement("path",{d:"M80.0961 121.626C78.244 115.214 74.7914 109.167 69.7384 104.114C53.7848 88.16 27.9188 88.16 11.9652 104.114C-3.98841 120.067 -3.98841 145.933 11.9652 161.887C17.0183 166.94 23.0657 170.392 29.4777 172.245C32.8124 173.307 36.6495 174.133 40.8349 175.034C54.6805 178.016 72.3375 181.818 88.2258 197.706C88.2258 197.706 90.5368 192.507 95.4475 187.596C100.358 182.685 105.558 180.374 105.558 180.374C89.6695 164.486 85.8674 146.829 82.8861 132.983C81.9848 128.798 81.1586 124.961 80.0961 121.626Z",fill:"url(#paint0_linear_361_1664)"}),x.createElement("path",{d:"M185.904 144.375C187.756 150.786 191.209 156.834 196.262 161.887C212.215 177.84 238.081 177.84 254.035 161.887C269.988 145.933 269.988 120.067 254.035 104.114C248.982 99.0605 242.934 95.608 236.522 93.7559C233.188 92.6934 229.351 91.8672 225.165 90.966C211.32 87.9846 193.662 84.1825 177.774 68.2942C177.774 68.2942 175.463 73.4938 170.553 78.4045C165.642 83.3153 160.442 85.6262 160.442 85.6262C176.331 101.514 180.133 119.172 183.114 133.017C184.015 137.203 184.841 141.04 185.904 144.375Z",fill:"url(#paint1_linear_361_1664)"}),x.createElement("path",{d:"M93.7559 29.4775C95.608 23.0656 99.0606 17.0182 104.114 11.9652C120.067 -3.98841 145.933 -3.98841 161.887 11.9652C177.84 27.9188 177.84 53.7848 161.887 69.7384C156.834 74.7915 150.786 78.244 144.374 80.0962C141.04 81.1586 137.203 81.9848 133.017 82.8861C119.172 85.8674 101.514 89.6695 85.6262 105.558C85.6262 105.558 83.3153 100.358 78.4045 95.4475C73.4938 90.5368 68.2942 88.2258 68.2942 88.2258C84.1825 72.3375 87.9846 54.6805 90.966 40.8349C91.8672 36.6494 92.6935 32.8122 93.7559 29.4775Z",fill:"url(#paint2_linear_361_1664)"}),x.createElement("path",{d:"M172.244 236.523C170.392 242.935 166.939 248.982 161.886 254.035C145.933 269.989 120.067 269.989 104.113 254.035C88.1596 238.082 88.1596 212.216 104.113 196.262C109.166 191.209 115.214 187.756 121.626 185.904C124.96 184.842 128.797 184.016 132.983 183.114C146.828 180.133 164.486 176.331 180.374 160.443C180.374 160.443 182.685 165.642 187.595 170.553C192.506 175.464 197.706 177.775 197.706 177.775C181.817 193.663 178.015 211.32 175.034 225.165C174.133 229.351 173.307 233.188 172.244 236.523Z",fill:"url(#paint3_linear_361_1664)"}),x.createElement("path",{d:"M79.6157 121.765L79.6156 121.765L79.6197 121.778C80.6734 125.085 81.4946 128.897 82.3973 133.089L82.4019 133.11C85.3524 146.812 89.1323 164.366 104.71 180.229C104.626 180.271 104.536 180.318 104.438 180.368C103.864 180.667 103.049 181.116 102.08 181.719C100.143 182.925 97.5829 184.753 95.0939 187.242C92.605 189.731 90.7768 192.291 89.5707 194.228C88.9673 195.197 88.5186 196.012 88.22 196.586C88.1692 196.684 88.1227 196.775 88.0806 196.858C72.218 181.281 54.664 177.501 40.9618 174.55L40.9401 174.546C36.7483 173.643 32.9366 172.822 29.6295 171.768L29.6295 171.768L29.6164 171.764C23.2836 169.935 17.3106 166.525 12.3188 161.533C-3.43959 145.775 -3.43959 120.226 12.3188 104.467C28.0771 88.7088 53.6265 88.7088 69.3849 104.467C74.3766 109.459 77.7865 115.432 79.6157 121.765ZM186.384 144.236L186.384 144.236L186.38 144.223C185.327 140.916 184.505 137.104 183.603 132.912L183.598 132.89C180.648 119.188 176.868 101.634 161.29 85.7715C161.374 85.7293 161.464 85.6828 161.562 85.632C162.136 85.3334 162.951 84.8847 163.92 84.2813C165.857 83.0752 168.417 81.247 170.906 78.7581C173.395 76.2692 175.223 73.7092 176.429 71.7721C177.033 70.803 177.481 69.9883 177.78 69.4141C177.831 69.3163 177.877 69.2255 177.919 69.1421C193.782 84.7197 211.336 88.4996 225.038 91.4501L225.06 91.4548C229.252 92.3574 233.063 93.1786 236.371 94.2323L236.37 94.2324L236.384 94.2362C242.716 96.0655 248.689 99.4753 253.681 104.467C269.44 120.226 269.44 145.775 253.681 161.533C237.923 177.292 212.374 177.292 196.615 161.533C191.623 156.541 188.214 150.569 186.384 144.236ZM94.2323 29.6293L94.2325 29.6293L94.2363 29.6162C96.0655 23.2835 99.4754 17.3105 104.467 12.3188C120.226 -3.43959 145.775 -3.43959 161.533 12.3188C177.292 28.0771 177.292 53.6265 161.533 69.3849C156.541 74.3767 150.568 77.7865 144.236 79.6158L144.236 79.6156L144.223 79.6198C140.915 80.6734 137.104 81.4946 132.912 82.3973L132.89 82.4019C119.188 85.3524 101.634 89.1323 85.7715 104.71C85.7293 104.626 85.6828 104.536 85.632 104.438C85.3334 103.864 84.8847 103.049 84.2813 102.08C83.0752 100.143 81.247 97.5829 78.7581 95.0939C76.2692 92.605 73.7092 90.7768 71.7721 89.5707C70.803 88.9673 69.9883 88.5186 69.4141 88.22C69.3163 88.1692 69.2255 88.1227 69.1421 88.0806C84.7197 72.218 88.4996 54.664 91.4501 40.9618L91.4548 40.9401C92.3574 36.7482 93.1786 32.9364 94.2323 29.6293ZM171.768 236.371L171.768 236.371L171.764 236.384C169.934 242.717 166.525 248.69 161.533 253.682C145.774 269.44 120.225 269.44 104.467 253.682C88.7084 237.923 88.7084 212.374 104.467 196.616C109.459 191.624 115.432 188.214 121.764 186.385L121.764 186.385L121.777 186.381C125.085 185.327 128.896 184.506 133.088 183.603L133.11 183.598C146.812 180.648 164.366 176.868 180.229 161.29C180.271 161.374 180.317 161.465 180.368 161.562C180.667 162.137 181.115 162.951 181.719 163.92C182.925 165.858 184.753 168.418 187.242 170.906C189.731 173.395 192.291 175.224 194.228 176.43C195.197 177.033 196.012 177.482 196.586 177.78C196.684 177.831 196.774 177.878 196.858 177.92C181.28 193.782 177.5 211.336 174.55 225.039L174.545 225.06C173.643 229.252 172.821 233.064 171.768 236.371Z",stroke:"black",strokeOpacity:.1,strokeLinejoin:"round"}),x.createElement("defs",null,x.createElement("linearGradient",{id:"paint0_linear_361_1664",x1:119.251,y1:276.386,x2:112.859,y2:-28.0325,gradientUnits:"userSpaceOnUse"},x.createElement("stop",{stopColor:"#FF004F"}),x.createElement("stop",{offset:1,stopColor:"#FF0581"})),x.createElement("linearGradient",{id:"paint1_linear_361_1664",x1:119.251,y1:276.386,x2:112.859,y2:-28.0325,gradientUnits:"userSpaceOnUse"},x.createElement("stop",{stopColor:"#FF004F"}),x.createElement("stop",{offset:1,stopColor:"#FF0581"})),x.createElement("linearGradient",{id:"paint2_linear_361_1664",x1:119.251,y1:276.386,x2:112.859,y2:-28.0325,gradientUnits:"userSpaceOnUse"},x.createElement("stop",{stopColor:"#FF004F"}),x.createElement("stop",{offset:1,stopColor:"#FF0581"})),x.createElement("linearGradient",{id:"paint3_linear_361_1664",x1:119.251,y1:276.386,x2:112.859,y2:-28.0325,gradientUnits:"userSpaceOnUse"},x.createElement("stop",{stopColor:"#FF004F"}),x.createElement("stop",{offset:1,stopColor:"#FF0581"})))),dSt=e=>x.createElement("svg",{width:1143,height:266,viewBox:"0 0 1143 266",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},x.createElement("path",{d:"M342.542 133.753C342.542 181.713 378.512 207.347 416.55 207.347C446.732 207.347 477.534 191.43 483.735 153.185H453.967C449.006 170.757 434.328 179.233 416.343 179.233C390.502 179.233 373.757 158.56 373.757 133.753C373.757 106.259 390.916 87.6533 416.55 87.6533C433.915 87.6533 446.938 94.8888 453.347 111.22H483.322C476.707 75.4565 445.698 59.7454 416.55 59.7454C378.512 59.1252 342.542 85.5861 342.542 133.753ZM533.503 148.844C533.503 134.787 543.633 126.931 554.796 126.931C566.993 126.931 571.334 132.513 572.988 143.056C573.608 147.81 573.608 153.392 573.608 160.007V179.026C573.608 205.28 589.732 210.242 613.713 205.28V187.915C603.996 188.535 602.549 186.468 602.549 177.579V150.911C602.549 145.95 602.343 141.402 601.722 136.647C598.622 117.835 588.492 105.432 566.166 104.398C553.555 103.778 541.565 107.499 533.503 119.696V54.784H504.561V206.107H533.503V148.844ZM726.013 113.287C712.783 107.706 698.312 104.191 683.634 103.985C649.938 103.364 626.991 121.143 625.958 154.839C625.958 183.161 640.222 206.934 671.024 207.554C684.254 207.554 697.071 200.732 702.653 188.329C702.653 208.795 722.085 207.761 735.522 204.867V186.261C725.6 186.882 726.013 182.334 726.013 173.858V113.287ZM697.898 155.873C697.278 170.964 691.076 181.92 677.226 181.92C662.341 182.127 654.899 170.55 654.899 154.839C655.52 135.82 665.649 127.138 681.36 127.138C686.322 127.138 692.317 127.758 697.898 130.032V155.873ZM753.629 77.5238C753.629 99.8502 787.532 99.8502 787.532 77.5238C787.532 55.4042 753.629 55.4042 753.629 77.5238ZM785.051 107.499H756.109V205.9H785.051V107.499ZM804.992 122.797C816.155 122.177 815.948 126.104 815.948 137.061V205.9H844.89V148.637C844.89 134.787 855.019 126.311 865.769 126.931C876.312 126.931 885.201 134.167 884.995 148.017V182.954C884.995 207.761 904.634 210.242 924.273 205.28V188.329C914.143 188.949 913.73 184.401 913.73 175.098V148.017C914.35 123.21 902.566 103.985 874.452 103.985C861.221 103.985 849.438 109.153 843.029 120.936C843.029 101.711 819.669 103.158 804.992 105.845V122.797ZM942.017 54.5773V168.07C942.017 203.833 960.622 211.482 991.424 205.9L990.391 184.194C976.54 186.468 970.545 183.367 970.545 168.07V54.5773H942.017ZM1004.36 77.5238C1004.36 99.8502 1038.27 99.8502 1038.27 77.5238C1038.27 55.4042 1004.36 55.4042 1004.36 77.5238ZM1035.79 107.499H1006.84V205.9H1035.79V107.499ZM1101 75.4565H1077.85L1074.75 106.465H1053.87V126.311L1072.68 128.172V167.449C1072.68 208.381 1103.07 213.963 1137.38 204.453L1134.7 182.54C1118.16 188.535 1101 187.502 1101 166.829V128.172H1133.46V106.465H1101V75.4565Z",fill:"#2A1351"}),x.createElement("path",{d:"M80.0961 121.626C78.244 115.214 74.7914 109.167 69.7384 104.114C53.7848 88.16 27.9188 88.16 11.9652 104.114C-3.98841 120.067 -3.98841 145.933 11.9652 161.887C17.0183 166.94 23.0657 170.392 29.4777 172.245C32.8124 173.307 36.6495 174.133 40.8349 175.034C54.6805 178.016 72.3375 181.818 88.2258 197.706C88.2258 197.706 90.5368 192.507 95.4475 187.596C100.358 182.685 105.558 180.374 105.558 180.374C89.6695 164.486 85.8674 146.829 82.8861 132.983C81.9848 128.798 81.1586 124.961 80.0961 121.626Z",fill:"url(#paint0_linear_361_1534)"}),x.createElement("path",{d:"M185.904 144.375C187.756 150.786 191.209 156.834 196.262 161.887C212.215 177.84 238.081 177.84 254.035 161.887C269.988 145.933 269.988 120.067 254.035 104.114C248.982 99.0605 242.934 95.608 236.522 93.7559C233.188 92.6934 229.351 91.8672 225.165 90.966C211.32 87.9846 193.662 84.1825 177.774 68.2942C177.774 68.2942 175.463 73.4938 170.553 78.4045C165.642 83.3153 160.442 85.6262 160.442 85.6262C176.331 101.514 180.133 119.172 183.114 133.017C184.015 137.203 184.841 141.04 185.904 144.375Z",fill:"url(#paint1_linear_361_1534)"}),x.createElement("path",{d:"M93.7559 29.4775C95.608 23.0656 99.0606 17.0182 104.114 11.9652C120.067 -3.98841 145.933 -3.98841 161.887 11.9652C177.84 27.9188 177.84 53.7848 161.887 69.7384C156.834 74.7915 150.786 78.244 144.374 80.0962C141.04 81.1586 137.203 81.9848 133.017 82.8861C119.172 85.8674 101.514 89.6695 85.6262 105.558C85.6262 105.558 83.3153 100.358 78.4045 95.4475C73.4938 90.5368 68.2942 88.2258 68.2942 88.2258C84.1825 72.3375 87.9846 54.6805 90.966 40.8349C91.8672 36.6494 92.6935 32.8122 93.7559 29.4775Z",fill:"url(#paint2_linear_361_1534)"}),x.createElement("path",{d:"M172.244 236.523C170.392 242.935 166.939 248.982 161.886 254.035C145.933 269.989 120.067 269.989 104.113 254.035C88.1596 238.082 88.1596 212.216 104.113 196.262C109.166 191.209 115.214 187.756 121.626 185.904C124.96 184.842 128.797 184.016 132.983 183.114C146.828 180.133 164.486 176.331 180.374 160.443C180.374 160.443 182.685 165.642 187.595 170.553C192.506 175.464 197.706 177.775 197.706 177.775C181.817 193.663 178.015 211.32 175.034 225.165C174.133 229.351 173.307 233.188 172.244 236.523Z",fill:"url(#paint3_linear_361_1534)"}),x.createElement("path",{d:"M79.6157 121.765L79.6156 121.765L79.6197 121.778C80.6734 125.085 81.4946 128.897 82.3973 133.089L82.4019 133.11C85.3524 146.812 89.1323 164.366 104.71 180.229C104.626 180.271 104.536 180.318 104.438 180.368C103.864 180.667 103.049 181.116 102.08 181.719C100.143 182.925 97.5829 184.753 95.0939 187.242C92.605 189.731 90.7768 192.291 89.5707 194.228C88.9673 195.197 88.5186 196.012 88.22 196.586C88.1692 196.684 88.1227 196.775 88.0806 196.858C72.218 181.281 54.664 177.501 40.9618 174.55L40.9401 174.546C36.7483 173.643 32.9366 172.822 29.6295 171.768L29.6295 171.768L29.6164 171.764C23.2836 169.935 17.3106 166.525 12.3188 161.533C-3.43959 145.775 -3.43959 120.226 12.3188 104.467C28.0771 88.7088 53.6265 88.7088 69.3849 104.467C74.3766 109.459 77.7865 115.432 79.6157 121.765ZM186.384 144.236L186.384 144.236L186.38 144.223C185.327 140.916 184.505 137.104 183.603 132.912L183.598 132.89C180.648 119.188 176.868 101.634 161.29 85.7715C161.374 85.7293 161.464 85.6828 161.562 85.632C162.136 85.3334 162.951 84.8847 163.92 84.2813C165.857 83.0752 168.417 81.247 170.906 78.7581C173.395 76.2692 175.223 73.7092 176.429 71.7721C177.033 70.803 177.481 69.9883 177.78 69.4141C177.831 69.3163 177.877 69.2255 177.919 69.1421C193.782 84.7197 211.336 88.4996 225.038 91.4501L225.06 91.4548C229.252 92.3574 233.063 93.1786 236.371 94.2323L236.37 94.2324L236.384 94.2362C242.716 96.0655 248.689 99.4753 253.681 104.467C269.44 120.226 269.44 145.775 253.681 161.533C237.923 177.292 212.374 177.292 196.615 161.533C191.623 156.541 188.214 150.569 186.384 144.236ZM94.2323 29.6293L94.2325 29.6293L94.2363 29.6162C96.0655 23.2835 99.4754 17.3105 104.467 12.3188C120.226 -3.43959 145.775 -3.43959 161.533 12.3188C177.292 28.0771 177.292 53.6265 161.533 69.3849C156.541 74.3767 150.568 77.7865 144.236 79.6158L144.236 79.6156L144.223 79.6198C140.915 80.6734 137.104 81.4946 132.912 82.3973L132.89 82.4019C119.188 85.3524 101.634 89.1323 85.7715 104.71C85.7293 104.626 85.6828 104.536 85.632 104.438C85.3334 103.864 84.8847 103.049 84.2813 102.08C83.0752 100.143 81.247 97.5829 78.7581 95.0939C76.2692 92.605 73.7092 90.7768 71.7721 89.5707C70.803 88.9673 69.9883 88.5186 69.4141 88.22C69.3163 88.1692 69.2255 88.1227 69.1421 88.0806C84.7197 72.218 88.4996 54.664 91.4501 40.9618L91.4548 40.9401C92.3574 36.7482 93.1786 32.9364 94.2323 29.6293ZM171.768 236.371L171.768 236.371L171.764 236.384C169.934 242.717 166.525 248.69 161.533 253.682C145.774 269.44 120.225 269.44 104.467 253.682C88.7084 237.923 88.7084 212.374 104.467 196.616C109.459 191.624 115.432 188.214 121.764 186.385L121.764 186.385L121.777 186.381C125.085 185.327 128.896 184.506 133.088 183.603L133.11 183.598C146.812 180.648 164.366 176.868 180.229 161.29C180.271 161.374 180.317 161.465 180.368 161.562C180.667 162.137 181.115 162.951 181.719 163.92C182.925 165.858 184.753 168.418 187.242 170.906C189.731 173.395 192.291 175.224 194.228 176.43C195.197 177.033 196.012 177.482 196.586 177.78C196.684 177.831 196.774 177.878 196.858 177.92C181.28 193.782 177.5 211.336 174.55 225.039L174.545 225.06C173.643 229.252 172.821 233.064 171.768 236.371Z",stroke:"black",strokeOpacity:.1,strokeLinejoin:"round"}),x.createElement("defs",null,x.createElement("linearGradient",{id:"paint0_linear_361_1534",x1:119.251,y1:276.386,x2:112.859,y2:-28.0325,gradientUnits:"userSpaceOnUse"},x.createElement("stop",{stopColor:"#FF004F"}),x.createElement("stop",{offset:1,stopColor:"#FF0581"})),x.createElement("linearGradient",{id:"paint1_linear_361_1534",x1:119.251,y1:276.386,x2:112.859,y2:-28.0325,gradientUnits:"userSpaceOnUse"},x.createElement("stop",{stopColor:"#FF004F"}),x.createElement("stop",{offset:1,stopColor:"#FF0581"})),x.createElement("linearGradient",{id:"paint2_linear_361_1534",x1:119.251,y1:276.386,x2:112.859,y2:-28.0325,gradientUnits:"userSpaceOnUse"},x.createElement("stop",{stopColor:"#FF004F"}),x.createElement("stop",{offset:1,stopColor:"#FF0581"})),x.createElement("linearGradient",{id:"paint3_linear_361_1534",x1:119.251,y1:276.386,x2:112.859,y2:-28.0325,gradientUnits:"userSpaceOnUse"},x.createElement("stop",{stopColor:"#FF004F"}),x.createElement("stop",{offset:1,stopColor:"#FF0581"}))));function rae(){const{theme:e}=yt(Wl),t=e==="light"?dSt:uSt;return _.jsx(kt,{mx:"auto",className:"watermark",children:_.jsxs("a",{href:"https://github.com/Chainlit/chainlit",target:"_blank",style:{display:"flex",alignItems:"center",textDecoration:"none"},children:[_.jsx(fn,{fontSize:"12px",color:"text.secondary",children:_.jsx(Pt,{path:"components.organisms.chat.inputBox.waterMark.text"})}),_.jsx(t,{style:{width:65,height:"auto",filter:"grayscale(1)",marginLeft:"4px"}})]})})}const pSt=x.memo(({fileSpec:e,onFileUpload:t,onFileUploadError:n,setAutoScroll:r,autoScroll:a,projectSettings:i})=>{const o=du(),s=Tn(Y6),{user:l}=gs(),{sendMessage:c,replyMessage:u}=Uo(),p=x.useCallback(async(h,g)=>{const E={threadId:"",id:_S(),name:(l==null?void 0:l.identifier)||"User",type:"user_message",output:h,createdAt:new Date().toISOString()};s(b=>{const C=[...b.inputs||[]];return C.push({content:h,createdAt:new Date().getTime()}),{...b,inputs:C.length>50?C.slice(C.length-50):C}});const y=g==null?void 0:g.filter(b=>!!b.serverId).map(b=>({id:b.serverId}));r(!0),c(E,y)},[l,i,c]),f=x.useCallback(async h=>{const g={threadId:"",id:_S(),name:(l==null?void 0:l.identifier)||"User",type:"user_message",output:h,createdAt:new Date().toISOString()};u(g),r(!0)},[l,u]);return _.jsxs(_t,{display:"flex",position:"relative",flexDirection:"column",gap:1,pb:2,px:2,sx:{boxSizing:"border-box",width:"100%",maxWidth:o,m:"auto",justifyContent:"center"},children:[a?null:_.jsx(Zgt,{onClick:()=>r(!0)}),_.jsx(_t,{children:_.jsx(cSt,{fileSpec:e,onFileUpload:t,onFileUploadError:n,onSubmit:p,onReply:f})}),_.jsx(rae,{})]})});function fSt({starter:e}){var o;const t=yt(ca),{sendMessage:n}=Uo(),{loading:r}=au(),{user:a}=gs(),i=x.useCallback(async()=>{const s={threadId:"",id:_S(),name:(a==null?void 0:a.identifier)||"User",type:"user_message",output:e.message,createdAt:new Date().toISOString()};n(s,[])},[a,n,e]);return _.jsx(Ii,{id:`starter-${e.label.trim().toLowerCase().replaceAll(" ","-")}`,fullWidth:!0,disabled:r,color:"inherit",sx:{border:s=>`1px solid ${s.palette.divider}`,borderRadius:"1rem",height:100,p:2,textTransform:"none",justifyContent:"flex-start"},onClick:i,children:_.jsxs(kt,{gap:.5,flexGrow:1,height:"100%",children:[e.icon?_.jsx("img",{style:{borderRadius:"50%"},src:(o=e.icon)!=null&&o.startsWith("/public")?t.buildEndpoint(e.icon):e.icon,alt:e.label,height:20,width:20}):_.jsx(_t,{sx:{height:20,width:20}}),_.jsx(fn,{sx:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:"2",WebkitBoxOrient:"vertical",fontSize:"14px"},color:"text.secondary",align:"left",children:e.label})]})})}function mSt({hideLogo:e}){const{messages:t}=hs(),[n,r]=x.useState(!0),{chatProfile:a}=Ul(),i=yt(Zr),o=yt(ca),s=o==null?void 0:o.buildEndpoint("/avatars/default");x.useEffect(()=>{t.length>0?r(!1):r(!0)},[t]);const l=x.useMemo(()=>i==null?void 0:i.chatProfiles.find(p=>p.name===a),[i,a]),c=x.useMemo(()=>{const p=l==null?void 0:l.name;let f=(l==null?void 0:l.icon)||s;return f!=null&&f.startsWith("/public")&&(f=o.buildEndpoint(f)),_.jsxs(kt,{gap:2,alignItems:"center",children:[_.jsx(O5,{sx:{height:48,width:48},src:f}),p?_.jsx(fn,{color:"text.primary",sx:{fontSize:"1.1rem",fontWeight:600},children:p}):null]})},[i,a,l]),u=x.useMemo(()=>{if(a){const p=i==null?void 0:i.chatProfiles.find(f=>f.name===a);if(p!=null&&p.starters)return p.starters.slice(0,4)}return i==null?void 0:i.starters},[i,a]);return u!=null&&u.length?_.jsx(zb,{in:n,children:_.jsxs(kt,{position:"absolute",zIndex:n?1:-1,width:"100%",height:"100%",mx:"auto",left:0,right:0,sx:{overflowY:"auto"},maxWidth:"min(48rem, 80vw)",justifyContent:e?"end":"center",alignItems:"center",gap:6,px:2,boxSizing:"border-box",children:[e?null:_.jsx(kt,{children:c}),_.jsx(k7,{container:!0,spacing:2,minHeight:100,justifyContent:"center",children:u==null?void 0:u.map((p,f)=>_.jsx(zb,{in:n,timeout:f*300,children:_.jsx(k7,{item:!0,xs:6,sm:3,children:_.jsx(fSt,{starter:p})})},f))})]})}):null}const aae=()=>{var N,A;const{user:e}=gs(),{idToResume:t}=Ul(),n=yt(Zr),r=Tn(cT),a=Tn(fv),i=yt(ca),[o,s]=x.useState(!0),{error:l,disabled:c}=au(),{uploadFile:u}=Uo(),p=x.useRef(u),f=no(),h=x.useMemo(()=>{var O,M,P,D,$,V;return{max_size_mb:((M=(O=n==null?void 0:n.features)==null?void 0:O.spontaneous_file_upload)==null?void 0:M.max_size_mb)||500,max_files:((D=(P=n==null?void 0:n.features)==null?void 0:P.spontaneous_file_upload)==null?void 0:D.max_files)||20,accept:((V=($=n==null?void 0:n.features)==null?void 0:$.spontaneous_file_upload)==null?void 0:V.accept)||["*/*"]}},[n]),{t:g}=ql(),E=du();x.useEffect(()=>{p.current=u},[u]);const y=x.useCallback(O=>{const M=O.map(P=>{const D=_S(),{xhr:$,promise:V}=p.current(i,P,Z=>{r(W=>W.map(ae=>ae.id===D?{...ae,uploadProgress:Z}:ae))});return V.then(Z=>{r(W=>W.map(ae=>ae.id===D?{...ae,serverId:Z.id,uploaded:!0,uploadProgress:100,cancel:void 0}:ae))}).catch(Z=>{oa.error(`${g("components.organisms.chat.index.failedToUpload")} ${P.name}: ${Z.message}`),r(W=>W.filter(ae=>ae.id!==D))}),{id:D,type:P.type,name:P.name,size:P.size,uploadProgress:0,cancel:()=>{oa.info(`${g("components.organisms.chat.index.cancelledUploadOf")} ${P.name}`),$.abort(),r(Z=>Z.filter(W=>W.id!==D))},remove:()=>{r(Z=>Z.filter(W=>W.id!==D))}}});r(P=>P.concat(M))},[u]),b=x.useCallback(O=>oa.error(O),[oa]),v=t6({spec:h,onResolved:y,onError:b,options:{noClick:!0}}),{threadId:C}=hs();x.useEffect(()=>{const O=new URL(window.location.href);e&&(n!=null&&n.dataPersistence)&&C&&O.pathname==="/"?f(`/thread/${C}`):a(M=>({...M,currentThreadId:C}))},[]);const T=!c&&((A=(N=n==null?void 0:n.features)==null?void 0:N.spontaneous_file_upload)==null?void 0:A.enabled);return _.jsxs(_t,{...T?v==null?void 0:v.getRootProps({className:"dropzone"}):{},onBlur:void 0,onFocus:void 0,display:"flex",width:"100%",flexGrow:1,position:"relative",children:[v?_.jsxs(_.Fragment,{children:[_.jsx("input",{id:"#upload-drop-input",...v.getInputProps()}),v!=null&&v.isDragActive?_.jsx(Xgt,{}):null]}):null,_.jsxs(kt,{width:"100%",children:[l?_.jsx(_t,{sx:{width:"100%",maxWidth:E,mx:"auto",my:2},children:_.jsx(ms,{sx:{mx:2},id:"session-error",severity:"error",children:_.jsx(Pt,{path:"components.organisms.chat.index.couldNotReachServer"})})}):null,t?_.jsx(_t,{sx:{width:"100%",maxWidth:E,mx:"auto",my:2},children:_.jsx(ms,{sx:{mx:2},severity:"info",children:_.jsx(Pt,{path:"components.organisms.chat.index.continuingChat"})})}):null,_.jsx(Ite,{isMobile:!0}),_.jsxs(QQ,{children:[_.jsxs(kre,{autoScroll:o,setAutoScroll:s,children:[_.jsx(mSt,{}),_.jsx(_t,{py:2}),_.jsx(Kgt,{})]}),_.jsx(pSt,{fileSpec:h,onFileUpload:y,onFileUploadError:b,autoScroll:o,setAutoScroll:s,projectSettings:n})]})]})]})};function hSt(){return _.jsx(R6,{children:_.jsx(aae,{})})}var bS=globalThis&&globalThis.__assign||function(){return bS=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},bS.apply(this,arguments)},gSt=globalThis&&globalThis.__rest||function(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 a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n},_St=function(e){var t=e.className,n=e.style,r=e.rules,a=e.value,i=e.valueAgain,o=e.minLength,s=e.maxLength,l=e.rtl,c=e.onChange,u=e.specialCharsRegex,p=u===void 0?/[~`¿¡!#$%\^&*€£@+÷=\-\[\]\\';,/{}\(\)|\\":<>\?\.\_]/g:u,f=e.messages,h=f===void 0?{}:f,g=gSt(e,["className","style","rules","value","valueAgain","minLength","maxLength","rtl","onChange","specialCharsRegex","messages"]),E=x.useState(!1),y=E[0],b=E[1],v={minLength:{valid:a.length>=(o||100),message:h.minLength||"Password has at least ".concat(o," characters.")},specialChar:{valid:p.test(a),message:h.specialChar||"Password has special characters."},number:{valid:/\d/g.test(a),message:h.number||"Password has a number."},capital:{valid:function(){var T=0;if(a.length===0)return!1;for(;T<a.length;){var N=a.charAt(T);if(N!=N.toLowerCase()){if(N==N.toUpperCase())return!0}T++}return!1}(),message:h.capital||"Password has a capital letter."},match:{valid:a.length>0&&a===i,message:h.match||"Passwords match."},lowercase:{valid:function(){var T=0;if(a.length===0)return!1;for(;T<a.length;){var N=a.charAt(T);if(N!=N.toUpperCase()){if(N==N.toLowerCase())return!0}T++}return!1}(),message:h.lowercase||"Password has a lowercase letter."},letter:{valid:/[a-zA-Z]/g.test(a),message:h.letter||"Password has a letter."},maxLength:{valid:a.length<=(s||16),message:h.maxLength||"Password has no more than ".concat(s," characters.")},notEmpty:{valid:!!(a.length>0&&i&&i.length>0),message:h.notEmpty||"Password fields are not empty."}},C=r.filter(function(T){return!!v[T]});return x.useEffect(function(){C.every(function(T){return v[T].valid})?b(!0):b(!1)},[a,i]),x.useEffect(function(){typeof c=="function"&&c(y,C.filter(function(T){return!v[T].valid}))},[y]),l&&(t=t?t+" rtl":"rtl"),Oe.createElement("ul",{className:t,style:bS({margin:0,padding:0},n)},C.map(function(T){var N=v[T],A=N.message,O=N.valid;return Oe.createElement(ESt,bS({key:T,valid:O,iconSize:18,validColor:"#4BCA81",invalidColor:"#FF0033",rtl:l},g),A)}))},ESt=function(e){var t=e.valid,n=e.iconSize,r=e.validColor,a=e.invalidColor,i=e.validTextColor,o=e.invalidTextColor,s=e.iconComponents,l=e.hideIcon,c=e.rtl,u=e.children;return Oe.createElement("li",{className:t?"valid":"invalid",style:{listStyleType:"none",display:"flex",alignItems:"flex-start",margin:"2px 0"}},l?null:s?t?s.ValidIcon:s.InvalidIcon:Oe.createElement("svg",{className:"checklist-icon",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:n,height:n,viewBox:"0 0 512 512",style:{marginRight:c?0:5,marginLeft:c?5:0}},Oe.createElement("path",{fill:t?r:a,d:t?"M432 64l-240 240-112-112-80 80 192 192 320-320z":"M507.331 411.33c-0.002-0.002-0.004-0.004-0.006-0.005l-155.322-155.325 155.322-155.325c0.002-0.002 0.004-0.003 0.006-0.005 1.672-1.673 2.881-3.627 3.656-5.708 2.123-5.688 0.912-12.341-3.662-16.915l-73.373-73.373c-4.574-4.573-11.225-5.783-16.914-3.66-2.080 0.775-4.035 1.984-5.709 3.655 0 0.002-0.002 0.003-0.004 0.005l-155.324 155.326-155.324-155.325c-0.002-0.002-0.003-0.003-0.005-0.005-1.673-1.671-3.627-2.88-5.707-3.655-5.69-2.124-12.341-0.913-16.915 3.66l-73.374 73.374c-4.574 4.574-5.784 11.226-3.661 16.914 0.776 2.080 1.985 4.036 3.656 5.708 0.002 0.001 0.003 0.003 0.005 0.005l155.325 155.324-155.325 155.326c-0.001 0.002-0.003 0.003-0.004 0.005-1.671 1.673-2.88 3.627-3.657 5.707-2.124 5.688-0.913 12.341 3.661 16.915l73.374 73.373c4.575 4.574 11.226 5.784 16.915 3.661 2.080-0.776 4.035-1.985 5.708-3.656 0.001-0.002 0.003-0.003 0.005-0.005l155.324-155.325 155.324 155.325c0.002 0.001 0.004 0.003 0.006 0.004 1.674 1.672 3.627 2.881 5.707 3.657 5.689 2.123 12.342 0.913 16.914-3.661l73.373-73.374c4.574-4.574 5.785-11.227 3.662-16.915-0.776-2.080-1.985-4.034-3.657-5.707z"})),Oe.createElement("span",{style:{paddingTop:2,opacity:t?1:o?void 0:.5,flex:1,color:t?i:o}},u))},eL={},bSt=Qn;Object.defineProperty(eL,"__esModule",{value:!0});var iae=eL.default=void 0,SSt=bSt(Xn()),vSt=_,ySt=(0,SSt.default)((0,vSt.jsx)("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"}),"Visibility");iae=eL.default=ySt;var tL={},TSt=Qn;Object.defineProperty(tL,"__esModule",{value:!0});var oae=tL.default=void 0,CSt=TSt(Xn()),RSt=_,xSt=(0,CSt.default)((0,RSt.jsx)("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z"}),"VisibilityOff");oae=tL.default=xSt;const ASt=({title:e,children:t,renderLogo:n})=>_.jsx(kt,{sx:{backgroundColor:r=>r.palette.background.default,height:"100vh",width:"100vw",alignItems:"center",justifyContent:"center"},children:_.jsxs(_t,{sx:r=>({backgroundColor:a=>a.palette.background.paper,border:a=>`1px solid ${a.palette.divider}`,borderRadius:1,padding:r.spacing(5,5),maxWidth:"400px",width:"90%",height:"auto",maxHeight:"90%",[r.breakpoints.down("sm")]:{maxWidth:"unset",width:"100%",height:"100%"}}),children:[_.jsxs(kt,{sx:{alignItems:"center",gap:3,marginBottom:3},children:[n,e?_.jsx(fn,{textAlign:"center",color:"text.primary",children:e}):null]}),_.jsx(kt,{gap:1,paddingX:3,children:t})]})});var nL={},OSt=Qn;Object.defineProperty(nL,"__esModule",{value:!0});var sae=nL.default=void 0;wSt(x);var NSt=OSt(Xn()),ISt=_;function lae(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(lae=function(r){return r?n:t})(e)}function wSt(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=lae(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var o=a?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(r,i,o):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}var DSt=(0,NSt.default)((0,ISt.jsx)("path",{d:"M12 1.27a11 11 0 00-3.48 21.46c.55.09.73-.28.73-.55v-1.84c-3.03.64-3.67-1.46-3.67-1.46-.55-1.29-1.28-1.65-1.28-1.65-.92-.65.1-.65.1-.65 1.1 0 1.73 1.1 1.73 1.1.92 1.65 2.57 1.2 3.21.92a2 2 0 01.64-1.47c-2.47-.27-5.04-1.19-5.04-5.5 0-1.1.46-2.1 1.2-2.84a3.76 3.76 0 010-2.93s.91-.28 3.11 1.1c1.8-.49 3.7-.49 5.5 0 2.1-1.38 3.02-1.1 3.02-1.1a3.76 3.76 0 010 2.93c.83.74 1.2 1.74 1.2 2.94 0 4.21-2.57 5.13-5.04 5.4.45.37.82.92.82 2.02v3.03c0 .27.1.64.73.55A11 11 0 0012 1.27"}),"GitHub");sae=nL.default=DSt;var rL={},LSt=Qn;Object.defineProperty(rL,"__esModule",{value:!0});var cae=rL.default=void 0;PSt(x);var MSt=LSt(Xn()),kSt=_;function uae(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(uae=function(r){return r?n:t})(e)}function PSt(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=uae(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var o=a?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(r,i,o):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}var FSt=(0,MSt.default)((0,kSt.jsx)("path",{d:"M12.545,10.239v3.821h5.445c-0.712,2.315-2.647,3.972-5.445,3.972c-3.332,0-6.033-2.701-6.033-6.032s2.701-6.032,6.033-6.032c1.498,0,2.866,0.549,3.921,1.453l2.814-2.814C17.503,2.988,15.139,2,12.545,2C7.021,2,2.543,6.477,2.543,12s4.478,10,10.002,10c8.396,0,10.249-7.85,9.426-11.748L12.545,10.239z"}),"Google");cae=rL.default=FSt;var aL={},BSt=Qn;Object.defineProperty(aL,"__esModule",{value:!0});var dae=aL.default=void 0;zSt(x);var USt=BSt(Xn()),$St=_;function pae(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(pae=function(r){return r?n:t})(e)}function zSt(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=pae(t);if(n&&n.has(e))return n.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var o=a?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(r,i,o):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}var HSt=(0,USt.default)((0,$St.jsx)("path",{d:"M2 3h9v9H2V3m9 19H2v-9h9v9M21 3v9h-9V3h9m0 19h-9v-9h9v9Z"}),"Microsoft");dae=aL.default=HSt;const GSt=()=>_.jsx("svg",{width:"24",height:"24",viewBox:"0 0 256 287",style:{fill:"inherit"},xmlns:"http://www.w3.org/2000/svg",preserveAspectRatio:"xMinYMin meet",children:_.jsx("path",{d:"M203.24 231.531l-28.73-88.434 75.208-54.64h-92.966L128.019.025l-.009-.024h92.98l28.74 88.446.002-.002.024-.013c16.69 51.31-.5 109.67-46.516 143.098zm-150.45 0l-.023.017 75.228 54.655 75.245-54.67-75.221-54.656-75.228 54.654zM6.295 88.434c-17.57 54.088 2.825 111.4 46.481 143.108l.007-.028 28.735-88.429-75.192-54.63h92.944L128.004.024 128.01 0H35.025L6.294 88.434z"})}),VSt=()=>_.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 256 299",xmlns:"http://www.w3.org/2000/svg",preserveAspectRatio:"xMidYMid",children:[_.jsx("path",{d:"M208.752 58.061l25.771-6.636.192.283.651 155.607-.843.846-5.31.227-20.159-3.138-.302-.794V58.061M59.705 218.971l.095.007 68.027 19.767.173.133.296.236-.096 59.232-.2.252-68.295-33.178v-46.449",fill:"#7A3E65"}),_.jsx("path",{d:"M208.752 204.456l-80.64 19.312-40.488-9.773-27.919 4.976L128 238.878l105.405-28.537 1.118-2.18-25.771-3.705",fill:"#CFB2C1"}),_.jsx("path",{d:"M196.295 79.626l-.657-.749-66.904-19.44-.734.283-.672-.343L22.052 89.734l-.575.703.845.463 24.075 3.53.851-.289 80.64-19.311 40.488 9.773 27.919-4.977",fill:"#512843"}),_.jsx("path",{d:"M47.248 240.537l-25.771 6.221-.045-.149-1.015-155.026 1.06-1.146 25.771 3.704v146.396",fill:"#C17B9E"}),_.jsx("path",{d:"M82.04 180.403l45.96 5.391.345-.515.187-71.887-.532-.589-45.96 5.392v62.208",fill:"#7A3E65"}),_.jsx("path",{d:"M173.96 180.403L128 185.794v-72.991l45.96 5.392v62.208M196.295 79.626L128 59.72V0l68.295 33.177v46.449",fill:"#C17B9E"}),_.jsx("path",{d:"M128 0L0 61.793v175.011l21.477 9.954V90.437L128 59.72V0",fill:"#7A3E65"}),_.jsx("path",{d:"M234.523 51.425v156.736L128 238.878v59.72l128-61.794V61.793l-21.477-10.368",fill:"#C17B9E"})]}),YSt=()=>_.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",version:"1.1",viewBox:"0 0 196 216",xmlSpace:"preserve",children:[_.jsx("path",{fill:"#0198B8",d:"M66.841 183.009c.049 4.355.097 8.71-.27 13.485-11.818-6.767-23.167-14.04-34.66-21.077-3.023-1.85-6.494-2.968-9.759-4.421-1.994-5.399-3.99-10.797-5.564-16.59 2.378.369 4.526.837 6.264 1.947 12.42 7.933 24.72 16.054 37.157 23.961 2.028 1.29 4.543 1.816 6.832 2.695z",opacity:"1"}),_.jsx("path",{fill:"#0BE5DA",d:"M56.298 102c.85-.912 1.624-2.505 2.565-2.611 3.038-.343 6.137-.139 9.679.29 1.212 1.44 1.753 2.758 2.736 3.396 17.255 11.216 34.541 22.386 51.898 33.444 1.855 1.182 4.195 1.604 6.31 2.38-.19 1.28.077 3.15-.662 3.723-1.792 1.39-4.052 2.174-6.483 2.884-1.164-1.446-1.731-2.93-2.809-3.643-7.175-4.742-14.43-9.367-21.72-13.934-4.877-3.057-9.855-5.954-14.788-8.923-1.091-.413-2.182-.827-3.71-1.653-7.963-5.393-15.49-10.373-23.016-15.353z",opacity:"1"}),_.jsx("path",{fill:"#13E5D1",d:"M129.377 138.545c-2.006-.422-4.346-.844-6.201-2.026-17.357-11.058-34.643-22.228-51.898-33.444-.983-.638-1.524-1.957-2.285-3.3 3.358-.406 6.73-.473 10.563-.1 1.243 1.615 1.78 3.14 2.856 3.903 3.597 2.547 7.509 4.656 11.063 7.256 2.387 1.748 4.374 4.043 6.254 6.143-.431.113-.606.145-.713.247-.096.092-.118.261-.172.397l5.186 1.336c1.656.136 3.312.279 4.968.406 7.268.557 12.628 3.671 15.482 10.766 1.153 2.866 3.167 5.386 4.897 8.416z",opacity:"1"}),_.jsx("path",{fill:"#07E4E3",d:"M82.727 119.17a257.804 257.804 0 0115.086 8.759c7.29 4.567 14.544 9.192 21.719 13.934 1.078.713 1.645 2.197 2.45 3.691-2.826 1.962-5.652 3.557-9.194 5.557-2.288-4.191-4.438-7.98-6.446-11.841-3.98-7.655-7.928-7.877-13.248-.74-5.877-3.234-11.26-6.38-16.642-9.524 1.993-3.225 3.986-6.449 6.275-9.837z",opacity:"1"}),_.jsx("path",{fill:"#57DB45",d:"M180.423 56.014c.762 2.732 1.524 5.464 1.853 8.58-1.646-.019-3-.2-4.05-.863-9.341-5.915-18.569-12.013-27.954-17.857-6.12-3.811-12.448-7.29-18.682-10.92-.078-2.364-.156-4.729.227-7.511 11.469 6.52 22.417 13.556 33.511 20.353 4.879 2.989 10.054 5.493 15.095 8.218z",opacity:"1"}),_.jsx("path",{fill:"#06A3BE",d:"M66.914 182.573c-2.362-.443-4.877-.97-6.905-2.259-12.437-7.907-24.737-16.028-37.157-23.96-1.738-1.11-3.886-1.58-6.217-2.344-.464-.472-.555-.944-.662-2.2.014-2.802.045-4.819.445-6.821 4.9 2.647 9.35 5.428 13.983 7.865 3.738 1.966 7.696 3.516 11.557 5.25 5.502 9.625 13.99 15.097 25.029 17.64 0 2.146 0 4.27-.073 6.83z",opacity:"1"}),_.jsx("path",{fill:"#088FB2",d:"M22.181 171.339c3.236 1.11 6.707 2.227 9.73 4.078 11.493 7.036 22.842 14.31 34.591 21.536.346 1.483.346 2.924.346 4.552-19.021-2.271-32.731-12.099-42.868-27.5-.534-.811-1.177-1.55-1.799-2.666z",opacity:"1"}),_.jsx("path",{fill:"#5CDB3C",d:"M180.408 55.677c-5.026-2.388-10.201-4.892-15.08-7.881-11.094-6.797-22.042-13.833-33.376-20.778-.418-2.055-.51-4.103-.145-6.568 1.673.084 3 .414 4.09 1.112 10.474 6.71 20.862 13.554 31.389 20.18 2.318 1.459 5.084 2.206 7.644 3.281 1.821 3.44 3.642 6.878 5.478 10.654z",opacity:"1"}),_.jsx("path",{fill:"#59DD55",d:"M131.458 35.376c6.366 3.207 12.693 6.687 18.814 10.498 9.385 5.844 18.613 11.942 27.954 17.857 1.05.664 2.404.844 3.974 1.244.501 2.046.646 4.098.38 6.545-7.279-3.892-14.065-8.316-21.058-12.385-2.192-1.275-4.942-1.59-7.436-2.346-5.384-3.857-10.328-8.777-16.286-11.25-5.178-2.148-7.703-4.195-6.342-10.163z",opacity:"1"}),_.jsx("path",{fill:"#01E3E3",d:"M15.447 90.994c-.065-4.355-.131-8.71.255-13.521 2.615.575 4.824 1.524 6.932 2.657 5.425 2.916 10.805 5.913 16.203 8.878.046 4.358.092 8.716-.295 13.527-3.835-1.435-7.207-3.382-10.647-5.197-4.118-2.173-8.296-4.234-12.448-6.344z",opacity:"1"}),_.jsx("path",{fill:"#22E3B4",d:"M100.982 92.49c-5.371.802-10.758 1.513-16.107 2.443-2.781.484-4.543-.264-5.988-2.802-3.166-5.56-6.618-10.957-10.33-17.038 2.094-1.064 3.92-1.994 6.137-2.627 1.35 1.37 2.138 2.71 3.302 3.476 6.054 3.99 12.27 7.737 18.282 11.79 1.813 1.222 3.15 3.153 4.704 4.759z",opacity:"1"}),_.jsx("path",{fill:"#66DB3A",d:"M174.883 44.68c-2.513-.732-5.279-1.48-7.597-2.938-10.527-6.626-20.915-13.47-31.39-20.18-1.09-.698-2.416-1.028-3.964-1.533-1.176-3.157-.493-4.067 3.096-3.379 17.434 3.343 30.305 13.045 39.855 28.03z",opacity:"1"}),_.jsx("path",{fill:"#07E4E3",d:"M173.516 175.205c-2.971 3.499-5.943 6.998-9.27 10.29-4.452-3.19-8.447-6.328-12.682-9.1-2.676-1.75-5.71-2.954-8.585-4.403 3.165-2.552 6.33-5.105 10.158-7.814 2.674.924 4.708 1.962 6.688 3.095 4.578 2.62 9.13 5.285 13.691 7.932z",opacity:"1"}),_.jsx("path",{fill:"#19E3BC",d:"M128.157 117.563c-5.08.066-10.162.133-15.708-.24-1.486-1.621-2.32-3.067-3.56-3.937-4.746-3.333-9.7-6.372-14.403-9.762-1.448-1.044-2.341-2.857-3.488-4.318 5.015-.057 10.03-.114 15.524.242 1.13 1.272 1.615 2.373 2.46 2.95 4.987 3.41 10.154 6.566 15.047 10.101 1.69 1.22 2.77 3.285 4.128 4.964z",opacity:"1"}),_.jsx("path",{fill:"#26E2A8",d:"M101.374 92.561c-1.947-1.676-3.283-3.607-5.096-4.83-6.011-4.052-12.228-7.798-18.282-11.789-1.164-.767-1.951-2.106-2.947-3.525 2.391-1.668 4.817-2.992 7.748-4.059 2.898 1.398 5.29 2.537 7.683 3.677 1.158 2.159 2.405 4.276 3.453 6.487 1.481 3.128 3.688 4.935 8.075 4.528 3.838 2.53 6.91 5.09 9.981 7.649-3.408.644-6.815 1.289-10.615 1.862z",opacity:"1"}),_.jsx("path",{fill:"#52DD5A",d:"M154.217 57.132c2.363.412 5.113.728 7.305 2.003 6.993 4.069 13.78 8.493 20.991 12.823.386 3.074.426 6.106.057 9.544-8.285-4.232-16.162-8.87-24.038-13.508a10797.74 10797.74 0 01-4.315-10.862z",opacity:"1"}),_.jsx("path",{fill:"#00CFD8",d:"M16.05 144.975c-.032 2.016-.063 4.033-.11 6.474-.266-1.494-.726-3.41-.731-5.328-.036-15.064.016-30.13.484-45.645 2.058.335 3.731 1.02 5.277 1.925 5.976 3.495 11.912 7.06 17.863 10.6.047 2.703.095 5.406-.273 8.51-7.515-3.888-14.615-8.178-22.472-12.926 0 3.858 0 6.64-.026 9.87-.011 3.147.004 5.844-.011 8.991-.014 3.152.002 5.853-.008 9.004-.015 3.14-.004 5.833.006 8.525z",opacity:"1"}),_.jsx("path",{fill:"#22E2AA",d:"M112.026 99.266c3.355-.08 6.71-.16 10.58.153 7.661 4.795 14.808 9.196 21.955 13.596v4.757c-3.706 0-7.16 0-11.087-.418-1.152-1.264-1.678-2.334-2.536-2.918-5.006-3.407-10.197-6.553-15.088-10.114-1.635-1.19-2.57-3.343-3.824-5.056z",opacity:"1"}),_.jsx("path",{fill:"#0BE5DA",d:"M38.909 88.559c-5.47-2.516-10.85-5.513-16.275-8.429-2.108-1.133-4.317-2.082-6.836-3.111-.392-3.025-.428-6.053-.01-9.536 2.605.583 4.8 1.543 6.903 2.674 5.414 2.913 10.786 5.902 16.176 8.86.038 3.03.076 6.062.042 9.542z",opacity:"1"}),_.jsx("path",{fill:"#04D9DF",d:"M142.637 172.105c3.216 1.336 6.251 2.54 8.927 4.29 4.235 2.772 8.23 5.91 12.376 9.23-1.94 2.225-3.928 4.112-6.416 5.68-2.805-2.126-5.087-3.967-7.423-5.736-4.688-3.55-9.406-7.062-14.111-10.59 2.101-.92 4.203-1.841 6.647-2.874z",opacity:"1"}),_.jsx("path",{fill:"#07E4E3",d:"M56.216 102.46c7.609 4.52 15.135 9.5 22.722 14.795-7.345.314-14.751.314-22.804.314 0-4.869 0-9.758.082-15.108z",opacity:"1"}),_.jsx("path",{fill:"#00D9DE",d:"M38.904 112.552c-6.022-3.09-11.958-6.656-17.934-10.151-1.546-.904-3.22-1.59-5.178-2.382-.41-2.718-.475-5.43-.443-8.582 4.25 1.667 8.428 3.728 12.546 5.9 3.44 1.816 6.812 3.763 10.576 5.658.41 3.04.456 6.074.433 9.557z",opacity:"1"}),_.jsx("path",{fill:"#02ABC3",d:"M16.418 144.989c-.38-2.706-.39-5.398-.012-8.534 2.24.512 4.135 1.395 5.936 2.439 5.769 3.34 11.503 6.74 17.25 10.117.75 2.772 1.498 5.544 2.306 8.705-3.801-1.346-7.759-2.896-11.497-4.862-4.633-2.437-9.084-5.218-13.983-7.865z",opacity:"1"}),_.jsx("path",{fill:"#14E4C7",d:"M90.544 99.234c1.6 1.533 2.494 3.346 3.942 4.39 4.703 3.39 9.657 6.43 14.404 9.762 1.239.87 2.073 2.316 3.106 3.838-2.395.419-4.804.497-7.903.314-1.82-.378-2.949-.495-4.078-.611-2.166-2.05-4.153-4.345-6.54-6.093-3.554-2.6-7.466-4.71-11.063-7.256-1.077-.763-1.613-2.288-2.409-3.804 3.355-.43 6.722-.521 10.541-.54z",opacity:"1"}),_.jsx("path",{fill:"#00BDCD",d:"M16.08 126.997c-.014-2.698-.029-5.395.343-8.539 2.267.537 4.164 1.488 6.024 2.508 5.47 2.998 10.925 6.023 16.386 9.038.048 3.032.096 6.064-.268 9.501-7.769-3.9-15.127-8.204-22.484-12.508z",opacity:"1"}),_.jsx("path",{fill:"#14E4C7",d:"M39.985 66.998c-.326 2.73-.653 5.46-1.395 8.557-1.717-.33-3.022-1.016-4.317-1.721-6.023-3.282-12.043-6.569-18.064-9.854.57-2.436 1.14-4.873 2.25-7.643a29.74 29.74 0 017.06 2.707c4.853 2.594 9.648 5.296 14.466 7.954z",opacity:"1"}),_.jsx("path",{fill:"#02B4C8",d:"M16.05 127.446c7.388 3.855 14.746 8.16 22.445 12.509.642 2.778.942 5.511 1.17 8.65-5.82-2.971-11.554-6.371-17.323-9.711-1.801-1.044-3.695-1.927-5.91-2.888-.379-2.707-.395-5.408-.381-8.56z",opacity:"1"}),_.jsx("path",{fill:"#00C6D3",d:"M38.904 129.564c-5.532-2.575-10.987-5.6-16.457-8.598a74.807 74.807 0 00-5.998-2.956c-.36-2.785-.36-5.567-.36-9.425 7.856 4.748 14.956 9.038 22.4 13.372.391 2.418.439 4.792.415 7.607z",opacity:"1"}),_.jsx("path",{fill:"#19E3BC",d:"M159.333 145.996c0-2.371 0-4.742.456-7.537 2.769.814 5.081 2.052 7.395 3.286 5.17 2.758 10.34 5.513 15.511 8.27-.218 2.093-.435 4.186-1.201 6.632-2.487-.413-4.517-1.009-6.349-1.978-5.313-2.81-10.547-5.771-15.812-8.673z",opacity:"1"}),_.jsx("path",{fill:"#36E087",d:"M43.012 25.04c1.452-.952 2.904-1.903 4.846-2.6 6.652 4.024 12.816 7.791 18.98 11.558-.346 3.21-.692 6.42-1.446 9.266-1.63-1.61-2.685-3.108-4.105-4.06-4.952-3.319-10.12-6.323-15.008-9.73-1.426-.994-2.196-2.93-3.267-4.434z",opacity:"1"}),_.jsx("path",{fill:"#22E2AA",d:"M182.848 137.005c.043 2.042.085 4.084-.298 6.554-5.814-2.777-11.152-6.073-16.617-9.141-1.954-1.097-4.217-1.646-6.338-2.445-.083-2.362-.166-4.724.204-7.511 1.925.273 3.46.865 4.857 1.688 6.086 3.582 12.132 7.23 18.192 10.855z",opacity:"1"}),_.jsx("path",{fill:"#10D2DA",d:"M135.591 174.997c5.104 3.51 9.822 7.021 14.51 10.572 2.336 1.769 4.618 3.61 7.07 5.788-1.752 1.637-3.65 2.903-5.878 3.865-6.792-4.604-13.253-8.903-19.714-13.201-.304-3.114-1.881-6.883 4.012-7.024z",opacity:"1"}),_.jsx("path",{fill:"#2EE29A",d:"M182.85 123.001c.044 2.044.088 4.087-.298 6.559-2.865-.817-5.323-2.023-7.734-3.316-5.092-2.732-10.158-5.51-15.235-8.268-.083-2.367-.165-4.733.205-7.523 1.196-.108 1.986.128 2.677.533 6.804 3.99 13.593 8.006 20.386 12.015z",opacity:"1"}),_.jsx("path",{fill:"#34E192",d:"M42.672 25.09c1.41 1.454 2.181 3.39 3.607 4.384 4.889 3.407 10.056 6.411 15.008 9.73 1.42.952 2.475 2.45 3.713 4.031a22.66 22.66 0 01-6.684 2.299c-1.223-1.3-1.863-2.572-2.894-3.245-6.364-4.15-12.816-8.163-19.239-12.223 2.05-1.641 4.1-3.283 6.489-4.975z",opacity:"1"}),_.jsx("path",{fill:"#2EE29A",d:"M35.89 30.195a473.368 473.368 0 0119.532 12.094c1.031.673 1.67 1.946 2.525 3.284-1.092.995-2.22 1.647-4.042 2.354a312.328 312.328 0 01-19.87-11.69c-.703-.449-.679-2.038-.991-3.097.85-.94 1.7-1.878 2.845-2.945z",opacity:"1"}),_.jsx("path",{fill:"#3CDF74",d:"M182.838 95.002c.044 2.044.087 4.087-.3 6.558-3.87-1.491-7.28-3.461-10.755-5.314-4.021-2.144-8.098-4.185-12.151-6.27-.091-2.039-.182-4.078.203-6.542a33.016 33.016 0 018.01 3.094c5.042 2.744 10 5.64 14.993 8.474z",opacity:"1"}),_.jsx("path",{fill:"#38DF7C",d:"M159.495 90.398c4.19 1.663 8.267 3.704 12.288 5.848 3.474 1.853 6.886 3.823 10.687 5.747.41 2.048.456 4.09.076 6.562-3.872-1.488-7.29-3.459-10.77-5.313-4.032-2.148-8.117-4.193-12.179-6.283-.08-2.046-.159-4.092-.102-6.56z",opacity:"1"}),_.jsx("path",{fill:"#04D9DF",d:"M76.254 129.3c5.58 2.85 10.963 5.996 16.54 9.41-.633 2.14-1.462 4.01-2.936 6.076-6.049-3.127-11.451-6.45-16.854-9.775a537.765 537.765 0 013.25-5.712z",opacity:"1"}),_.jsx("path",{fill:"#44DE6C",d:"M182.906 94.568c-5.06-2.4-10.019-5.296-15.06-8.04-2.43-1.322-5.018-2.355-7.879-3.514-.47-2.047-.597-4.1-.263-6.583 3.218.886 6.032 2.098 8.72 3.542 4.845 2.602 9.615 5.343 14.416 8.026.045 2.045.09 4.09.066 6.57z",opacity:"1"}),_.jsx("path",{fill:"#34E192",d:"M182.917 122.567c-6.86-3.575-13.648-7.592-20.452-11.581-.691-.405-1.48-.641-2.552-.96-.413-1.73-.498-3.454-.111-5.598 3.012.683 5.653 1.602 8.073 2.927 5.055 2.769 9.993 5.751 14.98 8.646.043 2.044.086 4.088.062 6.566z",opacity:"1"}),_.jsx("path",{fill:"#0BE5DA",d:"M173.79 175.063c-4.836-2.505-9.387-5.17-13.965-7.79a75.774 75.774 0 00-6.388-3.251 24.082 24.082 0 013.526-6.486c6.92 4.175 13.374 8.288 19.829 12.401-.91 1.662-1.818 3.323-3.001 5.126z",opacity:"1"}),_.jsx("path",{fill:"#00C6D3",d:"M131.465 182.46c6.575 3.86 13.036 8.158 19.505 12.8-2.413 1.401-4.832 2.458-7.663 3.16-4.167-2.713-7.922-5.073-11.677-7.433-.093-2.696-.186-5.393-.165-8.528z",opacity:"1"}),_.jsx("path",{fill:"#14E4C7",d:"M159.236 146.383c5.362 2.515 10.596 5.475 15.909 8.286 1.832.97 3.862 1.565 6.17 2.331-.242 2.213-.853 4.426-2.005 6.782-4.846-2.523-9.07-5.332-13.486-7.796-2.34-1.306-5.014-2.011-7.537-2.988.284-2.076.568-4.152.949-6.615z",opacity:"1"}),_.jsx("path",{fill:"#48DD63",d:"M182.907 87.574c-4.868-2.258-9.638-5-14.482-7.601-2.69-1.444-5.503-2.656-8.62-3.972-.713-2.409-1.067-4.818-1.347-7.617 7.95 4.248 15.827 8.886 24.044 13.568.385 1.761.428 3.479.405 5.622z",opacity:"1"}),_.jsx("path",{fill:"#3BE189",d:"M182.921 115.566c-5.053-2.46-9.99-5.442-15.046-8.21-2.42-1.326-5.061-2.245-7.952-3.343-.431-2.064-.513-4.132-.46-6.628 4.196 1.664 8.281 3.71 12.312 5.857 3.48 1.854 6.899 3.825 10.708 5.747.41 2.05.457 4.096.438 6.577z",opacity:"1"}),_.jsx("path",{fill:"#22E2AA",d:"M47.885 52.757c-.817.965-1.634 1.931-3.08 3.02-7.014-4.162-13.399-8.447-19.784-12.732.813-1.245 1.626-2.49 3.083-3.849 4.956 2.48 9.387 4.9 13.535 7.734 2.324 1.588 4.18 3.862 6.246 5.827z",opacity:"1"}),_.jsx("path",{fill:"#19E3BC",d:"M40.25 66.76c-5.083-2.42-9.878-5.122-14.731-7.716-2.112-1.129-4.343-2.034-6.888-3.041.25-1.793.87-3.585 2.047-5.683 2.473.551 4.455 1.287 6.292 2.287 5.016 2.732 9.972 5.576 14.952 8.376-.47 1.846-.939 3.692-1.673 5.776z",opacity:"1"}),_.jsx("path",{fill:"#22E3B4",d:"M42.186 60.792c-5.244-2.609-10.2-5.453-15.216-8.185-1.837-1-3.819-1.736-6.082-2.585.951-2.219 2.25-4.445 3.84-6.824 6.678 4.132 13.063 8.417 19.794 12.73-.46 1.576-1.266 3.124-2.336 4.864zM159.464 132.392c2.252.38 4.515.929 6.469 2.026 5.465 3.068 10.803 6.364 16.552 9.575.379 1.73.397 3.455.313 5.601-5.273-2.336-10.444-5.091-15.614-7.849-2.314-1.234-4.626-2.472-7.27-3.712-.414-1.743-.497-3.483-.45-5.641z",opacity:"1"}),_.jsx("path",{fill:"#2CE2A4",d:"M159.455 118.395c5.205 2.34 10.271 5.117 15.363 7.849a115.926 115.926 0 007.67 3.75c.408 2.051.453 4.097.429 6.578-6.13-3.191-12.175-6.84-18.26-10.422-1.399-.823-2.933-1.415-4.735-2.115-.418-1.742-.506-3.481-.467-5.64z",opacity:"1"}),_.jsx("path",{fill:"#34E192",d:"M107.005 77c.83-1.862 1.66-3.724 3.114-5.754 6.028 3.442 11.431 7.05 16.835 10.66-.85 1.562-1.7 3.124-3.171 4.838-6.008-3.147-11.393-6.445-16.778-9.743z",opacity:"1"}),_.jsx("path",{fill:"#13E5D1",d:"M158.124 153.32c2.686.655 5.36 1.36 7.7 2.666 4.416 2.464 8.64 5.273 13.304 8.085-.331 1.922-1.024 3.697-2.027 5.67-6.764-3.917-13.219-8.03-19.872-12.406.112-1.406.422-2.55.895-4.015z",opacity:"1"}),_.jsx("path",{fill:"#10D2DA",d:"M72.707 135.176c5.7 3.16 11.102 6.483 16.876 9.808-.464 1.924-1.298 3.846-2.388 6.357l-18.676-9.997c1.469-2.266 2.68-4.134 4.188-6.168z",opacity:"1"}),_.jsx("path",{fill:"#40E28D",d:"M127.235 81.727c-5.685-3.43-11.088-7.04-16.845-10.681.36-1.67 1.074-3.307 2.092-5.642l18.892 9.704c-1.531 2.556-2.695 4.498-4.14 6.619z",opacity:"1"}),_.jsx("path",{fill:"#32E29F",d:"M106.734 77.187c5.656 3.112 11.04 6.41 16.77 9.736-2.041 4.98-6.953 2.77-11.099 3.845-3.487-2.629-6.559-5.188-9.995-7.75 1.108-1.883 2.581-3.764 4.324-5.83z",opacity:"1"}),_.jsx("path",{fill:"#26E2A8",d:"M144.662 112.586c-7.248-3.971-14.395-8.372-21.603-13.101 3.302-.374 6.663-.42 10.541-.073 4.004 2.466 7.492 4.54 10.98 6.613.06 2.044.121 4.088.082 6.561z",opacity:"1"}),_.jsx("path",{fill:"#2CE2A4",d:"M48.197 52.661c-2.379-1.87-4.234-4.143-6.558-5.731-4.148-2.835-8.579-5.255-13.244-7.882 1.117-1.9 2.587-3.768 4.353-5.772.608.923.584 2.512 1.287 2.96 6.318 4.029 12.765 7.857 19.54 11.745-1.446 1.528-3.256 3.057-5.378 4.68z",opacity:"1"}),_.jsx("path",{fill:"#38DF7C",d:"M66.904 33.565c-6.23-3.334-12.394-7.101-18.71-11.163a27.463 27.463 0 017.47-3.006c3.998 2.755 7.584 5.18 11.17 7.604.045 2.043.09 4.087.07 6.565z",opacity:"1"}),_.jsx("path",{fill:"#00BDCD",d:"M131.497 191.427c3.888 1.92 7.643 4.28 11.448 6.969-3.55 1.412-7.15 2.496-11.582 3.83 0-3.906 0-7.133.134-10.8z",opacity:"1"}),_.jsx("path",{fill:"#32E6BE",d:"M111.61 99.179c1.67 1.8 2.605 3.952 4.24 5.143 4.89 3.56 10.082 6.707 15.088 10.114.858.584 1.384 1.654 2.086 2.837-1.387.386-2.797.437-4.537.388-1.688-1.777-2.768-3.841-4.458-5.062-4.893-3.535-10.06-6.69-15.047-10.1-.845-.578-1.33-1.68-2-2.884 1.392-.404 2.802-.464 4.628-.436z",opacity:"1"}),_.jsx("path",{fill:"#3CDF74",d:"M66.901 26.546c-3.653-1.97-7.239-4.395-10.86-7.165 3.35-1.367 6.735-2.387 10.928-3.65 0 3.915 0 7.138-.068 10.815z",opacity:"1"}),_.jsx("path",{fill:"#23E0D5",d:"M16.109 64.287c6.121 2.978 12.14 6.265 18.164 9.547 1.295.705 2.6 1.392 4.249 2.12.395.793.442 1.553.417 2.688-5.462-2.583-10.834-5.572-16.248-8.485-2.103-1.131-4.298-2.09-6.798-3.113-.193-.806-.039-1.628.216-2.757z",opacity:"1"}),_.jsx("path",{fill:"#32E29F",d:"M144.68 105.59c-3.588-1.639-7.076-3.712-10.626-6.115 3.355-.33 6.772-.33 10.726-.33 0 2.18 0 4.094-.1 6.444zM90.45 71.705c-2.363-.81-4.755-1.95-7.3-3.396.974-1.133 2.102-1.96 3.466-2.96 1.41 2.235 2.607 4.13 3.834 6.356z",opacity:"1"}),_.jsx("path",{fill:"#32E6BE",d:"M99.73 116.977c1.414.066 2.543.183 3.91.537.249.441.26.644.33 1.145-1.669-.147-3.397-.593-5.126-1.038.054-.136.076-.305.172-.397.107-.102.282-.134.713-.247z",opacity:"1"})]}),qSt=()=>_.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 380 380",width:"24",height:"24",children:[_.jsx("path",{fill:"#e24329",d:"M282.83,170.73l-.27-.69-26.14-68.22a6.81,6.81,0,0,0-2.69-3.24,7,7,0,0,0-8,.43,7,7,0,0,0-2.32,3.52l-17.65,54H154.29l-17.65-54A6.86,6.86,0,0,0,134.32,99a7,7,0,0,0-8-.43,6.87,6.87,0,0,0-2.69,3.24L97.44,170l-.26.69a48.54,48.54,0,0,0,16.1,56.1l.09.07.24.17,39.82,29.82,19.7,14.91,12,9.06a8.07,8.07,0,0,0,9.76,0l12-9.06,19.7-14.91,40.06-30,.1-.08A48.56,48.56,0,0,0,282.83,170.73Z"}),_.jsx("path",{fill:"#fc6d26",d:"M282.83,170.73l-.27-.69a88.3,88.3,0,0,0-35.15,15.8L190,229.25c19.55,14.79,36.57,27.64,36.57,27.64l40.06-30,.1-.08A48.56,48.56,0,0,0,282.83,170.73Z"}),_.jsx("path",{fill:"#fca326",d:"M153.43,256.89l19.7,14.91,12,9.06a8.07,8.07,0,0,0,9.76,0l12-9.06,19.7-14.91S209.55,244,190,229.25C170.45,244,153.43,256.89,153.43,256.89Z"}),_.jsx("path",{fill:"#fc6d26",d:"M132.58,185.84A88.19,88.19,0,0,0,97.44,170l-.26.69a48.54,48.54,0,0,0,16.1,56.1l.09.07.24.17,39.82,29.82s17-12.85,36.57-27.64Z"})]}),WSt=()=>_.jsx("svg",{version:"1.2",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1594 1595",width:"24",height:"24",style:{fill:"inherit"},children:_.jsx("path",{fillRule:"evenodd",d:"m877 11.5l-32.8 403.8c-15.5-1.8-31-2.7-46.9-2.7-19.9 0-39.4 1.3-58.5 4.4l-18.6-195.6c-0.4-6.2 4.5-11.6 10.7-11.6h33.2l-16-197.8c-0.4-6.2 4.5-11.6 10.2-11.6h108.5c6.2 0 11.1 5.4 10.2 11.1zm-166.1 410.4c-35 8-68.2 20.8-98.8 37.6l-84.6-177.5c-2.6-5.3 0-11.9 5.8-14.2l31.4-11.5-82.8-180.6c-2.6-5.3 0-11.9 5.8-14.2l101.9-37.2c5.7-2.2 11.9 1.4 13.7 7.1 0.4 0 107.6 390.5 107.6 390.5zm-357.4-278l234.3 330.2c-29.7 19.5-56.7 42.5-79.7 69.1l-140.5-138.1c-4.4-4.4-3.9-11.5 0.5-15.5l25.7-21.3-139.6-141.2c-4.4-4.4-3.9-11.5 0.9-15.5l82.9-69.5c4.8-4 11.5-3.1 15 1.8zm136.9 421.4c-21.3 27.9-38.5 58.9-51.4 92.1l-178.9-81.9c-5.8-2.2-8-9.3-4.9-14.6l16.8-28.8-179.8-85c-5.3-2.6-7.5-9.3-4.4-14.6l54-93.8c3.1-5.3 10.2-7.1 15.1-3.6zm-466 24.8c0.9-6.2 7.1-9.7 12.8-8.4l392 102.3c-10.2 33.2-15.9 68.2-16.8 104.5l-196.2-16c-6.2-0.4-10.7-6.2-9.3-12.4l5.7-32.7-198-18.6c-6.2-0.5-10.1-6.2-9.3-12.4l18.6-106.7zm-15 264.7l403.5-37.2c1.8 35.9 8.9 70.9 19.9 103.6l-189.5 52.3c-5.8 1.3-12-2.2-12.9-8.4l-5.7-32.8-192.3 50c-5.7 1.4-11.9-2.2-12.8-8.4l-19.1-106.7c-0.9-6.2 3.1-11.9 9.3-12.4zm63.4 280.7c-3.1-5.3-0.9-11.9 4.4-14.6l365.9-173.5c13.7 32.7 32.3 63.3 54.4 90.7l-160.3 114.2c-4.9 3.6-12 2.2-15.1-3.1l-16.8-29.2-163.4 112.9c-4.9 3.5-12 1.8-15.1-3.5 0 0-54.5-93.9-54-93.9zm525.7-9.3l-111.6 162c-3.5 5.4-10.6 6.2-15.5 2.3l-25.7-21.7-115.1 162c-3.6 4.9-10.2 5.8-15.1 1.8l-83.3-69.5c-4.8-4-5.3-11.1-0.9-15.5l284.8-288.2c24.4 25.6 52.3 48.2 82.4 66.8zm-138.6 395.8c-5.8-2.2-8.4-8.9-5.8-14.2l168.8-368.3c31 15.9 64.7 27.9 99.7 34.5l-49.7 190.4c-1.3 5.7-7.9 9.3-13.7 7.1l-31.4-11.5-52.7 191.7c-1.8 5.7-8 9.3-13.8 7l-101.8-37.1zm337.5-340c19.9 0 39.4-1.4 58.4-4.5l18.6 195.7c0.5 6.2-4.4 11.5-10.6 11.5h-33.2l15.9 197.9c0.9 6.2-3.9 11.5-10.1 11.5h-108.6c-5.7 0-10.6-5.3-10.2-11.5l32.8-403.7c15.5 2.2 31 3.1 47 3.1zm174.5-728.3c-31-15.5-64.2-27.5-99.7-34.5l49.6-190.4c1.8-5.8 8-9.3 13.8-7.1l31.4 11.5 52.7-191.7c1.8-5.7 8-9.3 13.8-7.1l101.8 37.2c5.8 2.2 8.5 8.4 5.8 14.2zm391.6-207.2l-284.9 288.2c-23.9-25.7-51.3-48.2-81.9-66.8l111.6-162.1c3.6-4.8 10.7-6.2 15.5-2.2l25.7 21.7 115.2-162c3.5-4.9 10.6-5.8 15-1.8l83.3 69.5c4.9 4 4.9 11.1 0.5 15.5zm153.7 227.1l-365.9 173.6c-14.2-32.8-32.3-63.4-54.5-90.8l160.3-114.2c4.9-4 12-2.2 15.1 3.1l16.8 28.8 163.5-112.9c4.9-3.1 11.9-1.8 15 3.5l54.5 93.9c3.1 5.3 1.4 11.9-4.4 14.6zm58 146.5l18.6 106.7c0.9 6.2-3.1 11.5-9.3 12.4l-403.5 37.6c-1.8-36.3-8.9-70.8-19.9-103.6l189.6-52.2c5.7-1.8 11.9 2.2 12.8 8.4l5.8 32.8 192.2-50.1c5.8-1.3 12 2.3 12.8 8.5zm-18.6 391.3l-392-102.3c10.2-33.2 16-68.1 16.9-104.4l196.2 15.9c6.2 0.9 10.2 6.2 9.3 12.4l-5.8 32.8 198 18.6c6.2 0.8 10.2 6.1 9.3 12.3l-18.6 106.7c-0.9 6.2-7.1 9.8-12.8 8.5zm-104.1 243.9c-3.1 5.3-10.2 6.6-15.1 3.5l-333.5-230.2c21.3-27.9 38.5-58.9 51.4-92.1l178.9 81.9c5.8 2.7 8 9.3 4.9 14.6l-16.8 28.8 179.8 85c5.3 2.7 7.5 9.3 4.4 14.6zm-446.5-135.9c29.7-19 56.3-42.5 79.8-69l140.4 138.1c4.4 4.4 4.4 11.5-0.5 15.5l-25.7 21.2 139.6 141.3c4 4.4 4 11.5-0.9 15.4l-82.8 69.6c-4.5 3.9-11.6 3.1-15.1-1.8l-234.3-330.3zm-1.8 449.8c-5.7 2.2-11.9-1.3-13.7-7.1l-107.2-390.4c35-8 68.2-20.8 98.8-37.7l84.6 177.6c2.6 5.7 0 12.4-5.8 14.1l-31.4 11.5 82.8 180.7c2.6 5.7 0 11.9-5.8 14.1l-101.8 37.2z"})});function jSt(e){return e.charAt(0).toUpperCase()+e.slice(1)}function RV(e){switch(e){case"azure-ad":return"Microsoft";case"github":return"GitHub";case"okta":return"Okta";case"descope":return"Descope";case"aws-cognito":return"Cognito";default:return jSt(e)}}function KSt(e){switch(e){case"google":return _.jsx(cae,{});case"github":return _.jsx(sae,{});case"azure-ad":return _.jsx(dae,{});case"okta":return _.jsx(WSt,{});case"auth0":return _.jsx(GSt,{});case"descope":return _.jsx(YSt,{});case"aws-cognito":return _.jsx(VSt,{});case"gitlab":return _.jsx(qSt,{});default:return null}}const QSt=({provider:e,onClick:t,isSignIn:n})=>{const{t:r}=ql();return _.jsx(Ii,{variant:"outlined",color:"inherit",startIcon:KSt(e.toLowerCase()),onClick:t,sx:{width:"100%",textTransform:"none",borderColor:Mt[400],padding:1.5,paddingLeft:3,justifyContent:"flex-start"},children:n?r("components.molecules.auth.providerButton.continue",{provider:RV(e)}):r("components.molecules.auth.providerButton.signup",{provider:RV(e)})})},XSt=({title:e,error:t,providers:n,callbackUrl:r,onPasswordSignIn:a,onOAuthSignIn:i,onForgotPassword:o,onSignUp:s,renderLogo:l,passwordChecklistSettings:c})=>{const[u,p]=x.useState(!1),[f,h]=x.useState(!c),[g,E]=M4(!0),[y,b]=M4(),[v,C]=x.useState(t),{t:T}=ql(),N=i&&n.length;x.useEffect(()=>{C(void 0),A.resetForm()},[g]),x.useEffect(()=>{C(t)},[t]),x.useEffect(()=>{!a&&i&&n.length===1&&i(n[0],r)},[a,i,n]);const A=P6({initialValues:{email:"",password:""},validationSchema:H6({email:gS().required(T("components.molecules.auth.authLogin.form.emailRequired")),password:gS().required(T("components.molecules.auth.authLogin.form.passwordRequired"))}),onSubmit:async({email:O,password:M})=>{if(p(!0),!!a)try{g?await a(O,M,r):s&&await s(O,M,r)}catch(P){P instanceof Error&&C(P.message)}finally{p(!1)}},validateOnBlur:!0});return _.jsxs(ASt,{title:e,renderLogo:l,children:[v?_.jsx(ms,{sx:{my:1},severity:"error",children:T([`components.molecules.auth.authLogin.error.${v.toLowerCase()}`,"components.molecules.auth.authLogin.error.default"])}):null,a?_.jsxs("form",{onSubmit:A.handleSubmit,children:[_.jsx(Lf,{id:"email",placeholder:T("components.molecules.auth.authLogin.form.email"),size:"medium",value:A.values.email,hasError:!!A.errors.email,description:A.touched.email?A.errors.email:void 0,onBlur:A.handleBlur,onChange:O=>A.setFieldValue("email",O.target.value)}),_.jsx(Lf,{id:"password",placeholder:T("components.molecules.auth.authLogin.form.password"),value:A.values.password,hasError:!!A.errors.password,description:A.touched.password?A.errors.password:void 0,onBlur:A.handleBlur,onChange:O=>A.setFieldValue("password",O.target.value),type:y?"text":"password",size:"medium",endAdornment:_.jsx(I5,{position:"end",children:_.jsx(zn,{"aria-label":"toggle password visibility",onClick:b,children:y?_.jsx(oae,{}):_.jsx(iae,{})})})}),!g&&A.values.password.length&&c?_.jsxs(_t,{sx:{border:1,marginTop:1,padding:1.5,borderRadius:1,borderColor:"grey.400","& .checklist-icon":{marginTop:.5},fontSize:14},children:[_.jsx(Pt,{path:"components.molecules.auth.authLogin.form.passwordMustContain"}),_.jsx(_St,{rules:c.rules,minLength:c.minLength,maxLength:c.maxLength,value:A.values.password,messages:c.messages,onChange:h})]}):null,g&&o?_.jsx(Zp,{href:"#",marginTop:1,onClick:o,children:_.jsx(Pt,{path:"components.molecules.auth.authLogin.form.forgotPassword"})}):null,_.jsx(Ii,{type:"submit",disabled:u||!g&&!f,variant:"contained",sx:{marginTop:3,width:"100%"},children:_.jsx(Pt,{path:"components.molecules.auth.authLogin.form.continue"})})]}):null,s?_.jsx(kt,{direction:"row",alignItems:"center",gap:.5,marginTop:1,children:g?_.jsxs(_.Fragment,{children:[_.jsx(fn,{color:"text.primary",children:_.jsx(Pt,{path:"components.molecules.auth.authLogin.form.noAccount"})}),_.jsx(Zp,{component:"button",onClick:E,children:_.jsx(Pt,{path:"components.molecules.auth.authLogin.form.signup"})})]}):_.jsxs(_.Fragment,{children:[_.jsx(fn,{color:"text.primary",children:_.jsx(Pt,{path:"components.molecules.auth.authLogin.form.alreadyHaveAccount"})}),_.jsx(Zp,{component:"button",onClick:E,children:_.jsx(Pt,{path:"components.molecules.auth.authLogin.form.signin"})})]})}):null,a&&N?_.jsx(fn,{color:"text.primary",sx:{alignItems:"center",direction:"row",display:"flex",gap:2,marginTop:1,width:"100%",":before, :after":{content:'""',borderBottom:`1px solid ${Mt[400]}`,height:"0.5px",flex:"1 0 auto"}},children:_.jsx(Pt,{path:"components.molecules.auth.authLogin.form.or"})}):null,N?_.jsx(kt,{color:"text.primary",marginTop:1,gap:1,children:n.map((O,M)=>_.jsx(QSt,{isSignIn:g,provider:O,onClick:()=>i(O,r)},`provider-${M}`))}):null]})};var iL={},ZSt=Qn;Object.defineProperty(iL,"__esModule",{value:!0});iL.default=void 0;var JSt=ZSt(Xn()),evt=_,tvt=(0,JSt.default)((0,evt.jsx)("path",{d:"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 14H4V8l8 5 8-5v10zm-8-7L4 6h16l-8 5z"}),"MailOutline");iL.default=tvt;function nvt(){const e=Qw(),{data:t,setAccessToken:n,user:r}=gs(),[a,i]=x.useState(""),o=yt(ca),s=no(),l=async()=>{try{const u=await o.headerAuth();n(u.access_token),s("/")}catch(u){i(u.message)}},c=async(u,p,f)=>{const h=new FormData;h.append("username",u),h.append("password",p);try{const g=await o.passwordAuth(h);n(g.access_token),s(f)}catch(g){i(g.message)}};return x.useEffect(()=>{i(e.get("error")||"")},[e]),x.useEffect(()=>{t&&(t.requireLogin||s("/"),t.headerAuth&&l(),r&&s("/"))},[t,r]),_.jsx(XSt,{title:_.jsx(Pt,{path:"components.molecules.auth.authLogin.title"}),error:a,callbackUrl:"/",providers:(t==null?void 0:t.oauthProviders)||[],onPasswordSignIn:t!=null&&t.passwordAuth?c:void 0,onOAuthSignIn:async u=>{window.location.href=o.getOAuthEndpoint(u)},renderLogo:_.jsx(jD,{style:{maxWidth:"60%",maxHeight:"90px"}})})}const rvt=({thread:e,error:t,isLoading:n})=>{const r=yt(vd),[a,i]=x.useState([]),o=yt(ca),{t:s}=Yy(),{threadId:l}=hs(),c=du();x.useEffect(()=>{e&&i(e.steps)},[e]);const u=x.useCallback(async(E,y,b)=>{try{oa.promise(o.setFeedback(b,r),{loading:"Updating",success:v=>(i(C=>C.map(T=>T.id===E.id?{...T,feedback:{...b,id:v.feedbackId}}:T)),y(),"Feedback updated!"),error:v=>_.jsx("span",{children:v.message})})}catch(v){console.log(v)}},[]),p=x.useCallback(async(E,y,b)=>{try{oa.promise(o.deleteFeedback(b,r),{loading:s("components.organisms.chat.Messages.index.updating"),success:()=>(i(v=>v.map(C=>C.id===E.id?{...C,feedback:void 0}:C)),y(),s("components.organisms.chat.Messages.index.feedbackUpdated")),error:v=>_.jsx("span",{children:v.message})})}catch(v){console.log(v)}},[]);if(n)return _.jsx(_.Fragment,{children:[1,2,3].map(E=>_.jsxs(kt,{sx:{px:2,gap:4,mt:5,flexDirection:"row",justifyContent:"center"},children:[_.jsxs(kt,{children:[_.jsx(Bc,{width:50}),_.jsx(Bc,{width:50})]}),_.jsx(Bc,{variant:"rounded",sx:{maxWidth:c,width:"100%",height:100}})]},`thread-skeleton-${E}`))});if(!e||t)return null;const f=e.elements,h=[],g=lSe(a);return _.jsxs(kt,{flexGrow:1,width:"100%",height:"100%",children:[_.jsx(_t,{sx:{width:"100%",maxWidth:c,mx:"auto",my:2},children:_.jsxs(ms,{sx:{mx:2},id:"thread-info",severity:"info",action:_.jsx(Ii,{component:Kw,color:"inherit",size:"small",to:l?`/thread/${l}`:"/",children:_.jsx(Pt,{path:"components.organisms.threadHistory.Thread.backToChat"})}),children:[_.jsx(Pt,{path:"components.organisms.threadHistory.Thread.chatCreatedOn"})," ",new Intl.DateTimeFormat(void 0,{day:"numeric",month:"numeric",year:"numeric",hour:"numeric",minute:"numeric"}).format(new Date(e.createdAt)),"."]})}),_.jsx(kre,{autoScroll:!0,children:_.jsx(Ure,{loading:!1,actions:h,elements:f||[],onFeedbackUpdated:u,onFeedbackDeleted:p,messages:g})})]})};function avt({threadId:e}){const t=no(),n=du(),r=yt(Zr),{clear:a,setIdToResume:i}=Uo(),{session:o,idToResume:s}=Ul();if(x.useEffect(()=>{e===s&&(o!=null&&o.socket.connected?oa.success("Chat resumed successfully"):o!=null&&o.error&&oa.error("Couldn't resume chat"))},[o,s,e]),!e||!(r!=null&&r.threadResumable))return null;const l=()=>{a(),i(e),r!=null&&r.dataPersistence||t("/")};return _.jsxs(_t,{display:"flex",flexDirection:"column",gap:1,p:2,sx:{boxSizing:"border-box",width:"100%",maxWidth:n,m:"auto",justifyContent:"center"},children:[_.jsx(Ii,{id:"resumeThread",onClick:l,variant:"contained",children:_.jsx(Pt,{path:"pages.ResumeButton.resumeChat"})}),_.jsx(rae,{})]})}function ivt(){const{id:e}=iK(),t=yt(ca),{data:n,error:r,isLoading:a}=gf(t,e?`/project/thread/${e}`:null,{revalidateOnFocus:!1}),[i,o]=xa(fv),{threadId:s}=hs(),l=s===e;return x.useEffect(()=>{(i==null?void 0:i.currentThreadId)!==e&&o(c=>({...c,currentThreadId:e}))},[e]),_.jsx(R6,{children:_.jsxs(_.Fragment,{children:[l&&_.jsx(aae,{}),!l&&_.jsxs(_t,{sx:{display:"flex",flexDirection:"column",flexGrow:1,gap:2},children:[_.jsx(_t,{sx:{width:"100%",flexGrow:1,overflow:"auto"},children:_.jsx(rvt,{thread:n,error:r,isLoading:a})}),_.jsx(avt,{threadId:e})]})]})})}const ovt=Kve([{path:"/",element:_.jsx(hSt,{})},{path:"/env",element:_.jsx(mgt,{})},{path:"/thread/:id?",element:_.jsx(ivt,{})},{path:"/element/:id",element:_.jsx(Udt,{})},{path:"/login",element:_.jsx(nvt,{})},{path:"/login/callback",element:_.jsx(tye,{})},{path:"*",element:_.jsx($I,{replace:!0,to:"/"})}]);var svt=W6,lvt=qne,cvt=g6;function uvt(e,t){var n={};return t=cvt(t),lvt(e,function(r,a,i){svt(n,a,t(r,a,i))}),n}var dvt=uvt;const pvt=Aa(dvt);function fvt(){const{chatSettingsValue:e,chatSettingsInputs:t,chatSettingsDefaultValue:n}=au(),{updateChatSettings:r}=Uo(),[a,i]=xa(Cee),o=P6({initialValues:e,enableReinitialize:!0,onSubmit:async()=>{}}),s=()=>i(!1),l=()=>{const u=pvt(o.values,p=>p!==""?p:null);r(u),s()},c=()=>{o.setValues(n)};return _.jsxs(Og,{open:a,onClose:s,id:"chat-settings-dialog",PaperProps:{sx:{backgroundImage:"none"}},children:[_.jsx(Ig,{id:"alert-dialog-title",children:_.jsx(Pt,{path:"components.organisms.chat.settings.settingsPanel"})}),_.jsx(Ng,{children:_.jsx(_t,{sx:{display:"flex",flexDirection:"column",minWidth:"20vw",maxHeight:"70vh",gap:"15px"},children:t.map(u=>_.jsx(ctt,{element:{...u,value:o.values[u.id],onChange:o.handleChange,setField:o.setFieldValue}},u.id))})}),_.jsxs(my,{sx:{p:2},children:[_.jsx(oS,{onClick:c,color:"primary",variant:"outlined",children:_.jsx(Pt,{path:"components.organisms.chat.settings.reset"})}),_.jsx("div",{style:{flex:"1 0 0"}}),_.jsx(rne,{onClick:s,children:_.jsx(Pt,{path:"components.organisms.chat.settings.cancel"})}),_.jsx(oS,{id:"confirm",variant:"outlined",onClick:l,autoFocus:!0,children:_.jsx(Pt,{path:"components.organisms.chat.settings.confirm"})})]})]})}function mvt(e){var r,a,i,o,s,l;const t=e.palette.mode,n=(r=window==null?void 0:window.theme)==null?void 0:r[t];return n!=null&&n.background&&(e.palette.background.default=n.background),n!=null&&n.paper&&(e.palette.background.paper=n.paper),(a=n==null?void 0:n.primary)!=null&&a.main&&(e.palette.primary.main=n.primary.main),(i=n==null?void 0:n.primary)!=null&&i.dark&&(e.palette.primary.dark=n.primary.dark),(o=n==null?void 0:n.primary)!=null&&o.light&&(e.palette.primary.light=n.primary.light),(s=n==null?void 0:n.text)!=null&&s.primary&&(e.palette.text.primary=n.text.primary),(l=n==null?void 0:n.text)!=null&&l.secondary&&(e.palette.text.secondary=n.text.secondary),e}function hvt(){var h;const{theme:e}=yt(Wl),t=yt(Zr),n=(h=window.theme)==null?void 0:h.font_family,r=mvt(kXe(e,n)),{isAuthenticated:a,accessToken:i}=gs(),o=yt(C6),{connect:s,chatProfile:l,setChatProfile:c}=Ul(),u=yt(ca),p=!!t,f=p?t.chatProfiles.length?!!l:!0:!1;if(x.useEffect(()=>{if(a)if(f)s({client:u,userEnv:o,accessToken:i});else return;else return},[o,i,a,s,f]),p&&t.chatProfiles.length&&!l){const g=t.chatProfiles.find(E=>E.default);c(g?g.name:t.chatProfiles[0].name)}return _.jsxs(Y2e,{theme:r,children:[_.jsx(cQ,{styles:{body:{backgroundColor:r.palette.background.default}}}),_.jsx(DSe,{className:"toast",position:"top-right",toastOptions:{style:{fontFamily:r.typography.fontFamily,background:r.palette.background.paper,border:`1px solid ${r.palette.divider}`,color:r.palette.text.primary}}}),_.jsxs(_t,{display:"flex",height:"100vh",maxHeight:"-webkit-fill-available",width:"100vw",sx:{overflowX:"hidden"},children:[_.jsx(fvt,{}),_.jsx(zve,{router:ovt})]})]})}function gvt(){const e=yt(ca),[t,n]=xa(Zr),r=Tn(Wl),{isAuthenticated:a,isReady:i}=gs(),{i18n:o}=Yy(),s=navigator.language||"en-US";function l(p){o.addResourceBundle(s,"translation",p),o.changeLanguage(s)}const{data:c}=gf(e,t===void 0&&a?`/project/settings?language=${s}`:null),{data:u}=gf(e,`/project/translations?language=${s}`);return i&&!a&&window.location.pathname!=="/login"&&window.location.pathname!=="/login/callback"&&(window.location.href="/login"),x.useEffect(()=>{c&&(n(c),r(p=>({...p,defaultCollapseContent:c.ui.default_collapse_content??!0})))},[c,n,r]),x.useEffect(()=>{u&&l(u.translation)},[u]),i?_.jsx(hvt,{}):null}var E3={},xV=Bf;E3.createRoot=xV.createRoot,E3.hydrateRoot=xV.hydrateRoot;const _vt={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console&&console[e]&&console[e].apply(console,t)}};class SS{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(t,n)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=t||_vt,this.options=n,this.debug=n.debug}log(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"log","",!0)}warn(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"warn","",!0)}error(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"error","")}deprecate(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,r,a){return a&&!this.debug?null:(typeof t[0]=="string"&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new SS(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new SS(this.logger,t)}}var Ms=new SS;class dT{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(r=>{this.observers[r]=this.observers[r]||[],this.observers[r].push(n)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t]=this.observers[t].filter(r=>r!==n)}}emit(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];this.observers[t]&&[].concat(this.observers[t]).forEach(o=>{o(...r)}),this.observers["*"]&&[].concat(this.observers["*"]).forEach(o=>{o.apply(o,[t,...r])})}}function xm(){let e,t;const n=new Promise((r,a)=>{e=r,t=a});return n.resolve=e,n.reject=t,n}function AV(e){return e==null?"":""+e}function Evt(e,t,n){e.forEach(r=>{t[r]&&(n[r]=t[r])})}function oL(e,t,n){function r(o){return o&&o.indexOf("###")>-1?o.replace(/###/g,"."):o}function a(){return!e||typeof e=="string"}const i=typeof t!="string"?[].concat(t):t.split(".");for(;i.length>1;){if(a())return{};const o=r(i.shift());!e[o]&&n&&(e[o]=new n),Object.prototype.hasOwnProperty.call(e,o)?e=e[o]:e={}}return a()?{}:{obj:e,k:r(i.shift())}}function OV(e,t,n){const{obj:r,k:a}=oL(e,t,Object);r[a]=n}function bvt(e,t,n,r){const{obj:a,k:i}=oL(e,t,Object);a[i]=a[i]||[],r&&(a[i]=a[i].concat(n)),r||a[i].push(n)}function vS(e,t){const{obj:n,k:r}=oL(e,t);if(n)return n[r]}function Svt(e,t,n){const r=vS(e,n);return r!==void 0?r:vS(t,n)}function fae(e,t,n){for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?typeof e[r]=="string"||e[r]instanceof String||typeof t[r]=="string"||t[r]instanceof String?n&&(e[r]=t[r]):fae(e[r],t[r],n):e[r]=t[r]);return e}function dp(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var vvt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function yvt(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,t=>vvt[t]):e}const Tvt=[" ",",","?","!",";"];function Cvt(e,t,n){t=t||"",n=n||"";const r=Tvt.filter(o=>t.indexOf(o)<0&&n.indexOf(o)<0);if(r.length===0)return!0;const a=new RegExp(`(${r.map(o=>o==="?"?"\\?":o).join("|")})`);let i=!a.test(e);if(!i){const o=e.indexOf(n);o>0&&!a.test(e.substring(0,o))&&(i=!0)}return i}function yS(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!e)return;if(e[t])return e[t];const r=t.split(n);let a=e;for(let i=0;i<r.length;++i){if(!a||typeof a[r[i]]=="string"&&i+1<r.length)return;if(a[r[i]]===void 0){let o=2,s=r.slice(i,i+o).join(n),l=a[s];for(;l===void 0&&r.length>i+o;)o++,s=r.slice(i,i+o).join(n),l=a[s];if(l===void 0)return;if(l===null)return null;if(t.endsWith(s)){if(typeof l=="string")return l;if(s&&typeof l[s]=="string")return l[s]}const c=r.slice(i+o).join(n);return c?yS(l,c,n):void 0}a=a[r[i]]}return a}function TS(e){return e&&e.indexOf("_")>0?e.replace("_","-"):e}class NV extends dT{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r){let a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const i=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,o=a.ignoreJSONStructure!==void 0?a.ignoreJSONStructure:this.options.ignoreJSONStructure;let s=[t,n];r&&typeof r!="string"&&(s=s.concat(r)),r&&typeof r=="string"&&(s=s.concat(i?r.split(i):r)),t.indexOf(".")>-1&&(s=t.split("."));const l=vS(this.data,s);return l||!o||typeof r!="string"?l:yS(this.data&&this.data[t]&&this.data[t][n],r,i)}addResource(t,n,r,a){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator;let s=[t,n];r&&(s=s.concat(o?r.split(o):r)),t.indexOf(".")>-1&&(s=t.split("."),a=n,n=s[1]),this.addNamespaces(n),OV(this.data,s,a),i.silent||this.emit("added",t,n,r,a)}addResources(t,n,r){let a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const i in r)(typeof r[i]=="string"||Object.prototype.toString.apply(r[i])==="[object Array]")&&this.addResource(t,n,i,r[i],{silent:!0});a.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,a,i){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},s=[t,n];t.indexOf(".")>-1&&(s=t.split("."),a=r,r=n,n=s[1]),this.addNamespaces(n);let l=vS(this.data,s)||{};a?fae(l,r,i):l={...l,...r},OV(this.data,s,l),o.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(t,n)}:this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(a=>n[a]&&Object.keys(n[a]).length>0)}toJSON(){return this.data}}var mae={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,a){return e.forEach(i=>{this.processors[i]&&(t=this.processors[i].process(t,n,r,a))}),t}};const IV={};class CS extends dT{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),Evt(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Ms.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(t==null)return!1;const r=this.resolve(t,n);return r&&r.res!==void 0}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const a=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let i=n.ns||this.options.defaultNS||[];const o=r&&t.indexOf(r)>-1,s=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!Cvt(t,r,a);if(o&&!s){const l=t.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:t,namespaces:i};const c=t.split(r);(r!==a||r===a&&this.options.ns.indexOf(c[0])>-1)&&(i=c.shift()),t=c.join(a)}return typeof i=="string"&&(i=[i]),{key:t,namespaces:i}}translate(t,n,r){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const a=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,i=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:o,namespaces:s}=this.extractFromKey(t[t.length-1],n),l=s[s.length-1],c=n.lng||this.language,u=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(c&&c.toLowerCase()==="cimode"){if(u){const T=n.nsSeparator||this.options.nsSeparator;return a?{res:`${l}${T}${o}`,usedKey:o,exactUsedKey:o,usedLng:c,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:`${l}${T}${o}`}return a?{res:o,usedKey:o,exactUsedKey:o,usedLng:c,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:o}const p=this.resolve(t,n);let f=p&&p.res;const h=p&&p.usedKey||o,g=p&&p.exactUsedKey||o,E=Object.prototype.toString.apply(f),y=["[object Number]","[object Function]","[object RegExp]"],b=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,v=!this.i18nFormat||this.i18nFormat.handleAsObject;if(v&&f&&(typeof f!="string"&&typeof f!="boolean"&&typeof f!="number")&&y.indexOf(E)<0&&!(typeof b=="string"&&E==="[object Array]")){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const T=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,f,{...n,ns:s}):`key '${o} (${this.language})' returned an object instead of string.`;return a?(p.res=T,p.usedParams=this.getUsedParamsDetails(n),p):T}if(i){const T=E==="[object Array]",N=T?[]:{},A=T?g:h;for(const O in f)if(Object.prototype.hasOwnProperty.call(f,O)){const M=`${A}${i}${O}`;N[O]=this.translate(M,{...n,joinArrays:!1,ns:s}),N[O]===M&&(N[O]=f[O])}f=N}}else if(v&&typeof b=="string"&&E==="[object Array]")f=f.join(b),f&&(f=this.extendTranslation(f,t,n,r));else{let T=!1,N=!1;const A=n.count!==void 0&&typeof n.count!="string",O=CS.hasDefaultValue(n),M=A?this.pluralResolver.getSuffix(c,n.count,n):"",P=n.ordinal&&A?this.pluralResolver.getSuffix(c,n.count,{ordinal:!1}):"",D=n[`defaultValue${M}`]||n[`defaultValue${P}`]||n.defaultValue;!this.isValidLookup(f)&&O&&(T=!0,f=D),this.isValidLookup(f)||(N=!0,f=o);const V=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&N?void 0:f,Z=O&&D!==f&&this.options.updateMissing;if(N||T||Z){if(this.logger.log(Z?"updateKey":"missingKey",c,l,o,Z?D:f),i){const q=this.resolve(o,{...n,keySeparator:!1});q&&q.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let W=[];const ae=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&ae&&ae[0])for(let q=0;q<ae.length;q++)W.push(ae[q]);else this.options.saveMissingTo==="all"?W=this.languageUtils.toResolveHierarchy(n.lng||this.language):W.push(n.lng||this.language);const he=(q,G,H)=>{const k=O&&H!==f?H:V;this.options.missingKeyHandler?this.options.missingKeyHandler(q,l,G,k,Z,n):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(q,l,G,k,Z,n),this.emit("missingKey",q,l,G,f)};this.options.saveMissing&&(this.options.saveMissingPlurals&&A?W.forEach(q=>{this.pluralResolver.getSuffixes(q,n).forEach(G=>{he([q],o+G,n[`defaultValue${G}`]||D)})}):he(W,o,D))}f=this.extendTranslation(f,t,n,p,r),N&&f===o&&this.options.appendNamespaceToMissingKey&&(f=`${l}:${o}`),(N||T)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?f=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}:${o}`:o,T?f:void 0):f=this.options.parseMissingKeyHandler(f))}return a?(p.res=f,p.usedParams=this.getUsedParamsDetails(n),p):f}extendTranslation(t,n,r,a,i){var o=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||a.usedLng,a.usedNS,a.usedKey,{resolved:a});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const c=typeof t=="string"&&(r&&r.interpolation&&r.interpolation.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let u;if(c){const f=t.match(this.interpolator.nestingRegexp);u=f&&f.length}let p=r.replace&&typeof r.replace!="string"?r.replace:r;if(this.options.interpolation.defaultVariables&&(p={...this.options.interpolation.defaultVariables,...p}),t=this.interpolator.interpolate(t,p,r.lng||this.language,r),c){const f=t.match(this.interpolator.nestingRegexp),h=f&&f.length;u<h&&(r.nest=!1)}!r.lng&&this.options.compatibilityAPI!=="v1"&&a&&a.res&&(r.lng=a.usedLng),r.nest!==!1&&(t=this.interpolator.nest(t,function(){for(var f=arguments.length,h=new Array(f),g=0;g<f;g++)h[g]=arguments[g];return i&&i[0]===h[0]&&!r.context?(o.logger.warn(`It seems you are nesting recursively key: ${h[0]} in key: ${n[0]}`),null):o.translate(...h,n)},r)),r.interpolation&&this.interpolator.reset()}const s=r.postProcess||this.options.postProcess,l=typeof s=="string"?[s]:s;return t!=null&&l&&l.length&&r.applyPostProcessor!==!1&&(t=mae.handle(l,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...a,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),t}resolve(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r,a,i,o,s;return typeof t=="string"&&(t=[t]),t.forEach(l=>{if(this.isValidLookup(r))return;const c=this.extractFromKey(l,n),u=c.key;a=u;let p=c.namespaces;this.options.fallbackNS&&(p=p.concat(this.options.fallbackNS));const f=n.count!==void 0&&typeof n.count!="string",h=f&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),g=n.context!==void 0&&(typeof n.context=="string"||typeof n.context=="number")&&n.context!=="",E=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);p.forEach(y=>{this.isValidLookup(r)||(s=y,!IV[`${E[0]}-${y}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(s)&&(IV[`${E[0]}-${y}`]=!0,this.logger.warn(`key "${a}" for languages "${E.join(", ")}" won't get resolved as namespace "${s}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),E.forEach(b=>{if(this.isValidLookup(r))return;o=b;const v=[u];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(v,u,b,y,n);else{let T;f&&(T=this.pluralResolver.getSuffix(b,n.count,n));const N=`${this.options.pluralSeparator}zero`,A=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(f&&(v.push(u+T),n.ordinal&&T.indexOf(A)===0&&v.push(u+T.replace(A,this.options.pluralSeparator)),h&&v.push(u+N)),g){const O=`${u}${this.options.contextSeparator}${n.context}`;v.push(O),f&&(v.push(O+T),n.ordinal&&T.indexOf(A)===0&&v.push(O+T.replace(A,this.options.pluralSeparator)),h&&v.push(O+N))}}let C;for(;C=v.pop();)this.isValidLookup(r)||(i=C,r=this.getResource(b,y,C,n))}))})}),{res:r,usedKey:a,exactUsedKey:i,usedLng:o,usedNS:s}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r){let a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,n,r,a):this.resourceStore.getResource(t,n,r,a)}getUsedParamsDetails(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&typeof t.replace!="string";let a=r?t.replace:t;if(r&&typeof t.count<"u"&&(a.count=t.count),this.options.interpolation.defaultVariables&&(a={...this.options.interpolation.defaultVariables,...a}),!r){a={...a};for(const i of n)delete a[i]}return a}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}function bN(e){return e.charAt(0).toUpperCase()+e.slice(1)}class wV{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Ms.create("languageUtils")}getScriptPartFromCode(t){if(t=TS(t),!t||t.indexOf("-")<0)return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=TS(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(typeof t=="string"&&t.indexOf("-")>-1){const n=["hans","hant","latn","cyrl","cans","mong","arab"];let r=t.split("-");return this.options.lowerCaseLng?r=r.map(a=>a.toLowerCase()):r.length===2?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=bN(r[1].toLowerCase()))):r.length===3&&(r[0]=r[0].toLowerCase(),r[1].length===2&&(r[1]=r[1].toUpperCase()),r[0]!=="sgn"&&r[2].length===2&&(r[2]=r[2].toUpperCase()),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=bN(r[1].toLowerCase())),n.indexOf(r[2].toLowerCase())>-1&&(r[2]=bN(r[2].toLowerCase()))),r.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const a=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(a))&&(n=a)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const a=this.getLanguagePartFromCode(r);if(this.isSupportedCode(a))return n=a;n=this.options.supportedLngs.find(i=>{if(i===a)return i;if(!(i.indexOf("-")<0&&a.indexOf("-")<0)&&i.indexOf(a)===0)return i})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),typeof t=="string"&&(t=[t]),Object.prototype.toString.apply(t)==="[object Array]")return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes(n||this.options.fallbackLng||[],t),a=[],i=o=>{o&&(this.isSupportedCode(o)?a.push(o):this.logger.warn(`rejecting language code not found in supportedLngs: ${o}`))};return typeof t=="string"&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&i(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&i(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&i(this.getLanguagePartFromCode(t))):typeof t=="string"&&i(this.formatLanguageCode(t)),r.forEach(o=>{a.indexOf(o)<0&&i(this.formatLanguageCode(o))}),a}}let Rvt=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],xvt={1:function(e){return+(e>1)},2:function(e){return+(e!=1)},3:function(e){return 0},4:function(e){return e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2},5:function(e){return e==0?0:e==1?1:e==2?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},6:function(e){return e==1?0:e>=2&&e<=4?1:2},7:function(e){return e==1?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2},8:function(e){return e==1?0:e==2?1:e!=8&&e!=11?2:3},9:function(e){return+(e>=2)},10:function(e){return e==1?0:e==2?1:e<7?2:e<11?3:4},11:function(e){return e==1||e==11?0:e==2||e==12?1:e>2&&e<20?2:3},12:function(e){return+(e%10!=1||e%100==11)},13:function(e){return+(e!==0)},14:function(e){return e==1?0:e==2?1:e==3?2:3},15:function(e){return e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2},16:function(e){return e%10==1&&e%100!=11?0:e!==0?1:2},17:function(e){return e==1||e%10==1&&e%100!=11?0:1},18:function(e){return e==0?0:e==1?1:2},19:function(e){return e==1?0:e==0||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3},20:function(e){return e==1?0:e==0||e%100>0&&e%100<20?1:2},21:function(e){return e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0},22:function(e){return e==1?0:e==2?1:(e<0||e>10)&&e%10==0?2:3}};const Avt=["v1","v2","v3"],Ovt=["v4"],DV={zero:0,one:1,two:2,few:3,many:4,other:5};function Nvt(){const e={};return Rvt.forEach(t=>{t.lngs.forEach(n=>{e[n]={numbers:t.nr,plurals:xvt[t.fc]}})}),e}class Ivt{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=n,this.logger=Ms.create("pluralResolver"),(!this.options.compatibilityJSON||Ovt.includes(this.options.compatibilityJSON))&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=Nvt()}addRule(t,n){this.rules[t]=n}getRule(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(TS(t),{type:n.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}needsPlural(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(t,n);return this.shouldUseIntlApi()?r&&r.resolvedOptions().pluralCategories.length>1:r&&r.numbers.length>1}getPluralFormsOfKey(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,r).map(a=>`${n}${a}`)}getSuffixes(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(t,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((a,i)=>DV[a]-DV[i]).map(a=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${a}`):r.numbers.map(a=>this.getSuffix(t,a,n)):[]}getSuffix(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const a=this.getRule(t,r);return a?this.shouldUseIntlApi()?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${a.select(n)}`:this.getSuffixRetroCompatible(a,n):(this.logger.warn(`no plural rule found for: ${t}`),"")}getSuffixRetroCompatible(t,n){const r=t.noAbs?t.plurals(n):t.plurals(Math.abs(n));let a=t.numbers[r];this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1&&(a===2?a="plural":a===1&&(a=""));const i=()=>this.options.prepend&&a.toString()?this.options.prepend+a.toString():a.toString();return this.options.compatibilityJSON==="v1"?a===1?"":typeof a=="number"?`_plural_${a.toString()}`:i():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1?i():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}shouldUseIntlApi(){return!Avt.includes(this.options.compatibilityJSON)}}function LV(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=Svt(e,t,n);return!i&&a&&typeof n=="string"&&(i=yS(e,n,r),i===void 0&&(i=yS(t,n,r))),i}class wvt{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Ms.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||(n=>n),this.init(t)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const n=t.interpolation;this.escape=n.escape!==void 0?n.escape:yvt,this.escapeValue=n.escapeValue!==void 0?n.escapeValue:!0,this.useRawValueToEscape=n.useRawValueToEscape!==void 0?n.useRawValueToEscape:!1,this.prefix=n.prefix?dp(n.prefix):n.prefixEscaped||"{{",this.suffix=n.suffix?dp(n.suffix):n.suffixEscaped||"}}",this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||",",this.unescapePrefix=n.unescapeSuffix?"":n.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":n.unescapeSuffix||"",this.nestingPrefix=n.nestingPrefix?dp(n.nestingPrefix):n.nestingPrefixEscaped||dp("$t("),this.nestingSuffix=n.nestingSuffix?dp(n.nestingSuffix):n.nestingSuffixEscaped||dp(")"),this.nestingOptionsSeparator=n.nestingOptionsSeparator?n.nestingOptionsSeparator:n.nestingOptionsSeparator||",",this.maxReplaces=n.maxReplaces?n.maxReplaces:1e3,this.alwaysFormat=n.alwaysFormat!==void 0?n.alwaysFormat:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=`${this.prefix}(.+?)${this.suffix}`;this.regexp=new RegExp(t,"g");const n=`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`;this.regexpUnescape=new RegExp(n,"g");const r=`${this.nestingPrefix}(.+?)${this.nestingSuffix}`;this.nestingRegexp=new RegExp(r,"g")}interpolate(t,n,r,a){let i,o,s;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function c(g){return g.replace(/\$/g,"$$$$")}const u=g=>{if(g.indexOf(this.formatSeparator)<0){const v=LV(n,l,g,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(v,void 0,r,{...a,...n,interpolationkey:g}):v}const E=g.split(this.formatSeparator),y=E.shift().trim(),b=E.join(this.formatSeparator).trim();return this.format(LV(n,l,y,this.options.keySeparator,this.options.ignoreJSONStructure),b,r,{...a,...n,interpolationkey:y})};this.resetRegExp();const p=a&&a.missingInterpolationHandler||this.options.missingInterpolationHandler,f=a&&a.interpolation&&a.interpolation.skipOnVariables!==void 0?a.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:g=>c(g)},{regex:this.regexp,safeValue:g=>this.escapeValue?c(this.escape(g)):c(g)}].forEach(g=>{for(s=0;i=g.regex.exec(t);){const E=i[1].trim();if(o=u(E),o===void 0)if(typeof p=="function"){const b=p(t,i,a);o=typeof b=="string"?b:""}else if(a&&Object.prototype.hasOwnProperty.call(a,E))o="";else if(f){o=i[0];continue}else this.logger.warn(`missed to pass in variable ${E} for interpolating ${t}`),o="";else typeof o!="string"&&!this.useRawValueToEscape&&(o=AV(o));const y=g.safeValue(o);if(t=t.replace(i[0],y),f?(g.regex.lastIndex+=o.length,g.regex.lastIndex-=i[0].length):g.regex.lastIndex=0,s++,s>=this.maxReplaces)break}}),t}nest(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a,i,o;function s(l,c){const u=this.nestingOptionsSeparator;if(l.indexOf(u)<0)return l;const p=l.split(new RegExp(`${u}[ ]*{`));let f=`{${p[1]}`;l=p[0],f=this.interpolate(f,o);const h=f.match(/'/g),g=f.match(/"/g);(h&&h.length%2===0&&!g||g.length%2!==0)&&(f=f.replace(/'/g,'"'));try{o=JSON.parse(f),c&&(o={...c,...o})}catch(E){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,E),`${l}${u}${f}`}return delete o.defaultValue,l}for(;a=this.nestingRegexp.exec(t);){let l=[];o={...r},o=o.replace&&typeof o.replace!="string"?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;let c=!1;if(a[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(a[1])){const u=a[1].split(this.formatSeparator).map(p=>p.trim());a[1]=u.shift(),l=u,c=!0}if(i=n(s.call(this,a[1].trim(),o),o),i&&a[0]===t&&typeof i!="string")return i;typeof i!="string"&&(i=AV(i)),i||(this.logger.warn(`missed to resolve ${a[1]} for nesting ${t}`),i=""),c&&(i=l.reduce((u,p)=>this.format(u,p,r.lng,{...r,interpolationkey:a[1].trim()}),i.trim())),t=t.replace(a[0],i),this.regexp.lastIndex=0}return t}}function Dvt(e){let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const a=r[1].substring(0,r[1].length-1);t==="currency"&&a.indexOf(":")<0?n.currency||(n.currency=a.trim()):t==="relativetime"&&a.indexOf(":")<0?n.range||(n.range=a.trim()):a.split(";").forEach(o=>{if(!o)return;const[s,...l]=o.split(":"),c=l.join(":").trim().replace(/^'+|'+$/g,"");n[s.trim()]||(n[s.trim()]=c),c==="false"&&(n[s.trim()]=!1),c==="true"&&(n[s.trim()]=!0),isNaN(c)||(n[s.trim()]=parseInt(c,10))})}return{formatName:t,formatOptions:n}}function pp(e){const t={};return function(r,a,i){const o=a+JSON.stringify(i);let s=t[o];return s||(s=e(TS(a),i),t[o]=s),s(r)}}class Lvt{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Ms.create("formatter"),this.options=t,this.formats={number:pp((n,r)=>{const a=new Intl.NumberFormat(n,{...r});return i=>a.format(i)}),currency:pp((n,r)=>{const a=new Intl.NumberFormat(n,{...r,style:"currency"});return i=>a.format(i)}),datetime:pp((n,r)=>{const a=new Intl.DateTimeFormat(n,{...r});return i=>a.format(i)}),relativetime:pp((n,r)=>{const a=new Intl.RelativeTimeFormat(n,{...r});return i=>a.format(i,r.range||"day")}),list:pp((n,r)=>{const a=new Intl.ListFormat(n,{...r});return i=>a.format(i)})},this.init(t)}init(t){const r=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||","}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=pp(n)}format(t,n,r){let a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return n.split(this.formatSeparator).reduce((s,l)=>{const{formatName:c,formatOptions:u}=Dvt(l);if(this.formats[c]){let p=s;try{const f=a&&a.formatParams&&a.formatParams[a.interpolationkey]||{},h=f.locale||f.lng||a.locale||a.lng||r;p=this.formats[c](s,h,{...u,...a,...f})}catch(f){this.logger.warn(f)}return p}else this.logger.warn(`there was no format function for ${c}`);return s},t)}}function Mvt(e,t){e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)}class kvt extends dT{constructor(t,n,r){let a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=a,this.logger=Ms.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=a.maxParallelReads||10,this.readingCalls=0,this.maxRetries=a.maxRetries>=0?a.maxRetries:5,this.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(r,a.backend,a)}queueLoad(t,n,r,a){const i={},o={},s={},l={};return t.forEach(c=>{let u=!0;n.forEach(p=>{const f=`${c}|${p}`;!r.reload&&this.store.hasResourceBundle(c,p)?this.state[f]=2:this.state[f]<0||(this.state[f]===1?o[f]===void 0&&(o[f]=!0):(this.state[f]=1,u=!1,o[f]===void 0&&(o[f]=!0),i[f]===void 0&&(i[f]=!0),l[p]===void 0&&(l[p]=!0)))}),u||(s[c]=!0)}),(Object.keys(i).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:a}),{toLoad:Object.keys(i),pending:Object.keys(o),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(l)}}loaded(t,n,r){const a=t.split("|"),i=a[0],o=a[1];n&&this.emit("failedLoading",i,o,n),r&&this.store.addResourceBundle(i,o,r),this.state[t]=n?-1:2;const s={};this.queue.forEach(l=>{bvt(l.loaded,[i],o),Mvt(l,t),n&&l.errors.push(n),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(c=>{s[c]||(s[c]={});const u=l.loaded[c];u.length&&u.forEach(p=>{s[c][p]===void 0&&(s[c][p]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",s),this.queue=this.queue.filter(l=>!l.done)}read(t,n,r){let a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,o=arguments.length>5?arguments[5]:void 0;if(!t.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:a,wait:i,callback:o});return}this.readingCalls++;const s=(c,u)=>{if(this.readingCalls--,this.waitingReads.length>0){const p=this.waitingReads.shift();this.read(p.lng,p.ns,p.fcName,p.tried,p.wait,p.callback)}if(c&&u&&a<this.maxRetries){setTimeout(()=>{this.read.call(this,t,n,r,a+1,i*2,o)},i);return}o(c,u)},l=this.backend[r].bind(this.backend);if(l.length===2){try{const c=l(t,n);c&&typeof c.then=="function"?c.then(u=>s(null,u)).catch(s):s(null,c)}catch(c){s(c)}return}return l(t,n,s)}prepareLoading(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),a&&a();typeof t=="string"&&(t=this.languageUtils.toResolveHierarchy(t)),typeof n=="string"&&(n=[n]);const i=this.queueLoad(t,n,r,a);if(!i.toLoad.length)return i.pending.length||a(),null;i.toLoad.forEach(o=>{this.loadOne(o)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=t.split("|"),a=r[0],i=r[1];this.read(a,i,"read",void 0,void 0,(o,s)=>{o&&this.logger.warn(`${n}loading namespace ${i} for language ${a} failed`,o),!o&&s&&this.logger.log(`${n}loaded namespace ${i} for language ${a}`,s),this.loaded(t,o,s)})}saveMissing(t,n,r,a,i){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},s=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if(this.backend&&this.backend.create){const l={...o,isUpdate:i},c=this.backend.create.bind(this.backend);if(c.length<6)try{let u;c.length===5?u=c(t,n,r,a,l):u=c(t,n,r,a),u&&typeof u.then=="function"?u.then(p=>s(null,p)).catch(s):s(null,u)}catch(u){s(u)}else c(t,n,r,a,s,l)}!t||!t[0]||this.store.addResource(t[0],n,r,a)}}}function MV(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){let n={};if(typeof t[1]=="object"&&(n=t[1]),typeof t[1]=="string"&&(n.defaultValue=t[1]),typeof t[2]=="string"&&(n.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const r=t[3]||t[2];Object.keys(r).forEach(a=>{n[a]=r[a]})}return n},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function kV(e){return typeof e.ns=="string"&&(e.ns=[e.ns]),typeof e.fallbackLng=="string"&&(e.fallbackLng=[e.fallbackLng]),typeof e.fallbackNS=="string"&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function yE(){}function Pvt(e){Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})}class sg extends dT{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=kV(t),this.services={},this.logger=Ms,this.modules={external:[]},Pvt(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initImmediate)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(){var t=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;typeof n=="function"&&(r=n,n={}),!n.defaultNS&&n.defaultNS!==!1&&n.ns&&(typeof n.ns=="string"?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const a=MV();this.options={...a,...this.options,...kV(n)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...a.interpolation,...this.options.interpolation}),n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);function i(u){return u?typeof u=="function"?new u:u:null}if(!this.options.isClone){this.modules.logger?Ms.init(i(this.modules.logger),this.options):Ms.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:typeof Intl<"u"&&(u=Lvt);const p=new wV(this.options);this.store=new NV(this.options.resources,this.options);const f=this.services;f.logger=Ms,f.resourceStore=this.store,f.languageUtils=p,f.pluralResolver=new Ivt(p,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),u&&(!this.options.interpolation.format||this.options.interpolation.format===a.interpolation.format)&&(f.formatter=i(u),f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new wvt(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new kvt(i(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",function(h){for(var g=arguments.length,E=new Array(g>1?g-1:0),y=1;y<g;y++)E[y-1]=arguments[y];t.emit(h,...E)}),this.modules.languageDetector&&(f.languageDetector=i(this.modules.languageDetector),f.languageDetector.init&&f.languageDetector.init(f,this.options.detection,this.options)),this.modules.i18nFormat&&(f.i18nFormat=i(this.modules.i18nFormat),f.i18nFormat.init&&f.i18nFormat.init(this)),this.translator=new CS(this.services,this.options),this.translator.on("*",function(h){for(var g=arguments.length,E=new Array(g>1?g-1:0),y=1;y<g;y++)E[y-1]=arguments[y];t.emit(h,...E)}),this.modules.external.forEach(h=>{h.init&&h.init(this)})}if(this.format=this.options.interpolation.format,r||(r=yE),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.length>0&&u[0]!=="dev"&&(this.options.lng=u[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(u=>{this[u]=function(){return t.store[u](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(u=>{this[u]=function(){return t.store[u](...arguments),t}});const l=xm(),c=()=>{const u=(p,f)=>{this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),l.resolve(f),r(p,f)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return u(null,this.t.bind(this));this.changeLanguage(this.options.lng,u)};return this.options.resources||!this.options.initImmediate?c():setTimeout(c,0),l}loadResources(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:yE;const a=typeof t=="string"?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(a&&a.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const i=[],o=s=>{if(!s||s==="cimode")return;this.services.languageUtils.toResolveHierarchy(s).forEach(c=>{c!=="cimode"&&i.indexOf(c)<0&&i.push(c)})};a?o(a):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(l=>o(l)),this.options.preload&&this.options.preload.forEach(s=>o(s)),this.services.backendConnector.load(i,this.options.ns,s=>{!s&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(s)})}else r(null)}reloadResources(t,n,r){const a=xm();return t||(t=this.languages),n||(n=this.options.ns),r||(r=yE),this.services.backendConnector.reload(t,n,i=>{a.resolve(),r(i)}),a}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&mae.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1))for(let n=0;n<this.languages.length;n++){const r=this.languages[n];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}changeLanguage(t,n){var r=this;this.isLanguageChangingTo=t;const a=xm();this.emit("languageChanging",t);const i=l=>{this.language=l,this.languages=this.services.languageUtils.toResolveHierarchy(l),this.resolvedLanguage=void 0,this.setResolvedLanguage(l)},o=(l,c)=>{c?(i(c),this.translator.changeLanguage(c),this.isLanguageChangingTo=void 0,this.emit("languageChanged",c),this.logger.log("languageChanged",c)):this.isLanguageChangingTo=void 0,a.resolve(function(){return r.t(...arguments)}),n&&n(l,function(){return r.t(...arguments)})},s=l=>{!t&&!l&&this.services.languageDetector&&(l=[]);const c=typeof l=="string"?l:this.services.languageUtils.getBestMatchFromCodes(l);c&&(this.language||i(c),this.translator.language||this.translator.changeLanguage(c),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(c)),this.loadResources(c,u=>{o(u,c)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?s(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(s):this.services.languageDetector.detect(s):s(t),a}getFixedT(t,n,r){var a=this;const i=function(o,s){let l;if(typeof s!="object"){for(var c=arguments.length,u=new Array(c>2?c-2:0),p=2;p<c;p++)u[p-2]=arguments[p];l=a.options.overloadTranslationOptionHandler([o,s].concat(u))}else l={...s};l.lng=l.lng||i.lng,l.lngs=l.lngs||i.lngs,l.ns=l.ns||i.ns,l.keyPrefix=l.keyPrefix||r||i.keyPrefix;const f=a.options.keySeparator||".";let h;return l.keyPrefix&&Array.isArray(o)?h=o.map(g=>`${l.keyPrefix}${f}${g}`):h=l.keyPrefix?`${l.keyPrefix}${f}${o}`:o,a.t(h,l)};return typeof t=="string"?i.lng=t:i.lngs=t,i.ns=n,i.keyPrefix=r,i}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],a=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const o=(s,l)=>{const c=this.services.backendConnector.state[`${s}|${l}`];return c===-1||c===2};if(n.precheck){const s=n.precheck(this,o);if(s!==void 0)return s}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(r,t)&&(!a||o(i,t)))}loadNamespaces(t,n){const r=xm();return this.options.ns?(typeof t=="string"&&(t=[t]),t.forEach(a=>{this.options.ns.indexOf(a)<0&&this.options.ns.push(a)}),this.loadResources(a=>{r.resolve(),n&&n(a)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=xm();typeof t=="string"&&(t=[t]);const a=this.options.preload||[],i=t.filter(o=>a.indexOf(o)<0);return i.length?(this.options.preload=a.concat(i),this.loadResources(o=>{r.resolve(),n&&n(o)}),r):(n&&n(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!t)return"rtl";const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=this.services&&this.services.languageUtils||new wV(MV());return n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new sg(t,n)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:yE;const r=t.forkResourceStore;r&&delete t.forkResourceStore;const a={...this.options,...t,isClone:!0},i=new sg(a);return(t.debug!==void 0||t.prefix!==void 0)&&(i.logger=i.logger.clone(t)),["store","services","language"].forEach(s=>{i[s]=this[s]}),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},r&&(i.store=new NV(this.store.data,a),i.services.resourceStore=i.store),i.translator=new CS(i.services,a),i.translator.on("*",function(s){for(var l=arguments.length,c=new Array(l>1?l-1:0),u=1;u<l;u++)c[u-1]=arguments[u];i.emit(s,...c)}),i.init(a,n),i.translator.options=a,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const za=sg.createInstance();za.createInstance=sg.createInstance;za.createInstance;za.dir;za.init;za.loadResources;za.reloadResources;za.use;za.changeLanguage;za.getFixedT;za.t;za.exists;za.setDefaultNamespace;za.hasLoadedNamespace;za.loadNamespaces;za.loadLanguages;const Fvt={fallbackLng:"en-US",defaultNS:"translation"};function Bvt(){za.use(NXe).init(Fvt).catch(e=>console.error("[i18n] Failed to setup localization.",e))}Bvt();E3.createRoot(document.getElementById("root")).render(_.jsx(Oe.StrictMode,{children:_.jsx(yEe,{children:_.jsx(gvt,{})})}));export{ja as _,bje as a,Aa as g,Wf as p,x as r,Py as u};