totem-llm 0.3.2 → 0.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/bin/totem-llm.js +1 -1
- package/lib/launcher.js +48 -22
- package/lib/setup.js +1 -1
- package/package.json +1 -1
- package/server/.env +1 -1
- package/server/endpoints/features.js +22 -0
- package/server/index.js +4 -2
- package/server/models/mobileDevice.js +1 -1
- package/server/models/systemSettings.js +1 -1
- package/server/public/assets/{index-cf613bb3.js → index-391c1474.js} +2 -2
- package/server/public/assets/{index-e9761a1b.js → index-4ce77c64.js} +1 -1
- package/server/public/assets/{index-dcc00e8c.js → index-671239cd.js} +1 -1
- package/server/public/assets/{index-6adfbee1.js → index-a253e180.js} +1 -1
- package/server/public/assets/{index-d1d3d69a.js → index-df293c50.js} +1 -1
- package/server/public/index.js +5 -5
- package/server/utils/boot/index.js +3 -3
package/server/public/index.js
CHANGED
|
@@ -66,7 +66,7 @@ Error generating stack: `+r.message+`
|
|
|
66
66
|
* LICENSE.md file in the root directory of this source tree.
|
|
67
67
|
*
|
|
68
68
|
* @license MIT
|
|
69
|
-
*/function wr(){return wr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(e[a]=i[a])}return e},wr.apply(this,arguments)}function C1(e,t){if(e==null)return{};var i={},a=Object.keys(e),n,r;for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&(i[n]=e[n]);return i}function Q4(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Y4(e,t){return e.button===0&&(!t||t==="_self")&&!Q4(e)}function Vu(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,i)=>{let a=e[i];return t.concat(Array.isArray(a)?a.map(n=>[i,n]):[[i,a]])},[]))}function X4(e,t){let i=Vu(e);return t&&t.forEach((a,n)=>{i.has(n)||t.getAll(n).forEach(r=>{i.append(n,r)})}),i}const e6=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],t6=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"],i6="6";try{window.__reactRouterVersion=i6}catch{}function a6(e,t){return u4({basename:t==null?void 0:t.basename,future:wr({},t==null?void 0:t.future,{v7_prependBasename:!0}),history:D8({window:t==null?void 0:t.window}),hydrationData:(t==null?void 0:t.hydrationData)||n6(),routes:e,mapRouteProperties:J4,unstable_dataStrategy:t==null?void 0:t.unstable_dataStrategy,unstable_patchRoutesOnMiss:t==null?void 0:t.unstable_patchRoutesOnMiss,window:t==null?void 0:t.window}).initialize()}function n6(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=wr({},t,{errors:r6(t.errors)})),t}function r6(e){if(!e)return null;let t=Object.entries(e),i={};for(let[a,n]of t)if(n&&n.__type==="RouteErrorResponse")i[a]=new pm(n.status,n.statusText,n.data,n.internal===!0);else if(n&&n.__type==="Error"){if(n.__subType){let r=window[n.__subType];if(typeof r=="function")try{let s=new r(n.message);s.stack="",i[a]=s}catch{}}if(i[a]==null){let r=new Error(n.message);r.stack="",i[a]=r}}else i[a]=n;return i}const E1=m.createContext({isTransitioning:!1}),o6=m.createContext(new Map),s6="startTransition",Hg=x_[s6],l6="flushSync",Vg=N8[l6];function c6(e){Hg?Hg(e):e()}function qr(e){Vg?Vg(e):e()}class d6{constructor(){this.status="pending",this.promise=new Promise((t,i)=>{this.resolve=a=>{this.status==="pending"&&(this.status="resolved",t(a))},this.reject=a=>{this.status==="pending"&&(this.status="rejected",i(a))}})}}function u6(e){let{fallbackElement:t,router:i,future:a}=e,[n,r]=m.useState(i.state),[s,l]=m.useState(),[d,u]=m.useState({isTransitioning:!1}),[h,g]=m.useState(),[p,v]=m.useState(),[f,b]=m.useState(),w=m.useRef(new Map),{v7_startTransition:y}=a||{},k=m.useCallback(M=>{y?c6(M):M()},[y]),_=m.useCallback((M,T)=>{let{deletedFetchers:D,unstable_flushSync:F,unstable_viewTransitionOpts:O}=T;D.forEach(R=>w.current.delete(R)),M.fetchers.forEach((R,ce)=>{R.data!==void 0&&w.current.set(ce,R.data)});let Z=i.window==null||i.window.document==null||typeof i.window.document.startViewTransition!="function";if(!O||Z){F?qr(()=>r(M)):k(()=>r(M));return}if(F){qr(()=>{p&&(h&&h.resolve(),p.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:O.currentLocation,nextLocation:O.nextLocation})});let R=i.window.document.startViewTransition(()=>{qr(()=>r(M))});R.finished.finally(()=>{qr(()=>{g(void 0),v(void 0),l(void 0),u({isTransitioning:!1})})}),qr(()=>v(R));return}p?(h&&h.resolve(),p.skipTransition(),b({state:M,currentLocation:O.currentLocation,nextLocation:O.nextLocation})):(l(M),u({isTransitioning:!0,flushSync:!1,currentLocation:O.currentLocation,nextLocation:O.nextLocation}))},[i.window,p,h,w,k]);m.useLayoutEffect(()=>i.subscribe(_),[i,_]),m.useEffect(()=>{d.isTransitioning&&!d.flushSync&&g(new d6)},[d]),m.useEffect(()=>{if(h&&s&&i.window){let M=s,T=h.promise,D=i.window.document.startViewTransition(async()=>{k(()=>r(M)),await T});D.finished.finally(()=>{g(void 0),v(void 0),l(void 0),u({isTransitioning:!1})}),v(D)}},[k,s,h,i.window]),m.useEffect(()=>{h&&s&&n.location.key===s.location.key&&h.resolve()},[h,p,n.location,s]),m.useEffect(()=>{!d.isTransitioning&&f&&(l(f.state),u({isTransitioning:!0,flushSync:!1,currentLocation:f.currentLocation,nextLocation:f.nextLocation}),b(void 0))},[d.isTransitioning,f]),m.useEffect(()=>{},[]);let x=m.useMemo(()=>({createHref:i.createHref,encodeLocation:i.encodeLocation,go:M=>i.navigate(M),push:(M,T,D)=>i.navigate(M,{state:T,preventScrollReset:D==null?void 0:D.preventScrollReset}),replace:(M,T,D)=>i.navigate(M,{replace:!0,state:T,preventScrollReset:D==null?void 0:D.preventScrollReset})}),[i]),A=i.basename||"/",z=m.useMemo(()=>({router:i,navigator:x,static:!1,basename:A}),[i,x,A]),S=m.useMemo(()=>({v7_relativeSplatPath:i.future.v7_relativeSplatPath}),[i.future.v7_relativeSplatPath]);return m.createElement(m.Fragment,null,m.createElement(ss.Provider,{value:z},m.createElement(gm.Provider,{value:n},m.createElement(o6.Provider,{value:w.current},m.createElement(E1.Provider,{value:d},m.createElement(Z4,{basename:A,location:n.location,navigationType:n.historyAction,navigator:x,future:S},n.initialized||i.future.v7_partialHydration?m.createElement(p6,{routes:i.routes,future:i.future,state:n}):t))))),null)}const p6=m.memo(m6);function m6(e){let{routes:t,future:i,state:a}=e;return D4(t,void 0,a,i)}const h6=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",g6=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Vt=m.forwardRef(function(t,i){let{onClick:a,relative:n,reloadDocument:r,replace:s,state:l,target:d,to:u,preventScrollReset:h,unstable_viewTransition:g}=t,p=C1(t,e6),{basename:v}=m.useContext(Aa),f,b=!1;if(typeof u=="string"&&g6.test(u)&&(f=u,h6))try{let _=new URL(window.location.href),x=u.startsWith("//")?new URL(_.protocol+u):new URL(u),A=wa(x.pathname,v);x.origin===_.origin&&A!=null?u=A+x.search+x.hash:b=!0}catch{}let w=C4(u,{relative:n}),y=v6(u,{replace:s,state:l,target:d,preventScrollReset:h,relative:n,unstable_viewTransition:g});function k(_){a&&a(_),_.defaultPrevented||y(_)}return m.createElement("a",wr({},p,{href:f||w,onClick:b||r?a:k,ref:i,target:d}))}),f6=m.forwardRef(function(t,i){let{"aria-current":a="page",caseSensitive:n=!1,className:r="",end:s=!1,style:l,to:d,unstable_viewTransition:u,children:h}=t,g=C1(t,t6),p=cc(d,{relative:g.relative}),v=ta(),f=m.useContext(gm),{navigator:b,basename:w}=m.useContext(Aa),y=f!=null&&k6(p)&&u===!0,k=b.encodeLocation?b.encodeLocation(p).pathname:p.pathname,_=v.pathname,x=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;n||(_=_.toLowerCase(),x=x?x.toLowerCase():null,k=k.toLowerCase()),x&&w&&(x=wa(x,w)||x);const A=k!=="/"&&k.endsWith("/")?k.length-1:k.length;let z=_===k||!s&&_.startsWith(k)&&_.charAt(A)==="/",S=x!=null&&(x===k||!s&&x.startsWith(k)&&x.charAt(k.length)==="/"),M={isActive:z,isPending:S,isTransitioning:y},T=z?a:void 0,D;typeof r=="function"?D=r(M):D=[r,z?"active":null,S?"pending":null,y?"transitioning":null].filter(Boolean).join(" ");let F=typeof l=="function"?l(M):l;return m.createElement(Vt,wr({},g,{"aria-current":T,className:D,ref:i,style:F,to:d,unstable_viewTransition:u}),typeof h=="function"?h(M):h)});var qu;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(qu||(qu={}));var qg;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(qg||(qg={}));function b6(e){let t=m.useContext(ss);return t||ge(!1),t}function v6(e,t){let{target:i,replace:a,state:n,preventScrollReset:r,relative:s,unstable_viewTransition:l}=t===void 0?{}:t,d=ia(),u=ta(),h=cc(e,{relative:s});return m.useCallback(g=>{if(Y4(g,i)){g.preventDefault();let p=a!==void 0?a:An(u)===An(h);d(e,{replace:p,state:n,preventScrollReset:r,relative:s,unstable_viewTransition:l})}},[u,d,h,a,n,i,e,r,s,l])}function SD(e){let t=m.useRef(Vu(e)),i=m.useRef(!1),a=ta(),n=m.useMemo(()=>X4(a.search,i.current?null:t.current),[a.search]),r=ia(),s=m.useCallback((l,d)=>{const u=Vu(typeof l=="function"?l(n):l);i.current=!0,r("?"+u,d)},[r,n]);return[n,s]}function k6(e,t){t===void 0&&(t={});let i=m.useContext(E1);i==null&&ge(!1);let{basename:a}=b6(qu.useViewTransitionState),n=cc(e,{relative:t.relative});if(!i.isTransitioning)return!1;let r=wa(i.currentLocation.pathname,a)||i.currentLocation.pathname,s=wa(i.nextLocation.pathname,a)||i.nextLocation.pathname;return Po(n.pathname,s)!=null||Po(n.pathname,r)!=null}function y6(){if(console&&console.warn){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];vn(t[0])&&(t[0]=`react-i18next:: ${t[0]}`),console.warn(...t)}}const Fg={};function Fu(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];vn(t[0])&&Fg[t[0]]||(vn(t[0])&&(Fg[t[0]]=new Date),y6(...t))}const T1=(e,t)=>()=>{if(e.isInitialized)t();else{const i=()=>{setTimeout(()=>{e.off("initialized",i)},0),t()};e.on("initialized",i)}},Ug=(e,t,i)=>{e.loadNamespaces(t,T1(e,i))},Bg=(e,t,i,a)=>{vn(i)&&(i=[i]),i.forEach(n=>{e.options.ns.indexOf(n)<0&&e.options.ns.push(n)}),e.loadLanguages(t,T1(e,a))},w6=function(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const a=t.languages[0],n=t.options?t.options.fallbackLng:!1,r=t.languages[t.languages.length-1];if(a.toLowerCase()==="cimode")return!0;const s=(l,d)=>{const u=t.services.backendConnector.state[`${l}|${d}`];return u===-1||u===2};return i.bindI18n&&i.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!s(t.isLanguageChangingTo,e)?!1:!!(t.hasResourceBundle(a,e)||!t.services.backendConnector.backend||t.options.resources&&!t.options.partialBundledLanguages||s(a,e)&&(!n||s(r,e)))},_6=function(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return!t.languages||!t.languages.length?(Fu("i18n.languages were undefined or empty",t.languages),!0):t.options.ignoreJSONStructure!==void 0?t.hasLoadedNamespace(e,{lng:i.lng,precheck:(n,r)=>{if(i.bindI18n&&i.bindI18n.indexOf("languageChanging")>-1&&n.services.backendConnector.backend&&n.isLanguageChangingTo&&!r(n.isLanguageChangingTo,e))return!1}}):w6(e,t,i)},vn=e=>typeof e=="string",x6=e=>typeof e=="object"&&e!==null,z6=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,A6={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},j6=e=>A6[e],L6=e=>e.replace(z6,j6);let Uu={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:L6};const S6=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Uu={...Uu,...e}},M6=()=>Uu;let I1;const P6=e=>{I1=e},C6=()=>I1,E6={type:"3rdParty",init(e){S6(e.options.react),P6(e)}},N1=m.createContext();class T6{constructor(){uh(this,"getUsedNamespaces",()=>Object.keys(this.usedNamespaces));this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(i=>{this.usedNamespaces[i]||(this.usedNamespaces[i]=!0)})}}const I6=(e,t)=>{const i=m.useRef();return m.useEffect(()=>{i.current=t?i.current:e},[e,t]),i.current},D1=(e,t,i,a)=>e.getFixedT(t,i,a),N6=(e,t,i,a)=>m.useCallback(D1(e,t,i,a),[e,t,i,a]),Qe=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{i18n:i}=t,{i18n:a,defaultNS:n}=m.useContext(N1)||{},r=i||a||C6();if(r&&!r.reportNamespaces&&(r.reportNamespaces=new T6),!r){Fu("You will need to pass in an i18next instance by using initReactI18next");const x=(z,S)=>vn(S)?S:x6(S)&&vn(S.defaultValue)?S.defaultValue:Array.isArray(z)?z[z.length-1]:z,A=[x,{},!1];return A.t=x,A.i18n={},A.ready=!1,A}r.options.react&&r.options.react.wait!==void 0&&Fu("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const s={...M6(),...r.options.react,...t},{useSuspense:l,keyPrefix:d}=s;let u=e||n||r.options&&r.options.defaultNS;u=vn(u)?[u]:u||["translation"],r.reportNamespaces.addUsedNamespaces&&r.reportNamespaces.addUsedNamespaces(u);const h=(r.isInitialized||r.initializedStoreOnce)&&u.every(x=>_6(x,r,s)),g=N6(r,t.lng||null,s.nsMode==="fallback"?u:u[0],d),p=()=>g,v=()=>D1(r,t.lng||null,s.nsMode==="fallback"?u:u[0],d),[f,b]=m.useState(p);let w=u.join();t.lng&&(w=`${t.lng}${w}`);const y=I6(w),k=m.useRef(!0);m.useEffect(()=>{const{bindI18n:x,bindI18nStore:A}=s;k.current=!0,!h&&!l&&(t.lng?Bg(r,t.lng,u,()=>{k.current&&b(v)}):Ug(r,u,()=>{k.current&&b(v)})),h&&y&&y!==w&&k.current&&b(v);const z=()=>{k.current&&b(v)};return x&&r&&r.on(x,z),A&&r&&r.store.on(A,z),()=>{k.current=!1,x&&r&&x.split(" ").forEach(S=>r.off(S,z)),A&&r&&A.split(" ").forEach(S=>r.store.off(S,z))}},[r,w]),m.useEffect(()=>{k.current&&h&&b(p)},[r,d,h]);const _=[f,r,h];if(_.t=f,_.i18n=r,_.ready=h,h||!h&&!l)return _;throw new Promise(x=>{t.lng?Bg(r,t.lng,u,()=>x()):Ug(r,u,()=>x())})};function D6(e){let{i18n:t,defaultNS:i,children:a}=e;const n=m.useMemo(()=>({i18n:t,defaultNS:i}),[t,i]);return m.createElement(N1.Provider,{value:n},a)}const E="http://localhost:3001/api",Gg="https://onboarding.anythingllm.com",at="anythingllm_user",Ke="anythingllm_authToken",Jt="anythingllm_authTimestamp",Ll="anythingllm_completed_questionnaire",MD="anythingllm_pinned_document_alert",PD="anythingllm_watched_document_alert",O6="anythingllm_last_visited_workspace",Bu="anythingllm_user_prompt_input_map",CD="anythingllm_pending_home_message",Kg="anythingllm_appearance_settings",R6=["http://127.0.0.1:11434","http://host.docker.internal:11434","http://172.17.0.1:11434"],H6=["http://localhost:1234/v1","http://127.0.0.1:1234/v1","http://host.docker.internal:1234/v1","http://172.17.0.1:1234/v1"],V6=["http://127.0.0.1:5000/v1","http://localhost:5000/v1","http://host.docker.internal:5000/v1","http://172.17.0.1:5000/v1"],q6=["http://127.0.0.1:8080/v1","http://localhost:8080/v1","http://host.docker.internal:8080/v1","http://172.17.0.1:8080/v1"],F6=["http://127.0.0.1:8553/v1/openai","http://0.0.0.0:8553/v1/openai","http://localhost:8553/v1/openai","http://host.docker.internal:8553/v1/openai"],U6=["http://127.0.0.1:8000/v1/version","http://localhost:8000/v1/version","http://host.docker.internal:8000/v1/version","http://172.17.0.1:8000/v1/version"],B6=["http://localhost:12434/engines/llama.cpp/v1","http://127.0.0.1:12434/engines/llama.cpp/v1","http://model-runner.docker.internal/engines/llama.cpp/v1","http://host.docker.internal:12434/engines/llama.cpp/v1","http://172.17.0.1:12434/engines/llama.cpp/v1"],G6=["http://localhost:8000/live","http://127.0.0.1:8000/live","http://host.docker.internal:8000/live","http://172.17.0.1:8000/live","http://localhost:13305/live","http://127.0.0.1:13305/live","http://host.docker.internal:13305/live","http://172.17.0.1:13305/live"];function Xs(){return E}const ED="NEW_BROWSER_EXTENSION_CONNECTION";function dc(){const e=window.localStorage.getItem(at);return e?Et(e,null):null}function N(e=null){const t=e||window.localStorage.getItem(Ke);return{Authorization:t?`Bearer ${t}`:null}}function Et(e,t=null){try{return e==null?t:JSON.parse(e)}catch{}return t}function O1(e){var t,i,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(i=O1(e[t]))&&(a&&(a+=" "),a+=i);else for(t in e)e[t]&&(a&&(a+=" "),a+=t);return a}function Da(){for(var e,t,i=0,a="";i<arguments.length;)(e=arguments[i++])&&(t=O1(e))&&(a&&(a+=" "),a+=t);return a}const oo=e=>typeof e=="number"&&!isNaN(e),jn=e=>typeof e=="string",Kt=e=>typeof e=="function",el=e=>jn(e)||Kt(e)?e:null,ud=e=>m.isValidElement(e)||jn(e)||Kt(e)||oo(e);function K6(e,t,i){i===void 0&&(i=300);const{scrollHeight:a,style:n}=e;requestAnimationFrame(()=>{n.minHeight="initial",n.height=a+"px",n.transition=`all ${i}ms`,requestAnimationFrame(()=>{n.height="0",n.padding="0",n.margin="0",setTimeout(t,i)})})}function uc(e){let{enter:t,exit:i,appendPosition:a=!1,collapse:n=!0,collapseDuration:r=300}=e;return function(s){let{children:l,position:d,preventExitTransition:u,done:h,nodeRef:g,isIn:p}=s;const v=a?`${t}--${d}`:t,f=a?`${i}--${d}`:i,b=m.useRef(0);return m.useLayoutEffect(()=>{const w=g.current,y=v.split(" "),k=_=>{_.target===g.current&&(w.dispatchEvent(new Event("d")),w.removeEventListener("animationend",k),w.removeEventListener("animationcancel",k),b.current===0&&_.type!=="animationcancel"&&w.classList.remove(...y))};w.classList.add(...y),w.addEventListener("animationend",k),w.addEventListener("animationcancel",k)},[]),m.useEffect(()=>{const w=g.current,y=()=>{w.removeEventListener("animationend",y),n?K6(w,h,r):h()};p||(u?y():(b.current=1,w.className+=` ${f}`,w.addEventListener("animationend",y)))},[p]),c.createElement(c.Fragment,null,l)}}function Wg(e,t){return e!=null?{content:e.content,containerId:e.props.containerId,id:e.props.toastId,theme:e.props.theme,type:e.props.type,data:e.props.data||{},isLoading:e.props.isLoading,icon:e.props.icon,status:t}:{}}const hi={list:new Map,emitQueue:new Map,on(e,t){return this.list.has(e)||this.list.set(e,[]),this.list.get(e).push(t),this},off(e,t){if(t){const i=this.list.get(e).filter(a=>a!==t);return this.list.set(e,i),this}return this.list.delete(e),this},cancelEmit(e){const t=this.emitQueue.get(e);return t&&(t.forEach(clearTimeout),this.emitQueue.delete(e)),this},emit(e){this.list.has(e)&&this.list.get(e).forEach(t=>{const i=setTimeout(()=>{t(...[].slice.call(arguments,1))},0);this.emitQueue.has(e)||this.emitQueue.set(e,[]),this.emitQueue.get(e).push(i)})}},Ts=e=>{let{theme:t,type:i,...a}=e;return c.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:t==="colored"?"currentColor":`var(--toastify-icon-color-${i})`,...a})},pd={info:function(e){return c.createElement(Ts,{...e},c.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(e){return c.createElement(Ts,{...e},c.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(e){return c.createElement(Ts,{...e},c.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(e){return c.createElement(Ts,{...e},c.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return c.createElement("div",{className:"Toastify__spinner"})}};function W6(e){const[,t]=m.useReducer(v=>v+1,0),[i,a]=m.useState([]),n=m.useRef(null),r=m.useRef(new Map).current,s=v=>i.indexOf(v)!==-1,l=m.useRef({toastKey:1,displayedToast:0,count:0,queue:[],props:e,containerId:null,isToastActive:s,getToast:v=>r.get(v)}).current;function d(v){let{containerId:f}=v;const{limit:b}=l.props;!b||f&&l.containerId!==f||(l.count-=l.queue.length,l.queue=[])}function u(v){a(f=>v==null?[]:f.filter(b=>b!==v))}function h(){const{toastContent:v,toastProps:f,staleId:b}=l.queue.shift();p(v,f,b)}function g(v,f){let{delay:b,staleId:w,...y}=f;if(!ud(v)||function(O){return!n.current||l.props.enableMultiContainer&&O.containerId!==l.props.containerId||r.has(O.toastId)&&O.updateId==null}(y))return;const{toastId:k,updateId:_,data:x}=y,{props:A}=l,z=()=>u(k),S=_==null;S&&l.count++;const M={...A,style:A.toastStyle,key:l.toastKey++,...Object.fromEntries(Object.entries(y).filter(O=>{let[Z,R]=O;return R!=null})),toastId:k,updateId:_,data:x,closeToast:z,isIn:!1,className:el(y.className||A.toastClassName),bodyClassName:el(y.bodyClassName||A.bodyClassName),progressClassName:el(y.progressClassName||A.progressClassName),autoClose:!y.isLoading&&(T=y.autoClose,D=A.autoClose,T===!1||oo(T)&&T>0?T:D),deleteToast(){const O=Wg(r.get(k),"removed");r.delete(k),hi.emit(4,O);const Z=l.queue.length;if(l.count=k==null?l.count-l.displayedToast:l.count-1,l.count<0&&(l.count=0),Z>0){const R=k==null?l.props.limit:1;if(Z===1||R===1)l.displayedToast++,h();else{const ce=R>Z?Z:R;l.displayedToast=ce;for(let ae=0;ae<ce;ae++)h()}}else t()}};var T,D;M.iconOut=function(O){let{theme:Z,type:R,isLoading:ce,icon:ae}=O,Q=null;const I={theme:Z,type:R};return ae===!1||(Kt(ae)?Q=ae(I):m.isValidElement(ae)?Q=m.cloneElement(ae,I):jn(ae)||oo(ae)?Q=ae:ce?Q=pd.spinner():(U=>U in pd)(R)&&(Q=pd[R](I))),Q}(M),Kt(y.onOpen)&&(M.onOpen=y.onOpen),Kt(y.onClose)&&(M.onClose=y.onClose),M.closeButton=A.closeButton,y.closeButton===!1||ud(y.closeButton)?M.closeButton=y.closeButton:y.closeButton===!0&&(M.closeButton=!ud(A.closeButton)||A.closeButton);let F=v;m.isValidElement(v)&&!jn(v.type)?F=m.cloneElement(v,{closeToast:z,toastProps:M,data:x}):Kt(v)&&(F=v({closeToast:z,toastProps:M,data:x})),A.limit&&A.limit>0&&l.count>A.limit&&S?l.queue.push({toastContent:F,toastProps:M,staleId:w}):oo(b)?setTimeout(()=>{p(F,M,w)},b):p(F,M,w)}function p(v,f,b){const{toastId:w}=f;b&&r.delete(b);const y={content:v,props:f};r.set(w,y),a(k=>[...k,w].filter(_=>_!==b)),hi.emit(4,Wg(y,y.props.updateId==null?"added":"updated"))}return m.useEffect(()=>(l.containerId=e.containerId,hi.cancelEmit(3).on(0,g).on(1,v=>n.current&&u(v)).on(5,d).emit(2,l),()=>{r.clear(),hi.emit(3,l)}),[]),m.useEffect(()=>{l.props=e,l.isToastActive=s,l.displayedToast=i.length}),{getToastToRender:function(v){const f=new Map,b=Array.from(r.values());return e.newestOnTop&&b.reverse(),b.forEach(w=>{const{position:y}=w.props;f.has(y)||f.set(y,[]),f.get(y).push(w)}),Array.from(f,w=>v(w[0],w[1]))},containerRef:n,isToastActive:s}}function $g(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientX:e.clientX}function Zg(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientY:e.clientY}function $6(e){const[t,i]=m.useState(!1),[a,n]=m.useState(!1),r=m.useRef(null),s=m.useRef({start:0,x:0,y:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,boundingRect:null,didMove:!1}).current,l=m.useRef(e),{autoClose:d,pauseOnHover:u,closeToast:h,onClick:g,closeOnClick:p}=e;function v(x){if(e.draggable){x.nativeEvent.type==="touchstart"&&x.nativeEvent.preventDefault(),s.didMove=!1,document.addEventListener("mousemove",y),document.addEventListener("mouseup",k),document.addEventListener("touchmove",y),document.addEventListener("touchend",k);const A=r.current;s.canCloseOnClick=!0,s.canDrag=!0,s.boundingRect=A.getBoundingClientRect(),A.style.transition="",s.x=$g(x.nativeEvent),s.y=Zg(x.nativeEvent),e.draggableDirection==="x"?(s.start=s.x,s.removalDistance=A.offsetWidth*(e.draggablePercent/100)):(s.start=s.y,s.removalDistance=A.offsetHeight*(e.draggablePercent===80?1.5*e.draggablePercent:e.draggablePercent/100))}}function f(x){if(s.boundingRect){const{top:A,bottom:z,left:S,right:M}=s.boundingRect;x.nativeEvent.type!=="touchend"&&e.pauseOnHover&&s.x>=S&&s.x<=M&&s.y>=A&&s.y<=z?w():b()}}function b(){i(!0)}function w(){i(!1)}function y(x){const A=r.current;s.canDrag&&A&&(s.didMove=!0,t&&w(),s.x=$g(x),s.y=Zg(x),s.delta=e.draggableDirection==="x"?s.x-s.start:s.y-s.start,s.start!==s.x&&(s.canCloseOnClick=!1),A.style.transform=`translate${e.draggableDirection}(${s.delta}px)`,A.style.opacity=""+(1-Math.abs(s.delta/s.removalDistance)))}function k(){document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",k),document.removeEventListener("touchmove",y),document.removeEventListener("touchend",k);const x=r.current;if(s.canDrag&&s.didMove&&x){if(s.canDrag=!1,Math.abs(s.delta)>s.removalDistance)return n(!0),void e.closeToast();x.style.transition="transform 0.2s, opacity 0.2s",x.style.transform=`translate${e.draggableDirection}(0)`,x.style.opacity="1"}}m.useEffect(()=>{l.current=e}),m.useEffect(()=>(r.current&&r.current.addEventListener("d",b,{once:!0}),Kt(e.onOpen)&&e.onOpen(m.isValidElement(e.children)&&e.children.props),()=>{const x=l.current;Kt(x.onClose)&&x.onClose(m.isValidElement(x.children)&&x.children.props)}),[]),m.useEffect(()=>(e.pauseOnFocusLoss&&(document.hasFocus()||w(),window.addEventListener("focus",b),window.addEventListener("blur",w)),()=>{e.pauseOnFocusLoss&&(window.removeEventListener("focus",b),window.removeEventListener("blur",w))}),[e.pauseOnFocusLoss]);const _={onMouseDown:v,onTouchStart:v,onMouseUp:f,onTouchEnd:f};return d&&u&&(_.onMouseEnter=w,_.onMouseLeave=b),p&&(_.onClick=x=>{g&&g(x),s.canCloseOnClick&&h()}),{playToast:b,pauseToast:w,isRunning:t,preventExitTransition:a,toastRef:r,eventHandlers:_}}function R1(e){let{closeToast:t,theme:i,ariaLabel:a="close"}=e;return c.createElement("button",{className:`Toastify__close-button Toastify__close-button--${i}`,type:"button",onClick:n=>{n.stopPropagation(),t(n)},"aria-label":a},c.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},c.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}function Z6(e){let{delay:t,isRunning:i,closeToast:a,type:n="default",hide:r,className:s,style:l,controlledProgress:d,progress:u,rtl:h,isIn:g,theme:p}=e;const v=r||d&&u===0,f={...l,animationDuration:`${t}ms`,animationPlayState:i?"running":"paused",opacity:v?0:1};d&&(f.transform=`scaleX(${u})`);const b=Da("Toastify__progress-bar",d?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${p}`,`Toastify__progress-bar--${n}`,{"Toastify__progress-bar--rtl":h}),w=Kt(s)?s({rtl:h,type:n,defaultClassName:b}):Da(b,s);return c.createElement("div",{role:"progressbar","aria-hidden":v?"true":"false","aria-label":"notification timer",className:w,style:f,[d&&u>=1?"onTransitionEnd":"onAnimationEnd"]:d&&u<1?null:()=>{g&&a()}})}const J6=e=>{const{isRunning:t,preventExitTransition:i,toastRef:a,eventHandlers:n}=$6(e),{closeButton:r,children:s,autoClose:l,onClick:d,type:u,hideProgressBar:h,closeToast:g,transition:p,position:v,className:f,style:b,bodyClassName:w,bodyStyle:y,progressClassName:k,progressStyle:_,updateId:x,role:A,progress:z,rtl:S,toastId:M,deleteToast:T,isIn:D,isLoading:F,iconOut:O,closeOnClick:Z,theme:R}=e,ce=Da("Toastify__toast",`Toastify__toast-theme--${R}`,`Toastify__toast--${u}`,{"Toastify__toast--rtl":S},{"Toastify__toast--close-on-click":Z}),ae=Kt(f)?f({rtl:S,position:v,type:u,defaultClassName:ce}):Da(ce,f),Q=!!z||!l,I={closeToast:g,type:u,theme:R};let U=null;return r===!1||(U=Kt(r)?r(I):m.isValidElement(r)?m.cloneElement(r,I):R1(I)),c.createElement(p,{isIn:D,done:T,position:v,preventExitTransition:i,nodeRef:a},c.createElement("div",{id:M,onClick:d,className:ae,...n,style:b,ref:a},c.createElement("div",{...D&&{role:A},className:Kt(w)?w({type:u}):Da("Toastify__toast-body",w),style:y},O!=null&&c.createElement("div",{className:Da("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!F})},O),c.createElement("div",null,s)),U,c.createElement(Z6,{...x&&!Q?{key:`pb-${x}`}:{},rtl:S,theme:R,delay:l,isRunning:t,isIn:D,closeToast:g,hide:h,type:u,style:_,className:k,controlledProgress:Q,progress:z||0})))},pc=function(e,t){return t===void 0&&(t=!1),{enter:`Toastify--animate Toastify__${e}-enter`,exit:`Toastify--animate Toastify__${e}-exit`,appendPosition:t}},Q6=uc(pc("bounce",!0));uc(pc("slide",!0));uc(pc("zoom"));uc(pc("flip"));const Gu=m.forwardRef((e,t)=>{const{getToastToRender:i,containerRef:a,isToastActive:n}=W6(e),{className:r,style:s,rtl:l,containerId:d}=e;function u(h){const g=Da("Toastify__toast-container",`Toastify__toast-container--${h}`,{"Toastify__toast-container--rtl":l});return Kt(r)?r({position:h,rtl:l,defaultClassName:g}):Da(g,el(r))}return m.useEffect(()=>{t&&(t.current=a.current)},[]),c.createElement("div",{ref:a,className:"Toastify",id:d},i((h,g)=>{const p=g.length?{...s}:{...s,pointerEvents:"none"};return c.createElement("div",{className:u(h),style:p,key:`container-${h}`},g.map((v,f)=>{let{content:b,props:w}=v;return c.createElement(J6,{...w,isIn:n(w.toastId),style:{...w.style,"--nth":f+1,"--len":g.length},key:`toast-${w.key}`},b)}))}))});Gu.displayName="ToastContainer",Gu.defaultProps={position:"top-right",transition:Q6,autoClose:5e3,closeButton:R1,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,draggable:!0,draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};let md,cn=new Map,Jr=[],Y6=1;function H1(){return""+Y6++}function X6(e){return e&&(jn(e.toastId)||oo(e.toastId))?e.toastId:H1()}function so(e,t){return cn.size>0?hi.emit(0,e,t):Jr.push({content:e,options:t}),t.toastId}function Sl(e,t){return{...t,type:t&&t.type||e,toastId:X6(t)}}function Is(e){return(t,i)=>so(t,Sl(e,i))}function Ee(e,t){return so(e,Sl("default",t))}Ee.loading=(e,t)=>so(e,Sl("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),Ee.promise=function(e,t,i){let a,{pending:n,error:r,success:s}=t;n&&(a=jn(n)?Ee.loading(n,i):Ee.loading(n.render,{...i,...n}));const l={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},d=(h,g,p)=>{if(g==null)return void Ee.dismiss(a);const v={type:h,...l,...i,data:p},f=jn(g)?{render:g}:g;return a?Ee.update(a,{...v,...f}):Ee(f.render,{...v,...f}),p},u=Kt(e)?e():e;return u.then(h=>d("success",s,h)).catch(h=>d("error",r,h)),u},Ee.success=Is("success"),Ee.info=Is("info"),Ee.error=Is("error"),Ee.warning=Is("warning"),Ee.warn=Ee.warning,Ee.dark=(e,t)=>so(e,Sl("default",{theme:"dark",...t})),Ee.dismiss=e=>{cn.size>0?hi.emit(1,e):Jr=Jr.filter(t=>e!=null&&t.options.toastId!==e)},Ee.clearWaitingQueue=function(e){return e===void 0&&(e={}),hi.emit(5,e)},Ee.isActive=e=>{let t=!1;return cn.forEach(i=>{i.isToastActive&&i.isToastActive(e)&&(t=!0)}),t},Ee.update=function(e,t){t===void 0&&(t={}),setTimeout(()=>{const i=function(a,n){let{containerId:r}=n;const s=cn.get(r||md);return s&&s.getToast(a)}(e,t);if(i){const{props:a,content:n}=i,r={delay:100,...a,...t,toastId:t.toastId||e,updateId:H1()};r.toastId!==e&&(r.staleId=e);const s=r.render||n;delete r.render,so(s,r)}},0)},Ee.done=e=>{Ee.update(e,{progress:1})},Ee.onChange=e=>(hi.on(4,e),()=>{hi.off(4,e)}),Ee.POSITION={TOP_LEFT:"top-left",TOP_RIGHT:"top-right",TOP_CENTER:"top-center",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_CENTER:"bottom-center"},Ee.TYPE={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"},hi.on(2,e=>{md=e.containerId||e,cn.set(md,e),Jr.forEach(t=>{hi.emit(0,t.content,t.options)}),Jr=[]}).on(3,e=>{cn.delete(e.containerId||e),cn.size===0&&hi.off(0).off(1).off(5)});const Se=(e,t="default",i={})=>{const n={position:"bottom-center",autoClose:5e3,hideProgressBar:!1,closeOnClick:!0,pauseOnHover:!0,draggable:!0,theme:((localStorage==null?void 0:localStorage.getItem("theme"))||"default")==="default"?"dark":"light",...i};switch((i==null?void 0:i.clear)===!0&&Ee.dismiss(),t){case"success":Ee.success(e,n);break;case"error":Ee.error(e,n);break;case"info":Ee.info(e,n);break;case"warning":Ee.warn(e,n);break;default:Ee(e,n)}},ez={github:{branches:async({repo:e,accessToken:t})=>await fetch(`${E}/ext/github/branches`,{method:"POST",headers:N(),cache:"force-cache",body:JSON.stringify({repo:e,accessToken:t})}).then(i=>i.json()).then(i=>{if(!i.success)throw new Error(i.reason);return i.data}).then(i=>({branches:(i==null?void 0:i.branches)||[],error:null})).catch(i=>(console.error(i),Se(i.message,"error"),{branches:[],error:i.message})),collect:async function({repo:e,accessToken:t,branch:i,ignorePaths:a=[]}){return await fetch(`${E}/ext/github/repo`,{method:"POST",headers:N(),body:JSON.stringify({repo:e,accessToken:t,branch:i,ignorePaths:a})}).then(n=>n.json()).then(n=>{if(!n.success)throw new Error(n.reason);return{data:n.data,error:null}}).catch(n=>(console.error(n),{data:null,error:n.message}))}},gitlab:{branches:async({repo:e,accessToken:t})=>await fetch(`${E}/ext/gitlab/branches`,{method:"POST",headers:N(),cache:"force-cache",body:JSON.stringify({repo:e,accessToken:t})}).then(i=>i.json()).then(i=>{if(!i.success)throw new Error(i.reason);return i.data}).then(i=>({branches:(i==null?void 0:i.branches)||[],error:null})).catch(i=>(console.error(i),Se(i.message,"error"),{branches:[],error:i.message})),collect:async function({repo:e,accessToken:t,branch:i,ignorePaths:a=[],fetchIssues:n=!1,fetchWikis:r=!1}){return await fetch(`${E}/ext/gitlab/repo`,{method:"POST",headers:N(),body:JSON.stringify({repo:e,accessToken:t,branch:i,ignorePaths:a,fetchIssues:n,fetchWikis:r})}).then(s=>s.json()).then(s=>{if(!s.success)throw new Error(s.reason);return{data:s.data,error:null}}).catch(s=>(console.error(s),{data:null,error:s.message}))}},youtube:{transcribe:async({url:e})=>await fetch(`${E}/ext/youtube/transcript`,{method:"POST",headers:N(),body:JSON.stringify({url:e})}).then(t=>t.json()).then(t=>{if(!t.success)throw new Error(t.reason);return{data:t.data,error:null}}).catch(t=>(console.error(t),{data:null,error:t.message}))},websiteDepth:{scrape:async({url:e,depth:t,maxLinks:i})=>await fetch(`${E}/ext/website-depth`,{method:"POST",headers:N(),body:JSON.stringify({url:e,depth:t,maxLinks:i})}).then(a=>a.json()).then(a=>{if(!a.success)throw new Error(a.reason);return{data:a.data,error:null}}).catch(a=>(console.error(a),{data:null,error:a.message}))},confluence:{collect:async function({baseUrl:e,spaceKey:t,username:i,accessToken:a,cloud:n,personalAccessToken:r,bypassSSL:s}){return await fetch(`${E}/ext/confluence`,{method:"POST",headers:N(),body:JSON.stringify({baseUrl:e,spaceKey:t,username:i,accessToken:a,cloud:n,personalAccessToken:r,bypassSSL:s})}).then(l=>l.json()).then(l=>{if(!l.success)throw new Error(l.reason);return{data:l.data,error:null}}).catch(l=>(console.error(l),{data:null,error:l.message}))}},drupalwiki:{collect:async function({baseUrl:e,spaceIds:t,accessToken:i}){return await fetch(`${E}/ext/drupalwiki`,{method:"POST",headers:N(),body:JSON.stringify({baseUrl:e,spaceIds:t,accessToken:i})}).then(a=>a.json()).then(a=>{if(!a.success)throw new Error(a.reason);return{data:a.data,error:null}}).catch(a=>(console.error(a),{data:null,error:a.message}))}},obsidian:{collect:async function({files:e}){return await fetch(`${E}/ext/obsidian/vault`,{method:"POST",headers:N(),body:JSON.stringify({files:e})}).then(t=>t.json()).then(t=>{if(!t.success)throw new Error(t.reason);return{data:t.data,error:null}}).catch(t=>(console.error(t),{data:null,error:t.message}))}},paperlessNgx:{collect:async function({baseUrl:e,apiToken:t}){return await fetch(`${E}/ext/paperless-ngx`,{method:"POST",headers:N(),body:JSON.stringify({baseUrl:e,apiToken:t})}).then(i=>i.json()).then(i=>{if(!i.success)throw new Error(i.reason);return{data:i.data,error:null}}).catch(i=>(console.error(i),{data:null,error:i.message}))}}},tz={featureFlag:"experimental_live_file_sync",toggleFeature:async function(e=!1){return await fetch(`${E}/experimental/toggle-live-sync`,{method:"POST",headers:N(),body:JSON.stringify({updatedStatus:e})}).then(t=>{if(!t.ok)throw new Error("Could not update status.");return!0}).then(t=>t).catch(t=>(console.error(t),!1))},queues:async function(){return await fetch(`${E}/experimental/live-sync/queues`,{headers:N()}).then(e=>{if(!e.ok)throw new Error("Could not update status.");return e.json()}).then(e=>(e==null?void 0:e.queues)||[]).catch(e=>(console.error(e),[]))},setWatchStatusForDocument:async function(e,t,i){return fetch(`${E}/workspace/${e}/update-watch-status`,{method:"POST",headers:N(),body:JSON.stringify({docPath:t,watchStatus:i})}).then(a=>{if(!a.ok)throw new Error(a.statusText||"Error setting watch status for document.");return!0}).catch(a=>(console.error(a),!1))}},iz={toggleFeature:async function(e,t=!1){return await fetch(`${E}/experimental/agent-plugins/${e}/toggle`,{method:"POST",headers:N(),body:JSON.stringify({active:t})}).then(i=>{if(!i.ok)throw new Error("Could not update agent plugin status.");return!0}).catch(i=>(console.error(i),!1))},updatePluginConfig:async function(e,t={}){return await fetch(`${E}/experimental/agent-plugins/${e}/config`,{method:"POST",headers:N(),body:JSON.stringify({updates:t})}).then(i=>{if(!i.ok)throw new Error("Could not update agent plugin config.");return!0}).catch(i=>(console.error(i),!1))},deletePlugin:async function(e){return await fetch(`${E}/experimental/agent-plugins/${e}`,{method:"DELETE",headers:N()}).then(t=>{if(!t.ok)throw new Error("Could not delete agent plugin config.");return!0}).catch(t=>(console.error(t),!1))}},az={getAll:async function(){try{return await fetch(`${E}/system/prompt-variables`,{method:"GET",headers:N()}).then(e=>e.json()).catch(e=>(console.error("Error fetching system prompt variables:",e),{variables:[]}))}catch(e){return console.error("Error fetching system prompt variables:",e),{variables:[]}}},create:async function(e={}){try{return await fetch(`${E}/system/prompt-variables`,{method:"POST",headers:N(),body:JSON.stringify(e)}).then(t=>t.json()).catch(t=>(console.error("Error creating system prompt variable:",t),{success:!1,error:t}))}catch(t){return console.error("Error creating system prompt variable:",t),{success:!1,error:t}}},update:async function(e,t={}){try{return await fetch(`${E}/system/prompt-variables/${e}`,{method:"PUT",headers:N(),body:JSON.stringify(t)}).then(i=>i.json()).catch(i=>(console.error("Error updating system prompt variable:",i),{success:!1,error:i}))}catch(i){return console.error("Error updating system prompt variable:",i),{success:!1,error:i}}},delete:async function(e=null){try{return e===null?{success:!1,error:"ID is required"}:await fetch(`${E}/system/prompt-variables/${e}`,{method:"DELETE",headers:N()}).then(t=>t.json()).catch(t=>(console.error("Error deleting system prompt variable:",t),{success:!1,error:t}))}catch(t){return console.error("Error deleting system prompt variable:",t),{success:!1,error:t}}}},K={cacheKeys:{footerIcons:"anythingllm_footer_links",supportEmail:"anythingllm_support_email",customAppName:"anythingllm_custom_app_name",canViewChatHistory:"anythingllm_can_view_chat_history",deploymentVersion:"anythingllm_deployment_version"},ping:async function(){return await fetch(`${E}/ping`).then(e=>e.json()).then(e=>(e==null?void 0:e.online)||!1).catch(()=>!1)},totalIndexes:async function(e=null){const t=new URL(`${Xs()}/system/system-vectors`);return e&&t.searchParams.append("slug",encodeURIComponent(e)),await fetch(t.toString(),{headers:N()}).then(i=>{if(!i.ok)throw new Error("Could not find indexes.");return i.json()}).then(i=>i.vectorCount).catch(()=>0)},isOnboardingComplete:async function(){return await fetch(`${E}/onboarding`).then(e=>{if(!e.ok)throw new Error("Could not find onboarding information.");return e.json()}).then(e=>e.onboardingComplete).catch(()=>!1)},markOnboardingComplete:async function(){return await fetch(`${E}/onboarding`,{method:"POST",headers:N()}).then(e=>e.ok).catch(()=>!1)},keys:async function(){return await fetch(`${E}/setup-complete`).then(e=>{if(!e.ok)throw new Error("Could not find setup information.");return e.json()}).then(e=>e.results).catch(()=>null)},localFiles:async function(){return await fetch(`${E}/system/local-files`,{headers:N()}).then(e=>{if(!e.ok)throw new Error("Could not find setup information.");return e.json()}).then(e=>e.localFiles).catch(()=>null)},needsAuthCheck:function(){const e=window.localStorage.getItem(Jt);if(!e)return!0;const t=Number(e)+60*5*1e3;return Number(new Date)>t},checkAuth:async function(e=null){const t=await fetch(`${E}/system/check-token`,{headers:N(e)}).then(i=>i.ok).catch(()=>!1);return window.localStorage.setItem(Jt,Number(new Date)),t},requestToken:async function(e){return await fetch(`${E}/request-token`,{method:"POST",body:JSON.stringify({...e})}).then(t=>{if(!t.ok)throw new Error("Could not validate login.");return t.json()}).then(t=>t).catch(t=>({valid:!1,message:t.message}))},refreshUser:()=>fetch(`${E}/system/refresh-user`,{headers:N()}).then(e=>{if(!e.ok)throw new Error("Could not refresh user.");return e.json()}).catch(e=>({success:!1,user:null,message:e.message})),recoverAccount:async function(e,t){return await fetch(`${E}/system/recover-account`,{method:"POST",headers:N(),body:JSON.stringify({username:e,recoveryCodes:t})}).then(async i=>{const a=await i.json();if(!i.ok)throw new Error(a.message||"Error recovering account.");return a}).catch(i=>(console.error(i),{success:!1,error:i.message}))},resetPassword:async function(e,t,i){return await fetch(`${E}/system/reset-password`,{method:"POST",headers:N(),body:JSON.stringify({token:e,newPassword:t,confirmPassword:i})}).then(async a=>{const n=await a.json();if(!a.ok)throw new Error(n.message||"Error resetting password.");return n}).catch(a=>(console.error(a),{success:!1,error:a.message}))},checkDocumentProcessorOnline:async()=>await fetch(`${E}/system/document-processing-status`,{headers:N()}).then(e=>e.ok).catch(()=>!1),acceptedDocumentTypes:async()=>await fetch(`${E}/system/accepted-document-types`,{headers:N()}).then(e=>e.json()).then(e=>e==null?void 0:e.types).catch(()=>null),updateSystem:async e=>await fetch(`${E}/system/update-env`,{method:"POST",headers:N(),body:JSON.stringify(e)}).then(t=>t.json()).catch(t=>(console.error(t),{newValues:null,error:t.message})),updateSystemPassword:async e=>await fetch(`${E}/system/update-password`,{method:"POST",headers:N(),body:JSON.stringify(e)}).then(t=>t.json()).catch(t=>(console.error(t),{success:!1,error:t.message})),setupMultiUser:async e=>await fetch(`${E}/system/enable-multi-user`,{method:"POST",headers:N(),body:JSON.stringify(e)}).then(t=>t.json()).catch(t=>(console.error(t),{success:!1,error:t.message})),isMultiUserMode:async()=>await fetch(`${E}/system/multi-user-mode`,{method:"GET",headers:N()}).then(e=>e.json()).then(e=>e==null?void 0:e.multiUserMode).catch(e=>(console.error(e),!1)),deleteDocument:async e=>await fetch(`${E}/system/remove-document`,{method:"DELETE",headers:N(),body:JSON.stringify({name:e})}).then(t=>t.ok).catch(t=>(console.error(t),!1)),deleteDocuments:async(e=[])=>await fetch(`${E}/system/remove-documents`,{method:"DELETE",headers:N(),body:JSON.stringify({names:e})}).then(t=>t.ok).catch(t=>(console.error(t),!1)),deleteFolder:async e=>await fetch(`${E}/system/remove-folder`,{method:"DELETE",headers:N(),body:JSON.stringify({name:e})}).then(t=>t.ok).catch(t=>(console.error(t),!1)),uploadPfp:async function(e){return await fetch(`${E}/system/upload-pfp`,{method:"POST",body:e,headers:N()}).then(t=>{if(!t.ok)throw new Error("Error uploading pfp.");return{success:!0,error:null}}).catch(t=>(console.log(t),{success:!1,error:t.message}))},uploadLogo:async function(e){return await fetch(`${E}/system/upload-logo`,{method:"POST",body:e,headers:N()}).then(t=>{if(!t.ok)throw new Error("Error uploading logo.");return{success:!0,error:null}}).catch(t=>(console.log(t),{success:!1,error:t.message}))},fetchCustomFooterIcons:async function(){const e=window.localStorage.getItem(this.cacheKeys.footerIcons),{data:t,lastFetched:i}=e?Et(e,{data:[],lastFetched:0}):{data:[],lastFetched:0};if(t&&Date.now()-i<36e5)return{footerData:t,error:null};const{footerData:a,error:n}=await fetch(`${E}/system/footer-data`,{method:"GET",cache:"no-cache",headers:N()}).then(s=>s.json()).catch(s=>(console.log(s),{footerData:[],error:s.message}));if(!a||n)return{footerData:[],error:null};const r=Et(a,[]);return window.localStorage.setItem(this.cacheKeys.footerIcons,JSON.stringify({data:r,lastFetched:Date.now()})),{footerData:r,error:null}},fetchSupportEmail:async function(){const e=window.localStorage.getItem(this.cacheKeys.supportEmail),{email:t,lastFetched:i}=e?Et(e,{email:"",lastFetched:0}):{email:"",lastFetched:0};if(t&&Date.now()-i<36e5)return{email:t,error:null};const{supportEmail:a,error:n}=await fetch(`${E}/system/support-email`,{method:"GET",cache:"no-cache",headers:N()}).then(r=>r.json()).catch(r=>(console.log(r),{email:"",error:r.message}));return!a||n?{email:"",error:null}:(window.localStorage.setItem(this.cacheKeys.supportEmail,JSON.stringify({email:a,lastFetched:Date.now()})),{email:a,error:null})},fetchCustomAppName:async function(){const e=window.localStorage.getItem(this.cacheKeys.customAppName),{appName:t,lastFetched:i}=e?Et(e,{appName:"",lastFetched:0}):{appName:"",lastFetched:0};if(t&&Date.now()-i<36e5)return{appName:t,error:null};const{customAppName:a,error:n}=await fetch(`${E}/system/custom-app-name`,{method:"GET",cache:"no-cache",headers:N()}).then(r=>r.json()).catch(r=>(console.log(r),{customAppName:"",error:r.message}));return!a||n?(window.localStorage.removeItem(this.cacheKeys.customAppName),{appName:"",error:null}):(window.localStorage.setItem(this.cacheKeys.customAppName,JSON.stringify({appName:a,lastFetched:Date.now()})),{appName:a,error:null})},fetchDefaultSystemPrompt:async function(){return await fetch(`${E}/system/default-system-prompt`,{method:"GET",headers:N()}).then(e=>e.json()).then(e=>({defaultSystemPrompt:e.defaultSystemPrompt,saneDefaultSystemPrompt:e.saneDefaultSystemPrompt})).catch(e=>(console.error(e),{defaultSystemPrompt:"",saneDefaultSystemPrompt:""}))},updateDefaultSystemPrompt:async function(e){try{return await(await fetch(`${E}/system/default-system-prompt`,{method:"POST",headers:N(),body:JSON.stringify({defaultSystemPrompt:e})})).json()}catch(t){return console.error(t),{success:!1,message:t.message}}},fetchLogo:async function(){const e=new URL(`${Xs()}/system/logo`);return e.searchParams.append("theme",localStorage.getItem("theme")||"default"),await fetch(e,{method:"GET",cache:"no-cache"}).then(async t=>{if(t.ok&&t.status!==204){const i=t.headers.get("X-Is-Custom-Logo")==="true",a=await t.blob(),n=URL.createObjectURL(a);return{isCustomLogo:i,logoURL:n}}throw new Error("Failed to fetch logo!")}).catch(t=>(console.log(t),{isCustomLogo:!1,logoURL:null}))},fetchPfp:async function(e){return await fetch(`${E}/system/pfp/${e}`,{method:"GET",cache:"no-cache",headers:N()}).then(t=>{if(t.ok&&t.status!==204)return t.blob();throw new Error("Failed to fetch pfp.")}).then(t=>t?URL.createObjectURL(t):null).catch(()=>null)},removePfp:async function(){return await fetch(`${E}/system/remove-pfp`,{method:"DELETE",headers:N()}).then(e=>{if(e.ok)return{success:!0,error:null};throw new Error("Failed to remove pfp.")}).catch(e=>(console.log(e),{success:!1,error:e.message}))},isDefaultLogo:async function(){return await fetch(`${E}/system/is-default-logo`,{method:"GET",cache:"no-cache"}).then(e=>{if(!e.ok)throw new Error("Failed to get is default logo!");return e.json()}).then(e=>e==null?void 0:e.isDefaultLogo).catch(e=>(console.log(e),null))},removeCustomLogo:async function(){return await fetch(`${E}/system/remove-logo`,{headers:N()}).then(e=>{if(e.ok)return{success:!0,error:null};throw new Error("Error removing logo!")}).catch(e=>(console.log(e),{success:!1,error:e.message}))},getApiKeys:async function(){return fetch(`${E}/system/api-keys`,{method:"GET",headers:N()}).then(e=>{if(!e.ok)throw new Error(e.statusText||"Error fetching api key.");return e.json()}).catch(e=>(console.error(e),{apiKey:null,error:e.message}))},generateApiKey:async function(e={}){return fetch(`${E}/system/generate-api-key`,{method:"POST",headers:N(),body:JSON.stringify(e)}).then(t=>{if(!t.ok)throw new Error(t.statusText||"Error generating api key.");return t.json()}).catch(t=>(console.error(t),{apiKey:null,error:t.message}))},deleteApiKey:async function(e=""){return fetch(`${E}/system/api-key/${e}`,{method:"DELETE",headers:N()}).then(t=>t.ok).catch(t=>(console.error(t),!1))},customModels:async function(e,t=null,i=null,a=null){const n=new AbortController;return a&&setTimeout(()=>{n.abort("Request timed out.")},a),fetch(`${E}/system/custom-models`,{method:"POST",headers:N(),signal:n.signal,body:JSON.stringify({provider:e,apiKey:t,basePath:i})}).then(r=>{if(!r.ok)throw new Error(r.statusText||"Error finding custom models.");return r.json()}).catch(r=>(console.error(r),{models:[],error:r.message}))},chats:async(e=0)=>await fetch(`${E}/system/workspace-chats`,{method:"POST",headers:N(),body:JSON.stringify({offset:e})}).then(t=>t.json()).catch(t=>(console.error(t),[])),eventLogs:async(e=0)=>await fetch(`${E}/system/event-logs`,{method:"POST",headers:N(),body:JSON.stringify({offset:e})}).then(t=>t.json()).catch(t=>(console.error(t),[])),clearEventLogs:async()=>await fetch(`${E}/system/event-logs`,{method:"DELETE",headers:N()}).then(e=>e.json()).catch(e=>(console.error(e),{success:!1,error:e.message})),deleteChat:async e=>await fetch(`${E}/system/workspace-chats/${e}`,{method:"DELETE",headers:N()}).then(t=>t.json()).catch(t=>(console.error(t),{success:!1,error:t.message})),exportChats:async(e="csv",t="workspace")=>{const i=new URL(`${Xs()}/system/export-chats`);return i.searchParams.append("type",encodeURIComponent(e)),i.searchParams.append("chatType",encodeURIComponent(t)),await fetch(i,{method:"GET",headers:N()}).then(a=>{if(a.ok)return a.text();throw new Error(a.statusText)}).catch(a=>(console.error(a),null))},updateUser:async e=>await fetch(`${E}/system/user`,{method:"POST",headers:N(),body:JSON.stringify(e)}).then(t=>t.json()).catch(t=>(console.error(t),{success:!1,error:t.message})),dataConnectors:ez,getSlashCommandPresets:async function(){return await fetch(`${E}/system/slash-command-presets`,{method:"GET",headers:N()}).then(e=>{if(!e.ok)throw new Error("Could not fetch slash command presets.");return e.json()}).then(e=>e.presets).catch(e=>(console.error(e),[]))},createSlashCommandPreset:async function(e){return await fetch(`${E}/system/slash-command-presets`,{method:"POST",headers:N(),body:JSON.stringify(e)}).then(async t=>{const i=await t.json();if(!t.ok)throw new Error(i.message||"Error creating slash command preset.");return i}).then(t=>({preset:t.preset,error:null})).catch(t=>(console.error(t),{preset:null,error:t.message}))},updateSlashCommandPreset:async function(e,t){return await fetch(`${E}/system/slash-command-presets/${e}`,{method:"POST",headers:N(),body:JSON.stringify(t)}).then(async i=>{const a=await i.json();if(!i.ok)throw new Error(a.message||"Could not update slash command preset.");return a}).then(i=>({preset:i.preset,error:null})).catch(i=>(console.error(i),{preset:null,error:i.message}))},deleteSlashCommandPreset:async function(e){return await fetch(`${E}/system/slash-command-presets/${e}`,{method:"DELETE",headers:N()}).then(t=>{if(!t.ok)throw new Error("Could not delete slash command preset.");return!0}).catch(t=>(console.error(t),!1))},fetchCanViewChatHistory:async function(){const e=window.localStorage.getItem(this.cacheKeys.canViewChatHistory),{viewable:t,lastFetched:i}=e?Et(e,{viewable:!1,lastFetched:0}):{viewable:!1,lastFetched:0};if(typeof t=="boolean"&&Date.now()-i<864e5)return{viewable:t,error:null};const a=await K.keys(),n=(a==null?void 0:a.DisableViewChatHistory)===!1;return window.localStorage.setItem(this.cacheKeys.canViewChatHistory,JSON.stringify({viewable:n,lastFetched:Date.now()})),{viewable:n,error:null}},simpleSSOLogin:async function(e){return fetch(`${E}/request-token/sso/simple?token=${e}`,{method:"GET"}).then(async t=>{if(!t.ok){const i=await t.text();if(!i.startsWith("{"))throw new Error(i);return JSON.parse(i)}return await t.json()}).catch(t=>(console.error(t),{valid:!1,user:null,token:null,message:t.message}))},fetchAppVersion:async function(){const e=window.localStorage.getItem(this.cacheKeys.deploymentVersion),{version:t,lastFetched:i}=e?Et(e,{version:null,lastFetched:0}):{version:null,lastFetched:0};if(t&&Date.now()-i<36e5)return t;const a=await fetch(`${E}/utils/metrics`,{method:"GET",cache:"no-cache"}).then(n=>{if(!n.ok)throw new Error("Could not fetch app version.");return n.json()}).then(n=>n==null?void 0:n.appVersion).catch(()=>null);return a?(window.localStorage.setItem(this.cacheKeys.deploymentVersion,JSON.stringify({version:a,lastFetched:Date.now()})),a):null},validateSQLConnection:async function(e,t){return fetch(`${E}/system/validate-sql-connection`,{method:"POST",headers:N(),body:JSON.stringify({engine:e,connectionString:t})}).then(i=>i.json()).catch(i=>(console.error("Failed to validate SQL connection:",i),{success:!1,error:i.message}))},isFileSystemAgentAvailable:async function(){return fetch(`${E}/agent-skills/filesystem-agent/is-available`,{method:"GET",headers:N()}).then(e=>e.json()).then(e=>(e==null?void 0:e.available)??!1).catch(()=>!1)},isCreateFilesAgentAvailable:async function(){return fetch(`${E}/agent-skills/create-files-agent/is-available`,{method:"GET",headers:N()}).then(e=>e.json()).then(e=>(e==null?void 0:e.available)??!1).catch(()=>!1)},experimentalFeatures:{liveSync:tz,agentPlugins:iz},promptVariables:az},V1=m.createContext(null);function nz(e){const t=localStorage.getItem(at),i=localStorage.getItem(Ke),[a,n]=m.useState({user:t?Et(t,null):null,authToken:i||null}),r=ia(),[s]=m.useState({updateUser:(l,d="")=>{localStorage.setItem(at,JSON.stringify(l)),localStorage.setItem(Ke,d),n({user:l,authToken:d})},unsetUser:()=>{localStorage.removeItem(at),localStorage.removeItem(Ke),localStorage.removeItem(Jt),localStorage.removeItem(Bu),n({user:null,authToken:null})}});return m.useEffect(()=>{async function l(){const{success:d,user:u}=await K.refreshUser();if(!(d&&u===null)){if(!d){localStorage.removeItem(at),localStorage.removeItem(Ke),localStorage.removeItem(Jt),localStorage.removeItem(Bu),n({user:null,authToken:null}),r("/login");return}localStorage.setItem(at,JSON.stringify(u)),n(h=>({...h,user:u}))}}a.authToken&&l()},[a.authToken]),o.jsx(V1.Provider,{value:{store:a,actions:s},children:e.children})}const rz={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 Ml{constructor(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(t,i)}init(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=i.prefix||"i18next:",this.logger=t||rz,this.options=i,this.debug=i.debug}log(){for(var t=arguments.length,i=new Array(t),a=0;a<t;a++)i[a]=arguments[a];return this.forward(i,"log","",!0)}warn(){for(var t=arguments.length,i=new Array(t),a=0;a<t;a++)i[a]=arguments[a];return this.forward(i,"warn","",!0)}error(){for(var t=arguments.length,i=new Array(t),a=0;a<t;a++)i[a]=arguments[a];return this.forward(i,"error","")}deprecate(){for(var t=arguments.length,i=new Array(t),a=0;a<t;a++)i[a]=arguments[a];return this.forward(i,"warn","WARNING DEPRECATED: ",!0)}forward(t,i,a,n){return n&&!this.debug?null:(typeof t[0]=="string"&&(t[0]=`${a}${this.prefix} ${t[0]}`),this.logger[i](t))}create(t){return new Ml(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new Ml(this.logger,t)}}var $i=new Ml;class mc{constructor(){this.observers={}}on(t,i){return t.split(" ").forEach(a=>{this.observers[a]||(this.observers[a]=new Map);const n=this.observers[a].get(i)||0;this.observers[a].set(i,n+1)}),this}off(t,i){if(this.observers[t]){if(!i){delete this.observers[t];return}this.observers[t].delete(i)}}emit(t){for(var i=arguments.length,a=new Array(i>1?i-1:0),n=1;n<i;n++)a[n-1]=arguments[n];this.observers[t]&&Array.from(this.observers[t].entries()).forEach(s=>{let[l,d]=s;for(let u=0;u<d;u++)l(...a)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(s=>{let[l,d]=s;for(let u=0;u<d;u++)l.apply(l,[t,...a])})}}function Fr(){let e,t;const i=new Promise((a,n)=>{e=a,t=n});return i.resolve=e,i.reject=t,i}function Jg(e){return e==null?"":""+e}function oz(e,t,i){e.forEach(a=>{t[a]&&(i[a]=t[a])})}const sz=/###/g;function lo(e,t,i){function a(l){return l&&l.indexOf("###")>-1?l.replace(sz,"."):l}function n(){return!e||typeof e=="string"}const r=typeof t!="string"?t:t.split(".");let s=0;for(;s<r.length-1;){if(n())return{};const l=a(r[s]);!e[l]&&i&&(e[l]=new i),Object.prototype.hasOwnProperty.call(e,l)?e=e[l]:e={},++s}return n()?{}:{obj:e,k:a(r[s])}}function Qg(e,t,i){const{obj:a,k:n}=lo(e,t,Object);if(a!==void 0||t.length===1){a[n]=i;return}let r=t[t.length-1],s=t.slice(0,t.length-1),l=lo(e,s,Object);for(;l.obj===void 0&&s.length;)r=`${s[s.length-1]}.${r}`,s=s.slice(0,s.length-1),l=lo(e,s,Object),l&&l.obj&&typeof l.obj[`${l.k}.${r}`]<"u"&&(l.obj=void 0);l.obj[`${l.k}.${r}`]=i}function lz(e,t,i,a){const{obj:n,k:r}=lo(e,t,Object);n[r]=n[r]||[],n[r].push(i)}function Pl(e,t){const{obj:i,k:a}=lo(e,t);if(i)return i[a]}function cz(e,t,i){const a=Pl(e,i);return a!==void 0?a:Pl(t,i)}function q1(e,t,i){for(const a in t)a!=="__proto__"&&a!=="constructor"&&(a in e?typeof e[a]=="string"||e[a]instanceof String||typeof t[a]=="string"||t[a]instanceof String?i&&(e[a]=t[a]):q1(e[a],t[a],i):e[a]=t[a]);return e}function qn(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var dz={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function uz(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,t=>dz[t]):e}class pz{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const i=this.regExpMap.get(t);if(i!==void 0)return i;const a=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,a),this.regExpQueue.push(t),a}}const mz=[" ",",","?","!",";"],hz=new pz(20);function gz(e,t,i){t=t||"",i=i||"";const a=mz.filter(s=>t.indexOf(s)<0&&i.indexOf(s)<0);if(a.length===0)return!0;const n=hz.getRegExp(`(${a.map(s=>s==="?"?"\\?":s).join("|")})`);let r=!n.test(e);if(!r){const s=e.indexOf(i);s>0&&!n.test(e.substring(0,s))&&(r=!0)}return r}function Ku(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!e)return;if(e[t])return e[t];const a=t.split(i);let n=e;for(let r=0;r<a.length;){if(!n||typeof n!="object")return;let s,l="";for(let d=r;d<a.length;++d)if(d!==r&&(l+=i),l+=a[d],s=n[l],s!==void 0){if(["string","number","boolean"].indexOf(typeof s)>-1&&d<a.length-1)continue;r+=d-r+1;break}n=s}return n}function Cl(e){return e&&e.indexOf("_")>0?e.replace("_","-"):e}class Yg extends mc{constructor(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=i,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 i=this.options.ns.indexOf(t);i>-1&&this.options.ns.splice(i,1)}getResource(t,i,a){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const r=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,s=n.ignoreJSONStructure!==void 0?n.ignoreJSONStructure:this.options.ignoreJSONStructure;let l;t.indexOf(".")>-1?l=t.split("."):(l=[t,i],a&&(Array.isArray(a)?l.push(...a):typeof a=="string"&&r?l.push(...a.split(r)):l.push(a)));const d=Pl(this.data,l);return!d&&!i&&!a&&t.indexOf(".")>-1&&(t=l[0],i=l[1],a=l.slice(2).join(".")),d||!s||typeof a!="string"?d:Ku(this.data&&this.data[t]&&this.data[t][i],a,r)}addResource(t,i,a,n){let r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const s=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator;let l=[t,i];a&&(l=l.concat(s?a.split(s):a)),t.indexOf(".")>-1&&(l=t.split("."),n=i,i=l[1]),this.addNamespaces(i),Qg(this.data,l,n),r.silent||this.emit("added",t,i,a,n)}addResources(t,i,a){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const r in a)(typeof a[r]=="string"||Array.isArray(a[r]))&&this.addResource(t,i,r,a[r],{silent:!0});n.silent||this.emit("added",t,i,a)}addResourceBundle(t,i,a,n,r){let s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},l=[t,i];t.indexOf(".")>-1&&(l=t.split("."),n=a,a=i,i=l[1]),this.addNamespaces(i);let d=Pl(this.data,l)||{};s.skipCopy||(a=JSON.parse(JSON.stringify(a))),n?q1(d,a,r):d={...d,...a},Qg(this.data,l,d),s.silent||this.emit("added",t,i,a)}removeResourceBundle(t,i){this.hasResourceBundle(t,i)&&delete this.data[t][i],this.removeNamespaces(i),this.emit("removed",t,i)}hasResourceBundle(t,i){return this.getResource(t,i)!==void 0}getResourceBundle(t,i){return i||(i=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(t,i)}:this.getResource(t,i)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const i=this.getDataByLanguage(t);return!!(i&&Object.keys(i)||[]).find(n=>i[n]&&Object.keys(i[n]).length>0)}toJSON(){return this.data}}var F1={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,i,a,n){return e.forEach(r=>{this.processors[r]&&(t=this.processors[r].process(t,i,a,n))}),t}};const Xg={};class El extends mc{constructor(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),oz(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=i,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=$i.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(t==null)return!1;const a=this.resolve(t,i);return a&&a.res!==void 0}extractFromKey(t,i){let a=i.nsSeparator!==void 0?i.nsSeparator:this.options.nsSeparator;a===void 0&&(a=":");const n=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator;let r=i.ns||this.options.defaultNS||[];const s=a&&t.indexOf(a)>-1,l=!this.options.userDefinedKeySeparator&&!i.keySeparator&&!this.options.userDefinedNsSeparator&&!i.nsSeparator&&!gz(t,a,n);if(s&&!l){const d=t.match(this.interpolator.nestingRegexp);if(d&&d.length>0)return{key:t,namespaces:r};const u=t.split(a);(a!==n||a===n&&this.options.ns.indexOf(u[0])>-1)&&(r=u.shift()),t=u.join(n)}return typeof r=="string"&&(r=[r]),{key:t,namespaces:r}}translate(t,i,a){if(typeof i!="object"&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i=="object"&&(i={...i}),i||(i={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const n=i.returnDetails!==void 0?i.returnDetails:this.options.returnDetails,r=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,{key:s,namespaces:l}=this.extractFromKey(t[t.length-1],i),d=l[l.length-1],u=i.lng||this.language,h=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u&&u.toLowerCase()==="cimode"){if(h){const x=i.nsSeparator||this.options.nsSeparator;return n?{res:`${d}${x}${s}`,usedKey:s,exactUsedKey:s,usedLng:u,usedNS:d,usedParams:this.getUsedParamsDetails(i)}:`${d}${x}${s}`}return n?{res:s,usedKey:s,exactUsedKey:s,usedLng:u,usedNS:d,usedParams:this.getUsedParamsDetails(i)}:s}const g=this.resolve(t,i);let p=g&&g.res;const v=g&&g.usedKey||s,f=g&&g.exactUsedKey||s,b=Object.prototype.toString.apply(p),w=["[object Number]","[object Function]","[object RegExp]"],y=i.joinArrays!==void 0?i.joinArrays:this.options.joinArrays,k=!this.i18nFormat||this.i18nFormat.handleAsObject;if(k&&p&&(typeof p!="string"&&typeof p!="boolean"&&typeof p!="number")&&w.indexOf(b)<0&&!(typeof y=="string"&&Array.isArray(p))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const x=this.options.returnedObjectHandler?this.options.returnedObjectHandler(v,p,{...i,ns:l}):`key '${s} (${this.language})' returned an object instead of string.`;return n?(g.res=x,g.usedParams=this.getUsedParamsDetails(i),g):x}if(r){const x=Array.isArray(p),A=x?[]:{},z=x?f:v;for(const S in p)if(Object.prototype.hasOwnProperty.call(p,S)){const M=`${z}${r}${S}`;A[S]=this.translate(M,{...i,joinArrays:!1,ns:l}),A[S]===M&&(A[S]=p[S])}p=A}}else if(k&&typeof y=="string"&&Array.isArray(p))p=p.join(y),p&&(p=this.extendTranslation(p,t,i,a));else{let x=!1,A=!1;const z=i.count!==void 0&&typeof i.count!="string",S=El.hasDefaultValue(i),M=z?this.pluralResolver.getSuffix(u,i.count,i):"",T=i.ordinal&&z?this.pluralResolver.getSuffix(u,i.count,{ordinal:!1}):"",D=z&&!i.ordinal&&i.count===0&&this.pluralResolver.shouldUseIntlApi(),F=D&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${M}`]||i[`defaultValue${T}`]||i.defaultValue;!this.isValidLookup(p)&&S&&(x=!0,p=F),this.isValidLookup(p)||(A=!0,p=s);const Z=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&A?void 0:p,R=S&&F!==p&&this.options.updateMissing;if(A||x||R){if(this.logger.log(R?"updateKey":"missingKey",u,d,s,R?F:p),r){const I=this.resolve(s,{...i,keySeparator:!1});I&&I.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 ce=[];const ae=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo==="fallback"&&ae&&ae[0])for(let I=0;I<ae.length;I++)ce.push(ae[I]);else this.options.saveMissingTo==="all"?ce=this.languageUtils.toResolveHierarchy(i.lng||this.language):ce.push(i.lng||this.language);const Q=(I,U,B)=>{const me=S&&B!==p?B:Z;this.options.missingKeyHandler?this.options.missingKeyHandler(I,d,U,me,R,i):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(I,d,U,me,R,i),this.emit("missingKey",I,d,U,p)};this.options.saveMissing&&(this.options.saveMissingPlurals&&z?ce.forEach(I=>{const U=this.pluralResolver.getSuffixes(I,i);D&&i[`defaultValue${this.options.pluralSeparator}zero`]&&U.indexOf(`${this.options.pluralSeparator}zero`)<0&&U.push(`${this.options.pluralSeparator}zero`),U.forEach(B=>{Q([I],s+B,i[`defaultValue${B}`]||F)})}):Q(ce,s,F))}p=this.extendTranslation(p,t,i,g,a),A&&p===s&&this.options.appendNamespaceToMissingKey&&(p=`${d}:${s}`),(A||x)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?p=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${d}:${s}`:s,x?p:void 0):p=this.options.parseMissingKeyHandler(p))}return n?(g.res=p,g.usedParams=this.getUsedParamsDetails(i),g):p}extendTranslation(t,i,a,n,r){var s=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...a},a.lng||this.language||n.usedLng,n.usedNS,n.usedKey,{resolved:n});else if(!a.skipInterpolation){a.interpolation&&this.interpolator.init({...a,interpolation:{...this.options.interpolation,...a.interpolation}});const u=typeof t=="string"&&(a&&a.interpolation&&a.interpolation.skipOnVariables!==void 0?a.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let h;if(u){const p=t.match(this.interpolator.nestingRegexp);h=p&&p.length}let g=a.replace&&typeof a.replace!="string"?a.replace:a;if(this.options.interpolation.defaultVariables&&(g={...this.options.interpolation.defaultVariables,...g}),t=this.interpolator.interpolate(t,g,a.lng||this.language,a),u){const p=t.match(this.interpolator.nestingRegexp),v=p&&p.length;h<v&&(a.nest=!1)}!a.lng&&this.options.compatibilityAPI!=="v1"&&n&&n.res&&(a.lng=n.usedLng),a.nest!==!1&&(t=this.interpolator.nest(t,function(){for(var p=arguments.length,v=new Array(p),f=0;f<p;f++)v[f]=arguments[f];return r&&r[0]===v[0]&&!a.context?(s.logger.warn(`It seems you are nesting recursively key: ${v[0]} in key: ${i[0]}`),null):s.translate(...v,i)},a)),a.interpolation&&this.interpolator.reset()}const l=a.postProcess||this.options.postProcess,d=typeof l=="string"?[l]:l;return t!=null&&d&&d.length&&a.applyPostProcessor!==!1&&(t=F1.handle(d,t,i,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...n,usedParams:this.getUsedParamsDetails(a)},...a}:a,this)),t}resolve(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a,n,r,s,l;return typeof t=="string"&&(t=[t]),t.forEach(d=>{if(this.isValidLookup(a))return;const u=this.extractFromKey(d,i),h=u.key;n=h;let g=u.namespaces;this.options.fallbackNS&&(g=g.concat(this.options.fallbackNS));const p=i.count!==void 0&&typeof i.count!="string",v=p&&!i.ordinal&&i.count===0&&this.pluralResolver.shouldUseIntlApi(),f=i.context!==void 0&&(typeof i.context=="string"||typeof i.context=="number")&&i.context!=="",b=i.lngs?i.lngs:this.languageUtils.toResolveHierarchy(i.lng||this.language,i.fallbackLng);g.forEach(w=>{this.isValidLookup(a)||(l=w,!Xg[`${b[0]}-${w}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(l)&&(Xg[`${b[0]}-${w}`]=!0,this.logger.warn(`key "${n}" for languages "${b.join(", ")}" won't get resolved as namespace "${l}" 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!!!")),b.forEach(y=>{if(this.isValidLookup(a))return;s=y;const k=[h];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(k,h,y,w,i);else{let x;p&&(x=this.pluralResolver.getSuffix(y,i.count,i));const A=`${this.options.pluralSeparator}zero`,z=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(p&&(k.push(h+x),i.ordinal&&x.indexOf(z)===0&&k.push(h+x.replace(z,this.options.pluralSeparator)),v&&k.push(h+A)),f){const S=`${h}${this.options.contextSeparator}${i.context}`;k.push(S),p&&(k.push(S+x),i.ordinal&&x.indexOf(z)===0&&k.push(S+x.replace(z,this.options.pluralSeparator)),v&&k.push(S+A))}}let _;for(;_=k.pop();)this.isValidLookup(a)||(r=_,a=this.getResource(y,w,_,i))}))})}),{res:a,usedKey:n,exactUsedKey:r,usedLng:s,usedNS:l}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,i,a){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,i,a,n):this.resourceStore.getResource(t,i,a,n)}getUsedParamsDetails(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const i=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],a=t.replace&&typeof t.replace!="string";let n=a?t.replace:t;if(a&&typeof t.count<"u"&&(n.count=t.count),this.options.interpolation.defaultVariables&&(n={...this.options.interpolation.defaultVariables,...n}),!a){n={...n};for(const r of i)delete n[r]}return n}static hasDefaultValue(t){const i="defaultValue";for(const a in t)if(Object.prototype.hasOwnProperty.call(t,a)&&i===a.substring(0,i.length)&&t[a]!==void 0)return!0;return!1}}function hd(e){return e.charAt(0).toUpperCase()+e.slice(1)}class ef{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=$i.create("languageUtils")}getScriptPartFromCode(t){if(t=Cl(t),!t||t.indexOf("-")<0)return null;const i=t.split("-");return i.length===2||(i.pop(),i[i.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(i.join("-"))}getLanguagePartFromCode(t){if(t=Cl(t),!t||t.indexOf("-")<0)return t;const i=t.split("-");return this.formatLanguageCode(i[0])}formatLanguageCode(t){if(typeof t=="string"&&t.indexOf("-")>-1){const i=["hans","hant","latn","cyrl","cans","mong","arab"];let a=t.split("-");return this.options.lowerCaseLng?a=a.map(n=>n.toLowerCase()):a.length===2?(a[0]=a[0].toLowerCase(),a[1]=a[1].toUpperCase(),i.indexOf(a[1].toLowerCase())>-1&&(a[1]=hd(a[1].toLowerCase()))):a.length===3&&(a[0]=a[0].toLowerCase(),a[1].length===2&&(a[1]=a[1].toUpperCase()),a[0]!=="sgn"&&a[2].length===2&&(a[2]=a[2].toUpperCase()),i.indexOf(a[1].toLowerCase())>-1&&(a[1]=hd(a[1].toLowerCase())),i.indexOf(a[2].toLowerCase())>-1&&(a[2]=hd(a[2].toLowerCase()))),a.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 i;return t.forEach(a=>{if(i)return;const n=this.formatLanguageCode(a);(!this.options.supportedLngs||this.isSupportedCode(n))&&(i=n)}),!i&&this.options.supportedLngs&&t.forEach(a=>{if(i)return;const n=this.getLanguagePartFromCode(a);if(this.isSupportedCode(n))return i=n;i=this.options.supportedLngs.find(r=>{if(r===n)return r;if(!(r.indexOf("-")<0&&n.indexOf("-")<0)&&(r.indexOf("-")>0&&n.indexOf("-")<0&&r.substring(0,r.indexOf("-"))===n||r.indexOf(n)===0&&n.length>1))return r})}),i||(i=this.getFallbackCodes(this.options.fallbackLng)[0]),i}getFallbackCodes(t,i){if(!t)return[];if(typeof t=="function"&&(t=t(i)),typeof t=="string"&&(t=[t]),Array.isArray(t))return t;if(!i)return t.default||[];let a=t[i];return a||(a=t[this.getScriptPartFromCode(i)]),a||(a=t[this.formatLanguageCode(i)]),a||(a=t[this.getLanguagePartFromCode(i)]),a||(a=t.default),a||[]}toResolveHierarchy(t,i){const a=this.getFallbackCodes(i||this.options.fallbackLng||[],t),n=[],r=s=>{s&&(this.isSupportedCode(s)?n.push(s):this.logger.warn(`rejecting language code not found in supportedLngs: ${s}`))};return typeof t=="string"&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&r(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&r(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&r(this.getLanguagePartFromCode(t))):typeof t=="string"&&r(this.formatLanguageCode(t)),a.forEach(s=>{n.indexOf(s)<0&&r(this.formatLanguageCode(s))}),n}}let fz=[{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}],bz={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 vz=["v1","v2","v3"],kz=["v4"],tf={zero:0,one:1,two:2,few:3,many:4,other:5};function yz(){const e={};return fz.forEach(t=>{t.lngs.forEach(i=>{e[i]={numbers:t.nr,plurals:bz[t.fc]}})}),e}class wz{constructor(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=i,this.logger=$i.create("pluralResolver"),(!this.options.compatibilityJSON||kz.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=yz()}addRule(t,i){this.rules[t]=i}getRule(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(Cl(t==="dev"?"en":t),{type:i.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}needsPlural(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const a=this.getRule(t,i);return this.shouldUseIntlApi()?a&&a.resolvedOptions().pluralCategories.length>1:a&&a.numbers.length>1}getPluralFormsOfKey(t,i){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,a).map(n=>`${i}${n}`)}getSuffixes(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const a=this.getRule(t,i);return a?this.shouldUseIntlApi()?a.resolvedOptions().pluralCategories.sort((n,r)=>tf[n]-tf[r]).map(n=>`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${n}`):a.numbers.map(n=>this.getSuffix(t,n,i)):[]}getSuffix(t,i){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const n=this.getRule(t,a);return n?this.shouldUseIntlApi()?`${this.options.prepend}${a.ordinal?`ordinal${this.options.prepend}`:""}${n.select(i)}`:this.getSuffixRetroCompatible(n,i):(this.logger.warn(`no plural rule found for: ${t}`),"")}getSuffixRetroCompatible(t,i){const a=t.noAbs?t.plurals(i):t.plurals(Math.abs(i));let n=t.numbers[a];this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1&&(n===2?n="plural":n===1&&(n=""));const r=()=>this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString();return this.options.compatibilityJSON==="v1"?n===1?"":typeof n=="number"?`_plural_${n.toString()}`:r():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1?r():this.options.prepend&&a.toString()?this.options.prepend+a.toString():a.toString()}shouldUseIntlApi(){return!vz.includes(this.options.compatibilityJSON)}}function af(e,t,i){let a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,r=cz(e,t,i);return!r&&n&&typeof i=="string"&&(r=Ku(e,i,a),r===void 0&&(r=Ku(t,i,a))),r}class _z{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=$i.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||(i=>i),this.init(t)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const{escape:i,escapeValue:a,useRawValueToEscape:n,prefix:r,prefixEscaped:s,suffix:l,suffixEscaped:d,formatSeparator:u,unescapeSuffix:h,unescapePrefix:g,nestingPrefix:p,nestingPrefixEscaped:v,nestingSuffix:f,nestingSuffixEscaped:b,nestingOptionsSeparator:w,maxReplaces:y,alwaysFormat:k}=t.interpolation;this.escape=i!==void 0?i:uz,this.escapeValue=a!==void 0?a:!0,this.useRawValueToEscape=n!==void 0?n:!1,this.prefix=r?qn(r):s||"{{",this.suffix=l?qn(l):d||"}}",this.formatSeparator=u||",",this.unescapePrefix=h?"":g||"-",this.unescapeSuffix=this.unescapePrefix?"":h||"",this.nestingPrefix=p?qn(p):v||qn("$t("),this.nestingSuffix=f?qn(f):b||qn(")"),this.nestingOptionsSeparator=w||",",this.maxReplaces=y||1e3,this.alwaysFormat=k!==void 0?k:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(i,a)=>i&&i.source===a?(i.lastIndex=0,i):new RegExp(a,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(t,i,a,n){let r,s,l;const d=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function u(f){return f.replace(/\$/g,"$$$$")}const h=f=>{if(f.indexOf(this.formatSeparator)<0){const k=af(i,d,f,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(k,void 0,a,{...n,...i,interpolationkey:f}):k}const b=f.split(this.formatSeparator),w=b.shift().trim(),y=b.join(this.formatSeparator).trim();return this.format(af(i,d,w,this.options.keySeparator,this.options.ignoreJSONStructure),y,a,{...n,...i,interpolationkey:w})};this.resetRegExp();const g=n&&n.missingInterpolationHandler||this.options.missingInterpolationHandler,p=n&&n.interpolation&&n.interpolation.skipOnVariables!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:f=>u(f)},{regex:this.regexp,safeValue:f=>this.escapeValue?u(this.escape(f)):u(f)}].forEach(f=>{for(l=0;r=f.regex.exec(t);){const b=r[1].trim();if(s=h(b),s===void 0)if(typeof g=="function"){const y=g(t,r,n);s=typeof y=="string"?y:""}else if(n&&Object.prototype.hasOwnProperty.call(n,b))s="";else if(p){s=r[0];continue}else this.logger.warn(`missed to pass in variable ${b} for interpolating ${t}`),s="";else typeof s!="string"&&!this.useRawValueToEscape&&(s=Jg(s));const w=f.safeValue(s);if(t=t.replace(r[0],w),p?(f.regex.lastIndex+=s.length,f.regex.lastIndex-=r[0].length):f.regex.lastIndex=0,l++,l>=this.maxReplaces)break}}),t}nest(t,i){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n,r,s;function l(d,u){const h=this.nestingOptionsSeparator;if(d.indexOf(h)<0)return d;const g=d.split(new RegExp(`${h}[ ]*{`));let p=`{${g[1]}`;d=g[0],p=this.interpolate(p,s);const v=p.match(/'/g),f=p.match(/"/g);(v&&v.length%2===0&&!f||f.length%2!==0)&&(p=p.replace(/'/g,'"'));try{s=JSON.parse(p),u&&(s={...u,...s})}catch(b){return this.logger.warn(`failed parsing options string in nesting for key ${d}`,b),`${d}${h}${p}`}return s.defaultValue&&s.defaultValue.indexOf(this.prefix)>-1&&delete s.defaultValue,d}for(;n=this.nestingRegexp.exec(t);){let d=[];s={...a},s=s.replace&&typeof s.replace!="string"?s.replace:s,s.applyPostProcessor=!1,delete s.defaultValue;let u=!1;if(n[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(n[1])){const h=n[1].split(this.formatSeparator).map(g=>g.trim());n[1]=h.shift(),d=h,u=!0}if(r=i(l.call(this,n[1].trim(),s),s),r&&n[0]===t&&typeof r!="string")return r;typeof r!="string"&&(r=Jg(r)),r||(this.logger.warn(`missed to resolve ${n[1]} for nesting ${t}`),r=""),u&&(r=d.reduce((h,g)=>this.format(h,g,a.lng,{...a,interpolationkey:n[1].trim()}),r.trim())),t=t.replace(n[0],r),this.regexp.lastIndex=0}return t}}function xz(e){let t=e.toLowerCase().trim();const i={};if(e.indexOf("(")>-1){const a=e.split("(");t=a[0].toLowerCase().trim();const n=a[1].substring(0,a[1].length-1);t==="currency"&&n.indexOf(":")<0?i.currency||(i.currency=n.trim()):t==="relativetime"&&n.indexOf(":")<0?i.range||(i.range=n.trim()):n.split(";").forEach(s=>{if(s){const[l,...d]=s.split(":"),u=d.join(":").trim().replace(/^'+|'+$/g,""),h=l.trim();i[h]||(i[h]=u),u==="false"&&(i[h]=!1),u==="true"&&(i[h]=!0),isNaN(u)||(i[h]=parseInt(u,10))}})}return{formatName:t,formatOptions:i}}function Fn(e){const t={};return function(a,n,r){const s=n+JSON.stringify(r);let l=t[s];return l||(l=e(Cl(n),r),t[s]=l),l(a)}}let zz=class{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=$i.create("formatter"),this.options=t,this.formats={number:Fn((i,a)=>{const n=new Intl.NumberFormat(i,{...a});return r=>n.format(r)}),currency:Fn((i,a)=>{const n=new Intl.NumberFormat(i,{...a,style:"currency"});return r=>n.format(r)}),datetime:Fn((i,a)=>{const n=new Intl.DateTimeFormat(i,{...a});return r=>n.format(r)}),relativetime:Fn((i,a)=>{const n=new Intl.RelativeTimeFormat(i,{...a});return r=>n.format(r,a.range||"day")}),list:Fn((i,a)=>{const n=new Intl.ListFormat(i,{...a});return r=>n.format(r)})},this.init(t)}init(t){const a=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=a.formatSeparator?a.formatSeparator:a.formatSeparator||","}add(t,i){this.formats[t.toLowerCase().trim()]=i}addCached(t,i){this.formats[t.toLowerCase().trim()]=Fn(i)}format(t,i,a){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return i.split(this.formatSeparator).reduce((l,d)=>{const{formatName:u,formatOptions:h}=xz(d);if(this.formats[u]){let g=l;try{const p=n&&n.formatParams&&n.formatParams[n.interpolationkey]||{},v=p.locale||p.lng||n.locale||n.lng||a;g=this.formats[u](l,v,{...h,...n,...p})}catch(p){this.logger.warn(p)}return g}else this.logger.warn(`there was no format function for ${u}`);return l},t)}};function Az(e,t){e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)}class jz extends mc{constructor(t,i,a){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=t,this.store=i,this.services=a,this.languageUtils=a.languageUtils,this.options=n,this.logger=$i.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=n.maxParallelReads||10,this.readingCalls=0,this.maxRetries=n.maxRetries>=0?n.maxRetries:5,this.retryTimeout=n.retryTimeout>=1?n.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(a,n.backend,n)}queueLoad(t,i,a,n){const r={},s={},l={},d={};return t.forEach(u=>{let h=!0;i.forEach(g=>{const p=`${u}|${g}`;!a.reload&&this.store.hasResourceBundle(u,g)?this.state[p]=2:this.state[p]<0||(this.state[p]===1?s[p]===void 0&&(s[p]=!0):(this.state[p]=1,h=!1,s[p]===void 0&&(s[p]=!0),r[p]===void 0&&(r[p]=!0),d[g]===void 0&&(d[g]=!0)))}),h||(l[u]=!0)}),(Object.keys(r).length||Object.keys(s).length)&&this.queue.push({pending:s,pendingCount:Object.keys(s).length,loaded:{},errors:[],callback:n}),{toLoad:Object.keys(r),pending:Object.keys(s),toLoadLanguages:Object.keys(l),toLoadNamespaces:Object.keys(d)}}loaded(t,i,a){const n=t.split("|"),r=n[0],s=n[1];i&&this.emit("failedLoading",r,s,i),a&&this.store.addResourceBundle(r,s,a,void 0,void 0,{skipCopy:!0}),this.state[t]=i?-1:2;const l={};this.queue.forEach(d=>{lz(d.loaded,[r],s),Az(d,t),i&&d.errors.push(i),d.pendingCount===0&&!d.done&&(Object.keys(d.loaded).forEach(u=>{l[u]||(l[u]={});const h=d.loaded[u];h.length&&h.forEach(g=>{l[u][g]===void 0&&(l[u][g]=!0)})}),d.done=!0,d.errors.length?d.callback(d.errors):d.callback())}),this.emit("loaded",l),this.queue=this.queue.filter(d=>!d.done)}read(t,i,a){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,s=arguments.length>5?arguments[5]:void 0;if(!t.length)return s(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:i,fcName:a,tried:n,wait:r,callback:s});return}this.readingCalls++;const l=(u,h)=>{if(this.readingCalls--,this.waitingReads.length>0){const g=this.waitingReads.shift();this.read(g.lng,g.ns,g.fcName,g.tried,g.wait,g.callback)}if(u&&h&&n<this.maxRetries){setTimeout(()=>{this.read.call(this,t,i,a,n+1,r*2,s)},r);return}s(u,h)},d=this.backend[a].bind(this.backend);if(d.length===2){try{const u=d(t,i);u&&typeof u.then=="function"?u.then(h=>l(null,h)).catch(l):l(null,u)}catch(u){l(u)}return}return d(t,i,l)}prepareLoading(t,i){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=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."),n&&n();typeof t=="string"&&(t=this.languageUtils.toResolveHierarchy(t)),typeof i=="string"&&(i=[i]);const r=this.queueLoad(t,i,a,n);if(!r.toLoad.length)return r.pending.length||n(),null;r.toLoad.forEach(s=>{this.loadOne(s)})}load(t,i,a){this.prepareLoading(t,i,{},a)}reload(t,i,a){this.prepareLoading(t,i,{reload:!0},a)}loadOne(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const a=t.split("|"),n=a[0],r=a[1];this.read(n,r,"read",void 0,void 0,(s,l)=>{s&&this.logger.warn(`${i}loading namespace ${r} for language ${n} failed`,s),!s&&l&&this.logger.log(`${i}loaded namespace ${r} for language ${n}`,l),this.loaded(t,s,l)})}saveMissing(t,i,a,n,r){let s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},l=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(i)){this.logger.warn(`did not save key "${a}" as the namespace "${i}" 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(!(a==null||a==="")){if(this.backend&&this.backend.create){const d={...s,isUpdate:r},u=this.backend.create.bind(this.backend);if(u.length<6)try{let h;u.length===5?h=u(t,i,a,n,d):h=u(t,i,a,n),h&&typeof h.then=="function"?h.then(g=>l(null,g)).catch(l):l(null,h)}catch(h){l(h)}else u(t,i,a,n,l,d)}!t||!t[0]||this.store.addResource(t[0],i,a,n)}}}function nf(){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 i={};if(typeof t[1]=="object"&&(i=t[1]),typeof t[1]=="string"&&(i.defaultValue=t[1]),typeof t[2]=="string"&&(i.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const a=t[3]||t[2];Object.keys(a).forEach(n=>{i[n]=a[n]})}return i},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function rf(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 Ns(){}function Lz(e){Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(i=>{typeof e[i]=="function"&&(e[i]=e[i].bind(e))})}class Eo extends mc{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if(super(),this.options=rf(t),this.services={},this.logger=$i,this.modules={external:[]},Lz(this),i&&!this.isInitialized&&!t.isClone){if(!this.options.initImmediate)return this.init(t,i),this;setTimeout(()=>{this.init(t,i)},0)}}init(){var t=this;let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof i=="function"&&(a=i,i={}),!i.defaultNS&&i.defaultNS!==!1&&i.ns&&(typeof i.ns=="string"?i.defaultNS=i.ns:i.ns.indexOf("translation")<0&&(i.defaultNS=i.ns[0]));const n=nf();this.options={...n,...this.options,...rf(i)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...n.interpolation,...this.options.interpolation}),i.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=i.keySeparator),i.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=i.nsSeparator);function r(h){return h?typeof h=="function"?new h:h:null}if(!this.options.isClone){this.modules.logger?$i.init(r(this.modules.logger),this.options):$i.init(null,this.options);let h;this.modules.formatter?h=this.modules.formatter:typeof Intl<"u"&&(h=zz);const g=new ef(this.options);this.store=new Yg(this.options.resources,this.options);const p=this.services;p.logger=$i,p.resourceStore=this.store,p.languageUtils=g,p.pluralResolver=new wz(g,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),h&&(!this.options.interpolation.format||this.options.interpolation.format===n.interpolation.format)&&(p.formatter=r(h),p.formatter.init(p,this.options),this.options.interpolation.format=p.formatter.format.bind(p.formatter)),p.interpolator=new _z(this.options),p.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},p.backendConnector=new jz(r(this.modules.backend),p.resourceStore,p,this.options),p.backendConnector.on("*",function(v){for(var f=arguments.length,b=new Array(f>1?f-1:0),w=1;w<f;w++)b[w-1]=arguments[w];t.emit(v,...b)}),this.modules.languageDetector&&(p.languageDetector=r(this.modules.languageDetector),p.languageDetector.init&&p.languageDetector.init(p,this.options.detection,this.options)),this.modules.i18nFormat&&(p.i18nFormat=r(this.modules.i18nFormat),p.i18nFormat.init&&p.i18nFormat.init(this)),this.translator=new El(this.services,this.options),this.translator.on("*",function(v){for(var f=arguments.length,b=new Array(f>1?f-1:0),w=1;w<f;w++)b[w-1]=arguments[w];t.emit(v,...b)}),this.modules.external.forEach(v=>{v.init&&v.init(this)})}if(this.format=this.options.interpolation.format,a||(a=Ns),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const h=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);h.length>0&&h[0]!=="dev"&&(this.options.lng=h[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(h=>{this[h]=function(){return t.store[h](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(h=>{this[h]=function(){return t.store[h](...arguments),t}});const d=Fr(),u=()=>{const h=(g,p)=>{this.isInitializing=!1,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),d.resolve(p),a(g,p)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return h(null,this.t.bind(this));this.changeLanguage(this.options.lng,h)};return this.options.resources||!this.options.initImmediate?u():setTimeout(u,0),d}loadResources(t){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ns;const n=typeof t=="string"?t:this.language;if(typeof t=="function"&&(a=t),!this.options.resources||this.options.partialBundledLanguages){if(n&&n.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return a();const r=[],s=l=>{if(!l||l==="cimode")return;this.services.languageUtils.toResolveHierarchy(l).forEach(u=>{u!=="cimode"&&r.indexOf(u)<0&&r.push(u)})};n?s(n):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(d=>s(d)),this.options.preload&&this.options.preload.forEach(l=>s(l)),this.services.backendConnector.load(r,this.options.ns,l=>{!l&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),a(l)})}else a(null)}reloadResources(t,i,a){const n=Fr();return t||(t=this.languages),i||(i=this.options.ns),a||(a=Ns),this.services.backendConnector.reload(t,i,r=>{n.resolve(),a(r)}),n}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"&&F1.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 i=0;i<this.languages.length;i++){const a=this.languages[i];if(!(["cimode","dev"].indexOf(a)>-1)&&this.store.hasLanguageSomeTranslations(a)){this.resolvedLanguage=a;break}}}changeLanguage(t,i){var a=this;this.isLanguageChangingTo=t;const n=Fr();this.emit("languageChanging",t);const r=d=>{this.language=d,this.languages=this.services.languageUtils.toResolveHierarchy(d),this.resolvedLanguage=void 0,this.setResolvedLanguage(d)},s=(d,u)=>{u?(r(u),this.translator.changeLanguage(u),this.isLanguageChangingTo=void 0,this.emit("languageChanged",u),this.logger.log("languageChanged",u)):this.isLanguageChangingTo=void 0,n.resolve(function(){return a.t(...arguments)}),i&&i(d,function(){return a.t(...arguments)})},l=d=>{!t&&!d&&this.services.languageDetector&&(d=[]);const u=typeof d=="string"?d:this.services.languageUtils.getBestMatchFromCodes(d);u&&(this.language||r(u),this.translator.language||this.translator.changeLanguage(u),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(u)),this.loadResources(u,h=>{s(h,u)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?l(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(l):this.services.languageDetector.detect(l):l(t),n}getFixedT(t,i,a){var n=this;const r=function(s,l){let d;if(typeof l!="object"){for(var u=arguments.length,h=new Array(u>2?u-2:0),g=2;g<u;g++)h[g-2]=arguments[g];d=n.options.overloadTranslationOptionHandler([s,l].concat(h))}else d={...l};d.lng=d.lng||r.lng,d.lngs=d.lngs||r.lngs,d.ns=d.ns||r.ns,d.keyPrefix!==""&&(d.keyPrefix=d.keyPrefix||a||r.keyPrefix);const p=n.options.keySeparator||".";let v;return d.keyPrefix&&Array.isArray(s)?v=s.map(f=>`${d.keyPrefix}${p}${f}`):v=d.keyPrefix?`${d.keyPrefix}${p}${s}`:s,n.t(v,d)};return typeof t=="string"?r.lng=t:r.lngs=t,r.ns=i,r.keyPrefix=a,r}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 i=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 a=i.lng||this.resolvedLanguage||this.languages[0],n=this.options?this.options.fallbackLng:!1,r=this.languages[this.languages.length-1];if(a.toLowerCase()==="cimode")return!0;const s=(l,d)=>{const u=this.services.backendConnector.state[`${l}|${d}`];return u===-1||u===2};if(i.precheck){const l=i.precheck(this,s);if(l!==void 0)return l}return!!(this.hasResourceBundle(a,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||s(a,t)&&(!n||s(r,t)))}loadNamespaces(t,i){const a=Fr();return this.options.ns?(typeof t=="string"&&(t=[t]),t.forEach(n=>{this.options.ns.indexOf(n)<0&&this.options.ns.push(n)}),this.loadResources(n=>{a.resolve(),i&&i(n)}),a):(i&&i(),Promise.resolve())}loadLanguages(t,i){const a=Fr();typeof t=="string"&&(t=[t]);const n=this.options.preload||[],r=t.filter(s=>n.indexOf(s)<0&&this.services.languageUtils.isSupportedCode(s));return r.length?(this.options.preload=n.concat(r),this.loadResources(s=>{a.resolve(),i&&i(s)}),a):(i&&i(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!t)return"rtl";const i=["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"],a=this.services&&this.services.languageUtils||new ef(nf());return i.indexOf(a.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;return new Eo(t,i)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ns;const a=t.forkResourceStore;a&&delete t.forkResourceStore;const n={...this.options,...t,isClone:!0},r=new Eo(n);return(t.debug!==void 0||t.prefix!==void 0)&&(r.logger=r.logger.clone(t)),["store","services","language"].forEach(l=>{r[l]=this[l]}),r.services={...this.services},r.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},a&&(r.store=new Yg(this.store.data,n),r.services.resourceStore=r.store),r.translator=new El(r.services,n),r.translator.on("*",function(l){for(var d=arguments.length,u=new Array(d>1?d-1:0),h=1;h<d;h++)u[h-1]=arguments[h];r.emit(l,...u)}),r.init(n,i),r.translator.options=n,r.translator.backendConnector.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},r}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const vt=Eo.createInstance();vt.createInstance=Eo.createInstance;vt.createInstance;vt.dir;vt.init;vt.loadResources;vt.reloadResources;vt.use;vt.changeLanguage;vt.getFixedT;const Un=vt.t;vt.exists;vt.setDefaultNamespace;vt.hasLoadedNamespace;vt.loadNamespaces;vt.loadLanguages;function Sz(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function To(e){"@babel/helpers - typeof";return To=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},To(e)}function Mz(e,t){if(To(e)!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var a=i.call(e,t||"default");if(To(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Pz(e){var t=Mz(e,"string");return To(t)=="symbol"?t:t+""}function of(e,t){for(var i=0;i<t.length;i++){var a=t[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,Pz(a.key),a)}}function Cz(e,t,i){return t&&of(e.prototype,t),i&&of(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}var U1=[],Ez=U1.forEach,Tz=U1.slice;function Iz(e){return Ez.call(Tz.call(arguments,1),function(t){if(t)for(var i in t)e[i]===void 0&&(e[i]=t[i])}),e}var sf=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Nz=function(t,i,a){var n=a||{};n.path=n.path||"/";var r=encodeURIComponent(i),s="".concat(t,"=").concat(r);if(n.maxAge>0){var l=n.maxAge-0;if(Number.isNaN(l))throw new Error("maxAge should be a Number");s+="; Max-Age=".concat(Math.floor(l))}if(n.domain){if(!sf.test(n.domain))throw new TypeError("option domain is invalid");s+="; Domain=".concat(n.domain)}if(n.path){if(!sf.test(n.path))throw new TypeError("option path is invalid");s+="; Path=".concat(n.path)}if(n.expires){if(typeof n.expires.toUTCString!="function")throw new TypeError("option expires is invalid");s+="; Expires=".concat(n.expires.toUTCString())}if(n.httpOnly&&(s+="; HttpOnly"),n.secure&&(s+="; Secure"),n.sameSite){var d=typeof n.sameSite=="string"?n.sameSite.toLowerCase():n.sameSite;switch(d){case!0:s+="; SameSite=Strict";break;case"lax":s+="; SameSite=Lax";break;case"strict":s+="; SameSite=Strict";break;case"none":s+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return s},lf={create:function(t,i,a,n){var r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};a&&(r.expires=new Date,r.expires.setTime(r.expires.getTime()+a*60*1e3)),n&&(r.domain=n),document.cookie=Nz(t,encodeURIComponent(i),r)},read:function(t){for(var i="".concat(t,"="),a=document.cookie.split(";"),n=0;n<a.length;n++){for(var r=a[n];r.charAt(0)===" ";)r=r.substring(1,r.length);if(r.indexOf(i)===0)return r.substring(i.length,r.length)}return null},remove:function(t){this.create(t,"",-1)}},Dz={name:"cookie",lookup:function(t){var i;if(t.lookupCookie&&typeof document<"u"){var a=lf.read(t.lookupCookie);a&&(i=a)}return i},cacheUserLanguage:function(t,i){i.lookupCookie&&typeof document<"u"&&lf.create(i.lookupCookie,t,i.cookieMinutes,i.cookieDomain,i.cookieOptions)}},Oz={name:"querystring",lookup:function(t){var i;if(typeof window<"u"){var a=window.location.search;!window.location.search&&window.location.hash&&window.location.hash.indexOf("?")>-1&&(a=window.location.hash.substring(window.location.hash.indexOf("?")));for(var n=a.substring(1),r=n.split("&"),s=0;s<r.length;s++){var l=r[s].indexOf("=");if(l>0){var d=r[s].substring(0,l);d===t.lookupQuerystring&&(i=r[s].substring(l+1))}}}return i}},Ur=null,cf=function(){if(Ur!==null)return Ur;try{Ur=window!=="undefined"&&window.localStorage!==null;var t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{Ur=!1}return Ur},Rz={name:"localStorage",lookup:function(t){var i;if(t.lookupLocalStorage&&cf()){var a=window.localStorage.getItem(t.lookupLocalStorage);a&&(i=a)}return i},cacheUserLanguage:function(t,i){i.lookupLocalStorage&&cf()&&window.localStorage.setItem(i.lookupLocalStorage,t)}},Br=null,df=function(){if(Br!==null)return Br;try{Br=window!=="undefined"&&window.sessionStorage!==null;var t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{Br=!1}return Br},Hz={name:"sessionStorage",lookup:function(t){var i;if(t.lookupSessionStorage&&df()){var a=window.sessionStorage.getItem(t.lookupSessionStorage);a&&(i=a)}return i},cacheUserLanguage:function(t,i){i.lookupSessionStorage&&df()&&window.sessionStorage.setItem(i.lookupSessionStorage,t)}},Vz={name:"navigator",lookup:function(t){var i=[];if(typeof navigator<"u"){if(navigator.languages)for(var a=0;a<navigator.languages.length;a++)i.push(navigator.languages[a]);navigator.userLanguage&&i.push(navigator.userLanguage),navigator.language&&i.push(navigator.language)}return i.length>0?i:void 0}},qz={name:"htmlTag",lookup:function(t){var i,a=t.htmlTag||(typeof document<"u"?document.documentElement:null);return a&&typeof a.getAttribute=="function"&&(i=a.getAttribute("lang")),i}},Fz={name:"path",lookup:function(t){var i;if(typeof window<"u"){var a=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(a instanceof Array)if(typeof t.lookupFromPathIndex=="number"){if(typeof a[t.lookupFromPathIndex]!="string")return;i=a[t.lookupFromPathIndex].replace("/","")}else i=a[0].replace("/","")}return i}},Uz={name:"subdomain",lookup:function(t){var i=typeof t.lookupFromSubdomainIndex=="number"?t.lookupFromSubdomainIndex+1:1,a=typeof window<"u"&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(a)return a[i]}};function Bz(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:function(t){return t}}}var B1=function(){function e(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Sz(this,e),this.type="languageDetector",this.detectors={},this.init(t,i)}return Cz(e,[{key:"init",value:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=i||{languageUtils:{}},this.options=Iz(a,this.options||{},Bz()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=function(r){return r.replace("-","_")}),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=n,this.addDetector(Dz),this.addDetector(Oz),this.addDetector(Rz),this.addDetector(Hz),this.addDetector(Vz),this.addDetector(qz),this.addDetector(Fz),this.addDetector(Uz)}},{key:"addDetector",value:function(i){return this.detectors[i.name]=i,this}},{key:"detect",value:function(i){var a=this;i||(i=this.options.order);var n=[];return i.forEach(function(r){if(a.detectors[r]){var s=a.detectors[r].lookup(a.options);s&&typeof s=="string"&&(s=[s]),s&&(n=n.concat(s))}}),n=n.map(function(r){return a.options.convertDetectedLanguage(r)}),this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}},{key:"cacheUserLanguage",value:function(i,a){var n=this;a||(a=this.options.caches),a&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(i)>-1||a.forEach(function(r){n.detectors[r]&&n.detectors[r].cacheUserLanguage(i,n.options)}))}}]),e}();B1.type="languageDetector";const Gz={onboarding:{home:{welcome:"Welcome",getStarted:"Get Started"},llm:{title:"LLM Preference",description:"Totem LLM can work with many LLM providers. This will be the service which handles chatting."},userSetup:{title:"User Setup",description:"Configure your user settings.",howManyUsers:"How many users will be using this instance?",justMe:"Just me",myTeam:"My team",instancePassword:"Instance Password",setPassword:"Would you like to set up a password?",passwordReq:"Passwords must be at least 8 characters.",passwordWarn:"It's important to save this password because there is no recovery method.",adminUsername:"Admin account username",adminPassword:"Admin account password",adminPasswordReq:"Passwords must be at least 8 characters.",teamHint:"By default, you will be the only admin. Once onboarding is completed you can create and invite others to be users or admins. Do not lose your password as only admins can reset passwords."},data:{title:"Data Handling & Privacy",description:"We are committed to transparency and control when it comes to your personal data.",settingsHint:"These settings can be reconfigured at any time in the settings."},survey:{title:"Welcome to Totem LLM",description:"Help us make Totem LLM built for your needs. Optional.",email:"What's your email?",useCase:"What will you use Totem LLM for?",useCaseWork:"For work",useCasePersonal:"For personal use",useCaseOther:"Other",comment:"How did you hear about Totem LLM?",commentPlaceholder:"Reddit, Twitter, GitHub, YouTube, etc. - Let us know how you found us!",skip:"Skip Survey",thankYou:"Thank you for your feedback!"}},common:{"workspaces-name":"Workspace Name",selection:"Model Selection",saving:"Saving...",save:"Save changes",previous:"Previous Page",next:"Next Page",optional:"Optional",yes:"Yes",no:"No",on:"On",none:"None",stopped:"Stopped",search:"Search",username_requirements:"Username must be 2-32 characters, start with a lowercase letter, and only contain lowercase letters, numbers, underscores, hyphens, and periods.",loading:"Loading",refresh:"Refresh"},home:{welcome:"Welcome",chooseWorkspace:"Choose a workspace to start chatting!",notAssigned:`You currently aren't assigned to any workspaces.
|
|
69
|
+
*/function wr(){return wr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(e[a]=i[a])}return e},wr.apply(this,arguments)}function C1(e,t){if(e==null)return{};var i={},a=Object.keys(e),n,r;for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&(i[n]=e[n]);return i}function Q4(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Y4(e,t){return e.button===0&&(!t||t==="_self")&&!Q4(e)}function Vu(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,i)=>{let a=e[i];return t.concat(Array.isArray(a)?a.map(n=>[i,n]):[[i,a]])},[]))}function X4(e,t){let i=Vu(e);return t&&t.forEach((a,n)=>{i.has(n)||t.getAll(n).forEach(r=>{i.append(n,r)})}),i}const e6=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],t6=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"],i6="6";try{window.__reactRouterVersion=i6}catch{}function a6(e,t){return u4({basename:t==null?void 0:t.basename,future:wr({},t==null?void 0:t.future,{v7_prependBasename:!0}),history:D8({window:t==null?void 0:t.window}),hydrationData:(t==null?void 0:t.hydrationData)||n6(),routes:e,mapRouteProperties:J4,unstable_dataStrategy:t==null?void 0:t.unstable_dataStrategy,unstable_patchRoutesOnMiss:t==null?void 0:t.unstable_patchRoutesOnMiss,window:t==null?void 0:t.window}).initialize()}function n6(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=wr({},t,{errors:r6(t.errors)})),t}function r6(e){if(!e)return null;let t=Object.entries(e),i={};for(let[a,n]of t)if(n&&n.__type==="RouteErrorResponse")i[a]=new pm(n.status,n.statusText,n.data,n.internal===!0);else if(n&&n.__type==="Error"){if(n.__subType){let r=window[n.__subType];if(typeof r=="function")try{let s=new r(n.message);s.stack="",i[a]=s}catch{}}if(i[a]==null){let r=new Error(n.message);r.stack="",i[a]=r}}else i[a]=n;return i}const E1=m.createContext({isTransitioning:!1}),o6=m.createContext(new Map),s6="startTransition",Hg=x_[s6],l6="flushSync",Vg=N8[l6];function c6(e){Hg?Hg(e):e()}function qr(e){Vg?Vg(e):e()}class d6{constructor(){this.status="pending",this.promise=new Promise((t,i)=>{this.resolve=a=>{this.status==="pending"&&(this.status="resolved",t(a))},this.reject=a=>{this.status==="pending"&&(this.status="rejected",i(a))}})}}function u6(e){let{fallbackElement:t,router:i,future:a}=e,[n,r]=m.useState(i.state),[s,l]=m.useState(),[d,u]=m.useState({isTransitioning:!1}),[h,g]=m.useState(),[p,v]=m.useState(),[f,b]=m.useState(),w=m.useRef(new Map),{v7_startTransition:y}=a||{},k=m.useCallback(M=>{y?c6(M):M()},[y]),_=m.useCallback((M,T)=>{let{deletedFetchers:D,unstable_flushSync:F,unstable_viewTransitionOpts:O}=T;D.forEach(R=>w.current.delete(R)),M.fetchers.forEach((R,ce)=>{R.data!==void 0&&w.current.set(ce,R.data)});let Z=i.window==null||i.window.document==null||typeof i.window.document.startViewTransition!="function";if(!O||Z){F?qr(()=>r(M)):k(()=>r(M));return}if(F){qr(()=>{p&&(h&&h.resolve(),p.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:O.currentLocation,nextLocation:O.nextLocation})});let R=i.window.document.startViewTransition(()=>{qr(()=>r(M))});R.finished.finally(()=>{qr(()=>{g(void 0),v(void 0),l(void 0),u({isTransitioning:!1})})}),qr(()=>v(R));return}p?(h&&h.resolve(),p.skipTransition(),b({state:M,currentLocation:O.currentLocation,nextLocation:O.nextLocation})):(l(M),u({isTransitioning:!0,flushSync:!1,currentLocation:O.currentLocation,nextLocation:O.nextLocation}))},[i.window,p,h,w,k]);m.useLayoutEffect(()=>i.subscribe(_),[i,_]),m.useEffect(()=>{d.isTransitioning&&!d.flushSync&&g(new d6)},[d]),m.useEffect(()=>{if(h&&s&&i.window){let M=s,T=h.promise,D=i.window.document.startViewTransition(async()=>{k(()=>r(M)),await T});D.finished.finally(()=>{g(void 0),v(void 0),l(void 0),u({isTransitioning:!1})}),v(D)}},[k,s,h,i.window]),m.useEffect(()=>{h&&s&&n.location.key===s.location.key&&h.resolve()},[h,p,n.location,s]),m.useEffect(()=>{!d.isTransitioning&&f&&(l(f.state),u({isTransitioning:!0,flushSync:!1,currentLocation:f.currentLocation,nextLocation:f.nextLocation}),b(void 0))},[d.isTransitioning,f]),m.useEffect(()=>{},[]);let x=m.useMemo(()=>({createHref:i.createHref,encodeLocation:i.encodeLocation,go:M=>i.navigate(M),push:(M,T,D)=>i.navigate(M,{state:T,preventScrollReset:D==null?void 0:D.preventScrollReset}),replace:(M,T,D)=>i.navigate(M,{replace:!0,state:T,preventScrollReset:D==null?void 0:D.preventScrollReset})}),[i]),A=i.basename||"/",z=m.useMemo(()=>({router:i,navigator:x,static:!1,basename:A}),[i,x,A]),S=m.useMemo(()=>({v7_relativeSplatPath:i.future.v7_relativeSplatPath}),[i.future.v7_relativeSplatPath]);return m.createElement(m.Fragment,null,m.createElement(ss.Provider,{value:z},m.createElement(gm.Provider,{value:n},m.createElement(o6.Provider,{value:w.current},m.createElement(E1.Provider,{value:d},m.createElement(Z4,{basename:A,location:n.location,navigationType:n.historyAction,navigator:x,future:S},n.initialized||i.future.v7_partialHydration?m.createElement(p6,{routes:i.routes,future:i.future,state:n}):t))))),null)}const p6=m.memo(m6);function m6(e){let{routes:t,future:i,state:a}=e;return D4(t,void 0,a,i)}const h6=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",g6=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Vt=m.forwardRef(function(t,i){let{onClick:a,relative:n,reloadDocument:r,replace:s,state:l,target:d,to:u,preventScrollReset:h,unstable_viewTransition:g}=t,p=C1(t,e6),{basename:v}=m.useContext(Aa),f,b=!1;if(typeof u=="string"&&g6.test(u)&&(f=u,h6))try{let _=new URL(window.location.href),x=u.startsWith("//")?new URL(_.protocol+u):new URL(u),A=wa(x.pathname,v);x.origin===_.origin&&A!=null?u=A+x.search+x.hash:b=!0}catch{}let w=C4(u,{relative:n}),y=v6(u,{replace:s,state:l,target:d,preventScrollReset:h,relative:n,unstable_viewTransition:g});function k(_){a&&a(_),_.defaultPrevented||y(_)}return m.createElement("a",wr({},p,{href:f||w,onClick:b||r?a:k,ref:i,target:d}))}),f6=m.forwardRef(function(t,i){let{"aria-current":a="page",caseSensitive:n=!1,className:r="",end:s=!1,style:l,to:d,unstable_viewTransition:u,children:h}=t,g=C1(t,t6),p=cc(d,{relative:g.relative}),v=ta(),f=m.useContext(gm),{navigator:b,basename:w}=m.useContext(Aa),y=f!=null&&k6(p)&&u===!0,k=b.encodeLocation?b.encodeLocation(p).pathname:p.pathname,_=v.pathname,x=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;n||(_=_.toLowerCase(),x=x?x.toLowerCase():null,k=k.toLowerCase()),x&&w&&(x=wa(x,w)||x);const A=k!=="/"&&k.endsWith("/")?k.length-1:k.length;let z=_===k||!s&&_.startsWith(k)&&_.charAt(A)==="/",S=x!=null&&(x===k||!s&&x.startsWith(k)&&x.charAt(k.length)==="/"),M={isActive:z,isPending:S,isTransitioning:y},T=z?a:void 0,D;typeof r=="function"?D=r(M):D=[r,z?"active":null,S?"pending":null,y?"transitioning":null].filter(Boolean).join(" ");let F=typeof l=="function"?l(M):l;return m.createElement(Vt,wr({},g,{"aria-current":T,className:D,ref:i,style:F,to:d,unstable_viewTransition:u}),typeof h=="function"?h(M):h)});var qu;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(qu||(qu={}));var qg;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(qg||(qg={}));function b6(e){let t=m.useContext(ss);return t||ge(!1),t}function v6(e,t){let{target:i,replace:a,state:n,preventScrollReset:r,relative:s,unstable_viewTransition:l}=t===void 0?{}:t,d=ia(),u=ta(),h=cc(e,{relative:s});return m.useCallback(g=>{if(Y4(g,i)){g.preventDefault();let p=a!==void 0?a:An(u)===An(h);d(e,{replace:p,state:n,preventScrollReset:r,relative:s,unstable_viewTransition:l})}},[u,d,h,a,n,i,e,r,s,l])}function SD(e){let t=m.useRef(Vu(e)),i=m.useRef(!1),a=ta(),n=m.useMemo(()=>X4(a.search,i.current?null:t.current),[a.search]),r=ia(),s=m.useCallback((l,d)=>{const u=Vu(typeof l=="function"?l(n):l);i.current=!0,r("?"+u,d)},[r,n]);return[n,s]}function k6(e,t){t===void 0&&(t={});let i=m.useContext(E1);i==null&&ge(!1);let{basename:a}=b6(qu.useViewTransitionState),n=cc(e,{relative:t.relative});if(!i.isTransitioning)return!1;let r=wa(i.currentLocation.pathname,a)||i.currentLocation.pathname,s=wa(i.nextLocation.pathname,a)||i.nextLocation.pathname;return Po(n.pathname,s)!=null||Po(n.pathname,r)!=null}function y6(){if(console&&console.warn){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];vn(t[0])&&(t[0]=`react-i18next:: ${t[0]}`),console.warn(...t)}}const Fg={};function Fu(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];vn(t[0])&&Fg[t[0]]||(vn(t[0])&&(Fg[t[0]]=new Date),y6(...t))}const T1=(e,t)=>()=>{if(e.isInitialized)t();else{const i=()=>{setTimeout(()=>{e.off("initialized",i)},0),t()};e.on("initialized",i)}},Ug=(e,t,i)=>{e.loadNamespaces(t,T1(e,i))},Bg=(e,t,i,a)=>{vn(i)&&(i=[i]),i.forEach(n=>{e.options.ns.indexOf(n)<0&&e.options.ns.push(n)}),e.loadLanguages(t,T1(e,a))},w6=function(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const a=t.languages[0],n=t.options?t.options.fallbackLng:!1,r=t.languages[t.languages.length-1];if(a.toLowerCase()==="cimode")return!0;const s=(l,d)=>{const u=t.services.backendConnector.state[`${l}|${d}`];return u===-1||u===2};return i.bindI18n&&i.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!s(t.isLanguageChangingTo,e)?!1:!!(t.hasResourceBundle(a,e)||!t.services.backendConnector.backend||t.options.resources&&!t.options.partialBundledLanguages||s(a,e)&&(!n||s(r,e)))},_6=function(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return!t.languages||!t.languages.length?(Fu("i18n.languages were undefined or empty",t.languages),!0):t.options.ignoreJSONStructure!==void 0?t.hasLoadedNamespace(e,{lng:i.lng,precheck:(n,r)=>{if(i.bindI18n&&i.bindI18n.indexOf("languageChanging")>-1&&n.services.backendConnector.backend&&n.isLanguageChangingTo&&!r(n.isLanguageChangingTo,e))return!1}}):w6(e,t,i)},vn=e=>typeof e=="string",x6=e=>typeof e=="object"&&e!==null,z6=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,A6={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},j6=e=>A6[e],L6=e=>e.replace(z6,j6);let Uu={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:L6};const S6=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Uu={...Uu,...e}},M6=()=>Uu;let I1;const P6=e=>{I1=e},C6=()=>I1,E6={type:"3rdParty",init(e){S6(e.options.react),P6(e)}},N1=m.createContext();class T6{constructor(){uh(this,"getUsedNamespaces",()=>Object.keys(this.usedNamespaces));this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(i=>{this.usedNamespaces[i]||(this.usedNamespaces[i]=!0)})}}const I6=(e,t)=>{const i=m.useRef();return m.useEffect(()=>{i.current=t?i.current:e},[e,t]),i.current},D1=(e,t,i,a)=>e.getFixedT(t,i,a),N6=(e,t,i,a)=>m.useCallback(D1(e,t,i,a),[e,t,i,a]),Qe=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{i18n:i}=t,{i18n:a,defaultNS:n}=m.useContext(N1)||{},r=i||a||C6();if(r&&!r.reportNamespaces&&(r.reportNamespaces=new T6),!r){Fu("You will need to pass in an i18next instance by using initReactI18next");const x=(z,S)=>vn(S)?S:x6(S)&&vn(S.defaultValue)?S.defaultValue:Array.isArray(z)?z[z.length-1]:z,A=[x,{},!1];return A.t=x,A.i18n={},A.ready=!1,A}r.options.react&&r.options.react.wait!==void 0&&Fu("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const s={...M6(),...r.options.react,...t},{useSuspense:l,keyPrefix:d}=s;let u=e||n||r.options&&r.options.defaultNS;u=vn(u)?[u]:u||["translation"],r.reportNamespaces.addUsedNamespaces&&r.reportNamespaces.addUsedNamespaces(u);const h=(r.isInitialized||r.initializedStoreOnce)&&u.every(x=>_6(x,r,s)),g=N6(r,t.lng||null,s.nsMode==="fallback"?u:u[0],d),p=()=>g,v=()=>D1(r,t.lng||null,s.nsMode==="fallback"?u:u[0],d),[f,b]=m.useState(p);let w=u.join();t.lng&&(w=`${t.lng}${w}`);const y=I6(w),k=m.useRef(!0);m.useEffect(()=>{const{bindI18n:x,bindI18nStore:A}=s;k.current=!0,!h&&!l&&(t.lng?Bg(r,t.lng,u,()=>{k.current&&b(v)}):Ug(r,u,()=>{k.current&&b(v)})),h&&y&&y!==w&&k.current&&b(v);const z=()=>{k.current&&b(v)};return x&&r&&r.on(x,z),A&&r&&r.store.on(A,z),()=>{k.current=!1,x&&r&&x.split(" ").forEach(S=>r.off(S,z)),A&&r&&A.split(" ").forEach(S=>r.store.off(S,z))}},[r,w]),m.useEffect(()=>{k.current&&h&&b(p)},[r,d,h]);const _=[f,r,h];if(_.t=f,_.i18n=r,_.ready=h,h||!h&&!l)return _;throw new Promise(x=>{t.lng?Bg(r,t.lng,u,()=>x()):Ug(r,u,()=>x())})};function D6(e){let{i18n:t,defaultNS:i,children:a}=e;const n=m.useMemo(()=>({i18n:t,defaultNS:i}),[t,i]);return m.createElement(N1.Provider,{value:n},a)}const E="http://localhost:8686/api",Gg="https://onboarding.anythingllm.com",at="anythingllm_user",Ke="anythingllm_authToken",Jt="anythingllm_authTimestamp",Ll="anythingllm_completed_questionnaire",MD="anythingllm_pinned_document_alert",PD="anythingllm_watched_document_alert",O6="anythingllm_last_visited_workspace",Bu="anythingllm_user_prompt_input_map",CD="anythingllm_pending_home_message",Kg="anythingllm_appearance_settings",R6=["http://127.0.0.1:11434","http://host.docker.internal:11434","http://172.17.0.1:11434"],H6=["http://localhost:1234/v1","http://127.0.0.1:1234/v1","http://host.docker.internal:1234/v1","http://172.17.0.1:1234/v1"],V6=["http://127.0.0.1:5000/v1","http://localhost:5000/v1","http://host.docker.internal:5000/v1","http://172.17.0.1:5000/v1"],q6=["http://127.0.0.1:8080/v1","http://localhost:8080/v1","http://host.docker.internal:8080/v1","http://172.17.0.1:8080/v1"],F6=["http://127.0.0.1:8553/v1/openai","http://0.0.0.0:8553/v1/openai","http://localhost:8553/v1/openai","http://host.docker.internal:8553/v1/openai"],U6=["http://127.0.0.1:8000/v1/version","http://localhost:8000/v1/version","http://host.docker.internal:8000/v1/version","http://172.17.0.1:8000/v1/version"],B6=["http://localhost:12434/engines/llama.cpp/v1","http://127.0.0.1:12434/engines/llama.cpp/v1","http://model-runner.docker.internal/engines/llama.cpp/v1","http://host.docker.internal:12434/engines/llama.cpp/v1","http://172.17.0.1:12434/engines/llama.cpp/v1"],G6=["http://localhost:8000/live","http://127.0.0.1:8000/live","http://host.docker.internal:8000/live","http://172.17.0.1:8000/live","http://localhost:13305/live","http://127.0.0.1:13305/live","http://host.docker.internal:13305/live","http://172.17.0.1:13305/live"];function Xs(){return E}const ED="NEW_BROWSER_EXTENSION_CONNECTION";function dc(){const e=window.localStorage.getItem(at);return e?Et(e,null):null}function N(e=null){const t=e||window.localStorage.getItem(Ke);return{Authorization:t?`Bearer ${t}`:null}}function Et(e,t=null){try{return e==null?t:JSON.parse(e)}catch{}return t}function O1(e){var t,i,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(i=O1(e[t]))&&(a&&(a+=" "),a+=i);else for(t in e)e[t]&&(a&&(a+=" "),a+=t);return a}function Da(){for(var e,t,i=0,a="";i<arguments.length;)(e=arguments[i++])&&(t=O1(e))&&(a&&(a+=" "),a+=t);return a}const oo=e=>typeof e=="number"&&!isNaN(e),jn=e=>typeof e=="string",Kt=e=>typeof e=="function",el=e=>jn(e)||Kt(e)?e:null,ud=e=>m.isValidElement(e)||jn(e)||Kt(e)||oo(e);function K6(e,t,i){i===void 0&&(i=300);const{scrollHeight:a,style:n}=e;requestAnimationFrame(()=>{n.minHeight="initial",n.height=a+"px",n.transition=`all ${i}ms`,requestAnimationFrame(()=>{n.height="0",n.padding="0",n.margin="0",setTimeout(t,i)})})}function uc(e){let{enter:t,exit:i,appendPosition:a=!1,collapse:n=!0,collapseDuration:r=300}=e;return function(s){let{children:l,position:d,preventExitTransition:u,done:h,nodeRef:g,isIn:p}=s;const v=a?`${t}--${d}`:t,f=a?`${i}--${d}`:i,b=m.useRef(0);return m.useLayoutEffect(()=>{const w=g.current,y=v.split(" "),k=_=>{_.target===g.current&&(w.dispatchEvent(new Event("d")),w.removeEventListener("animationend",k),w.removeEventListener("animationcancel",k),b.current===0&&_.type!=="animationcancel"&&w.classList.remove(...y))};w.classList.add(...y),w.addEventListener("animationend",k),w.addEventListener("animationcancel",k)},[]),m.useEffect(()=>{const w=g.current,y=()=>{w.removeEventListener("animationend",y),n?K6(w,h,r):h()};p||(u?y():(b.current=1,w.className+=` ${f}`,w.addEventListener("animationend",y)))},[p]),c.createElement(c.Fragment,null,l)}}function Wg(e,t){return e!=null?{content:e.content,containerId:e.props.containerId,id:e.props.toastId,theme:e.props.theme,type:e.props.type,data:e.props.data||{},isLoading:e.props.isLoading,icon:e.props.icon,status:t}:{}}const hi={list:new Map,emitQueue:new Map,on(e,t){return this.list.has(e)||this.list.set(e,[]),this.list.get(e).push(t),this},off(e,t){if(t){const i=this.list.get(e).filter(a=>a!==t);return this.list.set(e,i),this}return this.list.delete(e),this},cancelEmit(e){const t=this.emitQueue.get(e);return t&&(t.forEach(clearTimeout),this.emitQueue.delete(e)),this},emit(e){this.list.has(e)&&this.list.get(e).forEach(t=>{const i=setTimeout(()=>{t(...[].slice.call(arguments,1))},0);this.emitQueue.has(e)||this.emitQueue.set(e,[]),this.emitQueue.get(e).push(i)})}},Ts=e=>{let{theme:t,type:i,...a}=e;return c.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:t==="colored"?"currentColor":`var(--toastify-icon-color-${i})`,...a})},pd={info:function(e){return c.createElement(Ts,{...e},c.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(e){return c.createElement(Ts,{...e},c.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(e){return c.createElement(Ts,{...e},c.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(e){return c.createElement(Ts,{...e},c.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return c.createElement("div",{className:"Toastify__spinner"})}};function W6(e){const[,t]=m.useReducer(v=>v+1,0),[i,a]=m.useState([]),n=m.useRef(null),r=m.useRef(new Map).current,s=v=>i.indexOf(v)!==-1,l=m.useRef({toastKey:1,displayedToast:0,count:0,queue:[],props:e,containerId:null,isToastActive:s,getToast:v=>r.get(v)}).current;function d(v){let{containerId:f}=v;const{limit:b}=l.props;!b||f&&l.containerId!==f||(l.count-=l.queue.length,l.queue=[])}function u(v){a(f=>v==null?[]:f.filter(b=>b!==v))}function h(){const{toastContent:v,toastProps:f,staleId:b}=l.queue.shift();p(v,f,b)}function g(v,f){let{delay:b,staleId:w,...y}=f;if(!ud(v)||function(O){return!n.current||l.props.enableMultiContainer&&O.containerId!==l.props.containerId||r.has(O.toastId)&&O.updateId==null}(y))return;const{toastId:k,updateId:_,data:x}=y,{props:A}=l,z=()=>u(k),S=_==null;S&&l.count++;const M={...A,style:A.toastStyle,key:l.toastKey++,...Object.fromEntries(Object.entries(y).filter(O=>{let[Z,R]=O;return R!=null})),toastId:k,updateId:_,data:x,closeToast:z,isIn:!1,className:el(y.className||A.toastClassName),bodyClassName:el(y.bodyClassName||A.bodyClassName),progressClassName:el(y.progressClassName||A.progressClassName),autoClose:!y.isLoading&&(T=y.autoClose,D=A.autoClose,T===!1||oo(T)&&T>0?T:D),deleteToast(){const O=Wg(r.get(k),"removed");r.delete(k),hi.emit(4,O);const Z=l.queue.length;if(l.count=k==null?l.count-l.displayedToast:l.count-1,l.count<0&&(l.count=0),Z>0){const R=k==null?l.props.limit:1;if(Z===1||R===1)l.displayedToast++,h();else{const ce=R>Z?Z:R;l.displayedToast=ce;for(let ae=0;ae<ce;ae++)h()}}else t()}};var T,D;M.iconOut=function(O){let{theme:Z,type:R,isLoading:ce,icon:ae}=O,Q=null;const I={theme:Z,type:R};return ae===!1||(Kt(ae)?Q=ae(I):m.isValidElement(ae)?Q=m.cloneElement(ae,I):jn(ae)||oo(ae)?Q=ae:ce?Q=pd.spinner():(U=>U in pd)(R)&&(Q=pd[R](I))),Q}(M),Kt(y.onOpen)&&(M.onOpen=y.onOpen),Kt(y.onClose)&&(M.onClose=y.onClose),M.closeButton=A.closeButton,y.closeButton===!1||ud(y.closeButton)?M.closeButton=y.closeButton:y.closeButton===!0&&(M.closeButton=!ud(A.closeButton)||A.closeButton);let F=v;m.isValidElement(v)&&!jn(v.type)?F=m.cloneElement(v,{closeToast:z,toastProps:M,data:x}):Kt(v)&&(F=v({closeToast:z,toastProps:M,data:x})),A.limit&&A.limit>0&&l.count>A.limit&&S?l.queue.push({toastContent:F,toastProps:M,staleId:w}):oo(b)?setTimeout(()=>{p(F,M,w)},b):p(F,M,w)}function p(v,f,b){const{toastId:w}=f;b&&r.delete(b);const y={content:v,props:f};r.set(w,y),a(k=>[...k,w].filter(_=>_!==b)),hi.emit(4,Wg(y,y.props.updateId==null?"added":"updated"))}return m.useEffect(()=>(l.containerId=e.containerId,hi.cancelEmit(3).on(0,g).on(1,v=>n.current&&u(v)).on(5,d).emit(2,l),()=>{r.clear(),hi.emit(3,l)}),[]),m.useEffect(()=>{l.props=e,l.isToastActive=s,l.displayedToast=i.length}),{getToastToRender:function(v){const f=new Map,b=Array.from(r.values());return e.newestOnTop&&b.reverse(),b.forEach(w=>{const{position:y}=w.props;f.has(y)||f.set(y,[]),f.get(y).push(w)}),Array.from(f,w=>v(w[0],w[1]))},containerRef:n,isToastActive:s}}function $g(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientX:e.clientX}function Zg(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientY:e.clientY}function $6(e){const[t,i]=m.useState(!1),[a,n]=m.useState(!1),r=m.useRef(null),s=m.useRef({start:0,x:0,y:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,boundingRect:null,didMove:!1}).current,l=m.useRef(e),{autoClose:d,pauseOnHover:u,closeToast:h,onClick:g,closeOnClick:p}=e;function v(x){if(e.draggable){x.nativeEvent.type==="touchstart"&&x.nativeEvent.preventDefault(),s.didMove=!1,document.addEventListener("mousemove",y),document.addEventListener("mouseup",k),document.addEventListener("touchmove",y),document.addEventListener("touchend",k);const A=r.current;s.canCloseOnClick=!0,s.canDrag=!0,s.boundingRect=A.getBoundingClientRect(),A.style.transition="",s.x=$g(x.nativeEvent),s.y=Zg(x.nativeEvent),e.draggableDirection==="x"?(s.start=s.x,s.removalDistance=A.offsetWidth*(e.draggablePercent/100)):(s.start=s.y,s.removalDistance=A.offsetHeight*(e.draggablePercent===80?1.5*e.draggablePercent:e.draggablePercent/100))}}function f(x){if(s.boundingRect){const{top:A,bottom:z,left:S,right:M}=s.boundingRect;x.nativeEvent.type!=="touchend"&&e.pauseOnHover&&s.x>=S&&s.x<=M&&s.y>=A&&s.y<=z?w():b()}}function b(){i(!0)}function w(){i(!1)}function y(x){const A=r.current;s.canDrag&&A&&(s.didMove=!0,t&&w(),s.x=$g(x),s.y=Zg(x),s.delta=e.draggableDirection==="x"?s.x-s.start:s.y-s.start,s.start!==s.x&&(s.canCloseOnClick=!1),A.style.transform=`translate${e.draggableDirection}(${s.delta}px)`,A.style.opacity=""+(1-Math.abs(s.delta/s.removalDistance)))}function k(){document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",k),document.removeEventListener("touchmove",y),document.removeEventListener("touchend",k);const x=r.current;if(s.canDrag&&s.didMove&&x){if(s.canDrag=!1,Math.abs(s.delta)>s.removalDistance)return n(!0),void e.closeToast();x.style.transition="transform 0.2s, opacity 0.2s",x.style.transform=`translate${e.draggableDirection}(0)`,x.style.opacity="1"}}m.useEffect(()=>{l.current=e}),m.useEffect(()=>(r.current&&r.current.addEventListener("d",b,{once:!0}),Kt(e.onOpen)&&e.onOpen(m.isValidElement(e.children)&&e.children.props),()=>{const x=l.current;Kt(x.onClose)&&x.onClose(m.isValidElement(x.children)&&x.children.props)}),[]),m.useEffect(()=>(e.pauseOnFocusLoss&&(document.hasFocus()||w(),window.addEventListener("focus",b),window.addEventListener("blur",w)),()=>{e.pauseOnFocusLoss&&(window.removeEventListener("focus",b),window.removeEventListener("blur",w))}),[e.pauseOnFocusLoss]);const _={onMouseDown:v,onTouchStart:v,onMouseUp:f,onTouchEnd:f};return d&&u&&(_.onMouseEnter=w,_.onMouseLeave=b),p&&(_.onClick=x=>{g&&g(x),s.canCloseOnClick&&h()}),{playToast:b,pauseToast:w,isRunning:t,preventExitTransition:a,toastRef:r,eventHandlers:_}}function R1(e){let{closeToast:t,theme:i,ariaLabel:a="close"}=e;return c.createElement("button",{className:`Toastify__close-button Toastify__close-button--${i}`,type:"button",onClick:n=>{n.stopPropagation(),t(n)},"aria-label":a},c.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},c.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}function Z6(e){let{delay:t,isRunning:i,closeToast:a,type:n="default",hide:r,className:s,style:l,controlledProgress:d,progress:u,rtl:h,isIn:g,theme:p}=e;const v=r||d&&u===0,f={...l,animationDuration:`${t}ms`,animationPlayState:i?"running":"paused",opacity:v?0:1};d&&(f.transform=`scaleX(${u})`);const b=Da("Toastify__progress-bar",d?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${p}`,`Toastify__progress-bar--${n}`,{"Toastify__progress-bar--rtl":h}),w=Kt(s)?s({rtl:h,type:n,defaultClassName:b}):Da(b,s);return c.createElement("div",{role:"progressbar","aria-hidden":v?"true":"false","aria-label":"notification timer",className:w,style:f,[d&&u>=1?"onTransitionEnd":"onAnimationEnd"]:d&&u<1?null:()=>{g&&a()}})}const J6=e=>{const{isRunning:t,preventExitTransition:i,toastRef:a,eventHandlers:n}=$6(e),{closeButton:r,children:s,autoClose:l,onClick:d,type:u,hideProgressBar:h,closeToast:g,transition:p,position:v,className:f,style:b,bodyClassName:w,bodyStyle:y,progressClassName:k,progressStyle:_,updateId:x,role:A,progress:z,rtl:S,toastId:M,deleteToast:T,isIn:D,isLoading:F,iconOut:O,closeOnClick:Z,theme:R}=e,ce=Da("Toastify__toast",`Toastify__toast-theme--${R}`,`Toastify__toast--${u}`,{"Toastify__toast--rtl":S},{"Toastify__toast--close-on-click":Z}),ae=Kt(f)?f({rtl:S,position:v,type:u,defaultClassName:ce}):Da(ce,f),Q=!!z||!l,I={closeToast:g,type:u,theme:R};let U=null;return r===!1||(U=Kt(r)?r(I):m.isValidElement(r)?m.cloneElement(r,I):R1(I)),c.createElement(p,{isIn:D,done:T,position:v,preventExitTransition:i,nodeRef:a},c.createElement("div",{id:M,onClick:d,className:ae,...n,style:b,ref:a},c.createElement("div",{...D&&{role:A},className:Kt(w)?w({type:u}):Da("Toastify__toast-body",w),style:y},O!=null&&c.createElement("div",{className:Da("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!F})},O),c.createElement("div",null,s)),U,c.createElement(Z6,{...x&&!Q?{key:`pb-${x}`}:{},rtl:S,theme:R,delay:l,isRunning:t,isIn:D,closeToast:g,hide:h,type:u,style:_,className:k,controlledProgress:Q,progress:z||0})))},pc=function(e,t){return t===void 0&&(t=!1),{enter:`Toastify--animate Toastify__${e}-enter`,exit:`Toastify--animate Toastify__${e}-exit`,appendPosition:t}},Q6=uc(pc("bounce",!0));uc(pc("slide",!0));uc(pc("zoom"));uc(pc("flip"));const Gu=m.forwardRef((e,t)=>{const{getToastToRender:i,containerRef:a,isToastActive:n}=W6(e),{className:r,style:s,rtl:l,containerId:d}=e;function u(h){const g=Da("Toastify__toast-container",`Toastify__toast-container--${h}`,{"Toastify__toast-container--rtl":l});return Kt(r)?r({position:h,rtl:l,defaultClassName:g}):Da(g,el(r))}return m.useEffect(()=>{t&&(t.current=a.current)},[]),c.createElement("div",{ref:a,className:"Toastify",id:d},i((h,g)=>{const p=g.length?{...s}:{...s,pointerEvents:"none"};return c.createElement("div",{className:u(h),style:p,key:`container-${h}`},g.map((v,f)=>{let{content:b,props:w}=v;return c.createElement(J6,{...w,isIn:n(w.toastId),style:{...w.style,"--nth":f+1,"--len":g.length},key:`toast-${w.key}`},b)}))}))});Gu.displayName="ToastContainer",Gu.defaultProps={position:"top-right",transition:Q6,autoClose:5e3,closeButton:R1,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,draggable:!0,draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};let md,cn=new Map,Jr=[],Y6=1;function H1(){return""+Y6++}function X6(e){return e&&(jn(e.toastId)||oo(e.toastId))?e.toastId:H1()}function so(e,t){return cn.size>0?hi.emit(0,e,t):Jr.push({content:e,options:t}),t.toastId}function Sl(e,t){return{...t,type:t&&t.type||e,toastId:X6(t)}}function Is(e){return(t,i)=>so(t,Sl(e,i))}function Ee(e,t){return so(e,Sl("default",t))}Ee.loading=(e,t)=>so(e,Sl("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),Ee.promise=function(e,t,i){let a,{pending:n,error:r,success:s}=t;n&&(a=jn(n)?Ee.loading(n,i):Ee.loading(n.render,{...i,...n}));const l={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},d=(h,g,p)=>{if(g==null)return void Ee.dismiss(a);const v={type:h,...l,...i,data:p},f=jn(g)?{render:g}:g;return a?Ee.update(a,{...v,...f}):Ee(f.render,{...v,...f}),p},u=Kt(e)?e():e;return u.then(h=>d("success",s,h)).catch(h=>d("error",r,h)),u},Ee.success=Is("success"),Ee.info=Is("info"),Ee.error=Is("error"),Ee.warning=Is("warning"),Ee.warn=Ee.warning,Ee.dark=(e,t)=>so(e,Sl("default",{theme:"dark",...t})),Ee.dismiss=e=>{cn.size>0?hi.emit(1,e):Jr=Jr.filter(t=>e!=null&&t.options.toastId!==e)},Ee.clearWaitingQueue=function(e){return e===void 0&&(e={}),hi.emit(5,e)},Ee.isActive=e=>{let t=!1;return cn.forEach(i=>{i.isToastActive&&i.isToastActive(e)&&(t=!0)}),t},Ee.update=function(e,t){t===void 0&&(t={}),setTimeout(()=>{const i=function(a,n){let{containerId:r}=n;const s=cn.get(r||md);return s&&s.getToast(a)}(e,t);if(i){const{props:a,content:n}=i,r={delay:100,...a,...t,toastId:t.toastId||e,updateId:H1()};r.toastId!==e&&(r.staleId=e);const s=r.render||n;delete r.render,so(s,r)}},0)},Ee.done=e=>{Ee.update(e,{progress:1})},Ee.onChange=e=>(hi.on(4,e),()=>{hi.off(4,e)}),Ee.POSITION={TOP_LEFT:"top-left",TOP_RIGHT:"top-right",TOP_CENTER:"top-center",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_CENTER:"bottom-center"},Ee.TYPE={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"},hi.on(2,e=>{md=e.containerId||e,cn.set(md,e),Jr.forEach(t=>{hi.emit(0,t.content,t.options)}),Jr=[]}).on(3,e=>{cn.delete(e.containerId||e),cn.size===0&&hi.off(0).off(1).off(5)});const Se=(e,t="default",i={})=>{const n={position:"bottom-center",autoClose:5e3,hideProgressBar:!1,closeOnClick:!0,pauseOnHover:!0,draggable:!0,theme:((localStorage==null?void 0:localStorage.getItem("theme"))||"default")==="default"?"dark":"light",...i};switch((i==null?void 0:i.clear)===!0&&Ee.dismiss(),t){case"success":Ee.success(e,n);break;case"error":Ee.error(e,n);break;case"info":Ee.info(e,n);break;case"warning":Ee.warn(e,n);break;default:Ee(e,n)}},ez={github:{branches:async({repo:e,accessToken:t})=>await fetch(`${E}/ext/github/branches`,{method:"POST",headers:N(),cache:"force-cache",body:JSON.stringify({repo:e,accessToken:t})}).then(i=>i.json()).then(i=>{if(!i.success)throw new Error(i.reason);return i.data}).then(i=>({branches:(i==null?void 0:i.branches)||[],error:null})).catch(i=>(console.error(i),Se(i.message,"error"),{branches:[],error:i.message})),collect:async function({repo:e,accessToken:t,branch:i,ignorePaths:a=[]}){return await fetch(`${E}/ext/github/repo`,{method:"POST",headers:N(),body:JSON.stringify({repo:e,accessToken:t,branch:i,ignorePaths:a})}).then(n=>n.json()).then(n=>{if(!n.success)throw new Error(n.reason);return{data:n.data,error:null}}).catch(n=>(console.error(n),{data:null,error:n.message}))}},gitlab:{branches:async({repo:e,accessToken:t})=>await fetch(`${E}/ext/gitlab/branches`,{method:"POST",headers:N(),cache:"force-cache",body:JSON.stringify({repo:e,accessToken:t})}).then(i=>i.json()).then(i=>{if(!i.success)throw new Error(i.reason);return i.data}).then(i=>({branches:(i==null?void 0:i.branches)||[],error:null})).catch(i=>(console.error(i),Se(i.message,"error"),{branches:[],error:i.message})),collect:async function({repo:e,accessToken:t,branch:i,ignorePaths:a=[],fetchIssues:n=!1,fetchWikis:r=!1}){return await fetch(`${E}/ext/gitlab/repo`,{method:"POST",headers:N(),body:JSON.stringify({repo:e,accessToken:t,branch:i,ignorePaths:a,fetchIssues:n,fetchWikis:r})}).then(s=>s.json()).then(s=>{if(!s.success)throw new Error(s.reason);return{data:s.data,error:null}}).catch(s=>(console.error(s),{data:null,error:s.message}))}},youtube:{transcribe:async({url:e})=>await fetch(`${E}/ext/youtube/transcript`,{method:"POST",headers:N(),body:JSON.stringify({url:e})}).then(t=>t.json()).then(t=>{if(!t.success)throw new Error(t.reason);return{data:t.data,error:null}}).catch(t=>(console.error(t),{data:null,error:t.message}))},websiteDepth:{scrape:async({url:e,depth:t,maxLinks:i})=>await fetch(`${E}/ext/website-depth`,{method:"POST",headers:N(),body:JSON.stringify({url:e,depth:t,maxLinks:i})}).then(a=>a.json()).then(a=>{if(!a.success)throw new Error(a.reason);return{data:a.data,error:null}}).catch(a=>(console.error(a),{data:null,error:a.message}))},confluence:{collect:async function({baseUrl:e,spaceKey:t,username:i,accessToken:a,cloud:n,personalAccessToken:r,bypassSSL:s}){return await fetch(`${E}/ext/confluence`,{method:"POST",headers:N(),body:JSON.stringify({baseUrl:e,spaceKey:t,username:i,accessToken:a,cloud:n,personalAccessToken:r,bypassSSL:s})}).then(l=>l.json()).then(l=>{if(!l.success)throw new Error(l.reason);return{data:l.data,error:null}}).catch(l=>(console.error(l),{data:null,error:l.message}))}},drupalwiki:{collect:async function({baseUrl:e,spaceIds:t,accessToken:i}){return await fetch(`${E}/ext/drupalwiki`,{method:"POST",headers:N(),body:JSON.stringify({baseUrl:e,spaceIds:t,accessToken:i})}).then(a=>a.json()).then(a=>{if(!a.success)throw new Error(a.reason);return{data:a.data,error:null}}).catch(a=>(console.error(a),{data:null,error:a.message}))}},obsidian:{collect:async function({files:e}){return await fetch(`${E}/ext/obsidian/vault`,{method:"POST",headers:N(),body:JSON.stringify({files:e})}).then(t=>t.json()).then(t=>{if(!t.success)throw new Error(t.reason);return{data:t.data,error:null}}).catch(t=>(console.error(t),{data:null,error:t.message}))}},paperlessNgx:{collect:async function({baseUrl:e,apiToken:t}){return await fetch(`${E}/ext/paperless-ngx`,{method:"POST",headers:N(),body:JSON.stringify({baseUrl:e,apiToken:t})}).then(i=>i.json()).then(i=>{if(!i.success)throw new Error(i.reason);return{data:i.data,error:null}}).catch(i=>(console.error(i),{data:null,error:i.message}))}}},tz={featureFlag:"experimental_live_file_sync",toggleFeature:async function(e=!1){return await fetch(`${E}/experimental/toggle-live-sync`,{method:"POST",headers:N(),body:JSON.stringify({updatedStatus:e})}).then(t=>{if(!t.ok)throw new Error("Could not update status.");return!0}).then(t=>t).catch(t=>(console.error(t),!1))},queues:async function(){return await fetch(`${E}/experimental/live-sync/queues`,{headers:N()}).then(e=>{if(!e.ok)throw new Error("Could not update status.");return e.json()}).then(e=>(e==null?void 0:e.queues)||[]).catch(e=>(console.error(e),[]))},setWatchStatusForDocument:async function(e,t,i){return fetch(`${E}/workspace/${e}/update-watch-status`,{method:"POST",headers:N(),body:JSON.stringify({docPath:t,watchStatus:i})}).then(a=>{if(!a.ok)throw new Error(a.statusText||"Error setting watch status for document.");return!0}).catch(a=>(console.error(a),!1))}},iz={toggleFeature:async function(e,t=!1){return await fetch(`${E}/experimental/agent-plugins/${e}/toggle`,{method:"POST",headers:N(),body:JSON.stringify({active:t})}).then(i=>{if(!i.ok)throw new Error("Could not update agent plugin status.");return!0}).catch(i=>(console.error(i),!1))},updatePluginConfig:async function(e,t={}){return await fetch(`${E}/experimental/agent-plugins/${e}/config`,{method:"POST",headers:N(),body:JSON.stringify({updates:t})}).then(i=>{if(!i.ok)throw new Error("Could not update agent plugin config.");return!0}).catch(i=>(console.error(i),!1))},deletePlugin:async function(e){return await fetch(`${E}/experimental/agent-plugins/${e}`,{method:"DELETE",headers:N()}).then(t=>{if(!t.ok)throw new Error("Could not delete agent plugin config.");return!0}).catch(t=>(console.error(t),!1))}},az={getAll:async function(){try{return await fetch(`${E}/system/prompt-variables`,{method:"GET",headers:N()}).then(e=>e.json()).catch(e=>(console.error("Error fetching system prompt variables:",e),{variables:[]}))}catch(e){return console.error("Error fetching system prompt variables:",e),{variables:[]}}},create:async function(e={}){try{return await fetch(`${E}/system/prompt-variables`,{method:"POST",headers:N(),body:JSON.stringify(e)}).then(t=>t.json()).catch(t=>(console.error("Error creating system prompt variable:",t),{success:!1,error:t}))}catch(t){return console.error("Error creating system prompt variable:",t),{success:!1,error:t}}},update:async function(e,t={}){try{return await fetch(`${E}/system/prompt-variables/${e}`,{method:"PUT",headers:N(),body:JSON.stringify(t)}).then(i=>i.json()).catch(i=>(console.error("Error updating system prompt variable:",i),{success:!1,error:i}))}catch(i){return console.error("Error updating system prompt variable:",i),{success:!1,error:i}}},delete:async function(e=null){try{return e===null?{success:!1,error:"ID is required"}:await fetch(`${E}/system/prompt-variables/${e}`,{method:"DELETE",headers:N()}).then(t=>t.json()).catch(t=>(console.error("Error deleting system prompt variable:",t),{success:!1,error:t}))}catch(t){return console.error("Error deleting system prompt variable:",t),{success:!1,error:t}}}},K={cacheKeys:{footerIcons:"anythingllm_footer_links",supportEmail:"anythingllm_support_email",customAppName:"anythingllm_custom_app_name",canViewChatHistory:"anythingllm_can_view_chat_history",deploymentVersion:"anythingllm_deployment_version"},ping:async function(){return await fetch(`${E}/ping`).then(e=>e.json()).then(e=>(e==null?void 0:e.online)||!1).catch(()=>!1)},totalIndexes:async function(e=null){const t=new URL(`${Xs()}/system/system-vectors`);return e&&t.searchParams.append("slug",encodeURIComponent(e)),await fetch(t.toString(),{headers:N()}).then(i=>{if(!i.ok)throw new Error("Could not find indexes.");return i.json()}).then(i=>i.vectorCount).catch(()=>0)},isOnboardingComplete:async function(){return await fetch(`${E}/onboarding`).then(e=>{if(!e.ok)throw new Error("Could not find onboarding information.");return e.json()}).then(e=>e.onboardingComplete).catch(()=>!1)},markOnboardingComplete:async function(){return await fetch(`${E}/onboarding`,{method:"POST",headers:N()}).then(e=>e.ok).catch(()=>!1)},keys:async function(){return await fetch(`${E}/setup-complete`).then(e=>{if(!e.ok)throw new Error("Could not find setup information.");return e.json()}).then(e=>e.results).catch(()=>null)},localFiles:async function(){return await fetch(`${E}/system/local-files`,{headers:N()}).then(e=>{if(!e.ok)throw new Error("Could not find setup information.");return e.json()}).then(e=>e.localFiles).catch(()=>null)},needsAuthCheck:function(){const e=window.localStorage.getItem(Jt);if(!e)return!0;const t=Number(e)+60*5*1e3;return Number(new Date)>t},checkAuth:async function(e=null){const t=await fetch(`${E}/system/check-token`,{headers:N(e)}).then(i=>i.ok).catch(()=>!1);return window.localStorage.setItem(Jt,Number(new Date)),t},requestToken:async function(e){return await fetch(`${E}/request-token`,{method:"POST",body:JSON.stringify({...e})}).then(t=>{if(!t.ok)throw new Error("Could not validate login.");return t.json()}).then(t=>t).catch(t=>({valid:!1,message:t.message}))},refreshUser:()=>fetch(`${E}/system/refresh-user`,{headers:N()}).then(e=>{if(!e.ok)throw new Error("Could not refresh user.");return e.json()}).catch(e=>({success:!1,user:null,message:e.message})),recoverAccount:async function(e,t){return await fetch(`${E}/system/recover-account`,{method:"POST",headers:N(),body:JSON.stringify({username:e,recoveryCodes:t})}).then(async i=>{const a=await i.json();if(!i.ok)throw new Error(a.message||"Error recovering account.");return a}).catch(i=>(console.error(i),{success:!1,error:i.message}))},resetPassword:async function(e,t,i){return await fetch(`${E}/system/reset-password`,{method:"POST",headers:N(),body:JSON.stringify({token:e,newPassword:t,confirmPassword:i})}).then(async a=>{const n=await a.json();if(!a.ok)throw new Error(n.message||"Error resetting password.");return n}).catch(a=>(console.error(a),{success:!1,error:a.message}))},checkDocumentProcessorOnline:async()=>await fetch(`${E}/system/document-processing-status`,{headers:N()}).then(e=>e.ok).catch(()=>!1),acceptedDocumentTypes:async()=>await fetch(`${E}/system/accepted-document-types`,{headers:N()}).then(e=>e.json()).then(e=>e==null?void 0:e.types).catch(()=>null),updateSystem:async e=>await fetch(`${E}/system/update-env`,{method:"POST",headers:N(),body:JSON.stringify(e)}).then(t=>t.json()).catch(t=>(console.error(t),{newValues:null,error:t.message})),updateSystemPassword:async e=>await fetch(`${E}/system/update-password`,{method:"POST",headers:N(),body:JSON.stringify(e)}).then(t=>t.json()).catch(t=>(console.error(t),{success:!1,error:t.message})),setupMultiUser:async e=>await fetch(`${E}/system/enable-multi-user`,{method:"POST",headers:N(),body:JSON.stringify(e)}).then(t=>t.json()).catch(t=>(console.error(t),{success:!1,error:t.message})),isMultiUserMode:async()=>await fetch(`${E}/system/multi-user-mode`,{method:"GET",headers:N()}).then(e=>e.json()).then(e=>e==null?void 0:e.multiUserMode).catch(e=>(console.error(e),!1)),deleteDocument:async e=>await fetch(`${E}/system/remove-document`,{method:"DELETE",headers:N(),body:JSON.stringify({name:e})}).then(t=>t.ok).catch(t=>(console.error(t),!1)),deleteDocuments:async(e=[])=>await fetch(`${E}/system/remove-documents`,{method:"DELETE",headers:N(),body:JSON.stringify({names:e})}).then(t=>t.ok).catch(t=>(console.error(t),!1)),deleteFolder:async e=>await fetch(`${E}/system/remove-folder`,{method:"DELETE",headers:N(),body:JSON.stringify({name:e})}).then(t=>t.ok).catch(t=>(console.error(t),!1)),uploadPfp:async function(e){return await fetch(`${E}/system/upload-pfp`,{method:"POST",body:e,headers:N()}).then(t=>{if(!t.ok)throw new Error("Error uploading pfp.");return{success:!0,error:null}}).catch(t=>(console.log(t),{success:!1,error:t.message}))},uploadLogo:async function(e){return await fetch(`${E}/system/upload-logo`,{method:"POST",body:e,headers:N()}).then(t=>{if(!t.ok)throw new Error("Error uploading logo.");return{success:!0,error:null}}).catch(t=>(console.log(t),{success:!1,error:t.message}))},fetchCustomFooterIcons:async function(){const e=window.localStorage.getItem(this.cacheKeys.footerIcons),{data:t,lastFetched:i}=e?Et(e,{data:[],lastFetched:0}):{data:[],lastFetched:0};if(t&&Date.now()-i<36e5)return{footerData:t,error:null};const{footerData:a,error:n}=await fetch(`${E}/system/footer-data`,{method:"GET",cache:"no-cache",headers:N()}).then(s=>s.json()).catch(s=>(console.log(s),{footerData:[],error:s.message}));if(!a||n)return{footerData:[],error:null};const r=Et(a,[]);return window.localStorage.setItem(this.cacheKeys.footerIcons,JSON.stringify({data:r,lastFetched:Date.now()})),{footerData:r,error:null}},fetchSupportEmail:async function(){const e=window.localStorage.getItem(this.cacheKeys.supportEmail),{email:t,lastFetched:i}=e?Et(e,{email:"",lastFetched:0}):{email:"",lastFetched:0};if(t&&Date.now()-i<36e5)return{email:t,error:null};const{supportEmail:a,error:n}=await fetch(`${E}/system/support-email`,{method:"GET",cache:"no-cache",headers:N()}).then(r=>r.json()).catch(r=>(console.log(r),{email:"",error:r.message}));return!a||n?{email:"",error:null}:(window.localStorage.setItem(this.cacheKeys.supportEmail,JSON.stringify({email:a,lastFetched:Date.now()})),{email:a,error:null})},fetchCustomAppName:async function(){const e=window.localStorage.getItem(this.cacheKeys.customAppName),{appName:t,lastFetched:i}=e?Et(e,{appName:"",lastFetched:0}):{appName:"",lastFetched:0};if(t&&Date.now()-i<36e5)return{appName:t,error:null};const{customAppName:a,error:n}=await fetch(`${E}/system/custom-app-name`,{method:"GET",cache:"no-cache",headers:N()}).then(r=>r.json()).catch(r=>(console.log(r),{customAppName:"",error:r.message}));return!a||n?(window.localStorage.removeItem(this.cacheKeys.customAppName),{appName:"",error:null}):(window.localStorage.setItem(this.cacheKeys.customAppName,JSON.stringify({appName:a,lastFetched:Date.now()})),{appName:a,error:null})},fetchDefaultSystemPrompt:async function(){return await fetch(`${E}/system/default-system-prompt`,{method:"GET",headers:N()}).then(e=>e.json()).then(e=>({defaultSystemPrompt:e.defaultSystemPrompt,saneDefaultSystemPrompt:e.saneDefaultSystemPrompt})).catch(e=>(console.error(e),{defaultSystemPrompt:"",saneDefaultSystemPrompt:""}))},updateDefaultSystemPrompt:async function(e){try{return await(await fetch(`${E}/system/default-system-prompt`,{method:"POST",headers:N(),body:JSON.stringify({defaultSystemPrompt:e})})).json()}catch(t){return console.error(t),{success:!1,message:t.message}}},fetchLogo:async function(){const e=new URL(`${Xs()}/system/logo`);return e.searchParams.append("theme",localStorage.getItem("theme")||"default"),await fetch(e,{method:"GET",cache:"no-cache"}).then(async t=>{if(t.ok&&t.status!==204){const i=t.headers.get("X-Is-Custom-Logo")==="true",a=await t.blob(),n=URL.createObjectURL(a);return{isCustomLogo:i,logoURL:n}}throw new Error("Failed to fetch logo!")}).catch(t=>(console.log(t),{isCustomLogo:!1,logoURL:null}))},fetchPfp:async function(e){return await fetch(`${E}/system/pfp/${e}`,{method:"GET",cache:"no-cache",headers:N()}).then(t=>{if(t.ok&&t.status!==204)return t.blob();throw new Error("Failed to fetch pfp.")}).then(t=>t?URL.createObjectURL(t):null).catch(()=>null)},removePfp:async function(){return await fetch(`${E}/system/remove-pfp`,{method:"DELETE",headers:N()}).then(e=>{if(e.ok)return{success:!0,error:null};throw new Error("Failed to remove pfp.")}).catch(e=>(console.log(e),{success:!1,error:e.message}))},isDefaultLogo:async function(){return await fetch(`${E}/system/is-default-logo`,{method:"GET",cache:"no-cache"}).then(e=>{if(!e.ok)throw new Error("Failed to get is default logo!");return e.json()}).then(e=>e==null?void 0:e.isDefaultLogo).catch(e=>(console.log(e),null))},removeCustomLogo:async function(){return await fetch(`${E}/system/remove-logo`,{headers:N()}).then(e=>{if(e.ok)return{success:!0,error:null};throw new Error("Error removing logo!")}).catch(e=>(console.log(e),{success:!1,error:e.message}))},getApiKeys:async function(){return fetch(`${E}/system/api-keys`,{method:"GET",headers:N()}).then(e=>{if(!e.ok)throw new Error(e.statusText||"Error fetching api key.");return e.json()}).catch(e=>(console.error(e),{apiKey:null,error:e.message}))},generateApiKey:async function(e={}){return fetch(`${E}/system/generate-api-key`,{method:"POST",headers:N(),body:JSON.stringify(e)}).then(t=>{if(!t.ok)throw new Error(t.statusText||"Error generating api key.");return t.json()}).catch(t=>(console.error(t),{apiKey:null,error:t.message}))},deleteApiKey:async function(e=""){return fetch(`${E}/system/api-key/${e}`,{method:"DELETE",headers:N()}).then(t=>t.ok).catch(t=>(console.error(t),!1))},customModels:async function(e,t=null,i=null,a=null){const n=new AbortController;return a&&setTimeout(()=>{n.abort("Request timed out.")},a),fetch(`${E}/system/custom-models`,{method:"POST",headers:N(),signal:n.signal,body:JSON.stringify({provider:e,apiKey:t,basePath:i})}).then(r=>{if(!r.ok)throw new Error(r.statusText||"Error finding custom models.");return r.json()}).catch(r=>(console.error(r),{models:[],error:r.message}))},chats:async(e=0)=>await fetch(`${E}/system/workspace-chats`,{method:"POST",headers:N(),body:JSON.stringify({offset:e})}).then(t=>t.json()).catch(t=>(console.error(t),[])),eventLogs:async(e=0)=>await fetch(`${E}/system/event-logs`,{method:"POST",headers:N(),body:JSON.stringify({offset:e})}).then(t=>t.json()).catch(t=>(console.error(t),[])),clearEventLogs:async()=>await fetch(`${E}/system/event-logs`,{method:"DELETE",headers:N()}).then(e=>e.json()).catch(e=>(console.error(e),{success:!1,error:e.message})),deleteChat:async e=>await fetch(`${E}/system/workspace-chats/${e}`,{method:"DELETE",headers:N()}).then(t=>t.json()).catch(t=>(console.error(t),{success:!1,error:t.message})),exportChats:async(e="csv",t="workspace")=>{const i=new URL(`${Xs()}/system/export-chats`);return i.searchParams.append("type",encodeURIComponent(e)),i.searchParams.append("chatType",encodeURIComponent(t)),await fetch(i,{method:"GET",headers:N()}).then(a=>{if(a.ok)return a.text();throw new Error(a.statusText)}).catch(a=>(console.error(a),null))},updateUser:async e=>await fetch(`${E}/system/user`,{method:"POST",headers:N(),body:JSON.stringify(e)}).then(t=>t.json()).catch(t=>(console.error(t),{success:!1,error:t.message})),dataConnectors:ez,getSlashCommandPresets:async function(){return await fetch(`${E}/system/slash-command-presets`,{method:"GET",headers:N()}).then(e=>{if(!e.ok)throw new Error("Could not fetch slash command presets.");return e.json()}).then(e=>e.presets).catch(e=>(console.error(e),[]))},createSlashCommandPreset:async function(e){return await fetch(`${E}/system/slash-command-presets`,{method:"POST",headers:N(),body:JSON.stringify(e)}).then(async t=>{const i=await t.json();if(!t.ok)throw new Error(i.message||"Error creating slash command preset.");return i}).then(t=>({preset:t.preset,error:null})).catch(t=>(console.error(t),{preset:null,error:t.message}))},updateSlashCommandPreset:async function(e,t){return await fetch(`${E}/system/slash-command-presets/${e}`,{method:"POST",headers:N(),body:JSON.stringify(t)}).then(async i=>{const a=await i.json();if(!i.ok)throw new Error(a.message||"Could not update slash command preset.");return a}).then(i=>({preset:i.preset,error:null})).catch(i=>(console.error(i),{preset:null,error:i.message}))},deleteSlashCommandPreset:async function(e){return await fetch(`${E}/system/slash-command-presets/${e}`,{method:"DELETE",headers:N()}).then(t=>{if(!t.ok)throw new Error("Could not delete slash command preset.");return!0}).catch(t=>(console.error(t),!1))},fetchCanViewChatHistory:async function(){const e=window.localStorage.getItem(this.cacheKeys.canViewChatHistory),{viewable:t,lastFetched:i}=e?Et(e,{viewable:!1,lastFetched:0}):{viewable:!1,lastFetched:0};if(typeof t=="boolean"&&Date.now()-i<864e5)return{viewable:t,error:null};const a=await K.keys(),n=(a==null?void 0:a.DisableViewChatHistory)===!1;return window.localStorage.setItem(this.cacheKeys.canViewChatHistory,JSON.stringify({viewable:n,lastFetched:Date.now()})),{viewable:n,error:null}},simpleSSOLogin:async function(e){return fetch(`${E}/request-token/sso/simple?token=${e}`,{method:"GET"}).then(async t=>{if(!t.ok){const i=await t.text();if(!i.startsWith("{"))throw new Error(i);return JSON.parse(i)}return await t.json()}).catch(t=>(console.error(t),{valid:!1,user:null,token:null,message:t.message}))},fetchAppVersion:async function(){const e=window.localStorage.getItem(this.cacheKeys.deploymentVersion),{version:t,lastFetched:i}=e?Et(e,{version:null,lastFetched:0}):{version:null,lastFetched:0};if(t&&Date.now()-i<36e5)return t;const a=await fetch(`${E}/utils/metrics`,{method:"GET",cache:"no-cache"}).then(n=>{if(!n.ok)throw new Error("Could not fetch app version.");return n.json()}).then(n=>n==null?void 0:n.appVersion).catch(()=>null);return a?(window.localStorage.setItem(this.cacheKeys.deploymentVersion,JSON.stringify({version:a,lastFetched:Date.now()})),a):null},validateSQLConnection:async function(e,t){return fetch(`${E}/system/validate-sql-connection`,{method:"POST",headers:N(),body:JSON.stringify({engine:e,connectionString:t})}).then(i=>i.json()).catch(i=>(console.error("Failed to validate SQL connection:",i),{success:!1,error:i.message}))},isFileSystemAgentAvailable:async function(){return fetch(`${E}/agent-skills/filesystem-agent/is-available`,{method:"GET",headers:N()}).then(e=>e.json()).then(e=>(e==null?void 0:e.available)??!1).catch(()=>!1)},isCreateFilesAgentAvailable:async function(){return fetch(`${E}/agent-skills/create-files-agent/is-available`,{method:"GET",headers:N()}).then(e=>e.json()).then(e=>(e==null?void 0:e.available)??!1).catch(()=>!1)},experimentalFeatures:{liveSync:tz,agentPlugins:iz},promptVariables:az},V1=m.createContext(null);function nz(e){const t=localStorage.getItem(at),i=localStorage.getItem(Ke),[a,n]=m.useState({user:t?Et(t,null):null,authToken:i||null}),r=ia(),[s]=m.useState({updateUser:(l,d="")=>{localStorage.setItem(at,JSON.stringify(l)),localStorage.setItem(Ke,d),n({user:l,authToken:d})},unsetUser:()=>{localStorage.removeItem(at),localStorage.removeItem(Ke),localStorage.removeItem(Jt),localStorage.removeItem(Bu),n({user:null,authToken:null})}});return m.useEffect(()=>{async function l(){const{success:d,user:u}=await K.refreshUser();if(!(d&&u===null)){if(!d){localStorage.removeItem(at),localStorage.removeItem(Ke),localStorage.removeItem(Jt),localStorage.removeItem(Bu),n({user:null,authToken:null}),r("/login");return}localStorage.setItem(at,JSON.stringify(u)),n(h=>({...h,user:u}))}}a.authToken&&l()},[a.authToken]),o.jsx(V1.Provider,{value:{store:a,actions:s},children:e.children})}const rz={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 Ml{constructor(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(t,i)}init(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=i.prefix||"i18next:",this.logger=t||rz,this.options=i,this.debug=i.debug}log(){for(var t=arguments.length,i=new Array(t),a=0;a<t;a++)i[a]=arguments[a];return this.forward(i,"log","",!0)}warn(){for(var t=arguments.length,i=new Array(t),a=0;a<t;a++)i[a]=arguments[a];return this.forward(i,"warn","",!0)}error(){for(var t=arguments.length,i=new Array(t),a=0;a<t;a++)i[a]=arguments[a];return this.forward(i,"error","")}deprecate(){for(var t=arguments.length,i=new Array(t),a=0;a<t;a++)i[a]=arguments[a];return this.forward(i,"warn","WARNING DEPRECATED: ",!0)}forward(t,i,a,n){return n&&!this.debug?null:(typeof t[0]=="string"&&(t[0]=`${a}${this.prefix} ${t[0]}`),this.logger[i](t))}create(t){return new Ml(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new Ml(this.logger,t)}}var $i=new Ml;class mc{constructor(){this.observers={}}on(t,i){return t.split(" ").forEach(a=>{this.observers[a]||(this.observers[a]=new Map);const n=this.observers[a].get(i)||0;this.observers[a].set(i,n+1)}),this}off(t,i){if(this.observers[t]){if(!i){delete this.observers[t];return}this.observers[t].delete(i)}}emit(t){for(var i=arguments.length,a=new Array(i>1?i-1:0),n=1;n<i;n++)a[n-1]=arguments[n];this.observers[t]&&Array.from(this.observers[t].entries()).forEach(s=>{let[l,d]=s;for(let u=0;u<d;u++)l(...a)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(s=>{let[l,d]=s;for(let u=0;u<d;u++)l.apply(l,[t,...a])})}}function Fr(){let e,t;const i=new Promise((a,n)=>{e=a,t=n});return i.resolve=e,i.reject=t,i}function Jg(e){return e==null?"":""+e}function oz(e,t,i){e.forEach(a=>{t[a]&&(i[a]=t[a])})}const sz=/###/g;function lo(e,t,i){function a(l){return l&&l.indexOf("###")>-1?l.replace(sz,"."):l}function n(){return!e||typeof e=="string"}const r=typeof t!="string"?t:t.split(".");let s=0;for(;s<r.length-1;){if(n())return{};const l=a(r[s]);!e[l]&&i&&(e[l]=new i),Object.prototype.hasOwnProperty.call(e,l)?e=e[l]:e={},++s}return n()?{}:{obj:e,k:a(r[s])}}function Qg(e,t,i){const{obj:a,k:n}=lo(e,t,Object);if(a!==void 0||t.length===1){a[n]=i;return}let r=t[t.length-1],s=t.slice(0,t.length-1),l=lo(e,s,Object);for(;l.obj===void 0&&s.length;)r=`${s[s.length-1]}.${r}`,s=s.slice(0,s.length-1),l=lo(e,s,Object),l&&l.obj&&typeof l.obj[`${l.k}.${r}`]<"u"&&(l.obj=void 0);l.obj[`${l.k}.${r}`]=i}function lz(e,t,i,a){const{obj:n,k:r}=lo(e,t,Object);n[r]=n[r]||[],n[r].push(i)}function Pl(e,t){const{obj:i,k:a}=lo(e,t);if(i)return i[a]}function cz(e,t,i){const a=Pl(e,i);return a!==void 0?a:Pl(t,i)}function q1(e,t,i){for(const a in t)a!=="__proto__"&&a!=="constructor"&&(a in e?typeof e[a]=="string"||e[a]instanceof String||typeof t[a]=="string"||t[a]instanceof String?i&&(e[a]=t[a]):q1(e[a],t[a],i):e[a]=t[a]);return e}function qn(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var dz={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function uz(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,t=>dz[t]):e}class pz{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const i=this.regExpMap.get(t);if(i!==void 0)return i;const a=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,a),this.regExpQueue.push(t),a}}const mz=[" ",",","?","!",";"],hz=new pz(20);function gz(e,t,i){t=t||"",i=i||"";const a=mz.filter(s=>t.indexOf(s)<0&&i.indexOf(s)<0);if(a.length===0)return!0;const n=hz.getRegExp(`(${a.map(s=>s==="?"?"\\?":s).join("|")})`);let r=!n.test(e);if(!r){const s=e.indexOf(i);s>0&&!n.test(e.substring(0,s))&&(r=!0)}return r}function Ku(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!e)return;if(e[t])return e[t];const a=t.split(i);let n=e;for(let r=0;r<a.length;){if(!n||typeof n!="object")return;let s,l="";for(let d=r;d<a.length;++d)if(d!==r&&(l+=i),l+=a[d],s=n[l],s!==void 0){if(["string","number","boolean"].indexOf(typeof s)>-1&&d<a.length-1)continue;r+=d-r+1;break}n=s}return n}function Cl(e){return e&&e.indexOf("_")>0?e.replace("_","-"):e}class Yg extends mc{constructor(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=i,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 i=this.options.ns.indexOf(t);i>-1&&this.options.ns.splice(i,1)}getResource(t,i,a){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const r=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,s=n.ignoreJSONStructure!==void 0?n.ignoreJSONStructure:this.options.ignoreJSONStructure;let l;t.indexOf(".")>-1?l=t.split("."):(l=[t,i],a&&(Array.isArray(a)?l.push(...a):typeof a=="string"&&r?l.push(...a.split(r)):l.push(a)));const d=Pl(this.data,l);return!d&&!i&&!a&&t.indexOf(".")>-1&&(t=l[0],i=l[1],a=l.slice(2).join(".")),d||!s||typeof a!="string"?d:Ku(this.data&&this.data[t]&&this.data[t][i],a,r)}addResource(t,i,a,n){let r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const s=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator;let l=[t,i];a&&(l=l.concat(s?a.split(s):a)),t.indexOf(".")>-1&&(l=t.split("."),n=i,i=l[1]),this.addNamespaces(i),Qg(this.data,l,n),r.silent||this.emit("added",t,i,a,n)}addResources(t,i,a){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const r in a)(typeof a[r]=="string"||Array.isArray(a[r]))&&this.addResource(t,i,r,a[r],{silent:!0});n.silent||this.emit("added",t,i,a)}addResourceBundle(t,i,a,n,r){let s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},l=[t,i];t.indexOf(".")>-1&&(l=t.split("."),n=a,a=i,i=l[1]),this.addNamespaces(i);let d=Pl(this.data,l)||{};s.skipCopy||(a=JSON.parse(JSON.stringify(a))),n?q1(d,a,r):d={...d,...a},Qg(this.data,l,d),s.silent||this.emit("added",t,i,a)}removeResourceBundle(t,i){this.hasResourceBundle(t,i)&&delete this.data[t][i],this.removeNamespaces(i),this.emit("removed",t,i)}hasResourceBundle(t,i){return this.getResource(t,i)!==void 0}getResourceBundle(t,i){return i||(i=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(t,i)}:this.getResource(t,i)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const i=this.getDataByLanguage(t);return!!(i&&Object.keys(i)||[]).find(n=>i[n]&&Object.keys(i[n]).length>0)}toJSON(){return this.data}}var F1={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,i,a,n){return e.forEach(r=>{this.processors[r]&&(t=this.processors[r].process(t,i,a,n))}),t}};const Xg={};class El extends mc{constructor(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),oz(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=i,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=$i.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(t==null)return!1;const a=this.resolve(t,i);return a&&a.res!==void 0}extractFromKey(t,i){let a=i.nsSeparator!==void 0?i.nsSeparator:this.options.nsSeparator;a===void 0&&(a=":");const n=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator;let r=i.ns||this.options.defaultNS||[];const s=a&&t.indexOf(a)>-1,l=!this.options.userDefinedKeySeparator&&!i.keySeparator&&!this.options.userDefinedNsSeparator&&!i.nsSeparator&&!gz(t,a,n);if(s&&!l){const d=t.match(this.interpolator.nestingRegexp);if(d&&d.length>0)return{key:t,namespaces:r};const u=t.split(a);(a!==n||a===n&&this.options.ns.indexOf(u[0])>-1)&&(r=u.shift()),t=u.join(n)}return typeof r=="string"&&(r=[r]),{key:t,namespaces:r}}translate(t,i,a){if(typeof i!="object"&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i=="object"&&(i={...i}),i||(i={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const n=i.returnDetails!==void 0?i.returnDetails:this.options.returnDetails,r=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,{key:s,namespaces:l}=this.extractFromKey(t[t.length-1],i),d=l[l.length-1],u=i.lng||this.language,h=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u&&u.toLowerCase()==="cimode"){if(h){const x=i.nsSeparator||this.options.nsSeparator;return n?{res:`${d}${x}${s}`,usedKey:s,exactUsedKey:s,usedLng:u,usedNS:d,usedParams:this.getUsedParamsDetails(i)}:`${d}${x}${s}`}return n?{res:s,usedKey:s,exactUsedKey:s,usedLng:u,usedNS:d,usedParams:this.getUsedParamsDetails(i)}:s}const g=this.resolve(t,i);let p=g&&g.res;const v=g&&g.usedKey||s,f=g&&g.exactUsedKey||s,b=Object.prototype.toString.apply(p),w=["[object Number]","[object Function]","[object RegExp]"],y=i.joinArrays!==void 0?i.joinArrays:this.options.joinArrays,k=!this.i18nFormat||this.i18nFormat.handleAsObject;if(k&&p&&(typeof p!="string"&&typeof p!="boolean"&&typeof p!="number")&&w.indexOf(b)<0&&!(typeof y=="string"&&Array.isArray(p))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const x=this.options.returnedObjectHandler?this.options.returnedObjectHandler(v,p,{...i,ns:l}):`key '${s} (${this.language})' returned an object instead of string.`;return n?(g.res=x,g.usedParams=this.getUsedParamsDetails(i),g):x}if(r){const x=Array.isArray(p),A=x?[]:{},z=x?f:v;for(const S in p)if(Object.prototype.hasOwnProperty.call(p,S)){const M=`${z}${r}${S}`;A[S]=this.translate(M,{...i,joinArrays:!1,ns:l}),A[S]===M&&(A[S]=p[S])}p=A}}else if(k&&typeof y=="string"&&Array.isArray(p))p=p.join(y),p&&(p=this.extendTranslation(p,t,i,a));else{let x=!1,A=!1;const z=i.count!==void 0&&typeof i.count!="string",S=El.hasDefaultValue(i),M=z?this.pluralResolver.getSuffix(u,i.count,i):"",T=i.ordinal&&z?this.pluralResolver.getSuffix(u,i.count,{ordinal:!1}):"",D=z&&!i.ordinal&&i.count===0&&this.pluralResolver.shouldUseIntlApi(),F=D&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${M}`]||i[`defaultValue${T}`]||i.defaultValue;!this.isValidLookup(p)&&S&&(x=!0,p=F),this.isValidLookup(p)||(A=!0,p=s);const Z=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&A?void 0:p,R=S&&F!==p&&this.options.updateMissing;if(A||x||R){if(this.logger.log(R?"updateKey":"missingKey",u,d,s,R?F:p),r){const I=this.resolve(s,{...i,keySeparator:!1});I&&I.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 ce=[];const ae=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo==="fallback"&&ae&&ae[0])for(let I=0;I<ae.length;I++)ce.push(ae[I]);else this.options.saveMissingTo==="all"?ce=this.languageUtils.toResolveHierarchy(i.lng||this.language):ce.push(i.lng||this.language);const Q=(I,U,B)=>{const me=S&&B!==p?B:Z;this.options.missingKeyHandler?this.options.missingKeyHandler(I,d,U,me,R,i):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(I,d,U,me,R,i),this.emit("missingKey",I,d,U,p)};this.options.saveMissing&&(this.options.saveMissingPlurals&&z?ce.forEach(I=>{const U=this.pluralResolver.getSuffixes(I,i);D&&i[`defaultValue${this.options.pluralSeparator}zero`]&&U.indexOf(`${this.options.pluralSeparator}zero`)<0&&U.push(`${this.options.pluralSeparator}zero`),U.forEach(B=>{Q([I],s+B,i[`defaultValue${B}`]||F)})}):Q(ce,s,F))}p=this.extendTranslation(p,t,i,g,a),A&&p===s&&this.options.appendNamespaceToMissingKey&&(p=`${d}:${s}`),(A||x)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?p=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${d}:${s}`:s,x?p:void 0):p=this.options.parseMissingKeyHandler(p))}return n?(g.res=p,g.usedParams=this.getUsedParamsDetails(i),g):p}extendTranslation(t,i,a,n,r){var s=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...a},a.lng||this.language||n.usedLng,n.usedNS,n.usedKey,{resolved:n});else if(!a.skipInterpolation){a.interpolation&&this.interpolator.init({...a,interpolation:{...this.options.interpolation,...a.interpolation}});const u=typeof t=="string"&&(a&&a.interpolation&&a.interpolation.skipOnVariables!==void 0?a.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let h;if(u){const p=t.match(this.interpolator.nestingRegexp);h=p&&p.length}let g=a.replace&&typeof a.replace!="string"?a.replace:a;if(this.options.interpolation.defaultVariables&&(g={...this.options.interpolation.defaultVariables,...g}),t=this.interpolator.interpolate(t,g,a.lng||this.language,a),u){const p=t.match(this.interpolator.nestingRegexp),v=p&&p.length;h<v&&(a.nest=!1)}!a.lng&&this.options.compatibilityAPI!=="v1"&&n&&n.res&&(a.lng=n.usedLng),a.nest!==!1&&(t=this.interpolator.nest(t,function(){for(var p=arguments.length,v=new Array(p),f=0;f<p;f++)v[f]=arguments[f];return r&&r[0]===v[0]&&!a.context?(s.logger.warn(`It seems you are nesting recursively key: ${v[0]} in key: ${i[0]}`),null):s.translate(...v,i)},a)),a.interpolation&&this.interpolator.reset()}const l=a.postProcess||this.options.postProcess,d=typeof l=="string"?[l]:l;return t!=null&&d&&d.length&&a.applyPostProcessor!==!1&&(t=F1.handle(d,t,i,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...n,usedParams:this.getUsedParamsDetails(a)},...a}:a,this)),t}resolve(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a,n,r,s,l;return typeof t=="string"&&(t=[t]),t.forEach(d=>{if(this.isValidLookup(a))return;const u=this.extractFromKey(d,i),h=u.key;n=h;let g=u.namespaces;this.options.fallbackNS&&(g=g.concat(this.options.fallbackNS));const p=i.count!==void 0&&typeof i.count!="string",v=p&&!i.ordinal&&i.count===0&&this.pluralResolver.shouldUseIntlApi(),f=i.context!==void 0&&(typeof i.context=="string"||typeof i.context=="number")&&i.context!=="",b=i.lngs?i.lngs:this.languageUtils.toResolveHierarchy(i.lng||this.language,i.fallbackLng);g.forEach(w=>{this.isValidLookup(a)||(l=w,!Xg[`${b[0]}-${w}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(l)&&(Xg[`${b[0]}-${w}`]=!0,this.logger.warn(`key "${n}" for languages "${b.join(", ")}" won't get resolved as namespace "${l}" 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!!!")),b.forEach(y=>{if(this.isValidLookup(a))return;s=y;const k=[h];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(k,h,y,w,i);else{let x;p&&(x=this.pluralResolver.getSuffix(y,i.count,i));const A=`${this.options.pluralSeparator}zero`,z=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(p&&(k.push(h+x),i.ordinal&&x.indexOf(z)===0&&k.push(h+x.replace(z,this.options.pluralSeparator)),v&&k.push(h+A)),f){const S=`${h}${this.options.contextSeparator}${i.context}`;k.push(S),p&&(k.push(S+x),i.ordinal&&x.indexOf(z)===0&&k.push(S+x.replace(z,this.options.pluralSeparator)),v&&k.push(S+A))}}let _;for(;_=k.pop();)this.isValidLookup(a)||(r=_,a=this.getResource(y,w,_,i))}))})}),{res:a,usedKey:n,exactUsedKey:r,usedLng:s,usedNS:l}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,i,a){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,i,a,n):this.resourceStore.getResource(t,i,a,n)}getUsedParamsDetails(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const i=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],a=t.replace&&typeof t.replace!="string";let n=a?t.replace:t;if(a&&typeof t.count<"u"&&(n.count=t.count),this.options.interpolation.defaultVariables&&(n={...this.options.interpolation.defaultVariables,...n}),!a){n={...n};for(const r of i)delete n[r]}return n}static hasDefaultValue(t){const i="defaultValue";for(const a in t)if(Object.prototype.hasOwnProperty.call(t,a)&&i===a.substring(0,i.length)&&t[a]!==void 0)return!0;return!1}}function hd(e){return e.charAt(0).toUpperCase()+e.slice(1)}class ef{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=$i.create("languageUtils")}getScriptPartFromCode(t){if(t=Cl(t),!t||t.indexOf("-")<0)return null;const i=t.split("-");return i.length===2||(i.pop(),i[i.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(i.join("-"))}getLanguagePartFromCode(t){if(t=Cl(t),!t||t.indexOf("-")<0)return t;const i=t.split("-");return this.formatLanguageCode(i[0])}formatLanguageCode(t){if(typeof t=="string"&&t.indexOf("-")>-1){const i=["hans","hant","latn","cyrl","cans","mong","arab"];let a=t.split("-");return this.options.lowerCaseLng?a=a.map(n=>n.toLowerCase()):a.length===2?(a[0]=a[0].toLowerCase(),a[1]=a[1].toUpperCase(),i.indexOf(a[1].toLowerCase())>-1&&(a[1]=hd(a[1].toLowerCase()))):a.length===3&&(a[0]=a[0].toLowerCase(),a[1].length===2&&(a[1]=a[1].toUpperCase()),a[0]!=="sgn"&&a[2].length===2&&(a[2]=a[2].toUpperCase()),i.indexOf(a[1].toLowerCase())>-1&&(a[1]=hd(a[1].toLowerCase())),i.indexOf(a[2].toLowerCase())>-1&&(a[2]=hd(a[2].toLowerCase()))),a.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 i;return t.forEach(a=>{if(i)return;const n=this.formatLanguageCode(a);(!this.options.supportedLngs||this.isSupportedCode(n))&&(i=n)}),!i&&this.options.supportedLngs&&t.forEach(a=>{if(i)return;const n=this.getLanguagePartFromCode(a);if(this.isSupportedCode(n))return i=n;i=this.options.supportedLngs.find(r=>{if(r===n)return r;if(!(r.indexOf("-")<0&&n.indexOf("-")<0)&&(r.indexOf("-")>0&&n.indexOf("-")<0&&r.substring(0,r.indexOf("-"))===n||r.indexOf(n)===0&&n.length>1))return r})}),i||(i=this.getFallbackCodes(this.options.fallbackLng)[0]),i}getFallbackCodes(t,i){if(!t)return[];if(typeof t=="function"&&(t=t(i)),typeof t=="string"&&(t=[t]),Array.isArray(t))return t;if(!i)return t.default||[];let a=t[i];return a||(a=t[this.getScriptPartFromCode(i)]),a||(a=t[this.formatLanguageCode(i)]),a||(a=t[this.getLanguagePartFromCode(i)]),a||(a=t.default),a||[]}toResolveHierarchy(t,i){const a=this.getFallbackCodes(i||this.options.fallbackLng||[],t),n=[],r=s=>{s&&(this.isSupportedCode(s)?n.push(s):this.logger.warn(`rejecting language code not found in supportedLngs: ${s}`))};return typeof t=="string"&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&r(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&r(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&r(this.getLanguagePartFromCode(t))):typeof t=="string"&&r(this.formatLanguageCode(t)),a.forEach(s=>{n.indexOf(s)<0&&r(this.formatLanguageCode(s))}),n}}let fz=[{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}],bz={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 vz=["v1","v2","v3"],kz=["v4"],tf={zero:0,one:1,two:2,few:3,many:4,other:5};function yz(){const e={};return fz.forEach(t=>{t.lngs.forEach(i=>{e[i]={numbers:t.nr,plurals:bz[t.fc]}})}),e}class wz{constructor(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=i,this.logger=$i.create("pluralResolver"),(!this.options.compatibilityJSON||kz.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=yz()}addRule(t,i){this.rules[t]=i}getRule(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(Cl(t==="dev"?"en":t),{type:i.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}needsPlural(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const a=this.getRule(t,i);return this.shouldUseIntlApi()?a&&a.resolvedOptions().pluralCategories.length>1:a&&a.numbers.length>1}getPluralFormsOfKey(t,i){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,a).map(n=>`${i}${n}`)}getSuffixes(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const a=this.getRule(t,i);return a?this.shouldUseIntlApi()?a.resolvedOptions().pluralCategories.sort((n,r)=>tf[n]-tf[r]).map(n=>`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${n}`):a.numbers.map(n=>this.getSuffix(t,n,i)):[]}getSuffix(t,i){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const n=this.getRule(t,a);return n?this.shouldUseIntlApi()?`${this.options.prepend}${a.ordinal?`ordinal${this.options.prepend}`:""}${n.select(i)}`:this.getSuffixRetroCompatible(n,i):(this.logger.warn(`no plural rule found for: ${t}`),"")}getSuffixRetroCompatible(t,i){const a=t.noAbs?t.plurals(i):t.plurals(Math.abs(i));let n=t.numbers[a];this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1&&(n===2?n="plural":n===1&&(n=""));const r=()=>this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString();return this.options.compatibilityJSON==="v1"?n===1?"":typeof n=="number"?`_plural_${n.toString()}`:r():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1?r():this.options.prepend&&a.toString()?this.options.prepend+a.toString():a.toString()}shouldUseIntlApi(){return!vz.includes(this.options.compatibilityJSON)}}function af(e,t,i){let a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,r=cz(e,t,i);return!r&&n&&typeof i=="string"&&(r=Ku(e,i,a),r===void 0&&(r=Ku(t,i,a))),r}class _z{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=$i.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||(i=>i),this.init(t)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const{escape:i,escapeValue:a,useRawValueToEscape:n,prefix:r,prefixEscaped:s,suffix:l,suffixEscaped:d,formatSeparator:u,unescapeSuffix:h,unescapePrefix:g,nestingPrefix:p,nestingPrefixEscaped:v,nestingSuffix:f,nestingSuffixEscaped:b,nestingOptionsSeparator:w,maxReplaces:y,alwaysFormat:k}=t.interpolation;this.escape=i!==void 0?i:uz,this.escapeValue=a!==void 0?a:!0,this.useRawValueToEscape=n!==void 0?n:!1,this.prefix=r?qn(r):s||"{{",this.suffix=l?qn(l):d||"}}",this.formatSeparator=u||",",this.unescapePrefix=h?"":g||"-",this.unescapeSuffix=this.unescapePrefix?"":h||"",this.nestingPrefix=p?qn(p):v||qn("$t("),this.nestingSuffix=f?qn(f):b||qn(")"),this.nestingOptionsSeparator=w||",",this.maxReplaces=y||1e3,this.alwaysFormat=k!==void 0?k:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(i,a)=>i&&i.source===a?(i.lastIndex=0,i):new RegExp(a,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(t,i,a,n){let r,s,l;const d=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function u(f){return f.replace(/\$/g,"$$$$")}const h=f=>{if(f.indexOf(this.formatSeparator)<0){const k=af(i,d,f,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(k,void 0,a,{...n,...i,interpolationkey:f}):k}const b=f.split(this.formatSeparator),w=b.shift().trim(),y=b.join(this.formatSeparator).trim();return this.format(af(i,d,w,this.options.keySeparator,this.options.ignoreJSONStructure),y,a,{...n,...i,interpolationkey:w})};this.resetRegExp();const g=n&&n.missingInterpolationHandler||this.options.missingInterpolationHandler,p=n&&n.interpolation&&n.interpolation.skipOnVariables!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:f=>u(f)},{regex:this.regexp,safeValue:f=>this.escapeValue?u(this.escape(f)):u(f)}].forEach(f=>{for(l=0;r=f.regex.exec(t);){const b=r[1].trim();if(s=h(b),s===void 0)if(typeof g=="function"){const y=g(t,r,n);s=typeof y=="string"?y:""}else if(n&&Object.prototype.hasOwnProperty.call(n,b))s="";else if(p){s=r[0];continue}else this.logger.warn(`missed to pass in variable ${b} for interpolating ${t}`),s="";else typeof s!="string"&&!this.useRawValueToEscape&&(s=Jg(s));const w=f.safeValue(s);if(t=t.replace(r[0],w),p?(f.regex.lastIndex+=s.length,f.regex.lastIndex-=r[0].length):f.regex.lastIndex=0,l++,l>=this.maxReplaces)break}}),t}nest(t,i){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n,r,s;function l(d,u){const h=this.nestingOptionsSeparator;if(d.indexOf(h)<0)return d;const g=d.split(new RegExp(`${h}[ ]*{`));let p=`{${g[1]}`;d=g[0],p=this.interpolate(p,s);const v=p.match(/'/g),f=p.match(/"/g);(v&&v.length%2===0&&!f||f.length%2!==0)&&(p=p.replace(/'/g,'"'));try{s=JSON.parse(p),u&&(s={...u,...s})}catch(b){return this.logger.warn(`failed parsing options string in nesting for key ${d}`,b),`${d}${h}${p}`}return s.defaultValue&&s.defaultValue.indexOf(this.prefix)>-1&&delete s.defaultValue,d}for(;n=this.nestingRegexp.exec(t);){let d=[];s={...a},s=s.replace&&typeof s.replace!="string"?s.replace:s,s.applyPostProcessor=!1,delete s.defaultValue;let u=!1;if(n[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(n[1])){const h=n[1].split(this.formatSeparator).map(g=>g.trim());n[1]=h.shift(),d=h,u=!0}if(r=i(l.call(this,n[1].trim(),s),s),r&&n[0]===t&&typeof r!="string")return r;typeof r!="string"&&(r=Jg(r)),r||(this.logger.warn(`missed to resolve ${n[1]} for nesting ${t}`),r=""),u&&(r=d.reduce((h,g)=>this.format(h,g,a.lng,{...a,interpolationkey:n[1].trim()}),r.trim())),t=t.replace(n[0],r),this.regexp.lastIndex=0}return t}}function xz(e){let t=e.toLowerCase().trim();const i={};if(e.indexOf("(")>-1){const a=e.split("(");t=a[0].toLowerCase().trim();const n=a[1].substring(0,a[1].length-1);t==="currency"&&n.indexOf(":")<0?i.currency||(i.currency=n.trim()):t==="relativetime"&&n.indexOf(":")<0?i.range||(i.range=n.trim()):n.split(";").forEach(s=>{if(s){const[l,...d]=s.split(":"),u=d.join(":").trim().replace(/^'+|'+$/g,""),h=l.trim();i[h]||(i[h]=u),u==="false"&&(i[h]=!1),u==="true"&&(i[h]=!0),isNaN(u)||(i[h]=parseInt(u,10))}})}return{formatName:t,formatOptions:i}}function Fn(e){const t={};return function(a,n,r){const s=n+JSON.stringify(r);let l=t[s];return l||(l=e(Cl(n),r),t[s]=l),l(a)}}let zz=class{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=$i.create("formatter"),this.options=t,this.formats={number:Fn((i,a)=>{const n=new Intl.NumberFormat(i,{...a});return r=>n.format(r)}),currency:Fn((i,a)=>{const n=new Intl.NumberFormat(i,{...a,style:"currency"});return r=>n.format(r)}),datetime:Fn((i,a)=>{const n=new Intl.DateTimeFormat(i,{...a});return r=>n.format(r)}),relativetime:Fn((i,a)=>{const n=new Intl.RelativeTimeFormat(i,{...a});return r=>n.format(r,a.range||"day")}),list:Fn((i,a)=>{const n=new Intl.ListFormat(i,{...a});return r=>n.format(r)})},this.init(t)}init(t){const a=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=a.formatSeparator?a.formatSeparator:a.formatSeparator||","}add(t,i){this.formats[t.toLowerCase().trim()]=i}addCached(t,i){this.formats[t.toLowerCase().trim()]=Fn(i)}format(t,i,a){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return i.split(this.formatSeparator).reduce((l,d)=>{const{formatName:u,formatOptions:h}=xz(d);if(this.formats[u]){let g=l;try{const p=n&&n.formatParams&&n.formatParams[n.interpolationkey]||{},v=p.locale||p.lng||n.locale||n.lng||a;g=this.formats[u](l,v,{...h,...n,...p})}catch(p){this.logger.warn(p)}return g}else this.logger.warn(`there was no format function for ${u}`);return l},t)}};function Az(e,t){e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)}class jz extends mc{constructor(t,i,a){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=t,this.store=i,this.services=a,this.languageUtils=a.languageUtils,this.options=n,this.logger=$i.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=n.maxParallelReads||10,this.readingCalls=0,this.maxRetries=n.maxRetries>=0?n.maxRetries:5,this.retryTimeout=n.retryTimeout>=1?n.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(a,n.backend,n)}queueLoad(t,i,a,n){const r={},s={},l={},d={};return t.forEach(u=>{let h=!0;i.forEach(g=>{const p=`${u}|${g}`;!a.reload&&this.store.hasResourceBundle(u,g)?this.state[p]=2:this.state[p]<0||(this.state[p]===1?s[p]===void 0&&(s[p]=!0):(this.state[p]=1,h=!1,s[p]===void 0&&(s[p]=!0),r[p]===void 0&&(r[p]=!0),d[g]===void 0&&(d[g]=!0)))}),h||(l[u]=!0)}),(Object.keys(r).length||Object.keys(s).length)&&this.queue.push({pending:s,pendingCount:Object.keys(s).length,loaded:{},errors:[],callback:n}),{toLoad:Object.keys(r),pending:Object.keys(s),toLoadLanguages:Object.keys(l),toLoadNamespaces:Object.keys(d)}}loaded(t,i,a){const n=t.split("|"),r=n[0],s=n[1];i&&this.emit("failedLoading",r,s,i),a&&this.store.addResourceBundle(r,s,a,void 0,void 0,{skipCopy:!0}),this.state[t]=i?-1:2;const l={};this.queue.forEach(d=>{lz(d.loaded,[r],s),Az(d,t),i&&d.errors.push(i),d.pendingCount===0&&!d.done&&(Object.keys(d.loaded).forEach(u=>{l[u]||(l[u]={});const h=d.loaded[u];h.length&&h.forEach(g=>{l[u][g]===void 0&&(l[u][g]=!0)})}),d.done=!0,d.errors.length?d.callback(d.errors):d.callback())}),this.emit("loaded",l),this.queue=this.queue.filter(d=>!d.done)}read(t,i,a){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,s=arguments.length>5?arguments[5]:void 0;if(!t.length)return s(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:i,fcName:a,tried:n,wait:r,callback:s});return}this.readingCalls++;const l=(u,h)=>{if(this.readingCalls--,this.waitingReads.length>0){const g=this.waitingReads.shift();this.read(g.lng,g.ns,g.fcName,g.tried,g.wait,g.callback)}if(u&&h&&n<this.maxRetries){setTimeout(()=>{this.read.call(this,t,i,a,n+1,r*2,s)},r);return}s(u,h)},d=this.backend[a].bind(this.backend);if(d.length===2){try{const u=d(t,i);u&&typeof u.then=="function"?u.then(h=>l(null,h)).catch(l):l(null,u)}catch(u){l(u)}return}return d(t,i,l)}prepareLoading(t,i){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=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."),n&&n();typeof t=="string"&&(t=this.languageUtils.toResolveHierarchy(t)),typeof i=="string"&&(i=[i]);const r=this.queueLoad(t,i,a,n);if(!r.toLoad.length)return r.pending.length||n(),null;r.toLoad.forEach(s=>{this.loadOne(s)})}load(t,i,a){this.prepareLoading(t,i,{},a)}reload(t,i,a){this.prepareLoading(t,i,{reload:!0},a)}loadOne(t){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const a=t.split("|"),n=a[0],r=a[1];this.read(n,r,"read",void 0,void 0,(s,l)=>{s&&this.logger.warn(`${i}loading namespace ${r} for language ${n} failed`,s),!s&&l&&this.logger.log(`${i}loaded namespace ${r} for language ${n}`,l),this.loaded(t,s,l)})}saveMissing(t,i,a,n,r){let s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},l=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(i)){this.logger.warn(`did not save key "${a}" as the namespace "${i}" 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(!(a==null||a==="")){if(this.backend&&this.backend.create){const d={...s,isUpdate:r},u=this.backend.create.bind(this.backend);if(u.length<6)try{let h;u.length===5?h=u(t,i,a,n,d):h=u(t,i,a,n),h&&typeof h.then=="function"?h.then(g=>l(null,g)).catch(l):l(null,h)}catch(h){l(h)}else u(t,i,a,n,l,d)}!t||!t[0]||this.store.addResource(t[0],i,a,n)}}}function nf(){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 i={};if(typeof t[1]=="object"&&(i=t[1]),typeof t[1]=="string"&&(i.defaultValue=t[1]),typeof t[2]=="string"&&(i.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const a=t[3]||t[2];Object.keys(a).forEach(n=>{i[n]=a[n]})}return i},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function rf(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 Ns(){}function Lz(e){Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(i=>{typeof e[i]=="function"&&(e[i]=e[i].bind(e))})}class Eo extends mc{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if(super(),this.options=rf(t),this.services={},this.logger=$i,this.modules={external:[]},Lz(this),i&&!this.isInitialized&&!t.isClone){if(!this.options.initImmediate)return this.init(t,i),this;setTimeout(()=>{this.init(t,i)},0)}}init(){var t=this;let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof i=="function"&&(a=i,i={}),!i.defaultNS&&i.defaultNS!==!1&&i.ns&&(typeof i.ns=="string"?i.defaultNS=i.ns:i.ns.indexOf("translation")<0&&(i.defaultNS=i.ns[0]));const n=nf();this.options={...n,...this.options,...rf(i)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...n.interpolation,...this.options.interpolation}),i.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=i.keySeparator),i.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=i.nsSeparator);function r(h){return h?typeof h=="function"?new h:h:null}if(!this.options.isClone){this.modules.logger?$i.init(r(this.modules.logger),this.options):$i.init(null,this.options);let h;this.modules.formatter?h=this.modules.formatter:typeof Intl<"u"&&(h=zz);const g=new ef(this.options);this.store=new Yg(this.options.resources,this.options);const p=this.services;p.logger=$i,p.resourceStore=this.store,p.languageUtils=g,p.pluralResolver=new wz(g,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),h&&(!this.options.interpolation.format||this.options.interpolation.format===n.interpolation.format)&&(p.formatter=r(h),p.formatter.init(p,this.options),this.options.interpolation.format=p.formatter.format.bind(p.formatter)),p.interpolator=new _z(this.options),p.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},p.backendConnector=new jz(r(this.modules.backend),p.resourceStore,p,this.options),p.backendConnector.on("*",function(v){for(var f=arguments.length,b=new Array(f>1?f-1:0),w=1;w<f;w++)b[w-1]=arguments[w];t.emit(v,...b)}),this.modules.languageDetector&&(p.languageDetector=r(this.modules.languageDetector),p.languageDetector.init&&p.languageDetector.init(p,this.options.detection,this.options)),this.modules.i18nFormat&&(p.i18nFormat=r(this.modules.i18nFormat),p.i18nFormat.init&&p.i18nFormat.init(this)),this.translator=new El(this.services,this.options),this.translator.on("*",function(v){for(var f=arguments.length,b=new Array(f>1?f-1:0),w=1;w<f;w++)b[w-1]=arguments[w];t.emit(v,...b)}),this.modules.external.forEach(v=>{v.init&&v.init(this)})}if(this.format=this.options.interpolation.format,a||(a=Ns),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const h=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);h.length>0&&h[0]!=="dev"&&(this.options.lng=h[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(h=>{this[h]=function(){return t.store[h](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(h=>{this[h]=function(){return t.store[h](...arguments),t}});const d=Fr(),u=()=>{const h=(g,p)=>{this.isInitializing=!1,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),d.resolve(p),a(g,p)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return h(null,this.t.bind(this));this.changeLanguage(this.options.lng,h)};return this.options.resources||!this.options.initImmediate?u():setTimeout(u,0),d}loadResources(t){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ns;const n=typeof t=="string"?t:this.language;if(typeof t=="function"&&(a=t),!this.options.resources||this.options.partialBundledLanguages){if(n&&n.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return a();const r=[],s=l=>{if(!l||l==="cimode")return;this.services.languageUtils.toResolveHierarchy(l).forEach(u=>{u!=="cimode"&&r.indexOf(u)<0&&r.push(u)})};n?s(n):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(d=>s(d)),this.options.preload&&this.options.preload.forEach(l=>s(l)),this.services.backendConnector.load(r,this.options.ns,l=>{!l&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),a(l)})}else a(null)}reloadResources(t,i,a){const n=Fr();return t||(t=this.languages),i||(i=this.options.ns),a||(a=Ns),this.services.backendConnector.reload(t,i,r=>{n.resolve(),a(r)}),n}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"&&F1.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 i=0;i<this.languages.length;i++){const a=this.languages[i];if(!(["cimode","dev"].indexOf(a)>-1)&&this.store.hasLanguageSomeTranslations(a)){this.resolvedLanguage=a;break}}}changeLanguage(t,i){var a=this;this.isLanguageChangingTo=t;const n=Fr();this.emit("languageChanging",t);const r=d=>{this.language=d,this.languages=this.services.languageUtils.toResolveHierarchy(d),this.resolvedLanguage=void 0,this.setResolvedLanguage(d)},s=(d,u)=>{u?(r(u),this.translator.changeLanguage(u),this.isLanguageChangingTo=void 0,this.emit("languageChanged",u),this.logger.log("languageChanged",u)):this.isLanguageChangingTo=void 0,n.resolve(function(){return a.t(...arguments)}),i&&i(d,function(){return a.t(...arguments)})},l=d=>{!t&&!d&&this.services.languageDetector&&(d=[]);const u=typeof d=="string"?d:this.services.languageUtils.getBestMatchFromCodes(d);u&&(this.language||r(u),this.translator.language||this.translator.changeLanguage(u),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(u)),this.loadResources(u,h=>{s(h,u)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?l(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(l):this.services.languageDetector.detect(l):l(t),n}getFixedT(t,i,a){var n=this;const r=function(s,l){let d;if(typeof l!="object"){for(var u=arguments.length,h=new Array(u>2?u-2:0),g=2;g<u;g++)h[g-2]=arguments[g];d=n.options.overloadTranslationOptionHandler([s,l].concat(h))}else d={...l};d.lng=d.lng||r.lng,d.lngs=d.lngs||r.lngs,d.ns=d.ns||r.ns,d.keyPrefix!==""&&(d.keyPrefix=d.keyPrefix||a||r.keyPrefix);const p=n.options.keySeparator||".";let v;return d.keyPrefix&&Array.isArray(s)?v=s.map(f=>`${d.keyPrefix}${p}${f}`):v=d.keyPrefix?`${d.keyPrefix}${p}${s}`:s,n.t(v,d)};return typeof t=="string"?r.lng=t:r.lngs=t,r.ns=i,r.keyPrefix=a,r}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 i=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 a=i.lng||this.resolvedLanguage||this.languages[0],n=this.options?this.options.fallbackLng:!1,r=this.languages[this.languages.length-1];if(a.toLowerCase()==="cimode")return!0;const s=(l,d)=>{const u=this.services.backendConnector.state[`${l}|${d}`];return u===-1||u===2};if(i.precheck){const l=i.precheck(this,s);if(l!==void 0)return l}return!!(this.hasResourceBundle(a,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||s(a,t)&&(!n||s(r,t)))}loadNamespaces(t,i){const a=Fr();return this.options.ns?(typeof t=="string"&&(t=[t]),t.forEach(n=>{this.options.ns.indexOf(n)<0&&this.options.ns.push(n)}),this.loadResources(n=>{a.resolve(),i&&i(n)}),a):(i&&i(),Promise.resolve())}loadLanguages(t,i){const a=Fr();typeof t=="string"&&(t=[t]);const n=this.options.preload||[],r=t.filter(s=>n.indexOf(s)<0&&this.services.languageUtils.isSupportedCode(s));return r.length?(this.options.preload=n.concat(r),this.loadResources(s=>{a.resolve(),i&&i(s)}),a):(i&&i(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!t)return"rtl";const i=["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"],a=this.services&&this.services.languageUtils||new ef(nf());return i.indexOf(a.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;return new Eo(t,i)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ns;const a=t.forkResourceStore;a&&delete t.forkResourceStore;const n={...this.options,...t,isClone:!0},r=new Eo(n);return(t.debug!==void 0||t.prefix!==void 0)&&(r.logger=r.logger.clone(t)),["store","services","language"].forEach(l=>{r[l]=this[l]}),r.services={...this.services},r.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},a&&(r.store=new Yg(this.store.data,n),r.services.resourceStore=r.store),r.translator=new El(r.services,n),r.translator.on("*",function(l){for(var d=arguments.length,u=new Array(d>1?d-1:0),h=1;h<d;h++)u[h-1]=arguments[h];r.emit(l,...u)}),r.init(n,i),r.translator.options=n,r.translator.backendConnector.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},r}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const vt=Eo.createInstance();vt.createInstance=Eo.createInstance;vt.createInstance;vt.dir;vt.init;vt.loadResources;vt.reloadResources;vt.use;vt.changeLanguage;vt.getFixedT;const Un=vt.t;vt.exists;vt.setDefaultNamespace;vt.hasLoadedNamespace;vt.loadNamespaces;vt.loadLanguages;function Sz(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function To(e){"@babel/helpers - typeof";return To=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},To(e)}function Mz(e,t){if(To(e)!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var a=i.call(e,t||"default");if(To(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Pz(e){var t=Mz(e,"string");return To(t)=="symbol"?t:t+""}function of(e,t){for(var i=0;i<t.length;i++){var a=t[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,Pz(a.key),a)}}function Cz(e,t,i){return t&&of(e.prototype,t),i&&of(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}var U1=[],Ez=U1.forEach,Tz=U1.slice;function Iz(e){return Ez.call(Tz.call(arguments,1),function(t){if(t)for(var i in t)e[i]===void 0&&(e[i]=t[i])}),e}var sf=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Nz=function(t,i,a){var n=a||{};n.path=n.path||"/";var r=encodeURIComponent(i),s="".concat(t,"=").concat(r);if(n.maxAge>0){var l=n.maxAge-0;if(Number.isNaN(l))throw new Error("maxAge should be a Number");s+="; Max-Age=".concat(Math.floor(l))}if(n.domain){if(!sf.test(n.domain))throw new TypeError("option domain is invalid");s+="; Domain=".concat(n.domain)}if(n.path){if(!sf.test(n.path))throw new TypeError("option path is invalid");s+="; Path=".concat(n.path)}if(n.expires){if(typeof n.expires.toUTCString!="function")throw new TypeError("option expires is invalid");s+="; Expires=".concat(n.expires.toUTCString())}if(n.httpOnly&&(s+="; HttpOnly"),n.secure&&(s+="; Secure"),n.sameSite){var d=typeof n.sameSite=="string"?n.sameSite.toLowerCase():n.sameSite;switch(d){case!0:s+="; SameSite=Strict";break;case"lax":s+="; SameSite=Lax";break;case"strict":s+="; SameSite=Strict";break;case"none":s+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return s},lf={create:function(t,i,a,n){var r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};a&&(r.expires=new Date,r.expires.setTime(r.expires.getTime()+a*60*1e3)),n&&(r.domain=n),document.cookie=Nz(t,encodeURIComponent(i),r)},read:function(t){for(var i="".concat(t,"="),a=document.cookie.split(";"),n=0;n<a.length;n++){for(var r=a[n];r.charAt(0)===" ";)r=r.substring(1,r.length);if(r.indexOf(i)===0)return r.substring(i.length,r.length)}return null},remove:function(t){this.create(t,"",-1)}},Dz={name:"cookie",lookup:function(t){var i;if(t.lookupCookie&&typeof document<"u"){var a=lf.read(t.lookupCookie);a&&(i=a)}return i},cacheUserLanguage:function(t,i){i.lookupCookie&&typeof document<"u"&&lf.create(i.lookupCookie,t,i.cookieMinutes,i.cookieDomain,i.cookieOptions)}},Oz={name:"querystring",lookup:function(t){var i;if(typeof window<"u"){var a=window.location.search;!window.location.search&&window.location.hash&&window.location.hash.indexOf("?")>-1&&(a=window.location.hash.substring(window.location.hash.indexOf("?")));for(var n=a.substring(1),r=n.split("&"),s=0;s<r.length;s++){var l=r[s].indexOf("=");if(l>0){var d=r[s].substring(0,l);d===t.lookupQuerystring&&(i=r[s].substring(l+1))}}}return i}},Ur=null,cf=function(){if(Ur!==null)return Ur;try{Ur=window!=="undefined"&&window.localStorage!==null;var t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{Ur=!1}return Ur},Rz={name:"localStorage",lookup:function(t){var i;if(t.lookupLocalStorage&&cf()){var a=window.localStorage.getItem(t.lookupLocalStorage);a&&(i=a)}return i},cacheUserLanguage:function(t,i){i.lookupLocalStorage&&cf()&&window.localStorage.setItem(i.lookupLocalStorage,t)}},Br=null,df=function(){if(Br!==null)return Br;try{Br=window!=="undefined"&&window.sessionStorage!==null;var t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{Br=!1}return Br},Hz={name:"sessionStorage",lookup:function(t){var i;if(t.lookupSessionStorage&&df()){var a=window.sessionStorage.getItem(t.lookupSessionStorage);a&&(i=a)}return i},cacheUserLanguage:function(t,i){i.lookupSessionStorage&&df()&&window.sessionStorage.setItem(i.lookupSessionStorage,t)}},Vz={name:"navigator",lookup:function(t){var i=[];if(typeof navigator<"u"){if(navigator.languages)for(var a=0;a<navigator.languages.length;a++)i.push(navigator.languages[a]);navigator.userLanguage&&i.push(navigator.userLanguage),navigator.language&&i.push(navigator.language)}return i.length>0?i:void 0}},qz={name:"htmlTag",lookup:function(t){var i,a=t.htmlTag||(typeof document<"u"?document.documentElement:null);return a&&typeof a.getAttribute=="function"&&(i=a.getAttribute("lang")),i}},Fz={name:"path",lookup:function(t){var i;if(typeof window<"u"){var a=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(a instanceof Array)if(typeof t.lookupFromPathIndex=="number"){if(typeof a[t.lookupFromPathIndex]!="string")return;i=a[t.lookupFromPathIndex].replace("/","")}else i=a[0].replace("/","")}return i}},Uz={name:"subdomain",lookup:function(t){var i=typeof t.lookupFromSubdomainIndex=="number"?t.lookupFromSubdomainIndex+1:1,a=typeof window<"u"&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(a)return a[i]}};function Bz(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:function(t){return t}}}var B1=function(){function e(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Sz(this,e),this.type="languageDetector",this.detectors={},this.init(t,i)}return Cz(e,[{key:"init",value:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=i||{languageUtils:{}},this.options=Iz(a,this.options||{},Bz()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=function(r){return r.replace("-","_")}),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=n,this.addDetector(Dz),this.addDetector(Oz),this.addDetector(Rz),this.addDetector(Hz),this.addDetector(Vz),this.addDetector(qz),this.addDetector(Fz),this.addDetector(Uz)}},{key:"addDetector",value:function(i){return this.detectors[i.name]=i,this}},{key:"detect",value:function(i){var a=this;i||(i=this.options.order);var n=[];return i.forEach(function(r){if(a.detectors[r]){var s=a.detectors[r].lookup(a.options);s&&typeof s=="string"&&(s=[s]),s&&(n=n.concat(s))}}),n=n.map(function(r){return a.options.convertDetectedLanguage(r)}),this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}},{key:"cacheUserLanguage",value:function(i,a){var n=this;a||(a=this.options.caches),a&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(i)>-1||a.forEach(function(r){n.detectors[r]&&n.detectors[r].cacheUserLanguage(i,n.options)}))}}]),e}();B1.type="languageDetector";const Gz={onboarding:{home:{welcome:"Welcome",getStarted:"Get Started"},llm:{title:"LLM Preference",description:"Totem LLM can work with many LLM providers. This will be the service which handles chatting."},userSetup:{title:"User Setup",description:"Configure your user settings.",howManyUsers:"How many users will be using this instance?",justMe:"Just me",myTeam:"My team",instancePassword:"Instance Password",setPassword:"Would you like to set up a password?",passwordReq:"Passwords must be at least 8 characters.",passwordWarn:"It's important to save this password because there is no recovery method.",adminUsername:"Admin account username",adminPassword:"Admin account password",adminPasswordReq:"Passwords must be at least 8 characters.",teamHint:"By default, you will be the only admin. Once onboarding is completed you can create and invite others to be users or admins. Do not lose your password as only admins can reset passwords."},data:{title:"Data Handling & Privacy",description:"We are committed to transparency and control when it comes to your personal data.",settingsHint:"These settings can be reconfigured at any time in the settings."},survey:{title:"Welcome to Totem LLM",description:"Help us make Totem LLM built for your needs. Optional.",email:"What's your email?",useCase:"What will you use Totem LLM for?",useCaseWork:"For work",useCasePersonal:"For personal use",useCaseOther:"Other",comment:"How did you hear about Totem LLM?",commentPlaceholder:"Reddit, Twitter, GitHub, YouTube, etc. - Let us know how you found us!",skip:"Skip Survey",thankYou:"Thank you for your feedback!"}},common:{"workspaces-name":"Workspace Name",selection:"Model Selection",saving:"Saving...",save:"Save changes",previous:"Previous Page",next:"Next Page",optional:"Optional",yes:"Yes",no:"No",on:"On",none:"None",stopped:"Stopped",search:"Search",username_requirements:"Username must be 2-32 characters, start with a lowercase letter, and only contain lowercase letters, numbers, underscores, hyphens, and periods.",loading:"Loading",refresh:"Refresh"},home:{welcome:"Welcome",chooseWorkspace:"Choose a workspace to start chatting!",notAssigned:`You currently aren't assigned to any workspaces.
|
|
70
70
|
Please contact your administrator to request access to a workspace.`,goToWorkspace:'Go to "{{workspace}}"'},settings:{title:"Instance Settings",invites:"Invites",users:"Users",workspaces:"Workspaces","workspace-chats":"Workspace Chats",customization:"Customization",interface:"UI Preferences",branding:"Branding & Whitelabeling",chat:"Chat","api-keys":"Developer API",llm:"LLM",transcription:"Transcription",embedder:"Embedder","text-splitting":"Text Splitter & Chunking","voice-speech":"Voice & Speech","vector-database":"Vector Database",embeds:"Chat Embed",security:"Security","event-logs":"Event Logs","scheduled-jobs":"Scheduled Jobs",privacy:"Privacy & Data","ai-providers":"AI Providers","agent-skills":"Agent Skills","model-router":"Model Router","community-hub":{title:"Community Hub",trending:"Explore Trending","your-account":"Your Account","import-item":"Import Item"},admin:"Admin",tools:"Tools","system-prompt-variables":"System Prompt Variables","experimental-features":"Experimental Features",contact:"Contact Support","browser-extension":"Browser Extension","mobile-app":"Totem LLM Mobile",channels:"Channels","available-channels":{telegram:"Telegram"}},login:{"multi-user":{welcome:"Welcome","placeholder-username":"Username","placeholder-password":"Password",login:"Login",validating:"Validating...","forgot-pass":"Forgot password",reset:"Reset"},"sign-in":"Enter your username and password to access your {{appName}} instance.","password-reset":{title:"Password Reset",description:"Provide the necessary information below to reset your password.","recovery-codes":"Recovery Codes","back-to-login":"Back to Login"}},"main-page":{greeting:"How can I help you today?",quickActions:{createAgent:"Create an Agent",editWorkspace:"Edit Workspace",uploadDocument:"Upload a Document"}},"new-workspace":{title:"New Workspace",placeholder:"My Workspace"},"workspaces—settings":{general:"General Settings",chat:"Chat Settings",vector:"Vector Database",members:"Members",agent:"Agent Configuration"},general:{vector:{title:"Vector Count",description:"Total number of vectors in your vector database."},names:{description:"This will only change the display name of your workspace."},message:{title:"Suggested Chat Messages",description:"Customize the messages that will be suggested to your workspace users.",add:"Add new message",save:"Save Messages",heading:"Explain to me",body:"the benefits of Totem LLM"},delete:{title:"Delete Workspace",description:"Delete this workspace and all of its data. This will delete the workspace for all users.",delete:"Delete Workspace",deleting:"Deleting Workspace...","confirm-start":"You are about to delete your entire","confirm-end":`workspace. This will remove all vector embeddings in your vector database.
|
|
71
71
|
|
|
72
72
|
The original source files will remain untouched. This action is irreversible.`}},chat:{llm:{title:"Workspace LLM Provider",description:"The specific LLM provider & model that will be used for this workspace. By default, it uses the system LLM provider and settings.",search:"Search all LLM providers"},model:{title:"Workspace Chat model",description:"The specific chat model that will be used for this workspace. If empty, will use the system LLM preference."},mode:{title:"Chat mode",automatic:{title:"Agent",description:"will automatically use tools if the model and provider support native tool calling.<br />If native tooling is not supported, you will need to use the @agent command to use tools."},chat:{title:"Chat",description:"will provide answers with the LLM's general knowledge <b>and</b> document context that is found.<br />You will need to use the @agent command to use tools."},query:{title:"Query",description:"will provide answers <b>only</b> if document context is found.<br />You will need to use the @agent command to use tools."}},history:{title:"Chat History","desc-start":"The number of previous chats that will be included in the response's short-term memory.",recommend:"Recommend 20. ","desc-end":"Anything more than 45 is likely to lead to continuous chat failures depending on message size."},prompt:{title:"System Prompt",description:"The prompt that will be used on this workspace. Define the context and instructions for the AI to generate a response. You should provide a carefully crafted prompt so the AI can generate a relevant and accurate response.",history:{title:"System Prompt History",clearAll:"Clear All",noHistory:"No system prompt history available",restore:"Restore",delete:"Delete",publish:"Publish to Community Hub",deleteConfirm:"Are you sure you want to delete this history item?",clearAllConfirm:"Are you sure you want to clear all history? This action cannot be undone.",expand:"Expand"}},refusal:{title:"Query mode refusal response","desc-start":"When in",query:"query","desc-end":"mode, you may want to return a custom refusal response when no context is found.","tooltip-title":"Why am I seeing this?","tooltip-description":"You are in query mode, which only uses information from your documents. Switch to chat mode for more flexible conversations, or click here to visit our documentation to learn more about chat modes."},temperature:{title:"LLM Temperature","desc-start":'This setting controls how "creative" your LLM responses will be.',"desc-end":"The higher the number the more creative. For some models this can lead to incoherent responses when set too high.",hint:"Most LLMs have various acceptable ranges of valid values. Consult your LLM provider for that information."}},"vector-workspace":{identifier:"Vector database identifier",snippets:{title:"Max Context Snippets",description:"This setting controls the maximum amount of context snippets that will be sent to the LLM for per chat or query.",recommend:"Recommended: 4"},doc:{title:"Document similarity threshold",description:"The minimum similarity score required for a source to be considered related to the chat. The higher the number, the more similar the source must be to the chat.",zero:"No restriction",low:"Low (similarity score ≥ .25)",medium:"Medium (similarity score ≥ .50)",high:"High (similarity score ≥ .75)"},reset:{reset:"Reset Vector Database",resetting:"Clearing vectors...",confirm:`You are about to reset this workspace's vector database. This will remove all vector embeddings currently embedded.
|
|
@@ -1703,8 +1703,8 @@ Aquesta acció és irreversible.`,"toast-deleted":"Router eliminat","toast-delet
|
|
|
1703
1703
|
* {@link https://github.com/ReactTooltip/react-tooltip}
|
|
1704
1704
|
* @copyright ReactTooltip Team
|
|
1705
1705
|
* @license MIT
|
|
1706
|
-
*/const eC="react-tooltip-core-styles",tC="react-tooltip-base-styles",s0={core:!1,base:!1};function l0({css:e,id:t=tC,type:i="base",ref:a}){var n,r;if(!e||typeof document>"u"||s0[i]||i==="core"&&typeof process<"u"&&(!((n=process==null?void 0:{GJS_DEBUG_TOPICS:"JS ERROR;JS LOG",PYTHON_BASIC_REPL:"1",LESSOPEN:"| /usr/bin/lesspipe %s",npm_package_dependencies_react_dropzone:"^14.2.3",npm_package_devDependencies__types_react_router_dom:"^5.3.3",npm_package_dependencies_cronstrue:"^2.50.0",USER:"mike-diker",npm_config_user_agent:"yarn/1.22.22 npm/? node/v24.10.0 linux x64",npm_package_devDependencies__esbuild_plugins_node_globals_polyfill:"^0.1.1",npm_package_dependencies_react_toastify:"^9.1.3",npm_package_dependencies_js_levenshtein:"^1.1.6",npm_config_version_commit_hooks:"true",FONTCONFIG_PATH:"/etc/fonts",GIO_MODULE_DIR:"/home/mike-diker/snap/code/common/.cache/gio-modules",npm_package_devDependencies_buffer:"^6.0.3",npm_package_dependencies_text_case:"^1.0.9",npm_package_dependencies_react_device_detect:"^2.2.2",npm_package_dependencies__lobehub_icons:"^4.0.3",npm_config_bin_links:"true",XDG_SESSION_TYPE:"x11",GIT_ASKPASS:"/snap/code/241/usr/share/code/resources/app/extensions/git/dist/askpass.sh",GTK_EXE_PREFIX_VSCODE_SNAP_ORIG:"",npm_node_execpath:"/home/mike-diker/.nvm/versions/node/v24.10.0/bin/node",npm_package_devDependencies_vite:"^4.3.0",npm_config_init_version:"1.0.0",GDK_BACKEND_VSCODE_SNAP_ORIG:"",CLUTTER_DISABLE_MIPMAPPED_TEXT:"1",SHLVL:"1",npm_config_noproxy:"",HOME:"/home/mike-diker",CHROME_DESKTOP:"code.desktop",LOCPATH_VSCODE_SNAP_ORIG:"",npm_package_devDependencies__eslint_js:"^9.39.2",TERM_PROGRAM_VERSION:"1.121.0",DESKTOP_SESSION:"ubuntu",GTK_PATH:"/snap/code/241/usr/lib/x86_64-linux-gnu/gtk-3.0",NVM_BIN:"/home/mike-diker/.nvm/versions/node/v24.10.0/bin",npm_package_json:"/home/mike-diker/git-repos/totem-llm/package.json",npm_package_devDependencies_eslint_config_prettier:"^9.0.0",NVM_INC:"/home/mike-diker/.nvm/versions/node/v24.10.0/include/node",XDG_DATA_HOME_VSCODE_SNAP_ORIG:"",GTK_IM_MODULE_FILE:"/home/mike-diker/snap/code/common/.cache/immodules/immodules.cache",GIO_LAUNCHED_DESKTOP_FILE:"/var/lib/snapd/desktop/applications/code_code.desktop",npm_package_engines_node:">=18",npm_config_init_license:"MIT",GNOME_SHELL_SESSION_MODE:"ubuntu",GTK_MODULES:"gail:atk-bridge",GSETTINGS_SCHEMA_DIR_VSCODE_SNAP_ORIG:"",VSCODE_GIT_ASKPASS_MAIN:"/snap/code/241/usr/share/code/resources/app/extensions/git/dist/askpass-main.js",YARN_WRAP_OUTPUT:"false",npm_package_devDependencies_flow_remove_types:"^2.217.1",npm_config_version_tag_prefix:"v",VSCODE_GIT_ASKPASS_NODE:"/snap/code/241/usr/share/code/code",MANAGERPID:"3558",npm_config_userconfig:"/home/mike-diker/.npmrc",npm_config_local_prefix:"/home/mike-diker/git-repos/totem-llm",npm_package_dependencies_react_i18next:"^14.1.1",SYSTEMD_EXEC_PID:"4202",VSCODE_PYTHON_AUTOACTIVATE_GUARD:"1",GSM_SKIP_SSH_AGENT_WORKAROUND:"true",DBUS_SESSION_BUS_ADDRESS:"unix:path=/run/user/1000/bus",npm_package_devDependencies_eslint_plugin_react_hooks:"^7.0.1",npm_package_dependencies_moment:"^2.30.1",COLORTERM:"truecolor",GIO_LAUNCHED_DESKTOP_FILE_PID:"5033",COLOR:"1",npm_package_devDependencies_tailwindcss:"^3.3.1",npm_package_dependencies_react_router_dom:"^6.3.0",npm_package_dependencies_react_error_boundary:"^6.0.0",npm_package_dependencies_i18next:"^23.11.3",NVM_DIR:"/home/mike-diker/.nvm",DEBUGINFOD_URLS:"https://debuginfod.ubuntu.com ",npm_package_devDependencies__types_react_dom:"^18.2.8",npm_package_dependencies_katex:"^0.6.0",npm_package_devDependencies_prettier:"^3.0.3",npm_package_dependencies_react_confetti_explosion:"^2.1.2",npm_package_scripts_dev:"cross-env NODE_ENV=development vite --debug --host=0.0.0.0",LOGNAME:"mike-diker",npm_package_devDependencies__vitejs_plugin_react:"^4.0.0-beta.0",npm_package_dependencies_react_tooltip:"^5.25.2",npm_package_type:"module",JOURNAL_STREAM:"9:33800",_:"/home/mike-diker/.nvm/versions/node/v24.10.0/bin/npm",npm_config_prefix:"/home/mike-diker/.nvm/versions/node/v24.10.0",npm_config_npm_version:"11.6.1",npm_package_devDependencies_autoprefixer:"^10.4.14",npm_package_dependencies_onnxruntime_web:"^1.18.0",npm_package_dependencies_i18next_browser_languagedetector:"^7.2.1",npm_package_private:"false",XDG_CONFIG_DIRS_VSCODE_SNAP_ORIG:"/etc/xdg/xdg-ubuntu:/etc/xdg",MEMORY_PRESSURE_WATCH:"/sys/fs/cgroup/user.slice/user-1000.slice/user@1000.service/session.slice/org.gnome.Shell@x11.service/memory.pressure",XDG_SESSION_CLASS:"user",XDG_DATA_DIRS_VSCODE_SNAP_ORIG:"/usr/share/ubuntu:/usr/share/gnome:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop",npm_package_dependencies_react_speech_recognition:"^3.10.0",npm_package_dependencies_react_beautiful_dnd:"13.1.1",npm_package_scripts_lint:"eslint --fix src",npm_config_registry:"https://registry.yarnpkg.com",USERNAME:"mike-diker",TERM:"xterm-256color",npm_config_cache:"/home/mike-diker/.npm",GNOME_DESKTOP_SESSION_ID:"this-is-deprecated",FC_FONTATIONS:"1",npm_package_devDependencies_eslint_plugin_react_refresh:"^0.4.3",npm_package_scripts_start:"vite --open",npm_config_ignore_scripts:"",WINDOWPATH:"2",npm_config_node_gyp:"/home/mike-diker/.nvm/versions/node/v24.10.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js",npm_package_dependencies_recharts:"^2.12.5",PATH:"/tmp/yarn--1780627688803-0.19399038405742697:/home/mike-diker/git-repos/totem-llm/frontend/node_modules/.bin:/home/mike-diker/snap/code/241/.local/share/yarn/link/node_modules/.bin:/home/mike-diker/.nvm/versions/node/v24.10.0/libexec/lib/node_modules/npm/bin/node-gyp-bin:/home/mike-diker/.nvm/versions/node/v24.10.0/lib/node_modules/npm/bin/node-gyp-bin:/home/mike-diker/.nvm/versions/node/v24.10.0/bin/node_modules/npm/bin/node-gyp-bin:/home/mike-diker/git-repos/totem-llm/node_modules/.bin:/home/mike-diker/git-repos/node_modules/.bin:/home/mike-diker/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/home/mike-diker/.nvm/versions/node/v24.10.0/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin:/home/mike-diker/.local/share/solana/install/active_release/bin:/home/mike-diker/.config/Code/User/globalStorage/github.copilot-chat/debugCommand:/home/mike-diker/.config/Code/User/globalStorage/github.copilot-chat/copilotCli:/home/mike-diker/.local/share/solana/install/active_release/bin:/home/mike-diker/.local/bin:/home/mike-diker/.local/share/solana/install/active_release/bin:/home/mike-diker/.nvm/versions/node/v24.10.0/bin:/home/mike-diker/.local/share/solana/install/active_release/bin:/home/mike-diker/.cargo/bin:/home/mike-diker/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin:/home/mike-diker/.local/bin:/home/mike-diker/.local/bin:/home/mike-diker/.local/bin:/home/mike-diker/.local/bin",NODE:"/home/mike-diker/.nvm/versions/node/v24.10.0/bin/node",SESSION_MANAGER:"local/mike-diker-Precision-7530:@/tmp/.ICE-unix/4176,unix/mike-diker-Precision-7530:/tmp/.ICE-unix/4176",GTK_EXE_PREFIX:"/snap/code/241/usr",INVOCATION_ID:"64c065948fa541279cfe1dc565c1037d",npm_package_name:"anything-llm-frontend",npm_package_dependencies_recharts_to_png:"^2.3.1",npm_package_dependencies_file_saver:"^2.0.5",XDG_MENU_PREFIX:"gnome-",XDG_RUNTIME_DIR:"/run/user/1000",GDK_BACKEND:"x11",npm_package_devDependencies_hermes_eslint:"^0.15.0",npm_package_devDependencies_flow_bin:"^0.217.0",DISPLAY:":1",LOCPATH:"/snap/code/241/usr/lib/locale",npm_package_devDependencies_eslint_plugin_ft_flow:"^3.0.0",npm_package_dependencies_react_highlight_words:"^0.21.0",LANG:"en_US.UTF-8",XDG_CURRENT_DESKTOP:"ubuntu:GNOME",PYTHONSTARTUP:"/home/mike-diker/.config/Code/User/workspaceStorage/e3f9de5e65c351ebaea57871eb56e5ba/ms-python.python/pythonrc.py",npm_package_devDependencies_eslint:"^9.39.2",npm_package_dependencies_react_dom:"^18.2.0",npm_package_dependencies__microsoft_fetch_event_source:"^2.0.1",GIO_MODULE_DIR_VSCODE_SNAP_ORIG:"",XDG_DATA_HOME:"/home/mike-diker/snap/code/241/.local/share",XMODIFIERS:"@im=ibus",XDG_SESSION_DESKTOP:"ubuntu",XAUTHORITY:"/run/user/1000/gdm/Xauthority",LS_COLORS:"rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=00:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.avif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:*~=00;90:*#=00;90:*.bak=00;90:*.crdownload=00;90:*.dpkg-dist=00;90:*.dpkg-new=00;90:*.dpkg-old=00;90:*.dpkg-tmp=00;90:*.old=00;90:*.orig=00;90:*.part=00;90:*.rej=00;90:*.rpmnew=00;90:*.rpmorig=00;90:*.rpmsave=00;90:*.swp=00;90:*.tmp=00;90:*.ucf-dist=00;90:*.ucf-new=00;90:*.ucf-old=00;90:",VSCODE_GIT_IPC_HANDLE:"/run/user/1000/vscode-git-9b67e3720d.sock",TERM_PROGRAM:"vscode",npm_lifecycle_script:"vite build && node scripts/postbuild.js",npm_package_dependencies_lodash_debounce:"^4.0.8",SSH_AUTH_SOCK:"/run/user/1000/keyring/ssh",GSETTINGS_SCHEMA_DIR:"/home/mike-diker/snap/code/241/.local/share/glib-2.0/schemas",npm_config_version_git_message:"v%s",SHELL:"/bin/bash",npm_package_version:"",npm_lifecycle_event:"build",npm_package_devDependencies_eslint_plugin_unused_imports:"^4.3.0",npm_package_devDependencies__types_react:"^18.2.23",npm_package_dependencies_pluralize:"^8.0.0",QT_ACCESSIBILITY:"1",GDMSESSION:"ubuntu",npm_config_argv:'{"remain":[],"cooked":["run","build"],"original":["build"]}',npm_package_dependencies_uuid:"^9.0.0",npm_package_dependencies_he:"^1.2.0",npm_package_scripts_build:"vite build && node scripts/postbuild.js",LESSCLOSE:"/usr/bin/lesspipe %s %s",GTK_PATH_VSCODE_SNAP_ORIG:"",FONTCONFIG_FILE:"/etc/fonts/fonts.conf",GTK_IM_MODULE_FILE_VSCODE_SNAP_ORIG:"",npm_package_dependencies_truncate:"^3.0.0",npm_package_dependencies_qrcode_react:"^4.2.0",npm_package_dependencies__phosphor_icons_react:"^2.1.7",npm_config_version_git_tag:"true",npm_config_version_git_sign:"",GPG_AGENT_INFO:"/run/user/1000/gnupg/S.gpg-agent:0:1",GJS_DEBUG_OUTPUT:"stderr",npm_package_devDependencies_globals:"^16.5.0",npm_package_devDependencies_eslint_plugin_react:"^7.37.5",npm_package_dependencies_markdown_it:"^13.0.1",npm_package_license:"MIT",npm_config_strict_ssl:"true",VSCODE_GIT_ASKPASS_EXTRA_ARGS:"",QT_IM_MODULE:"ibus",npm_config_globalconfig:"/home/mike-diker/.nvm/versions/node/v24.10.0/etc/npmrc",npm_config_init_module:"/home/mike-diker/.npm-init.js",npm_package_devDependencies_eslint_plugin_prettier:"^5.0.0",PWD:"/home/mike-diker/git-repos/totem-llm/frontend",npm_execpath:"/home/mike-diker/.nvm/versions/node/v24.10.0/lib/node_modules/npm/bin/npm-cli.js",npm_package_dependencies_react_tag_input_component:"^2.0.2",XDG_CONFIG_DIRS:"/etc/xdg/xdg-ubuntu:/etc/xdg",NVM_CD_FLAGS:"",XDG_DATA_DIRS:"/home/mike-diker/snap/code/241/.local/share:/home/mike-diker/snap/code/241:/snap/code/241/usr/share:/usr/share/ubuntu:/usr/share/gnome:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop",npm_config_global_prefix:"/home/mike-diker/.nvm/versions/node/v24.10.0",npm_package_dependencies_dompurify:"^3.0.8",npm_command:"publish",npm_package_devDependencies_postcss:"^8.4.23",npm_package_devDependencies_cross_env:"^7.0.3",npm_package_dependencies__tremor_react:"^3.15.1",npm_config_save_prefix:"^",npm_config_ignore_optional:"",npm_package_devDependencies_rollup_plugin_visualizer:"^5.9.0",npm_package_scripts_preview:"vite preview",MEMORY_PRESSURE_WRITE:"c29tZSAyMDAwMDAgMjAwMDAwMAA=",npm_package_dependencies_react_loading_skeleton:"^3.1.0",npm_package_dependencies__mintplex_labs_piper_tts_web:"^1.0.4",npm_package_scripts_lint_check:"eslint src",INIT_CWD:"/home/mike-diker/git-repos/totem-llm",EDITOR:"vi",npm_package_dependencies_react:"^18.2.0",npm_package_dependencies_highlight_js:"^11.9.0",NODE_ENV:"production"})===null||n===void 0)&&n.REACT_TOOLTIP_DISABLE_CORE_STYLES)||i!=="base"&&typeof process<"u"&&(!((r=process==null?void 0:{GJS_DEBUG_TOPICS:"JS ERROR;JS LOG",PYTHON_BASIC_REPL:"1",LESSOPEN:"| /usr/bin/lesspipe %s",npm_package_dependencies_react_dropzone:"^14.2.3",npm_package_devDependencies__types_react_router_dom:"^5.3.3",npm_package_dependencies_cronstrue:"^2.50.0",USER:"mike-diker",npm_config_user_agent:"yarn/1.22.22 npm/? node/v24.10.0 linux x64",npm_package_devDependencies__esbuild_plugins_node_globals_polyfill:"^0.1.1",npm_package_dependencies_react_toastify:"^9.1.3",npm_package_dependencies_js_levenshtein:"^1.1.6",npm_config_version_commit_hooks:"true",FONTCONFIG_PATH:"/etc/fonts",GIO_MODULE_DIR:"/home/mike-diker/snap/code/common/.cache/gio-modules",npm_package_devDependencies_buffer:"^6.0.3",npm_package_dependencies_text_case:"^1.0.9",npm_package_dependencies_react_device_detect:"^2.2.2",npm_package_dependencies__lobehub_icons:"^4.0.3",npm_config_bin_links:"true",XDG_SESSION_TYPE:"x11",GIT_ASKPASS:"/snap/code/241/usr/share/code/resources/app/extensions/git/dist/askpass.sh",GTK_EXE_PREFIX_VSCODE_SNAP_ORIG:"",npm_node_execpath:"/home/mike-diker/.nvm/versions/node/v24.10.0/bin/node",npm_package_devDependencies_vite:"^4.3.0",npm_config_init_version:"1.0.0",GDK_BACKEND_VSCODE_SNAP_ORIG:"",CLUTTER_DISABLE_MIPMAPPED_TEXT:"1",SHLVL:"1",npm_config_noproxy:"",HOME:"/home/mike-diker",CHROME_DESKTOP:"code.desktop",LOCPATH_VSCODE_SNAP_ORIG:"",npm_package_devDependencies__eslint_js:"^9.39.2",TERM_PROGRAM_VERSION:"1.121.0",DESKTOP_SESSION:"ubuntu",GTK_PATH:"/snap/code/241/usr/lib/x86_64-linux-gnu/gtk-3.0",NVM_BIN:"/home/mike-diker/.nvm/versions/node/v24.10.0/bin",npm_package_json:"/home/mike-diker/git-repos/totem-llm/package.json",npm_package_devDependencies_eslint_config_prettier:"^9.0.0",NVM_INC:"/home/mike-diker/.nvm/versions/node/v24.10.0/include/node",XDG_DATA_HOME_VSCODE_SNAP_ORIG:"",GTK_IM_MODULE_FILE:"/home/mike-diker/snap/code/common/.cache/immodules/immodules.cache",GIO_LAUNCHED_DESKTOP_FILE:"/var/lib/snapd/desktop/applications/code_code.desktop",npm_package_engines_node:">=18",npm_config_init_license:"MIT",GNOME_SHELL_SESSION_MODE:"ubuntu",GTK_MODULES:"gail:atk-bridge",GSETTINGS_SCHEMA_DIR_VSCODE_SNAP_ORIG:"",VSCODE_GIT_ASKPASS_MAIN:"/snap/code/241/usr/share/code/resources/app/extensions/git/dist/askpass-main.js",YARN_WRAP_OUTPUT:"false",npm_package_devDependencies_flow_remove_types:"^2.217.1",npm_config_version_tag_prefix:"v",VSCODE_GIT_ASKPASS_NODE:"/snap/code/241/usr/share/code/code",MANAGERPID:"3558",npm_config_userconfig:"/home/mike-diker/.npmrc",npm_config_local_prefix:"/home/mike-diker/git-repos/totem-llm",npm_package_dependencies_react_i18next:"^14.1.1",SYSTEMD_EXEC_PID:"4202",VSCODE_PYTHON_AUTOACTIVATE_GUARD:"1",GSM_SKIP_SSH_AGENT_WORKAROUND:"true",DBUS_SESSION_BUS_ADDRESS:"unix:path=/run/user/1000/bus",npm_package_devDependencies_eslint_plugin_react_hooks:"^7.0.1",npm_package_dependencies_moment:"^2.30.1",COLORTERM:"truecolor",GIO_LAUNCHED_DESKTOP_FILE_PID:"5033",COLOR:"1",npm_package_devDependencies_tailwindcss:"^3.3.1",npm_package_dependencies_react_router_dom:"^6.3.0",npm_package_dependencies_react_error_boundary:"^6.0.0",npm_package_dependencies_i18next:"^23.11.3",NVM_DIR:"/home/mike-diker/.nvm",DEBUGINFOD_URLS:"https://debuginfod.ubuntu.com ",npm_package_devDependencies__types_react_dom:"^18.2.8",npm_package_dependencies_katex:"^0.6.0",npm_package_devDependencies_prettier:"^3.0.3",npm_package_dependencies_react_confetti_explosion:"^2.1.2",npm_package_scripts_dev:"cross-env NODE_ENV=development vite --debug --host=0.0.0.0",LOGNAME:"mike-diker",npm_package_devDependencies__vitejs_plugin_react:"^4.0.0-beta.0",npm_package_dependencies_react_tooltip:"^5.25.2",npm_package_type:"module",JOURNAL_STREAM:"9:33800",_:"/home/mike-diker/.nvm/versions/node/v24.10.0/bin/npm",npm_config_prefix:"/home/mike-diker/.nvm/versions/node/v24.10.0",npm_config_npm_version:"11.6.1",npm_package_devDependencies_autoprefixer:"^10.4.14",npm_package_dependencies_onnxruntime_web:"^1.18.0",npm_package_dependencies_i18next_browser_languagedetector:"^7.2.1",npm_package_private:"false",XDG_CONFIG_DIRS_VSCODE_SNAP_ORIG:"/etc/xdg/xdg-ubuntu:/etc/xdg",MEMORY_PRESSURE_WATCH:"/sys/fs/cgroup/user.slice/user-1000.slice/user@1000.service/session.slice/org.gnome.Shell@x11.service/memory.pressure",XDG_SESSION_CLASS:"user",XDG_DATA_DIRS_VSCODE_SNAP_ORIG:"/usr/share/ubuntu:/usr/share/gnome:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop",npm_package_dependencies_react_speech_recognition:"^3.10.0",npm_package_dependencies_react_beautiful_dnd:"13.1.1",npm_package_scripts_lint:"eslint --fix src",npm_config_registry:"https://registry.yarnpkg.com",USERNAME:"mike-diker",TERM:"xterm-256color",npm_config_cache:"/home/mike-diker/.npm",GNOME_DESKTOP_SESSION_ID:"this-is-deprecated",FC_FONTATIONS:"1",npm_package_devDependencies_eslint_plugin_react_refresh:"^0.4.3",npm_package_scripts_start:"vite --open",npm_config_ignore_scripts:"",WINDOWPATH:"2",npm_config_node_gyp:"/home/mike-diker/.nvm/versions/node/v24.10.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js",npm_package_dependencies_recharts:"^2.12.5",PATH:"/tmp/yarn--1780627688803-0.19399038405742697:/home/mike-diker/git-repos/totem-llm/frontend/node_modules/.bin:/home/mike-diker/snap/code/241/.local/share/yarn/link/node_modules/.bin:/home/mike-diker/.nvm/versions/node/v24.10.0/libexec/lib/node_modules/npm/bin/node-gyp-bin:/home/mike-diker/.nvm/versions/node/v24.10.0/lib/node_modules/npm/bin/node-gyp-bin:/home/mike-diker/.nvm/versions/node/v24.10.0/bin/node_modules/npm/bin/node-gyp-bin:/home/mike-diker/git-repos/totem-llm/node_modules/.bin:/home/mike-diker/git-repos/node_modules/.bin:/home/mike-diker/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/home/mike-diker/.nvm/versions/node/v24.10.0/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin:/home/mike-diker/.local/share/solana/install/active_release/bin:/home/mike-diker/.config/Code/User/globalStorage/github.copilot-chat/debugCommand:/home/mike-diker/.config/Code/User/globalStorage/github.copilot-chat/copilotCli:/home/mike-diker/.local/share/solana/install/active_release/bin:/home/mike-diker/.local/bin:/home/mike-diker/.local/share/solana/install/active_release/bin:/home/mike-diker/.nvm/versions/node/v24.10.0/bin:/home/mike-diker/.local/share/solana/install/active_release/bin:/home/mike-diker/.cargo/bin:/home/mike-diker/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin:/home/mike-diker/.local/bin:/home/mike-diker/.local/bin:/home/mike-diker/.local/bin:/home/mike-diker/.local/bin",NODE:"/home/mike-diker/.nvm/versions/node/v24.10.0/bin/node",SESSION_MANAGER:"local/mike-diker-Precision-7530:@/tmp/.ICE-unix/4176,unix/mike-diker-Precision-7530:/tmp/.ICE-unix/4176",GTK_EXE_PREFIX:"/snap/code/241/usr",INVOCATION_ID:"64c065948fa541279cfe1dc565c1037d",npm_package_name:"anything-llm-frontend",npm_package_dependencies_recharts_to_png:"^2.3.1",npm_package_dependencies_file_saver:"^2.0.5",XDG_MENU_PREFIX:"gnome-",XDG_RUNTIME_DIR:"/run/user/1000",GDK_BACKEND:"x11",npm_package_devDependencies_hermes_eslint:"^0.15.0",npm_package_devDependencies_flow_bin:"^0.217.0",DISPLAY:":1",LOCPATH:"/snap/code/241/usr/lib/locale",npm_package_devDependencies_eslint_plugin_ft_flow:"^3.0.0",npm_package_dependencies_react_highlight_words:"^0.21.0",LANG:"en_US.UTF-8",XDG_CURRENT_DESKTOP:"ubuntu:GNOME",PYTHONSTARTUP:"/home/mike-diker/.config/Code/User/workspaceStorage/e3f9de5e65c351ebaea57871eb56e5ba/ms-python.python/pythonrc.py",npm_package_devDependencies_eslint:"^9.39.2",npm_package_dependencies_react_dom:"^18.2.0",npm_package_dependencies__microsoft_fetch_event_source:"^2.0.1",GIO_MODULE_DIR_VSCODE_SNAP_ORIG:"",XDG_DATA_HOME:"/home/mike-diker/snap/code/241/.local/share",XMODIFIERS:"@im=ibus",XDG_SESSION_DESKTOP:"ubuntu",XAUTHORITY:"/run/user/1000/gdm/Xauthority",LS_COLORS:"rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=00:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.avif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:*~=00;90:*#=00;90:*.bak=00;90:*.crdownload=00;90:*.dpkg-dist=00;90:*.dpkg-new=00;90:*.dpkg-old=00;90:*.dpkg-tmp=00;90:*.old=00;90:*.orig=00;90:*.part=00;90:*.rej=00;90:*.rpmnew=00;90:*.rpmorig=00;90:*.rpmsave=00;90:*.swp=00;90:*.tmp=00;90:*.ucf-dist=00;90:*.ucf-new=00;90:*.ucf-old=00;90:",VSCODE_GIT_IPC_HANDLE:"/run/user/1000/vscode-git-9b67e3720d.sock",TERM_PROGRAM:"vscode",npm_lifecycle_script:"vite build && node scripts/postbuild.js",npm_package_dependencies_lodash_debounce:"^4.0.8",SSH_AUTH_SOCK:"/run/user/1000/keyring/ssh",GSETTINGS_SCHEMA_DIR:"/home/mike-diker/snap/code/241/.local/share/glib-2.0/schemas",npm_config_version_git_message:"v%s",SHELL:"/bin/bash",npm_package_version:"",npm_lifecycle_event:"build",npm_package_devDependencies_eslint_plugin_unused_imports:"^4.3.0",npm_package_devDependencies__types_react:"^18.2.23",npm_package_dependencies_pluralize:"^8.0.0",QT_ACCESSIBILITY:"1",GDMSESSION:"ubuntu",npm_config_argv:'{"remain":[],"cooked":["run","build"],"original":["build"]}',npm_package_dependencies_uuid:"^9.0.0",npm_package_dependencies_he:"^1.2.0",npm_package_scripts_build:"vite build && node scripts/postbuild.js",LESSCLOSE:"/usr/bin/lesspipe %s %s",GTK_PATH_VSCODE_SNAP_ORIG:"",FONTCONFIG_FILE:"/etc/fonts/fonts.conf",GTK_IM_MODULE_FILE_VSCODE_SNAP_ORIG:"",npm_package_dependencies_truncate:"^3.0.0",npm_package_dependencies_qrcode_react:"^4.2.0",npm_package_dependencies__phosphor_icons_react:"^2.1.7",npm_config_version_git_tag:"true",npm_config_version_git_sign:"",GPG_AGENT_INFO:"/run/user/1000/gnupg/S.gpg-agent:0:1",GJS_DEBUG_OUTPUT:"stderr",npm_package_devDependencies_globals:"^16.5.0",npm_package_devDependencies_eslint_plugin_react:"^7.37.5",npm_package_dependencies_markdown_it:"^13.0.1",npm_package_license:"MIT",npm_config_strict_ssl:"true",VSCODE_GIT_ASKPASS_EXTRA_ARGS:"",QT_IM_MODULE:"ibus",npm_config_globalconfig:"/home/mike-diker/.nvm/versions/node/v24.10.0/etc/npmrc",npm_config_init_module:"/home/mike-diker/.npm-init.js",npm_package_devDependencies_eslint_plugin_prettier:"^5.0.0",PWD:"/home/mike-diker/git-repos/totem-llm/frontend",npm_execpath:"/home/mike-diker/.nvm/versions/node/v24.10.0/lib/node_modules/npm/bin/npm-cli.js",npm_package_dependencies_react_tag_input_component:"^2.0.2",XDG_CONFIG_DIRS:"/etc/xdg/xdg-ubuntu:/etc/xdg",NVM_CD_FLAGS:"",XDG_DATA_DIRS:"/home/mike-diker/snap/code/241/.local/share:/home/mike-diker/snap/code/241:/snap/code/241/usr/share:/usr/share/ubuntu:/usr/share/gnome:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop",npm_config_global_prefix:"/home/mike-diker/.nvm/versions/node/v24.10.0",npm_package_dependencies_dompurify:"^3.0.8",npm_command:"publish",npm_package_devDependencies_postcss:"^8.4.23",npm_package_devDependencies_cross_env:"^7.0.3",npm_package_dependencies__tremor_react:"^3.15.1",npm_config_save_prefix:"^",npm_config_ignore_optional:"",npm_package_devDependencies_rollup_plugin_visualizer:"^5.9.0",npm_package_scripts_preview:"vite preview",MEMORY_PRESSURE_WRITE:"c29tZSAyMDAwMDAgMjAwMDAwMAA=",npm_package_dependencies_react_loading_skeleton:"^3.1.0",npm_package_dependencies__mintplex_labs_piper_tts_web:"^1.0.4",npm_package_scripts_lint_check:"eslint src",INIT_CWD:"/home/mike-diker/git-repos/totem-llm",EDITOR:"vi",npm_package_dependencies_react:"^18.2.0",npm_package_dependencies_highlight_js:"^11.9.0",NODE_ENV:"production"})===null||r===void 0)&&r.REACT_TOOLTIP_DISABLE_BASE_STYLES))return;i==="core"&&(t=eC),a||(a={});const{insertAt:s}=a;if(document.getElementById(t))return;const l=document.head||document.getElementsByTagName("head")[0],d=document.createElement("style");d.id=t,d.type="text/css",s==="top"&&l.firstChild?l.insertBefore(d,l.firstChild):l.appendChild(d),d.styleSheet?d.styleSheet.cssText=e:d.appendChild(document.createTextNode(e)),s0[i]=!0}const c0=async({elementReference:e=null,tooltipReference:t=null,tooltipArrowReference:i=null,place:a="top",offset:n=10,strategy:r="absolute",middlewares:s=[Z5(Number(n)),Q5({fallbackAxisSideDirection:"start"}),J5({padding:5})],border:l})=>{if(!e)return{tooltipStyles:{},tooltipArrowStyles:{},place:a};if(t===null)return{tooltipStyles:{},tooltipArrowStyles:{},place:a};const d=s;return i?(d.push(Y5({element:i,padding:5})),o0(e,t,{placement:a,strategy:r,middleware:d}).then(({x:u,y:h,placement:g,middlewareData:p})=>{var v,f;const b={left:`${u}px`,top:`${h}px`,border:l},{x:w,y}=(v=p.arrow)!==null&&v!==void 0?v:{x:0,y:0},k=(f={top:"bottom",right:"left",bottom:"top",left:"right"}[g.split("-")[0]])!==null&&f!==void 0?f:"bottom",_=l&&{borderBottom:l,borderRight:l};let x=0;if(l){const A=`${l}`.match(/(\d+)px/);x=A!=null&&A[1]?Number(A[1]):1}return{tooltipStyles:b,tooltipArrowStyles:{left:w!=null?`${w}px`:"",top:y!=null?`${y}px`:"",right:"",bottom:"",..._,[k]:`-${4+x}px`},place:g}})):o0(e,t,{placement:"bottom",strategy:r,middleware:d}).then(({x:u,y:h,placement:g})=>({tooltipStyles:{left:`${u}px`,top:`${h}px`},tooltipArrowStyles:{},place:g}))},d0=(e,t)=>!("CSS"in window&&"supports"in window.CSS)||window.CSS.supports(e,t),u0=(e,t,i)=>{let a=null;const n=function(...r){const s=()=>{a=null,i||e.apply(this,r)};i&&!a&&(e.apply(this,r),a=setTimeout(s,t)),i||(a&&clearTimeout(a),a=setTimeout(s,t))};return n.cancel=()=>{a&&(clearTimeout(a),a=null)},n},p0=e=>e!==null&&!Array.isArray(e)&&typeof e=="object",ep=(e,t)=>{if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((n,r)=>ep(n,t[r]));if(Array.isArray(e)!==Array.isArray(t))return!1;if(!p0(e)||!p0(t))return e===t;const i=Object.keys(e),a=Object.keys(t);return i.length===a.length&&i.every(n=>ep(e[n],t[n]))},iC=e=>{if(!(e instanceof HTMLElement||e instanceof SVGElement))return!1;const t=getComputedStyle(e);return["overflow","overflow-x","overflow-y"].some(i=>{const a=t.getPropertyValue(i);return a==="auto"||a==="scroll"})},m0=e=>{if(!e)return null;let t=e.parentElement;for(;t;){if(iC(t))return t;t=t.parentElement}return document.scrollingElement||document.documentElement},aC=typeof window<"u"?m.useLayoutEffect:m.useEffect,mi=e=>{e.current&&(clearTimeout(e.current),e.current=null)},nC="DEFAULT_TOOLTIP_ID",rC={anchorRefs:new Set,activeAnchor:{current:null},attach:()=>{},detach:()=>{},setActiveAnchor:()=>{}},oC=m.createContext({getTooltipData:()=>rC});function Oy(e=nC){return m.useContext(oC).getTooltipData(e)}var Bn={tooltip:"core-styles-module_tooltip__3vRRp",fixed:"core-styles-module_fixed__pcSol",arrow:"core-styles-module_arrow__cvMwQ",noArrow:"core-styles-module_noArrow__xock6",clickable:"core-styles-module_clickable__ZuTTB",show:"core-styles-module_show__Nt9eE",closing:"core-styles-module_closing__sGnxF"},bd={tooltip:"styles-module_tooltip__mnnfp",arrow:"styles-module_arrow__K0L3T",dark:"styles-module_dark__xNqje",light:"styles-module_light__Z6W-X",success:"styles-module_success__A2AKt",warning:"styles-module_warning__SCK0X",error:"styles-module_error__JvumD",info:"styles-module_info__BWdHW"};const sC=({forwardRef:e,id:t,className:i,classNameArrow:a,variant:n="dark",anchorId:r,anchorSelect:s,place:l="top",offset:d=10,events:u=["hover"],openOnClick:h=!1,positionStrategy:g="absolute",middlewares:p,wrapper:v,delayShow:f=0,delayHide:b=0,float:w=!1,hidden:y=!1,noArrow:k=!1,clickable:_=!1,closeOnEsc:x=!1,closeOnScroll:A=!1,closeOnResize:z=!1,openEvents:S,closeEvents:M,globalCloseEvents:T,imperativeModeOnly:D,style:F,position:O,afterShow:Z,afterHide:R,content:ce,contentWrapperRef:ae,isOpen:Q,defaultIsOpen:I=!1,setIsOpen:U,activeAnchor:B,setActiveAnchor:me,border:ze,opacity:ct,arrowColor:He,role:dt="tooltip"})=>{var Ve;const Ie=m.useRef(null),Yt=m.useRef(null),jt=m.useRef(null),Xt=m.useRef(null),na=m.useRef(null),[Pe,ei]=m.useState({tooltipStyles:{},tooltipArrowStyles:{},place:l}),[Ye,La]=m.useState(!1),[ht,Dt]=m.useState(!1),[Ce,Hi]=m.useState(null),Vi=m.useRef(!1),qi=m.useRef(null),{anchorRefs:gt,setActiveAnchor:ti}=Oy(t),wt=m.useRef(!1),[se,_e]=m.useState([]),ne=m.useRef(!1),fe=h||u.includes("click"),qe=fe||(S==null?void 0:S.click)||(S==null?void 0:S.dblclick)||(S==null?void 0:S.mousedown),ut=S?{...S}:{mouseover:!0,focus:!0,mouseenter:!1,click:!1,dblclick:!1,mousedown:!1};!S&&fe&&Object.assign(ut,{mouseenter:!1,focus:!1,mouseover:!1,click:!0});const be=M?{...M}:{mouseout:!0,blur:!0,mouseleave:!1,click:!1,dblclick:!1,mouseup:!1};!M&&fe&&Object.assign(be,{mouseleave:!1,blur:!1,mouseout:!1});const ee=T?{...T}:{escape:x||!1,scroll:A||!1,resize:z||!1,clickOutsideAnchor:qe||!1};D&&(Object.assign(ut,{mouseenter:!1,focus:!1,click:!1,dblclick:!1,mousedown:!1}),Object.assign(be,{mouseleave:!1,blur:!1,click:!1,dblclick:!1,mouseup:!1}),Object.assign(ee,{escape:!1,scroll:!1,resize:!1,clickOutsideAnchor:!1})),aC(()=>(ne.current=!0,()=>{ne.current=!1}),[]);const ve=W=>{ne.current&&(W&&Dt(!0),setTimeout(()=>{ne.current&&(U==null||U(W),Q===void 0&&La(W))},10))};m.useEffect(()=>{if(Q===void 0)return()=>null;Q&&Dt(!0);const W=setTimeout(()=>{La(Q)},10);return()=>{clearTimeout(W)}},[Q]),m.useEffect(()=>{if(Ye!==Vi.current)if(mi(na),Vi.current=Ye,Ye)Z==null||Z();else{const W=(le=>{const pe=le.match(/^([\d.]+)(ms|s)$/);if(!pe)return 0;const[,j,L]=pe;return Number(j)*(L==="ms"?1:1e3)})(getComputedStyle(document.body).getPropertyValue("--rt-transition-show-delay"));na.current=setTimeout(()=>{Dt(!1),Hi(null),R==null||R()},W+25)}},[Ye]);const _i=W=>{ei(le=>ep(le,W)?le:W)},xi=(W=f)=>{mi(jt),ht?ve(!0):jt.current=setTimeout(()=>{ve(!0)},W)},ra=(W=b)=>{mi(Xt),Xt.current=setTimeout(()=>{wt.current||ve(!1)},W)},nn=W=>{var le;if(!W)return;const pe=(le=W.currentTarget)!==null&&le!==void 0?le:W.target;if(!(pe!=null&&pe.isConnected))return me(null),void ti({current:null});f?xi():ve(!0),me(pe),ti({current:pe}),mi(Xt)},oa=()=>{_?ra(b||100):b?ra():ve(!1),mi(jt)},zi=({x:W,y:le})=>{var pe;const j={getBoundingClientRect:()=>({x:W,y:le,width:0,height:0,top:le,left:W,right:W,bottom:le})};c0({place:(pe=Ce==null?void 0:Ce.place)!==null&&pe!==void 0?pe:l,offset:d,elementReference:j,tooltipReference:Ie.current,tooltipArrowReference:Yt.current,strategy:g,middlewares:p,border:ze}).then(L=>{_i(L)})},sa=W=>{if(!W)return;const le=W,pe={x:le.clientX,y:le.clientY};zi(pe),qi.current=pe},la=W=>{var le;if(!Ye)return;const pe=W.target;pe.isConnected&&(!((le=Ie.current)===null||le===void 0)&&le.contains(pe)||[document.querySelector(`[id='${r}']`),...se].some(j=>j==null?void 0:j.contains(pe))||(ve(!1),mi(jt)))},ca=u0(nn,50,!0),Xe=u0(oa,50,!0),Ut=W=>{Xe.cancel(),ca(W)},oe=()=>{ca.cancel(),Xe()},Ae=m.useCallback(()=>{var W,le;const pe=(W=Ce==null?void 0:Ce.position)!==null&&W!==void 0?W:O;pe?zi(pe):w?qi.current&&zi(qi.current):B!=null&&B.isConnected&&c0({place:(le=Ce==null?void 0:Ce.place)!==null&&le!==void 0?le:l,offset:d,elementReference:B,tooltipReference:Ie.current,tooltipArrowReference:Yt.current,strategy:g,middlewares:p,border:ze}).then(j=>{ne.current&&_i(j)})},[Ye,B,ce,F,l,Ce==null?void 0:Ce.place,d,g,O,Ce==null?void 0:Ce.position,w]);m.useEffect(()=>{var W,le;const pe=new Set(gt);se.forEach(re=>{pe.add({current:re})});const j=document.querySelector(`[id='${r}']`);j&&pe.add({current:j});const L=()=>{ve(!1)},P=m0(B),C=m0(Ie.current);ee.scroll&&(window.addEventListener("scroll",L),P==null||P.addEventListener("scroll",L),C==null||C.addEventListener("scroll",L));let V=null;ee.resize?window.addEventListener("resize",L):B&&Ie.current&&(V=$5(B,Ie.current,Ae,{ancestorResize:!0,elementResize:!0,layoutShift:!0}));const J=re=>{re.key==="Escape"&&ve(!1)};ee.escape&&window.addEventListener("keydown",J),ee.clickOutsideAnchor&&window.addEventListener("click",la);const $=[],q=re=>{Ye&&(re==null?void 0:re.target)===B||nn(re)},he=re=>{Ye&&(re==null?void 0:re.target)===B&&oa()},te=["mouseover","mouseout","mouseenter","mouseleave","focus","blur"],ie=["click","dblclick","mousedown","mouseup"];Object.entries(ut).forEach(([re,ke])=>{ke&&(te.includes(re)?$.push({event:re,listener:Ut}):ie.includes(re)&&$.push({event:re,listener:q}))}),Object.entries(be).forEach(([re,ke])=>{ke&&(te.includes(re)?$.push({event:re,listener:oe}):ie.includes(re)&&$.push({event:re,listener:he}))}),w&&$.push({event:"pointermove",listener:sa});const Me=()=>{wt.current=!0},Le=()=>{wt.current=!1,oa()};return _&&!qe&&((W=Ie.current)===null||W===void 0||W.addEventListener("mouseenter",Me),(le=Ie.current)===null||le===void 0||le.addEventListener("mouseleave",Le)),$.forEach(({event:re,listener:ke})=>{pe.forEach(rt=>{var Ne;(Ne=rt.current)===null||Ne===void 0||Ne.addEventListener(re,ke)})}),()=>{var re,ke;ee.scroll&&(window.removeEventListener("scroll",L),P==null||P.removeEventListener("scroll",L),C==null||C.removeEventListener("scroll",L)),ee.resize?window.removeEventListener("resize",L):V==null||V(),ee.clickOutsideAnchor&&window.removeEventListener("click",la),ee.escape&&window.removeEventListener("keydown",J),_&&!qe&&((re=Ie.current)===null||re===void 0||re.removeEventListener("mouseenter",Me),(ke=Ie.current)===null||ke===void 0||ke.removeEventListener("mouseleave",Le)),$.forEach(({event:rt,listener:Ne})=>{pe.forEach(rn=>{var pi;(pi=rn.current)===null||pi===void 0||pi.removeEventListener(rt,Ne)})})}},[B,Ae,ht,gt,se,S,M,T,fe,f,b]),m.useEffect(()=>{var W,le;let pe=(le=(W=Ce==null?void 0:Ce.anchorSelect)!==null&&W!==void 0?W:s)!==null&&le!==void 0?le:"";!pe&&t&&(pe=`[data-tooltip-id='${t.replace(/'/g,"\\'")}']`);const j=new MutationObserver(L=>{const P=[],C=[];L.forEach(V=>{if(V.type==="attributes"&&V.attributeName==="data-tooltip-id"&&(V.target.getAttribute("data-tooltip-id")===t?P.push(V.target):V.oldValue===t&&C.push(V.target)),V.type==="childList"){if(B){const J=[...V.removedNodes].filter($=>$.nodeType===1);if(pe)try{C.push(...J.filter($=>$.matches(pe))),C.push(...J.flatMap($=>[...$.querySelectorAll(pe)]))}catch{}J.some($=>{var q;return!!(!((q=$==null?void 0:$.contains)===null||q===void 0)&&q.call($,B))&&(Dt(!1),ve(!1),me(null),mi(jt),mi(Xt),!0)})}if(pe)try{const J=[...V.addedNodes].filter($=>$.nodeType===1);P.push(...J.filter($=>$.matches(pe))),P.push(...J.flatMap($=>[...$.querySelectorAll(pe)]))}catch{}}}),(P.length||C.length)&&_e(V=>[...V.filter(J=>!C.includes(J)),...P])});return j.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-tooltip-id"],attributeOldValue:!0}),()=>{j.disconnect()}},[t,s,Ce==null?void 0:Ce.anchorSelect,B]),m.useEffect(()=>{Ae()},[Ae]),m.useEffect(()=>{if(!(ae!=null&&ae.current))return()=>null;const W=new ResizeObserver(()=>{setTimeout(()=>Ae())});return W.observe(ae.current),()=>{W.disconnect()}},[ce,ae==null?void 0:ae.current]),m.useEffect(()=>{var W;const le=document.querySelector(`[id='${r}']`),pe=[...se,le];B&&pe.includes(B)||me((W=se[0])!==null&&W!==void 0?W:le)},[r,se,B]),m.useEffect(()=>(I&&ve(!0),()=>{mi(jt),mi(Xt)}),[]),m.useEffect(()=>{var W;let le=(W=Ce==null?void 0:Ce.anchorSelect)!==null&&W!==void 0?W:s;if(!le&&t&&(le=`[data-tooltip-id='${t.replace(/'/g,"\\'")}']`),le)try{const pe=Array.from(document.querySelectorAll(le));_e(pe)}catch{_e([])}},[t,s,Ce==null?void 0:Ce.anchorSelect]),m.useEffect(()=>{jt.current&&(mi(jt),xi(f))},[f]);const Lt=(Ve=Ce==null?void 0:Ce.content)!==null&&Ve!==void 0?Ve:ce,Ai=Ye&&Object.keys(Pe.tooltipStyles).length>0;return m.useImperativeHandle(e,()=>({open:W=>{if(W!=null&&W.anchorSelect)try{document.querySelector(W.anchorSelect)}catch{return void console.warn(`[react-tooltip] "${W.anchorSelect}" is not a valid CSS selector`)}Hi(W??null),W!=null&&W.delay?xi(W.delay):ve(!0)},close:W=>{W!=null&&W.delay?ra(W.delay):ve(!1)},activeAnchor:B,place:Pe.place,isOpen:!!(ht&&!y&&Lt&&Ai)})),ht&&!y&&Lt?c.createElement(v,{id:t,role:dt,className:Xu("react-tooltip",Bn.tooltip,bd.tooltip,bd[n],i,`react-tooltip__place-${Pe.place}`,Bn[Ai?"show":"closing"],Ai?"react-tooltip__show":"react-tooltip__closing",g==="fixed"&&Bn.fixed,_&&Bn.clickable),onTransitionEnd:W=>{mi(na),Ye||W.propertyName!=="opacity"||(Dt(!1),Hi(null),R==null||R())},style:{...F,...Pe.tooltipStyles,opacity:ct!==void 0&&Ai?ct:void 0},ref:Ie},Lt,c.createElement(v,{className:Xu("react-tooltip-arrow",Bn.arrow,bd.arrow,a,k&&Bn.noArrow),style:{...Pe.tooltipArrowStyles,background:He?`linear-gradient(to right bottom, transparent 50%, ${He} 50%)`:void 0},ref:Yt})):null},lC=({content:e})=>c.createElement("span",{dangerouslySetInnerHTML:{__html:e}}),lt=c.forwardRef(({id:e,anchorId:t,anchorSelect:i,content:a,html:n,render:r,className:s,classNameArrow:l,variant:d="dark",place:u="top",offset:h=10,wrapper:g="div",children:p=null,events:v=["hover"],openOnClick:f=!1,positionStrategy:b="absolute",middlewares:w,delayShow:y=0,delayHide:k=0,float:_=!1,hidden:x=!1,noArrow:A=!1,clickable:z=!1,closeOnEsc:S=!1,closeOnScroll:M=!1,closeOnResize:T=!1,openEvents:D,closeEvents:F,globalCloseEvents:O,imperativeModeOnly:Z=!1,style:R,position:ce,isOpen:ae,defaultIsOpen:Q=!1,disableStyleInjection:I=!1,border:U,opacity:B,arrowColor:me,setIsOpen:ze,afterShow:ct,afterHide:He,role:dt="tooltip"},Ve)=>{const[Ie,Yt]=m.useState(a),[jt,Xt]=m.useState(n),[na,Pe]=m.useState(u),[ei,Ye]=m.useState(d),[La,ht]=m.useState(h),[Dt,Ce]=m.useState(y),[Hi,Vi]=m.useState(k),[qi,gt]=m.useState(_),[ti,wt]=m.useState(x),[se,_e]=m.useState(g),[ne,fe]=m.useState(v),[qe,ut]=m.useState(b),[be,ee]=m.useState(null),[ve,_i]=m.useState(null),xi=m.useRef(I),{anchorRefs:ra,activeAnchor:nn}=Oy(e),oa=Xe=>Xe==null?void 0:Xe.getAttributeNames().reduce((Ut,oe)=>{var Ae;return oe.startsWith("data-tooltip-")&&(Ut[oe.replace(/^data-tooltip-/,"")]=(Ae=Xe==null?void 0:Xe.getAttribute(oe))!==null&&Ae!==void 0?Ae:null),Ut},{}),zi=Xe=>{const Ut={place:oe=>{var Ae;Pe((Ae=oe)!==null&&Ae!==void 0?Ae:u)},content:oe=>{Yt(oe??a)},html:oe=>{Xt(oe??n)},variant:oe=>{var Ae;Ye((Ae=oe)!==null&&Ae!==void 0?Ae:d)},offset:oe=>{ht(oe===null?h:Number(oe))},wrapper:oe=>{var Ae;_e((Ae=oe)!==null&&Ae!==void 0?Ae:g)},events:oe=>{const Ae=oe==null?void 0:oe.split(" ");fe(Ae??v)},"position-strategy":oe=>{var Ae;ut((Ae=oe)!==null&&Ae!==void 0?Ae:b)},"delay-show":oe=>{Ce(oe===null?y:Number(oe))},"delay-hide":oe=>{Vi(oe===null?k:Number(oe))},float:oe=>{gt(oe===null?_:oe==="true")},hidden:oe=>{wt(oe===null?x:oe==="true")},"class-name":oe=>{ee(oe)}};Object.values(Ut).forEach(oe=>oe(null)),Object.entries(Xe).forEach(([oe,Ae])=>{var Lt;(Lt=Ut[oe])===null||Lt===void 0||Lt.call(Ut,Ae)})};m.useEffect(()=>{Yt(a)},[a]),m.useEffect(()=>{Xt(n)},[n]),m.useEffect(()=>{Pe(u)},[u]),m.useEffect(()=>{Ye(d)},[d]),m.useEffect(()=>{ht(h)},[h]),m.useEffect(()=>{Ce(y)},[y]),m.useEffect(()=>{Vi(k)},[k]),m.useEffect(()=>{gt(_)},[_]),m.useEffect(()=>{wt(x)},[x]),m.useEffect(()=>{ut(b)},[b]),m.useEffect(()=>{xi.current!==I&&console.warn("[react-tooltip] Do not change `disableStyleInjection` dynamically.")},[I]),m.useEffect(()=>{typeof window<"u"&&window.dispatchEvent(new CustomEvent("react-tooltip-inject-styles",{detail:{disableCore:I==="core",disableBase:I}}))},[]),m.useEffect(()=>{var Xe;const Ut=new Set(ra);let oe=i;if(!oe&&e&&(oe=`[data-tooltip-id='${e.replace(/'/g,"\\'")}']`),oe)try{document.querySelectorAll(oe).forEach(le=>{Ut.add({current:le})})}catch{console.warn(`[react-tooltip] "${oe}" is not a valid CSS selector`)}const Ae=document.querySelector(`[id='${t}']`);if(Ae&&Ut.add({current:Ae}),!Ut.size)return()=>null;const Lt=(Xe=ve??Ae)!==null&&Xe!==void 0?Xe:nn.current,Ai=new MutationObserver(le=>{le.forEach(pe=>{var j;if(!Lt||pe.type!=="attributes"||!(!((j=pe.attributeName)===null||j===void 0)&&j.startsWith("data-tooltip-")))return;const L=oa(Lt);zi(L)})}),W={attributes:!0,childList:!1,subtree:!1};if(Lt){const le=oa(Lt);zi(le),Ai.observe(Lt,W)}return()=>{Ai.disconnect()}},[ra,nn,ve,t,i]),m.useEffect(()=>{R!=null&&R.border&&console.warn("[react-tooltip] Do not set `style.border`. Use `border` prop instead."),U&&!d0("border",`${U}`)&&console.warn(`[react-tooltip] "${U}" is not a valid \`border\`.`),R!=null&&R.opacity&&console.warn("[react-tooltip] Do not set `style.opacity`. Use `opacity` prop instead."),B&&!d0("opacity",`${B}`)&&console.warn(`[react-tooltip] "${B}" is not a valid \`opacity\`.`)},[]);let sa=p;const la=m.useRef(null);if(r){const Xe=r({content:(ve==null?void 0:ve.getAttribute("data-tooltip-content"))||Ie||null,activeAnchor:ve});sa=Xe?c.createElement("div",{ref:la,className:"react-tooltip-content-wrapper"},Xe):null}else Ie&&(sa=Ie);jt&&(sa=c.createElement(lC,{content:jt}));const ca={forwardRef:Ve,id:e,anchorId:t,anchorSelect:i,className:Xu(s,be),classNameArrow:l,content:sa,contentWrapperRef:la,place:na,variant:ei,offset:La,wrapper:se,events:ne,openOnClick:f,positionStrategy:qe,middlewares:w,delayShow:Dt,delayHide:Hi,float:qi,hidden:ti,noArrow:A,clickable:z,closeOnEsc:S,closeOnScroll:M,closeOnResize:T,openEvents:D,closeEvents:F,globalCloseEvents:O,imperativeModeOnly:Z,style:R,position:ce,isOpen:ae,defaultIsOpen:Q,border:U,opacity:B,arrowColor:me,setIsOpen:ze,afterShow:ct,afterHide:He,activeAnchor:ve,setActiveAnchor:Xe=>_i(Xe),role:dt};return c.createElement(sC,{...ca})});typeof window<"u"&&window.addEventListener("react-tooltip-inject-styles",e=>{e.detail.disableCore||l0({css:":root{--rt-color-white:#fff;--rt-color-dark:#222;--rt-color-success:#8dc572;--rt-color-error:#be6464;--rt-color-warning:#f0ad4e;--rt-color-info:#337ab7;--rt-opacity:0.9;--rt-transition-show-delay:0.15s;--rt-transition-closing-delay:0.15s}.core-styles-module_tooltip__3vRRp{position:absolute;top:0;left:0;pointer-events:none;opacity:0;will-change:opacity}.core-styles-module_fixed__pcSol{position:fixed}.core-styles-module_arrow__cvMwQ{position:absolute;background:inherit}.core-styles-module_noArrow__xock6{display:none}.core-styles-module_clickable__ZuTTB{pointer-events:auto}.core-styles-module_show__Nt9eE{opacity:var(--rt-opacity);transition:opacity var(--rt-transition-show-delay)ease-out}.core-styles-module_closing__sGnxF{opacity:0;transition:opacity var(--rt-transition-closing-delay)ease-in}",type:"core"}),e.detail.disableBase||l0({css:`
|
|
1707
|
-
.styles-module_tooltip__mnnfp{padding:8px 16px;border-radius:3px;font-size:90%;width:max-content}.styles-module_arrow__K0L3T{width:8px;height:8px}[class*='react-tooltip__place-top']>.styles-module_arrow__K0L3T{transform:rotate(45deg)}[class*='react-tooltip__place-right']>.styles-module_arrow__K0L3T{transform:rotate(135deg)}[class*='react-tooltip__place-bottom']>.styles-module_arrow__K0L3T{transform:rotate(225deg)}[class*='react-tooltip__place-left']>.styles-module_arrow__K0L3T{transform:rotate(315deg)}.styles-module_dark__xNqje{background:var(--rt-color-dark);color:var(--rt-color-white)}.styles-module_light__Z6W-X{background-color:var(--rt-color-white);color:var(--rt-color-dark)}.styles-module_success__A2AKt{background-color:var(--rt-color-success);color:var(--rt-color-white)}.styles-module_warning__SCK0X{background-color:var(--rt-color-warning);color:var(--rt-color-white)}.styles-module_error__JvumD{background-color:var(--rt-color-error);color:var(--rt-color-white)}.styles-module_info__BWdHW{background-color:var(--rt-color-info);color:var(--rt-color-white)}`,type:"base"})});const cC=["azure","textgenwebui","generic-openai","bedrock"],h0={openai:[],gemini:[],anthropic:[],azure:[],lmstudio:[],localai:[],ollama:[],togetherai:[],fireworksai:[],"nvidia-nim":[],groq:[],cohere:["command-r","command-r-plus","command","command-light","command-nightly","command-light-nightly"],textgenwebui:[],"generic-openai":[],bedrock:[],xai:["grok-beta"]};function dC(e){return e.reduce((t,i)=>(t[i.organization]=t[i.organization]||[],t[i.organization].push(i),t),{})}const g0=["togetherai","fireworksai","openai","novita","openrouter","ppio","docker-model-runner","sambanova"];function ID(e=null){const[t,i]=m.useState([]),[a,n]=m.useState([]),[r,s]=m.useState(!0);return m.useEffect(()=>{async function l(){if(!e)return;s(!0);const{models:d=[]}=await K.customModels(e);h0.hasOwnProperty(e)&&!g0.includes(e)?i(h0[e]):i([]),g0.includes(e)?n(dC(d)):n(d),s(!1)}l()},[e]),{defaultModels:t,customModels:a,loading:r}}const uC={getAll:async()=>await fetch(`${E}/model-routers`,{method:"GET",headers:N()}).then(e=>e.json()).then(e=>(e==null?void 0:e.routers)||[]).catch(e=>(console.error(e),[])),get:async e=>await fetch(`${E}/model-routers/${e}`,{method:"GET",headers:N()}).then(t=>t.json()).catch(t=>(console.error(t),{router:null,error:t.message})),create:async e=>await fetch(`${E}/model-routers/new`,{method:"POST",headers:N(),body:JSON.stringify(e)}).then(t=>t.json()).catch(t=>(console.error(t),{router:null,error:t.message})),update:async(e,t)=>await fetch(`${E}/model-routers/${e}`,{method:"PUT",headers:N(),body:JSON.stringify(t)}).then(i=>i.json()).catch(i=>(console.error(i),{router:null,error:i.message})),delete:async e=>await fetch(`${E}/model-routers/${e}`,{method:"DELETE",headers:N()}).then(t=>t.json()).catch(t=>(console.error(t),{success:!1,error:t.message})),createRule:async(e,t)=>await fetch(`${E}/model-routers/${e}/rules/new`,{method:"POST",headers:N(),body:JSON.stringify(t)}).then(i=>i.json()).catch(i=>(console.error(i),{rule:null,error:i.message})),updateRule:async(e,t,i)=>await fetch(`${E}/model-routers/${e}/rules/${t}`,{method:"PUT",headers:N(),body:JSON.stringify(i)}).then(a=>a.json()).catch(a=>(console.error(a),{rule:null,error:a.message})),deleteRule:async(e,t)=>await fetch(`${E}/model-routers/${e}/rules/${t}`,{method:"DELETE",headers:N()}).then(i=>i.json()).catch(i=>(console.error(i),{success:!1,error:i.message})),reorderRules:async(e,t)=>await fetch(`${E}/model-routers/${e}/rules/reorder`,{method:"PUT",headers:N(),body:JSON.stringify({ruleUpdates:t})}).then(i=>i.json()).catch(i=>(console.error(i),{success:!1,error:i.message}))};function Ry(){const{logo:e,setLogo:t,loginLogo:i,isCustomLogo:a}=m.useContext(K1);return{logo:e,setLogo:t,loginLogo:i,isCustomLogo:a}}const pC="/agent-static.png",mC="/community-hub.png",Hy=typeof{communityHub:{label:"Community Hub",tier:"L2",enabled:!1,allowlist:null},modelRouter:{label:"Model Router",tier:"L2",enabled:!1,allowlist:null},llmProviders:{label:"LLM Provider Allowlist",tier:"L1",enabled:!0,allowlist:["ollama","openrouter"]},brandingWhitelabel:{label:"Branding & Whitelabeling",tier:"L2",enabled:!1,allowlist:null},filesystemAgent:{label:"File System Access",tier:"L2",enabled:!0,allowlist:null},documentationLink:{label:"Documentation Link",tier:"L2",enabled:!1,allowlist:null},multiUser:{label:"Multi-User Mode",tier:"L2",enabled:!1,allowlist:null},browserExtension:{label:"Browser Extension",tier:"L2",enabled:!1,allowlist:null},chatEmbed:{label:"Chat Embed",tier:"L2",enabled:!1,allowlist:null},scheduledJobs:{label:"Scheduled Jobs",tier:"L2",enabled:!1,allowlist:null},developerApi:{label:"Developer API",tier:"L2",enabled:!1,allowlist:null},mobile:{label:"Totem LLM Mobile",tier:"L2",enabled:!1,allowlist:null},agentMode:{label:"Agent Mode",tier:"L2",enabled:!1,allowlist:null},memories:{label:"Memories Feature",tier:"L2",enabled:!1,allowlist:null},vectorDB:{label:"Vector Database Integrations",tier:"L2",enabled:!1,allowlist:null},embedder:{label:"Embedder Integrations",tier:"L2",enabled:!1,allowlist:null},textSplitter:{label:"Text Splitter Integrations",tier:"L2",enabled:!1,allowlist:null},transcription:{label:"Audio Transcription",tier:"L2",enabled:!1,allowlist:null}}<"u"?{communityHub:{label:"Community Hub",tier:"L2",enabled:!1,allowlist:null},modelRouter:{label:"Model Router",tier:"L2",enabled:!1,allowlist:null},llmProviders:{label:"LLM Provider Allowlist",tier:"L1",enabled:!0,allowlist:["ollama","openrouter"]},brandingWhitelabel:{label:"Branding & Whitelabeling",tier:"L2",enabled:!1,allowlist:null},filesystemAgent:{label:"File System Access",tier:"L2",enabled:!0,allowlist:null},documentationLink:{label:"Documentation Link",tier:"L2",enabled:!1,allowlist:null},multiUser:{label:"Multi-User Mode",tier:"L2",enabled:!1,allowlist:null},browserExtension:{label:"Browser Extension",tier:"L2",enabled:!1,allowlist:null},chatEmbed:{label:"Chat Embed",tier:"L2",enabled:!1,allowlist:null},scheduledJobs:{label:"Scheduled Jobs",tier:"L2",enabled:!1,allowlist:null},developerApi:{label:"Developer API",tier:"L2",enabled:!1,allowlist:null},mobile:{label:"Totem LLM Mobile",tier:"L2",enabled:!1,allowlist:null},agentMode:{label:"Agent Mode",tier:"L2",enabled:!1,allowlist:null},memories:{label:"Memories Feature",tier:"L2",enabled:!1,allowlist:null},vectorDB:{label:"Vector Database Integrations",tier:"L2",enabled:!1,allowlist:null},embedder:{label:"Embedder Integrations",tier:"L2",enabled:!1,allowlist:null},textSplitter:{label:"Text Splitter Integrations",tier:"L2",enabled:!1,allowlist:null},transcription:{label:"Audio Transcription",tier:"L2",enabled:!1,allowlist:null}}:{},Vy=m.createContext(Hy);function hC({children:e}){return o.jsx(Vy.Provider,{value:Hy,children:e})}function qy(){return m.useContext(Vy)}function pt(e){return qy()[e]??{enabled:!1,label:e,tier:"free"}}var X={},tp={exports:{}};(function(e,t){(function(i,a){var n="1.0.38",r="",s="?",l="function",d="undefined",u="object",h="string",g="major",p="model",v="name",f="type",b="vendor",w="version",y="architecture",k="console",_="mobile",x="tablet",A="smarttv",z="wearable",S="embedded",M=500,T="Amazon",D="Apple",F="ASUS",O="BlackBerry",Z="Browser",R="Chrome",ce="Edge",ae="Firefox",Q="Google",I="Huawei",U="LG",B="Microsoft",me="Motorola",ze="Opera",ct="Samsung",He="Sharp",dt="Sony",Ve="Xiaomi",Ie="Zebra",Yt="Facebook",jt="Chromium OS",Xt="Mac OS",na=function(se,_e){var ne={};for(var fe in se)_e[fe]&&_e[fe].length%2===0?ne[fe]=_e[fe].concat(se[fe]):ne[fe]=se[fe];return ne},Pe=function(se){for(var _e={},ne=0;ne<se.length;ne++)_e[se[ne].toUpperCase()]=se[ne];return _e},ei=function(se,_e){return typeof se===h?Ye(_e).indexOf(Ye(se))!==-1:!1},Ye=function(se){return se.toLowerCase()},La=function(se){return typeof se===h?se.replace(/[^\d\.]/g,r).split(".")[0]:a},ht=function(se,_e){if(typeof se===h)return se=se.replace(/^\s\s*/,r),typeof _e===d?se:se.substring(0,M)},Dt=function(se,_e){for(var ne=0,fe,qe,ut,be,ee,ve;ne<_e.length&&!ee;){var _i=_e[ne],xi=_e[ne+1];for(fe=qe=0;fe<_i.length&&!ee&&_i[fe];)if(ee=_i[fe++].exec(se),ee)for(ut=0;ut<xi.length;ut++)ve=ee[++qe],be=xi[ut],typeof be===u&&be.length>0?be.length===2?typeof be[1]==l?this[be[0]]=be[1].call(this,ve):this[be[0]]=be[1]:be.length===3?typeof be[1]===l&&!(be[1].exec&&be[1].test)?this[be[0]]=ve?be[1].call(this,ve,be[2]):a:this[be[0]]=ve?ve.replace(be[1],be[2]):a:be.length===4&&(this[be[0]]=ve?be[3].call(this,ve.replace(be[1],be[2])):a):this[be]=ve||a;ne+=2}},Ce=function(se,_e){for(var ne in _e)if(typeof _e[ne]===u&&_e[ne].length>0){for(var fe=0;fe<_e[ne].length;fe++)if(ei(_e[ne][fe],se))return ne===s?a:ne}else if(ei(_e[ne],se))return ne===s?a:ne;return se},Hi={"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},Vi={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},qi={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[w,[v,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[w,[v,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[v,w],[/opios[\/ ]+([\w\.]+)/i],[w,[v,ze+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[w,[v,ze+" GX"]],[/\bopr\/([\w\.]+)/i],[w,[v,ze]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[w,[v,"Baidu"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim)\s?(?:browser)?[\/ ]?([\w\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[v,w],[/\bddg\/([\w\.]+)/i],[w,[v,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[w,[v,"UC"+Z]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[w,[v,"WeChat"]],[/konqueror\/([\w\.]+)/i],[w,[v,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[w,[v,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[w,[v,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[w,[v,"Smart Lenovo "+Z]],[/(avast|avg)\/([\w\.]+)/i],[[v,/(.+)/,"$1 Secure "+Z],w],[/\bfocus\/([\w\.]+)/i],[w,[v,ae+" Focus"]],[/\bopt\/([\w\.]+)/i],[w,[v,ze+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[w,[v,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[w,[v,"Dolphin"]],[/coast\/([\w\.]+)/i],[w,[v,ze+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[w,[v,"MIUI "+Z]],[/fxios\/([-\w\.]+)/i],[w,[v,ae]],[/\bqihu|(qi?ho?o?|360)browser/i],[[v,"360 "+Z]],[/(oculus|sailfish|huawei|vivo)browser\/([\w\.]+)/i],[[v,/(.+)/,"$1 "+Z],w],[/samsungbrowser\/([\w\.]+)/i],[w,[v,ct+" Internet"]],[/(comodo_dragon)\/([\w\.]+)/i],[[v,/_/g," "],w],[/metasr[\/ ]?([\d\.]+)/i],[w,[v,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[v,"Sogou Mobile"],w],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i],[v,w],[/(lbbrowser)/i,/\[(linkedin)app\]/i],[v],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[v,Yt],w],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[v,w],[/\bgsa\/([\w\.]+) .*safari\//i],[w,[v,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[w,[v,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[w,[v,R+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[v,R+" WebView"],w],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[w,[v,"Android "+Z]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[v,w],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[w,[v,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[w,v],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[v,[w,Ce,Hi]],[/(webkit|khtml)\/([\w\.]+)/i],[v,w],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[v,"Netscape"],w],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[w,[v,ae+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[v,w],[/(cobalt)\/([\w\.]+)/i],[v,[w,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[y,"amd64"]],[/(ia32(?=;))/i],[[y,Ye]],[/((?:i[346]|x)86)[;\)]/i],[[y,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[y,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[y,"armhf"]],[/windows (ce|mobile); ppc;/i],[[y,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[y,/ower/,r,Ye]],[/(sun4\w)[;\)]/i],[[y,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[y,Ye]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[p,[b,ct],[f,x]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[p,[b,ct],[f,_]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[p,[b,D],[f,_]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[p,[b,D],[f,x]],[/(macintosh);/i],[p,[b,D]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[p,[b,He],[f,_]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[p,[b,I],[f,x]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[p,[b,I],[f,_]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[p,/_/g," "],[b,Ve],[f,_]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[p,/_/g," "],[b,Ve],[f,x]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[p,[b,"OPPO"],[f,_]],[/\b(opd2\d{3}a?) bui/i],[p,[b,"OPPO"],[f,x]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[p,[b,"Vivo"],[f,_]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[p,[b,"Realme"],[f,_]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[p,[b,me],[f,_]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[p,[b,me],[f,x]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[p,[b,U],[f,x]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[p,[b,U],[f,_]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[p,[b,"Lenovo"],[f,x]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[p,/_/g," "],[b,"Nokia"],[f,_]],[/(pixel c)\b/i],[p,[b,Q],[f,x]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[p,[b,Q],[f,_]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[p,[b,dt],[f,_]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[p,"Xperia Tablet"],[b,dt],[f,x]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[p,[b,"OnePlus"],[f,_]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[p,[b,T],[f,x]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[p,/(.+)/g,"Fire Phone $1"],[b,T],[f,_]],[/(playbook);[-\w\),; ]+(rim)/i],[p,b,[f,x]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[p,[b,O],[f,_]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[p,[b,F],[f,x]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[p,[b,F],[f,_]],[/(nexus 9)/i],[p,[b,"HTC"],[f,x]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[b,[p,/_/g," "],[f,_]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[p,[b,"Acer"],[f,x]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[p,[b,"Meizu"],[f,_]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[p,[b,"Ulefone"],[f,_]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[b,p,[f,_]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[b,p,[f,x]],[/(surface duo)/i],[p,[b,B],[f,x]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[p,[b,"Fairphone"],[f,_]],[/(u304aa)/i],[p,[b,"AT&T"],[f,_]],[/\bsie-(\w*)/i],[p,[b,"Siemens"],[f,_]],[/\b(rct\w+) b/i],[p,[b,"RCA"],[f,x]],[/\b(venue[\d ]{2,7}) b/i],[p,[b,"Dell"],[f,x]],[/\b(q(?:mv|ta)\w+) b/i],[p,[b,"Verizon"],[f,x]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[p,[b,"Barnes & Noble"],[f,x]],[/\b(tm\d{3}\w+) b/i],[p,[b,"NuVision"],[f,x]],[/\b(k88) b/i],[p,[b,"ZTE"],[f,x]],[/\b(nx\d{3}j) b/i],[p,[b,"ZTE"],[f,_]],[/\b(gen\d{3}) b.+49h/i],[p,[b,"Swiss"],[f,_]],[/\b(zur\d{3}) b/i],[p,[b,"Swiss"],[f,x]],[/\b((zeki)?tb.*\b) b/i],[p,[b,"Zeki"],[f,x]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[b,"Dragon Touch"],p,[f,x]],[/\b(ns-?\w{0,9}) b/i],[p,[b,"Insignia"],[f,x]],[/\b((nxa|next)-?\w{0,9}) b/i],[p,[b,"NextBook"],[f,x]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[b,"Voice"],p,[f,_]],[/\b(lvtel\-)?(v1[12]) b/i],[[b,"LvTel"],p,[f,_]],[/\b(ph-1) /i],[p,[b,"Essential"],[f,_]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[p,[b,"Envizen"],[f,x]],[/\b(trio[-\w\. ]+) b/i],[p,[b,"MachSpeed"],[f,x]],[/\btu_(1491) b/i],[p,[b,"Rotor"],[f,x]],[/(shield[\w ]+) b/i],[p,[b,"Nvidia"],[f,x]],[/(sprint) (\w+)/i],[b,p,[f,_]],[/(kin\.[onetw]{3})/i],[[p,/\./g," "],[b,B],[f,_]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[p,[b,Ie],[f,x]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[p,[b,Ie],[f,_]],[/smart-tv.+(samsung)/i],[b,[f,A]],[/hbbtv.+maple;(\d+)/i],[[p,/^/,"SmartTV"],[b,ct],[f,A]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[b,U],[f,A]],[/(apple) ?tv/i],[b,[p,D+" TV"],[f,A]],[/crkey/i],[[p,R+"cast"],[b,Q],[f,A]],[/droid.+aft(\w+)( bui|\))/i],[p,[b,T],[f,A]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[p,[b,He],[f,A]],[/(bravia[\w ]+)( bui|\))/i],[p,[b,dt],[f,A]],[/(mitv-\w{5}) bui/i],[p,[b,Ve],[f,A]],[/Hbbtv.*(technisat) (.*);/i],[b,p,[f,A]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[b,ht],[p,ht],[f,A]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[f,A]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[b,p,[f,k]],[/droid.+; (shield) bui/i],[p,[b,"Nvidia"],[f,k]],[/(playstation [345portablevi]+)/i],[p,[b,dt],[f,k]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[p,[b,B],[f,k]],[/((pebble))app/i],[b,p,[f,z]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[p,[b,D],[f,z]],[/droid.+; (glass) \d/i],[p,[b,Q],[f,z]],[/droid.+; (wt63?0{2,3})\)/i],[p,[b,Ie],[f,z]],[/(quest( \d| pro)?)/i],[p,[b,Yt],[f,z]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[b,[f,S]],[/(aeobc)\b/i],[p,[b,T],[f,S]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[p,[f,_]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[p,[f,x]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[f,x]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[f,_]],[/(android[-\w\. ]{0,9});.+buil/i],[p,[b,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[w,[v,ce+"HTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[w,[v,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[v,w],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[w,v]],os:[[/microsoft (windows) (vista|xp)/i],[v,w],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[v,[w,Ce,Vi]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[w,Ce,Vi],[v,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[w,/_/g,"."],[v,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[v,Xt],[w,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[w,v],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[v,w],[/\(bb(10);/i],[w,[v,O]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[w,[v,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[w,[v,ae+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[w,[v,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[w,[v,"watchOS"]],[/crkey\/([\d\.]+)/i],[w,[v,R+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[v,jt],w],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[v,w],[/(sunos) ?([\w\.\d]*)/i],[[v,"Solaris"],w],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[v,w]]},gt=function(se,_e){if(typeof se===u&&(_e=se,se=a),!(this instanceof gt))return new gt(se,_e).getResult();var ne=typeof i!==d&&i.navigator?i.navigator:a,fe=se||(ne&&ne.userAgent?ne.userAgent:r),qe=ne&&ne.userAgentData?ne.userAgentData:a,ut=_e?na(qi,_e):qi,be=ne&&ne.userAgent==fe;return this.getBrowser=function(){var ee={};return ee[v]=a,ee[w]=a,Dt.call(ee,fe,ut.browser),ee[g]=La(ee[w]),be&&ne&&ne.brave&&typeof ne.brave.isBrave==l&&(ee[v]="Brave"),ee},this.getCPU=function(){var ee={};return ee[y]=a,Dt.call(ee,fe,ut.cpu),ee},this.getDevice=function(){var ee={};return ee[b]=a,ee[p]=a,ee[f]=a,Dt.call(ee,fe,ut.device),be&&!ee[f]&&qe&&qe.mobile&&(ee[f]=_),be&&ee[p]=="Macintosh"&&ne&&typeof ne.standalone!==d&&ne.maxTouchPoints&&ne.maxTouchPoints>2&&(ee[p]="iPad",ee[f]=x),ee},this.getEngine=function(){var ee={};return ee[v]=a,ee[w]=a,Dt.call(ee,fe,ut.engine),ee},this.getOS=function(){var ee={};return ee[v]=a,ee[w]=a,Dt.call(ee,fe,ut.os),be&&!ee[v]&&qe&&qe.platform&&qe.platform!="Unknown"&&(ee[v]=qe.platform.replace(/chrome os/i,jt).replace(/macos/i,Xt)),ee},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return fe},this.setUA=function(ee){return fe=typeof ee===h&&ee.length>M?ht(ee,M):ee,this},this.setUA(fe),this};gt.VERSION=n,gt.BROWSER=Pe([v,w,g]),gt.CPU=Pe([y]),gt.DEVICE=Pe([p,b,f,k,_,A,x,z,S]),gt.ENGINE=gt.OS=Pe([v,w]),e.exports&&(t=e.exports=gt),t.UAParser=gt;var ti=typeof i!==d&&(i.jQuery||i.Zepto);if(ti&&!ti.ua){var wt=new gt;ti.ua=wt.getResult(),ti.ua.get=function(){return wt.getUA()},ti.ua.set=function(se){wt.setUA(se);var _e=wt.getResult();for(var ne in _e)ti.ua[ne]=_e[ne]}}})(typeof window=="object"?window:Ti)})(tp,tp.exports);var gC=tp.exports;Object.defineProperty(X,"__esModule",{value:!0});function fC(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var Tt=m,Re=fC(Tt),Fy=gC,en=new Fy,Nt=en.getBrowser(),bC=en.getCPU(),ui=en.getDevice(),Pm=en.getEngine(),tn=en.getOS(),us=en.getUA(),Uy=function(t){return en.setUA(t)},ps=function(t){if(!t){console.error("No userAgent string was provided");return}var i=new Fy(t);return{UA:i,browser:i.getBrowser(),cpu:i.getCPU(),device:i.getDevice(),engine:i.getEngine(),os:i.getOS(),ua:i.getUA(),setUserAgent:function(n){return i.setUA(n)}}},By=Object.freeze({ClientUAInstance:en,browser:Nt,cpu:bC,device:ui,engine:Pm,os:tn,ua:us,setUa:Uy,parseUserAgent:ps});function f0(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),i.push.apply(i,a)}return i}function vC(e){for(var t=1;t<arguments.length;t++){var i=arguments[t]!=null?arguments[t]:{};t%2?f0(Object(i),!0).forEach(function(a){wC(e,a,i[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):f0(Object(i)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(i,a))})}return e}function co(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?co=function(t){return typeof t}:co=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},co(e)}function kC(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function b0(e,t){for(var i=0;i<t.length;i++){var a=t[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function yC(e,t,i){return t&&b0(e.prototype,t),i&&b0(e,i),e}function wC(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function ip(){return ip=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(e[a]=i[a])}return e},ip.apply(this,arguments)}function _C(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&np(e,t)}function ap(e){return ap=Object.setPrototypeOf?Object.getPrototypeOf:function(i){return i.__proto__||Object.getPrototypeOf(i)},ap(e)}function np(e,t){return np=Object.setPrototypeOf||function(a,n){return a.__proto__=n,a},np(e,t)}function xC(e,t){if(e==null)return{};var i={},a=Object.keys(e),n,r;for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&(i[n]=e[n]);return i}function wi(e,t){if(e==null)return{};var i=xC(e,t),a,n;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n<r.length;n++)a=r[n],!(t.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(i[a]=e[a])}return i}function tl(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function zC(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return tl(e)}function AC(e,t){return jC(e)||LC(e,t)||SC(e,t)||MC()}function jC(e){if(Array.isArray(e))return e}function LC(e,t){var i=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(i!=null){var a=[],n=!0,r=!1,s,l;try{for(i=i.call(e);!(n=(s=i.next()).done)&&(a.push(s.value),!(t&&a.length===t));n=!0);}catch(d){r=!0,l=d}finally{try{!n&&i.return!=null&&i.return()}finally{if(r)throw l}}return a}}function SC(e,t){if(e){if(typeof e=="string")return v0(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);if(i==="Object"&&e.constructor&&(i=e.constructor.name),i==="Map"||i==="Set")return Array.from(e);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return v0(e,t)}}function v0(e,t){(t==null||t>e.length)&&(t=e.length);for(var i=0,a=new Array(t);i<t;i++)a[i]=e[i];return a}function MC(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1706
|
+
*/const eC="react-tooltip-core-styles",tC="react-tooltip-base-styles",s0={core:!1,base:!1};function l0({css:e,id:t=tC,type:i="base",ref:a}){var n,r;if(!e||typeof document>"u"||s0[i]||i==="core"&&typeof process<"u"&&(!((n=process==null?void 0:{GJS_DEBUG_TOPICS:"JS ERROR;JS LOG",PYTHON_BASIC_REPL:"1",LESSOPEN:"| /usr/bin/lesspipe %s",npm_package_dependencies_react_dropzone:"^14.2.3",npm_package_devDependencies__types_react_router_dom:"^5.3.3",npm_package_dependencies_cronstrue:"^2.50.0",USER:"mike-diker",npm_config_user_agent:"yarn/1.22.22 npm/? node/v24.10.0 linux x64",npm_package_devDependencies__esbuild_plugins_node_globals_polyfill:"^0.1.1",npm_package_dependencies_react_toastify:"^9.1.3",npm_package_dependencies_js_levenshtein:"^1.1.6",npm_config_version_commit_hooks:"true",FONTCONFIG_PATH:"/etc/fonts",GIO_MODULE_DIR:"/home/mike-diker/snap/code/common/.cache/gio-modules",npm_package_devDependencies_buffer:"^6.0.3",npm_package_dependencies_text_case:"^1.0.9",npm_package_dependencies_react_device_detect:"^2.2.2",npm_package_dependencies__lobehub_icons:"^4.0.3",npm_config_bin_links:"true",XDG_SESSION_TYPE:"x11",GIT_ASKPASS:"/snap/code/241/usr/share/code/resources/app/extensions/git/dist/askpass.sh",GTK_EXE_PREFIX_VSCODE_SNAP_ORIG:"",npm_node_execpath:"/home/mike-diker/.nvm/versions/node/v24.10.0/bin/node",npm_package_devDependencies_vite:"^4.3.0",npm_config_init_version:"1.0.0",GDK_BACKEND_VSCODE_SNAP_ORIG:"",CLUTTER_DISABLE_MIPMAPPED_TEXT:"1",SHLVL:"1",npm_config_noproxy:"",HOME:"/home/mike-diker",CHROME_DESKTOP:"code.desktop",LOCPATH_VSCODE_SNAP_ORIG:"",npm_package_devDependencies__eslint_js:"^9.39.2",TERM_PROGRAM_VERSION:"1.121.0",DESKTOP_SESSION:"ubuntu",GTK_PATH:"/snap/code/241/usr/lib/x86_64-linux-gnu/gtk-3.0",NVM_BIN:"/home/mike-diker/.nvm/versions/node/v24.10.0/bin",npm_package_json:"/home/mike-diker/git-repos/totem-llm/package.json",npm_package_devDependencies_eslint_config_prettier:"^9.0.0",NVM_INC:"/home/mike-diker/.nvm/versions/node/v24.10.0/include/node",XDG_DATA_HOME_VSCODE_SNAP_ORIG:"",GTK_IM_MODULE_FILE:"/home/mike-diker/snap/code/common/.cache/immodules/immodules.cache",GIO_LAUNCHED_DESKTOP_FILE:"/var/lib/snapd/desktop/applications/code_code.desktop",npm_package_engines_node:">=18",npm_config_init_license:"MIT",GNOME_SHELL_SESSION_MODE:"ubuntu",GTK_MODULES:"gail:atk-bridge",GSETTINGS_SCHEMA_DIR_VSCODE_SNAP_ORIG:"",VSCODE_GIT_ASKPASS_MAIN:"/snap/code/241/usr/share/code/resources/app/extensions/git/dist/askpass-main.js",YARN_WRAP_OUTPUT:"false",npm_package_devDependencies_flow_remove_types:"^2.217.1",npm_config_version_tag_prefix:"v",VSCODE_GIT_ASKPASS_NODE:"/snap/code/241/usr/share/code/code",MANAGERPID:"3558",npm_config_userconfig:"/home/mike-diker/.npmrc",npm_config_local_prefix:"/home/mike-diker/git-repos/totem-llm",npm_package_dependencies_react_i18next:"^14.1.1",SYSTEMD_EXEC_PID:"4202",VSCODE_PYTHON_AUTOACTIVATE_GUARD:"1",GSM_SKIP_SSH_AGENT_WORKAROUND:"true",DBUS_SESSION_BUS_ADDRESS:"unix:path=/run/user/1000/bus",npm_package_devDependencies_eslint_plugin_react_hooks:"^7.0.1",npm_package_dependencies_moment:"^2.30.1",COLORTERM:"truecolor",GIO_LAUNCHED_DESKTOP_FILE_PID:"5033",COLOR:"1",npm_package_devDependencies_tailwindcss:"^3.3.1",npm_package_dependencies_react_router_dom:"^6.3.0",npm_package_dependencies_react_error_boundary:"^6.0.0",npm_package_dependencies_i18next:"^23.11.3",NVM_DIR:"/home/mike-diker/.nvm",DEBUGINFOD_URLS:"https://debuginfod.ubuntu.com ",npm_package_devDependencies__types_react_dom:"^18.2.8",npm_package_dependencies_katex:"^0.6.0",npm_package_devDependencies_prettier:"^3.0.3",npm_package_dependencies_react_confetti_explosion:"^2.1.2",npm_package_scripts_dev:"cross-env NODE_ENV=development vite --debug --host=0.0.0.0",LOGNAME:"mike-diker",npm_package_devDependencies__vitejs_plugin_react:"^4.0.0-beta.0",npm_package_dependencies_react_tooltip:"^5.25.2",npm_package_type:"module",JOURNAL_STREAM:"9:33800",_:"/home/mike-diker/.nvm/versions/node/v24.10.0/bin/npm",npm_config_prefix:"/home/mike-diker/.nvm/versions/node/v24.10.0",npm_config_npm_version:"11.6.1",npm_package_devDependencies_autoprefixer:"^10.4.14",npm_package_dependencies_onnxruntime_web:"^1.18.0",npm_package_dependencies_i18next_browser_languagedetector:"^7.2.1",npm_package_private:"false",XDG_CONFIG_DIRS_VSCODE_SNAP_ORIG:"/etc/xdg/xdg-ubuntu:/etc/xdg",MEMORY_PRESSURE_WATCH:"/sys/fs/cgroup/user.slice/user-1000.slice/user@1000.service/session.slice/org.gnome.Shell@x11.service/memory.pressure",XDG_SESSION_CLASS:"user",XDG_DATA_DIRS_VSCODE_SNAP_ORIG:"/usr/share/ubuntu:/usr/share/gnome:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop",npm_package_dependencies_react_speech_recognition:"^3.10.0",npm_package_dependencies_react_beautiful_dnd:"13.1.1",npm_package_scripts_lint:"eslint --fix src",npm_config_registry:"https://registry.yarnpkg.com",USERNAME:"mike-diker",TERM:"xterm-256color",npm_config_cache:"/home/mike-diker/.npm",GNOME_DESKTOP_SESSION_ID:"this-is-deprecated",FC_FONTATIONS:"1",npm_package_devDependencies_eslint_plugin_react_refresh:"^0.4.3",npm_package_scripts_start:"vite --open",npm_config_ignore_scripts:"",WINDOWPATH:"2",npm_config_node_gyp:"/home/mike-diker/.nvm/versions/node/v24.10.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js",npm_package_dependencies_recharts:"^2.12.5",PATH:"/tmp/yarn--1780715053259-0.9603504958321178:/home/mike-diker/git-repos/totem-llm/frontend/node_modules/.bin:/home/mike-diker/snap/code/241/.local/share/yarn/link/node_modules/.bin:/home/mike-diker/.nvm/versions/node/v24.10.0/libexec/lib/node_modules/npm/bin/node-gyp-bin:/home/mike-diker/.nvm/versions/node/v24.10.0/lib/node_modules/npm/bin/node-gyp-bin:/home/mike-diker/.nvm/versions/node/v24.10.0/bin/node_modules/npm/bin/node-gyp-bin:/home/mike-diker/git-repos/totem-llm/node_modules/.bin:/home/mike-diker/git-repos/node_modules/.bin:/home/mike-diker/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/home/mike-diker/.nvm/versions/node/v24.10.0/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin:/home/mike-diker/.local/share/solana/install/active_release/bin:/home/mike-diker/.config/Code/User/globalStorage/github.copilot-chat/debugCommand:/home/mike-diker/.config/Code/User/globalStorage/github.copilot-chat/copilotCli:/home/mike-diker/.local/share/solana/install/active_release/bin:/home/mike-diker/.local/bin:/home/mike-diker/.local/share/solana/install/active_release/bin:/home/mike-diker/.nvm/versions/node/v24.10.0/bin:/home/mike-diker/.local/share/solana/install/active_release/bin:/home/mike-diker/.cargo/bin:/home/mike-diker/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin:/home/mike-diker/.local/bin:/home/mike-diker/.local/bin:/home/mike-diker/.local/bin:/home/mike-diker/.local/bin",NODE:"/home/mike-diker/.nvm/versions/node/v24.10.0/bin/node",SESSION_MANAGER:"local/mike-diker-Precision-7530:@/tmp/.ICE-unix/4176,unix/mike-diker-Precision-7530:/tmp/.ICE-unix/4176",GTK_EXE_PREFIX:"/snap/code/241/usr",INVOCATION_ID:"64c065948fa541279cfe1dc565c1037d",npm_package_name:"anything-llm-frontend",npm_package_dependencies_recharts_to_png:"^2.3.1",npm_package_dependencies_file_saver:"^2.0.5",XDG_MENU_PREFIX:"gnome-",XDG_RUNTIME_DIR:"/run/user/1000",GDK_BACKEND:"x11",npm_package_devDependencies_hermes_eslint:"^0.15.0",npm_package_devDependencies_flow_bin:"^0.217.0",DISPLAY:":1",LOCPATH:"/snap/code/241/usr/lib/locale",npm_package_devDependencies_eslint_plugin_ft_flow:"^3.0.0",npm_package_dependencies_react_highlight_words:"^0.21.0",LANG:"en_US.UTF-8",XDG_CURRENT_DESKTOP:"ubuntu:GNOME",PYTHONSTARTUP:"/home/mike-diker/.config/Code/User/workspaceStorage/e3f9de5e65c351ebaea57871eb56e5ba/ms-python.python/pythonrc.py",npm_package_devDependencies_eslint:"^9.39.2",npm_package_dependencies_react_dom:"^18.2.0",npm_package_dependencies__microsoft_fetch_event_source:"^2.0.1",GIO_MODULE_DIR_VSCODE_SNAP_ORIG:"",XDG_DATA_HOME:"/home/mike-diker/snap/code/241/.local/share",XMODIFIERS:"@im=ibus",XDG_SESSION_DESKTOP:"ubuntu",XAUTHORITY:"/run/user/1000/gdm/Xauthority",LS_COLORS:"rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=00:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.avif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:*~=00;90:*#=00;90:*.bak=00;90:*.crdownload=00;90:*.dpkg-dist=00;90:*.dpkg-new=00;90:*.dpkg-old=00;90:*.dpkg-tmp=00;90:*.old=00;90:*.orig=00;90:*.part=00;90:*.rej=00;90:*.rpmnew=00;90:*.rpmorig=00;90:*.rpmsave=00;90:*.swp=00;90:*.tmp=00;90:*.ucf-dist=00;90:*.ucf-new=00;90:*.ucf-old=00;90:",VSCODE_GIT_IPC_HANDLE:"/run/user/1000/vscode-git-9b67e3720d.sock",TERM_PROGRAM:"vscode",npm_lifecycle_script:"vite build && node scripts/postbuild.js",npm_package_dependencies_lodash_debounce:"^4.0.8",SSH_AUTH_SOCK:"/run/user/1000/keyring/ssh",GSETTINGS_SCHEMA_DIR:"/home/mike-diker/snap/code/241/.local/share/glib-2.0/schemas",npm_config_version_git_message:"v%s",SHELL:"/bin/bash",npm_package_version:"",npm_lifecycle_event:"build",npm_package_devDependencies_eslint_plugin_unused_imports:"^4.3.0",npm_package_devDependencies__types_react:"^18.2.23",npm_package_dependencies_pluralize:"^8.0.0",QT_ACCESSIBILITY:"1",GDMSESSION:"ubuntu",npm_config_argv:'{"remain":[],"cooked":["run","build"],"original":["build"]}',npm_package_dependencies_uuid:"^9.0.0",npm_package_dependencies_he:"^1.2.0",npm_package_scripts_build:"vite build && node scripts/postbuild.js",LESSCLOSE:"/usr/bin/lesspipe %s %s",GTK_PATH_VSCODE_SNAP_ORIG:"",FONTCONFIG_FILE:"/etc/fonts/fonts.conf",GTK_IM_MODULE_FILE_VSCODE_SNAP_ORIG:"",npm_package_dependencies_truncate:"^3.0.0",npm_package_dependencies_qrcode_react:"^4.2.0",npm_package_dependencies__phosphor_icons_react:"^2.1.7",npm_config_version_git_tag:"true",npm_config_version_git_sign:"",GPG_AGENT_INFO:"/run/user/1000/gnupg/S.gpg-agent:0:1",GJS_DEBUG_OUTPUT:"stderr",npm_package_devDependencies_globals:"^16.5.0",npm_package_devDependencies_eslint_plugin_react:"^7.37.5",npm_package_dependencies_markdown_it:"^13.0.1",npm_package_license:"MIT",npm_config_strict_ssl:"true",VSCODE_GIT_ASKPASS_EXTRA_ARGS:"",QT_IM_MODULE:"ibus",npm_config_globalconfig:"/home/mike-diker/.nvm/versions/node/v24.10.0/etc/npmrc",npm_config_init_module:"/home/mike-diker/.npm-init.js",npm_package_devDependencies_eslint_plugin_prettier:"^5.0.0",PWD:"/home/mike-diker/git-repos/totem-llm/frontend",npm_execpath:"/home/mike-diker/.nvm/versions/node/v24.10.0/lib/node_modules/npm/bin/npm-cli.js",npm_package_dependencies_react_tag_input_component:"^2.0.2",XDG_CONFIG_DIRS:"/etc/xdg/xdg-ubuntu:/etc/xdg",NVM_CD_FLAGS:"",XDG_DATA_DIRS:"/home/mike-diker/snap/code/241/.local/share:/home/mike-diker/snap/code/241:/snap/code/241/usr/share:/usr/share/ubuntu:/usr/share/gnome:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop",npm_config_global_prefix:"/home/mike-diker/.nvm/versions/node/v24.10.0",npm_package_dependencies_dompurify:"^3.0.8",npm_command:"publish",npm_package_devDependencies_postcss:"^8.4.23",npm_package_devDependencies_cross_env:"^7.0.3",npm_package_dependencies__tremor_react:"^3.15.1",npm_config_save_prefix:"^",npm_config_ignore_optional:"",npm_package_devDependencies_rollup_plugin_visualizer:"^5.9.0",npm_package_scripts_preview:"vite preview",MEMORY_PRESSURE_WRITE:"c29tZSAyMDAwMDAgMjAwMDAwMAA=",npm_package_dependencies_react_loading_skeleton:"^3.1.0",npm_package_dependencies__mintplex_labs_piper_tts_web:"^1.0.4",npm_package_scripts_lint_check:"eslint src",INIT_CWD:"/home/mike-diker/git-repos/totem-llm",EDITOR:"vi",npm_package_dependencies_react:"^18.2.0",npm_package_dependencies_highlight_js:"^11.9.0",NODE_ENV:"production"})===null||n===void 0)&&n.REACT_TOOLTIP_DISABLE_CORE_STYLES)||i!=="base"&&typeof process<"u"&&(!((r=process==null?void 0:{GJS_DEBUG_TOPICS:"JS ERROR;JS LOG",PYTHON_BASIC_REPL:"1",LESSOPEN:"| /usr/bin/lesspipe %s",npm_package_dependencies_react_dropzone:"^14.2.3",npm_package_devDependencies__types_react_router_dom:"^5.3.3",npm_package_dependencies_cronstrue:"^2.50.0",USER:"mike-diker",npm_config_user_agent:"yarn/1.22.22 npm/? node/v24.10.0 linux x64",npm_package_devDependencies__esbuild_plugins_node_globals_polyfill:"^0.1.1",npm_package_dependencies_react_toastify:"^9.1.3",npm_package_dependencies_js_levenshtein:"^1.1.6",npm_config_version_commit_hooks:"true",FONTCONFIG_PATH:"/etc/fonts",GIO_MODULE_DIR:"/home/mike-diker/snap/code/common/.cache/gio-modules",npm_package_devDependencies_buffer:"^6.0.3",npm_package_dependencies_text_case:"^1.0.9",npm_package_dependencies_react_device_detect:"^2.2.2",npm_package_dependencies__lobehub_icons:"^4.0.3",npm_config_bin_links:"true",XDG_SESSION_TYPE:"x11",GIT_ASKPASS:"/snap/code/241/usr/share/code/resources/app/extensions/git/dist/askpass.sh",GTK_EXE_PREFIX_VSCODE_SNAP_ORIG:"",npm_node_execpath:"/home/mike-diker/.nvm/versions/node/v24.10.0/bin/node",npm_package_devDependencies_vite:"^4.3.0",npm_config_init_version:"1.0.0",GDK_BACKEND_VSCODE_SNAP_ORIG:"",CLUTTER_DISABLE_MIPMAPPED_TEXT:"1",SHLVL:"1",npm_config_noproxy:"",HOME:"/home/mike-diker",CHROME_DESKTOP:"code.desktop",LOCPATH_VSCODE_SNAP_ORIG:"",npm_package_devDependencies__eslint_js:"^9.39.2",TERM_PROGRAM_VERSION:"1.121.0",DESKTOP_SESSION:"ubuntu",GTK_PATH:"/snap/code/241/usr/lib/x86_64-linux-gnu/gtk-3.0",NVM_BIN:"/home/mike-diker/.nvm/versions/node/v24.10.0/bin",npm_package_json:"/home/mike-diker/git-repos/totem-llm/package.json",npm_package_devDependencies_eslint_config_prettier:"^9.0.0",NVM_INC:"/home/mike-diker/.nvm/versions/node/v24.10.0/include/node",XDG_DATA_HOME_VSCODE_SNAP_ORIG:"",GTK_IM_MODULE_FILE:"/home/mike-diker/snap/code/common/.cache/immodules/immodules.cache",GIO_LAUNCHED_DESKTOP_FILE:"/var/lib/snapd/desktop/applications/code_code.desktop",npm_package_engines_node:">=18",npm_config_init_license:"MIT",GNOME_SHELL_SESSION_MODE:"ubuntu",GTK_MODULES:"gail:atk-bridge",GSETTINGS_SCHEMA_DIR_VSCODE_SNAP_ORIG:"",VSCODE_GIT_ASKPASS_MAIN:"/snap/code/241/usr/share/code/resources/app/extensions/git/dist/askpass-main.js",YARN_WRAP_OUTPUT:"false",npm_package_devDependencies_flow_remove_types:"^2.217.1",npm_config_version_tag_prefix:"v",VSCODE_GIT_ASKPASS_NODE:"/snap/code/241/usr/share/code/code",MANAGERPID:"3558",npm_config_userconfig:"/home/mike-diker/.npmrc",npm_config_local_prefix:"/home/mike-diker/git-repos/totem-llm",npm_package_dependencies_react_i18next:"^14.1.1",SYSTEMD_EXEC_PID:"4202",VSCODE_PYTHON_AUTOACTIVATE_GUARD:"1",GSM_SKIP_SSH_AGENT_WORKAROUND:"true",DBUS_SESSION_BUS_ADDRESS:"unix:path=/run/user/1000/bus",npm_package_devDependencies_eslint_plugin_react_hooks:"^7.0.1",npm_package_dependencies_moment:"^2.30.1",COLORTERM:"truecolor",GIO_LAUNCHED_DESKTOP_FILE_PID:"5033",COLOR:"1",npm_package_devDependencies_tailwindcss:"^3.3.1",npm_package_dependencies_react_router_dom:"^6.3.0",npm_package_dependencies_react_error_boundary:"^6.0.0",npm_package_dependencies_i18next:"^23.11.3",NVM_DIR:"/home/mike-diker/.nvm",DEBUGINFOD_URLS:"https://debuginfod.ubuntu.com ",npm_package_devDependencies__types_react_dom:"^18.2.8",npm_package_dependencies_katex:"^0.6.0",npm_package_devDependencies_prettier:"^3.0.3",npm_package_dependencies_react_confetti_explosion:"^2.1.2",npm_package_scripts_dev:"cross-env NODE_ENV=development vite --debug --host=0.0.0.0",LOGNAME:"mike-diker",npm_package_devDependencies__vitejs_plugin_react:"^4.0.0-beta.0",npm_package_dependencies_react_tooltip:"^5.25.2",npm_package_type:"module",JOURNAL_STREAM:"9:33800",_:"/home/mike-diker/.nvm/versions/node/v24.10.0/bin/npm",npm_config_prefix:"/home/mike-diker/.nvm/versions/node/v24.10.0",npm_config_npm_version:"11.6.1",npm_package_devDependencies_autoprefixer:"^10.4.14",npm_package_dependencies_onnxruntime_web:"^1.18.0",npm_package_dependencies_i18next_browser_languagedetector:"^7.2.1",npm_package_private:"false",XDG_CONFIG_DIRS_VSCODE_SNAP_ORIG:"/etc/xdg/xdg-ubuntu:/etc/xdg",MEMORY_PRESSURE_WATCH:"/sys/fs/cgroup/user.slice/user-1000.slice/user@1000.service/session.slice/org.gnome.Shell@x11.service/memory.pressure",XDG_SESSION_CLASS:"user",XDG_DATA_DIRS_VSCODE_SNAP_ORIG:"/usr/share/ubuntu:/usr/share/gnome:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop",npm_package_dependencies_react_speech_recognition:"^3.10.0",npm_package_dependencies_react_beautiful_dnd:"13.1.1",npm_package_scripts_lint:"eslint --fix src",npm_config_registry:"https://registry.yarnpkg.com",USERNAME:"mike-diker",TERM:"xterm-256color",npm_config_cache:"/home/mike-diker/.npm",GNOME_DESKTOP_SESSION_ID:"this-is-deprecated",FC_FONTATIONS:"1",npm_package_devDependencies_eslint_plugin_react_refresh:"^0.4.3",npm_package_scripts_start:"vite --open",npm_config_ignore_scripts:"",WINDOWPATH:"2",npm_config_node_gyp:"/home/mike-diker/.nvm/versions/node/v24.10.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js",npm_package_dependencies_recharts:"^2.12.5",PATH:"/tmp/yarn--1780715053259-0.9603504958321178:/home/mike-diker/git-repos/totem-llm/frontend/node_modules/.bin:/home/mike-diker/snap/code/241/.local/share/yarn/link/node_modules/.bin:/home/mike-diker/.nvm/versions/node/v24.10.0/libexec/lib/node_modules/npm/bin/node-gyp-bin:/home/mike-diker/.nvm/versions/node/v24.10.0/lib/node_modules/npm/bin/node-gyp-bin:/home/mike-diker/.nvm/versions/node/v24.10.0/bin/node_modules/npm/bin/node-gyp-bin:/home/mike-diker/git-repos/totem-llm/node_modules/.bin:/home/mike-diker/git-repos/node_modules/.bin:/home/mike-diker/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/home/mike-diker/.nvm/versions/node/v24.10.0/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/node-gyp-bin:/home/mike-diker/.local/share/solana/install/active_release/bin:/home/mike-diker/.config/Code/User/globalStorage/github.copilot-chat/debugCommand:/home/mike-diker/.config/Code/User/globalStorage/github.copilot-chat/copilotCli:/home/mike-diker/.local/share/solana/install/active_release/bin:/home/mike-diker/.local/bin:/home/mike-diker/.local/share/solana/install/active_release/bin:/home/mike-diker/.nvm/versions/node/v24.10.0/bin:/home/mike-diker/.local/share/solana/install/active_release/bin:/home/mike-diker/.cargo/bin:/home/mike-diker/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin:/home/mike-diker/.local/bin:/home/mike-diker/.local/bin:/home/mike-diker/.local/bin:/home/mike-diker/.local/bin",NODE:"/home/mike-diker/.nvm/versions/node/v24.10.0/bin/node",SESSION_MANAGER:"local/mike-diker-Precision-7530:@/tmp/.ICE-unix/4176,unix/mike-diker-Precision-7530:/tmp/.ICE-unix/4176",GTK_EXE_PREFIX:"/snap/code/241/usr",INVOCATION_ID:"64c065948fa541279cfe1dc565c1037d",npm_package_name:"anything-llm-frontend",npm_package_dependencies_recharts_to_png:"^2.3.1",npm_package_dependencies_file_saver:"^2.0.5",XDG_MENU_PREFIX:"gnome-",XDG_RUNTIME_DIR:"/run/user/1000",GDK_BACKEND:"x11",npm_package_devDependencies_hermes_eslint:"^0.15.0",npm_package_devDependencies_flow_bin:"^0.217.0",DISPLAY:":1",LOCPATH:"/snap/code/241/usr/lib/locale",npm_package_devDependencies_eslint_plugin_ft_flow:"^3.0.0",npm_package_dependencies_react_highlight_words:"^0.21.0",LANG:"en_US.UTF-8",XDG_CURRENT_DESKTOP:"ubuntu:GNOME",PYTHONSTARTUP:"/home/mike-diker/.config/Code/User/workspaceStorage/e3f9de5e65c351ebaea57871eb56e5ba/ms-python.python/pythonrc.py",npm_package_devDependencies_eslint:"^9.39.2",npm_package_dependencies_react_dom:"^18.2.0",npm_package_dependencies__microsoft_fetch_event_source:"^2.0.1",GIO_MODULE_DIR_VSCODE_SNAP_ORIG:"",XDG_DATA_HOME:"/home/mike-diker/snap/code/241/.local/share",XMODIFIERS:"@im=ibus",XDG_SESSION_DESKTOP:"ubuntu",XAUTHORITY:"/run/user/1000/gdm/Xauthority",LS_COLORS:"rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=00:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.avif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:*~=00;90:*#=00;90:*.bak=00;90:*.crdownload=00;90:*.dpkg-dist=00;90:*.dpkg-new=00;90:*.dpkg-old=00;90:*.dpkg-tmp=00;90:*.old=00;90:*.orig=00;90:*.part=00;90:*.rej=00;90:*.rpmnew=00;90:*.rpmorig=00;90:*.rpmsave=00;90:*.swp=00;90:*.tmp=00;90:*.ucf-dist=00;90:*.ucf-new=00;90:*.ucf-old=00;90:",VSCODE_GIT_IPC_HANDLE:"/run/user/1000/vscode-git-9b67e3720d.sock",TERM_PROGRAM:"vscode",npm_lifecycle_script:"vite build && node scripts/postbuild.js",npm_package_dependencies_lodash_debounce:"^4.0.8",SSH_AUTH_SOCK:"/run/user/1000/keyring/ssh",GSETTINGS_SCHEMA_DIR:"/home/mike-diker/snap/code/241/.local/share/glib-2.0/schemas",npm_config_version_git_message:"v%s",SHELL:"/bin/bash",npm_package_version:"",npm_lifecycle_event:"build",npm_package_devDependencies_eslint_plugin_unused_imports:"^4.3.0",npm_package_devDependencies__types_react:"^18.2.23",npm_package_dependencies_pluralize:"^8.0.0",QT_ACCESSIBILITY:"1",GDMSESSION:"ubuntu",npm_config_argv:'{"remain":[],"cooked":["run","build"],"original":["build"]}',npm_package_dependencies_uuid:"^9.0.0",npm_package_dependencies_he:"^1.2.0",npm_package_scripts_build:"vite build && node scripts/postbuild.js",LESSCLOSE:"/usr/bin/lesspipe %s %s",GTK_PATH_VSCODE_SNAP_ORIG:"",FONTCONFIG_FILE:"/etc/fonts/fonts.conf",GTK_IM_MODULE_FILE_VSCODE_SNAP_ORIG:"",npm_package_dependencies_truncate:"^3.0.0",npm_package_dependencies_qrcode_react:"^4.2.0",npm_package_dependencies__phosphor_icons_react:"^2.1.7",npm_config_version_git_tag:"true",npm_config_version_git_sign:"",GPG_AGENT_INFO:"/run/user/1000/gnupg/S.gpg-agent:0:1",GJS_DEBUG_OUTPUT:"stderr",npm_package_devDependencies_globals:"^16.5.0",npm_package_devDependencies_eslint_plugin_react:"^7.37.5",npm_package_dependencies_markdown_it:"^13.0.1",npm_package_license:"MIT",npm_config_strict_ssl:"true",VSCODE_GIT_ASKPASS_EXTRA_ARGS:"",QT_IM_MODULE:"ibus",npm_config_globalconfig:"/home/mike-diker/.nvm/versions/node/v24.10.0/etc/npmrc",npm_config_init_module:"/home/mike-diker/.npm-init.js",npm_package_devDependencies_eslint_plugin_prettier:"^5.0.0",PWD:"/home/mike-diker/git-repos/totem-llm/frontend",npm_execpath:"/home/mike-diker/.nvm/versions/node/v24.10.0/lib/node_modules/npm/bin/npm-cli.js",npm_package_dependencies_react_tag_input_component:"^2.0.2",XDG_CONFIG_DIRS:"/etc/xdg/xdg-ubuntu:/etc/xdg",NVM_CD_FLAGS:"",XDG_DATA_DIRS:"/home/mike-diker/snap/code/241/.local/share:/home/mike-diker/snap/code/241:/snap/code/241/usr/share:/usr/share/ubuntu:/usr/share/gnome:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop",npm_config_global_prefix:"/home/mike-diker/.nvm/versions/node/v24.10.0",npm_package_dependencies_dompurify:"^3.0.8",npm_command:"publish",npm_package_devDependencies_postcss:"^8.4.23",npm_package_devDependencies_cross_env:"^7.0.3",npm_package_dependencies__tremor_react:"^3.15.1",npm_config_save_prefix:"^",npm_config_ignore_optional:"",npm_package_devDependencies_rollup_plugin_visualizer:"^5.9.0",npm_package_scripts_preview:"vite preview",MEMORY_PRESSURE_WRITE:"c29tZSAyMDAwMDAgMjAwMDAwMAA=",npm_package_dependencies_react_loading_skeleton:"^3.1.0",npm_package_dependencies__mintplex_labs_piper_tts_web:"^1.0.4",npm_package_scripts_lint_check:"eslint src",INIT_CWD:"/home/mike-diker/git-repos/totem-llm",EDITOR:"vi",npm_package_dependencies_react:"^18.2.0",npm_package_dependencies_highlight_js:"^11.9.0",NODE_ENV:"production"})===null||r===void 0)&&r.REACT_TOOLTIP_DISABLE_BASE_STYLES))return;i==="core"&&(t=eC),a||(a={});const{insertAt:s}=a;if(document.getElementById(t))return;const l=document.head||document.getElementsByTagName("head")[0],d=document.createElement("style");d.id=t,d.type="text/css",s==="top"&&l.firstChild?l.insertBefore(d,l.firstChild):l.appendChild(d),d.styleSheet?d.styleSheet.cssText=e:d.appendChild(document.createTextNode(e)),s0[i]=!0}const c0=async({elementReference:e=null,tooltipReference:t=null,tooltipArrowReference:i=null,place:a="top",offset:n=10,strategy:r="absolute",middlewares:s=[Z5(Number(n)),Q5({fallbackAxisSideDirection:"start"}),J5({padding:5})],border:l})=>{if(!e)return{tooltipStyles:{},tooltipArrowStyles:{},place:a};if(t===null)return{tooltipStyles:{},tooltipArrowStyles:{},place:a};const d=s;return i?(d.push(Y5({element:i,padding:5})),o0(e,t,{placement:a,strategy:r,middleware:d}).then(({x:u,y:h,placement:g,middlewareData:p})=>{var v,f;const b={left:`${u}px`,top:`${h}px`,border:l},{x:w,y}=(v=p.arrow)!==null&&v!==void 0?v:{x:0,y:0},k=(f={top:"bottom",right:"left",bottom:"top",left:"right"}[g.split("-")[0]])!==null&&f!==void 0?f:"bottom",_=l&&{borderBottom:l,borderRight:l};let x=0;if(l){const A=`${l}`.match(/(\d+)px/);x=A!=null&&A[1]?Number(A[1]):1}return{tooltipStyles:b,tooltipArrowStyles:{left:w!=null?`${w}px`:"",top:y!=null?`${y}px`:"",right:"",bottom:"",..._,[k]:`-${4+x}px`},place:g}})):o0(e,t,{placement:"bottom",strategy:r,middleware:d}).then(({x:u,y:h,placement:g})=>({tooltipStyles:{left:`${u}px`,top:`${h}px`},tooltipArrowStyles:{},place:g}))},d0=(e,t)=>!("CSS"in window&&"supports"in window.CSS)||window.CSS.supports(e,t),u0=(e,t,i)=>{let a=null;const n=function(...r){const s=()=>{a=null,i||e.apply(this,r)};i&&!a&&(e.apply(this,r),a=setTimeout(s,t)),i||(a&&clearTimeout(a),a=setTimeout(s,t))};return n.cancel=()=>{a&&(clearTimeout(a),a=null)},n},p0=e=>e!==null&&!Array.isArray(e)&&typeof e=="object",ep=(e,t)=>{if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((n,r)=>ep(n,t[r]));if(Array.isArray(e)!==Array.isArray(t))return!1;if(!p0(e)||!p0(t))return e===t;const i=Object.keys(e),a=Object.keys(t);return i.length===a.length&&i.every(n=>ep(e[n],t[n]))},iC=e=>{if(!(e instanceof HTMLElement||e instanceof SVGElement))return!1;const t=getComputedStyle(e);return["overflow","overflow-x","overflow-y"].some(i=>{const a=t.getPropertyValue(i);return a==="auto"||a==="scroll"})},m0=e=>{if(!e)return null;let t=e.parentElement;for(;t;){if(iC(t))return t;t=t.parentElement}return document.scrollingElement||document.documentElement},aC=typeof window<"u"?m.useLayoutEffect:m.useEffect,mi=e=>{e.current&&(clearTimeout(e.current),e.current=null)},nC="DEFAULT_TOOLTIP_ID",rC={anchorRefs:new Set,activeAnchor:{current:null},attach:()=>{},detach:()=>{},setActiveAnchor:()=>{}},oC=m.createContext({getTooltipData:()=>rC});function Oy(e=nC){return m.useContext(oC).getTooltipData(e)}var Bn={tooltip:"core-styles-module_tooltip__3vRRp",fixed:"core-styles-module_fixed__pcSol",arrow:"core-styles-module_arrow__cvMwQ",noArrow:"core-styles-module_noArrow__xock6",clickable:"core-styles-module_clickable__ZuTTB",show:"core-styles-module_show__Nt9eE",closing:"core-styles-module_closing__sGnxF"},bd={tooltip:"styles-module_tooltip__mnnfp",arrow:"styles-module_arrow__K0L3T",dark:"styles-module_dark__xNqje",light:"styles-module_light__Z6W-X",success:"styles-module_success__A2AKt",warning:"styles-module_warning__SCK0X",error:"styles-module_error__JvumD",info:"styles-module_info__BWdHW"};const sC=({forwardRef:e,id:t,className:i,classNameArrow:a,variant:n="dark",anchorId:r,anchorSelect:s,place:l="top",offset:d=10,events:u=["hover"],openOnClick:h=!1,positionStrategy:g="absolute",middlewares:p,wrapper:v,delayShow:f=0,delayHide:b=0,float:w=!1,hidden:y=!1,noArrow:k=!1,clickable:_=!1,closeOnEsc:x=!1,closeOnScroll:A=!1,closeOnResize:z=!1,openEvents:S,closeEvents:M,globalCloseEvents:T,imperativeModeOnly:D,style:F,position:O,afterShow:Z,afterHide:R,content:ce,contentWrapperRef:ae,isOpen:Q,defaultIsOpen:I=!1,setIsOpen:U,activeAnchor:B,setActiveAnchor:me,border:ze,opacity:ct,arrowColor:He,role:dt="tooltip"})=>{var Ve;const Ie=m.useRef(null),Yt=m.useRef(null),jt=m.useRef(null),Xt=m.useRef(null),na=m.useRef(null),[Pe,ei]=m.useState({tooltipStyles:{},tooltipArrowStyles:{},place:l}),[Ye,La]=m.useState(!1),[ht,Dt]=m.useState(!1),[Ce,Hi]=m.useState(null),Vi=m.useRef(!1),qi=m.useRef(null),{anchorRefs:gt,setActiveAnchor:ti}=Oy(t),wt=m.useRef(!1),[se,_e]=m.useState([]),ne=m.useRef(!1),fe=h||u.includes("click"),qe=fe||(S==null?void 0:S.click)||(S==null?void 0:S.dblclick)||(S==null?void 0:S.mousedown),ut=S?{...S}:{mouseover:!0,focus:!0,mouseenter:!1,click:!1,dblclick:!1,mousedown:!1};!S&&fe&&Object.assign(ut,{mouseenter:!1,focus:!1,mouseover:!1,click:!0});const be=M?{...M}:{mouseout:!0,blur:!0,mouseleave:!1,click:!1,dblclick:!1,mouseup:!1};!M&&fe&&Object.assign(be,{mouseleave:!1,blur:!1,mouseout:!1});const ee=T?{...T}:{escape:x||!1,scroll:A||!1,resize:z||!1,clickOutsideAnchor:qe||!1};D&&(Object.assign(ut,{mouseenter:!1,focus:!1,click:!1,dblclick:!1,mousedown:!1}),Object.assign(be,{mouseleave:!1,blur:!1,click:!1,dblclick:!1,mouseup:!1}),Object.assign(ee,{escape:!1,scroll:!1,resize:!1,clickOutsideAnchor:!1})),aC(()=>(ne.current=!0,()=>{ne.current=!1}),[]);const ve=W=>{ne.current&&(W&&Dt(!0),setTimeout(()=>{ne.current&&(U==null||U(W),Q===void 0&&La(W))},10))};m.useEffect(()=>{if(Q===void 0)return()=>null;Q&&Dt(!0);const W=setTimeout(()=>{La(Q)},10);return()=>{clearTimeout(W)}},[Q]),m.useEffect(()=>{if(Ye!==Vi.current)if(mi(na),Vi.current=Ye,Ye)Z==null||Z();else{const W=(le=>{const pe=le.match(/^([\d.]+)(ms|s)$/);if(!pe)return 0;const[,j,L]=pe;return Number(j)*(L==="ms"?1:1e3)})(getComputedStyle(document.body).getPropertyValue("--rt-transition-show-delay"));na.current=setTimeout(()=>{Dt(!1),Hi(null),R==null||R()},W+25)}},[Ye]);const _i=W=>{ei(le=>ep(le,W)?le:W)},xi=(W=f)=>{mi(jt),ht?ve(!0):jt.current=setTimeout(()=>{ve(!0)},W)},ra=(W=b)=>{mi(Xt),Xt.current=setTimeout(()=>{wt.current||ve(!1)},W)},nn=W=>{var le;if(!W)return;const pe=(le=W.currentTarget)!==null&&le!==void 0?le:W.target;if(!(pe!=null&&pe.isConnected))return me(null),void ti({current:null});f?xi():ve(!0),me(pe),ti({current:pe}),mi(Xt)},oa=()=>{_?ra(b||100):b?ra():ve(!1),mi(jt)},zi=({x:W,y:le})=>{var pe;const j={getBoundingClientRect:()=>({x:W,y:le,width:0,height:0,top:le,left:W,right:W,bottom:le})};c0({place:(pe=Ce==null?void 0:Ce.place)!==null&&pe!==void 0?pe:l,offset:d,elementReference:j,tooltipReference:Ie.current,tooltipArrowReference:Yt.current,strategy:g,middlewares:p,border:ze}).then(L=>{_i(L)})},sa=W=>{if(!W)return;const le=W,pe={x:le.clientX,y:le.clientY};zi(pe),qi.current=pe},la=W=>{var le;if(!Ye)return;const pe=W.target;pe.isConnected&&(!((le=Ie.current)===null||le===void 0)&&le.contains(pe)||[document.querySelector(`[id='${r}']`),...se].some(j=>j==null?void 0:j.contains(pe))||(ve(!1),mi(jt)))},ca=u0(nn,50,!0),Xe=u0(oa,50,!0),Ut=W=>{Xe.cancel(),ca(W)},oe=()=>{ca.cancel(),Xe()},Ae=m.useCallback(()=>{var W,le;const pe=(W=Ce==null?void 0:Ce.position)!==null&&W!==void 0?W:O;pe?zi(pe):w?qi.current&&zi(qi.current):B!=null&&B.isConnected&&c0({place:(le=Ce==null?void 0:Ce.place)!==null&&le!==void 0?le:l,offset:d,elementReference:B,tooltipReference:Ie.current,tooltipArrowReference:Yt.current,strategy:g,middlewares:p,border:ze}).then(j=>{ne.current&&_i(j)})},[Ye,B,ce,F,l,Ce==null?void 0:Ce.place,d,g,O,Ce==null?void 0:Ce.position,w]);m.useEffect(()=>{var W,le;const pe=new Set(gt);se.forEach(re=>{pe.add({current:re})});const j=document.querySelector(`[id='${r}']`);j&&pe.add({current:j});const L=()=>{ve(!1)},P=m0(B),C=m0(Ie.current);ee.scroll&&(window.addEventListener("scroll",L),P==null||P.addEventListener("scroll",L),C==null||C.addEventListener("scroll",L));let V=null;ee.resize?window.addEventListener("resize",L):B&&Ie.current&&(V=$5(B,Ie.current,Ae,{ancestorResize:!0,elementResize:!0,layoutShift:!0}));const J=re=>{re.key==="Escape"&&ve(!1)};ee.escape&&window.addEventListener("keydown",J),ee.clickOutsideAnchor&&window.addEventListener("click",la);const $=[],q=re=>{Ye&&(re==null?void 0:re.target)===B||nn(re)},he=re=>{Ye&&(re==null?void 0:re.target)===B&&oa()},te=["mouseover","mouseout","mouseenter","mouseleave","focus","blur"],ie=["click","dblclick","mousedown","mouseup"];Object.entries(ut).forEach(([re,ke])=>{ke&&(te.includes(re)?$.push({event:re,listener:Ut}):ie.includes(re)&&$.push({event:re,listener:q}))}),Object.entries(be).forEach(([re,ke])=>{ke&&(te.includes(re)?$.push({event:re,listener:oe}):ie.includes(re)&&$.push({event:re,listener:he}))}),w&&$.push({event:"pointermove",listener:sa});const Me=()=>{wt.current=!0},Le=()=>{wt.current=!1,oa()};return _&&!qe&&((W=Ie.current)===null||W===void 0||W.addEventListener("mouseenter",Me),(le=Ie.current)===null||le===void 0||le.addEventListener("mouseleave",Le)),$.forEach(({event:re,listener:ke})=>{pe.forEach(rt=>{var Ne;(Ne=rt.current)===null||Ne===void 0||Ne.addEventListener(re,ke)})}),()=>{var re,ke;ee.scroll&&(window.removeEventListener("scroll",L),P==null||P.removeEventListener("scroll",L),C==null||C.removeEventListener("scroll",L)),ee.resize?window.removeEventListener("resize",L):V==null||V(),ee.clickOutsideAnchor&&window.removeEventListener("click",la),ee.escape&&window.removeEventListener("keydown",J),_&&!qe&&((re=Ie.current)===null||re===void 0||re.removeEventListener("mouseenter",Me),(ke=Ie.current)===null||ke===void 0||ke.removeEventListener("mouseleave",Le)),$.forEach(({event:rt,listener:Ne})=>{pe.forEach(rn=>{var pi;(pi=rn.current)===null||pi===void 0||pi.removeEventListener(rt,Ne)})})}},[B,Ae,ht,gt,se,S,M,T,fe,f,b]),m.useEffect(()=>{var W,le;let pe=(le=(W=Ce==null?void 0:Ce.anchorSelect)!==null&&W!==void 0?W:s)!==null&&le!==void 0?le:"";!pe&&t&&(pe=`[data-tooltip-id='${t.replace(/'/g,"\\'")}']`);const j=new MutationObserver(L=>{const P=[],C=[];L.forEach(V=>{if(V.type==="attributes"&&V.attributeName==="data-tooltip-id"&&(V.target.getAttribute("data-tooltip-id")===t?P.push(V.target):V.oldValue===t&&C.push(V.target)),V.type==="childList"){if(B){const J=[...V.removedNodes].filter($=>$.nodeType===1);if(pe)try{C.push(...J.filter($=>$.matches(pe))),C.push(...J.flatMap($=>[...$.querySelectorAll(pe)]))}catch{}J.some($=>{var q;return!!(!((q=$==null?void 0:$.contains)===null||q===void 0)&&q.call($,B))&&(Dt(!1),ve(!1),me(null),mi(jt),mi(Xt),!0)})}if(pe)try{const J=[...V.addedNodes].filter($=>$.nodeType===1);P.push(...J.filter($=>$.matches(pe))),P.push(...J.flatMap($=>[...$.querySelectorAll(pe)]))}catch{}}}),(P.length||C.length)&&_e(V=>[...V.filter(J=>!C.includes(J)),...P])});return j.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-tooltip-id"],attributeOldValue:!0}),()=>{j.disconnect()}},[t,s,Ce==null?void 0:Ce.anchorSelect,B]),m.useEffect(()=>{Ae()},[Ae]),m.useEffect(()=>{if(!(ae!=null&&ae.current))return()=>null;const W=new ResizeObserver(()=>{setTimeout(()=>Ae())});return W.observe(ae.current),()=>{W.disconnect()}},[ce,ae==null?void 0:ae.current]),m.useEffect(()=>{var W;const le=document.querySelector(`[id='${r}']`),pe=[...se,le];B&&pe.includes(B)||me((W=se[0])!==null&&W!==void 0?W:le)},[r,se,B]),m.useEffect(()=>(I&&ve(!0),()=>{mi(jt),mi(Xt)}),[]),m.useEffect(()=>{var W;let le=(W=Ce==null?void 0:Ce.anchorSelect)!==null&&W!==void 0?W:s;if(!le&&t&&(le=`[data-tooltip-id='${t.replace(/'/g,"\\'")}']`),le)try{const pe=Array.from(document.querySelectorAll(le));_e(pe)}catch{_e([])}},[t,s,Ce==null?void 0:Ce.anchorSelect]),m.useEffect(()=>{jt.current&&(mi(jt),xi(f))},[f]);const Lt=(Ve=Ce==null?void 0:Ce.content)!==null&&Ve!==void 0?Ve:ce,Ai=Ye&&Object.keys(Pe.tooltipStyles).length>0;return m.useImperativeHandle(e,()=>({open:W=>{if(W!=null&&W.anchorSelect)try{document.querySelector(W.anchorSelect)}catch{return void console.warn(`[react-tooltip] "${W.anchorSelect}" is not a valid CSS selector`)}Hi(W??null),W!=null&&W.delay?xi(W.delay):ve(!0)},close:W=>{W!=null&&W.delay?ra(W.delay):ve(!1)},activeAnchor:B,place:Pe.place,isOpen:!!(ht&&!y&&Lt&&Ai)})),ht&&!y&&Lt?c.createElement(v,{id:t,role:dt,className:Xu("react-tooltip",Bn.tooltip,bd.tooltip,bd[n],i,`react-tooltip__place-${Pe.place}`,Bn[Ai?"show":"closing"],Ai?"react-tooltip__show":"react-tooltip__closing",g==="fixed"&&Bn.fixed,_&&Bn.clickable),onTransitionEnd:W=>{mi(na),Ye||W.propertyName!=="opacity"||(Dt(!1),Hi(null),R==null||R())},style:{...F,...Pe.tooltipStyles,opacity:ct!==void 0&&Ai?ct:void 0},ref:Ie},Lt,c.createElement(v,{className:Xu("react-tooltip-arrow",Bn.arrow,bd.arrow,a,k&&Bn.noArrow),style:{...Pe.tooltipArrowStyles,background:He?`linear-gradient(to right bottom, transparent 50%, ${He} 50%)`:void 0},ref:Yt})):null},lC=({content:e})=>c.createElement("span",{dangerouslySetInnerHTML:{__html:e}}),lt=c.forwardRef(({id:e,anchorId:t,anchorSelect:i,content:a,html:n,render:r,className:s,classNameArrow:l,variant:d="dark",place:u="top",offset:h=10,wrapper:g="div",children:p=null,events:v=["hover"],openOnClick:f=!1,positionStrategy:b="absolute",middlewares:w,delayShow:y=0,delayHide:k=0,float:_=!1,hidden:x=!1,noArrow:A=!1,clickable:z=!1,closeOnEsc:S=!1,closeOnScroll:M=!1,closeOnResize:T=!1,openEvents:D,closeEvents:F,globalCloseEvents:O,imperativeModeOnly:Z=!1,style:R,position:ce,isOpen:ae,defaultIsOpen:Q=!1,disableStyleInjection:I=!1,border:U,opacity:B,arrowColor:me,setIsOpen:ze,afterShow:ct,afterHide:He,role:dt="tooltip"},Ve)=>{const[Ie,Yt]=m.useState(a),[jt,Xt]=m.useState(n),[na,Pe]=m.useState(u),[ei,Ye]=m.useState(d),[La,ht]=m.useState(h),[Dt,Ce]=m.useState(y),[Hi,Vi]=m.useState(k),[qi,gt]=m.useState(_),[ti,wt]=m.useState(x),[se,_e]=m.useState(g),[ne,fe]=m.useState(v),[qe,ut]=m.useState(b),[be,ee]=m.useState(null),[ve,_i]=m.useState(null),xi=m.useRef(I),{anchorRefs:ra,activeAnchor:nn}=Oy(e),oa=Xe=>Xe==null?void 0:Xe.getAttributeNames().reduce((Ut,oe)=>{var Ae;return oe.startsWith("data-tooltip-")&&(Ut[oe.replace(/^data-tooltip-/,"")]=(Ae=Xe==null?void 0:Xe.getAttribute(oe))!==null&&Ae!==void 0?Ae:null),Ut},{}),zi=Xe=>{const Ut={place:oe=>{var Ae;Pe((Ae=oe)!==null&&Ae!==void 0?Ae:u)},content:oe=>{Yt(oe??a)},html:oe=>{Xt(oe??n)},variant:oe=>{var Ae;Ye((Ae=oe)!==null&&Ae!==void 0?Ae:d)},offset:oe=>{ht(oe===null?h:Number(oe))},wrapper:oe=>{var Ae;_e((Ae=oe)!==null&&Ae!==void 0?Ae:g)},events:oe=>{const Ae=oe==null?void 0:oe.split(" ");fe(Ae??v)},"position-strategy":oe=>{var Ae;ut((Ae=oe)!==null&&Ae!==void 0?Ae:b)},"delay-show":oe=>{Ce(oe===null?y:Number(oe))},"delay-hide":oe=>{Vi(oe===null?k:Number(oe))},float:oe=>{gt(oe===null?_:oe==="true")},hidden:oe=>{wt(oe===null?x:oe==="true")},"class-name":oe=>{ee(oe)}};Object.values(Ut).forEach(oe=>oe(null)),Object.entries(Xe).forEach(([oe,Ae])=>{var Lt;(Lt=Ut[oe])===null||Lt===void 0||Lt.call(Ut,Ae)})};m.useEffect(()=>{Yt(a)},[a]),m.useEffect(()=>{Xt(n)},[n]),m.useEffect(()=>{Pe(u)},[u]),m.useEffect(()=>{Ye(d)},[d]),m.useEffect(()=>{ht(h)},[h]),m.useEffect(()=>{Ce(y)},[y]),m.useEffect(()=>{Vi(k)},[k]),m.useEffect(()=>{gt(_)},[_]),m.useEffect(()=>{wt(x)},[x]),m.useEffect(()=>{ut(b)},[b]),m.useEffect(()=>{xi.current!==I&&console.warn("[react-tooltip] Do not change `disableStyleInjection` dynamically.")},[I]),m.useEffect(()=>{typeof window<"u"&&window.dispatchEvent(new CustomEvent("react-tooltip-inject-styles",{detail:{disableCore:I==="core",disableBase:I}}))},[]),m.useEffect(()=>{var Xe;const Ut=new Set(ra);let oe=i;if(!oe&&e&&(oe=`[data-tooltip-id='${e.replace(/'/g,"\\'")}']`),oe)try{document.querySelectorAll(oe).forEach(le=>{Ut.add({current:le})})}catch{console.warn(`[react-tooltip] "${oe}" is not a valid CSS selector`)}const Ae=document.querySelector(`[id='${t}']`);if(Ae&&Ut.add({current:Ae}),!Ut.size)return()=>null;const Lt=(Xe=ve??Ae)!==null&&Xe!==void 0?Xe:nn.current,Ai=new MutationObserver(le=>{le.forEach(pe=>{var j;if(!Lt||pe.type!=="attributes"||!(!((j=pe.attributeName)===null||j===void 0)&&j.startsWith("data-tooltip-")))return;const L=oa(Lt);zi(L)})}),W={attributes:!0,childList:!1,subtree:!1};if(Lt){const le=oa(Lt);zi(le),Ai.observe(Lt,W)}return()=>{Ai.disconnect()}},[ra,nn,ve,t,i]),m.useEffect(()=>{R!=null&&R.border&&console.warn("[react-tooltip] Do not set `style.border`. Use `border` prop instead."),U&&!d0("border",`${U}`)&&console.warn(`[react-tooltip] "${U}" is not a valid \`border\`.`),R!=null&&R.opacity&&console.warn("[react-tooltip] Do not set `style.opacity`. Use `opacity` prop instead."),B&&!d0("opacity",`${B}`)&&console.warn(`[react-tooltip] "${B}" is not a valid \`opacity\`.`)},[]);let sa=p;const la=m.useRef(null);if(r){const Xe=r({content:(ve==null?void 0:ve.getAttribute("data-tooltip-content"))||Ie||null,activeAnchor:ve});sa=Xe?c.createElement("div",{ref:la,className:"react-tooltip-content-wrapper"},Xe):null}else Ie&&(sa=Ie);jt&&(sa=c.createElement(lC,{content:jt}));const ca={forwardRef:Ve,id:e,anchorId:t,anchorSelect:i,className:Xu(s,be),classNameArrow:l,content:sa,contentWrapperRef:la,place:na,variant:ei,offset:La,wrapper:se,events:ne,openOnClick:f,positionStrategy:qe,middlewares:w,delayShow:Dt,delayHide:Hi,float:qi,hidden:ti,noArrow:A,clickable:z,closeOnEsc:S,closeOnScroll:M,closeOnResize:T,openEvents:D,closeEvents:F,globalCloseEvents:O,imperativeModeOnly:Z,style:R,position:ce,isOpen:ae,defaultIsOpen:Q,border:U,opacity:B,arrowColor:me,setIsOpen:ze,afterShow:ct,afterHide:He,activeAnchor:ve,setActiveAnchor:Xe=>_i(Xe),role:dt};return c.createElement(sC,{...ca})});typeof window<"u"&&window.addEventListener("react-tooltip-inject-styles",e=>{e.detail.disableCore||l0({css:":root{--rt-color-white:#fff;--rt-color-dark:#222;--rt-color-success:#8dc572;--rt-color-error:#be6464;--rt-color-warning:#f0ad4e;--rt-color-info:#337ab7;--rt-opacity:0.9;--rt-transition-show-delay:0.15s;--rt-transition-closing-delay:0.15s}.core-styles-module_tooltip__3vRRp{position:absolute;top:0;left:0;pointer-events:none;opacity:0;will-change:opacity}.core-styles-module_fixed__pcSol{position:fixed}.core-styles-module_arrow__cvMwQ{position:absolute;background:inherit}.core-styles-module_noArrow__xock6{display:none}.core-styles-module_clickable__ZuTTB{pointer-events:auto}.core-styles-module_show__Nt9eE{opacity:var(--rt-opacity);transition:opacity var(--rt-transition-show-delay)ease-out}.core-styles-module_closing__sGnxF{opacity:0;transition:opacity var(--rt-transition-closing-delay)ease-in}",type:"core"}),e.detail.disableBase||l0({css:`
|
|
1707
|
+
.styles-module_tooltip__mnnfp{padding:8px 16px;border-radius:3px;font-size:90%;width:max-content}.styles-module_arrow__K0L3T{width:8px;height:8px}[class*='react-tooltip__place-top']>.styles-module_arrow__K0L3T{transform:rotate(45deg)}[class*='react-tooltip__place-right']>.styles-module_arrow__K0L3T{transform:rotate(135deg)}[class*='react-tooltip__place-bottom']>.styles-module_arrow__K0L3T{transform:rotate(225deg)}[class*='react-tooltip__place-left']>.styles-module_arrow__K0L3T{transform:rotate(315deg)}.styles-module_dark__xNqje{background:var(--rt-color-dark);color:var(--rt-color-white)}.styles-module_light__Z6W-X{background-color:var(--rt-color-white);color:var(--rt-color-dark)}.styles-module_success__A2AKt{background-color:var(--rt-color-success);color:var(--rt-color-white)}.styles-module_warning__SCK0X{background-color:var(--rt-color-warning);color:var(--rt-color-white)}.styles-module_error__JvumD{background-color:var(--rt-color-error);color:var(--rt-color-white)}.styles-module_info__BWdHW{background-color:var(--rt-color-info);color:var(--rt-color-white)}`,type:"base"})});const cC=["azure","textgenwebui","generic-openai","bedrock"],h0={openai:[],gemini:[],anthropic:[],azure:[],lmstudio:[],localai:[],ollama:[],togetherai:[],fireworksai:[],"nvidia-nim":[],groq:[],cohere:["command-r","command-r-plus","command","command-light","command-nightly","command-light-nightly"],textgenwebui:[],"generic-openai":[],bedrock:[],xai:["grok-beta"]};function dC(e){return e.reduce((t,i)=>(t[i.organization]=t[i.organization]||[],t[i.organization].push(i),t),{})}const g0=["togetherai","fireworksai","openai","novita","openrouter","ppio","docker-model-runner","sambanova"];function ID(e=null){const[t,i]=m.useState([]),[a,n]=m.useState([]),[r,s]=m.useState(!0);return m.useEffect(()=>{async function l(){if(!e)return;s(!0);const{models:d=[]}=await K.customModels(e);h0.hasOwnProperty(e)&&!g0.includes(e)?i(h0[e]):i([]),g0.includes(e)?n(dC(d)):n(d),s(!1)}l()},[e]),{defaultModels:t,customModels:a,loading:r}}const uC={getAll:async()=>await fetch(`${E}/model-routers`,{method:"GET",headers:N()}).then(e=>e.json()).then(e=>(e==null?void 0:e.routers)||[]).catch(e=>(console.error(e),[])),get:async e=>await fetch(`${E}/model-routers/${e}`,{method:"GET",headers:N()}).then(t=>t.json()).catch(t=>(console.error(t),{router:null,error:t.message})),create:async e=>await fetch(`${E}/model-routers/new`,{method:"POST",headers:N(),body:JSON.stringify(e)}).then(t=>t.json()).catch(t=>(console.error(t),{router:null,error:t.message})),update:async(e,t)=>await fetch(`${E}/model-routers/${e}`,{method:"PUT",headers:N(),body:JSON.stringify(t)}).then(i=>i.json()).catch(i=>(console.error(i),{router:null,error:i.message})),delete:async e=>await fetch(`${E}/model-routers/${e}`,{method:"DELETE",headers:N()}).then(t=>t.json()).catch(t=>(console.error(t),{success:!1,error:t.message})),createRule:async(e,t)=>await fetch(`${E}/model-routers/${e}/rules/new`,{method:"POST",headers:N(),body:JSON.stringify(t)}).then(i=>i.json()).catch(i=>(console.error(i),{rule:null,error:i.message})),updateRule:async(e,t,i)=>await fetch(`${E}/model-routers/${e}/rules/${t}`,{method:"PUT",headers:N(),body:JSON.stringify(i)}).then(a=>a.json()).catch(a=>(console.error(a),{rule:null,error:a.message})),deleteRule:async(e,t)=>await fetch(`${E}/model-routers/${e}/rules/${t}`,{method:"DELETE",headers:N()}).then(i=>i.json()).catch(i=>(console.error(i),{success:!1,error:i.message})),reorderRules:async(e,t)=>await fetch(`${E}/model-routers/${e}/rules/reorder`,{method:"PUT",headers:N(),body:JSON.stringify({ruleUpdates:t})}).then(i=>i.json()).catch(i=>(console.error(i),{success:!1,error:i.message}))};function Ry(){const{logo:e,setLogo:t,loginLogo:i,isCustomLogo:a}=m.useContext(K1);return{logo:e,setLogo:t,loginLogo:i,isCustomLogo:a}}const pC="/agent-static.png",mC="/community-hub.png",Hy=typeof{communityHub:{label:"Community Hub",tier:"L2",enabled:!1,allowlist:null},modelRouter:{label:"Model Router",tier:"L2",enabled:!1,allowlist:null},llmProviders:{label:"LLM Provider Allowlist",tier:"L1",enabled:!0,allowlist:["ollama","openrouter"]},brandingWhitelabel:{label:"Branding & Whitelabeling",tier:"L2",enabled:!1,allowlist:null},filesystemAgent:{label:"File System Access",tier:"L2",enabled:!0,allowlist:null},documentationLink:{label:"Documentation Link",tier:"L2",enabled:!1,allowlist:null},multiUser:{label:"Multi-User Mode",tier:"L2",enabled:!1,allowlist:null},browserExtension:{label:"Browser Extension",tier:"L2",enabled:!1,allowlist:null},chatEmbed:{label:"Chat Embed",tier:"L2",enabled:!1,allowlist:null},scheduledJobs:{label:"Scheduled Jobs",tier:"L2",enabled:!1,allowlist:null},developerApi:{label:"Developer API",tier:"L2",enabled:!1,allowlist:null},mobile:{label:"Totem LLM Mobile",tier:"L2",enabled:!1,allowlist:null},agentMode:{label:"Agent Mode",tier:"L2",enabled:!1,allowlist:null},memories:{label:"Memories Feature",tier:"L2",enabled:!1,allowlist:null},vectorDB:{label:"Vector Database Integrations",tier:"L2",enabled:!1,allowlist:null},embedder:{label:"Embedder Integrations",tier:"L2",enabled:!1,allowlist:null},textSplitter:{label:"Text Splitter Integrations",tier:"L2",enabled:!1,allowlist:null},transcription:{label:"Audio Transcription",tier:"L2",enabled:!1,allowlist:null}}<"u"?{communityHub:{label:"Community Hub",tier:"L2",enabled:!1,allowlist:null},modelRouter:{label:"Model Router",tier:"L2",enabled:!1,allowlist:null},llmProviders:{label:"LLM Provider Allowlist",tier:"L1",enabled:!0,allowlist:["ollama","openrouter"]},brandingWhitelabel:{label:"Branding & Whitelabeling",tier:"L2",enabled:!1,allowlist:null},filesystemAgent:{label:"File System Access",tier:"L2",enabled:!0,allowlist:null},documentationLink:{label:"Documentation Link",tier:"L2",enabled:!1,allowlist:null},multiUser:{label:"Multi-User Mode",tier:"L2",enabled:!1,allowlist:null},browserExtension:{label:"Browser Extension",tier:"L2",enabled:!1,allowlist:null},chatEmbed:{label:"Chat Embed",tier:"L2",enabled:!1,allowlist:null},scheduledJobs:{label:"Scheduled Jobs",tier:"L2",enabled:!1,allowlist:null},developerApi:{label:"Developer API",tier:"L2",enabled:!1,allowlist:null},mobile:{label:"Totem LLM Mobile",tier:"L2",enabled:!1,allowlist:null},agentMode:{label:"Agent Mode",tier:"L2",enabled:!1,allowlist:null},memories:{label:"Memories Feature",tier:"L2",enabled:!1,allowlist:null},vectorDB:{label:"Vector Database Integrations",tier:"L2",enabled:!1,allowlist:null},embedder:{label:"Embedder Integrations",tier:"L2",enabled:!1,allowlist:null},textSplitter:{label:"Text Splitter Integrations",tier:"L2",enabled:!1,allowlist:null},transcription:{label:"Audio Transcription",tier:"L2",enabled:!1,allowlist:null}}:{},Vy=m.createContext(Hy);function hC({children:e}){const[t,i]=m.useState(Hy);return m.useEffect(()=>{fetch("http://localhost:8686/api/features").then(n=>n.json()).then(({features:n})=>{n&&Object.keys(n).length>0&&i(n)}).catch(()=>{})},[]),o.jsx(Vy.Provider,{value:t,children:e})}function qy(){return m.useContext(Vy)}function pt(e){return qy()[e]??{enabled:!1,label:e,tier:"free"}}var X={},tp={exports:{}};(function(e,t){(function(i,a){var n="1.0.38",r="",s="?",l="function",d="undefined",u="object",h="string",g="major",p="model",v="name",f="type",b="vendor",w="version",y="architecture",k="console",_="mobile",x="tablet",A="smarttv",z="wearable",S="embedded",M=500,T="Amazon",D="Apple",F="ASUS",O="BlackBerry",Z="Browser",R="Chrome",ce="Edge",ae="Firefox",Q="Google",I="Huawei",U="LG",B="Microsoft",me="Motorola",ze="Opera",ct="Samsung",He="Sharp",dt="Sony",Ve="Xiaomi",Ie="Zebra",Yt="Facebook",jt="Chromium OS",Xt="Mac OS",na=function(se,_e){var ne={};for(var fe in se)_e[fe]&&_e[fe].length%2===0?ne[fe]=_e[fe].concat(se[fe]):ne[fe]=se[fe];return ne},Pe=function(se){for(var _e={},ne=0;ne<se.length;ne++)_e[se[ne].toUpperCase()]=se[ne];return _e},ei=function(se,_e){return typeof se===h?Ye(_e).indexOf(Ye(se))!==-1:!1},Ye=function(se){return se.toLowerCase()},La=function(se){return typeof se===h?se.replace(/[^\d\.]/g,r).split(".")[0]:a},ht=function(se,_e){if(typeof se===h)return se=se.replace(/^\s\s*/,r),typeof _e===d?se:se.substring(0,M)},Dt=function(se,_e){for(var ne=0,fe,qe,ut,be,ee,ve;ne<_e.length&&!ee;){var _i=_e[ne],xi=_e[ne+1];for(fe=qe=0;fe<_i.length&&!ee&&_i[fe];)if(ee=_i[fe++].exec(se),ee)for(ut=0;ut<xi.length;ut++)ve=ee[++qe],be=xi[ut],typeof be===u&&be.length>0?be.length===2?typeof be[1]==l?this[be[0]]=be[1].call(this,ve):this[be[0]]=be[1]:be.length===3?typeof be[1]===l&&!(be[1].exec&&be[1].test)?this[be[0]]=ve?be[1].call(this,ve,be[2]):a:this[be[0]]=ve?ve.replace(be[1],be[2]):a:be.length===4&&(this[be[0]]=ve?be[3].call(this,ve.replace(be[1],be[2])):a):this[be]=ve||a;ne+=2}},Ce=function(se,_e){for(var ne in _e)if(typeof _e[ne]===u&&_e[ne].length>0){for(var fe=0;fe<_e[ne].length;fe++)if(ei(_e[ne][fe],se))return ne===s?a:ne}else if(ei(_e[ne],se))return ne===s?a:ne;return se},Hi={"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},Vi={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},qi={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[w,[v,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[w,[v,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[v,w],[/opios[\/ ]+([\w\.]+)/i],[w,[v,ze+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[w,[v,ze+" GX"]],[/\bopr\/([\w\.]+)/i],[w,[v,ze]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[w,[v,"Baidu"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim)\s?(?:browser)?[\/ ]?([\w\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[v,w],[/\bddg\/([\w\.]+)/i],[w,[v,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[w,[v,"UC"+Z]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[w,[v,"WeChat"]],[/konqueror\/([\w\.]+)/i],[w,[v,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[w,[v,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[w,[v,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[w,[v,"Smart Lenovo "+Z]],[/(avast|avg)\/([\w\.]+)/i],[[v,/(.+)/,"$1 Secure "+Z],w],[/\bfocus\/([\w\.]+)/i],[w,[v,ae+" Focus"]],[/\bopt\/([\w\.]+)/i],[w,[v,ze+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[w,[v,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[w,[v,"Dolphin"]],[/coast\/([\w\.]+)/i],[w,[v,ze+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[w,[v,"MIUI "+Z]],[/fxios\/([-\w\.]+)/i],[w,[v,ae]],[/\bqihu|(qi?ho?o?|360)browser/i],[[v,"360 "+Z]],[/(oculus|sailfish|huawei|vivo)browser\/([\w\.]+)/i],[[v,/(.+)/,"$1 "+Z],w],[/samsungbrowser\/([\w\.]+)/i],[w,[v,ct+" Internet"]],[/(comodo_dragon)\/([\w\.]+)/i],[[v,/_/g," "],w],[/metasr[\/ ]?([\d\.]+)/i],[w,[v,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[v,"Sogou Mobile"],w],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i],[v,w],[/(lbbrowser)/i,/\[(linkedin)app\]/i],[v],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[v,Yt],w],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[v,w],[/\bgsa\/([\w\.]+) .*safari\//i],[w,[v,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[w,[v,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[w,[v,R+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[v,R+" WebView"],w],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[w,[v,"Android "+Z]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[v,w],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[w,[v,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[w,v],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[v,[w,Ce,Hi]],[/(webkit|khtml)\/([\w\.]+)/i],[v,w],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[v,"Netscape"],w],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[w,[v,ae+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[v,w],[/(cobalt)\/([\w\.]+)/i],[v,[w,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[y,"amd64"]],[/(ia32(?=;))/i],[[y,Ye]],[/((?:i[346]|x)86)[;\)]/i],[[y,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[y,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[y,"armhf"]],[/windows (ce|mobile); ppc;/i],[[y,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[y,/ower/,r,Ye]],[/(sun4\w)[;\)]/i],[[y,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[y,Ye]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[p,[b,ct],[f,x]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[p,[b,ct],[f,_]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[p,[b,D],[f,_]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[p,[b,D],[f,x]],[/(macintosh);/i],[p,[b,D]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[p,[b,He],[f,_]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[p,[b,I],[f,x]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[p,[b,I],[f,_]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[p,/_/g," "],[b,Ve],[f,_]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[p,/_/g," "],[b,Ve],[f,x]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[p,[b,"OPPO"],[f,_]],[/\b(opd2\d{3}a?) bui/i],[p,[b,"OPPO"],[f,x]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[p,[b,"Vivo"],[f,_]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[p,[b,"Realme"],[f,_]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[p,[b,me],[f,_]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[p,[b,me],[f,x]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[p,[b,U],[f,x]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[p,[b,U],[f,_]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[p,[b,"Lenovo"],[f,x]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[p,/_/g," "],[b,"Nokia"],[f,_]],[/(pixel c)\b/i],[p,[b,Q],[f,x]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[p,[b,Q],[f,_]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[p,[b,dt],[f,_]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[p,"Xperia Tablet"],[b,dt],[f,x]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[p,[b,"OnePlus"],[f,_]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[p,[b,T],[f,x]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[p,/(.+)/g,"Fire Phone $1"],[b,T],[f,_]],[/(playbook);[-\w\),; ]+(rim)/i],[p,b,[f,x]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[p,[b,O],[f,_]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[p,[b,F],[f,x]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[p,[b,F],[f,_]],[/(nexus 9)/i],[p,[b,"HTC"],[f,x]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[b,[p,/_/g," "],[f,_]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[p,[b,"Acer"],[f,x]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[p,[b,"Meizu"],[f,_]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[p,[b,"Ulefone"],[f,_]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[b,p,[f,_]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[b,p,[f,x]],[/(surface duo)/i],[p,[b,B],[f,x]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[p,[b,"Fairphone"],[f,_]],[/(u304aa)/i],[p,[b,"AT&T"],[f,_]],[/\bsie-(\w*)/i],[p,[b,"Siemens"],[f,_]],[/\b(rct\w+) b/i],[p,[b,"RCA"],[f,x]],[/\b(venue[\d ]{2,7}) b/i],[p,[b,"Dell"],[f,x]],[/\b(q(?:mv|ta)\w+) b/i],[p,[b,"Verizon"],[f,x]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[p,[b,"Barnes & Noble"],[f,x]],[/\b(tm\d{3}\w+) b/i],[p,[b,"NuVision"],[f,x]],[/\b(k88) b/i],[p,[b,"ZTE"],[f,x]],[/\b(nx\d{3}j) b/i],[p,[b,"ZTE"],[f,_]],[/\b(gen\d{3}) b.+49h/i],[p,[b,"Swiss"],[f,_]],[/\b(zur\d{3}) b/i],[p,[b,"Swiss"],[f,x]],[/\b((zeki)?tb.*\b) b/i],[p,[b,"Zeki"],[f,x]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[b,"Dragon Touch"],p,[f,x]],[/\b(ns-?\w{0,9}) b/i],[p,[b,"Insignia"],[f,x]],[/\b((nxa|next)-?\w{0,9}) b/i],[p,[b,"NextBook"],[f,x]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[b,"Voice"],p,[f,_]],[/\b(lvtel\-)?(v1[12]) b/i],[[b,"LvTel"],p,[f,_]],[/\b(ph-1) /i],[p,[b,"Essential"],[f,_]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[p,[b,"Envizen"],[f,x]],[/\b(trio[-\w\. ]+) b/i],[p,[b,"MachSpeed"],[f,x]],[/\btu_(1491) b/i],[p,[b,"Rotor"],[f,x]],[/(shield[\w ]+) b/i],[p,[b,"Nvidia"],[f,x]],[/(sprint) (\w+)/i],[b,p,[f,_]],[/(kin\.[onetw]{3})/i],[[p,/\./g," "],[b,B],[f,_]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[p,[b,Ie],[f,x]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[p,[b,Ie],[f,_]],[/smart-tv.+(samsung)/i],[b,[f,A]],[/hbbtv.+maple;(\d+)/i],[[p,/^/,"SmartTV"],[b,ct],[f,A]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[b,U],[f,A]],[/(apple) ?tv/i],[b,[p,D+" TV"],[f,A]],[/crkey/i],[[p,R+"cast"],[b,Q],[f,A]],[/droid.+aft(\w+)( bui|\))/i],[p,[b,T],[f,A]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[p,[b,He],[f,A]],[/(bravia[\w ]+)( bui|\))/i],[p,[b,dt],[f,A]],[/(mitv-\w{5}) bui/i],[p,[b,Ve],[f,A]],[/Hbbtv.*(technisat) (.*);/i],[b,p,[f,A]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[b,ht],[p,ht],[f,A]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[f,A]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[b,p,[f,k]],[/droid.+; (shield) bui/i],[p,[b,"Nvidia"],[f,k]],[/(playstation [345portablevi]+)/i],[p,[b,dt],[f,k]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[p,[b,B],[f,k]],[/((pebble))app/i],[b,p,[f,z]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[p,[b,D],[f,z]],[/droid.+; (glass) \d/i],[p,[b,Q],[f,z]],[/droid.+; (wt63?0{2,3})\)/i],[p,[b,Ie],[f,z]],[/(quest( \d| pro)?)/i],[p,[b,Yt],[f,z]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[b,[f,S]],[/(aeobc)\b/i],[p,[b,T],[f,S]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[p,[f,_]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[p,[f,x]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[f,x]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[f,_]],[/(android[-\w\. ]{0,9});.+buil/i],[p,[b,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[w,[v,ce+"HTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[w,[v,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[v,w],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[w,v]],os:[[/microsoft (windows) (vista|xp)/i],[v,w],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[v,[w,Ce,Vi]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[w,Ce,Vi],[v,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[w,/_/g,"."],[v,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[v,Xt],[w,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[w,v],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[v,w],[/\(bb(10);/i],[w,[v,O]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[w,[v,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[w,[v,ae+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[w,[v,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[w,[v,"watchOS"]],[/crkey\/([\d\.]+)/i],[w,[v,R+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[v,jt],w],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[v,w],[/(sunos) ?([\w\.\d]*)/i],[[v,"Solaris"],w],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[v,w]]},gt=function(se,_e){if(typeof se===u&&(_e=se,se=a),!(this instanceof gt))return new gt(se,_e).getResult();var ne=typeof i!==d&&i.navigator?i.navigator:a,fe=se||(ne&&ne.userAgent?ne.userAgent:r),qe=ne&&ne.userAgentData?ne.userAgentData:a,ut=_e?na(qi,_e):qi,be=ne&&ne.userAgent==fe;return this.getBrowser=function(){var ee={};return ee[v]=a,ee[w]=a,Dt.call(ee,fe,ut.browser),ee[g]=La(ee[w]),be&&ne&&ne.brave&&typeof ne.brave.isBrave==l&&(ee[v]="Brave"),ee},this.getCPU=function(){var ee={};return ee[y]=a,Dt.call(ee,fe,ut.cpu),ee},this.getDevice=function(){var ee={};return ee[b]=a,ee[p]=a,ee[f]=a,Dt.call(ee,fe,ut.device),be&&!ee[f]&&qe&&qe.mobile&&(ee[f]=_),be&&ee[p]=="Macintosh"&&ne&&typeof ne.standalone!==d&&ne.maxTouchPoints&&ne.maxTouchPoints>2&&(ee[p]="iPad",ee[f]=x),ee},this.getEngine=function(){var ee={};return ee[v]=a,ee[w]=a,Dt.call(ee,fe,ut.engine),ee},this.getOS=function(){var ee={};return ee[v]=a,ee[w]=a,Dt.call(ee,fe,ut.os),be&&!ee[v]&&qe&&qe.platform&&qe.platform!="Unknown"&&(ee[v]=qe.platform.replace(/chrome os/i,jt).replace(/macos/i,Xt)),ee},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return fe},this.setUA=function(ee){return fe=typeof ee===h&&ee.length>M?ht(ee,M):ee,this},this.setUA(fe),this};gt.VERSION=n,gt.BROWSER=Pe([v,w,g]),gt.CPU=Pe([y]),gt.DEVICE=Pe([p,b,f,k,_,A,x,z,S]),gt.ENGINE=gt.OS=Pe([v,w]),e.exports&&(t=e.exports=gt),t.UAParser=gt;var ti=typeof i!==d&&(i.jQuery||i.Zepto);if(ti&&!ti.ua){var wt=new gt;ti.ua=wt.getResult(),ti.ua.get=function(){return wt.getUA()},ti.ua.set=function(se){wt.setUA(se);var _e=wt.getResult();for(var ne in _e)ti.ua[ne]=_e[ne]}}})(typeof window=="object"?window:Ti)})(tp,tp.exports);var gC=tp.exports;Object.defineProperty(X,"__esModule",{value:!0});function fC(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var Tt=m,Re=fC(Tt),Fy=gC,en=new Fy,Nt=en.getBrowser(),bC=en.getCPU(),ui=en.getDevice(),Pm=en.getEngine(),tn=en.getOS(),us=en.getUA(),Uy=function(t){return en.setUA(t)},ps=function(t){if(!t){console.error("No userAgent string was provided");return}var i=new Fy(t);return{UA:i,browser:i.getBrowser(),cpu:i.getCPU(),device:i.getDevice(),engine:i.getEngine(),os:i.getOS(),ua:i.getUA(),setUserAgent:function(n){return i.setUA(n)}}},By=Object.freeze({ClientUAInstance:en,browser:Nt,cpu:bC,device:ui,engine:Pm,os:tn,ua:us,setUa:Uy,parseUserAgent:ps});function f0(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),i.push.apply(i,a)}return i}function vC(e){for(var t=1;t<arguments.length;t++){var i=arguments[t]!=null?arguments[t]:{};t%2?f0(Object(i),!0).forEach(function(a){wC(e,a,i[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):f0(Object(i)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(i,a))})}return e}function co(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?co=function(t){return typeof t}:co=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},co(e)}function kC(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function b0(e,t){for(var i=0;i<t.length;i++){var a=t[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function yC(e,t,i){return t&&b0(e.prototype,t),i&&b0(e,i),e}function wC(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function ip(){return ip=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(e[a]=i[a])}return e},ip.apply(this,arguments)}function _C(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&np(e,t)}function ap(e){return ap=Object.setPrototypeOf?Object.getPrototypeOf:function(i){return i.__proto__||Object.getPrototypeOf(i)},ap(e)}function np(e,t){return np=Object.setPrototypeOf||function(a,n){return a.__proto__=n,a},np(e,t)}function xC(e,t){if(e==null)return{};var i={},a=Object.keys(e),n,r;for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&(i[n]=e[n]);return i}function wi(e,t){if(e==null)return{};var i=xC(e,t),a,n;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n<r.length;n++)a=r[n],!(t.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(i[a]=e[a])}return i}function tl(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function zC(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return tl(e)}function AC(e,t){return jC(e)||LC(e,t)||SC(e,t)||MC()}function jC(e){if(Array.isArray(e))return e}function LC(e,t){var i=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(i!=null){var a=[],n=!0,r=!1,s,l;try{for(i=i.call(e);!(n=(s=i.next()).done)&&(a.push(s.value),!(t&&a.length===t));n=!0);}catch(d){r=!0,l=d}finally{try{!n&&i.return!=null&&i.return()}finally{if(r)throw l}}return a}}function SC(e,t){if(e){if(typeof e=="string")return v0(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);if(i==="Object"&&e.constructor&&(i=e.constructor.name),i==="Map"||i==="Set")return Array.from(e);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return v0(e,t)}}function v0(e,t){(t==null||t>e.length)&&(t=e.length);for(var i=0,a=new Array(t);i<t;i++)a[i]=e[i];return a}function MC(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1708
1708
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Pt={Mobile:"mobile",Tablet:"tablet",SmartTv:"smarttv",Console:"console",Wearable:"wearable",Embedded:"embedded",Browser:void 0},Qt={Chrome:"Chrome",Firefox:"Firefox",Opera:"Opera",Yandex:"Yandex",Safari:"Safari",InternetExplorer:"Internet Explorer",Edge:"Edge",Chromium:"Chromium",Ie:"IE",MobileSafari:"Mobile Safari",EdgeChromium:"Edge Chromium",MIUI:"MIUI Browser",SamsungBrowser:"Samsung Browser"},Pr={IOS:"iOS",Android:"Android",WindowsPhone:"Windows Phone",Windows:"Windows",MAC_OS:"Mac OS"},PC={isMobile:!1,isTablet:!1,isBrowser:!1,isSmartTV:!1,isConsole:!1,isWearable:!1},CC=function(t){switch(t){case Pt.Mobile:return{isMobile:!0};case Pt.Tablet:return{isTablet:!0};case Pt.SmartTv:return{isSmartTV:!0};case Pt.Console:return{isConsole:!0};case Pt.Wearable:return{isWearable:!0};case Pt.Browser:return{isBrowser:!0};case Pt.Embedded:return{isEmbedded:!0};default:return PC}},EC=function(t){return Uy(t)},de=function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"none";return t||i},Cm=function(){return typeof window<"u"&&(window.navigator||navigator)?window.navigator||navigator:!1},Em=function(t){var i=Cm();return i&&i.platform&&(i.platform.indexOf(t)!==-1||i.platform==="MacIntel"&&i.maxTouchPoints>1&&!window.MSStream)},TC=function(t,i,a,n,r){return{isBrowser:t,browserMajorVersion:de(i.major),browserFullVersion:de(i.version),browserName:de(i.name),engineName:de(a.name),engineVersion:de(a.version),osName:de(n.name),osVersion:de(n.version),userAgent:de(r)}},k0=function(t,i,a,n){return vC({},t,{vendor:de(i.vendor),model:de(i.model),os:de(a.name),osVersion:de(a.version),ua:de(n)})},IC=function(t,i,a,n){return{isSmartTV:t,engineName:de(i.name),engineVersion:de(i.version),osName:de(a.name),osVersion:de(a.version),userAgent:de(n)}},NC=function(t,i,a,n){return{isConsole:t,engineName:de(i.name),engineVersion:de(i.version),osName:de(a.name),osVersion:de(a.version),userAgent:de(n)}},DC=function(t,i,a,n){return{isWearable:t,engineName:de(i.name),engineVersion:de(i.version),osName:de(a.name),osVersion:de(a.version),userAgent:de(n)}},OC=function(t,i,a,n,r){return{isEmbedded:t,vendor:de(i.vendor),model:de(i.model),engineName:de(a.name),engineVersion:de(a.version),osName:de(n.name),osVersion:de(n.version),userAgent:de(r)}};function RC(e){var t=e?ps(e):By,i=t.device,a=t.browser,n=t.engine,r=t.os,s=t.ua,l=CC(i.type),d=l.isBrowser,u=l.isMobile,h=l.isTablet,g=l.isSmartTV,p=l.isConsole,v=l.isWearable,f=l.isEmbedded;if(d)return TC(d,a,n,r,s);if(g)return IC(g,n,r,s);if(p)return NC(p,n,r,s);if(u||h)return k0(l,i,r,s);if(v)return DC(v,n,r,s);if(f)return OC(f,i,n,r,s)}var Gy=function(t){var i=t.type;return i===Pt.Mobile},Ky=function(t){var i=t.type;return i===Pt.Tablet},Wy=function(t){var i=t.type;return i===Pt.Mobile||i===Pt.Tablet},$y=function(t){var i=t.type;return i===Pt.SmartTv},Rl=function(t){var i=t.type;return i===Pt.Browser},Zy=function(t){var i=t.type;return i===Pt.Wearable},Jy=function(t){var i=t.type;return i===Pt.Console},Qy=function(t){var i=t.type;return i===Pt.Embedded},Yy=function(t){var i=t.vendor;return de(i)},Xy=function(t){var i=t.model;return de(i)},ew=function(t){var i=t.type;return de(i,"browser")},tw=function(t){var i=t.name;return i===Pr.Android},iw=function(t){var i=t.name;return i===Pr.Windows},aw=function(t){var i=t.name;return i===Pr.MAC_OS},nw=function(t){var i=t.name;return i===Pr.WindowsPhone},rw=function(t){var i=t.name;return i===Pr.IOS},ow=function(t){var i=t.version;return de(i)},sw=function(t){var i=t.name;return de(i)},lw=function(t){var i=t.name;return i===Qt.Chrome},cw=function(t){var i=t.name;return i===Qt.Firefox},dw=function(t){var i=t.name;return i===Qt.Chromium},Hl=function(t){var i=t.name;return i===Qt.Edge},uw=function(t){var i=t.name;return i===Qt.Yandex},pw=function(t){var i=t.name;return i===Qt.Safari||i===Qt.MobileSafari},mw=function(t){var i=t.name;return i===Qt.MobileSafari},hw=function(t){var i=t.name;return i===Qt.Opera},gw=function(t){var i=t.name;return i===Qt.InternetExplorer||i===Qt.Ie},fw=function(t){var i=t.name;return i===Qt.MIUI},bw=function(t){var i=t.name;return i===Qt.SamsungBrowser},vw=function(t){var i=t.version;return de(i)},kw=function(t){var i=t.major;return de(i)},yw=function(t){var i=t.name;return de(i)},ww=function(t){var i=t.name;return de(i)},_w=function(t){var i=t.version;return de(i)},xw=function(){var t=Cm(),i=t&&t.userAgent&&t.userAgent.toLowerCase();return typeof i=="string"?/electron/.test(i):!1},ur=function(t){return typeof t=="string"&&t.indexOf("Edg/")!==-1},zw=function(){var t=Cm();return t&&(/iPad|iPhone|iPod/.test(t.platform)||t.platform==="MacIntel"&&t.maxTouchPoints>1)&&!window.MSStream},Wi=function(){return Em("iPad")},Aw=function(){return Em("iPhone")},jw=function(){return Em("iPod")},Lw=function(t){return de(t)};function Sw(e){var t=e||By,i=t.device,a=t.browser,n=t.os,r=t.engine,s=t.ua;return{isSmartTV:$y(i),isConsole:Jy(i),isWearable:Zy(i),isEmbedded:Qy(i),isMobileSafari:mw(a)||Wi(),isChromium:dw(a),isMobile:Wy(i)||Wi(),isMobileOnly:Gy(i),isTablet:Ky(i)||Wi(),isBrowser:Rl(i),isDesktop:Rl(i),isAndroid:tw(n),isWinPhone:nw(n),isIOS:rw(n)||Wi(),isChrome:lw(a),isFirefox:cw(a),isSafari:pw(a),isOpera:hw(a),isIE:gw(a),osVersion:ow(n),osName:sw(n),fullBrowserVersion:vw(a),browserVersion:kw(a),browserName:yw(a),mobileVendor:Yy(i),mobileModel:Xy(i),engineName:ww(r),engineVersion:_w(r),getUA:Lw(s),isEdge:Hl(a)||ur(s),isYandex:uw(a),deviceType:ew(i),isIOS13:zw(),isIPad13:Wi(),isIPhone13:Aw(),isIPod13:jw(),isElectron:xw(),isEdgeChromium:ur(s),isLegacyEdge:Hl(a)&&!ur(s),isWindows:iw(n),isMacOs:aw(n),isMIUI:fw(a),isSamsungBrowser:bw(a)}}var Mw=$y(ui),Pw=Jy(ui),Cw=Zy(ui),HC=Qy(ui),VC=mw(Nt)||Wi(),qC=dw(Nt),kc=Wy(ui)||Wi(),Ew=Gy(ui),Tw=Ky(ui)||Wi(),Iw=Rl(ui),FC=Rl(ui),Nw=tw(tn),Dw=nw(tn),Ow=rw(tn)||Wi(),UC=lw(Nt),BC=cw(Nt),GC=pw(Nt),KC=hw(Nt),Rw=gw(Nt),WC=ow(tn),$C=sw(tn),ZC=vw(Nt),JC=kw(Nt),QC=yw(Nt),YC=Yy(ui),XC=Xy(ui),eE=ww(Pm),tE=_w(Pm),iE=Lw(us),aE=Hl(Nt)||ur(us),nE=uw(Nt),rE=ew(ui),oE=zw(),sE=Wi(),lE=Aw(),cE=jw(),dE=xw(),uE=ur(us),pE=Hl(Nt)&&!ur(us),mE=iw(tn),hE=aw(tn),gE=fw(Nt),fE=bw(Nt),bE=function(t){if(!t||typeof t!="string"){console.error("No valid user agent string was provided");return}var i=ps(t),a=i.device,n=i.browser,r=i.os,s=i.engine,l=i.ua;return Sw({device:a,browser:n,os:r,engine:s,ua:l})},vE=function(t){var i=t.renderWithFragment,a=t.children,n=wi(t,["renderWithFragment","children"]);return Nw?i?Re.createElement(Tt.Fragment,null,a):Re.createElement("div",n,a):null},kE=function(t){var i=t.renderWithFragment,a=t.children,n=wi(t,["renderWithFragment","children"]);return Iw?i?Re.createElement(Tt.Fragment,null,a):Re.createElement("div",n,a):null},yE=function(t){var i=t.renderWithFragment,a=t.children,n=wi(t,["renderWithFragment","children"]);return Rw?i?Re.createElement(Tt.Fragment,null,a):Re.createElement("div",n,a):null},wE=function(t){var i=t.renderWithFragment,a=t.children,n=wi(t,["renderWithFragment","children"]);return Ow?i?Re.createElement(Tt.Fragment,null,a):Re.createElement("div",n,a):null},_E=function(t){var i=t.renderWithFragment,a=t.children,n=wi(t,["renderWithFragment","children"]);return kc?i?Re.createElement(Tt.Fragment,null,a):Re.createElement("div",n,a):null},xE=function(t){var i=t.renderWithFragment,a=t.children,n=wi(t,["renderWithFragment","children"]);return Tw?i?Re.createElement(Tt.Fragment,null,a):Re.createElement("div",n,a):null},zE=function(t){var i=t.renderWithFragment,a=t.children,n=wi(t,["renderWithFragment","children"]);return Dw?i?Re.createElement(Tt.Fragment,null,a):Re.createElement("div",n,a):null},AE=function(t){var i=t.renderWithFragment,a=t.children;t.viewClassName,t.style;var n=wi(t,["renderWithFragment","children","viewClassName","style"]);return Ew?i?Re.createElement(Tt.Fragment,null,a):Re.createElement("div",n,a):null},jE=function(t){var i=t.renderWithFragment,a=t.children,n=wi(t,["renderWithFragment","children"]);return Mw?i?Re.createElement(Tt.Fragment,null,a):Re.createElement("div",n,a):null},LE=function(t){var i=t.renderWithFragment,a=t.children,n=wi(t,["renderWithFragment","children"]);return Pw?i?Re.createElement(Tt.Fragment,null,a):Re.createElement("div",n,a):null},SE=function(t){var i=t.renderWithFragment,a=t.children,n=wi(t,["renderWithFragment","children"]);return Cw?i?Re.createElement(Tt.Fragment,null,a):Re.createElement("div",n,a):null},ME=function(t){var i=t.renderWithFragment,a=t.children;t.viewClassName,t.style;var n=t.condition,r=wi(t,["renderWithFragment","children","viewClassName","style","condition"]);return n?i?Re.createElement(Tt.Fragment,null,a):Re.createElement("div",r,a):null};function PE(e){return function(t){_C(i,t);function i(a){var n;return kC(this,i),n=zC(this,ap(i).call(this,a)),n.isEventListenerAdded=!1,n.handleOrientationChange=n.handleOrientationChange.bind(tl(n)),n.onOrientationChange=n.onOrientationChange.bind(tl(n)),n.onPageLoad=n.onPageLoad.bind(tl(n)),n.state={isLandscape:!1,isPortrait:!1},n}return yC(i,[{key:"handleOrientationChange",value:function(){this.isEventListenerAdded||(this.isEventListenerAdded=!0);var n=window.innerWidth>window.innerHeight?90:0;this.setState({isPortrait:n===0,isLandscape:n===90})}},{key:"onOrientationChange",value:function(){this.handleOrientationChange()}},{key:"onPageLoad",value:function(){this.handleOrientationChange()}},{key:"componentDidMount",value:function(){(typeof window>"u"?"undefined":co(window))!==void 0&&kc&&(this.isEventListenerAdded?window.removeEventListener("load",this.onPageLoad,!1):(this.handleOrientationChange(),window.addEventListener("load",this.onPageLoad,!1)),window.addEventListener("resize",this.onOrientationChange,!1))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.onOrientationChange,!1)}},{key:"render",value:function(){return Re.createElement(e,ip({},this.props,{isLandscape:this.state.isLandscape,isPortrait:this.state.isPortrait}))}}]),i}(Re.Component)}function CE(){var e=Tt.useState(function(){var r=window.innerWidth>window.innerHeight?90:0;return{isPortrait:r===0,isLandscape:r===90,orientation:r===0?"portrait":"landscape"}}),t=AC(e,2),i=t[0],a=t[1],n=Tt.useCallback(function(){var r=window.innerWidth>window.innerHeight?90:0,s={isPortrait:r===0,isLandscape:r===90,orientation:r===0?"portrait":"landscape"};i.orientation!==s.orientation&&a(s)},[i.orientation]);return Tt.useEffect(function(){return(typeof window>"u"?"undefined":co(window))!==void 0&&kc&&(n(),window.addEventListener("load",n,!1),window.addEventListener("resize",n,!1)),function(){window.removeEventListener("resize",n,!1),window.removeEventListener("load",n,!1)}},[n]),i}function Hw(e){var t=e||window.navigator.userAgent;return ps(t)}function EE(e){var t=e||window.navigator.userAgent,i=Hw(t),a=Sw(i);return[a,i]}X.AndroidView=vE;X.BrowserTypes=Qt;X.BrowserView=kE;X.ConsoleView=LE;X.CustomView=ME;X.IEView=yE;X.IOSView=wE;X.MobileOnlyView=AE;X.MobileView=_E;X.OsTypes=Pr;X.SmartTVView=jE;X.TabletView=xE;X.WearableView=SE;X.WinPhoneView=zE;X.browserName=QC;X.browserVersion=JC;X.deviceDetect=RC;X.deviceType=rE;X.engineName=eE;X.engineVersion=tE;X.fullBrowserVersion=ZC;X.getSelectorsByUserAgent=bE;X.getUA=iE;X.isAndroid=Nw;X.isBrowser=Iw;X.isChrome=UC;X.isChromium=qC;X.isConsole=Pw;X.isDesktop=FC;X.isEdge=aE;X.isEdgeChromium=uE;X.isElectron=dE;X.isEmbedded=HC;X.isFirefox=BC;X.isIE=Rw;X.isIOS=Ow;X.isIOS13=oE;X.isIPad13=sE;X.isIPhone13=lE;X.isIPod13=cE;X.isLegacyEdge=pE;X.isMIUI=gE;X.isMacOs=hE;var Mn=X.isMobile=kc,ND=X.isMobileOnly=Ew;X.isMobileSafari=VC;X.isOpera=KC;X.isSafari=GC;X.isSamsungBrowser=fE;X.isSmartTV=Mw;X.isTablet=Tw;X.isWearable=Cw;X.isWinPhone=Dw;X.isWindows=mE;X.isYandex=nE;X.mobileModel=XC;X.mobileVendor=YC;X.osName=$C;X.osVersion=WC;X.parseUserAgent=ps;X.setUserAgent=EC;X.useDeviceData=Hw;X.useDeviceSelectors=EE;X.useMobileOrientation=CE;X.withOrientationChange=PE;function y0(){const e=!!E4("/settings/*"),{user:t}=hc();return t&&(t==null?void 0:t.role)==="default"?null:e?o.jsx("div",{className:"flex w-fit",children:o.jsx(Vt,{to:G.home(),className:"transition-all duration-300 p-2 rounded-full bg-theme-sidebar-footer-icon hover:bg-theme-sidebar-footer-icon-hover","aria-label":"Home","data-tooltip-id":"footer-item","data-tooltip-content":"Back to workspaces",children:o.jsx(Q1,{className:"h-5 w-5 text-white light:text-slate-800",weight:"fill"})})}):o.jsx("div",{className:"flex w-fit",children:o.jsx(Vt,{to:G.settings.interface(),className:"transition-all duration-300 p-2 rounded-full bg-theme-sidebar-footer-icon hover:bg-theme-sidebar-footer-icon-hover","aria-label":"Settings","data-tooltip-id":"footer-item","data-tooltip-content":"Open settings",children:o.jsx(Ay,{className:"h-5 w-5 text-white light:text-slate-800",weight:"fill"})})})}const Os={BookOpen:ym,DiscordLogo:ry,GithubLogo:wm,Envelope:cy,LinkSimple:gy,HouseLine:my,Globe:py,Briefcase:Y1,Info:nt};function w0(){const[e,t]=m.useState(!1),{enabled:i}=pt("documentationLink");return m.useEffect(()=>{async function a(){const{footerData:n}=await K.fetchCustomFooterIcons();t(n)}a()},[]),e===!1?null:!Array.isArray(e)||e.length===0?o.jsxs("div",{className:"flex justify-center mb-2",children:[o.jsxs("div",{className:"flex space-x-4",children:[o.jsx("div",{className:"flex w-fit",children:o.jsx(Vt,{to:G.github(),target:"_blank",rel:"noreferrer",className:"transition-all duration-300 p-2 rounded-full bg-theme-sidebar-footer-icon hover:bg-theme-sidebar-footer-icon-hover","aria-label":"Find us on GitHub","data-tooltip-id":"footer-item","data-tooltip-content":"View Source Code",children:o.jsx(wm,{weight:"fill",className:"h-5 w-5 text-white light:text-slate-800"})})}),i&&o.jsx("div",{className:"flex w-fit",children:o.jsx(Vt,{to:G.docs(),target:"_blank",rel:"noreferrer",className:"transition-all duration-300 p-2 rounded-full bg-theme-sidebar-footer-icon hover:bg-theme-sidebar-footer-icon-hover","aria-label":"Docs","data-tooltip-id":"footer-item","data-tooltip-content":"Open AnythingLLM help docs",children:o.jsx(ym,{weight:"fill",className:"h-5 w-5 text-white light:text-slate-800"})})}),!Mn&&o.jsx(y0,{})]}),o.jsx(lt,{id:"footer-item",place:"top",delayShow:300,className:"tooltip !text-xs z-99"})]}):o.jsxs("div",{className:"flex justify-center mb-2",children:[o.jsxs("div",{className:"flex space-x-4",children:[e.map((a,n)=>o.jsx("a",{href:a.url,target:"_blank",rel:"noreferrer",className:"transition-all duration-300 flex w-fit h-fit p-2 p-2 rounded-full bg-theme-sidebar-footer-icon hover:bg-theme-sidebar-footer-icon-hover hover:border-slate-100",children:c.createElement((Os==null?void 0:Os[a.icon])??Os.Info,{weight:"fill",className:"h-5 w-5",color:"var(--theme-sidebar-footer-icon-fill)"})},n)),!Mn&&o.jsx(y0,{})]}),o.jsx(lt,{id:"footer-item",place:"top",delayShow:300,className:"tooltip !text-xs z-99"})]})}function Vw({isActive:e,behavior:t,block:i}){const a=m.useRef(null);return m.useEffect(()=>{var n;e&&((n=a.current)==null||n.scrollIntoView({behavior:t,block:i}))},[e]),{ref:a}}function Bi({btnText:e,icon:t,href:i,childOptions:a=[],flex:n=!1,user:r=null,roles:s=[],hidden:l=!1,isChild:d=!1}){const u=NE({key:e}),h=ta(),g=a.length>0,p=IE(r,a),{isExpanded:v,setIsExpanded:f}=TE({storageKey:u,hasVisibleChildren:p,childOptions:a,location:h.pathname}),b=g?!v&&a.some(k=>Il(k.href,h.pathname))||h.pathname===i:Il(i,h.pathname),{ref:w}=Vw({isActive:b,behavior:"instant",block:"center"});if(l)return null;if(d){if(!n&&!s.includes(r==null?void 0:r.role)||n&&r&&!s.includes(r==null?void 0:r.role))return null}else if(!g&&(!n&&!s.includes(r==null?void 0:r.role)||n&&r&&!s.includes(r==null?void 0:r.role))||g&&!p)return null;const y=k=>{if(g){k.preventDefault();const _=!v;f(_),localStorage.setItem(u,JSON.stringify(_))}};return o.jsxs("div",{children:[o.jsxs("div",{className:`
|
|
1709
1709
|
flex items-center justify-between w-full
|
|
1710
1710
|
transition-all duration-300
|
|
@@ -1713,7 +1713,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1713
1713
|
`,children:[o.jsxs(Vt,{ref:w,to:i,className:`flex flex-grow items-center px-[12px] h-[32px] font-medium ${d?"hover:text-white":"text-white light:text-black"}`,onClick:g?y:void 0,children:[t,o.jsx("p",{className:`${d?"text-xs":"text-sm"} leading-loose whitespace-nowrap overflow-hidden ml-2 ${b?"text-white font-semibold":"text-white light:text-black"} ${!t&&"pl-5"}`,children:e})]}),g&&o.jsx("button",{onClick:y,className:"p-2 text-white",children:o.jsx(gc,{size:16,weight:"bold",className:`transition-transform text-white light:text-black ${v?"rotate-90":""}`})})]}),v&&g&&o.jsx("div",{className:"mt-1 rounded-r-lg w-full",children:a.map((k,_)=>o.jsx(Bi,{...k,user:r,isChild:!0},_))})]})}function TE({storageKey:e="",hasVisibleChildren:t=!1,childOptions:i=[],location:a=null}){const[n,r]=m.useState(()=>{if(t){const s=localStorage.getItem(e);return s!==null?Et(s,!1):i.some(l=>Il(l.href,a))}return!1});return m.useEffect(()=>{t&&i.some(l=>Il(l.href,a))&&!n&&(r(!0),localStorage.setItem(e,JSON.stringify(!0)))},[a]),{isExpanded:n,setIsExpanded:r}}function IE(e=null,t=[]){if(!Array.isArray(t)||(t==null?void 0:t.length)===0)return!1;function i({roles:a=[],user:n=null,flex:r=!1,hidden:s=!1}){return!(s||!r&&!a.includes(n==null?void 0:n.role)||r&&n&&!a.includes(n==null?void 0:n.role))}return t.some(a=>i({roles:a.roles,user:e,flex:a.flex,hidden:a.hidden}))}function NE({key:e=""}){return`anything_llm_menu_${e.replace(/\s+/g,"_").toLowerCase()}_expanded`}function DD({children:e}){const{loading:t,viewable:i}=qw();return t?o.jsx(_a,{}):i?o.jsx(o.Fragment,{children:e}):(window.location.href=G.home(),o.jsx(_a,{}))}function DE({children:e}){const{loading:t,viewable:i}=qw();return t?null:o.jsx(o.Fragment,{children:e({viewable:i})})}function qw(){const[e,t]=m.useState(!0),[i,a]=m.useState(!1);return m.useEffect(()=>{async function n(){const{viewable:r}=await K.fetchCanViewChatHistory();a(r),t(!1)}n()},[]),{loading:e,viewable:i}}function Fw(){const{t:e}=Qe(),{logo:t}=Ry(),{user:i}=hc(),a=m.useRef(null),[n,r]=m.useState(!1),[s,l]=m.useState(!1);return m.useEffect(()=>{function d(){n?setTimeout(()=>{l(!0)},300):l(!1)}d()},[n]),Mn?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"fixed top-0 left-0 right-0 z-10 flex justify-between items-center px-4 py-2 bg-theme-bg-sidebar light:bg-white text-theme-text-secondary shadow-lg h-16",children:[o.jsx("button",{onClick:()=>r(!0),className:"rounded-md p-2 flex items-center justify-center text-theme-text-secondary",children:o.jsx(fy,{className:"h-6 w-6"})}),o.jsx("div",{className:"flex items-center justify-center flex-grow",children:o.jsx("img",{src:t,alt:"Logo",className:"block mx-auto h-6 w-auto",style:{maxHeight:"40px",objectFit:"contain"}})}),o.jsx("div",{className:"w-12"})]}),o.jsxs("div",{style:{transform:n?"translateX(0vw)":"translateX(-100vw)"},className:"z-99 fixed top-0 left-0 transition-all duration-500 w-[100vw] h-[100vh]",children:[o.jsx("div",{className:`${s?"transition-all opacity-1":"transition-none opacity-0"} duration-500 fixed top-0 left-0 bg-theme-bg-secondary bg-opacity-75 w-screen h-screen`,onClick:()=>r(!1)}),o.jsx("div",{ref:a,className:"h-[100vh] fixed top-0 left-0 rounded-r-[26px] bg-theme-bg-sidebar w-[80%] p-[18px]",children:o.jsxs("div",{className:"w-full h-full flex flex-col overflow-x-hidden items-between",children:[o.jsxs("div",{className:"flex w-full items-center justify-between gap-x-4",children:[o.jsx("div",{className:"flex shrink-1 w-fit items-center justify-start",children:o.jsx("img",{src:t,alt:"Logo",className:"rounded w-full max-h-[40px]",style:{objectFit:"contain"}})}),o.jsx("div",{className:"flex gap-x-2 items-center text-slate-500 shrink-0",children:o.jsx("a",{href:G.home(),className:"transition-all duration-300 p-2 rounded-full text-white bg-theme-action-menu-bg hover:bg-theme-action-menu-item-hover hover:border-slate-100 hover:border-opacity-50 border-transparent border",children:o.jsx(_m,{className:"h-4 w-4"})})})]}),o.jsx("div",{className:"h-full flex flex-col w-full justify-between pt-4 overflow-y-scroll no-scroll",children:o.jsx("div",{className:"h-auto md:sidebar-items",children:o.jsx("div",{className:"flex flex-col gap-y-4 pb-[60px] overflow-y-scroll no-scroll",children:o.jsx(_0,{user:i,t:e})})})}),o.jsx("div",{className:"absolute bottom-2 left-0 right-0 pt-2 bg-theme-bg-sidebar bg-opacity-80 backdrop-filter backdrop-blur-md",children:o.jsx(w0,{})})]})})]})]}):o.jsx(o.Fragment,{children:o.jsxs("div",{children:[o.jsx(Vt,{to:G.home(),className:"flex shrink-0 max-w-[55%] items-center justify-start mx-[20.5px] my-[18px]",children:o.jsx("img",{src:t,alt:"Logo",className:"rounded max-h-[24px]",style:{objectFit:"contain"}})}),o.jsx("div",{ref:a,className:"transition-all duration-500 relative m-[16px] rounded-[16px] bg-theme-bg-sidebar border-[2px] border-theme-sidebar-border light:border-none min-w-[250px] p-[10px] h-[calc(100%-76px)]",children:o.jsxs("div",{className:"w-full h-full flex flex-col overflow-x-hidden items-between min-w-[235px]",children:[o.jsx("div",{className:"text-theme-text-secondary text-sm font-medium uppercase mt-[4px] mb-0 ml-2",children:e("settings.title")}),o.jsx("div",{className:"relative h-[calc(100%-60px)] flex flex-col w-full justify-between pt-[10px] overflow-y-scroll no-scroll",children:o.jsx("div",{className:"h-auto sidebar-items",children:o.jsx("div",{className:"flex flex-col gap-y-2 pb-[60px] overflow-y-scroll no-scroll",children:o.jsx(_0,{user:i,t:e})})})}),o.jsx("div",{className:"absolute bottom-0 left-0 right-0 pt-4 pb-3 rounded-b-[16px] bg-theme-bg-sidebar bg-opacity-80 backdrop-filter backdrop-blur-md z-10",children:o.jsx(w0,{})})]})})]})})}const _0=({user:e=null,t})=>{const{enabled:i}=pt("modelRouter"),{enabled:a}=pt("communityHub"),{enabled:n}=pt("brandingWhitelabel"),{enabled:r}=pt("multiUser"),{enabled:s}=pt("browserExtension"),{enabled:l}=pt("chatEmbed"),{enabled:d}=pt("scheduledJobs"),{enabled:u}=pt("developerApi"),{enabled:h}=pt("mobile"),g=pt("agentMode"),{enabled:p}=pt("vectorDB"),{enabled:v}=pt("embedder"),{enabled:f}=pt("textSplitter"),{enabled:b}=pt("transcription");return o.jsx(DE,{children:({viewable:w})=>o.jsxs(o.Fragment,{children:[o.jsx(Bi,{btnText:t("settings.ai-providers"),icon:o.jsx(uy,{className:"h-5 w-5 flex-shrink-0"}),user:e,childOptions:[{btnText:t("settings.llm"),href:G.settings.llmPreference(),flex:!0,roles:["admin"]},...p?[{btnText:t("settings.vector-database"),href:G.settings.vectorDatabase(),flex:!0,roles:["admin"]}]:[],...v?[{btnText:t("settings.embedder"),href:G.settings.embedder.modelPreference(),flex:!0,roles:["admin"]}]:[],...f?[{btnText:t("settings.text-splitting"),href:G.settings.embedder.chunkingPreference(),flex:!0,roles:["admin"]}]:[],{btnText:t("settings.voice-speech"),href:G.settings.audioPreference(),flex:!0,roles:["admin"]},...b?[{btnText:t("settings.transcription"),href:G.settings.transcriptionPreference(),flex:!0,roles:["admin"]}]:[],...i?[{btnText:t("settings.model-router"),href:G.settings.modelRouters(),flex:!0,roles:["admin"]}]:[]]}),o.jsx(Bi,{btnText:t("settings.admin"),icon:o.jsx(xy,{className:"h-5 w-5 flex-shrink-0"}),user:e,childOptions:[...r?[{btnText:t("settings.users"),href:G.settings.users(),roles:["admin","manager"]}]:[],{btnText:t("settings.workspaces"),href:G.settings.workspaces(),roles:["admin","manager"]},{hidden:!w,btnText:t("settings.workspace-chats"),href:G.settings.chats(),flex:!0,roles:["admin","manager"]},...r?[{btnText:t("settings.invites"),href:G.settings.invites(),roles:["admin","manager"]}]:[],{btnText:"Default System Prompt",href:G.settings.defaultSystemPrompt(),flex:!0,roles:["admin"]}]}),g.enabled&&o.jsx(Bi,{btnText:t("settings.agent-skills"),icon:o.jsx("img",{src:pC,alt:"Agent",className:"h-5 w-5 flex-shrink-0 light:invert"}),href:G.settings.agentSkills(),user:e,flex:!0,roles:["admin"]}),a&&o.jsx(Bi,{btnText:t("settings.community-hub.title"),icon:o.jsx("img",{src:mC,alt:"Community Hub",className:"h-5 w-5 flex-shrink-0 light:invert"}),user:e,childOptions:[{btnText:t("settings.community-hub.trending"),href:G.communityHub.trending(),flex:!0,roles:["admin"]},{btnText:t("settings.community-hub.your-account"),href:G.communityHub.authentication(),flex:!0,roles:["admin"]},{btnText:t("settings.community-hub.import-item"),href:G.communityHub.importItem(),flex:!0,roles:["admin"]}]}),o.jsx(Bi,{btnText:t("settings.customization"),icon:o.jsx(ky,{className:"h-5 w-5 flex-shrink-0"}),user:e,childOptions:[{btnText:t("settings.interface"),href:G.settings.interface(),flex:!0,roles:["admin","manager"]},...n?[{btnText:t("settings.branding"),href:G.settings.branding(),flex:!0,roles:["admin","manager"]}]:[],{btnText:t("settings.chat"),href:G.settings.chat(),flex:!0,roles:["admin","manager"]}]}),o.jsx(Bi,{btnText:t("settings.channels"),icon:o.jsx(wy,{className:"h-5 w-5 flex-shrink-0"}),user:e,childOptions:[{btnText:t("settings.available-channels.telegram"),href:G.settings.telegram(),flex:!0,hidden:!!e}]}),o.jsx(Bi,{btnText:t("settings.tools"),icon:o.jsx(_y,{className:"h-5 w-5 flex-shrink-0"}),user:e,childOptions:[...l?[{hidden:!w,btnText:t("settings.embeds"),href:G.settings.embedChatWidgets(),flex:!0,roles:["admin"]}]:[],{btnText:t("settings.event-logs"),href:G.settings.logs(),flex:!0,roles:["admin"]},...d?[{btnText:t("settings.scheduled-jobs"),href:G.settings.scheduledJobs(),flex:!0,hidden:!!e}]:[],...u?[{btnText:t("settings.api-keys"),href:G.settings.apiKeys(),flex:!0,roles:["admin"]}]:[],{btnText:t("settings.system-prompt-variables"),href:G.settings.systemPromptVariables(),flex:!0,roles:["admin"]},...s?[{btnText:t("settings.browser-extension"),href:G.settings.browserExtension(),flex:!0,roles:["admin","manager"]}]:[],...h?[{btnText:t("settings.mobile-app"),href:G.settings.mobile(),flex:!0,roles:["admin"]}]:[]]}),o.jsx(Bi,{btnText:t("settings.security"),icon:o.jsx(by,{className:"h-5 w-5 flex-shrink-0"}),href:G.settings.security(),user:e,flex:!0,roles:["admin","manager"],hidden:e==null?void 0:e.role}),o.jsx(OE,{children:o.jsx(Bi,{btnText:t("settings.experimental-features"),icon:o.jsx(dy,{className:"h-5 w-5 flex-shrink-0"}),href:G.settings.experimental(),user:e,flex:!0,roles:["admin"]})},"exp_features")]})})};function OE({children:e,holdForMs:t=3e3}){let i=null;const[a,n]=m.useState(window.localStorage.getItem("anythingllm_experimental_feature_preview_unlocked"));return m.useEffect(()=>{const r=l=>{!["Control","Meta"].includes(l.key)||i!==null||(i=setTimeout(()=>{n(!0),Se("Experimental feature previews unlocked!"),window.localStorage.setItem("anythingllm_experimental_feature_preview_unlocked","enabled"),window.removeEventListener("keypress",r),window.removeEventListener("keyup",s),clearTimeout(i)},t))},s=l=>{if(["Control","Meta"].includes(l.key)){if(a){window.removeEventListener("keypress",r),window.removeEventListener("keyup",s),clearTimeout(i);return}clearTimeout(i)}};return a||(window.addEventListener("keydown",r),window.addEventListener("keyup",s)),()=>{window.removeEventListener("keydown",r),window.removeEventListener("keyup",s)}},[]),a?e:null}const yc="/anything-llm.png",wc="/openai.png",_c="/generic-openai.png",xc="/azure.png",Tm="/anthropic.png",zc="/gemini.png",Ac="/ollama.png",Im="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAXgAAAF4CAYAAABeneKmAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAApvSURBVHgB7d3BdRTJFkXRQhZggkwBD/AITMIDLSwBE/CAD033B4SkynwVGRlxY+8JAyQNKu47SzO9+vbdBYA4dxcAIgk8QCiBBwgl8AChBB4glMADhBJ4gFACDxBK4AFCCTxAKIEHCCXwAKEEHiCUwAOEEniAUAIPEErgAUIJPEAogQcIJfAAoQQeIJTAA4QSeIBQAg8QSuABQgk8QCiBBwgl8AChBB4glMADhBJ4gFACDxBK4AFCCTxAKIEHCCXwAKEEHiCUwAOEEniAUAIPEErgAUIJPEAogQcIJfAAoQQeIJTAA4QSeIBQAg8QSuABQgk8QCiBBwgl8AChBB4glMADhBJ4gFACDxBK4AFCCTxAKIEHCCXwAKEEHiCUwAOEEniAUAIPEErgAUIJPEAogQcIJfAAoQQeIJTAA4QSeIBQAk/Zp0+fLl++fLkAYxJ4yj5//nx5+/atyMOgBJ6b/Ii7yMOYBJ6biTyMSeBpQuRhPAJPMyIPYxF4mhJ5GIfA05zIwxgEnkOIPJxP4DmMyMO5BJ5DiTycR+A5nMjDOQSeLkQe+hN4uhF56Evg6UrkoR+BpzuRhz4EnlOIPBxP4DmNyMOxBJ5TiTwcR+A5ncjDMQSeIYg8tCfwDEPkoS2BZygiD+0IPMMReWhD4BmSyMPtBJ5hiTzcRuAZmshDncAzPJGHGoFnCiIP+wk80xB52EfgmYrIw3YCz3REHrYReKYk8nCdwDMtkYeXCTxTE3l4nsAzPZGHpwk8EUQe/ibwxBB5+JPAE0Xk4ReBJ47Iw08CTySRB4EnmMizOoEnmsizMoEnnsizKoFnCSLPigSeZYg8qxF4liLyrETgWY7IswqBZ0kizwoEnmWJPOkEnqWJPMkEnuWJPKkEHi4iTyaBh3+JPGkEHn4j8iQReHhE5Ekh8PAEkSeBwMMzRJ7ZCTy8QOSZmcDDFSLPrAQeNhB5ZiTwsJHIMxuBhx1EnpkIPOwk8sxC4KFA5JmBwEORyDM6gYcbiDwjE3i4kcgzKoGHBkSeEQk8NCLyjEbgoSGRZyQCD42JPKMQeDiAyDMCgYeDiDxnE3g4kMhzJoGHg4k8ZxF46EDkOYPAQyciT28CDx2JPD0JPHQm8vQi8HACkacHgYeTiDxHE3g4kchzJIGHk4k8RxF4GIDIcwSBh0GIPK0JPAxE5GlJ4GEwIk8rAg8DEnlaePXtuwvsJEB93N/fXx4eHv75F/byGzy7iXs/PmtuIfDsIjj9+cypEng2E5rz+OypEHg2EZjzeQP2EniuEpZxeAv2EHheJCjj8SZsJfA8S0jG5W3YQuB5koCMzxtxjcDzF+GYh7fiJQLPHwRjPt6M5wg8/ycU8/J2PEXg+YdAzM8b8pjAIwxBvCW/E/jFCUIeb8p/BH5hQpDL2/KDwC9KAPJ5YwR+QQ5/Hd56bQK/GAe/Hm++LoFfiENfl7dfk8AvwoFjA+sR+AU4bP5jC2sR+HAOmsdsYh0CH8wh8xzbWIPAh3LAXGMj+QQ+kMNlK1vJJvBhHCx72UwugQ/iUKmynUwCH8KBcisbyiPwARwmrdhSFoGfnIOkNZvKIfATc4gcxbYyCPykHCBHs7H5CfyEHB692NrcBH4yDo7ebG5eAj8Rh8ZZbG9OAj8JB8bZbHA+Aj8Bh8UobHEuAj84B8VobHIeAj8wh8SobHMOAj8oB8TobHR8Aj8gh8MsbHVsAj8YB8NsbHZcAj8Qh8KsbHdMAj8IB8LsbHg8Aj8Ah0EKWx6LwJ/MQZDGpsch8CdyCKSy7TEI/EkcAOls/HwCfwLDZxW2fi6B78zgWY3Nn0fgOzJ0VmX75xD4Tgyc1bmB/gS+A8OGn9xCXwJ/sORBv379+gJ7iXw/An+g9CG/e/fu8v79+wvsJfJ9CPxBVhnwhw8fRJ5LhcgfT+APsNpwRZ4qkT+WwDe26mBFniqRP47AN7T6UEWeKpE/hsA3YqA/iTxVbqg9gW/AMP8k8lS5pbYE/kYG+TSRp8pNtSPwNzDEl4k8VW6rDYEvMsBtRJ4qN3Y7gS8wvH1Eniq3dhuB38ngakSeKjdXJ/A7GNptRJ4qt1cj8BsZWBsiT5Ub3E/gNzCstkSeKre4j8BfYVDHEHmq3OR2Av8CQzqWyFPlNrcR+GcYUB8iT5UbvU7gn2A4fYk8VW71ZQL/iMGcQ+SpcrPPE/jfGMq5RJ4qt/s0gf+XgYxB5Klyw38T+IthjEbkqXLLf1o+8AYxJpGnyk3/snTgDWFsIk+V2/5p2cAbwBxEnio3vmjgPfxcRJ6q1W99ucCL+5xEnqqVb36pwIv73ESeqlVvf5nAi3sGkadqxQYsEXhxzyLyVK3WgvjAi3smkadqpSZEB17cs4k8Vau0ITbw4r4GkadqhUZEBl7c1yLyVKW3Ii7w4r4mkacquRlRgRf3tYk8VantiAm8uPODyFOV2JCIwIs7vxN5qtJaMn3gxZ2niDxVSU2ZOvDizktEnqqUtkwbeHFnC5GnKqExUwZe3NlD5KmavTXTBV7cqRB5qmZuzlSBF3duIfJUzdqeaQIv7rQg8lTN2KApAi/utCTyVM3WouEDL+4cQeSpmqlJQwde3DmSyFM1S5uGDby404PIUzVDo4YMvLjTk8hTNXqrhgu8uHMGkadq5GYNFXhx50wiT9Wo7Rom8OLOCESeqhEbNkTgxZ2RiDxVo7Xs9MCLOyMSeapGatqpgRd3RibyVI3SttMCL+7MQOSpGqFxpwRe3JmJyFN1duu6B17cmZHIU3Vm87oGXtyZmchTdVb7ugVe3Ekg8lSd0cAugRd3kog8Vb1beHjgxZ1EIk9VzyYeGnhxJ5nIU9WrjYcFXtxZgchT1aORhwRe3FmJyFN1dCubB17cWZHIU3VkM5sGXtxZmchTdVQ7mwVe3EHkqTuioU0CL+7wi8hT1bqlNwde3OFvIk9Vy6beFHhxh+eJPFWt2loOvLjDdSJPVYvGlgIv7rCdyFN1a2t3B17cYT+Rp+qW5u4KvLhDnchTVW3v5sCLO9xO5KmqNHhT4MUd2hF5qva2+GrgxR3aE3mq9jT5rtUPAvYReaq2tvnu1h8A1Ik8VVsafVf9RqANkafqWqvv9n4D0J7IU/VSs++2fiFwLJGn6rl23137AqAfkafqqYbfPfcfwDlEnqrHLb8TdxiPyFP1e9NfPTw8fBN3Ku7v7y9v3ry5cJyPHz9evn79eoG9ftznq2/fXQCI0+yPbgMwFoEHCCXwAKEEHiCUwAOEEniAUAIPEErgAUIJPEAogQcIJfAAoQQeIJTAA4QSeIBQAg8QSuABQgk8QCiBBwgl8AChBB4glMADhBJ4gFACDxBK4AFCCTxAKIEHCCXwAKEEHiCUwAOEEniAUAIPEErgAUIJPEAogQcIJfAAoQQeIJTAA4QSeIBQAg8QSuABQgk8QCiBBwgl8AChBB4glMADhBJ4gFACDxBK4AFCCTxAKIEHCCXwAKEEHiCUwAOEEniAUAIPEErgAUIJPEAogQcIJfAAoQQeIJTAA4QSeIBQAg8QSuABQgk8QCiBBwgl8AChBB4glMADhBJ4gFD/Axqz7HhTEibjAAAAAElFTkSuQmCC",jc="/lmstudio.png",Lc="/localai.png",Nm="/togetherai.png",Dm="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAMCAgMCAgMDAwMEAwMEBQgFBQQEBQoHBwYIDAoMDAsKCwsNDhIQDQ4RDgsLEBYQERMUFRUVDA8XGBYUGBIUFRT/2wBDAQMEBAUEBQkFBQkUDQsNFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBT/wgARCADIAMgDASIAAhEBAxEB/8QAHAABAAMAAwEBAAAAAAAAAAAAAAYHCAECBQQD/8QAHAEBAAIDAQEBAAAAAAAAAAAAAAQGAgMFBwEI/9oADAMBAAIQAxAAAAGvR+hesAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAs+sPqh46kyjtzK9MjwvnibXeTfVOaNxdQ4vzD0SWAAAAAABI00vulx8WpDHrfI0H6dF7B83hYc0xR+u+lnTdAe/4Fl3pJ11hzcMnx21qp6+wOjkAAAAAvuhHOw2jk63rR8/i4w1TnT6bfI1LF/Jpapx41IONYWjf2qjvQXE1h6DKAAAAA7e772palox3xsXniascX5Zjm4RvH+msy2neFxkbBin7WT4xzsa87Id/bjnnYj4w7xPIH6BLCT9AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//EACYQAAIBAgUDBQEAAAAAAAAAAAQFBgADAQITFBUHEDAREhZAcBf/2gAIAQEAAQUC/UYFeGxZyONjGJ+8djYwSieXx+U+kMRnEIAMyMApcq4l3UPVcq8Ym5FoJF/OVf8APH1OLto8R30Rnbpu11RuoSrdqq6fKtmp6kNfZY7IkZD4x+pxStPJ0/ZiAHtlI7kN2kIRGVH2eKhvdt5Cx8EV35BbyWxB3rLFu1pGkIemKVI6YPqAzEPYeWGzHUpuoHdBukpCMyoO15JJw9nmp2149LSRKQ8MUKB0ocymPs+hDZjq04Tjuw3KYhIYgf34+X/SgNJ89vvzEqYh4YnTjpQ5lMdLy4YeuPx9nXAs64JlXBsaiDk/Pkk6u01T94yrtKlEvcn5MvCMa4JlXAs64BnWOHpj4IUvyGu9zZrc2q3FqtxarXt1LpUMGB3iMqGNA1rda9ute3W4tVuLVTRdlBd/sv8A/8QAJREAAQQBAwIHAAAAAAAAAAAAAQACAxESEyEiIFEQMDFCUGBh/9oACAEDAQE/AfmHCxShd7SiaFqK3HI+S6Qtf+IG1JwfkpnbUExuLaUkmHomElu/W5ocKKaTEaKe3UbsmRuJ5KSTBRx3yd1ySYmgtc9k6TMUQoQQN/A211uWuey1z2QNi/on/8QANREAAAUBAgoIBwEAAAAAAAAAAQIDBAUAITEGERITFEFRYaHwFiAjU3GBkbEQMDJQYMHR0v/aAAgBAgEBPwH7w8b6U3OjtrBp4fLUZrDbf/aXWK3SMse4KweKq8cqPFRu9x/nyX8yrHyGQoXssXIhSahFiAomOMBqWIMXJkeEuNb/AK531hK+DMEQTH67fLV6/qoppoTQiWu8fGpmZLHlzadqg8N9R6qi7VNRYMRhDn1679glIJZpXyHZTV04wfcaO5tTHnGFSrQJZn2A4xvCoyHeKuiKOy4ik27rgqYmCx5M2naoPDeNQ0OZY2nPbRG0AH3Hry02dgsCKRMrbXSlx3IcafzQyCWaVRDcOysGUl02xs7YAjZ8FBUZvjKOk8oceu7xrpSv3Ica6UuO6DjTdcrlEqxdf4J//8QAPRAAAgECAgQJCAkFAAAAAAAAAQIDAAQRMRIhQWEQEyIjM1FxkZMFIDAyNUJykhQVNEBwocHh8ENSgYKx/9oACAEBAAY/AvxRe0uYYpRMvI4xAcGFXC29rFHOo00MaAHEbPMt0uLWKScjScyICcTspbW2hiiWBeVxaAYsfucU8ZweNgwqG5j9SVQ1TIowik5xOw8EKsMYoudf/H71PcyerEul21JNIcXkYsx3/cIrXEhDrdhsWjDMMVOtJBkw4ZrBzyo+cTsOf5/9pbpRzlsdfwnP9OA3TDnLk4/6jL9ag8nodb85J2bP5u4RDCMEHryHJRU1rrKjWjHavpZY5+RLOAqSHLspre4XFTk21T1ijBMMRmkgyYcFvc+4Dg/w7aeNuXHIuB3g19V+/wAboY7uvu10qLgkUa4DcBVxde6zcn4dnAIYRgo1vIclFLb264KM22ses1FHBy5YAVeQZdnpksL9+VlFM23caa3uFxHusM1PWKME41Zo4yYcCIxxlt+bbs2fzdX1l/V4ri/3polOEtzzY7Nv838AggGAzeQ5KKW3t1wHvMc2PWaewsH5WUsy7Nw+4JYX78vKKZtu401vcL8LDNT10YJx8LjJhXGxDTRtTxn3hWP0e44z+3AYd+NcdLyFGpIxkooQQDeznJRS29uvxMc2PXT2Fi/LylmXZuHpcBrNezrrwWr2ddeC1ez7rwWr7BdeC1Cy8o2twrD1J3ibXuNXCOo00UvG3UR5kCIo03UPI3Waay8nWtwzHpJ0jOrcK+wXXgtXs+68Fq9nXfgtXs668FqwPoY3lIEUHOHS69ldKnzV0qfNXSJ81dIvfXSL31Na28qzXUq6HIOOgN/mQ208qxXUS6GDnDT3ivXXvrpF766Re+ukTvrpU+apGiIMU/ODR/P8Zv/EACkQAAEDAgQGAgMBAAAAAAAAAAEAESExUUFxgZEQYaHB8PEw0SBAcLH/2gAIAQEAAT8h/qM5Nyohg4xD7BPdOpUlAxDjX8GKn+qSoYU0Qs3RqIYsJYN1/TfZY+YLqmoQWeo0opGXy8QaFxpw2LUtQNWDdVSqy7Aalgue4xCLn9CUxayKp7aqlkzZrO441HVk3oaSSbdyzGLYXb8Iu2p6iLcXahVodoWwGpc6ONUBBvasEThLioGkHtmPlnfB0Jrs5bZVFIFkCXTxJgM0O44OoIZwxKOidEOEFhYAIutYc6gQAuwN9BFITCE4BAbcKKYJmjzsFUGA2YJdT4g6UwN2nf5uW2Y0HvYpwASlh5wUFnh9YcJm3NUhXtGpAZMnC0V6mjJTZiCt/aOBlwQGeP1imADKGOc0Y1Hvc/oN8JmNJ72OOdXAArosXOfjZ4fSMRB39h2CMCjDxedeGCYOAX1+4NymToo2eP0mEAE6rFznjGs97nD/AD5CCASFgBivFOy8m7JvzuiZwvCyEo9hwDdIrzxzqUgx6DP1ofwC+Y0DhztQIZCWKwF0CvPDOj/kdE553RPeF0Xm3ZEMBiIIPw1XH4AEKd50K9WXpC9EXo69bRqIGMCQSQxag/AHNkAAQCGpaoXqq9DXra9FTf0FU+VnAJp3c6j+zf/aAAwDAQACAAMAAAAQ/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A5QrC/wD/AP8A/wD/AP8AC+Lp0mW//wD/AP8A/wDRLu9Fv/8A/wD/AP2LQ1/0OS/v/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP/EACARAQACAQQCAwAAAAAAAAAAAAEAEUEQITAxIFBgofD/2gAIAQMBAT8Q9xbw1sCZYhTwlaSAFkCYz+Zt80qoIV2gB7cGjD+F9CAUbEAUdxF561F6J4BjhpYhbqkRDPwT/8QAJxEBAAEDAwMDBQEAAAAAAAAAAREAITFBUZFhcYEgwfAQMFBgsdH/2gAIAQIBAT8Q/MRAwlhxDkeYoiCDCW4lhfwx3rH4q+NO7gp66JgljIwYs06n2RrJAxd1W6TCdNGGjACkTUoub3LA8jNGz6xxqb8lygukR8i7xjsUlcBY0G7rsa5bZegBM2XSY5efWlD+i3Pc1p6SibYj5ye9DUAh5s7k9TfWJxSAocWX0BtN3SJqfACxoPhBr2ofKjUF+EHltHrFAomU2nBbpd7lbvJRfZrgsrctyYeKZgyhe10Nm3C/SL9piUmbYXNjGNorb5P8Vs81MQhHtOTw2/RP/8QAKRABAAEEAQIFBAMBAAAAAAAAAREAITFRYUGBEDBxwfAgQJGxcKHR4f/aAAgBAQABPxD+UZUFnkLIaBZ7aNg4FaAFigxIenjmgsBvGolG1I4u3UFgzycSFCHfC/Z+Ki5mE8SXKS+ZDSsXeVK5GsTkYQHUeBI0N+FxCXCUwvuRjTpTREinCBZ5QOUpK7gdST8v2AWWBiBkpkFsJG4q76CAn4aEhkHYi+Fxhal2IXCFOSrMXQepBwB4cxVYuCHc5DRVnACFxVfA+IWSlcL3LtQmRdAoR3zyBlRApdQRJ5pwhVxGl5FFWFJa09AtJI/AD8JIyNXVXWE/sJYyDsRagHH2RvWFA2KGHXmVgw6Ro0+v83Dr+qgYGSxES+j+ip9RejXdGAvK78LJyJGf3FCZF0CnQZyV5yC/AQEAVAKTczh5DejAsvePNhfoLlTsXOG8LifuAg2TomsJI2auhYkJdtTvJdlq04BKxT6dsurRhLttdff6NVxxxVkZ9Kzt+FlKlDLvuW4ZLiUwHzQwbp1XWAgLFR/0FwJ2DjBeU87FBEh7MVO1ODg0mIMnFnZd7MJZqVYXcXdn/eQ2eQORUDMlybpsMS2RRHMeoHgyRzdxSifcknMS5G8BNrAAQqiFF3d/1kttpgYLixuu9GAsV/nKQE7Q4F5fNH/EHKnAHVpD2Kqdfcg/WvLmcV4Rd0NOjQmG6ODRkQZL9EPQh6DsPoMwLS35HqS4AOamBNH46cUNy6GTScszXMJPSmYFXE9ymkByBCJkTyQT1MogXcsyGqhMJ8918996+c+9CYX5br49707iWci2YJEkmUYg+hAmsZMUAQHUkWIqxNvf/SviHvXx73pDIfPdOYPr/rQeHnFO4cIYOh/M1//Z",Sc="/mistral.jpeg",Om="/huggingface.png",Rm="/perplexity.png",Mc="/openrouter.jpeg",Hm="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMkAAADJCAMAAAC+GOY3AAAAQlBMVEX1TzX1TzX1TzX1TzX1TzX2WkL4e2j6p5r7sqf9083+9PL////+6eb5kYH4hnT7vbP3cFv8yMD93tn2ZU75nI31TzW9T89eAAAABXRSTlOPv2CAQLFEbcUAAAUSSURBVHic7ZzrmqMgDIbnsIra2mpb7/9Wt4c5dElQMGH57JPv90zlFXKQQN7e3l9DH2/v02vo00jgZCR4MhI8GQmejARPRoInI8GTkeDJSPBkJHgyEjwZCZ6MBE9GgicjwZOR4MlI8GQkeDKSKFW1a9q22920b1vX1/melY+kOhz3O6rWDXmel4vkMDIUX9o3WWBykFSuC3PcderVH5qBpDouYDwmRp1Fm2R5Pn5YDqoP1iapOSsPqT1rPlqVpGoSOK7qNJeYJsmQMiEPHSu1pyuS9LEW8qyTmkfWI3ErOK7qtFDUSKJ8L4ui5MO0SFaDXKVj90okEhClBaZDcpGAKKGokBxkINd4r+CMNUjOYffbja5+vPD64NowSisehArJKYRB0vdwsu/Eo1AgCQQSPts9hzJMsanISQZ+Pi6hvw9k/SfhMBRI2LU1zpkwnzBL15eYpOdGFZyQh9hp6YT+S0zCvN+I8MDZ1lE2ECkJMyVRcY6bStmHl5SETklkwGZQGtFIhCTMeGJ356ityCxFSELDdrwLok5PlBTLSM5kMAlpB01yRDFFRkJz4BSrlf23LxkJWSBp4Y24i4U4NCsRCVlciTZbay4vEQnxXKkZB5kUgfcSkRBHmrrOyasQFFhEJP4rHVN/oJJO6pNEJP440uOB/+Ul+HaUkBCDTXei/vLarx6MiMTfiFgxDPKZtnowIhI/NU82k4ku0PWxUZNkjbn6idt65yUh8Z3wmgiNQaIxCn9ejcRIHnodEj9Ar7F4DBINL4xJsiYyYpBoJE0YJAoZJAiJQlaPQiL+0oIhEX/9wpCQDat0PwxCIt0lmmBI6C5P8qSgkJDzXF2qpaCQ0Gpp6uYICglTOUhMI2FImEpQWmEdhmSi5wTSjtPgkDBF3CQUHJKKObyRgoJDwh7tSjgQCETCHS3Y7ZrYYI9EQr5S7oo9a45EQgP9Q23UoKBIqtBJtf1lOXeBIpmG8OnBU7NwowmLhD8ZFdbzaMFIQqayQZK0k8/QJEko2CQpKOAkCSjoJPEeDJ5kqiMvBeGTTNXMzdJtkUTe1doESdRFwG2QTNN50YltheTGMr/GtkNyXWN9KNPfGslV534MzczzaP2lCEhy09C77+YLodFinFvRkL8Kt0viz9f6XypMQjZm1v9UYRLfdRU60akg30wE94LKkpBCpeBgfVkSkqQJbjUWJSEb/Z3gx4qSkOKL5PpcSRJae5FcbypJQtN/yZWzgiT0Vr3obmY5EuZWvai9VzESplYhuOgwlSPhii6yHh8ZSIZ22XA5ENmUZCAZuuUyNlsGE7ZdUSe5F7gWmkCxm5XSpgXaJN+VupmmBYEtMWlfQmWS35Jj5wIsPd8bS3alfNIm+ad2yrFUAQ6F3jGqJKQIPPbPdeyqD2/pyXteqvZU48a5b52r69q5cW4zT3J1+UuKJDNl+SUJm2HcpUciADlpdLtTIykNokcy0wjqv4AUqf1mAdG0+HUosx2MUqTphRMP4twlDu0/0o2MqU06tToo3qSbrUSWsb+l2gJWOxdOaGar2v81x5dWZIPhYK68Vhm+fmOaJXeNam/hm7LsSMyXfm9HPZXn46ZceytDEzKYTK3Rc+4SnXvSsX4/XnK1q8++31UfnHNt2zbOHeoMa+pXpWu/ejISPBkJnowET0aCJyPBk5HgyUjwZCR4MhI8GQmejARPRoInI8GTkeDJSPBkJHgyEjwZCZ5eieTj8zX05y/Z/fRFIEbR7gAAAABJRU5ErkJggg==",Vm="/koboldcpp.png",qm="/text-generation-webui.png",Pc="/cohere.png",Cc="/litellm.png",Fm="/bedrock.png",Um="/deepseek.png",Bm="/apipie.png",Gm="/xai.png",Km="/zai.png",Wm="/nvidia-nim.png",$m="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMEAAADACAYAAAC9Hgc5AAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAA2bSURBVHgB7Z0/bFRXFsbvrLZZVjKFaU0LBZFilzuWUrlYWwotg5aGLUgEtEYiDU2Q7DaOli2gQWJobQmncBXJQ2lHSlaKW0+5uABpSfl2vvd8Y2eYsT3zzr3v3Hu+n+RgJ1LwvHe/e/7cc+5puQHFAEeIUf7kCDEORUDMQxEQ81AExDwUATEPRUDMQxEQ81AExDwUATEPRUDMQxEQ81AExDwUATEPRUDMQxEQ81AExDwUATEPRUDMQxEQ81AExDwUATEPRUDMQxEQ81AExDwUATEPRUDMQxEQ81AExDwUATEPRUDMQxEQ8/zZkSAcvnPu50Pn+keF6w++f/+x+neHRyf/fRRXrxz/Oevc5UvVz3P4mm2V33921RFhWvgHh3TUAwv8zZ5z/+kXbvfXaqHj34Vi8Volhr9da5V/euGQ6aAIpgALHLv8D/uFe7M/flePBUQAYfx9vuVWFhyZEIpgArDLv+5VCz/kTl8HuFAr8xTEJFAE54BdvjtY+M929C78cXgLsXqzRZfpDCiCMWDXX98c+PgHLgsghntLtA6joAiGyG3xDwOL8Oimc512y5EKiuCY3Bf/MBTDCeZFAJ//wXM7i38YuEkb/7QdM5gVAYLcZzuFW9t0ZMDXS1UAjeySNUyKAK7PgxdF4/l9bVh1kUyJALv/2maV7iTjsWYVzIgAu/6X69z9LwqswtaqjVjBhAhw2PW4m95hlwaedpz7ailv9yh7ETzu0v2pC+KERzfzFUK2IsCuj9Qn6nxIfZBKffkwzzghSxHA77+zUZSVnkSOXOOE7ETAADgsOQohKxFoFUDZITZbNcLMXKp+RqfYMO9/c+7Dx6J05dCNVnan9Z06chNCNiLQJAD4zzcGC74t1PkFtw6fq3dQuN6vOoSRkxCyEEHTAsDO/tmcc7faValy6OARnxOn3r6zrSlyEULyIoDr8MWTZgRQtjQutNzttmssa+IFsb7VzDOAAH58knbWKHkR3Pku/m7ou7UWrztVQAw4GOz2XFTwPLYepXuOkLQIUAcUswpU6+IfBhYBzyamGFBv9G0nTSEkKwKUQaMUIgapLP5hcA3MN6/juUmpllgkKQK8VMQBoWuB4OeiXOCrJZc0sJawDKHB80KgnNoFYUmK4PPV8Ltbbh1XsTJoKQbKyd1FioK40C8SJh2BXk6novgsP623ghfC4d2sb6blXSdlCZD9wG4WCuxeG3fzv5bk1W4VK4R0J+EWpRJDJSOC0OcBlppIQGj3KCW3KBl3CNkgCkCO0J85JbcoCUuAB4pgOAQWBXCa0BYB1kB7tigJS/BNlwIIRehnEOrdSaJeBN3dMGURFMAJIZ8FLjVDQkMz6kWwtuXE8Yc6FMAJXgghAlntsYFqEcAKhPBVkQalAD4FzwTPRhrt1kB1YBziZBiHRbg9oUkO3518eS5fOvlqOpAMUWahudJU7eC+cvaXsAD8NYMxwfkGPsvbg2qe2UW7wtCkAzFg4gwOnWLm2/GM0MEmeUmxtwYaD9DUWoIv12RvisYiQroulhvkr3rHopc4mcUIpuWFePeEhihS1GoNVIogxLnA006calDEMajjD3XVe8xLc/+1I5/i1FhOoTIwls4mYOGEFkBZ1zSwXvdfuKCzDrBB3H9ebRLbe2H3LjTKYPeWZHtfX/ipUgTSi+jlg7C7Jipbceoac9AHxPCPjWqnDlkItypcdQorqe1OWHUiwE4hGRB32uGyLd5vbvKuU7gsIQsL4bogHpHCz4DWhD4R7DlRQtXP40Vi99fwQr0YQ/0u0r3D3be6XCJ1IpAskYAVCJEN8gLQdNOdLzV/FaC5Hs8Qz1IKbHSaXCJVIkBwKflwQjR9ewFonXWAm7hDCEEyG6XNJVIlgtc9OTOJrIZ0LOBvu9Y+7COEEBAbSGaKNGWJdFkCwezKrUV5K5DSbdchhHBP0LJuK5oboUYEw7U0dZHMaADU0qQiAI+0ECTLN6Tfdx3UiOCXvpx57AjfDVrd6OaSRFIIeKaSATJu2daAGhFIltq2r8u6QiFvuIiBpBCW5+WerZbgWI8lEHwgkq5QqJ6G2EgJAckGKSvbi3jCfhZ6LIHQA0EGQ9IVCtHZ1hQSQvCzGCRgTHAKSbN4QzAtKl3CoQEJISwLXU6GVLOG56tCBJJ5d4xIkqK767KkrhBuzOUVF6gQgWRmSKpWHcLMeQZyHSFIHkL2j5pPOqgQgZRJ9D26EmhJ34UEQpgmK1dO4xSqyaI7dExf6EFIBWxAuppVK9MOPZd61hhb2zRZxQQzglkhjfODQ4BnP01J+JyQJej/1zWODnfoyIkg6atqa/wIyTRCECufEHr3dUhuSMdZSL0YSwLwTCqEq7MuG7ILjCXQXiodimldozowMFZK/13+maFxXFQIc1fSnVs8TFYimPlLPi+mSZqwCE3CmICMxJIQ6A4ZY5JDLitCoAhGcPmvLltwhePtCRpjxgnhw2/5xE0qRKBtVoBkgZg25mZb5ZDyukJ4/z8ngoZ3T0swgpxjC3+gWFcIGg65pNBhCZQdvEgWiGliuMCwjhCkzlI0vHsVQzrKOhQlrXae9jU9nU9SjCp6gxCcu3hZtReClLWcUWB1VVgCje6H9JXkGhjXETaNRZDaIBgTHKPR9VheyC84PuumiEmFIAVFcIxGEcA65WQNEBCf95ybEIKGTJwKEWhNSd5byscaXPSzQAgxxa/BFVZjCTTGBSsLeaRL8XwnWdgvH7ZEu/TOoulxtUDNOUGshz4pMYb9hQbXqk/ickL4mDIZ+p1ocTfViOCGgh1hFJh0k/KZwbQDNmIIQcs7pyW4ABt3040NVmuIOLQQJO+IqoMaEWhOSeIuoybSh3WBu1H39w4pBA3xAFAjAu2lChhel5JbhN+1Og2uTwgh4PfT8jxVFdAtCw/WkAQLAfOQU8kWwYWTXGTlRbyCO3db0RmMMhHo9r2xCL69pT8+QDAvdR2lB2USklNvJAcB1kWVCCTvvg/F7UXdgTIEgMYZadY35ZpoytN4YZHWQZUI8HA0u0QerUJ42gkjAGkroO0dq2uq0WQmzwJC+PGJjmC5DFxXW8EO9iStANDm9qoTgeSExNDAfcPi6zSYPkUaFGIM5V5IWwFsGitCQz6kUNlemVKpAl7q94NUpHQ25jywUcD9Qeoy5N8rbQU0ZYU8SkWQ3gkt3CNYhdBlFlj8+Dt+Wm8F3ywwtFB6IDh+d22oaK8cxtfy7ypruTwPLH4EpohrMPxifasQ7cDC/xcLP4a7WM5uFh5aiHeq8cBRpQgAal52E50fjBcNy3B7sVU2pUPMP+wV5cyDizao+ymRmMkMFyJ2ShFukHSP9apCKwDUigAvPUVrMAyCZ3x9fezi+ZsaIIgPH/8octwJ5E9mm9wxn+3Iu0FlT4Ois4HTqBUBSNkajMOXHlQLQt/OWLpBm04crVYAqL58y1sDEgcIANepSM9nKN1DxVW46m+g07yD5AQWPob4hbhrSfs7VC8CWoM43PkuzO3TK/P6ezGSuIsUdfGcPRCO+5hnHCgBgT4M7SQhAviUOTS8a6O8UnGtcF3hTJAnlf7sZG6lxilyjpfkNoUPgkNZgJQ2rmREAHco5YZ3TXgBhJxAg3eVigub1HwCBMkxdpecR7h2e4X74kkR9MZtWG2tB2OjSG5IB/zM0NezbO8V7sHzsAslNhD2424xCILDihxu0NOOS4rkRFA2vD8Mb2pRNgCXATtn6qCYD7v/sx0XFN/ckxpJjmvCbhOj4R2WADtnqlYBvzPy/xBzjN8/1dv6kp1ZhirNWLXpsAqfrxZubTMNMcDdwe+K3f/NvosC3kWqaWzVBXTngdr9vnD731mgsAzuERrFNaZssfhRAQq3J2Zwj+cRosE/FkmLAOBE8ufDqlY/BrAEWGRYbCgHuNVuPhMCn/91r9r1Y2e2fHtpyiQvAn9FIEx/bGCBXg0WX9k8Pl8JItb9mlj4vYPqtLcpFw2fG4Fw6iUtpYSLAS5xsBCwC0osQvTW3n/hpsIPxGhfrybwSIkCnw8L/+1BMzv+MF4AOZziZyMCSeqIYBjfJok/cR8/usdOLxz/PRb16a/+UVHGOzjVxeBsTQd4OQkAJO8OaQeL19fnVJmatPeb3AQAkk2Rkvj4y8ZyK2SkJSAXAmnQ7zPt66AIyLngTCS1eqBJoAjIWPxVj50ER1VNAkVARpJjADwOioB8AtwflEFY6eumCMjvlMP+7qbVECMBRUBKfBWoxVs9KALjoMQDV9pYvsSAIjAKFv/qTXuuzygoAmNw8X8KC+jGgIrNf+/E68wKDRf/eCiCc6iuKi9c78Al12eMIBfpThx28eKy8VAEE/Bmz7nt/WLwpfduIix83+DDXf9iUARTAncJ/ca/HLporZ3jwC6PAjfMB0alJy8vngyKQIDD4+YXtDt6UYSyFFjgV2dPOtcwE5iLvh4UQSBOzybrv6u6xPAzusTAuPjC++5Y6Ph+ZrDA5660yp+bnmWWKxQBMQ87y4h5KAJiHoqAmIciIOahCIh5KAJiHoqAmIciIOahCIh5KAJiHoqAmIciIOahCIh5KAJiHoqAmIciIOahCIh5KAJiHoqAmIciIOahCIh5KAJiHoqAmIciIOahCIh5KAJiHoqAmIciIOahCIh5KAJiHoqAmOf/mYyphIV9A0sAAAAASUVORK5CYII=",Zm="/dpais.png",Jm="/moonshotai.png",Qm="/cometapi.png",Uw="/foundry-local.png",Ym="/giteeai.png",Xm="/docker-model-runner.png",eh="/privatemode.png",th="/sambanova.png",Ec="/lemonade.png",ih="/minimax.png",ah="/cerebras.png";function RE({settings:e}){const{t}=Qe(),{enabled:i}=pt("modelRouter"),[a,n]=m.useState([]),[r,s]=m.useState(!0);return m.useEffect(()=>{if(!i)return;async function l(){const d=await uC.getAll();n(d),s(!1)}l()},[i]),i?r?o.jsx("div",{className:"w-full flex flex-col gap-y-4",children:o.jsx("p",{className:"text-sm text-white text-opacity-60",children:t("model-router.router-selection.loading-routers")})}):a.length===0?o.jsx("div",{className:"w-full flex flex-col gap-y-4",children:o.jsxs("p",{className:"text-sm text-white text-opacity-60",children:[t("model-router.router-selection.no-routers-prefix-settings")," ",o.jsx(Vt,{to:G.settings.modelRouters(),className:"underline text-white",children:t("model-router.router-selection.no-routers-link")}),"."]})}):o.jsx("div",{className:"w-full flex flex-col gap-y-4",children:o.jsx("div",{className:"w-full flex items-center gap-[36px]",children:o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:t("model-router.router-selection.model-router-label")}),o.jsxs("select",{name:"ModelRouterId",defaultValue:(e==null?void 0:e.ModelRouterId)||"",className:"border-none bg-theme-settings-input-bg text-white text-sm rounded-lg block w-full p-2.5",required:!0,children:[o.jsx("option",{value:"",children:t("model-router.router-selection.select-router")}),a.map(l=>o.jsx("option",{value:l.id,children:l.name},l.id))]})]})})}):null}function Bw({settings:e}){const[t,i]=m.useState(e==null?void 0:e.OpenAiKey),[a,n]=m.useState(e==null?void 0:e.OpenAiKey);return o.jsxs("div",{className:"flex gap-[36px] mt-1.5",children:[o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"API Key"}),o.jsx("input",{type:"password",name:"OpenAiKey",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"OpenAI API Key",defaultValue:e!=null&&e.OpenAiKey?"*".repeat(20):"",required:!0,autoComplete:"off",spellCheck:!1,onChange:r=>i(r.target.value),onBlur:()=>n(t)})]}),!(e!=null&&e.credentialsOnly)&&o.jsx(HE,{settings:e,apiKey:a})]})}function HE({apiKey:e,settings:t}){const[i,a]=m.useState({}),[n,r]=m.useState(!0);return m.useEffect(()=>{async function s(){r(!0);const{models:l}=await K.customModels("openai",typeof e=="boolean"?null:e);if((l==null?void 0:l.length)>0){const d=l.reduce((u,h)=>(u[h.organization]=u[h.organization]||[],u[h.organization].push(h),u),{});a(d)}r(!1)}s()},[e]),n?o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Chat Model Selection"}),o.jsx("select",{name:"OpenAiModelPref",disabled:!0,className:"border-none bg-theme-settings-input-bg border-gray-500 text-white text-sm rounded-lg block w-full p-2.5",children:o.jsx("option",{disabled:!0,selected:!0,children:"-- loading available models --"})})]}):o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Chat Model Selection"}),o.jsx("select",{name:"OpenAiModelPref",required:!0,className:"border-none bg-theme-settings-input-bg border-gray-500 text-white text-sm rounded-lg block w-full p-2.5",children:Object.keys(i).sort().map(s=>o.jsx("optgroup",{label:s,children:i[s].map(l=>o.jsx("option",{value:l.id,selected:(t==null?void 0:t.OpenAiModelPref)===l.id,children:l.name},l.id))},s))})]})}function Gw({settings:e}){return o.jsxs("div",{className:"flex flex-col gap-y-7",children:[o.jsxs("div",{className:"flex gap-[36px] mt-1.5 flex-wrap",children:[o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Base URL"}),o.jsx("input",{type:"url",name:"GenericOpenAiBasePath",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"eg: https://proxy.openai.com",defaultValue:e==null?void 0:e.GenericOpenAiBasePath,required:!0,autoComplete:"off",spellCheck:!1})]}),o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"API Key"}),o.jsx("input",{type:"password",name:"GenericOpenAiKey",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"Generic service API Key",defaultValue:e!=null&&e.GenericOpenAiKey?"*".repeat(20):"",required:!1,autoComplete:"off",spellCheck:!1})]}),o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Chat Model Name"}),o.jsx("input",{type:"text",name:"GenericOpenAiModelPref",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"Model id used for chat requests",defaultValue:e==null?void 0:e.GenericOpenAiModelPref,required:!0,autoComplete:"off"})]})]}),o.jsxs("div",{className:"flex gap-[36px] flex-wrap",children:[o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Model context window"}),o.jsx("input",{type:"number",name:"GenericOpenAiTokenLimit",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"Content window limit (eg: 4096)",min:1,onScroll:t=>t.target.blur(),defaultValue:e==null?void 0:e.GenericOpenAiTokenLimit,required:!0,autoComplete:"off"})]}),o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Max Tokens"}),o.jsx("input",{type:"number",name:"GenericOpenAiMaxTokens",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"Max tokens per request (eg: 1024)",min:1,defaultValue:(e==null?void 0:e.GenericOpenAiMaxTokens)||1024,required:!0,autoComplete:"off"})]})]})]})}function Kw({settings:e}){const{t}=Qe();return o.jsxs("div",{className:"w-full flex flex-col gap-y-7 mt-1.5",children:[o.jsxs("div",{className:"w-full flex items-center gap-[36px]",children:[o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:t("llm.providers.azure_openai.azure_service_endpoint")}),o.jsx("input",{type:"url",name:"AzureOpenAiEndpoint",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"https://my-azure.openai.azure.com",defaultValue:e==null?void 0:e.AzureOpenAiEndpoint,required:!0,autoComplete:"off",spellCheck:!1})]}),o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:t("llm.providers.azure_openai.api_key")}),o.jsx("input",{type:"password",name:"AzureOpenAiKey",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"Azure OpenAI API Key",defaultValue:e!=null&&e.AzureOpenAiKey?"*".repeat(20):"",required:!0,autoComplete:"off",spellCheck:!1})]}),o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:t("llm.providers.azure_openai.chat_deployment_name")}),o.jsx("input",{type:"text",name:"AzureOpenAiModelPref",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"Azure OpenAI chat model deployment name",defaultValue:e==null?void 0:e.AzureOpenAiModelPref,required:!0,autoComplete:"off",spellCheck:!1})]})]}),o.jsxs("div",{className:"w-full flex items-center gap-[36px]",children:[o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:t("llm.providers.azure_openai.chat_model_token_limit")}),o.jsxs("select",{name:"AzureOpenAiTokenLimit",defaultValue:(e==null?void 0:e.AzureOpenAiTokenLimit)||4096,className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",required:!0,children:[o.jsx("option",{value:4096,children:"4,096 (gpt-3.5-turbo)"}),o.jsx("option",{value:16384,children:"16,384 (gpt-3.5-16k)"}),o.jsx("option",{value:8192,children:"8,192 (gpt-4)"}),o.jsx("option",{value:32768,children:"32,768 (gpt-4-32k)"}),o.jsx("option",{value:128e3,children:"128,000 (gpt-4-turbo,gpt-4o,gpt-4o-mini,o1-mini)"}),o.jsx("option",{value:2e5,children:"200,000 (o1,o1-pro,o3-mini)"}),o.jsx("option",{value:1047576,children:"1,047,576 (gpt-4.1)"})]})]}),o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsxs("div",{className:"flex items-center gap-1 mb-3",children:[o.jsx("label",{className:"text-white text-sm font-semibold block",children:t("llm.providers.azure_openai.model_type")}),o.jsx(lt,{id:"azure-openai-model-type",place:"top",delayShow:300,className:"tooltip !text-xs !opacity-100",style:{maxWidth:"250px",whiteSpace:"normal",wordWrap:"break-word"}}),o.jsx("div",{type:"button",className:"text-theme-text-secondary cursor-pointer hover:bg-theme-bg-primary flex items-center justify-center rounded-full","data-tooltip-id":"azure-openai-model-type","data-tooltip-place":"top","data-tooltip-content":t("llm.providers.azure_openai.model_type_tooltip"),children:o.jsx(nt,{size:18,className:"text-theme-text-secondary"})})]}),o.jsxs("select",{name:"AzureOpenAiModelType",defaultValue:(e==null?void 0:e.AzureOpenAiModelType)||"default",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",required:!0,children:[o.jsx("option",{value:"default",children:t("llm.providers.azure_openai.default")}),o.jsx("option",{value:"reasoning",children:t("llm.providers.azure_openai.reasoning")})]})]})]})]})}function Ww({settings:e}){const[t,i]=m.useState(!1),[a,n]=m.useState(e==null?void 0:e.AnthropicApiKey),[r,s]=m.useState(e==null?void 0:e.AnthropicApiKey);return o.jsxs("div",{className:"w-full flex flex-col",children:[o.jsxs("div",{className:"w-full flex items-center gap-[36px] mt-1.5",children:[o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Anthropic API Key"}),o.jsx("input",{type:"password",name:"AnthropicApiKey",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"Anthropic API Key",defaultValue:e!=null&&e.AnthropicApiKey?"*".repeat(20):"",required:!0,autoComplete:"off",spellCheck:!1,onChange:l=>n(l.target.value),onBlur:()=>s(a)})]}),!(e!=null&&e.credentialsOnly)&&o.jsx(VE,{apiKey:r,settings:e})]}),o.jsx("div",{className:"flex justify-start mt-4",children:o.jsxs("button",{onClick:l=>{l.preventDefault(),i(!t)},className:"border-none text-theme-text-primary hover:text-theme-text-secondary flex items-center text-sm",children:[t?"Hide":"Show"," advanced settings",t?o.jsx(aa,{size:14,className:"ml-1"}):o.jsx(Ri,{size:14,className:"ml-1"})]})}),o.jsx("div",{hidden:!t,children:o.jsx("div",{className:"w-full flex items-start gap-4 mt-1.5",children:o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("div",{className:"flex justify-between items-center mb-2",children:o.jsx("label",{className:"text-white text-sm font-semibold",children:"Prompt Caching"})}),o.jsxs("select",{name:"AnthropicCacheControl",className:"border-none bg-theme-settings-input-bg border-gray-500 text-white text-sm rounded-lg block w-full p-2.5",children:[o.jsx("option",{value:"none",selected:(e==null?void 0:e.AnthropicCacheControl)==="none",children:"No caching"}),o.jsx("option",{value:"5m",selected:(e==null?void 0:e.AnthropicCacheControl)==="5m",children:"5 minutes"}),o.jsx("option",{value:"1h",selected:(e==null?void 0:e.AnthropicCacheControl)==="1h",children:"1 hour"})]})]})})})]})}function VE({apiKey:e,settings:t}){const[i,a]=m.useState([]),[n,r]=m.useState(!0);return m.useEffect(()=>{async function s(){r(!0);const{models:l}=await K.customModels("anthropic",typeof e=="boolean"?null:e);l.length>0&&a(l),r(!1)}s()},[e]),n?o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Chat Model Selection"}),o.jsx("select",{name:"AnthropicModelPref",disabled:!0,className:"border-none bg-theme-settings-input-bg border-gray-500 text-white text-sm rounded-lg block w-full p-2.5",children:o.jsx("option",{disabled:!0,selected:!0,children:"-- loading available models --"})})]}):o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Chat Model Selection"}),o.jsx("select",{name:"AnthropicModelPref",required:!0,className:"border-none bg-theme-settings-input-bg border-gray-500 text-white text-sm rounded-lg block w-full p-2.5",children:i.map(s=>o.jsx("option",{value:s.id,selected:(t==null?void 0:t.AnthropicModelPref)===s.id,children:s.name},s.id))})]})}function an({provider:e=null,initialBasePath:t="",initialAuthToken:i=null,ENDPOINTS:a=[]}){const[n,r]=m.useState(!1),[s,l]=m.useState(t),[d,u]=m.useState(t),[h,g]=m.useState(i),[p,v]=m.useState(i),[f,b]=m.useState(!1),[w,y]=m.useState(!0);async function k(){r(!0),b(!0);const M=[];a.forEach(F=>{M.push(new Promise((O,Z)=>{K.customModels(e,p,F,2e3).then(R=>{if(!(R!=null&&R.models)||R.models.length===0)throw new Error("No models");O({endpoint:F,models:R.models})}).catch(()=>{Z(`${e} @ ${F} did not resolve.`)})}))});const{endpoint:T,models:D}=await Promise.any(M).then(F=>F).catch(()=>(console.error("All endpoints failed to resolve."),{endpoint:null,models:null}));if(D!==null){l(T),u(T),r(!1),y(!1);return}r(!1),y(!0)}function _(M){M.preventDefault(),k()}function x(M){const T=M.target.value;u(T)}function A(){l(d)}function z(M){const T=M.target.value;v(T)}function S(){g(p)}return m.useEffect(()=>{!t&&!f&&k()},[t,i,f]),{autoDetecting:n,autoDetectAttempted:f,showAdvancedControls:w,setShowAdvancedControls:y,basePath:{value:s,set:u,onChange:x,onBlur:A},basePathValue:{value:d,set:u},authToken:{value:h,set:v,onChange:z,onBlur:S},authTokenValue:{value:p,set:v},handleAutoDetectClick:_,runAutoDetect:k}}function $w({settings:e,showAlert:t=!1}){const{enabled:i}=pt("embedder"),{autoDetecting:a,basePath:n,basePathValue:r,authToken:s,authTokenValue:l,showAdvancedControls:d,setShowAdvancedControls:u,handleAutoDetectClick:h}=an({provider:"lmstudio",initialBasePath:e==null?void 0:e.LMStudioBasePath,ENDPOINTS:H6}),[g,p]=m.useState((e==null?void 0:e.LMStudioTokenLimit)||""),v=f=>{p(f.target.value?Number(f.target.value):"")};return o.jsxs("div",{className:"w-full flex flex-col gap-y-7",children:[t&&i&&o.jsxs("div",{className:"flex flex-col md:flex-row md:items-center gap-x-2 text-white mb-6 bg-blue-800/30 w-fit rounded-lg px-4 py-2",children:[o.jsxs("div",{className:"gap-x-2 flex items-center",children:[o.jsx(nt,{size:12,className:"hidden md:visible"}),o.jsx("p",{className:"text-sm md:text-base",children:"LMStudio as your LLM requires you to set an embedding service to use."})]}),o.jsx("a",{href:G.settings.embedder.modelPreference(),className:"text-sm md:text-base my-2 underline",children:"Manage embedding →"})]}),o.jsx("div",{className:"w-full flex items-start gap-[36px] mt-1.5",children:o.jsx(qE,{settings:e,basePath:n.value,apiKey:l.value})}),o.jsx("div",{className:"flex justify-start mt-4",children:o.jsxs("button",{onClick:f=>{f.preventDefault(),u(!d)},className:"border-none text-theme-text-primary hover:text-theme-text-secondary flex items-center text-sm",children:[d?"Hide":"Show"," advanced settings",d?o.jsx(aa,{size:14,className:"ml-1"}):o.jsx(Ri,{size:14,className:"ml-1"})]})}),o.jsxs("div",{hidden:!d,children:[o.jsxs("div",{className:"w-full flex items-start gap-4",children:[o.jsxs("div",{className:"flex flex-col w-[300px]",children:[o.jsxs("div",{className:"flex justify-between items-center mb-2",children:[o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx("label",{className:"text-white text-sm font-semibold",children:"LM Studio Base URL"}),o.jsx(nt,{size:18,className:"text-theme-text-secondary cursor-pointer","data-tooltip-id":"lmstudio-base-url","data-tooltip-content":"Enter the URL where LM Studio is running."}),o.jsx(lt,{id:"lmstudio-base-url",place:"top",delayShow:300,className:"tooltip !text-xs !opacity-100",style:{maxWidth:"250px",whiteSpace:"normal",wordWrap:"break-word"}})]}),a?o.jsx(Xa,{size:16,className:"text-theme-text-secondary animate-spin"}):o.jsx(o.Fragment,{children:!r.value&&o.jsx("button",{onClick:h,className:"border-none bg-primary-button text-xs font-medium px-2 py-1 rounded-lg hover:bg-secondary hover:text-white shadow-[0_4px_14px_rgba(0,0,0,0.25)]",children:"Auto-Detect"})})]}),o.jsx("input",{type:"url",name:"LMStudioBasePath",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"http://localhost:1234/v1",value:r.value,required:!0,autoComplete:"off",spellCheck:!1,onChange:n.onChange,onBlur:n.onBlur})]}),o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsxs("div",{className:"flex items-center mb-2 gap-x-1",children:[o.jsx("label",{className:"text-white text-sm font-semibold",children:"Model Context Window"}),o.jsx(nt,{size:18,className:"text-theme-text-secondary cursor-pointer","data-tooltip-id":"lmstudio-max-tokens","data-tooltip-content":"Override the context window limit. Leave empty to auto-detect from the model (defaults to 4096 if detection fails)."}),o.jsx(lt,{id:"lmstudio-max-tokens",className:"tooltip !text-xs !opacity-100",style:{maxWidth:"250px",whiteSpace:"normal",wordWrap:"break-word"}})]}),o.jsx("input",{type:"number",name:"LMStudioTokenLimit",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"Automatically managed",min:1,value:g,onChange:v,onScroll:f=>f.target.blur(),required:!1,autoComplete:"off"})]})]}),o.jsx("div",{className:"flex items-start gap-4 mt-4",children:o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsxs("div",{className:"flex items-center mb-2 gap-x-1",children:[o.jsx("label",{className:"text-white text-sm font-semibold",children:"Authentication Token"}),o.jsx(nt,{size:18,className:"text-theme-text-secondary cursor-pointer","data-tooltip-id":"lmstudio-authentication-token"}),o.jsx(lt,{id:"lmstudio-authentication-token",place:"top",delayShow:300,delayHide:400,clickable:!0,className:"tooltip !text-xs !opacity-100",style:{maxWidth:"250px",whiteSpace:"normal",wordWrap:"break-word"},children:o.jsxs("p",{className:"text-xs leading-[18px] font-base",children:["Enter a ",o.jsx("code",{children:"Bearer"})," Auth Token for interacting with your LM Studio server.",o.jsx("br",{})," ",o.jsx("br",{}),"Useful if running LM Studio behind an authentication or proxy."]})})]}),o.jsx("input",{type:"password",name:"LMStudioAuthToken",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg outline-none block w-full p-2.5 focus:outline-primary-button active:outline-primary-button",placeholder:"LM Studio Auth Token",defaultValue:e!=null&&e.LMStudioAuthToken?"*".repeat(20):"",value:l.value,onChange:s.onChange,onBlur:s.onBlur,required:!1,autoComplete:"off",spellCheck:!1})]})})]})]})}function qE({settings:e,basePath:t=null,apiKey:i=null}){const[a,n]=m.useState([]),[r,s]=m.useState(!0);return m.useEffect(()=>{async function l(){if(!t){n([]),s(!1);return}s(!0);try{const{models:d}=await K.customModels("lmstudio",i,t);n(d||[])}catch(d){console.error("Failed to fetch custom models:",d),n([])}s(!1)}l()},[t,i]),r||a.length===0?o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsxs("div",{className:"flex items-center mb-2 gap-x-1",children:[o.jsx("label",{className:"text-white text-sm font-semibold",children:"Selected Model"}),!r&&!!t&&o.jsxs(o.Fragment,{children:[o.jsx(zy,{size:18,className:"text-red-400 cursor-pointer","data-tooltip-id":"lmstudio-selected-model"}),o.jsx(lt,{id:"lmstudio-selected-model",place:"top",delayShow:300,delayHide:400,clickable:!0,className:"tooltip !text-xs !opacity-100 z-99",style:{maxWidth:"250px",whiteSpace:"normal",wordWrap:"break-word"},children:o.jsx("p",{className:"text-xs leading-[18px] font-base",children:"Could not reach LM Studio. Verify the URL is correct and the LMStudio server is running and accessible."})})]})]}),o.jsx("select",{name:"LMStudioModelPref",disabled:!0,className:"border-none bg-theme-settings-input-bg border-gray-500 text-white text-sm rounded-lg block w-full p-2.5",children:o.jsx("option",{disabled:!0,selected:!0,children:r?"--loading available models--":t?"No models found":"Enter LM Studio URL first"})})]}):o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-2",children:"Selected Model"}),o.jsx("select",{name:"LMStudioModelPref",required:!0,className:"border-none bg-theme-settings-input-bg border-gray-500 text-white text-sm rounded-lg block w-full p-2.5",children:a.length>0&&o.jsx("optgroup",{label:"Your loaded models",children:a.map(l=>o.jsx("option",{value:l.id,selected:e.LMStudioModelPref===l.id,children:l.id},l.id))})})]})}function Zw({settings:e,showAlert:t=!1}){const{enabled:i}=pt("embedder"),{autoDetecting:a,basePath:n,basePathValue:r,showAdvancedControls:s,setShowAdvancedControls:l,handleAutoDetectClick:d}=an({provider:"localai",initialBasePath:e==null?void 0:e.LocalAiBasePath,ENDPOINTS:q6}),[u,h]=m.useState(e==null?void 0:e.LocalAiApiKey),[g,p]=m.useState(e==null?void 0:e.LocalAiApiKey);return o.jsxs("div",{className:"w-full flex flex-col gap-y-7",children:[t&&i&&o.jsxs("div",{className:"flex flex-col md:flex-row md:items-center gap-x-2 text-white mb-6 bg-blue-800/30 w-fit rounded-lg px-4 py-2",children:[o.jsxs("div",{className:"gap-x-2 flex items-center",children:[o.jsx(nt,{size:12,className:"hidden md:visible"}),o.jsx("p",{className:"text-sm md:text-base",children:"LocalAI as your LLM requires you to set an embedding service to use."})]}),o.jsx("a",{href:G.settings.embedder.modelPreference(),className:"text-sm md:text-base my-2 underline",children:"Manage embedding →"})]}),o.jsxs("div",{className:"w-full flex items-center gap-[36px] mt-1.5",children:[!(e!=null&&e.credentialsOnly)&&o.jsxs(o.Fragment,{children:[o.jsx(FE,{settings:e,basePath:n.value,apiKey:g}),o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-2",children:"Model context window"}),o.jsx("input",{type:"number",name:"LocalAiTokenLimit",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"4096",min:1,onScroll:v=>v.target.blur(),defaultValue:e==null?void 0:e.LocalAiTokenLimit,required:!0,autoComplete:"off"})]})]}),o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("div",{className:"flex flex-col gap-y-1 mb-2",children:o.jsxs("label",{className:"text-white text-sm font-semibold flex items-center gap-x-2",children:["Local AI API Key"," ",o.jsx("p",{className:"!text-xs !italic !font-thin",children:"optional"})]})}),o.jsx("input",{type:"password",name:"LocalAiApiKey",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"sk-mysecretkey",defaultValue:e!=null&&e.LocalAiApiKey?"*".repeat(20):"",autoComplete:"off",spellCheck:!1,onChange:v=>h(v.target.value),onBlur:()=>p(u)})]})]}),o.jsx("div",{className:"flex justify-start mt-4",children:o.jsxs("button",{onClick:v=>{v.preventDefault(),l(!s)},className:"border-none text-theme-text-primary hover:text-theme-text-secondary flex items-center text-sm",children:[s?"Hide":"Show"," advanced settings",s?o.jsx(aa,{size:14,className:"ml-1"}):o.jsx(Ri,{size:14,className:"ml-1"})]})}),o.jsx("div",{hidden:!s,children:o.jsx("div",{className:"w-full flex items-center gap-4",children:o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsxs("div",{className:"flex justify-between items-center mb-2",children:[o.jsx("label",{className:"text-white text-sm font-semibold",children:"Local AI Base URL"}),a?o.jsx(Nn,{size:"6"}):o.jsx(o.Fragment,{children:!r.value&&o.jsx("button",{onClick:d,className:"bg-primary-button text-xs font-medium px-2 py-1 rounded-lg hover:bg-secondary hover:text-white shadow-[0_4px_14px_rgba(0,0,0,0.25)]",children:"Auto-Detect"})})]}),o.jsx("input",{type:"url",name:"LocalAiBasePath",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"http://localhost:8080/v1",value:r.value,required:!0,autoComplete:"off",spellCheck:!1,onChange:n.onChange,onBlur:n.onBlur})]})})})]})}function FE({settings:e,basePath:t=null,apiKey:i=null}){const[a,n]=m.useState([]),[r,s]=m.useState(!0);return m.useEffect(()=>{async function l(){if(!t||!t.includes("/v1")){n([]),s(!1);return}s(!0);const{models:d}=await K.customModels("localai",typeof i=="boolean"?null:i,t);n(d||[]),s(!1)}l()},[t,i]),r||a.length==0?o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-2",children:"Chat Model Selection"}),o.jsx("select",{name:"LocalAiModelPref",disabled:!0,className:"border-none bg-theme-settings-input-bg border-gray-500 text-white text-sm rounded-lg block w-full p-2.5",children:o.jsx("option",{disabled:!0,selected:!0,children:t!=null&&t.includes("/v1")?"-- loading available models --":"-- waiting for URL --"})})]}):o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-2",children:"Chat Model Selection"}),o.jsx("select",{name:"LocalAiModelPref",required:!0,className:"border-none bg-theme-settings-input-bg border-gray-500 text-white text-sm rounded-lg block w-full p-2.5",children:a.length>0&&o.jsx("optgroup",{label:"Your loaded models",children:a.map(l=>o.jsx("option",{value:l.id,selected:e.LocalAiModelPref===l.id,children:l.id},l.id))})})]})}function Jw({settings:e}){const[t,i]=m.useState(e==null?void 0:e.GeminiLLMApiKey),[a,n]=m.useState(e==null?void 0:e.GeminiLLMApiKey);return o.jsx("div",{className:"w-full flex flex-col",children:o.jsxs("div",{className:"w-full flex items-center gap-[36px] mt-1.5",children:[o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Google AI API Key"}),o.jsx("input",{type:"password",name:"GeminiLLMApiKey",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"Google Gemini API Key",defaultValue:e!=null&&e.GeminiLLMApiKey?"*".repeat(20):"",required:!0,autoComplete:"off",spellCheck:!1,onChange:r=>i(r.target.value),onBlur:()=>n(t)})]}),!(e!=null&&e.credentialsOnly)&&o.jsx(o.Fragment,{children:o.jsx(UE,{apiKey:a,settings:e})})]})})}function UE({apiKey:e,settings:t}){const[i,a]=m.useState({}),[n,r]=m.useState(!0);return m.useEffect(()=>{async function s(){r(!0);const{models:l}=await K.customModels("gemini",e);if((l==null?void 0:l.length)>0){const d=l.reduce((u,h)=>(u[h.experimental?"Experimental":"Stable"]=u[h.experimental?"Experimental":"Stable"]||[],u[h.experimental?"Experimental":"Stable"].push(h),u),{});a(d)}r(!1)}s()},[e]),n?o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Chat Model Selection"}),o.jsx("select",{name:"GeminiLLMModelPref",disabled:!0,className:"border-none bg-theme-settings-input-bg border-gray-500 text-white text-sm rounded-lg block w-full p-2.5",children:o.jsx("option",{disabled:!0,selected:!0,children:"-- loading available models --"})})]}):o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Chat Model Selection"}),o.jsx("select",{name:"GeminiLLMModelPref",required:!0,className:"border-none bg-theme-settings-input-bg border-gray-500 text-white text-sm rounded-lg block w-full p-2.5",children:Object.keys(i).sort((s,l)=>s==="Stable"?-1:l==="Stable"?1:s.localeCompare(l)).map(s=>o.jsx("optgroup",{label:s,children:i[s].map(l=>o.jsx("option",{value:l.id,selected:(t==null?void 0:t.GeminiLLMModelPref)===l.id,children:l.id},l.id))},s))})]})}function Qw({settings:e}){const{autoDetecting:t,basePath:i,basePathValue:a,authToken:n,authTokenValue:r,showAdvancedControls:s,setShowAdvancedControls:l,handleAutoDetectClick:d}=an({provider:"ollama",initialBasePath:e==null?void 0:e.OllamaLLMBasePath,ENDPOINTS:R6}),[u,h]=m.useState((e==null?void 0:e.OllamaLLMTokenLimit)||"");return o.jsxs("div",{className:"w-full flex flex-col gap-y-7",children:[o.jsx("div",{className:"w-full flex items-start gap-[36px] mt-1.5",children:o.jsx(BE,{settings:e,basePath:i.value,authToken:n.value})}),o.jsx("div",{className:"flex justify-start mt-4",children:o.jsxs("button",{onClick:g=>{g.preventDefault(),l(!s)},className:"border-none text-theme-text-primary hover:text-theme-text-secondary flex items-center text-sm",children:[s?"Hide":"Show"," advanced settings",s?o.jsx(aa,{size:14,className:"ml-1"}):o.jsx(Ri,{size:14,className:"ml-1"})]})}),o.jsx("div",{hidden:!s,children:o.jsxs("div",{className:"flex flex-col",children:[o.jsxs("div",{className:"w-full flex items-start gap-4 mb-4",children:[o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsxs("div",{className:"flex justify-between items-center mb-2",children:[o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx("label",{className:"text-white text-sm font-semibold",children:"Ollama Base URL"}),o.jsx(nt,{size:18,className:"text-theme-text-secondary cursor-pointer","data-tooltip-id":"ollama-base-url","data-tooltip-content":"Enter the URL where Ollama is running."}),o.jsx(lt,{id:"ollama-base-url",place:"top",delayShow:300,className:"tooltip !text-xs !opacity-100",style:{maxWidth:"250px",whiteSpace:"normal",wordWrap:"break-word"}})]}),t?o.jsx(Xa,{size:16,className:"text-theme-text-secondary animate-spin"}):o.jsx(o.Fragment,{children:!a.value&&o.jsx("button",{onClick:d,className:"bg-primary-button text-xs font-medium px-2 py-1 rounded-lg hover:bg-secondary hover:text-white shadow-[0_4px_14px_rgba(0,0,0,0.25)]",children:"Auto-Detect"})})]}),o.jsx("input",{type:"url",name:"OllamaLLMBasePath",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"http://127.0.0.1:11434",value:a.value,required:!0,autoComplete:"off",spellCheck:!1,onChange:i.onChange,onBlur:i.onBlur})]}),o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsxs("div",{className:"flex items-center mb-2 gap-x-1",children:[o.jsx("label",{className:"text-white text-sm font-semibold block",children:"Ollama Keep Alive"}),o.jsx(nt,{size:18,className:"text-theme-text-secondary cursor-pointer","data-tooltip-id":"ollama-keep-alive"}),o.jsx(lt,{id:"ollama-keep-alive",place:"top",delayShow:300,delayHide:400,clickable:!0,className:"tooltip !text-xs !opacity-100",style:{maxWidth:"250px",whiteSpace:"normal",wordWrap:"break-word"},children:o.jsxs("p",{className:"text-xs leading-[18px] font-base",children:["Choose how long Ollama should keep your model in memory before unloading."," ",o.jsx(Vt,{className:"underline text-blue-300",to:"https://docs.ollama.com/faq#how-do-i-keep-a-model-loaded-in-memory-or-make-it-unload-immediately",target:"_blank",rel:"noreferrer",children:"Learn more →"})]})})]}),o.jsxs("select",{name:"OllamaLLMKeepAliveSeconds",required:!0,className:"border-none bg-theme-settings-input-bg border-gray-500 text-white text-sm rounded-lg block w-full p-2.5",defaultValue:(e==null?void 0:e.OllamaLLMKeepAliveSeconds)??"300",children:[o.jsx("option",{value:"0",children:"No cache"}),o.jsx("option",{value:"300",children:"5 minutes"}),o.jsx("option",{value:"3600",children:"1 hour"}),o.jsx("option",{value:"-1",children:"Forever"})]})]})]}),o.jsxs("div",{className:"w-full flex items-start gap-4",children:[o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsxs("div",{className:"flex items-center mb-2 gap-x-1",children:[o.jsx("label",{className:"text-white text-sm font-semibold block",children:"Model context window"}),o.jsx(nt,{size:18,className:"text-theme-text-secondary cursor-pointer","data-tooltip-id":"ollama-model-context-window"}),o.jsx(lt,{id:"ollama-model-context-window",place:"top",delayShow:300,delayHide:400,clickable:!0,className:"tooltip !text-xs !opacity-100",style:{maxWidth:"250px",whiteSpace:"normal",wordWrap:"break-word"},children:o.jsxs("p",{className:"text-xs leading-[18px] font-base",children:["Specify the maximum number of tokens that can be used for the model context window.",o.jsx("br",{})," ",o.jsx("br",{}),"If you leave this field blank, the context window limit will be auto-detected from the model and applied to all chats. If auto-detection fails, a fallback context window limit of 4096 will be used.",o.jsx("br",{})," ",o.jsx("br",{}),o.jsx("b",{children:"Important:"})," Some models have very large context windows using the full context window limit can dramatically increase the memory usage of your system. For this reason, we will automatically cap the context window limit to 16,384 tokens if the model supports more than that and no value is specified.",o.jsx("br",{})," ",o.jsx("br",{}),"If an invalid value is entered, AnythingLLM will handle this for you so that chats do not fail."]})})]}),o.jsx("input",{type:"number",name:"OllamaLLMTokenLimit",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"Automatically managed",min:1,value:u,onChange:g=>h(g.target.value?Number(g.target.value):""),onScroll:g=>g.target.blur(),required:!1,autoComplete:"off"})]}),o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsxs("div",{className:"flex items-center mb-2 gap-x-1",children:[o.jsx("label",{className:"text-white text-sm font-semibold",children:"Authentication Token"}),o.jsx(nt,{size:18,className:"text-theme-text-secondary cursor-pointer","data-tooltip-id":"ollama-authentication-token"}),o.jsx(lt,{id:"ollama-authentication-token",place:"top",delayShow:300,delayHide:400,clickable:!0,className:"tooltip !text-xs !opacity-100",style:{maxWidth:"250px",whiteSpace:"normal",wordWrap:"break-word"},children:o.jsxs("p",{className:"text-xs leading-[18px] font-base",children:["Enter a ",o.jsx("code",{children:"Bearer"})," Auth Token for interacting with your Ollama server.",o.jsx("br",{})," ",o.jsx("br",{}),"Used ",o.jsx("b",{children:"only"})," if running Ollama behind an authentication server."]})})]}),o.jsx("input",{type:"password",name:"OllamaLLMAuthToken",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg outline-none block w-full p-2.5 focus:outline-primary-button active:outline-primary-button",placeholder:"Ollama Auth Token",defaultValue:e!=null&&e.OllamaLLMAuthToken?"*".repeat(20):"",value:r.value,onChange:n.onChange,onBlur:n.onBlur,required:!1,autoComplete:"off",spellCheck:!1})]})]})]})})]})}function BE({settings:e,basePath:t=null,authToken:i=null}){const[a,n]=m.useState([]),[r,s]=m.useState(!0);return m.useEffect(()=>{async function l(){if(!t){n([]),s(!1);return}s(!0);try{const{models:d}=await K.customModels("ollama",i,t);n(d||[])}catch(d){console.error("Failed to fetch custom models:",d),n([])}s(!1)}l()},[t,i]),r||a.length===0?o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-2",children:"Ollama Model"}),o.jsx("select",{name:"OllamaLLMModelPref",disabled:!0,className:"border-none bg-theme-settings-input-bg border-gray-500 text-white text-sm rounded-lg block w-full p-2.5",children:o.jsx("option",{disabled:!0,selected:!0,children:t?"--loading available models--":"Enter Ollama URL first"})}),o.jsx("p",{className:"text-xs leading-[18px] font-base text-white text-opacity-60 mt-2",children:"Select the Ollama model you want to use. Models will load after entering a valid Ollama URL."})]}):o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-2",children:"Ollama Model"}),o.jsx("select",{name:"OllamaLLMModelPref",required:!0,className:"border-none bg-theme-settings-input-bg border-gray-500 text-white text-sm rounded-lg block w-full p-2.5",children:a.length>0&&o.jsx("optgroup",{label:"Your loaded models",children:a.map(l=>o.jsx("option",{value:l.id,selected:e.OllamaLLMModelPref===l.id,children:l.id},l.id))})}),o.jsx("p",{className:"text-xs leading-[18px] font-base text-white text-opacity-60 mt-2",children:"Choose the Ollama model you want to use for your conversations."})]})}function Yw({settings:e}){return o.jsxs("div",{className:"w-full flex flex-col gap-y-7",children:[o.jsxs("div",{className:"w-full flex items-start gap-[36px] mt-1.5",children:[o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-theme-text-primary text-sm font-semibold block mb-3",children:"Novita API Key"}),o.jsx("input",{type:"password",name:"NovitaLLMApiKey",className:"border-none bg-theme-settings-input-bg text-theme-text-primary placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"Novita API Key",defaultValue:e!=null&&e.NovitaLLMApiKey?"*".repeat(20):"",required:!0,autoComplete:"off",spellCheck:!1})]}),!(e!=null&&e.credentialsOnly)&&o.jsx(KE,{settings:e})]}),o.jsx(GE,{settings:e})]})}function GE({settings:e}){const[t,i]=m.useState(!1);return o.jsxs("div",{className:"flex flex-col gap-y-4",children:[o.jsx("div",{className:"flex justify-start",children:o.jsxs("button",{type:"button",onClick:()=>i(!t),className:"border-none text-theme-text-primary hover:text-theme-text-secondary flex items-center text-sm",children:[t?"Hide":"Show"," advanced settings",t?o.jsx(aa,{size:14,className:"ml-1"}):o.jsx(Ri,{size:14,className:"ml-1"})]})}),o.jsx("div",{hidden:!t,children:o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-theme-text-primary text-sm font-semibold block mb-3",children:"Stream Timeout (ms)"}),o.jsx("input",{type:"number",name:"NovitaLLMTimeout",className:"border-none bg-theme-settings-input-bg text-theme-text-primary placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"Timeout value between token responses to auto-timeout the stream",defaultValue:(e==null?void 0:e.NovitaLLMTimeout)??3e3,autoComplete:"off",onScroll:a=>a.target.blur(),min:500,step:1}),o.jsx("p",{className:"text-xs leading-[18px] font-base text-theme-text-primary text-opacity-60 mt-2",children:"Timeout value between token responses to auto-timeout the stream."})]})})]})}function KE({settings:e}){const[t,i]=m.useState({}),[a,n]=m.useState(!0);return m.useEffect(()=>{async function r(){n(!0);const{models:s}=await K.customModels("novita");if((s==null?void 0:s.length)>0){const l=s.reduce((d,u)=>(d[u.organization]=d[u.organization]||[],d[u.organization].push(u),d),{});i(l)}n(!1)}r()},[]),a||Object.keys(t).length===0?o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-theme-text-primary text-sm font-semibold block mb-3",children:"Chat Model Selection"}),o.jsx("select",{name:"NovitaLLMModelPref",disabled:!0,className:"border-none bg-theme-settings-input-bg text-theme-text-primary border-theme-border text-sm rounded-lg block w-full p-2.5",children:o.jsx("option",{disabled:!0,selected:!0,children:"-- loading available models --"})})]}):o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-theme-text-primary text-sm font-semibold block mb-3",children:"Chat Model Selection"}),o.jsx("select",{name:"NovitaLLMModelPref",required:!0,className:"border-none bg-theme-settings-input-bg text-theme-text-primary border-theme-border text-sm rounded-lg block w-full p-2.5",children:Object.keys(t).sort().map(r=>o.jsx("optgroup",{label:r,children:t[r].map(s=>o.jsx("option",{value:s.id,selected:(e==null?void 0:e.NovitaLLMModelPref)===s.id,children:s.name},s.id))},r))})]})}function Xw({settings:e}){return o.jsxs("div",{className:"w-full flex flex-col gap-y-7",children:[o.jsxs("div",{className:"w-full flex items-start gap-[36px] mt-1.5",children:[o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-theme-text-primary text-sm font-semibold block mb-3",children:"CometAPI API Key"}),o.jsx("input",{type:"password",name:"CometApiLLMApiKey",className:"border-none bg-theme-settings-input-bg text-theme-text-primary placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"CometAPI API Key",defaultValue:e!=null&&e.CometApiLLMApiKey?"*".repeat(20):"",required:!0,autoComplete:"off",spellCheck:!1})]}),!(e!=null&&e.credentialsOnly)&&o.jsx($E,{settings:e})]}),o.jsx(WE,{settings:e})]})}function WE({settings:e}){const[t,i]=m.useState(!1);return o.jsxs("div",{className:"flex flex-col gap-y-4",children:[o.jsx("div",{className:"flex justify-start",children:o.jsxs("button",{type:"button",onClick:()=>i(!t),className:"border-none text-theme-text-primary hover:text-theme-text-secondary flex items-center text-sm",children:[t?"Hide":"Show"," advanced settings",t?o.jsx(aa,{size:14,className:"ml-1"}):o.jsx(Ri,{size:14,className:"ml-1"})]})}),o.jsx("div",{hidden:!t,children:o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-theme-text-primary text-sm font-semibold block mb-3",children:"Stream Timeout (ms)"}),o.jsx("input",{type:"number",name:"CometApiLLMTimeout",className:"border-none bg-theme-settings-input-bg text-theme-text-primary placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"Timeout value between token responses to auto-timeout the stream",defaultValue:(e==null?void 0:e.CometApiLLMTimeout)??3e3,autoComplete:"off",onScroll:a=>a.target.blur(),min:500,step:1}),o.jsx("p",{className:"text-xs leading-[18px] font-base text-theme-text-primary text-opacity-60 mt-2",children:"Timeout value between token responses to auto-timeout the stream."})]})})]})}function $E({settings:e}){const[t,i]=m.useState([]),[a,n]=m.useState(!0);return m.useEffect(()=>{async function r(){n(!0);const{models:s=[]}=await K.customModels("cometapi");if((s==null?void 0:s.length)>0){const l=new Set,d=[];for(const u of s){const h=String(u.id||u.name||"").toLowerCase();l.has(h)||(l.add(h),d.push(u))}d.sort((u,h)=>String(u.name||u.id).localeCompare(String(h.name||h.id))),i(d)}else i([]);n(!1)}r()},[]),a||t.length===0?o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-theme-text-primary text-sm font-semibold block mb-3",children:"Chat Model Selection"}),o.jsx("input",{type:"text",name:"CometApiLLMModelPref",className:"border-none bg-theme-settings-input-bg text-theme-text-primary placeholder:text-theme-settings-input-placeholder text-sm rounded-lg block w-full p-2.5",placeholder:"-- loading available models --",disabled:!0})]}):o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-theme-text-primary text-sm font-semibold block mb-3",children:"Chat Model Selection"}),o.jsx("input",{type:"text",name:"CometApiLLMModelPref",list:"cometapi-models-list",required:!0,className:"border-none bg-theme-settings-input-bg text-theme-text-primary placeholder:text-theme-settings-input-placeholder text-sm rounded-lg block w-full p-2.5",placeholder:"Type or select a model",defaultValue:(e==null?void 0:e.CometApiLLMModelPref)||"",autoComplete:"off",spellCheck:!1}),o.jsx("datalist",{id:"cometapi-models-list",children:t.map(r=>o.jsx("option",{value:r.id,children:r.name},r.id))}),o.jsx("p",{className:"text-xs leading-[18px] font-base text-theme-text-primary text-opacity-60 mt-2",children:"You can type the model id directly or pick from suggestions."})]})}function e2({settings:e}){const[t,i]=m.useState(e==null?void 0:e.TogetherAiApiKey),[a,n]=m.useState(e==null?void 0:e.TogetherAiApiKey);return o.jsxs("div",{className:"flex gap-[36px] mt-1.5",children:[o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Together AI API Key"}),o.jsx("input",{type:"password",name:"TogetherAiApiKey",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"Together AI API Key",defaultValue:e!=null&&e.TogetherAiApiKey?"*".repeat(20):"",required:!0,autoComplete:"off",spellCheck:!1,onChange:r=>i(r.target.value),onBlur:()=>n(t)})]}),!(e!=null&&e.credentialsOnly)&&o.jsx(ZE,{settings:e,apiKey:a})]})}function ZE({settings:e,apiKey:t}){const[i,a]=m.useState({}),[n,r]=m.useState(!0);return m.useEffect(()=>{async function s(){r(!0);try{const l=t==="*".repeat(20)?null:t,{models:d}=await K.customModels("togetherai",l);if((d==null?void 0:d.length)>0){const u=d.reduce((h,g)=>{if(g.type!=="chat")return h;const p=g.organization||"Unknown";return h[p]=h[p]||[],h[p].push({id:g.id,name:g.name||g.id,organization:p,maxLength:g.maxLength}),h},{});a(u)}}catch(l){console.error("Error fetching Together AI models:",l)}r(!1)}s()},[t]),n||Object.keys(i).length===0?o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Chat Model Selection"}),o.jsx("select",{name:"TogetherAiModelPref",disabled:!0,className:"border-none bg-theme-settings-input-bg border-gray-500 text-white text-sm rounded-lg block w-full p-2.5",children:o.jsx("option",{disabled:!0,selected:!0,children:"-- loading available models --"})})]}):o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Chat Model Selection"}),o.jsx("select",{name:"TogetherAiModelPref",required:!0,className:"border-none bg-theme-settings-input-bg border-gray-500 text-white text-sm rounded-lg block w-full p-2.5",children:Object.keys(i).sort().map(s=>o.jsx("optgroup",{label:s,children:i[s].map(l=>o.jsx("option",{value:l.id,selected:(e==null?void 0:e.TogetherAiModelPref)===l.id,children:l.name},l.id))},s))})]})}function t2({settings:e}){const[t,i]=m.useState(e==null?void 0:e.FireworksAiLLMApiKey),[a,n]=m.useState(e==null?void 0:e.FireworksAiLLMApiKey);return o.jsxs("div",{className:"flex gap-[36px] mt-1.5",children:[o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Fireworks AI API Key"}),o.jsx("input",{type:"password",name:"FireworksAiLLMApiKey",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"Fireworks AI API Key",defaultValue:e!=null&&e.FireworksAiLLMApiKey?"*".repeat(20):"",required:!0,autoComplete:"off",spellCheck:!1,onChange:r=>i(r.target.value),onBlur:()=>n(t)})]}),!(e!=null&&e.credentialsOnly)&&o.jsx(JE,{apiKey:a,settings:e})]})}function JE({apiKey:e,settings:t}){const[i,a]=m.useState({}),[n,r]=m.useState(!0);return m.useEffect(()=>{async function s(){r(!0);const{models:l}=await K.customModels("fireworksai",e);if((l==null?void 0:l.length)>0){const d=l.reduce((u,h)=>(u[h.organization]=u[h.organization]||[],u[h.organization].push(h),u),{});a(d)}r(!1)}s()},[e]),n||Object.keys(i).length===0?o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Chat Model Selection"}),o.jsx("select",{name:"FireworksAiLLMModelPref",disabled:!0,className:"border-none bg-theme-settings-input-bg border-gray-500 text-white text-sm rounded-lg block w-full p-2.5",children:o.jsx("option",{disabled:!0,selected:!0,children:"-- loading available models --"})})]}):o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Chat Model Selection"}),o.jsx("select",{name:"FireworksAiLLMModelPref",required:!0,className:"border-none bg-theme-settings-input-bg border-gray-500 text-white text-sm rounded-lg block w-full p-2.5",children:Object.keys(i).sort().map(s=>o.jsx("optgroup",{label:s,children:i[s].map(l=>o.jsx("option",{value:l.id,selected:(t==null?void 0:t.FireworksAiLLMModelPref)===l.id,children:l.name},l.id))},s))})]})}function i2({settings:e}){const[t,i]=m.useState(e==null?void 0:e.MistralApiKey),[a,n]=m.useState(e==null?void 0:e.MistralApiKey);return o.jsxs("div",{className:"flex gap-[36px] mt-1.5",children:[o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Mistral API Key"}),o.jsx("input",{type:"password",name:"MistralApiKey",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"Mistral API Key",defaultValue:e!=null&&e.MistralApiKey?"*".repeat(20):"",required:!0,autoComplete:"off",spellCheck:!1,onChange:r=>i(r.target.value),onBlur:()=>n(t)})]}),!(e!=null&&e.credentialsOnly)&&o.jsx(QE,{settings:e,apiKey:a})]})}function QE({apiKey:e,settings:t}){const[i,a]=m.useState([]),[n,r]=m.useState(!0);return m.useEffect(()=>{async function s(){if(!e){a([]),r(!1);return}r(!0);const{models:l}=await K.customModels("mistral",typeof e=="boolean"?null:e);a(l||[]),r(!1)}s()},[e]),n||i.length==0?o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Chat Model Selection"}),o.jsx("select",{name:"MistralModelPref",disabled:!0,className:"border-none bg-theme-settings-input-bg border-gray-500 text-white text-sm rounded-lg block w-full p-2.5",children:o.jsx("option",{disabled:!0,selected:!0,children:e?"-- loading available models --":"-- waiting for API key --"})})]}):o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Chat Model Selection"}),o.jsx("select",{name:"MistralModelPref",required:!0,className:"border-none bg-theme-settings-input-bg border-gray-500 text-white text-sm rounded-lg block w-full p-2.5",children:i.length>0&&o.jsx("optgroup",{label:"Available Mistral Models",children:i.map(s=>o.jsx("option",{value:s.id,selected:(t==null?void 0:t.MistralModelPref)===s.id,children:s.id},s.id))})})]})}function a2({settings:e}){return o.jsx("div",{className:"w-full flex flex-col",children:o.jsxs("div",{className:"w-full flex items-center gap-[36px] mt-1.5",children:[o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"HuggingFace Inference Endpoint"}),o.jsx("input",{type:"url",name:"HuggingFaceLLMEndpoint",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"https://example.endpoints.huggingface.cloud",defaultValue:e==null?void 0:e.HuggingFaceLLMEndpoint,required:!0,autoComplete:"off",spellCheck:!1})]}),o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"HuggingFace Access Token"}),o.jsx("input",{type:"password",name:"HuggingFaceLLMAccessToken",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"HuggingFace Access Token",defaultValue:e!=null&&e.HuggingFaceLLMAccessToken?"*".repeat(20):"",required:!0,autoComplete:"off",spellCheck:!1})]}),o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Model Token Limit"}),o.jsx("input",{type:"number",name:"HuggingFaceLLMTokenLimit",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"4096",min:1,onScroll:t=>t.target.blur(),defaultValue:e==null?void 0:e.HuggingFaceLLMTokenLimit,required:!0,autoComplete:"off"})]})]})})}function n2({settings:e}){return o.jsxs("div",{className:"flex gap-[36px] mt-1.5",children:[o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Perplexity API Key"}),o.jsx("input",{type:"password",name:"PerplexityApiKey",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"Perplexity API Key",defaultValue:e!=null&&e.PerplexityApiKey?"*".repeat(20):"",required:!0,autoComplete:"off",spellCheck:!1})]}),!(e!=null&&e.credentialsOnly)&&o.jsx(YE,{settings:e})]})}function YE({settings:e}){const[t,i]=m.useState([]),[a,n]=m.useState(!0);return m.useEffect(()=>{async function r(){n(!0);const{models:s}=await K.customModels("perplexity");i(s||[]),n(!1)}r()},[]),a||t.length==0?o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Chat Model Selection"}),o.jsx("select",{name:"PerplexityModelPref",disabled:!0,className:"border-none bg-theme-settings-input-bg border-gray-500 text-white text-sm rounded-lg block w-full p-2.5",children:o.jsx("option",{disabled:!0,selected:!0,children:"-- loading available models --"})})]}):o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Chat Model Selection"}),o.jsx("select",{name:"PerplexityModelPref",required:!0,className:"border-none bg-theme-settings-input-bg border-gray-500 text-white text-sm rounded-lg block w-full p-2.5",children:t.length>0&&o.jsx("optgroup",{label:"Available Perplexity Models",children:t.map(r=>o.jsx("option",{value:r.id,selected:(e==null?void 0:e.PerplexityModelPref)===r.id,children:r.id},r.id))})})]})}function r2({settings:e}){return o.jsxs("div",{className:"flex flex-col gap-y-4 mt-1.5",children:[o.jsxs("div",{className:"flex gap-[36px]",children:[o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"OpenRouter API Key"}),o.jsx("input",{type:"password",name:"OpenRouterApiKey",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"OpenRouter API Key",defaultValue:e!=null&&e.OpenRouterApiKey?"*".repeat(20):"",required:!0,autoComplete:"off",spellCheck:!1})]}),!(e!=null&&e.credentialsOnly)&&o.jsx(e7,{settings:e})]}),o.jsx(XE,{settings:e})]})}function XE({settings:e}){const[t,i]=m.useState(!1);return o.jsxs("div",{className:"flex flex-col gap-y-4",children:[o.jsxs("button",{type:"button",onClick:()=>i(!t),className:"border-none text-white hover:text-white/70 flex items-center text-sm",children:[t?"Hide":"Show"," advanced controls",t?o.jsx(aa,{size:14,className:"ml-1"}):o.jsx(Ri,{size:14,className:"ml-1"})]}),o.jsx("div",{hidden:!t,children:o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Stream Timeout (ms)"}),o.jsx("input",{type:"number",name:"OpenRouterTimeout",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"Timeout value between token responses to auto-timeout the stream",defaultValue:(e==null?void 0:e.OpenRouterTimeout)??3e3,autoComplete:"off",onScroll:a=>a.target.blur(),min:500,step:1})]})})]})}function e7({settings:e}){const[t,i]=m.useState({}),[a,n]=m.useState(!0);return m.useEffect(()=>{async function r(){n(!0);const{models:s}=await K.customModels("openrouter");if((s==null?void 0:s.length)>0){const l=s.reduce((d,u)=>(d[u.organization]=d[u.organization]||[],d[u.organization].push(u),d),{});i(l)}n(!1)}r()},[]),a||Object.keys(t).length===0?o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Chat Model Selection"}),o.jsx("select",{name:"OpenRouterModelPref",disabled:!0,className:"border-none bg-theme-settings-input-bg border-gray-500 text-white text-sm rounded-lg block w-full p-2.5",children:o.jsx("option",{disabled:!0,selected:!0,children:"-- loading available models --"})})]}):o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Chat Model Selection"}),o.jsx("select",{name:"OpenRouterModelPref",required:!0,className:"border-none bg-theme-settings-input-bg border-gray-500 text-white text-sm rounded-lg block w-full p-2.5",children:Object.keys(t).sort().map(r=>o.jsx("optgroup",{label:r,children:t[r].map(s=>o.jsx("option",{value:s.id,selected:(e==null?void 0:e.OpenRouterModelPref)===s.id,children:s.name},s.id))},r))})]})}function o2({settings:e}){const[t,i]=m.useState(e==null?void 0:e.GroqApiKey),[a,n]=m.useState(e==null?void 0:e.GroqApiKey);return o.jsxs("div",{className:"flex gap-[36px] mt-1.5",children:[o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Groq API Key"}),o.jsx("input",{type:"password",name:"GroqApiKey",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"Groq API Key",defaultValue:e!=null&&e.GroqApiKey?"*".repeat(20):"",required:!0,autoComplete:"off",spellCheck:!1,onChange:r=>i(r.target.value),onBlur:()=>n(t)})]}),!(e!=null&&e.credentialsOnly)&&o.jsx(t7,{settings:e,apiKey:a})]})}function t7({apiKey:e,settings:t}){const[i,a]=m.useState([]),[n,r]=m.useState(!0);return m.useEffect(()=>{async function s(){if(!e){a([]),r(!0);return}try{r(!0);const{models:l}=await K.customModels("groq",e);a(l||[])}catch(l){console.error("Failed to fetch custom models:",l),a([])}finally{r(!1)}}s()},[e]),n?o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Chat Model Selection"}),o.jsx("select",{name:"GroqModelPref",disabled:!0,className:"border-none bg-theme-settings-input-bg border-gray-500 text-white text-sm rounded-lg block w-full p-2.5",children:o.jsx("option",{disabled:!0,selected:!0,children:"--loading available models--"})}),o.jsx("p",{className:"text-xs leading-[18px] font-base text-white text-opacity-60 mt-2",children:"Enter a valid API key to view all available models for your account."})]}):o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Chat Model Selection"}),o.jsx("select",{name:"GroqModelPref",required:!0,className:"border-none bg-theme-settings-input-bg border-gray-500 text-white text-sm rounded-lg block w-full p-2.5",children:i.length>0&&o.jsx("optgroup",{label:"Available models",children:i.map(s=>o.jsx("option",{value:s.id,selected:(t==null?void 0:t.GroqModelPref)===s.id,children:s.id},s.id))})}),o.jsx("p",{className:"text-xs leading-[18px] font-base text-white text-opacity-60 mt-2",children:"Select the GroqAI model you want to use for your conversations."})]})}function s2({settings:e}){const[t,i]=m.useState(e==null?void 0:e.CohereApiKey),[a,n]=m.useState(e==null?void 0:e.CohereApiKey);return o.jsx("div",{className:"w-full flex flex-col",children:o.jsxs("div",{className:"w-full flex items-center gap-[36px] mt-1.5",children:[o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Cohere API Key"}),o.jsx("input",{type:"password",name:"CohereApiKey",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"Cohere API Key",defaultValue:e!=null&&e.CohereApiKey?"*".repeat(20):"",required:!0,autoComplete:"off",spellCheck:!1,onChange:r=>i(r.target.value),onBlur:()=>n(t)})]}),!(e!=null&&e.credentialsOnly)&&o.jsx(i7,{settings:e,apiKey:a})]})})}function i7({apiKey:e,settings:t}){const[i,a]=m.useState([]),[n,r]=m.useState(!0);return m.useEffect(()=>{async function s(){if(!e){a([]),r(!0);return}r(!0);const{models:l}=await K.customModels("cohere",typeof e=="boolean"?null:e);a(l||[]),r(!1)}s()},[e]),n?o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Chat Model Selection"}),o.jsx("select",{name:"CohereModelPref",disabled:!0,className:"border-none bg-theme-settings-input-bg border-gray-500 text-white text-sm rounded-lg block w-full p-2.5",children:o.jsx("option",{disabled:!0,selected:!0,children:"-- loading available models --"})})]}):o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Chat Model Selection"}),o.jsx("select",{name:"CohereModelPref",required:!0,className:"border-none bg-theme-settings-input-bg border-gray-500 text-white text-sm rounded-lg block w-full p-2.5",children:i.map(s=>o.jsx("option",{value:s.id,selected:(t==null?void 0:t.CohereModelPref)===s.id,children:s.name},s.id))})]})}function l2({settings:e}){const{autoDetecting:t,basePath:i,basePathValue:a,showAdvancedControls:n,setShowAdvancedControls:r,handleAutoDetectClick:s}=an({provider:"koboldcpp",initialBasePath:e==null?void 0:e.KoboldCPPBasePath,ENDPOINTS:V6}),[l,d]=m.useState((e==null?void 0:e.KoboldCPPTokenLimit)||4096),[u,h]=m.useState((e==null?void 0:e.KoboldCPPMaxTokens)||2048),g=v=>{d(Number(v.target.value))},p=v=>{h(Number(v.target.value))};return o.jsxs("div",{className:"w-full flex flex-col gap-y-7",children:[o.jsxs("div",{className:"w-full flex items-start gap-[36px] mt-1.5",children:[o.jsx(a7,{settings:e,basePath:i.value}),o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-2",children:"Model context window"}),o.jsx("input",{type:"number",name:"KoboldCPPTokenLimit",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"4096",min:1,value:l,onChange:g,onScroll:v=>v.target.blur(),required:!0,autoComplete:"off"}),o.jsx("p",{className:"text-xs leading-[18px] font-base text-white text-opacity-60 mt-2",children:"Maximum number of tokens for context and response."})]}),o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-2",children:"Max response tokens"}),o.jsx("input",{type:"number",name:"KoboldCPPMaxTokens",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"2048",min:1,value:u,onChange:p,onScroll:v=>v.target.blur(),required:!0,autoComplete:"off"}),o.jsx("p",{className:"text-xs leading-[18px] font-base text-white text-opacity-60 mt-2",children:"Maximum number of tokens for the response."})]})]}),o.jsx("div",{className:"flex justify-start mt-4",children:o.jsxs("button",{onClick:v=>{v.preventDefault(),r(!n)},className:"border-none text-theme-text-primary hover:text-theme-text-secondary flex items-center text-sm",children:[n?"Hide":"Show"," Manual Endpoint Input",n?o.jsx(aa,{size:14,className:"ml-1"}):o.jsx(Ri,{size:14,className:"ml-1"})]})}),o.jsx("div",{hidden:!n,children:o.jsx("div",{className:"w-full flex items-start gap-4",children:o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsxs("div",{className:"flex justify-between items-center mb-2",children:[o.jsx("label",{className:"text-white text-sm font-semibold",children:"KoboldCPP Base URL"}),t?o.jsx(Nn,{size:"6"}):o.jsx(o.Fragment,{children:!a.value&&o.jsx("button",{onClick:s,className:"border-none bg-primary-button text-xs font-medium px-2 py-1 rounded-lg hover:bg-secondary hover:text-white shadow-[0_4px_14px_rgba(0,0,0,0.25)]",children:"Auto-Detect"})})]}),o.jsx("input",{type:"url",name:"KoboldCPPBasePath",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"http://127.0.0.1:5000/v1",value:a.value,required:!0,autoComplete:"off",spellCheck:!1,onChange:i.onChange,onBlur:i.onBlur}),o.jsx("p",{className:"text-xs leading-[18px] font-base text-white text-opacity-60 mt-2",children:"Enter the URL where KoboldCPP is running."})]})})})]})}function a7({settings:e,basePath:t=null}){const[i,a]=m.useState([]),[n,r]=m.useState(!0);return m.useEffect(()=>{async function s(){if(!t||!t.includes("/v1")){a([]),r(!1);return}r(!0);try{const{models:l}=await K.customModels("koboldcpp",null,t);a(l||[])}catch(l){console.error("Failed to fetch custom models:",l),a([])}r(!1)}s()},[t]),n||i.length===0?o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-2",children:"KoboldCPP Model"}),o.jsx("select",{name:"KoboldCPPModelPref",disabled:!0,className:"border-none bg-theme-settings-input-bg border-gray-500 text-white text-sm rounded-lg block w-full p-2.5",children:o.jsx("option",{disabled:!0,selected:!0,children:t!=null&&t.includes("/v1")?"--loading available models--":"Enter KoboldCPP URL first"})}),o.jsx("p",{className:"text-xs leading-[18px] font-base text-white text-opacity-60 mt-2",children:"Select the KoboldCPP model you want to use. Models will load after entering a valid KoboldCPP URL."})]}):o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-2",children:"KoboldCPP Model"}),o.jsx("select",{name:"KoboldCPPModelPref",required:!0,className:"border-none bg-theme-settings-input-bg border-gray-500 text-white text-sm rounded-lg block w-full p-2.5",children:i.map(s=>o.jsx("option",{value:s.id,selected:e.KoboldCPPModelPref===s.id,children:s.id},s.id))}),o.jsx("p",{className:"text-xs leading-[18px] font-base text-white text-opacity-60 mt-2",children:"Choose the KoboldCPP model you want to use for your conversations."})]})}function c2({settings:e}){return o.jsxs("div",{className:"flex gap-[36px] mt-1.5 flex-wrap",children:[o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Base URL"}),o.jsx("input",{type:"url",name:"TextGenWebUIBasePath",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"http://127.0.0.1:5000/v1",defaultValue:e==null?void 0:e.TextGenWebUIBasePath,required:!0,autoComplete:"off",spellCheck:!1})]}),o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Model context window"}),o.jsx("input",{type:"number",name:"TextGenWebUITokenLimit",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"Content window limit (eg: 4096)",min:1,onScroll:t=>t.target.blur(),defaultValue:e==null?void 0:e.TextGenWebUITokenLimit,required:!0,autoComplete:"off"})]}),o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"API Key (Optional)"}),o.jsx("input",{type:"password",name:"TextGenWebUIAPIKey",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"TextGen Web UI API Key",defaultValue:e!=null&&e.TextGenWebUIAPIKey?"*".repeat(20):"",autoComplete:"off",spellCheck:!1})]})]})}function d2({settings:e}){const[t,i]=m.useState(e==null?void 0:e.LiteLLMBasePath),[a,n]=m.useState(e==null?void 0:e.LiteLLMBasePath),[r,s]=m.useState(e==null?void 0:e.LiteLLMAPIKey),[l,d]=m.useState(e==null?void 0:e.LiteLLMAPIKey);return o.jsxs("div",{className:"w-full flex flex-col gap-y-7 mt-1.5",children:[o.jsxs("div",{className:"w-full flex items-center gap-[36px]",children:[o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Base URL"}),o.jsx("input",{type:"url",name:"LiteLLMBasePath",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"http://127.0.0.1:4000",defaultValue:e==null?void 0:e.LiteLLMBasePath,required:!0,autoComplete:"off",spellCheck:!1,onChange:u=>i(u.target.value),onBlur:()=>n(t)})]}),o.jsx(n7,{settings:e,basePath:a,apiKey:l}),o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Model context window"}),o.jsx("input",{type:"number",name:"LiteLLMTokenLimit",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"8192",min:1,onScroll:u=>u.target.blur(),defaultValue:e==null?void 0:e.LiteLLMTokenLimit,required:!0,autoComplete:"off"})]})]}),o.jsx("div",{className:"w-full flex items-center gap-[36px]",children:o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("div",{className:"flex flex-col gap-y-1 mb-4",children:o.jsxs("label",{className:"text-white text-sm font-semibold flex items-center gap-x-2",children:["API Key ",o.jsx("p",{className:"!text-xs !italic !font-thin",children:"optional"})]})}),o.jsx("input",{type:"password",name:"LiteLLMAPIKey",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"sk-mysecretkey",defaultValue:e!=null&&e.LiteLLMAPIKey?"*".repeat(20):"",autoComplete:"off",spellCheck:!1,onChange:u=>s(u.target.value),onBlur:()=>d(r)})]})})]})}function n7({settings:e,basePath:t=null,apiKey:i=null}){const[a,n]=m.useState([]),[r,s]=m.useState(!0);return m.useEffect(()=>{async function l(){if(!t){n([]),s(!1);return}s(!0);const{models:d}=await K.customModels("litellm",typeof i=="boolean"?null:i,t);n(d||[]),s(!1)}l()},[t,i]),r||a.length==0?o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Chat Model Selection"}),o.jsx("select",{name:"LiteLLMModelPref",disabled:!0,className:"border-none bg-theme-settings-input-bg border-gray-500 text-white text-sm rounded-lg block w-full p-2.5",children:o.jsx("option",{disabled:!0,selected:!0,children:t!=null&&t.includes("/v1")?"-- loading available models --":"-- waiting for URL --"})})]}):o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Chat Model Selection"}),o.jsx("select",{name:"LiteLLMModelPref",required:!0,className:"border-none bg-theme-settings-input-bg border-gray-500 text-white text-sm rounded-lg block w-full p-2.5",children:a.length>0&&o.jsx("optgroup",{label:"Your loaded models",children:a.map(l=>o.jsx("option",{value:l.id,selected:e.LiteLLMModelPref===l.id,children:l.id},l.id))})})]})}const r7=[{name:"N. Virginia",full_name:"US East (N. Virginia)",code:"us-east-1",public:!0,zones:["us-east-1a","us-east-1b","us-east-1c","us-east-1d","us-east-1e","us-east-1f"]},{name:"Ohio",full_name:"US East (Ohio)",code:"us-east-2",public:!0,zones:["us-east-2a","us-east-2b","us-east-2c"]},{name:"N. California",full_name:"US West (N. California)",code:"us-west-1",public:!0,zone_limit:2,zones:["us-west-1a","us-west-1b","us-west-1c"]},{name:"Oregon",full_name:"US West (Oregon)",code:"us-west-2",public:!0,zones:["us-west-2a","us-west-2b","us-west-2c","us-west-2d"]},{name:"GovCloud West",full_name:"AWS GovCloud (US)",code:"us-gov-west-1",public:!1,zones:["us-gov-west-1a","us-gov-west-1b","us-gov-west-1c"]},{name:"GovCloud East",full_name:"AWS GovCloud (US-East)",code:"us-gov-east-1",public:!1,zones:["us-gov-east-1a","us-gov-east-1b","us-gov-east-1c"]},{name:"Canada",full_name:"Canada (Central)",code:"ca-central-1",public:!0,zones:["ca-central-1a","ca-central-1b","ca-central-1c","ca-central-1d"]},{name:"Stockholm",full_name:"EU (Stockholm)",code:"eu-north-1",public:!0,zones:["eu-north-1a","eu-north-1b","eu-north-1c"]},{name:"Ireland",full_name:"EU (Ireland)",code:"eu-west-1",public:!0,zones:["eu-west-1a","eu-west-1b","eu-west-1c"]},{name:"London",full_name:"EU (London)",code:"eu-west-2",public:!0,zones:["eu-west-2a","eu-west-2b","eu-west-2c"]},{name:"Paris",full_name:"EU (Paris)",code:"eu-west-3",public:!0,zones:["eu-west-3a","eu-west-3b","eu-west-3c"]},{name:"Frankfurt",full_name:"EU (Frankfurt)",code:"eu-central-1",public:!0,zones:["eu-central-1a","eu-central-1b","eu-central-1c"]},{name:"Milan",full_name:"EU (Milan)",code:"eu-south-1",public:!0,zones:["eu-south-1a","eu-south-1b","eu-south-1c"]},{name:"Cape Town",full_name:"Africa (Cape Town)",code:"af-south-1",public:!0,zones:["af-south-1a","af-south-1b","af-south-1c"]},{name:"Tokyo",full_name:"Asia Pacific (Tokyo)",code:"ap-northeast-1",public:!0,zone_limit:3,zones:["ap-northeast-1a","ap-northeast-1b","ap-northeast-1c","ap-northeast-1d"]},{name:"Seoul",full_name:"Asia Pacific (Seoul)",code:"ap-northeast-2",public:!0,zones:["ap-northeast-2a","ap-northeast-2b","ap-northeast-2c","ap-northeast-2d"]},{name:"Osaka",full_name:"Asia Pacific (Osaka-Local)",code:"ap-northeast-3",public:!0,zones:["ap-northeast-3a","ap-northeast-3b","ap-northeast-3c"]},{name:"Singapore",full_name:"Asia Pacific (Singapore)",code:"ap-southeast-1",public:!0,zones:["ap-southeast-1a","ap-southeast-1b","ap-southeast-1c"]},{name:"Sydney",full_name:"Asia Pacific (Sydney)",code:"ap-southeast-2",public:!0,zones:["ap-southeast-2a","ap-southeast-2b","ap-southeast-2c"]},{name:"Jakarta",full_name:"Asia Pacific (Jakarta)",code:"ap-southeast-3",public:!0,zones:["ap-southeast-3a","ap-southeast-3b","ap-southeast-3c"]},{name:"Hong Kong",full_name:"Asia Pacific (Hong Kong)",code:"ap-east-1",public:!0,zones:["ap-east-1a","ap-east-1b","ap-east-1c"]},{name:"Mumbai",full_name:"Asia Pacific (Mumbai)",code:"ap-south-1",public:!0,zones:["ap-south-1a","ap-south-1b","ap-south-1c"]},{name:"São Paulo",full_name:"South America (São Paulo)",code:"sa-east-1",public:!0,zone_limit:2,zones:["sa-east-1a","sa-east-1b","sa-east-1c"]},{name:"Bahrain",full_name:"Middle East (Bahrain)",code:"me-south-1",public:!0,zones:["me-south-1a","me-south-1b","me-south-1c"]},{name:"UAE",full_name:"Middle East (UAE)",code:"me-central-1",public:!0,zones:["me-central-1a","me-central-1b","me-central-1c"]},{name:"Beijing",full_name:"China (Beijing)",code:"cn-north-1",public:!1,zones:["cn-north-1a","cn-north-1b","cn-north-1c"]},{name:"Ningxia",full_name:"China (Ningxia)",code:"cn-northwest-1",public:!1,zones:["cn-northwest-1a","cn-northwest-1b","cn-northwest-1c"]}];function u2({settings:e}){const[t,i]=m.useState((e==null?void 0:e.AwsBedrockLLMConnectionMethod)??"iam");return o.jsxs("div",{className:"w-full flex flex-col",children:[!(e!=null&&e.credentialsOnly)&&t!=="apiKey"&&o.jsx("div",{className:"flex flex-col md:flex-row md:items-center gap-x-2 text-white mb-4 bg-blue-800/30 w-fit rounded-lg px-4 py-2",children:o.jsxs("div",{className:"gap-x-2 flex items-center",children:[o.jsx(nt,{size:40}),o.jsxs("p",{className:"text-base",children:["You should use a properly defined IAM user for inferencing.",o.jsx("br",{}),o.jsxs("a",{href:"https://docs.anythingllm.com/setup/llm-configuration/cloud/aws-bedrock",target:"_blank",className:"underline flex gap-x-1 items-center",rel:"noreferrer",children:["Read more on how to use AWS Bedrock in AnythingLLM",o.jsx(km,{size:14})]})]})]})}),o.jsxs("div",{className:"flex flex-col gap-y-2 mb-2",children:[o.jsx("input",{type:"hidden",name:"AwsBedrockLLMConnectionMethod",value:t}),o.jsxs("div",{className:"flex flex-col w-full",children:[o.jsx("label",{className:"text-theme-text-primary text-sm font-semibold block mb-3",children:"Authentication Method"}),o.jsx("p",{className:"text-theme-text-secondary text-sm",children:"Select the method to authenticate with AWS Bedrock."})]}),o.jsxs("select",{name:"AwsBedrockLLMConnectionMethod",value:t,required:!0,onChange:a=>i(a.target.value),className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-fit p-2.5",children:[o.jsx("option",{value:"iam",children:"IAM (Explicit Credentials)"}),o.jsx("option",{value:"sessionToken",children:"Session Token (Temporary Credentials)"}),o.jsx("option",{value:"iam_role",children:"IAM Role (Implied Credentials)"}),o.jsx("option",{value:"apiKey",children:"Bedrock API Key"})]})]}),o.jsxs("div",{className:"w-full flex items-center gap-[36px] my-1.5",children:[["iam","sessionToken"].includes(t)&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"AWS Bedrock IAM Access ID"}),o.jsx("input",{type:"password",name:"AwsBedrockLLMAccessKeyId",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"AWS Bedrock IAM User Access ID",defaultValue:e!=null&&e.AwsBedrockLLMAccessKeyId?"*".repeat(20):"",required:!0,autoComplete:"off",spellCheck:!1})]}),o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"AWS Bedrock IAM Access Key"}),o.jsx("input",{type:"password",name:"AwsBedrockLLMAccessKey",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"AWS Bedrock IAM User Access Key",defaultValue:e!=null&&e.AwsBedrockLLMAccessKey?"*".repeat(20):"",required:!0,autoComplete:"off",spellCheck:!1})]})]}),t==="sessionToken"&&o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-theme-text-primary text-sm font-semibold block mb-3",children:"AWS Bedrock Session Token"}),o.jsx("input",{type:"password",name:"AwsBedrockLLMSessionToken",className:"border-none bg-theme-settings-input-bg text-theme-text-primary placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"AWS Bedrock Session Token",defaultValue:e!=null&&e.AwsBedrockLLMSessionToken?"*".repeat(20):"",required:!0,autoComplete:"off",spellCheck:!1})]}),t==="apiKey"&&o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-theme-text-primary text-sm font-semibold block mb-3",children:"AWS Bedrock API Key"}),o.jsx("input",{type:"password",name:"AwsBedrockLLMAPIKey",className:"border-none bg-theme-settings-input-bg text-theme-text-primary placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"AWS Bedrock API Key",defaultValue:e!=null&&e.AwsBedrockLLMAPIKey?"*".repeat(20):"",required:!0,autoComplete:"off",spellCheck:!1})]}),o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"AWS region"}),o.jsx("select",{name:"AwsBedrockLLMRegion",defaultValue:(e==null?void 0:e.AwsBedrockLLMRegion)||"us-west-2",required:!0,className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",children:r7.map(a=>o.jsxs("option",{value:a.code,children:[a.name," (",a.code,")"]},a.code))})]})]}),o.jsx("div",{className:"w-full flex items-center gap-[36px] my-1.5",children:!(e!=null&&e.credentialsOnly)&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Model ID"}),o.jsx("input",{type:"text",name:"AwsBedrockLLMModel",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"Model id from AWS eg: meta.llama3.1-v0.1",defaultValue:e==null?void 0:e.AwsBedrockLLMModel,required:!0,autoComplete:"off",spellCheck:!1})]}),o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Model context window"}),o.jsx("input",{type:"number",name:"AwsBedrockLLMTokenLimit",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"Content window limit (eg: 8192)",min:1,onScroll:a=>a.target.blur(),defaultValue:e==null?void 0:e.AwsBedrockLLMTokenLimit,required:!0,autoComplete:"off"})]}),o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Model max output tokens"}),o.jsx("input",{type:"number",name:"AwsBedrockLLMMaxOutputTokens",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"Max output tokens (eg: 4096)",min:1,onScroll:a=>a.target.blur(),defaultValue:e==null?void 0:e.AwsBedrockLLMMaxOutputTokens,required:!0,autoComplete:"off"})]})]})})]})}function p2({settings:e}){const[t,i]=m.useState(e==null?void 0:e.DeepSeekApiKey),[a,n]=m.useState(e==null?void 0:e.DeepSeekApiKey);return o.jsxs("div",{className:"flex gap-[36px] mt-1.5",children:[o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"API Key"}),o.jsx("input",{type:"password",name:"DeepSeekApiKey",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"DeepSeek API Key",defaultValue:e!=null&&e.DeepSeekApiKey?"*".repeat(20):"",required:!0,autoComplete:"off",spellCheck:!1,onChange:r=>i(r.target.value),onBlur:()=>n(t)})]}),!(e!=null&&e.credentialsOnly)&&o.jsx(o7,{settings:e,apiKey:a})]})}function o7({apiKey:e,settings:t}){const[i,a]=m.useState([]),[n,r]=m.useState(!0);return m.useEffect(()=>{async function s(){if(!e){a([]),r(!0);return}r(!0);const{models:l}=await K.customModels("deepseek",typeof e=="boolean"?null:e);a(l||[]),r(!1)}s()},[e]),n?o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Chat Model Selection"}),o.jsx("select",{name:"DeepSeekModelPref",disabled:!0,className:"border-none bg-theme-settings-input-bg border-gray-500 text-white text-sm rounded-lg block w-full p-2.5",children:o.jsx("option",{disabled:!0,selected:!0,children:"-- loading available models --"})})]}):o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Chat Model Selection"}),o.jsx("select",{name:"DeepSeekModelPref",required:!0,className:"border-none bg-theme-settings-input-bg border-gray-500 text-white text-sm rounded-lg block w-full p-2.5",children:i.map(s=>o.jsx("option",{value:s.id,selected:(t==null?void 0:t.DeepSeekModelPref)===s.id,children:s.name},s.id))})]})}function m2({settings:e}){return o.jsx("div",{className:"flex flex-col gap-y-4 mt-1.5",children:o.jsxs("div",{className:"flex gap-[36px]",children:[o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"APIpie API Key"}),o.jsx("input",{type:"password",name:"ApipieLLMApiKey",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"APIpie API Key",defaultValue:e!=null&&e.ApipieLLMApiKey?"*".repeat(20):"",required:!0,autoComplete:"off",spellCheck:!1})]}),!(e!=null&&e.credentialsOnly)&&o.jsx(s7,{settings:e})]})})}function s7({settings:e}){const[t,i]=m.useState({}),[a,n]=m.useState(!0);return m.useEffect(()=>{async function r(){n(!0);const{models:s}=await K.customModels("apipie");if((s==null?void 0:s.length)>0){const l=s.reduce((d,u)=>(d[u.organization]=d[u.organization]||[],d[u.organization].push(u),d),{});i(l)}n(!1)}r()},[]),a||Object.keys(t).length===0?o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Chat Model Selection"}),o.jsx("select",{name:"ApipieLLMModelPref",disabled:!0,className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",children:o.jsx("option",{disabled:!0,selected:!0,children:"-- loading available models --"})})]}):o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Chat Model Selection"}),o.jsx("select",{name:"ApipieLLMModelPref",required:!0,className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",children:Object.keys(t).sort().map(r=>o.jsx("optgroup",{label:r,children:t[r].map(s=>o.jsx("option",{value:s.id,selected:(e==null?void 0:e.ApipieLLMModelPref)===s.id,children:s.name},s.id))},r))})]})}function h2({settings:e}){const[t,i]=m.useState(e==null?void 0:e.XAIApiKey),[a,n]=m.useState(e==null?void 0:e.XAIApiKey);return o.jsxs("div",{className:"flex gap-[36px] mt-1.5",children:[o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"xAI API Key"}),o.jsx("input",{type:"password",name:"XAIApiKey",className:"border-none bg-theme-settings-input-bg text-theme-text-primary placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"xAI API Key",defaultValue:e!=null&&e.XAIApiKey?"*".repeat(20):"",required:!0,autoComplete:"off",spellCheck:!1,onChange:r=>i(r.target.value),onBlur:()=>n(t)})]}),!(e!=null&&e.credentialsOnly)&&o.jsx(l7,{settings:e,apiKey:a})]})}function l7({apiKey:e,settings:t}){const[i,a]=m.useState([]),[n,r]=m.useState(!0);return m.useEffect(()=>{async function s(){if(!e){a([]),r(!0);return}try{r(!0);const{models:l}=await K.customModels("xai",e);a(l||[])}catch(l){console.error("Failed to fetch custom models:",l),a([])}finally{r(!1)}}s()},[e]),n?o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-theme-text-primary text-sm font-semibold block mb-3",children:"Chat Model Selection"}),o.jsx("select",{name:"XAIModelPref",disabled:!0,className:"border-none bg-theme-settings-input-bg text-theme-text-primary border-theme-border text-sm rounded-lg block w-full p-2.5",children:o.jsx("option",{disabled:!0,selected:!0,children:"--loading available models--"})}),o.jsx("p",{className:"text-xs leading-[18px] font-base text-theme-text-primary opacity-60 mt-2",children:"Enter a valid API key to view all available models for your account."})]}):o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-theme-text-primary text-sm font-semibold block mb-3",children:"Chat Model Selection"}),o.jsx("select",{name:"XAIModelPref",required:!0,className:"border-none bg-theme-settings-input-bg text-theme-text-primary border-theme-border text-sm rounded-lg block w-full p-2.5",children:i.length>0&&o.jsx("optgroup",{label:"Available models",children:i.map(s=>o.jsx("option",{value:s.id,selected:(t==null?void 0:t.XAIModelPref)===s.id,children:s.id},s.id))})}),o.jsx("p",{className:"text-xs leading-[18px] font-base text-theme-text-primary opacity-60 mt-2",children:"Select the xAI model you want to use for your conversations."})]})}function g2({settings:e}){const[t,i]=m.useState(e==null?void 0:e.ZAiApiKey),[a,n]=m.useState(e==null?void 0:e.ZAiApiKey);return o.jsxs("div",{className:"flex gap-[36px] mt-1.5",children:[o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Z.AI API Key"}),o.jsx("input",{type:"password",name:"ZAiApiKey",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"Z.AI API Key",defaultValue:e!=null&&e.ZAiApiKey?"*".repeat(20):"",required:!0,autoComplete:"off",spellCheck:!1,onChange:r=>i(r.target.value),onBlur:()=>n(t)})]}),!(e!=null&&e.credentialsOnly)&&o.jsx(c7,{settings:e,apiKey:a})]})}function c7({apiKey:e,settings:t}){const[i,a]=m.useState([]),[n,r]=m.useState(!0);return m.useEffect(()=>{async function s(){if(!e){a([]),r(!0);return}try{r(!0);const{models:l}=await K.customModels("zai",e);a(l||[])}catch(l){console.error("Failed to fetch custom models:",l),a([])}finally{r(!1)}}s()},[e]),n?o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Chat Model Selection"}),o.jsx("select",{name:"ZAiModelPref",disabled:!0,className:"border-none bg-theme-settings-input-bg border-gray-500 text-white text-sm rounded-lg block w-full p-2.5",children:o.jsx("option",{disabled:!0,selected:!0,children:"--loading available models--"})}),o.jsx("p",{className:"text-xs leading-[18px] font-base text-white text-opacity-60 mt-2",children:"Enter a valid API key to view all available models for your account."})]}):o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Chat Model Selection"}),o.jsx("select",{name:"ZAiModelPref",required:!0,className:"border-none bg-theme-settings-input-bg border-gray-500 text-white text-sm rounded-lg block w-full p-2.5",children:i.length>0&&o.jsx("optgroup",{label:"Available models",children:i.map(s=>o.jsx("option",{value:s.id,selected:(t==null?void 0:t.ZAiModelPref)===s.id,children:s.id},s.id))})}),o.jsx("p",{className:"text-xs leading-[18px] font-base text-white text-opacity-60 mt-2",children:"Select the Z.AI model you want to use for your conversations."})]})}function d7({settings:e}){const{autoDetecting:t,basePath:i,basePathValue:a,handleAutoDetectClick:n}=an({provider:"nvidia-nim",initialBasePath:e==null?void 0:e.NvidiaNimLLMBasePath,ENDPOINTS:U6});return o.jsxs("div",{className:"flex gap-[36px] mt-1.5",children:[o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsxs("div",{className:"flex justify-between items-center mb-2",children:[o.jsx("label",{className:"text-white text-sm font-semibold",children:"NVIDIA Nim Base URL"}),t?o.jsx(Nn,{size:"6"}):o.jsx(o.Fragment,{children:!a.value&&o.jsx("button",{onClick:n,className:"bg-primary-button text-xs font-medium px-2 py-1 rounded-lg hover:bg-secondary hover:text-white shadow-[0_4px_14px_rgba(0,0,0,0.25)]",children:"Auto-Detect"})})]}),o.jsx("input",{type:"url",name:"NvidiaNimLLMBasePath",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"http://localhost:8000/v1",value:a.value,required:!0,autoComplete:"off",spellCheck:!1,onChange:i.onChange,onBlur:i.onBlur}),o.jsx("p",{className:"text-xs leading-[18px] font-base text-white text-opacity-60 mt-2",children:"Enter the URL where NVIDIA NIM is running."})]}),!(e!=null&&e.credentialsOnly)&&o.jsx(u7,{settings:e,basePath:i.value})]})}function u7({settings:e,basePath:t}){const[i,a]=m.useState([]),[n,r]=m.useState(!0);return m.useEffect(()=>{async function s(){r(!0);const{models:l}=await K.customModels("nvidia-nim",null,t);a(l),r(!1)}s()},[t]),n||i.length===0?o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Chat Model Selection"}),o.jsx("select",{name:"NvidiaNimLLMModelPref",disabled:!0,className:"border-none bg-theme-settings-input-bg border-gray-500 text-white text-sm rounded-lg block w-full p-2.5",children:o.jsx("option",{disabled:!0,selected:!0,children:"-- loading available models --"})})]}):o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Chat Model Selection"}),o.jsx("select",{name:"NvidiaNimLLMModelPref",required:!0,className:"border-none bg-theme-settings-input-bg border-gray-500 text-white text-sm rounded-lg block w-full p-2.5",children:i.map(s=>o.jsx("option",{value:s.id,selected:(e==null?void 0:e.NvidiaNimLLMModelPref)===s.id,children:s.name},s.id))})]})}function p7({settings:e}){return null}function f2({settings:e}){return"remote"==="remote"?o.jsx(d7,{settings:e}):o.jsx(p7,{settings:e})}function b2({settings:e}){return o.jsx("div",{className:"w-full flex flex-col gap-y-7",children:o.jsxs("div",{className:"w-full flex items-start gap-[36px] mt-1.5",children:[o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-theme-text-primary text-sm font-semibold block mb-3",children:"PPIO API Key"}),o.jsx("input",{type:"password",name:"PPIOApiKey",className:"border-none bg-theme-settings-input-bg text-theme-text-primary placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"PPIO API Key",defaultValue:e!=null&&e.PPIOApiKey?"*".repeat(20):"",required:!0,autoComplete:"off",spellCheck:!1})]}),!(e!=null&&e.credentialsOnly)&&o.jsx(m7,{settings:e})]})})}function m7({settings:e}){const[t,i]=m.useState({}),[a,n]=m.useState(!0);return m.useEffect(()=>{async function r(){n(!0);const{models:s}=await K.customModels("ppio");if((s==null?void 0:s.length)>0){const l=s.reduce((d,u)=>(d[u.organization]=d[u.organization]||[],d[u.organization].push(u),d),{});i(l)}n(!1)}r()},[]),a||Object.keys(t).length===0?o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-theme-text-primary text-sm font-semibold block mb-3",children:"Chat Model Selection"}),o.jsx("select",{name:"PPIOModelPref",required:!0,disabled:!0,className:"bg-theme-settings-input-bg text-theme-text-primary text-sm rounded-lg focus:ring-primary-button focus:border-primary-button block w-full p-2.5",children:o.jsx("option",{disabled:!0,selected:!0,children:"-- loading available models --"})})]}):o.jsxs("div",{className:"flex flex-col",children:[o.jsx("label",{className:"text-theme-text-primary text-sm font-semibold block mb-3",children:"Chat Model Selection"}),o.jsx("select",{name:"PPIOModelPref",required:!0,className:"border-none bg-theme-settings-input-bg text-theme-text-primary border-theme-border text-sm rounded-lg block w-full p-2.5",children:Object.keys(t).sort().map(r=>o.jsx("optgroup",{label:r,children:t[r].map(s=>o.jsx("option",{value:s.id,selected:(e==null?void 0:e.PPIOModelPref)===s.id,children:s.name},s.id))},r))})]})}function v2({settings:e}){const{autoDetecting:t,basePath:i,basePathValue:a,showAdvancedControls:n,setShowAdvancedControls:r,handleAutoDetectClick:s}=an({provider:"dpais",initialBasePath:e==null?void 0:e.DellProAiStudioBasePath,ENDPOINTS:F6});return o.jsxs("div",{className:"w-full flex flex-col gap-y-7",children:[o.jsx("div",{className:"w-full flex items-center gap-[36px] mt-1.5",children:!(e!=null&&e.credentialsOnly)&&o.jsxs(o.Fragment,{children:[o.jsx(h7,{settings:e,basePath:i.value}),o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-2",children:"Model context window"}),o.jsx("input",{type:"number",name:"DellProAiStudioTokenLimit",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"4096",min:1,onScroll:l=>l.target.blur(),defaultValue:e==null?void 0:e.DellProAiStudioTokenLimit,required:!0,autoComplete:"off"})]})]})}),o.jsx("div",{className:"flex justify-start mt-4",children:o.jsxs("button",{onClick:l=>{l.preventDefault(),r(!n)},className:"border-none text-theme-text-primary hover:text-theme-text-secondary flex items-center text-sm",children:[n?"Hide":"Show"," advanced settings",n?o.jsx(aa,{size:14,className:"ml-1"}):o.jsx(Ri,{size:14,className:"ml-1"})]})}),o.jsx("div",{hidden:!n,children:o.jsx("div",{className:"w-full flex items-center gap-4",children:o.jsxs("div",{className:"flex flex-col w-fit",children:[o.jsxs("div",{className:"flex justify-between items-center mb-2 gap-x-2",children:[o.jsx("label",{className:"text-white text-sm font-semibold",children:"Dell Pro AI Studio Base URL"}),t?o.jsx(Nn,{size:"6"}):o.jsx(o.Fragment,{children:!a.value&&o.jsx("button",{onClick:s,className:"bg-primary-button text-xs font-medium px-2 py-1 rounded-lg hover:bg-secondary hover:text-white shadow-[0_4px_14px_rgba(0,0,0,0.25)]",children:"Auto-Detect"})})]}),o.jsx("input",{type:"url",name:"DellProAiStudioBasePath",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"http://localhost:8553/v1/openai",value:a.value,required:!0,autoComplete:"off",spellCheck:!1,onChange:i.onChange,onBlur:i.onBlur})]})})})]})}function h7({settings:e,basePath:t=null}){const[i,a]=m.useState([]),[n,r]=m.useState(!0);return m.useEffect(()=>{async function s(){if(!t){a([]),r(!1);return}r(!0);const{models:l}=await K.customModels("dpais",null,t,2e3);a(l||[]),r(!1)}s()},[t]),n||i.length==0?o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-2",children:"Chat Model Selection"}),o.jsx("select",{name:"DellProAiStudioModelPref",disabled:!0,className:"border-none bg-theme-settings-input-bg border-gray-500 text-white text-sm rounded-lg block w-full p-2.5",children:o.jsx("option",{disabled:!0,selected:!0,children:"-- loading available models --"})})]}):o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-2",children:"Chat Model Selection"}),o.jsx("select",{name:"DellProAiStudioModelPref",required:!0,className:"border-none bg-theme-settings-input-bg border-gray-500 text-white text-sm rounded-lg block w-full p-2.5",children:i.length>0&&o.jsx("optgroup",{label:"Your loaded models",children:i.map(s=>o.jsx("option",{value:s.id,selected:e.DellProAiStudioModelPref===s.id,children:s.id},s.id))})})]})}function k2({settings:e}){const[t,i]=m.useState(e==null?void 0:e.MoonshotAiApiKey),[a,n]=m.useState(e==null?void 0:e.MoonshotAiApiKey);return o.jsxs("div",{className:"flex gap-[36px] mt-1.5",children:[o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"API Key"}),o.jsx("input",{type:"password",name:"MoonshotAiApiKey",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"Moonshot AI API Key",defaultValue:e!=null&&e.MoonshotAiApiKey?"*".repeat(20):"",required:!0,autoComplete:"off",spellCheck:!1,onChange:r=>i(r.target.value),onBlur:()=>n(t)})]}),!(e!=null&&e.credentialsOnly)&&o.jsx(g7,{settings:e,apiKey:a})]})}function g7({apiKey:e,settings:t}){const[i,a]=m.useState([]),[n,r]=m.useState(!0);return m.useEffect(()=>{async function s(){r(!0);const{models:l}=await K.customModels("moonshotai",typeof e=="boolean"?null:e);(l==null?void 0:l.length)>0&&a(l),r(!1)}s()},[e]),e?n?o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Chat Model Selection"}),o.jsx("select",{name:"MoonshotAiModelPref",disabled:!0,className:"border-none bg-theme-settings-input-bg border-gray-500 text-white text-sm rounded-lg block w-full p-2.5",children:o.jsx("option",{disabled:!0,selected:!0,children:"-- loading available models --"})})]}):o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Chat Model Selection"}),o.jsx("select",{name:"MoonshotAiModelPref",required:!0,className:"border-none bg-theme-settings-input-bg border-gray-500 text-white text-sm rounded-lg block w-full p-2.5",children:i.map(s=>o.jsx("option",{value:s.id,selected:(t==null?void 0:t.MoonshotAiModelPref)===s.id,children:s.id},s.id))})]}):o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Chat Model Selection"}),o.jsx("select",{name:"MoonshotAiModelPref",disabled:!0,className:"border-none bg-theme-settings-input-bg border-gray-500 text-white text-sm rounded-lg block w-full p-2.5",children:o.jsx("option",{disabled:!0,selected:!0,children:"-- Enter API key --"})})]})}function f7({settings:e}){const[t,i]=m.useState([]),[a,n]=m.useState(!!(e!=null&&e.FoundryBasePath)),[r,s]=m.useState(e==null?void 0:e.FoundryBasePath),[l,d]=m.useState((e==null?void 0:e.FoundryModelPref)||"");return m.useEffect(()=>{d((e==null?void 0:e.FoundryModelPref)||"")},[e==null?void 0:e.FoundryModelPref]),m.useEffect(()=>{async function u(){try{if(n(!0),!r)throw new Error("Base path is required");const{models:h,error:g}=await K.customModels("foundry",null,r);if(g)throw new Error(g);i(h)}catch(h){console.error("Error fetching Foundry models:",h),i([])}finally{n(!1)}}u()},[r]),o.jsx("div",{className:"flex flex-col gap-y-7",children:o.jsxs("div",{className:"flex gap-[36px] mt-1.5 flex-wrap",children:[o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Base URL"}),o.jsx("input",{type:"url",name:"FoundryBasePath",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"eg: http://127.0.0.1:8080",defaultValue:e==null?void 0:e.FoundryBasePath,required:!0,autoComplete:"off",spellCheck:!1,onChange:u=>s(u.target.value)})]}),o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Chat Model"}),a?o.jsx("select",{name:"FoundryModelPref",required:!0,disabled:!0,className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",children:o.jsx("option",{children:"---- Loading ----"})}):o.jsx("select",{name:"FoundryModelPref",value:l,onChange:u=>d(u.target.value),required:!0,className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",children:t.length>0?o.jsxs(o.Fragment,{children:[o.jsx("option",{value:"",children:"-- Select a model --"}),t.map(u=>o.jsx("option",{value:u.id,children:u.id},u.id))]}):o.jsx("option",{disabled:!0,value:"",children:"No models found"})})]}),o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Model context window"}),o.jsx("input",{type:"number",name:"FoundryModelTokenLimit",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"4096",defaultValue:e==null?void 0:e.FoundryModelTokenLimit,autoComplete:"off",min:0})]})]})})}function y2({settings:e}){return o.jsxs("div",{className:"flex gap-[36px] mt-1.5",children:[o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"API Key"}),o.jsx("input",{type:"password",name:"GiteeAIApiKey",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"GiteeAI API Key",defaultValue:e!=null&&e.GiteeAIApiKey?"*".repeat(20):"",required:!0,autoComplete:"off",spellCheck:!1})]}),!(e!=null&&e.credentialsOnly)&&o.jsxs(o.Fragment,{children:[o.jsx(b7,{settings:e}),o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-2",children:"Model context window"}),o.jsx("input",{type:"number",name:"GiteeAITokenLimit",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"Content window limit (eg: 8192)",min:1,onScroll:t=>t.target.blur(),defaultValue:e==null?void 0:e.GiteeAITokenLimit,required:!0,autoComplete:"off"})]})]})]})}function b7({settings:e}){const[t,i]=m.useState({}),[a,n]=m.useState(!0);return m.useEffect(()=>{async function r(){n(!0);const{models:s=[]}=await K.customModels("giteeai");if((s==null?void 0:s.length)>0){const l=s.reduce((d,u)=>(d[u.organization]=d[u.organization]||[],d[u.organization].push(u),d),{});i(l)}n(!1)}r()},[]),a?o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Chat Model Selection"}),o.jsx("select",{name:"GiteeAIModelPref",disabled:!0,className:"border-none bg-theme-settings-input-bg border-gray-500 text-white text-sm rounded-lg block w-full p-2.5",children:o.jsx("option",{disabled:!0,selected:!0,children:"-- loading available models --"})})]}):o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Chat Model Selection"}),o.jsx("select",{name:"GiteeAIModelPref",required:!0,className:"border-none bg-theme-settings-input-bg border-gray-500 text-white text-sm rounded-lg block w-full p-2.5",children:Object.keys(t).sort().map(r=>o.jsx("optgroup",{label:r,children:t[r].map(s=>o.jsx("option",{value:s.id,selected:(e==null?void 0:e.GiteeAIModelPref)===s.id,children:s.name},s.id))},r))})]})}var v7=function(){function e(t,i,a,n,r){return t<i||a<i?t>a?a+1:t+1:n===r?i:i+1}return function(t,i){if(t===i)return 0;if(t.length>i.length){var a=t;t=i,i=a}for(var n=t.length,r=i.length;n>0&&t.charCodeAt(n-1)===i.charCodeAt(r-1);)n--,r--;for(var s=0;s<n&&t.charCodeAt(s)===i.charCodeAt(s);)s++;if(n-=s,r-=s,n===0||r<3)return r;var l=0,d,u,h,g,p,v,f,b,w,y,k,_,x=[];for(d=0;d<n;d++)x.push(d+1),x.push(t.charCodeAt(s+d));for(var A=x.length-1;l<r-3;)for(w=i.charCodeAt(s+(u=l)),y=i.charCodeAt(s+(h=l+1)),k=i.charCodeAt(s+(g=l+2)),_=i.charCodeAt(s+(p=l+3)),v=l+=4,d=0;d<A;d+=2)f=x[d],b=x[d+1],u=e(f,u,h,w,b),h=e(u,h,g,y,b),g=e(h,g,p,k,b),v=e(g,p,v,_,b),x[d]=v,p=g,g=h,h=u,u=f;for(;l<r;)for(w=i.charCodeAt(s+(u=l)),v=++l,d=0;d<A;d+=2)f=x[d],x[d]=v=e(f,u,v,w,x[d+1]),u=f;return v}}();const Vl=Cn(v7);function k7(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var w2={exports:{}};(function(e,t){(function(i,a){typeof k7=="function"?e.exports=a():i.pluralize=a()})(Ti,function(){var i=[],a=[],n={},r={},s={};function l(b){return typeof b=="string"?new RegExp("^"+b+"$","i"):b}function d(b,w){return b===w?w:b===b.toLowerCase()?w.toLowerCase():b===b.toUpperCase()?w.toUpperCase():b[0]===b[0].toUpperCase()?w.charAt(0).toUpperCase()+w.substr(1).toLowerCase():w.toLowerCase()}function u(b,w){return b.replace(/\$(\d{1,2})/g,function(y,k){return w[k]||""})}function h(b,w){return b.replace(w[0],function(y,k){var _=u(w[1],arguments);return d(y===""?b[k-1]:y,_)})}function g(b,w,y){if(!b.length||n.hasOwnProperty(b))return w;for(var k=y.length;k--;){var _=y[k];if(_[0].test(w))return h(w,_)}return w}function p(b,w,y){return function(k){var _=k.toLowerCase();return w.hasOwnProperty(_)?d(k,_):b.hasOwnProperty(_)?d(k,b[_]):g(_,k,y)}}function v(b,w,y,k){return function(_){var x=_.toLowerCase();return w.hasOwnProperty(x)?!0:b.hasOwnProperty(x)?!1:g(x,x,y)===x}}function f(b,w,y){var k=w===1?f.singular(b):f.plural(b);return(y?w+" ":"")+k}return f.plural=p(s,r,i),f.isPlural=v(s,r,i),f.singular=p(r,s,a),f.isSingular=v(r,s,a),f.addPluralRule=function(b,w){i.push([l(b),w])},f.addSingularRule=function(b,w){a.push([l(b),w])},f.addUncountableRule=function(b){if(typeof b=="string"){n[b.toLowerCase()]=!0;return}f.addPluralRule(b,"$0"),f.addSingularRule(b,"$0")},f.addIrregularRule=function(b,w){w=w.toLowerCase(),b=b.toLowerCase(),s[b]=w,r[w]=b},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach(function(b){return f.addIrregularRule(b[0],b[1])}),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach(function(b){return f.addPluralRule(b[0],b[1])}),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach(function(b){return f.addSingularRule(b[0],b[1])}),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eé]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(f.addUncountableRule),f})})(w2);var y7=w2.exports;const w7=Cn(y7);function _7(e){return e.toLowerCase()}var x7=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],z7=/[^A-Z0-9]+/gi;function A7(e,t){t===void 0&&(t={});for(var i=t.splitRegexp,a=i===void 0?x7:i,n=t.stripRegexp,r=n===void 0?z7:n,s=t.transform,l=s===void 0?_7:s,d=t.delimiter,u=d===void 0?" ":d,h=x0(x0(e,a,"$1\0$2"),r,"\0"),g=0,p=h.length;h.charAt(g)==="\0";)g++;for(;h.charAt(p-1)==="\0";)p--;return h.slice(g,p).split("\0").map(l).join(u)}function x0(e,t,i){return t instanceof RegExp?e.replace(t,i):t.reduce(function(a,n){return a.replace(n,i)},e)}function j7(e){return e.charAt(0).toUpperCase()+e.substr(1)}var rp=globalThis&&globalThis.__assign||function(){return rp=Object.assign||function(e){for(var t,i=1,a=arguments.length;i<a;i++){t=arguments[i];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},rp.apply(this,arguments)};function L7(e,t){var i=e.toLowerCase();return t===0?j7(i):i}function S7(e,t){return t===void 0&&(t={}),A7(e,rp({delimiter:" ",transform:L7},t))}var M7=/\b(?:an?d?|a[st]|because|but|by|en|for|i[fn]|neither|nor|o[fnr]|only|over|per|so|some|tha[tn]|the|to|up|upon|vs?\.?|versus|via|when|with|without|yet)\b/i,P7=/[^\s:–—-]+|./g,C7=/\s/,E7=/.(?=[A-Z]|\..)/,T7=/[A-Za-z0-9\u00C0-\u00FF]/;function _2(e){for(var t="",i;(i=P7.exec(e))!==null;){var a=i[0],n=i.index;if(!E7.test(a)&&(!M7.test(a)||n===0||n+a.length===e.length)&&(e.charAt(n+a.length)!==":"||C7.test(e.charAt(n+a.length+1)))){t+=a.replace(T7,function(r){return r.toUpperCase()});continue}t+=a}return t}const I7=Intl.NumberFormat("en",{notation:"compact"});function OD(e){return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}function RD(e){return I7.format(e)}function HD(e=null,t=0){if(isNaN(e)||e===null)return"";const i=Math.round(e*100);return(t>0?i.toFixed(t):i.toString())+"%"}function N7(e,t=!1,i=1){const a=t?1e3:1024;if(Math.abs(e)<a)return e+" B";const n=t?["kB","MB","GB","TB","PB","EB","ZB","YB"]:["KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"];let r=-1;const s=10**i;do e/=a,++r;while(Math.round(Math.abs(e)*s)/s>=a&&r<n.length-1);return e.toFixed(i)+" "+n[r]}function VD(e=0){const t=parseFloat(e)/1e3;var i=Math.floor(t/3600),a=Math.floor(t%3600/60),n=parseFloat(t%3600%60),r=i>=1?i+"h ":"",s=a>=1?a+"m ":"",l=n>=.01?n.toFixed(2)+"s":"";return r+s+l}function qD(e){try{if(e<0)return"";if(e<1)return`${(e*1e3).toFixed(0)}ms`;if(e<60)return`${e.toFixed(1)}s`;if(e<3600){const n=Math.floor(e/60),r=Math.floor(e%60);return`${n}m ${r}s`}const t=Math.floor(e/3600),i=Math.floor(e%3600/60),a=Math.floor(e%60);return`${t}h ${i}m ${a}s`}catch{return""}}var D7="OpenAI";function No(e){"@babel/helpers - typeof";return No=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},No(e)}var O7=["size","style"];function z0(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),i.push.apply(i,a)}return i}function vd(e){for(var t=1;t<arguments.length;t++){var i=arguments[t]!=null?arguments[t]:{};t%2?z0(Object(i),!0).forEach(function(a){R7(e,a,i[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):z0(Object(i)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(i,a))})}return e}function R7(e,t,i){return t=H7(t),t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function H7(e){var t=V7(e,"string");return No(t)=="symbol"?t:String(t)}function V7(e,t){if(No(e)!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var a=i.call(e,t||"default");if(No(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function q7(e,t){if(e==null)return{};var i=F7(e,t),a,n;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n<r.length;n++)a=r[n],!(t.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(i[a]=e[a])}return i}function F7(e,t){if(e==null)return{};var i={},a=Object.keys(e),n,r;for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&(i[n]=e[n]);return i}var U7=m.memo(function(e){var t=e.size,i=t===void 0?"1em":t,a=e.style,n=q7(e,O7);return o.jsxs("svg",vd(vd({fill:"currentColor",fillRule:"evenodd",height:i,style:vd({flex:"none",lineHeight:1},a),viewBox:"0 0 24 24",width:i,xmlns:"http://www.w3.org/2000/svg"},n),{},{children:[o.jsx("title",{children:D7}),o.jsx("path",{d:"M21.55 10.004a5.416 5.416 0 00-.478-4.501c-1.217-2.09-3.662-3.166-6.05-2.66A5.59 5.59 0 0010.831 1C8.39.995 6.224 2.546 5.473 4.838A5.553 5.553 0 001.76 7.496a5.487 5.487 0 00.691 6.5 5.416 5.416 0 00.477 4.502c1.217 2.09 3.662 3.165 6.05 2.66A5.586 5.586 0 0013.168 23c2.443.006 4.61-1.546 5.361-3.84a5.553 5.553 0 003.715-2.66 5.488 5.488 0 00-.693-6.497v.001zm-8.381 11.558a4.199 4.199 0 01-2.675-.954c.034-.018.093-.05.132-.074l4.44-2.53a.71.71 0 00.364-.623v-6.176l1.877 1.069c.02.01.033.029.036.05v5.115c-.003 2.274-1.87 4.118-4.174 4.123zM4.192 17.78a4.059 4.059 0 01-.498-2.763c.032.02.09.055.131.078l4.44 2.53c.225.13.504.13.73 0l5.42-3.088v2.138a.068.068 0 01-.027.057L9.9 19.288c-1.999 1.136-4.552.46-5.707-1.51h-.001zM3.023 8.216A4.15 4.15 0 015.198 6.41l-.002.151v5.06a.711.711 0 00.364.624l5.42 3.087-1.876 1.07a.067.067 0 01-.063.005l-4.489-2.559c-1.995-1.14-2.679-3.658-1.53-5.63h.001zm15.417 3.54l-5.42-3.088L14.896 7.6a.067.067 0 01.063-.006l4.489 2.557c1.998 1.14 2.683 3.662 1.529 5.633a4.163 4.163 0 01-2.174 1.807V12.38a.71.71 0 00-.363-.623zm1.867-2.773a6.04 6.04 0 00-.132-.078l-4.44-2.53a.731.731 0 00-.729 0l-5.42 3.088V7.325a.068.068 0 01.027-.057L14.1 4.713c2-1.137 4.555-.46 5.707 1.513.487.833.664 1.809.499 2.757h.001zm-11.741 3.81l-1.877-1.068a.065.065 0 01-.036-.051V6.559c.001-2.277 1.873-4.122 4.181-4.12.976 0 1.92.338 2.671.954-.034.018-.092.05-.131.073l-4.44 2.53a.71.71 0 00-.365.623l-.003 6.173v.002zm1.02-2.168L12 9.25l2.414 1.375v2.75L12 14.75l-2.415-1.375v-2.75z"})]}))});const op=U7;var B7="Anthropic";function Do(e){"@babel/helpers - typeof";return Do=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Do(e)}var G7=["size","style"];function A0(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),i.push.apply(i,a)}return i}function kd(e){for(var t=1;t<arguments.length;t++){var i=arguments[t]!=null?arguments[t]:{};t%2?A0(Object(i),!0).forEach(function(a){K7(e,a,i[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):A0(Object(i)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(i,a))})}return e}function K7(e,t,i){return t=W7(t),t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function W7(e){var t=$7(e,"string");return Do(t)=="symbol"?t:String(t)}function $7(e,t){if(Do(e)!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var a=i.call(e,t||"default");if(Do(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Z7(e,t){if(e==null)return{};var i=J7(e,t),a,n;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n<r.length;n++)a=r[n],!(t.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(i[a]=e[a])}return i}function J7(e,t){if(e==null)return{};var i={},a=Object.keys(e),n,r;for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&(i[n]=e[n]);return i}var Q7=m.memo(function(e){var t=e.size,i=t===void 0?"1em":t,a=e.style,n=Z7(e,G7);return o.jsxs("svg",kd(kd({fill:"currentColor",fillRule:"evenodd",height:i,style:kd({flex:"none",lineHeight:1},a),viewBox:"0 0 24 24",width:i,xmlns:"http://www.w3.org/2000/svg"},n),{},{children:[o.jsx("title",{children:B7}),o.jsx("path",{d:"M13.827 3.52h3.603L24 20h-3.603l-6.57-16.48zm-7.258 0h3.767L16.906 20h-3.674l-1.343-3.461H5.017l-1.344 3.46H0L6.57 3.522zm4.132 9.959L8.453 7.687 6.205 13.48H10.7z"})]}))});const x2=Q7;var Y7="Google";function Oo(e){"@babel/helpers - typeof";return Oo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Oo(e)}var X7=["size","style"];function j0(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),i.push.apply(i,a)}return i}function yd(e){for(var t=1;t<arguments.length;t++){var i=arguments[t]!=null?arguments[t]:{};t%2?j0(Object(i),!0).forEach(function(a){eT(e,a,i[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):j0(Object(i)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(i,a))})}return e}function eT(e,t,i){return t=tT(t),t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function tT(e){var t=iT(e,"string");return Oo(t)=="symbol"?t:String(t)}function iT(e,t){if(Oo(e)!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var a=i.call(e,t||"default");if(Oo(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function aT(e,t){if(e==null)return{};var i=nT(e,t),a,n;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n<r.length;n++)a=r[n],!(t.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(i[a]=e[a])}return i}function nT(e,t){if(e==null)return{};var i={},a=Object.keys(e),n,r;for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&(i[n]=e[n]);return i}var rT=m.memo(function(e){var t=e.size,i=t===void 0?"1em":t,a=e.style,n=aT(e,X7);return o.jsxs("svg",yd(yd({fill:"currentColor",fillRule:"evenodd",height:i,style:yd({flex:"none",lineHeight:1},a),viewBox:"0 0 24 24",width:i,xmlns:"http://www.w3.org/2000/svg"},n),{},{children:[o.jsx("title",{children:Y7}),o.jsx("path",{d:"M23 12.245c0-.905-.075-1.565-.236-2.25h-10.54v4.083h6.186c-.124 1.014-.797 2.542-2.294 3.569l-.021.136 3.332 2.53.23.022C21.779 18.417 23 15.593 23 12.245z"}),o.jsx("path",{d:"M12.225 23c3.03 0 5.574-.978 7.433-2.665l-3.542-2.688c-.948.648-2.22 1.1-3.891 1.1a6.745 6.745 0 01-6.386-4.572l-.132.011-3.465 2.628-.045.124C4.043 20.531 7.835 23 12.225 23z"}),o.jsx("path",{d:"M5.84 14.175A6.65 6.65 0 015.463 12c0-.758.138-1.491.361-2.175l-.006-.147-3.508-2.67-.115.054A10.831 10.831 0 001 12c0 1.772.436 3.447 1.197 4.938l3.642-2.763z"}),o.jsx("path",{d:"M12.225 5.253c2.108 0 3.529.892 4.34 1.638l3.167-3.031C17.787 2.088 15.255 1 12.225 1 7.834 1 4.043 3.469 2.197 7.062l3.63 2.763a6.77 6.77 0 016.398-4.572z"})]}))});const oT=rT;var sT="Gemma";function Ro(e){"@babel/helpers - typeof";return Ro=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ro(e)}var lT=["size","style"];function L0(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),i.push.apply(i,a)}return i}function wd(e){for(var t=1;t<arguments.length;t++){var i=arguments[t]!=null?arguments[t]:{};t%2?L0(Object(i),!0).forEach(function(a){cT(e,a,i[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):L0(Object(i)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(i,a))})}return e}function cT(e,t,i){return t=dT(t),t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function dT(e){var t=uT(e,"string");return Ro(t)=="symbol"?t:String(t)}function uT(e,t){if(Ro(e)!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var a=i.call(e,t||"default");if(Ro(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function pT(e,t){if(e==null)return{};var i=mT(e,t),a,n;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n<r.length;n++)a=r[n],!(t.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(i[a]=e[a])}return i}function mT(e,t){if(e==null)return{};var i={},a=Object.keys(e),n,r;for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&(i[n]=e[n]);return i}var hT=m.memo(function(e){var t=e.size,i=t===void 0?"1em":t,a=e.style,n=pT(e,lT);return o.jsxs("svg",wd(wd({fill:"currentColor",fillRule:"evenodd",height:i,style:wd({flex:"none",lineHeight:1},a),viewBox:"0 0 24 24",width:i,xmlns:"http://www.w3.org/2000/svg"},n),{},{children:[o.jsx("title",{children:sT}),o.jsx("path",{d:"M12.34 5.953a8.233 8.233 0 01-.247-1.125V3.72a8.25 8.25 0 015.562 2.232H12.34zm-.69 0c.113-.373.199-.755.257-1.145V3.72a8.25 8.25 0 00-5.562 2.232h5.304zm-5.433.187h5.373a7.98 7.98 0 01-.267.696 8.41 8.41 0 01-1.76 2.65L6.216 6.14zm-.264-.187H2.977v.187h2.915a8.436 8.436 0 00-2.357 5.767H0v.186h3.535a8.436 8.436 0 002.357 5.767H2.977v.186h2.976v2.977h.187v-2.915a8.436 8.436 0 005.767 2.357V24h.186v-3.535a8.436 8.436 0 005.767-2.357v2.915h.186v-2.977h2.977v-.186h-2.915a8.436 8.436 0 002.357-5.767H24v-.186h-3.535a8.436 8.436 0 00-2.357-5.767h2.915v-.187h-2.977V2.977h-.186v2.915a8.436 8.436 0 00-5.767-2.357V0h-.186v3.535A8.436 8.436 0 006.14 5.892V2.977h-.187v2.976zm6.14 14.326a8.25 8.25 0 005.562-2.233H12.34c-.108.367-.19.743-.247 1.126v1.107zm-.186-1.087a8.015 8.015 0 00-.258-1.146H6.345a8.25 8.25 0 005.562 2.233v-1.087zm-8.186-7.285h1.107a8.23 8.23 0 001.125-.247V6.345a8.25 8.25 0 00-2.232 5.562zm1.087.186H3.72a8.25 8.25 0 002.232 5.562v-5.304a8.012 8.012 0 00-1.145-.258zm15.47-.186a8.25 8.25 0 00-2.232-5.562v5.315c.367.108.743.19 1.126.247h1.107zm-1.086.186c-.39.058-.772.144-1.146.258v5.304a8.25 8.25 0 002.233-5.562h-1.087zm-1.332 5.69V12.41a7.97 7.97 0 00-.696.267 8.409 8.409 0 00-2.65 1.76l3.346 3.346zm0-6.18v-5.45l-.012-.013h-5.451c.076.235.162.468.26.696a8.698 8.698 0 001.819 2.688 8.698 8.698 0 002.688 1.82c.228.097.46.183.696.259zM6.14 17.848V12.41c.235.078.468.167.696.267a8.403 8.403 0 012.688 1.799 8.404 8.404 0 011.799 2.688c.1.228.19.46.267.696H6.152l-.012-.012zm0-6.245V6.326l3.29 3.29a8.716 8.716 0 01-2.594 1.728 8.14 8.14 0 01-.696.259zm6.257 6.257h5.277l-3.29-3.29a8.716 8.716 0 00-1.728 2.594 8.135 8.135 0 00-.259.696zm-2.347-7.81a9.435 9.435 0 01-2.88 1.96 9.14 9.14 0 012.88 1.94 9.14 9.14 0 011.94 2.88 9.435 9.435 0 011.96-2.88 9.14 9.14 0 012.88-1.94 9.435 9.435 0 01-2.88-1.96 9.434 9.434 0 01-1.96-2.88 9.14 9.14 0 01-1.94 2.88z"})]}))});const z2=hT;var gT="Gemini";function Ho(e){"@babel/helpers - typeof";return Ho=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ho(e)}var fT=["size","style"];function S0(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),i.push.apply(i,a)}return i}function _d(e){for(var t=1;t<arguments.length;t++){var i=arguments[t]!=null?arguments[t]:{};t%2?S0(Object(i),!0).forEach(function(a){bT(e,a,i[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):S0(Object(i)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(i,a))})}return e}function bT(e,t,i){return t=vT(t),t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function vT(e){var t=kT(e,"string");return Ho(t)=="symbol"?t:String(t)}function kT(e,t){if(Ho(e)!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var a=i.call(e,t||"default");if(Ho(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function yT(e,t){if(e==null)return{};var i=wT(e,t),a,n;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n<r.length;n++)a=r[n],!(t.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(i[a]=e[a])}return i}function wT(e,t){if(e==null)return{};var i={},a=Object.keys(e),n,r;for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&(i[n]=e[n]);return i}var _T=m.memo(function(e){var t=e.size,i=t===void 0?"1em":t,a=e.style,n=yT(e,fT);return o.jsxs("svg",_d(_d({fill:"currentColor",fillRule:"evenodd",height:i,style:_d({flex:"none",lineHeight:1},a),viewBox:"0 0 24 24",width:i,xmlns:"http://www.w3.org/2000/svg"},n),{},{children:[o.jsx("title",{children:gT}),o.jsx("path",{d:"M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z"})]}))});const A2=_T;var xT="Azure";function Vo(e){"@babel/helpers - typeof";return Vo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vo(e)}var zT=["size","style"];function M0(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),i.push.apply(i,a)}return i}function xd(e){for(var t=1;t<arguments.length;t++){var i=arguments[t]!=null?arguments[t]:{};t%2?M0(Object(i),!0).forEach(function(a){AT(e,a,i[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):M0(Object(i)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(i,a))})}return e}function AT(e,t,i){return t=jT(t),t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function jT(e){var t=LT(e,"string");return Vo(t)=="symbol"?t:String(t)}function LT(e,t){if(Vo(e)!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var a=i.call(e,t||"default");if(Vo(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ST(e,t){if(e==null)return{};var i=MT(e,t),a,n;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n<r.length;n++)a=r[n],!(t.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(i[a]=e[a])}return i}function MT(e,t){if(e==null)return{};var i={},a=Object.keys(e),n,r;for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&(i[n]=e[n]);return i}var PT=m.memo(function(e){var t=e.size,i=t===void 0?"1em":t,a=e.style,n=ST(e,zT);return o.jsxs("svg",xd(xd({fill:"currentColor",fillRule:"evenodd",height:i,style:xd({flex:"none",lineHeight:1},a),viewBox:"0 0 24 24",width:i,xmlns:"http://www.w3.org/2000/svg"},n),{},{children:[o.jsx("title",{children:xT}),o.jsx("path",{d:"M11.49 2H2v9.492h9.492V2h-.002z"}),o.jsx("path",{d:"M22 2h-9.492v9.492H22V2z"}),o.jsx("path",{d:"M11.49 12.508H2V22h9.492v-9.492h-.002z"}),o.jsx("path",{d:"M22 12.508h-9.492V22H22v-9.492z"})]}))});const j2=PT;var CT="Meta";function qo(e){"@babel/helpers - typeof";return qo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qo(e)}var ET=["size","style"];function P0(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),i.push.apply(i,a)}return i}function zd(e){for(var t=1;t<arguments.length;t++){var i=arguments[t]!=null?arguments[t]:{};t%2?P0(Object(i),!0).forEach(function(a){TT(e,a,i[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):P0(Object(i)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(i,a))})}return e}function TT(e,t,i){return t=IT(t),t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function IT(e){var t=NT(e,"string");return qo(t)=="symbol"?t:String(t)}function NT(e,t){if(qo(e)!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var a=i.call(e,t||"default");if(qo(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function DT(e,t){if(e==null)return{};var i=OT(e,t),a,n;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n<r.length;n++)a=r[n],!(t.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(i[a]=e[a])}return i}function OT(e,t){if(e==null)return{};var i={},a=Object.keys(e),n,r;for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&(i[n]=e[n]);return i}var RT=m.memo(function(e){var t=e.size,i=t===void 0?"1em":t,a=e.style,n=DT(e,ET);return o.jsxs("svg",zd(zd({fill:"currentColor",fillRule:"evenodd",height:i,style:zd({flex:"none",lineHeight:1},a),viewBox:"0 0 24 24",width:i,xmlns:"http://www.w3.org/2000/svg"},n),{},{children:[o.jsx("title",{children:CT}),o.jsx("path",{d:"M6.897 4c1.915 0 3.516.932 5.43 3.376l.282-.373c.19-.246.383-.484.58-.71l.313-.35C14.588 4.788 15.792 4 17.225 4c1.273 0 2.469.557 3.491 1.516l.218.213c1.73 1.765 2.917 4.71 3.053 8.026l.011.392.002.25c0 1.501-.28 2.759-.818 3.7l-.14.23-.108.153c-.301.42-.664.758-1.086 1.009l-.265.142-.087.04a3.493 3.493 0 01-.302.118 4.117 4.117 0 01-1.33.208c-.524 0-.996-.067-1.438-.215-.614-.204-1.163-.56-1.726-1.116l-.227-.235c-.753-.812-1.534-1.976-2.493-3.586l-1.43-2.41-.544-.895-1.766 3.13-.343.592C7.597 19.156 6.227 20 4.356 20c-1.21 0-2.205-.42-2.936-1.182l-.168-.184c-.484-.573-.837-1.311-1.043-2.189l-.067-.32a8.69 8.69 0 01-.136-1.288L0 14.468c.002-.745.06-1.49.174-2.23l.1-.573c.298-1.53.828-2.958 1.536-4.157l.209-.34c1.177-1.83 2.789-3.053 4.615-3.16L6.897 4zm-.033 2.615l-.201.01c-.83.083-1.606.673-2.252 1.577l-.138.199-.01.018c-.67 1.017-1.185 2.378-1.456 3.845l-.004.022a12.591 12.591 0 00-.207 2.254l.002.188c.004.18.017.36.04.54l.043.291c.092.503.257.908.486 1.208l.117.137c.303.323.698.492 1.17.492 1.1 0 1.796-.676 3.696-3.641l2.175-3.4.454-.701-.139-.198C9.11 7.3 8.084 6.616 6.864 6.616zm10.196-.552l-.176.007c-.635.048-1.223.359-1.82.933l-.196.198c-.439.462-.887 1.064-1.367 1.807l.266.398c.18.274.362.56.55.858l.293.475 1.396 2.335.695 1.114c.583.926 1.03 1.6 1.408 2.082l.213.262c.282.326.529.54.777.673l.102.05c.227.1.457.138.718.138.176.002.35-.023.518-.073.338-.104.61-.32.813-.637l.095-.163.077-.162c.194-.459.29-1.06.29-1.785l-.006-.449c-.08-2.871-.938-5.372-2.2-6.798l-.176-.189c-.67-.683-1.444-1.074-2.27-1.074z"})]}))});const sp=RT;var HT="Mistral";function Fo(e){"@babel/helpers - typeof";return Fo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fo(e)}var VT=["size","style"];function C0(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),i.push.apply(i,a)}return i}function Ad(e){for(var t=1;t<arguments.length;t++){var i=arguments[t]!=null?arguments[t]:{};t%2?C0(Object(i),!0).forEach(function(a){qT(e,a,i[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):C0(Object(i)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(i,a))})}return e}function qT(e,t,i){return t=FT(t),t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function FT(e){var t=UT(e,"string");return Fo(t)=="symbol"?t:String(t)}function UT(e,t){if(Fo(e)!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var a=i.call(e,t||"default");if(Fo(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function BT(e,t){if(e==null)return{};var i=GT(e,t),a,n;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n<r.length;n++)a=r[n],!(t.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(i[a]=e[a])}return i}function GT(e,t){if(e==null)return{};var i={},a=Object.keys(e),n,r;for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&(i[n]=e[n]);return i}var KT=m.memo(function(e){var t=e.size,i=t===void 0?"1em":t,a=e.style,n=BT(e,VT);return o.jsxs("svg",Ad(Ad({fill:"currentColor",fillRule:"evenodd",height:i,style:Ad({flex:"none",lineHeight:1},a),viewBox:"0 0 24 24",width:i,xmlns:"http://www.w3.org/2000/svg"},n),{},{children:[o.jsx("title",{children:HT}),o.jsx("path",{clipRule:"evenodd",d:"M3.428 3.4h3.429v3.428h3.429v3.429h-.002 3.431V6.828h3.427V3.4h3.43v13.714H24v3.429H13.714v-3.428h-3.428v-3.429h-3.43v3.428h3.43v3.429H0v-3.429h3.428V3.4zm10.286 13.715h3.428v-3.429h-3.427v3.429z"})]}))});const L2=KT;var WT="Azure";function Uo(e){"@babel/helpers - typeof";return Uo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Uo(e)}var $T=["size","style"];function E0(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),i.push.apply(i,a)}return i}function jd(e){for(var t=1;t<arguments.length;t++){var i=arguments[t]!=null?arguments[t]:{};t%2?E0(Object(i),!0).forEach(function(a){ZT(e,a,i[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):E0(Object(i)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(i,a))})}return e}function ZT(e,t,i){return t=JT(t),t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function JT(e){var t=QT(e,"string");return Uo(t)=="symbol"?t:String(t)}function QT(e,t){if(Uo(e)!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var a=i.call(e,t||"default");if(Uo(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function YT(e,t){if(e==null)return{};var i=XT(e,t),a,n;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n<r.length;n++)a=r[n],!(t.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(i[a]=e[a])}return i}function XT(e,t){if(e==null)return{};var i={},a=Object.keys(e),n,r;for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&(i[n]=e[n]);return i}var e9=m.memo(function(e){var t=e.size,i=t===void 0?"1em":t,a=e.style,n=YT(e,$T);return o.jsxs("svg",jd(jd({fill:"currentColor",fillRule:"evenodd",height:i,style:jd({flex:"none",lineHeight:1},a),viewBox:"0 0 24 24",width:i,xmlns:"http://www.w3.org/2000/svg"},n),{},{children:[o.jsx("title",{children:WT}),o.jsx("path",{d:"M18.397 15.296H7.4a.51.51 0 00-.347.882l7.066 6.595c.206.192.477.298.758.298h6.226l-2.706-7.775z",fillOpacity:".75"}),o.jsx("path",{d:"M8.295.857c-.477 0-.9.304-1.053.756L.495 21.605a1.11 1.11 0 001.052 1.466h5.43c.477 0 .9-.304 1.053-.755l1.341-3.975-2.318-2.163a.51.51 0 01.347-.882h3L15.271.857H8.295z",fillOpacity:".5"}),o.jsx("path",{d:"M17.193 1.613a1.11 1.11 0 00-1.052-.756h-7.81.035c.477 0 .9.304 1.052.756l6.748 19.992a1.11 1.11 0 01-1.052 1.466h-.12 7.895a1.11 1.11 0 001.052-1.466L17.193 1.613z"})]}))});const t9=e9;var i9="AzureAI";function Bo(e){"@babel/helpers - typeof";return Bo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bo(e)}var a9=["size","style"];function T0(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),i.push.apply(i,a)}return i}function Ld(e){for(var t=1;t<arguments.length;t++){var i=arguments[t]!=null?arguments[t]:{};t%2?T0(Object(i),!0).forEach(function(a){n9(e,a,i[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):T0(Object(i)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(i,a))})}return e}function n9(e,t,i){return t=r9(t),t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function r9(e){var t=o9(e,"string");return Bo(t)=="symbol"?t:String(t)}function o9(e,t){if(Bo(e)!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var a=i.call(e,t||"default");if(Bo(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function s9(e,t){if(e==null)return{};var i=l9(e,t),a,n;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n<r.length;n++)a=r[n],!(t.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(i[a]=e[a])}return i}function l9(e,t){if(e==null)return{};var i={},a=Object.keys(e),n,r;for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&(i[n]=e[n]);return i}var c9=m.memo(function(e){var t=e.size,i=t===void 0?"1em":t,a=e.style,n=s9(e,a9);return o.jsxs("svg",Ld(Ld({fill:"currentColor",fillRule:"evenodd",height:i,style:Ld({flex:"none",lineHeight:1},a),viewBox:"0 0 24 24",width:i,xmlns:"http://www.w3.org/2000/svg"},n),{},{children:[o.jsx("title",{children:i9}),o.jsx("path",{clipRule:"evenodd",d:"M16.233 0c.713 0 1.345.551 1.572 1.329.227.778 1.555 5.59 1.555 5.59v9.562h-4.813L14.645 0h1.588z",fillOpacity:".5"}),o.jsx("path",{d:"M23.298 7.47c0-.34-.275-.6-.6-.6h-2.835a3.617 3.617 0 00-3.614 3.615v5.996h3.436a3.617 3.617 0 003.613-3.614V7.47z"}),o.jsx("path",{clipRule:"evenodd",d:"M16.233 0a.982.982 0 00-.989.989l-.097 18.198A4.814 4.814 0 0110.334 24H1.6a.597.597 0 01-.567-.794l7-19.981A4.819 4.819 0 0112.57 0h3.679-.016z"})]}))});const d9=c9;var u9="DeepSeek";function Go(e){"@babel/helpers - typeof";return Go=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Go(e)}var p9=["size","style"];function I0(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),i.push.apply(i,a)}return i}function Sd(e){for(var t=1;t<arguments.length;t++){var i=arguments[t]!=null?arguments[t]:{};t%2?I0(Object(i),!0).forEach(function(a){m9(e,a,i[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):I0(Object(i)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(i,a))})}return e}function m9(e,t,i){return t=h9(t),t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function h9(e){var t=g9(e,"string");return Go(t)=="symbol"?t:String(t)}function g9(e,t){if(Go(e)!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var a=i.call(e,t||"default");if(Go(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function f9(e,t){if(e==null)return{};var i=b9(e,t),a,n;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n<r.length;n++)a=r[n],!(t.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(i[a]=e[a])}return i}function b9(e,t){if(e==null)return{};var i={},a=Object.keys(e),n,r;for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&(i[n]=e[n]);return i}var v9=m.memo(function(e){var t=e.size,i=t===void 0?"1em":t,a=e.style,n=f9(e,p9);return o.jsxs("svg",Sd(Sd({fill:"currentColor",fillRule:"evenodd",height:i,style:Sd({flex:"none",lineHeight:1},a),viewBox:"0 0 24 24",width:i,xmlns:"http://www.w3.org/2000/svg"},n),{},{children:[o.jsx("title",{children:u9}),o.jsx("path",{d:"M23.748 4.482c-.254-.124-.364.113-.512.234-.051.039-.094.09-.137.136-.372.397-.806.657-1.373.626-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.352-.156-.708-.311-.955-.65-.172-.241-.219-.51-.305-.774-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434 1.202-.422 1.84.027 1.436.633 2.58 1.838 3.393.137.093.172.187.129.323-.082.28-.18.552-.266.833-.055.179-.137.217-.329.14a5.526 5.526 0 01-1.736-1.18c-.857-.828-1.631-1.742-2.597-2.458a11.365 11.365 0 00-.689-.471c-.985-.957.13-1.743.388-1.836.27-.098.093-.432-.779-.428-.872.004-1.67.295-2.687.684a3.055 3.055 0 01-.465.137 9.597 9.597 0 00-2.883-.102c-1.885.21-3.39 1.102-4.497 2.623C.082 8.606-.231 10.684.152 12.85c.403 2.284 1.569 4.175 3.36 5.653 1.858 1.533 3.997 2.284 6.438 2.14 1.482-.085 3.133-.284 4.994-1.86.47.234.962.327 1.78.397.63.059 1.236-.03 1.705-.128.735-.156.684-.837.419-.961-2.155-1.004-1.682-.595-2.113-.926 1.096-1.296 2.746-2.642 3.392-7.003.05-.347.007-.565 0-.845-.004-.17.035-.237.23-.256a4.173 4.173 0 001.545-.475c1.396-.763 1.96-2.015 2.093-3.517.02-.23-.004-.467-.247-.588zM11.581 18c-2.089-1.642-3.102-2.183-3.52-2.16-.392.024-.321.471-.235.763.09.288.207.486.371.739.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.167-1.361-.802-2.5-1.86-3.301-3.307-.774-1.393-1.224-2.887-1.298-4.482-.02-.386.093-.522.477-.592a4.696 4.696 0 011.529-.039c2.132.312 3.946 1.265 5.468 2.774.868.86 1.525 1.887 2.202 2.891.72 1.066 1.494 2.082 2.48 2.914.348.292.625.514.891.677-.802.09-2.14.11-3.054-.614zm1-6.44a.306.306 0 01.415-.287.302.302 0 01.2.288.306.306 0 01-.31.307.303.303 0 01-.304-.308zm3.11 1.596c-.2.081-.399.151-.59.16a1.245 1.245 0 01-.798-.254c-.274-.23-.47-.358-.552-.758a1.73 1.73 0 01.016-.588c.07-.327-.008-.537-.239-.727-.187-.156-.426-.199-.688-.199a.559.559 0 01-.254-.078c-.11-.054-.2-.19-.114-.358.028-.054.16-.186.192-.21.356-.202.767-.136 1.146.016.352.144.618.408 1.001.782.391.451.462.576.685.914.176.265.336.537.445.848.067.195-.019.354-.25.452z"})]}))});const S2=v9;var k9="HuggingFace";function Ko(e){"@babel/helpers - typeof";return Ko=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ko(e)}var y9=["size","style"];function N0(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),i.push.apply(i,a)}return i}function Md(e){for(var t=1;t<arguments.length;t++){var i=arguments[t]!=null?arguments[t]:{};t%2?N0(Object(i),!0).forEach(function(a){w9(e,a,i[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):N0(Object(i)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(i,a))})}return e}function w9(e,t,i){return t=_9(t),t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function _9(e){var t=x9(e,"string");return Ko(t)=="symbol"?t:String(t)}function x9(e,t){if(Ko(e)!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var a=i.call(e,t||"default");if(Ko(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function z9(e,t){if(e==null)return{};var i=A9(e,t),a,n;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n<r.length;n++)a=r[n],!(t.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(i[a]=e[a])}return i}function A9(e,t){if(e==null)return{};var i={},a=Object.keys(e),n,r;for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&(i[n]=e[n]);return i}var j9=m.memo(function(e){var t=e.size,i=t===void 0?"1em":t,a=e.style,n=z9(e,y9);return o.jsxs("svg",Md(Md({fill:"currentColor",fillRule:"evenodd",height:i,style:Md({flex:"none",lineHeight:1},a),viewBox:"0 0 24 24",width:i,xmlns:"http://www.w3.org/2000/svg"},n),{},{children:[o.jsx("title",{children:k9}),o.jsx("path",{d:"M16.781 3.277c2.997 1.704 4.844 4.851 4.844 8.258 0 .995-.155 1.955-.443 2.857a1.332 1.332 0 011.125.4 1.41 1.41 0 01.2 1.723c.204.165.352.385.428.632l.017.062c.06.222.12.69-.2 1.166.244.37.279.836.093 1.236-.255.57-.893 1.018-2.128 1.5l-.202.078-.131.048c-.478.173-.89.295-1.061.345l-.086.024c-.89.243-1.808.375-2.732.394-1.32 0-2.3-.36-2.923-1.067a9.852 9.852 0 01-3.18.018C9.778 21.647 8.802 22 7.494 22a11.249 11.249 0 01-2.541-.343l-.221-.06-.273-.08a16.574 16.574 0 01-1.175-.405c-1.237-.483-1.875-.93-2.13-1.501-.186-.4-.151-.867.093-1.236a1.42 1.42 0 01-.2-1.166c.069-.273.226-.516.447-.694a1.41 1.41 0 01.2-1.722c.233-.248.557-.391.917-.407l.078-.001a9.385 9.385 0 01-.44-2.85c0-3.407 1.847-6.554 4.844-8.258a9.822 9.822 0 019.687 0zM4.188 14.758c.125.687 2.357 2.35 2.14 2.707-.19.315-.796-.239-.948-.386l-.041-.04-.168-.147c-.561-.479-2.304-1.9-2.74-1.432-.43.46.119.859 1.055 1.42l.784.467.136.083c1.045.643 1.12.84.95 1.113-.188.295-3.07-2.1-3.34-1.083-.27 1.011 2.942 1.304 2.744 2.006-.2.7-2.265-1.324-2.685-.537-.425.79 2.913 1.718 2.94 1.725l.16.04.175.042c1.227.284 3.565.65 4.435-.604.673-.973.64-1.709-.248-2.61l-.057-.057c-.945-.928-1.495-2.288-1.495-2.288l-.017-.058-.025-.072c-.082-.22-.284-.639-.63-.584-.46.073-.798 1.21.12 1.933l.05.038c.977.721-.195 1.21-.573.534l-.058-.104-.143-.25c-.463-.799-1.282-2.111-1.739-2.397-.532-.332-.907-.148-.782.541zm14.842-.541c-.533.335-1.563 2.074-1.94 2.751a.613.613 0 01-.687.302.436.436 0 01-.176-.098.303.303 0 01-.049-.06l-.014-.028-.008-.02-.007-.019-.003-.013-.003-.017a.289.289 0 01-.004-.048c0-.12.071-.266.25-.427.026-.024.054-.047.084-.07l.047-.036c.022-.016.043-.032.063-.049.883-.71.573-1.81.131-1.917l-.031-.006-.056-.004a.368.368 0 00-.062.006l-.028.005-.042.014-.039.017-.028.015-.028.019-.036.027-.023.02c-.173.158-.273.428-.31.542l-.016.054s-.53 1.309-1.439 2.234l-.054.054c-.365.358-.596.69-.702 1.018-.143.437-.066.868.21 1.353.055.097.117.195.187.296.882 1.275 3.282.876 4.494.59l.286-.07.25-.074c.276-.084.736-.233 1.2-.42l.188-.077.065-.028.064-.028.124-.056.081-.038c.529-.252.964-.543.994-.827l.001-.036a.299.299 0 00-.037-.139c-.094-.176-.271-.212-.491-.168l-.045.01c-.044.01-.09.024-.136.04l-.097.035-.054.022c-.559.23-1.238.705-1.607.745h.006a.452.452 0 01-.05.003h-.024l-.024-.003-.023-.005c-.068-.016-.116-.06-.14-.142a.22.22 0 01-.005-.1c.062-.345.958-.595 1.713-.91l.066-.028c.528-.224.97-.483.985-.832v-.04a.47.47 0 00-.016-.098c-.048-.18-.175-.251-.36-.251-.785 0-2.55 1.36-2.92 1.36-.025 0-.048-.007-.058-.024a.6.6 0 01-.046-.088c-.1-.238.068-.462 1.06-1.066l.209-.126c.538-.32 1.01-.588 1.341-.831.29-.212.475-.406.503-.6l.003-.028c.008-.113-.038-.227-.147-.344a.266.266 0 00-.07-.054l-.034-.015-.013-.005a.403.403 0 00-.13-.02c-.162 0-.369.07-.595.18-.637.313-1.431.952-1.826 1.285l-.249.215-.033.033c-.08.078-.288.27-.493.386l-.071.037-.041.019a.535.535 0 01-.122.036h.005a.346.346 0 01-.031.003l.01-.001-.013.001c-.079.005-.145-.021-.19-.095a.113.113 0 01-.014-.065c.027-.465 2.034-1.991 2.152-2.642l.009-.048c.1-.65-.271-.817-.791-.493zM11.938 2.984c-4.798 0-8.688 3.829-8.688 8.55 0 .692.083 1.364.24 2.008l.008-.009c.252-.298.612-.46 1.017-.46.355.008.699.117.993.312.22.14.465.384.715.694.261-.372.69-.598 1.15-.605.852 0 1.367.728 1.562 1.383l.047.105.06.127c.192.396.595 1.139 1.143 1.68 1.06 1.04 1.324 2.115.8 3.266a8.865 8.865 0 002.024-.014c-.505-1.12-.26-2.17.74-3.186l.066-.066c.695-.684 1.157-1.69 1.252-1.912.195-.655.708-1.383 1.56-1.383.46.007.889.233 1.15.605.25-.31.495-.553.718-.694a1.87 1.87 0 01.99-.312c.357 0 .682.126.925.36.14-.61.215-1.245.215-1.898 0-4.722-3.89-8.55-8.687-8.55zm1.857 8.926l.439-.212c.553-.264.89-.383.89.152 0 1.093-.771 3.208-3.155 3.262h-.184c-2.325-.052-3.116-2.06-3.156-3.175l-.001-.087c0-1.107 1.452.586 3.25.586.716 0 1.379-.272 1.917-.526zm4.017-3.143c.45 0 .813.358.813.8 0 .441-.364.8-.813.8a.806.806 0 01-.812-.8c0-.442.364-.8.812-.8zm-11.624 0c.448 0 .812.358.812.8 0 .441-.364.8-.812.8a.806.806 0 01-.813-.8c0-.442.364-.8.813-.8zm7.79-.841c.32-.384.846-.54 1.33-.394.483.146.83.564.878 1.06.048.495-.212.97-.659 1.203-.322.168-.447-.477-.767-.585l.002-.003c-.287-.098-.772.362-.925.079a1.215 1.215 0 01.14-1.36zm-4.323 0c.322.384.377.92.14 1.36-.152.283-.64-.177-.925-.079l.003.003c-.108.036-.194.134-.273.24l-.118.165c-.11.15-.22.262-.377.18a1.226 1.226 0 01-.658-1.204c.048-.495.395-.913.878-1.059a1.262 1.262 0 011.33.394z"})]}))});const M2=j9;var L9="Qwen";function Wo(e){"@babel/helpers - typeof";return Wo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wo(e)}var S9=["size","style"];function D0(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),i.push.apply(i,a)}return i}function Pd(e){for(var t=1;t<arguments.length;t++){var i=arguments[t]!=null?arguments[t]:{};t%2?D0(Object(i),!0).forEach(function(a){M9(e,a,i[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):D0(Object(i)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(i,a))})}return e}function M9(e,t,i){return t=P9(t),t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function P9(e){var t=C9(e,"string");return Wo(t)=="symbol"?t:String(t)}function C9(e,t){if(Wo(e)!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var a=i.call(e,t||"default");if(Wo(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function E9(e,t){if(e==null)return{};var i=T9(e,t),a,n;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n<r.length;n++)a=r[n],!(t.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(i[a]=e[a])}return i}function T9(e,t){if(e==null)return{};var i={},a=Object.keys(e),n,r;for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&(i[n]=e[n]);return i}var I9=m.memo(function(e){var t=e.size,i=t===void 0?"1em":t,a=e.style,n=E9(e,S9);return o.jsxs("svg",Pd(Pd({fill:"currentColor",fillRule:"evenodd",height:i,style:Pd({flex:"none",lineHeight:1},a),viewBox:"0 0 24 24",width:i,xmlns:"http://www.w3.org/2000/svg"},n),{},{children:[o.jsx("title",{children:L9}),o.jsx("path",{d:"M12.604 1.34c.393.69.784 1.382 1.174 2.075a.18.18 0 00.157.091h5.552c.174 0 .322.11.446.327l1.454 2.57c.19.337.24.478.024.837-.26.43-.513.864-.76 1.3l-.367.658c-.106.196-.223.28-.04.512l2.652 4.637c.172.301.111.494-.043.77-.437.785-.882 1.564-1.335 2.34-.159.272-.352.375-.68.37-.777-.016-1.552-.01-2.327.016a.099.099 0 00-.081.05 575.097 575.097 0 01-2.705 4.74c-.169.293-.38.363-.725.364-.997.003-2.002.004-3.017.002a.537.537 0 01-.465-.271l-1.335-2.323a.09.09 0 00-.083-.049H4.982c-.285.03-.553-.001-.805-.092l-1.603-2.77a.543.543 0 01-.002-.54l1.207-2.12a.198.198 0 000-.197 550.951 550.951 0 01-1.875-3.272l-.79-1.395c-.16-.31-.173-.496.095-.965.465-.813.927-1.625 1.387-2.436.132-.234.304-.334.584-.335a338.3 338.3 0 012.589-.001.124.124 0 00.107-.063l2.806-4.895a.488.488 0 01.422-.246c.524-.001 1.053 0 1.583-.006L11.704 1c.341-.003.724.032.9.34zm-3.432.403a.06.06 0 00-.052.03L6.254 6.788a.157.157 0 01-.135.078H3.253c-.056 0-.07.025-.041.074l5.81 10.156c.025.042.013.062-.034.063l-2.795.015a.218.218 0 00-.2.116l-1.32 2.31c-.044.078-.021.118.068.118l5.716.008c.046 0 .08.02.104.061l1.403 2.454c.046.081.092.082.139 0l5.006-8.76.783-1.382a.055.055 0 01.096 0l1.424 2.53a.122.122 0 00.107.062l2.763-.02a.04.04 0 00.035-.02.041.041 0 000-.04l-2.9-5.086a.108.108 0 010-.113l.293-.507 1.12-1.977c.024-.041.012-.062-.035-.062H9.2c-.059 0-.073-.026-.043-.077l1.434-2.505a.107.107 0 000-.114L9.225 1.774a.06.06 0 00-.053-.031zm6.29 8.02c.046 0 .058.02.034.06l-.832 1.465-2.613 4.585a.056.056 0 01-.05.029.058.058 0 01-.05-.029L8.498 9.841c-.02-.034-.01-.052.028-.054l.216-.012 6.722-.012z"})]}))});const ql=I9;var N9="IBM";function $o(e){"@babel/helpers - typeof";return $o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$o(e)}var D9=["size","style"];function O0(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),i.push.apply(i,a)}return i}function Cd(e){for(var t=1;t<arguments.length;t++){var i=arguments[t]!=null?arguments[t]:{};t%2?O0(Object(i),!0).forEach(function(a){O9(e,a,i[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):O0(Object(i)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(i,a))})}return e}function O9(e,t,i){return t=R9(t),t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function R9(e){var t=H9(e,"string");return $o(t)=="symbol"?t:String(t)}function H9(e,t){if($o(e)!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var a=i.call(e,t||"default");if($o(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function V9(e,t){if(e==null)return{};var i=q9(e,t),a,n;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n<r.length;n++)a=r[n],!(t.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(i[a]=e[a])}return i}function q9(e,t){if(e==null)return{};var i={},a=Object.keys(e),n,r;for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&(i[n]=e[n]);return i}var F9=m.memo(function(e){var t=e.size,i=t===void 0?"1em":t,a=e.style,n=V9(e,D9);return o.jsxs("svg",Cd(Cd({fill:"currentColor",fillRule:"evenodd",height:i,style:Cd({flex:"none",lineHeight:1},a),viewBox:"0 0 24 24",width:i,xmlns:"http://www.w3.org/2000/svg"},n),{},{children:[o.jsx("title",{children:N9}),o.jsx("path",{clipRule:"evenodd",d:"M24 16.333V17h-3.158v-.667H24zm-7.579 0V17h-3.158v-.667h3.158zm2.464 0L18.63 17l-.25-.667h.504zm-7.075 0a2.528 2.528 0 01-1.717.667h-5.04v-.667h6.757zm-7.389 0V17H0v-.667h4.421zm12-1.333v.667h-3.158V15h3.158zm2.958 0l-.246.667h-1L17.885 15h1.494zm-6.937 0c-.057.237-.148.46-.265.667H5.053V15h7.39zm-8.02 0v.667H0V15h4.421zM24 15v.667h-3.158V15H24zm-1.263-1.333v.666h-1.895v-.666h1.895zm-6.316 0v.666h-1.895v-.666h1.895zm3.453 0l-.248.666h-1.989l-.25-.666h2.487zm-7.52 0c.056.212.088.435.088.666h-2.337v-.666h2.249zm-4.143 0v.666H6.316v-.666H8.21zm-5.053 0v.666H1.263v-.666h1.895zm19.579-1.334V13h-1.895v-.667h1.895zm-6.316 0V13h-1.895v-.667h1.895zm3.948 0l-.247.667h-2.987l-.245-.667h3.48zm-8.792 0c.218.188.405.414.55.667H6.315v-.667h5.26zm-8.42 0V13H1.264v-.667h1.895zM18.456 11l.177.539.176-.539h3.929v.667h-1.895v-.613l-.215.613H16.63l-.209-.613v.613h-1.895V11h3.929zM3.158 11v.667H1.263V11h1.895zm8.968 0a2.555 2.555 0 01-.55.667h-5.26V11h5.81zm10.61-1.333v.666h-3.709l.224-.666h3.486zm-4.722 0l.224.666h-3.712v-.666h3.488zm-5.572 0c0 .23-.032.454-.088.666h-2.249v-.666h2.337zm-4.231 0v.666H6.316v-.666H8.21zm-5.053 0v.666H1.263v-.666h1.895zm14.419-1.334l.22.667h-4.534v-.667h4.314zm6.423 0V9h-4.536l.229-.667H24zm-11.823 0c.117.206.208.43.265.667h-7.39v-.667h7.125zm-7.756 0V9H0v-.667h4.421zM17.133 7l.224.667h-4.094V7h3.87zM24 7v.667h-4.089L20.13 7H24zM10.093 7c.662 0 1.264.253 1.717.667H5.053V7h5.04zM4.42 7v.667H0V7h4.421z"})]}))});const P2=F9;var U9="ByteDance";function Zo(e){"@babel/helpers - typeof";return Zo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zo(e)}var B9=["size","style"];function R0(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),i.push.apply(i,a)}return i}function Ed(e){for(var t=1;t<arguments.length;t++){var i=arguments[t]!=null?arguments[t]:{};t%2?R0(Object(i),!0).forEach(function(a){G9(e,a,i[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):R0(Object(i)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(i,a))})}return e}function G9(e,t,i){return t=K9(t),t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function K9(e){var t=W9(e,"string");return Zo(t)=="symbol"?t:String(t)}function W9(e,t){if(Zo(e)!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var a=i.call(e,t||"default");if(Zo(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function $9(e,t){if(e==null)return{};var i=Z9(e,t),a,n;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n<r.length;n++)a=r[n],!(t.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(i[a]=e[a])}return i}function Z9(e,t){if(e==null)return{};var i={},a=Object.keys(e),n,r;for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&(i[n]=e[n]);return i}var J9=m.memo(function(e){var t=e.size,i=t===void 0?"1em":t,a=e.style,n=$9(e,B9);return o.jsxs("svg",Ed(Ed({fill:"currentColor",fillRule:"evenodd",height:i,style:Ed({flex:"none",lineHeight:1},a),viewBox:"0 0 24 24",width:i,xmlns:"http://www.w3.org/2000/svg"},n),{},{children:[o.jsx("title",{children:U9}),o.jsx("path",{d:"M14.944 18.587l-1.704-.445V10.01l1.824-.462c1-.254 1.84-.461 1.88-.453.032 0 .056 2.235.056 4.972v4.973l-.176-.008c-.104 0-.952-.207-1.88-.446z"}),o.jsx("path",{d:"M7 16.542c0-2.736.024-4.98.064-4.98.032-.008.872.2 1.88.454l1.816.461-.016 4.05-.024 4.049-1.632.422c-.896.23-1.736.445-1.856.469L7 21.523v-4.98z"}),o.jsx("path",{d:"M19.24 12.477c0-9.03.008-9.515.144-9.475.072.024.784.207 1.576.406.792.207 1.576.405 1.744.445l.296.08-.016 8.56-.024 8.568-1.624.414c-.888.23-1.728.437-1.856.47l-.24.055v-9.523z"}),o.jsx("path",{d:"M1 12.509c0-4.678.024-8.505.064-8.505.032 0 .872.207 1.872.454l1.824.461v7.582c0 4.16-.016 7.574-.032 7.574-.024 0-.872.215-1.88.47L1 21.013v-8.505z"})]}))});const lp=J9;var Q9="Kimi";function Jo(e){"@babel/helpers - typeof";return Jo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jo(e)}var Y9=["size","style"];function H0(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),i.push.apply(i,a)}return i}function Td(e){for(var t=1;t<arguments.length;t++){var i=arguments[t]!=null?arguments[t]:{};t%2?H0(Object(i),!0).forEach(function(a){X9(e,a,i[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):H0(Object(i)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(i,a))})}return e}function X9(e,t,i){return t=eI(t),t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function eI(e){var t=tI(e,"string");return Jo(t)=="symbol"?t:String(t)}function tI(e,t){if(Jo(e)!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var a=i.call(e,t||"default");if(Jo(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function iI(e,t){if(e==null)return{};var i=aI(e,t),a,n;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n<r.length;n++)a=r[n],!(t.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(i[a]=e[a])}return i}function aI(e,t){if(e==null)return{};var i={},a=Object.keys(e),n,r;for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&(i[n]=e[n]);return i}var nI=m.memo(function(e){var t=e.size,i=t===void 0?"1em":t,a=e.style,n=iI(e,Y9);return o.jsxs("svg",Td(Td({fill:"currentColor",fillRule:"evenodd",height:i,style:Td({flex:"none",lineHeight:1},a),viewBox:"0 0 24 24",width:i,xmlns:"http://www.w3.org/2000/svg"},n),{},{children:[o.jsx("title",{children:Q9}),o.jsx("path",{d:"M19.738 5.776c.163-.209.306-.4.457-.585.07-.087.064-.153-.004-.244-.655-.861-.717-1.817-.34-2.787.283-.73.909-1.072 1.674-1.145.477-.045.945.004 1.379.236.57.305.902.77 1.01 1.412.086.512.07 1.012-.075 1.508-.257.878-.888 1.333-1.753 1.448-.718.096-1.446.108-2.17.157-.056.004-.113 0-.178 0z"}),o.jsx("path",{d:"M17.962 1.844h-4.326l-3.425 7.81H5.369V1.878H1.5V22h3.87v-8.477h6.824a3.025 3.025 0 002.743-1.75V22h3.87v-8.477a3.87 3.87 0 00-3.588-3.86v-.01h-2.125a3.94 3.94 0 002.323-2.12l2.545-5.689z"})]}))});const cp=nI;var rI="Snowflake";function Qo(e){"@babel/helpers - typeof";return Qo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qo(e)}var oI=["size","style"];function V0(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),i.push.apply(i,a)}return i}function Id(e){for(var t=1;t<arguments.length;t++){var i=arguments[t]!=null?arguments[t]:{};t%2?V0(Object(i),!0).forEach(function(a){sI(e,a,i[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):V0(Object(i)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(i,a))})}return e}function sI(e,t,i){return t=lI(t),t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function lI(e){var t=cI(e,"string");return Qo(t)=="symbol"?t:String(t)}function cI(e,t){if(Qo(e)!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var a=i.call(e,t||"default");if(Qo(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function dI(e,t){if(e==null)return{};var i=uI(e,t),a,n;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n<r.length;n++)a=r[n],!(t.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(i[a]=e[a])}return i}function uI(e,t){if(e==null)return{};var i={},a=Object.keys(e),n,r;for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&(i[n]=e[n]);return i}var pI=m.memo(function(e){var t=e.size,i=t===void 0?"1em":t,a=e.style,n=dI(e,oI);return o.jsxs("svg",Id(Id({fill:"currentColor",fillRule:"evenodd",height:i,style:Id({flex:"none",lineHeight:1},a),viewBox:"0 0 24 24",width:i,xmlns:"http://www.w3.org/2000/svg"},n),{},{children:[o.jsx("title",{children:rI}),o.jsx("path",{clipRule:"evenodd",d:"M23.252 10.365l-2.843 1.636 2.843 1.631a1.47 1.47 0 01.697.903 1.492 1.492 0 01-.15 1.135c-.202.342-.53.591-.912.693a1.498 1.498 0 01-1.132-.15l-5.09-2.924a1.473 1.473 0 01-.68-.851 1.446 1.446 0 01-.068-.485 1.5 1.5 0 01.745-1.248l5.09-2.921a1.496 1.496 0 012.044.547 1.479 1.479 0 01-.544 2.034zm-2.692 7.927l-5.087-2.92a1.477 1.477 0 00-.867-.195 1.478 1.478 0 00-.982.468c-.257.276-.4.639-.403 1.017v5.847A1.49 1.49 0 0014.718 24c.828 0 1.497-.668 1.497-1.491v-3.27l2.849 1.636a1.493 1.493 0 002.044-.544 1.49 1.49 0 00-.548-2.04zm-5.87-5.719l-2.116 2.102a.42.42 0 01-.265.112h-.621a.427.427 0 01-.265-.112l-2.115-2.102a.42.42 0 01-.11-.262v-.62a.43.43 0 01.11-.265l2.114-2.102a.426.426 0 01.264-.11h.623a.422.422 0 01.265.11l2.116 2.102a.43.43 0 01.109.265v.62a.428.428 0 01-.11.262zM13 11.99a.442.442 0 00-.113-.266l-.612-.607a.431.431 0 00-.266-.11h-.024a.426.426 0 00-.264.11l-.612.607a.436.436 0 00-.107.266v.024c0 .085.047.202.107.262l.612.61c.061.06.179.11.264.11h.024a.434.434 0 00.266-.11l.612-.61a.429.429 0 00.112-.262v-.024zM3.436 5.704l5.089 2.924c.274.157.578.219.868.195.375-.026.726-.194.983-.47.256-.275.4-.64.403-1.017V1.489C10.78.667 10.11 0 9.284 0c-.829 0-1.498.667-1.498 1.49v3.27l-2.85-1.639a1.496 1.496 0 00-2.045.546 1.489 1.489 0 00.546 2.037zm11.17 3.119c.29.024.594-.038.866-.195l5.087-2.923a1.474 1.474 0 00.697-.903 1.496 1.496 0 00-.149-1.135 1.496 1.496 0 00-2.044-.545L16.215 4.76V1.489C16.215.667 15.546 0 14.718 0c-.83 0-1.497.667-1.497 1.49v5.845a1.491 1.491 0 001.385 1.487zm-5.213 6.354a1.479 1.479 0 00-.868.194l-5.089 2.92a1.476 1.476 0 00-.696.905 1.498 1.498 0 00.148 1.135 1.496 1.496 0 002.044.543l2.851-1.636v3.27c0 .825.67 1.491 1.498 1.491.826 0 1.496-.667 1.496-1.49v-5.847a1.5 1.5 0 00-.401-1.017 1.477 1.477 0 00-.982-.468zm-1.38-2.74c.05-.156.072-.32.068-.484a1.497 1.497 0 00-.751-1.248l-5.084-2.92a1.499 1.499 0 00-2.045.547 1.481 1.481 0 00.549 2.034l2.841 1.636L.75 13.633a1.47 1.47 0 00-.698.903 1.492 1.492 0 00.15 1.135c.202.343.53.592.912.693.382.102.789.048 1.132-.15l5.086-2.924c.345-.195.577-.505.684-.852z"})]}))});const mI=pI;var hI="Liquid";function Yo(e){"@babel/helpers - typeof";return Yo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yo(e)}var gI=["size","style"];function q0(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),i.push.apply(i,a)}return i}function Nd(e){for(var t=1;t<arguments.length;t++){var i=arguments[t]!=null?arguments[t]:{};t%2?q0(Object(i),!0).forEach(function(a){fI(e,a,i[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):q0(Object(i)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(i,a))})}return e}function fI(e,t,i){return t=bI(t),t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function bI(e){var t=vI(e,"string");return Yo(t)=="symbol"?t:String(t)}function vI(e,t){if(Yo(e)!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var a=i.call(e,t||"default");if(Yo(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function kI(e,t){if(e==null)return{};var i=yI(e,t),a,n;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n<r.length;n++)a=r[n],!(t.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(i[a]=e[a])}return i}function yI(e,t){if(e==null)return{};var i={},a=Object.keys(e),n,r;for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&(i[n]=e[n]);return i}var wI=m.memo(function(e){var t=e.size,i=t===void 0?"1em":t,a=e.style,n=kI(e,gI);return o.jsxs("svg",Nd(Nd({fill:"currentColor",fillRule:"evenodd",height:i,style:Nd({flex:"none",lineHeight:1},a),viewBox:"0 0 24 24",width:i,xmlns:"http://www.w3.org/2000/svg"},n),{},{children:[o.jsx("title",{children:hI}),o.jsx("path",{d:"M12.028 8.546l-.008.005 3.03 5.25a3.94 3.94 0 01.643 2.162c0 .754-.212 1.46-.58 2.062l6.173-1.991L11.63 0 9.304 3.872l2.724 4.674zM6.837 24l4.85-4.053h-.013c-2.219 0-4.017-1.784-4.017-3.984 0-.794.235-1.534.64-2.156l2.865-4.976-2.381-4.087L2 16.034 6.83 24h.007zM13.737 19.382h-.001L8.222 24h8.182l4.148-6.769-6.815 2.151z"})]}))});const C2=wI,Dd={openai:op,anthropic:x2,google:oT,microsoft:j2,gemma:z2,gemini:A2,meta:sp,mistral:L2,azure:t9,azureai:d9,deepseek:S2,huggingface:M2,qwen:ql,qwq:ql,ibm:P2,bytedance:lp,kimi:cp,liquid:C2},_I=[{pattern:/^gpt/i,icon:op},{pattern:/^o\d+/i,icon:op},{pattern:/^claude-/i,icon:x2},{pattern:/^gemini-/i,icon:A2},{pattern:/gemma/i,icon:z2},{pattern:/llama/i,icon:sp},{pattern:/^meta/i,icon:sp},{pattern:/^(mistral|devstral|mixtral|magistral|codestral|ministral)/i,icon:L2},{pattern:/^deepseek/i,icon:S2},{pattern:/^qwen/i,icon:ql},{pattern:/^qwq/i,icon:ql},{pattern:/^phi/i,icon:j2},{pattern:/^granite/i,icon:P2},{pattern:/^doubao/i,icon:lp},{pattern:/^moonshot/i,icon:cp},{pattern:/^smol/i,icon:M2},{pattern:/^seed/i,icon:lp},{pattern:/^kimi/i,icon:cp},{pattern:/^snowflake/i,icon:mI},{pattern:/^lfm/i,icon:C2}];function xI(e){if(!e)return null;const t=_I.find(({pattern:i})=>i.test(e));return(t==null?void 0:t.icon)||null}function E2({provider:e,match:t="exact",size:i=24,className:a="",fallbackIconKey:n=null}){let r=null;return t==="exact"?r=Dd[e==null?void 0:e.toLowerCase()]:t==="pattern"&&(r=xI(e)),!r&&n&&Dd[n]&&(r=Dd[n]),r?o.jsx(r,{size:i,className:a}):null}function T2({alias:e="",models:t=[],downloadModel:i=null,uninstallModel:a=null,setActiveModel:n=()=>{},selectedModelId:r="",ui:s={showRuntime:!0}}){const[l,d]=m.useState(t.some(h=>h.downloaded)),u=t.length;return o.jsxs("div",{className:"flex flex-col w-full border-b border-theme-modal-border py-[18px]",children:[o.jsxs("button",{type:"button",onClick:()=>d(!l),className:"border-none text-theme-text-secondary text-sm font-medium hover:underline flex items-center gap-x-[8px]",children:[l?o.jsx(Ri,{size:16,weight:"bold",className:"text-theme-text-secondary"}):o.jsx(gc,{size:16,weight:"bold",className:"text-theme-text-secondary"}),o.jsxs("div",{className:"flex items-center gap-x-[4px]",children:[o.jsx(E2,{provider:e,match:"pattern",size:16,className:"text-theme-text-primary"}),o.jsxs("p",{className:"flex items-center gap-x-1 text-theme-text-primary text-base font-bold",children:[_2(e),o.jsxs("span",{className:"text-theme-text-secondary font-normal text-sm",children:["(",u," ",w7("Model",u),")"]})]})]})]}),o.jsx("div",{hidden:!l,className:"mt-[16px]",children:o.jsx("div",{className:"w-full flex flex-col gap-y-[8px]",children:t.map(h=>o.jsx(AI,{alias:e,model:h,downloadModel:i,uninstallModel:a,setActiveModel:n,selectedModelId:r,ui:s},h.id))})})]})}function Rs({text:e,bgClass:t,textClass:i}){return o.jsxs("div",{className:t+" px-1.5 py-1 rounded-full flex items-center gap-x-1 w-fit",children:[o.jsx(ny,{size:14,weight:"bold",className:i}),o.jsx("p",{className:i+" text-xs",children:e})]})}function zI({deviceType:e}){switch(e==null?void 0:e.toLowerCase()){case"cpu":return o.jsx(Rs,{text:"CPU",bgClass:"bg-zinc-800 light:bg-zinc-200",textClass:"text-theme-text-primary"});case"gpu":return o.jsx(Rs,{text:"GPU",bgClass:"bg-green-800 light:bg-green-200",textClass:"text-theme-text-primary"});case"npu":return o.jsx(Rs,{text:"NPU",bgClass:"bg-indigo-800 light:bg-indigo-200",textClass:"text-theme-text-primary"});default:return o.jsx(Rs,{text:"CPU",bgClass:"bg-zinc-800 light:bg-zinc-200",textClass:"text-theme-text-primary"})}}function AI({alias:e,model:t,downloadModel:i=null,uninstallModel:a=null,setActiveModel:n,selectedModelId:r,ui:s={showRuntime:!0}}){const l=m.useRef(null),[d,u]=m.useState(!1),[h,g]=m.useState(!1),[p,v]=m.useState(0),f=typeof t.size=="number"?N7(t.size*1e6,!0,2):t.size??"Unknown size",[b,w]=m.useState(r===t.id);async function y(){if(v(0),t.downloaded)n(t.id);else try{if(!i)return;g(!0),await i(t.id,f,_=>{v(_)})}catch{}finally{g(!1)}}async function k(){if(a)try{g(!0),await a(t.id)}catch{}finally{g(!1)}}return m.useEffect(()=>{r===t.id?(w(!0),l.current.classList.add("!bg-gray-200/10"),setTimeout(()=>l.current.classList.remove("!bg-gray-200/10"),800)):w(!1)},[r]),o.jsxs("div",{ref:l,className:"w-full grid grid-cols-[1fr_auto_1fr] items-center gap-x-4 transition-all duration-300 rounded-lg",children:[o.jsxs("button",{type:"button",className:"border-none flex items-center gap-x-[8px] whitespace-nowrap py-[8px]",disabled:h,onClick:y,children:[s.showRuntime&&o.jsx(zI,{deviceType:t.deviceType}),!s.showRuntime&&t.downloaded&&e==="Downloaded Models"&&o.jsx(E2,{provider:t.organization,match:"pattern",size:16,className:"text-theme-text-primary"}),o.jsx("p",{className:"text-theme-text-primary text-base",children:t.name}),o.jsx("p",{className:"text-theme-text-secondary opacity-70 text-base",children:f})]}),o.jsx("div",{className:"justify-self-start",children:o.jsx(jI,{model:t,isActiveModel:b})}),o.jsxs("div",{className:"relative justify-self-end",children:[a&&t.downloaded?o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",className:"border-none hover:bg-white/20 rounded-lg p-1",onClick:()=>u(!d),children:o.jsx(sy,{size:22,weight:"bold",className:"text-theme-text-primary cursor-pointer"})}),d&&o.jsx("div",{className:"absolute top-[20px] right-[20px] bg-theme-action-menu-bg border border-theme-modal-border rounded-lg py-2 px-4 shadow-lg",children:o.jsx("button",{type:"button",className:"border-none font-medium group",onClick:k,children:o.jsx("p",{className:"text-sm text-theme-text-primary group-hover:underline group-hover:text-theme-text-secondary",children:"Uninstall"})})})]}):null,!t.downloaded&&!h&&o.jsx("button",{type:"button","data-tooltip-id":"install-model-tooltip","data-tooltip-place":"top","data-tooltip-delay-show":300,"data-tooltip-content":`Install ${t.organization}:${t.name}`,className:"border-none hover:bg-white/20 light:hover:bg-black/5 rounded-lg p-2 flex items-center gap-x-1 cursor-pointer",onClick:y,children:o.jsx(ay,{size:20,weight:"bold",className:"text-theme-text-primary"})}),!t.downloaded&&h&&o.jsxs("div",{className:"flex items-center justify-center gap-x-[10px] whitespace-nowrap",children:[!p&&o.jsx(Xa,{size:16,weight:"bold",className:"text-theme-text-primary animate-spin"}),o.jsxs("p",{className:"text-theme-text-secondary text-sm",children:[p,"%"]})]})]})]})}function jI({model:e,isActiveModel:t}){return t?o.jsxs("div",{className:"flex items-center justify-center gap-x-[10px] whitespace-nowrap",children:[o.jsx(iy,{size:8,weight:"fill",className:"text-green-500"}),o.jsx("p",{className:"text-theme-text-primary text-sm",children:"Active"})]}):!t&&e.downloaded?o.jsx("p",{className:"text-theme-text-secondary text-sm italic whitespace-nowrap",children:"Installed"}):e.downloaded?null:o.jsx("p",{className:"text-theme-text-secondary text-sm italic whitespace-nowrap",children:"Not Installed"})}function I2({children:e,fetchModels:t=null,searchQuery:i="",setSearchQuery:a=()=>{},loading:n=!1}){const[r,s]=m.useState(!1);async function l(){s(!0);try{await(t==null?void 0:t())}catch{}finally{s(!1)}}return o.jsxs("div",{className:"flex flex-col w-full",children:[o.jsx("div",{className:"flex gap-x-2 items-center pb-[8px]",children:o.jsx("label",{className:"text-theme-text-primary text-base font-semibold",children:"Available Models"})}),o.jsxs("div",{className:"flex w-full items-center gap-x-[16px]",children:[o.jsxs("div",{className:"relative flex-1 flex-grow",children:[o.jsx(fc,{size:16,weight:"bold",color:"var(--theme-text-primary)",className:"absolute left-[9px] top-[10px] text-theme-settings-input-placeholder peer-focus:invisible"}),o.jsx("input",{type:"search",placeholder:"Search models",value:i,disabled:n,className:"min-h-[32px] border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5 pl-[30px] py-2 search-input disabled:opacity-50 disabled:cursor-not-allowed",onChange:d=>{d.preventDefault(),d.stopPropagation(),a(d.target.value)}})]}),!!t&&o.jsxs("button",{type:"button",onClick:l,disabled:r||n,className:"border-none text-theme-text-secondary text-sm font-medium hover:bg-white/10 light:hover:bg-black/5 rounded-lg px-2 h-full flex items-center gap-x-1 disabled:opacity-50 disabled:cursor-not-allowed",children:[r?o.jsx(Xa,{className:"w-4 h-4 text-theme-text-secondary animate-spin"}):o.jsx(vm,{weight:"bold",className:"w-4 h-4 text-theme-text-secondary"}),o.jsx("span",{className:`text-sm font-medium ${r?"hidden":"text-theme-text-secondary"}`,children:"Refresh Models"})]})]}),e]})}const LI=c.createContext({}),N2=!0;function SI({baseColor:e,highlightColor:t,width:i,height:a,borderRadius:n,circle:r,direction:s,duration:l,enableAnimation:d=N2}){const u={};return s==="rtl"&&(u["--animation-direction"]="reverse"),typeof l=="number"&&(u["--animation-duration"]=`${l}s`),d||(u["--pseudo-element-display"]="none"),(typeof i=="string"||typeof i=="number")&&(u.width=i),(typeof a=="string"||typeof a=="number")&&(u.height=a),(typeof n=="string"||typeof n=="number")&&(u.borderRadius=n),r&&(u.borderRadius="50%"),typeof e<"u"&&(u["--base-color"]=e),typeof t<"u"&&(u["--highlight-color"]=t),u}function MI({count:e=1,wrapper:t,className:i,containerClassName:a,containerTestId:n,circle:r=!1,style:s,...l}){var d,u,h;const g=c.useContext(LI),p={...l};for(const[_,x]of Object.entries(l))typeof x>"u"&&delete p[_];const v={...g,...p,circle:r},f={...s,...SI(v)};let b="react-loading-skeleton";i&&(b+=` ${i}`);const w=(d=v.inline)!==null&&d!==void 0?d:!1,y=[],k=Math.ceil(e);for(let _=0;_<k;_++){let x=f;if(k>e&&_===k-1){const z=(u=x.width)!==null&&u!==void 0?u:"100%",S=e%1,M=typeof z=="number"?z*S:`calc(${z} * ${S})`;x={...x,width:M}}const A=c.createElement("span",{className:b,style:x,key:_},"");w?y.push(A):y.push(c.createElement(c.Fragment,{key:_},A,c.createElement("br",null)))}return c.createElement("span",{className:a,"data-testid":n,"aria-live":"polite","aria-busy":(h=v.enableAnimation)!==null&&h!==void 0?h:N2},t?y.map((_,x)=>c.createElement(t,{key:x},_)):y)}function D2(){return o.jsx("div",{className:"flex flex-col w-full gap-y-4 pt-4",children:o.jsx(MI,{height:100,width:"100%",count:7,highlightColor:"var(--theme-settings-input-active)",baseColor:"var(--theme-settings-input-bg)",enableAnimation:!0,containerClassName:"w-fill flex gap-[8px] flex-col p-0"})})}const PI={downloadModel:async function(e,t="",i=()=>{}){return new Promise(async a=>{try{const n=await fetch(`${E}/utils/dmr/download-model`,{method:"POST",headers:N(),body:JSON.stringify({modelId:e,basePath:t})});if(!n.ok)throw new Error("Error downloading model: "+n.statusText);const r=n.body.getReader();let s=!1;for(;!s;){const{value:l,done:d}=await r.read();if(d)s=!0,a({success:!0});else{const h=new TextDecoder("utf-8").decode(l).split(`
|
|
1714
1714
|
`);for(const g of h)if(g.startsWith("data:")){const p=Et(g.slice(5));switch(p==null?void 0:p.type){case"success":s=!0,a({success:!0});break;case"error":s=!0,a({success:!1,error:(p==null?void 0:p.error)||(p==null?void 0:p.message)});break;case"progress":i(p==null?void 0:p.percentage);break;default:break}}}}}catch(n){console.error("Error downloading model:",n),a({success:!1,error:(n==null?void 0:n.message)||"An error occurred while downloading the model"})}})}};function O2({settings:e}){const{autoDetecting:t,basePath:i,basePathValue:a,handleAutoDetectClick:n}=an({provider:"docker-model-runner",initialBasePath:e==null?void 0:e.DockerModelRunnerBasePath,ENDPOINTS:B6}),[r,s]=m.useState(e==null?void 0:e.DockerModelRunnerModelPref),[l,d]=m.useState((e==null?void 0:e.DockerModelRunnerModelTokenLimit)||4096);return o.jsx("div",{className:"w-full flex flex-col gap-y-7",children:o.jsxs("div",{className:"flex gap-[36px] mt-1.5 flex-wrap",children:[o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsxs("div",{className:"flex items-center gap-1 mb-3",children:[o.jsxs("div",{className:"flex justify-between items-center gap-x-2",children:[o.jsx("label",{className:"text-white text-sm font-semibold",children:"Base URL"}),t?o.jsx(Xa,{className:"w-4 h-4 text-theme-text-secondary animate-spin"}):o.jsx(o.Fragment,{children:!a.value&&o.jsx("button",{onClick:n,className:"bg-primary-button text-xs font-medium px-2 py-1 rounded-lg hover:bg-secondary hover:text-white shadow-[0_4px_14px_rgba(0,0,0,0.25)]",children:"Auto-Detect"})})]}),o.jsxs(lt,{id:"docker-model-runner-base-url",place:"top",delayShow:300,delayHide:800,clickable:!0,className:"tooltip !text-xs !opacity-100 z-99",style:{maxWidth:"250px",whiteSpace:"normal",wordWrap:"break-word"},children:["Enter the URL where the Docker Model Runner is running.",o.jsx("br",{}),o.jsx("br",{}),"You ",o.jsx("b",{children:"must"})," have enabled the Docker Model Runner TCP support for this to work.",o.jsx("br",{}),o.jsx("br",{}),o.jsx(Vt,{to:"https://docs.docker.com/ai/model-runner/get-started/#docker-desktop",target:"_blank",className:"text-blue-500 hover:underline",children:"Learn more →"})]}),o.jsx("div",{className:"text-theme-text-secondary cursor-pointer hover:bg-theme-bg-primary flex items-center justify-center rounded-full","data-tooltip-id":"docker-model-runner-base-url","data-tooltip-place":"top","data-tooltip-delay-hide":800,children:o.jsx(nt,{size:18,className:"text-theme-text-secondary"})})]}),o.jsx("input",{type:"url",name:"DockerModelRunnerBasePath",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"http://localhost:12434/engines/llama.cpp/v1",value:a.value,required:!0,autoComplete:"off",spellCheck:!1,onChange:i.onChange,onBlur:i.onBlur})]}),o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsxs("div",{className:"flex items-center gap-1 mb-3",children:[o.jsx("label",{className:"text-white text-sm font-semibold block",children:"Model context window"}),o.jsxs(lt,{id:"docker-model-runner-model-context-window",place:"top",delayShow:300,delayHide:800,clickable:!0,className:"tooltip !text-xs !opacity-100 z-99",style:{maxWidth:"350px",whiteSpace:"normal",wordWrap:"break-word"},children:["The maximum number of tokens that can be used for a model context window.",o.jsx("br",{}),o.jsx("br",{}),"To set the context window limit for a model, you can use the"," ",o.jsx("code",{children:"docker run"})," command with the"," ",o.jsx("code",{children:"--context-window"})," parameter.",o.jsx("br",{}),o.jsx("br",{}),o.jsxs("code",{children:["docker model configure --context-size ",l||8192," ",r??"ai/qwen3:latest"]}),o.jsx("br",{}),o.jsx("br",{}),o.jsx(Vt,{to:"https://docs.docker.com/ai/model-runner/#context-size",target:"_blank",className:"text-blue-500 hover:underline",children:"Learn more →"})]}),o.jsx("div",{className:"text-theme-text-secondary cursor-pointer hover:bg-theme-bg-primary flex items-center justify-center rounded-full","data-tooltip-id":"docker-model-runner-model-context-window","data-tooltip-place":"top","data-tooltip-delay-hide":800,children:o.jsx(nt,{size:18,className:"text-theme-text-secondary"})})]}),o.jsx("input",{type:"number",name:"DockerModelRunnerModelTokenLimit",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"4096",min:1,value:l,onChange:u=>d(Number(u.target.value)),onScroll:u=>u.target.blur(),required:!0,autoComplete:"off"})]}),o.jsx(CI,{selectedModelId:r,setSelectedModelId:s,basePath:a.value})]})})}function CI({selectedModelId:e,setSelectedModelId:t,basePath:i=null}){const[a,n]=m.useState([]),[r,s]=m.useState([]),[l,d]=m.useState(!0),[u,h]=m.useState("");async function g(){if(!i){n([]),s([]),d(!1),h("");return}d(!0);const{models:w}=await K.customModels("docker-model-runner",null,i);n(w||[]),s(w||[]),h(""),d(!1)}m.useEffect(()=>{g()},[i]),m.useEffect(()=>{if(!u||!a.length){s(a||[]);return}const w=u.toLowerCase().trim(),y=new Map;a.forEach(k=>{const _=k.name.toLowerCase(),x=k.organization.toLowerCase();_.startsWith(w)&&y.set(k.id,k),x.startsWith(w)&&y.set(k.id,k),Vl(_,w)<=2&&y.set(k.id,k),Vl(x,w)<=2&&y.set(k.id,k)}),s(Array.from(y.values()))},[u]);async function p(w,y,k){try{if(!window.confirm(`Are you sure you want to download this model? It is ${y} in size and may take a while to download.`))return;const{success:_,error:x}=await PI.downloadModel(w,i,k);if(!_)throw new Error(x||"An error occurred while downloading the model");k(100),f(w);const A=[...a],z=A.find(S=>S.id===w);z&&(z.downloaded=!0,n(A),s(A),h(""))}catch(_){console.error("Error downloading model:",_),Se(_.message||"An error occurred while downloading the model","error",{clear:!0})}finally{d(!1)}}function v(w){const y=new Map;y.set("installed",new Map),y.set("not installed",new Map);const k=w.reduce((A,z)=>(A[z.organization]=A[z.organization]||[],A[z.organization].push(z),A),{});Object.entries(k).forEach(([A,z])=>{if(z.some(T=>T.downloaded)){const T=z.filter(D=>D.downloaded);y.get("installed").set("Downloaded Models",[...y.get("installed").get("Downloaded Models")||[],...T])}const M=z.map(T=>({...T,name:T.name.split(":")[1]}));y.get("not installed").set(A,M)});const _=new Map,x=new Map;return y.get("installed").entries().forEach(([A,z])=>x.set(A,z)),y.get("not installed").entries().forEach(([A,z])=>_.set(A,z)),Object.fromEntries(Array.from(x.entries()).sort((A,z)=>A[0].localeCompare(z[0])).concat(Array.from(_.entries()).sort((A,z)=>A[0].localeCompare(z[0]))))}function f(w){w!==e&&(t(w),window.dispatchEvent(new Event(Xo)))}const b=v(r);return o.jsxs(I2,{fetchModels:g,searchQuery:u,setSearchQuery:h,loading:l,children:[o.jsx(lt,{id:"install-model-tooltip",place:"top",className:"tooltip !text-xs !opacity-100 z-99"}),o.jsx("input",{type:"hidden",name:"DockerModelRunnerModelPref",id:"DockerModelRunnerModelPref",value:e}),l?o.jsx(D2,{}):r.length===0?o.jsx("div",{className:"flex flex-col w-full gap-y-2 mt-4",children:o.jsx("p",{className:"text-theme-text-secondary text-sm",children:"No models found!"})}):Object.entries(b).map(([w,y])=>o.jsx(T2,{alias:w,models:y,setActiveModel:f,downloadModel:p,selectedModelId:e,ui:{showRuntime:!1}},w))]})}function R2({settings:e}){const[t,i]=m.useState([]),[a,n]=m.useState(!!(e!=null&&e.PrivateModeBasePath)),[r,s]=m.useState(e==null?void 0:e.PrivateModeBasePath),[l,d]=m.useState((e==null?void 0:e.PrivateModeModelPref)||"");return m.useEffect(()=>{d((e==null?void 0:e.PrivateModeModelPref)||"")},[e==null?void 0:e.PrivateModeModelPref]),m.useEffect(()=>{async function u(){try{if(n(!0),!r)throw new Error("Base path is required");const{models:h,error:g}=await K.customModels("privatemode",null,r);if(g)throw new Error(g);i(h)}catch(h){console.error("Error fetching Private Mode models:",h),i([])}finally{n(!1)}}u()},[r]),o.jsx("div",{className:"flex flex-col gap-y-7",children:o.jsxs("div",{className:"flex gap-[36px] mt-1.5 flex-wrap",children:[o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsxs("div",{className:"flex items-center gap-1 mb-2",children:[o.jsx("label",{className:"text-white text-sm font-semibold",children:"Privatemode Proxy URL"}),o.jsx(nt,{size:18,className:"text-theme-text-secondary cursor-pointer","data-tooltip-id":"private-mode-base-url"}),o.jsxs(lt,{id:"private-mode-base-url",place:"top",delayShow:300,clickable:!0,className:"tooltip !text-xs !opacity-100",style:{maxWidth:"250px",whiteSpace:"normal",wordWrap:"break-word"},children:["Enter the URL where Privatemode Proxy is running.",o.jsx("br",{}),o.jsx("br",{}),o.jsx(Vt,{to:"https://docs.privatemode.ai/quickstart#2-run-the-proxy",target:"_blank",className:"text-blue-500 hover:underline",children:"Learn more →"})]})]}),o.jsx("input",{type:"url",name:"PrivateModeBasePath",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"eg: http://127.0.0.1:8080",defaultValue:e==null?void 0:e.PrivateModeBasePath,required:!0,autoComplete:"off",spellCheck:!1,onChange:u=>s(u.target.value)})]}),o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-2",children:"Chat Model"}),a?o.jsx("select",{name:"PrivateModeModelPref",required:!0,disabled:!0,className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",children:o.jsx("option",{children:"---- Loading ----"})}):o.jsx("select",{name:"PrivateModeModelPref",value:l,onChange:u=>d(u.target.value),required:!0,className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",children:t.length>0?o.jsxs(o.Fragment,{children:[o.jsx("option",{value:"",children:"-- Select a model --"}),t.map(u=>o.jsx("option",{value:u.id,children:u.name},u.id))]}):o.jsx("option",{disabled:!0,value:"",children:"No models found"})})]})]})})}function H2({settings:e}){const[t,i]=m.useState(e==null?void 0:e.SambaNovaLLMApiKey),[a,n]=m.useState(e==null?void 0:e.SambaNovaLLMApiKey);return o.jsxs("div",{className:"flex gap-[36px] mt-1.5",children:[o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"SambaNova API Key"}),o.jsx("input",{type:"password",name:"SambaNovaLLMApiKey",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"SambaNova AI API Key",defaultValue:e!=null&&e.SambaNovaLLMApiKey?"*".repeat(20):"",required:!0,autoComplete:"off",spellCheck:!1,onChange:r=>i(r.target.value),onBlur:()=>n(t)})]}),!(e!=null&&e.credentialsOnly)&&o.jsx(EI,{settings:e,apiKey:a})]})}function EI({settings:e,apiKey:t}){const[i,a]=m.useState({}),[n,r]=m.useState(!0);return m.useEffect(()=>{async function s(){r(!0);const{models:l}=await K.customModels("sambanova",t);if((l==null?void 0:l.length)>0){const d=l.reduce((u,h)=>(u[h.organization]=u[h.organization]||[],u[h.organization].push(h),u),{});a(d)}r(!1)}s()},[t]),n||Object.keys(i).length===0?o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Chat Model Selection"}),o.jsx("select",{name:"SambaNovaLLMModelPref",disabled:!0,className:"border-none bg-theme-settings-input-bg border-gray-500 text-white text-sm rounded-lg block w-full p-2.5",children:o.jsx("option",{disabled:!0,selected:!0,children:"-- loading available models --"})})]}):o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Chat Model Selection"}),o.jsx("select",{name:"SambaNovaLLMModelPref",required:!0,className:"border-none bg-theme-settings-input-bg border-gray-500 text-white text-sm rounded-lg block w-full p-2.5",children:Object.keys(i).sort().map(s=>o.jsx("optgroup",{label:s,children:i[s].map(l=>o.jsx("option",{value:l.id,selected:(e==null?void 0:e.SambaNovaLLMModelPref)===l.id,children:l.name},l.id))},s))})]})}const F0={downloadModel:async function(e,t="",i=()=>{}){return new Promise(async a=>{try{const n=await fetch(`${E}/utils/lemonade/download-model`,{method:"POST",headers:N(),body:JSON.stringify({modelId:e,basePath:t})});if(!n.ok)throw new Error("Error downloading model: "+n.statusText);const r=n.body.getReader();let s=!1;for(;!s;){const{value:l,done:d}=await r.read();if(d)s=!0,a({success:!0});else{const h=new TextDecoder("utf-8").decode(l).split(`
|
|
1715
1715
|
`);for(const g of h)if(g.startsWith("data:")){const p=Et(g.slice(5));switch(p==null?void 0:p.type){case"success":s=!0,a({success:!0});break;case"error":s=!0,a({success:!1,error:(p==null?void 0:p.error)||(p==null?void 0:p.message)});break;case"progress":i(p==null?void 0:p.percentage);break;default:break}}}}}catch(n){console.error("Error downloading model:",n),a({success:!1,error:(n==null?void 0:n.message)||"An error occurred while downloading the model"})}})},deleteModel:async function(e,t=""){try{const i=await fetch(`${E}/utils/lemonade/delete-model`,{method:"POST",headers:N(),body:JSON.stringify({modelId:e,basePath:t})}),a=await i.json();return!i.ok||!a.success?{success:!1,error:a.error||"An error occurred while deleting the model"}:{success:!0,message:a.message}}catch(i){return console.error("Error deleting model:",i),{success:!1,error:(i==null?void 0:i.message)||"An error occurred while deleting the model"}}}};function TI(e=""){try{return new URL(e).origin}catch{return e}}function V2({settings:e}){const{autoDetecting:t,basePath:i,basePathValue:a,handleAutoDetectClick:n}=an({provider:"lemonade",initialBasePath:e==null?void 0:e.LemonadeLLMBasePath,ENDPOINTS:G6}),[r,s]=m.useState(e==null?void 0:e.LemonadeLLMModelPref),[l,d]=m.useState((e==null?void 0:e.LemonadeLLMModelTokenLimit)||4096);return o.jsx("div",{className:"w-full flex flex-col gap-y-7",children:o.jsxs("div",{className:"flex gap-[36px] mt-1.5 flex-wrap",children:[o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsxs("div",{className:"flex items-center gap-1 mb-3",children:[o.jsxs("div",{className:"flex justify-between items-center gap-x-2",children:[o.jsx("label",{className:"text-white text-sm font-semibold",children:"Base URL"}),t?o.jsx(Xa,{className:"w-4 h-4 text-theme-text-secondary animate-spin"}):o.jsx(o.Fragment,{children:!a.value&&o.jsx("button",{onClick:n,className:"border-none bg-primary-button text-xs font-medium px-2 py-1 rounded-lg hover:bg-secondary hover:text-white shadow-[0_4px_14px_rgba(0,0,0,0.25)]",children:"Auto-Detect"})})]}),o.jsxs(lt,{id:"lemonade-base-url",place:"top",delayShow:300,delayHide:800,clickable:!0,className:"tooltip !text-xs !opacity-100 z-99",style:{maxWidth:"250px",whiteSpace:"normal",wordWrap:"break-word"},children:["Enter the URL where the Lemonade is running.",o.jsx("br",{}),o.jsx("br",{}),"You ",o.jsx("b",{children:"must"})," have enabled the Lemonade TCP support for this to work.",o.jsx("br",{}),o.jsx("br",{}),o.jsx(Vt,{to:"https://lemonade-server.ai/docs",target:"_blank",className:"text-blue-500 hover:underline",children:"Learn more →"})]}),o.jsx("div",{className:"text-theme-text-secondary cursor-pointer hover:bg-theme-bg-primary flex items-center justify-center rounded-full","data-tooltip-id":"lemonade-base-url","data-tooltip-place":"top","data-tooltip-delay-hide":800,children:o.jsx(nt,{size:18,className:"text-theme-text-secondary"})})]}),o.jsx("input",{type:"url",name:"LemonadeLLMBasePath",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"http://localhost:13305",value:TI(a.value),required:!0,autoComplete:"off",spellCheck:!1,onChange:i.onChange,onBlur:i.onBlur})]}),o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsxs("div",{className:"flex items-center gap-1 mb-3",children:[o.jsx("label",{className:"text-white text-sm font-semibold block",children:"Model context window"}),o.jsx(lt,{id:"lemonade-model-context-window",place:"top",delayShow:300,delayHide:800,clickable:!0,className:"tooltip !text-xs !opacity-100 z-99",style:{maxWidth:"350px",whiteSpace:"normal",wordWrap:"break-word"},children:"The maximum number of tokens that can be used for a model context window. This must be set to a value that is supported by the model."}),o.jsx("div",{className:"text-theme-text-secondary cursor-pointer hover:bg-theme-bg-primary flex items-center justify-center rounded-full","data-tooltip-id":"lemonade-model-context-window","data-tooltip-place":"top","data-tooltip-delay-hide":800,children:o.jsx(nt,{size:18,className:"text-theme-text-secondary"})})]}),o.jsx("input",{type:"number",name:"LemonadeLLMModelTokenLimit",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"8192",min:1,value:l,onChange:u=>d(Number(u.target.value)),onScroll:u=>u.target.blur(),required:!0,autoComplete:"off"})]}),o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsxs("div",{className:"flex items-center gap-1 mb-3",children:[o.jsx("label",{className:"text-white text-sm font-semibold block",children:"API Key (optional)"}),o.jsx(lt,{id:"lemonade-api-key",place:"top",delayShow:300,delayHide:800,clickable:!0,className:"tooltip !text-xs !opacity-100 z-99",style:{maxWidth:"350px",whiteSpace:"normal",wordWrap:"break-word"},children:"The API key for your Lemonade server"}),o.jsx("div",{className:"text-theme-text-secondary cursor-pointer hover:bg-theme-bg-primary flex items-center justify-center rounded-full","data-tooltip-id":"lemonade-api-key","data-tooltip-place":"top","data-tooltip-delay-hide":800,children:o.jsx(nt,{size:18,className:"text-theme-text-secondary"})})]}),o.jsx("input",{type:"password",name:"LemonadeLLMApiKey",defaultValue:e!=null&&e.LemonadeLLMApiKey?"*".repeat(20):"",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",autoComplete:"off"})]}),o.jsx(II,{selectedModelId:r,setSelectedModelId:s,basePath:a.value})]})})}function II({selectedModelId:e,setSelectedModelId:t,basePath:i=null}){const[a,n]=m.useState([]),[r,s]=m.useState([]),[l,d]=m.useState(!0),[u,h]=m.useState("");async function g(){if(!i){n([]),s([]),d(!1),h("");return}d(!0);const{models:y}=await K.customModels("lemonade",null,i);n(y||[]),s(y||[]),h(""),d(!1)}m.useEffect(()=>{g()},[i]),m.useEffect(()=>{if(!u||!a.length){s(a||[]);return}const y=u.toLowerCase().trim(),k=new Map;a.forEach(_=>{const x=_.name.toLowerCase(),A=_.organization.toLowerCase();x.startsWith(y)&&k.set(_.id,_),A.startsWith(y)&&k.set(_.id,_),Vl(x,y)<=2&&k.set(_.id,_),Vl(A,y)<=2&&k.set(_.id,_)}),s(Array.from(k.values()))},[u]);async function p(y){try{if(!window.confirm("Are you sure you want to uninstall this model? You will need to download it again to use it."))return;const{success:k,error:_}=await F0.deleteModel(y,i);if(!k)throw new Error(_||"An error occurred while uninstalling the model");const x=a.map(A=>A.id===y?{...A,downloaded:!1}:A);n(x),s(x),h("")}catch(k){console.error("Error uninstalling model:",k),Se(k.message||"An error occurred while uninstalling the model","error",{clear:!0})}finally{d(!1)}}async function v(y,k,_){try{if(!window.confirm(`Are you sure you want to download this model? It is ${k} in size and may take a while to download.`))return;const{success:x,error:A}=await F0.downloadModel(y,i,_);if(!x)throw new Error(A||"An error occurred while downloading the model");_(100),b(y);const z=[...a],S=z.find(M=>M.id===y);S&&(S.downloaded=!0,n(z),s(z),h(""))}catch(x){console.error("Error downloading model:",x),Se(x.message||"An error occurred while downloading the model","error",{clear:!0})}finally{d(!1)}}function f(y){const k=new Map;k.set("installed",new Map),k.set("not installed",new Map);const _=y.reduce((z,S)=>(z[S.organization]=z[S.organization]||[],z[S.organization].push(S),z),{});Object.entries(_).forEach(([z,S])=>{if(S.some(D=>D.downloaded)){const D=S.filter(F=>F.downloaded);k.get("installed").set("Downloaded Models",[...k.get("installed").get("Downloaded Models")||[],...D])}const T=S.map(D=>({...D,name:D.name.split(":")[1]}));k.get("not installed").set(z,T)});const x=new Map,A=new Map;return k.get("installed").entries().forEach(([z,S])=>A.set(z,S)),k.get("not installed").entries().forEach(([z,S])=>x.set(z,S)),Object.fromEntries(Array.from(A.entries()).sort((z,S)=>z[0].localeCompare(S[0])).concat(Array.from(x.entries()).sort((z,S)=>z[0].localeCompare(S[0]))))}function b(y){y!==e&&(t(y),window.dispatchEvent(new Event(Xo)))}const w=f(r);return o.jsxs(I2,{fetchModels:g,searchQuery:u,setSearchQuery:h,loading:l,children:[o.jsx(lt,{id:"install-model-tooltip",place:"top",className:"tooltip !text-xs !opacity-100 z-99"}),o.jsx("input",{type:"hidden",name:"LemonadeLLMModelPref",id:"LemonadeLLMModelPref",value:e}),l?o.jsx(D2,{}):r.length===0?o.jsx("div",{className:"flex flex-col w-full gap-y-2 mt-4",children:o.jsx("p",{className:"text-theme-text-secondary text-sm",children:"No models found!"})}):Object.entries(w).map(([y,k])=>o.jsx(T2,{alias:y,models:k,setActiveModel:b,downloadModel:v,selectedModelId:e,uninstallModel:p,ui:{showRuntime:!1}},y))]})}function q2({settings:e}){const[t,i]=m.useState(e==null?void 0:e.MinimaxApiKey),[a,n]=m.useState(e==null?void 0:e.MinimaxApiKey);return o.jsxs("div",{className:"flex gap-[36px] mt-1.5",children:[o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"API Key"}),o.jsx("input",{type:"password",name:"MinimaxApiKey",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"Minimax API Key",defaultValue:e!=null&&e.MinimaxApiKey?"*".repeat(20):"",required:!0,autoComplete:"off",spellCheck:!1,onChange:r=>i(r.target.value),onBlur:()=>n(t)})]}),o.jsx(NI,{settings:e,apiKey:a})]})}function NI({apiKey:e,settings:t}){const[i,a]=m.useState([]),[n,r]=m.useState(!0);return m.useEffect(()=>{async function s(){if(!e){a([]),r(!0);return}r(!0);const{models:l}=await K.customModels("minimax",typeof e=="boolean"?null:e);a(l||[]),r(!1)}s()},[e]),n?o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Chat Model Selection"}),o.jsx("select",{name:"MinimaxModelPref",disabled:!0,className:"border-none bg-theme-settings-input-bg border-gray-500 text-white text-sm rounded-lg block w-full p-2.5",children:o.jsx("option",{disabled:!0,selected:!0,children:"-- loading available models --"})})]}):o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Chat Model Selection"}),o.jsx("select",{name:"MinimaxModelPref",required:!0,className:"border-none bg-theme-settings-input-bg border-gray-500 text-white text-sm rounded-lg block w-full p-2.5",children:i.map(s=>o.jsx("option",{value:s.id,selected:(t==null?void 0:t.MinimaxModelPref)===s.id,children:s.name||s.id},s.id))})]})}function F2({settings:e}){const[t,i]=m.useState(e==null?void 0:e.CerebrasApiKey),[a,n]=m.useState(e==null?void 0:e.CerebrasApiKey);return o.jsxs("div",{className:"flex gap-[36px] mt-1.5",children:[o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Cerebras API Key"}),o.jsx("input",{type:"password",name:"CerebrasApiKey",className:"border-none bg-theme-settings-input-bg text-white placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"Cerebras API Key",defaultValue:e!=null&&e.CerebrasApiKey?"*".repeat(20):"",required:!0,autoComplete:"off",spellCheck:!1,onChange:r=>i(r.target.value),onBlur:()=>n(t)})]}),!(e!=null&&e.credentialsOnly)&&o.jsx(DI,{settings:e,apiKey:a})]})}function DI({apiKey:e,settings:t}){const[i,a]=m.useState([]),[n,r]=m.useState(!0);return m.useEffect(()=>{async function s(){try{r(!0);const{models:l}=await K.customModels("cerebras");a(l||[])}catch(l){console.error("Failed to fetch custom models:",l),a([])}finally{r(!1)}}s()},[]),n?o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Chat Model Selection"}),o.jsx("select",{name:"CerebrasModelPref",disabled:!0,className:"border-none bg-theme-settings-input-bg border-gray-500 text-white text-sm rounded-lg block w-full p-2.5",children:o.jsx("option",{disabled:!0,selected:!0,children:"--loading available models--"})})]}):o.jsxs("div",{className:"flex flex-col w-60",children:[o.jsx("label",{className:"text-white text-sm font-semibold block mb-3",children:"Chat Model Selection"}),o.jsx("select",{name:"CerebrasModelPref",required:!0,className:"border-none bg-theme-settings-input-bg border-gray-500 text-white text-sm rounded-lg block w-full p-2.5",children:i.length>0&&o.jsx("optgroup",{label:"Available models",children:i.map(s=>o.jsx("option",{value:s.id,selected:(t==null?void 0:t.CerebrasModelPref)===s.id,children:s.name},s.id))})})]})}function U2({name:e,value:t,image:i,description:a,checked:n,onClick:r}){return o.jsxs("div",{onClick:()=>r(t),className:`w-full p-2 rounded-md hover:cursor-pointer hover:bg-theme-bg-secondary ${n?"bg-theme-bg-secondary":""}`,children:[o.jsx("input",{type:"checkbox",value:t,className:"peer hidden",checked:n,readOnly:!0,formNoValidate:!0}),o.jsxs("div",{className:"flex gap-x-4 items-center",children:[o.jsx("img",{src:i,alt:`${e} logo`,className:"w-10 h-10 rounded-md"}),o.jsxs("div",{className:"flex flex-col",children:[o.jsx("div",{className:"text-sm font-semibold text-white",children:e}),o.jsx("div",{className:"mt-1 text-xs text-description",children:a})]})]})]})}function nh({children:e,disabled:t=!1,onClick:i,className:a=""}){return o.jsx("button",{disabled:t,onClick:()=>i==null?void 0:i(),className:`border-none text-xs px-4 py-1 font-semibold light:text-[#ffffff] rounded-lg bg-primary-button hover:bg-secondary hover:text-white h-[34px] -mr-8 whitespace-nowrap w-fit ${a}`,children:o.jsx("div",{className:"flex items-center justify-center gap-2",children:e})})}const pr=[{name:"Model Router",value:"anythingllm-router",logo:yc,options:e=>o.jsx(RE,{settings:e}),description:"Route messages to different LLM providers based on rules you define.",requiredConfig:[],requiredFeature:"modelRouter"},{name:"OpenAI",value:"openai",logo:wc,options:e=>o.jsx(Bw,{settings:e}),description:"The standard option for most non-commercial use.",requiredConfig:["OpenAiKey"]},{name:"Azure OpenAI",value:"azure",logo:xc,options:e=>o.jsx(Kw,{settings:e}),description:"The enterprise option of OpenAI hosted on Azure services.",requiredConfig:["AzureOpenAiEndpoint"]},{name:"Anthropic",value:"anthropic",logo:Tm,options:e=>o.jsx(Ww,{settings:e}),description:"A friendly AI Assistant hosted by Anthropic.",requiredConfig:["AnthropicApiKey"]},{name:"Gemini",value:"gemini",logo:zc,options:e=>o.jsx(Jw,{settings:e}),description:"Google's largest and most capable AI model",requiredConfig:["GeminiLLMApiKey"]},{name:"NVIDIA NIM",value:"nvidia-nim",logo:Wm,options:e=>o.jsx(f2,{settings:e}),description:"Run full parameter LLMs directly on your NVIDIA RTX GPU using NVIDIA NIM.",requiredConfig:["NvidiaNimLLMBasePath"]},{name:"HuggingFace",value:"huggingface",logo:Om,options:e=>o.jsx(a2,{settings:e}),description:"Access 150,000+ open-source LLMs and the world's AI community",requiredConfig:["HuggingFaceLLMEndpoint","HuggingFaceLLMAccessToken","HuggingFaceLLMTokenLimit"]},{name:"Ollama",value:"ollama",logo:Ac,options:e=>o.jsx(Qw,{settings:e}),description:"Run LLMs locally on your own machine.",requiredConfig:["OllamaLLMBasePath"]},{name:"Dell Pro AI Studio",value:"dpais",logo:Zm,options:e=>o.jsx(v2,{settings:e}),description:"Run powerful LLMs quickly on NPU powered by Dell Pro AI Studio.",requiredConfig:["DellProAiStudioBasePath","DellProAiStudioModelPref","DellProAiStudioTokenLimit"]},{name:"LM Studio",value:"lmstudio",logo:jc,options:e=>o.jsx($w,{settings:e}),description:"Discover, download, and run thousands of cutting edge LLMs in a few clicks.",requiredConfig:["LMStudioBasePath"]},{name:"Docker Model Runner",value:"docker-model-runner",logo:Xm,options:e=>o.jsx(O2,{settings:e}),description:"Run LLMs using Docker Model Runner.",requiredConfig:["DockerModelRunnerBasePath","DockerModelRunnerModelPref","DockerModelRunnerModelTokenLimit"]},{name:"Lemonade",value:"lemonade",logo:Ec,options:e=>o.jsx(V2,{settings:e}),description:"Run local LLMs, ASR, TTS, and more in a single unified AI runtime.",requiredConfig:["LemonadeLLMBasePath"]},{name:"SambaNova",value:"sambanova",logo:th,options:e=>o.jsx(H2,{settings:e}),description:"Run open source models from SambaNova.",requiredConfig:["SambaNovaLLMApiKey"]},{name:"Local AI",value:"localai",logo:Lc,options:e=>o.jsx(Zw,{settings:e}),description:"Run LLMs locally on your own machine.",requiredConfig:["LocalAiApiKey","LocalAiBasePath","LocalAiTokenLimit"]},{name:"Together AI",value:"togetherai",logo:Nm,options:e=>o.jsx(e2,{settings:e}),description:"Run open source models from Together AI.",requiredConfig:["TogetherAiApiKey"]},{name:"Fireworks AI",value:"fireworksai",logo:Dm,options:e=>o.jsx(t2,{settings:e}),description:"The fastest and most efficient inference engine to build production-ready, compound AI systems.",requiredConfig:["FireworksAiLLMApiKey"]},{name:"Mistral",value:"mistral",logo:Sc,options:e=>o.jsx(i2,{settings:e}),description:"Run open source models from Mistral AI.",requiredConfig:["MistralApiKey"]},{name:"Perplexity AI",value:"perplexity",logo:Rm,options:e=>o.jsx(n2,{settings:e}),description:"Run powerful and internet-connected models hosted by Perplexity AI.",requiredConfig:["PerplexityApiKey"]},{name:"OpenRouter",value:"openrouter",logo:Mc,options:e=>o.jsx(r2,{settings:e}),description:"A unified interface for LLMs.",requiredConfig:["OpenRouterApiKey"]},{name:"Groq",value:"groq",logo:Hm,options:e=>o.jsx(o2,{settings:e}),description:"The fastest LLM inferencing available for real-time AI applications.",requiredConfig:["GroqApiKey"]},{name:"KoboldCPP",value:"koboldcpp",logo:Vm,options:e=>o.jsx(l2,{settings:e}),description:"Run local LLMs using koboldcpp.",requiredConfig:["KoboldCPPModelPref","KoboldCPPBasePath","KoboldCPPTokenLimit"]},{name:"Oobabooga Web UI",value:"textgenwebui",logo:qm,options:e=>o.jsx(c2,{settings:e}),description:"Run local LLMs using Oobabooga's Text Generation Web UI.",requiredConfig:["TextGenWebUIBasePath","TextGenWebUITokenLimit"]},{name:"Cohere",value:"cohere",logo:Pc,options:e=>o.jsx(s2,{settings:e}),description:"Run Cohere's powerful Command models.",requiredConfig:["CohereApiKey"]},{name:"LiteLLM",value:"litellm",logo:Cc,options:e=>o.jsx(d2,{settings:e}),description:"Run LiteLLM's OpenAI compatible proxy for various LLMs.",requiredConfig:["LiteLLMBasePath"]},{name:"DeepSeek",value:"deepseek",logo:Um,options:e=>o.jsx(p2,{settings:e}),description:"Run DeepSeek's powerful LLMs.",requiredConfig:["DeepSeekApiKey"]},{name:"PPIO",value:"ppio",logo:$m,options:e=>o.jsx(b2,{settings:e}),description:"Run stable and cost-efficient open-source LLM APIs, such as DeepSeek, Llama, Qwen etc.",requiredConfig:["PPIOApiKey"]},{name:"AWS Bedrock",value:"bedrock",logo:Fm,options:e=>o.jsx(u2,{settings:e}),description:"Run powerful foundation models privately with AWS Bedrock.",requiredConfig:["AwsBedrockLLMAccessKeyId","AwsBedrockLLMAccessKey","AwsBedrockLLMRegion","AwsBedrockLLMModel"]},{name:"APIpie",value:"apipie",logo:Bm,options:e=>o.jsx(m2,{settings:e}),description:"A unified API of AI services from leading providers",requiredConfig:["ApipieLLMApiKey","ApipieLLMModelPref"]},{name:"Moonshot AI",value:"moonshotai",logo:Jm,options:e=>o.jsx(k2,{settings:e}),description:"Run Moonshot AI's powerful LLMs.",requiredConfig:["MoonshotAiApiKey"]},{name:"Privatemode",value:"privatemode",logo:eh,options:e=>o.jsx(R2,{settings:e}),description:"Run LLMs with end-to-end encryption.",requiredConfig:["PrivateModeBasePath"]},{name:"Novita AI",value:"novita",logo:Im,options:e=>o.jsx(Yw,{settings:e}),description:"Reliable, Scalable, and Cost-Effective for LLMs from Novita AI",requiredConfig:["NovitaLLMApiKey"]},{name:"CometAPI",value:"cometapi",logo:Qm,options:e=>o.jsx(Xw,{settings:e}),description:"500+ AI Models all in one API.",requiredConfig:["CometApiLLMApiKey"]},{name:"Microsoft Foundry Local",value:"foundry",logo:Uw,options:e=>o.jsx(f7,{settings:e}),description:"Run Microsoft's Foundry models locally.",requiredConfig:["FoundryBasePath","FoundryModelPref","FoundryModelTokenLimit"]},{name:"xAI",value:"xai",logo:Gm,options:e=>o.jsx(h2,{settings:e}),description:"Run xAI's powerful LLMs like Grok-2 and more.",requiredConfig:["XAIApiKey","XAIModelPref"]},{name:"Z.AI",value:"zai",logo:Km,options:e=>o.jsx(g2,{settings:e}),description:"Run Z.AI's powerful GLM models.",requiredConfig:["ZAiApiKey"]},{name:"GiteeAI",value:"giteeai",logo:Ym,options:e=>o.jsx(y2,{settings:e}),description:"Run GiteeAI's powerful LLMs.",requiredConfig:["GiteeAIApiKey"]},{name:"Minimax",value:"minimax",logo:ih,options:e=>o.jsx(q2,{settings:e}),description:"Run Minimax's powerful M2 LLMs.",requiredConfig:["MinimaxApiKey"]},{name:"Cerebras",value:"cerebras",logo:ah,options:e=>o.jsx(F2,{settings:e}),description:"Run models at instant speed on Cerebras inference.",requiredConfig:["CerebrasApiKey"]},{name:"Generic OpenAI",value:"generic-openai",logo:_c,options:e=>o.jsx(Gw,{settings:e}),description:"Connect to any OpenAi-compatible service via a custom configuration",requiredConfig:["GenericOpenAiBasePath","GenericOpenAiModelPref","GenericOpenAiTokenLimit","GenericOpenAiKey"],connectionConfig:["GenericOpenAiBasePath"]}],Xo="llm-preference-changed";function OI(){var T,D,F;const[e,t]=m.useState(!1),[i,a]=m.useState(!1),[n,r]=m.useState(null),[s,l]=m.useState(!0),[d,u]=m.useState(""),[h,g]=m.useState([]),[p,v]=m.useState(null),[f,b]=m.useState(!1),w=m.useRef(null),{t:y}=Qe(),k=qy(),_=((T=k.llmProviders)==null?void 0:T.allowlist)??null,x=pr.filter(O=>{var Z;return!(O.requiredFeature&&!((Z=k[O.requiredFeature])!=null&&Z.enabled)||_&&!_.includes(O.value))}),A=async O=>{O.preventDefault();const Z=O.target,R={LLMProvider:p},ce=new FormData(Z);for(var[ae,Q]of ce.entries())R[ae]=Q;const{error:I}=await K.updateSystem(R);t(!0),I?Se(`Failed to save LLM settings: ${I}`,"error"):Se("LLM preferences saved successfully.","success"),t(!1),a(!!I)},z=O=>{u(""),v(O),b(!1),a(!0)},S=()=>{d.length>0?(u(""),w.current&&(w.current.value="")):b(!f)};m.useEffect(()=>{async function O(){const Z=await K.keys();r(Z),v(Z==null?void 0:Z.LLMProvider),l(!1)}O()},[]),m.useEffect(()=>{function O(){a(!0)}return window.addEventListener(Xo,O),()=>{window.removeEventListener(Xo,O)}},[]),m.useEffect(()=>{const O=x.filter(Z=>Z.name.toLowerCase().includes(d.toLowerCase()));g(O)},[d,p,x]);const M=pr.find(O=>O.value===p);return o.jsxs("div",{className:"w-screen h-screen overflow-hidden bg-theme-bg-container flex",children:[o.jsx(Fw,{}),s?o.jsx("div",{style:{height:Mn?"100%":"calc(100% - 32px)"},className:"relative md:ml-[2px] md:mr-[16px] md:my-[16px] md:rounded-[16px] bg-theme-bg-secondary w-full h-full overflow-y-scroll p-4 md:p-0",children:o.jsx("div",{className:"w-full h-full flex justify-center items-center",children:o.jsx(Nn,{})})}):o.jsx("div",{style:{height:Mn?"100%":"calc(100% - 32px)"},className:"relative md:ml-[2px] md:mr-[16px] md:my-[16px] md:rounded-[16px] bg-theme-bg-secondary w-full h-full overflow-y-scroll p-4 md:p-0",children:o.jsx("form",{onSubmit:A,className:"flex w-full",children:o.jsxs("div",{className:"flex flex-col w-full px-1 md:pl-6 md:pr-[50px] md:py-6 py-16",children:[o.jsxs("div",{className:"w-full flex flex-col gap-y-1 pb-6 border-white light:border-theme-sidebar-border border-b-2 border-opacity-10",children:[o.jsx("div",{className:"flex gap-x-4 items-center",children:o.jsx("p",{className:"text-lg leading-6 font-bold text-white",children:y("llm.title")})}),o.jsx("p",{className:"text-xs leading-[18px] font-base text-white text-opacity-60",children:y("llm.description")})]}),o.jsx("div",{className:"w-full justify-end flex",children:i&&o.jsx(nh,{onClick:()=>A(),className:"mt-3 mr-0 -mb-14 z-10",children:e?"Saving...":"Save changes"})}),o.jsx("div",{className:"text-base font-bold text-white mt-6 mb-4",children:y("llm.provider")}),o.jsxs("div",{className:"relative",children:[f&&o.jsx("div",{className:"fixed top-0 left-0 w-full h-full bg-black bg-opacity-70 backdrop-blur-sm z-10",onClick:()=>b(!1)}),f?o.jsx("div",{className:"absolute top-0 left-0 w-full max-w-[640px] max-h-[310px] min-h-[64px] bg-theme-settings-input-bg rounded-lg flex flex-col justify-between cursor-pointer border-2 border-primary-button z-20",children:o.jsxs("div",{className:"w-full flex flex-col gap-y-1",children:[o.jsxs("div",{className:"flex items-center sticky top-0 z-10 border-b border-[#9CA3AF] mx-4 bg-theme-settings-input-bg",children:[o.jsx(fc,{size:20,weight:"bold",className:"absolute left-4 z-30 text-theme-text-primary -ml-4 my-2"}),o.jsx("input",{type:"text",name:"llm-search",autoComplete:"off",placeholder:"Search all LLM providers",className:"border-none -ml-4 my-2 bg-transparent z-20 pl-12 h-[38px] w-full px-4 py-1 text-sm outline-none text-theme-text-primary placeholder:text-theme-text-primary placeholder:font-medium",onChange:O=>u(O.target.value),ref:w,onKeyDown:O=>{O.key==="Enter"&&O.preventDefault()}}),o.jsx(Sr,{size:20,weight:"bold",className:"cursor-pointer text-white hover:text-x-button",onClick:S})]}),o.jsx("div",{className:"flex-1 pl-4 pr-2 flex flex-col gap-y-1 overflow-y-auto white-scrollbar pb-4 max-h-[245px]",children:h.map(O=>o.jsx(U2,{name:O.name,value:O.value,image:O.logo,description:O.description,checked:p===O.value,onClick:()=>z(O.value)},O.name))})]})}):o.jsxs("button",{className:"w-full max-w-[640px] h-[64px] bg-theme-settings-input-bg rounded-lg flex items-center p-[14px] justify-between cursor-pointer border-2 border-transparent hover:border-primary-button transition-all duration-300",type:"button",onClick:()=>b(!0),children:[o.jsxs("div",{className:"flex gap-x-4 items-center",children:[o.jsx("img",{src:(M==null?void 0:M.logo)||yc,alt:`${M==null?void 0:M.name} logo`,className:"w-10 h-10 rounded-md"}),o.jsxs("div",{className:"flex flex-col text-left",children:[o.jsx("div",{className:"text-sm font-semibold text-white",children:(M==null?void 0:M.name)||"None selected"}),o.jsx("div",{className:"mt-1 text-xs text-description",children:(M==null?void 0:M.description)||"You need to select an LLM"})]})]}),o.jsx(ey,{size:24,weight:"bold",className:"text-white"})]})]}),o.jsx("div",{onChange:()=>a(!0),className:"mt-4 flex flex-col gap-y-1",children:p&&((F=(D=pr.find(O=>O.value===p))==null?void 0:D.options)==null?void 0:F.call(D,n))})]})})})]})}const RI=Object.freeze(Object.defineProperty({__proto__:null,AVAILABLE_LLM_PROVIDERS:pr,LLM_PREFERENCE_CHANGED_EVENT:Xo,default:OI},Symbol.toStringTag,{value:"Module"}));function FD(e,t=500){setTimeout(()=>{const i=document.querySelector(`[data-llm-value="${e}"]`);i&&i.scrollIntoView({behavior:"smooth",block:"nearest"})},t)}function UD(e){try{const t=document.getElementById("workspace-llm-model-select");return t?t.querySelector(`option[value="${e}"]`)?e:t.querySelector("option").value:e}catch{return null}}function BD(e,t){if(!e)return!1;const i=pr.find(a=>a.value===t);if(!i)return!1;for(const a of i.requiredConfig)if(!e.hasOwnProperty(a)||!e[a])return!0;return!1}const GD=pr.filter(e=>!cC.includes(e.value));function Tc({children:e,isOpen:t,noPortal:i=!1}){return t?i?o.jsx("div",{className:"bg-black/60 backdrop-blur-sm fixed top-0 left-0 outline-none w-screen h-screen flex items-center justify-center z-99",children:e}):os.createPortal(o.jsx("div",{className:"bg-black/60 backdrop-blur-sm fixed top-0 left-0 outline-none w-screen h-screen flex items-center justify-center z-99",children:e}),document.getElementById("root")):null}async function HI(e,t){const i=e.getReader();let a;for(;!(a=await i.read()).done;)t(a.value)}function VI(e){let t,i,a,n=!1;return function(s){t===void 0?(t=s,i=0,a=-1):t=FI(t,s);const l=t.length;let d=0;for(;i<l;){n&&(t[i]===10&&(d=++i),n=!1);let u=-1;for(;i<l&&u===-1;++i)switch(t[i]){case 58:a===-1&&(a=i-d);break;case 13:n=!0;case 10:u=i;break}if(u===-1)break;e(t.subarray(d,u),a),d=i,a=-1}d===l?t=void 0:d!==0&&(t=t.subarray(d),i-=d)}}function qI(e,t,i){let a=U0();const n=new TextDecoder;return function(s,l){if(s.length===0)i==null||i(a),a=U0();else if(l>0){const d=n.decode(s.subarray(0,l)),u=l+(s[l+1]===32?2:1),h=n.decode(s.subarray(u));switch(d){case"data":a.data=a.data?a.data+`
|
|
1716
|
-
`+h:h;break;case"event":a.event=h;break;case"id":e(a.id=h);break;case"retry":const g=parseInt(h,10);isNaN(g)||t(a.retry=g);break}}}}function FI(e,t){const i=new Uint8Array(e.length+t.length);return i.set(e),i.set(t,e.length),i}function U0(){return{data:"",event:"",id:"",retry:void 0}}var UI=globalThis&&globalThis.__rest||function(e,t){var i={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(i[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,a=Object.getOwnPropertySymbols(e);n<a.length;n++)t.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(e,a[n])&&(i[a[n]]=e[a[n]]);return i};const dp="text/event-stream",BI=1e3,B0="last-event-id";function B2(e,t){var{signal:i,headers:a,onopen:n,onmessage:r,onclose:s,onerror:l,openWhenHidden:d,fetch:u}=t,h=UI(t,["signal","headers","onopen","onmessage","onclose","onerror","openWhenHidden","fetch"]);return new Promise((g,p)=>{const v=Object.assign({},a);v.accept||(v.accept=dp);let f;function b(){f.abort(),document.hidden||A()}d||document.addEventListener("visibilitychange",b);let w=BI,y=0;function k(){document.removeEventListener("visibilitychange",b),window.clearTimeout(y),f.abort()}i==null||i.addEventListener("abort",()=>{k(),g()});const _=u??window.fetch,x=n??GI;async function A(){var z;f=new AbortController;try{const S=await _(e,Object.assign(Object.assign({},h),{headers:v,signal:f.signal}));await x(S),await HI(S.body,VI(qI(M=>{M?v[B0]=M:delete v[B0]},M=>{w=M},r))),s==null||s(),k(),g()}catch(S){if(!f.signal.aborted)try{const M=(z=l==null?void 0:l(S))!==null&&z!==void 0?z:w;window.clearTimeout(y),y=window.setTimeout(A,M)}catch(M){k(),p(M)}}}A()})}function GI(e){const t=e.headers.get("content-type");if(!(t!=null&&t.startsWith(dp)))throw new Error(`Expected content-type to be ${dp}, Actual: ${t}`)}const Od=26;function Rd({idx:e,activeIdx:t,isActive:i,workspace:a,thread:n,onRemove:r,toggleMarkForDeletion:s,hasNext:l,ctrlPressed:d=!1}){const{slug:u,threadSlug:h=null}=fm(),g=(a==null?void 0:a.slug)??u,p=m.useRef(null),[v,f]=m.useState(!1),b=n.virtual?"/":n.slug?G.workspace.thread(g,n.slug):G.workspace.chat(g),{ref:w}=Vw({isActive:i,behavior:"instant",block:"center"});return o.jsxs("div",{className:"w-full relative flex h-[38px] items-center border-none rounded-lg",role:"listitem",children:[o.jsx("div",{style:{width:Od/2},className:`${i?"border-l-2 border-b-2 border-white light:border-blue-800 z-[2]":"border-l border-b border-zinc-500 light:border-slate-400 z-[1]"} h-[50%] absolute top-0 left-3 rounded-bl-lg`}),l&&o.jsx("div",{style:{width:Od/2},className:`${e<=t&&!i?"border-l-2 border-white light:border-blue-800 z-[2]":"border-l border-zinc-500 light:border-slate-400 z-[1]"} h-[100%] absolute top-0 left-3`}),o.jsx("div",{style:{width:Od+8},className:"h-full"}),o.jsxs("div",{className:`flex w-full items-center justify-between pr-2 group/thread relative ${i?"bg-[var(--theme-sidebar-thread-selected)] light:bg-blue-200":"hover:bg-theme-sidebar-subitem-hover light:hover:bg-slate-300"} rounded-[4px]`,children:[n.deleted?o.jsxs("div",{className:"w-full flex justify-between",children:[o.jsx("div",{className:"w-full pl-2 py-1",children:o.jsx("p",{className:"text-left text-sm text-slate-400/50 light:text-slate-500 italic",children:"deleted thread"})}),d&&o.jsx("button",{type:"button",className:"border-none",onClick:()=>s(n.id),children:o.jsx(J1,{className:"text-zinc-300 hover:text-white light:text-theme-text-secondary hover:light:text-theme-text-primary",size:18})})]}):o.jsx(Vt,{ref:w,to:b,"data-tooltip-id":"workspace-thread-name","data-tooltip-content":n.name,className:"w-full pl-2 py-1 overflow-hidden","aria-current":i?"page":"",children:o.jsx("p",{className:`text-left text-sm truncate max-w-[150px] ${i?"font-semibold text-theme-text-primary light:text-blue-900":"text-theme-text-primary font-medium light:text-slate-800"}`,children:n.name})}),!!n.slug&&!n.deleted&&!n.virtual&&o.jsxs("div",{ref:p,className:"flex items-center",children:[" ",d?o.jsx("button",{type:"button",className:"border-none",onClick:()=>s(n.id),children:o.jsx(Sr,{className:"text-zinc-300 light:text-theme-text-secondary hover:text-white hover:light:text-theme-text-primary",weight:"bold",size:18})}):o.jsx("div",{className:"flex items-center w-fit md:invisible md:group-hover/thread:visible md:group-focus-within/thread:visible gap-x-1",children:o.jsx("button",{type:"button",className:"border-none",onClick:()=>f(!v),"aria-label":"Thread options",children:o.jsx(oy,{className:"text-slate-300 light:text-theme-text-secondary hover:text-white hover:light:text-theme-text-primary",size:25})})}),v&&o.jsx(KI,{containerRef:p,workspace:a,thread:n,onRemove:r,close:()=>f(!1),currentThreadSlug:h})]})]})]})}function KI({containerRef:e,workspace:t,thread:i,onRemove:a,close:n,currentThreadSlug:r}){const s=m.useRef(null),l=p=>{var v,f;return s.current&&!((v=s.current)!=null&&v.contains(p.target))&&!((f=e.current)!=null&&f.contains(p.target))&&n(),!1},d=p=>{(p.key==="Escape"||p.key==="Esc")&&n()};function u(){window.removeEventListener("click",l),window.removeEventListener("keyup",d)}m.useEffect(()=>{function p(){if(!(s!=null&&s.current)||!e.current)return!1;window.document.addEventListener("click",l),window.document.addEventListener("keyup",d)}return p(),u},[s.current,e.current]);const h=async()=>{var f;const p=(f=window.prompt("What would you like to rename this thread to?"))==null?void 0:f.trim();if(!p||p.length===0){n();return}const{message:v}=await Pn.threads.update(t.slug,i.slug,{name:p});if(v){Se(`Thread could not be updated! ${v}`,"error",{clear:!0}),n();return}i.name=p,n()},g=async()=>{if(!window.confirm("Are you sure you want to delete this thread? All of its chats will be deleted. You cannot undo this."))return;const p=await Pn.threads.delete(t.slug,i.slug);if(!p){Se("Thread could not be deleted!","error",{clear:!0});return}if(p){Se("Thread deleted successfully!","success",{clear:!0}),a(i.id),r===i.slug&&(window.location.href=G.workspace.chat(t.slug));return}};return o.jsxs("div",{ref:s,className:"absolute w-fit z-[20] top-[25px] right-[10px] bg-zinc-900 light:bg-theme-bg-sidebar light:border-[1px] light:border-theme-sidebar-border rounded-lg p-1",children:[o.jsxs("button",{onClick:h,type:"button",className:"w-full rounded-md flex items-center p-2 gap-x-2 hover:bg-slate-500/20 text-slate-300 light:text-theme-text-primary",children:[o.jsx(vy,{size:18}),o.jsx("p",{className:"text-sm",children:"Rename"})]}),o.jsxs("button",{onClick:g,type:"button",className:"w-full rounded-md flex items-center p-2 gap-x-2 hover:bg-red-500/20 text-slate-300 light:text-theme-text-primary hover:text-red-100",children:[o.jsx(zm,{size:18}),o.jsx("p",{className:"text-sm",children:"Delete Thread"})]})]})}const up="renameThread";function KD({workspace:e,isVirtualThread:t=!1}){const{threadSlug:i=null}=fm(),[a,n]=m.useState([]),[r,s]=m.useState(!0),[l,d]=m.useState(!1);m.useEffect(()=>{const f=b=>{const{threadSlug:w,newName:y}=b.detail;n(k=>k.map(_=>_.slug===w?{..._,name:y}:_))};return window.addEventListener(up,f),()=>{window.removeEventListener(up,f)}},[]),m.useEffect(()=>{async function f(){if(!e.slug)return;const{threads:b}=await Pn.threads.all(e.slug);s(!1),n(b)}f()},[e.slug]),m.useEffect(()=>{const f=w=>{["Control","Meta"].includes(w.key)&&d(!0)},b=w=>{["Control","Meta"].includes(w.key)&&(d(!1),n(y=>y.map(k=>({...k,deleted:!1}))))};return window.addEventListener("keydown",f),window.addEventListener("keyup",b),()=>{window.removeEventListener("keydown",f),window.removeEventListener("keyup",b)}},[]);const u=f=>{n(b=>b.map(w=>w.id!==f?w:{...w,deleted:!w.deleted}))},h=async()=>{const f=a.filter(b=>b.deleted===!0).map(b=>b.slug);await Pn.threads.deleteBulk(e.slug,f),n(b=>b.filter(w=>!w.deleted)),f.includes(i)&&(window.location.href=G.workspace.chat(e.slug))};function g(f){n(b=>b.map(w=>w.id!==f?w:{...w,deleted:!0})),setTimeout(()=>{n(b=>b.filter(w=>!w.deleted))},500)}function p(){if(t)return a.length+1;const f=a.findIndex(b=>(b==null?void 0:b.slug)===i);return f>=0?f+1:0}if(r)return o.jsx("div",{className:"flex flex-col bg-pulse w-full h-10 items-center justify-center",children:o.jsx("p",{className:"text-xs text-white animate-pulse",children:"loading threads...."})});const v=p();return o.jsxs("div",{className:"flex flex-col",role:"list","aria-label":"Threads",children:[o.jsx(Rd,{idx:0,activeIdx:v,isActive:v===0,workspace:e,thread:{slug:null,name:"default"},hasNext:a.length>0||t}),a.map((f,b)=>o.jsx(Rd,{idx:b+1,ctrlPressed:l,toggleMarkForDeletion:u,activeIdx:v,isActive:v===b+1,workspace:e,onRemove:g,thread:f,hasNext:b!==a.length-1||t},f.slug)),t&&o.jsx(Rd,{idx:v,activeIdx:v,isActive:!0,workspace:e,thread:{slug:null,name:"*New Thread",virtual:!0},hasNext:!1}),o.jsx($I,{ctrlPressed:l,threads:a,onDelete:h}),o.jsx(WI,{workspace:e})]})}function WI({workspace:e}){const[t,i]=m.useState(!1),a=async()=>{i(!0);const{thread:n,error:r}=await Pn.threads.new(e.slug);if(r){Se(`Could not create thread - ${r}`,"error",{clear:!0}),i(!1);return}window.location.replace(G.workspace.thread(e.slug,n.slug))};return o.jsx("button",{onClick:a,className:"w-full relative flex h-[40px] items-center border-none hover:bg-[var(--theme-sidebar-thread-selected)] light:hover:bg-slate-300 hover:light:bg-theme-sidebar-subitem-hover rounded-lg",children:o.jsxs("div",{className:"flex w-full gap-x-2 items-center pl-4",children:[o.jsx("div",{className:"bg-zinc-800 light:bg-slate-50 p-2 rounded-lg h-[24px] w-[24px] flex items-center justify-center",children:t?o.jsx(Xa,{weight:"bold",size:14,className:"shrink-0 animate-spin text-white light:text-theme-text-primary"}):o.jsx(xm,{weight:"bold",size:14,className:"shrink-0 text-white light:text-theme-text-primary"})}),t?o.jsx("p",{className:"text-left text-white light:text-theme-text-primary text-sm",children:"Starting Thread..."}):o.jsx("p",{className:"text-left text-white light:text-theme-text-primary text-sm font-semibold",children:"New Thread"})]})})}function $I({ctrlPressed:e,threads:t,onDelete:i}){return!e||t.filter(a=>a.deleted).length===0?null:o.jsx("button",{type:"button",onClick:i,className:"w-full relative flex h-[40px] items-center border-none hover:bg-red-400/20 rounded-lg group",children:o.jsxs("div",{className:"flex w-full gap-x-2 items-center pl-4",children:[o.jsx("div",{className:"bg-transparent p-2 rounded-lg h-[24px] w-[24px] flex items-center justify-center",children:o.jsx(zm,{weight:"bold",size:14,className:"shrink-0 text-white light:text-red-500/50 group-hover:text-red-400"})}),o.jsx("p",{className:"text-white light:text-theme-text-secondary text-left text-sm group-hover:text-red-400",children:"Delete Selected"})]})})}const Ei={defaultSettings:{showScrollbar:!1,autoSubmitSttInput:!0,autoPlayAssistantTtsResponse:!1,enableSpellCheck:!0,renderHTML:!1},getSettings:()=>{const e=localStorage.getItem(Kg);return Et(e,Ei.defaultSettings)},get:e=>{const t=Ei.getSettings();return t.hasOwnProperty(e)?t[e]:Ei.defaultSettings[e]},set:(e,t)=>{const i=Ei.getSettings();return i[e]=t,Ei.updateSettings(i),i},updateSettings:e=>{const t={...Ei.getSettings(),...e};return localStorage.setItem(Kg,JSON.stringify(t)),t}},pp="ASSISTANT_MESSAGE_COMPLETE_EVENT",G2=m.createContext();function WD({children:e}){const[t,i]=m.useState({}),[a,n]=m.useState("native"),[r,s]=m.useState(!0);return m.useEffect(()=>{async function l(){const d=await K.keys();n((d==null?void 0:d.TextToSpeechProvider)??"native"),i(d),s(!1)}l()},[]),o.jsx(G2.Provider,{value:{settings:t,provider:a,loading:r},children:e})}function $D(){const e=m.useContext(G2);if(!e)throw new Error("useTTSProvider must be used within a TTSProvider");return e}function G0(e){window.dispatchEvent(new CustomEvent(pp,{detail:{chatId:e}}))}function ZD(){const e=Ei.get("autoPlayAssistantTtsResponse");function t(i){let a=0;const{chatId:n}=i.detail;function r(){const s=document.querySelector(`[data-auto-play-chat-id="${n}"]`);return s?(s.click(),!0):(a++,a>3||setTimeout(()=>{r()},1e3*a),!1)}setTimeout(()=>{r()},800)}m.useEffect(()=>{if(e)return window.addEventListener(pp,t),()=>{window.removeEventListener(pp,t)};console.log("Assistant TTS auto-play is disabled")},[e])}const K2="abort-chat-stream";function JD(e,t,i,a,n,r){var y;const{uuid:s,textResponse:l,type:d,sources:u=[],error:h,close:g,animate:p=!1,chatId:v=null,action:f=null,metrics:b={},routedTo:w=null}=e;if(d==="modelRouteNotification"){n.push({type:"modelRouteNotification",uuid:s,routedTo:w,role:"assistant"}),i([...n]);return}if(d==="abort"||d==="statusResponse")t(!1),i([...a,{type:d,uuid:s,content:l,role:"assistant",sources:u,closed:!0,error:h,animate:p,pending:!1,metrics:b}]),n.push({type:d,uuid:s,content:l,role:"assistant",sources:u,closed:!0,error:h,animate:p,pending:!1,metrics:b});else if(d==="textResponse")t(!1),i([...a,{uuid:s,content:l,role:"assistant",sources:u,closed:g,error:h,animate:!g,pending:!1,chatId:v,metrics:b}]),n.push({uuid:s,content:l,role:"assistant",sources:u,closed:g,error:h,animate:!g,pending:!1,chatId:v,metrics:b}),G0(v);else if(d==="textResponseChunk"||d==="finalizeResponseStream"){const k=n.findIndex(_=>_.uuid===s);if(k!==-1){const _={...n[k]};let x;d==="finalizeResponseStream"?(x={..._,closed:g,animate:!g,pending:!1,chatId:v,metrics:b},n[k-1]={...n[k-1],chatId:v},G0(v),t(!1)):x={..._,content:_.content+l,...u&&u.length>0?{sources:u}:{},error:h,closed:g,animate:!g,pending:!1,chatId:v,metrics:b},n[k]=x}else n.push({uuid:s,sources:u,error:h,content:l,role:"assistant",closed:g,animate:!g,pending:!1,chatId:v,metrics:b});i([...n])}else if(d==="agentInitWebsocketConnection")r(e.websocketUUID);else if(d==="stopGeneration"){const k=n.length-1,x={...{...n[k]},sources:[],closed:!0,error:null,animate:!1,pending:!1,metrics:b};n[k]=x,i([...n]),t(!1)}f==="reset_chat"&&i([]),f==="rename_thread"&&(y=e==null?void 0:e.thread)!=null&&y.slug&&e.thread.name&&window.dispatchEvent(new CustomEvent(up,{detail:{threadSlug:e.thread.slug,newName:e.thread.name}}))}function QD(e){return(e==null?void 0:e.openAiPrompt)??"You are Totem LLM. You are an AI that prioritizes consistent behavior with your history."}function YD(e){return(e==null?void 0:e.queryRefusalResponse)??"There is no relevant information in this workspace to answer your query."}let Hs;const ZI=new Uint8Array(16);function JI(){if(!Hs&&(Hs=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Hs))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Hs(ZI)}const _t=[];for(let e=0;e<256;++e)_t.push((e+256).toString(16).slice(1));function QI(e,t=0){return _t[e[t+0]]+_t[e[t+1]]+_t[e[t+2]]+_t[e[t+3]]+"-"+_t[e[t+4]]+_t[e[t+5]]+"-"+_t[e[t+6]]+_t[e[t+7]]+"-"+_t[e[t+8]]+_t[e[t+9]]+"-"+_t[e[t+10]]+_t[e[t+11]]+_t[e[t+12]]+_t[e[t+13]]+_t[e[t+14]]+_t[e[t+15]]}const YI=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),K0={randomUUID:YI};function Oa(e,t,i){if(K0.randomUUID&&!t&&!e)return K0.randomUUID();e=e||{};const a=e.random||(e.rng||JI)();if(a[6]=a[6]&15|64,a[8]=a[8]&63|128,t){i=i||0;for(let n=0;n<16;++n)t[i+n]=a[n];return t}return QI(a)}const XI={all:async function(e){const{threads:t}=await fetch(`${E}/workspace/${e}/threads`,{method:"GET",headers:N()}).then(i=>i.json()).catch(()=>({threads:[]}));return{threads:t}},new:async function(e){const{thread:t,error:i}=await fetch(`${E}/workspace/${e}/thread/new`,{method:"POST",headers:N()}).then(a=>a.json()).catch(a=>({thread:null,error:a.message}));return{thread:t,error:i}},update:async function(e,t,i={}){const{thread:a,message:n}=await fetch(`${E}/workspace/${e}/thread/${t}/update`,{method:"POST",body:JSON.stringify(i),headers:N()}).then(r=>r.json()).catch(r=>({thread:null,message:r.message}));return{thread:a,message:n}},delete:async function(e,t){return await fetch(`${E}/workspace/${e}/thread/${t}`,{method:"DELETE",headers:N()}).then(i=>i.ok).catch(()=>!1)},deleteBulk:async function(e,t=[]){return await fetch(`${E}/workspace/${e}/thread-bulk-delete`,{method:"DELETE",body:JSON.stringify({slugs:t}),headers:N()}).then(i=>i.ok).catch(()=>!1)},chatHistory:async function(e,t){return await fetch(`${E}/workspace/${e}/thread/${t}/chats`,{method:"GET",headers:N()}).then(a=>a.json()).then(a=>a.history||[]).catch(()=>[])},streamChat:async function({workspaceSlug:e,threadSlug:t},i,a,n=[]){const r=new AbortController;window.addEventListener(K2,()=>{r.abort(),a({id:Oa(),type:"stopGeneration"})}),await B2(`${E}/workspace/${e}/thread/${t}/stream-chat`,{method:"POST",body:JSON.stringify({message:i,attachments:n}),headers:N(),signal:r.signal,openWhenHidden:!0,async onopen(s){if(!s.ok)throw s.status>=400&&s.status<500&&s.status!==429?(a({id:Oa(),type:"abort",textResponse:null,sources:[],close:!0,error:`An error occurred while streaming response. Code ${s.status}`}),r.abort(),new Error("Invalid Status code response.")):(a({id:Oa(),type:"abort",textResponse:null,sources:[],close:!0,error:"An error occurred while streaming response. Unknown Error."}),r.abort(),new Error("Unknown error"))},async onmessage(s){const l=Et(s.data,null);l&&a(l)},onerror(s){throw a({id:Oa(),type:"abort",textResponse:null,sources:[],close:!0,error:`An error occurred while streaming response. ${s.message}`}),r.abort(),new Error}})},_deleteEditedChats:async function(e="",t="",i){return await fetch(`${E}/workspace/${e}/thread/${t}/delete-edited-chats`,{method:"DELETE",headers:N(),body:JSON.stringify({startingId:i})}).then(a=>{if(a.ok)return!0;throw new Error("Failed to delete chats.")}).catch(a=>(console.log(a),!1))},_updateChat:async function(e="",t="",i,a,n="assistant"){return await fetch(`${E}/workspace/${e}/thread/${t}/update-chat`,{method:"POST",headers:N(),body:JSON.stringify({chatId:i,newText:a,role:n})}).then(r=>{if(r.ok)return!0;throw new Error("Failed to update chat.")}).catch(r=>(console.log(r),!1))}},Pn={workspaceOrderStorageKey:"anythingllm-workspace-order",maxContextWindowLimit:.8,new:async function(e={}){const{workspace:t,message:i}=await fetch(`${E}/workspace/new`,{method:"POST",body:JSON.stringify(e),headers:N()}).then(a=>a.json()).catch(a=>({workspace:null,message:a.message}));return{workspace:t,message:i}},update:async function(e,t={}){const{workspace:i,message:a}=await fetch(`${E}/workspace/${e}/update`,{method:"POST",body:JSON.stringify(t),headers:N()}).then(n=>n.json()).catch(n=>({workspace:null,message:n.message}));return{workspace:i,message:a}},modifyEmbeddings:async function(e,t={}){const{workspace:i,message:a}=await fetch(`${E}/workspace/${e}/update-embeddings`,{method:"POST",body:JSON.stringify(t),headers:N()}).then(n=>n.json()).catch(n=>({workspace:null,message:n.message}));return{workspace:i,message:a}},removeQueuedEmbedding:async function(e,t){return fetch(`${E}/workspace/${e}/embed-queue`,{method:"DELETE",body:JSON.stringify({filename:t}),headers:N()}).then(i=>i.json()).catch(()=>({success:!1}))},chatHistory:async function(e){return await fetch(`${E}/workspace/${e}/chats`,{method:"GET",headers:N()}).then(i=>i.json()).then(i=>i.history||[]).catch(()=>[])},updateChatFeedback:async function(e,t,i){return await fetch(`${E}/workspace/${t}/chat-feedback/${e}`,{method:"POST",headers:N(),body:JSON.stringify({feedback:i})}).then(n=>n.ok).catch(()=>!1)},deleteChats:async function(e="",t=[]){return await fetch(`${E}/workspace/${e}/delete-chats`,{method:"DELETE",headers:N(),body:JSON.stringify({chatIds:t})}).then(i=>{if(i.ok)return!0;throw new Error("Failed to delete chats.")}).catch(i=>(console.log(i),!1))},deleteEditedChats:async function(e="",t="",i){return t?this.threads._deleteEditedChats(e,t,i):this._deleteEditedChats(e,i)},updateChat:async function(e="",t="",i,a,n="assistant"){return t?this.threads._updateChat(e,t,i,a,n):this._updateChat(e,i,a,n)},multiplexStream:async function({workspaceSlug:e,threadSlug:t=null,prompt:i,chatHandler:a,attachments:n=[]}){return t?this.threads.streamChat({workspaceSlug:e,threadSlug:t},i,a,n):this.streamChat({slug:e},i,a,n)},streamChat:async function({slug:e},t,i,a=[]){const n=new AbortController;window.addEventListener(K2,()=>{n.abort(),i({id:Oa(),type:"stopGeneration"})}),await B2(`${E}/workspace/${e}/stream-chat`,{method:"POST",body:JSON.stringify({message:t,attachments:a}),headers:N(),signal:n.signal,openWhenHidden:!0,async onopen(r){if(!r.ok)throw r.status>=400&&r.status<500&&r.status!==429?(i({id:Oa(),type:"abort",textResponse:null,sources:[],close:!0,error:`An error occurred while streaming response. Code ${r.status}`}),n.abort(),new Error("Invalid Status code response.")):(i({id:Oa(),type:"abort",textResponse:null,sources:[],close:!0,error:"An error occurred while streaming response. Unknown Error."}),n.abort(),new Error("Unknown error"))},async onmessage(r){const s=Et(r.data,null);s&&i(s)},onerror(r){throw i({id:Oa(),type:"abort",textResponse:null,sources:[],close:!0,error:`An error occurred while streaming response. ${r.message}`}),n.abort(),new Error}})},all:async function(){return await fetch(`${E}/workspaces`,{method:"GET",headers:N()}).then(t=>t.json()).then(t=>t.workspaces||[]).catch(()=>[])},bySlug:async function(e=""){return await fetch(`${E}/workspace/${e}`,{headers:N()}).then(i=>i.json()).then(i=>i.workspace).catch(()=>null)},delete:async function(e){return await fetch(`${E}/workspace/${e}`,{method:"DELETE",headers:N()}).then(i=>i.ok).catch(()=>!1)},wipeVectorDb:async function(e){return await fetch(`${E}/workspace/${e}/reset-vector-db`,{method:"DELETE",headers:N()}).then(t=>t.ok).catch(()=>!1)},uploadFile:async function(e,t){const i=await fetch(`${E}/workspace/${e}/upload`,{method:"POST",body:t,headers:N()}),a=await i.json();return{response:i,data:a}},parseFile:async function(e,t){const i=await fetch(`${E}/workspace/${e}/parse`,{method:"POST",body:t,headers:N()}),a=await i.json();return{response:i,data:a}},getParsedFiles:async function(e,t=null){const i=new URL(`${Xs()}/workspace/${e}/parsed-files`);return t&&i.searchParams.set("threadSlug",t),await(await fetch(i,{method:"GET",headers:N()})).json()},uploadLink:async function(e,t){const i=await fetch(`${E}/workspace/${e}/upload-link`,{method:"POST",body:JSON.stringify({link:t}),headers:N()}),a=await i.json();return{response:i,data:a}},getSuggestedMessages:async function(e){return await fetch(`${E}/workspace/${e}/suggested-messages`,{method:"GET",cache:"no-cache",headers:N()}).then(t=>{if(!t.ok)throw new Error("Could not fetch suggested messages.");return t.json()}).then(t=>t.suggestedMessages).catch(t=>(console.error(t),null))},setSuggestedMessages:async function(e,t){return fetch(`${E}/workspace/${e}/suggested-messages`,{method:"POST",headers:N(),body:JSON.stringify({messages:t})}).then(i=>{if(!i.ok)throw new Error(i.statusText||"Error setting suggested messages.");return{success:!0,...i.json()}}).catch(i=>(console.error(i),{success:!1,error:i.message}))},setPinForDocument:async function(e,t,i){return fetch(`${E}/workspace/${e}/update-pin`,{method:"POST",headers:N(),body:JSON.stringify({docPath:t,pinStatus:i})}).then(a=>{if(!a.ok)throw new Error(a.statusText||"Error setting pin status for document.");return!0}).catch(a=>(console.error(a),!1))},ttsMessage:async function(e,t){return await fetch(`${E}/workspace/${e}/tts/${t}`,{method:"GET",cache:"no-cache",headers:N()}).then(i=>{if(i.ok&&i.status!==204)return i.blob();throw new Error("Failed to fetch TTS.")}).then(i=>i?URL.createObjectURL(i):null).catch(()=>null)},uploadPfp:async function(e,t){return await fetch(`${E}/workspace/${t}/upload-pfp`,{method:"POST",body:e,headers:N()}).then(i=>{if(!i.ok)throw new Error("Error uploading pfp.");return{success:!0,error:null}}).catch(i=>(console.log(i),{success:!1,error:i.message}))},fetchPfp:async function(e){return await fetch(`${E}/workspace/${e}/pfp`,{method:"GET",cache:"no-cache",headers:N()}).then(t=>{if(t.ok&&t.status!==204)return t.blob();throw new Error("Failed to fetch pfp.")}).then(t=>t?URL.createObjectURL(t):null).catch(()=>null)},removePfp:async function(e){return await fetch(`${E}/workspace/${e}/remove-pfp`,{method:"DELETE",headers:N()}).then(t=>{if(t.ok)return{success:!0,error:null};throw new Error("Failed to remove pfp.")}).catch(t=>(console.log(t),{success:!1,error:t.message}))},_updateChat:async function(e="",t,i,a="assistant"){return await fetch(`${E}/workspace/${e}/update-chat`,{method:"POST",headers:N(),body:JSON.stringify({chatId:t,newText:i,role:a})}).then(n=>{if(n.ok)return!0;throw new Error("Failed to update chat.")}).catch(n=>(console.log(n),!1))},_deleteEditedChats:async function(e="",t){return await fetch(`${E}/workspace/${e}/delete-edited-chats`,{method:"DELETE",headers:N(),body:JSON.stringify({startingId:t})}).then(i=>{if(i.ok)return!0;throw new Error("Failed to delete chats.")}).catch(i=>(console.log(i),!1))},deleteChat:async e=>await fetch(`${E}/workspace/workspace-chats/${e}`,{method:"PUT",headers:N()}).then(t=>t.json()).catch(t=>(console.error(t),{success:!1,error:t.message})),forkThread:async function(e="",t=null,i=null){return await fetch(`${E}/workspace/${e}/thread/fork`,{method:"POST",headers:N(),body:JSON.stringify({threadSlug:t,chatId:i})}).then(a=>{if(!a.ok)throw new Error("Failed to fork thread.");return a.json()}).then(a=>a.newThreadSlug).catch(a=>(console.error("Error forking thread:",a),null))},uploadAndEmbedFile:async function(e,t){const i=await fetch(`${E}/workspace/${e}/upload-and-embed`,{method:"POST",body:t,headers:N()}),a=await i.json();return{response:i,data:a}},deleteParsedFiles:async function(e,t=[]){return(await fetch(`${E}/workspace/${e}/delete-parsed-files`,{method:"DELETE",headers:N(),body:JSON.stringify({fileIds:t})})).ok},embedParsedFile:async function(e,t){const i=await fetch(`${E}/workspace/${e}/embed-parsed-file/${t}`,{method:"POST",headers:N()}),a=await i.json();return{response:i,data:a}},deleteAndUnembedFile:async function(e,t){return(await fetch(`${E}/workspace/${e}/remove-and-unembed`,{method:"DELETE",body:JSON.stringify({documentLocation:t}),headers:N()})).ok},storeWorkspaceOrder:function(e=[]){try{return localStorage.setItem(this.workspaceOrderStorageKey,JSON.stringify(e)),!0}catch(t){return console.error("Error reordering workspaces:",t),!1}},orderWorkspaces:function(e=[]){const t=Et(localStorage.getItem(this.workspaceOrderStorageKey))||[];if(t.length===0)return e;const i=Array.from(e);return i.sort((a,n)=>t.indexOf(a.id)-t.indexOf(n.id)),i},searchWorkspaceOrThread:async function(e){return await fetch(`${E}/workspace/search`,{method:"POST",headers:N(),body:JSON.stringify({searchTerm:e})}).then(i=>i.json()).catch(i=>(console.error(i),{workspaces:[],threads:[]}))},agentCommandAvailable:async function(e=null){return e?await fetch(`${E}/workspace/${e}/is-agent-command-available`,{headers:N()}).then(t=>t.json()).catch(t=>(console.error(t),{showAgentCommand:!0})):{showAgentCommand:!0}},threads:XI};function W2(){const[e,t]=m.useState(!1);return{isOpen:e,openModal:()=>t(!0),closeModal:()=>t(!1)}}const eN="toggle_llm_selector",XD="save_llm_selector",eO="provider_setup_requested",Fl="keyboard-shortcuts-help",$2=navigator.platform.toUpperCase().indexOf("MAC")>=0,mp={"⌘ + ,":{translationKey:"settings",action:()=>{window.location.href=G.settings.interface()}},"⌘ + H":{translationKey:"home",action:()=>{window.location.href=G.home()}},"⌘ + I":{translationKey:"workspaces",action:()=>{window.location.href=G.settings.workspaces()}},"⌘ + K":{translationKey:"apiKeys",action:()=>{window.location.href=G.settings.apiKeys()}},"⌘ + L":{translationKey:"llmPreferences",action:()=>{window.location.href=G.settings.llmPreference()}},"⌘ + Shift + C":{translationKey:"chatSettings",action:()=>{window.location.href=G.settings.chat()}},"⌘ + Shift + ?":{translationKey:"help",action:()=>{window.dispatchEvent(new CustomEvent(Fl,{detail:{show:!0}}))}},F1:{translationKey:"help",action:()=>{window.dispatchEvent(new CustomEvent(Fl,{detail:{show:!0}}))}},"⌘ + Shift + L":{translationKey:"showLLMSelector",action:()=>{window.dispatchEvent(new Event(eN))}}},Z2={},J2=$2?"meta":"ctrl";for(const e in mp){const t=e.replace("⌘",J2).replaceAll(" ","").toLowerCase();Z2[t]=mp[e].action}function tN(e){let t="";if((e.metaKey||e.ctrlKey)&&(t+=J2+"+"),e.shiftKey&&(t+="shift+"),e.altKey&&(t+="alt+"),e.key===",")t+=",";else if(e.key==="?"||e.key==="/")t+="?";else{if(e.key==="Control")return"";if(e.key==="Shift")return"";t+=e.key.toLowerCase()}return t}function iN(){function e(t){const i=tN(t);if(!i)return;const a=Z2[i];a&&(t.preventDefault(),a())}return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)}function aN(){m.useEffect(()=>{const e=dc();if(e&&(e==null?void 0:e.role)!=="admin")return;const t=iN();return()=>t()},[])}function es({children:e}){return aN(),e}function nN(){const[e,t]=m.useState(!1),{t:i}=Qe();return m.useEffect(()=>(window.addEventListener(Fl,()=>t(a=>!a)),()=>{window.removeEventListener(Fl,()=>t(!1))}),[]),e?o.jsx("div",{className:"fixed inset-0 z-50 overflow-auto bg-black bg-opacity-50 flex items-center justify-center",children:o.jsxs("div",{className:"relative bg-theme-bg-secondary rounded-lg p-6 max-w-2xl w-full mx-4",children:[o.jsxs("div",{className:"flex justify-between items-center mb-6",children:[o.jsx("h2",{className:"text-xl font-semibold text-white",children:i("keyboard-shortcuts.title")}),o.jsx("button",{onClick:()=>t(!1),className:"text-white hover:text-gray-300","aria-label":"Close",children:o.jsx(Sr,{size:24})})]}),o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:Object.entries(mp).map(([a,n])=>o.jsxs("div",{className:"flex items-center justify-between p-3 bg-theme-bg-hover rounded-lg",children:[o.jsx("span",{className:"text-white",children:i(`keyboard-shortcuts.shortcuts.${n.translationKey}`)}),o.jsx("kbd",{className:"px-2 py-1 bg-theme-bg-secondary text-white rounded border border-gray-600",children:$2?a:a.replace("⌘","Ctrl")})]},a))})]})}):null}const hp="open-image-lightbox";function tO(e,t=0){window.dispatchEvent(new CustomEvent(hp,{detail:{images:e,initialIndex:t}}))}function rN(){const[e,t]=m.useState(null),[i,a]=m.useState(0);m.useEffect(()=>{function u(h){t(h.detail.images),a(h.detail.initialIndex)}return window.addEventListener(hp,u),()=>window.removeEventListener(hp,u)},[]);function n(){t(null)}function r(){a(u=>u>0?u-1:e.length-1)}function s(){a(u=>u<e.length-1?u+1:0)}if(m.useEffect(()=>{if(!e)return;function u(h){h.key==="Escape"?n():h.key==="ArrowLeft"?r():h.key==="ArrowRight"&&s()}return window.addEventListener("keydown",u),()=>window.removeEventListener("keydown",u)},[e]),!e||e.length===0)return null;const l=Math.min(i,e.length-1),d=e[l];return d?os.createPortal(o.jsxs("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center bg-black/90",onClick:n,children:[o.jsx("button",{type:"button",onClick:n,className:"absolute top-4 right-4 p-2 text-white light:text-white hover:text-white/70 transition-colors rounded-full bg-white/10 hover:bg-white/20 border-none cursor-pointer","aria-label":"Close lightbox",children:o.jsx(Sr,{size:24,weight:"bold"})}),e.length>1&&o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",onClick:u=>{u.stopPropagation(),r()},className:"absolute left-4 p-3 text-white light:text-white hover:text-white/70 transition-colors rounded-full bg-white/10 hover:bg-white/20 border-none cursor-pointer","aria-label":"Previous image",children:o.jsx(X1,{size:24,weight:"bold"})}),o.jsx("button",{type:"button",onClick:u=>{u.stopPropagation(),s()},className:"absolute right-4 p-3 text-white light:text-white hover:text-white/70 transition-colors rounded-full bg-white/10 hover:bg-white/20 border-none cursor-pointer","aria-label":"Next image",children:o.jsx(gc,{size:24,weight:"bold"})})]}),o.jsx("img",{src:d.contentString,alt:d.name||"attachment",className:"max-w-[90vw] max-h-[90vh] object-contain",onClick:u=>u.stopPropagation()}),e.length>1&&o.jsxs("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 text-white/70 text-sm bg-black/50 px-3 py-1 rounded-full",children:[l+1," / ",e.length]})]}),document.getElementById("root")):null}const oN=m.createContext(null),Hd={didCatch:!1,error:null};class sN extends m.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Hd}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){const{error:t}=this.state;if(t!==null){for(var i,a,n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];(i=(a=this.props).onReset)===null||i===void 0||i.call(a,{args:r,reason:"imperative-api"}),this.setState(Hd)}}componentDidCatch(t,i){var a,n;(a=(n=this.props).onError)===null||a===void 0||a.call(n,t,i)}componentDidUpdate(t,i){const{didCatch:a}=this.state,{resetKeys:n}=this.props;if(a&&i.error!==null&&lN(t.resetKeys,n)){var r,s;(r=(s=this.props).onReset)===null||r===void 0||r.call(s,{next:n,prev:t.resetKeys,reason:"keys"}),this.setState(Hd)}}render(){const{children:t,fallbackRender:i,FallbackComponent:a,fallback:n}=this.props,{didCatch:r,error:s}=this.state;let l=t;if(r){const d={error:s,resetErrorBoundary:this.resetErrorBoundary};if(typeof i=="function")l=i(d);else if(a)l=m.createElement(a,d);else if(n!==void 0)l=n;else throw s}return m.createElement(oN.Provider,{value:{didCatch:r,error:s,resetErrorBoundary:this.resetErrorBoundary}},l)}}function lN(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return e.length!==t.length||e.some((i,a)=>!Object.is(i,t[a]))}function cN({error:e,resetErrorBoundary:t}){return m.useState(!1),o.jsxs("div",{className:"flex flex-col items-center justify-center min-h-screen bg-theme-bg-primary text-theme-text-primary gap-4 p-4 md:p-8 w-full",children:[o.jsx("h1",{className:"text-xl md:text-2xl font-bold text-center",children:"An error occurred."}),o.jsx("p",{className:"text-theme-text-secondary text-center px-4",children:e==null?void 0:e.message}),!1,o.jsxs("div",{className:"flex flex-col md:flex-row gap-3 md:gap-4 mt-4 w-full md:w-auto",children:[o.jsxs("button",{onClick:t,className:"flex items-center justify-center gap-2 px-4 py-2 bg-theme-bg-secondary text-theme-text-primary rounded-lg hover:bg-theme-sidebar-item-hover transition-all duration-300 w-full md:w-auto",children:[o.jsx(vm,{className:"w-4 h-4"}),"Reset"]}),o.jsxs(f6,{to:"/",className:"flex items-center justify-center gap-2 px-4 py-2 bg-theme-bg-secondary text-theme-text-primary rounded-lg hover:bg-theme-sidebar-item-hover transition-all duration-300 w-full md:w-auto",children:[o.jsx(_m,{className:"w-4 h-4"}),"Home"]})]})]})}function dN(){m.useEffect(()=>{if(typeof window>"u"||!("serviceWorker"in navigator))return;const e=t=>{const i=t==null?void 0:t.data;!i||(i==null?void 0:i.type)!=="BACKEND_OFFLINE"||Se("The backend appears to be offline. Please ensure the CLI/server is running in the terminal.","error",{clear:!0})};return navigator.serviceWorker.addEventListener("message",e),navigator.serviceWorker.register("/service-worker.js").catch(t=>{console.error("Failed to register backend offline service worker",t)}),()=>{navigator.serviceWorker.removeEventListener("message",e)}},[])}function uN(){const e=ta();return dN(),o.jsx(sN,{FallbackComponent:cN,onError:console.error,resetKeys:[e.pathname],children:o.jsx(xA,{children:o.jsx(AA,{children:o.jsx(m.Suspense,{fallback:o.jsx(_a,{}),children:o.jsx(nz,{children:o.jsx(yA,{children:o.jsx(bA,{children:o.jsxs(D6,{i18n:vt,children:[o.jsx($4,{}),o.jsx(Gu,{}),o.jsx(nN,{}),o.jsx(rN,{})]})})})})})})})})}async function W0(){return await fetch(`${E}/system/check-token`,{method:"GET",cache:"default",headers:N()}).then(t=>t.status===200).catch(()=>!1)}function pN(){const[e,t]=m.useState(null);return m.useEffect(()=>{if(!window)return;const i=!!window.localStorage.getItem(at),a=!!window.localStorage.getItem(Ke);let n=null;i&&a&&(n="multi"),!i&&a&&(n="single"),t(n)},[window]),e}function Q2(){const{pfp:e,setPfp:t}=m.useContext(G1);return{pfp:e,setPfp:t}}function mN(){const e=Object.keys(Wu),t=new Intl.DisplayNames(e,{type:"language"}),i=(a="en")=>{if(!Object.keys(Wu).includes(a))return!1;vt.changeLanguage(a)};return{currentLanguage:vt.language||"en",supportedLanguages:e,getLanguageName:(a="en")=>t.of(a),changeLanguage:i}}const $0={sm:"h-[12px] w-[20px] after:h-[8px] after:w-[8px] after:top-[2px] after:left-[2px] peer-checked:after:translate-x-full",md:"h-[16px] w-[28px] after:h-[12px] after:w-[12px] after:top-[2px] after:left-[2px] peer-checked:after:translate-x-full",lg:"h-[19px] w-[36px] after:h-[15px] after:w-[15px] after:top-[2px] after:left-[2px] peer-checked:after:translate-x-[17px]"},Z0={sm:{label:"text-[12px] leading-[10px] font-medium mt-[1.5px]",description:"text-[10px] leading-[16px] font-normal",gap:"gap-[2px]"},md:{label:"text-[14px] leading-[18px] font-medium -mt-[2px]",description:"text-[12px] leading-[16px] font-normal",gap:"gap-[2px]"},lg:{label:"text-[16px] leading-[14px] font-medium mt-[2.5px]",description:"text-[14px] leading-[24px] font-normal",gap:"gap-[2px]"}};function Ic({className:e,enabled:t,onChange:i,disabled:a=!1,size:n="sm",name:r,label:s,description:l,variant:d="default",hint:u,value:h}){const g=t!==void 0?{checked:t,onChange:v=>i==null?void 0:i(v.target.checked)}:{defaultChecked:!1},p=Z0[n]||Z0.sm;return d==="horizontal"?o.jsxs("label",{className:`flex items-start justify-between max-w-[700px] ${a?"cursor-not-allowed opacity-50":"cursor-pointer"} ${e??""}`,children:[o.jsx(Q0,{label:s,description:l,labelStyles:p,hint:u}),o.jsx("div",{className:"shrink-0 ml-4",children:o.jsx(J0,{name:r,disabled:a,size:n,inputProps:g,value:h})})]}):o.jsxs("label",{className:`inline-flex items-start ${a?"cursor-not-allowed opacity-50":"cursor-pointer"} ${e??""}`,children:[o.jsx(J0,{name:r,disabled:a,size:n,inputProps:g,value:h}),(s||l)&&o.jsx("div",{className:"ml-3",children:o.jsx(Q0,{label:s,description:l,labelStyles:p,hint:u})})]})}function J0({name:e,disabled:t,size:i,inputProps:a,value:n}){return o.jsxs(o.Fragment,{children:[o.jsx("input",{type:"checkbox",name:e,disabled:t,className:"peer sr-only",value:n,...a}),o.jsx("div",{className:`
|
|
1716
|
+
`+h:h;break;case"event":a.event=h;break;case"id":e(a.id=h);break;case"retry":const g=parseInt(h,10);isNaN(g)||t(a.retry=g);break}}}}function FI(e,t){const i=new Uint8Array(e.length+t.length);return i.set(e),i.set(t,e.length),i}function U0(){return{data:"",event:"",id:"",retry:void 0}}var UI=globalThis&&globalThis.__rest||function(e,t){var i={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(i[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,a=Object.getOwnPropertySymbols(e);n<a.length;n++)t.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(e,a[n])&&(i[a[n]]=e[a[n]]);return i};const dp="text/event-stream",BI=1e3,B0="last-event-id";function B2(e,t){var{signal:i,headers:a,onopen:n,onmessage:r,onclose:s,onerror:l,openWhenHidden:d,fetch:u}=t,h=UI(t,["signal","headers","onopen","onmessage","onclose","onerror","openWhenHidden","fetch"]);return new Promise((g,p)=>{const v=Object.assign({},a);v.accept||(v.accept=dp);let f;function b(){f.abort(),document.hidden||A()}d||document.addEventListener("visibilitychange",b);let w=BI,y=0;function k(){document.removeEventListener("visibilitychange",b),window.clearTimeout(y),f.abort()}i==null||i.addEventListener("abort",()=>{k(),g()});const _=u??window.fetch,x=n??GI;async function A(){var z;f=new AbortController;try{const S=await _(e,Object.assign(Object.assign({},h),{headers:v,signal:f.signal}));await x(S),await HI(S.body,VI(qI(M=>{M?v[B0]=M:delete v[B0]},M=>{w=M},r))),s==null||s(),k(),g()}catch(S){if(!f.signal.aborted)try{const M=(z=l==null?void 0:l(S))!==null&&z!==void 0?z:w;window.clearTimeout(y),y=window.setTimeout(A,M)}catch(M){k(),p(M)}}}A()})}function GI(e){const t=e.headers.get("content-type");if(!(t!=null&&t.startsWith(dp)))throw new Error(`Expected content-type to be ${dp}, Actual: ${t}`)}const Od=26;function Rd({idx:e,activeIdx:t,isActive:i,workspace:a,thread:n,onRemove:r,toggleMarkForDeletion:s,hasNext:l,ctrlPressed:d=!1}){const{slug:u,threadSlug:h=null}=fm(),g=(a==null?void 0:a.slug)??u,p=m.useRef(null),[v,f]=m.useState(!1),b=n.virtual?"/":n.slug?G.workspace.thread(g,n.slug):G.workspace.chat(g),{ref:w}=Vw({isActive:i,behavior:"instant",block:"center"});return o.jsxs("div",{className:"w-full relative flex h-[38px] items-center border-none rounded-lg",role:"listitem",children:[o.jsx("div",{style:{width:Od/2},className:`${i?"border-l-2 border-b-2 border-white light:border-blue-800 z-[2]":"border-l border-b border-zinc-500 light:border-slate-400 z-[1]"} h-[50%] absolute top-0 left-3 rounded-bl-lg`}),l&&o.jsx("div",{style:{width:Od/2},className:`${e<=t&&!i?"border-l-2 border-white light:border-blue-800 z-[2]":"border-l border-zinc-500 light:border-slate-400 z-[1]"} h-[100%] absolute top-0 left-3`}),o.jsx("div",{style:{width:Od+8},className:"h-full"}),o.jsxs("div",{className:`flex w-full items-center justify-between pr-2 group/thread relative ${i?"bg-[var(--theme-sidebar-thread-selected)] light:bg-blue-200":"hover:bg-theme-sidebar-subitem-hover light:hover:bg-slate-300"} rounded-[4px]`,children:[n.deleted?o.jsxs("div",{className:"w-full flex justify-between",children:[o.jsx("div",{className:"w-full pl-2 py-1",children:o.jsx("p",{className:"text-left text-sm text-slate-400/50 light:text-slate-500 italic",children:"deleted thread"})}),d&&o.jsx("button",{type:"button",className:"border-none",onClick:()=>s(n.id),children:o.jsx(J1,{className:"text-zinc-300 hover:text-white light:text-theme-text-secondary hover:light:text-theme-text-primary",size:18})})]}):o.jsx(Vt,{ref:w,to:b,"data-tooltip-id":"workspace-thread-name","data-tooltip-content":n.name,className:"w-full pl-2 py-1 overflow-hidden","aria-current":i?"page":"",children:o.jsx("p",{className:`text-left text-sm truncate max-w-[150px] ${i?"font-semibold text-theme-text-primary light:text-blue-900":"text-theme-text-primary font-medium light:text-slate-800"}`,children:n.name})}),!!n.slug&&!n.deleted&&!n.virtual&&o.jsxs("div",{ref:p,className:"flex items-center",children:[" ",d?o.jsx("button",{type:"button",className:"border-none",onClick:()=>s(n.id),children:o.jsx(Sr,{className:"text-zinc-300 light:text-theme-text-secondary hover:text-white hover:light:text-theme-text-primary",weight:"bold",size:18})}):o.jsx("div",{className:"flex items-center w-fit md:invisible md:group-hover/thread:visible md:group-focus-within/thread:visible gap-x-1",children:o.jsx("button",{type:"button",className:"border-none",onClick:()=>f(!v),"aria-label":"Thread options",children:o.jsx(oy,{className:"text-slate-300 light:text-theme-text-secondary hover:text-white hover:light:text-theme-text-primary",size:25})})}),v&&o.jsx(KI,{containerRef:p,workspace:a,thread:n,onRemove:r,close:()=>f(!1),currentThreadSlug:h})]})]})]})}function KI({containerRef:e,workspace:t,thread:i,onRemove:a,close:n,currentThreadSlug:r}){const s=m.useRef(null),l=p=>{var v,f;return s.current&&!((v=s.current)!=null&&v.contains(p.target))&&!((f=e.current)!=null&&f.contains(p.target))&&n(),!1},d=p=>{(p.key==="Escape"||p.key==="Esc")&&n()};function u(){window.removeEventListener("click",l),window.removeEventListener("keyup",d)}m.useEffect(()=>{function p(){if(!(s!=null&&s.current)||!e.current)return!1;window.document.addEventListener("click",l),window.document.addEventListener("keyup",d)}return p(),u},[s.current,e.current]);const h=async()=>{var f;const p=(f=window.prompt("What would you like to rename this thread to?"))==null?void 0:f.trim();if(!p||p.length===0){n();return}const{message:v}=await Pn.threads.update(t.slug,i.slug,{name:p});if(v){Se(`Thread could not be updated! ${v}`,"error",{clear:!0}),n();return}i.name=p,n()},g=async()=>{if(!window.confirm("Are you sure you want to delete this thread? All of its chats will be deleted. You cannot undo this."))return;const p=await Pn.threads.delete(t.slug,i.slug);if(!p){Se("Thread could not be deleted!","error",{clear:!0});return}if(p){Se("Thread deleted successfully!","success",{clear:!0}),a(i.id),r===i.slug&&(window.location.href=G.workspace.chat(t.slug));return}};return o.jsxs("div",{ref:s,className:"absolute w-fit z-[20] top-[25px] right-[10px] bg-zinc-900 light:bg-theme-bg-sidebar light:border-[1px] light:border-theme-sidebar-border rounded-lg p-1",children:[o.jsxs("button",{onClick:h,type:"button",className:"w-full rounded-md flex items-center p-2 gap-x-2 hover:bg-slate-500/20 text-slate-300 light:text-theme-text-primary",children:[o.jsx(vy,{size:18}),o.jsx("p",{className:"text-sm",children:"Rename"})]}),o.jsxs("button",{onClick:g,type:"button",className:"w-full rounded-md flex items-center p-2 gap-x-2 hover:bg-red-500/20 text-slate-300 light:text-theme-text-primary hover:text-red-100",children:[o.jsx(zm,{size:18}),o.jsx("p",{className:"text-sm",children:"Delete Thread"})]})]})}const up="renameThread";function KD({workspace:e,isVirtualThread:t=!1}){const{threadSlug:i=null}=fm(),[a,n]=m.useState([]),[r,s]=m.useState(!0),[l,d]=m.useState(!1);m.useEffect(()=>{const f=b=>{const{threadSlug:w,newName:y}=b.detail;n(k=>k.map(_=>_.slug===w?{..._,name:y}:_))};return window.addEventListener(up,f),()=>{window.removeEventListener(up,f)}},[]),m.useEffect(()=>{async function f(){if(!e.slug)return;const{threads:b}=await Pn.threads.all(e.slug);s(!1),n(b)}f()},[e.slug]),m.useEffect(()=>{const f=w=>{["Control","Meta"].includes(w.key)&&d(!0)},b=w=>{["Control","Meta"].includes(w.key)&&(d(!1),n(y=>y.map(k=>({...k,deleted:!1}))))};return window.addEventListener("keydown",f),window.addEventListener("keyup",b),()=>{window.removeEventListener("keydown",f),window.removeEventListener("keyup",b)}},[]);const u=f=>{n(b=>b.map(w=>w.id!==f?w:{...w,deleted:!w.deleted}))},h=async()=>{const f=a.filter(b=>b.deleted===!0).map(b=>b.slug);await Pn.threads.deleteBulk(e.slug,f),n(b=>b.filter(w=>!w.deleted)),f.includes(i)&&(window.location.href=G.workspace.chat(e.slug))};function g(f){n(b=>b.map(w=>w.id!==f?w:{...w,deleted:!0})),setTimeout(()=>{n(b=>b.filter(w=>!w.deleted))},500)}function p(){if(t)return a.length+1;const f=a.findIndex(b=>(b==null?void 0:b.slug)===i);return f>=0?f+1:0}if(r)return o.jsx("div",{className:"flex flex-col bg-pulse w-full h-10 items-center justify-center",children:o.jsx("p",{className:"text-xs text-white animate-pulse",children:"loading threads...."})});const v=p();return o.jsxs("div",{className:"flex flex-col",role:"list","aria-label":"Threads",children:[o.jsx(Rd,{idx:0,activeIdx:v,isActive:v===0,workspace:e,thread:{slug:null,name:"default"},hasNext:a.length>0||t}),a.map((f,b)=>o.jsx(Rd,{idx:b+1,ctrlPressed:l,toggleMarkForDeletion:u,activeIdx:v,isActive:v===b+1,workspace:e,onRemove:g,thread:f,hasNext:b!==a.length-1||t},f.slug)),t&&o.jsx(Rd,{idx:v,activeIdx:v,isActive:!0,workspace:e,thread:{slug:null,name:"*New Thread",virtual:!0},hasNext:!1}),o.jsx($I,{ctrlPressed:l,threads:a,onDelete:h}),o.jsx(WI,{workspace:e})]})}function WI({workspace:e}){const[t,i]=m.useState(!1),a=async()=>{i(!0);const{thread:n,error:r}=await Pn.threads.new(e.slug);if(r){Se(`Could not create thread - ${r}`,"error",{clear:!0}),i(!1);return}window.location.replace(G.workspace.thread(e.slug,n.slug))};return o.jsx("button",{onClick:a,className:"w-full relative flex h-[40px] items-center border-none hover:bg-[var(--theme-sidebar-thread-selected)] light:hover:bg-slate-300 hover:light:bg-theme-sidebar-subitem-hover rounded-lg",children:o.jsxs("div",{className:"flex w-full gap-x-2 items-center pl-4",children:[o.jsx("div",{className:"bg-zinc-800 light:bg-slate-50 p-2 rounded-lg h-[24px] w-[24px] flex items-center justify-center",children:t?o.jsx(Xa,{weight:"bold",size:14,className:"shrink-0 animate-spin text-white light:text-theme-text-primary"}):o.jsx(xm,{weight:"bold",size:14,className:"shrink-0 text-white light:text-theme-text-primary"})}),t?o.jsx("p",{className:"text-left text-white light:text-theme-text-primary text-sm",children:"Starting Thread..."}):o.jsx("p",{className:"text-left text-white light:text-theme-text-primary text-sm font-semibold",children:"New Thread"})]})})}function $I({ctrlPressed:e,threads:t,onDelete:i}){return!e||t.filter(a=>a.deleted).length===0?null:o.jsx("button",{type:"button",onClick:i,className:"w-full relative flex h-[40px] items-center border-none hover:bg-red-400/20 rounded-lg group",children:o.jsxs("div",{className:"flex w-full gap-x-2 items-center pl-4",children:[o.jsx("div",{className:"bg-transparent p-2 rounded-lg h-[24px] w-[24px] flex items-center justify-center",children:o.jsx(zm,{weight:"bold",size:14,className:"shrink-0 text-white light:text-red-500/50 group-hover:text-red-400"})}),o.jsx("p",{className:"text-white light:text-theme-text-secondary text-left text-sm group-hover:text-red-400",children:"Delete Selected"})]})})}const Ei={defaultSettings:{showScrollbar:!1,autoSubmitSttInput:!0,autoPlayAssistantTtsResponse:!1,enableSpellCheck:!0,renderHTML:!1},getSettings:()=>{const e=localStorage.getItem(Kg);return Et(e,Ei.defaultSettings)},get:e=>{const t=Ei.getSettings();return t.hasOwnProperty(e)?t[e]:Ei.defaultSettings[e]},set:(e,t)=>{const i=Ei.getSettings();return i[e]=t,Ei.updateSettings(i),i},updateSettings:e=>{const t={...Ei.getSettings(),...e};return localStorage.setItem(Kg,JSON.stringify(t)),t}},pp="ASSISTANT_MESSAGE_COMPLETE_EVENT",G2=m.createContext();function WD({children:e}){const[t,i]=m.useState({}),[a,n]=m.useState("native"),[r,s]=m.useState(!0);return m.useEffect(()=>{async function l(){const d=await K.keys();n((d==null?void 0:d.TextToSpeechProvider)??"native"),i(d),s(!1)}l()},[]),o.jsx(G2.Provider,{value:{settings:t,provider:a,loading:r},children:e})}function $D(){const e=m.useContext(G2);if(!e)throw new Error("useTTSProvider must be used within a TTSProvider");return e}function G0(e){window.dispatchEvent(new CustomEvent(pp,{detail:{chatId:e}}))}function ZD(){const e=Ei.get("autoPlayAssistantTtsResponse");function t(i){let a=0;const{chatId:n}=i.detail;function r(){const s=document.querySelector(`[data-auto-play-chat-id="${n}"]`);return s?(s.click(),!0):(a++,a>3||setTimeout(()=>{r()},1e3*a),!1)}setTimeout(()=>{r()},800)}m.useEffect(()=>{if(e)return window.addEventListener(pp,t),()=>{window.removeEventListener(pp,t)};console.log("Assistant TTS auto-play is disabled")},[e])}const K2="abort-chat-stream";function JD(e,t,i,a,n,r){var y;const{uuid:s,textResponse:l,type:d,sources:u=[],error:h,close:g,animate:p=!1,chatId:v=null,action:f=null,metrics:b={},routedTo:w=null}=e;if(d==="modelRouteNotification"){n.push({type:"modelRouteNotification",uuid:s,routedTo:w,role:"assistant"}),i([...n]);return}if(d==="abort"||d==="statusResponse")t(!1),i([...a,{type:d,uuid:s,content:l,role:"assistant",sources:u,closed:!0,error:h,animate:p,pending:!1,metrics:b}]),n.push({type:d,uuid:s,content:l,role:"assistant",sources:u,closed:!0,error:h,animate:p,pending:!1,metrics:b});else if(d==="textResponse")t(!1),i([...a,{uuid:s,content:l,role:"assistant",sources:u,closed:g,error:h,animate:!g,pending:!1,chatId:v,metrics:b}]),n.push({uuid:s,content:l,role:"assistant",sources:u,closed:g,error:h,animate:!g,pending:!1,chatId:v,metrics:b}),G0(v);else if(d==="textResponseChunk"||d==="finalizeResponseStream"){const k=n.findIndex(_=>_.uuid===s);if(k!==-1){const _={...n[k]};let x;d==="finalizeResponseStream"?(x={..._,closed:g,animate:!g,pending:!1,chatId:v,metrics:b},n[k-1]={...n[k-1],chatId:v},G0(v),t(!1)):x={..._,content:_.content+l,...u&&u.length>0?{sources:u}:{},error:h,closed:g,animate:!g,pending:!1,chatId:v,metrics:b},n[k]=x}else n.push({uuid:s,sources:u,error:h,content:l,role:"assistant",closed:g,animate:!g,pending:!1,chatId:v,metrics:b});i([...n])}else if(d==="agentInitWebsocketConnection")r(e.websocketUUID);else if(d==="stopGeneration"){const k=n.length-1,x={...{...n[k]},sources:[],closed:!0,error:null,animate:!1,pending:!1,metrics:b};n[k]=x,i([...n]),t(!1)}f==="reset_chat"&&i([]),f==="rename_thread"&&(y=e==null?void 0:e.thread)!=null&&y.slug&&e.thread.name&&window.dispatchEvent(new CustomEvent(up,{detail:{threadSlug:e.thread.slug,newName:e.thread.name}}))}function QD(e){return(e==null?void 0:e.openAiPrompt)??"You are Totem LLM. You are an AI that prioritizes consistent behavior with your history. The current date and time is {datetime}."}function YD(e){return(e==null?void 0:e.queryRefusalResponse)??"There is no relevant information in this workspace to answer your query."}let Hs;const ZI=new Uint8Array(16);function JI(){if(!Hs&&(Hs=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Hs))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Hs(ZI)}const _t=[];for(let e=0;e<256;++e)_t.push((e+256).toString(16).slice(1));function QI(e,t=0){return _t[e[t+0]]+_t[e[t+1]]+_t[e[t+2]]+_t[e[t+3]]+"-"+_t[e[t+4]]+_t[e[t+5]]+"-"+_t[e[t+6]]+_t[e[t+7]]+"-"+_t[e[t+8]]+_t[e[t+9]]+"-"+_t[e[t+10]]+_t[e[t+11]]+_t[e[t+12]]+_t[e[t+13]]+_t[e[t+14]]+_t[e[t+15]]}const YI=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),K0={randomUUID:YI};function Oa(e,t,i){if(K0.randomUUID&&!t&&!e)return K0.randomUUID();e=e||{};const a=e.random||(e.rng||JI)();if(a[6]=a[6]&15|64,a[8]=a[8]&63|128,t){i=i||0;for(let n=0;n<16;++n)t[i+n]=a[n];return t}return QI(a)}const XI={all:async function(e){const{threads:t}=await fetch(`${E}/workspace/${e}/threads`,{method:"GET",headers:N()}).then(i=>i.json()).catch(()=>({threads:[]}));return{threads:t}},new:async function(e){const{thread:t,error:i}=await fetch(`${E}/workspace/${e}/thread/new`,{method:"POST",headers:N()}).then(a=>a.json()).catch(a=>({thread:null,error:a.message}));return{thread:t,error:i}},update:async function(e,t,i={}){const{thread:a,message:n}=await fetch(`${E}/workspace/${e}/thread/${t}/update`,{method:"POST",body:JSON.stringify(i),headers:N()}).then(r=>r.json()).catch(r=>({thread:null,message:r.message}));return{thread:a,message:n}},delete:async function(e,t){return await fetch(`${E}/workspace/${e}/thread/${t}`,{method:"DELETE",headers:N()}).then(i=>i.ok).catch(()=>!1)},deleteBulk:async function(e,t=[]){return await fetch(`${E}/workspace/${e}/thread-bulk-delete`,{method:"DELETE",body:JSON.stringify({slugs:t}),headers:N()}).then(i=>i.ok).catch(()=>!1)},chatHistory:async function(e,t){return await fetch(`${E}/workspace/${e}/thread/${t}/chats`,{method:"GET",headers:N()}).then(a=>a.json()).then(a=>a.history||[]).catch(()=>[])},streamChat:async function({workspaceSlug:e,threadSlug:t},i,a,n=[]){const r=new AbortController;window.addEventListener(K2,()=>{r.abort(),a({id:Oa(),type:"stopGeneration"})}),await B2(`${E}/workspace/${e}/thread/${t}/stream-chat`,{method:"POST",body:JSON.stringify({message:i,attachments:n}),headers:N(),signal:r.signal,openWhenHidden:!0,async onopen(s){if(!s.ok)throw s.status>=400&&s.status<500&&s.status!==429?(a({id:Oa(),type:"abort",textResponse:null,sources:[],close:!0,error:`An error occurred while streaming response. Code ${s.status}`}),r.abort(),new Error("Invalid Status code response.")):(a({id:Oa(),type:"abort",textResponse:null,sources:[],close:!0,error:"An error occurred while streaming response. Unknown Error."}),r.abort(),new Error("Unknown error"))},async onmessage(s){const l=Et(s.data,null);l&&a(l)},onerror(s){throw a({id:Oa(),type:"abort",textResponse:null,sources:[],close:!0,error:`An error occurred while streaming response. ${s.message}`}),r.abort(),new Error}})},_deleteEditedChats:async function(e="",t="",i){return await fetch(`${E}/workspace/${e}/thread/${t}/delete-edited-chats`,{method:"DELETE",headers:N(),body:JSON.stringify({startingId:i})}).then(a=>{if(a.ok)return!0;throw new Error("Failed to delete chats.")}).catch(a=>(console.log(a),!1))},_updateChat:async function(e="",t="",i,a,n="assistant"){return await fetch(`${E}/workspace/${e}/thread/${t}/update-chat`,{method:"POST",headers:N(),body:JSON.stringify({chatId:i,newText:a,role:n})}).then(r=>{if(r.ok)return!0;throw new Error("Failed to update chat.")}).catch(r=>(console.log(r),!1))}},Pn={workspaceOrderStorageKey:"anythingllm-workspace-order",maxContextWindowLimit:.8,new:async function(e={}){const{workspace:t,message:i}=await fetch(`${E}/workspace/new`,{method:"POST",body:JSON.stringify(e),headers:N()}).then(a=>a.json()).catch(a=>({workspace:null,message:a.message}));return{workspace:t,message:i}},update:async function(e,t={}){const{workspace:i,message:a}=await fetch(`${E}/workspace/${e}/update`,{method:"POST",body:JSON.stringify(t),headers:N()}).then(n=>n.json()).catch(n=>({workspace:null,message:n.message}));return{workspace:i,message:a}},modifyEmbeddings:async function(e,t={}){const{workspace:i,message:a}=await fetch(`${E}/workspace/${e}/update-embeddings`,{method:"POST",body:JSON.stringify(t),headers:N()}).then(n=>n.json()).catch(n=>({workspace:null,message:n.message}));return{workspace:i,message:a}},removeQueuedEmbedding:async function(e,t){return fetch(`${E}/workspace/${e}/embed-queue`,{method:"DELETE",body:JSON.stringify({filename:t}),headers:N()}).then(i=>i.json()).catch(()=>({success:!1}))},chatHistory:async function(e){return await fetch(`${E}/workspace/${e}/chats`,{method:"GET",headers:N()}).then(i=>i.json()).then(i=>i.history||[]).catch(()=>[])},updateChatFeedback:async function(e,t,i){return await fetch(`${E}/workspace/${t}/chat-feedback/${e}`,{method:"POST",headers:N(),body:JSON.stringify({feedback:i})}).then(n=>n.ok).catch(()=>!1)},deleteChats:async function(e="",t=[]){return await fetch(`${E}/workspace/${e}/delete-chats`,{method:"DELETE",headers:N(),body:JSON.stringify({chatIds:t})}).then(i=>{if(i.ok)return!0;throw new Error("Failed to delete chats.")}).catch(i=>(console.log(i),!1))},deleteEditedChats:async function(e="",t="",i){return t?this.threads._deleteEditedChats(e,t,i):this._deleteEditedChats(e,i)},updateChat:async function(e="",t="",i,a,n="assistant"){return t?this.threads._updateChat(e,t,i,a,n):this._updateChat(e,i,a,n)},multiplexStream:async function({workspaceSlug:e,threadSlug:t=null,prompt:i,chatHandler:a,attachments:n=[]}){return t?this.threads.streamChat({workspaceSlug:e,threadSlug:t},i,a,n):this.streamChat({slug:e},i,a,n)},streamChat:async function({slug:e},t,i,a=[]){const n=new AbortController;window.addEventListener(K2,()=>{n.abort(),i({id:Oa(),type:"stopGeneration"})}),await B2(`${E}/workspace/${e}/stream-chat`,{method:"POST",body:JSON.stringify({message:t,attachments:a}),headers:N(),signal:n.signal,openWhenHidden:!0,async onopen(r){if(!r.ok)throw r.status>=400&&r.status<500&&r.status!==429?(i({id:Oa(),type:"abort",textResponse:null,sources:[],close:!0,error:`An error occurred while streaming response. Code ${r.status}`}),n.abort(),new Error("Invalid Status code response.")):(i({id:Oa(),type:"abort",textResponse:null,sources:[],close:!0,error:"An error occurred while streaming response. Unknown Error."}),n.abort(),new Error("Unknown error"))},async onmessage(r){const s=Et(r.data,null);s&&i(s)},onerror(r){throw i({id:Oa(),type:"abort",textResponse:null,sources:[],close:!0,error:`An error occurred while streaming response. ${r.message}`}),n.abort(),new Error}})},all:async function(){return await fetch(`${E}/workspaces`,{method:"GET",headers:N()}).then(t=>t.json()).then(t=>t.workspaces||[]).catch(()=>[])},bySlug:async function(e=""){return await fetch(`${E}/workspace/${e}`,{headers:N()}).then(i=>i.json()).then(i=>i.workspace).catch(()=>null)},delete:async function(e){return await fetch(`${E}/workspace/${e}`,{method:"DELETE",headers:N()}).then(i=>i.ok).catch(()=>!1)},wipeVectorDb:async function(e){return await fetch(`${E}/workspace/${e}/reset-vector-db`,{method:"DELETE",headers:N()}).then(t=>t.ok).catch(()=>!1)},uploadFile:async function(e,t){const i=await fetch(`${E}/workspace/${e}/upload`,{method:"POST",body:t,headers:N()}),a=await i.json();return{response:i,data:a}},parseFile:async function(e,t){const i=await fetch(`${E}/workspace/${e}/parse`,{method:"POST",body:t,headers:N()}),a=await i.json();return{response:i,data:a}},getParsedFiles:async function(e,t=null){const i=new URL(`${Xs()}/workspace/${e}/parsed-files`);return t&&i.searchParams.set("threadSlug",t),await(await fetch(i,{method:"GET",headers:N()})).json()},uploadLink:async function(e,t){const i=await fetch(`${E}/workspace/${e}/upload-link`,{method:"POST",body:JSON.stringify({link:t}),headers:N()}),a=await i.json();return{response:i,data:a}},getSuggestedMessages:async function(e){return await fetch(`${E}/workspace/${e}/suggested-messages`,{method:"GET",cache:"no-cache",headers:N()}).then(t=>{if(!t.ok)throw new Error("Could not fetch suggested messages.");return t.json()}).then(t=>t.suggestedMessages).catch(t=>(console.error(t),null))},setSuggestedMessages:async function(e,t){return fetch(`${E}/workspace/${e}/suggested-messages`,{method:"POST",headers:N(),body:JSON.stringify({messages:t})}).then(i=>{if(!i.ok)throw new Error(i.statusText||"Error setting suggested messages.");return{success:!0,...i.json()}}).catch(i=>(console.error(i),{success:!1,error:i.message}))},setPinForDocument:async function(e,t,i){return fetch(`${E}/workspace/${e}/update-pin`,{method:"POST",headers:N(),body:JSON.stringify({docPath:t,pinStatus:i})}).then(a=>{if(!a.ok)throw new Error(a.statusText||"Error setting pin status for document.");return!0}).catch(a=>(console.error(a),!1))},ttsMessage:async function(e,t){return await fetch(`${E}/workspace/${e}/tts/${t}`,{method:"GET",cache:"no-cache",headers:N()}).then(i=>{if(i.ok&&i.status!==204)return i.blob();throw new Error("Failed to fetch TTS.")}).then(i=>i?URL.createObjectURL(i):null).catch(()=>null)},uploadPfp:async function(e,t){return await fetch(`${E}/workspace/${t}/upload-pfp`,{method:"POST",body:e,headers:N()}).then(i=>{if(!i.ok)throw new Error("Error uploading pfp.");return{success:!0,error:null}}).catch(i=>(console.log(i),{success:!1,error:i.message}))},fetchPfp:async function(e){return await fetch(`${E}/workspace/${e}/pfp`,{method:"GET",cache:"no-cache",headers:N()}).then(t=>{if(t.ok&&t.status!==204)return t.blob();throw new Error("Failed to fetch pfp.")}).then(t=>t?URL.createObjectURL(t):null).catch(()=>null)},removePfp:async function(e){return await fetch(`${E}/workspace/${e}/remove-pfp`,{method:"DELETE",headers:N()}).then(t=>{if(t.ok)return{success:!0,error:null};throw new Error("Failed to remove pfp.")}).catch(t=>(console.log(t),{success:!1,error:t.message}))},_updateChat:async function(e="",t,i,a="assistant"){return await fetch(`${E}/workspace/${e}/update-chat`,{method:"POST",headers:N(),body:JSON.stringify({chatId:t,newText:i,role:a})}).then(n=>{if(n.ok)return!0;throw new Error("Failed to update chat.")}).catch(n=>(console.log(n),!1))},_deleteEditedChats:async function(e="",t){return await fetch(`${E}/workspace/${e}/delete-edited-chats`,{method:"DELETE",headers:N(),body:JSON.stringify({startingId:t})}).then(i=>{if(i.ok)return!0;throw new Error("Failed to delete chats.")}).catch(i=>(console.log(i),!1))},deleteChat:async e=>await fetch(`${E}/workspace/workspace-chats/${e}`,{method:"PUT",headers:N()}).then(t=>t.json()).catch(t=>(console.error(t),{success:!1,error:t.message})),forkThread:async function(e="",t=null,i=null){return await fetch(`${E}/workspace/${e}/thread/fork`,{method:"POST",headers:N(),body:JSON.stringify({threadSlug:t,chatId:i})}).then(a=>{if(!a.ok)throw new Error("Failed to fork thread.");return a.json()}).then(a=>a.newThreadSlug).catch(a=>(console.error("Error forking thread:",a),null))},uploadAndEmbedFile:async function(e,t){const i=await fetch(`${E}/workspace/${e}/upload-and-embed`,{method:"POST",body:t,headers:N()}),a=await i.json();return{response:i,data:a}},deleteParsedFiles:async function(e,t=[]){return(await fetch(`${E}/workspace/${e}/delete-parsed-files`,{method:"DELETE",headers:N(),body:JSON.stringify({fileIds:t})})).ok},embedParsedFile:async function(e,t){const i=await fetch(`${E}/workspace/${e}/embed-parsed-file/${t}`,{method:"POST",headers:N()}),a=await i.json();return{response:i,data:a}},deleteAndUnembedFile:async function(e,t){return(await fetch(`${E}/workspace/${e}/remove-and-unembed`,{method:"DELETE",body:JSON.stringify({documentLocation:t}),headers:N()})).ok},storeWorkspaceOrder:function(e=[]){try{return localStorage.setItem(this.workspaceOrderStorageKey,JSON.stringify(e)),!0}catch(t){return console.error("Error reordering workspaces:",t),!1}},orderWorkspaces:function(e=[]){const t=Et(localStorage.getItem(this.workspaceOrderStorageKey))||[];if(t.length===0)return e;const i=Array.from(e);return i.sort((a,n)=>t.indexOf(a.id)-t.indexOf(n.id)),i},searchWorkspaceOrThread:async function(e){return await fetch(`${E}/workspace/search`,{method:"POST",headers:N(),body:JSON.stringify({searchTerm:e})}).then(i=>i.json()).catch(i=>(console.error(i),{workspaces:[],threads:[]}))},agentCommandAvailable:async function(e=null){return e?await fetch(`${E}/workspace/${e}/is-agent-command-available`,{headers:N()}).then(t=>t.json()).catch(t=>(console.error(t),{showAgentCommand:!0})):{showAgentCommand:!0}},threads:XI};function W2(){const[e,t]=m.useState(!1);return{isOpen:e,openModal:()=>t(!0),closeModal:()=>t(!1)}}const eN="toggle_llm_selector",XD="save_llm_selector",eO="provider_setup_requested",Fl="keyboard-shortcuts-help",$2=navigator.platform.toUpperCase().indexOf("MAC")>=0,mp={"⌘ + ,":{translationKey:"settings",action:()=>{window.location.href=G.settings.interface()}},"⌘ + H":{translationKey:"home",action:()=>{window.location.href=G.home()}},"⌘ + I":{translationKey:"workspaces",action:()=>{window.location.href=G.settings.workspaces()}},"⌘ + K":{translationKey:"apiKeys",action:()=>{window.location.href=G.settings.apiKeys()}},"⌘ + L":{translationKey:"llmPreferences",action:()=>{window.location.href=G.settings.llmPreference()}},"⌘ + Shift + C":{translationKey:"chatSettings",action:()=>{window.location.href=G.settings.chat()}},"⌘ + Shift + ?":{translationKey:"help",action:()=>{window.dispatchEvent(new CustomEvent(Fl,{detail:{show:!0}}))}},F1:{translationKey:"help",action:()=>{window.dispatchEvent(new CustomEvent(Fl,{detail:{show:!0}}))}},"⌘ + Shift + L":{translationKey:"showLLMSelector",action:()=>{window.dispatchEvent(new Event(eN))}}},Z2={},J2=$2?"meta":"ctrl";for(const e in mp){const t=e.replace("⌘",J2).replaceAll(" ","").toLowerCase();Z2[t]=mp[e].action}function tN(e){let t="";if((e.metaKey||e.ctrlKey)&&(t+=J2+"+"),e.shiftKey&&(t+="shift+"),e.altKey&&(t+="alt+"),e.key===",")t+=",";else if(e.key==="?"||e.key==="/")t+="?";else{if(e.key==="Control")return"";if(e.key==="Shift")return"";t+=e.key.toLowerCase()}return t}function iN(){function e(t){const i=tN(t);if(!i)return;const a=Z2[i];a&&(t.preventDefault(),a())}return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)}function aN(){m.useEffect(()=>{const e=dc();if(e&&(e==null?void 0:e.role)!=="admin")return;const t=iN();return()=>t()},[])}function es({children:e}){return aN(),e}function nN(){const[e,t]=m.useState(!1),{t:i}=Qe();return m.useEffect(()=>(window.addEventListener(Fl,()=>t(a=>!a)),()=>{window.removeEventListener(Fl,()=>t(!1))}),[]),e?o.jsx("div",{className:"fixed inset-0 z-50 overflow-auto bg-black bg-opacity-50 flex items-center justify-center",children:o.jsxs("div",{className:"relative bg-theme-bg-secondary rounded-lg p-6 max-w-2xl w-full mx-4",children:[o.jsxs("div",{className:"flex justify-between items-center mb-6",children:[o.jsx("h2",{className:"text-xl font-semibold text-white",children:i("keyboard-shortcuts.title")}),o.jsx("button",{onClick:()=>t(!1),className:"text-white hover:text-gray-300","aria-label":"Close",children:o.jsx(Sr,{size:24})})]}),o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:Object.entries(mp).map(([a,n])=>o.jsxs("div",{className:"flex items-center justify-between p-3 bg-theme-bg-hover rounded-lg",children:[o.jsx("span",{className:"text-white",children:i(`keyboard-shortcuts.shortcuts.${n.translationKey}`)}),o.jsx("kbd",{className:"px-2 py-1 bg-theme-bg-secondary text-white rounded border border-gray-600",children:$2?a:a.replace("⌘","Ctrl")})]},a))})]})}):null}const hp="open-image-lightbox";function tO(e,t=0){window.dispatchEvent(new CustomEvent(hp,{detail:{images:e,initialIndex:t}}))}function rN(){const[e,t]=m.useState(null),[i,a]=m.useState(0);m.useEffect(()=>{function u(h){t(h.detail.images),a(h.detail.initialIndex)}return window.addEventListener(hp,u),()=>window.removeEventListener(hp,u)},[]);function n(){t(null)}function r(){a(u=>u>0?u-1:e.length-1)}function s(){a(u=>u<e.length-1?u+1:0)}if(m.useEffect(()=>{if(!e)return;function u(h){h.key==="Escape"?n():h.key==="ArrowLeft"?r():h.key==="ArrowRight"&&s()}return window.addEventListener("keydown",u),()=>window.removeEventListener("keydown",u)},[e]),!e||e.length===0)return null;const l=Math.min(i,e.length-1),d=e[l];return d?os.createPortal(o.jsxs("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center bg-black/90",onClick:n,children:[o.jsx("button",{type:"button",onClick:n,className:"absolute top-4 right-4 p-2 text-white light:text-white hover:text-white/70 transition-colors rounded-full bg-white/10 hover:bg-white/20 border-none cursor-pointer","aria-label":"Close lightbox",children:o.jsx(Sr,{size:24,weight:"bold"})}),e.length>1&&o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",onClick:u=>{u.stopPropagation(),r()},className:"absolute left-4 p-3 text-white light:text-white hover:text-white/70 transition-colors rounded-full bg-white/10 hover:bg-white/20 border-none cursor-pointer","aria-label":"Previous image",children:o.jsx(X1,{size:24,weight:"bold"})}),o.jsx("button",{type:"button",onClick:u=>{u.stopPropagation(),s()},className:"absolute right-4 p-3 text-white light:text-white hover:text-white/70 transition-colors rounded-full bg-white/10 hover:bg-white/20 border-none cursor-pointer","aria-label":"Next image",children:o.jsx(gc,{size:24,weight:"bold"})})]}),o.jsx("img",{src:d.contentString,alt:d.name||"attachment",className:"max-w-[90vw] max-h-[90vh] object-contain",onClick:u=>u.stopPropagation()}),e.length>1&&o.jsxs("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 text-white/70 text-sm bg-black/50 px-3 py-1 rounded-full",children:[l+1," / ",e.length]})]}),document.getElementById("root")):null}const oN=m.createContext(null),Hd={didCatch:!1,error:null};class sN extends m.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Hd}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){const{error:t}=this.state;if(t!==null){for(var i,a,n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];(i=(a=this.props).onReset)===null||i===void 0||i.call(a,{args:r,reason:"imperative-api"}),this.setState(Hd)}}componentDidCatch(t,i){var a,n;(a=(n=this.props).onError)===null||a===void 0||a.call(n,t,i)}componentDidUpdate(t,i){const{didCatch:a}=this.state,{resetKeys:n}=this.props;if(a&&i.error!==null&&lN(t.resetKeys,n)){var r,s;(r=(s=this.props).onReset)===null||r===void 0||r.call(s,{next:n,prev:t.resetKeys,reason:"keys"}),this.setState(Hd)}}render(){const{children:t,fallbackRender:i,FallbackComponent:a,fallback:n}=this.props,{didCatch:r,error:s}=this.state;let l=t;if(r){const d={error:s,resetErrorBoundary:this.resetErrorBoundary};if(typeof i=="function")l=i(d);else if(a)l=m.createElement(a,d);else if(n!==void 0)l=n;else throw s}return m.createElement(oN.Provider,{value:{didCatch:r,error:s,resetErrorBoundary:this.resetErrorBoundary}},l)}}function lN(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return e.length!==t.length||e.some((i,a)=>!Object.is(i,t[a]))}function cN({error:e,resetErrorBoundary:t}){return m.useState(!1),o.jsxs("div",{className:"flex flex-col items-center justify-center min-h-screen bg-theme-bg-primary text-theme-text-primary gap-4 p-4 md:p-8 w-full",children:[o.jsx("h1",{className:"text-xl md:text-2xl font-bold text-center",children:"An error occurred."}),o.jsx("p",{className:"text-theme-text-secondary text-center px-4",children:e==null?void 0:e.message}),!1,o.jsxs("div",{className:"flex flex-col md:flex-row gap-3 md:gap-4 mt-4 w-full md:w-auto",children:[o.jsxs("button",{onClick:t,className:"flex items-center justify-center gap-2 px-4 py-2 bg-theme-bg-secondary text-theme-text-primary rounded-lg hover:bg-theme-sidebar-item-hover transition-all duration-300 w-full md:w-auto",children:[o.jsx(vm,{className:"w-4 h-4"}),"Reset"]}),o.jsxs(f6,{to:"/",className:"flex items-center justify-center gap-2 px-4 py-2 bg-theme-bg-secondary text-theme-text-primary rounded-lg hover:bg-theme-sidebar-item-hover transition-all duration-300 w-full md:w-auto",children:[o.jsx(_m,{className:"w-4 h-4"}),"Home"]})]})]})}function dN(){m.useEffect(()=>{if(typeof window>"u"||!("serviceWorker"in navigator))return;const e=t=>{const i=t==null?void 0:t.data;!i||(i==null?void 0:i.type)!=="BACKEND_OFFLINE"||Se("The backend appears to be offline. Please ensure the CLI/server is running in the terminal.","error",{clear:!0})};return navigator.serviceWorker.addEventListener("message",e),navigator.serviceWorker.register("/service-worker.js").catch(t=>{console.error("Failed to register backend offline service worker",t)}),()=>{navigator.serviceWorker.removeEventListener("message",e)}},[])}function uN(){const e=ta();return dN(),o.jsx(sN,{FallbackComponent:cN,onError:console.error,resetKeys:[e.pathname],children:o.jsx(xA,{children:o.jsx(AA,{children:o.jsx(m.Suspense,{fallback:o.jsx(_a,{}),children:o.jsx(nz,{children:o.jsx(yA,{children:o.jsx(bA,{children:o.jsxs(D6,{i18n:vt,children:[o.jsx($4,{}),o.jsx(Gu,{}),o.jsx(nN,{}),o.jsx(rN,{})]})})})})})})})})}async function W0(){return await fetch(`${E}/system/check-token`,{method:"GET",cache:"default",headers:N()}).then(t=>t.status===200).catch(()=>!1)}function pN(){const[e,t]=m.useState(null);return m.useEffect(()=>{if(!window)return;const i=!!window.localStorage.getItem(at),a=!!window.localStorage.getItem(Ke);let n=null;i&&a&&(n="multi"),!i&&a&&(n="single"),t(n)},[window]),e}function Q2(){const{pfp:e,setPfp:t}=m.useContext(G1);return{pfp:e,setPfp:t}}function mN(){const e=Object.keys(Wu),t=new Intl.DisplayNames(e,{type:"language"}),i=(a="en")=>{if(!Object.keys(Wu).includes(a))return!1;vt.changeLanguage(a)};return{currentLanguage:vt.language||"en",supportedLanguages:e,getLanguageName:(a="en")=>t.of(a),changeLanguage:i}}const $0={sm:"h-[12px] w-[20px] after:h-[8px] after:w-[8px] after:top-[2px] after:left-[2px] peer-checked:after:translate-x-full",md:"h-[16px] w-[28px] after:h-[12px] after:w-[12px] after:top-[2px] after:left-[2px] peer-checked:after:translate-x-full",lg:"h-[19px] w-[36px] after:h-[15px] after:w-[15px] after:top-[2px] after:left-[2px] peer-checked:after:translate-x-[17px]"},Z0={sm:{label:"text-[12px] leading-[10px] font-medium mt-[1.5px]",description:"text-[10px] leading-[16px] font-normal",gap:"gap-[2px]"},md:{label:"text-[14px] leading-[18px] font-medium -mt-[2px]",description:"text-[12px] leading-[16px] font-normal",gap:"gap-[2px]"},lg:{label:"text-[16px] leading-[14px] font-medium mt-[2.5px]",description:"text-[14px] leading-[24px] font-normal",gap:"gap-[2px]"}};function Ic({className:e,enabled:t,onChange:i,disabled:a=!1,size:n="sm",name:r,label:s,description:l,variant:d="default",hint:u,value:h}){const g=t!==void 0?{checked:t,onChange:v=>i==null?void 0:i(v.target.checked)}:{defaultChecked:!1},p=Z0[n]||Z0.sm;return d==="horizontal"?o.jsxs("label",{className:`flex items-start justify-between max-w-[700px] ${a?"cursor-not-allowed opacity-50":"cursor-pointer"} ${e??""}`,children:[o.jsx(Q0,{label:s,description:l,labelStyles:p,hint:u}),o.jsx("div",{className:"shrink-0 ml-4",children:o.jsx(J0,{name:r,disabled:a,size:n,inputProps:g,value:h})})]}):o.jsxs("label",{className:`inline-flex items-start ${a?"cursor-not-allowed opacity-50":"cursor-pointer"} ${e??""}`,children:[o.jsx(J0,{name:r,disabled:a,size:n,inputProps:g,value:h}),(s||l)&&o.jsx("div",{className:"ml-3",children:o.jsx(Q0,{label:s,description:l,labelStyles:p,hint:u})})]})}function J0({name:e,disabled:t,size:i,inputProps:a,value:n}){return o.jsxs(o.Fragment,{children:[o.jsx("input",{type:"checkbox",name:e,disabled:t,className:"peer sr-only",value:n,...a}),o.jsx("div",{className:`
|
|
1717
1717
|
relative shrink-0 peer pointer-events-none rounded-full
|
|
1718
1718
|
${$0[i]||$0.sm}
|
|
1719
1719
|
after:absolute after:rounded-full after:bg-white
|
|
@@ -1736,4 +1736,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1736
1736
|
`})})}const rh=2,oh=32,Y2="[a-z][a-z0-9._@-]*";function hN({user:e,hideModal:t}){const{pfp:i,setPfp:a}=Q2(),{t:n}=Qe(),r=async d=>{const u=d.target.files[0];if(!u)return!1;const h=new FormData;h.append("file",u);const{success:g,error:p}=await K.uploadPfp(h);if(!g){Se(n("profile_settings.failed_upload",{error:p}),"error");return}const v=await K.fetchPfp(e.id);a(v),Se(n("profile_settings.upload_success"),"success")},s=async()=>{const{success:d,error:u}=await K.removePfp();if(!d){Se(n("profile_settings.failed_remove",{error:u}),"error");return}a(null)},l=async d=>{d.preventDefault();const u={},h=new FormData(d.target);for(var[g,p]of h.entries())!p||p===null||(u[g]=p);const{success:v,error:f}=await K.updateUser(u);if(v){let b=Et(localStorage.getItem(at),null);b&&(b.username=u.username,b.bio=u.bio,localStorage.setItem(at,JSON.stringify(b))),Se(n("profile_settings.profile_updated"),"success",{clear:!0}),t()}else Se(n("profile_settings.failed_update_user",{error:f}),"error")};return o.jsx(Tc,{isOpen:!0,children:o.jsxs("div",{className:"w-full max-w-2xl bg-theme-bg-secondary rounded-lg shadow border-2 border-theme-modal-border overflow-hidden",children:[o.jsxs("div",{className:"relative p-6 border-b rounded-t border-theme-modal-border",children:[o.jsx("div",{className:"w-full flex gap-x-2 items-center",children:o.jsx("h3",{className:"text-xl font-semibold text-white overflow-hidden overflow-ellipsis whitespace-nowrap",children:n("profile_settings.edit_account")})}),o.jsx("button",{onClick:t,type:"button",className:"absolute top-4 right-4 transition-all duration-300 bg-transparent rounded-lg text-sm p-1 inline-flex items-center hover:bg-theme-modal-border hover:border-theme-modal-border hover:border-opacity-50 border-transparent border",children:o.jsx(Sr,{size:24,weight:"bold",className:"text-white"})})]}),o.jsx("div",{className:"h-full w-full overflow-y-auto",style:{maxHeight:"calc(100vh - 200px)"},children:o.jsxs("form",{onSubmit:l,className:"space-y-6",children:[o.jsx("div",{className:"flex flex-col md:flex-row items-center justify-center gap-8",children:o.jsxs("div",{className:"flex flex-col items-center",children:[o.jsxs("label",{className:"group w-48 h-48 flex flex-col items-center justify-center bg-theme-bg-primary hover:bg-theme-bg-secondary transition-colors duration-300 rounded-full mt-8 border-2 border-dashed border-white light:border-[#686C6F] light:bg-[#E0F2FE] light:hover:bg-transparent cursor-pointer hover:opacity-60",children:[o.jsx("input",{id:"logo-upload",type:"file",accept:"image/*",className:"hidden",onChange:r}),i?o.jsx("img",{src:i,alt:"User profile picture",className:"w-48 h-48 rounded-full object-cover bg-white"}):o.jsxs("div",{className:"flex flex-col items-center justify-center p-3",children:[o.jsx(xm,{className:"w-8 h-8 text-theme-text-secondary m-2"}),o.jsx("span",{className:"text-theme-text-secondary text-opacity-80 text-sm font-semibold",children:n("profile_settings.profile_picture")}),o.jsx("span",{className:"text-theme-text-secondary text-opacity-60 text-xs",children:"800 x 800"})]})]}),i&&o.jsx("button",{type:"button",onClick:s,className:"mt-3 text-theme-text-secondary text-opacity-60 text-sm font-medium hover:underline",children:n("profile_settings.remove_profile_picture")})]})}),o.jsxs("div",{className:"flex flex-col gap-y-4 px-6",children:[o.jsxs("div",{children:[o.jsx("label",{htmlFor:"username",className:"block mb-2 text-sm font-medium text-theme-text-primary",children:n("profile_settings.username")}),o.jsx("input",{name:"username",type:"text",className:"border-none bg-theme-settings-input-bg placeholder:text-theme-settings-input-placeholder border-gray-500 text-white text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:"User's username",minLength:rh,maxLength:oh,pattern:Y2,defaultValue:e.username,required:!0,autoComplete:"off"}),o.jsx("p",{className:"mt-2 text-xs text-white/60",children:n("common.username_requirements")})]}),o.jsxs("div",{children:[o.jsx("label",{htmlFor:"password",className:"block mb-2 text-sm font-medium text-white",children:n("profile_settings.new_password")}),o.jsx("input",{name:"password",type:"text",className:"border-none bg-theme-settings-input-bg placeholder:text-theme-settings-input-placeholder border-gray-500 text-white text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5",placeholder:`${e.username}'s new password`,minLength:8}),o.jsx("p",{className:"mt-2 text-xs text-white/60",children:n("profile_settings.password_description")})]}),o.jsxs("div",{children:[o.jsx("label",{htmlFor:"bio",className:"block mb-2 text-sm font-medium text-white",children:"Bio"}),o.jsx("textarea",{name:"bio",className:"border-none bg-theme-settings-input-bg placeholder:text-theme-settings-input-placeholder border-gray-500 text-white text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5 min-h-[100px] resize-y",placeholder:"Tell us about yourself...",defaultValue:e.bio})]}),o.jsxs("div",{className:"flex gap-x-16",children:[o.jsxs("div",{className:"flex flex-col gap-y-6",children:[o.jsx(fN,{}),o.jsx(gN,{})]}),o.jsxs("div",{className:"flex flex-col gap-y-6",children:[o.jsx(bN,{}),o.jsx(vN,{})]})]})]}),o.jsxs("div",{className:"flex justify-between items-center border-t border-theme-modal-border pt-4 p-6",children:[o.jsx("button",{onClick:t,type:"button",className:"transition-all duration-300 text-white hover:bg-zinc-700 px-4 py-2 rounded-lg text-sm",children:n("profile_settings.cancel")}),o.jsx("button",{type:"submit",className:"transition-all duration-300 bg-white text-black hover:opacity-60 px-4 py-2 rounded-lg text-sm",children:n("profile_settings.update_account")})]})]})})]})})}function gN(){const{currentLanguage:e,supportedLanguages:t,getLanguageName:i,changeLanguage:a}=mN(),{t:n}=Qe();return o.jsxs("div",{children:[o.jsx("label",{htmlFor:"userLang",className:"block mb-2 text-sm font-medium text-white",children:n("profile_settings.language")}),o.jsx("select",{name:"userLang",className:"border-none bg-theme-settings-input-bg w-fit mt-2 px-4 focus:outline-primary-button active:outline-primary-button outline-none text-white text-sm rounded-lg block py-2",defaultValue:e||"en",onChange:r=>a(r.target.value),children:t.map(r=>o.jsx("option",{value:r,children:i(r)},r))})]})}function fN(){const{theme:e,setTheme:t,availableThemes:i}=bm(),{t:a}=Qe();return o.jsxs("div",{children:[o.jsx("label",{htmlFor:"theme",className:"block mb-2 text-sm font-medium text-white",children:a("profile_settings.theme")}),o.jsx("select",{name:"theme",value:e,onChange:n=>t(n.target.value),className:"border-none bg-theme-settings-input-bg w-fit px-4 focus:outline-primary-button active:outline-primary-button outline-none text-white text-sm rounded-lg block py-2",children:Object.entries(i).map(([n,r])=>o.jsx("option",{value:n,children:r},n))})]})}function bN(){const[e,t]=m.useState(!0),{t:i}=Qe();m.useEffect(()=>{const n=Ei.getSettings();t(n.autoSubmitSttInput??!0)},[]);const a=n=>{t(n),Ei.updateSettings({autoSubmitSttInput:n})};return o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center gap-x-1 mb-2",children:[o.jsx("label",{htmlFor:"autoSubmit",className:"block text-sm font-medium text-white",children:i("customization.chat.auto_submit.title")}),o.jsx("div",{"data-tooltip-id":"auto-submit-info","data-tooltip-content":i("customization.chat.auto_submit.description"),className:"cursor-pointer h-fit",children:o.jsx(nt,{size:16,weight:"bold",className:"text-white"})})]}),o.jsx(Ic,{size:"lg",enabled:e,onChange:a}),o.jsx(lt,{id:"auto-submit-info",place:"bottom",delayShow:300,className:"allm-tooltip !allm-text-xs"})]})}function vN(){const[e,t]=m.useState(!1),{t:i}=Qe();m.useEffect(()=>{const n=Ei.getSettings();t(n.autoPlayAssistantTtsResponse??!1)},[]);const a=n=>{t(n),Ei.updateSettings({autoPlayAssistantTtsResponse:n})};return o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center gap-x-1 mb-2",children:[o.jsx("label",{htmlFor:"autoSpeak",className:"block text-sm font-medium text-white",children:i("customization.chat.auto_speak.title")}),o.jsx("div",{"data-tooltip-id":"auto-speak-info","data-tooltip-content":i("customization.chat.auto_speak.description"),className:"cursor-pointer h-fit",children:o.jsx(nt,{size:16,weight:"bold",className:"text-white"})})]}),o.jsx(Ic,{size:"lg",enabled:e,onChange:a}),o.jsx(lt,{id:"auto-speak-info",place:"bottom",delayShow:300,className:"allm-tooltip !allm-text-xs"})]})}function kN(){const{t:e}=Qe(),t=pN(),{user:i}=hc(),a=m.useRef(),n=m.useRef(),[r,s]=m.useState(!1),[l,d]=m.useState(!1),[u,h]=m.useState(""),g=v=>{a.current&&!a.current.contains(v.target)&&!n.current.contains(v.target)&&s(!1)},p=()=>{d(!0),s(!1)};return m.useEffect(()=>(r&&document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)),[r]),m.useEffect(()=>{(async()=>{const f=await K.fetchSupportEmail();h(f!=null&&f.email?`mailto:${f.email}`:G.mailToMintplex())})()},[]),t===null?null:o.jsxs("div",{className:"absolute top-3 right-4 md:top-9 md:right-10 w-fit h-fit z-40",children:[o.jsx("button",{ref:n,onClick:()=>s(!r),type:"button",className:"uppercase transition-all duration-300 w-[35px] h-[35px] text-base font-semibold rounded-full flex items-center bg-theme-action-menu-bg hover:bg-theme-action-menu-item-hover justify-center text-white p-2 hover:border-slate-100 hover:border-opacity-50 border-transparent border",children:t==="multi"?o.jsx(yN,{}):o.jsx(yy,{size:14})}),r&&o.jsx("div",{ref:a,className:"w-fit rounded-lg absolute top-12 right-0 bg-theme-action-menu-bg p-2 flex items-center-justify-center",children:o.jsxs("div",{className:"flex flex-col gap-y-2",children:[t==="multi"&&!!i&&o.jsx("button",{onClick:p,className:"border-none text-white hover:bg-theme-action-menu-item-hover w-full text-left px-4 py-1.5 rounded-md",children:e("profile_settings.account")}),o.jsx("a",{href:u,className:"text-white hover:bg-theme-action-menu-item-hover w-full text-left px-4 py-1.5 rounded-md",children:e("profile_settings.support")}),o.jsx("button",{onClick:()=>{window.localStorage.removeItem(at),window.localStorage.removeItem(Ke),window.localStorage.removeItem(Jt),window.localStorage.removeItem(O6),window.localStorage.removeItem(Bu),window.location.replace(G.home())},type:"button",className:"text-white hover:bg-theme-action-menu-item-hover w-full text-left px-4 py-1.5 rounded-md",children:e("profile_settings.signout")})]})}),i&&l&&o.jsx(hN,{user:i,hideModal:()=>d(!1)})]})}function yN(){var i;const{pfp:e}=Q2(),t=dc();return e?o.jsx("div",{className:"w-[35px] h-[35px] rounded-full flex-shrink-0 overflow-hidden transition-all duration-300 bg-gray-100 hover:border-slate-100 hover:border-opacity-50 border-transparent border hover:opacity-60",children:o.jsx("img",{src:e,alt:"User profile picture",className:"w-full h-full object-cover"})}):((i=t==null?void 0:t.username)==null?void 0:i.slice(0,2))||"AA"}function sh({children:e}){return o.jsxs("div",{className:"w-auto h-auto",children:[o.jsx(kN,{}),e]})}function Nc(){const[e,t]=m.useState(null),[i,a]=m.useState(!1),[n,r]=m.useState(!1);return m.useEffect(()=>{(async()=>{const l=await K.isOnboardingComplete(),{MultiUserMode:d,RequiresAuth:u}=await K.keys();if(r(d),l===!1){a(!0),t(!0);return}if(!d&&!u){t(!0);return}if(!d&&u){if(!localStorage.getItem(Ke)){t(!1);return}const f=await W0();t(f);return}const h=localStorage.getItem(at),g=localStorage.getItem(Ke);if(!h||!g){t(!1);return}if(!await W0()){localStorage.removeItem(at),localStorage.removeItem(Ke),localStorage.removeItem(Jt),t(!1);return}t(!0)})()},[]),{isAuthd:e,shouldRedirectToOnboarding:i,multiUserMode:n}}function tt({Component:e,hideUserMenu:t=!1}){const{isAuthd:i,shouldRedirectToOnboarding:a,multiUserMode:n}=Nc();if(i===null)return o.jsx(_a,{});if(a)return o.jsx(Qi,{to:G.onboarding.home()});const r=dc();return i&&((r==null?void 0:r.role)==="admin"||!n)?t?o.jsx(es,{children:o.jsx(e,{})}):o.jsx(es,{children:o.jsx(sh,{children:o.jsx(e,{})})}):o.jsx(Qi,{to:G.home()})}function Li({Component:e}){const{isAuthd:t,shouldRedirectToOnboarding:i,multiUserMode:a}=Nc();if(t===null)return o.jsx(_a,{});if(i)return o.jsx(Qi,{to:G.onboarding.home()});const n=dc();return t&&((n==null?void 0:n.role)!=="default"||!a)?o.jsx(es,{children:o.jsx(sh,{children:o.jsx(e,{})})}):o.jsx(Qi,{to:G.home()})}function Vd({Component:e}){const{isAuthd:t,shouldRedirectToOnboarding:i,multiUserMode:a}=Nc();return t===null?o.jsx(_a,{}):i?o.jsx(Qi,{to:G.onboarding.home()}):t&&!a?o.jsx(es,{children:o.jsx(e,{})}):o.jsx(Qi,{to:G.home()})}function Y0({Component:e}){const{isAuthd:t,shouldRedirectToOnboarding:i}=Nc();return t===null?o.jsx(_a,{}):i?o.jsx(Qi,{to:"/onboarding"}):t?o.jsx(es,{children:o.jsx(sh,{children:o.jsx(e,{})})}):o.jsx(Qi,{to:G.login(!0)})}var X2={exports:{}};(function(e,t){(function(i,a){a()})(Ti,function(){function i(u,h){return typeof h>"u"?h={autoBom:!1}:typeof h!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),h={autoBom:!h}),h.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(u.type)?new Blob(["\uFEFF",u],{type:u.type}):u}function a(u,h,g){var p=new XMLHttpRequest;p.open("GET",u),p.responseType="blob",p.onload=function(){d(p.response,h,g)},p.onerror=function(){console.error("could not download file")},p.send()}function n(u){var h=new XMLHttpRequest;h.open("HEAD",u,!1);try{h.send()}catch{}return 200<=h.status&&299>=h.status}function r(u){try{u.dispatchEvent(new MouseEvent("click"))}catch{var h=document.createEvent("MouseEvents");h.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),u.dispatchEvent(h)}}var s=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof Ti=="object"&&Ti.global===Ti?Ti:void 0,l=s.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),d=s.saveAs||(typeof window!="object"||window!==s?function(){}:"download"in HTMLAnchorElement.prototype&&!l?function(u,h,g){var p=s.URL||s.webkitURL,v=document.createElement("a");h=h||u.name||"download",v.download=h,v.rel="noopener",typeof u=="string"?(v.href=u,v.origin===location.origin?r(v):n(v.href)?a(u,h,g):r(v,v.target="_blank")):(v.href=p.createObjectURL(u),setTimeout(function(){p.revokeObjectURL(v.href)},4e4),setTimeout(function(){r(v)},0))}:"msSaveOrOpenBlob"in navigator?function(u,h,g){if(h=h||u.name||"download",typeof u!="string")navigator.msSaveOrOpenBlob(i(u,g),h);else if(n(u))a(u,h,g);else{var p=document.createElement("a");p.href=u,p.target="_blank",setTimeout(function(){r(p)})}}:function(u,h,g,p){if(p=p||open("","_blank"),p&&(p.document.title=p.document.body.innerText="downloading..."),typeof u=="string")return a(u,h,g);var v=u.type==="application/octet-stream",f=/constructor/i.test(s.HTMLElement)||s.safari,b=/CriOS\/[\d]+/.test(navigator.userAgent);if((b||v&&f||l)&&typeof FileReader<"u"){var w=new FileReader;w.onloadend=function(){var _=w.result;_=b?_:_.replace(/^data:[^;]*;/,"data:attachment/file;"),p?p.location.href=_:location=_,p=null},w.readAsDataURL(u)}else{var y=s.URL||s.webkitURL,k=y.createObjectURL(u);p?p.location=k:location.href=k,p=null,setTimeout(function(){y.revokeObjectURL(k)},4e4)}});s.saveAs=d.saveAs=d,e.exports=d})})(X2);var lh=X2.exports;const wN=Cn(lh),aO=bp({__proto__:null,default:wN},[lh]);function e_({recoveryCodes:e,onDownloadComplete:t,onClose:i}){const[a,n]=m.useState(!1),r=()=>{const d=new Blob([e.join(`
|
|
1737
1737
|
`)],{type:"text/plain"});lh.saveAs(d,"recovery_codes.txt"),n(!0)},s=()=>{a&&(t(),i())},l=()=>{navigator.clipboard.writeText(e.join(`,
|
|
1738
1738
|
`)).then(()=>{Se("Recovery codes copied to clipboard","success",{clear:!0})})};return o.jsx(Tc,{isOpen:!0,children:o.jsxs("div",{className:"w-full max-w-2xl bg-theme-bg-secondary rounded-lg shadow border-2 border-theme-modal-border overflow-hidden",children:[o.jsx("div",{className:"relative p-6 border-b rounded-t border-theme-modal-border",children:o.jsxs("div",{className:"w-full flex gap-x-2 items-center",children:[o.jsx(hy,{size:24,className:"text-white",weight:"bold"}),o.jsx("h3",{className:"text-xl font-semibold text-white overflow-hidden overflow-ellipsis whitespace-nowrap",children:"Recovery Codes"})]})}),o.jsxs("div",{className:"h-full w-full overflow-y-auto",style:{maxHeight:"calc(100vh - 200px)"},children:[o.jsxs("div",{className:"py-7 px-9 space-y-2 flex-col",children:[o.jsxs("p",{className:"text-sm text-white flex flex-col",children:["In order to reset your password in the future, you will need these recovery codes. Download or copy your recovery codes to save them."," ",o.jsx("br",{}),o.jsx("b",{className:"mt-4",children:"These recovery codes are only shown once!"})]}),o.jsx("div",{className:`border-none bg-theme-settings-input-bg text-white hover:text-primary-button
|
|
1739
|
-
flex items-center justify-center rounded-md mt-6 cursor-pointer`,onClick:l,children:o.jsx("ul",{className:"space-y-2 md:p-6 p-4",children:e.map((d,u)=>o.jsx("li",{className:"md:text-sm text-xs",children:d},u))})})]}),o.jsx("div",{className:"flex w-full justify-end items-center p-6 space-x-2 border-t border-theme-modal-border rounded-b",children:o.jsx("button",{type:"button",className:"transition-all duration-300 bg-white text-black hover:opacity-60 px-4 py-2 rounded-lg text-sm flex items-center gap-x-2",onClick:a?s:r,children:a?"Close":o.jsxs(o.Fragment,{children:[o.jsx(ly,{weight:"bold",size:18}),o.jsx("p",{children:"Download"})]})})})]})]})})}function _N(){const{t:e}=Qe(),[t,i]=m.useState(!1),[a,n]=m.useState(null),[r,s]=m.useState([]),[l,d]=m.useState(!1),[u,h]=m.useState(null),[g,p]=m.useState(null),{isOpen:v,openModal:f,closeModal:b}=W2(),w=async k=>{n(null),i(!0),k.preventDefault();const _={},x=new FormData(k.target);for(var[A,z]of x.entries())_[A]=z;const{valid:S,token:M,message:T,recoveryCodes:D}=await K.requestToken(_);S&&M?(h(M),D?(s(D),f()):(window.localStorage.setItem(Ke,M),window.location=G.home())):(n(T),i(!1)),i(!1)},y=()=>{d(!0)};return m.useEffect(()=>{l&&u&&(window.localStorage.setItem(Ke,u),window.location=G.home())},[l,u]),m.useEffect(()=>{(async()=>{const{appName:_}=await K.fetchCustomAppName();p(_||""),i(!1)})()},[]),o.jsxs(o.Fragment,{children:[o.jsxs("form",{onSubmit:w,className:"flex flex-col justify-center items-center",children:[o.jsx("div",{className:"flex items-start justify-between pt-7 pb-9",children:o.jsxs("div",{className:"flex items-center flex-col gap-y-[18px] max-w-[300px]",children:[o.jsx("div",{className:"flex gap-x-1",children:o.jsx("h3",{className:"text-white light:text-slate-950 text-3xl leading-[28px] font-medium text-center white-space-nowrap block",children:e("login.multi-user.welcome")})}),o.jsx("p",{className:"text-zinc-400 light:text-zinc-600 text-sm text-center",children:e("login.sign-in",{appName:g||"AnythingLLM"})})]})}),o.jsx("div",{className:"w-full px-12",children:o.jsxs("div",{className:"w-full flex flex-col gap-y-3",children:[o.jsxs("div",{className:"w-full flex flex-col gap-y-2",children:[o.jsx("label",{className:"text-zinc-300 light:text-slate-800 text-sm",children:"Password"}),o.jsx("input",{name:"password",type:"password",className:"border-none bg-zinc-800 light:bg-slate-200 text-zinc-200 light:text-zinc-600 text-sm rounded-lg p-2.5 w-[300px] h-[34px] focus:outline-none focus:ring-1 focus:ring-sky-300",required:!0,autoComplete:"off"})]}),a&&o.jsxs("p",{className:"text-red-400 text-sm",children:["Error: ",a]})]})}),o.jsx("div",{className:"flex items-center px-12 mt-9 space-x-2 w-full flex-col gap-y-6",children:o.jsx("button",{disabled:t,type:"submit",className:"text-zinc-950 bg-white hover:bg-zinc-300 light:bg-sky-200 light:text-slate-950 light:hover:bg-sky-300 text-sm font-semibold rounded-lg border-primary-button h-[34px] w-full",children:e(t?"login.multi-user.validating":"login.multi-user.login")})})]}),o.jsx(Tc,{isOpen:v,noPortal:!0,children:o.jsx(e_,{recoveryCodes:r,onDownloadComplete:y,onClose:b})})]})}const xN=({onSubmit:e,setShowRecoveryForm:t})=>{const[i,a]=m.useState(""),[n,r]=m.useState(Array(2).fill("")),s=(d,u)=>{const h=[...n];h[d]=u,r(h)},l=d=>{d.preventDefault();const u=n.filter(h=>h.trim()!=="");e(i,u)};return o.jsxs("form",{onSubmit:l,className:"flex flex-col justify-center items-center",children:[o.jsx("div",{className:"flex items-start justify-between pt-7 pb-9",children:o.jsxs("div",{className:"flex items-center flex-col gap-y-[18px] max-w-[300px]",children:[o.jsx("div",{className:"flex gap-x-1",children:o.jsx("h3",{className:"text-white light:text-slate-950 text-3xl leading-[28px] font-medium text-center white-space-nowrap block",children:Un("login.password-reset.title")})}),o.jsx("p",{className:"text-zinc-400 light:text-zinc-600 text-sm text-center",children:Un("login.password-reset.description")})]})}),o.jsx("div",{className:"w-full px-12",children:o.jsxs("div",{className:"w-full flex flex-col gap-y-3",children:[o.jsxs("div",{className:"w-full flex flex-col gap-y-2",children:[o.jsx("label",{className:"text-zinc-300 light:text-slate-800 text-sm",children:Un("login.multi-user.placeholder-username")}),o.jsx("input",{name:"username",type:"text",className:"border-none bg-zinc-800 light:bg-slate-200 text-zinc-200 light:text-zinc-600 text-sm rounded-lg p-2.5 w-[300px] h-[34px] focus:outline-none focus:ring-1 focus:ring-sky-300",value:i,onChange:d=>a(d.target.value),required:!0,autoComplete:"off"})]}),o.jsxs("div",{className:"w-full flex flex-col gap-y-2",children:[o.jsx("label",{className:"text-zinc-300 light:text-slate-800 text-sm",children:Un("login.password-reset.recovery-codes")}),n.map((d,u)=>o.jsx("input",{type:"text",name:`recoveryCode${u+1}`,className:"border-none bg-zinc-800 light:bg-slate-200 text-zinc-200 light:text-zinc-600 text-sm rounded-lg p-2.5 w-[300px] h-[34px] focus:outline-none focus:ring-1 focus:ring-sky-300",value:d,onChange:h=>s(u,h.target.value),required:!0,autoComplete:"off"},u))]})]})}),o.jsxs("div",{className:"flex items-center px-12 mt-9 space-x-2 w-full flex-col gap-y-6",children:[o.jsx("button",{type:"submit",className:"text-zinc-950 bg-white hover:bg-zinc-300 light:bg-sky-200 light:text-slate-950 light:hover:bg-sky-300 text-sm font-semibold rounded-lg border-primary-button h-[34px] w-full",children:Un("login.password-reset.title")}),o.jsx("button",{type:"button",className:"text-zinc-200 light:text-zinc-600 hover:text-sky-300 light:hover:text-sky-600 hover:underline text-sm flex gap-x-1",onClick:()=>t(!1),children:Un("login.password-reset.back-to-login")})]})]})},zN=({onSubmit:e})=>{const[t,i]=m.useState(""),[a,n]=m.useState(""),r=s=>{s.preventDefault(),e(t,a)};return o.jsxs("form",{onSubmit:r,className:"flex flex-col justify-center items-center",children:[o.jsx("div",{className:"flex items-start justify-between pt-7 pb-9",children:o.jsxs("div",{className:"flex items-center flex-col gap-y-[18px] max-w-[300px]",children:[o.jsx("div",{className:"flex gap-x-1",children:o.jsx("h3",{className:"text-white light:text-slate-950 text-[38px] leading-[28px] font-medium text-center white-space-nowrap block",children:"Reset Password"})}),o.jsx("p",{className:"text-zinc-400 light:text-zinc-600 text-sm text-center",children:"Enter your new password."})]})}),o.jsx("div",{className:"w-full px-12",children:o.jsxs("div",{className:"w-full flex flex-col gap-y-3",children:[o.jsxs("div",{className:"w-full flex flex-col gap-y-2",children:[o.jsx("label",{className:"text-zinc-300 light:text-slate-800 text-sm",children:"New Password"}),o.jsx("input",{type:"password",name:"newPassword",className:"border-none bg-zinc-800 light:bg-slate-200 text-zinc-200 light:text-zinc-600 text-sm rounded-lg p-2.5 w-[300px] h-[34px] focus:outline-none focus:ring-1 focus:ring-sky-300",value:t,onChange:s=>i(s.target.value),required:!0})]}),o.jsxs("div",{className:"w-full flex flex-col gap-y-2",children:[o.jsx("label",{className:"text-zinc-300 light:text-slate-800 text-sm",children:"Confirm Password"}),o.jsx("input",{type:"password",name:"confirmPassword",className:"border-none bg-zinc-800 light:bg-slate-200 text-zinc-200 light:text-zinc-600 text-sm rounded-lg p-2.5 w-[300px] h-[34px] focus:outline-none focus:ring-1 focus:ring-sky-300",value:a,onChange:s=>n(s.target.value),required:!0})]})]})}),o.jsx("div",{className:"flex items-center px-12 mt-9 space-x-2 w-full flex-col gap-y-6",children:o.jsx("button",{type:"submit",className:"text-zinc-950 bg-white hover:bg-zinc-300 light:bg-sky-200 light:text-slate-950 light:hover:bg-sky-300 text-sm font-semibold rounded-lg border-primary-button h-[34px] w-full",children:"Reset Password"})})]})};function AN(){const{t:e}=Qe(),[t,i]=m.useState(!1),[a,n]=m.useState(null),[r,s]=m.useState([]),[l,d]=m.useState(!1),[u,h]=m.useState(null),[g,p]=m.useState(null),[v,f]=m.useState(!1),[b,w]=m.useState(!1),[y,k]=m.useState(null),{isOpen:_,openModal:x,closeModal:A}=W2(),z=async F=>{n(null),i(!0),F.preventDefault();const O={},Z=new FormData(F.target);for(var[R,ce]of Z.entries())O[R]=ce;const{valid:ae,user:Q,token:I,message:U,recoveryCodes:B}=await K.requestToken(O);ae&&I&&Q?(h(Q),p(I),B?(s(B),x()):(window.localStorage.setItem(at,JSON.stringify(Q)),window.localStorage.setItem(Ke,I),window.location=G.home())):(n(U),i(!1)),i(!1)},S=()=>d(!0),M=()=>f(!0),T=async(F,O)=>{const{success:Z,resetToken:R,error:ce}=await K.recoverAccount(F,O);Z&&R?(window.localStorage.setItem("resetToken",R),f(!1),w(!0)):Se(ce,"error",{clear:!0})},D=async(F,O)=>{const Z=window.localStorage.getItem("resetToken");if(Z){const{success:R,error:ce}=await K.resetPassword(Z,F,O);R?(window.localStorage.removeItem("resetToken"),w(!1),Se("Password reset successful","success",{clear:!0})):Se(ce,"error",{clear:!0})}else Se("Invalid reset token","error",{clear:!0})};return m.useEffect(()=>{l&&u&&g&&(window.localStorage.setItem(at,JSON.stringify(u)),window.localStorage.setItem(Ke,g),window.location=G.home())},[l,u,g]),m.useEffect(()=>{(async()=>{const{appName:O}=await K.fetchCustomAppName();k(O||""),i(!1)})()},[]),v?o.jsx(xN,{onSubmit:T,setShowRecoveryForm:f}):b?o.jsx(zN,{onSubmit:D}):o.jsxs(o.Fragment,{children:[o.jsxs("form",{onSubmit:z,className:"flex flex-col justify-center items-center",children:[o.jsx("div",{className:"flex items-start justify-between pt-7 pb-9",children:o.jsxs("div",{className:"flex items-center flex-col gap-y-[18px] max-w-[300px]",children:[o.jsx("div",{className:"flex gap-x-1",children:o.jsx("h3",{className:"text-white light:text-slate-950 text-[38px] leading-[28px] font-medium text-center white-space-nowrap block",children:e("login.multi-user.welcome")})}),o.jsx("p",{className:"text-zinc-400 light:text-zinc-600 text-sm text-center",children:e("login.sign-in",{appName:y||"AnythingLLM"})})]})}),o.jsx("div",{className:"w-full px-12",children:o.jsxs("div",{className:"w-full flex flex-col gap-y-3",children:[o.jsxs("div",{className:"w-full flex flex-col gap-y-2",children:[o.jsx("label",{className:"text-zinc-300 light:text-slate-800 text-sm",children:e("login.multi-user.placeholder-username")}),o.jsx("input",{name:"username",type:"text",className:"border-none bg-zinc-800 light:bg-slate-200 text-zinc-200 light:text-zinc-600 text-sm rounded-lg p-2.5 w-[300px] h-[34px] focus:outline-none focus:ring-1 focus:ring-sky-300",required:!0,autoComplete:"off"})]}),o.jsxs("div",{className:"w-full px-0 flex flex-col gap-y-2",children:[o.jsx("label",{className:"text-zinc-300 light:text-slate-800 text-sm",children:e("login.multi-user.placeholder-password")}),o.jsx("input",{name:"password",type:"password",className:"border-none bg-zinc-800 light:bg-slate-200 text-zinc-200 light:text-zinc-600 text-sm rounded-lg p-2.5 w-[300px] h-[34px] focus:outline-none focus:ring-1 focus:ring-sky-300",required:!0,autoComplete:"off"})]}),a&&o.jsxs("p",{className:"text-red-400 text-sm",children:["Error: ",a]})]})}),o.jsxs("div",{className:"flex items-center px-12 mt-9 space-x-2 w-full flex-col gap-y-6",children:[o.jsx("button",{disabled:t,type:"submit",className:"text-zinc-950 bg-white hover:bg-zinc-300 light:bg-sky-200 light:text-slate-950 light:hover:bg-sky-300 text-sm font-semibold rounded-lg border-primary-button h-[34px] w-full",children:e(t?"login.multi-user.validating":"login.multi-user.login")}),o.jsxs("button",{type:"button",className:"text-zinc-200 light:text-zinc-600 hover:text-sky-300 light:hover:text-sky-600 hover:underline text-sm flex gap-x-1",onClick:M,children:[e("login.multi-user.forgot-pass"),"?",o.jsx("b",{className:"font-semibold text-sky-300 light:text-sky-600",children:e("login.multi-user.reset")})]})]})]}),o.jsx(Tc,{isOpen:_,noPortal:!0,children:o.jsx(e_,{recoveryCodes:r,onDownloadComplete:S,onClose:A})})]})}function jN({mode:e="single"}){const{loginLogo:t,isCustomLogo:i}=Ry();return o.jsxs("div",{className:"fixed inset-0 bg-zinc-950 light:bg-slate-50 flex flex-col items-center justify-center overflow-hidden",children:[o.jsx("img",{src:t,alt:"Logo",className:`max-h-[80px] ${i?"rounded-lg":""}`,style:{objectFit:"contain"}}),e==="single"?o.jsx(_N,{}):o.jsx(AN,{})]})}function LN(e=!1){const[t,i]=m.useState({loading:!0,requiresAuth:!1,mode:"single"});return m.useEffect(()=>{async function a(){if(!window)return;if(!K.needsAuthCheck()&&e===!1){i({loading:!1,requiresAuth:!1,mode:"multi"});return}const n=await K.keys();if(n!=null&&n.MultiUserMode){const r=window.localStorage.getItem(Ke);if(r)if(e?!1:await K.checkAuth(r)){i({loading:!1,requiresAuth:!1,mode:"multi"});return}else{i({loading:!1,requiresAuth:!0,mode:"multi"}),window.localStorage.removeItem(at),window.localStorage.removeItem(Ke),window.localStorage.removeItem(Jt);return}else{i({loading:!1,requiresAuth:!0,mode:"multi"});return}}else{if(!((n==null?void 0:n.RequiresAuth)||!1)){i({loading:!1,requiresAuth:!1,mode:"single"});return}const s=window.localStorage.getItem(Ke);if(s)if(e?!1:await K.checkAuth(s)){i({loading:!1,requiresAuth:!1,mode:"single"});return}else{i({loading:!1,requiresAuth:!0,mode:"single"}),window.localStorage.removeItem(Ke),window.localStorage.removeItem(at),window.localStorage.removeItem(Jt);return}else{i({loading:!1,requiresAuth:!0,mode:"single"});return}}}a()},[]),t}function t_(){return new URLSearchParams(window.location.search)}function SN(){const[e,t]=m.useState(!0),[i,a]=m.useState({enabled:!1,noLogin:!1,noLoginRedirect:null});return m.useEffect(()=>{async function n(){try{const r=await K.keys();a({enabled:r==null?void 0:r.SimpleSSOEnabled,noLogin:r==null?void 0:r.SimpleSSONoLogin,noLoginRedirect:r==null?void 0:r.SimpleSSONoLoginRedirect})}catch(r){console.error(r)}finally{t(!1)}}n()},[]),{loading:e,ssoConfig:i}}function MN(){const e=t_(),{loading:t,ssoConfig:i}=SN(),{loading:a,requiresAuth:n,mode:r}=LN(!!e.get("nt"));return a||t?o.jsx(_a,{}):i.enabled&&i.noLogin?i.noLoginRedirect&&!e.has("token")?window.location.replace(i.noLoginRedirect):o.jsx(Qi,{to:G.sso.login()}):n===!1?o.jsx(Qi,{to:G.home()}):o.jsx(jN,{mode:r})}function PN(){const e=t_(),t=e.get("redirectTo")||G.home(),[i,a]=m.useState(!1),[n,r]=m.useState(null);return m.useEffect(()=>{try{if(!e.get("token"))throw new Error("No token provided.");window.localStorage.removeItem(at),window.localStorage.removeItem(Ke),window.localStorage.removeItem(Jt),K.simpleSSOLogin(e.get("token")).then(s=>{if(!s.valid)throw new Error(s.message);window.localStorage.setItem(at,JSON.stringify(s.user)),window.localStorage.setItem(Ke,s.token),window.localStorage.setItem(Jt,Number(new Date)),a(s.valid)}).catch(s=>{r(s.message)})}catch(s){r(s.message)}},[]),n?o.jsxs("div",{className:"w-screen h-screen overflow-hidden bg-theme-bg-primary flex items-center justify-center flex-col gap-4",children:[o.jsx("p",{className:"text-theme-text-primary font-mono text-lg",children:n}),o.jsx("p",{className:"text-theme-text-secondary font-mono text-sm",children:"Please contact the system administrator about this error."})]}):i?window.location.replace(t):o.jsx(_a,{})}function i_(){const e=ia();m.useEffect(()=>{async function t(){await K.isOnboardingComplete()!==!1&&e(G.home())}t()},[])}function CN(){const{isLight:e}=bm();return o.jsxs("svg",{viewBox:"0 0 818 514",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"w-full h-auto",children:[o.jsx("g",{filter:"url(#filter0_i_onboarding)",children:o.jsx("path",{d:"M817.643 77.9966V435.862C817.643 478.86 782.656 513.847 739.646 513.847H598.7C575.046 513.847 552.952 503.3 538.072 484.907L478.122 410.756C470.908 401.84 470.837 389.328 477.943 380.329L499.609 352.901C504.264 347.009 511.228 343.628 518.739 343.628C526.251 343.628 533.143 346.973 537.798 352.818L595.593 425.47C598.391 428.969 602.557 430.981 607.033 430.981H715.243C726.004 430.981 734.766 422.22 734.766 411.458V102.4C734.766 91.627 726.004 82.8773 715.243 82.8773H606.938C602.462 82.8773 598.295 84.8773 595.498 88.3771L279.643 484.479C264.75 503.145 242.525 513.847 218.657 513.847H77.9847C34.9866 513.847 0 478.86 0 435.862V77.9966C0 34.9866 34.9866 0 77.9847 0H219.681C243.716 0 266.036 10.8329 280.928 29.7249L338.426 103.115C345.437 112.019 345.425 124.435 338.39 133.328L316.57 160.898C311.927 166.767 304.963 170.147 297.463 170.147C289.964 170.147 283.059 166.802 278.405 160.957L220.764 88.3771C217.979 84.8773 213.812 82.8773 209.336 82.8773H102.388C91.627 82.8773 82.8654 91.627 82.8654 102.4V411.458C82.8654 422.22 91.627 430.981 102.388 430.981H209.289C213.765 430.981 217.931 428.969 220.717 425.482L536.727 29.3559C551.607 10.7019 573.832 0 597.7 0H739.646C782.656 0 817.643 34.9866 817.643 77.9966Z",fill:"url(#paint0_linear_onboarding)",fillOpacity:e?.5:.28})}),o.jsxs("defs",{children:[o.jsxs("filter",{id:"filter0_i_onboarding",x:"0",y:"0",width:"817.643",height:"525.847",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[o.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),o.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),o.jsx("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),o.jsx("feOffset",{dy:"12"}),o.jsx("feGaussianBlur",{stdDeviation:"6"}),o.jsx("feComposite",{in2:"hardAlpha",operator:"arithmetic",k2:"-1",k3:"1"}),o.jsx("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.15 0"}),o.jsx("feBlend",{mode:"normal",in2:"shape",result:"effect1_innerShadow"})]}),o.jsx("linearGradient",{id:"paint0_linear_onboarding",x1:"15.9568",y1:"-4.97115",x2:"720.527",y2:"514.346",gradientUnits:"userSpaceOnUse",children:e?o.jsxs(o.Fragment,{children:[o.jsx("stop",{stopColor:"#B0BAC5"}),o.jsx("stop",{offset:"0.538462",stopColor:"#FFFFFF",stopOpacity:"0.4"}),o.jsx("stop",{offset:"1",stopColor:"#A8B0BE"})]}):o.jsxs(o.Fragment,{children:[o.jsx("stop",{stopColor:"#3C5769"}),o.jsx("stop",{offset:"0.538462",stopColor:"#9FA5C2",stopOpacity:"0.253846"}),o.jsx("stop",{offset:"1",stopColor:"#40435E"})]})})]})]})}function EN(){const e=ia();i_();const{t}=Qe();return o.jsxs("div",{className:"relative w-screen h-screen flex flex-col overflow-hidden bg-zinc-950 light:bg-slate-50",children:[o.jsx("div",{className:"absolute inset-0 light:hidden",style:{background:"radial-gradient(ellipse 160% 100% at 50% 0%, rgba(130, 152, 178, 0.45) 0%, rgba(60, 87, 105, 0.25) 45%, transparent 90%)"}}),o.jsx("div",{className:"absolute inset-0 hidden light:block",style:{background:"radial-gradient(ellipse 160% 100% at 50% 0%, rgba(176, 200, 224, 0.7) 0%, rgba(195, 213, 230, 0.45) 50%, transparent 90%)"}}),o.jsx("div",{className:"relative z-10 flex justify-center pt-[58px]",children:o.jsx("p",{className:"text-white/80 light:text-slate-600 text-3xl font-semibold",children:"AnythingLLM"})}),o.jsxs("div",{className:"relative z-10 flex-1 flex flex-col items-center justify-center -mt-8",children:[o.jsx("div",{className:"absolute flex items-center justify-center w-full px-4 md:px-0 md:max-w-[852px] md:w-[56%]",children:o.jsx(CN,{})}),o.jsx("h1",{className:"relative font-medium text-white light:text-slate-700 text-[64px] md:text-[96px] lg:text-[160px] leading-none tracking-[-0.06em] select-none",children:t("onboarding.home.welcome")}),o.jsx("button",{type:"button",onClick:()=>e(G.onboarding.llmPreference()),className:"relative border-none z-10 h-[36px] w-[300px] py-2.5 px-5 rounded-lg bg-slate-50 hover:bg-slate-300 font-medium text-sm mt-[42px] text-zinc-900 light:text-white light:bg-slate-900 light:hover:bg-slate-800 text-center flex justify-center items-center transition-colors duration-200",children:t("onboarding.home.getStarted")})]})]})}const X0=[{name:"OpenAI",value:"openai",logo:wc,options:e=>o.jsx(Bw,{settings:e}),description:"The standard option for most non-commercial use."},{name:"Azure OpenAI",value:"azure",logo:xc,options:e=>o.jsx(Kw,{settings:e}),description:"The enterprise option of OpenAI hosted on Azure services."},{name:"Anthropic",value:"anthropic",logo:Tm,options:e=>o.jsx(Ww,{settings:e}),description:"A friendly AI Assistant hosted by Anthropic."},{name:"Gemini",value:"gemini",logo:zc,options:e=>o.jsx(Jw,{settings:e}),description:"Google's largest and most capable AI model"},{name:"NVIDIA NIM",value:"nvidia-nim",logo:Wm,options:e=>o.jsx(f2,{settings:e}),description:"Run full parameter LLMs directly on your NVIDIA RTX GPU using NVIDIA NIM."},{name:"HuggingFace",value:"huggingface",logo:Om,options:e=>o.jsx(a2,{settings:e}),description:"Access 150,000+ open-source LLMs and the world's AI community"},{name:"Ollama",value:"ollama",logo:Ac,options:e=>o.jsx(Qw,{settings:e}),description:"Run LLMs locally on your own machine."},{name:"Dell Pro AI Studio",value:"dpais",logo:Zm,options:e=>o.jsx(v2,{settings:e}),description:"Run powerful LLMs quickly on NPU powered by Dell Pro AI Studio."},{name:"LM Studio",value:"lmstudio",logo:jc,options:e=>o.jsx($w,{settings:e}),description:"Discover, download, and run thousands of cutting edge LLMs in a few clicks."},{name:"Docker Model Runner",value:"docker-model-runner",logo:Xm,options:e=>o.jsx(O2,{settings:e}),description:"Run LLMs using Docker Model Runner."},{name:"Lemonade",value:"lemonade",logo:Ec,options:e=>o.jsx(V2,{settings:e}),description:"Run local LLMs, ASR, TTS, and more in a single unified AI runtime."},{name:"Local AI",value:"localai",logo:Lc,options:e=>o.jsx(Zw,{settings:e}),description:"Run LLMs locally on your own machine."},{name:"SambaNova",value:"sambanova",logo:th,options:e=>o.jsx(H2,{settings:e}),description:"Run open source models from SambaNova."},{name:"Novita AI",value:"novita",logo:Im,options:e=>o.jsx(Yw,{settings:e}),description:"Reliable, Scalable, and Cost-Effective for LLMs from Novita AI"},{name:"KoboldCPP",value:"koboldcpp",logo:Vm,options:e=>o.jsx(l2,{settings:e}),description:"Run local LLMs using koboldcpp."},{name:"Oobabooga Web UI",value:"textgenwebui",logo:qm,options:e=>o.jsx(c2,{settings:e}),description:"Run local LLMs using Oobabooga's Text Generation Web UI."},{name:"Together AI",value:"togetherai",logo:Nm,options:e=>o.jsx(e2,{settings:e}),description:"Run open source models from Together AI."},{name:"Fireworks AI",value:"fireworksai",logo:Dm,options:e=>o.jsx(t2,{settings:e}),description:"The fastest and most efficient inference engine to build production-ready, compound AI systems."},{name:"Mistral",value:"mistral",logo:Sc,options:e=>o.jsx(i2,{settings:e}),description:"Run open source models from Mistral AI."},{name:"Perplexity AI",value:"perplexity",logo:Rm,options:e=>o.jsx(n2,{settings:e}),description:"Run powerful and internet-connected models hosted by Perplexity AI."},{name:"OpenRouter",value:"openrouter",logo:Mc,options:e=>o.jsx(r2,{settings:e}),description:"A unified interface for LLMs."},{name:"Groq",value:"groq",logo:Hm,options:e=>o.jsx(o2,{settings:e}),description:"The fastest LLM inferencing available for real-time AI applications."},{name:"Cohere",value:"cohere",logo:Pc,options:e=>o.jsx(s2,{settings:e}),description:"Run Cohere's powerful Command models."},{name:"LiteLLM",value:"litellm",logo:Cc,options:e=>o.jsx(d2,{settings:e}),description:"Run LiteLLM's OpenAI compatible proxy for various LLMs."},{name:"DeepSeek",value:"deepseek",logo:Um,options:e=>o.jsx(p2,{settings:e}),description:"Run DeepSeek's powerful LLMs."},{name:"PPIO",value:"ppio",logo:$m,options:e=>o.jsx(b2,{settings:e}),description:"Run stable and cost-efficient open-source LLM APIs, such as DeepSeek, Llama, Qwen etc."},{name:"APIpie",value:"apipie",logo:Bm,options:e=>o.jsx(m2,{settings:e}),description:"A unified API of AI services from leading providers"},{name:"Generic OpenAI",value:"generic-openai",logo:_c,options:e=>o.jsx(Gw,{settings:e}),description:"Connect to any OpenAi-compatible service via a custom configuration"},{name:"AWS Bedrock",value:"bedrock",logo:Fm,options:e=>o.jsx(u2,{settings:e}),description:"Run powerful foundation models privately with AWS Bedrock."},{name:"Privatemode",value:"privatemode",logo:eh,options:e=>o.jsx(R2,{settings:e}),description:"Run LLMs with end-to-end encryption."},{name:"xAI",value:"xai",logo:Gm,options:e=>o.jsx(h2,{settings:e}),description:"Run xAI's powerful LLMs like Grok-2 and more."},{name:"Z.AI",value:"zai",logo:Km,options:e=>o.jsx(g2,{settings:e}),description:"Run Z.AI's powerful GLM models."},{name:"Moonshot AI",value:"moonshotai",logo:Jm,options:e=>o.jsx(k2,{settings:e}),description:"Run Moonshot AI's powerful LLMs."},{name:"CometAPI",value:"cometapi",logo:Qm,options:e=>o.jsx(Xw,{settings:e}),description:"500+ AI Models all in one API."},{name:"GiteeAI",value:"giteeai",logo:Ym,options:e=>o.jsx(y2,{settings:e}),description:"Run GiteeAI's powerful LLMs."},{name:"Minimax",value:"minimax",logo:ih,options:e=>o.jsx(q2,{settings:e}),description:"Run Minimax's powerful M2 LLMs."},{name:"Cerebras",value:"cerebras",logo:ah,options:e=>o.jsx(F2,{settings:e}),description:"Run models at instant speed on Cerebras inference."}];function TN({setHeader:e,setForwardBtn:t,setBackBtn:i}){var A;const{t:a}=Qe(),[n,r]=m.useState(""),[s,l]=m.useState([]),[d,u]=m.useState(null),[h,g]=m.useState(null),p=m.useRef(null),v=m.useRef(null),f=window.location.hostname.includes("useanything.com"),b=ia(),w=a("onboarding.llm.title"),y=a("onboarding.llm.description");m.useEffect(()=>{async function z(){const S=await K.keys();g(S),u((S==null?void 0:S.LLMProvider)||"openai")}z()},[]);async function k(){try{await K.markOnboardingComplete(),console.log("Onboarding complete")}catch(z){console.error("Onboarding complete failed",z)}finally{v.current&&v.current.click()}}function _(){b(G.onboarding.home())}const x=async z=>{z.preventDefault();const S=z.target,M={},T=new FormData(S);M.LLMProvider=d,M.EmbeddingEngine="native",M.VectorDB="lancedb";for(var[D,F]of T.entries())M[D]=F;const{error:O}=await K.updateSystem(M);if(O){Se(`Failed to save LLM settings: ${O}`,"error");return}b(G.onboarding.userSetup())};return m.useEffect(()=>{e({title:w,description:y}),t({showing:!0,disabled:!1,onClick:k}),i({showing:!0,disabled:!1,onClick:_})},[]),m.useEffect(()=>{const z=X0.filter(S=>S.name.toLowerCase().includes(n.toLowerCase()));l(z)},[n,d]),o.jsx("div",{children:o.jsxs("form",{ref:p,onSubmit:x,className:"w-full",children:[o.jsxs("div",{className:"w-full relative border-theme-chat-input-border shadow border-2 rounded-lg text-white",children:[o.jsx("div",{className:"w-full p-4 absolute top-0 rounded-t-lg backdrop-blur-sm",children:o.jsxs("div",{className:"w-full flex items-center sticky top-0",children:[o.jsx(fc,{size:16,weight:"bold",className:"absolute left-4 z-30 text-theme-text-primary"}),o.jsx("input",{type:"text",placeholder:"Search LLM providers",className:"bg-theme-bg-secondary placeholder:text-theme-text-secondary z-20 pl-10 h-[38px] rounded-full w-full px-4 py-1 text-sm border border-theme-chat-input-border outline-none focus:outline-primary-button active:outline-primary-button outline-none text-theme-text-primary",onChange:z=>r(z.target.value),autoComplete:"off",onKeyDown:z=>{z.key==="Enter"&&z.preventDefault()}})]})}),o.jsx("div",{className:"px-4 pt-[70px] flex flex-col gap-y-1 max-h-[390px] overflow-y-auto no-scroll pb-4",children:s.map(z=>z.value==="native"&&f?null:o.jsx(U2,{name:z.name,value:z.value,image:z.logo,description:z.description,checked:d===z.value,onClick:()=>u(z.value)},z.name))})]}),o.jsx("div",{className:"mt-4 flex flex-col gap-y-1",children:d&&((A=X0.find(z=>z.value===d))==null?void 0:A.options(h))}),o.jsx("button",{type:"submit",ref:v,hidden:!0,"aria-hidden":"true"})]})})}var IN="Expected a function",ev=0/0,NN="[object Symbol]",DN=/^\s+|\s+$/g,ON=/^[-+]0x[0-9a-f]+$/i,RN=/^0b[01]+$/i,HN=/^0o[0-7]+$/i,VN=parseInt,qN=typeof Ti=="object"&&Ti&&Ti.Object===Object&&Ti,FN=typeof self=="object"&&self&&self.Object===Object&&self,UN=qN||FN||Function("return this")(),BN=Object.prototype,GN=BN.toString,KN=Math.max,WN=Math.min,qd=function(){return UN.Date.now()};function $N(e,t,i){var a,n,r,s,l,d,u=0,h=!1,g=!1,p=!0;if(typeof e!="function")throw new TypeError(IN);t=tv(t)||0,gp(i)&&(h=!!i.leading,g="maxWait"in i,r=g?KN(tv(i.maxWait)||0,t):r,p="trailing"in i?!!i.trailing:p);function v(z){var S=a,M=n;return a=n=void 0,u=z,s=e.apply(M,S),s}function f(z){return u=z,l=setTimeout(y,t),h?v(z):s}function b(z){var S=z-d,M=z-u,T=t-S;return g?WN(T,r-M):T}function w(z){var S=z-d,M=z-u;return d===void 0||S>=t||S<0||g&&M>=r}function y(){var z=qd();if(w(z))return k(z);l=setTimeout(y,b(z))}function k(z){return l=void 0,p&&a?v(z):(a=n=void 0,s)}function _(){l!==void 0&&clearTimeout(l),u=0,a=d=n=l=void 0}function x(){return l===void 0?s:k(qd())}function A(){var z=qd(),S=w(z);if(a=arguments,n=this,d=z,S){if(l===void 0)return f(d);if(g)return l=setTimeout(y,t),v(d)}return l===void 0&&(l=setTimeout(y,t)),s}return A.cancel=_,A.flush=x,A}function gp(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function ZN(e){return!!e&&typeof e=="object"}function JN(e){return typeof e=="symbol"||ZN(e)&&GN.call(e)==NN}function tv(e){if(typeof e=="number")return e;if(JN(e))return ev;if(gp(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=gp(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(DN,"");var i=RN.test(e);return i||HN.test(e)?VN(e.slice(2),i?2:8):ON.test(e)?ev:+e}var QN=$N;const fp=Cn(QN);function YN(){const{t:e}=Qe(),{enabled:t}=pt("multiUser");return o.jsxs("div",{className:"w-screen h-screen overflow-hidden bg-theme-bg-container flex",children:[o.jsx(Fw,{}),o.jsxs("div",{style:{height:Mn?"100%":"calc(100% - 32px)"},className:"relative md:ml-[2px] md:mr-[16px] md:my-[16px] md:rounded-[16px] bg-theme-bg-secondary w-full h-full overflow-y-scroll p-4 md:p-0",children:[o.jsx("div",{className:"flex flex-col w-full px-1 md:pl-6 md:pr-[50px] md:pt-6",children:o.jsx("p",{className:"text-lg leading-6 font-bold text-theme-text-primary md-6 border-white light:border-theme-sidebar-border border-b-2 border-opacity-10 py-4",children:e("security.title")})}),t&&o.jsx(XN,{}),o.jsx(eD,{})]})]})}function XN(){const[e,t]=m.useState(!1),[i,a]=m.useState(!1),[n,r]=m.useState(!1),[s,l]=m.useState(!1),[d,u]=m.useState(!0),{t:h}=Qe(),g=async p=>{if(p.preventDefault(),t(!0),a(!1),n){const v=new FormData(p.target),f={username:v.get("username"),password:v.get("password")},{success:b,error:w}=await K.setupMultiUser(f);if(b){Se("Multi-User mode enabled successfully.","success"),t(!1),setTimeout(()=>{window.localStorage.removeItem(at),window.localStorage.removeItem(Ke),window.localStorage.removeItem(Jt),window.location=G.settings.users()},2e3);return}Se(`Failed to enable Multi-User mode: ${w}`,"error"),t(!1);return}};return m.useEffect(()=>{async function p(){u(!0);const v=await K.isMultiUserMode();l(v),u(!1)}p()},[]),d?o.jsx("div",{className:"h-1/2 transition-all duration-500 relative md:ml-[2px] md:mr-[8px] md:my-[16px] md:rounded-[26px] p-[18px] h-full overflow-y-scroll",children:o.jsx("div",{className:"w-full h-full flex justify-center items-center",children:o.jsx(Nn,{})})}):o.jsx("form",{onSubmit:g,onChange:()=>a(!0),className:"flex flex-col w-full px-1 md:pl-6 md:pr-[50px]",children:o.jsxs("div",{className:"w-full flex flex-col gap-y-1 w-full flex flex-col gap-y-1 pb-6 border-white light:border-theme-sidebar-border border-b-2 border-opacity-10",children:[o.jsxs("div",{className:"w-full flex flex-col gap-y-1",children:[o.jsx("div",{className:"items-center flex gap-x-4",children:o.jsx("p",{className:"text-base font-bold text-white mt-6",children:h("security.multiuser.title")})}),o.jsx("p",{className:"text-xs leading-[18px] font-base text-white text-opacity-60",children:h("security.multiuser.description")})]}),i&&o.jsx("div",{className:"flex justify-end",children:o.jsx(nh,{onClick:()=>g(),className:"mt-3 mr-0 -mb-20 z-10",children:h(e?"common.saving":"common.save")})}),o.jsx("div",{className:"relative w-full max-h-full",children:o.jsxs("div",{className:"relative rounded-lg",children:[o.jsx("div",{className:"flex items-start justify-between px-6 py-4"}),o.jsx("div",{className:"space-y-6 flex h-full w-full",children:o.jsxs("div",{className:"w-full flex flex-col gap-y-4",children:[s?o.jsx("p",{className:"text-white text-sm font-semibold",children:h("security.multiuser.enable.is-enable")}):o.jsx(Ic,{size:"lg",className:"mb-4",label:h("security.multiuser.enable.enable"),enabled:n,onChange:p=>r(p)}),n&&o.jsxs("div",{className:"w-full flex flex-col gap-y-2 my-5",children:[o.jsxs("div",{className:"w-80",children:[o.jsx("label",{htmlFor:"username",className:"text-white text-sm font-semibold block mb-3",children:h("security.multiuser.enable.username")}),o.jsx("input",{name:"username",type:"text",className:"border-none bg-theme-settings-input-bg text-white text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5 placeholder:text-theme-settings-input-placeholder focus:ring-blue-500",placeholder:"Your admin username",minLength:rh,maxLength:oh,pattern:Y2,required:!0,autoComplete:"off",disabled:s,defaultValue:s?"********":""}),o.jsx("p",{className:"text-white text-opacity-60 text-xs mt-2",children:h("common.username_requirements")})]}),o.jsxs("div",{className:"mt-4 w-80",children:[o.jsx("label",{htmlFor:"password",className:"text-white text-sm font-semibold block mb-3",children:h("security.multiuser.enable.password")}),o.jsx("input",{name:"password",type:"text",className:"border-none bg-theme-settings-input-bg text-white text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5 placeholder:text-theme-settings-input-placeholder focus:ring-blue-500",placeholder:"Your admin password",minLength:8,required:!0,autoComplete:"off",defaultValue:s?"********":""})]})]})]})}),o.jsx("div",{className:"flex items-center justify-between space-x-14",children:o.jsx("p",{className:"text-white text-opacity-80 text-xs rounded-lg w-96",children:h("security.multiuser.enable.description")})})]})})]})})}const ch=new RegExp(/^[a-zA-Z0-9_\-!@$%^&*();]+$/);function eD(){const[e,t]=m.useState(!1),[i,a]=m.useState(!1),[n,r]=m.useState(!1),[s,l]=m.useState(!1),[d,u]=m.useState(!0),{t:h}=Qe(),g=async p=>{if(p.preventDefault(),n)return!1;const v=new FormData(p.target);if(!ch.test(v.get("password"))){Se("Your password has restricted characters in it. Allowed symbols are _,-,!,@,$,%,^,&,*,(,),;","error"),t(!1);return}t(!0),a(!1);const f={usePassword:s,newPassword:v.get("password")},{success:b,error:w}=await K.updateSystemPassword(f);if(b){Se("Your page will refresh in a few seconds.","success"),t(!1),setTimeout(()=>{window.localStorage.removeItem(at),window.localStorage.removeItem(Ke),window.localStorage.removeItem(Jt),window.location.reload()},3e3);return}else Se(`Failed to update password: ${w}`,"error"),t(!1)};return m.useEffect(()=>{async function p(){u(!0);const v=await K.isMultiUserMode(),f=await K.keys();r(v),l(f==null?void 0:f.RequiresAuth),u(!1)}p()},[]),d?o.jsx("div",{className:"h-1/2 transition-all duration-500 relative md:ml-[2px] md:mr-[8px] md:my-[16px] md:rounded-[26px] p-[18px] h-full overflow-y-scroll",children:o.jsx("div",{className:"w-full h-full flex justify-center items-center",children:o.jsx(Nn,{})})}):n?null:o.jsx("form",{onSubmit:g,onChange:()=>a(!0),className:"flex flex-col w-full px-1 md:pl-6 md:pr-[50px]",children:o.jsxs("div",{className:"w-full flex flex-col gap-y-1 pb-6 border-white light:border-theme-sidebar-border border-b-2 border-opacity-10",children:[o.jsxs("div",{className:"w-full flex flex-col gap-y-1",children:[o.jsx("div",{className:"items-center flex gap-x-4",children:o.jsx("p",{className:"text-base font-bold text-white mt-6",children:h("security.password.title")})}),o.jsx("p",{className:"text-xs leading-[18px] font-base text-white text-opacity-60",children:h("security.password.description")})]}),i&&o.jsx("div",{className:"flex justify-end",children:o.jsx(nh,{onClick:()=>g(),className:"mt-3 mr-0 -mb-20 z-10",children:h(e?"common.saving":"common.save")})}),o.jsx("div",{className:"relative w-full max-h-full",children:o.jsxs("div",{className:"relative rounded-lg",children:[o.jsx("div",{className:"flex items-start justify-between px-6 py-4"}),o.jsx("div",{className:"space-y-6 flex h-full w-full",children:o.jsxs("div",{className:"w-full flex flex-col gap-y-4",children:[o.jsx(Ic,{size:"lg",className:"mb-4",label:h("security.password.title"),enabled:s,onChange:p=>l(p)}),s&&o.jsx("div",{className:"w-full flex flex-col gap-y-2 my-5",children:o.jsxs("div",{className:"mt-4 w-80",children:[o.jsx("label",{htmlFor:"password",className:"text-white text-sm font-semibold block mb-3",children:h("security.password.password-label")}),o.jsx("input",{name:"password",type:"text",className:"border-none bg-theme-settings-input-bg text-white text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5 placeholder:text-theme-settings-input-placeholder",placeholder:"Your Instance Password",minLength:8,required:!0,autoComplete:"off",defaultValue:s?"********":""})]})})]})}),o.jsx("div",{className:"flex items-center justify-between space-x-14",children:o.jsx("p",{className:"text-white text-opacity-80 light:text-theme-text text-xs rounded-lg w-96",children:h("security.password.description")})})]})})]})})}const tD=Object.freeze(Object.defineProperty({__proto__:null,PW_REGEX:ch,default:YN},Symbol.toStringTag,{value:"Module"}));function iD({setHeader:e,setForwardBtn:t,setBackBtn:i}){const{t:a}=Qe(),{enabled:n}=pt("multiUser"),[r,s]=m.useState(""),[l,d]=m.useState(!1),[u,h]=m.useState(!1),[g,p]=m.useState(!1),v=m.useRef(null),f=m.useRef(null),b=ia(),w=a("onboarding.userSetup.title"),y=a("onboarding.userSetup.description");function k(){var x,A;r==="just_me"&&g?(x=f.current)==null||x.click():r==="just_me"&&!g?b(G.onboarding.dataHandling()):r==="my_team"&&((A=v.current)==null||A.click())}function _(){b(G.onboarding.llmPreference())}return m.useEffect(()=>{let x=!0;r==="just_me"?x=!l:r==="my_team"&&(x=!u),t({showing:!0,disabled:x,onClick:k})},[r,l,u]),m.useEffect(()=>{e({title:w,description:y}),i({showing:!0,disabled:!1,onClick:_})},[]),o.jsxs("div",{className:"w-full flex items-center justify-center flex-col gap-y-6",children:[o.jsxs("div",{className:"flex flex-col border rounded-lg border-white/20 light:border-theme-sidebar-border p-8 items-center gap-y-4 w-full max-w-[600px]",children:[o.jsx("div",{className:" text-white text-sm font-semibold md:-ml-44",children:a("onboarding.userSetup.howManyUsers")}),o.jsxs("div",{className:"flex flex-col md:flex-row gap-6 w-full justify-center",children:[o.jsx("button",{onClick:()=>s("just_me"),className:`${r==="just_me"?"text-sky-400 border-sky-400/70":"text-theme-text-primary border-theme-sidebar-border"} min-w-[230px] h-11 p-4 rounded-[10px] border-2 justify-center items-center gap-[100px] inline-flex hover:border-sky-400/70 hover:text-sky-400 transition-all duration-300`,children:o.jsx("div",{className:"text-center text-sm font-bold",children:a("onboarding.userSetup.justMe")})}),n&&o.jsx("button",{onClick:()=>s("my_team"),className:`${r==="my_team"?"text-sky-400 border-sky-400/70":"text-theme-text-primary border-theme-sidebar-border"} min-w-[230px] h-11 p-4 rounded-[10px] border-2 justify-center items-center gap-[100px] inline-flex hover:border-sky-400/70 hover:text-sky-400 transition-all duration-300`,children:o.jsx("div",{className:"text-center text-sm font-bold",children:a("onboarding.userSetup.myTeam")})})]})]}),r==="just_me"&&o.jsx(aD,{setSingleUserPasswordValid:d,enablePassword:g,setEnablePassword:p,justMeSubmitRef:f,navigate:b}),r==="my_team"&&n&&o.jsx(nD,{setMultiUserLoginValid:h,myTeamSubmitRef:v,navigate:b})]})}const aD=({setSingleUserPasswordValid:e,enablePassword:t,setEnablePassword:i,justMeSubmitRef:a,navigate:n})=>{const{t:r}=Qe(),[s,l]=m.useState(!1),[d,u]=m.useState(""),h=async b=>{b.preventDefault();const w=b.target,y=new FormData(w);if(!ch.test(y.get("password"))){Se("Your password has restricted characters in it. Allowed symbols are _,-,!,@,$,%,^,&,*,(,),;","error");return}const{error:k}=await K.updateSystemPassword({usePassword:!0,newPassword:y.get("password")});if(k){Se(`Failed to set password: ${k}`,"error");return}const{token:_}=await K.requestToken({password:y.get("password")});window.localStorage.removeItem(at),window.localStorage.removeItem(Jt),window.localStorage.setItem(Ke,_),n(G.onboarding.dataHandling())},p=fp(b=>u(b.target.value),500);function v(){l(!0),i(!0)}function f(){l(!0),i(!1)}return m.useEffect(()=>{t&&s&&d.length>=8?e(!0):e(!!(!t&&s))}),o.jsx("div",{className:"w-full flex items-center justify-center flex-col gap-y-6",children:o.jsxs("div",{className:"flex flex-col border rounded-lg border-white/20 light:border-theme-sidebar-border p-8 items-center gap-y-4 w-full max-w-[600px]",children:[o.jsx("div",{className:" text-white text-sm font-semibold md:-ml-56",children:r("onboarding.userSetup.setPassword")}),o.jsxs("div",{className:"flex flex-col md:flex-row gap-6 w-full justify-center",children:[o.jsx("button",{onClick:v,className:`${t&&s?"text-sky-400 border-sky-400/70":"text-theme-text-primary border-theme-sidebar-border"} min-w-[230px] h-11 p-4 rounded-[10px] border-2 justify-center items-center gap-[100px] inline-flex hover:border-sky-400/70 hover:text-sky-400 transition-all duration-300`,children:o.jsx("div",{className:"text-center text-sm font-bold",children:r("common.yes")})}),o.jsx("button",{onClick:f,className:`${!t&&s?"text-sky-400 border-sky-400/70":"text-theme-text-primary border-theme-sidebar-border"} min-w-[230px] h-11 p-4 rounded-[10px] border-2 justify-center items-center gap-[100px] inline-flex hover:border-sky-400/70 hover:text-sky-400 transition-all duration-300`,children:o.jsx("div",{className:"text-center text-sm font-bold",children:r("common.no")})})]}),t&&o.jsxs("form",{className:"w-full mt-4",onSubmit:h,children:[o.jsx("label",{htmlFor:"name",className:"block mb-3 text-sm font-medium text-white",children:r("onboarding.userSetup.instancePassword")}),o.jsx("input",{name:"password",type:"password",className:"border-none bg-theme-settings-input-bg text-white text-sm rounded-lg block w-full p-2.5 focus:outline-primary-button active:outline-primary-button outline-none placeholder:text-theme-text-secondary",placeholder:"Your admin password",minLength:6,required:!0,autoComplete:"off",onChange:p}),o.jsxs("div",{className:"mt-4 text-white text-opacity-80 text-xs font-base -mb-2",children:[r("onboarding.userSetup.passwordReq"),o.jsx("br",{}),o.jsx("i",{children:r("onboarding.userSetup.passwordWarn")})," "]}),o.jsx("button",{type:"submit",ref:a,hidden:!0,"aria-hidden":"true"})]})]})})},nD=({setMultiUserLoginValid:e,myTeamSubmitRef:t,navigate:i})=>{const{t:a}=Qe(),[n,r]=m.useState(""),[s,l]=m.useState(""),d=async v=>{v.preventDefault();const f=v.target,b=new FormData(f),w={username:b.get("username"),password:b.get("password")},{success:y,error:k}=await K.setupMultiUser(w);if(!y){Se(`Error: ${k}`,"error");return}i(G.onboarding.dataHandling());const{user:_,token:x}=await K.requestToken(w);window.localStorage.setItem(at,JSON.stringify(_)),window.localStorage.setItem(Ke,x),window.localStorage.removeItem(Jt)},u=v=>r(v.target.value),h=v=>l(v.target.value),g=fp(u,500),p=fp(h,500);return m.useEffect(()=>{n.trim().length>0&&s.length>0?e(!0):e(!1)},[n,s]),o.jsx("div",{className:"w-full flex items-center justify-center border max-w-[600px] rounded-lg border-white/20 light:border-theme-sidebar-border",children:o.jsxs("form",{onSubmit:d,children:[o.jsx("div",{className:"flex flex-col w-full md:px-8 px-2 py-4",children:o.jsx("div",{className:"space-y-6 flex h-full w-full",children:o.jsxs("div",{className:"w-full flex flex-col gap-y-4",children:[o.jsxs("div",{children:[o.jsx("label",{htmlFor:"name",className:"block mb-3 text-sm font-medium text-white",children:a("onboarding.userSetup.adminUsername")}),o.jsx("input",{name:"username",type:"text",className:"border-none bg-theme-settings-input-bg text-white text-sm rounded-lg block w-full p-2.5 focus:outline-primary-button active:outline-primary-button placeholder:text-theme-text-secondary outline-none",placeholder:"Your admin username",minLength:rh,maxLength:oh,required:!0,autoComplete:"off",onChange:g})]}),o.jsx("p",{className:" text-white text-opacity-80 text-xs font-base",children:a("common.username_requirements")}),o.jsxs("div",{className:"mt-4",children:[o.jsx("label",{htmlFor:"name",className:"block mb-3 text-sm font-medium text-white",children:a("onboarding.userSetup.adminPassword")}),o.jsx("input",{name:"password",type:"password",className:"border-none bg-theme-settings-input-bg text-white text-sm rounded-lg block w-full p-2.5 focus:outline-primary-button active:outline-primary-button placeholder:text-theme-text-secondary outline-none",placeholder:"Your admin password",minLength:8,required:!0,autoComplete:"off",onChange:p})]}),o.jsx("p",{className:" text-white text-opacity-80 text-xs font-base",children:a("onboarding.userSetup.adminPasswordReq")})]})})}),o.jsx("div",{className:"flex w-full justify-between items-center px-6 py-4 space-x-6 border-t rounded-b border-theme-sidebar-border",children:o.jsx("div",{className:"text-theme-text-secondary text-opacity-80 text-xs font-base",children:a("onboarding.userSetup.teamHint")})}),o.jsx("button",{type:"submit",ref:t,hidden:!0,"aria-hidden":"true"})]})})},rD="/zilliz.png",oD="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUoAAAFKCAMAAABM9+Y3AAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAchQTFRFAAAAICAgQEBAPT09FhYWBwcHLi4uGBgYgICA/////f390NDQSUlJAQEBFRUVkZGR7e3tYmJi8fHxVVVVEhISsbGx+fn5h4eHDw8PPj4+2NjYycnJKCgoAgICdXV1+/v73d3dGxsbr6+v8vLyd3d3CQkJNTU1w8PDpqamNzc3DAwMg4OD4eHhKioqf39/6enpZWVluLi4tbW1AwMDZmZm8PDwp6enJCQk5ubm/v7+0dHRxMTE19fX3t7eUlJSJiYmu7u7Pz8/BAQEVlZWpKSkzs7OxsbGTU1NHR0dPDw8U1NTra2t4+PjIiIiHx8fMzMzCwsLERERmpqa+Pj41NTUOzs7hYWF8/Pz1tbWBQUFWFhYysrKHBwcwsLC0tLSFxcXDQ0NqKio9fX129vbMDAwRUVF9vb2qqqqGhoalJSU/Pz8zc3NRkZGZGRkdHR0srKyKysrCAgIrKys4ODgeHh47u7uXV1dXl5eLS0tcXFxmZmZaGhonZ2dy8vLvb29MTEx7OzsJycnqamp9/f3GRkZm5ubjY2NYWFh+vr6s7OzYGBg09PTY2Njtra2ExMT5+fnOTk5NDQ0oaGha2tr1dXVj4+PcHBwBgYGgq1wbwAAA8JJREFUeJzt3PlzE3Ucx+EFAd1yVGitgJSC9YKqFZQKHqAIHnhiBUUQDxCxoIK3eOCJIt7nv6sy4xCGJk32+8k3afs8v2Ym793XJNvOdLtFAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQaXPmJrtsXquj8xek7F3ejg4BriiT9SxctLilzSW9V6bsLW1TilQBKctyWV8rk/1X9SStzeiU5cDVy5teXLEycWxmpyzLa1Y1tze4eih1aqanLNf0NXPBXHtt+tKMT1kOX3f9VGODN9yYdpk8b+anLHtuWtf4g7l+5OaInVmQ8t8L5i2NpgZvDfhIlrMkZTl622DdpXUbgkZmR8qy3Ng/+c7td2yKmpgtKXvG7pzsgrl89eawiemQcstdd1d0T8273Lv10pVt920JKzktUg7dv72iB2pPdcelKztrXn7woUQP56/UlItSPlL1XXZNkbL22/1oyuF2MynDSBlGyjBShpEyjJRhpAwjZRgpw0gZRsowUoaRMoyUYaQMkyflYzUvb3i8gidSzjGTPCmfXFMm2vFUyllmkSdlsfvp8cSWz+xp7c7D/DKlLPr3PpvY8rm+fdVPM4dcKYt9z+9PbDk8cqDyaeaQLWWxeN4LiS2HDr5Y9QBzyJeyKF56+ZXEmIcO17+RpuNypiyKV1NvZTvSu77qMbZd3pTFgp1lotda/n+MXDKnLI6+PpCWcuLY8S79rSh3ymL7G6lf8mVvdueXPHvKolh0KLHlwN7m/x8jow6kLI6+lXpf2/4TVY+0jTqRsjg5d2kFb9dsvHO86qG2T0dSVvNuzcZ777dpJIGUYaQMI2UYKcNIGUbKMFKGkTKMlGGkDCNlGCnDSBlGyjBShpEyTG3KiQ8+rOij2pSnJh36+JNUn16Y6PnsdOZOTbjogQ+bPq9o+MJ7jI99MenQl2Wcr059nTlTM6KfnVF+U+cvq4Eph87UedZJZwWnHP623lBcys0rcgZqXmzKjfWfaxGV8ruxbr2dLTLl+NkGjwsMSnmkt1sfqhqZcvT73Q2GYlKe+2F+tjStCnxS4J6GQyEpF67t0luv/hOW8uzhxkMBKcd//ClPlGqCUo6PnJxiKD3lz1u7+JbfIirl6K4pv3jJKVf+kqNHgpCUx36deigx5cRvc7r4Mnne738kO/hnM7+fnEnaOPdX9/7k/t+SE8m2/d3M0IGkjVXd/pEEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgOnjH+nZZsJlWX+1AAAAAElFTkSuQmCC",iv="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUoAAAFKCAMAAABM9+Y3AAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAATVQTFRF////8vf/2Of/ss//pcb/mL7/i7b/f67/y9///+vo/9jR/8W5/7ut/7Gi/56L/6aJ/+p8/+yJ/+6W//Cj//W9//fL//3y5e//ZZ7/P4b/Mn7/WJb/cqb//+Ld/4Fp/2RG/3ND/94t/+A6/+Zi//vlTI7/ss7///X0/4t0/25R/+JH/5V/i5nc//3xv9f/P330pm+X//KwZXjR5WddTHvo2WlpWHnc/+hvf3S6mXGj2ef///nXjHOuf3S5sm6LzGt0WZb/pW+X//nY2GlpcnbFWHnd/+RVi3OumHGiv9b//3tB/4JA/5I9/6E6/6k4/78z/8cy/5k7/7g1/88w/+JIzN///7A2/++W//GjjLb/psf//6E5/+A7mb///9cv/4p0/9Bm//Ow/5SA/7uu/4Bp/+Lc8p+XBNvEXwAABhNJREFUeJzt3XtbG0UYhnFSIKGUYsLBAKJ0ObQSFbViUTygqFXrsQpWK4qI+v0/goTQFpLsZt6H7i7v7v37P9cF9zU7szPZJENDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACUR+Xa8MhotdY2Ojo8di3sVdfHb0zcnJx8oV5vTE3PzL6Y7t949TWHq3PzC91eWhwZS3rVyxOTryyduRWdWV5pzKxm9XdfMZWx6lpPxafmF283+73qzsSr60vnPE15qlWfyfrfyN9YrXc0dpvrrnnScanLxZTt0Vmfzec/ykdldHDHjtq5K338tfXukH1StsfmdFmu9GY1NGRnaHZeNd4zIGNTnqiXIWazZuh4au12bMjYlCWIGX5pn/d6XMiElFE09Ube/22aNhLW7FhvvhUbMjFl1Ho77/83NZVFIeTC3XcSSiamLO5VPqYMyYWkITkwZdQq5H3mqBJy893kkoNSnsyYef/fz11lTil5L/HiDkoZbRVs9WlKF/d7g0KGpIxahZowtZLvDy4ZkrJQLbeVm8mgkkEpo+UP8i7wvKRYMixlYVqmd3UHp4yWC3GNayU/DCsZmrIQ82VFKnk3sGRwyqjl/55I2ixuDryfNKeMtvIucVnSHmchuKQhZTSdd4vL2ZZKDth3iykj1+9UaBPlR+ElTSldT5fmE/O28InSmDJq5N1DN6aUXPjYUNKW0vElLl3e9ywljSlbeRdRjUiD0nJ5W1N6Pb3UtjmWNceectnnypP2LaWS0uewbEoljYPSnNLlsMxkUJpTuhyWWcyUQkqHw3JYGpQ7qad0uBX/RCm5aS0ppFzJu4yVtuiYNjpiSndbnqqU0rroSCm9LTzpnp1fKqWz3eO2NCg/zSRltJt3HRNt+/1ZNil9reHSE0L29VtL6WsNlx4i+DyjlMt517HQznyFqVJK6Wqy1KbKnaxSepostbtKoaSWsp53HwNp1fkis5T38+5jIK06wg26mNLRulNRSi58mVnKyM9B27aU8qvsUvp5rC2D978vl9LP4dDXUsqd7FL6+ZhZRifopCSlgfZmo3AupKb0s93J4gmXMw+klH4O0rULXEr5jZTSzwVOyufmyqf089Fm7RZdSvmtlNLPLbr2JriU8jsppZ+zX+04Q0r5vZTSz3GGdsgmpfxBKenokE17YEhK+aOS0tNbjtKHTKSUSklXHzqRtjtKSu1eyM++UTz7VVI+lFL6uRca0tYdJeVPSklPq472lqOS8mclpadVR5sshZTauZCnqVKbLIWU2lTpZ69zSnhUVUgp3aDv5d3GSDhIz+Tp6cjXXWXbfhYptWMhP2+Cn7Gv4faU0vrt6YGhDvsabk5Z9BP0Jyrmu3Rzyl+Ukt4WnTbzwpP6J0VPPcq7i8A8LK0ppUHpb9Fpsw7LlD9U73dQ2oelMaU2U7oclOZhmer3j5z5Ne8mKtvu0ZZSeifC4/LdYdvymFIW/f3vHr+llfKWtNHx9CGTbqavt7Ok1NYc1z9gZrnEDSlLcU7Z7XEaKct0S3lO+BfUhn8prTRRuv+CWsN0GZxSOzt3PVF2BH/LXWhK6Ykrr9uci5qBG8jAlL+Xt2TwDx+EpZRKHjhfvJ8JaxmUsuQlA+fLkJSlvro7QloGpCzVwVqcgF/LG/zjWdpzqQW4C+ryx2VTPpDuzN3vcfoZ9HuYA1JK++49x8dqSQb83G3yT19KW5yt4l3cTwwnDcyklA//VIaknw+NCSoJM2Z8ysO/hJAHj4o7JDvir/K4lIfjQ0NHe9aSRf252wviYvZP2Q7ZdrRiGZGNMoRsaz7uN2f2Sbn+9/izV83WubT72a/17Mt7Uh4e37n4otWAoXlQL+j9T5KN2lp8yvWejh2rR1sH8R1bjdlSDchzmhvVufmelP9MHv+b9KrZ6a37vaNxpXFUlgkyVmV/Y2S0Wqv9Nzl58/jG+PWwV+3OHk1N1dsaU9NHu2UdjAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAcvofjSLbR/4YdaIAAAAASUVORK5CYII=",sD="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALIAAACyCAMAAADRVGVaAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAIRQTFRF////4+Pjc3JyIB0e8fHxenl5LSssq6qrOjc4x8fHV1VWnZydj46OOzk61dXVSUdIZWNkgYCAJiQly8rLTUtLubm5mpmZLCkqNjQ0WVdYJyQlNDIzPDo7v76+VFJSKicoQkBBjoyNiIeHKygpysnKqKenLiwtODU2Ih8gXlxdaWdopqWlbIoJFwAAB2RJREFUeJztXGm3pDQQbUIECfsoOo7LqOPu//9/siSVygq8IYRzzP3Urx/dXELVrSVFv14JCQkJCQkJCQkJCQkJCQkJCQkJCQlnkZE8J1lsFidAv8gXFDQ2kcMoi3zDl7GZHETFcgCJTeYIKMkx6th89tEUuYoqNqMdVG2uo+hik/IhYwbhGf1zZYM2NsIzhtjMXCh1I5YYY3OzY1RIvlM5l7HZWdEhhuwrfZ2f6YIgx231qoRFgGw80gXpZstFM7/mjli8hmfLxsqTrNQ4U/aiveD8zMjd5oyHuh6UIgMdeUjkptWCsmnWvyoQBiQU0i2jJc+0Hr5uGdPinHqMoLmuecnteorBdoE0Tg/lUnl3lZI2nsyNVsYaZS4YLf9zviMsomDYF1mjzK1G5Ba0jSoXdsaaa3GVaMTfUTW5c1BW8njK34zmcApKG9+CMcW5RLjWVK0lUVwQp8T9LMnWg0Qaqr67XEgfIaVT5NjtVLRqSM/U97a0qRjvjihqadfsfwCQwafYrTZOcxUn7jM2qba5T0MqjfKJil8rvcldvYJanBDE4qgImOrYfnPLUvNw3Us3PFxu0MZocXxLbiDNhFTI7OhEuTENOuk+IFcOfqYGyqZ8KT2OIxu1zkFw8RBCtbhOByc/l/OUSmJ1RibfBCUSg3qcbLqV7xHl4NUVFM7buV2MaeWOcJWavQaXOiicN6xX0OuM6SIrjpTe6DMGlwxZOG8gFsEo3zmFJCMaYahbwsEwQKYrq9xz+E7/MDWa5efU5m2oCfMaoLLnoImBtTEaXDBWZJPzPLXKCudMmRr6esshEWDsOShSgv/ZlkIgQ5cpXkHKjGA8U0OGLnPApc8o0qvAjEef5VlcK1dTCOGXI32h9CooiMf0JnMfagOK5dsy811trdERBHQ7iTWLse9DbUABeb5m0Rg1Gh0hGHMXt6YTik3o3SR5kVkLr3F6FQgyayss2UMtCbYTT0M+wAdsF+lodARhbE/oxcoWcxXKgwmTOyeWT4jSNRhj1CGyZzt80YbshdIQsBBLUCbO/1zO2JXML5rcbobJj6xftHV/Sk+vLgZKG5ynyIqCSwPq30tzMrQRrisEcKLjSQgmYTATP5ai16YBzHnK0AcSDLTNcGyvQ+nf135zqkLk99n3kvGxDIYp60p2bs71QOL2w4/HPsJ9ToS1Pi/uHXpRAzEjjacM5dDMng6eT9AAhpGbKNhYe2zwTB5chtj0sVC2K4CkwY/Y/+61ILg+YLsyNPfqHM2DeVV7ffJpdJNz1blM1Kw4QgU669f75k92yv6KqmrIrq6JPdrrswzY3/ioUP58E4S+6fWdT7EaPa3qEUz7gi8W6ef17SJYje1WLzedXXI3tS++ErAaSIsvkSYhh9fPSUHWe3llGeyLw63GFGyZoSC6pIRgQzMJuxLefH3YhnhywIQzwpjPn7hoLnnKuS8+CbEau9GVVzCeVcPhtB1+PvrFpwHxZCe6QpfrF+chjmnh68O2KP+8eoy7XE4Klu7ouuCXU6b7HTSqDHY5iy7HLFWAsL0Nc3q8RN9UcG0SOxgHsOY5njBPnVGZebXDhsqRWfvQAdpGjhmiFdTYGVvvifv4ZYbn8NEhUDsm8HfSna789ZM8+M7JLstjJAI7ytXJlf5wZ9/AIVor/L0a1CL59FsIaiVrmqY2uxg4NLDfNc6+2ZJyp2P9+eCqawiznCMpSuAPd9wtXaj/OwTaeOcqZiq+OPcyRCb63PI6XMkf0phgWsGcHrX+h60WA31uT2N5AVbFcBMkBmWw6m7Z0tleShbyvltcEI+ZB2yKtiplOkgujRgsxPP34JaF+V3SZYM+VcfPwf+qClsLC/fvhbXaOrWwymGn8zFlnrQZ6qH07zdexgwP5hz4cR5EuRPxTl9Ade5oeQLGpV+rewYeRKzkAkpL1Lcgtf5956lvZ86hE6FKLGCGUzBtmXUR8BWhZfD9E0EZZ22681T2C4kFLgZ/oCUejVkzVVUcyO4atTYKY4t48WMs/fsJ7RgOed/ckhzrlK1SsO2YGqnQHHZQD2uzqRt+0EGlXPh8R7+YrQYQF6KEm6BQMnl2ZolEr4BfZeihBok/EeNzuZegzIdl2rd8x5uAd3n68Yz7QEKxLqzInG5wQK1PUZDysDHCgw7oueHw47RKFQEWXR80aXDdLviwC0Zm7VUcTBOEafT3PlOXkfcm5YN5AlzvKAbhw3KV6Gq9K3VU7GCMjnvxnT89QcsBWcjxEVMh63+dujuXoRpFio+dqCLztbSuJ/mo6goRniDP6oErgAAEDMcCTpjxDc8Y2UAngsQVdfCxGOTrQ61sbJrmb0T5nvF7P/A2E953NDUm1+5ONCiBRpqG4/Hn2yTOB8W5pII5Rmb+icgUoDCSeaWD8r8RmQIclCc75Uf8foqy9yATD/tO6jN+PkXZpVRTnq6qplnjCPwCyB0Pqx5AdjSKZ0FGad8E2U5+9o+aYUx8ne2dzmdizvEYI8/4OYyEhISEhISEhISEhISEhISEhISE/y/+A/2yTM1YBjAvAAAAAElFTkSuQmCC",lD="/lancedb.png",cD="/weaviate.png",dD="/qdrant.png",uD="/milvus.png",pD="/voyageai.png",mD="/pgvector.png",hD={openai:{name:"OpenAI",policyUrl:"https://openai.com/policies/privacy-policy/",logo:wc},azure:{name:"Azure OpenAI",policyUrl:"https://privacy.microsoft.com/privacystatement",logo:xc},anthropic:{name:"Anthropic",policyUrl:"https://www.anthropic.com/privacy",logo:Tm},gemini:{name:"Google Gemini",policyUrl:"https://policies.google.com/privacy",logo:zc},"nvidia-nim":{name:"NVIDIA NIM",description:["Your model and chats are only accessible on the machine running the NVIDIA NIM."],logo:Wm},lmstudio:{name:"LMStudio",description:["Your model and chats are only accessible on the server running LMStudio."],logo:jc},localai:{name:"LocalAI",description:["Your model and chats are only accessible on the server running LocalAI."],logo:Lc},ollama:{name:"Ollama",description:["Your model and chats are only accessible on the machine running Ollama models."],logo:Ac},togetherai:{name:"TogetherAI",policyUrl:"https://www.together.ai/privacy",logo:Nm},fireworksai:{name:"FireworksAI",policyUrl:"https://fireworks.ai/privacy-policy",logo:Dm},mistral:{name:"Mistral",policyUrl:"https://legal.mistral.ai/terms/privacy-policy",logo:Sc},huggingface:{name:"HuggingFace",policyUrl:"https://huggingface.co/privacy",logo:Om},perplexity:{name:"Perplexity AI",policyUrl:"https://www.perplexity.ai/privacy",logo:Rm},openrouter:{name:"OpenRouter",policyUrl:"https://openrouter.ai/privacy",logo:Mc},novita:{name:"Novita AI",policyUrl:"https://novita.ai/legal/privacy-policy",logo:Im},groq:{name:"Groq",policyUrl:"https://groq.com/privacy-policy/",logo:Hm},koboldcpp:{name:"KoboldCPP",description:["Your model and chats are only accessible on the server running KoboldCPP"],logo:Vm},textgenwebui:{name:"Oobabooga Web UI",description:["Your model and chats are only accessible on the server running the Oobabooga Text Generation Web UI"],logo:qm},"generic-openai":{name:"Generic OpenAI compatible service",description:["Data is shared according to the terms of service applicable with your generic endpoint provider."],logo:_c},cohere:{name:"Cohere",policyUrl:"https://cohere.com/privacy",logo:Pc},litellm:{name:"LiteLLM",description:["Your model and chats are only accessible on the server running LiteLLM"],logo:Cc},bedrock:{name:"AWS Bedrock",policyUrl:"https://aws.amazon.com/bedrock/security-compliance/",logo:Fm},deepseek:{name:"DeepSeek",policyUrl:"https://cdn.deepseek.com/policies/en-US/deepseek-privacy-policy.html",logo:Um},apipie:{name:"APIpie.AI",policyUrl:"https://apipie.ai/docs/Terms/privacy",logo:Bm},xai:{name:"xAI",policyUrl:"https://x.ai/legal/privacy-policy",logo:Gm},zai:{name:"Z.AI",policyUrl:"https://docs.z.ai/legal-agreement/privacy-policy",logo:Km},ppio:{name:"PPIO",policyUrl:"https://www.pipio.ai/privacy-policy",logo:$m},dpais:{name:"Dell Pro AI Studio",description:["Your model and chat contents are only accessible on the computer running Dell Pro AI Studio."],logo:Zm},moonshotai:{name:"Moonshot AI",policyUrl:"https://platform.moonshot.ai/docs/agreement/userprivacy",logo:Jm},cometapi:{name:"CometAPI",policyUrl:"https://apidoc.cometapi.com/privacy-policy-873819m0",logo:Qm},foundry:{name:"Microsoft Foundry Local",description:["Your model and chats are only accessible on the machine running Foundry Local."],logo:Uw},giteeai:{name:"GiteeAI",policyUrl:"https://ai.gitee.com/docs/appendix/privacy",logo:Ym},"docker-model-runner":{name:"Docker Model Runner",description:["Your model and chats are only accessible on the machine running Docker Model Runner."],logo:Xm},privatemode:{name:"Privatemode",policyUrl:"https://docs.privatemode.ai/getting-started/faq#q2",logo:eh},sambanova:{name:"SambaNova",policyUrl:"https://sambanova.ai/privacy-policy",logo:th},lemonade:{name:"Lemonade",description:["Your model and chats are only accessible on the machine running the Lemonade server."],logo:Ec},minimax:{name:"Minimax",policyUrl:"https://platform.minimax.io/protocol/privacy-policy",logo:ih},cerebras:{name:"Cerebras",policyUrl:"https://www.cerebras.ai/privacy-policy",logo:ah}},gD={pgvector:{name:"PGVector",description:["Your vectors and document text are stored on your PostgreSQL instance.","Access to your instance is managed by you."],logo:mD},chroma:{name:"Chroma",description:["Your vectors and document text are stored on your Chroma instance.","Access to your instance is managed by you."],logo:iv},chromacloud:{name:"Chroma Cloud",policyUrl:"https://www.trychroma.com/privacy",logo:iv},pinecone:{name:"Pinecone",policyUrl:"https://www.pinecone.io/privacy/",logo:sD},qdrant:{name:"Qdrant",policyUrl:"https://qdrant.tech/legal/privacy-policy/",logo:dD},weaviate:{name:"Weaviate",policyUrl:"https://weaviate.io/privacy",logo:cD},milvus:{name:"Milvus",description:["Your vectors and document text are stored on your Milvus instance (cloud or self-hosted)."],logo:uD},zilliz:{name:"Zilliz Cloud",policyUrl:"https://zilliz.com/privacy-policy",logo:rD},astra:{name:"AstraDB",policyUrl:"https://www.ibm.com/us-en/privacy",logo:oD},lancedb:{name:"LanceDB",description:["Your vectors and document text are stored privately on this instance of AnythingLLM."],logo:lD}},fD={native:{name:"AnythingLLM Embedder",description:["Your document text is embedded privately on this instance of AnythingLLM."],logo:yc},openai:{name:"OpenAI",policyUrl:"https://openai.com/policies/privacy-policy/",logo:wc},azure:{name:"Azure OpenAI",policyUrl:"https://privacy.microsoft.com/privacystatement",logo:xc},localai:{name:"LocalAI",description:["Your document text is embedded privately on the server running LocalAI."],logo:Lc},ollama:{name:"Ollama",description:["Your document text is embedded privately on the server running Ollama."],logo:Ac},lmstudio:{name:"LMStudio",description:["Your document text is embedded privately on the server running LMStudio."],logo:jc},openrouter:{name:"OpenRouter",policyUrl:"https://openrouter.ai/privacy",logo:Mc},cohere:{name:"Cohere",policyUrl:"https://cohere.com/privacy",logo:Pc},voyageai:{name:"Voyage AI",policyUrl:"https://www.voyageai.com/privacy",logo:pD},mistral:{name:"Mistral AI",policyUrl:"https://legal.mistral.ai/terms/privacy-policy",logo:Sc},litellm:{name:"LiteLLM",description:["Your document text is only accessible on the server running LiteLLM and to the providers you configured in LiteLLM."],logo:Cc},"generic-openai":{name:"Generic OpenAI compatible service",description:["Data is shared according to the terms of service applicable with your generic endpoint provider."],logo:_c},gemini:{name:"Google Gemini",policyUrl:"https://policies.google.com/privacy",logo:zc},lemonade:{name:"Lemonade",description:["Your document text is embedded privately on the machine running the Lemonade server."],logo:Ec}},Fd={llm:hD,embeddingEngine:fD,vectorDb:gD};function Ud(e){return{name:e?_2(S7(String(e))):"Unknown",description:[`"${e}" has no known data handling policy defined in AnythingLLM.`],logo:yc}}function bD(){const[e,t]=m.useState(!0),[i,a]=m.useState({llmProvider:null,embeddingEngine:null,vectorDb:null});return m.useEffect(()=>{async function n(){const r=await K.keys(),s=Fd.llm[r==null?void 0:r.LLMProvider]||Ud(r==null?void 0:r.LLMProvider),l=Fd.embeddingEngine[r==null?void 0:r.EmbeddingEngine]||Ud(r==null?void 0:r.EmbeddingEngine),d=Fd.vectorDb[r==null?void 0:r.VectorDB]||Ud(r==null?void 0:r.VectorDB);a({llmProvider:s,embeddingEngine:l,vectorDb:d}),t(!1)}n()},[]),e?null:o.jsxs("div",{className:"flex flex-col gap-8 w-full max-w-2xl",children:[o.jsx(Bd,{title:"LLM Provider",provider:i.llmProvider,altText:"LLM Logo"}),o.jsx(Bd,{title:"Embedding Preference",provider:i.embeddingEngine,altText:"Embedding Logo"}),o.jsx(Bd,{title:"Vector Database",provider:i.vectorDb,altText:"Vector DB Logo"})]})}function Bd({title:e,provider:t,altText:i}){return o.jsxs("div",{className:"flex flex-col items-start gap-y-3 pb-4 border-b border-theme-sidebar-border",children:[o.jsx("div",{className:"text-theme-text-primary text-base font-bold",children:e}),o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx("img",{src:t.logo,alt:i,className:"w-8 h-8 rounded flex-shrink-0 mt-0.5"}),o.jsxs("div",{className:"flex flex-col gap-2 flex-1",children:[o.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:o.jsx("span",{className:"text-theme-text-primary text-sm font-semibold",children:t.name})}),t.policyUrl?o.jsxs("div",{className:"text-theme-text-secondary text-sm",children:["Your usage, chats, and data are subject to the service's"," ",o.jsxs(Vt,{className:"text-theme-text-secondary hover:text-theme-text-primary text-sm font-medium underline transition-colors inline-flex items-center gap-1",to:t.policyUrl,target:"_blank",rel:"noopener noreferrer",children:["privacy policy",o.jsx(km,{size:12})]}),"."]}):t.description&&o.jsx("ul",{className:"flex flex-col list-none gap-1",children:t.description.map((a,n)=>o.jsx("li",{className:"text-theme-text-secondary text-sm",children:a},n))})]})]})]})}function vD({setHeader:e,setForwardBtn:t,setBackBtn:i}){const{t:a}=Qe(),n=ia(),r=a("onboarding.data.title"),s=a("onboarding.data.description");m.useEffect(()=>{e({title:r,description:s}),t({showing:!0,disabled:!1,onClick:l}),i({showing:!1,disabled:!1,onClick:d})},[]);function l(){n(G.onboarding.survey())}function d(){n(G.onboarding.userSetup())}return o.jsxs("div",{className:"w-full flex items-center justify-center flex-col gap-y-6",children:[o.jsx(bD,{}),o.jsx("p",{className:"text-theme-text-secondary text-sm font-medium py-1",children:a("onboarding.data.settingsHint")})]})}async function kD({email:e,useCase:t,comment:i}){const a=JSON.stringify({email:e,useCase:t,comment:i,sourceId:"0VRjqHh6Vukqi0x0Vd0n/m8JuT7k8nOz"});if(!navigator.sendBeacon)return console.log("navigator.sendBeacon not supported, falling back to fetch"),fetch(Gg,{method:"POST",body:a}).then(()=>{window.localStorage.setItem(Ll,!0),console.log("✅ Questionnaire responses sent.")}).catch(n=>{console.error("sendQuestionnaire",n.message)});navigator.sendBeacon(Gg,a),window.localStorage.setItem(Ll,!0),console.log("✅ Questionnaire responses sent.")}function yD({setHeader:e,setForwardBtn:t,setBackBtn:i}){var b;const{t:a}=Qe(),[n,r]=m.useState(""),s=m.useRef(null),l=ia(),d=m.useRef(null),u=a("onboarding.survey.title"),h=a("onboarding.survey.description");function g(){var y;if((y=window==null?void 0:window.localStorage)!=null&&y.getItem(Ll)){l(G.home());return}if(!s.current){p();return}const w=new FormData(s.current);if(w.get("email")||w.get("use_case")||w.get("comment")){s.current.requestSubmit();return}p()}function p(){l(G.home())}function v(){l(G.onboarding.dataHandling())}m.useEffect(()=>{e({title:u,description:h}),t({showing:!0,disabled:!1,onClick:g}),i({showing:!0,disabled:!1,onClick:v})},[]),m.useEffect(()=>{async function w(){(await Pn.all()).length===0&&await Pn.new({name:a("new-workspace.placeholder"),onboardingComplete:!0})}w()},[]);const f=async w=>{w.preventDefault();const y=w.target,k=new FormData(y);await kD({email:k.get("email"),useCase:k.get("use_case")||"other",comment:k.get("comment")||null}),l(G.home())};return(b=window==null?void 0:window.localStorage)!=null&&b.getItem(Ll)?o.jsx("div",{className:"w-full flex justify-center items-center py-40",children:o.jsx("div",{className:"w-full flex items-center justify-center px-1 md:px-8 py-4",children:o.jsxs("div",{className:"w-auto flex flex-col gap-y-1 items-center",children:[o.jsx(ty,{size:60,className:"text-green-500"}),o.jsx("p",{className:"text-white text-lg",children:a("onboarding.survey.thankYou")}),o.jsx("a",{href:G.mailToMintplex(),className:"text-sky-400 underline text-xs",children:"team@mintplexlabs.com"})]})})}):o.jsx("div",{className:"w-full flex justify-center bo",children:o.jsxs("form",{onSubmit:f,ref:s,className:"",children:[o.jsxs("div",{className:"md:min-w-[400px]",children:[o.jsxs("label",{htmlFor:"email",className:"text-theme-text-primary text-base font-medium",children:[a("onboarding.survey.email")," "]}),o.jsx("input",{name:"email",type:"email",placeholder:"you@gmail.com",required:!0,className:"mt-2 bg-theme-settings-input-bg text-white focus:outline-primary-button active:outline-primary-button placeholder:text-theme-settings-input-placeholder outline-none text-sm font-medium font-['Plus Jakarta Sans'] leading-tight w-full h-11 p-2.5 bg-theme-settings-input-bg rounded-lg"})]}),o.jsxs("div",{className:"mt-8",children:[o.jsxs("label",{className:"text-theme-text-primary text-base font-medium",htmlFor:"use_case",children:[a("onboarding.survey.useCase")," "]}),o.jsxs("div",{className:"mt-2 gap-y-3 flex flex-col",children:[o.jsxs("label",{className:`border-solid transition-all duration-300 w-full h-11 p-2.5 rounded-lg flex justify-start items-center gap-2.5 cursor-pointer border ${n==="job"?"border-theme-sidebar-item-workspace-active bg-theme-bg-secondary":"border-theme-sidebar-border"} hover:border-theme-sidebar-border hover:bg-theme-bg-secondary`,children:[o.jsx("input",{type:"radio",name:"use_case",value:"job",checked:n==="job",onChange:w=>r(w.target.value),className:"hidden"}),o.jsx("div",{className:`w-4 h-4 rounded-full border-2 border-theme-sidebar-border mr-2 ${n==="job"?"bg-[var(--theme-sidebar-item-workspace-active)]":""}`}),o.jsx("div",{className:"text-theme-text-primary text-sm font-medium font-['Plus Jakarta Sans'] leading-tight",children:a("onboarding.survey.useCaseWork")})]}),o.jsxs("label",{className:`border-solid transition-all duration-300 w-full h-11 p-2.5 rounded-lg flex justify-start items-center gap-2.5 cursor-pointer border-[1px] ${n==="personal"?"border-theme-sidebar-item-workspace-active bg-theme-bg-secondary":"border-theme-sidebar-border"} hover:border-theme-sidebar-border hover:bg-theme-bg-secondary`,children:[o.jsx("input",{type:"radio",name:"use_case",value:"personal",checked:n==="personal",onChange:w=>r(w.target.value),className:"hidden"}),o.jsx("div",{className:`w-4 h-4 rounded-full border-2 border-theme-sidebar-border mr-2 ${n==="personal"?"bg-[var(--theme-sidebar-item-workspace-active)]":""}`}),o.jsx("div",{className:"text-theme-text-primary text-sm font-medium font-['Plus Jakarta Sans'] leading-tight",children:a("onboarding.survey.useCasePersonal")})]}),o.jsxs("label",{className:`border-solid transition-all duration-300 w-full h-11 p-2.5 rounded-lg flex justify-start items-center gap-2.5 cursor-pointer border-[1px] ${n==="other"?"border-theme-sidebar-item-workspace-active bg-theme-bg-secondary":"border-theme-sidebar-border"} hover:border-theme-sidebar-border hover:bg-theme-bg-secondary`,children:[o.jsx("input",{type:"radio",name:"use_case",value:"other",checked:n==="other",onChange:w=>r(w.target.value),className:"hidden"}),o.jsx("div",{className:`w-4 h-4 rounded-full border-2 border-theme-sidebar-border mr-2 ${n==="other"?"bg-[var(--theme-sidebar-item-workspace-active)]":""}`}),o.jsx("div",{className:"text-theme-text-primary text-sm font-medium font-['Plus Jakarta Sans'] leading-tight",children:a("onboarding.survey.useCaseOther")})]})]})]}),o.jsxs("div",{className:"mt-8",children:[o.jsxs("label",{htmlFor:"comment",className:"text-white text-base font-medium",children:[a("onboarding.survey.comment")," ",o.jsxs("span",{className:"text-neutral-400 text-base font-light",children:["(",a("common.optional"),")"]})]}),o.jsx("textarea",{name:"comment",rows:5,className:"mt-2 bg-theme-settings-input-bg text-white text-sm rounded-lg focus:outline-primary-button active:outline-primary-button placeholder:text-theme-settings-input-placeholder outline-none block w-full p-2.5",placeholder:a("onboarding.survey.commentPlaceholder"),wrap:"soft",autoComplete:"off"})]}),o.jsx("button",{type:"submit",ref:d,hidden:!0,"aria-hidden":"true"}),o.jsx("div",{className:"w-full flex items-center justify-center",children:o.jsx("button",{type:"button",onClick:p,className:"text-white text-base font-medium text-opacity-30 hover:text-opacity-100 hover:text-teal mt-8",children:a("onboarding.survey.skip")})})]})})}const wD={home:EN,"llm-preference":TN,"user-setup":iD,"data-handling":vD,survey:yD};function _D({children:e}){i_();const[t,i]=m.useState({title:"",description:""}),[a,n]=m.useState({showing:!1,disabled:!0,onClick:()=>null}),[r,s]=m.useState({showing:!1,disabled:!0,onClick:()=>null});return Mn?o.jsx("div",{"data-layout":"onboarding",className:"w-screen h-screen overflow-y-auto bg-theme-bg-primary overflow-hidden",children:o.jsxs("div",{className:"flex flex-col",children:[o.jsxs("div",{className:"w-full relative py-10 px-2",children:[o.jsxs("div",{className:"flex flex-col w-fit mx-auto gap-y-1 mb-[55px]",children:[o.jsx("h1",{className:"text-theme-text-primary font-semibold text-center text-2xl",children:t.title}),o.jsx("p",{className:"text-theme-text-secondary text-base text-center",children:t.description})]}),e(i,n,s)]}),o.jsxs("div",{className:"flex w-full justify-center gap-x-4 pb-20",children:[o.jsx("div",{className:"flex justify-center items-center",children:a.showing&&o.jsx("button",{disabled:a.disabled,onClick:a.onClick,className:"group p-2 rounded-lg border-2 border-zinc-300 disabled:border-zinc-600 h-fit w-fit disabled:not-allowed hover:bg-zinc-100 disabled:hover:bg-transparent",children:o.jsx(Zu,{className:"text-white group-hover:text-black group-disabled:text-gray-500",size:30})})}),o.jsx("div",{className:"flex justify-center items-center",children:r.showing&&o.jsx("button",{disabled:r.disabled,onClick:r.onClick,className:"group p-2 rounded-lg border-2 border-zinc-300 disabled:border-zinc-600 h-fit w-fit disabled:not-allowed hover:bg-teal disabled:hover:bg-transparent",children:o.jsx(Ju,{className:"text-white group-hover:text-teal group-disabled:text-gray-500",size:30})})})]})]})}):o.jsxs("div",{"data-layout":"onboarding",className:"w-screen overflow-y-auto bg-theme-bg-primary flex justify-center overflow-hidden",children:[o.jsx("div",{className:"flex w-1/5 h-screen justify-center items-center",children:a.showing&&o.jsx("button",{disabled:a.disabled,onClick:a.onClick,className:"group p-2 rounded-lg border-2 border-theme-sidebar-border h-fit w-fit disabled:cursor-not-allowed hover:bg-theme-bg-secondary disabled:hover:bg-transparent","aria-label":"Back",children:o.jsx(Zu,{className:"text-theme-text-secondary group-hover:text-theme-text-primary group-disabled:text-gray-500",size:30})})}),o.jsxs("div",{className:"w-full md:w-3/5 relative h-full py-10",children:[o.jsxs("div",{className:"flex flex-col w-fit mx-auto gap-y-1 mb-[55px]",children:[o.jsx("h1",{className:"text-theme-text-primary font-semibold text-center text-2xl",children:t.title}),o.jsx("p",{className:"text-theme-text-secondary text-base text-center",children:t.description})]}),e(i,n,s)]}),o.jsx("div",{className:"flex w-1/5 h-screen justify-center items-center",children:r.showing&&o.jsx("button",{disabled:r.disabled,onClick:r.onClick,className:"group p-2 rounded-lg border-2 border-theme-sidebar-border h-fit w-fit disabled:cursor-not-allowed hover:bg-teal disabled:hover:bg-transparent","aria-label":"Continue",children:o.jsx(Ju,{className:"text-theme-text-secondary group-hover:text-white group-disabled:text-gray-500",size:30})})})]})}function av(){const{step:e}=fm(),t=wD[e||"home"];return e==="home"||!e?o.jsx(t,{}):o.jsx(_D,{children:(i,a,n)=>o.jsx(t,{setHeader:i,setBackBtn:a,setForwardBtn:n})})}const xD=c.StrictMode,zD=typeof{communityHub:{label:"Community Hub",tier:"L2",enabled:!1,allowlist:null},modelRouter:{label:"Model Router",tier:"L2",enabled:!1,allowlist:null},llmProviders:{label:"LLM Provider Allowlist",tier:"L1",enabled:!0,allowlist:["ollama","openrouter"]},brandingWhitelabel:{label:"Branding & Whitelabeling",tier:"L2",enabled:!1,allowlist:null},filesystemAgent:{label:"File System Access",tier:"L2",enabled:!0,allowlist:null},documentationLink:{label:"Documentation Link",tier:"L2",enabled:!1,allowlist:null},multiUser:{label:"Multi-User Mode",tier:"L2",enabled:!1,allowlist:null},browserExtension:{label:"Browser Extension",tier:"L2",enabled:!1,allowlist:null},chatEmbed:{label:"Chat Embed",tier:"L2",enabled:!1,allowlist:null},scheduledJobs:{label:"Scheduled Jobs",tier:"L2",enabled:!1,allowlist:null},developerApi:{label:"Developer API",tier:"L2",enabled:!1,allowlist:null},mobile:{label:"Totem LLM Mobile",tier:"L2",enabled:!1,allowlist:null},agentMode:{label:"Agent Mode",tier:"L2",enabled:!1,allowlist:null},memories:{label:"Memories Feature",tier:"L2",enabled:!1,allowlist:null},vectorDB:{label:"Vector Database Integrations",tier:"L2",enabled:!1,allowlist:null},embedder:{label:"Embedder Integrations",tier:"L2",enabled:!1,allowlist:null},textSplitter:{label:"Text Splitter Integrations",tier:"L2",enabled:!1,allowlist:null},transcription:{label:"Audio Transcription",tier:"L2",enabled:!1,allowlist:null}}<"u"?{communityHub:{label:"Community Hub",tier:"L2",enabled:!1,allowlist:null},modelRouter:{label:"Model Router",tier:"L2",enabled:!1,allowlist:null},llmProviders:{label:"LLM Provider Allowlist",tier:"L1",enabled:!0,allowlist:["ollama","openrouter"]},brandingWhitelabel:{label:"Branding & Whitelabeling",tier:"L2",enabled:!1,allowlist:null},filesystemAgent:{label:"File System Access",tier:"L2",enabled:!0,allowlist:null},documentationLink:{label:"Documentation Link",tier:"L2",enabled:!1,allowlist:null},multiUser:{label:"Multi-User Mode",tier:"L2",enabled:!1,allowlist:null},browserExtension:{label:"Browser Extension",tier:"L2",enabled:!1,allowlist:null},chatEmbed:{label:"Chat Embed",tier:"L2",enabled:!1,allowlist:null},scheduledJobs:{label:"Scheduled Jobs",tier:"L2",enabled:!1,allowlist:null},developerApi:{label:"Developer API",tier:"L2",enabled:!1,allowlist:null},mobile:{label:"Totem LLM Mobile",tier:"L2",enabled:!1,allowlist:null},agentMode:{label:"Agent Mode",tier:"L2",enabled:!1,allowlist:null},memories:{label:"Memories Feature",tier:"L2",enabled:!1,allowlist:null},vectorDB:{label:"Vector Database Integrations",tier:"L2",enabled:!1,allowlist:null},embedder:{label:"Embedder Integrations",tier:"L2",enabled:!1,allowlist:null},textSplitter:{label:"Text Splitter Integrations",tier:"L2",enabled:!1,allowlist:null},transcription:{label:"Audio Transcription",tier:"L2",enabled:!1,allowlist:null}}:{},on=e=>{var t;return((t=zD[e])==null?void 0:t.enabled)===!0},AD=a6([{path:"/",element:o.jsx(uN,{}),children:[{path:"/",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-d1d3d69a.js"),["assets/index-d1d3d69a.js","assets/index-6bd7928a.js","assets/truncate-06273256.js","assets/XCircle-edfe554c.js","assets/moment-75486807.js","assets/File-b92df2f3.js","assets/Eye-9f033dc0.js","assets/index-4fb4d421.js","assets/react-beautiful-dnd.esm-bb85eef1.js","assets/index-dcc00e8c.js","assets/mcpServers-1686e782.js","assets/admin-04b020fe.js","assets/Database-f1a76329.js","assets/Copy-d323e545.js","assets/Trans-820f1dad.js","assets/Brain-24e386d5.js","assets/Browser-1820fad0.js","assets/agentFlows-e4124dd3.js","assets/index-3cb59d82.js","assets/communityHub-aba61686.js","assets/WarningCircle-27467274.js"]);return{element:o.jsx(Y0,{Component:e})}}},{path:"/login",element:o.jsx(MN,{})},{path:"/sso/simple",element:o.jsx(PN,{})},{path:"/workspace/:slug/settings/:tab",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-d29fdeda.js"),["assets/index-d29fdeda.js","assets/index-6bd7928a.js","assets/truncate-06273256.js","assets/XCircle-edfe554c.js","assets/moment-75486807.js","assets/File-b92df2f3.js","assets/Eye-9f033dc0.js","assets/index-4fb4d421.js","assets/react-beautiful-dnd.esm-bb85eef1.js","assets/ChatText-35275002.js","assets/Database-f1a76329.js","assets/types-e90e1137.js","assets/main-0b9e408b.js","assets/index-3cb59d82.js","assets/communityHub-aba61686.js","assets/Brain-24e386d5.js","assets/Browser-1820fad0.js","assets/Trans-820f1dad.js","assets/admin-04b020fe.js","assets/Gauge-e6762f4d.js"]);return{element:o.jsx(Li,{Component:e})}}},{path:"/workspace/:slug",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-e9761a1b.js"),["assets/index-e9761a1b.js","assets/index-cf613bb3.js","assets/files-676613ed.js","assets/purify-eb750cf4.js","files.css","github.css","assets/Check-7e83fb0d.js","assets/Copy-d323e545.js","assets/index-6bd7928a.js","assets/truncate-06273256.js","assets/XCircle-edfe554c.js","assets/moment-75486807.js","assets/File-b92df2f3.js","assets/Eye-9f033dc0.js","assets/index-4fb4d421.js","assets/react-beautiful-dnd.esm-bb85eef1.js","assets/mcpServers-1686e782.js","assets/admin-04b020fe.js","assets/Database-f1a76329.js","assets/Trans-820f1dad.js","assets/Brain-24e386d5.js","assets/Browser-1820fad0.js","assets/index-dcc00e8c.js","assets/agentFlows-e4124dd3.js","assets/index-3cb59d82.js","assets/communityHub-aba61686.js","assets/WarningCircle-27467274.js","assets/index-8ba96f42.js","assets/Hammer-05b5ccc7.js"]);return{element:o.jsx(Y0,{Component:e})}},children:[{path:"t/:threadSlug"}]},{path:"/accept-invite/:code",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-166e238c.js"),[]);return{element:o.jsx(e,{})}}},{path:"/settings/llm-preference",lazy:async()=>{const{default:e}=await we(()=>Promise.resolve().then(()=>RI),void 0);return{element:o.jsx(tt,{Component:e})}}},...on("transcription")?[{path:"/settings/transcription-preference",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-83825216.js"),["assets/index-83825216.js","assets/Gauge-e6762f4d.js"]);return{element:o.jsx(tt,{Component:e})}}}]:[],{path:"/settings/audio-preference",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-1fe43260.js"),["assets/index-1fe43260.js","assets/index-8ba96f42.js"]);return{element:o.jsx(tt,{Component:e})}}},...on("embedder")?[{path:"/settings/embedding-preference",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-fce187ac.js"),["assets/index-fce187ac.js","assets/index-4277cf52.js"]);return{element:o.jsx(tt,{Component:e})}}}]:[],...on("textSplitter")?[{path:"/settings/text-splitter-preference",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-80edec8f.js"),["assets/index-80edec8f.js","assets/admin-04b020fe.js","assets/index-4277cf52.js"]);return{element:o.jsx(tt,{Component:e})}}}]:[],...on("vectorDB")?[{path:"/settings/vector-database",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-2d84e5fe.js"),["assets/index-2d84e5fe.js","assets/index-4277cf52.js"]);return{element:o.jsx(tt,{Component:e})}}}]:[],{path:"/settings/agents",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-882e468e.js"),["assets/index-882e468e.js","assets/admin-04b020fe.js","assets/mcpServers-1686e782.js","assets/Database-f1a76329.js","assets/Copy-d323e545.js","assets/File-b92df2f3.js","assets/XCircle-edfe554c.js","assets/Trans-820f1dad.js","assets/Brain-24e386d5.js","assets/Browser-1820fad0.js","assets/Hammer-05b5ccc7.js","assets/Plug-7d951c7d.js","assets/types-e90e1137.js","assets/index-efee6d1f.js","assets/agentFlows-e4124dd3.js"]);return{element:o.jsx(tt,{Component:e})}}},{path:"/settings/agents/builder",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-0bf4fb6b.js"),["assets/index-0bf4fb6b.js","assets/index-3cb59d82.js","assets/communityHub-aba61686.js","assets/Brain-24e386d5.js","assets/Browser-1820fad0.js","assets/agentFlows-e4124dd3.js","assets/anything-llm-infinity-0d7244a1.js"]);return{element:o.jsx(tt,{Component:e,hideUserMenu:!0})}}},{path:"/settings/agents/builder/:flowId",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-0bf4fb6b.js"),["assets/index-0bf4fb6b.js","assets/index-3cb59d82.js","assets/communityHub-aba61686.js","assets/Brain-24e386d5.js","assets/Browser-1820fad0.js","assets/agentFlows-e4124dd3.js","assets/anything-llm-infinity-0d7244a1.js"]);return{element:o.jsx(tt,{Component:e,hideUserMenu:!0})}}},{path:"/settings/event-logs",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-ec3efa1e.js"),[]);return{element:o.jsx(tt,{Component:e})}}},{path:"/settings/embed-chat-widgets",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-6d56c896.js"),["assets/index-6d56c896.js","assets/index-4fb4d421.js","assets/purify-eb750cf4.js","assets/moment-75486807.js","assets/truncate-06273256.js","assets/github-dark-57c241de.js","github-dark.css","github.css"]);return{element:o.jsx(tt,{Component:e})}}},{path:"/settings/security",lazy:async()=>{const{default:e}=await we(()=>Promise.resolve().then(()=>tD),void 0);return{element:o.jsx(Li,{Component:e})}}},{path:"/settings/interface",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-f9305828.js"),[]);return{element:o.jsx(Li,{Component:e})}}},...on("brandingWhitelabel")?[{path:"/settings/branding",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-d54b0575.js"),["assets/index-d54b0575.js","assets/admin-04b020fe.js"]);return{element:o.jsx(Li,{Component:e})}}}]:[],{path:"/settings/default-system-prompt",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-e58bf860.js"),["assets/index-e58bf860.js","assets/main-0b9e408b.js"]);return{element:o.jsx(tt,{Component:e})}}},{path:"/settings/chat",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-841db586.js"),[]);return{element:o.jsx(Li,{Component:e})}}},{path:"/settings/beta-features",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-44ab5f11.js"),["assets/index-44ab5f11.js","assets/admin-04b020fe.js"]);return{element:o.jsx(tt,{Component:e})}}},{path:"/settings/api-keys",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-65184421.js"),["assets/index-65184421.js","assets/PlusCircle-31c6a8d8.js","assets/admin-04b020fe.js","assets/Check-7e83fb0d.js","assets/Copy-d323e545.js"]);return{element:o.jsx(tt,{Component:e})}}},...on("modelRouter")?[{path:"/settings/model-routers",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-01932fa1.js"),["assets/index-01932fa1.js","assets/index-8c2371f5.js"]);return{element:o.jsx(tt,{Component:e})}}},{path:"/settings/model-routers/:id",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-33ded078.js"),["assets/index-33ded078.js","assets/react-beautiful-dnd.esm-bb85eef1.js","assets/index-8c2371f5.js","assets/truncate-06273256.js","assets/Trans-820f1dad.js"]);return{element:o.jsx(tt,{Component:e})}}}]:[],{path:"/settings/system-prompt-variables",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-72544df5.js"),["assets/index-72544df5.js","assets/truncate-06273256.js"]);return{element:o.jsx(tt,{Component:e})}}},{path:"/settings/browser-extension",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-ae4f557d.js"),["assets/index-ae4f557d.js","assets/PlusCircle-31c6a8d8.js","assets/Check-7e83fb0d.js","assets/Copy-d323e545.js","assets/Plug-7d951c7d.js"]);return{element:o.jsx(Li,{Component:e})}}},{path:"/settings/workspace-chats",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-2aac91d0.js"),["assets/index-2aac91d0.js","assets/truncate-06273256.js","assets/purify-eb750cf4.js","assets/github-dark-57c241de.js","github-dark.css"]);return{element:o.jsx(Li,{Component:e})}}},{path:"/settings/invites",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-574ed823.js"),["assets/index-574ed823.js","assets/admin-04b020fe.js","assets/Check-7e83fb0d.js","assets/Copy-d323e545.js"]);return{element:o.jsx(Li,{Component:e})}}},{path:"/settings/users",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-a2978aa0.js"),["assets/index-a2978aa0.js","assets/admin-04b020fe.js"]);return{element:o.jsx(Li,{Component:e})}}},{path:"/settings/workspaces",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-1c653bbf.js"),["assets/index-1c653bbf.js","assets/admin-04b020fe.js"]);return{element:o.jsx(Li,{Component:e})}}},{path:"/onboarding",element:o.jsx(av,{})},{path:"/onboarding/:step",element:o.jsx(av,{})},{path:"/settings/beta-features/live-document-sync/manage",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-631fc042.js"),["assets/index-631fc042.js","assets/index-6bd7928a.js","assets/truncate-06273256.js","assets/XCircle-edfe554c.js","assets/moment-75486807.js","assets/File-b92df2f3.js","assets/Eye-9f033dc0.js","assets/index-4fb4d421.js","assets/react-beautiful-dnd.esm-bb85eef1.js"]);return{element:o.jsx(tt,{Component:e})}}},...on("communityHub")?[{path:"/settings/community-hub/trending",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-4750915e.js"),["assets/index-4750915e.js","assets/index-b49f94f1.js","assets/communityHub-aba61686.js","assets/Eye-9f033dc0.js","assets/truncate-06273256.js"]);return{element:o.jsx(tt,{Component:e})}}},{path:"/settings/community-hub/authentication",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-27cc497c.js"),["assets/index-27cc497c.js","assets/communityHub-aba61686.js","assets/index-efee6d1f.js","assets/index-b49f94f1.js","assets/Eye-9f033dc0.js","assets/truncate-06273256.js"]);return{element:o.jsx(tt,{Component:e})}}},{path:"/settings/community-hub/import-item",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-6adfbee1.js"),["assets/index-6adfbee1.js","assets/communityHub-aba61686.js","assets/files-676613ed.js","assets/purify-eb750cf4.js","files.css","github.css","assets/index-cf613bb3.js","assets/Check-7e83fb0d.js","assets/Copy-d323e545.js","assets/index-6bd7928a.js","assets/truncate-06273256.js","assets/XCircle-edfe554c.js","assets/moment-75486807.js","assets/File-b92df2f3.js","assets/Eye-9f033dc0.js","assets/index-4fb4d421.js","assets/react-beautiful-dnd.esm-bb85eef1.js","assets/mcpServers-1686e782.js","assets/admin-04b020fe.js","assets/Database-f1a76329.js","assets/Trans-820f1dad.js","assets/Brain-24e386d5.js","assets/Browser-1820fad0.js","assets/index-dcc00e8c.js","assets/agentFlows-e4124dd3.js","assets/index-3cb59d82.js","assets/WarningCircle-27467274.js","assets/index-8ba96f42.js","assets/Hammer-05b5ccc7.js"]);return{element:o.jsx(tt,{Component:e})}}}]:[],{path:"/settings/mobile-connections",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-6679334a.js"),["assets/index-6679334a.js","assets/index-08cd0bc2.js","assets/anything-llm-infinity-0d7244a1.js","assets/moment-75486807.js"]);return{element:o.jsx(Li,{Component:e})}}},{path:"/settings/external-connections/telegram",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-ed9034ac.js"),["assets/index-ed9034ac.js","assets/Check-7e83fb0d.js","assets/Eye-9f033dc0.js","assets/index-08cd0bc2.js","assets/anything-llm-infinity-0d7244a1.js","assets/Trans-820f1dad.js"]);return{element:o.jsx(tt,{Component:e})}}},{path:"/settings/scheduled-jobs",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-cd6bc090.js"),["assets/index-cd6bc090.js","assets/usePolling-417bb099.js","assets/WarningCircle-27467274.js","assets/cron-307d3fc6.js","assets/moment-75486807.js","assets/Check-7e83fb0d.js"]);return{element:o.jsx(Vd,{Component:e})}}},{path:"/settings/scheduled-jobs/:id/runs",lazy:async()=>{const{default:e}=await we(()=>import("./assets/RunHistoryPage-2fcb4325.js"),["assets/RunHistoryPage-2fcb4325.js","assets/usePolling-417bb099.js","assets/Stop-4b47ae05.js","assets/moment-75486807.js","assets/cron-307d3fc6.js"]);return{element:o.jsx(Vd,{Component:e})}}},{path:"/settings/scheduled-jobs/:id/runs/:runId",lazy:async()=>{const{default:e}=await we(()=>import("./assets/RunDetailPage-da6aa377.js"),["assets/RunDetailPage-da6aa377.js","assets/Brain-24e386d5.js","assets/ChatText-35275002.js","assets/File-b92df2f3.js","assets/Stop-4b47ae05.js","assets/usePolling-417bb099.js","assets/files-676613ed.js","assets/purify-eb750cf4.js","files.css","github.css","assets/Copy-d323e545.js","assets/truncate-06273256.js","assets/moment-75486807.js"]);return{element:o.jsx(Vd,{Component:e})}}},{path:"*",lazy:async()=>{const{default:e}=await we(()=>import("./assets/404-56d107aa.js"),[]);return{element:o.jsx(e,{})}}}]}]);Gd.createRoot(document.getElementById("root")).render(o.jsx(xD,{children:o.jsx(hC,{children:o.jsx(u6,{router:AD})})}));export{at as $,E as A,ID as B,nh as C,sy as D,cC as E,aO as F,uC as G,pr as H,xm as I,yc as J,fc as K,O6 as L,Tc as M,ey as N,YD as O,CD as P,_2 as Q,c as R,MI as S,Qi as T,Q1 as U,Ay as V,Pn as W,f6 as X,rh as Y,oh as Z,Y2 as _,hc as a,Xs as a$,Ke as a0,Fw as a1,U2 as a2,wc as a3,Xa as a4,N7 as a5,nt as a6,lt as a7,an as a8,q6 as a9,cD as aA,uD as aB,oD as aC,S7 as aD,gc as aE,Ic as aF,vm as aG,iO as aH,fp as aI,X1 as aJ,bm as aK,t_ as aL,ty as aM,RD as aN,lh as aO,mN as aP,Os as aQ,Ry as aR,Cn as aS,Ei as aT,km as aU,dy as aV,zm as aW,dc as aX,vy as aY,Zu as aZ,ED as a_,aa,Ri as ab,R6 as ac,H6 as ad,zy as ae,G6 as af,TI as ag,xc as ah,zc as ai,Lc as aj,Ac as ak,jc as al,Ec as am,Mc as an,Cc as ao,Pc as ap,pD as aq,Sc as ar,_c as as,OD as at,lD as au,mD as av,iv as aw,sD as ax,rD as ay,dD as az,ia as b,we as b$,DD as b0,gy as b1,ym as b2,VD as b3,Oa as b4,Vl as b5,B2 as b6,MD as b7,PD as b8,w7 as b9,vn as bA,y6 as bB,x6 as bC,C6 as bD,N1 as bE,k7 as bF,qD as bG,HD as bH,wm as bI,$D as bJ,ly as bK,pC as bL,Ju as bM,Ti as bN,o0 as bO,Io as bP,x_ as bQ,$5 as bR,Z5 as bS,Q5 as bT,J5 as bU,$2 as bV,JD as bW,ZD as bX,WD as bY,LD as bZ,iy as b_,ND as ba,E4 as bb,KD as bc,w0 as bd,fy as be,y0 as bf,qy as bg,GD as bh,FD as bi,BD as bj,eO as bk,UD as bl,XD as bm,K2 as bn,tO as bo,Bu as bp,iz as bq,up as br,G0 as bs,oy as bt,pN as bu,xy as bv,I8 as bw,py as bx,Fu as by,M6 as bz,Se as c,_m as c0,LN as d,_a as e,jN as f,ue as g,Nn as h,Mn as i,o as j,Sr as k,fm as l,N as m,SD as n,QD as o,G as p,W2 as q,m as r,Et as s,K as t,Qe as u,Vt as v,az as w,pt as x,uy as y,os as z};
|
|
1739
|
+
flex items-center justify-center rounded-md mt-6 cursor-pointer`,onClick:l,children:o.jsx("ul",{className:"space-y-2 md:p-6 p-4",children:e.map((d,u)=>o.jsx("li",{className:"md:text-sm text-xs",children:d},u))})})]}),o.jsx("div",{className:"flex w-full justify-end items-center p-6 space-x-2 border-t border-theme-modal-border rounded-b",children:o.jsx("button",{type:"button",className:"transition-all duration-300 bg-white text-black hover:opacity-60 px-4 py-2 rounded-lg text-sm flex items-center gap-x-2",onClick:a?s:r,children:a?"Close":o.jsxs(o.Fragment,{children:[o.jsx(ly,{weight:"bold",size:18}),o.jsx("p",{children:"Download"})]})})})]})]})})}function _N(){const{t:e}=Qe(),[t,i]=m.useState(!1),[a,n]=m.useState(null),[r,s]=m.useState([]),[l,d]=m.useState(!1),[u,h]=m.useState(null),[g,p]=m.useState(null),{isOpen:v,openModal:f,closeModal:b}=W2(),w=async k=>{n(null),i(!0),k.preventDefault();const _={},x=new FormData(k.target);for(var[A,z]of x.entries())_[A]=z;const{valid:S,token:M,message:T,recoveryCodes:D}=await K.requestToken(_);S&&M?(h(M),D?(s(D),f()):(window.localStorage.setItem(Ke,M),window.location=G.home())):(n(T),i(!1)),i(!1)},y=()=>{d(!0)};return m.useEffect(()=>{l&&u&&(window.localStorage.setItem(Ke,u),window.location=G.home())},[l,u]),m.useEffect(()=>{(async()=>{const{appName:_}=await K.fetchCustomAppName();p(_||""),i(!1)})()},[]),o.jsxs(o.Fragment,{children:[o.jsxs("form",{onSubmit:w,className:"flex flex-col justify-center items-center",children:[o.jsx("div",{className:"flex items-start justify-between pt-7 pb-9",children:o.jsxs("div",{className:"flex items-center flex-col gap-y-[18px] max-w-[300px]",children:[o.jsx("div",{className:"flex gap-x-1",children:o.jsx("h3",{className:"text-white light:text-slate-950 text-3xl leading-[28px] font-medium text-center white-space-nowrap block",children:e("login.multi-user.welcome")})}),o.jsx("p",{className:"text-zinc-400 light:text-zinc-600 text-sm text-center",children:e("login.sign-in",{appName:g||"AnythingLLM"})})]})}),o.jsx("div",{className:"w-full px-12",children:o.jsxs("div",{className:"w-full flex flex-col gap-y-3",children:[o.jsxs("div",{className:"w-full flex flex-col gap-y-2",children:[o.jsx("label",{className:"text-zinc-300 light:text-slate-800 text-sm",children:"Password"}),o.jsx("input",{name:"password",type:"password",className:"border-none bg-zinc-800 light:bg-slate-200 text-zinc-200 light:text-zinc-600 text-sm rounded-lg p-2.5 w-[300px] h-[34px] focus:outline-none focus:ring-1 focus:ring-sky-300",required:!0,autoComplete:"off"})]}),a&&o.jsxs("p",{className:"text-red-400 text-sm",children:["Error: ",a]})]})}),o.jsx("div",{className:"flex items-center px-12 mt-9 space-x-2 w-full flex-col gap-y-6",children:o.jsx("button",{disabled:t,type:"submit",className:"text-zinc-950 bg-white hover:bg-zinc-300 light:bg-sky-200 light:text-slate-950 light:hover:bg-sky-300 text-sm font-semibold rounded-lg border-primary-button h-[34px] w-full",children:e(t?"login.multi-user.validating":"login.multi-user.login")})})]}),o.jsx(Tc,{isOpen:v,noPortal:!0,children:o.jsx(e_,{recoveryCodes:r,onDownloadComplete:y,onClose:b})})]})}const xN=({onSubmit:e,setShowRecoveryForm:t})=>{const[i,a]=m.useState(""),[n,r]=m.useState(Array(2).fill("")),s=(d,u)=>{const h=[...n];h[d]=u,r(h)},l=d=>{d.preventDefault();const u=n.filter(h=>h.trim()!=="");e(i,u)};return o.jsxs("form",{onSubmit:l,className:"flex flex-col justify-center items-center",children:[o.jsx("div",{className:"flex items-start justify-between pt-7 pb-9",children:o.jsxs("div",{className:"flex items-center flex-col gap-y-[18px] max-w-[300px]",children:[o.jsx("div",{className:"flex gap-x-1",children:o.jsx("h3",{className:"text-white light:text-slate-950 text-3xl leading-[28px] font-medium text-center white-space-nowrap block",children:Un("login.password-reset.title")})}),o.jsx("p",{className:"text-zinc-400 light:text-zinc-600 text-sm text-center",children:Un("login.password-reset.description")})]})}),o.jsx("div",{className:"w-full px-12",children:o.jsxs("div",{className:"w-full flex flex-col gap-y-3",children:[o.jsxs("div",{className:"w-full flex flex-col gap-y-2",children:[o.jsx("label",{className:"text-zinc-300 light:text-slate-800 text-sm",children:Un("login.multi-user.placeholder-username")}),o.jsx("input",{name:"username",type:"text",className:"border-none bg-zinc-800 light:bg-slate-200 text-zinc-200 light:text-zinc-600 text-sm rounded-lg p-2.5 w-[300px] h-[34px] focus:outline-none focus:ring-1 focus:ring-sky-300",value:i,onChange:d=>a(d.target.value),required:!0,autoComplete:"off"})]}),o.jsxs("div",{className:"w-full flex flex-col gap-y-2",children:[o.jsx("label",{className:"text-zinc-300 light:text-slate-800 text-sm",children:Un("login.password-reset.recovery-codes")}),n.map((d,u)=>o.jsx("input",{type:"text",name:`recoveryCode${u+1}`,className:"border-none bg-zinc-800 light:bg-slate-200 text-zinc-200 light:text-zinc-600 text-sm rounded-lg p-2.5 w-[300px] h-[34px] focus:outline-none focus:ring-1 focus:ring-sky-300",value:d,onChange:h=>s(u,h.target.value),required:!0,autoComplete:"off"},u))]})]})}),o.jsxs("div",{className:"flex items-center px-12 mt-9 space-x-2 w-full flex-col gap-y-6",children:[o.jsx("button",{type:"submit",className:"text-zinc-950 bg-white hover:bg-zinc-300 light:bg-sky-200 light:text-slate-950 light:hover:bg-sky-300 text-sm font-semibold rounded-lg border-primary-button h-[34px] w-full",children:Un("login.password-reset.title")}),o.jsx("button",{type:"button",className:"text-zinc-200 light:text-zinc-600 hover:text-sky-300 light:hover:text-sky-600 hover:underline text-sm flex gap-x-1",onClick:()=>t(!1),children:Un("login.password-reset.back-to-login")})]})]})},zN=({onSubmit:e})=>{const[t,i]=m.useState(""),[a,n]=m.useState(""),r=s=>{s.preventDefault(),e(t,a)};return o.jsxs("form",{onSubmit:r,className:"flex flex-col justify-center items-center",children:[o.jsx("div",{className:"flex items-start justify-between pt-7 pb-9",children:o.jsxs("div",{className:"flex items-center flex-col gap-y-[18px] max-w-[300px]",children:[o.jsx("div",{className:"flex gap-x-1",children:o.jsx("h3",{className:"text-white light:text-slate-950 text-[38px] leading-[28px] font-medium text-center white-space-nowrap block",children:"Reset Password"})}),o.jsx("p",{className:"text-zinc-400 light:text-zinc-600 text-sm text-center",children:"Enter your new password."})]})}),o.jsx("div",{className:"w-full px-12",children:o.jsxs("div",{className:"w-full flex flex-col gap-y-3",children:[o.jsxs("div",{className:"w-full flex flex-col gap-y-2",children:[o.jsx("label",{className:"text-zinc-300 light:text-slate-800 text-sm",children:"New Password"}),o.jsx("input",{type:"password",name:"newPassword",className:"border-none bg-zinc-800 light:bg-slate-200 text-zinc-200 light:text-zinc-600 text-sm rounded-lg p-2.5 w-[300px] h-[34px] focus:outline-none focus:ring-1 focus:ring-sky-300",value:t,onChange:s=>i(s.target.value),required:!0})]}),o.jsxs("div",{className:"w-full flex flex-col gap-y-2",children:[o.jsx("label",{className:"text-zinc-300 light:text-slate-800 text-sm",children:"Confirm Password"}),o.jsx("input",{type:"password",name:"confirmPassword",className:"border-none bg-zinc-800 light:bg-slate-200 text-zinc-200 light:text-zinc-600 text-sm rounded-lg p-2.5 w-[300px] h-[34px] focus:outline-none focus:ring-1 focus:ring-sky-300",value:a,onChange:s=>n(s.target.value),required:!0})]})]})}),o.jsx("div",{className:"flex items-center px-12 mt-9 space-x-2 w-full flex-col gap-y-6",children:o.jsx("button",{type:"submit",className:"text-zinc-950 bg-white hover:bg-zinc-300 light:bg-sky-200 light:text-slate-950 light:hover:bg-sky-300 text-sm font-semibold rounded-lg border-primary-button h-[34px] w-full",children:"Reset Password"})})]})};function AN(){const{t:e}=Qe(),[t,i]=m.useState(!1),[a,n]=m.useState(null),[r,s]=m.useState([]),[l,d]=m.useState(!1),[u,h]=m.useState(null),[g,p]=m.useState(null),[v,f]=m.useState(!1),[b,w]=m.useState(!1),[y,k]=m.useState(null),{isOpen:_,openModal:x,closeModal:A}=W2(),z=async F=>{n(null),i(!0),F.preventDefault();const O={},Z=new FormData(F.target);for(var[R,ce]of Z.entries())O[R]=ce;const{valid:ae,user:Q,token:I,message:U,recoveryCodes:B}=await K.requestToken(O);ae&&I&&Q?(h(Q),p(I),B?(s(B),x()):(window.localStorage.setItem(at,JSON.stringify(Q)),window.localStorage.setItem(Ke,I),window.location=G.home())):(n(U),i(!1)),i(!1)},S=()=>d(!0),M=()=>f(!0),T=async(F,O)=>{const{success:Z,resetToken:R,error:ce}=await K.recoverAccount(F,O);Z&&R?(window.localStorage.setItem("resetToken",R),f(!1),w(!0)):Se(ce,"error",{clear:!0})},D=async(F,O)=>{const Z=window.localStorage.getItem("resetToken");if(Z){const{success:R,error:ce}=await K.resetPassword(Z,F,O);R?(window.localStorage.removeItem("resetToken"),w(!1),Se("Password reset successful","success",{clear:!0})):Se(ce,"error",{clear:!0})}else Se("Invalid reset token","error",{clear:!0})};return m.useEffect(()=>{l&&u&&g&&(window.localStorage.setItem(at,JSON.stringify(u)),window.localStorage.setItem(Ke,g),window.location=G.home())},[l,u,g]),m.useEffect(()=>{(async()=>{const{appName:O}=await K.fetchCustomAppName();k(O||""),i(!1)})()},[]),v?o.jsx(xN,{onSubmit:T,setShowRecoveryForm:f}):b?o.jsx(zN,{onSubmit:D}):o.jsxs(o.Fragment,{children:[o.jsxs("form",{onSubmit:z,className:"flex flex-col justify-center items-center",children:[o.jsx("div",{className:"flex items-start justify-between pt-7 pb-9",children:o.jsxs("div",{className:"flex items-center flex-col gap-y-[18px] max-w-[300px]",children:[o.jsx("div",{className:"flex gap-x-1",children:o.jsx("h3",{className:"text-white light:text-slate-950 text-[38px] leading-[28px] font-medium text-center white-space-nowrap block",children:e("login.multi-user.welcome")})}),o.jsx("p",{className:"text-zinc-400 light:text-zinc-600 text-sm text-center",children:e("login.sign-in",{appName:y||"AnythingLLM"})})]})}),o.jsx("div",{className:"w-full px-12",children:o.jsxs("div",{className:"w-full flex flex-col gap-y-3",children:[o.jsxs("div",{className:"w-full flex flex-col gap-y-2",children:[o.jsx("label",{className:"text-zinc-300 light:text-slate-800 text-sm",children:e("login.multi-user.placeholder-username")}),o.jsx("input",{name:"username",type:"text",className:"border-none bg-zinc-800 light:bg-slate-200 text-zinc-200 light:text-zinc-600 text-sm rounded-lg p-2.5 w-[300px] h-[34px] focus:outline-none focus:ring-1 focus:ring-sky-300",required:!0,autoComplete:"off"})]}),o.jsxs("div",{className:"w-full px-0 flex flex-col gap-y-2",children:[o.jsx("label",{className:"text-zinc-300 light:text-slate-800 text-sm",children:e("login.multi-user.placeholder-password")}),o.jsx("input",{name:"password",type:"password",className:"border-none bg-zinc-800 light:bg-slate-200 text-zinc-200 light:text-zinc-600 text-sm rounded-lg p-2.5 w-[300px] h-[34px] focus:outline-none focus:ring-1 focus:ring-sky-300",required:!0,autoComplete:"off"})]}),a&&o.jsxs("p",{className:"text-red-400 text-sm",children:["Error: ",a]})]})}),o.jsxs("div",{className:"flex items-center px-12 mt-9 space-x-2 w-full flex-col gap-y-6",children:[o.jsx("button",{disabled:t,type:"submit",className:"text-zinc-950 bg-white hover:bg-zinc-300 light:bg-sky-200 light:text-slate-950 light:hover:bg-sky-300 text-sm font-semibold rounded-lg border-primary-button h-[34px] w-full",children:e(t?"login.multi-user.validating":"login.multi-user.login")}),o.jsxs("button",{type:"button",className:"text-zinc-200 light:text-zinc-600 hover:text-sky-300 light:hover:text-sky-600 hover:underline text-sm flex gap-x-1",onClick:M,children:[e("login.multi-user.forgot-pass"),"?",o.jsx("b",{className:"font-semibold text-sky-300 light:text-sky-600",children:e("login.multi-user.reset")})]})]})]}),o.jsx(Tc,{isOpen:_,noPortal:!0,children:o.jsx(e_,{recoveryCodes:r,onDownloadComplete:S,onClose:A})})]})}function jN({mode:e="single"}){const{loginLogo:t,isCustomLogo:i}=Ry();return o.jsxs("div",{className:"fixed inset-0 bg-zinc-950 light:bg-slate-50 flex flex-col items-center justify-center overflow-hidden",children:[o.jsx("img",{src:t,alt:"Logo",className:`max-h-[80px] ${i?"rounded-lg":""}`,style:{objectFit:"contain"}}),e==="single"?o.jsx(_N,{}):o.jsx(AN,{})]})}function LN(e=!1){const[t,i]=m.useState({loading:!0,requiresAuth:!1,mode:"single"});return m.useEffect(()=>{async function a(){if(!window)return;if(!K.needsAuthCheck()&&e===!1){i({loading:!1,requiresAuth:!1,mode:"multi"});return}const n=await K.keys();if(n!=null&&n.MultiUserMode){const r=window.localStorage.getItem(Ke);if(r)if(e?!1:await K.checkAuth(r)){i({loading:!1,requiresAuth:!1,mode:"multi"});return}else{i({loading:!1,requiresAuth:!0,mode:"multi"}),window.localStorage.removeItem(at),window.localStorage.removeItem(Ke),window.localStorage.removeItem(Jt);return}else{i({loading:!1,requiresAuth:!0,mode:"multi"});return}}else{if(!((n==null?void 0:n.RequiresAuth)||!1)){i({loading:!1,requiresAuth:!1,mode:"single"});return}const s=window.localStorage.getItem(Ke);if(s)if(e?!1:await K.checkAuth(s)){i({loading:!1,requiresAuth:!1,mode:"single"});return}else{i({loading:!1,requiresAuth:!0,mode:"single"}),window.localStorage.removeItem(Ke),window.localStorage.removeItem(at),window.localStorage.removeItem(Jt);return}else{i({loading:!1,requiresAuth:!0,mode:"single"});return}}}a()},[]),t}function t_(){return new URLSearchParams(window.location.search)}function SN(){const[e,t]=m.useState(!0),[i,a]=m.useState({enabled:!1,noLogin:!1,noLoginRedirect:null});return m.useEffect(()=>{async function n(){try{const r=await K.keys();a({enabled:r==null?void 0:r.SimpleSSOEnabled,noLogin:r==null?void 0:r.SimpleSSONoLogin,noLoginRedirect:r==null?void 0:r.SimpleSSONoLoginRedirect})}catch(r){console.error(r)}finally{t(!1)}}n()},[]),{loading:e,ssoConfig:i}}function MN(){const e=t_(),{loading:t,ssoConfig:i}=SN(),{loading:a,requiresAuth:n,mode:r}=LN(!!e.get("nt"));return a||t?o.jsx(_a,{}):i.enabled&&i.noLogin?i.noLoginRedirect&&!e.has("token")?window.location.replace(i.noLoginRedirect):o.jsx(Qi,{to:G.sso.login()}):n===!1?o.jsx(Qi,{to:G.home()}):o.jsx(jN,{mode:r})}function PN(){const e=t_(),t=e.get("redirectTo")||G.home(),[i,a]=m.useState(!1),[n,r]=m.useState(null);return m.useEffect(()=>{try{if(!e.get("token"))throw new Error("No token provided.");window.localStorage.removeItem(at),window.localStorage.removeItem(Ke),window.localStorage.removeItem(Jt),K.simpleSSOLogin(e.get("token")).then(s=>{if(!s.valid)throw new Error(s.message);window.localStorage.setItem(at,JSON.stringify(s.user)),window.localStorage.setItem(Ke,s.token),window.localStorage.setItem(Jt,Number(new Date)),a(s.valid)}).catch(s=>{r(s.message)})}catch(s){r(s.message)}},[]),n?o.jsxs("div",{className:"w-screen h-screen overflow-hidden bg-theme-bg-primary flex items-center justify-center flex-col gap-4",children:[o.jsx("p",{className:"text-theme-text-primary font-mono text-lg",children:n}),o.jsx("p",{className:"text-theme-text-secondary font-mono text-sm",children:"Please contact the system administrator about this error."})]}):i?window.location.replace(t):o.jsx(_a,{})}function i_(){const e=ia();m.useEffect(()=>{async function t(){await K.isOnboardingComplete()!==!1&&e(G.home())}t()},[])}function CN(){const{isLight:e}=bm();return o.jsxs("svg",{viewBox:"0 0 818 514",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"w-full h-auto",children:[o.jsx("g",{filter:"url(#filter0_i_onboarding)",children:o.jsx("path",{d:"M817.643 77.9966V435.862C817.643 478.86 782.656 513.847 739.646 513.847H598.7C575.046 513.847 552.952 503.3 538.072 484.907L478.122 410.756C470.908 401.84 470.837 389.328 477.943 380.329L499.609 352.901C504.264 347.009 511.228 343.628 518.739 343.628C526.251 343.628 533.143 346.973 537.798 352.818L595.593 425.47C598.391 428.969 602.557 430.981 607.033 430.981H715.243C726.004 430.981 734.766 422.22 734.766 411.458V102.4C734.766 91.627 726.004 82.8773 715.243 82.8773H606.938C602.462 82.8773 598.295 84.8773 595.498 88.3771L279.643 484.479C264.75 503.145 242.525 513.847 218.657 513.847H77.9847C34.9866 513.847 0 478.86 0 435.862V77.9966C0 34.9866 34.9866 0 77.9847 0H219.681C243.716 0 266.036 10.8329 280.928 29.7249L338.426 103.115C345.437 112.019 345.425 124.435 338.39 133.328L316.57 160.898C311.927 166.767 304.963 170.147 297.463 170.147C289.964 170.147 283.059 166.802 278.405 160.957L220.764 88.3771C217.979 84.8773 213.812 82.8773 209.336 82.8773H102.388C91.627 82.8773 82.8654 91.627 82.8654 102.4V411.458C82.8654 422.22 91.627 430.981 102.388 430.981H209.289C213.765 430.981 217.931 428.969 220.717 425.482L536.727 29.3559C551.607 10.7019 573.832 0 597.7 0H739.646C782.656 0 817.643 34.9866 817.643 77.9966Z",fill:"url(#paint0_linear_onboarding)",fillOpacity:e?.5:.28})}),o.jsxs("defs",{children:[o.jsxs("filter",{id:"filter0_i_onboarding",x:"0",y:"0",width:"817.643",height:"525.847",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[o.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),o.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),o.jsx("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),o.jsx("feOffset",{dy:"12"}),o.jsx("feGaussianBlur",{stdDeviation:"6"}),o.jsx("feComposite",{in2:"hardAlpha",operator:"arithmetic",k2:"-1",k3:"1"}),o.jsx("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.15 0"}),o.jsx("feBlend",{mode:"normal",in2:"shape",result:"effect1_innerShadow"})]}),o.jsx("linearGradient",{id:"paint0_linear_onboarding",x1:"15.9568",y1:"-4.97115",x2:"720.527",y2:"514.346",gradientUnits:"userSpaceOnUse",children:e?o.jsxs(o.Fragment,{children:[o.jsx("stop",{stopColor:"#B0BAC5"}),o.jsx("stop",{offset:"0.538462",stopColor:"#FFFFFF",stopOpacity:"0.4"}),o.jsx("stop",{offset:"1",stopColor:"#A8B0BE"})]}):o.jsxs(o.Fragment,{children:[o.jsx("stop",{stopColor:"#3C5769"}),o.jsx("stop",{offset:"0.538462",stopColor:"#9FA5C2",stopOpacity:"0.253846"}),o.jsx("stop",{offset:"1",stopColor:"#40435E"})]})})]})]})}function EN(){const e=ia();i_();const{t}=Qe();return o.jsxs("div",{className:"relative w-screen h-screen flex flex-col overflow-hidden bg-zinc-950 light:bg-slate-50",children:[o.jsx("div",{className:"absolute inset-0 light:hidden",style:{background:"radial-gradient(ellipse 160% 100% at 50% 0%, rgba(130, 152, 178, 0.45) 0%, rgba(60, 87, 105, 0.25) 45%, transparent 90%)"}}),o.jsx("div",{className:"absolute inset-0 hidden light:block",style:{background:"radial-gradient(ellipse 160% 100% at 50% 0%, rgba(176, 200, 224, 0.7) 0%, rgba(195, 213, 230, 0.45) 50%, transparent 90%)"}}),o.jsx("div",{className:"relative z-10 flex justify-center pt-[58px]",children:o.jsx("p",{className:"text-white/80 light:text-slate-600 text-3xl font-semibold",children:"AnythingLLM"})}),o.jsxs("div",{className:"relative z-10 flex-1 flex flex-col items-center justify-center -mt-8",children:[o.jsx("div",{className:"absolute flex items-center justify-center w-full px-4 md:px-0 md:max-w-[852px] md:w-[56%]",children:o.jsx(CN,{})}),o.jsx("h1",{className:"relative font-medium text-white light:text-slate-700 text-[64px] md:text-[96px] lg:text-[160px] leading-none tracking-[-0.06em] select-none",children:t("onboarding.home.welcome")}),o.jsx("button",{type:"button",onClick:()=>e(G.onboarding.llmPreference()),className:"relative border-none z-10 h-[36px] w-[300px] py-2.5 px-5 rounded-lg bg-slate-50 hover:bg-slate-300 font-medium text-sm mt-[42px] text-zinc-900 light:text-white light:bg-slate-900 light:hover:bg-slate-800 text-center flex justify-center items-center transition-colors duration-200",children:t("onboarding.home.getStarted")})]})]})}const X0=[{name:"OpenAI",value:"openai",logo:wc,options:e=>o.jsx(Bw,{settings:e}),description:"The standard option for most non-commercial use."},{name:"Azure OpenAI",value:"azure",logo:xc,options:e=>o.jsx(Kw,{settings:e}),description:"The enterprise option of OpenAI hosted on Azure services."},{name:"Anthropic",value:"anthropic",logo:Tm,options:e=>o.jsx(Ww,{settings:e}),description:"A friendly AI Assistant hosted by Anthropic."},{name:"Gemini",value:"gemini",logo:zc,options:e=>o.jsx(Jw,{settings:e}),description:"Google's largest and most capable AI model"},{name:"NVIDIA NIM",value:"nvidia-nim",logo:Wm,options:e=>o.jsx(f2,{settings:e}),description:"Run full parameter LLMs directly on your NVIDIA RTX GPU using NVIDIA NIM."},{name:"HuggingFace",value:"huggingface",logo:Om,options:e=>o.jsx(a2,{settings:e}),description:"Access 150,000+ open-source LLMs and the world's AI community"},{name:"Ollama",value:"ollama",logo:Ac,options:e=>o.jsx(Qw,{settings:e}),description:"Run LLMs locally on your own machine."},{name:"Dell Pro AI Studio",value:"dpais",logo:Zm,options:e=>o.jsx(v2,{settings:e}),description:"Run powerful LLMs quickly on NPU powered by Dell Pro AI Studio."},{name:"LM Studio",value:"lmstudio",logo:jc,options:e=>o.jsx($w,{settings:e}),description:"Discover, download, and run thousands of cutting edge LLMs in a few clicks."},{name:"Docker Model Runner",value:"docker-model-runner",logo:Xm,options:e=>o.jsx(O2,{settings:e}),description:"Run LLMs using Docker Model Runner."},{name:"Lemonade",value:"lemonade",logo:Ec,options:e=>o.jsx(V2,{settings:e}),description:"Run local LLMs, ASR, TTS, and more in a single unified AI runtime."},{name:"Local AI",value:"localai",logo:Lc,options:e=>o.jsx(Zw,{settings:e}),description:"Run LLMs locally on your own machine."},{name:"SambaNova",value:"sambanova",logo:th,options:e=>o.jsx(H2,{settings:e}),description:"Run open source models from SambaNova."},{name:"Novita AI",value:"novita",logo:Im,options:e=>o.jsx(Yw,{settings:e}),description:"Reliable, Scalable, and Cost-Effective for LLMs from Novita AI"},{name:"KoboldCPP",value:"koboldcpp",logo:Vm,options:e=>o.jsx(l2,{settings:e}),description:"Run local LLMs using koboldcpp."},{name:"Oobabooga Web UI",value:"textgenwebui",logo:qm,options:e=>o.jsx(c2,{settings:e}),description:"Run local LLMs using Oobabooga's Text Generation Web UI."},{name:"Together AI",value:"togetherai",logo:Nm,options:e=>o.jsx(e2,{settings:e}),description:"Run open source models from Together AI."},{name:"Fireworks AI",value:"fireworksai",logo:Dm,options:e=>o.jsx(t2,{settings:e}),description:"The fastest and most efficient inference engine to build production-ready, compound AI systems."},{name:"Mistral",value:"mistral",logo:Sc,options:e=>o.jsx(i2,{settings:e}),description:"Run open source models from Mistral AI."},{name:"Perplexity AI",value:"perplexity",logo:Rm,options:e=>o.jsx(n2,{settings:e}),description:"Run powerful and internet-connected models hosted by Perplexity AI."},{name:"OpenRouter",value:"openrouter",logo:Mc,options:e=>o.jsx(r2,{settings:e}),description:"A unified interface for LLMs."},{name:"Groq",value:"groq",logo:Hm,options:e=>o.jsx(o2,{settings:e}),description:"The fastest LLM inferencing available for real-time AI applications."},{name:"Cohere",value:"cohere",logo:Pc,options:e=>o.jsx(s2,{settings:e}),description:"Run Cohere's powerful Command models."},{name:"LiteLLM",value:"litellm",logo:Cc,options:e=>o.jsx(d2,{settings:e}),description:"Run LiteLLM's OpenAI compatible proxy for various LLMs."},{name:"DeepSeek",value:"deepseek",logo:Um,options:e=>o.jsx(p2,{settings:e}),description:"Run DeepSeek's powerful LLMs."},{name:"PPIO",value:"ppio",logo:$m,options:e=>o.jsx(b2,{settings:e}),description:"Run stable and cost-efficient open-source LLM APIs, such as DeepSeek, Llama, Qwen etc."},{name:"APIpie",value:"apipie",logo:Bm,options:e=>o.jsx(m2,{settings:e}),description:"A unified API of AI services from leading providers"},{name:"Generic OpenAI",value:"generic-openai",logo:_c,options:e=>o.jsx(Gw,{settings:e}),description:"Connect to any OpenAi-compatible service via a custom configuration"},{name:"AWS Bedrock",value:"bedrock",logo:Fm,options:e=>o.jsx(u2,{settings:e}),description:"Run powerful foundation models privately with AWS Bedrock."},{name:"Privatemode",value:"privatemode",logo:eh,options:e=>o.jsx(R2,{settings:e}),description:"Run LLMs with end-to-end encryption."},{name:"xAI",value:"xai",logo:Gm,options:e=>o.jsx(h2,{settings:e}),description:"Run xAI's powerful LLMs like Grok-2 and more."},{name:"Z.AI",value:"zai",logo:Km,options:e=>o.jsx(g2,{settings:e}),description:"Run Z.AI's powerful GLM models."},{name:"Moonshot AI",value:"moonshotai",logo:Jm,options:e=>o.jsx(k2,{settings:e}),description:"Run Moonshot AI's powerful LLMs."},{name:"CometAPI",value:"cometapi",logo:Qm,options:e=>o.jsx(Xw,{settings:e}),description:"500+ AI Models all in one API."},{name:"GiteeAI",value:"giteeai",logo:Ym,options:e=>o.jsx(y2,{settings:e}),description:"Run GiteeAI's powerful LLMs."},{name:"Minimax",value:"minimax",logo:ih,options:e=>o.jsx(q2,{settings:e}),description:"Run Minimax's powerful M2 LLMs."},{name:"Cerebras",value:"cerebras",logo:ah,options:e=>o.jsx(F2,{settings:e}),description:"Run models at instant speed on Cerebras inference."}];function TN({setHeader:e,setForwardBtn:t,setBackBtn:i}){var A;const{t:a}=Qe(),[n,r]=m.useState(""),[s,l]=m.useState([]),[d,u]=m.useState(null),[h,g]=m.useState(null),p=m.useRef(null),v=m.useRef(null),f=window.location.hostname.includes("useanything.com"),b=ia(),w=a("onboarding.llm.title"),y=a("onboarding.llm.description");m.useEffect(()=>{async function z(){const S=await K.keys();g(S),u((S==null?void 0:S.LLMProvider)||"openai")}z()},[]);async function k(){try{await K.markOnboardingComplete(),console.log("Onboarding complete")}catch(z){console.error("Onboarding complete failed",z)}finally{v.current&&v.current.click()}}function _(){b(G.onboarding.home())}const x=async z=>{z.preventDefault();const S=z.target,M={},T=new FormData(S);M.LLMProvider=d,M.EmbeddingEngine="native",M.VectorDB="lancedb";for(var[D,F]of T.entries())M[D]=F;const{error:O}=await K.updateSystem(M);if(O){Se(`Failed to save LLM settings: ${O}`,"error");return}b(G.onboarding.userSetup())};return m.useEffect(()=>{e({title:w,description:y}),t({showing:!0,disabled:!1,onClick:k}),i({showing:!0,disabled:!1,onClick:_})},[]),m.useEffect(()=>{const z=X0.filter(S=>S.name.toLowerCase().includes(n.toLowerCase()));l(z)},[n,d]),o.jsx("div",{children:o.jsxs("form",{ref:p,onSubmit:x,className:"w-full",children:[o.jsxs("div",{className:"w-full relative border-theme-chat-input-border shadow border-2 rounded-lg text-white",children:[o.jsx("div",{className:"w-full p-4 absolute top-0 rounded-t-lg backdrop-blur-sm",children:o.jsxs("div",{className:"w-full flex items-center sticky top-0",children:[o.jsx(fc,{size:16,weight:"bold",className:"absolute left-4 z-30 text-theme-text-primary"}),o.jsx("input",{type:"text",placeholder:"Search LLM providers",className:"bg-theme-bg-secondary placeholder:text-theme-text-secondary z-20 pl-10 h-[38px] rounded-full w-full px-4 py-1 text-sm border border-theme-chat-input-border outline-none focus:outline-primary-button active:outline-primary-button outline-none text-theme-text-primary",onChange:z=>r(z.target.value),autoComplete:"off",onKeyDown:z=>{z.key==="Enter"&&z.preventDefault()}})]})}),o.jsx("div",{className:"px-4 pt-[70px] flex flex-col gap-y-1 max-h-[390px] overflow-y-auto no-scroll pb-4",children:s.map(z=>z.value==="native"&&f?null:o.jsx(U2,{name:z.name,value:z.value,image:z.logo,description:z.description,checked:d===z.value,onClick:()=>u(z.value)},z.name))})]}),o.jsx("div",{className:"mt-4 flex flex-col gap-y-1",children:d&&((A=X0.find(z=>z.value===d))==null?void 0:A.options(h))}),o.jsx("button",{type:"submit",ref:v,hidden:!0,"aria-hidden":"true"})]})})}var IN="Expected a function",ev=0/0,NN="[object Symbol]",DN=/^\s+|\s+$/g,ON=/^[-+]0x[0-9a-f]+$/i,RN=/^0b[01]+$/i,HN=/^0o[0-7]+$/i,VN=parseInt,qN=typeof Ti=="object"&&Ti&&Ti.Object===Object&&Ti,FN=typeof self=="object"&&self&&self.Object===Object&&self,UN=qN||FN||Function("return this")(),BN=Object.prototype,GN=BN.toString,KN=Math.max,WN=Math.min,qd=function(){return UN.Date.now()};function $N(e,t,i){var a,n,r,s,l,d,u=0,h=!1,g=!1,p=!0;if(typeof e!="function")throw new TypeError(IN);t=tv(t)||0,gp(i)&&(h=!!i.leading,g="maxWait"in i,r=g?KN(tv(i.maxWait)||0,t):r,p="trailing"in i?!!i.trailing:p);function v(z){var S=a,M=n;return a=n=void 0,u=z,s=e.apply(M,S),s}function f(z){return u=z,l=setTimeout(y,t),h?v(z):s}function b(z){var S=z-d,M=z-u,T=t-S;return g?WN(T,r-M):T}function w(z){var S=z-d,M=z-u;return d===void 0||S>=t||S<0||g&&M>=r}function y(){var z=qd();if(w(z))return k(z);l=setTimeout(y,b(z))}function k(z){return l=void 0,p&&a?v(z):(a=n=void 0,s)}function _(){l!==void 0&&clearTimeout(l),u=0,a=d=n=l=void 0}function x(){return l===void 0?s:k(qd())}function A(){var z=qd(),S=w(z);if(a=arguments,n=this,d=z,S){if(l===void 0)return f(d);if(g)return l=setTimeout(y,t),v(d)}return l===void 0&&(l=setTimeout(y,t)),s}return A.cancel=_,A.flush=x,A}function gp(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function ZN(e){return!!e&&typeof e=="object"}function JN(e){return typeof e=="symbol"||ZN(e)&&GN.call(e)==NN}function tv(e){if(typeof e=="number")return e;if(JN(e))return ev;if(gp(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=gp(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(DN,"");var i=RN.test(e);return i||HN.test(e)?VN(e.slice(2),i?2:8):ON.test(e)?ev:+e}var QN=$N;const fp=Cn(QN);function YN(){const{t:e}=Qe(),{enabled:t}=pt("multiUser");return o.jsxs("div",{className:"w-screen h-screen overflow-hidden bg-theme-bg-container flex",children:[o.jsx(Fw,{}),o.jsxs("div",{style:{height:Mn?"100%":"calc(100% - 32px)"},className:"relative md:ml-[2px] md:mr-[16px] md:my-[16px] md:rounded-[16px] bg-theme-bg-secondary w-full h-full overflow-y-scroll p-4 md:p-0",children:[o.jsx("div",{className:"flex flex-col w-full px-1 md:pl-6 md:pr-[50px] md:pt-6",children:o.jsx("p",{className:"text-lg leading-6 font-bold text-theme-text-primary md-6 border-white light:border-theme-sidebar-border border-b-2 border-opacity-10 py-4",children:e("security.title")})}),t&&o.jsx(XN,{}),o.jsx(eD,{})]})]})}function XN(){const[e,t]=m.useState(!1),[i,a]=m.useState(!1),[n,r]=m.useState(!1),[s,l]=m.useState(!1),[d,u]=m.useState(!0),{t:h}=Qe(),g=async p=>{if(p.preventDefault(),t(!0),a(!1),n){const v=new FormData(p.target),f={username:v.get("username"),password:v.get("password")},{success:b,error:w}=await K.setupMultiUser(f);if(b){Se("Multi-User mode enabled successfully.","success"),t(!1),setTimeout(()=>{window.localStorage.removeItem(at),window.localStorage.removeItem(Ke),window.localStorage.removeItem(Jt),window.location=G.settings.users()},2e3);return}Se(`Failed to enable Multi-User mode: ${w}`,"error"),t(!1);return}};return m.useEffect(()=>{async function p(){u(!0);const v=await K.isMultiUserMode();l(v),u(!1)}p()},[]),d?o.jsx("div",{className:"h-1/2 transition-all duration-500 relative md:ml-[2px] md:mr-[8px] md:my-[16px] md:rounded-[26px] p-[18px] h-full overflow-y-scroll",children:o.jsx("div",{className:"w-full h-full flex justify-center items-center",children:o.jsx(Nn,{})})}):o.jsx("form",{onSubmit:g,onChange:()=>a(!0),className:"flex flex-col w-full px-1 md:pl-6 md:pr-[50px]",children:o.jsxs("div",{className:"w-full flex flex-col gap-y-1 w-full flex flex-col gap-y-1 pb-6 border-white light:border-theme-sidebar-border border-b-2 border-opacity-10",children:[o.jsxs("div",{className:"w-full flex flex-col gap-y-1",children:[o.jsx("div",{className:"items-center flex gap-x-4",children:o.jsx("p",{className:"text-base font-bold text-white mt-6",children:h("security.multiuser.title")})}),o.jsx("p",{className:"text-xs leading-[18px] font-base text-white text-opacity-60",children:h("security.multiuser.description")})]}),i&&o.jsx("div",{className:"flex justify-end",children:o.jsx(nh,{onClick:()=>g(),className:"mt-3 mr-0 -mb-20 z-10",children:h(e?"common.saving":"common.save")})}),o.jsx("div",{className:"relative w-full max-h-full",children:o.jsxs("div",{className:"relative rounded-lg",children:[o.jsx("div",{className:"flex items-start justify-between px-6 py-4"}),o.jsx("div",{className:"space-y-6 flex h-full w-full",children:o.jsxs("div",{className:"w-full flex flex-col gap-y-4",children:[s?o.jsx("p",{className:"text-white text-sm font-semibold",children:h("security.multiuser.enable.is-enable")}):o.jsx(Ic,{size:"lg",className:"mb-4",label:h("security.multiuser.enable.enable"),enabled:n,onChange:p=>r(p)}),n&&o.jsxs("div",{className:"w-full flex flex-col gap-y-2 my-5",children:[o.jsxs("div",{className:"w-80",children:[o.jsx("label",{htmlFor:"username",className:"text-white text-sm font-semibold block mb-3",children:h("security.multiuser.enable.username")}),o.jsx("input",{name:"username",type:"text",className:"border-none bg-theme-settings-input-bg text-white text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5 placeholder:text-theme-settings-input-placeholder focus:ring-blue-500",placeholder:"Your admin username",minLength:rh,maxLength:oh,pattern:Y2,required:!0,autoComplete:"off",disabled:s,defaultValue:s?"********":""}),o.jsx("p",{className:"text-white text-opacity-60 text-xs mt-2",children:h("common.username_requirements")})]}),o.jsxs("div",{className:"mt-4 w-80",children:[o.jsx("label",{htmlFor:"password",className:"text-white text-sm font-semibold block mb-3",children:h("security.multiuser.enable.password")}),o.jsx("input",{name:"password",type:"text",className:"border-none bg-theme-settings-input-bg text-white text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5 placeholder:text-theme-settings-input-placeholder focus:ring-blue-500",placeholder:"Your admin password",minLength:8,required:!0,autoComplete:"off",defaultValue:s?"********":""})]})]})]})}),o.jsx("div",{className:"flex items-center justify-between space-x-14",children:o.jsx("p",{className:"text-white text-opacity-80 text-xs rounded-lg w-96",children:h("security.multiuser.enable.description")})})]})})]})})}const ch=new RegExp(/^[a-zA-Z0-9_\-!@$%^&*();]+$/);function eD(){const[e,t]=m.useState(!1),[i,a]=m.useState(!1),[n,r]=m.useState(!1),[s,l]=m.useState(!1),[d,u]=m.useState(!0),{t:h}=Qe(),g=async p=>{if(p.preventDefault(),n)return!1;const v=new FormData(p.target);if(!ch.test(v.get("password"))){Se("Your password has restricted characters in it. Allowed symbols are _,-,!,@,$,%,^,&,*,(,),;","error"),t(!1);return}t(!0),a(!1);const f={usePassword:s,newPassword:v.get("password")},{success:b,error:w}=await K.updateSystemPassword(f);if(b){Se("Your page will refresh in a few seconds.","success"),t(!1),setTimeout(()=>{window.localStorage.removeItem(at),window.localStorage.removeItem(Ke),window.localStorage.removeItem(Jt),window.location.reload()},3e3);return}else Se(`Failed to update password: ${w}`,"error"),t(!1)};return m.useEffect(()=>{async function p(){u(!0);const v=await K.isMultiUserMode(),f=await K.keys();r(v),l(f==null?void 0:f.RequiresAuth),u(!1)}p()},[]),d?o.jsx("div",{className:"h-1/2 transition-all duration-500 relative md:ml-[2px] md:mr-[8px] md:my-[16px] md:rounded-[26px] p-[18px] h-full overflow-y-scroll",children:o.jsx("div",{className:"w-full h-full flex justify-center items-center",children:o.jsx(Nn,{})})}):n?null:o.jsx("form",{onSubmit:g,onChange:()=>a(!0),className:"flex flex-col w-full px-1 md:pl-6 md:pr-[50px]",children:o.jsxs("div",{className:"w-full flex flex-col gap-y-1 pb-6 border-white light:border-theme-sidebar-border border-b-2 border-opacity-10",children:[o.jsxs("div",{className:"w-full flex flex-col gap-y-1",children:[o.jsx("div",{className:"items-center flex gap-x-4",children:o.jsx("p",{className:"text-base font-bold text-white mt-6",children:h("security.password.title")})}),o.jsx("p",{className:"text-xs leading-[18px] font-base text-white text-opacity-60",children:h("security.password.description")})]}),i&&o.jsx("div",{className:"flex justify-end",children:o.jsx(nh,{onClick:()=>g(),className:"mt-3 mr-0 -mb-20 z-10",children:h(e?"common.saving":"common.save")})}),o.jsx("div",{className:"relative w-full max-h-full",children:o.jsxs("div",{className:"relative rounded-lg",children:[o.jsx("div",{className:"flex items-start justify-between px-6 py-4"}),o.jsx("div",{className:"space-y-6 flex h-full w-full",children:o.jsxs("div",{className:"w-full flex flex-col gap-y-4",children:[o.jsx(Ic,{size:"lg",className:"mb-4",label:h("security.password.title"),enabled:s,onChange:p=>l(p)}),s&&o.jsx("div",{className:"w-full flex flex-col gap-y-2 my-5",children:o.jsxs("div",{className:"mt-4 w-80",children:[o.jsx("label",{htmlFor:"password",className:"text-white text-sm font-semibold block mb-3",children:h("security.password.password-label")}),o.jsx("input",{name:"password",type:"text",className:"border-none bg-theme-settings-input-bg text-white text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5 placeholder:text-theme-settings-input-placeholder",placeholder:"Your Instance Password",minLength:8,required:!0,autoComplete:"off",defaultValue:s?"********":""})]})})]})}),o.jsx("div",{className:"flex items-center justify-between space-x-14",children:o.jsx("p",{className:"text-white text-opacity-80 light:text-theme-text text-xs rounded-lg w-96",children:h("security.password.description")})})]})})]})})}const tD=Object.freeze(Object.defineProperty({__proto__:null,PW_REGEX:ch,default:YN},Symbol.toStringTag,{value:"Module"}));function iD({setHeader:e,setForwardBtn:t,setBackBtn:i}){const{t:a}=Qe(),{enabled:n}=pt("multiUser"),[r,s]=m.useState(""),[l,d]=m.useState(!1),[u,h]=m.useState(!1),[g,p]=m.useState(!1),v=m.useRef(null),f=m.useRef(null),b=ia(),w=a("onboarding.userSetup.title"),y=a("onboarding.userSetup.description");function k(){var x,A;r==="just_me"&&g?(x=f.current)==null||x.click():r==="just_me"&&!g?b(G.onboarding.dataHandling()):r==="my_team"&&((A=v.current)==null||A.click())}function _(){b(G.onboarding.llmPreference())}return m.useEffect(()=>{let x=!0;r==="just_me"?x=!l:r==="my_team"&&(x=!u),t({showing:!0,disabled:x,onClick:k})},[r,l,u]),m.useEffect(()=>{e({title:w,description:y}),i({showing:!0,disabled:!1,onClick:_})},[]),o.jsxs("div",{className:"w-full flex items-center justify-center flex-col gap-y-6",children:[o.jsxs("div",{className:"flex flex-col border rounded-lg border-white/20 light:border-theme-sidebar-border p-8 items-center gap-y-4 w-full max-w-[600px]",children:[o.jsx("div",{className:" text-white text-sm font-semibold md:-ml-44",children:a("onboarding.userSetup.howManyUsers")}),o.jsxs("div",{className:"flex flex-col md:flex-row gap-6 w-full justify-center",children:[o.jsx("button",{onClick:()=>s("just_me"),className:`${r==="just_me"?"text-sky-400 border-sky-400/70":"text-theme-text-primary border-theme-sidebar-border"} min-w-[230px] h-11 p-4 rounded-[10px] border-2 justify-center items-center gap-[100px] inline-flex hover:border-sky-400/70 hover:text-sky-400 transition-all duration-300`,children:o.jsx("div",{className:"text-center text-sm font-bold",children:a("onboarding.userSetup.justMe")})}),n&&o.jsx("button",{onClick:()=>s("my_team"),className:`${r==="my_team"?"text-sky-400 border-sky-400/70":"text-theme-text-primary border-theme-sidebar-border"} min-w-[230px] h-11 p-4 rounded-[10px] border-2 justify-center items-center gap-[100px] inline-flex hover:border-sky-400/70 hover:text-sky-400 transition-all duration-300`,children:o.jsx("div",{className:"text-center text-sm font-bold",children:a("onboarding.userSetup.myTeam")})})]})]}),r==="just_me"&&o.jsx(aD,{setSingleUserPasswordValid:d,enablePassword:g,setEnablePassword:p,justMeSubmitRef:f,navigate:b}),r==="my_team"&&n&&o.jsx(nD,{setMultiUserLoginValid:h,myTeamSubmitRef:v,navigate:b})]})}const aD=({setSingleUserPasswordValid:e,enablePassword:t,setEnablePassword:i,justMeSubmitRef:a,navigate:n})=>{const{t:r}=Qe(),[s,l]=m.useState(!1),[d,u]=m.useState(""),h=async b=>{b.preventDefault();const w=b.target,y=new FormData(w);if(!ch.test(y.get("password"))){Se("Your password has restricted characters in it. Allowed symbols are _,-,!,@,$,%,^,&,*,(,),;","error");return}const{error:k}=await K.updateSystemPassword({usePassword:!0,newPassword:y.get("password")});if(k){Se(`Failed to set password: ${k}`,"error");return}const{token:_}=await K.requestToken({password:y.get("password")});window.localStorage.removeItem(at),window.localStorage.removeItem(Jt),window.localStorage.setItem(Ke,_),n(G.onboarding.dataHandling())},p=fp(b=>u(b.target.value),500);function v(){l(!0),i(!0)}function f(){l(!0),i(!1)}return m.useEffect(()=>{t&&s&&d.length>=8?e(!0):e(!!(!t&&s))}),o.jsx("div",{className:"w-full flex items-center justify-center flex-col gap-y-6",children:o.jsxs("div",{className:"flex flex-col border rounded-lg border-white/20 light:border-theme-sidebar-border p-8 items-center gap-y-4 w-full max-w-[600px]",children:[o.jsx("div",{className:" text-white text-sm font-semibold md:-ml-56",children:r("onboarding.userSetup.setPassword")}),o.jsxs("div",{className:"flex flex-col md:flex-row gap-6 w-full justify-center",children:[o.jsx("button",{onClick:v,className:`${t&&s?"text-sky-400 border-sky-400/70":"text-theme-text-primary border-theme-sidebar-border"} min-w-[230px] h-11 p-4 rounded-[10px] border-2 justify-center items-center gap-[100px] inline-flex hover:border-sky-400/70 hover:text-sky-400 transition-all duration-300`,children:o.jsx("div",{className:"text-center text-sm font-bold",children:r("common.yes")})}),o.jsx("button",{onClick:f,className:`${!t&&s?"text-sky-400 border-sky-400/70":"text-theme-text-primary border-theme-sidebar-border"} min-w-[230px] h-11 p-4 rounded-[10px] border-2 justify-center items-center gap-[100px] inline-flex hover:border-sky-400/70 hover:text-sky-400 transition-all duration-300`,children:o.jsx("div",{className:"text-center text-sm font-bold",children:r("common.no")})})]}),t&&o.jsxs("form",{className:"w-full mt-4",onSubmit:h,children:[o.jsx("label",{htmlFor:"name",className:"block mb-3 text-sm font-medium text-white",children:r("onboarding.userSetup.instancePassword")}),o.jsx("input",{name:"password",type:"password",className:"border-none bg-theme-settings-input-bg text-white text-sm rounded-lg block w-full p-2.5 focus:outline-primary-button active:outline-primary-button outline-none placeholder:text-theme-text-secondary",placeholder:"Your admin password",minLength:6,required:!0,autoComplete:"off",onChange:p}),o.jsxs("div",{className:"mt-4 text-white text-opacity-80 text-xs font-base -mb-2",children:[r("onboarding.userSetup.passwordReq"),o.jsx("br",{}),o.jsx("i",{children:r("onboarding.userSetup.passwordWarn")})," "]}),o.jsx("button",{type:"submit",ref:a,hidden:!0,"aria-hidden":"true"})]})]})})},nD=({setMultiUserLoginValid:e,myTeamSubmitRef:t,navigate:i})=>{const{t:a}=Qe(),[n,r]=m.useState(""),[s,l]=m.useState(""),d=async v=>{v.preventDefault();const f=v.target,b=new FormData(f),w={username:b.get("username"),password:b.get("password")},{success:y,error:k}=await K.setupMultiUser(w);if(!y){Se(`Error: ${k}`,"error");return}i(G.onboarding.dataHandling());const{user:_,token:x}=await K.requestToken(w);window.localStorage.setItem(at,JSON.stringify(_)),window.localStorage.setItem(Ke,x),window.localStorage.removeItem(Jt)},u=v=>r(v.target.value),h=v=>l(v.target.value),g=fp(u,500),p=fp(h,500);return m.useEffect(()=>{n.trim().length>0&&s.length>0?e(!0):e(!1)},[n,s]),o.jsx("div",{className:"w-full flex items-center justify-center border max-w-[600px] rounded-lg border-white/20 light:border-theme-sidebar-border",children:o.jsxs("form",{onSubmit:d,children:[o.jsx("div",{className:"flex flex-col w-full md:px-8 px-2 py-4",children:o.jsx("div",{className:"space-y-6 flex h-full w-full",children:o.jsxs("div",{className:"w-full flex flex-col gap-y-4",children:[o.jsxs("div",{children:[o.jsx("label",{htmlFor:"name",className:"block mb-3 text-sm font-medium text-white",children:a("onboarding.userSetup.adminUsername")}),o.jsx("input",{name:"username",type:"text",className:"border-none bg-theme-settings-input-bg text-white text-sm rounded-lg block w-full p-2.5 focus:outline-primary-button active:outline-primary-button placeholder:text-theme-text-secondary outline-none",placeholder:"Your admin username",minLength:rh,maxLength:oh,required:!0,autoComplete:"off",onChange:g})]}),o.jsx("p",{className:" text-white text-opacity-80 text-xs font-base",children:a("common.username_requirements")}),o.jsxs("div",{className:"mt-4",children:[o.jsx("label",{htmlFor:"name",className:"block mb-3 text-sm font-medium text-white",children:a("onboarding.userSetup.adminPassword")}),o.jsx("input",{name:"password",type:"password",className:"border-none bg-theme-settings-input-bg text-white text-sm rounded-lg block w-full p-2.5 focus:outline-primary-button active:outline-primary-button placeholder:text-theme-text-secondary outline-none",placeholder:"Your admin password",minLength:8,required:!0,autoComplete:"off",onChange:p})]}),o.jsx("p",{className:" text-white text-opacity-80 text-xs font-base",children:a("onboarding.userSetup.adminPasswordReq")})]})})}),o.jsx("div",{className:"flex w-full justify-between items-center px-6 py-4 space-x-6 border-t rounded-b border-theme-sidebar-border",children:o.jsx("div",{className:"text-theme-text-secondary text-opacity-80 text-xs font-base",children:a("onboarding.userSetup.teamHint")})}),o.jsx("button",{type:"submit",ref:t,hidden:!0,"aria-hidden":"true"})]})})},rD="/zilliz.png",oD="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUoAAAFKCAMAAABM9+Y3AAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAchQTFRFAAAAICAgQEBAPT09FhYWBwcHLi4uGBgYgICA/////f390NDQSUlJAQEBFRUVkZGR7e3tYmJi8fHxVVVVEhISsbGx+fn5h4eHDw8PPj4+2NjYycnJKCgoAgICdXV1+/v73d3dGxsbr6+v8vLyd3d3CQkJNTU1w8PDpqamNzc3DAwMg4OD4eHhKioqf39/6enpZWVluLi4tbW1AwMDZmZm8PDwp6enJCQk5ubm/v7+0dHRxMTE19fX3t7eUlJSJiYmu7u7Pz8/BAQEVlZWpKSkzs7OxsbGTU1NHR0dPDw8U1NTra2t4+PjIiIiHx8fMzMzCwsLERERmpqa+Pj41NTUOzs7hYWF8/Pz1tbWBQUFWFhYysrKHBwcwsLC0tLSFxcXDQ0NqKio9fX129vbMDAwRUVF9vb2qqqqGhoalJSU/Pz8zc3NRkZGZGRkdHR0srKyKysrCAgIrKys4ODgeHh47u7uXV1dXl5eLS0tcXFxmZmZaGhonZ2dy8vLvb29MTEx7OzsJycnqamp9/f3GRkZm5ubjY2NYWFh+vr6s7OzYGBg09PTY2Njtra2ExMT5+fnOTk5NDQ0oaGha2tr1dXVj4+PcHBwBgYGgq1wbwAAA8JJREFUeJzt3PlzE3Ucx+EFAd1yVGitgJSC9YKqFZQKHqAIHnhiBUUQDxCxoIK3eOCJIt7nv6sy4xCGJk32+8k3afs8v2Ym793XJNvOdLtFAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQaXPmJrtsXquj8xek7F3ejg4BriiT9SxctLilzSW9V6bsLW1TilQBKctyWV8rk/1X9SStzeiU5cDVy5teXLEycWxmpyzLa1Y1tze4eih1aqanLNf0NXPBXHtt+tKMT1kOX3f9VGODN9yYdpk8b+anLHtuWtf4g7l+5OaInVmQ8t8L5i2NpgZvDfhIlrMkZTl622DdpXUbgkZmR8qy3Ng/+c7td2yKmpgtKXvG7pzsgrl89eawiemQcstdd1d0T8273Lv10pVt920JKzktUg7dv72iB2pPdcelKztrXn7woUQP56/UlItSPlL1XXZNkbL22/1oyuF2MynDSBlGyjBShpEyjJRhpAwjZRgpw0gZRsowUoaRMoyUYaQMkyflYzUvb3i8gidSzjGTPCmfXFMm2vFUyllmkSdlsfvp8cSWz+xp7c7D/DKlLPr3PpvY8rm+fdVPM4dcKYt9z+9PbDk8cqDyaeaQLWWxeN4LiS2HDr5Y9QBzyJeyKF56+ZXEmIcO17+RpuNypiyKV1NvZTvSu77qMbZd3pTFgp1lotda/n+MXDKnLI6+PpCWcuLY8S79rSh3ymL7G6lf8mVvdueXPHvKolh0KLHlwN7m/x8jow6kLI6+lXpf2/4TVY+0jTqRsjg5d2kFb9dsvHO86qG2T0dSVvNuzcZ777dpJIGUYaQMI2UYKcNIGUbKMFKGkTKMlGGkDCNlGCnDSBlGyjBShpEyTG3KiQ8+rOij2pSnJh36+JNUn16Y6PnsdOZOTbjogQ+bPq9o+MJ7jI99MenQl2Wcr059nTlTM6KfnVF+U+cvq4Eph87UedZJZwWnHP623lBcys0rcgZqXmzKjfWfaxGV8ruxbr2dLTLl+NkGjwsMSnmkt1sfqhqZcvT73Q2GYlKe+2F+tjStCnxS4J6GQyEpF67t0luv/hOW8uzhxkMBKcd//ClPlGqCUo6PnJxiKD3lz1u7+JbfIirl6K4pv3jJKVf+kqNHgpCUx36deigx5cRvc7r4Mnne738kO/hnM7+fnEnaOPdX9/7k/t+SE8m2/d3M0IGkjVXd/pEEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgOnjH+nZZsJlWX+1AAAAAElFTkSuQmCC",iv="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUoAAAFKCAMAAABM9+Y3AAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAATVQTFRF////8vf/2Of/ss//pcb/mL7/i7b/f67/y9///+vo/9jR/8W5/7ut/7Gi/56L/6aJ/+p8/+yJ/+6W//Cj//W9//fL//3y5e//ZZ7/P4b/Mn7/WJb/cqb//+Ld/4Fp/2RG/3ND/94t/+A6/+Zi//vlTI7/ss7///X0/4t0/25R/+JH/5V/i5nc//3xv9f/P330pm+X//KwZXjR5WddTHvo2WlpWHnc/+hvf3S6mXGj2ef///nXjHOuf3S5sm6LzGt0WZb/pW+X//nY2GlpcnbFWHnd/+RVi3OumHGiv9b//3tB/4JA/5I9/6E6/6k4/78z/8cy/5k7/7g1/88w/+JIzN///7A2/++W//GjjLb/psf//6E5/+A7mb///9cv/4p0/9Bm//Ow/5SA/7uu/4Bp/+Lc8p+XBNvEXwAABhNJREFUeJzt3XtbG0UYhnFSIKGUYsLBAKJ0ObQSFbViUTygqFXrsQpWK4qI+v0/goTQFpLsZt6H7i7v7v37P9cF9zU7szPZJENDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACUR+Xa8MhotdY2Ojo8di3sVdfHb0zcnJx8oV5vTE3PzL6Y7t949TWHq3PzC91eWhwZS3rVyxOTryyduRWdWV5pzKxm9XdfMZWx6lpPxafmF283+73qzsSr60vnPE15qlWfyfrfyN9YrXc0dpvrrnnScanLxZTt0Vmfzec/ykdldHDHjtq5K338tfXukH1StsfmdFmu9GY1NGRnaHZeNd4zIGNTnqiXIWazZuh4au12bMjYlCWIGX5pn/d6XMiElFE09Ube/22aNhLW7FhvvhUbMjFl1Ho77/83NZVFIeTC3XcSSiamLO5VPqYMyYWkITkwZdQq5H3mqBJy893kkoNSnsyYef/fz11lTil5L/HiDkoZbRVs9WlKF/d7g0KGpIxahZowtZLvDy4ZkrJQLbeVm8mgkkEpo+UP8i7wvKRYMixlYVqmd3UHp4yWC3GNayU/DCsZmrIQ82VFKnk3sGRwyqjl/55I2ixuDryfNKeMtvIucVnSHmchuKQhZTSdd4vL2ZZKDth3iykj1+9UaBPlR+ElTSldT5fmE/O28InSmDJq5N1DN6aUXPjYUNKW0vElLl3e9ywljSlbeRdRjUiD0nJ5W1N6Pb3UtjmWNceectnnypP2LaWS0uewbEoljYPSnNLlsMxkUJpTuhyWWcyUQkqHw3JYGpQ7qad0uBX/RCm5aS0ppFzJu4yVtuiYNjpiSndbnqqU0rroSCm9LTzpnp1fKqWz3eO2NCg/zSRltJt3HRNt+/1ZNil9reHSE0L29VtL6WsNlx4i+DyjlMt517HQznyFqVJK6Wqy1KbKnaxSepostbtKoaSWsp53HwNp1fkis5T38+5jIK06wg26mNLRulNRSi58mVnKyM9B27aU8qvsUvp5rC2D978vl9LP4dDXUsqd7FL6+ZhZRifopCSlgfZmo3AupKb0s93J4gmXMw+klH4O0rULXEr5jZTSzwVOyufmyqf089Fm7RZdSvmtlNLPLbr2JriU8jsppZ+zX+04Q0r5vZTSz3GGdsgmpfxBKenokE17YEhK+aOS0tNbjtKHTKSUSklXHzqRtjtKSu1eyM++UTz7VVI+lFL6uRca0tYdJeVPSklPq472lqOS8mclpadVR5sshZTauZCnqVKbLIWU2lTpZ69zSnhUVUgp3aDv5d3GSDhIz+Tp6cjXXWXbfhYptWMhP2+Cn7Gv4faU0vrt6YGhDvsabk5Z9BP0Jyrmu3Rzyl+Ukt4WnTbzwpP6J0VPPcq7i8A8LK0ppUHpb9Fpsw7LlD9U73dQ2oelMaU2U7oclOZhmer3j5z5Ne8mKtvu0ZZSeifC4/LdYdvymFIW/f3vHr+llfKWtNHx9CGTbqavt7Ok1NYc1z9gZrnEDSlLcU7Z7XEaKct0S3lO+BfUhn8prTRRuv+CWsN0GZxSOzt3PVF2BH/LXWhK6Ykrr9uci5qBG8jAlL+Xt2TwDx+EpZRKHjhfvJ8JaxmUsuQlA+fLkJSlvro7QloGpCzVwVqcgF/LG/zjWdpzqQW4C+ryx2VTPpDuzN3vcfoZ9HuYA1JK++49x8dqSQb83G3yT19KW5yt4l3cTwwnDcyklA//VIaknw+NCSoJM2Z8ysO/hJAHj4o7JDvir/K4lIfjQ0NHe9aSRf252wviYvZP2Q7ZdrRiGZGNMoRsaz7uN2f2Sbn+9/izV83WubT72a/17Mt7Uh4e37n4otWAoXlQL+j9T5KN2lp8yvWejh2rR1sH8R1bjdlSDchzmhvVufmelP9MHv+b9KrZ6a37vaNxpXFUlgkyVmV/Y2S0Wqv9Nzl58/jG+PWwV+3OHk1N1dsaU9NHu2UdjAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAcvofjSLbR/4YdaIAAAAASUVORK5CYII=",sD="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALIAAACyCAMAAADRVGVaAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAIRQTFRF////4+Pjc3JyIB0e8fHxenl5LSssq6qrOjc4x8fHV1VWnZydj46OOzk61dXVSUdIZWNkgYCAJiQly8rLTUtLubm5mpmZLCkqNjQ0WVdYJyQlNDIzPDo7v76+VFJSKicoQkBBjoyNiIeHKygpysnKqKenLiwtODU2Ih8gXlxdaWdopqWlbIoJFwAAB2RJREFUeJztXGm3pDQQbUIECfsoOo7LqOPu//9/siSVygq8IYRzzP3Urx/dXELVrSVFv14JCQkJCQkJCQkJCQkJCQkJCQkJCQlnkZE8J1lsFidAv8gXFDQ2kcMoi3zDl7GZHETFcgCJTeYIKMkx6th89tEUuYoqNqMdVG2uo+hik/IhYwbhGf1zZYM2NsIzhtjMXCh1I5YYY3OzY1RIvlM5l7HZWdEhhuwrfZ2f6YIgx231qoRFgGw80gXpZstFM7/mjli8hmfLxsqTrNQ4U/aiveD8zMjd5oyHuh6UIgMdeUjkptWCsmnWvyoQBiQU0i2jJc+0Hr5uGdPinHqMoLmuecnteorBdoE0Tg/lUnl3lZI2nsyNVsYaZS4YLf9zviMsomDYF1mjzK1G5Ba0jSoXdsaaa3GVaMTfUTW5c1BW8njK34zmcApKG9+CMcW5RLjWVK0lUVwQp8T9LMnWg0Qaqr67XEgfIaVT5NjtVLRqSM/U97a0qRjvjihqadfsfwCQwafYrTZOcxUn7jM2qba5T0MqjfKJil8rvcldvYJanBDE4qgImOrYfnPLUvNw3Us3PFxu0MZocXxLbiDNhFTI7OhEuTENOuk+IFcOfqYGyqZ8KT2OIxu1zkFw8RBCtbhOByc/l/OUSmJ1RibfBCUSg3qcbLqV7xHl4NUVFM7buV2MaeWOcJWavQaXOiicN6xX0OuM6SIrjpTe6DMGlwxZOG8gFsEo3zmFJCMaYahbwsEwQKYrq9xz+E7/MDWa5efU5m2oCfMaoLLnoImBtTEaXDBWZJPzPLXKCudMmRr6esshEWDsOShSgv/ZlkIgQ5cpXkHKjGA8U0OGLnPApc8o0qvAjEef5VlcK1dTCOGXI32h9CooiMf0JnMfagOK5dsy811trdERBHQ7iTWLse9DbUABeb5m0Rg1Gh0hGHMXt6YTik3o3SR5kVkLr3F6FQgyayss2UMtCbYTT0M+wAdsF+lodARhbE/oxcoWcxXKgwmTOyeWT4jSNRhj1CGyZzt80YbshdIQsBBLUCbO/1zO2JXML5rcbobJj6xftHV/Sk+vLgZKG5ynyIqCSwPq30tzMrQRrisEcKLjSQgmYTATP5ai16YBzHnK0AcSDLTNcGyvQ+nf135zqkLk99n3kvGxDIYp60p2bs71QOL2w4/HPsJ9ToS1Pi/uHXpRAzEjjacM5dDMng6eT9AAhpGbKNhYe2zwTB5chtj0sVC2K4CkwY/Y/+61ILg+YLsyNPfqHM2DeVV7ffJpdJNz1blM1Kw4QgU669f75k92yv6KqmrIrq6JPdrrswzY3/ioUP58E4S+6fWdT7EaPa3qEUz7gi8W6ef17SJYje1WLzedXXI3tS++ErAaSIsvkSYhh9fPSUHWe3llGeyLw63GFGyZoSC6pIRgQzMJuxLefH3YhnhywIQzwpjPn7hoLnnKuS8+CbEau9GVVzCeVcPhtB1+PvrFpwHxZCe6QpfrF+chjmnh68O2KP+8eoy7XE4Klu7ouuCXU6b7HTSqDHY5iy7HLFWAsL0Nc3q8RN9UcG0SOxgHsOY5njBPnVGZebXDhsqRWfvQAdpGjhmiFdTYGVvvifv4ZYbn8NEhUDsm8HfSna789ZM8+M7JLstjJAI7ytXJlf5wZ9/AIVor/L0a1CL59FsIaiVrmqY2uxg4NLDfNc6+2ZJyp2P9+eCqawiznCMpSuAPd9wtXaj/OwTaeOcqZiq+OPcyRCb63PI6XMkf0phgWsGcHrX+h60WA31uT2N5AVbFcBMkBmWw6m7Z0tleShbyvltcEI+ZB2yKtiplOkgujRgsxPP34JaF+V3SZYM+VcfPwf+qClsLC/fvhbXaOrWwymGn8zFlnrQZ6qH07zdexgwP5hz4cR5EuRPxTl9Ade5oeQLGpV+rewYeRKzkAkpL1Lcgtf5956lvZ86hE6FKLGCGUzBtmXUR8BWhZfD9E0EZZ22681T2C4kFLgZ/oCUejVkzVVUcyO4atTYKY4t48WMs/fsJ7RgOed/ckhzrlK1SsO2YGqnQHHZQD2uzqRt+0EGlXPh8R7+YrQYQF6KEm6BQMnl2ZolEr4BfZeihBok/EeNzuZegzIdl2rd8x5uAd3n68Yz7QEKxLqzInG5wQK1PUZDysDHCgw7oueHw47RKFQEWXR80aXDdLviwC0Zm7VUcTBOEafT3PlOXkfcm5YN5AlzvKAbhw3KV6Gq9K3VU7GCMjnvxnT89QcsBWcjxEVMh63+dujuXoRpFio+dqCLztbSuJ/mo6goRniDP6oErgAAEDMcCTpjxDc8Y2UAngsQVdfCxGOTrQ61sbJrmb0T5nvF7P/A2E953NDUm1+5ONCiBRpqG4/Hn2yTOB8W5pII5Rmb+icgUoDCSeaWD8r8RmQIclCc75Uf8foqy9yATD/tO6jN+PkXZpVRTnq6qplnjCPwCyB0Pqx5AdjSKZ0FGad8E2U5+9o+aYUx8ne2dzmdizvEYI8/4OYyEhISEhISEhISEhISEhISEhISE/y/+A/2yTM1YBjAvAAAAAElFTkSuQmCC",lD="/lancedb.png",cD="/weaviate.png",dD="/qdrant.png",uD="/milvus.png",pD="/voyageai.png",mD="/pgvector.png",hD={openai:{name:"OpenAI",policyUrl:"https://openai.com/policies/privacy-policy/",logo:wc},azure:{name:"Azure OpenAI",policyUrl:"https://privacy.microsoft.com/privacystatement",logo:xc},anthropic:{name:"Anthropic",policyUrl:"https://www.anthropic.com/privacy",logo:Tm},gemini:{name:"Google Gemini",policyUrl:"https://policies.google.com/privacy",logo:zc},"nvidia-nim":{name:"NVIDIA NIM",description:["Your model and chats are only accessible on the machine running the NVIDIA NIM."],logo:Wm},lmstudio:{name:"LMStudio",description:["Your model and chats are only accessible on the server running LMStudio."],logo:jc},localai:{name:"LocalAI",description:["Your model and chats are only accessible on the server running LocalAI."],logo:Lc},ollama:{name:"Ollama",description:["Your model and chats are only accessible on the machine running Ollama models."],logo:Ac},togetherai:{name:"TogetherAI",policyUrl:"https://www.together.ai/privacy",logo:Nm},fireworksai:{name:"FireworksAI",policyUrl:"https://fireworks.ai/privacy-policy",logo:Dm},mistral:{name:"Mistral",policyUrl:"https://legal.mistral.ai/terms/privacy-policy",logo:Sc},huggingface:{name:"HuggingFace",policyUrl:"https://huggingface.co/privacy",logo:Om},perplexity:{name:"Perplexity AI",policyUrl:"https://www.perplexity.ai/privacy",logo:Rm},openrouter:{name:"OpenRouter",policyUrl:"https://openrouter.ai/privacy",logo:Mc},novita:{name:"Novita AI",policyUrl:"https://novita.ai/legal/privacy-policy",logo:Im},groq:{name:"Groq",policyUrl:"https://groq.com/privacy-policy/",logo:Hm},koboldcpp:{name:"KoboldCPP",description:["Your model and chats are only accessible on the server running KoboldCPP"],logo:Vm},textgenwebui:{name:"Oobabooga Web UI",description:["Your model and chats are only accessible on the server running the Oobabooga Text Generation Web UI"],logo:qm},"generic-openai":{name:"Generic OpenAI compatible service",description:["Data is shared according to the terms of service applicable with your generic endpoint provider."],logo:_c},cohere:{name:"Cohere",policyUrl:"https://cohere.com/privacy",logo:Pc},litellm:{name:"LiteLLM",description:["Your model and chats are only accessible on the server running LiteLLM"],logo:Cc},bedrock:{name:"AWS Bedrock",policyUrl:"https://aws.amazon.com/bedrock/security-compliance/",logo:Fm},deepseek:{name:"DeepSeek",policyUrl:"https://cdn.deepseek.com/policies/en-US/deepseek-privacy-policy.html",logo:Um},apipie:{name:"APIpie.AI",policyUrl:"https://apipie.ai/docs/Terms/privacy",logo:Bm},xai:{name:"xAI",policyUrl:"https://x.ai/legal/privacy-policy",logo:Gm},zai:{name:"Z.AI",policyUrl:"https://docs.z.ai/legal-agreement/privacy-policy",logo:Km},ppio:{name:"PPIO",policyUrl:"https://www.pipio.ai/privacy-policy",logo:$m},dpais:{name:"Dell Pro AI Studio",description:["Your model and chat contents are only accessible on the computer running Dell Pro AI Studio."],logo:Zm},moonshotai:{name:"Moonshot AI",policyUrl:"https://platform.moonshot.ai/docs/agreement/userprivacy",logo:Jm},cometapi:{name:"CometAPI",policyUrl:"https://apidoc.cometapi.com/privacy-policy-873819m0",logo:Qm},foundry:{name:"Microsoft Foundry Local",description:["Your model and chats are only accessible on the machine running Foundry Local."],logo:Uw},giteeai:{name:"GiteeAI",policyUrl:"https://ai.gitee.com/docs/appendix/privacy",logo:Ym},"docker-model-runner":{name:"Docker Model Runner",description:["Your model and chats are only accessible on the machine running Docker Model Runner."],logo:Xm},privatemode:{name:"Privatemode",policyUrl:"https://docs.privatemode.ai/getting-started/faq#q2",logo:eh},sambanova:{name:"SambaNova",policyUrl:"https://sambanova.ai/privacy-policy",logo:th},lemonade:{name:"Lemonade",description:["Your model and chats are only accessible on the machine running the Lemonade server."],logo:Ec},minimax:{name:"Minimax",policyUrl:"https://platform.minimax.io/protocol/privacy-policy",logo:ih},cerebras:{name:"Cerebras",policyUrl:"https://www.cerebras.ai/privacy-policy",logo:ah}},gD={pgvector:{name:"PGVector",description:["Your vectors and document text are stored on your PostgreSQL instance.","Access to your instance is managed by you."],logo:mD},chroma:{name:"Chroma",description:["Your vectors and document text are stored on your Chroma instance.","Access to your instance is managed by you."],logo:iv},chromacloud:{name:"Chroma Cloud",policyUrl:"https://www.trychroma.com/privacy",logo:iv},pinecone:{name:"Pinecone",policyUrl:"https://www.pinecone.io/privacy/",logo:sD},qdrant:{name:"Qdrant",policyUrl:"https://qdrant.tech/legal/privacy-policy/",logo:dD},weaviate:{name:"Weaviate",policyUrl:"https://weaviate.io/privacy",logo:cD},milvus:{name:"Milvus",description:["Your vectors and document text are stored on your Milvus instance (cloud or self-hosted)."],logo:uD},zilliz:{name:"Zilliz Cloud",policyUrl:"https://zilliz.com/privacy-policy",logo:rD},astra:{name:"AstraDB",policyUrl:"https://www.ibm.com/us-en/privacy",logo:oD},lancedb:{name:"LanceDB",description:["Your vectors and document text are stored privately on this instance of AnythingLLM."],logo:lD}},fD={native:{name:"AnythingLLM Embedder",description:["Your document text is embedded privately on this instance of AnythingLLM."],logo:yc},openai:{name:"OpenAI",policyUrl:"https://openai.com/policies/privacy-policy/",logo:wc},azure:{name:"Azure OpenAI",policyUrl:"https://privacy.microsoft.com/privacystatement",logo:xc},localai:{name:"LocalAI",description:["Your document text is embedded privately on the server running LocalAI."],logo:Lc},ollama:{name:"Ollama",description:["Your document text is embedded privately on the server running Ollama."],logo:Ac},lmstudio:{name:"LMStudio",description:["Your document text is embedded privately on the server running LMStudio."],logo:jc},openrouter:{name:"OpenRouter",policyUrl:"https://openrouter.ai/privacy",logo:Mc},cohere:{name:"Cohere",policyUrl:"https://cohere.com/privacy",logo:Pc},voyageai:{name:"Voyage AI",policyUrl:"https://www.voyageai.com/privacy",logo:pD},mistral:{name:"Mistral AI",policyUrl:"https://legal.mistral.ai/terms/privacy-policy",logo:Sc},litellm:{name:"LiteLLM",description:["Your document text is only accessible on the server running LiteLLM and to the providers you configured in LiteLLM."],logo:Cc},"generic-openai":{name:"Generic OpenAI compatible service",description:["Data is shared according to the terms of service applicable with your generic endpoint provider."],logo:_c},gemini:{name:"Google Gemini",policyUrl:"https://policies.google.com/privacy",logo:zc},lemonade:{name:"Lemonade",description:["Your document text is embedded privately on the machine running the Lemonade server."],logo:Ec}},Fd={llm:hD,embeddingEngine:fD,vectorDb:gD};function Ud(e){return{name:e?_2(S7(String(e))):"Unknown",description:[`"${e}" has no known data handling policy defined in AnythingLLM.`],logo:yc}}function bD(){const[e,t]=m.useState(!0),[i,a]=m.useState({llmProvider:null,embeddingEngine:null,vectorDb:null});return m.useEffect(()=>{async function n(){const r=await K.keys(),s=Fd.llm[r==null?void 0:r.LLMProvider]||Ud(r==null?void 0:r.LLMProvider),l=Fd.embeddingEngine[r==null?void 0:r.EmbeddingEngine]||Ud(r==null?void 0:r.EmbeddingEngine),d=Fd.vectorDb[r==null?void 0:r.VectorDB]||Ud(r==null?void 0:r.VectorDB);a({llmProvider:s,embeddingEngine:l,vectorDb:d}),t(!1)}n()},[]),e?null:o.jsxs("div",{className:"flex flex-col gap-8 w-full max-w-2xl",children:[o.jsx(Bd,{title:"LLM Provider",provider:i.llmProvider,altText:"LLM Logo"}),o.jsx(Bd,{title:"Embedding Preference",provider:i.embeddingEngine,altText:"Embedding Logo"}),o.jsx(Bd,{title:"Vector Database",provider:i.vectorDb,altText:"Vector DB Logo"})]})}function Bd({title:e,provider:t,altText:i}){return o.jsxs("div",{className:"flex flex-col items-start gap-y-3 pb-4 border-b border-theme-sidebar-border",children:[o.jsx("div",{className:"text-theme-text-primary text-base font-bold",children:e}),o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx("img",{src:t.logo,alt:i,className:"w-8 h-8 rounded flex-shrink-0 mt-0.5"}),o.jsxs("div",{className:"flex flex-col gap-2 flex-1",children:[o.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:o.jsx("span",{className:"text-theme-text-primary text-sm font-semibold",children:t.name})}),t.policyUrl?o.jsxs("div",{className:"text-theme-text-secondary text-sm",children:["Your usage, chats, and data are subject to the service's"," ",o.jsxs(Vt,{className:"text-theme-text-secondary hover:text-theme-text-primary text-sm font-medium underline transition-colors inline-flex items-center gap-1",to:t.policyUrl,target:"_blank",rel:"noopener noreferrer",children:["privacy policy",o.jsx(km,{size:12})]}),"."]}):t.description&&o.jsx("ul",{className:"flex flex-col list-none gap-1",children:t.description.map((a,n)=>o.jsx("li",{className:"text-theme-text-secondary text-sm",children:a},n))})]})]})]})}function vD({setHeader:e,setForwardBtn:t,setBackBtn:i}){const{t:a}=Qe(),n=ia(),r=a("onboarding.data.title"),s=a("onboarding.data.description");m.useEffect(()=>{e({title:r,description:s}),t({showing:!0,disabled:!1,onClick:l}),i({showing:!1,disabled:!1,onClick:d})},[]);function l(){n(G.onboarding.survey())}function d(){n(G.onboarding.userSetup())}return o.jsxs("div",{className:"w-full flex items-center justify-center flex-col gap-y-6",children:[o.jsx(bD,{}),o.jsx("p",{className:"text-theme-text-secondary text-sm font-medium py-1",children:a("onboarding.data.settingsHint")})]})}async function kD({email:e,useCase:t,comment:i}){const a=JSON.stringify({email:e,useCase:t,comment:i,sourceId:"0VRjqHh6Vukqi0x0Vd0n/m8JuT7k8nOz"});if(!navigator.sendBeacon)return console.log("navigator.sendBeacon not supported, falling back to fetch"),fetch(Gg,{method:"POST",body:a}).then(()=>{window.localStorage.setItem(Ll,!0),console.log("✅ Questionnaire responses sent.")}).catch(n=>{console.error("sendQuestionnaire",n.message)});navigator.sendBeacon(Gg,a),window.localStorage.setItem(Ll,!0),console.log("✅ Questionnaire responses sent.")}function yD({setHeader:e,setForwardBtn:t,setBackBtn:i}){var b;const{t:a}=Qe(),[n,r]=m.useState(""),s=m.useRef(null),l=ia(),d=m.useRef(null),u=a("onboarding.survey.title"),h=a("onboarding.survey.description");function g(){var y;if((y=window==null?void 0:window.localStorage)!=null&&y.getItem(Ll)){l(G.home());return}if(!s.current){p();return}const w=new FormData(s.current);if(w.get("email")||w.get("use_case")||w.get("comment")){s.current.requestSubmit();return}p()}function p(){l(G.home())}function v(){l(G.onboarding.dataHandling())}m.useEffect(()=>{e({title:u,description:h}),t({showing:!0,disabled:!1,onClick:g}),i({showing:!0,disabled:!1,onClick:v})},[]),m.useEffect(()=>{async function w(){(await Pn.all()).length===0&&await Pn.new({name:a("new-workspace.placeholder"),onboardingComplete:!0})}w()},[]);const f=async w=>{w.preventDefault();const y=w.target,k=new FormData(y);await kD({email:k.get("email"),useCase:k.get("use_case")||"other",comment:k.get("comment")||null}),l(G.home())};return(b=window==null?void 0:window.localStorage)!=null&&b.getItem(Ll)?o.jsx("div",{className:"w-full flex justify-center items-center py-40",children:o.jsx("div",{className:"w-full flex items-center justify-center px-1 md:px-8 py-4",children:o.jsxs("div",{className:"w-auto flex flex-col gap-y-1 items-center",children:[o.jsx(ty,{size:60,className:"text-green-500"}),o.jsx("p",{className:"text-white text-lg",children:a("onboarding.survey.thankYou")}),o.jsx("a",{href:G.mailToMintplex(),className:"text-sky-400 underline text-xs",children:"team@mintplexlabs.com"})]})})}):o.jsx("div",{className:"w-full flex justify-center bo",children:o.jsxs("form",{onSubmit:f,ref:s,className:"",children:[o.jsxs("div",{className:"md:min-w-[400px]",children:[o.jsxs("label",{htmlFor:"email",className:"text-theme-text-primary text-base font-medium",children:[a("onboarding.survey.email")," "]}),o.jsx("input",{name:"email",type:"email",placeholder:"you@gmail.com",required:!0,className:"mt-2 bg-theme-settings-input-bg text-white focus:outline-primary-button active:outline-primary-button placeholder:text-theme-settings-input-placeholder outline-none text-sm font-medium font-['Plus Jakarta Sans'] leading-tight w-full h-11 p-2.5 bg-theme-settings-input-bg rounded-lg"})]}),o.jsxs("div",{className:"mt-8",children:[o.jsxs("label",{className:"text-theme-text-primary text-base font-medium",htmlFor:"use_case",children:[a("onboarding.survey.useCase")," "]}),o.jsxs("div",{className:"mt-2 gap-y-3 flex flex-col",children:[o.jsxs("label",{className:`border-solid transition-all duration-300 w-full h-11 p-2.5 rounded-lg flex justify-start items-center gap-2.5 cursor-pointer border ${n==="job"?"border-theme-sidebar-item-workspace-active bg-theme-bg-secondary":"border-theme-sidebar-border"} hover:border-theme-sidebar-border hover:bg-theme-bg-secondary`,children:[o.jsx("input",{type:"radio",name:"use_case",value:"job",checked:n==="job",onChange:w=>r(w.target.value),className:"hidden"}),o.jsx("div",{className:`w-4 h-4 rounded-full border-2 border-theme-sidebar-border mr-2 ${n==="job"?"bg-[var(--theme-sidebar-item-workspace-active)]":""}`}),o.jsx("div",{className:"text-theme-text-primary text-sm font-medium font-['Plus Jakarta Sans'] leading-tight",children:a("onboarding.survey.useCaseWork")})]}),o.jsxs("label",{className:`border-solid transition-all duration-300 w-full h-11 p-2.5 rounded-lg flex justify-start items-center gap-2.5 cursor-pointer border-[1px] ${n==="personal"?"border-theme-sidebar-item-workspace-active bg-theme-bg-secondary":"border-theme-sidebar-border"} hover:border-theme-sidebar-border hover:bg-theme-bg-secondary`,children:[o.jsx("input",{type:"radio",name:"use_case",value:"personal",checked:n==="personal",onChange:w=>r(w.target.value),className:"hidden"}),o.jsx("div",{className:`w-4 h-4 rounded-full border-2 border-theme-sidebar-border mr-2 ${n==="personal"?"bg-[var(--theme-sidebar-item-workspace-active)]":""}`}),o.jsx("div",{className:"text-theme-text-primary text-sm font-medium font-['Plus Jakarta Sans'] leading-tight",children:a("onboarding.survey.useCasePersonal")})]}),o.jsxs("label",{className:`border-solid transition-all duration-300 w-full h-11 p-2.5 rounded-lg flex justify-start items-center gap-2.5 cursor-pointer border-[1px] ${n==="other"?"border-theme-sidebar-item-workspace-active bg-theme-bg-secondary":"border-theme-sidebar-border"} hover:border-theme-sidebar-border hover:bg-theme-bg-secondary`,children:[o.jsx("input",{type:"radio",name:"use_case",value:"other",checked:n==="other",onChange:w=>r(w.target.value),className:"hidden"}),o.jsx("div",{className:`w-4 h-4 rounded-full border-2 border-theme-sidebar-border mr-2 ${n==="other"?"bg-[var(--theme-sidebar-item-workspace-active)]":""}`}),o.jsx("div",{className:"text-theme-text-primary text-sm font-medium font-['Plus Jakarta Sans'] leading-tight",children:a("onboarding.survey.useCaseOther")})]})]})]}),o.jsxs("div",{className:"mt-8",children:[o.jsxs("label",{htmlFor:"comment",className:"text-white text-base font-medium",children:[a("onboarding.survey.comment")," ",o.jsxs("span",{className:"text-neutral-400 text-base font-light",children:["(",a("common.optional"),")"]})]}),o.jsx("textarea",{name:"comment",rows:5,className:"mt-2 bg-theme-settings-input-bg text-white text-sm rounded-lg focus:outline-primary-button active:outline-primary-button placeholder:text-theme-settings-input-placeholder outline-none block w-full p-2.5",placeholder:a("onboarding.survey.commentPlaceholder"),wrap:"soft",autoComplete:"off"})]}),o.jsx("button",{type:"submit",ref:d,hidden:!0,"aria-hidden":"true"}),o.jsx("div",{className:"w-full flex items-center justify-center",children:o.jsx("button",{type:"button",onClick:p,className:"text-white text-base font-medium text-opacity-30 hover:text-opacity-100 hover:text-teal mt-8",children:a("onboarding.survey.skip")})})]})})}const wD={home:EN,"llm-preference":TN,"user-setup":iD,"data-handling":vD,survey:yD};function _D({children:e}){i_();const[t,i]=m.useState({title:"",description:""}),[a,n]=m.useState({showing:!1,disabled:!0,onClick:()=>null}),[r,s]=m.useState({showing:!1,disabled:!0,onClick:()=>null});return Mn?o.jsx("div",{"data-layout":"onboarding",className:"w-screen h-screen overflow-y-auto bg-theme-bg-primary overflow-hidden",children:o.jsxs("div",{className:"flex flex-col",children:[o.jsxs("div",{className:"w-full relative py-10 px-2",children:[o.jsxs("div",{className:"flex flex-col w-fit mx-auto gap-y-1 mb-[55px]",children:[o.jsx("h1",{className:"text-theme-text-primary font-semibold text-center text-2xl",children:t.title}),o.jsx("p",{className:"text-theme-text-secondary text-base text-center",children:t.description})]}),e(i,n,s)]}),o.jsxs("div",{className:"flex w-full justify-center gap-x-4 pb-20",children:[o.jsx("div",{className:"flex justify-center items-center",children:a.showing&&o.jsx("button",{disabled:a.disabled,onClick:a.onClick,className:"group p-2 rounded-lg border-2 border-zinc-300 disabled:border-zinc-600 h-fit w-fit disabled:not-allowed hover:bg-zinc-100 disabled:hover:bg-transparent",children:o.jsx(Zu,{className:"text-white group-hover:text-black group-disabled:text-gray-500",size:30})})}),o.jsx("div",{className:"flex justify-center items-center",children:r.showing&&o.jsx("button",{disabled:r.disabled,onClick:r.onClick,className:"group p-2 rounded-lg border-2 border-zinc-300 disabled:border-zinc-600 h-fit w-fit disabled:not-allowed hover:bg-teal disabled:hover:bg-transparent",children:o.jsx(Ju,{className:"text-white group-hover:text-teal group-disabled:text-gray-500",size:30})})})]})]})}):o.jsxs("div",{"data-layout":"onboarding",className:"w-screen overflow-y-auto bg-theme-bg-primary flex justify-center overflow-hidden",children:[o.jsx("div",{className:"flex w-1/5 h-screen justify-center items-center",children:a.showing&&o.jsx("button",{disabled:a.disabled,onClick:a.onClick,className:"group p-2 rounded-lg border-2 border-theme-sidebar-border h-fit w-fit disabled:cursor-not-allowed hover:bg-theme-bg-secondary disabled:hover:bg-transparent","aria-label":"Back",children:o.jsx(Zu,{className:"text-theme-text-secondary group-hover:text-theme-text-primary group-disabled:text-gray-500",size:30})})}),o.jsxs("div",{className:"w-full md:w-3/5 relative h-full py-10",children:[o.jsxs("div",{className:"flex flex-col w-fit mx-auto gap-y-1 mb-[55px]",children:[o.jsx("h1",{className:"text-theme-text-primary font-semibold text-center text-2xl",children:t.title}),o.jsx("p",{className:"text-theme-text-secondary text-base text-center",children:t.description})]}),e(i,n,s)]}),o.jsx("div",{className:"flex w-1/5 h-screen justify-center items-center",children:r.showing&&o.jsx("button",{disabled:r.disabled,onClick:r.onClick,className:"group p-2 rounded-lg border-2 border-theme-sidebar-border h-fit w-fit disabled:cursor-not-allowed hover:bg-teal disabled:hover:bg-transparent","aria-label":"Continue",children:o.jsx(Ju,{className:"text-theme-text-secondary group-hover:text-white group-disabled:text-gray-500",size:30})})})]})}function av(){const{step:e}=fm(),t=wD[e||"home"];return e==="home"||!e?o.jsx(t,{}):o.jsx(_D,{children:(i,a,n)=>o.jsx(t,{setHeader:i,setBackBtn:a,setForwardBtn:n})})}const xD=c.StrictMode,zD=typeof{communityHub:{label:"Community Hub",tier:"L2",enabled:!1,allowlist:null},modelRouter:{label:"Model Router",tier:"L2",enabled:!1,allowlist:null},llmProviders:{label:"LLM Provider Allowlist",tier:"L1",enabled:!0,allowlist:["ollama","openrouter"]},brandingWhitelabel:{label:"Branding & Whitelabeling",tier:"L2",enabled:!1,allowlist:null},filesystemAgent:{label:"File System Access",tier:"L2",enabled:!0,allowlist:null},documentationLink:{label:"Documentation Link",tier:"L2",enabled:!1,allowlist:null},multiUser:{label:"Multi-User Mode",tier:"L2",enabled:!1,allowlist:null},browserExtension:{label:"Browser Extension",tier:"L2",enabled:!1,allowlist:null},chatEmbed:{label:"Chat Embed",tier:"L2",enabled:!1,allowlist:null},scheduledJobs:{label:"Scheduled Jobs",tier:"L2",enabled:!1,allowlist:null},developerApi:{label:"Developer API",tier:"L2",enabled:!1,allowlist:null},mobile:{label:"Totem LLM Mobile",tier:"L2",enabled:!1,allowlist:null},agentMode:{label:"Agent Mode",tier:"L2",enabled:!1,allowlist:null},memories:{label:"Memories Feature",tier:"L2",enabled:!1,allowlist:null},vectorDB:{label:"Vector Database Integrations",tier:"L2",enabled:!1,allowlist:null},embedder:{label:"Embedder Integrations",tier:"L2",enabled:!1,allowlist:null},textSplitter:{label:"Text Splitter Integrations",tier:"L2",enabled:!1,allowlist:null},transcription:{label:"Audio Transcription",tier:"L2",enabled:!1,allowlist:null}}<"u"?{communityHub:{label:"Community Hub",tier:"L2",enabled:!1,allowlist:null},modelRouter:{label:"Model Router",tier:"L2",enabled:!1,allowlist:null},llmProviders:{label:"LLM Provider Allowlist",tier:"L1",enabled:!0,allowlist:["ollama","openrouter"]},brandingWhitelabel:{label:"Branding & Whitelabeling",tier:"L2",enabled:!1,allowlist:null},filesystemAgent:{label:"File System Access",tier:"L2",enabled:!0,allowlist:null},documentationLink:{label:"Documentation Link",tier:"L2",enabled:!1,allowlist:null},multiUser:{label:"Multi-User Mode",tier:"L2",enabled:!1,allowlist:null},browserExtension:{label:"Browser Extension",tier:"L2",enabled:!1,allowlist:null},chatEmbed:{label:"Chat Embed",tier:"L2",enabled:!1,allowlist:null},scheduledJobs:{label:"Scheduled Jobs",tier:"L2",enabled:!1,allowlist:null},developerApi:{label:"Developer API",tier:"L2",enabled:!1,allowlist:null},mobile:{label:"Totem LLM Mobile",tier:"L2",enabled:!1,allowlist:null},agentMode:{label:"Agent Mode",tier:"L2",enabled:!1,allowlist:null},memories:{label:"Memories Feature",tier:"L2",enabled:!1,allowlist:null},vectorDB:{label:"Vector Database Integrations",tier:"L2",enabled:!1,allowlist:null},embedder:{label:"Embedder Integrations",tier:"L2",enabled:!1,allowlist:null},textSplitter:{label:"Text Splitter Integrations",tier:"L2",enabled:!1,allowlist:null},transcription:{label:"Audio Transcription",tier:"L2",enabled:!1,allowlist:null}}:{},on=e=>{var t;return((t=zD[e])==null?void 0:t.enabled)===!0},AD=a6([{path:"/",element:o.jsx(uN,{}),children:[{path:"/",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-df293c50.js"),["assets/index-df293c50.js","assets/index-6bd7928a.js","assets/truncate-06273256.js","assets/XCircle-edfe554c.js","assets/moment-75486807.js","assets/File-b92df2f3.js","assets/Eye-9f033dc0.js","assets/index-4fb4d421.js","assets/react-beautiful-dnd.esm-bb85eef1.js","assets/index-671239cd.js","assets/mcpServers-1686e782.js","assets/admin-04b020fe.js","assets/Database-f1a76329.js","assets/Copy-d323e545.js","assets/Trans-820f1dad.js","assets/Brain-24e386d5.js","assets/Browser-1820fad0.js","assets/agentFlows-e4124dd3.js","assets/index-3cb59d82.js","assets/communityHub-aba61686.js","assets/WarningCircle-27467274.js"]);return{element:o.jsx(Y0,{Component:e})}}},{path:"/login",element:o.jsx(MN,{})},{path:"/sso/simple",element:o.jsx(PN,{})},{path:"/workspace/:slug/settings/:tab",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-d29fdeda.js"),["assets/index-d29fdeda.js","assets/index-6bd7928a.js","assets/truncate-06273256.js","assets/XCircle-edfe554c.js","assets/moment-75486807.js","assets/File-b92df2f3.js","assets/Eye-9f033dc0.js","assets/index-4fb4d421.js","assets/react-beautiful-dnd.esm-bb85eef1.js","assets/ChatText-35275002.js","assets/Database-f1a76329.js","assets/types-e90e1137.js","assets/main-0b9e408b.js","assets/index-3cb59d82.js","assets/communityHub-aba61686.js","assets/Brain-24e386d5.js","assets/Browser-1820fad0.js","assets/Trans-820f1dad.js","assets/admin-04b020fe.js","assets/Gauge-e6762f4d.js"]);return{element:o.jsx(Li,{Component:e})}}},{path:"/workspace/:slug",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-4ce77c64.js"),["assets/index-4ce77c64.js","assets/index-391c1474.js","assets/files-676613ed.js","assets/purify-eb750cf4.js","files.css","github.css","assets/Check-7e83fb0d.js","assets/Copy-d323e545.js","assets/index-6bd7928a.js","assets/truncate-06273256.js","assets/XCircle-edfe554c.js","assets/moment-75486807.js","assets/File-b92df2f3.js","assets/Eye-9f033dc0.js","assets/index-4fb4d421.js","assets/react-beautiful-dnd.esm-bb85eef1.js","assets/mcpServers-1686e782.js","assets/admin-04b020fe.js","assets/Database-f1a76329.js","assets/Trans-820f1dad.js","assets/Brain-24e386d5.js","assets/Browser-1820fad0.js","assets/index-671239cd.js","assets/agentFlows-e4124dd3.js","assets/index-3cb59d82.js","assets/communityHub-aba61686.js","assets/WarningCircle-27467274.js","assets/index-8ba96f42.js","assets/Hammer-05b5ccc7.js"]);return{element:o.jsx(Y0,{Component:e})}},children:[{path:"t/:threadSlug"}]},{path:"/accept-invite/:code",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-166e238c.js"),[]);return{element:o.jsx(e,{})}}},{path:"/settings/llm-preference",lazy:async()=>{const{default:e}=await we(()=>Promise.resolve().then(()=>RI),void 0);return{element:o.jsx(tt,{Component:e})}}},...on("transcription")?[{path:"/settings/transcription-preference",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-83825216.js"),["assets/index-83825216.js","assets/Gauge-e6762f4d.js"]);return{element:o.jsx(tt,{Component:e})}}}]:[],{path:"/settings/audio-preference",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-1fe43260.js"),["assets/index-1fe43260.js","assets/index-8ba96f42.js"]);return{element:o.jsx(tt,{Component:e})}}},...on("embedder")?[{path:"/settings/embedding-preference",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-fce187ac.js"),["assets/index-fce187ac.js","assets/index-4277cf52.js"]);return{element:o.jsx(tt,{Component:e})}}}]:[],...on("textSplitter")?[{path:"/settings/text-splitter-preference",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-80edec8f.js"),["assets/index-80edec8f.js","assets/admin-04b020fe.js","assets/index-4277cf52.js"]);return{element:o.jsx(tt,{Component:e})}}}]:[],...on("vectorDB")?[{path:"/settings/vector-database",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-2d84e5fe.js"),["assets/index-2d84e5fe.js","assets/index-4277cf52.js"]);return{element:o.jsx(tt,{Component:e})}}}]:[],{path:"/settings/agents",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-882e468e.js"),["assets/index-882e468e.js","assets/admin-04b020fe.js","assets/mcpServers-1686e782.js","assets/Database-f1a76329.js","assets/Copy-d323e545.js","assets/File-b92df2f3.js","assets/XCircle-edfe554c.js","assets/Trans-820f1dad.js","assets/Brain-24e386d5.js","assets/Browser-1820fad0.js","assets/Hammer-05b5ccc7.js","assets/Plug-7d951c7d.js","assets/types-e90e1137.js","assets/index-efee6d1f.js","assets/agentFlows-e4124dd3.js"]);return{element:o.jsx(tt,{Component:e})}}},{path:"/settings/agents/builder",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-0bf4fb6b.js"),["assets/index-0bf4fb6b.js","assets/index-3cb59d82.js","assets/communityHub-aba61686.js","assets/Brain-24e386d5.js","assets/Browser-1820fad0.js","assets/agentFlows-e4124dd3.js","assets/anything-llm-infinity-0d7244a1.js"]);return{element:o.jsx(tt,{Component:e,hideUserMenu:!0})}}},{path:"/settings/agents/builder/:flowId",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-0bf4fb6b.js"),["assets/index-0bf4fb6b.js","assets/index-3cb59d82.js","assets/communityHub-aba61686.js","assets/Brain-24e386d5.js","assets/Browser-1820fad0.js","assets/agentFlows-e4124dd3.js","assets/anything-llm-infinity-0d7244a1.js"]);return{element:o.jsx(tt,{Component:e,hideUserMenu:!0})}}},{path:"/settings/event-logs",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-ec3efa1e.js"),[]);return{element:o.jsx(tt,{Component:e})}}},{path:"/settings/embed-chat-widgets",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-6d56c896.js"),["assets/index-6d56c896.js","assets/index-4fb4d421.js","assets/purify-eb750cf4.js","assets/moment-75486807.js","assets/truncate-06273256.js","assets/github-dark-57c241de.js","github-dark.css","github.css"]);return{element:o.jsx(tt,{Component:e})}}},{path:"/settings/security",lazy:async()=>{const{default:e}=await we(()=>Promise.resolve().then(()=>tD),void 0);return{element:o.jsx(Li,{Component:e})}}},{path:"/settings/interface",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-f9305828.js"),[]);return{element:o.jsx(Li,{Component:e})}}},...on("brandingWhitelabel")?[{path:"/settings/branding",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-d54b0575.js"),["assets/index-d54b0575.js","assets/admin-04b020fe.js"]);return{element:o.jsx(Li,{Component:e})}}}]:[],{path:"/settings/default-system-prompt",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-e58bf860.js"),["assets/index-e58bf860.js","assets/main-0b9e408b.js"]);return{element:o.jsx(tt,{Component:e})}}},{path:"/settings/chat",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-841db586.js"),[]);return{element:o.jsx(Li,{Component:e})}}},{path:"/settings/beta-features",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-44ab5f11.js"),["assets/index-44ab5f11.js","assets/admin-04b020fe.js"]);return{element:o.jsx(tt,{Component:e})}}},{path:"/settings/api-keys",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-65184421.js"),["assets/index-65184421.js","assets/PlusCircle-31c6a8d8.js","assets/admin-04b020fe.js","assets/Check-7e83fb0d.js","assets/Copy-d323e545.js"]);return{element:o.jsx(tt,{Component:e})}}},...on("modelRouter")?[{path:"/settings/model-routers",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-01932fa1.js"),["assets/index-01932fa1.js","assets/index-8c2371f5.js"]);return{element:o.jsx(tt,{Component:e})}}},{path:"/settings/model-routers/:id",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-33ded078.js"),["assets/index-33ded078.js","assets/react-beautiful-dnd.esm-bb85eef1.js","assets/index-8c2371f5.js","assets/truncate-06273256.js","assets/Trans-820f1dad.js"]);return{element:o.jsx(tt,{Component:e})}}}]:[],{path:"/settings/system-prompt-variables",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-72544df5.js"),["assets/index-72544df5.js","assets/truncate-06273256.js"]);return{element:o.jsx(tt,{Component:e})}}},{path:"/settings/browser-extension",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-ae4f557d.js"),["assets/index-ae4f557d.js","assets/PlusCircle-31c6a8d8.js","assets/Check-7e83fb0d.js","assets/Copy-d323e545.js","assets/Plug-7d951c7d.js"]);return{element:o.jsx(Li,{Component:e})}}},{path:"/settings/workspace-chats",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-2aac91d0.js"),["assets/index-2aac91d0.js","assets/truncate-06273256.js","assets/purify-eb750cf4.js","assets/github-dark-57c241de.js","github-dark.css"]);return{element:o.jsx(Li,{Component:e})}}},{path:"/settings/invites",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-574ed823.js"),["assets/index-574ed823.js","assets/admin-04b020fe.js","assets/Check-7e83fb0d.js","assets/Copy-d323e545.js"]);return{element:o.jsx(Li,{Component:e})}}},{path:"/settings/users",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-a2978aa0.js"),["assets/index-a2978aa0.js","assets/admin-04b020fe.js"]);return{element:o.jsx(Li,{Component:e})}}},{path:"/settings/workspaces",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-1c653bbf.js"),["assets/index-1c653bbf.js","assets/admin-04b020fe.js"]);return{element:o.jsx(Li,{Component:e})}}},{path:"/onboarding",element:o.jsx(av,{})},{path:"/onboarding/:step",element:o.jsx(av,{})},{path:"/settings/beta-features/live-document-sync/manage",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-631fc042.js"),["assets/index-631fc042.js","assets/index-6bd7928a.js","assets/truncate-06273256.js","assets/XCircle-edfe554c.js","assets/moment-75486807.js","assets/File-b92df2f3.js","assets/Eye-9f033dc0.js","assets/index-4fb4d421.js","assets/react-beautiful-dnd.esm-bb85eef1.js"]);return{element:o.jsx(tt,{Component:e})}}},...on("communityHub")?[{path:"/settings/community-hub/trending",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-4750915e.js"),["assets/index-4750915e.js","assets/index-b49f94f1.js","assets/communityHub-aba61686.js","assets/Eye-9f033dc0.js","assets/truncate-06273256.js"]);return{element:o.jsx(tt,{Component:e})}}},{path:"/settings/community-hub/authentication",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-27cc497c.js"),["assets/index-27cc497c.js","assets/communityHub-aba61686.js","assets/index-efee6d1f.js","assets/index-b49f94f1.js","assets/Eye-9f033dc0.js","assets/truncate-06273256.js"]);return{element:o.jsx(tt,{Component:e})}}},{path:"/settings/community-hub/import-item",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-a253e180.js"),["assets/index-a253e180.js","assets/communityHub-aba61686.js","assets/files-676613ed.js","assets/purify-eb750cf4.js","files.css","github.css","assets/index-391c1474.js","assets/Check-7e83fb0d.js","assets/Copy-d323e545.js","assets/index-6bd7928a.js","assets/truncate-06273256.js","assets/XCircle-edfe554c.js","assets/moment-75486807.js","assets/File-b92df2f3.js","assets/Eye-9f033dc0.js","assets/index-4fb4d421.js","assets/react-beautiful-dnd.esm-bb85eef1.js","assets/mcpServers-1686e782.js","assets/admin-04b020fe.js","assets/Database-f1a76329.js","assets/Trans-820f1dad.js","assets/Brain-24e386d5.js","assets/Browser-1820fad0.js","assets/index-671239cd.js","assets/agentFlows-e4124dd3.js","assets/index-3cb59d82.js","assets/WarningCircle-27467274.js","assets/index-8ba96f42.js","assets/Hammer-05b5ccc7.js"]);return{element:o.jsx(tt,{Component:e})}}}]:[],{path:"/settings/mobile-connections",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-6679334a.js"),["assets/index-6679334a.js","assets/index-08cd0bc2.js","assets/anything-llm-infinity-0d7244a1.js","assets/moment-75486807.js"]);return{element:o.jsx(Li,{Component:e})}}},{path:"/settings/external-connections/telegram",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-ed9034ac.js"),["assets/index-ed9034ac.js","assets/Check-7e83fb0d.js","assets/Eye-9f033dc0.js","assets/index-08cd0bc2.js","assets/anything-llm-infinity-0d7244a1.js","assets/Trans-820f1dad.js"]);return{element:o.jsx(tt,{Component:e})}}},{path:"/settings/scheduled-jobs",lazy:async()=>{const{default:e}=await we(()=>import("./assets/index-cd6bc090.js"),["assets/index-cd6bc090.js","assets/usePolling-417bb099.js","assets/WarningCircle-27467274.js","assets/cron-307d3fc6.js","assets/moment-75486807.js","assets/Check-7e83fb0d.js"]);return{element:o.jsx(Vd,{Component:e})}}},{path:"/settings/scheduled-jobs/:id/runs",lazy:async()=>{const{default:e}=await we(()=>import("./assets/RunHistoryPage-2fcb4325.js"),["assets/RunHistoryPage-2fcb4325.js","assets/usePolling-417bb099.js","assets/Stop-4b47ae05.js","assets/moment-75486807.js","assets/cron-307d3fc6.js"]);return{element:o.jsx(Vd,{Component:e})}}},{path:"/settings/scheduled-jobs/:id/runs/:runId",lazy:async()=>{const{default:e}=await we(()=>import("./assets/RunDetailPage-da6aa377.js"),["assets/RunDetailPage-da6aa377.js","assets/Brain-24e386d5.js","assets/ChatText-35275002.js","assets/File-b92df2f3.js","assets/Stop-4b47ae05.js","assets/usePolling-417bb099.js","assets/files-676613ed.js","assets/purify-eb750cf4.js","files.css","github.css","assets/Copy-d323e545.js","assets/truncate-06273256.js","assets/moment-75486807.js"]);return{element:o.jsx(Vd,{Component:e})}}},{path:"*",lazy:async()=>{const{default:e}=await we(()=>import("./assets/404-56d107aa.js"),[]);return{element:o.jsx(e,{})}}}]}]);Gd.createRoot(document.getElementById("root")).render(o.jsx(xD,{children:o.jsx(hC,{children:o.jsx(u6,{router:AD})})}));export{at as $,E as A,ID as B,nh as C,sy as D,cC as E,aO as F,uC as G,pr as H,xm as I,yc as J,fc as K,O6 as L,Tc as M,ey as N,YD as O,CD as P,_2 as Q,c as R,MI as S,Qi as T,Q1 as U,Ay as V,Pn as W,f6 as X,rh as Y,oh as Z,Y2 as _,hc as a,Xs as a$,Ke as a0,Fw as a1,U2 as a2,wc as a3,Xa as a4,N7 as a5,nt as a6,lt as a7,an as a8,q6 as a9,cD as aA,uD as aB,oD as aC,S7 as aD,gc as aE,Ic as aF,vm as aG,iO as aH,fp as aI,X1 as aJ,bm as aK,t_ as aL,ty as aM,RD as aN,lh as aO,mN as aP,Os as aQ,Ry as aR,Cn as aS,Ei as aT,km as aU,dy as aV,zm as aW,dc as aX,vy as aY,Zu as aZ,ED as a_,aa,Ri as ab,R6 as ac,H6 as ad,zy as ae,G6 as af,TI as ag,xc as ah,zc as ai,Lc as aj,Ac as ak,jc as al,Ec as am,Mc as an,Cc as ao,Pc as ap,pD as aq,Sc as ar,_c as as,OD as at,lD as au,mD as av,iv as aw,sD as ax,rD as ay,dD as az,ia as b,we as b$,DD as b0,gy as b1,ym as b2,VD as b3,Oa as b4,Vl as b5,B2 as b6,MD as b7,PD as b8,w7 as b9,vn as bA,y6 as bB,x6 as bC,C6 as bD,N1 as bE,k7 as bF,qD as bG,HD as bH,wm as bI,$D as bJ,ly as bK,pC as bL,Ju as bM,Ti as bN,o0 as bO,Io as bP,x_ as bQ,$5 as bR,Z5 as bS,Q5 as bT,J5 as bU,$2 as bV,JD as bW,ZD as bX,WD as bY,LD as bZ,iy as b_,ND as ba,E4 as bb,KD as bc,w0 as bd,fy as be,y0 as bf,qy as bg,GD as bh,FD as bi,BD as bj,eO as bk,UD as bl,XD as bm,K2 as bn,tO as bo,Bu as bp,iz as bq,up as br,G0 as bs,oy as bt,pN as bu,xy as bv,I8 as bw,py as bx,Fu as by,M6 as bz,Se as c,_m as c0,LN as d,_a as e,jN as f,ue as g,Nn as h,Mn as i,o as j,Sr as k,fm as l,N as m,SD as n,QD as o,G as p,W2 as q,m as r,Et as s,K as t,Qe as u,Vt as v,az as w,pt as x,uy as y,os as z};
|