libre-webui 0.3.4 → 0.4.3

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.
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["js/utils-vendor-DEeF42mN.js","js/router-vendor-CnU0qKrY.js","js/react-vendor-N--QU9DW.js","js/ChatPage-BpA7Kkgb.js","js/markdown-vendor-YWiGftdn.js","js/ui-vendor-CAOY-5dA.js","js/ArtifactContainer-Cw1ZDLA2.js","js/ModelsPage-BPjn0auW.js","js/PersonasPage-BR3S_Lfk.js","js/GalleryPage-MWy5qimI.js","js/UserManagementPage-DMYq0zvJ.js","js/ArtifactDemoPage-BlajO5pZ.js"])))=>i.map(i=>d[i]);
2
- var Or=Object.defineProperty;var Lr=(n,a,t)=>a in n?Or(n,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[a]=t;var Ie=(n,a,t)=>Lr(n,typeof a!="symbol"?a+"":a,t);import{j as e,_ as he,h as Kr}from"../js/markdown-vendor-YWiGftdn.js";import{r as h,R as le,u as ut,a as Ia,b as Br,c as Mn,L as ta,N as It,H as Gr,B as Hr,d as Ja,e as ie}from"../js/router-vendor-CnU0qKrY.js";import{a as Rr,g as Ur,r as $r}from"../js/react-vendor-N--QU9DW.js";import{X as Me,I as et,U as ja,z,G as mt,P as Vr,B as Ct,S as Wr,V as Ft,D as ia,a as Et,M as qr,b as Dn,R as na,C as Se,c as jn,E as Ce,d as Aa,K as at,e as Jr,f as _r,g as An,T as zn,L as qe,h as Je,i as Ee,j as Yr,k as Zr,l as Xr,m as Qr,n as ei,o as Nn,p as wa,q as ai,r as Ot,s as Lt,t as ti,u as Kt,v as Bt,w as Tn,x as ni,y as Q,A as In,F as ri,H as ii,J as Cn,N as Gt,O as Ht,Q as tt,W as oi,Y as Fn,Z as si,_ as Rt,$ as li}from"../js/ui-vendor-CAOY-5dA.js";import{t as di,c as ci,a as Ca,b as nt}from"../js/utils-vendor-DEeF42mN.js";(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function t(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=t(i);fetch(i.href,o)}})();var va={},Ut;function ui(){if(Ut)return va;Ut=1;var n=Rr();return va.createRoot=n.createRoot,va.hydrateRoot=n.hydrateRoot,va}var mi=ui();const pi=Ur(mi),B=n=>typeof n=="string",ra=()=>{let n,a;const t=new Promise((r,i)=>{n=r,a=i});return t.resolve=n,t.reject=a,t},$t=n=>n==null?"":""+n,gi=(n,a,t)=>{n.forEach(r=>{a[r]&&(t[r]=a[r])})},hi=/###/g,Vt=n=>n&&n.indexOf("###")>-1?n.replace(hi,"."):n,Wt=n=>!n||B(n),oa=(n,a,t)=>{const r=B(a)?a.split("."):a;let i=0;for(;i<r.length-1;){if(Wt(n))return{};const o=Vt(r[i]);!n[o]&&t&&(n[o]=new t),Object.prototype.hasOwnProperty.call(n,o)?n=n[o]:n={},++i}return Wt(n)?{}:{obj:n,k:Vt(r[i])}},qt=(n,a,t)=>{const{obj:r,k:i}=oa(n,a,Object);if(r!==void 0||a.length===1){r[i]=t;return}let o=a[a.length-1],s=a.slice(0,a.length-1),d=oa(n,s,Object);for(;d.obj===void 0&&s.length;)o=`${s[s.length-1]}.${o}`,s=s.slice(0,s.length-1),d=oa(n,s,Object),d?.obj&&typeof d.obj[`${d.k}.${o}`]<"u"&&(d.obj=void 0);d.obj[`${d.k}.${o}`]=t},bi=(n,a,t,r)=>{const{obj:i,k:o}=oa(n,a,Object);i[o]=i[o]||[],i[o].push(t)},za=(n,a)=>{const{obj:t,k:r}=oa(n,a);if(t&&Object.prototype.hasOwnProperty.call(t,r))return t[r]},ki=(n,a,t)=>{const r=za(n,t);return r!==void 0?r:za(a,t)},En=(n,a,t)=>{for(const r in a)r!=="__proto__"&&r!=="constructor"&&(r in n?B(n[r])||n[r]instanceof String||B(a[r])||a[r]instanceof String?t&&(n[r]=a[r]):En(n[r],a[r],t):n[r]=a[r]);return n},Ue=n=>n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var fi={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const yi=n=>B(n)?n.replace(/[&<>"'\/]/g,a=>fi[a]):n;class vi{constructor(a){this.capacity=a,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(a){const t=this.regExpMap.get(a);if(t!==void 0)return t;const r=new RegExp(a);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(a,r),this.regExpQueue.push(a),r}}const xi=[" ",",","?","!",";"],Si=new vi(20),wi=(n,a,t)=>{a=a||"",t=t||"";const r=xi.filter(s=>a.indexOf(s)<0&&t.indexOf(s)<0);if(r.length===0)return!0;const i=Si.getRegExp(`(${r.map(s=>s==="?"?"\\?":s).join("|")})`);let o=!i.test(n);if(!o){const s=n.indexOf(t);s>0&&!i.test(n.substring(0,s))&&(o=!0)}return o},rt=(n,a,t=".")=>{if(!n)return;if(n[a])return Object.prototype.hasOwnProperty.call(n,a)?n[a]:void 0;const r=a.split(t);let i=n;for(let o=0;o<r.length;){if(!i||typeof i!="object")return;let s,d="";for(let u=o;u<r.length;++u)if(u!==o&&(d+=t),d+=r[u],s=i[d],s!==void 0){if(["string","number","boolean"].indexOf(typeof s)>-1&&u<r.length-1)continue;o+=u-o+1;break}i=s}return i},ca=n=>n?.replace("_","-"),Pi={type:"logger",log(n){this.output("log",n)},warn(n){this.output("warn",n)},error(n){this.output("error",n)},output(n,a){console?.[n]?.apply?.(console,a)}};class Na{constructor(a,t={}){this.init(a,t)}init(a,t={}){this.prefix=t.prefix||"i18next:",this.logger=a||Pi,this.options=t,this.debug=t.debug}log(...a){return this.forward(a,"log","",!0)}warn(...a){return this.forward(a,"warn","",!0)}error(...a){return this.forward(a,"error","")}deprecate(...a){return this.forward(a,"warn","WARNING DEPRECATED: ",!0)}forward(a,t,r,i){return i&&!this.debug?null:(B(a[0])&&(a[0]=`${r}${this.prefix} ${a[0]}`),this.logger[t](a))}create(a){return new Na(this.logger,{prefix:`${this.prefix}:${a}:`,...this.options})}clone(a){return a=a||this.options,a.prefix=a.prefix||this.prefix,new Na(this.logger,a)}}var we=new Na;class Fa{constructor(){this.observers={}}on(a,t){return a.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const i=this.observers[r].get(t)||0;this.observers[r].set(t,i+1)}),this}off(a,t){if(this.observers[a]){if(!t){delete this.observers[a];return}this.observers[a].delete(t)}}emit(a,...t){this.observers[a]&&Array.from(this.observers[a].entries()).forEach(([i,o])=>{for(let s=0;s<o;s++)i(...t)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([i,o])=>{for(let s=0;s<o;s++)i.apply(i,[a,...t])})}}class Jt extends Fa{constructor(a,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=a||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(a){this.options.ns.indexOf(a)<0&&this.options.ns.push(a)}removeNamespaces(a){const t=this.options.ns.indexOf(a);t>-1&&this.options.ns.splice(t,1)}getResource(a,t,r,i={}){const o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,s=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let d;a.indexOf(".")>-1?d=a.split("."):(d=[a,t],r&&(Array.isArray(r)?d.push(...r):B(r)&&o?d.push(...r.split(o)):d.push(r)));const u=za(this.data,d);return!u&&!t&&!r&&a.indexOf(".")>-1&&(a=d[0],t=d[1],r=d.slice(2).join(".")),u||!s||!B(r)?u:rt(this.data?.[a]?.[t],r,o)}addResource(a,t,r,i,o={silent:!1}){const s=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let d=[a,t];r&&(d=d.concat(s?r.split(s):r)),a.indexOf(".")>-1&&(d=a.split("."),i=t,t=d[1]),this.addNamespaces(t),qt(this.data,d,i),o.silent||this.emit("added",a,t,r,i)}addResources(a,t,r,i={silent:!1}){for(const o in r)(B(r[o])||Array.isArray(r[o]))&&this.addResource(a,t,o,r[o],{silent:!0});i.silent||this.emit("added",a,t,r)}addResourceBundle(a,t,r,i,o,s={silent:!1,skipCopy:!1}){let d=[a,t];a.indexOf(".")>-1&&(d=a.split("."),i=r,r=t,t=d[1]),this.addNamespaces(t);let u=za(this.data,d)||{};s.skipCopy||(r=JSON.parse(JSON.stringify(r))),i?En(u,r,o):u={...u,...r},qt(this.data,d,u),s.silent||this.emit("added",a,t,r)}removeResourceBundle(a,t){this.hasResourceBundle(a,t)&&delete this.data[a][t],this.removeNamespaces(t),this.emit("removed",a,t)}hasResourceBundle(a,t){return this.getResource(a,t)!==void 0}getResourceBundle(a,t){return t||(t=this.options.defaultNS),this.getResource(a,t)}getDataByLanguage(a){return this.data[a]}hasLanguageSomeTranslations(a){const t=this.getDataByLanguage(a);return!!(t&&Object.keys(t)||[]).find(i=>t[i]&&Object.keys(t[i]).length>0)}toJSON(){return this.data}}var On={processors:{},addPostProcessor(n){this.processors[n.name]=n},handle(n,a,t,r,i){return n.forEach(o=>{a=this.processors[o]?.process(a,t,r,i)??a}),a}};const Ln=Symbol("i18next/PATH_KEY");function Mi(){const n=[],a=Object.create(null);let t;return a.get=(r,i)=>(t?.revoke?.(),i===Ln?n:(n.push(i),t=Proxy.revocable(r,a),t.proxy)),Proxy.revocable(Object.create(null),a).proxy}function it(n,a){const{[Ln]:t}=n(Mi());return t.join(a?.keySeparator??".")}const _t={},_a=n=>!B(n)&&typeof n!="boolean"&&typeof n!="number";class Ta extends Fa{constructor(a,t={}){super(),gi(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],a,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=we.create("translator")}changeLanguage(a){a&&(this.language=a)}exists(a,t={interpolation:{}}){const r={...t};if(a==null)return!1;const i=this.resolve(a,r);if(i?.res===void 0)return!1;const o=_a(i.res);return!(r.returnObjects===!1&&o)}extractFromKey(a,t){let r=t.nsSeparator!==void 0?t.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const i=t.keySeparator!==void 0?t.keySeparator:this.options.keySeparator;let o=t.ns||this.options.defaultNS||[];const s=r&&a.indexOf(r)>-1,d=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!wi(a,r,i);if(s&&!d){const u=a.match(this.interpolator.nestingRegexp);if(u&&u.length>0)return{key:a,namespaces:B(o)?[o]:o};const m=a.split(r);(r!==i||r===i&&this.options.ns.indexOf(m[0])>-1)&&(o=m.shift()),a=m.join(i)}return{key:a,namespaces:B(o)?[o]:o}}translate(a,t,r){let i=typeof t=="object"?{...t}:t;if(typeof i!="object"&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i=="object"&&(i={...i}),i||(i={}),a==null)return"";typeof a=="function"&&(a=it(a,{...this.options,...i})),Array.isArray(a)||(a=[String(a)]);const o=i.returnDetails!==void 0?i.returnDetails:this.options.returnDetails,s=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,{key:d,namespaces:u}=this.extractFromKey(a[a.length-1],i),m=u[u.length-1];let g=i.nsSeparator!==void 0?i.nsSeparator:this.options.nsSeparator;g===void 0&&(g=":");const p=i.lng||this.language,k=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(p?.toLowerCase()==="cimode")return k?o?{res:`${m}${g}${d}`,usedKey:d,exactUsedKey:d,usedLng:p,usedNS:m,usedParams:this.getUsedParamsDetails(i)}:`${m}${g}${d}`:o?{res:d,usedKey:d,exactUsedKey:d,usedLng:p,usedNS:m,usedParams:this.getUsedParamsDetails(i)}:d;const x=this.resolve(a,i);let b=x?.res;const w=x?.usedKey||d,S=x?.exactUsedKey||d,F=["[object Number]","[object Function]","[object RegExp]"],L=i.joinArrays!==void 0?i.joinArrays:this.options.joinArrays,D=!this.i18nFormat||this.i18nFormat.handleAsObject,A=i.count!==void 0&&!B(i.count),N=Ta.hasDefaultValue(i),P=A?this.pluralResolver.getSuffix(p,i.count,i):"",U=i.ordinal&&A?this.pluralResolver.getSuffix(p,i.count,{ordinal:!1}):"",q=A&&!i.ordinal&&i.count===0,K=q&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${P}`]||i[`defaultValue${U}`]||i.defaultValue;let O=b;D&&!b&&N&&(O=K);const E=_a(O),G=Object.prototype.toString.apply(O);if(D&&O&&E&&F.indexOf(G)<0&&!(B(L)&&Array.isArray(O))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const c=this.options.returnedObjectHandler?this.options.returnedObjectHandler(w,O,{...i,ns:u}):`key '${d} (${this.language})' returned an object instead of string.`;return o?(x.res=c,x.usedParams=this.getUsedParamsDetails(i),x):c}if(s){const c=Array.isArray(O),$=c?[]:{},ue=c?S:w;for(const V in O)if(Object.prototype.hasOwnProperty.call(O,V)){const Y=`${ue}${s}${V}`;N&&!b?$[V]=this.translate(Y,{...i,defaultValue:_a(K)?K[V]:void 0,joinArrays:!1,ns:u}):$[V]=this.translate(Y,{...i,joinArrays:!1,ns:u}),$[V]===Y&&($[V]=O[V])}b=$}}else if(D&&B(L)&&Array.isArray(b))b=b.join(L),b&&(b=this.extendTranslation(b,a,i,r));else{let c=!1,$=!1;!this.isValidLookup(b)&&N&&(c=!0,b=K),this.isValidLookup(b)||($=!0,b=d);const V=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&$?void 0:b,Y=N&&K!==b&&this.options.updateMissing;if($||c||Y){if(this.logger.log(Y?"updateKey":"missingKey",p,m,d,Y?K:b),s){const T=this.resolve(d,{...i,keySeparator:!1});T&&T.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 J=[];const me=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo==="fallback"&&me&&me[0])for(let T=0;T<me.length;T++)J.push(me[T]);else this.options.saveMissingTo==="all"?J=this.languageUtils.toResolveHierarchy(i.lng||this.language):J.push(i.lng||this.language);const ne=(T,H,_)=>{const Pe=N&&_!==b?_:V;this.options.missingKeyHandler?this.options.missingKeyHandler(T,m,H,Pe,Y,i):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(T,m,H,Pe,Y,i),this.emit("missingKey",T,m,H,b)};this.options.saveMissing&&(this.options.saveMissingPlurals&&A?J.forEach(T=>{const H=this.pluralResolver.getSuffixes(T,i);q&&i[`defaultValue${this.options.pluralSeparator}zero`]&&H.indexOf(`${this.options.pluralSeparator}zero`)<0&&H.push(`${this.options.pluralSeparator}zero`),H.forEach(_=>{ne([T],d+_,i[`defaultValue${_}`]||K)})}):ne(J,d,K))}b=this.extendTranslation(b,a,i,x,r),$&&b===d&&this.options.appendNamespaceToMissingKey&&(b=`${m}${g}${d}`),($||c)&&this.options.parseMissingKeyHandler&&(b=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${m}${g}${d}`:d,c?b:void 0,i))}return o?(x.res=b,x.usedParams=this.getUsedParamsDetails(i),x):b}extendTranslation(a,t,r,i,o){if(this.i18nFormat?.parse)a=this.i18nFormat.parse(a,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const u=B(a)&&(r?.interpolation?.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let m;if(u){const p=a.match(this.interpolator.nestingRegexp);m=p&&p.length}let g=r.replace&&!B(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(g={...this.options.interpolation.defaultVariables,...g}),a=this.interpolator.interpolate(a,g,r.lng||this.language||i.usedLng,r),u){const p=a.match(this.interpolator.nestingRegexp),k=p&&p.length;m<k&&(r.nest=!1)}!r.lng&&i&&i.res&&(r.lng=this.language||i.usedLng),r.nest!==!1&&(a=this.interpolator.nest(a,(...p)=>o?.[0]===p[0]&&!r.context?(this.logger.warn(`It seems you are nesting recursively key: ${p[0]} in key: ${t[0]}`),null):this.translate(...p,t),r)),r.interpolation&&this.interpolator.reset()}const s=r.postProcess||this.options.postProcess,d=B(s)?[s]:s;return a!=null&&d?.length&&r.applyPostProcessor!==!1&&(a=On.handle(d,a,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),a}resolve(a,t={}){let r,i,o,s,d;return B(a)&&(a=[a]),a.forEach(u=>{if(this.isValidLookup(r))return;const m=this.extractFromKey(u,t),g=m.key;i=g;let p=m.namespaces;this.options.fallbackNS&&(p=p.concat(this.options.fallbackNS));const k=t.count!==void 0&&!B(t.count),x=k&&!t.ordinal&&t.count===0,b=t.context!==void 0&&(B(t.context)||typeof t.context=="number")&&t.context!=="",w=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);p.forEach(S=>{this.isValidLookup(r)||(d=S,!_t[`${w[0]}-${S}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(d)&&(_t[`${w[0]}-${S}`]=!0,this.logger.warn(`key "${i}" for languages "${w.join(", ")}" won't get resolved as namespace "${d}" 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!!!")),w.forEach(F=>{if(this.isValidLookup(r))return;s=F;const L=[g];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(L,g,F,S,t);else{let A;k&&(A=this.pluralResolver.getSuffix(F,t.count,t));const N=`${this.options.pluralSeparator}zero`,P=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(k&&(t.ordinal&&A.indexOf(P)===0&&L.push(g+A.replace(P,this.options.pluralSeparator)),L.push(g+A),x&&L.push(g+N)),b){const U=`${g}${this.options.contextSeparator||"_"}${t.context}`;L.push(U),k&&(t.ordinal&&A.indexOf(P)===0&&L.push(U+A.replace(P,this.options.pluralSeparator)),L.push(U+A),x&&L.push(U+N))}}let D;for(;D=L.pop();)this.isValidLookup(r)||(o=D,r=this.getResource(F,S,D,t))}))})}),{res:r,usedKey:i,exactUsedKey:o,usedLng:s,usedNS:d}}isValidLookup(a){return a!==void 0&&!(!this.options.returnNull&&a===null)&&!(!this.options.returnEmptyString&&a==="")}getResource(a,t,r,i={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(a,t,r,i):this.resourceStore.getResource(a,t,r,i)}getUsedParamsDetails(a={}){const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=a.replace&&!B(a.replace);let i=r?a.replace:a;if(r&&typeof a.count<"u"&&(i.count=a.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!r){i={...i};for(const o of t)delete i[o]}return i}static hasDefaultValue(a){const t="defaultValue";for(const r in a)if(Object.prototype.hasOwnProperty.call(a,r)&&t===r.substring(0,t.length)&&a[r]!==void 0)return!0;return!1}}class Yt{constructor(a){this.options=a,this.supportedLngs=this.options.supportedLngs||!1,this.logger=we.create("languageUtils")}getScriptPartFromCode(a){if(a=ca(a),!a||a.indexOf("-")<0)return null;const t=a.split("-");return t.length===2||(t.pop(),t[t.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(t.join("-"))}getLanguagePartFromCode(a){if(a=ca(a),!a||a.indexOf("-")<0)return a;const t=a.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(a){if(B(a)&&a.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(a)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?a.toLowerCase():a)}return this.options.cleanCode||this.options.lowerCaseLng?a.toLowerCase():a}isSupportedCode(a){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(a=this.getLanguagePartFromCode(a)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(a)>-1}getBestMatchFromCodes(a){if(!a)return null;let t;return a.forEach(r=>{if(t)return;const i=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(i))&&(t=i)}),!t&&this.options.supportedLngs&&a.forEach(r=>{if(t)return;const i=this.getScriptPartFromCode(r);if(this.isSupportedCode(i))return t=i;const o=this.getLanguagePartFromCode(r);if(this.isSupportedCode(o))return t=o;t=this.options.supportedLngs.find(s=>{if(s===o)return s;if(!(s.indexOf("-")<0&&o.indexOf("-")<0)&&(s.indexOf("-")>0&&o.indexOf("-")<0&&s.substring(0,s.indexOf("-"))===o||s.indexOf(o)===0&&o.length>1))return s})}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(a,t){if(!a)return[];if(typeof a=="function"&&(a=a(t)),B(a)&&(a=[a]),Array.isArray(a))return a;if(!t)return a.default||[];let r=a[t];return r||(r=a[this.getScriptPartFromCode(t)]),r||(r=a[this.formatLanguageCode(t)]),r||(r=a[this.getLanguagePartFromCode(t)]),r||(r=a.default),r||[]}toResolveHierarchy(a,t){const r=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],a),i=[],o=s=>{s&&(this.isSupportedCode(s)?i.push(s):this.logger.warn(`rejecting language code not found in supportedLngs: ${s}`))};return B(a)&&(a.indexOf("-")>-1||a.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&o(this.formatLanguageCode(a)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&o(this.getScriptPartFromCode(a)),this.options.load!=="currentOnly"&&o(this.getLanguagePartFromCode(a))):B(a)&&o(this.formatLanguageCode(a)),r.forEach(s=>{i.indexOf(s)<0&&o(this.formatLanguageCode(s))}),i}}const Zt={zero:0,one:1,two:2,few:3,many:4,other:5},Xt={select:n=>n===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Di{constructor(a,t={}){this.languageUtils=a,this.options=t,this.logger=we.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(a,t={}){const r=ca(a==="dev"?"en":a),i=t.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:r,type:i});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];let s;try{s=new Intl.PluralRules(r,{type:i})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),Xt;if(!a.match(/-|_/))return Xt;const u=this.languageUtils.getLanguagePartFromCode(a);s=this.getRule(u,t)}return this.pluralRulesCache[o]=s,s}needsPlural(a,t={}){let r=this.getRule(a,t);return r||(r=this.getRule("dev",t)),r?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(a,t,r={}){return this.getSuffixes(a,r).map(i=>`${t}${i}`)}getSuffixes(a,t={}){let r=this.getRule(a,t);return r||(r=this.getRule("dev",t)),r?r.resolvedOptions().pluralCategories.sort((i,o)=>Zt[i]-Zt[o]).map(i=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${i}`):[]}getSuffix(a,t,r={}){const i=this.getRule(a,r);return i?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${i.select(t)}`:(this.logger.warn(`no plural rule found for: ${a}`),this.getSuffix("dev",t,r))}}const Qt=(n,a,t,r=".",i=!0)=>{let o=ki(n,a,t);return!o&&i&&B(t)&&(o=rt(n,t,r),o===void 0&&(o=rt(a,t,r))),o},Ya=n=>n.replace(/\$/g,"$$$$");class en{constructor(a={}){this.logger=we.create("interpolator"),this.options=a,this.format=a?.interpolation?.format||(t=>t),this.init(a)}init(a={}){a.interpolation||(a.interpolation={escapeValue:!0});const{escape:t,escapeValue:r,useRawValueToEscape:i,prefix:o,prefixEscaped:s,suffix:d,suffixEscaped:u,formatSeparator:m,unescapeSuffix:g,unescapePrefix:p,nestingPrefix:k,nestingPrefixEscaped:x,nestingSuffix:b,nestingSuffixEscaped:w,nestingOptionsSeparator:S,maxReplaces:F,alwaysFormat:L}=a.interpolation;this.escape=t!==void 0?t:yi,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=o?Ue(o):s||"{{",this.suffix=d?Ue(d):u||"}}",this.formatSeparator=m||",",this.unescapePrefix=g?"":p||"-",this.unescapeSuffix=this.unescapePrefix?"":g||"",this.nestingPrefix=k?Ue(k):x||Ue("$t("),this.nestingSuffix=b?Ue(b):w||Ue(")"),this.nestingOptionsSeparator=S||",",this.maxReplaces=F||1e3,this.alwaysFormat=L!==void 0?L:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const a=(t,r)=>t?.source===r?(t.lastIndex=0,t):new RegExp(r,"g");this.regexp=a(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=a(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=a(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(a,t,r,i){let o,s,d;const u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},m=x=>{if(x.indexOf(this.formatSeparator)<0){const F=Qt(t,u,x,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(F,void 0,r,{...i,...t,interpolationkey:x}):F}const b=x.split(this.formatSeparator),w=b.shift().trim(),S=b.join(this.formatSeparator).trim();return this.format(Qt(t,u,w,this.options.keySeparator,this.options.ignoreJSONStructure),S,r,{...i,...t,interpolationkey:w})};this.resetRegExp();const g=i?.missingInterpolationHandler||this.options.missingInterpolationHandler,p=i?.interpolation?.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:x=>Ya(x)},{regex:this.regexp,safeValue:x=>this.escapeValue?Ya(this.escape(x)):Ya(x)}].forEach(x=>{for(d=0;o=x.regex.exec(a);){const b=o[1].trim();if(s=m(b),s===void 0)if(typeof g=="function"){const S=g(a,o,i);s=B(S)?S:""}else if(i&&Object.prototype.hasOwnProperty.call(i,b))s="";else if(p){s=o[0];continue}else this.logger.warn(`missed to pass in variable ${b} for interpolating ${a}`),s="";else!B(s)&&!this.useRawValueToEscape&&(s=$t(s));const w=x.safeValue(s);if(a=a.replace(o[0],w),p?(x.regex.lastIndex+=s.length,x.regex.lastIndex-=o[0].length):x.regex.lastIndex=0,d++,d>=this.maxReplaces)break}}),a}nest(a,t,r={}){let i,o,s;const d=(u,m)=>{const g=this.nestingOptionsSeparator;if(u.indexOf(g)<0)return u;const p=u.split(new RegExp(`${g}[ ]*{`));let k=`{${p[1]}`;u=p[0],k=this.interpolate(k,s);const x=k.match(/'/g),b=k.match(/"/g);((x?.length??0)%2===0&&!b||b.length%2!==0)&&(k=k.replace(/'/g,'"'));try{s=JSON.parse(k),m&&(s={...m,...s})}catch(w){return this.logger.warn(`failed parsing options string in nesting for key ${u}`,w),`${u}${g}${k}`}return s.defaultValue&&s.defaultValue.indexOf(this.prefix)>-1&&delete s.defaultValue,u};for(;i=this.nestingRegexp.exec(a);){let u=[];s={...r},s=s.replace&&!B(s.replace)?s.replace:s,s.applyPostProcessor=!1,delete s.defaultValue;const m=/{.*}/.test(i[1])?i[1].lastIndexOf("}")+1:i[1].indexOf(this.formatSeparator);if(m!==-1&&(u=i[1].slice(m).split(this.formatSeparator).map(g=>g.trim()).filter(Boolean),i[1]=i[1].slice(0,m)),o=t(d.call(this,i[1].trim(),s),s),o&&i[0]===a&&!B(o))return o;B(o)||(o=$t(o)),o||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${a}`),o=""),u.length&&(o=u.reduce((g,p)=>this.format(g,p,r.lng,{...r,interpolationkey:i[1].trim()}),o.trim())),a=a.replace(i[0],o),this.regexp.lastIndex=0}return a}}const ji=n=>{let a=n.toLowerCase().trim();const t={};if(n.indexOf("(")>-1){const r=n.split("(");a=r[0].toLowerCase().trim();const i=r[1].substring(0,r[1].length-1);a==="currency"&&i.indexOf(":")<0?t.currency||(t.currency=i.trim()):a==="relativetime"&&i.indexOf(":")<0?t.range||(t.range=i.trim()):i.split(";").forEach(s=>{if(s){const[d,...u]=s.split(":"),m=u.join(":").trim().replace(/^'+|'+$/g,""),g=d.trim();t[g]||(t[g]=m),m==="false"&&(t[g]=!1),m==="true"&&(t[g]=!0),isNaN(m)||(t[g]=parseInt(m,10))}})}return{formatName:a,formatOptions:t}},an=n=>{const a={};return(t,r,i)=>{let o=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(o={...o,[i.interpolationkey]:void 0});const s=r+JSON.stringify(o);let d=a[s];return d||(d=n(ca(r),i),a[s]=d),d(t)}},Ai=n=>(a,t,r)=>n(ca(t),r)(a);class zi{constructor(a={}){this.logger=we.create("formatter"),this.options=a,this.init(a)}init(a,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const r=t.cacheInBuiltFormats?an:Ai;this.formats={number:r((i,o)=>{const s=new Intl.NumberFormat(i,{...o});return d=>s.format(d)}),currency:r((i,o)=>{const s=new Intl.NumberFormat(i,{...o,style:"currency"});return d=>s.format(d)}),datetime:r((i,o)=>{const s=new Intl.DateTimeFormat(i,{...o});return d=>s.format(d)}),relativetime:r((i,o)=>{const s=new Intl.RelativeTimeFormat(i,{...o});return d=>s.format(d,o.range||"day")}),list:r((i,o)=>{const s=new Intl.ListFormat(i,{...o});return d=>s.format(d)})}}add(a,t){this.formats[a.toLowerCase().trim()]=t}addCached(a,t){this.formats[a.toLowerCase().trim()]=an(t)}format(a,t,r,i={}){const o=t.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find(d=>d.indexOf(")")>-1)){const d=o.findIndex(u=>u.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,d)].join(this.formatSeparator)}return o.reduce((d,u)=>{const{formatName:m,formatOptions:g}=ji(u);if(this.formats[m]){let p=d;try{const k=i?.formatParams?.[i.interpolationkey]||{},x=k.locale||k.lng||i.locale||i.lng||r;p=this.formats[m](d,x,{...g,...i,...k})}catch(k){this.logger.warn(k)}return p}else this.logger.warn(`there was no format function for ${m}`);return d},a)}}const Ni=(n,a)=>{n.pending[a]!==void 0&&(delete n.pending[a],n.pendingCount--)};class Ti extends Fa{constructor(a,t,r,i={}){super(),this.backend=a,this.store=t,this.services=r,this.languageUtils=r.languageUtils,this.options=i,this.logger=we.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(r,i.backend,i)}queueLoad(a,t,r,i){const o={},s={},d={},u={};return a.forEach(m=>{let g=!0;t.forEach(p=>{const k=`${m}|${p}`;!r.reload&&this.store.hasResourceBundle(m,p)?this.state[k]=2:this.state[k]<0||(this.state[k]===1?s[k]===void 0&&(s[k]=!0):(this.state[k]=1,g=!1,s[k]===void 0&&(s[k]=!0),o[k]===void 0&&(o[k]=!0),u[p]===void 0&&(u[p]=!0)))}),g||(d[m]=!0)}),(Object.keys(o).length||Object.keys(s).length)&&this.queue.push({pending:s,pendingCount:Object.keys(s).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(o),pending:Object.keys(s),toLoadLanguages:Object.keys(d),toLoadNamespaces:Object.keys(u)}}loaded(a,t,r){const i=a.split("|"),o=i[0],s=i[1];t&&this.emit("failedLoading",o,s,t),!t&&r&&this.store.addResourceBundle(o,s,r,void 0,void 0,{skipCopy:!0}),this.state[a]=t?-1:2,t&&r&&(this.state[a]=0);const d={};this.queue.forEach(u=>{bi(u.loaded,[o],s),Ni(u,a),t&&u.errors.push(t),u.pendingCount===0&&!u.done&&(Object.keys(u.loaded).forEach(m=>{d[m]||(d[m]={});const g=u.loaded[m];g.length&&g.forEach(p=>{d[m][p]===void 0&&(d[m][p]=!0)})}),u.done=!0,u.errors.length?u.callback(u.errors):u.callback())}),this.emit("loaded",d),this.queue=this.queue.filter(u=>!u.done)}read(a,t,r,i=0,o=this.retryTimeout,s){if(!a.length)return s(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:a,ns:t,fcName:r,tried:i,wait:o,callback:s});return}this.readingCalls++;const d=(m,g)=>{if(this.readingCalls--,this.waitingReads.length>0){const p=this.waitingReads.shift();this.read(p.lng,p.ns,p.fcName,p.tried,p.wait,p.callback)}if(m&&g&&i<this.maxRetries){setTimeout(()=>{this.read.call(this,a,t,r,i+1,o*2,s)},o);return}s(m,g)},u=this.backend[r].bind(this.backend);if(u.length===2){try{const m=u(a,t);m&&typeof m.then=="function"?m.then(g=>d(null,g)).catch(d):d(null,m)}catch(m){d(m)}return}return u(a,t,d)}prepareLoading(a,t,r={},i){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();B(a)&&(a=this.languageUtils.toResolveHierarchy(a)),B(t)&&(t=[t]);const o=this.queueLoad(a,t,r,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.toLoad.forEach(s=>{this.loadOne(s)})}load(a,t,r){this.prepareLoading(a,t,{},r)}reload(a,t,r){this.prepareLoading(a,t,{reload:!0},r)}loadOne(a,t=""){const r=a.split("|"),i=r[0],o=r[1];this.read(i,o,"read",void 0,void 0,(s,d)=>{s&&this.logger.warn(`${t}loading namespace ${o} for language ${i} failed`,s),!s&&d&&this.logger.log(`${t}loaded namespace ${o} for language ${i}`,d),this.loaded(a,s,d)})}saveMissing(a,t,r,i,o,s={},d=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${r}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if(this.backend?.create){const u={...s,isUpdate:o},m=this.backend.create.bind(this.backend);if(m.length<6)try{let g;m.length===5?g=m(a,t,r,i,u):g=m(a,t,r,i),g&&typeof g.then=="function"?g.then(p=>d(null,p)).catch(d):d(null,g)}catch(g){d(g)}else m(a,t,r,i,d,u)}!a||!a[0]||this.store.addResource(a[0],t,r,i)}}}const Za=()=>({debug:!1,initAsync:!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:n=>{let a={};if(typeof n[1]=="object"&&(a=n[1]),B(n[1])&&(a.defaultValue=n[1]),B(n[2])&&(a.tDescription=n[2]),typeof n[2]=="object"||typeof n[3]=="object"){const t=n[3]||n[2];Object.keys(t).forEach(r=>{a[r]=t[r]})}return a},interpolation:{escapeValue:!0,format:n=>n,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),tn=n=>(B(n.ns)&&(n.ns=[n.ns]),B(n.fallbackLng)&&(n.fallbackLng=[n.fallbackLng]),B(n.fallbackNS)&&(n.fallbackNS=[n.fallbackNS]),n.supportedLngs?.indexOf?.("cimode")<0&&(n.supportedLngs=n.supportedLngs.concat(["cimode"])),typeof n.initImmediate=="boolean"&&(n.initAsync=n.initImmediate),n),xa=()=>{},Ii=n=>{Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach(t=>{typeof n[t]=="function"&&(n[t]=n[t].bind(n))})};class sa extends Fa{constructor(a={},t){if(super(),this.options=tn(a),this.services={},this.logger=we,this.modules={external:[]},Ii(this),t&&!this.isInitialized&&!a.isClone){if(!this.options.initAsync)return this.init(a,t),this;setTimeout(()=>{this.init(a,t)},0)}}init(a={},t){this.isInitializing=!0,typeof a=="function"&&(t=a,a={}),a.defaultNS==null&&a.ns&&(B(a.ns)?a.defaultNS=a.ns:a.ns.indexOf("translation")<0&&(a.defaultNS=a.ns[0]));const r=Za();this.options={...r,...this.options,...tn(a)},this.options.interpolation={...r.interpolation,...this.options.interpolation},a.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=a.keySeparator),a.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=a.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=r.overloadTranslationOptionHandler);const i=m=>m?typeof m=="function"?new m:m:null;if(!this.options.isClone){this.modules.logger?we.init(i(this.modules.logger),this.options):we.init(null,this.options);let m;this.modules.formatter?m=this.modules.formatter:m=zi;const g=new Yt(this.options);this.store=new Jt(this.options.resources,this.options);const p=this.services;p.logger=we,p.resourceStore=this.store,p.languageUtils=g,p.pluralResolver=new Di(g,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),m&&(!this.options.interpolation.format||this.options.interpolation.format===r.interpolation.format)&&(p.formatter=i(m),p.formatter.init&&p.formatter.init(p,this.options),this.options.interpolation.format=p.formatter.format.bind(p.formatter)),p.interpolator=new en(this.options),p.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},p.backendConnector=new Ti(i(this.modules.backend),p.resourceStore,p,this.options),p.backendConnector.on("*",(x,...b)=>{this.emit(x,...b)}),this.modules.languageDetector&&(p.languageDetector=i(this.modules.languageDetector),p.languageDetector.init&&p.languageDetector.init(p,this.options.detection,this.options)),this.modules.i18nFormat&&(p.i18nFormat=i(this.modules.i18nFormat),p.i18nFormat.init&&p.i18nFormat.init(this)),this.translator=new Ta(this.services,this.options),this.translator.on("*",(x,...b)=>{this.emit(x,...b)}),this.modules.external.forEach(x=>{x.init&&x.init(this)})}if(this.format=this.options.interpolation.format,t||(t=xa),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const m=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);m.length>0&&m[0]!=="dev"&&(this.options.lng=m[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(m=>{this[m]=(...g)=>this.store[m](...g)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(m=>{this[m]=(...g)=>(this.store[m](...g),this)});const d=ra(),u=()=>{const m=(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),t(g,p)};if(this.languages&&!this.isInitialized)return m(null,this.t.bind(this));this.changeLanguage(this.options.lng,m)};return this.options.resources||!this.options.initAsync?u():setTimeout(u,0),d}loadResources(a,t=xa){let r=t;const i=B(a)?a:this.language;if(typeof a=="function"&&(r=a),!this.options.resources||this.options.partialBundledLanguages){if(i?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const o=[],s=d=>{if(!d||d==="cimode")return;this.services.languageUtils.toResolveHierarchy(d).forEach(m=>{m!=="cimode"&&o.indexOf(m)<0&&o.push(m)})};i?s(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(u=>s(u)),this.options.preload?.forEach?.(d=>s(d)),this.services.backendConnector.load(o,this.options.ns,d=>{!d&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(d)})}else r(null)}reloadResources(a,t,r){const i=ra();return typeof a=="function"&&(r=a,a=void 0),typeof t=="function"&&(r=t,t=void 0),a||(a=this.languages),t||(t=this.options.ns),r||(r=xa),this.services.backendConnector.reload(a,t,o=>{i.resolve(),r(o)}),i}use(a){if(!a)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!a.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return a.type==="backend"&&(this.modules.backend=a),(a.type==="logger"||a.log&&a.warn&&a.error)&&(this.modules.logger=a),a.type==="languageDetector"&&(this.modules.languageDetector=a),a.type==="i18nFormat"&&(this.modules.i18nFormat=a),a.type==="postProcessor"&&On.addPostProcessor(a),a.type==="formatter"&&(this.modules.formatter=a),a.type==="3rdParty"&&this.modules.external.push(a),this}setResolvedLanguage(a){if(!(!a||!this.languages)&&!(["cimode","dev"].indexOf(a)>-1)){for(let t=0;t<this.languages.length;t++){const r=this.languages[t];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}!this.resolvedLanguage&&this.languages.indexOf(a)<0&&this.store.hasLanguageSomeTranslations(a)&&(this.resolvedLanguage=a,this.languages.unshift(a))}}changeLanguage(a,t){this.isLanguageChangingTo=a;const r=ra();this.emit("languageChanging",a);const i=d=>{this.language=d,this.languages=this.services.languageUtils.toResolveHierarchy(d),this.resolvedLanguage=void 0,this.setResolvedLanguage(d)},o=(d,u)=>{u?this.isLanguageChangingTo===a&&(i(u),this.translator.changeLanguage(u),this.isLanguageChangingTo=void 0,this.emit("languageChanged",u),this.logger.log("languageChanged",u)):this.isLanguageChangingTo=void 0,r.resolve((...m)=>this.t(...m)),t&&t(d,(...m)=>this.t(...m))},s=d=>{!a&&!d&&this.services.languageDetector&&(d=[]);const u=B(d)?d:d&&d[0],m=this.store.hasLanguageSomeTranslations(u)?u:this.services.languageUtils.getBestMatchFromCodes(B(d)?[d]:d);m&&(this.language||i(m),this.translator.language||this.translator.changeLanguage(m),this.services.languageDetector?.cacheUserLanguage?.(m)),this.loadResources(m,g=>{o(g,m)})};return!a&&this.services.languageDetector&&!this.services.languageDetector.async?s(this.services.languageDetector.detect()):!a&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(s):this.services.languageDetector.detect(s):s(a),r}getFixedT(a,t,r){const i=(o,s,...d)=>{let u;typeof s!="object"?u=this.options.overloadTranslationOptionHandler([o,s].concat(d)):u={...s},u.lng=u.lng||i.lng,u.lngs=u.lngs||i.lngs,u.ns=u.ns||i.ns,u.keyPrefix!==""&&(u.keyPrefix=u.keyPrefix||r||i.keyPrefix);const m=this.options.keySeparator||".";let g;return u.keyPrefix&&Array.isArray(o)?g=o.map(p=>(typeof p=="function"&&(p=it(p,{...this.options,...s})),`${u.keyPrefix}${m}${p}`)):(typeof o=="function"&&(o=it(o,{...this.options,...s})),g=u.keyPrefix?`${u.keyPrefix}${m}${o}`:o),this.t(g,u)};return B(a)?i.lng=a:i.lngs=a,i.ns=t,i.keyPrefix=r,i}t(...a){return this.translator?.translate(...a)}exists(...a){return this.translator?.exists(...a)}setDefaultNamespace(a){this.options.defaultNS=a}hasLoadedNamespace(a,t={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=t.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,o=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const s=(d,u)=>{const m=this.services.backendConnector.state[`${d}|${u}`];return m===-1||m===0||m===2};if(t.precheck){const d=t.precheck(this,s);if(d!==void 0)return d}return!!(this.hasResourceBundle(r,a)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||s(r,a)&&(!i||s(o,a)))}loadNamespaces(a,t){const r=ra();return this.options.ns?(B(a)&&(a=[a]),a.forEach(i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}),this.loadResources(i=>{r.resolve(),t&&t(i)}),r):(t&&t(),Promise.resolve())}loadLanguages(a,t){const r=ra();B(a)&&(a=[a]);const i=this.options.preload||[],o=a.filter(s=>i.indexOf(s)<0&&this.services.languageUtils.isSupportedCode(s));return o.length?(this.options.preload=i.concat(o),this.loadResources(s=>{r.resolve(),t&&t(s)}),r):(t&&t(),Promise.resolve())}dir(a){if(a||(a=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!a)return"rtl";try{const i=new Intl.Locale(a);if(i&&i.getTextInfo){const o=i.getTextInfo();if(o&&o.direction)return o.direction}}catch{}const t=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=this.services?.languageUtils||new Yt(Za());return a.toLowerCase().indexOf("-latn")>1?"ltr":t.indexOf(r.getLanguagePartFromCode(a))>-1||a.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(a={},t){const r=new sa(a,t);return r.createInstance=sa.createInstance,r}cloneInstance(a={},t=xa){const r=a.forkResourceStore;r&&delete a.forkResourceStore;const i={...this.options,...a,isClone:!0},o=new sa(i);if((a.debug!==void 0||a.prefix!==void 0)&&(o.logger=o.logger.clone(a)),["store","services","language"].forEach(d=>{o[d]=this[d]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},r){const d=Object.keys(this.store.data).reduce((u,m)=>(u[m]={...this.store.data[m]},u[m]=Object.keys(u[m]).reduce((g,p)=>(g[p]={...u[m][p]},g),u[m]),u),{});o.store=new Jt(d,i),o.services.resourceStore=o.store}if(a.interpolation){const u={...Za().interpolation,...this.options.interpolation,...a.interpolation},m={...i,interpolation:u};o.services.interpolator=new en(m)}return o.translator=new Ta(o.services,i),o.translator.on("*",(d,...u)=>{o.emit(d,...u)}),o.init(i,t),o.translator.options=i,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const de=sa.createInstance();de.createInstance;de.dir;de.init;de.loadResources;de.reloadResources;de.use;de.changeLanguage;de.getFixedT;de.t;de.exists;de.setDefaultNamespace;de.hasLoadedNamespace;de.loadNamespaces;de.loadLanguages;const Ci=(n,a,t,r)=>{const i=[t,{code:a,...r||{}}];if(n?.services?.logger?.forward)return n.services.logger.forward(i,"warn","react-i18next::",!0);Oe(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),n?.services?.logger?.warn?n.services.logger.warn(...i):console?.warn&&console.warn(...i)},nn={},Kn=(n,a,t,r)=>{Oe(t)&&nn[t]||(Oe(t)&&(nn[t]=new Date),Ci(n,a,t,r))},Bn=(n,a)=>()=>{if(n.isInitialized)a();else{const t=()=>{setTimeout(()=>{n.off("initialized",t)},0),a()};n.on("initialized",t)}},ot=(n,a,t)=>{n.loadNamespaces(a,Bn(n,t))},rn=(n,a,t,r)=>{if(Oe(t)&&(t=[t]),n.options.preload&&n.options.preload.indexOf(a)>-1)return ot(n,t,r);t.forEach(i=>{n.options.ns.indexOf(i)<0&&n.options.ns.push(i)}),n.loadLanguages(a,Bn(n,r))},Fi=(n,a,t={})=>!a.languages||!a.languages.length?(Kn(a,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:a.languages}),!0):a.hasLoadedNamespace(n,{lng:t.lng,precheck:(r,i)=>{if(t.bindI18n&&t.bindI18n.indexOf("languageChanging")>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!i(r.isLanguageChangingTo,n))return!1}}),Oe=n=>typeof n=="string",Ei=n=>typeof n=="object"&&n!==null,Oi=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Li={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},Ki=n=>Li[n],Bi=n=>n.replace(Oi,Ki);let st={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Bi,transDefaultProps:void 0};const Gi=(n={})=>{st={...st,...n}},Hi=()=>st;let Gn;const Ri=n=>{Gn=n},Ui=()=>Gn,$i={type:"3rdParty",init(n){Gi(n.options.react),Ri(n)}},Vi=h.createContext();class Wi{constructor(){this.usedNamespaces={}}addUsedNamespaces(a){a.forEach(t=>{this.usedNamespaces[t]||(this.usedNamespaces[t]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var Xa={exports:{}},Qa={};var on;function qi(){if(on)return Qa;on=1;var n=$r();function a(p,k){return p===k&&(p!==0||1/p===1/k)||p!==p&&k!==k}var t=typeof Object.is=="function"?Object.is:a,r=n.useState,i=n.useEffect,o=n.useLayoutEffect,s=n.useDebugValue;function d(p,k){var x=k(),b=r({inst:{value:x,getSnapshot:k}}),w=b[0].inst,S=b[1];return o(function(){w.value=x,w.getSnapshot=k,u(w)&&S({inst:w})},[p,x,k]),i(function(){return u(w)&&S({inst:w}),p(function(){u(w)&&S({inst:w})})},[p]),s(x),x}function u(p){var k=p.getSnapshot;p=p.value;try{var x=k();return!t(p,x)}catch{return!0}}function m(p,k){return k()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?m:d;return Qa.useSyncExternalStore=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:g,Qa}var sn;function Ji(){return sn||(sn=1,Xa.exports=qi()),Xa.exports}var _i=Ji();const Yi=(n,a)=>Oe(a)?a:Ei(a)&&Oe(a.defaultValue)?a.defaultValue:Array.isArray(n)?n[n.length-1]:n,Zi={t:Yi,ready:!1},Xi=()=>()=>{},ce=(n,a={})=>{const{i18n:t}=a,{i18n:r,defaultNS:i}=h.useContext(Vi)||{},o=t||r||Ui();o&&!o.reportNamespaces&&(o.reportNamespaces=new Wi),o||Kn(o,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const s=h.useMemo(()=>({...Hi(),...o?.options?.react,...a}),[o,a]),{useSuspense:d,keyPrefix:u}=s,m=i||o?.options?.defaultNS,g=Oe(m)?[m]:m||["translation"],p=h.useMemo(()=>g,g);o?.reportNamespaces?.addUsedNamespaces?.(p);const k=h.useRef(0),x=h.useCallback(K=>{if(!o)return Xi;const{bindI18n:O,bindI18nStore:E}=s,G=()=>{k.current+=1,K()};return O&&o.on(O,G),E&&o.store.on(E,G),()=>{O&&O.split(" ").forEach(c=>o.off(c,G)),E&&E.split(" ").forEach(c=>o.store.off(c,G))}},[o,s]),b=h.useRef(),w=h.useCallback(()=>{if(!o)return Zi;const K=!!(o.isInitialized||o.initializedStoreOnce)&&p.every(ue=>Fi(ue,o,s)),O=a.lng||o.language,E=k.current,G=b.current;if(G&&G.ready===K&&G.lng===O&&G.keyPrefix===u&&G.revision===E)return G;const $={t:o.getFixedT(O,s.nsMode==="fallback"?p:p[0],u),ready:K,lng:O,keyPrefix:u,revision:E};return b.current=$,$},[o,p,u,s,a.lng]),[S,F]=h.useState(0),{t:L,ready:D}=_i.useSyncExternalStore(x,w,w);h.useEffect(()=>{if(o&&!D&&!d){const K=()=>F(O=>O+1);a.lng?rn(o,a.lng,p,K):ot(o,p,K)}},[o,a.lng,p,D,d,S]);const A=o||{},N=h.useRef(null),P=h.useRef(),U=K=>{const O=Object.getOwnPropertyDescriptors(K);O.__original&&delete O.__original;const E=Object.create(Object.getPrototypeOf(K),O);if(!Object.prototype.hasOwnProperty.call(E,"__original"))try{Object.defineProperty(E,"__original",{value:K,writable:!1,enumerable:!1,configurable:!1})}catch{}return E},q=h.useMemo(()=>{const K=A,O=K?.language;let E=K;K&&(N.current&&N.current.__original===K?P.current!==O?(E=U(K),N.current=E,P.current=O):E=N.current:(E=U(K),N.current=E,P.current=O));const G=[L,E,D];return G.t=L,G.i18n=E,G.ready=D,G},[L,A,D,A.resolvedLanguage,A.language,A.languages]);if(o&&d&&!D)throw new Promise(K=>{const O=()=>K();a.lng?rn(o,a.lng,p,O):ot(o,p,O)});return q},{slice:Qi,forEach:eo}=[];function ao(n){return eo.call(Qi.call(arguments,1),a=>{if(a)for(const t in a)n[t]===void 0&&(n[t]=a[t])}),n}function to(n){return typeof n!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(t=>t.test(n))}const ln=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,no=function(n,a){const r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},i=encodeURIComponent(a);let o=`${n}=${i}`;if(r.maxAge>0){const s=r.maxAge-0;if(Number.isNaN(s))throw new Error("maxAge should be a Number");o+=`; Max-Age=${Math.floor(s)}`}if(r.domain){if(!ln.test(r.domain))throw new TypeError("option domain is invalid");o+=`; Domain=${r.domain}`}if(r.path){if(!ln.test(r.path))throw new TypeError("option path is invalid");o+=`; Path=${r.path}`}if(r.expires){if(typeof r.expires.toUTCString!="function")throw new TypeError("option expires is invalid");o+=`; Expires=${r.expires.toUTCString()}`}if(r.httpOnly&&(o+="; HttpOnly"),r.secure&&(o+="; Secure"),r.sameSite)switch(typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite){case!0:o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"strict":o+="; SameSite=Strict";break;case"none":o+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return r.partitioned&&(o+="; Partitioned"),o},dn={create(n,a,t,r){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};t&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+t*60*1e3)),r&&(i.domain=r),document.cookie=no(n,a,i)},read(n){const a=`${n}=`,t=document.cookie.split(";");for(let r=0;r<t.length;r++){let i=t[r];for(;i.charAt(0)===" ";)i=i.substring(1,i.length);if(i.indexOf(a)===0)return i.substring(a.length,i.length)}return null},remove(n,a){this.create(n,"",-1,a)}};var ro={name:"cookie",lookup(n){let{lookupCookie:a}=n;if(a&&typeof document<"u")return dn.read(a)||void 0},cacheUserLanguage(n,a){let{lookupCookie:t,cookieMinutes:r,cookieDomain:i,cookieOptions:o}=a;t&&typeof document<"u"&&dn.create(t,n,r,i,o)}},io={name:"querystring",lookup(n){let{lookupQuerystring:a}=n,t;if(typeof window<"u"){let{search:r}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(r=window.location.hash.substring(window.location.hash.indexOf("?")));const o=r.substring(1).split("&");for(let s=0;s<o.length;s++){const d=o[s].indexOf("=");d>0&&o[s].substring(0,d)===a&&(t=o[s].substring(d+1))}}return t}},oo={name:"hash",lookup(n){let{lookupHash:a,lookupFromHashIndex:t}=n,r;if(typeof window<"u"){const{hash:i}=window.location;if(i&&i.length>2){const o=i.substring(1);if(a){const s=o.split("&");for(let d=0;d<s.length;d++){const u=s[d].indexOf("=");u>0&&s[d].substring(0,u)===a&&(r=s[d].substring(u+1))}}if(r)return r;if(!r&&t>-1){const s=i.match(/\/([a-zA-Z-]*)/g);return Array.isArray(s)?s[typeof t=="number"?t:0]?.replace("/",""):void 0}}}return r}};let $e=null;const cn=()=>{if($e!==null)return $e;try{if($e=typeof window<"u"&&window.localStorage!==null,!$e)return!1;const n="i18next.translate.boo";window.localStorage.setItem(n,"foo"),window.localStorage.removeItem(n)}catch{$e=!1}return $e};var so={name:"localStorage",lookup(n){let{lookupLocalStorage:a}=n;if(a&&cn())return window.localStorage.getItem(a)||void 0},cacheUserLanguage(n,a){let{lookupLocalStorage:t}=a;t&&cn()&&window.localStorage.setItem(t,n)}};let Ve=null;const un=()=>{if(Ve!==null)return Ve;try{if(Ve=typeof window<"u"&&window.sessionStorage!==null,!Ve)return!1;const n="i18next.translate.boo";window.sessionStorage.setItem(n,"foo"),window.sessionStorage.removeItem(n)}catch{Ve=!1}return Ve};var lo={name:"sessionStorage",lookup(n){let{lookupSessionStorage:a}=n;if(a&&un())return window.sessionStorage.getItem(a)||void 0},cacheUserLanguage(n,a){let{lookupSessionStorage:t}=a;t&&un()&&window.sessionStorage.setItem(t,n)}},co={name:"navigator",lookup(n){const a=[];if(typeof navigator<"u"){const{languages:t,userLanguage:r,language:i}=navigator;if(t)for(let o=0;o<t.length;o++)a.push(t[o]);r&&a.push(r),i&&a.push(i)}return a.length>0?a:void 0}},uo={name:"htmlTag",lookup(n){let{htmlTag:a}=n,t;const r=a||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(t=r.getAttribute("lang")),t}},mo={name:"path",lookup(n){let{lookupFromPathIndex:a}=n;if(typeof window>"u")return;const t=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(t)?t[typeof a=="number"?a:0]?.replace("/",""):void 0}},po={name:"subdomain",lookup(n){let{lookupFromSubdomainIndex:a}=n;const t=typeof a=="number"?a+1:1,r=typeof window<"u"&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(r)return r[t]}};let Hn=!1;try{document.cookie,Hn=!0}catch{}const Rn=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];Hn||Rn.splice(1,1);const go=()=>({order:Rn,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:n=>n});class Un{constructor(a){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(a,t)}init(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=a,this.options=ao(t,this.options||{},go()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=i=>i.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector(ro),this.addDetector(io),this.addDetector(so),this.addDetector(lo),this.addDetector(co),this.addDetector(uo),this.addDetector(mo),this.addDetector(po),this.addDetector(oo)}addDetector(a){return this.detectors[a.name]=a,this}detect(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,t=[];return a.forEach(r=>{if(this.detectors[r]){let i=this.detectors[r].lookup(this.options);i&&typeof i=="string"&&(i=[i]),i&&(t=t.concat(i))}}),t=t.filter(r=>r!=null&&!to(r)).map(r=>this.options.convertDetectedLanguage(r)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?t:t.length>0?t[0]:null}cacheUserLanguage(a){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;t&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(a)>-1||t.forEach(r=>{this.detectors[r]&&this.detectors[r].cacheUserLanguage(a,this.options)}))}}Un.type="languageDetector";const ho={loading:"جاري التحميل...",save:"حفظ",saving:"جاري الحفظ...",cancel:"إلغاء",delete:"حذف",edit:"تعديل",close:"إغلاق",back:"رجوع",next:"التالي",confirm:"تأكيد",error:"خطأ",success:"نجاح",warning:"تحذير",or:"أو",optional:"اختياري",enabled:"مُفعّل",disabled:"معطّل",on:"تشغيل",off:"إيقاف",yes:"نعم",no:"لا",search:"بحث",noResults:"لم يتم العثور على نتائج",retry:"إعادة المحاولة",refresh:"تحديث",download:"تحميل",upload:"رفع",export:"تصدير",import:"استيراد",reset:"إعادة تعيين",apply:"تطبيق",clear:"مسح",all:"الكل",none:"لا شيء",default:"افتراضي",custom:"مخصص",mode:"الوضع",multiUser:"متعدد المستخدمين",remove:"إزالة"},bo={name:"Libre WebUI",shortName:"Libre"},ko={login:{title:"مرحباً بعودتك",subtitle:"سجّل الدخول إلى حسابك للمتابعة",username:"اسم المستخدم",usernamePlaceholder:"أدخل اسم المستخدم",password:"كلمة المرور",passwordPlaceholder:"أدخل كلمة المرور",signIn:"تسجيل الدخول",signingIn:"جاري تسجيل الدخول...",noAccount:"ليس لديك حساب؟",signUpHere:"سجّل هنا",loginSuccess:"تم تسجيل الدخول بنجاح!",loginFailed:"فشل تسجيل الدخول",checkCredentials:"فشل تسجيل الدخول. يرجى التحقق من بيانات الاعتماد.",enterBoth:"يرجى إدخال اسم المستخدم وكلمة المرور",githubSuccess:"تم تسجيل الدخول عبر GitHub بنجاح!",githubFailed:"فشلت مصادقة GitHub",githubVerifyFailed:"فشل التحقق من مصادقة GitHub"},signup:{title:"إنشاء حساب",subtitle:"سجّل للحصول على حساب جديد",username:"اسم المستخدم",usernamePlaceholder:"اختر اسم مستخدم",email:"البريد الإلكتروني",emailPlaceholder:"your@email.com",password:"كلمة المرور",passwordPlaceholder:"اختر كلمة مرور",confirmPassword:"تأكيد كلمة المرور",confirmPasswordPlaceholder:"أكّد كلمة المرور",createAccount:"إنشاء حساب",creatingAccount:"جاري إنشاء الحساب...",hasAccount:"لديك حساب بالفعل؟",signInHere:"سجّل الدخول هنا",signupSuccess:"تم إنشاء الحساب بنجاح!",signupFailed:"فشل التسجيل",tryAgain:"فشل التسجيل. يرجى المحاولة مرة أخرى.",usernameRequired:"اسم المستخدم وكلمة المرور مطلوبان",passwordMismatch:"كلمات المرور غير متطابقة",passwordTooShort:"يجب أن تكون كلمة المرور 6 أحرف على الأقل"},logout:{button:"تسجيل الخروج",success:"تم تسجيل الخروج بنجاح"},oauth:{continueWith:"المتابعة مع {{provider}}",connectingTo:"جاري الاتصال بـ {{provider}}...",github:"GitHub",huggingFace:"Hugging Face"}},fo={welcome:{title:"مرحباً بك في Libre WebUI",subtitle:"لنبدأ",description:"قم بإعداد Libre WebUI الخاص بك في خطوات قليلة",createAdmin:"إنشاء حساب المسؤول",features:{secure:{title:"آمن وخاص",description:"محادثاتك تبقى على جهازك"},fast:{title:"سريع ومتجاوب",description:"محسّن للسرعة والأداء"},openSource:{title:"مفتوح المصدر",description:"برنامج مجاني ومفتوح المصدر"}}},admin:{title:"إنشاء حساب المسؤول",subtitle:"إعداد المسؤول",description:"أنشئ أول حساب مسؤول لـ Libre WebUI الخاص بك",usernamePlaceholder:"أدخل اسم المسؤول",passwordPlaceholder:"أدخل كلمة المرور (6 أحرف على الأقل)",confirmPlaceholder:"أكّد كلمة المرور",creating:"جاري الإنشاء...",createAdmin:"إنشاء المسؤول",success:"تم إنشاء حساب المسؤول بنجاح!",failed:"فشل إنشاء حساب المسؤول",fillAllFields:"يرجى ملء جميع الحقول",note:"سيكون هذا حساب المسؤول الرئيسي لـ Libre WebUI الخاص بك"},encryptionKey:{title:"احفظ مفتاح التشفير",subtitle:"مهم: احفظ هذا المفتاح",description:"يحمي مفتاح التشفير هذا بياناتك الحساسة. احفظه بأمان - ستحتاجه إذا احتجت لاستعادة قاعدة البيانات.",warning:"تحذير",warningText:"إذا فقدت هذا المفتاح واحتجت لاستعادة قاعدة البيانات، ستكون بياناتك المشفرة (مفاتيح API، التفضيلات) غير قابلة للاسترداد.",label:"مفتاح التشفير الخاص بك",loading:"جاري التحميل...",copyToClipboard:"نسخ إلى الحافظة",copied:"تم نسخ مفتاح التشفير إلى الحافظة!",copyFailed:"فشل نسخ المفتاح إلى الحافظة",envNote:"هذا المفتاح محفوظ أيضاً في ملف backend/.env كـ ENCRYPTION_KEY",acknowledgment:"لقد حفظت مفتاح التشفير في مكان آمن وأفهم أن فقدانه قد يؤدي إلى فقدان البيانات.",confirmRequired:"يرجى التأكيد على أنك حفظت مفتاح التشفير",continue:"المتابعة إلى Libre WebUI"}},yo={greeting:{morning:"صباح الخير",afternoon:"مساء الخير",evening:"مساء الخير",night:"تصبح على خير"},welcome:{helpToday:"كيف يمكنني مساعدتك اليوم؟",helpTonight:"كيف يمكنني مساعدتك الليلة؟"},input:{placeholder:"أرسل رسالة",messagePlaceholder:"رسالة...",attachImages:"إرفاق صور",attachments:"المرفقات والميزات المتقدمة",sendMessage:"إرسال الرسالة",stopGeneration:"إيقاف التوليد"},session:{new:"محادثة جديدة",private:"خاص",privateMode:"الوضع الخاص",privateDescription:"لن يتم حفظ هذه المحادثة",privateTooltip:"ابدأ محادثة خاصة لن يتم حفظها",deleteConfirm:"هل أنت متأكد من حذف هذه المحادثة؟",generatingTitle:"جاري توليد العنوان",noChats:"لا توجد محادثات بعد",createFirst:"أنشئ أول محادثة أعلاه",chats:"المحادثات",renameChat:"إعادة تسمية المحادثة",deleteChat:"حذف المحادثة"},persona:{applied:"تم تطبيق الشخصية",label:"الشخصية"},model:{updated:"تم تحديث النموذج",noModels:"لا توجد نماذج متاحة",noModelsDescription:"لا توجد نماذج متاحة. تأكد من تشغيل Ollama وتثبيت النماذج.",pullCommand:"ollama pull llama3.2:3b",noModelsTooltip:"لا توجد نماذج متاحة. يرجى التأكد من تشغيل Ollama وتثبيت النماذج."},footer:{disclaimer:"قد يرتكب الذكاء الاصطناعي أخطاء - تحقق من المعلومات المهمة",images:"{{count}} صورة",images_plural:"{{count}} صور",structuredOutput:"مخرجات منظمة"},mediaUpload:{dropImagesHere:"أفلت الصور هنا أو",supportedFormats:"يدعم: JPG، PNG، GIF، WebP (حد أقصى 10 ميجابايت لكل صورة)",browse:"تصفح"},structuredOutput:{title:"تنسيق الاستجابة",none:"بدون (لغة طبيعية)",noneDescription:"استجابة باللغة الطبيعية الافتراضية",json:"JSON",jsonDescription:"تنسيق JSON منظم",list:"قائمة",listDescription:"مصفوفة من العناصر",summary:"ملخص",summaryDescription:"ملخص المستند مع النقاط الرئيسية",analysis:"تحليل",analysisDescription:"تحليل منظم مع الإيجابيات والسلبيات",custom:"مخطط مخصص",customDescription:"حدد مخطط JSON الخاص بك",customSchema:"مخطط JSON مخصص",schemaPreview:"معاينة المخطط",applySchema:"تطبيق المخطط",cancel:"إلغاء",enabled:"تم تفعيل المخرجات المنظمة"}},vo={navigation:{chat:"محادثة",models:"النماذج",personas:"الشخصيات",imagine:"تخيّل",settings:"الإعدادات",userManagement:"إدارة المستخدمين",signOut:"تسجيل الخروج"},toggleSize:"تبديل حجم الشريط الجانبي",expandSidebar:"توسيع الشريط الجانبي"},xo={menu:{changePicture:"تغيير الصورة",settings:"الإعدادات",userManagement:"إدارة المستخدمين",logout:"تسجيل الخروج"},avatar:{title:"تغيير صورة الملف الشخصي",updated:"تم تحديث صورة الملف الشخصي",updateFailed:"فشل تحديث صورة الملف الشخصي",saving:"جاري الحفظ..."},profile:{noEmail:"لم يتم تقديم بريد إلكتروني"}},So={title:"الإعدادات",tabs:{appearance:"المظهر",model:"النموذج",systemMessage:"رسالة النظام",plugins:"الإضافات",generation:"التوليد",documents:"المستندات",tts:"تحويل النص إلى كلام",imageGen:"توليد الصور",system:"النظام",data:"البيانات",about:"حول"},appearance:{title:"المظهر",language:{title:"اللغة",description:"اختر لغتك المفضلة"},theme:{title:"السمة",light:"فاتح",dark:"داكن",amoled:"AMOLED",system:"النظام"},chatInterface:{title:"واجهة المحادثة",showUsername:"إظهار اسم المستخدم",showUsernameDescription:"عرض اسم المستخدم في رسائل المحادثة"},background:{title:"صورة الخلفية",enable:"تفعيل صورة الخلفية",enableDescription:"عرض خلفية مخصصة مع تأثير التمويه",blur:"التمويه",opacity:"الشفافية",upload:"رفع صورة الخلفية",dragDrop:"اسحب وأفلت صورة أو انقر للتصفح",chooseImage:"اختر صورة"}},system:{title:"النظام",currentModel:"النموذج الحالي",notSet:"غير محدد"},saveSettings:"حفظ الإعدادات",model:{title:"إعدادات النموذج",defaultModel:"النموذج الافتراضي",defaultModelDescription:"سيتم استخدام هذا النموذج افتراضياً للمحادثات الجديدة",selectModel:"اختر نموذجاً",updateAll:"تحديث جميع النماذج",updateAllDescription:"التحقق من التحديثات وسحب أحدث إصدارات جميع النماذج المثبتة",updateAllButton:"تحديث الكل",updating:"جاري تحديث النماذج...",currentModelInfo:"معلومات النموذج الحالي",name:"الاسم",size:"الحجم",family:"العائلة",format:"التنسيق",status:"الحالة",statusStarting:"جاري البدء...",statusComplete:"مكتمل",statusError:"خطأ",bulkOperations:"العمليات المجمعة",autoTitle:{title:"توليد العنوان التلقائي",enable:"تفعيل العنوان التلقائي",enableDescription:"توليد عناوين تلقائياً للمحادثات الجديدة",taskModel:"نموذج المهام",selectTaskModel:"اختر نموذج المهام",taskModelDescription:"النموذج المستخدم لتوليد عناوين المحادثات"}},systemMessage:{title:"رسالة النظام",description:"عيّن رسالة نظام مخصصة ستُستخدم لجميع المحادثات الجديدة.",placeholder:"أدخل رسالة النظام...",saved:"تم حفظ رسالة النظام",saveFailed:"فشل حفظ رسالة النظام"},plugins:{title:"الإضافات",description:"إدارة الإضافات المثبتة",addNew:"إضافة إضافة جديدة",upload:"رفع إضافة",addJson:"إضافة JSON",uploading:"جاري الرفع...",jsonPlaceholder:"الصق إعدادات JSON للإضافة...",install:"تثبيت الإضافة",noPlugins:"لا توجد إضافات مثبتة",noPluginsDescription:"أضف إضافة لتوسيع الوظائف",loading:"جاري تحميل الإضافات...",installed:"الإضافات المثبتة",active:"الإضافات النشطة",activeLabel:"نشط",inactive:"غير نشط",activate:"تفعيل",deactivate:"إلغاء التفعيل",models:"نماذج",apiKeySet:"تم تعيين مفتاح API",apiKeyConfiguration:"إعداد مفتاح API",apiKeyEnvAlternative:"بدلاً من ذلك، عيّن",environmentVariable:"متغير البيئة",apiKeyConfigured:"تم إعداد مفتاح API",apiKeyPlaceholder:"أدخل مفتاح API...",saveApiKey:"حفظ مفتاح API",apiKey:{title:"مفتاح API",placeholder:"أدخل مفتاح API",save:"حفظ المفتاح",remove:"إزالة المفتاح",configured:"تم إعداد مفتاح API",notConfigured:"مفتاح API مطلوب",saved:"تم حفظ مفتاح API بنجاح",removed:"تم إزالة مفتاح API",saveFailed:"فشل حفظ مفتاح API",removeFailed:"فشل إزالة مفتاح API",enterKey:"يرجى إدخال مفتاح API"}},generation:{title:"خيارات التوليد",description:"إعداد كيفية توليد الذكاء الاصطناعي للاستجابات",coreParameters:"المعلمات الأساسية",temperature:"درجة الحرارة",temperatureDescription:"يتحكم في العشوائية. القيم الأقل أكثر تركيزاً، والقيم الأعلى أكثر إبداعاً.",topP:"Top P",topPDescription:"يتحكم في التنوع عبر أخذ العينات النووية. القيم الأقل تركز على الرموز المحتملة.",topK:"Top K",topKDescription:"يحد اختيار الرموز لأكثر K رمز احتمالاً. عيّن 0 للتعطيل.",minP:"Min P",minPDescription:"الحد الأدنى لاحتمال اختيار الرمز.",generationControl:"التحكم في التوليد",maxTokens:"الحد الأقصى للرموز",maxTokensDescription:"الحد الأقصى لعدد الرموز المولدة في الاستجابة.",repeatPenalty:"عقوبة التكرار",repeatPenaltyDescription:"يعاقب الرموز المتكررة. القيم الأعلى تقلل التكرار.",contextLength:"طول السياق",contextLengthDescription:"الحد الأقصى لحجم نافذة السياق للمحادثات.",seed:"البذرة",optional:"اختياري",random:"عشوائي",seedDescription:"عيّن بذرة محددة للمخرجات القابلة للتكرار.",advancedOptions:"خيارات متقدمة",presencePenalty:"عقوبة الوجود",presencePenaltyDescription:"يعاقب الرموز التي تظهر في السياق.",frequencyPenalty:"عقوبة التكرار",frequencyPenaltyDescription:"يعاقب الرموز المستخدمة بشكل متكرر.",stopSequences:"تسلسلات الإيقاف",commaSeparated:"مفصولة بفواصل",stopSequencesDescription:"رموز مخصصة ستوقف التوليد عند مصادفتها.",resetDefaults:"إعادة تعيين الافتراضيات",saveOptions:"حفظ الخيارات",embeddingSettings:"إعدادات التضمين",enableEmbeddings:"تفعيل تضمين المستندات"},documents:{title:"إعدادات المستندات",embeddings:{title:"التضمينات",enable:"تفعيل تضمين المستندات",model:"نموذج التضمين",modelDescription:"اختر النموذج المستخدم لتضمين المستندات",chunkSize:"حجم القطعة",chunkSizeInTokens:"(بالرموز)",chunkSizeDescription:"حجم قطع النص للتضمين",chunkOverlap:"تداخل القطع",chunkOverlapInTokens:"(بالرموز)",chunkOverlapDescription:"التداخل بين القطع المتتالية",similarityThreshold:"عتبة التشابه",similarityDescription:"الحد الأدنى لدرجة التشابه لتضمين النتائج",status:"حالة التضمين",statusLabel:"الحالة",available:"متاح",unavailable:"غير متاح",chunksWithEmbeddings:"قطع مع تضمينات",coverage:"التغطية",regenerate:"إعادة توليد التضمينات",regenerating:"جاري إعادة التوليد..."}},tts:{title:"تحويل النص إلى كلام",description:"إعداد إعدادات تحويل النص إلى كلام لقراءة الرسائل بصوت عالٍ",loadingProviders:"جاري تحميل مزودي TTS...",noProviders:"لا يوجد مزودو TTS",noProvidersDescription:"قم بإعداد إضافة مع دعم TTS لتفعيل تحويل النص إلى كلام",enable:"تفعيل TTS",enableDescription:"السماح بتحويل النص إلى كلام لرسائل المساعد",autoPlay:"تشغيل تلقائي للاستجابات",autoPlayDescription:"قراءة رسائل المساعد الجديدة بصوت عالٍ تلقائياً",voiceConfiguration:"إعداد الصوت",model:"نموذج TTS",modelDescription:"اختر النموذج لتوليد الكلام",voice:"الصوت",selectVoice:"اختر صوتاً",voiceDescription:"اختر الصوت لتحويل النص إلى كلام",speed:"السرعة",speedSlow:"0.5x",speedNormal:"1.0x",speedFast:"2.0x",availableProviders:"المزودون المتاحون",models:"نماذج",test:"اختبار",testing:"جاري الاختبار...",stop:"إيقاف"},imageGen:{title:"توليد الصور",description:"إعداد إعدادات ومزودي توليد الصور",loadingProviders:"جاري تحميل مزودي توليد الصور...",noProviders:"لا يوجد مزودو توليد صور",noProvidersDescription:"قم بإعداد إضافة مع دعم توليد الصور",enable:"تفعيل توليد الصور",enableDescription:"السماح بتوليد الصور بالذكاء الاصطناعي في المحادثات",configuration:"الإعداد",model:"النموذج",modelDescription:"اختر النموذج لتوليد الصور",size:"الحجم",sizeDescription:"دقة الصور المولدة",quality:"الجودة",qualityDescription:"مستوى جودة الصور المولدة",style:"الأسلوب",styleDescription:"إعداد الأسلوب المسبق للصور المولدة",availableProviders:"المزودون المتاحون",models:"نماذج"},data:{title:"إدارة البيانات",export:"تصدير البيانات",exportDescription:"تحميل جميع بياناتك بما في ذلك التفضيلات والجلسات والمستندات.",exportAll:"تصدير جميع البيانات",import:"استيراد البيانات",importDescription:"استيراد البيانات من تصدير سابق.",importData:"استيراد البيانات",importing:"جاري الاستيراد...",clearSessions:"مسح الجلسات",clearSessionsDescription:"حذف جميع جلسات المحادثة. لا يمكن التراجع عن هذا الإجراء.",clearAll:"مسح الكل",clearing:"جاري المسح...",importOptions:"خيارات الاستيراد",importOptionsDescription:"اختر كيفية التعامل مع البيانات الموجودة",skipDuplicates:"تخطي المكررات",overwrite:"الكتابة فوق الموجود",importResults:"نتائج الاستيراد",preferences:"التفضيلات",imported:"تم الاستيراد",failed:"فشل",sessions:"الجلسات",importedLabel:"تم الاستيراد",skipped:"تم التخطي",documents:"المستندات",errors:"أخطاء"},about:{title:"حول",versionLabel:"الإصدار",ollama:{title:"حالة Ollama",version:"الإصدار",healthy:"سليم",unhealthy:"غير سليم"},stats:{models:"النماذج",sessions:"الجلسات"},features:{privacy:{title:"الخصوصية أولاً",description:"بياناتك تبقى على جهازك"},openSource:{title:"مفتوح المصدر",description:"برنامج مجاني ومفتوح المصدر"},localInference:{title:"استدلال محلي",description:"تشغيل نماذج الذكاء الاصطناعي محلياً مع Ollama"}},openSourceBy:"مفتوح المصدر بواسطة {{company}}",links:{title:"الروابط",github:"GitHub",githubDescription:"عرض الكود المصدري والمساهمة",website:"الموقع",websiteDescription:"زيارة موقعنا",ollama:"Ollama",ollamaDescription:"معرفة المزيد عن Ollama",documentation:"التوثيق",reportIssue:"الإبلاغ عن المشاكل",reportIssueDescription:"تقارير الأخطاء وطلبات الميزات"},version:"الإصدار {{version}}"}},wo={title:"النماذج",subtitle:"سحب وإدارة ومراقبة نماذج Ollama",installed:"النماذج المثبتة",available:"النماذج المتاحة",pull:"سحب النموذج",pulling:"جاري السحب...",delete:"حذف النموذج",deleting:"جاري الحذف...",size:"الحجم",modified:"تم التعديل",family:"العائلة",parameters:"المعلمات",quantization:"التكميم",noModels:"لا توجد نماذج مثبتة",pullFirst:"اسحب نموذجاً للبدء"},Po={title:"الشخصيات",create:"إنشاء شخصية",edit:"تعديل الشخصية",delete:"حذف الشخصية",name:"الاسم",description:"الوصف",systemPrompt:"موجه النظام",model:"النموذج",avatar:"الصورة الرمزية",background:"الخلفية",noPersonas:"لم يتم إنشاء شخصيات",createFirst:"أنشئ أول شخصية لتخصيص تجربة المحادثة"},Mo={title:"المعرض",subtitle:"معرض الصور المولدة بالذكاء الاصطناعي",imageCount:"{{count}} صورة",generate:"توليد صورة",generateDescription:"إنشاء صور بالذكاء الاصطناعي",generating:"جاري التوليد...",prompt:"الموجه",promptPlaceholder:"صف الصورة التي تريد توليدها...",noImages:"لم يتم توليد صور بعد",download:"تحميل",delete:"حذف",regenerate:"إعادة التوليد",model:"النموذج",size:"الحجم",quality:"الجودة",created:"تم الإنشاء"},Do={generic:"حدث خطأ",network:"خطأ في الشبكة. يرجى التحقق من الاتصال.",unauthorized:"غير مصرح لك بتنفيذ هذا الإجراء.",notFound:"لم يتم العثور على المورد المطلوب.",serverError:"خطأ في الخادم. يرجى المحاولة لاحقاً.",validation:"يرجى التحقق من المدخلات والمحاولة مرة أخرى."},jo={title:"اختصارات لوحة المفاتيح",toggleSidebar:"تبديل الشريط الجانبي",openSettings:"فتح الإعدادات",toggleDarkMode:"تبديل الوضع الداكن",showShortcuts:"إظهار اختصارات لوحة المفاتيح",closeModals:"إغلاق النوافذ المنبثقة",groups:{navigation:"التنقل",settings:"الإعدادات",general:"عام",chat:"المحادثة"},actions:{sendMessage:"إرسال الرسالة",newLine:"سطر جديد في الرسالة"},footer:"اضغط {{key1}} أو {{key2}} لإظهار هذه المساعدة",tooltip:"اختصارات لوحة المفاتيح"},Ao={title:"النماذج",loading:"جاري تحميل النماذج...",systemStatus:{online:"Ollama متصل",offline:"Ollama غير متصل",models:"نموذج",models_plural:"نماذج",running:"قيد التشغيل",vram:"VRAM"},sections:{pull:"سحب نموذج جديد",library:"تصفح المكتبة",running:"النماذج قيد التشغيل",local:"النماذج المحلية",advanced:"إجراءات متقدمة"},pull:{placeholder:"أدخل اسم النموذج (مثل llama3.2:3b، deepseek-r1:14b)",button:"سحب",cancel:"إلغاء",popular:"النماذج الشائعة:",browseAll:"تصفح جميع النماذج على ollama.com",success:"تم سحب النموذج {{name}} بنجاح",cancelled:"تم إلغاء سحب النموذج",failed:"فشل سحب النموذج",enterName:"يرجى إدخال اسم النموذج"},progress:{starting:"جاري التهيئة...",pulling:"جاري تحميل النموذج...",verifying:"جاري التحقق من السلامة...",writing:"جاري كتابة البيان...",cleaning:"جاري التنظيف..."},library:{available:"متاح",search:"البحث عن نماذج...",noResults:"لم يتم العثور على نماذج تطابق معاييرك",installed:"مثبت",more:"+{{count}} المزيد",refresh:"تحديث المكتبة"},local:{noModels:"لم يتم تثبيت نماذج بعد",pullToStart:"اسحب نموذجاً أعلاه للبدء",installed:"مثبت",running:"قيد التشغيل",info:"معلومات",copy:"نسخ",delete:"حذف",deleteConfirm:'هل أنت متأكد من حذف النموذج "{{name}}"؟',deleteSuccess:"تم حذف النموذج {{name}} بنجاح",deleteFailed:"فشل حذف النموذج"},advanced:{createModel:"إنشاء نموذج",fromModelfile:"من Modelfile",copyModel:"نسخ نموذج",duplicateExisting:"تكرار موجود",testEmbeddings:"اختبار التضمينات",generateVectors:"توليد المتجهات",healthCheck:"فحص الصحة",testConnection:"اختبار الاتصال",healthy:"Ollama سليم!"},modals:{details:{title:"تفاصيل النموذج",info:"معلومات النموذج",family:"العائلة",parameters:"المعلمات",quantization:"التكميم",format:"التنسيق",systemPrompt:"موجه النظام",template:"القالب",license:"الترخيص",modelfile:"Modelfile",noDetails:"لا تتوفر تفاصيل"},copy:{title:"نسخ النموذج",source:"النموذج المصدر",selectModel:"اختر نموذجاً...",newName:"اسم النموذج الجديد",placeholder:"مثل my-custom-model",copying:"جاري النسخ...",button:"نسخ النموذج",success:"تم نسخ النموذج إلى {{name}}",failed:"فشل نسخ النموذج",enterBoth:"يرجى إدخال أسماء المصدر والوجهة"},create:{title:"إنشاء نموذج مخصص",name:"اسم النموذج",namePlaceholder:"مثل my-assistant",modelfile:"Modelfile",modelfilePlaceholder:`FROM llama3.2
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["js/utils-vendor-COrKO_vV.js","js/router-vendor-CYqbjR9t.js","js/ChatPage-Bn4KhZ-P.js","js/markdown-vendor-DeGQOJEA.js","js/ui-vendor-C0aUE8gv.js","js/ArtifactContainer-Bf_RPKu5.js","js/ModelsPage-CV6HuX7C.js","js/PersonasPage-xwvWxbMB.js","js/GalleryPage-SIBQzaiG.js","js/UserManagementPage-BoTkq4w4.js","js/ArtifactDemoPage-6lM9n9_9.js"])))=>i.map(i=>d[i]);
2
+ var Or=Object.defineProperty;var Lr=(n,a,t)=>a in n?Or(n,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[a]=t;var Ie=(n,a,t)=>Lr(n,typeof a!="symbol"?a+"":a,t);import{j as e,_ as he,h as Kr}from"../js/markdown-vendor-DeGQOJEA.js";import{b as Br,g as Gr,r as h,a as Hr,R as le,u as ut,c as Ia,d as Rr,L as ta,e as Mn,N as It,H as Ur,B as $r,f as Ja,h as ie}from"../js/router-vendor-CYqbjR9t.js";import{X as Me,I as et,U as ja,z,G as mt,P as Vr,B as Ct,S as Wr,V as Ft,D as ia,a as Et,M as qr,b as Dn,R as na,C as Se,c as jn,E as Ce,d as Aa,K as at,e as Jr,f as _r,g as An,T as zn,L as qe,h as Je,i as Ee,j as Yr,k as Zr,l as Xr,m as Qr,n as ei,o as Nn,p as wa,q as ai,r as Ot,s as Lt,t as ti,u as Kt,v as Bt,w as Tn,x as ni,y as Q,A as In,F as ri,H as ii,J as Cn,N as Gt,O as Ht,Q as tt,W as oi,Y as Fn,Z as si,_ as Rt,$ as li}from"../js/ui-vendor-C0aUE8gv.js";import{t as di,c as ci,a as Ca,b as nt}from"../js/utils-vendor-COrKO_vV.js";(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function t(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=t(i);fetch(i.href,o)}})();var va={},Ut;function ui(){if(Ut)return va;Ut=1;var n=Br();return va.createRoot=n.createRoot,va.hydrateRoot=n.hydrateRoot,va}var mi=ui();const pi=Gr(mi),B=n=>typeof n=="string",ra=()=>{let n,a;const t=new Promise((r,i)=>{n=r,a=i});return t.resolve=n,t.reject=a,t},$t=n=>n==null?"":""+n,gi=(n,a,t)=>{n.forEach(r=>{a[r]&&(t[r]=a[r])})},hi=/###/g,Vt=n=>n&&n.indexOf("###")>-1?n.replace(hi,"."):n,Wt=n=>!n||B(n),oa=(n,a,t)=>{const r=B(a)?a.split("."):a;let i=0;for(;i<r.length-1;){if(Wt(n))return{};const o=Vt(r[i]);!n[o]&&t&&(n[o]=new t),Object.prototype.hasOwnProperty.call(n,o)?n=n[o]:n={},++i}return Wt(n)?{}:{obj:n,k:Vt(r[i])}},qt=(n,a,t)=>{const{obj:r,k:i}=oa(n,a,Object);if(r!==void 0||a.length===1){r[i]=t;return}let o=a[a.length-1],s=a.slice(0,a.length-1),d=oa(n,s,Object);for(;d.obj===void 0&&s.length;)o=`${s[s.length-1]}.${o}`,s=s.slice(0,s.length-1),d=oa(n,s,Object),d?.obj&&typeof d.obj[`${d.k}.${o}`]<"u"&&(d.obj=void 0);d.obj[`${d.k}.${o}`]=t},bi=(n,a,t,r)=>{const{obj:i,k:o}=oa(n,a,Object);i[o]=i[o]||[],i[o].push(t)},za=(n,a)=>{const{obj:t,k:r}=oa(n,a);if(t&&Object.prototype.hasOwnProperty.call(t,r))return t[r]},ki=(n,a,t)=>{const r=za(n,t);return r!==void 0?r:za(a,t)},En=(n,a,t)=>{for(const r in a)r!=="__proto__"&&r!=="constructor"&&(r in n?B(n[r])||n[r]instanceof String||B(a[r])||a[r]instanceof String?t&&(n[r]=a[r]):En(n[r],a[r],t):n[r]=a[r]);return n},Ue=n=>n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var fi={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const yi=n=>B(n)?n.replace(/[&<>"'\/]/g,a=>fi[a]):n;class vi{constructor(a){this.capacity=a,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(a){const t=this.regExpMap.get(a);if(t!==void 0)return t;const r=new RegExp(a);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(a,r),this.regExpQueue.push(a),r}}const xi=[" ",",","?","!",";"],Si=new vi(20),wi=(n,a,t)=>{a=a||"",t=t||"";const r=xi.filter(s=>a.indexOf(s)<0&&t.indexOf(s)<0);if(r.length===0)return!0;const i=Si.getRegExp(`(${r.map(s=>s==="?"?"\\?":s).join("|")})`);let o=!i.test(n);if(!o){const s=n.indexOf(t);s>0&&!i.test(n.substring(0,s))&&(o=!0)}return o},rt=(n,a,t=".")=>{if(!n)return;if(n[a])return Object.prototype.hasOwnProperty.call(n,a)?n[a]:void 0;const r=a.split(t);let i=n;for(let o=0;o<r.length;){if(!i||typeof i!="object")return;let s,d="";for(let u=o;u<r.length;++u)if(u!==o&&(d+=t),d+=r[u],s=i[d],s!==void 0){if(["string","number","boolean"].indexOf(typeof s)>-1&&u<r.length-1)continue;o+=u-o+1;break}i=s}return i},ca=n=>n?.replace("_","-"),Pi={type:"logger",log(n){this.output("log",n)},warn(n){this.output("warn",n)},error(n){this.output("error",n)},output(n,a){console?.[n]?.apply?.(console,a)}};class Na{constructor(a,t={}){this.init(a,t)}init(a,t={}){this.prefix=t.prefix||"i18next:",this.logger=a||Pi,this.options=t,this.debug=t.debug}log(...a){return this.forward(a,"log","",!0)}warn(...a){return this.forward(a,"warn","",!0)}error(...a){return this.forward(a,"error","")}deprecate(...a){return this.forward(a,"warn","WARNING DEPRECATED: ",!0)}forward(a,t,r,i){return i&&!this.debug?null:(B(a[0])&&(a[0]=`${r}${this.prefix} ${a[0]}`),this.logger[t](a))}create(a){return new Na(this.logger,{prefix:`${this.prefix}:${a}:`,...this.options})}clone(a){return a=a||this.options,a.prefix=a.prefix||this.prefix,new Na(this.logger,a)}}var we=new Na;class Fa{constructor(){this.observers={}}on(a,t){return a.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const i=this.observers[r].get(t)||0;this.observers[r].set(t,i+1)}),this}off(a,t){if(this.observers[a]){if(!t){delete this.observers[a];return}this.observers[a].delete(t)}}emit(a,...t){this.observers[a]&&Array.from(this.observers[a].entries()).forEach(([i,o])=>{for(let s=0;s<o;s++)i(...t)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([i,o])=>{for(let s=0;s<o;s++)i.apply(i,[a,...t])})}}class Jt extends Fa{constructor(a,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=a||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(a){this.options.ns.indexOf(a)<0&&this.options.ns.push(a)}removeNamespaces(a){const t=this.options.ns.indexOf(a);t>-1&&this.options.ns.splice(t,1)}getResource(a,t,r,i={}){const o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,s=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let d;a.indexOf(".")>-1?d=a.split("."):(d=[a,t],r&&(Array.isArray(r)?d.push(...r):B(r)&&o?d.push(...r.split(o)):d.push(r)));const u=za(this.data,d);return!u&&!t&&!r&&a.indexOf(".")>-1&&(a=d[0],t=d[1],r=d.slice(2).join(".")),u||!s||!B(r)?u:rt(this.data?.[a]?.[t],r,o)}addResource(a,t,r,i,o={silent:!1}){const s=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let d=[a,t];r&&(d=d.concat(s?r.split(s):r)),a.indexOf(".")>-1&&(d=a.split("."),i=t,t=d[1]),this.addNamespaces(t),qt(this.data,d,i),o.silent||this.emit("added",a,t,r,i)}addResources(a,t,r,i={silent:!1}){for(const o in r)(B(r[o])||Array.isArray(r[o]))&&this.addResource(a,t,o,r[o],{silent:!0});i.silent||this.emit("added",a,t,r)}addResourceBundle(a,t,r,i,o,s={silent:!1,skipCopy:!1}){let d=[a,t];a.indexOf(".")>-1&&(d=a.split("."),i=r,r=t,t=d[1]),this.addNamespaces(t);let u=za(this.data,d)||{};s.skipCopy||(r=JSON.parse(JSON.stringify(r))),i?En(u,r,o):u={...u,...r},qt(this.data,d,u),s.silent||this.emit("added",a,t,r)}removeResourceBundle(a,t){this.hasResourceBundle(a,t)&&delete this.data[a][t],this.removeNamespaces(t),this.emit("removed",a,t)}hasResourceBundle(a,t){return this.getResource(a,t)!==void 0}getResourceBundle(a,t){return t||(t=this.options.defaultNS),this.getResource(a,t)}getDataByLanguage(a){return this.data[a]}hasLanguageSomeTranslations(a){const t=this.getDataByLanguage(a);return!!(t&&Object.keys(t)||[]).find(i=>t[i]&&Object.keys(t[i]).length>0)}toJSON(){return this.data}}var On={processors:{},addPostProcessor(n){this.processors[n.name]=n},handle(n,a,t,r,i){return n.forEach(o=>{a=this.processors[o]?.process(a,t,r,i)??a}),a}};const Ln=Symbol("i18next/PATH_KEY");function Mi(){const n=[],a=Object.create(null);let t;return a.get=(r,i)=>(t?.revoke?.(),i===Ln?n:(n.push(i),t=Proxy.revocable(r,a),t.proxy)),Proxy.revocable(Object.create(null),a).proxy}function it(n,a){const{[Ln]:t}=n(Mi());return t.join(a?.keySeparator??".")}const _t={},_a=n=>!B(n)&&typeof n!="boolean"&&typeof n!="number";class Ta extends Fa{constructor(a,t={}){super(),gi(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],a,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=we.create("translator")}changeLanguage(a){a&&(this.language=a)}exists(a,t={interpolation:{}}){const r={...t};if(a==null)return!1;const i=this.resolve(a,r);if(i?.res===void 0)return!1;const o=_a(i.res);return!(r.returnObjects===!1&&o)}extractFromKey(a,t){let r=t.nsSeparator!==void 0?t.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const i=t.keySeparator!==void 0?t.keySeparator:this.options.keySeparator;let o=t.ns||this.options.defaultNS||[];const s=r&&a.indexOf(r)>-1,d=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!wi(a,r,i);if(s&&!d){const u=a.match(this.interpolator.nestingRegexp);if(u&&u.length>0)return{key:a,namespaces:B(o)?[o]:o};const m=a.split(r);(r!==i||r===i&&this.options.ns.indexOf(m[0])>-1)&&(o=m.shift()),a=m.join(i)}return{key:a,namespaces:B(o)?[o]:o}}translate(a,t,r){let i=typeof t=="object"?{...t}:t;if(typeof i!="object"&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i=="object"&&(i={...i}),i||(i={}),a==null)return"";typeof a=="function"&&(a=it(a,{...this.options,...i})),Array.isArray(a)||(a=[String(a)]);const o=i.returnDetails!==void 0?i.returnDetails:this.options.returnDetails,s=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,{key:d,namespaces:u}=this.extractFromKey(a[a.length-1],i),m=u[u.length-1];let g=i.nsSeparator!==void 0?i.nsSeparator:this.options.nsSeparator;g===void 0&&(g=":");const p=i.lng||this.language,k=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(p?.toLowerCase()==="cimode")return k?o?{res:`${m}${g}${d}`,usedKey:d,exactUsedKey:d,usedLng:p,usedNS:m,usedParams:this.getUsedParamsDetails(i)}:`${m}${g}${d}`:o?{res:d,usedKey:d,exactUsedKey:d,usedLng:p,usedNS:m,usedParams:this.getUsedParamsDetails(i)}:d;const x=this.resolve(a,i);let b=x?.res;const w=x?.usedKey||d,S=x?.exactUsedKey||d,F=["[object Number]","[object Function]","[object RegExp]"],L=i.joinArrays!==void 0?i.joinArrays:this.options.joinArrays,D=!this.i18nFormat||this.i18nFormat.handleAsObject,A=i.count!==void 0&&!B(i.count),N=Ta.hasDefaultValue(i),P=A?this.pluralResolver.getSuffix(p,i.count,i):"",U=i.ordinal&&A?this.pluralResolver.getSuffix(p,i.count,{ordinal:!1}):"",q=A&&!i.ordinal&&i.count===0,K=q&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${P}`]||i[`defaultValue${U}`]||i.defaultValue;let O=b;D&&!b&&N&&(O=K);const E=_a(O),G=Object.prototype.toString.apply(O);if(D&&O&&E&&F.indexOf(G)<0&&!(B(L)&&Array.isArray(O))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const c=this.options.returnedObjectHandler?this.options.returnedObjectHandler(w,O,{...i,ns:u}):`key '${d} (${this.language})' returned an object instead of string.`;return o?(x.res=c,x.usedParams=this.getUsedParamsDetails(i),x):c}if(s){const c=Array.isArray(O),$=c?[]:{},ue=c?S:w;for(const V in O)if(Object.prototype.hasOwnProperty.call(O,V)){const Y=`${ue}${s}${V}`;N&&!b?$[V]=this.translate(Y,{...i,defaultValue:_a(K)?K[V]:void 0,joinArrays:!1,ns:u}):$[V]=this.translate(Y,{...i,joinArrays:!1,ns:u}),$[V]===Y&&($[V]=O[V])}b=$}}else if(D&&B(L)&&Array.isArray(b))b=b.join(L),b&&(b=this.extendTranslation(b,a,i,r));else{let c=!1,$=!1;!this.isValidLookup(b)&&N&&(c=!0,b=K),this.isValidLookup(b)||($=!0,b=d);const V=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&$?void 0:b,Y=N&&K!==b&&this.options.updateMissing;if($||c||Y){if(this.logger.log(Y?"updateKey":"missingKey",p,m,d,Y?K:b),s){const T=this.resolve(d,{...i,keySeparator:!1});T&&T.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 J=[];const me=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo==="fallback"&&me&&me[0])for(let T=0;T<me.length;T++)J.push(me[T]);else this.options.saveMissingTo==="all"?J=this.languageUtils.toResolveHierarchy(i.lng||this.language):J.push(i.lng||this.language);const ne=(T,H,_)=>{const Pe=N&&_!==b?_:V;this.options.missingKeyHandler?this.options.missingKeyHandler(T,m,H,Pe,Y,i):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(T,m,H,Pe,Y,i),this.emit("missingKey",T,m,H,b)};this.options.saveMissing&&(this.options.saveMissingPlurals&&A?J.forEach(T=>{const H=this.pluralResolver.getSuffixes(T,i);q&&i[`defaultValue${this.options.pluralSeparator}zero`]&&H.indexOf(`${this.options.pluralSeparator}zero`)<0&&H.push(`${this.options.pluralSeparator}zero`),H.forEach(_=>{ne([T],d+_,i[`defaultValue${_}`]||K)})}):ne(J,d,K))}b=this.extendTranslation(b,a,i,x,r),$&&b===d&&this.options.appendNamespaceToMissingKey&&(b=`${m}${g}${d}`),($||c)&&this.options.parseMissingKeyHandler&&(b=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${m}${g}${d}`:d,c?b:void 0,i))}return o?(x.res=b,x.usedParams=this.getUsedParamsDetails(i),x):b}extendTranslation(a,t,r,i,o){if(this.i18nFormat?.parse)a=this.i18nFormat.parse(a,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const u=B(a)&&(r?.interpolation?.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let m;if(u){const p=a.match(this.interpolator.nestingRegexp);m=p&&p.length}let g=r.replace&&!B(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(g={...this.options.interpolation.defaultVariables,...g}),a=this.interpolator.interpolate(a,g,r.lng||this.language||i.usedLng,r),u){const p=a.match(this.interpolator.nestingRegexp),k=p&&p.length;m<k&&(r.nest=!1)}!r.lng&&i&&i.res&&(r.lng=this.language||i.usedLng),r.nest!==!1&&(a=this.interpolator.nest(a,(...p)=>o?.[0]===p[0]&&!r.context?(this.logger.warn(`It seems you are nesting recursively key: ${p[0]} in key: ${t[0]}`),null):this.translate(...p,t),r)),r.interpolation&&this.interpolator.reset()}const s=r.postProcess||this.options.postProcess,d=B(s)?[s]:s;return a!=null&&d?.length&&r.applyPostProcessor!==!1&&(a=On.handle(d,a,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),a}resolve(a,t={}){let r,i,o,s,d;return B(a)&&(a=[a]),a.forEach(u=>{if(this.isValidLookup(r))return;const m=this.extractFromKey(u,t),g=m.key;i=g;let p=m.namespaces;this.options.fallbackNS&&(p=p.concat(this.options.fallbackNS));const k=t.count!==void 0&&!B(t.count),x=k&&!t.ordinal&&t.count===0,b=t.context!==void 0&&(B(t.context)||typeof t.context=="number")&&t.context!=="",w=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);p.forEach(S=>{this.isValidLookup(r)||(d=S,!_t[`${w[0]}-${S}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(d)&&(_t[`${w[0]}-${S}`]=!0,this.logger.warn(`key "${i}" for languages "${w.join(", ")}" won't get resolved as namespace "${d}" 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!!!")),w.forEach(F=>{if(this.isValidLookup(r))return;s=F;const L=[g];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(L,g,F,S,t);else{let A;k&&(A=this.pluralResolver.getSuffix(F,t.count,t));const N=`${this.options.pluralSeparator}zero`,P=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(k&&(t.ordinal&&A.indexOf(P)===0&&L.push(g+A.replace(P,this.options.pluralSeparator)),L.push(g+A),x&&L.push(g+N)),b){const U=`${g}${this.options.contextSeparator||"_"}${t.context}`;L.push(U),k&&(t.ordinal&&A.indexOf(P)===0&&L.push(U+A.replace(P,this.options.pluralSeparator)),L.push(U+A),x&&L.push(U+N))}}let D;for(;D=L.pop();)this.isValidLookup(r)||(o=D,r=this.getResource(F,S,D,t))}))})}),{res:r,usedKey:i,exactUsedKey:o,usedLng:s,usedNS:d}}isValidLookup(a){return a!==void 0&&!(!this.options.returnNull&&a===null)&&!(!this.options.returnEmptyString&&a==="")}getResource(a,t,r,i={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(a,t,r,i):this.resourceStore.getResource(a,t,r,i)}getUsedParamsDetails(a={}){const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=a.replace&&!B(a.replace);let i=r?a.replace:a;if(r&&typeof a.count<"u"&&(i.count=a.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!r){i={...i};for(const o of t)delete i[o]}return i}static hasDefaultValue(a){const t="defaultValue";for(const r in a)if(Object.prototype.hasOwnProperty.call(a,r)&&t===r.substring(0,t.length)&&a[r]!==void 0)return!0;return!1}}class Yt{constructor(a){this.options=a,this.supportedLngs=this.options.supportedLngs||!1,this.logger=we.create("languageUtils")}getScriptPartFromCode(a){if(a=ca(a),!a||a.indexOf("-")<0)return null;const t=a.split("-");return t.length===2||(t.pop(),t[t.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(t.join("-"))}getLanguagePartFromCode(a){if(a=ca(a),!a||a.indexOf("-")<0)return a;const t=a.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(a){if(B(a)&&a.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(a)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?a.toLowerCase():a)}return this.options.cleanCode||this.options.lowerCaseLng?a.toLowerCase():a}isSupportedCode(a){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(a=this.getLanguagePartFromCode(a)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(a)>-1}getBestMatchFromCodes(a){if(!a)return null;let t;return a.forEach(r=>{if(t)return;const i=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(i))&&(t=i)}),!t&&this.options.supportedLngs&&a.forEach(r=>{if(t)return;const i=this.getScriptPartFromCode(r);if(this.isSupportedCode(i))return t=i;const o=this.getLanguagePartFromCode(r);if(this.isSupportedCode(o))return t=o;t=this.options.supportedLngs.find(s=>{if(s===o)return s;if(!(s.indexOf("-")<0&&o.indexOf("-")<0)&&(s.indexOf("-")>0&&o.indexOf("-")<0&&s.substring(0,s.indexOf("-"))===o||s.indexOf(o)===0&&o.length>1))return s})}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(a,t){if(!a)return[];if(typeof a=="function"&&(a=a(t)),B(a)&&(a=[a]),Array.isArray(a))return a;if(!t)return a.default||[];let r=a[t];return r||(r=a[this.getScriptPartFromCode(t)]),r||(r=a[this.formatLanguageCode(t)]),r||(r=a[this.getLanguagePartFromCode(t)]),r||(r=a.default),r||[]}toResolveHierarchy(a,t){const r=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],a),i=[],o=s=>{s&&(this.isSupportedCode(s)?i.push(s):this.logger.warn(`rejecting language code not found in supportedLngs: ${s}`))};return B(a)&&(a.indexOf("-")>-1||a.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&o(this.formatLanguageCode(a)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&o(this.getScriptPartFromCode(a)),this.options.load!=="currentOnly"&&o(this.getLanguagePartFromCode(a))):B(a)&&o(this.formatLanguageCode(a)),r.forEach(s=>{i.indexOf(s)<0&&o(this.formatLanguageCode(s))}),i}}const Zt={zero:0,one:1,two:2,few:3,many:4,other:5},Xt={select:n=>n===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Di{constructor(a,t={}){this.languageUtils=a,this.options=t,this.logger=we.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(a,t={}){const r=ca(a==="dev"?"en":a),i=t.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:r,type:i});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];let s;try{s=new Intl.PluralRules(r,{type:i})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),Xt;if(!a.match(/-|_/))return Xt;const u=this.languageUtils.getLanguagePartFromCode(a);s=this.getRule(u,t)}return this.pluralRulesCache[o]=s,s}needsPlural(a,t={}){let r=this.getRule(a,t);return r||(r=this.getRule("dev",t)),r?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(a,t,r={}){return this.getSuffixes(a,r).map(i=>`${t}${i}`)}getSuffixes(a,t={}){let r=this.getRule(a,t);return r||(r=this.getRule("dev",t)),r?r.resolvedOptions().pluralCategories.sort((i,o)=>Zt[i]-Zt[o]).map(i=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${i}`):[]}getSuffix(a,t,r={}){const i=this.getRule(a,r);return i?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${i.select(t)}`:(this.logger.warn(`no plural rule found for: ${a}`),this.getSuffix("dev",t,r))}}const Qt=(n,a,t,r=".",i=!0)=>{let o=ki(n,a,t);return!o&&i&&B(t)&&(o=rt(n,t,r),o===void 0&&(o=rt(a,t,r))),o},Ya=n=>n.replace(/\$/g,"$$$$");class en{constructor(a={}){this.logger=we.create("interpolator"),this.options=a,this.format=a?.interpolation?.format||(t=>t),this.init(a)}init(a={}){a.interpolation||(a.interpolation={escapeValue:!0});const{escape:t,escapeValue:r,useRawValueToEscape:i,prefix:o,prefixEscaped:s,suffix:d,suffixEscaped:u,formatSeparator:m,unescapeSuffix:g,unescapePrefix:p,nestingPrefix:k,nestingPrefixEscaped:x,nestingSuffix:b,nestingSuffixEscaped:w,nestingOptionsSeparator:S,maxReplaces:F,alwaysFormat:L}=a.interpolation;this.escape=t!==void 0?t:yi,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=o?Ue(o):s||"{{",this.suffix=d?Ue(d):u||"}}",this.formatSeparator=m||",",this.unescapePrefix=g?"":p||"-",this.unescapeSuffix=this.unescapePrefix?"":g||"",this.nestingPrefix=k?Ue(k):x||Ue("$t("),this.nestingSuffix=b?Ue(b):w||Ue(")"),this.nestingOptionsSeparator=S||",",this.maxReplaces=F||1e3,this.alwaysFormat=L!==void 0?L:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const a=(t,r)=>t?.source===r?(t.lastIndex=0,t):new RegExp(r,"g");this.regexp=a(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=a(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=a(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(a,t,r,i){let o,s,d;const u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},m=x=>{if(x.indexOf(this.formatSeparator)<0){const F=Qt(t,u,x,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(F,void 0,r,{...i,...t,interpolationkey:x}):F}const b=x.split(this.formatSeparator),w=b.shift().trim(),S=b.join(this.formatSeparator).trim();return this.format(Qt(t,u,w,this.options.keySeparator,this.options.ignoreJSONStructure),S,r,{...i,...t,interpolationkey:w})};this.resetRegExp();const g=i?.missingInterpolationHandler||this.options.missingInterpolationHandler,p=i?.interpolation?.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:x=>Ya(x)},{regex:this.regexp,safeValue:x=>this.escapeValue?Ya(this.escape(x)):Ya(x)}].forEach(x=>{for(d=0;o=x.regex.exec(a);){const b=o[1].trim();if(s=m(b),s===void 0)if(typeof g=="function"){const S=g(a,o,i);s=B(S)?S:""}else if(i&&Object.prototype.hasOwnProperty.call(i,b))s="";else if(p){s=o[0];continue}else this.logger.warn(`missed to pass in variable ${b} for interpolating ${a}`),s="";else!B(s)&&!this.useRawValueToEscape&&(s=$t(s));const w=x.safeValue(s);if(a=a.replace(o[0],w),p?(x.regex.lastIndex+=s.length,x.regex.lastIndex-=o[0].length):x.regex.lastIndex=0,d++,d>=this.maxReplaces)break}}),a}nest(a,t,r={}){let i,o,s;const d=(u,m)=>{const g=this.nestingOptionsSeparator;if(u.indexOf(g)<0)return u;const p=u.split(new RegExp(`${g}[ ]*{`));let k=`{${p[1]}`;u=p[0],k=this.interpolate(k,s);const x=k.match(/'/g),b=k.match(/"/g);((x?.length??0)%2===0&&!b||b.length%2!==0)&&(k=k.replace(/'/g,'"'));try{s=JSON.parse(k),m&&(s={...m,...s})}catch(w){return this.logger.warn(`failed parsing options string in nesting for key ${u}`,w),`${u}${g}${k}`}return s.defaultValue&&s.defaultValue.indexOf(this.prefix)>-1&&delete s.defaultValue,u};for(;i=this.nestingRegexp.exec(a);){let u=[];s={...r},s=s.replace&&!B(s.replace)?s.replace:s,s.applyPostProcessor=!1,delete s.defaultValue;const m=/{.*}/.test(i[1])?i[1].lastIndexOf("}")+1:i[1].indexOf(this.formatSeparator);if(m!==-1&&(u=i[1].slice(m).split(this.formatSeparator).map(g=>g.trim()).filter(Boolean),i[1]=i[1].slice(0,m)),o=t(d.call(this,i[1].trim(),s),s),o&&i[0]===a&&!B(o))return o;B(o)||(o=$t(o)),o||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${a}`),o=""),u.length&&(o=u.reduce((g,p)=>this.format(g,p,r.lng,{...r,interpolationkey:i[1].trim()}),o.trim())),a=a.replace(i[0],o),this.regexp.lastIndex=0}return a}}const ji=n=>{let a=n.toLowerCase().trim();const t={};if(n.indexOf("(")>-1){const r=n.split("(");a=r[0].toLowerCase().trim();const i=r[1].substring(0,r[1].length-1);a==="currency"&&i.indexOf(":")<0?t.currency||(t.currency=i.trim()):a==="relativetime"&&i.indexOf(":")<0?t.range||(t.range=i.trim()):i.split(";").forEach(s=>{if(s){const[d,...u]=s.split(":"),m=u.join(":").trim().replace(/^'+|'+$/g,""),g=d.trim();t[g]||(t[g]=m),m==="false"&&(t[g]=!1),m==="true"&&(t[g]=!0),isNaN(m)||(t[g]=parseInt(m,10))}})}return{formatName:a,formatOptions:t}},an=n=>{const a={};return(t,r,i)=>{let o=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(o={...o,[i.interpolationkey]:void 0});const s=r+JSON.stringify(o);let d=a[s];return d||(d=n(ca(r),i),a[s]=d),d(t)}},Ai=n=>(a,t,r)=>n(ca(t),r)(a);class zi{constructor(a={}){this.logger=we.create("formatter"),this.options=a,this.init(a)}init(a,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const r=t.cacheInBuiltFormats?an:Ai;this.formats={number:r((i,o)=>{const s=new Intl.NumberFormat(i,{...o});return d=>s.format(d)}),currency:r((i,o)=>{const s=new Intl.NumberFormat(i,{...o,style:"currency"});return d=>s.format(d)}),datetime:r((i,o)=>{const s=new Intl.DateTimeFormat(i,{...o});return d=>s.format(d)}),relativetime:r((i,o)=>{const s=new Intl.RelativeTimeFormat(i,{...o});return d=>s.format(d,o.range||"day")}),list:r((i,o)=>{const s=new Intl.ListFormat(i,{...o});return d=>s.format(d)})}}add(a,t){this.formats[a.toLowerCase().trim()]=t}addCached(a,t){this.formats[a.toLowerCase().trim()]=an(t)}format(a,t,r,i={}){const o=t.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find(d=>d.indexOf(")")>-1)){const d=o.findIndex(u=>u.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,d)].join(this.formatSeparator)}return o.reduce((d,u)=>{const{formatName:m,formatOptions:g}=ji(u);if(this.formats[m]){let p=d;try{const k=i?.formatParams?.[i.interpolationkey]||{},x=k.locale||k.lng||i.locale||i.lng||r;p=this.formats[m](d,x,{...g,...i,...k})}catch(k){this.logger.warn(k)}return p}else this.logger.warn(`there was no format function for ${m}`);return d},a)}}const Ni=(n,a)=>{n.pending[a]!==void 0&&(delete n.pending[a],n.pendingCount--)};class Ti extends Fa{constructor(a,t,r,i={}){super(),this.backend=a,this.store=t,this.services=r,this.languageUtils=r.languageUtils,this.options=i,this.logger=we.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(r,i.backend,i)}queueLoad(a,t,r,i){const o={},s={},d={},u={};return a.forEach(m=>{let g=!0;t.forEach(p=>{const k=`${m}|${p}`;!r.reload&&this.store.hasResourceBundle(m,p)?this.state[k]=2:this.state[k]<0||(this.state[k]===1?s[k]===void 0&&(s[k]=!0):(this.state[k]=1,g=!1,s[k]===void 0&&(s[k]=!0),o[k]===void 0&&(o[k]=!0),u[p]===void 0&&(u[p]=!0)))}),g||(d[m]=!0)}),(Object.keys(o).length||Object.keys(s).length)&&this.queue.push({pending:s,pendingCount:Object.keys(s).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(o),pending:Object.keys(s),toLoadLanguages:Object.keys(d),toLoadNamespaces:Object.keys(u)}}loaded(a,t,r){const i=a.split("|"),o=i[0],s=i[1];t&&this.emit("failedLoading",o,s,t),!t&&r&&this.store.addResourceBundle(o,s,r,void 0,void 0,{skipCopy:!0}),this.state[a]=t?-1:2,t&&r&&(this.state[a]=0);const d={};this.queue.forEach(u=>{bi(u.loaded,[o],s),Ni(u,a),t&&u.errors.push(t),u.pendingCount===0&&!u.done&&(Object.keys(u.loaded).forEach(m=>{d[m]||(d[m]={});const g=u.loaded[m];g.length&&g.forEach(p=>{d[m][p]===void 0&&(d[m][p]=!0)})}),u.done=!0,u.errors.length?u.callback(u.errors):u.callback())}),this.emit("loaded",d),this.queue=this.queue.filter(u=>!u.done)}read(a,t,r,i=0,o=this.retryTimeout,s){if(!a.length)return s(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:a,ns:t,fcName:r,tried:i,wait:o,callback:s});return}this.readingCalls++;const d=(m,g)=>{if(this.readingCalls--,this.waitingReads.length>0){const p=this.waitingReads.shift();this.read(p.lng,p.ns,p.fcName,p.tried,p.wait,p.callback)}if(m&&g&&i<this.maxRetries){setTimeout(()=>{this.read.call(this,a,t,r,i+1,o*2,s)},o);return}s(m,g)},u=this.backend[r].bind(this.backend);if(u.length===2){try{const m=u(a,t);m&&typeof m.then=="function"?m.then(g=>d(null,g)).catch(d):d(null,m)}catch(m){d(m)}return}return u(a,t,d)}prepareLoading(a,t,r={},i){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();B(a)&&(a=this.languageUtils.toResolveHierarchy(a)),B(t)&&(t=[t]);const o=this.queueLoad(a,t,r,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.toLoad.forEach(s=>{this.loadOne(s)})}load(a,t,r){this.prepareLoading(a,t,{},r)}reload(a,t,r){this.prepareLoading(a,t,{reload:!0},r)}loadOne(a,t=""){const r=a.split("|"),i=r[0],o=r[1];this.read(i,o,"read",void 0,void 0,(s,d)=>{s&&this.logger.warn(`${t}loading namespace ${o} for language ${i} failed`,s),!s&&d&&this.logger.log(`${t}loaded namespace ${o} for language ${i}`,d),this.loaded(a,s,d)})}saveMissing(a,t,r,i,o,s={},d=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${r}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if(this.backend?.create){const u={...s,isUpdate:o},m=this.backend.create.bind(this.backend);if(m.length<6)try{let g;m.length===5?g=m(a,t,r,i,u):g=m(a,t,r,i),g&&typeof g.then=="function"?g.then(p=>d(null,p)).catch(d):d(null,g)}catch(g){d(g)}else m(a,t,r,i,d,u)}!a||!a[0]||this.store.addResource(a[0],t,r,i)}}}const Za=()=>({debug:!1,initAsync:!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:n=>{let a={};if(typeof n[1]=="object"&&(a=n[1]),B(n[1])&&(a.defaultValue=n[1]),B(n[2])&&(a.tDescription=n[2]),typeof n[2]=="object"||typeof n[3]=="object"){const t=n[3]||n[2];Object.keys(t).forEach(r=>{a[r]=t[r]})}return a},interpolation:{escapeValue:!0,format:n=>n,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),tn=n=>(B(n.ns)&&(n.ns=[n.ns]),B(n.fallbackLng)&&(n.fallbackLng=[n.fallbackLng]),B(n.fallbackNS)&&(n.fallbackNS=[n.fallbackNS]),n.supportedLngs?.indexOf?.("cimode")<0&&(n.supportedLngs=n.supportedLngs.concat(["cimode"])),typeof n.initImmediate=="boolean"&&(n.initAsync=n.initImmediate),n),xa=()=>{},Ii=n=>{Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach(t=>{typeof n[t]=="function"&&(n[t]=n[t].bind(n))})};class sa extends Fa{constructor(a={},t){if(super(),this.options=tn(a),this.services={},this.logger=we,this.modules={external:[]},Ii(this),t&&!this.isInitialized&&!a.isClone){if(!this.options.initAsync)return this.init(a,t),this;setTimeout(()=>{this.init(a,t)},0)}}init(a={},t){this.isInitializing=!0,typeof a=="function"&&(t=a,a={}),a.defaultNS==null&&a.ns&&(B(a.ns)?a.defaultNS=a.ns:a.ns.indexOf("translation")<0&&(a.defaultNS=a.ns[0]));const r=Za();this.options={...r,...this.options,...tn(a)},this.options.interpolation={...r.interpolation,...this.options.interpolation},a.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=a.keySeparator),a.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=a.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=r.overloadTranslationOptionHandler),this.options.debug===!0&&typeof console<"u"&&console.warn("i18next is maintained with support from locize.com — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com");const i=m=>m?typeof m=="function"?new m:m:null;if(!this.options.isClone){this.modules.logger?we.init(i(this.modules.logger),this.options):we.init(null,this.options);let m;this.modules.formatter?m=this.modules.formatter:m=zi;const g=new Yt(this.options);this.store=new Jt(this.options.resources,this.options);const p=this.services;p.logger=we,p.resourceStore=this.store,p.languageUtils=g,p.pluralResolver=new Di(g,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),m&&(!this.options.interpolation.format||this.options.interpolation.format===r.interpolation.format)&&(p.formatter=i(m),p.formatter.init&&p.formatter.init(p,this.options),this.options.interpolation.format=p.formatter.format.bind(p.formatter)),p.interpolator=new en(this.options),p.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},p.backendConnector=new Ti(i(this.modules.backend),p.resourceStore,p,this.options),p.backendConnector.on("*",(x,...b)=>{this.emit(x,...b)}),this.modules.languageDetector&&(p.languageDetector=i(this.modules.languageDetector),p.languageDetector.init&&p.languageDetector.init(p,this.options.detection,this.options)),this.modules.i18nFormat&&(p.i18nFormat=i(this.modules.i18nFormat),p.i18nFormat.init&&p.i18nFormat.init(this)),this.translator=new Ta(this.services,this.options),this.translator.on("*",(x,...b)=>{this.emit(x,...b)}),this.modules.external.forEach(x=>{x.init&&x.init(this)})}if(this.format=this.options.interpolation.format,t||(t=xa),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const m=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);m.length>0&&m[0]!=="dev"&&(this.options.lng=m[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(m=>{this[m]=(...g)=>this.store[m](...g)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(m=>{this[m]=(...g)=>(this.store[m](...g),this)});const d=ra(),u=()=>{const m=(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),t(g,p)};if(this.languages&&!this.isInitialized)return m(null,this.t.bind(this));this.changeLanguage(this.options.lng,m)};return this.options.resources||!this.options.initAsync?u():setTimeout(u,0),d}loadResources(a,t=xa){let r=t;const i=B(a)?a:this.language;if(typeof a=="function"&&(r=a),!this.options.resources||this.options.partialBundledLanguages){if(i?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const o=[],s=d=>{if(!d||d==="cimode")return;this.services.languageUtils.toResolveHierarchy(d).forEach(m=>{m!=="cimode"&&o.indexOf(m)<0&&o.push(m)})};i?s(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(u=>s(u)),this.options.preload?.forEach?.(d=>s(d)),this.services.backendConnector.load(o,this.options.ns,d=>{!d&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(d)})}else r(null)}reloadResources(a,t,r){const i=ra();return typeof a=="function"&&(r=a,a=void 0),typeof t=="function"&&(r=t,t=void 0),a||(a=this.languages),t||(t=this.options.ns),r||(r=xa),this.services.backendConnector.reload(a,t,o=>{i.resolve(),r(o)}),i}use(a){if(!a)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!a.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return a.type==="backend"&&(this.modules.backend=a),(a.type==="logger"||a.log&&a.warn&&a.error)&&(this.modules.logger=a),a.type==="languageDetector"&&(this.modules.languageDetector=a),a.type==="i18nFormat"&&(this.modules.i18nFormat=a),a.type==="postProcessor"&&On.addPostProcessor(a),a.type==="formatter"&&(this.modules.formatter=a),a.type==="3rdParty"&&this.modules.external.push(a),this}setResolvedLanguage(a){if(!(!a||!this.languages)&&!(["cimode","dev"].indexOf(a)>-1)){for(let t=0;t<this.languages.length;t++){const r=this.languages[t];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}!this.resolvedLanguage&&this.languages.indexOf(a)<0&&this.store.hasLanguageSomeTranslations(a)&&(this.resolvedLanguage=a,this.languages.unshift(a))}}changeLanguage(a,t){this.isLanguageChangingTo=a;const r=ra();this.emit("languageChanging",a);const i=d=>{this.language=d,this.languages=this.services.languageUtils.toResolveHierarchy(d),this.resolvedLanguage=void 0,this.setResolvedLanguage(d)},o=(d,u)=>{u?this.isLanguageChangingTo===a&&(i(u),this.translator.changeLanguage(u),this.isLanguageChangingTo=void 0,this.emit("languageChanged",u),this.logger.log("languageChanged",u)):this.isLanguageChangingTo=void 0,r.resolve((...m)=>this.t(...m)),t&&t(d,(...m)=>this.t(...m))},s=d=>{!a&&!d&&this.services.languageDetector&&(d=[]);const u=B(d)?d:d&&d[0],m=this.store.hasLanguageSomeTranslations(u)?u:this.services.languageUtils.getBestMatchFromCodes(B(d)?[d]:d);m&&(this.language||i(m),this.translator.language||this.translator.changeLanguage(m),this.services.languageDetector?.cacheUserLanguage?.(m)),this.loadResources(m,g=>{o(g,m)})};return!a&&this.services.languageDetector&&!this.services.languageDetector.async?s(this.services.languageDetector.detect()):!a&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(s):this.services.languageDetector.detect(s):s(a),r}getFixedT(a,t,r){const i=(o,s,...d)=>{let u;typeof s!="object"?u=this.options.overloadTranslationOptionHandler([o,s].concat(d)):u={...s},u.lng=u.lng||i.lng,u.lngs=u.lngs||i.lngs,u.ns=u.ns||i.ns,u.keyPrefix!==""&&(u.keyPrefix=u.keyPrefix||r||i.keyPrefix);const m=this.options.keySeparator||".";let g;return u.keyPrefix&&Array.isArray(o)?g=o.map(p=>(typeof p=="function"&&(p=it(p,{...this.options,...s})),`${u.keyPrefix}${m}${p}`)):(typeof o=="function"&&(o=it(o,{...this.options,...s})),g=u.keyPrefix?`${u.keyPrefix}${m}${o}`:o),this.t(g,u)};return B(a)?i.lng=a:i.lngs=a,i.ns=t,i.keyPrefix=r,i}t(...a){return this.translator?.translate(...a)}exists(...a){return this.translator?.exists(...a)}setDefaultNamespace(a){this.options.defaultNS=a}hasLoadedNamespace(a,t={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=t.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,o=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const s=(d,u)=>{const m=this.services.backendConnector.state[`${d}|${u}`];return m===-1||m===0||m===2};if(t.precheck){const d=t.precheck(this,s);if(d!==void 0)return d}return!!(this.hasResourceBundle(r,a)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||s(r,a)&&(!i||s(o,a)))}loadNamespaces(a,t){const r=ra();return this.options.ns?(B(a)&&(a=[a]),a.forEach(i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}),this.loadResources(i=>{r.resolve(),t&&t(i)}),r):(t&&t(),Promise.resolve())}loadLanguages(a,t){const r=ra();B(a)&&(a=[a]);const i=this.options.preload||[],o=a.filter(s=>i.indexOf(s)<0&&this.services.languageUtils.isSupportedCode(s));return o.length?(this.options.preload=i.concat(o),this.loadResources(s=>{r.resolve(),t&&t(s)}),r):(t&&t(),Promise.resolve())}dir(a){if(a||(a=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!a)return"rtl";try{const i=new Intl.Locale(a);if(i&&i.getTextInfo){const o=i.getTextInfo();if(o&&o.direction)return o.direction}}catch{}const t=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=this.services?.languageUtils||new Yt(Za());return a.toLowerCase().indexOf("-latn")>1?"ltr":t.indexOf(r.getLanguagePartFromCode(a))>-1||a.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(a={},t){const r=new sa(a,t);return r.createInstance=sa.createInstance,r}cloneInstance(a={},t=xa){const r=a.forkResourceStore;r&&delete a.forkResourceStore;const i={...this.options,...a,isClone:!0},o=new sa(i);if((a.debug!==void 0||a.prefix!==void 0)&&(o.logger=o.logger.clone(a)),["store","services","language"].forEach(d=>{o[d]=this[d]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},r){const d=Object.keys(this.store.data).reduce((u,m)=>(u[m]={...this.store.data[m]},u[m]=Object.keys(u[m]).reduce((g,p)=>(g[p]={...u[m][p]},g),u[m]),u),{});o.store=new Jt(d,i),o.services.resourceStore=o.store}if(a.interpolation){const u={...Za().interpolation,...this.options.interpolation,...a.interpolation},m={...i,interpolation:u};o.services.interpolator=new en(m)}return o.translator=new Ta(o.services,i),o.translator.on("*",(d,...u)=>{o.emit(d,...u)}),o.init(i,t),o.translator.options=i,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const de=sa.createInstance();de.createInstance;de.dir;de.init;de.loadResources;de.reloadResources;de.use;de.changeLanguage;de.getFixedT;de.t;de.exists;de.setDefaultNamespace;de.hasLoadedNamespace;de.loadNamespaces;de.loadLanguages;const Ci=(n,a,t,r)=>{const i=[t,{code:a,...r||{}}];if(n?.services?.logger?.forward)return n.services.logger.forward(i,"warn","react-i18next::",!0);Oe(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),n?.services?.logger?.warn?n.services.logger.warn(...i):console?.warn&&console.warn(...i)},nn={},Kn=(n,a,t,r)=>{Oe(t)&&nn[t]||(Oe(t)&&(nn[t]=new Date),Ci(n,a,t,r))},Bn=(n,a)=>()=>{if(n.isInitialized)a();else{const t=()=>{setTimeout(()=>{n.off("initialized",t)},0),a()};n.on("initialized",t)}},ot=(n,a,t)=>{n.loadNamespaces(a,Bn(n,t))},rn=(n,a,t,r)=>{if(Oe(t)&&(t=[t]),n.options.preload&&n.options.preload.indexOf(a)>-1)return ot(n,t,r);t.forEach(i=>{n.options.ns.indexOf(i)<0&&n.options.ns.push(i)}),n.loadLanguages(a,Bn(n,r))},Fi=(n,a,t={})=>!a.languages||!a.languages.length?(Kn(a,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:a.languages}),!0):a.hasLoadedNamespace(n,{lng:t.lng,precheck:(r,i)=>{if(t.bindI18n&&t.bindI18n.indexOf("languageChanging")>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!i(r.isLanguageChangingTo,n))return!1}}),Oe=n=>typeof n=="string",Ei=n=>typeof n=="object"&&n!==null,Oi=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Li={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},Ki=n=>Li[n],Bi=n=>n.replace(Oi,Ki);let st={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Bi,transDefaultProps:void 0};const Gi=(n={})=>{st={...st,...n}},Hi=()=>st;let Gn;const Ri=n=>{Gn=n},Ui=()=>Gn,$i={type:"3rdParty",init(n){Gi(n.options.react),Ri(n)}},Vi=h.createContext();class Wi{constructor(){this.usedNamespaces={}}addUsedNamespaces(a){a.forEach(t=>{this.usedNamespaces[t]||(this.usedNamespaces[t]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var Xa={exports:{}},Qa={};var on;function qi(){if(on)return Qa;on=1;var n=Hr();function a(p,k){return p===k&&(p!==0||1/p===1/k)||p!==p&&k!==k}var t=typeof Object.is=="function"?Object.is:a,r=n.useState,i=n.useEffect,o=n.useLayoutEffect,s=n.useDebugValue;function d(p,k){var x=k(),b=r({inst:{value:x,getSnapshot:k}}),w=b[0].inst,S=b[1];return o(function(){w.value=x,w.getSnapshot=k,u(w)&&S({inst:w})},[p,x,k]),i(function(){return u(w)&&S({inst:w}),p(function(){u(w)&&S({inst:w})})},[p]),s(x),x}function u(p){var k=p.getSnapshot;p=p.value;try{var x=k();return!t(p,x)}catch{return!0}}function m(p,k){return k()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?m:d;return Qa.useSyncExternalStore=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:g,Qa}var sn;function Ji(){return sn||(sn=1,Xa.exports=qi()),Xa.exports}var _i=Ji();const Yi=(n,a)=>Oe(a)?a:Ei(a)&&Oe(a.defaultValue)?a.defaultValue:Array.isArray(n)?n[n.length-1]:n,Zi={t:Yi,ready:!1},Xi=()=>()=>{},ce=(n,a={})=>{const{i18n:t}=a,{i18n:r,defaultNS:i}=h.useContext(Vi)||{},o=t||r||Ui();o&&!o.reportNamespaces&&(o.reportNamespaces=new Wi),o||Kn(o,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const s=h.useMemo(()=>({...Hi(),...o?.options?.react,...a}),[o,a]),{useSuspense:d,keyPrefix:u}=s,m=i||o?.options?.defaultNS,g=Oe(m)?[m]:m||["translation"],p=h.useMemo(()=>g,g);o?.reportNamespaces?.addUsedNamespaces?.(p);const k=h.useRef(0),x=h.useCallback(K=>{if(!o)return Xi;const{bindI18n:O,bindI18nStore:E}=s,G=()=>{k.current+=1,K()};return O&&o.on(O,G),E&&o.store.on(E,G),()=>{O&&O.split(" ").forEach(c=>o.off(c,G)),E&&E.split(" ").forEach(c=>o.store.off(c,G))}},[o,s]),b=h.useRef(),w=h.useCallback(()=>{if(!o)return Zi;const K=!!(o.isInitialized||o.initializedStoreOnce)&&p.every(ue=>Fi(ue,o,s)),O=a.lng||o.language,E=k.current,G=b.current;if(G&&G.ready===K&&G.lng===O&&G.keyPrefix===u&&G.revision===E)return G;const $={t:o.getFixedT(O,s.nsMode==="fallback"?p:p[0],u),ready:K,lng:O,keyPrefix:u,revision:E};return b.current=$,$},[o,p,u,s,a.lng]),[S,F]=h.useState(0),{t:L,ready:D}=_i.useSyncExternalStore(x,w,w);h.useEffect(()=>{if(o&&!D&&!d){const K=()=>F(O=>O+1);a.lng?rn(o,a.lng,p,K):ot(o,p,K)}},[o,a.lng,p,D,d,S]);const A=o||{},N=h.useRef(null),P=h.useRef(),U=K=>{const O=Object.getOwnPropertyDescriptors(K);O.__original&&delete O.__original;const E=Object.create(Object.getPrototypeOf(K),O);if(!Object.prototype.hasOwnProperty.call(E,"__original"))try{Object.defineProperty(E,"__original",{value:K,writable:!1,enumerable:!1,configurable:!1})}catch{}return E},q=h.useMemo(()=>{const K=A,O=K?.language;let E=K;K&&(N.current&&N.current.__original===K?P.current!==O?(E=U(K),N.current=E,P.current=O):E=N.current:(E=U(K),N.current=E,P.current=O));const G=[L,E,D];return G.t=L,G.i18n=E,G.ready=D,G},[L,A,D,A.resolvedLanguage,A.language,A.languages]);if(o&&d&&!D)throw new Promise(K=>{const O=()=>K();a.lng?rn(o,a.lng,p,O):ot(o,p,O)});return q},{slice:Qi,forEach:eo}=[];function ao(n){return eo.call(Qi.call(arguments,1),a=>{if(a)for(const t in a)n[t]===void 0&&(n[t]=a[t])}),n}function to(n){return typeof n!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(t=>t.test(n))}const ln=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,no=function(n,a){const r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},i=encodeURIComponent(a);let o=`${n}=${i}`;if(r.maxAge>0){const s=r.maxAge-0;if(Number.isNaN(s))throw new Error("maxAge should be a Number");o+=`; Max-Age=${Math.floor(s)}`}if(r.domain){if(!ln.test(r.domain))throw new TypeError("option domain is invalid");o+=`; Domain=${r.domain}`}if(r.path){if(!ln.test(r.path))throw new TypeError("option path is invalid");o+=`; Path=${r.path}`}if(r.expires){if(typeof r.expires.toUTCString!="function")throw new TypeError("option expires is invalid");o+=`; Expires=${r.expires.toUTCString()}`}if(r.httpOnly&&(o+="; HttpOnly"),r.secure&&(o+="; Secure"),r.sameSite)switch(typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite){case!0:o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"strict":o+="; SameSite=Strict";break;case"none":o+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return r.partitioned&&(o+="; Partitioned"),o},dn={create(n,a,t,r){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};t&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+t*60*1e3)),r&&(i.domain=r),document.cookie=no(n,a,i)},read(n){const a=`${n}=`,t=document.cookie.split(";");for(let r=0;r<t.length;r++){let i=t[r];for(;i.charAt(0)===" ";)i=i.substring(1,i.length);if(i.indexOf(a)===0)return i.substring(a.length,i.length)}return null},remove(n,a){this.create(n,"",-1,a)}};var ro={name:"cookie",lookup(n){let{lookupCookie:a}=n;if(a&&typeof document<"u")return dn.read(a)||void 0},cacheUserLanguage(n,a){let{lookupCookie:t,cookieMinutes:r,cookieDomain:i,cookieOptions:o}=a;t&&typeof document<"u"&&dn.create(t,n,r,i,o)}},io={name:"querystring",lookup(n){let{lookupQuerystring:a}=n,t;if(typeof window<"u"){let{search:r}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(r=window.location.hash.substring(window.location.hash.indexOf("?")));const o=r.substring(1).split("&");for(let s=0;s<o.length;s++){const d=o[s].indexOf("=");d>0&&o[s].substring(0,d)===a&&(t=o[s].substring(d+1))}}return t}},oo={name:"hash",lookup(n){let{lookupHash:a,lookupFromHashIndex:t}=n,r;if(typeof window<"u"){const{hash:i}=window.location;if(i&&i.length>2){const o=i.substring(1);if(a){const s=o.split("&");for(let d=0;d<s.length;d++){const u=s[d].indexOf("=");u>0&&s[d].substring(0,u)===a&&(r=s[d].substring(u+1))}}if(r)return r;if(!r&&t>-1){const s=i.match(/\/([a-zA-Z-]*)/g);return Array.isArray(s)?s[typeof t=="number"?t:0]?.replace("/",""):void 0}}}return r}};let $e=null;const cn=()=>{if($e!==null)return $e;try{if($e=typeof window<"u"&&window.localStorage!==null,!$e)return!1;const n="i18next.translate.boo";window.localStorage.setItem(n,"foo"),window.localStorage.removeItem(n)}catch{$e=!1}return $e};var so={name:"localStorage",lookup(n){let{lookupLocalStorage:a}=n;if(a&&cn())return window.localStorage.getItem(a)||void 0},cacheUserLanguage(n,a){let{lookupLocalStorage:t}=a;t&&cn()&&window.localStorage.setItem(t,n)}};let Ve=null;const un=()=>{if(Ve!==null)return Ve;try{if(Ve=typeof window<"u"&&window.sessionStorage!==null,!Ve)return!1;const n="i18next.translate.boo";window.sessionStorage.setItem(n,"foo"),window.sessionStorage.removeItem(n)}catch{Ve=!1}return Ve};var lo={name:"sessionStorage",lookup(n){let{lookupSessionStorage:a}=n;if(a&&un())return window.sessionStorage.getItem(a)||void 0},cacheUserLanguage(n,a){let{lookupSessionStorage:t}=a;t&&un()&&window.sessionStorage.setItem(t,n)}},co={name:"navigator",lookup(n){const a=[];if(typeof navigator<"u"){const{languages:t,userLanguage:r,language:i}=navigator;if(t)for(let o=0;o<t.length;o++)a.push(t[o]);r&&a.push(r),i&&a.push(i)}return a.length>0?a:void 0}},uo={name:"htmlTag",lookup(n){let{htmlTag:a}=n,t;const r=a||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(t=r.getAttribute("lang")),t}},mo={name:"path",lookup(n){let{lookupFromPathIndex:a}=n;if(typeof window>"u")return;const t=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(t)?t[typeof a=="number"?a:0]?.replace("/",""):void 0}},po={name:"subdomain",lookup(n){let{lookupFromSubdomainIndex:a}=n;const t=typeof a=="number"?a+1:1,r=typeof window<"u"&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(r)return r[t]}};let Hn=!1;try{document.cookie,Hn=!0}catch{}const Rn=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];Hn||Rn.splice(1,1);const go=()=>({order:Rn,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:n=>n});class Un{constructor(a){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(a,t)}init(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=a,this.options=ao(t,this.options||{},go()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=i=>i.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector(ro),this.addDetector(io),this.addDetector(so),this.addDetector(lo),this.addDetector(co),this.addDetector(uo),this.addDetector(mo),this.addDetector(po),this.addDetector(oo)}addDetector(a){return this.detectors[a.name]=a,this}detect(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,t=[];return a.forEach(r=>{if(this.detectors[r]){let i=this.detectors[r].lookup(this.options);i&&typeof i=="string"&&(i=[i]),i&&(t=t.concat(i))}}),t=t.filter(r=>r!=null&&!to(r)).map(r=>this.options.convertDetectedLanguage(r)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?t:t.length>0?t[0]:null}cacheUserLanguage(a){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;t&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(a)>-1||t.forEach(r=>{this.detectors[r]&&this.detectors[r].cacheUserLanguage(a,this.options)}))}}Un.type="languageDetector";const ho={loading:"جاري التحميل...",save:"حفظ",saving:"جاري الحفظ...",cancel:"إلغاء",delete:"حذف",edit:"تعديل",close:"إغلاق",back:"رجوع",next:"التالي",confirm:"تأكيد",error:"خطأ",success:"نجاح",warning:"تحذير",or:"أو",optional:"اختياري",enabled:"مُفعّل",disabled:"معطّل",on:"تشغيل",off:"إيقاف",yes:"نعم",no:"لا",search:"بحث",noResults:"لم يتم العثور على نتائج",retry:"إعادة المحاولة",refresh:"تحديث",download:"تحميل",upload:"رفع",export:"تصدير",import:"استيراد",reset:"إعادة تعيين",apply:"تطبيق",clear:"مسح",all:"الكل",none:"لا شيء",default:"افتراضي",custom:"مخصص",mode:"الوضع",multiUser:"متعدد المستخدمين",remove:"إزالة"},bo={name:"Libre WebUI",shortName:"Libre"},ko={login:{title:"مرحباً بعودتك",subtitle:"سجّل الدخول إلى حسابك للمتابعة",username:"اسم المستخدم",usernamePlaceholder:"أدخل اسم المستخدم",password:"كلمة المرور",passwordPlaceholder:"أدخل كلمة المرور",signIn:"تسجيل الدخول",signingIn:"جاري تسجيل الدخول...",noAccount:"ليس لديك حساب؟",signUpHere:"سجّل هنا",loginSuccess:"تم تسجيل الدخول بنجاح!",loginFailed:"فشل تسجيل الدخول",checkCredentials:"فشل تسجيل الدخول. يرجى التحقق من بيانات الاعتماد.",enterBoth:"يرجى إدخال اسم المستخدم وكلمة المرور",githubSuccess:"تم تسجيل الدخول عبر GitHub بنجاح!",githubFailed:"فشلت مصادقة GitHub",githubVerifyFailed:"فشل التحقق من مصادقة GitHub"},signup:{title:"إنشاء حساب",subtitle:"سجّل للحصول على حساب جديد",username:"اسم المستخدم",usernamePlaceholder:"اختر اسم مستخدم",email:"البريد الإلكتروني",emailPlaceholder:"your@email.com",password:"كلمة المرور",passwordPlaceholder:"اختر كلمة مرور",confirmPassword:"تأكيد كلمة المرور",confirmPasswordPlaceholder:"أكّد كلمة المرور",createAccount:"إنشاء حساب",creatingAccount:"جاري إنشاء الحساب...",hasAccount:"لديك حساب بالفعل؟",signInHere:"سجّل الدخول هنا",signupSuccess:"تم إنشاء الحساب بنجاح!",signupFailed:"فشل التسجيل",tryAgain:"فشل التسجيل. يرجى المحاولة مرة أخرى.",usernameRequired:"اسم المستخدم وكلمة المرور مطلوبان",passwordMismatch:"كلمات المرور غير متطابقة",passwordTooShort:"يجب أن تكون كلمة المرور 6 أحرف على الأقل"},logout:{button:"تسجيل الخروج",success:"تم تسجيل الخروج بنجاح"},oauth:{continueWith:"المتابعة مع {{provider}}",connectingTo:"جاري الاتصال بـ {{provider}}...",github:"GitHub",huggingFace:"Hugging Face"}},fo={welcome:{title:"مرحباً بك في Libre WebUI",subtitle:"لنبدأ",description:"قم بإعداد Libre WebUI الخاص بك في خطوات قليلة",createAdmin:"إنشاء حساب المسؤول",features:{secure:{title:"آمن وخاص",description:"محادثاتك تبقى على جهازك"},fast:{title:"سريع ومتجاوب",description:"محسّن للسرعة والأداء"},openSource:{title:"مفتوح المصدر",description:"برنامج مجاني ومفتوح المصدر"}}},admin:{title:"إنشاء حساب المسؤول",subtitle:"إعداد المسؤول",description:"أنشئ أول حساب مسؤول لـ Libre WebUI الخاص بك",usernamePlaceholder:"أدخل اسم المسؤول",passwordPlaceholder:"أدخل كلمة المرور (6 أحرف على الأقل)",confirmPlaceholder:"أكّد كلمة المرور",creating:"جاري الإنشاء...",createAdmin:"إنشاء المسؤول",success:"تم إنشاء حساب المسؤول بنجاح!",failed:"فشل إنشاء حساب المسؤول",fillAllFields:"يرجى ملء جميع الحقول",note:"سيكون هذا حساب المسؤول الرئيسي لـ Libre WebUI الخاص بك"},encryptionKey:{title:"احفظ مفتاح التشفير",subtitle:"مهم: احفظ هذا المفتاح",description:"يحمي مفتاح التشفير هذا بياناتك الحساسة. احفظه بأمان - ستحتاجه إذا احتجت لاستعادة قاعدة البيانات.",warning:"تحذير",warningText:"إذا فقدت هذا المفتاح واحتجت لاستعادة قاعدة البيانات، ستكون بياناتك المشفرة (مفاتيح API، التفضيلات) غير قابلة للاسترداد.",label:"مفتاح التشفير الخاص بك",loading:"جاري التحميل...",copyToClipboard:"نسخ إلى الحافظة",copied:"تم نسخ مفتاح التشفير إلى الحافظة!",copyFailed:"فشل نسخ المفتاح إلى الحافظة",envNote:"هذا المفتاح محفوظ أيضاً في ملف backend/.env كـ ENCRYPTION_KEY",acknowledgment:"لقد حفظت مفتاح التشفير في مكان آمن وأفهم أن فقدانه قد يؤدي إلى فقدان البيانات.",confirmRequired:"يرجى التأكيد على أنك حفظت مفتاح التشفير",continue:"المتابعة إلى Libre WebUI"}},yo={greeting:{morning:"صباح الخير",afternoon:"مساء الخير",evening:"مساء الخير",night:"تصبح على خير"},welcome:{helpToday:"كيف يمكنني مساعدتك اليوم؟",helpTonight:"كيف يمكنني مساعدتك الليلة؟"},input:{placeholder:"أرسل رسالة",messagePlaceholder:"رسالة...",attachImages:"إرفاق صور",attachments:"المرفقات والميزات المتقدمة",sendMessage:"إرسال الرسالة",stopGeneration:"إيقاف التوليد"},session:{new:"محادثة جديدة",private:"خاص",privateMode:"الوضع الخاص",privateDescription:"لن يتم حفظ هذه المحادثة",privateTooltip:"ابدأ محادثة خاصة لن يتم حفظها",deleteConfirm:"هل أنت متأكد من حذف هذه المحادثة؟",generatingTitle:"جاري توليد العنوان",noChats:"لا توجد محادثات بعد",createFirst:"أنشئ أول محادثة أعلاه",chats:"المحادثات",renameChat:"إعادة تسمية المحادثة",deleteChat:"حذف المحادثة"},persona:{applied:"تم تطبيق الشخصية",label:"الشخصية"},model:{updated:"تم تحديث النموذج",noModels:"لا توجد نماذج متاحة",noModelsDescription:"لا توجد نماذج متاحة. تأكد من تشغيل Ollama وتثبيت النماذج.",pullCommand:"ollama pull llama3.2:3b",noModelsTooltip:"لا توجد نماذج متاحة. يرجى التأكد من تشغيل Ollama وتثبيت النماذج."},footer:{disclaimer:"قد يرتكب الذكاء الاصطناعي أخطاء - تحقق من المعلومات المهمة",images:"{{count}} صورة",images_plural:"{{count}} صور",structuredOutput:"مخرجات منظمة"},mediaUpload:{dropImagesHere:"أفلت الصور هنا أو",supportedFormats:"يدعم: JPG، PNG، GIF، WebP (حد أقصى 10 ميجابايت لكل صورة)",browse:"تصفح"},structuredOutput:{title:"تنسيق الاستجابة",none:"بدون (لغة طبيعية)",noneDescription:"استجابة باللغة الطبيعية الافتراضية",json:"JSON",jsonDescription:"تنسيق JSON منظم",list:"قائمة",listDescription:"مصفوفة من العناصر",summary:"ملخص",summaryDescription:"ملخص المستند مع النقاط الرئيسية",analysis:"تحليل",analysisDescription:"تحليل منظم مع الإيجابيات والسلبيات",custom:"مخطط مخصص",customDescription:"حدد مخطط JSON الخاص بك",customSchema:"مخطط JSON مخصص",schemaPreview:"معاينة المخطط",applySchema:"تطبيق المخطط",cancel:"إلغاء",enabled:"تم تفعيل المخرجات المنظمة"}},vo={navigation:{chat:"محادثة",models:"النماذج",personas:"الشخصيات",imagine:"تخيّل",settings:"الإعدادات",userManagement:"إدارة المستخدمين",signOut:"تسجيل الخروج"},toggleSize:"تبديل حجم الشريط الجانبي",expandSidebar:"توسيع الشريط الجانبي"},xo={menu:{changePicture:"تغيير الصورة",settings:"الإعدادات",userManagement:"إدارة المستخدمين",logout:"تسجيل الخروج"},avatar:{title:"تغيير صورة الملف الشخصي",updated:"تم تحديث صورة الملف الشخصي",updateFailed:"فشل تحديث صورة الملف الشخصي",saving:"جاري الحفظ..."},profile:{noEmail:"لم يتم تقديم بريد إلكتروني"}},So={title:"الإعدادات",tabs:{appearance:"المظهر",model:"النموذج",systemMessage:"رسالة النظام",plugins:"الإضافات",generation:"التوليد",documents:"المستندات",tts:"تحويل النص إلى كلام",imageGen:"توليد الصور",system:"النظام",data:"البيانات",about:"حول"},appearance:{title:"المظهر",language:{title:"اللغة",description:"اختر لغتك المفضلة"},theme:{title:"السمة",light:"فاتح",dark:"داكن",amoled:"AMOLED",system:"النظام"},chatInterface:{title:"واجهة المحادثة",showUsername:"إظهار اسم المستخدم",showUsernameDescription:"عرض اسم المستخدم في رسائل المحادثة"},background:{title:"صورة الخلفية",enable:"تفعيل صورة الخلفية",enableDescription:"عرض خلفية مخصصة مع تأثير التمويه",blur:"التمويه",opacity:"الشفافية",upload:"رفع صورة الخلفية",dragDrop:"اسحب وأفلت صورة أو انقر للتصفح",chooseImage:"اختر صورة"}},system:{title:"النظام",currentModel:"النموذج الحالي",notSet:"غير محدد"},saveSettings:"حفظ الإعدادات",model:{title:"إعدادات النموذج",defaultModel:"النموذج الافتراضي",defaultModelDescription:"سيتم استخدام هذا النموذج افتراضياً للمحادثات الجديدة",selectModel:"اختر نموذجاً",updateAll:"تحديث جميع النماذج",updateAllDescription:"التحقق من التحديثات وسحب أحدث إصدارات جميع النماذج المثبتة",updateAllButton:"تحديث الكل",updating:"جاري تحديث النماذج...",currentModelInfo:"معلومات النموذج الحالي",name:"الاسم",size:"الحجم",family:"العائلة",format:"التنسيق",status:"الحالة",statusStarting:"جاري البدء...",statusComplete:"مكتمل",statusError:"خطأ",bulkOperations:"العمليات المجمعة",autoTitle:{title:"توليد العنوان التلقائي",enable:"تفعيل العنوان التلقائي",enableDescription:"توليد عناوين تلقائياً للمحادثات الجديدة",taskModel:"نموذج المهام",selectTaskModel:"اختر نموذج المهام",taskModelDescription:"النموذج المستخدم لتوليد عناوين المحادثات"}},systemMessage:{title:"رسالة النظام",description:"عيّن رسالة نظام مخصصة ستُستخدم لجميع المحادثات الجديدة.",placeholder:"أدخل رسالة النظام...",saved:"تم حفظ رسالة النظام",saveFailed:"فشل حفظ رسالة النظام"},plugins:{title:"الإضافات",description:"إدارة الإضافات المثبتة",addNew:"إضافة إضافة جديدة",upload:"رفع إضافة",addJson:"إضافة JSON",uploading:"جاري الرفع...",jsonPlaceholder:"الصق إعدادات JSON للإضافة...",install:"تثبيت الإضافة",noPlugins:"لا توجد إضافات مثبتة",noPluginsDescription:"أضف إضافة لتوسيع الوظائف",loading:"جاري تحميل الإضافات...",installed:"الإضافات المثبتة",active:"الإضافات النشطة",activeLabel:"نشط",inactive:"غير نشط",activate:"تفعيل",deactivate:"إلغاء التفعيل",models:"نماذج",apiKeySet:"تم تعيين مفتاح API",apiKeyConfiguration:"إعداد مفتاح API",apiKeyEnvAlternative:"بدلاً من ذلك، عيّن",environmentVariable:"متغير البيئة",apiKeyConfigured:"تم إعداد مفتاح API",apiKeyPlaceholder:"أدخل مفتاح API...",saveApiKey:"حفظ مفتاح API",apiKey:{title:"مفتاح API",placeholder:"أدخل مفتاح API",save:"حفظ المفتاح",remove:"إزالة المفتاح",configured:"تم إعداد مفتاح API",notConfigured:"مفتاح API مطلوب",saved:"تم حفظ مفتاح API بنجاح",removed:"تم إزالة مفتاح API",saveFailed:"فشل حفظ مفتاح API",removeFailed:"فشل إزالة مفتاح API",enterKey:"يرجى إدخال مفتاح API"}},generation:{title:"خيارات التوليد",description:"إعداد كيفية توليد الذكاء الاصطناعي للاستجابات",coreParameters:"المعلمات الأساسية",temperature:"درجة الحرارة",temperatureDescription:"يتحكم في العشوائية. القيم الأقل أكثر تركيزاً، والقيم الأعلى أكثر إبداعاً.",topP:"Top P",topPDescription:"يتحكم في التنوع عبر أخذ العينات النووية. القيم الأقل تركز على الرموز المحتملة.",topK:"Top K",topKDescription:"يحد اختيار الرموز لأكثر K رمز احتمالاً. عيّن 0 للتعطيل.",minP:"Min P",minPDescription:"الحد الأدنى لاحتمال اختيار الرمز.",generationControl:"التحكم في التوليد",maxTokens:"الحد الأقصى للرموز",maxTokensDescription:"الحد الأقصى لعدد الرموز المولدة في الاستجابة.",repeatPenalty:"عقوبة التكرار",repeatPenaltyDescription:"يعاقب الرموز المتكررة. القيم الأعلى تقلل التكرار.",contextLength:"طول السياق",contextLengthDescription:"الحد الأقصى لحجم نافذة السياق للمحادثات.",seed:"البذرة",optional:"اختياري",random:"عشوائي",seedDescription:"عيّن بذرة محددة للمخرجات القابلة للتكرار.",advancedOptions:"خيارات متقدمة",presencePenalty:"عقوبة الوجود",presencePenaltyDescription:"يعاقب الرموز التي تظهر في السياق.",frequencyPenalty:"عقوبة التكرار",frequencyPenaltyDescription:"يعاقب الرموز المستخدمة بشكل متكرر.",stopSequences:"تسلسلات الإيقاف",commaSeparated:"مفصولة بفواصل",stopSequencesDescription:"رموز مخصصة ستوقف التوليد عند مصادفتها.",resetDefaults:"إعادة تعيين الافتراضيات",saveOptions:"حفظ الخيارات",embeddingSettings:"إعدادات التضمين",enableEmbeddings:"تفعيل تضمين المستندات"},documents:{title:"إعدادات المستندات",embeddings:{title:"التضمينات",enable:"تفعيل تضمين المستندات",model:"نموذج التضمين",modelDescription:"اختر النموذج المستخدم لتضمين المستندات",chunkSize:"حجم القطعة",chunkSizeInTokens:"(بالرموز)",chunkSizeDescription:"حجم قطع النص للتضمين",chunkOverlap:"تداخل القطع",chunkOverlapInTokens:"(بالرموز)",chunkOverlapDescription:"التداخل بين القطع المتتالية",similarityThreshold:"عتبة التشابه",similarityDescription:"الحد الأدنى لدرجة التشابه لتضمين النتائج",status:"حالة التضمين",statusLabel:"الحالة",available:"متاح",unavailable:"غير متاح",chunksWithEmbeddings:"قطع مع تضمينات",coverage:"التغطية",regenerate:"إعادة توليد التضمينات",regenerating:"جاري إعادة التوليد..."}},tts:{title:"تحويل النص إلى كلام",description:"إعداد إعدادات تحويل النص إلى كلام لقراءة الرسائل بصوت عالٍ",loadingProviders:"جاري تحميل مزودي TTS...",noProviders:"لا يوجد مزودو TTS",noProvidersDescription:"قم بإعداد إضافة مع دعم TTS لتفعيل تحويل النص إلى كلام",enable:"تفعيل TTS",enableDescription:"السماح بتحويل النص إلى كلام لرسائل المساعد",autoPlay:"تشغيل تلقائي للاستجابات",autoPlayDescription:"قراءة رسائل المساعد الجديدة بصوت عالٍ تلقائياً",voiceConfiguration:"إعداد الصوت",model:"نموذج TTS",modelDescription:"اختر النموذج لتوليد الكلام",voice:"الصوت",selectVoice:"اختر صوتاً",voiceDescription:"اختر الصوت لتحويل النص إلى كلام",speed:"السرعة",speedSlow:"0.5x",speedNormal:"1.0x",speedFast:"2.0x",availableProviders:"المزودون المتاحون",models:"نماذج",test:"اختبار",testing:"جاري الاختبار...",stop:"إيقاف"},imageGen:{title:"توليد الصور",description:"إعداد إعدادات ومزودي توليد الصور",loadingProviders:"جاري تحميل مزودي توليد الصور...",noProviders:"لا يوجد مزودو توليد صور",noProvidersDescription:"قم بإعداد إضافة مع دعم توليد الصور",enable:"تفعيل توليد الصور",enableDescription:"السماح بتوليد الصور بالذكاء الاصطناعي في المحادثات",configuration:"الإعداد",model:"النموذج",modelDescription:"اختر النموذج لتوليد الصور",size:"الحجم",sizeDescription:"دقة الصور المولدة",quality:"الجودة",qualityDescription:"مستوى جودة الصور المولدة",style:"الأسلوب",styleDescription:"إعداد الأسلوب المسبق للصور المولدة",availableProviders:"المزودون المتاحون",models:"نماذج"},data:{title:"إدارة البيانات",export:"تصدير البيانات",exportDescription:"تحميل جميع بياناتك بما في ذلك التفضيلات والجلسات والمستندات.",exportAll:"تصدير جميع البيانات",import:"استيراد البيانات",importDescription:"استيراد البيانات من تصدير سابق.",importData:"استيراد البيانات",importing:"جاري الاستيراد...",clearSessions:"مسح الجلسات",clearSessionsDescription:"حذف جميع جلسات المحادثة. لا يمكن التراجع عن هذا الإجراء.",clearAll:"مسح الكل",clearing:"جاري المسح...",importOptions:"خيارات الاستيراد",importOptionsDescription:"اختر كيفية التعامل مع البيانات الموجودة",skipDuplicates:"تخطي المكررات",overwrite:"الكتابة فوق الموجود",importResults:"نتائج الاستيراد",preferences:"التفضيلات",imported:"تم الاستيراد",failed:"فشل",sessions:"الجلسات",importedLabel:"تم الاستيراد",skipped:"تم التخطي",documents:"المستندات",errors:"أخطاء"},about:{title:"حول",versionLabel:"الإصدار",ollama:{title:"حالة Ollama",version:"الإصدار",healthy:"سليم",unhealthy:"غير سليم"},stats:{models:"النماذج",sessions:"الجلسات"},features:{privacy:{title:"الخصوصية أولاً",description:"بياناتك تبقى على جهازك"},openSource:{title:"مفتوح المصدر",description:"برنامج مجاني ومفتوح المصدر"},localInference:{title:"استدلال محلي",description:"تشغيل نماذج الذكاء الاصطناعي محلياً مع Ollama"}},openSourceBy:"مفتوح المصدر بواسطة {{company}}",links:{title:"الروابط",github:"GitHub",githubDescription:"عرض الكود المصدري والمساهمة",website:"الموقع",websiteDescription:"زيارة موقعنا",ollama:"Ollama",ollamaDescription:"معرفة المزيد عن Ollama",documentation:"التوثيق",reportIssue:"الإبلاغ عن المشاكل",reportIssueDescription:"تقارير الأخطاء وطلبات الميزات"},version:"الإصدار {{version}}"}},wo={title:"النماذج",subtitle:"سحب وإدارة ومراقبة نماذج Ollama",installed:"النماذج المثبتة",available:"النماذج المتاحة",pull:"سحب النموذج",pulling:"جاري السحب...",delete:"حذف النموذج",deleting:"جاري الحذف...",size:"الحجم",modified:"تم التعديل",family:"العائلة",parameters:"المعلمات",quantization:"التكميم",noModels:"لا توجد نماذج مثبتة",pullFirst:"اسحب نموذجاً للبدء"},Po={title:"الشخصيات",create:"إنشاء شخصية",edit:"تعديل الشخصية",delete:"حذف الشخصية",name:"الاسم",description:"الوصف",systemPrompt:"موجه النظام",model:"النموذج",avatar:"الصورة الرمزية",background:"الخلفية",noPersonas:"لم يتم إنشاء شخصيات",createFirst:"أنشئ أول شخصية لتخصيص تجربة المحادثة"},Mo={title:"المعرض",subtitle:"معرض الصور المولدة بالذكاء الاصطناعي",imageCount:"{{count}} صورة",generate:"توليد صورة",generateDescription:"إنشاء صور بالذكاء الاصطناعي",generating:"جاري التوليد...",prompt:"الموجه",promptPlaceholder:"صف الصورة التي تريد توليدها...",noImages:"لم يتم توليد صور بعد",download:"تحميل",delete:"حذف",regenerate:"إعادة التوليد",model:"النموذج",size:"الحجم",quality:"الجودة",created:"تم الإنشاء"},Do={generic:"حدث خطأ",network:"خطأ في الشبكة. يرجى التحقق من الاتصال.",unauthorized:"غير مصرح لك بتنفيذ هذا الإجراء.",notFound:"لم يتم العثور على المورد المطلوب.",serverError:"خطأ في الخادم. يرجى المحاولة لاحقاً.",validation:"يرجى التحقق من المدخلات والمحاولة مرة أخرى."},jo={title:"اختصارات لوحة المفاتيح",toggleSidebar:"تبديل الشريط الجانبي",openSettings:"فتح الإعدادات",toggleDarkMode:"تبديل الوضع الداكن",showShortcuts:"إظهار اختصارات لوحة المفاتيح",closeModals:"إغلاق النوافذ المنبثقة",groups:{navigation:"التنقل",settings:"الإعدادات",general:"عام",chat:"المحادثة"},actions:{sendMessage:"إرسال الرسالة",newLine:"سطر جديد في الرسالة"},footer:"اضغط {{key1}} أو {{key2}} لإظهار هذه المساعدة",tooltip:"اختصارات لوحة المفاتيح"},Ao={title:"النماذج",loading:"جاري تحميل النماذج...",systemStatus:{online:"Ollama متصل",offline:"Ollama غير متصل",models:"نموذج",models_plural:"نماذج",running:"قيد التشغيل",vram:"VRAM"},sections:{pull:"سحب نموذج جديد",library:"تصفح المكتبة",running:"النماذج قيد التشغيل",local:"النماذج المحلية",advanced:"إجراءات متقدمة"},pull:{placeholder:"أدخل اسم النموذج (مثل llama3.2:3b، deepseek-r1:14b)",button:"سحب",cancel:"إلغاء",popular:"النماذج الشائعة:",browseAll:"تصفح جميع النماذج على ollama.com",success:"تم سحب النموذج {{name}} بنجاح",cancelled:"تم إلغاء سحب النموذج",failed:"فشل سحب النموذج",enterName:"يرجى إدخال اسم النموذج"},progress:{starting:"جاري التهيئة...",pulling:"جاري تحميل النموذج...",verifying:"جاري التحقق من السلامة...",writing:"جاري كتابة البيان...",cleaning:"جاري التنظيف..."},library:{available:"متاح",search:"البحث عن نماذج...",noResults:"لم يتم العثور على نماذج تطابق معاييرك",installed:"مثبت",more:"+{{count}} المزيد",refresh:"تحديث المكتبة"},local:{noModels:"لم يتم تثبيت نماذج بعد",pullToStart:"اسحب نموذجاً أعلاه للبدء",installed:"مثبت",running:"قيد التشغيل",info:"معلومات",copy:"نسخ",delete:"حذف",deleteConfirm:'هل أنت متأكد من حذف النموذج "{{name}}"؟',deleteSuccess:"تم حذف النموذج {{name}} بنجاح",deleteFailed:"فشل حذف النموذج"},advanced:{createModel:"إنشاء نموذج",fromModelfile:"من Modelfile",copyModel:"نسخ نموذج",duplicateExisting:"تكرار موجود",testEmbeddings:"اختبار التضمينات",generateVectors:"توليد المتجهات",healthCheck:"فحص الصحة",testConnection:"اختبار الاتصال",healthy:"Ollama سليم!"},modals:{details:{title:"تفاصيل النموذج",info:"معلومات النموذج",family:"العائلة",parameters:"المعلمات",quantization:"التكميم",format:"التنسيق",systemPrompt:"موجه النظام",template:"القالب",license:"الترخيص",modelfile:"Modelfile",noDetails:"لا تتوفر تفاصيل"},copy:{title:"نسخ النموذج",source:"النموذج المصدر",selectModel:"اختر نموذجاً...",newName:"اسم النموذج الجديد",placeholder:"مثل my-custom-model",copying:"جاري النسخ...",button:"نسخ النموذج",success:"تم نسخ النموذج إلى {{name}}",failed:"فشل نسخ النموذج",enterBoth:"يرجى إدخال أسماء المصدر والوجهة"},create:{title:"إنشاء نموذج مخصص",name:"اسم النموذج",namePlaceholder:"مثل my-assistant",modelfile:"Modelfile",modelfilePlaceholder:`FROM llama3.2
3
3
  SYSTEM You are a helpful assistant.`,docs:"توثيق Modelfile",docsLink:"لمرجع الصيغة",creating:"جاري الإنشاء...",button:"إنشاء النموذج",success:"تم إنشاء النموذج {{name}} بنجاح",failed:"فشل إنشاء النموذج",enterBoth:"يرجى إدخال اسم النموذج ومحتوى Modelfile"},embeddings:{title:"اختبار التضمينات",model:"نموذج التضمين",selectModel:"اختر نموذجاً...",recommended:"موصى به: nomic-embed-text، mxbai-embed-large",input:"نص الإدخال",placeholder:"أدخل النص لتوليد التضمينات...",generating:"جاري التوليد...",button:"توليد التضمينات",result:"النتيجة ({{count}} بُعد)",success:"تم توليد متجه تضمين من {{count}} بُعد",failed:"فشل توليد التضمينات",enterBoth:"يرجى اختيار نموذج وإدخال نص"}}},zo={title:"الشخصيات",subtitle:"إنشاء وإدارة شخصيات الذكاء الاصطناعي مع شخصيات وذكريات وسلوكيات مخصصة",loading:"جاري تحميل الشخصيات...",createButton:"إنشاء شخصية",importExport:"استيراد/تصدير",stats:{title:"شخصياتك",count:"تم إنشاء {{count}} شخصية",count_plural:"تم إنشاء {{count}} شخصيات"},empty:{title:"لا توجد شخصيات بعد",description:"أنشئ أول شخصية للبدء مع تفاعلات الذكاء الاصطناعي المخصصة",button:"أنشئ شخصيتك الأولى"},deleteConfirm:'هل أنت متأكد من حذف "{{name}}"؟',deleteSuccess:'تم حذف الشخصية "{{name}}" بنجاح',downloadSuccess:'تم تحميل الشخصية "{{name}}" بنجاح',failed:"فشل {{action}} الشخصية"},No={title:{create:"إنشاء شخصية جديدة",edit:"تعديل الشخصية"},subtitle:{create:"أنشئ شخصية ذكاء اصطناعي جديدة مع شخصية مخصصة وأنظمة ذاكرة وقدرات تعلم تكيفية",edit:"خصص شخصية الذكاء الاصطناعي مع ذاكرة متقدمة وتعلم تكيفي ومعلمات ذكية"},loading:"جاري تحميل النموذج...",saved:"تم الحفظ",tabs:{basic:"أساسي",parameters:"المعلمات",memory:"الذاكرة والتعلم",advanced:"متقدم"},basic:{name:"الاسم",namePlaceholder:"أدخل اسم الشخصية",model:"النموذج",selectModel:"اختر نموذجاً",description:"الوصف",descriptionPlaceholder:"صف شخصيتك...",systemPrompt:"موجه النظام",systemPromptPlaceholder:"أدخل موجه النظام الذي يحدد سلوك شخصيتك...",systemPromptHint:"يحدد موجه النظام كيف ستتصرف شخصيتك وتستجيب."},parameters:{temperature:"درجة الحرارة",temperatureHint:"يتحكم في الإبداع مقابل الاتساق",topP:"Top-P",topPHint:"يتحكم في تنوع الاستجابة",topK:"Top-K",topKHint:"يحد المفردات لأعلى k رمز",contextWindow:"نافذة السياق",contextWindowHint:"الحد الأقصى لطول سجل المحادثة",maxTokens:"الحد الأقصى للرموز",maxTokensHint:"الحد الأقصى لطول الاستجابة",repeatPenalty:"عقوبة التكرار",repeatPenaltyHint:"يقلل الاستجابات المتكررة"},memory:{title:"نظام الذاكرة",subtitle:"الشخصية تتذكر المحادثات بمرور الوقت",enableHint:"فعّل نظام الذاكرة للسماح لشخصيتك بتذكر المحادثات وبناء السياق بمرور الوقت.",loading:"جاري تحميل حالة الذاكرة...",noData:"لا توجد بيانات ذاكرة بعد",memories:"الذكريات",mbUsed:"ميجابايت مستخدمة",lastBackup:"آخر نسخة احتياطية",never:"أبداً",maxMemories:"الحد الأقصى للذكريات",maxMemoriesHint:"كم ذكرى يمكن لهذه الشخصية تخزينها",retention:"الاحتفاظ بالذاكرة",retentionHint:"أيام الاحتفاظ بالذكريات قبل التنظيف",autoCleanup:"تنظيف تلقائي للذكريات القديمة",wipeAll:"مسح جميع الذكريات",wipeCannot:"لا يمكن التراجع عن هذا",wipeButton:"مسح",wiping:"جاري المسح...",wipeConfirm:"هل أنت متأكد من مسح جميع الذكريات؟ لا يمكن التراجع عن هذا.",wipeSuccess:"تم مسح {{count}} ذكرى"},learning:{title:"التعلم التكيفي",subtitle:"الشخصية تتطور بناءً على التفاعلات",enableHint:"فعّل التعلم التكيفي للسماح لشخصيتك بالتطور وتخصيص الاستجابات بناءً على تفاعلاتك.",speed:"سرعة التعلم",slow:"بطيء",slowDesc:"تغييرات تدريجية",balanced:"متوازن",balancedDesc:"وتيرة معتدلة",fast:"سريع",fastDesc:"تكيف سريع",autoAdapt:"التكيف التلقائي مع تفضيلات المستخدم",whatLearns:"ما تتعلمه الشخصية:",conversationTone:"نبرة المحادثة",responseStyle:"أسلوب الاستجابة",userPreferences:"تفضيلات المستخدم",topicInterests:"اهتمامات الموضوع"},advanced:{embeddingModel:"نموذج التضمين",embeddingHint:"اختر النموذج المستخدم لتشفير الذاكرة والبحث الدلالي. يتم عرض نماذج التضمين أولاً، تليها النماذج الأخرى المتاحة.",noModels:"لم يتم العثور على نماذج",embeddingModels:"نماذج التضمين",otherModels:"نماذج أخرى",installHint:"ثبّت نموذج تضمين:",recommended:"موصى به: nomic-embed-text، mxbai-embed-large، bge-m3، snowflake-arctic-embed",aboutTitle:"حول الإعدادات المتقدمة",aboutDescription:"يُستخدم نموذج التضمين بواسطة نظام الذاكرة لفهم المعنى الدلالي والعثور على الذكريات ذات الصلة أثناء المحادثات. اختر نموذجاً يتناسب مع حالة استخدامك والموارد المتاحة."},actions:{cancel:"إلغاء",save:"حفظ",saving:"جاري الحفظ...",saveClose:"حفظ وإغلاق",create:"إنشاء"},success:{created:"تم إنشاء الشخصية",updated:"تم تحديث الشخصية"},error:{saveFailed:"فشل الحفظ"}},To={enhanced:"محسّن",systemPrompt:"موجه النظام",memories:"ذكريات",use:"استخدام",editTooltip:"تعديل الشخصية",downloadTooltip:"تحميل الشخصية",backup:"نسخة احتياطية",exportDNA:"تصدير DNA",wipeMemories:"مسح الذكريات",wipeConfirm:"هل أنت متأكد من مسح جميع ذكريات هذه الشخصية؟ لا يمكن التراجع عن هذا الإجراء.",wipeSuccess:"تم مسح {{count}} ذكرى",backupSuccess:"تم تحميل نسخة الشخصية الاحتياطية بنجاح",dnaSuccess:"تم تصدير DNA الشخصية بنجاح",failed:"فشل {{action}}"},Io={title:"إدارة المستخدمين",subtitle:"إدارة حسابات المستخدمين والصلاحيات",loading:"جاري تحميل المستخدمين...",createUser:"إنشاء مستخدم",search:"البحث عن مستخدمين...",noUsers:"لم يتم العثور على مستخدمين",noUsersMatching:"لا يوجد مستخدمون يطابقون بحثك",columns:{user:"المستخدم",email:"البريد الإلكتروني",role:"الدور",created:"تم الإنشاء",actions:"الإجراءات"},roles:{admin:"مسؤول",user:"مستخدم"},noEmail:"لا يوجد بريد إلكتروني",deleteConfirm:'هل أنت متأكد من حذف المستخدم "{{name}}"؟',deleteSuccess:"تم حذف المستخدم بنجاح",deleteFailed:"فشل حذف المستخدم",cannotDeleteSelf:"لا يمكنك حذف حسابك الخاص",form:{title:{create:"إنشاء مستخدم",edit:"تعديل المستخدم"},username:"اسم المستخدم",usernamePlaceholder:"أدخل اسم المستخدم",email:"البريد الإلكتروني",emailPlaceholder:"أدخل البريد الإلكتروني (اختياري)",password:"كلمة المرور",passwordPlaceholder:"أدخل كلمة المرور",passwordHint:"اتركها فارغة للاحتفاظ بكلمة المرور الحالية",role:"الدور",creating:"جاري الإنشاء...",updating:"جاري التحديث...",createButton:"إنشاء مستخدم",updateButton:"تحديث المستخدم",createSuccess:"تم إنشاء المستخدم بنجاح",updateSuccess:"تم تحديث المستخدم بنجاح",createFailed:"فشل إنشاء المستخدم",updateFailed:"فشل تحديث المستخدم"}},Co={you:"أنت",assistant:"المساعد",system:"النظام",copy:"نسخ",copyMessage:"نسخ الرسالة",copied:"تم النسخ!",regenerate:"إعادة التوليد",regenerateResponse:"إعادة توليد الاستجابة",edit:"تعديل",editSystemMessage:"تعديل رسالة النظام",saveChanges:"حفظ التغييرات",cancelEditing:"إلغاء التعديل",delete:"حذف",deleteConfirm:"حذف هذه الرسالة؟",branch:"تفرع",speaking:"جاري التحدث...",speakMessage:"نطق الرسالة",stopSpeaking:"إيقاف التحدث",showMore:"عرض المزيد",showLess:"عرض أقل",thinking:"يفكر",systemMessagePlaceholder:"أدخل رسالة النظام...",fullSizeImage:"صورة بالحجم الكامل",startConversation:"ابدأ محادثة",startConversationDescription:"أرسل رسالة للبدء في الدردشة مع مساعدك الذكي. اطرح أسئلة، احصل على مساعدة في البرمجة، أو أجرِ محادثة طبيعية.",scrollToBottom:"انتقل إلى الأسفل",newMessages:"رسائل جديدة"},Fo={title:"معرض الصور",noImages:"لا توجد صور بعد",noImagesHint:"ولّد أول صورة باستخدام اللوحة على اليمين",delete:"حذف",download:"تحميل",deleteConfirm:"هل أنت متأكد من حذف هذه الصورة؟",deleteSuccess:"تم حذف الصورة",deleteFailed:"فشل حذف الصورة",downloadFailed:"فشل تحميل الصورة",loadMore:"تحميل المزيد ({{current}} من {{total}})",loadFailed:"فشل تحميل المعرض"},Eo={title:"توليد صورة",prompt:"الموجه",promptPlaceholder:"صف الصورة التي تريد إنشاءها...",model:"النموذج",selectModel:"اختر نموذجاً",noModels:"لا توجد نماذج توليد صور متاحة",configurePlugin:"قم بإعداد إضافة مع دعم توليد الصور",size:"الحجم",quality:"الجودة",style:"الأسلوب",generate:"توليد",generating:"جاري التوليد...",success:"تم توليد الصورة بنجاح",failed:"فشل توليد الصورة",enterPrompt:"يرجى إدخال موجه"},Oo={title:"حدث خطأ ما",description:"واجهنا خطأ غير متوقع. يرجى تحديث الصفحة.",tryAgain:"تحديث الصفحة",goHome:"الذهاب للرئيسية",errorDetails:"تفاصيل الخطأ (التطوير)"},Lo={title:"المستندات",upload:"رفع مستند",uploading:"جاري الرفع...",noDocuments:"لم يتم رفع مستندات",uploadHint:"ارفع مستندات لاستخدامها في محادثاتك",delete:"حذف",deleteConfirm:"هل أنت متأكد من حذف هذا المستند؟",deleteSuccess:"تم حذف المستند",deleteFailed:"فشل حذف المستند",uploadSuccess:"تم رفع المستند بنجاح",uploadFailed:"فشل رفع المستند",types:"مدعوم: PDF، TXT، MD، DOCX",unsupportedFileType:"يتم دعم ملفات PDF وTXT فقط",fileSizeTooLarge:"يجب أن يكون حجم الملف أقل من 10 ميجابايت",uploadSuccessWithName:'تم رفع المستند "{{name}}" بنجاح',removeSuccess:"تم إزالة المستند بنجاح",removeFailed:"فشل إزالة المستند",removeError:"حدث خطأ أثناء إزالة المستند",clickToUpload:"انقر للرفع",orDragAndDrop:"أو اسحب وأفلت",fileTypesAndSize:"ملفات PDF أو TXT حتى 10 ميجابايت",uploadedDocuments:"المستندات المرفوعة",removeDocument:"إزالة المستند"},Ko={speak:"تحدث",stop:"إيقاف",speaking:"جاري التحدث...",generateFailed:"فشل توليد الكلام",playbackFailed:"فشل تشغيل الصوت",stopSpeaking:"إيقاف التحدث",generatingSpeech:"جاري توليد الكلام...",readAloud:"قراءة بصوت عالٍ"},Bo={title:"المخرجات",code:"الكود",preview:"معاينة",copy:"نسخ الكود",copied:"تم النسخ!",download:"تحميل",expand:"توسيع",collapse:"طي",openInNewTab:"فتح في علامة تبويب جديدة",invalidSvg:"محتوى SVG غير صالح",invalidJson:"محتوى JSON غير صالح",previewMode:"وضع المعاينة",codeMode:"وضع الكود",copyContent:"نسخ المحتوى",openInPanel:"فتح في اللوحة",openInNewWindow:"فتح في نافذة جديدة",created:"تم الإنشاء",closePanelEsc:"إغلاق اللوحة (Esc)",copyButton:"نسخ",open:"فتح",dragEdgeToResize:"اسحب الحافة لتغيير الحجم"},Go={title:"استيراد وتصدير الشخصيات",description:"صدّر شخصياتك لمشاركتها أو استورد شخصيات من الآخرين",exportPersonas:"تصدير الشخصيات",importPersonas:"استيراد الشخصيات",noPersonasToExport:"لا توجد شخصيات للتصدير",personasAvailable:"{{count}} شخصية متاحة",personasAvailable_plural:"{{count}} شخصيات متاحة",exportAll:"تصدير الكل",uploadJsonFile:"رفع ملف JSON",pasteJsonLabel:"لصق بيانات JSON",pasteJsonPlaceholder:"الصق بيانات JSON للشخصية هنا...",importing:"جاري الاستيراد...",importButton:"استيراد الشخصية/الشخصيات",expectedFormat:"تنسيق JSON المتوقع:",exportSuccess:'تم تصدير الشخصية "{{name}}" بنجاح',exportFailed:"فشل تصدير الشخصية",exportAllSuccess:"تم تصدير جميع الشخصيات {{count}} بنجاح",exportAllFailed:"فشل تصدير الشخصيات",pasteJsonData:"يرجى لصق بيانات JSON للشخصية",importMultipleSuccess:"تم استيراد {{count}} شخصيات بنجاح",importMultipleFailed:"فشل استيراد {{count}} شخصيات",importNoneFailed:"فشل استيراد أي شخصيات",importSuccess:"تم استيراد الشخصية بنجاح",importFailed:"فشل استيراد الشخصية"},Ho={common:ho,brand:bo,auth:ko,setup:fo,chat:yo,sidebar:vo,user:xo,settings:So,models:wo,personas:Po,gallery:Mo,errors:Do,keyboard:jo,modelManager:Ao,personaManager:zo,personaForm:No,personaCard:To,userManager:Io,chatMessage:Co,imageGallery:Fo,imageGeneration:Eo,errorBoundary:Oo,documents:Lo,ttsButton:Ko,artifacts:Bo,personaImportExport:Go},Ro={loading:"লোড হচ্ছে...",save:"সংরক্ষণ",saving:"সংরক্ষণ হচ্ছে...",cancel:"বাতিল",delete:"মুছুন",edit:"সম্পাদনা",close:"বন্ধ",back:"পিছনে",next:"পরবর্তী",confirm:"নিশ্চিত করুন",error:"ত্রুটি",success:"সফল",warning:"সতর্কতা",or:"অথবা",optional:"ঐচ্ছিক",enabled:"সক্রিয়",disabled:"নিষ্ক্রিয়",on:"চালু",off:"বন্ধ",yes:"হ্যাঁ",no:"না",search:"অনুসন্ধান",noResults:"কোনো ফলাফল পাওয়া যায়নি",retry:"পুনরায় চেষ্টা করুন",refresh:"রিফ্রেশ",download:"ডাউনলোড",upload:"আপলোড",export:"এক্সপোর্ট",import:"ইম্পোর্ট",reset:"রিসেট",apply:"প্রয়োগ করুন",clear:"মুছুন",all:"সব",none:"কিছুই না",default:"ডিফল্ট",custom:"কাস্টম",mode:"মোড",multiUser:"মাল্টি ইউজার",remove:"সরান"},Uo={name:"Libre WebUI",shortName:"Libre"},$o={login:{title:"স্বাগতম",subtitle:"আপনার অ্যাকাউন্টে সাইন ইন করুন",username:"ব্যবহারকারীর নাম",usernamePlaceholder:"আপনার ব্যবহারকারীর নাম লিখুন",password:"পাসওয়ার্ড",passwordPlaceholder:"আপনার পাসওয়ার্ড লিখুন",signIn:"সাইন ইন",signingIn:"সাইন ইন হচ্ছে...",noAccount:"অ্যাকাউন্ট নেই?",signUpHere:"এখানে সাইন আপ করুন",loginSuccess:"লগইন সফল!",loginFailed:"লগইন ব্যর্থ",checkCredentials:"লগইন ব্যর্থ। আপনার তথ্য পরীক্ষা করুন।",enterBoth:"অনুগ্রহ করে ব্যবহারকারীর নাম এবং পাসওয়ার্ড উভয়ই লিখুন",githubSuccess:"GitHub লগইন সফল!",githubFailed:"GitHub প্রমাণীকরণ ব্যর্থ",githubVerifyFailed:"GitHub প্রমাণীকরণ যাচাই করতে ব্যর্থ"},signup:{title:"অ্যাকাউন্ট তৈরি করুন",subtitle:"আপনার নতুন অ্যাকাউন্টের জন্য সাইন আপ করুন",username:"ব্যবহারকারীর নাম",usernamePlaceholder:"একটি ব্যবহারকারীর নাম বেছে নিন",email:"ইমেইল",emailPlaceholder:"your@email.com",password:"পাসওয়ার্ড",passwordPlaceholder:"একটি পাসওয়ার্ড বেছে নিন",confirmPassword:"পাসওয়ার্ড নিশ্চিত করুন",confirmPasswordPlaceholder:"আপনার পাসওয়ার্ড নিশ্চিত করুন",createAccount:"অ্যাকাউন্ট তৈরি করুন",creatingAccount:"অ্যাকাউন্ট তৈরি হচ্ছে...",hasAccount:"ইতিমধ্যে অ্যাকাউন্ট আছে?",signInHere:"এখানে সাইন ইন করুন",signupSuccess:"অ্যাকাউন্ট সফলভাবে তৈরি হয়েছে!",signupFailed:"সাইন আপ ব্যর্থ",tryAgain:"সাইন আপ ব্যর্থ। অনুগ্রহ করে আবার চেষ্টা করুন।",usernameRequired:"ব্যবহারকারীর নাম এবং পাসওয়ার্ড প্রয়োজন",passwordMismatch:"পাসওয়ার্ড মিলছে না",passwordTooShort:"পাসওয়ার্ড কমপক্ষে ৬ অক্ষরের হতে হবে"},logout:{button:"লগ আউট",success:"সফলভাবে লগ আউট হয়েছে"},oauth:{continueWith:"{{provider}} দিয়ে চালিয়ে যান",connectingTo:"{{provider}} এ সংযোগ হচ্ছে...",github:"GitHub",huggingFace:"Hugging Face"}},Vo={welcome:{title:"Libre WebUI তে স্বাগতম",subtitle:"শুরু করা যাক",description:"কয়েকটি ধাপে আপনার Libre WebUI সেট আপ করুন",createAdmin:"অ্যাডমিন অ্যাকাউন্ট তৈরি করুন",features:{secure:{title:"নিরাপদ এবং ব্যক্তিগত",description:"আপনার কথোপকথন আপনার ডিভাইসে থাকে"},fast:{title:"দ্রুত এবং প্রতিক্রিয়াশীল",description:"গতি এবং কর্মক্ষমতার জন্য অপ্টিমাইজ করা"},openSource:{title:"ওপেন সোর্স",description:"বিনামূল্যে এবং ওপেন সোর্স সফটওয়্যার"}}},admin:{title:"অ্যাডমিন অ্যাকাউন্ট তৈরি করুন",subtitle:"অ্যাডমিনিস্ট্রেটর সেটআপ",description:"আপনার Libre WebUI এর জন্য প্রথম অ্যাডমিন অ্যাকাউন্ট তৈরি করুন",usernamePlaceholder:"অ্যাডমিন ব্যবহারকারীর নাম লিখুন",passwordPlaceholder:"পাসওয়ার্ড লিখুন (ন্যূনতম ৬ অক্ষর)",confirmPlaceholder:"আপনার পাসওয়ার্ড নিশ্চিত করুন",creating:"তৈরি হচ্ছে...",createAdmin:"অ্যাডমিন তৈরি করুন",success:"অ্যাডমিন অ্যাকাউন্ট সফলভাবে তৈরি হয়েছে!",failed:"অ্যাডমিন অ্যাকাউন্ট তৈরি করতে ব্যর্থ",fillAllFields:"অনুগ্রহ করে সব ফিল্ড পূরণ করুন",note:"এটি আপনার Libre WebUI এর প্রাথমিক অ্যাডমিনিস্ট্রেটর অ্যাকাউন্ট হবে"},encryptionKey:{title:"আপনার এনক্রিপশন কী সংরক্ষণ করুন",subtitle:"গুরুত্বপূর্ণ: এই কী সংরক্ষণ করুন",description:"এই এনক্রিপশন কী আপনার সংবেদনশীল ডেটা রক্ষা করে। এটি নিরাপদে সংরক্ষণ করুন - আপনার ডাটাবেস পুনরুদ্ধার করতে হলে এটি প্রয়োজন হবে।",warning:"সতর্কতা",warningText:"যদি আপনি এই কী হারান এবং ডাটাবেস পুনরুদ্ধার করতে হয়, আপনার এনক্রিপ্ট করা ডেটা (API কী, পছন্দসমূহ) পুনরুদ্ধার করা যাবে না।",label:"আপনার এনক্রিপশন কী",loading:"লোড হচ্ছে...",copyToClipboard:"ক্লিপবোর্ডে কপি করুন",copied:"এনক্রিপশন কী ক্লিপবোর্ডে কপি হয়েছে!",copyFailed:"ক্লিপবোর্ডে কী কপি করতে ব্যর্থ",envNote:"এই কী আপনার backend/.env ফাইলে ENCRYPTION_KEY হিসাবে সংরক্ষিত আছে",acknowledgment:"আমি আমার এনক্রিপশন কী একটি নিরাপদ স্থানে সংরক্ষণ করেছি এবং বুঝতে পারছি যে এটি হারালে ডেটা ক্ষতি হতে পারে।",confirmRequired:"অনুগ্রহ করে নিশ্চিত করুন যে আপনি এনক্রিপশন কী সংরক্ষণ করেছেন",continue:"Libre WebUI তে চালিয়ে যান"}},Wo={greeting:{morning:"সুপ্রভাত",afternoon:"শুভ অপরাহ্ন",evening:"শুভ সন্ধ্যা",night:"শুভ রাত্রি"},welcome:{helpToday:"আজ আমি কীভাবে সাহায্য করতে পারি?",helpTonight:"আজ রাতে আমি কীভাবে সাহায্য করতে পারি?"},input:{placeholder:"একটি বার্তা পাঠান",messagePlaceholder:"বার্তা...",attachImages:"ছবি সংযুক্ত করুন",attachments:"সংযুক্তি এবং উন্নত বৈশিষ্ট্য",sendMessage:"বার্তা পাঠান",stopGeneration:"জেনারেশন বন্ধ করুন"},session:{new:"নতুন চ্যাট",private:"ব্যক্তিগত",privateMode:"ব্যক্তিগত মোড",privateDescription:"এই কথোপকথন সংরক্ষণ করা হবে না",privateTooltip:"একটি ব্যক্তিগত কথোপকথন শুরু করুন যা সংরক্ষণ করা হবে না",deleteConfirm:"আপনি কি এই চ্যাট মুছতে চান?",generatingTitle:"শিরোনাম তৈরি হচ্ছে",noChats:"এখনও কোনো চ্যাট নেই",createFirst:"উপরে আপনার প্রথম চ্যাট তৈরি করুন",chats:"চ্যাট",renameChat:"চ্যাট পুনঃনামকরণ করুন",deleteChat:"চ্যাট মুছুন"},persona:{applied:"পার্সোনা প্রয়োগ করা হয়েছে",label:"পার্সোনা"},model:{updated:"মডেল আপডেট হয়েছে",noModels:"কোনো মডেল উপলব্ধ নেই",noModelsDescription:"কোনো মডেল উপলব্ধ নেই। নিশ্চিত করুন যে Ollama চলছে এবং মডেল ইনস্টল করা আছে।",pullCommand:"ollama pull llama3.2:3b",noModelsTooltip:"কোনো মডেল উপলব্ধ নেই। অনুগ্রহ করে নিশ্চিত করুন যে Ollama চলছে এবং মডেল ইনস্টল করা আছে।"},footer:{disclaimer:"LLM ভুল করতে পারে - গুরুত্বপূর্ণ তথ্য যাচাই করুন",images:"{{count}}টি ছবি",images_plural:"{{count}}টি ছবি",structuredOutput:"স্ট্রাকচার্ড আউটপুট"},mediaUpload:{dropImagesHere:"এখানে ছবি ছেড়ে দিন বা",supportedFormats:"সমর্থিত: JPG, PNG, GIF, WebP (সর্বোচ্চ ১০MB প্রতিটি)",browse:"ব্রাউজ করুন"},structuredOutput:{title:"রেসপন্স ফরম্যাট",none:"কোনোটি নয় (প্রাকৃতিক ভাষা)",noneDescription:"ডিফল্ট প্রাকৃতিক ভাষা প্রতিক্রিয়া",json:"JSON",jsonDescription:"স্ট্রাকচার্ড JSON ফরম্যাট",list:"তালিকা",listDescription:"আইটেমের অ্যারে",summary:"সারাংশ",summaryDescription:"মূল পয়েন্ট সহ ডকুমেন্ট সারাংশ",analysis:"বিশ্লেষণ",analysisDescription:"সুবিধা/অসুবিধা সহ স্ট্রাকচার্ড বিশ্লেষণ",custom:"কাস্টম স্কিমা",customDescription:"আপনার নিজের JSON স্কিমা সংজ্ঞায়িত করুন",customSchema:"কাস্টম JSON স্কিমা",schemaPreview:"স্কিমা প্রিভিউ",applySchema:"স্কিমা প্রয়োগ করুন",cancel:"বাতিল",enabled:"স্ট্রাকচার্ড আউটপুট সক্রিয়"}},qo={navigation:{chat:"চ্যাট",models:"মডেল",personas:"পার্সোনা",imagine:"ইমাজিন",settings:"সেটিংস",userManagement:"ব্যবহারকারী ব্যবস্থাপনা",signOut:"সাইন আউট"},toggleSize:"সাইডবার সাইজ টগল করুন",expandSidebar:"সাইডবার প্রসারিত করুন"},Jo={menu:{changePicture:"ছবি পরিবর্তন করুন",settings:"সেটিংস",userManagement:"ব্যবহারকারী ব্যবস্থাপনা",logout:"লগ আউট"},avatar:{title:"প্রোফাইল ছবি পরিবর্তন করুন",updated:"প্রোফাইল ছবি আপডেট হয়েছে",updateFailed:"প্রোফাইল ছবি আপডেট করতে ব্যর্থ",saving:"সংরক্ষণ হচ্ছে..."},profile:{noEmail:"কোনো ইমেইল দেওয়া হয়নি"}},_o={title:"সেটিংস",tabs:{appearance:"চেহারা",model:"মডেল",systemMessage:"সিস্টেম বার্তা",plugins:"প্লাগইন",generation:"জেনারেশন",documents:"ডকুমেন্ট",tts:"টেক্সট-টু-স্পিচ",imageGen:"ইমেজ জেনারেশন",system:"সিস্টেম",data:"ডেটা",about:"সম্পর্কে"},appearance:{title:"চেহারা",language:{title:"ভাষা",description:"আপনার পছন্দের ভাষা নির্বাচন করুন"},theme:{title:"থিম",light:"লাইট",dark:"ডার্ক",amoled:"AMOLED",system:"সিস্টেম"},chatInterface:{title:"চ্যাট ইন্টারফেস",showUsername:"ব্যবহারকারীর নাম দেখান",showUsernameDescription:"চ্যাট বার্তায় ব্যবহারকারীর নাম প্রদর্শন করুন"},background:{title:"ব্যাকগ্রাউন্ড ইমেজ",enable:"ব্যাকগ্রাউন্ড ইমেজ সক্রিয় করুন",enableDescription:"ব্লার ইফেক্ট সহ কাস্টম ব্যাকগ্রাউন্ড দেখান",blur:"ব্লার",opacity:"অপাসিটি",upload:"ব্যাকগ্রাউন্ড ইমেজ আপলোড করুন",dragDrop:"একটি ছবি টেনে আনুন বা ব্রাউজ করতে ক্লিক করুন",chooseImage:"ছবি বেছে নিন"}},system:{title:"সিস্টেম",currentModel:"বর্তমান মডেল",notSet:"সেট করা হয়নি"},saveSettings:"সেটিংস সংরক্ষণ করুন",model:{title:"মডেল সেটিংস",defaultModel:"ডিফল্ট মডেল",defaultModelDescription:"নতুন কথোপকথনের জন্য এই মডেলটি ডিফল্টভাবে ব্যবহৃত হবে",selectModel:"একটি মডেল নির্বাচন করুন",updateAll:"সব মডেল আপডেট করুন",updateAllDescription:"আপডেট চেক করুন এবং সব ইনস্টল করা মডেলের সর্বশেষ সংস্করণ পুল করুন",updateAllButton:"সব আপডেট করুন",updating:"মডেল আপডেট হচ্ছে...",currentModelInfo:"বর্তমান মডেল তথ্য",name:"নাম",size:"সাইজ",family:"ফ্যামিলি",format:"ফরম্যাট",status:"স্ট্যাটাস",statusStarting:"শুরু হচ্ছে...",statusComplete:"সম্পূর্ণ",statusError:"ত্রুটি",bulkOperations:"বাল্ক অপারেশন",autoTitle:{title:"স্বয়ংক্রিয় শিরোনাম জেনারেশন",enable:"স্বয়ংক্রিয় শিরোনাম সক্রিয় করুন",enableDescription:"নতুন কথোপকথনের জন্য স্বয়ংক্রিয়ভাবে শিরোনাম তৈরি করুন",taskModel:"টাস্ক মডেল",selectTaskModel:"টাস্ক মডেল নির্বাচন করুন",taskModelDescription:"কথোপকথনের শিরোনাম তৈরিতে ব্যবহৃত মডেল"}},systemMessage:{title:"সিস্টেম বার্তা",description:"একটি কাস্টম সিস্টেম বার্তা সেট করুন যা সব নতুন কথোপকথনের জন্য ব্যবহৃত হবে।",placeholder:"একটি সিস্টেম বার্তা লিখুন...",saved:"সিস্টেম বার্তা সংরক্ষিত",saveFailed:"সিস্টেম বার্তা সংরক্ষণ করতে ব্যর্থ"},plugins:{title:"প্লাগইন",description:"আপনার ইনস্টল করা প্লাগইন পরিচালনা করুন",addNew:"নতুন প্লাগইন যোগ করুন",upload:"প্লাগইন আপলোড করুন",addJson:"JSON যোগ করুন",uploading:"আপলোড হচ্ছে...",jsonPlaceholder:"প্লাগইন JSON কনফিগারেশন পেস্ট করুন...",install:"প্লাগইন ইনস্টল করুন",noPlugins:"কোনো প্লাগইন ইনস্টল করা নেই",noPluginsDescription:"কার্যকারিতা বাড়াতে একটি প্লাগইন যোগ করুন",loading:"প্লাগইন লোড হচ্ছে...",installed:"ইনস্টল করা প্লাগইন",active:"সক্রিয় প্লাগইন",activeLabel:"সক্রিয়",inactive:"নিষ্ক্রিয়",activate:"সক্রিয় করুন",deactivate:"নিষ্ক্রিয় করুন",models:"মডেল",apiKeySet:"API কী সেট",apiKeyConfiguration:"API কী কনফিগারেশন",apiKeyEnvAlternative:"বিকল্পভাবে, সেট করুন",environmentVariable:"এনভায়রনমেন্ট ভেরিয়েবল",apiKeyConfigured:"API কী কনফিগার করা হয়েছে",apiKeyPlaceholder:"আপনার API কী লিখুন...",saveApiKey:"API কী সংরক্ষণ করুন",apiKey:{title:"API কী",placeholder:"API কী লিখুন",save:"কী সংরক্ষণ করুন",remove:"কী সরান",configured:"API কী কনফিগার করা হয়েছে",notConfigured:"API কী প্রয়োজন",saved:"API কী সফলভাবে সংরক্ষিত",removed:"API কী সরানো হয়েছে",saveFailed:"API কী সংরক্ষণ করতে ব্যর্থ",removeFailed:"API কী সরাতে ব্যর্থ",enterKey:"অনুগ্রহ করে একটি API কী লিখুন"}},generation:{title:"জেনারেশন অপশন",description:"AI কীভাবে প্রতিক্রিয়া তৈরি করে তা কনফিগার করুন",coreParameters:"কোর প্যারামিটার",temperature:"টেম্পারেচার",temperatureDescription:"র্যান্ডমনেস নিয়ন্ত্রণ করে। কম মান বেশি ফোকাসড, উচ্চ মান বেশি সৃজনশীল।",topP:"Top P",topPDescription:"নিউক্লিয়াস স্যাম্পলিং এর মাধ্যমে বৈচিত্র্য নিয়ন্ত্রণ করে। কম মান সম্ভাব্য টোকেনে ফোকাস করে।",topK:"Top K",topKDescription:"টোকেন নির্বাচন শীর্ষ K সর্বাধিক সম্ভাব্যতে সীমাবদ্ধ করে। নিষ্ক্রিয় করতে 0 সেট করুন।",minP:"Min P",minPDescription:"টোকেন নির্বাচনের জন্য ন্যূনতম সম্ভাব্যতা থ্রেশহোল্ড।",generationControl:"জেনারেশন কন্ট্রোল",maxTokens:"সর্বোচ্চ টোকেন",maxTokensDescription:"প্রতিক্রিয়ায় তৈরি করার সর্বোচ্চ টোকেন সংখ্যা।",repeatPenalty:"রিপিট পেনাল্টি",repeatPenaltyDescription:"পুনরাবৃত্ত টোকেনকে শাস্তি দেয়। উচ্চ মান পুনরাবৃত্তি কমায়।",contextLength:"কনটেক্সট লেংথ",contextLengthDescription:"কথোপকথনের জন্য সর্বোচ্চ কনটেক্সট উইন্ডো সাইজ।",seed:"সিড",optional:"ঐচ্ছিক",random:"র্যান্ডম",seedDescription:"পুনরুৎপাদনযোগ্য আউটপুটের জন্য একটি নির্দিষ্ট সিড সেট করুন।",advancedOptions:"উন্নত অপশন",presencePenalty:"প্রেজেন্স পেনাল্টি",presencePenaltyDescription:"কনটেক্সটে প্রদর্শিত টোকেনকে শাস্তি দেয়।",frequencyPenalty:"ফ্রিকোয়েন্সি পেনাল্টি",frequencyPenaltyDescription:"ঘন ঘন ব্যবহৃত টোকেনকে শাস্তি দেয়।",stopSequences:"স্টপ সিকোয়েন্স",commaSeparated:"কমা দ্বারা পৃথক",stopSequencesDescription:"কাস্টম টোকেন যা পাওয়া গেলে জেনারেশন বন্ধ হবে।",resetDefaults:"ডিফল্টে রিসেট করুন",saveOptions:"অপশন সংরক্ষণ করুন",embeddingSettings:"এমবেডিং সেটিংস",enableEmbeddings:"ডকুমেন্ট এমবেডিং সক্রিয় করুন"},documents:{title:"ডকুমেন্ট সেটিংস",embeddings:{title:"এমবেডিং",enable:"ডকুমেন্ট এমবেডিং সক্রিয় করুন",model:"এমবেডিং মডেল",modelDescription:"ডকুমেন্ট এমবেডিং এর জন্য ব্যবহৃত মডেল নির্বাচন করুন",chunkSize:"চাংক সাইজ",chunkSizeInTokens:"(টোকেনে)",chunkSizeDescription:"এমবেডিং এর জন্য টেক্সট চাংকের সাইজ",chunkOverlap:"চাংক ওভারল্যাপ",chunkOverlapInTokens:"(টোকেনে)",chunkOverlapDescription:"পরপর চাংকের মধ্যে ওভারল্যাপ",similarityThreshold:"সিমিলারিটি থ্রেশহোল্ড",similarityDescription:"ফলাফল অন্তর্ভুক্ত করার ন্যূনতম সিমিলারিটি স্কোর",status:"এমবেডিং স্ট্যাটাস",statusLabel:"স্ট্যাটাস",available:"উপলব্ধ",unavailable:"অনুপলব্ধ",chunksWithEmbeddings:"এমবেডিং সহ চাংক",coverage:"কভারেজ",regenerate:"এমবেডিং পুনরায় তৈরি করুন",regenerating:"পুনরায় তৈরি হচ্ছে..."}},tts:{title:"টেক্সট-টু-স্পিচ",description:"বার্তা জোরে পড়ার জন্য টেক্সট-টু-স্পিচ সেটিংস কনফিগার করুন",loadingProviders:"TTS প্রোভাইডার লোড হচ্ছে...",noProviders:"কোনো TTS প্রোভাইডার নেই",noProvidersDescription:"টেক্সট-টু-স্পিচ সক্রিয় করতে TTS সমর্থন সহ একটি প্লাগইন কনফিগার করুন",enable:"TTS সক্রিয় করুন",enableDescription:"সহকারী বার্তার জন্য টেক্সট-টু-স্পিচ অনুমতি দিন",autoPlay:"প্রতিক্রিয়া অটো-প্লে",autoPlayDescription:"স্বয়ংক্রিয়ভাবে নতুন সহকারী বার্তা জোরে পড়ুন",voiceConfiguration:"ভয়েস কনফিগারেশন",model:"TTS মডেল",modelDescription:"টেক্সট-টু-স্পিচ জেনারেশনের জন্য মডেল নির্বাচন করুন",voice:"ভয়েস",selectVoice:"একটি ভয়েস নির্বাচন করুন",voiceDescription:"টেক্সট-টু-স্পিচের জন্য ভয়েস বেছে নিন",speed:"গতি",speedSlow:"0.5x",speedNormal:"1.0x",speedFast:"2.0x",availableProviders:"উপলব্ধ প্রোভাইডার",models:"মডেল",test:"পরীক্ষা",testing:"পরীক্ষা হচ্ছে...",stop:"বন্ধ"},imageGen:{title:"ইমেজ জেনারেশন",description:"ইমেজ জেনারেশন সেটিংস এবং প্রোভাইডার কনফিগার করুন",loadingProviders:"ইমেজ জেনারেশন প্রোভাইডার লোড হচ্ছে...",noProviders:"কোনো ইমেজ জেনারেশন প্রোভাইডার নেই",noProvidersDescription:"ইমেজ জেনারেশন সমর্থন সহ একটি প্লাগইন কনফিগার করুন",enable:"ইমেজ জেনারেশন সক্রিয় করুন",enableDescription:"কথোপকথনে AI ইমেজ জেনারেশন অনুমতি দিন",configuration:"কনফিগারেশন",model:"মডেল",modelDescription:"ইমেজ জেনারেশনের জন্য মডেল নির্বাচন করুন",size:"সাইজ",sizeDescription:"তৈরি ইমেজের রেজোলিউশন",quality:"কোয়ালিটি",qualityDescription:"তৈরি ইমেজের কোয়ালিটি লেভেল",style:"স্টাইল",styleDescription:"তৈরি ইমেজের স্টাইল প্রিসেট",availableProviders:"উপলব্ধ প্রোভাইডার",models:"মডেল"},data:{title:"ডেটা ম্যানেজমেন্ট",export:"ডেটা এক্সপোর্ট",exportDescription:"পছন্দ, সেশন এবং ডকুমেন্ট সহ আপনার সব ডেটা ডাউনলোড করুন।",exportAll:"সব ডেটা এক্সপোর্ট করুন",import:"ডেটা ইম্পোর্ট",importDescription:"পূর্ববর্তী এক্সপোর্ট থেকে ডেটা ইম্পোর্ট করুন।",importData:"ডেটা ইম্পোর্ট করুন",importing:"ইম্পোর্ট হচ্ছে...",clearSessions:"সেশন মুছুন",clearSessionsDescription:"সব চ্যাট সেশন মুছুন। এই ক্রিয়া পূর্বাবস্থায় ফেরানো যাবে না।",clearAll:"সব মুছুন",clearing:"মোছা হচ্ছে...",importOptions:"ইম্পোর্ট অপশন",importOptionsDescription:"বিদ্যমান ডেটা কীভাবে হ্যান্ডেল করতে হবে তা বেছে নিন",skipDuplicates:"ডুপ্লিকেট স্কিপ করুন",overwrite:"বিদ্যমান ওভাররাইট করুন",importResults:"ইম্পোর্ট ফলাফল",preferences:"পছন্দসমূহ",imported:"ইম্পোর্ট করা হয়েছে",failed:"ব্যর্থ",sessions:"সেশন",importedLabel:"ইম্পোর্ট করা হয়েছে",skipped:"স্কিপ করা হয়েছে",documents:"ডকুমেন্ট",errors:"ত্রুটি"},about:{title:"সম্পর্কে",versionLabel:"সংস্করণ",ollama:{title:"Ollama স্ট্যাটাস",version:"সংস্করণ",healthy:"সুস্থ",unhealthy:"অসুস্থ"},stats:{models:"মডেল",sessions:"সেশন"},features:{privacy:{title:"গোপনীয়তা প্রথমে",description:"আপনার ডেটা আপনার ডিভাইসে থাকে"},openSource:{title:"ওপেন সোর্স",description:"বিনামূল্যে এবং ওপেন সোর্স সফটওয়্যার"},localInference:{title:"লোকাল ইনফারেন্স",description:"Ollama দিয়ে স্থানীয়ভাবে AI মডেল চালান"}},openSourceBy:"{{company}} দ্বারা ওপেন সোর্স",links:{title:"লিংক",github:"GitHub",githubDescription:"সোর্স কোড দেখুন এবং অবদান রাখুন",website:"ওয়েবসাইট",websiteDescription:"আমাদের ওয়েবসাইট দেখুন",ollama:"Ollama",ollamaDescription:"Ollama সম্পর্কে আরও জানুন",documentation:"ডকুমেন্টেশন",reportIssue:"সমস্যা রিপোর্ট করুন",reportIssueDescription:"বাগ রিপোর্ট এবং ফিচার অনুরোধ"},version:"সংস্করণ {{version}}"}},Yo={title:"মডেল",subtitle:"আপনার Ollama মডেল পুল, পরিচালনা এবং মনিটর করুন",installed:"ইনস্টল করা মডেল",available:"উপলব্ধ মডেল",pull:"মডেল পুল করুন",pulling:"পুল হচ্ছে...",delete:"মডেল মুছুন",deleting:"মোছা হচ্ছে...",size:"সাইজ",modified:"পরিবর্তিত",family:"ফ্যামিলি",parameters:"প্যারামিটার",quantization:"কোয়ান্টাইজেশন",noModels:"কোনো মডেল ইনস্টল করা নেই",pullFirst:"শুরু করতে একটি মডেল পুল করুন"},Zo={title:"পার্সোনা",create:"পার্সোনা তৈরি করুন",edit:"পার্সোনা সম্পাদনা করুন",delete:"পার্সোনা মুছুন",name:"নাম",description:"বিবরণ",systemPrompt:"সিস্টেম প্রম্পট",model:"মডেল",avatar:"অবতার",background:"ব্যাকগ্রাউন্ড",noPersonas:"কোনো পার্সোনা তৈরি করা হয়নি",createFirst:"আপনার চ্যাট অভিজ্ঞতা কাস্টমাইজ করতে আপনার প্রথম পার্সোনা তৈরি করুন"},Xo={title:"গ্যালারি",subtitle:"আপনার AI-তৈরি ইমেজ গ্যালারি",imageCount:"{{count}}টি ইমেজ",generate:"ইমেজ তৈরি করুন",generateDescription:"AI দিয়ে ইমেজ তৈরি করুন",generating:"তৈরি হচ্ছে...",prompt:"প্রম্পট",promptPlaceholder:"আপনি যে ইমেজ তৈরি করতে চান তা বর্ণনা করুন...",noImages:"এখনও কোনো ইমেজ তৈরি হয়নি",download:"ডাউনলোড",delete:"মুছুন",regenerate:"পুনরায় তৈরি করুন",model:"মডেল",size:"সাইজ",quality:"কোয়ালিটি",created:"তৈরি করা হয়েছে"},Qo={generic:"একটি ত্রুটি ঘটেছে",network:"নেটওয়ার্ক ত্রুটি। আপনার সংযোগ পরীক্ষা করুন।",unauthorized:"এই ক্রিয়া সম্পাদন করার অনুমতি নেই।",notFound:"অনুরোধকৃত রিসোর্স পাওয়া যায়নি।",serverError:"সার্ভার ত্রুটি। পরে আবার চেষ্টা করুন।",validation:"আপনার ইনপুট পরীক্ষা করুন এবং আবার চেষ্টা করুন।"},es={title:"কীবোর্ড শর্টকাট",toggleSidebar:"সাইডবার টগল করুন",openSettings:"সেটিংস খুলুন",toggleDarkMode:"ডার্ক মোড টগল করুন",showShortcuts:"কীবোর্ড শর্টকাট দেখান",closeModals:"মোডাল বন্ধ করুন",groups:{navigation:"নেভিগেশন",settings:"সেটিংস",general:"সাধারণ",chat:"চ্যাট"},actions:{sendMessage:"বার্তা পাঠান",newLine:"বার্তায় নতুন লাইন"},footer:"এই সাহায্য দেখাতে {{key1}} বা {{key2}} চাপুন",tooltip:"কীবোর্ড শর্টকাট"},as={title:"মডেল",loading:"মডেল লোড হচ্ছে...",systemStatus:{online:"Ollama অনলাইন",offline:"Ollama অফলাইন",models:"মডেল",models_plural:"মডেল",running:"চলমান",vram:"VRAM"},sections:{pull:"নতুন মডেল পুল করুন",library:"লাইব্রেরি ব্রাউজ করুন",running:"চলমান মডেল",local:"লোকাল মডেল",advanced:"উন্নত অ্যাকশন"},pull:{placeholder:"মডেলের নাম লিখুন (যেমন llama3.2:3b, deepseek-r1:14b)",button:"পুল",cancel:"বাতিল",popular:"জনপ্রিয় মডেল:",browseAll:"ollama.com এ সব মডেল ব্রাউজ করুন",success:"মডেল {{name}} সফলভাবে পুল করা হয়েছে",cancelled:"মডেল পুল বাতিল করা হয়েছে",failed:"মডেল পুল করতে ব্যর্থ",enterName:"অনুগ্রহ করে একটি মডেলের নাম লিখুন"},progress:{starting:"শুরু হচ্ছে...",pulling:"মডেল ডাউনলোড হচ্ছে...",verifying:"অখণ্ডতা যাচাই হচ্ছে...",writing:"ম্যানিফেস্ট লেখা হচ্ছে...",cleaning:"পরিষ্কার করা হচ্ছে..."},library:{available:"উপলব্ধ",search:"মডেল অনুসন্ধান করুন...",noResults:"আপনার মানদণ্ডের সাথে মিলে যায় এমন কোনো মডেল পাওয়া যায়নি",installed:"ইনস্টল করা",more:"+{{count}} আরও",refresh:"লাইব্রেরি রিফ্রেশ করুন"},local:{noModels:"এখনও কোনো মডেল ইনস্টল করা হয়নি",pullToStart:"শুরু করতে উপরে একটি মডেল পুল করুন",installed:"ইনস্টল করা",running:"চলমান",info:"তথ্য",copy:"কপি",delete:"মুছুন",deleteConfirm:'আপনি কি মডেল "{{name}}" মুছতে চান?',deleteSuccess:"মডেল {{name}} সফলভাবে মোছা হয়েছে",deleteFailed:"মডেল মুছতে ব্যর্থ"},advanced:{createModel:"মডেল তৈরি করুন",fromModelfile:"Modelfile থেকে",copyModel:"মডেল কপি করুন",duplicateExisting:"বিদ্যমান ডুপ্লিকেট করুন",testEmbeddings:"এমবেডিং পরীক্ষা করুন",generateVectors:"ভেক্টর তৈরি করুন",healthCheck:"হেলথ চেক",testConnection:"সংযোগ পরীক্ষা করুন",healthy:"Ollama সুস্থ!"},modals:{details:{title:"মডেল বিবরণ",info:"মডেল তথ্য",family:"ফ্যামিলি",parameters:"প্যারামিটার",quantization:"কোয়ান্টাইজেশন",format:"ফরম্যাট",systemPrompt:"সিস্টেম প্রম্পট",template:"টেমপ্লেট",license:"লাইসেন্স",modelfile:"Modelfile",noDetails:"কোনো বিবরণ উপলব্ধ নেই"},copy:{title:"মডেল কপি করুন",source:"সোর্স মডেল",selectModel:"একটি মডেল নির্বাচন করুন...",newName:"নতুন মডেল নাম",placeholder:"যেমন my-custom-model",copying:"কপি হচ্ছে...",button:"মডেল কপি করুন",success:"মডেল {{name}} এ কপি করা হয়েছে",failed:"মডেল কপি করতে ব্যর্থ",enterBoth:"অনুগ্রহ করে সোর্স এবং ডেস্টিনেশন উভয় নাম লিখুন"},create:{title:"কাস্টম মডেল তৈরি করুন",name:"মডেল নাম",namePlaceholder:"যেমন my-assistant",modelfile:"Modelfile",modelfilePlaceholder:`FROM llama3.2
4
4
  SYSTEM You are a helpful assistant.`,docs:"Modelfile ডকস",docsLink:"সিনট্যাক্স রেফারেন্সের জন্য",creating:"তৈরি হচ্ছে...",button:"মডেল তৈরি করুন",success:"মডেল {{name}} সফলভাবে তৈরি হয়েছে",failed:"মডেল তৈরি করতে ব্যর্থ",enterBoth:"অনুগ্রহ করে মডেল নাম এবং Modelfile কন্টেন্ট লিখুন"},embeddings:{title:"এমবেডিং পরীক্ষা করুন",model:"এমবেডিং মডেল",selectModel:"একটি মডেল নির্বাচন করুন...",recommended:"সুপারিশকৃত: nomic-embed-text, mxbai-embed-large",input:"ইনপুট টেক্সট",placeholder:"এমবেডিং তৈরির জন্য টেক্সট লিখুন...",generating:"তৈরি হচ্ছে...",button:"এমবেডিং তৈরি করুন",result:"ফলাফল ({{count}} মাত্রা)",success:"{{count}}-মাত্রার এমবেডিং ভেক্টর তৈরি হয়েছে",failed:"এমবেডিং তৈরি করতে ব্যর্থ",enterBoth:"অনুগ্রহ করে একটি মডেল নির্বাচন করুন এবং টেক্সট লিখুন"}}},ts={title:"পার্সোনা",subtitle:"কাস্টম ব্যক্তিত্ব, স্মৃতি এবং আচরণ সহ AI পার্সোনা তৈরি এবং পরিচালনা করুন",loading:"পার্সোনা লোড হচ্ছে...",createButton:"পার্সোনা তৈরি করুন",importExport:"ইম্পোর্ট/এক্সপোর্ট",stats:{title:"আপনার পার্সোনা",count:"{{count}}টি পার্সোনা তৈরি হয়েছে",count_plural:"{{count}}টি পার্সোনা তৈরি হয়েছে"},empty:{title:"এখনও কোনো পার্সোনা নেই",description:"ব্যক্তিগতকৃত AI ইন্টারঅ্যাকশন শুরু করতে আপনার প্রথম পার্সোনা তৈরি করুন",button:"আপনার প্রথম পার্সোনা তৈরি করুন"},deleteConfirm:'আপনি কি "{{name}}" মুছতে চান?',deleteSuccess:'পার্সোনা "{{name}}" সফলভাবে মোছা হয়েছে',downloadSuccess:'পার্সোনা "{{name}}" সফলভাবে ডাউনলোড হয়েছে',failed:"পার্সোনা {{action}} করতে ব্যর্থ"},ns={title:{create:"নতুন পার্সোনা তৈরি করুন",edit:"পার্সোনা সম্পাদনা করুন"},subtitle:{create:"কাস্টম ব্যক্তিত্ব, মেমরি সিস্টেম এবং অ্যাডাপ্টিভ লার্নিং ক্ষমতা সহ একটি নতুন AI পার্সোনা তৈরি করুন",edit:"উন্নত মেমরি, অ্যাডাপ্টিভ লার্নিং এবং বুদ্ধিমান প্যারামিটার সহ আপনার AI পার্সোনা কাস্টমাইজ করুন"},loading:"ফর্ম লোড হচ্ছে...",saved:"সংরক্ষিত",tabs:{basic:"মৌলিক",parameters:"প্যারামিটার",memory:"মেমরি এবং লার্নিং",advanced:"উন্নত"},basic:{name:"নাম",namePlaceholder:"পার্সোনার নাম লিখুন",model:"মডেল",selectModel:"একটি মডেল নির্বাচন করুন",description:"বিবরণ",descriptionPlaceholder:"আপনার পার্সোনা বর্ণনা করুন...",systemPrompt:"সিস্টেম প্রম্পট",systemPromptPlaceholder:"আপনার পার্সোনার আচরণ সংজ্ঞায়িত করে এমন সিস্টেম প্রম্পট লিখুন...",systemPromptHint:"সিস্টেম প্রম্পট নির্ধারণ করে আপনার পার্সোনা কীভাবে আচরণ করবে এবং প্রতিক্রিয়া জানাবে।"},parameters:{temperature:"টেম্পারেচার",temperatureHint:"সৃজনশীলতা বনাম ধারাবাহিকতা নিয়ন্ত্রণ করে",topP:"Top-P",topPHint:"প্রতিক্রিয়া বৈচিত্র্য নিয়ন্ত্রণ করে",topK:"Top-K",topKHint:"শব্দভান্ডার শীর্ষ-k টোকেনে সীমাবদ্ধ করে",contextWindow:"কনটেক্সট উইন্ডো",contextWindowHint:"সর্বোচ্চ কথোপকথন ইতিহাসের দৈর্ঘ্য",maxTokens:"সর্বোচ্চ টোকেন",maxTokensHint:"সর্বোচ্চ প্রতিক্রিয়ার দৈর্ঘ্য",repeatPenalty:"রিপিট পেনাল্টি",repeatPenaltyHint:"পুনরাবৃত্তিমূলক প্রতিক্রিয়া কমায়"},memory:{title:"মেমরি সিস্টেম",subtitle:"পার্সোনা সময়ের সাথে কথোপকথন মনে রাখে",enableHint:"আপনার পার্সোনাকে কথোপকথন মনে রাখতে এবং সময়ের সাথে কনটেক্সট তৈরি করতে মেমরি সিস্টেম সক্রিয় করুন।",loading:"মেমরি স্ট্যাটাস লোড হচ্ছে...",noData:"এখনও কোনো মেমরি ডেটা নেই",memories:"স্মৃতি",mbUsed:"MB ব্যবহৃত",lastBackup:"শেষ ব্যাকআপ",never:"কখনো না",maxMemories:"সর্বোচ্চ স্মৃতি",maxMemoriesHint:"এই পার্সোনা কতগুলি স্মৃতি সংরক্ষণ করতে পারে",retention:"মেমরি রিটেনশন",retentionHint:"ক্লিনআপের আগে স্মৃতি রাখার দিন",autoCleanup:"পুরানো স্মৃতি স্বয়ংক্রিয়-ক্লিনআপ",wipeAll:"সব স্মৃতি মুছুন",wipeCannot:"এটি পূর্বাবস্থায় ফেরানো যাবে না",wipeButton:"মুছুন",wiping:"মোছা হচ্ছে...",wipeConfirm:"আপনি কি সব স্মৃতি মুছতে চান? এটি পূর্বাবস্থায় ফেরানো যাবে না।",wipeSuccess:"{{count}}টি স্মৃতি মোছা হয়েছে"},learning:{title:"অ্যাডাপ্টিভ লার্নিং",subtitle:"পার্সোনা ইন্টারঅ্যাকশনের উপর ভিত্তি করে বিকশিত হয়",enableHint:"আপনার পার্সোনাকে আপনার ইন্টারঅ্যাকশনের উপর ভিত্তি করে বিকশিত এবং প্রতিক্রিয়া ব্যক্তিগতকৃত করতে অ্যাডাপ্টিভ লার্নিং সক্রিয় করুন।",speed:"লার্নিং স্পিড",slow:"ধীর",slowDesc:"ধীরে ধীরে পরিবর্তন",balanced:"সুষম",balancedDesc:"মাঝারি গতি",fast:"দ্রুত",fastDesc:"দ্রুত অভিযোজন",autoAdapt:"ব্যবহারকারীর পছন্দে স্বয়ং-অভিযোজিত",whatLearns:"পার্সোনা যা শেখে:",conversationTone:"কথোপকথনের স্বর",responseStyle:"প্রতিক্রিয়া শৈলী",userPreferences:"ব্যবহারকারীর পছন্দ",topicInterests:"বিষয় আগ্রহ"},advanced:{embeddingModel:"এমবেডিং মডেল",embeddingHint:"মেমরি এনকোডিং এবং সেমান্টিক সার্চের জন্য ব্যবহৃত মডেল নির্বাচন করুন। এমবেডিং মডেলগুলি প্রথমে দেখানো হয়, তারপর অন্যান্য উপলব্ধ মডেল।",noModels:"কোনো মডেল পাওয়া যায়নি",embeddingModels:"এমবেডিং মডেল",otherModels:"অন্যান্য মডেল",installHint:"একটি এমবেডিং মডেল ইনস্টল করুন:",recommended:"সুপারিশকৃত: nomic-embed-text, mxbai-embed-large, bge-m3, snowflake-arctic-embed",aboutTitle:"উন্নত সেটিংস সম্পর্কে",aboutDescription:"এমবেডিং মডেল মেমরি সিস্টেম দ্বারা সেমান্টিক অর্থ বোঝতে এবং কথোপকথনের সময় প্রাসঙ্গিক স্মৃতি খুঁজে পেতে ব্যবহৃত হয়। আপনার ব্যবহারের ক্ষেত্রে এবং উপলব্ধ রিসোর্সের সাথে মেলে এমন একটি মডেল বেছে নিন।"},actions:{cancel:"বাতিল",save:"সংরক্ষণ",saving:"সংরক্ষণ হচ্ছে...",saveClose:"সংরক্ষণ এবং বন্ধ",create:"তৈরি করুন"},success:{created:"পার্সোনা তৈরি হয়েছে",updated:"পার্সোনা আপডেট হয়েছে"},error:{saveFailed:"সংরক্ষণ করতে ব্যর্থ"}},rs={enhanced:"উন্নত",systemPrompt:"সিস্টেম প্রম্পট",memories:"স্মৃতি",use:"ব্যবহার করুন",editTooltip:"পার্সোনা সম্পাদনা করুন",downloadTooltip:"পার্সোনা ডাউনলোড করুন",backup:"ব্যাকআপ",exportDNA:"DNA এক্সপোর্ট করুন",wipeMemories:"স্মৃতি মুছুন",wipeConfirm:"আপনি কি এই পার্সোনার সব স্মৃতি মুছতে চান? এই ক্রিয়া পূর্বাবস্থায় ফেরানো যাবে না।",wipeSuccess:"{{count}}টি স্মৃতি মোছা হয়েছে",backupSuccess:"পার্সোনা ব্যাকআপ সফলভাবে ডাউনলোড হয়েছে",dnaSuccess:"পার্সোনা DNA সফলভাবে এক্সপোর্ট হয়েছে",failed:"{{action}} করতে ব্যর্থ"},is={title:"ব্যবহারকারী ব্যবস্থাপনা",subtitle:"ব্যবহারকারী অ্যাকাউন্ট এবং অনুমতি পরিচালনা করুন",loading:"ব্যবহারকারী লোড হচ্ছে...",createUser:"ব্যবহারকারী তৈরি করুন",search:"ব্যবহারকারী অনুসন্ধান করুন...",noUsers:"কোনো ব্যবহারকারী পাওয়া যায়নি",noUsersMatching:"আপনার অনুসন্ধানের সাথে মিলে যায় এমন কোনো ব্যবহারকারী নেই",columns:{user:"ব্যবহারকারী",email:"ইমেইল",role:"ভূমিকা",created:"তৈরি করা হয়েছে",actions:"অ্যাকশন"},roles:{admin:"অ্যাডমিন",user:"ব্যবহারকারী"},noEmail:"কোনো ইমেইল নেই",deleteConfirm:'আপনি কি ব্যবহারকারী "{{name}}" মুছতে চান?',deleteSuccess:"ব্যবহারকারী সফলভাবে মোছা হয়েছে",deleteFailed:"ব্যবহারকারী মুছতে ব্যর্থ",cannotDeleteSelf:"আপনি নিজের অ্যাকাউন্ট মুছতে পারবেন না",form:{title:{create:"ব্যবহারকারী তৈরি করুন",edit:"ব্যবহারকারী সম্পাদনা করুন"},username:"ব্যবহারকারীর নাম",usernamePlaceholder:"ব্যবহারকারীর নাম লিখুন",email:"ইমেইল",emailPlaceholder:"ইমেইল লিখুন (ঐচ্ছিক)",password:"পাসওয়ার্ড",passwordPlaceholder:"পাসওয়ার্ড লিখুন",passwordHint:"বর্তমান পাসওয়ার্ড রাখতে খালি রাখুন",role:"ভূমিকা",creating:"তৈরি হচ্ছে...",updating:"আপডেট হচ্ছে...",createButton:"ব্যবহারকারী তৈরি করুন",updateButton:"ব্যবহারকারী আপডেট করুন",createSuccess:"ব্যবহারকারী সফলভাবে তৈরি হয়েছে",updateSuccess:"ব্যবহারকারী সফলভাবে আপডেট হয়েছে",createFailed:"ব্যবহারকারী তৈরি করতে ব্যর্থ",updateFailed:"ব্যবহারকারী আপডেট করতে ব্যর্থ"}},os={you:"আপনি",assistant:"সহকারী",system:"সিস্টেম",copy:"কপি",copyMessage:"বার্তা কপি করুন",copied:"কপি হয়েছে!",regenerate:"পুনরায় তৈরি করুন",regenerateResponse:"প্রতিক্রিয়া পুনরায় তৈরি করুন",edit:"সম্পাদনা",editSystemMessage:"সিস্টেম বার্তা সম্পাদনা করুন",saveChanges:"পরিবর্তন সংরক্ষণ করুন",cancelEditing:"সম্পাদনা বাতিল করুন",delete:"মুছুন",deleteConfirm:"এই বার্তা মুছবেন?",branch:"ব্রাঞ্চ",speaking:"বলছে...",speakMessage:"বার্তা বলুন",stopSpeaking:"বলা বন্ধ করুন",showMore:"আরও দেখান",showLess:"কম দেখান",thinking:"চিন্তা করছে",systemMessagePlaceholder:"আপনার সিস্টেম বার্তা লিখুন...",fullSizeImage:"পূর্ণ সাইজ ইমেজ",startConversation:"একটি কথোপকথন শুরু করুন",startConversationDescription:"আপনার AI সহকারীর সাথে চ্যাট শুরু করতে একটি বার্তা পাঠান। প্রশ্ন করুন, কোডে সাহায্য পান, বা একটি স্বাভাবিক কথোপকথন করুন।",scrollToBottom:"নিচে স্ক্রোল করুন",newMessages:"নতুন বার্তা"},ss={title:"ইমেজ গ্যালারি",noImages:"এখনও কোনো ইমেজ নেই",noImagesHint:"ডানদিকের প্যানেল ব্যবহার করে আপনার প্রথম ইমেজ তৈরি করুন",delete:"মুছুন",download:"ডাউনলোড",deleteConfirm:"আপনি কি এই ইমেজ মুছতে চান?",deleteSuccess:"ইমেজ মোছা হয়েছে",deleteFailed:"ইমেজ মুছতে ব্যর্থ",downloadFailed:"ইমেজ ডাউনলোড করতে ব্যর্থ",loadMore:"আরও লোড করুন ({{current}} এর মধ্যে {{total}})",loadFailed:"গ্যালারি লোড করতে ব্যর্থ"},ls={title:"ইমেজ তৈরি করুন",prompt:"প্রম্পট",promptPlaceholder:"আপনি যে ইমেজ তৈরি করতে চান তা বর্ণনা করুন...",model:"মডেল",selectModel:"মডেল নির্বাচন করুন",noModels:"কোনো ইমেজ জেনারেশন মডেল উপলব্ধ নেই",configurePlugin:"ইমেজ জেনারেশন সমর্থন সহ একটি প্লাগইন কনফিগার করুন",size:"সাইজ",quality:"কোয়ালিটি",style:"স্টাইল",generate:"তৈরি করুন",generating:"তৈরি হচ্ছে...",success:"ইমেজ সফলভাবে তৈরি হয়েছে",failed:"ইমেজ তৈরি করতে ব্যর্থ",enterPrompt:"অনুগ্রহ করে একটি প্রম্পট লিখুন"},ds={title:"কিছু ভুল হয়েছে",description:"আমরা একটি অপ্রত্যাশিত ত্রুটির সম্মুখীন হয়েছি। অনুগ্রহ করে পেজ রিফ্রেশ করুন।",tryAgain:"পেজ রিফ্রেশ করুন",goHome:"হোমে যান",errorDetails:"ত্রুটির বিবরণ (ডেভেলপমেন্ট)"},cs={title:"ডকুমেন্ট",upload:"ডকুমেন্ট আপলোড করুন",uploading:"আপলোড হচ্ছে...",noDocuments:"কোনো ডকুমেন্ট আপলোড করা হয়নি",uploadHint:"আপনার কথোপকথনে ব্যবহার করতে ডকুমেন্ট আপলোড করুন",delete:"মুছুন",deleteConfirm:"আপনি কি এই ডকুমেন্ট মুছতে চান?",deleteSuccess:"ডকুমেন্ট মোছা হয়েছে",deleteFailed:"ডকুমেন্ট মুছতে ব্যর্থ",uploadSuccess:"ডকুমেন্ট সফলভাবে আপলোড হয়েছে",uploadFailed:"ডকুমেন্ট আপলোড করতে ব্যর্থ",types:"সমর্থিত: PDF, TXT, MD, DOCX",unsupportedFileType:"শুধুমাত্র PDF এবং TXT ফাইল সমর্থিত",fileSizeTooLarge:"ফাইল সাইজ ১০MB এর কম হতে হবে",uploadSuccessWithName:'ডকুমেন্ট "{{name}}" সফলভাবে আপলোড হয়েছে',removeSuccess:"ডকুমেন্ট সফলভাবে সরানো হয়েছে",removeFailed:"ডকুমেন্ট সরাতে ব্যর্থ",removeError:"ডকুমেন্ট সরানোর সময় একটি ত্রুটি ঘটেছে",clickToUpload:"আপলোড করতে ক্লিক করুন",orDragAndDrop:"অথবা টেনে আনুন",fileTypesAndSize:"১০MB পর্যন্ত PDF বা TXT ফাইল",uploadedDocuments:"আপলোড করা ডকুমেন্ট",removeDocument:"ডকুমেন্ট সরান"},us={speak:"বলুন",stop:"বন্ধ",speaking:"বলছে...",generateFailed:"স্পিচ তৈরি করতে ব্যর্থ",playbackFailed:"অডিও প্লেব্যাক ব্যর্থ",stopSpeaking:"বলা বন্ধ করুন",generatingSpeech:"স্পিচ তৈরি হচ্ছে...",readAloud:"জোরে পড়ুন"},ms={title:"আর্টিফ্যাক্ট",code:"কোড",preview:"প্রিভিউ",copy:"কোড কপি করুন",copied:"কপি হয়েছে!",download:"ডাউনলোড",expand:"প্রসারিত করুন",collapse:"সংকুচিত করুন",openInNewTab:"নতুন ট্যাবে খুলুন",invalidSvg:"অবৈধ SVG কন্টেন্ট",invalidJson:"অবৈধ JSON কন্টেন্ট",previewMode:"প্রিভিউ মোড",codeMode:"কোড মোড",copyContent:"কন্টেন্ট কপি করুন",openInPanel:"প্যানেলে খুলুন",openInNewWindow:"নতুন উইন্ডোতে খুলুন",created:"তৈরি করা হয়েছে",closePanelEsc:"প্যানেল বন্ধ করুন (Esc)",copyButton:"কপি",open:"খুলুন",dragEdgeToResize:"সাইজ পরিবর্তন করতে প্রান্ত টানুন"},ps={title:"পার্সোনা ইম্পোর্ট এবং এক্সপোর্ট",description:"শেয়ার করতে আপনার পার্সোনা এক্সপোর্ট করুন বা অন্যদের থেকে পার্সোনা ইম্পোর্ট করুন",exportPersonas:"পার্সোনা এক্সপোর্ট করুন",importPersonas:"পার্সোনা ইম্পোর্ট করুন",noPersonasToExport:"এক্সপোর্ট করার জন্য কোনো পার্সোনা নেই",personasAvailable:"{{count}}টি পার্সোনা উপলব্ধ",personasAvailable_plural:"{{count}}টি পার্সোনা উপলব্ধ",exportAll:"সব এক্সপোর্ট করুন",uploadJsonFile:"JSON ফাইল আপলোড করুন",pasteJsonLabel:"JSON ডেটা পেস্ট করুন",pasteJsonPlaceholder:"এখানে পার্সোনা JSON ডেটা পেস্ট করুন...",importing:"ইম্পোর্ট হচ্ছে...",importButton:"পার্সোনা ইম্পোর্ট করুন",expectedFormat:"প্রত্যাশিত JSON ফরম্যাট:",exportSuccess:'পার্সোনা "{{name}}" সফলভাবে এক্সপোর্ট হয়েছে',exportFailed:"পার্সোনা এক্সপোর্ট করতে ব্যর্থ",exportAllSuccess:"সব {{count}}টি পার্সোনা সফলভাবে এক্সপোর্ট হয়েছে",exportAllFailed:"পার্সোনা এক্সপোর্ট করতে ব্যর্থ",pasteJsonData:"অনুগ্রহ করে পার্সোনা JSON ডেটা পেস্ট করুন",importMultipleSuccess:"{{count}}টি পার্সোনা সফলভাবে ইম্পোর্ট হয়েছে",importMultipleFailed:"{{count}}টি পার্সোনা ইম্পোর্ট করতে ব্যর্থ",importNoneFailed:"কোনো পার্সোনা ইম্পোর্ট করতে ব্যর্থ",importSuccess:"পার্সোনা সফলভাবে ইম্পোর্ট হয়েছে",importFailed:"পার্সোনা ইম্পোর্ট করতে ব্যর্থ"},gs={common:Ro,brand:Uo,auth:$o,setup:Vo,chat:Wo,sidebar:qo,user:Jo,settings:_o,models:Yo,personas:Zo,gallery:Xo,errors:Qo,keyboard:es,modelManager:as,personaManager:ts,personaForm:ns,personaCard:rs,userManager:is,chatMessage:os,imageGallery:ss,imageGeneration:ls,errorBoundary:ds,documents:cs,ttsButton:us,artifacts:ms,personaImportExport:ps},hs={loading:"Načítání...",save:"Uložit",saving:"Ukládání...",cancel:"Zrušit",delete:"Smazat",edit:"Upravit",close:"Zavřít",back:"Zpět",next:"Další",confirm:"Potvrdit",error:"Chyba",success:"Úspěch",warning:"Varování",or:"nebo",optional:"volitelné",enabled:"Povoleno",disabled:"Zakázáno",on:"Zap.",off:"Vyp.",yes:"Ano",no:"Ne",search:"Hledat",noResults:"Žádné výsledky",retry:"Zkusit znovu",refresh:"Obnovit",download:"Stáhnout",upload:"Nahrát",export:"Exportovat",import:"Importovat",reset:"Resetovat",apply:"Použít",clear:"Vymazat",all:"Vše",none:"Žádné",default:"Výchozí",custom:"Vlastní",mode:"Režim",multiUser:"Více uživatelů",remove:"Odstranit"},bs={name:"Libre WebUI",shortName:"Libre"},ks={login:{title:"Vítejte zpět",subtitle:"Přihlaste se ke svému účtu a pokračujte",username:"Uživatelské jméno",usernamePlaceholder:"Zadejte uživatelské jméno",password:"Heslo",passwordPlaceholder:"Zadejte heslo",signIn:"Přihlásit se",signingIn:"Přihlašování...",noAccount:"Nemáte účet?",signUpHere:"Zaregistrujte se zde",loginSuccess:"Přihlášení úspěšné!",loginFailed:"Přihlášení se nezdařilo",checkCredentials:"Přihlášení se nezdařilo. Zkontrolujte své přihlašovací údaje.",enterBoth:"Zadejte uživatelské jméno a heslo",githubSuccess:"Přihlášení přes GitHub úspěšné!",githubFailed:"Ověření GitHub se nezdařilo",githubVerifyFailed:"Nepodařilo se ověřit GitHub autentizaci"},signup:{title:"Vytvořit účet",subtitle:"Zaregistrujte nový účet",username:"Uživatelské jméno",usernamePlaceholder:"Zvolte uživatelské jméno",email:"Email",emailPlaceholder:"vas@email.cz",password:"Heslo",passwordPlaceholder:"Zvolte heslo",confirmPassword:"Potvrdit heslo",confirmPasswordPlaceholder:"Potvrďte heslo",createAccount:"Vytvořit účet",creatingAccount:"Vytváření účtu...",hasAccount:"Již máte účet?",signInHere:"Přihlaste se zde",signupSuccess:"Účet úspěšně vytvořen!",signupFailed:"Registrace se nezdařila",tryAgain:"Registrace se nezdařila. Zkuste to znovu.",usernameRequired:"Uživatelské jméno a heslo jsou povinné",passwordMismatch:"Hesla se neshodují",passwordTooShort:"Heslo musí mít alespoň 6 znaků"},logout:{button:"Odhlásit se",success:"Úspěšně odhlášeno"},oauth:{continueWith:"Pokračovat s {{provider}}",connectingTo:"Připojování k {{provider}}...",github:"GitHub",huggingFace:"Hugging Face"}},fs={welcome:{title:"Vítejte v Libre WebUI",subtitle:"Začněme",description:"Nastavte Libre WebUI v několika jednoduchých krocích",createAdmin:"Vytvořit účet správce",features:{secure:{title:"Bezpečné a soukromé",description:"Vaše konverzace zůstávají na vašem zařízení"},fast:{title:"Rychlé a responzivní",description:"Optimalizováno pro rychlost a výkon"},openSource:{title:"Open source",description:"Bezplatný software s otevřeným zdrojovým kódem"}}},admin:{title:"Vytvořit účet správce",subtitle:"Nastavení správce",description:"Vytvořte první účet správce pro vaši instanci Libre WebUI",usernamePlaceholder:"Zadejte jméno správce",passwordPlaceholder:"Zadejte heslo (min. 6 znaků)",confirmPlaceholder:"Potvrďte heslo",creating:"Vytváření...",createAdmin:"Vytvořit správce",success:"Účet správce úspěšně vytvořen!",failed:"Nepodařilo se vytvořit účet správce",fillAllFields:"Vyplňte všechna pole",note:"Toto bude hlavní účet správce pro vaši instanci Libre WebUI"},encryptionKey:{title:"Uložte šifrovací klíč",subtitle:"Důležité: Uložte tento klíč",description:"Tento šifrovací klíč chrání vaše citlivá data. Uložte ho bezpečně - budete ho potřebovat, pokud budete někdy muset obnovit databázi.",warning:"Varování",warningText:"Pokud tento klíč ztratíte a budete potřebovat obnovit databázi, vaše zašifrovaná data (API klíče, předvolby) budou nenávratně ztracena.",label:"Váš šifrovací klíč",loading:"Načítání...",copyToClipboard:"Kopírovat do schránky",copied:"Šifrovací klíč zkopírován!",copyFailed:"Nepodařilo se zkopírovat klíč",envNote:"Tento klíč je také uložen v souboru backend/.env jako ENCRYPTION_KEY",acknowledgment:"Uložil jsem šifrovací klíč na bezpečné místo a chápu, že jeho ztráta může vést ke ztrátě dat.",confirmRequired:"Potvrďte, že jste uložili šifrovací klíč",continue:"Pokračovat do Libre WebUI"}},ys={greeting:{morning:"Dobré ráno",afternoon:"Dobré odpoledne",evening:"Dobrý večer",night:"Dobrou noc"},welcome:{helpToday:"S čím vám mohu dnes pomoci?",helpTonight:"S čím vám mohu dnes večer pomoci?"},input:{placeholder:"Odeslat zprávu",messagePlaceholder:"Zpráva...",attachImages:"Připojit obrázky",attachments:"Přílohy a pokročilé funkce",sendMessage:"Odeslat zprávu",stopGeneration:"Zastavit generování"},session:{new:"Nový chat",private:"Soukromý",privateMode:"Soukromý režim",privateDescription:"Tato konverzace nebude uložena",privateTooltip:"Začít soukromou konverzaci, která nebude uložena",deleteConfirm:"Opravdu chcete smazat tento chat?",generatingTitle:"Generování titulku",noChats:"Zatím žádné chaty",createFirst:"Vytvořte svůj první chat výše",chats:"Chaty",renameChat:"Přejmenovat chat",deleteChat:"Smazat chat"},persona:{applied:"Persona použita",label:"Persona"},model:{updated:"Model aktualizován",noModels:"Žádné dostupné modely",noModelsDescription:"Žádné dostupné modely. Ujistěte se, že Ollama běží a modely jsou nainstalované.",pullCommand:"ollama pull llama3.2:3b",noModelsTooltip:"Žádné dostupné modely. Ujistěte se, že Ollama běží a modely jsou nainstalované."},footer:{disclaimer:"LLM může dělat chyby - ověřujte důležité informace",images:"{{count}} obrázek",images_plural:"{{count}} obrázků",structuredOutput:"Strukturovaný výstup"},mediaUpload:{dropImagesHere:"Přetáhněte obrázky sem nebo",supportedFormats:"Podporované: JPG, PNG, GIF, WebP (max 10MB každý)",browse:"procházet"},structuredOutput:{title:"Formát odpovědi",none:"Žádný (přirozený jazyk)",noneDescription:"Výchozí odpověď v přirozeném jazyce",json:"JSON",jsonDescription:"Strukturovaný formát JSON",list:"Seznam",listDescription:"Pole položek",summary:"Shrnutí",summaryDescription:"Shrnutí dokumentu s klíčovými body",analysis:"Analýza",analysisDescription:"Strukturovaná analýza s klady/zápory",custom:"Vlastní schéma",customDescription:"Definujte vlastní JSON schéma",customSchema:"Vlastní JSON schéma",schemaPreview:"Náhled schématu",applySchema:"Použít schéma",cancel:"Zrušit",enabled:"Strukturovaný výstup povolen"}},vs={navigation:{chat:"Chat",models:"Modely",personas:"Persony",imagine:"Generovat",settings:"Nastavení",userManagement:"Správa uživatelů",signOut:"Odhlásit se"},toggleSize:"Změnit velikost postranního panelu",expandSidebar:"Rozbalit postranní panel"},xs={menu:{changePicture:"Změnit obrázek",settings:"Nastavení",userManagement:"Správa uživatelů",logout:"Odhlásit se"},avatar:{title:"Změnit profilový obrázek",updated:"Profilový obrázek aktualizován",updateFailed:"Nepodařilo se aktualizovat profilový obrázek",saving:"Ukládání..."},profile:{noEmail:"Email není uveden"}},Ss={title:"Nastavení",tabs:{appearance:"Vzhled",model:"Model",systemMessage:"Systémová zpráva",plugins:"Pluginy",generation:"Generování",documents:"Dokumenty",tts:"Text na řeč",imageGen:"Generování obrázků",system:"Systém",data:"Data",about:"O aplikaci"},appearance:{title:"Vzhled",language:{title:"Jazyk",description:"Vyberte preferovaný jazyk"},theme:{title:"Motiv",light:"Světlý",dark:"Tmavý",amoled:"AMOLED",system:"Systémový"},chatInterface:{title:"Rozhraní chatu",showUsername:"Zobrazit uživatelské jméno",showUsernameDescription:"Zobrazovat uživatelské jméno ve zprávách chatu"},background:{title:"Obrázek pozadí",enable:"Povolit obrázek pozadí",enableDescription:"Zobrazit vlastní pozadí s efektem rozmazání",blur:"Rozmazání",opacity:"Průhlednost",upload:"Nahrát obrázek pozadí",dragDrop:"Přetáhněte obrázek nebo klikněte pro procházení",chooseImage:"Vybrat obrázek"}},system:{title:"Systém",currentModel:"Aktuální model",notSet:"Nenastaveno"},saveSettings:"Uložit nastavení",model:{title:"Nastavení modelu",defaultModel:"Výchozí model",defaultModelDescription:"Tento model bude ve výchozím nastavení použit pro nové konverzace",selectModel:"Vyberte model",updateAll:"Aktualizovat všechny modely",updateAllDescription:"Zkontrolovat aktualizace a stáhnout nejnovější verze všech nainstalovaných modelů",updateAllButton:"Aktualizovat vše",updating:"Aktualizace modelů...",currentModelInfo:"Informace o aktuálním modelu",name:"Název",size:"Velikost",family:"Rodina",format:"Formát",status:"Stav",statusStarting:"Spouštění...",statusComplete:"Dokončeno",statusError:"Chyba",bulkOperations:"Hromadné operace",autoTitle:{title:"Automatické generování titulků",enable:"Povolit automatické titulky",enableDescription:"Automaticky generovat titulky pro nové konverzace",taskModel:"Model úloh",selectTaskModel:"Vyberte model úloh",taskModelDescription:"Model používaný pro generování titulků konverzací"}},systemMessage:{title:"Systémová zpráva",description:"Nastavte vlastní systémovou zprávu, která bude použita pro všechny nové konverzace.",placeholder:"Zadejte systémovou zprávu...",saved:"Systémová zpráva uložena",saveFailed:"Nepodařilo se uložit systémovou zprávu"},plugins:{title:"Pluginy",description:"Spravujte nainstalované pluginy",addNew:"Přidat nový plugin",upload:"Nahrát plugin",addJson:"Přidat JSON",uploading:"Nahrávání...",jsonPlaceholder:"Vložte JSON konfiguraci pluginu...",install:"Nainstalovat plugin",noPlugins:"Žádné nainstalované pluginy",noPluginsDescription:"Přidejte plugin pro rozšíření funkcionality",loading:"Načítání pluginů...",installed:"Nainstalované pluginy",active:"Aktivní pluginy",activeLabel:"Aktivní",inactive:"Neaktivní",activate:"Aktivovat",deactivate:"Deaktivovat",models:"modelů",apiKeySet:"API klíč nastaven",apiKeyConfiguration:"Konfigurace API klíče",apiKeyEnvAlternative:"Alternativně nastavte",environmentVariable:"proměnnou prostředí",apiKeyConfigured:"API klíč nakonfigurován",apiKeyPlaceholder:"Zadejte API klíč...",saveApiKey:"Uložit API klíč",apiKey:{title:"API klíč",placeholder:"Zadejte API klíč",save:"Uložit klíč",remove:"Odstranit klíč",configured:"API klíč nakonfigurován",notConfigured:"Vyžadován API klíč",saved:"API klíč úspěšně uložen",removed:"API klíč odstraněn",saveFailed:"Nepodařilo se uložit API klíč",removeFailed:"Nepodařilo se odstranit API klíč",enterKey:"Zadejte API klíč"}},generation:{title:"Možnosti generování",description:"Nakonfigurujte, jak AI generuje odpovědi",coreParameters:"Základní parametry",temperature:"Teplota",temperatureDescription:"Ovládá náhodnost. Nižší hodnoty jsou více zaměřené, vyšší více kreativní.",topP:"Top P",topPDescription:"Ovládá rozmanitost pomocí nucleus sampling. Nižší hodnoty se soustředí na pravděpodobné tokeny.",topK:"Top K",topKDescription:"Omezuje výběr tokenů na K nejpravděpodobnějších. Nastavte 0 pro vypnutí.",minP:"Min P",minPDescription:"Minimální prah pravděpodobnosti pro výběr tokenů.",generationControl:"Ovládání generování",maxTokens:"Max tokenů",maxTokensDescription:"Maximální počet tokenů k vygenerování v odpovědi.",repeatPenalty:"Penalizace opakování",repeatPenaltyDescription:"Penalizuje opakující se tokeny. Vyšší hodnoty snižují opakování.",contextLength:"Délka kontextu",contextLengthDescription:"Maximální velikost kontextového okna pro konverzace.",seed:"Seed",optional:"volitelné",random:"Náhodný",seedDescription:"Nastavte konkrétní seed pro reprodukovatelné výsledky.",advancedOptions:"Pokročilé možnosti",presencePenalty:"Penalizace přítomnosti",presencePenaltyDescription:"Penalizuje tokeny, které se objevují v kontextu.",frequencyPenalty:"Penalizace frekvence",frequencyPenaltyDescription:"Penalizuje často používané tokeny.",stopSequences:"Stop sekvence",commaSeparated:"oddělené čárkou",stopSequencesDescription:"Vlastní tokeny, které zastaví generování při nalezení.",resetDefaults:"Obnovit výchozí",saveOptions:"Uložit možnosti",embeddingSettings:"Nastavení embeddingů",enableEmbeddings:"Povolit embeddingy dokumentů"},documents:{title:"Nastavení dokumentů",embeddings:{title:"Embeddingy",enable:"Povolit embeddingy dokumentů",model:"Model embeddingů",modelDescription:"Vyberte model pro embedding dokumentů",chunkSize:"Velikost části",chunkSizeInTokens:"(v tokenech)",chunkSizeDescription:"Velikost textových částí pro embedding",chunkOverlap:"Překryv částí",chunkOverlapInTokens:"(v tokenech)",chunkOverlapDescription:"Překryv mezi po sobě jdoucími částmi",similarityThreshold:"Práh podobnosti",similarityDescription:"Minimální skóre podobnosti pro zahrnutí výsledků",status:"Stav embeddingů",statusLabel:"Stav",available:"Dostupný",unavailable:"Nedostupný",chunksWithEmbeddings:"Části s embeddingy",coverage:"Pokrytí",regenerate:"Regenerovat embeddingy",regenerating:"Regenerování..."}},tts:{title:"Text na řeč",description:"Nakonfigurujte nastavení syntézy řeči pro čtení zpráv",loadingProviders:"Načítání poskytovatelů TTS...",noProviders:"Žádní poskytovatelé TTS",noProvidersDescription:"Nakonfigurujte plugin s podporou TTS pro povolení syntézy řeči",enable:"Povolit TTS",enableDescription:"Povolit syntézu řeči pro zprávy asistenta",autoPlay:"Automatické přehrávání odpovědí",autoPlayDescription:"Automaticky číst nové zprávy asistenta",voiceConfiguration:"Konfigurace hlasu",model:"Model TTS",modelDescription:"Vyberte model pro syntézu řeči",voice:"Hlas",selectVoice:"Vyberte hlas",voiceDescription:"Vyberte hlas pro syntézu řeči",speed:"Rychlost",speedSlow:"0.5x",speedNormal:"1.0x",speedFast:"2.0x",availableProviders:"Dostupní poskytovatelé",models:"modelů",test:"Test",testing:"Testování...",stop:"Stop"},imageGen:{title:"Generování obrázků",description:"Nakonfigurujte nastavení a poskytovatele generování obrázků",loadingProviders:"Načítání poskytovatelů generování obrázků...",noProviders:"Žádní poskytovatelé generování obrázků",noProvidersDescription:"Nakonfigurujte plugin s podporou generování obrázků",enable:"Povolit generování obrázků",enableDescription:"Povolit AI generování obrázků v konverzacích",configuration:"Konfigurace",model:"Model",modelDescription:"Vyberte model pro generování obrázků",size:"Velikost",sizeDescription:"Rozlišení generovaných obrázků",quality:"Kvalita",qualityDescription:"Úroveň kvality generovaných obrázků",style:"Styl",styleDescription:"Preset stylu pro generované obrázky",availableProviders:"Dostupní poskytovatelé",models:"modelů"},data:{title:"Správa dat",export:"Exportovat data",exportDescription:"Stáhněte všechna svá data včetně předvoleb, relací a dokumentů.",exportAll:"Exportovat všechna data",import:"Importovat data",importDescription:"Importujte data z předchozího exportu.",importData:"Importovat data",importing:"Importování...",clearSessions:"Vymazat relace",clearSessionsDescription:"Smazat všechny chatové relace. Tuto akci nelze vrátit zpět.",clearAll:"Vymazat vše",clearing:"Mazání...",importOptions:"Možnosti importu",importOptionsDescription:"Vyberte, jak zacházet s existujícími daty",skipDuplicates:"Přeskočit duplikáty",overwrite:"Přepsat existující",importResults:"Výsledky importu",preferences:"Předvolby",imported:"Importováno",failed:"Selhalo",sessions:"Relace",importedLabel:"importováno",skipped:"přeskočeno",documents:"Dokumenty",errors:"Chyby"},about:{title:"O aplikaci",versionLabel:"Verze",ollama:{title:"Stav Ollama",version:"Verze",healthy:"V pořádku",unhealthy:"Nefunkční"},stats:{models:"Modely",sessions:"Relace"},features:{privacy:{title:"Soukromí na prvním místě",description:"Vaše data zůstávají na vašem zařízení"},openSource:{title:"Open source",description:"Bezplatný software s otevřeným zdrojovým kódem"},localInference:{title:"Lokální inference",description:"Spouštějte AI modely lokálně s Ollama"}},openSourceBy:"Open source od {{company}}",links:{title:"Odkazy",github:"GitHub",githubDescription:"Zobrazit zdrojový kód a přispět",website:"Webová stránka",websiteDescription:"Navštivte naše stránky",ollama:"Ollama",ollamaDescription:"Zjistěte více o Ollama",documentation:"Dokumentace",reportIssue:"Nahlásit problém",reportIssueDescription:"Hlášení chyb a požadavky na funkce"},version:"Verze {{version}}"}},ws={title:"Modely",subtitle:"Stahujte, spravujte a monitorujte své modely Ollama",installed:"Nainstalované modely",available:"Dostupné modely",pull:"Stáhnout model",pulling:"Stahování...",delete:"Smazat model",deleting:"Mazání...",size:"Velikost",modified:"Upraveno",family:"Rodina",parameters:"Parametry",quantization:"Kvantizace",noModels:"Žádné nainstalované modely",pullFirst:"Stáhněte model pro začátek"},Ps={title:"Persony",create:"Vytvořit personu",edit:"Upravit personu",delete:"Smazat personu",name:"Název",description:"Popis",systemPrompt:"Systémový prompt",model:"Model",avatar:"Avatar",background:"Pozadí",noPersonas:"Žádné vytvořené persony",createFirst:"Vytvořte svou první personu pro přizpůsobení zážitku z chatu"},Ms={title:"Galerie",subtitle:"Vaše galerie obrázků generovaných AI",imageCount:"{{count}} obrázků",generate:"Generovat obrázek",generateDescription:"Vytvářejte obrázky pomocí AI",generating:"Generování...",prompt:"Prompt",promptPlaceholder:"Popište obrázek, který chcete vygenerovat...",noImages:"Zatím žádné vygenerované obrázky",download:"Stáhnout",delete:"Smazat",regenerate:"Regenerovat",model:"Model",size:"Velikost",quality:"Kvalita",created:"Vytvořeno"},Ds={generic:"Došlo k chybě",network:"Chyba sítě. Zkontrolujte připojení.",unauthorized:"Nemáte oprávnění provést tuto akci.",notFound:"Požadovaný prostředek nebyl nalezen.",serverError:"Chyba serveru. Zkuste to později.",validation:"Zkontrolujte zadané údaje a zkuste to znovu."},js={title:"Klávesové zkratky",toggleSidebar:"Přepnout postranní panel",openSettings:"Otevřít nastavení",toggleDarkMode:"Přepnout tmavý režim",showShortcuts:"Zobrazit klávesové zkratky",closeModals:"Zavřít modální okna",groups:{navigation:"Navigace",settings:"Nastavení",general:"Obecné",chat:"Chat"},actions:{sendMessage:"Odeslat zprávu",newLine:"Nový řádek ve zprávě"},footer:"Stiskněte {{key1}} nebo {{key2}} pro zobrazení této nápovědy",tooltip:"Klávesové zkratky"},As={title:"Modely",loading:"Načítání modelů...",systemStatus:{online:"Ollama online",offline:"Ollama offline",models:"model",models_plural:"modelů",running:"běží",vram:"VRAM"},sections:{pull:"Stáhnout nový model",library:"Procházet knihovnu",running:"Běžící modely",local:"Lokální modely",advanced:"Pokročilé akce"},pull:{placeholder:"Zadejte název modelu (např. llama3.2:3b, deepseek-r1:14b)",button:"Stáhnout",cancel:"Zrušit",popular:"Populární modely:",browseAll:"Procházet všechny modely na ollama.com",success:"Model {{name}} úspěšně stažen",cancelled:"Stahování modelu zrušeno",failed:"Nepodařilo se stáhnout model",enterName:"Zadejte název modelu"},progress:{starting:"Inicializace...",pulling:"Stahování modelu...",verifying:"Ověřování integrity...",writing:"Zápis manifestu...",cleaning:"Čištění..."},library:{available:"dostupné",search:"Hledat modely...",noResults:"Nebyly nalezeny žádné modely odpovídající kritériím",installed:"Nainstalováno",more:"+{{count}} dalších",refresh:"Obnovit knihovnu"},local:{noModels:"Zatím žádné nainstalované modely",pullToStart:"Stáhněte model výše pro začátek",installed:"nainstalováno",running:"Běží",info:"Info",copy:"Kopírovat",delete:"Smazat",deleteConfirm:'Opravdu chcete smazat model "{{name}}"?',deleteSuccess:"Model {{name}} úspěšně smazán",deleteFailed:"Nepodařilo se smazat model"},advanced:{createModel:"Vytvořit model",fromModelfile:"Z Modelfile",copyModel:"Kopírovat model",duplicateExisting:"Duplikovat existující",testEmbeddings:"Testovat embeddingy",generateVectors:"Generovat vektory",healthCheck:"Kontrola stavu",testConnection:"Test připojení",healthy:"Ollama je v pořádku!"},modals:{details:{title:"Detaily modelu",info:"Informace o modelu",family:"Rodina",parameters:"Parametry",quantization:"Kvantizace",format:"Formát",systemPrompt:"Systémový prompt",template:"Šablona",license:"Licence",modelfile:"Modelfile",noDetails:"Žádné dostupné detaily"},copy:{title:"Kopírovat model",source:"Zdrojový model",selectModel:"Vyberte model...",newName:"Nový název modelu",placeholder:"např. muj-vlastni-model",copying:"Kopírování...",button:"Kopírovat model",success:"Model zkopírován jako {{name}}",failed:"Nepodařilo se zkopírovat model",enterBoth:"Zadejte zdrojový i cílový název modelu"},create:{title:"Vytvořit vlastní model",name:"Název modelu",namePlaceholder:"např. muj-asistent",modelfile:"Modelfile",modelfilePlaceholder:`FROM llama3.2
5
5
  SYSTEM Jsi užitečný asistent.`,docs:"Dokumentace Modelfile",docsLink:"pro referenci syntaxe",creating:"Vytváření...",button:"Vytvořit model",success:"Model {{name}} úspěšně vytvořen",failed:"Nepodařilo se vytvořit model",enterBoth:"Zadejte název modelu a obsah Modelfile"},embeddings:{title:"Testovat embeddingy",model:"Model embeddingů",selectModel:"Vyberte model...",recommended:"Doporučené: nomic-embed-text, mxbai-embed-large",input:"Vstupní text",placeholder:"Zadejte text pro generování embeddingů...",generating:"Generování...",button:"Generovat embeddingy",result:"Výsledek ({{count}} dimenzí)",success:"Vygenerován {{count}}-dimenzionální embedding vektor",failed:"Nepodařilo se vygenerovat embeddingy",enterBoth:"Vyberte model a zadejte text"}}},zs={title:"Persony",subtitle:"Vytvářejte a spravujte AI persony s jedinečnými osobnostmi, pamětí a chováním",loading:"Načítání person...",createButton:"Vytvořit personu",importExport:"Import/Export",stats:{title:"Vaše persony",count:"{{count}} persona vytvořena",count_plural:"{{count}} person vytvořeno"},empty:{title:"Zatím žádné persony",description:"Vytvořte svou první personu pro personalizované AI interakce",button:"Vytvořit první personu"},deleteConfirm:'Opravdu chcete smazat "{{name}}"?',deleteSuccess:'Persona "{{name}}" úspěšně smazána',downloadSuccess:'Persona "{{name}}" úspěšně stažena',failed:"Nepodařilo se {{action}} personu"},Ns={title:{create:"Vytvořit novou personu",edit:"Upravit personu"},subtitle:{create:"Vytvořte novou AI personu s jedinečnou osobností, systémem paměti a adaptivním učením",edit:"Přizpůsobte svou AI personu s pokročilou pamětí, adaptivním učením a inteligentními parametry"},loading:"Načítání formuláře...",saved:"Uloženo",tabs:{basic:"Základní",parameters:"Parametry",memory:"Paměť a učení",advanced:"Pokročilé"},basic:{name:"Název",namePlaceholder:"Zadejte název persony",model:"Model",selectModel:"Vyberte model",description:"Popis",descriptionPlaceholder:"Popište svou personu...",systemPrompt:"Systémový prompt",systemPromptPlaceholder:"Zadejte systémový prompt definující chování persony...",systemPromptHint:"Systémový prompt definuje, jak se vaše persona bude chovat a odpovídat."},parameters:{temperature:"Teplota",temperatureHint:"Ovládá kreativitu vs konzistenci",topP:"Top-P",topPHint:"Ovládá rozmanitost odpovědí",topK:"Top-K",topKHint:"Omezuje slovník na top-k tokenů",contextWindow:"Kontextové okno",contextWindowHint:"Maximální délka historie konverzace",maxTokens:"Max tokenů",maxTokensHint:"Maximální délka odpovědi",repeatPenalty:"Penalizace opakování",repeatPenaltyHint:"Snižuje opakující se odpovědi"},memory:{title:"Systém paměti",subtitle:"Persona si pamatuje konverzace v čase",enableHint:"Povolte systém paměti, aby si vaše persona pamatovala konverzace a budovala kontext v čase.",loading:"Načítání stavu paměti...",noData:"Zatím žádná data paměti",memories:"Vzpomínky",mbUsed:"MB použito",lastBackup:"Poslední záloha",never:"Nikdy",maxMemories:"Maximum vzpomínek",maxMemoriesHint:"Kolik vzpomínek může persona uložit",retention:"Uchování paměti",retentionHint:"Dny uchování vzpomínek před vyčištěním",autoCleanup:"Automatické čištění starých vzpomínek",wipeAll:"Vymazat všechny vzpomínky",wipeCannot:"Tuto akci nelze vrátit zpět",wipeButton:"Vymazat",wiping:"Mazání...",wipeConfirm:"Opravdu chcete vymazat všechny vzpomínky? Tuto akci nelze vrátit zpět.",wipeSuccess:"Vymazáno {{count}} vzpomínek"},learning:{title:"Adaptivní učení",subtitle:"Persona se vyvíjí na základě interakcí",enableHint:"Povolte adaptivní učení, aby se persona vyvíjela a personalizovala odpovědi na základě vašich interakcí.",speed:"Rychlost učení",slow:"Pomalá",slowDesc:"Postupné změny",balanced:"Vyvážená",balancedDesc:"Střední tempo",fast:"Rychlá",fastDesc:"Rychlá adaptace",autoAdapt:"Automatická adaptace na preference uživatele",whatLearns:"Co se persona učí:",conversationTone:"Tón konverzace",responseStyle:"Styl odpovědí",userPreferences:"Preference uživatele",topicInterests:"Zájmy o témata"},advanced:{embeddingModel:"Model embeddingů",embeddingHint:"Vyberte model používaný pro kódování paměti a sémantické vyhledávání. Modely embeddingů jsou zobrazeny první, pak ostatní dostupné modely.",noModels:"Nebyly nalezeny žádné modely",embeddingModels:"Modely embeddingů",otherModels:"Ostatní modely",installHint:"Nainstalujte model embeddingů:",recommended:"Doporučené: nomic-embed-text, mxbai-embed-large, bge-m3, snowflake-arctic-embed",aboutTitle:"O pokročilých nastaveních",aboutDescription:"Model embeddingů je používán systémem paměti k pochopení sémantického významu a nalezení relevantních vzpomínek během konverzací. Vyberte model odpovídající vašemu případu použití a dostupným prostředkům."},actions:{cancel:"Zrušit",save:"Uložit",saving:"Ukládání...",saveClose:"Uložit a zavřít",create:"Vytvořit"},success:{created:"Persona vytvořena",updated:"Persona aktualizována"},error:{saveFailed:"Nepodařilo se uložit"}},Ts={enhanced:"Vylepšená",systemPrompt:"Systémový prompt",memories:"vzpomínek",use:"Použít",editTooltip:"Upravit personu",downloadTooltip:"Stáhnout personu",backup:"Záloha",exportDNA:"Exportovat DNA",wipeMemories:"Vymazat vzpomínky",wipeConfirm:"Opravdu chcete vymazat všechny vzpomínky této persony? Tuto akci nelze vrátit zpět.",wipeSuccess:"Vymazáno {{count}} vzpomínek",backupSuccess:"Záloha persony úspěšně stažena",dnaSuccess:"DNA persony úspěšně exportováno",failed:"Nepodařilo se {{action}}"},Is={title:"Správa uživatelů",subtitle:"Spravujte uživatelské účty a oprávnění",loading:"Načítání uživatelů...",createUser:"Vytvořit uživatele",search:"Hledat uživatele...",noUsers:"Nebyli nalezeni žádní uživatelé",noUsersMatching:"Nebyli nalezeni žádní uživatelé odpovídající hledání",columns:{user:"Uživatel",email:"Email",role:"Role",created:"Vytvořeno",actions:"Akce"},roles:{admin:"Správce",user:"Uživatel"},noEmail:"Žádný email",deleteConfirm:'Opravdu chcete smazat uživatele "{{name}}"?',deleteSuccess:"Uživatel úspěšně smazán",deleteFailed:"Nepodařilo se smazat uživatele",cannotDeleteSelf:"Nemůžete smazat svůj vlastní účet",form:{title:{create:"Vytvořit uživatele",edit:"Upravit uživatele"},username:"Uživatelské jméno",usernamePlaceholder:"Zadejte uživatelské jméno",email:"Email",emailPlaceholder:"Zadejte email (volitelné)",password:"Heslo",passwordPlaceholder:"Zadejte heslo",passwordHint:"Ponechte prázdné pro zachování současného hesla",role:"Role",creating:"Vytváření...",updating:"Aktualizace...",createButton:"Vytvořit uživatele",updateButton:"Aktualizovat uživatele",createSuccess:"Uživatel úspěšně vytvořen",updateSuccess:"Uživatel úspěšně aktualizován",createFailed:"Nepodařilo se vytvořit uživatele",updateFailed:"Nepodařilo se aktualizovat uživatele"}},Cs={you:"Vy",assistant:"Asistent",system:"Systém",copy:"Kopírovat",copyMessage:"Kopírovat zprávu",copied:"Zkopírováno!",regenerate:"Regenerovat",regenerateResponse:"Regenerovat odpověď",edit:"Upravit",editSystemMessage:"Upravit systémovou zprávu",saveChanges:"Uložit změny",cancelEditing:"Zrušit úpravy",delete:"Smazat",deleteConfirm:"Smazat tuto zprávu?",branch:"Větev",speaking:"Mluvení...",speakMessage:"Přečíst zprávu",stopSpeaking:"Zastavit mluvení",showMore:"Zobrazit více",showLess:"Zobrazit méně",thinking:"Přemýšlení",systemMessagePlaceholder:"Zadejte systémovou zprávu...",fullSizeImage:"Plná velikost obrázku",startConversation:"Zahájit konverzaci",startConversationDescription:"Pošlete zprávu pro zahájení chatu s AI asistentem. Ptejte se, získejte pomoc s kódem nebo veďte přirozenou konverzaci.",scrollToBottom:"Posunout dolů",newMessages:"Nové zprávy"},Fs={title:"Galerie obrázků",noImages:"Zatím žádné obrázky",noImagesHint:"Vygenerujte svůj první obrázek pomocí panelu vpravo",delete:"Smazat",download:"Stáhnout",deleteConfirm:"Opravdu chcete smazat tento obrázek?",deleteSuccess:"Obrázek smazán",deleteFailed:"Nepodařilo se smazat obrázek",downloadFailed:"Nepodařilo se stáhnout obrázek",loadMore:"Načíst více ({{current}} z {{total}})",loadFailed:"Nepodařilo se načíst galerii"},Es={title:"Generovat obrázek",prompt:"Prompt",promptPlaceholder:"Popište obrázek, který chcete vytvořit...",model:"Model",selectModel:"Vyberte model",noModels:"Žádné dostupné modely pro generování obrázků",configurePlugin:"Nakonfigurujte plugin s podporou generování obrázků",size:"Velikost",quality:"Kvalita",style:"Styl",generate:"Generovat",generating:"Generování...",success:"Obrázek úspěšně vygenerován",failed:"Nepodařilo se vygenerovat obrázek",enterPrompt:"Zadejte prompt"},Os={title:"Něco se pokazilo",description:"Došlo k neočekávané chybě. Zkuste obnovit stránku.",tryAgain:"Obnovit stránku",goHome:"Přejít domů",errorDetails:"Detaily chyby (vývoj)"},Ls={title:"Dokumenty",upload:"Nahrát dokument",uploading:"Nahrávání...",noDocuments:"Žádné nahrané dokumenty",uploadHint:"Nahrajte dokumenty pro použití v konverzacích",delete:"Smazat",deleteConfirm:"Opravdu chcete smazat tento dokument?",deleteSuccess:"Dokument smazán",deleteFailed:"Nepodařilo se smazat dokument",uploadSuccess:"Dokument úspěšně nahrán",uploadFailed:"Nepodařilo se nahrát dokument",types:"Podporované: PDF, TXT, MD, DOCX",unsupportedFileType:"Podporovány jsou pouze soubory PDF a TXT",fileSizeTooLarge:"Velikost souboru musí být menší než 10MB",uploadSuccessWithName:'Dokument "{{name}}" úspěšně nahrán',removeSuccess:"Dokument úspěšně odstraněn",removeFailed:"Nepodařilo se odstranit dokument",removeError:"Při odstraňování dokumentu došlo k chybě",clickToUpload:"Klikněte pro nahrání",orDragAndDrop:"nebo přetáhněte",fileTypesAndSize:"PDF nebo TXT soubory do 10MB",uploadedDocuments:"Nahrané dokumenty",removeDocument:"Odstranit dokument"},Ks={speak:"Mluvit",stop:"Stop",speaking:"Mluvení...",generateFailed:"Nepodařilo se vygenerovat řeč",playbackFailed:"Přehrávání zvuku se nezdařilo",stopSpeaking:"Zastavit mluvení",generatingSpeech:"Generování řeči...",readAloud:"Přečíst nahlas"},Bs={title:"Artefakty",code:"Kód",preview:"Náhled",copy:"Kopírovat kód",copied:"Zkopírováno!",download:"Stáhnout",expand:"Rozbalit",collapse:"Sbalit",openInNewTab:"Otevřít v nové záložce",invalidSvg:"Neplatný obsah SVG",invalidJson:"Neplatný obsah JSON",previewMode:"Režim náhledu",codeMode:"Režim kódu",copyContent:"Kopírovat obsah",openInPanel:"Otevřít v panelu",openInNewWindow:"Otevřít v novém okně",created:"Vytvořeno",closePanelEsc:"Zavřít panel (Esc)",copyButton:"Kopírovat",open:"Otevřít",dragEdgeToResize:"Přetáhněte okraj pro změnu velikosti"},Gs={title:"Import a export person",description:"Exportujte své persony pro sdílení nebo importujte persony ostatních",exportPersonas:"Exportovat persony",importPersonas:"Importovat persony",noPersonasToExport:"Žádné persony k exportu",personasAvailable:"{{count}} persona dostupná",personasAvailable_plural:"{{count}} person dostupných",exportAll:"Exportovat vše",uploadJsonFile:"Nahrát JSON soubor",pasteJsonLabel:"Vložit JSON data",pasteJsonPlaceholder:"Vložte JSON data persony sem...",importing:"Importování...",importButton:"Importovat personu(y)",expectedFormat:"Očekávaný formát JSON:",exportSuccess:'Persona "{{name}}" úspěšně exportována',exportFailed:"Nepodařilo se exportovat personu",exportAllSuccess:"Všechny {{count}} persony úspěšně exportovány",exportAllFailed:"Nepodařilo se exportovat persony",pasteJsonData:"Vložte JSON data persony",importMultipleSuccess:"Úspěšně importováno {{count}} person",importMultipleFailed:"Nepodařilo se importovat {{count}} person",importNoneFailed:"Nepodařilo se importovat žádnou personu",importSuccess:"Persona úspěšně importována",importFailed:"Nepodařilo se importovat personu"},Hs={common:hs,brand:bs,auth:ks,setup:fs,chat:ys,sidebar:vs,user:xs,settings:Ss,models:ws,personas:Ps,gallery:Ms,errors:Ds,keyboard:js,modelManager:As,personaManager:zs,personaForm:Ns,personaCard:Ts,userManager:Is,chatMessage:Cs,imageGallery:Fs,imageGeneration:Es,errorBoundary:Os,documents:Ls,ttsButton:Ks,artifacts:Bs,personaImportExport:Gs},Rs={loading:"Indlæser...",save:"Gem",saving:"Gemmer...",cancel:"Annuller",delete:"Slet",edit:"Rediger",close:"Luk",back:"Tilbage",next:"Næste",confirm:"Bekræft",error:"Fejl",success:"Succes",warning:"Advarsel",or:"eller",optional:"valgfri",enabled:"Aktiveret",disabled:"Deaktiveret",on:"Til",off:"Fra",yes:"Ja",no:"Nej",search:"Søg",noResults:"Ingen resultater fundet",retry:"Prøv igen",refresh:"Opdater",download:"Download",upload:"Upload",export:"Eksporter",import:"Importer",reset:"Nulstil",apply:"Anvend",clear:"Ryd",all:"Alle",none:"Ingen",default:"Standard",custom:"Tilpasset",mode:"Tilstand",multiUser:"Flere brugere",remove:"Fjern"},Us={name:"Libre WebUI",shortName:"Libre"},$s={login:{title:"Velkommen tilbage",subtitle:"Log ind på din konto for at fortsætte",username:"Brugernavn",usernamePlaceholder:"Indtast dit brugernavn",password:"Adgangskode",passwordPlaceholder:"Indtast din adgangskode",signIn:"Log ind",signingIn:"Logger ind...",noAccount:"Har du ikke en konto?",signUpHere:"Opret en her",loginSuccess:"Login lykkedes!",loginFailed:"Login mislykkedes",checkCredentials:"Login mislykkedes. Kontroller venligst dine loginoplysninger.",enterBoth:"Indtast venligst både brugernavn og adgangskode",githubSuccess:"GitHub-login lykkedes!",githubFailed:"GitHub-godkendelse mislykkedes",githubVerifyFailed:"Kunne ikke bekræfte GitHub-godkendelse"},signup:{title:"Opret konto",subtitle:"Tilmeld dig en ny konto",username:"Brugernavn",usernamePlaceholder:"Vælg et brugernavn",email:"E-mail",emailPlaceholder:"din@email.dk",password:"Adgangskode",passwordPlaceholder:"Vælg en adgangskode",confirmPassword:"Bekræft adgangskode",confirmPasswordPlaceholder:"Bekræft din adgangskode",createAccount:"Opret konto",creatingAccount:"Opretter konto...",hasAccount:"Har du allerede en konto?",signInHere:"Log ind her",signupSuccess:"Konto oprettet!",signupFailed:"Tilmelding mislykkedes",tryAgain:"Tilmelding mislykkedes. Prøv venligst igen.",usernameRequired:"Brugernavn og adgangskode er påkrævet",passwordMismatch:"Adgangskoderne stemmer ikke overens",passwordTooShort:"Adgangskoden skal være mindst 6 tegn lang"},logout:{button:"Log ud",success:"Logget ud"},oauth:{continueWith:"Fortsæt med {{provider}}",connectingTo:"Opretter forbindelse til {{provider}}...",github:"GitHub",huggingFace:"Hugging Face"}},Vs={welcome:{title:"Velkommen til Libre WebUI",subtitle:"Lad os komme i gang",description:"Opsæt din Libre WebUI-instans på få trin",createAdmin:"Opret administratorkonto",features:{secure:{title:"Sikker og privat",description:"Dine samtaler forbliver på din enhed"},fast:{title:"Hurtig og responsiv",description:"Optimeret til hastighed og ydeevne"},openSource:{title:"Open source",description:"Gratis og open source-software"}}},admin:{title:"Opret administratorkonto",subtitle:"Administrator-opsætning",description:"Opret den første administratorkonto til din Libre WebUI-instans",usernamePlaceholder:"Indtast administratorbrugernavn",passwordPlaceholder:"Indtast adgangskode (min. 6 tegn)",confirmPlaceholder:"Bekræft din adgangskode",creating:"Opretter...",createAdmin:"Opret administrator",success:"Administratorkonto oprettet!",failed:"Kunne ikke oprette administratorkonto",fillAllFields:"Udfyld venligst alle felter",note:"Dette bliver den primære administratorkonto for din Libre WebUI-instans"},encryptionKey:{title:"Gem din krypteringsnøgle",subtitle:"Vigtigt: Gem denne nøgle",description:"Denne krypteringsnøgle beskytter dine følsomme data. Opbevar den sikkert - du får brug for den, hvis du skal gendanne din database.",warning:"Advarsel",warningText:"Hvis du mister denne nøgle og skal gendanne din database, vil dine krypterede data (API-nøgler, præferencer) være uoprettelige.",label:"Din krypteringsnøgle",loading:"Indlæser...",copyToClipboard:"Kopier til udklipsholder",copied:"Krypteringsnøgle kopieret til udklipsholder!",copyFailed:"Kunne ikke kopiere nøgle til udklipsholder",envNote:"Denne nøgle er også gemt i din backend/.env-fil som ENCRYPTION_KEY",acknowledgment:"Jeg har gemt min krypteringsnøgle på et sikkert sted og forstår, at tab af den kan medføre datatab.",confirmRequired:"Bekræft venligst, at du har gemt krypteringsnøglen",continue:"Fortsæt til Libre WebUI"}},Ws={greeting:{morning:"Godmorgen",afternoon:"God eftermiddag",evening:"Godaften",night:"Godnat"},welcome:{helpToday:"Hvad kan jeg hjælpe med i dag?",helpTonight:"Hvad kan jeg hjælpe med i aften?"},input:{placeholder:"Send en besked",messagePlaceholder:"Besked...",attachImages:"Vedhæft billeder",attachments:"Vedhæftninger og avancerede funktioner",sendMessage:"Send besked",stopGeneration:"Stop generering"},session:{new:"Ny chat",private:"Privat",privateMode:"Privat tilstand",privateDescription:"Denne samtale gemmes ikke",privateTooltip:"Start en privat samtale, der ikke gemmes",deleteConfirm:"Er du sikker på, at du vil slette denne chat?",generatingTitle:"Genererer titel",noChats:"Ingen chats endnu",createFirst:"Opret din første chat ovenfor",chats:"Chats",renameChat:"Omdøb chat",deleteChat:"Slet chat"},persona:{applied:"Persona anvendt",label:"Persona"},model:{updated:"Model opdateret",noModels:"Ingen modeller tilgængelige",noModelsDescription:"Ingen modeller tilgængelige. Sørg for, at Ollama kører og har installeret modeller.",pullCommand:"ollama pull llama3.2:3b",noModelsTooltip:"Ingen modeller tilgængelige. Sørg venligst for, at Ollama kører, og at modeller er installeret."},footer:{disclaimer:"LLM kan begå fejl - verificer vigtige oplysninger",images:"{{count}} billede",images_plural:"{{count}} billeder",structuredOutput:"Struktureret output"},mediaUpload:{dropImagesHere:"Slip billeder her eller",supportedFormats:"Understøtter: JPG, PNG, GIF, WebP (maks. 10 MB hver)",browse:"gennemse"},structuredOutput:{title:"Svarformat",none:"Ingen (naturligt sprog)",noneDescription:"Standard naturligt sprog-svar",json:"JSON",jsonDescription:"Struktureret JSON-format",list:"Liste",listDescription:"Array af elementer",summary:"Resumé",summaryDescription:"Dokumentresumé med hovedpunkter",analysis:"Analyse",analysisDescription:"Struktureret analyse med fordele/ulemper",custom:"Tilpasset skema",customDescription:"Definer dit eget JSON-skema",customSchema:"Tilpasset JSON-skema",schemaPreview:"Skemaforhåndsvisning",applySchema:"Anvend skema",cancel:"Annuller",enabled:"Struktureret output aktiveret"}},qs={navigation:{chat:"Chat",models:"Modeller",personas:"Personaer",imagine:"Forestil",settings:"Indstillinger",userManagement:"Brugeradministration",signOut:"Log ud"},toggleSize:"Skift sidebjælkestørrelse",expandSidebar:"Udvid sidebjælke"},Js={menu:{changePicture:"Skift billede",settings:"Indstillinger",userManagement:"Brugeradministration",logout:"Log ud"},avatar:{title:"Skift profilbillede",updated:"Profilbillede opdateret",updateFailed:"Kunne ikke opdatere profilbillede",saving:"Gemmer..."},profile:{noEmail:"Ingen e-mail angivet"}},_s={title:"Indstillinger",tabs:{appearance:"Udseende",model:"Model",systemMessage:"Systembesked",plugins:"Plugins",generation:"Generering",documents:"Dokumenter",tts:"Tekst-til-tale",imageGen:"Billedgenerering",system:"System",data:"Data",about:"Om"},appearance:{title:"Udseende",language:{title:"Sprog",description:"Vælg dit foretrukne sprog"},theme:{title:"Tema",light:"Lys",dark:"Mørk",amoled:"AMOLED",system:"System"},chatInterface:{title:"Chat-grænseflade",showUsername:"Vis brugernavn",showUsernameDescription:"Vis brugernavn i chatbeskeder"},background:{title:"Baggrundsbillede",enable:"Aktiver baggrundsbillede",enableDescription:"Vis tilpasset baggrund med sløringseffekt",blur:"Sløring",opacity:"Gennemsigtighed",upload:"Upload baggrundsbillede",dragDrop:"Træk og slip et billede eller klik for at gennemse",chooseImage:"Vælg billede"}},system:{title:"System",currentModel:"Nuværende model",notSet:"Ikke angivet"},saveSettings:"Gem indstillinger",model:{title:"Modelindstillinger",defaultModel:"Standardmodel",defaultModelDescription:"Denne model bruges som standard til nye samtaler",selectModel:"Vælg en model",updateAll:"Opdater alle modeller",updateAllDescription:"Tjek for opdateringer og hent seneste versioner af alle installerede modeller",updateAllButton:"Opdater alle",updating:"Opdaterer modeller...",currentModelInfo:"Nuværende modelinfo",name:"Navn",size:"Størrelse",family:"Familie",format:"Format",status:"Status",statusStarting:"Starter...",statusComplete:"Fuldført",statusError:"Fejl",bulkOperations:"Massehandlinger",autoTitle:{title:"Automatisk titelgenerering",enable:"Aktiver automatisk titel",enableDescription:"Generer automatisk titler til nye samtaler",taskModel:"Opgavemodel",selectTaskModel:"Vælg opgavemodel",taskModelDescription:"Model brugt til at generere samtaletitler"}},systemMessage:{title:"Systembesked",description:"Indstil en tilpasset systembesked, der bruges til alle nye samtaler.",placeholder:"Indtast en systembesked...",saved:"Systembesked gemt",saveFailed:"Kunne ikke gemme systembesked"},plugins:{title:"Plugins",description:"Administrer dine installerede plugins",addNew:"Tilføj nyt plugin",upload:"Upload plugin",addJson:"Tilføj JSON",uploading:"Uploader...",jsonPlaceholder:"Indsæt plugin JSON-konfiguration...",install:"Installer plugin",noPlugins:"Ingen plugins installeret",noPluginsDescription:"Tilføj et plugin for at udvide funktionaliteten",loading:"Indlæser plugins...",installed:"Installerede plugins",active:"Aktive plugins",activeLabel:"Aktiv",inactive:"Inaktiv",activate:"Aktiver",deactivate:"Deaktiver",models:"modeller",apiKeySet:"API-nøgle angivet",apiKeyConfiguration:"API-nøgle konfiguration",apiKeyEnvAlternative:"Alternativt, sæt",environmentVariable:"miljøvariabel",apiKeyConfigured:"API-nøgle konfigureret",apiKeyPlaceholder:"Indtast din API-nøgle...",saveApiKey:"Gem API-nøgle",apiKey:{title:"API-nøgle",placeholder:"Indtast API-nøgle",save:"Gem nøgle",remove:"Fjern nøgle",configured:"API-nøgle konfigureret",notConfigured:"API-nøgle påkrævet",saved:"API-nøgle gemt",removed:"API-nøgle fjernet",saveFailed:"Kunne ikke gemme API-nøgle",removeFailed:"Kunne ikke fjerne API-nøgle",enterKey:"Indtast venligst en API-nøgle"}},generation:{title:"Genereringsindstillinger",description:"Konfigurer hvordan AI'en genererer svar",coreParameters:"Kerneparametre",temperature:"Temperatur",temperatureDescription:"Styrer tilfældighed. Lavere værdier er mere fokuserede, højere værdier mere kreative.",topP:"Top P",topPDescription:"Styrer diversitet via nucleus sampling. Lavere værdier fokuserer på sandsynlige tokens.",topK:"Top K",topKDescription:"Begrænser tokenvalg til top K mest sandsynlige. Sæt til 0 for at deaktivere.",minP:"Min P",minPDescription:"Minimum sandsynlighedstærskel for tokenvalg.",generationControl:"Genereringskontrol",maxTokens:"Maks. tokens",maxTokensDescription:"Maksimalt antal tokens, der genereres i svaret.",repeatPenalty:"Gentagelsesstraf",repeatPenaltyDescription:"Straffer gentagne tokens. Højere værdier reducerer gentagelse.",contextLength:"Kontekstlængde",contextLengthDescription:"Maksimal kontekstvindue-størrelse for samtaler.",seed:"Seed",optional:"valgfri",random:"Tilfældig",seedDescription:"Angiv en specifik seed for reproducerbare resultater.",advancedOptions:"Avancerede indstillinger",presencePenalty:"Tilstedeværelsesstraf",presencePenaltyDescription:"Straffer tokens, der optræder i konteksten.",frequencyPenalty:"Frekvensstraf",frequencyPenaltyDescription:"Straffer hyppigt brugte tokens.",stopSequences:"Stopsekvenser",commaSeparated:"kommasepareret",stopSequencesDescription:"Tilpassede tokens, der stopper generering, når de stødes på.",resetDefaults:"Nulstil til standard",saveOptions:"Gem indstillinger",embeddingSettings:"Embedding-indstillinger",enableEmbeddings:"Aktiver dokument-embeddings"},documents:{title:"Dokumentindstillinger",embeddings:{title:"Embeddings",enable:"Aktiver dokument-embeddings",model:"Embedding-model",modelDescription:"Vælg den model, der bruges til dokument-embedding",chunkSize:"Chunk-størrelse",chunkSizeInTokens:"(i tokens)",chunkSizeDescription:"Størrelse af tekstchunks til embedding",chunkOverlap:"Chunk-overlap",chunkOverlapInTokens:"(i tokens)",chunkOverlapDescription:"Overlap mellem på hinanden følgende chunks",similarityThreshold:"Lighedstærskel",similarityDescription:"Minimum lighedsscore for at inkludere resultater",status:"Embedding-status",statusLabel:"Status",available:"Tilgængelig",unavailable:"Utilgængelig",chunksWithEmbeddings:"Chunks med embeddings",coverage:"Dækning",regenerate:"Regenerer embeddings",regenerating:"Regenererer..."}},tts:{title:"Tekst-til-tale",description:"Konfigurer tekst-til-tale-indstillinger for oplæsning af beskeder",loadingProviders:"Indlæser TTS-udbydere...",noProviders:"Ingen TTS-udbydere",noProvidersDescription:"Konfigurer et plugin med TTS-understøttelse for at aktivere tekst-til-tale",enable:"Aktiver TTS",enableDescription:"Tillad tekst-til-tale for assistentbeskeder",autoPlay:"Automatisk afspilning af svar",autoPlayDescription:"Læs automatisk nye assistentbeskeder højt",voiceConfiguration:"Stemmekonfiguration",model:"TTS-model",modelDescription:"Vælg modellen til tekst-til-tale-generering",voice:"Stemme",selectVoice:"Vælg en stemme",voiceDescription:"Vælg stemmen til tekst-til-tale",speed:"Hastighed",speedSlow:"0,5x",speedNormal:"1,0x",speedFast:"2,0x",availableProviders:"Tilgængelige udbydere",models:"modeller",test:"Test",testing:"Tester...",stop:"Stop"},imageGen:{title:"Billedgenerering",description:"Konfigurer indstillinger og udbydere for billedgenerering",loadingProviders:"Indlæser billedgenereringsudbydere...",noProviders:"Ingen billedgenereringsudbydere",noProvidersDescription:"Konfigurer et plugin med understøttelse af billedgenerering",enable:"Aktiver billedgenerering",enableDescription:"Tillad AI-billedgenerering i samtaler",configuration:"Konfiguration",model:"Model",modelDescription:"Vælg modellen til billedgenerering",size:"Størrelse",sizeDescription:"Opløsning af genererede billeder",quality:"Kvalitet",qualityDescription:"Kvalitetsniveau for genererede billeder",style:"Stil",styleDescription:"Stilforudindstilling for genererede billeder",availableProviders:"Tilgængelige udbydere",models:"modeller"},data:{title:"Dataadministration",export:"Eksporter data",exportDescription:"Download alle dine data inklusive præferencer, sessioner og dokumenter.",exportAll:"Eksporter alle data",import:"Importer data",importDescription:"Importer data fra en tidligere eksport.",importData:"Importer data",importing:"Importerer...",clearSessions:"Ryd sessioner",clearSessionsDescription:"Slet alle chatsessioner. Denne handling kan ikke fortrydes.",clearAll:"Ryd alle",clearing:"Rydder...",importOptions:"Importindstillinger",importOptionsDescription:"Vælg hvordan eksisterende data skal håndteres",skipDuplicates:"Spring dubletter over",overwrite:"Overskriv eksisterende",importResults:"Importresultater",preferences:"Præferencer",imported:"Importeret",failed:"Mislykkedes",sessions:"Sessioner",importedLabel:"importeret",skipped:"sprunget over",documents:"Dokumenter",errors:"Fejl"},about:{title:"Om",versionLabel:"Version",ollama:{title:"Ollama-status",version:"Version",healthy:"Sund",unhealthy:"Usund"},stats:{models:"Modeller",sessions:"Sessioner"},features:{privacy:{title:"Privatliv først",description:"Dine data forbliver på din enhed"},openSource:{title:"Open source",description:"Gratis og open source-software"},localInference:{title:"Lokal inferens",description:"Kør AI-modeller lokalt med Ollama"}},openSourceBy:"Open source af {{company}}",links:{title:"Links",github:"GitHub",githubDescription:"Se kildekode og bidrag",website:"Hjemmeside",websiteDescription:"Besøg vores hjemmeside",ollama:"Ollama",ollamaDescription:"Lær mere om Ollama",documentation:"Dokumentation",reportIssue:"Rapporter problemer",reportIssueDescription:"Fejlrapporter og funktionsønsker"},version:"Version {{version}}"}},Ys={title:"Modeller",subtitle:"Hent, administrer og overvåg dine Ollama-modeller",installed:"Installerede modeller",available:"Tilgængelige modeller",pull:"Hent model",pulling:"Henter...",delete:"Slet model",deleting:"Sletter...",size:"Størrelse",modified:"Ændret",family:"Familie",parameters:"Parametre",quantization:"Kvantisering",noModels:"Ingen modeller installeret",pullFirst:"Hent en model for at komme i gang"},Zs={title:"Personaer",create:"Opret persona",edit:"Rediger persona",delete:"Slet persona",name:"Navn",description:"Beskrivelse",systemPrompt:"System-prompt",model:"Model",avatar:"Avatar",background:"Baggrund",noPersonas:"Ingen personaer oprettet",createFirst:"Opret din første persona for at tilpasse din chatoplevelse"},Xs={title:"Galleri",subtitle:"Dit AI-genererede billedgalleri",imageCount:"{{count}} billeder",generate:"Generer billede",generateDescription:"Opret billeder med AI",generating:"Genererer...",prompt:"Prompt",promptPlaceholder:"Beskriv det billede, du vil generere...",noImages:"Ingen billeder genereret endnu",download:"Download",delete:"Slet",regenerate:"Regenerer",model:"Model",size:"Størrelse",quality:"Kvalitet",created:"Oprettet"},Qs={generic:"Der opstod en fejl",network:"Netværksfejl. Kontroller venligst din forbindelse.",unauthorized:"Du har ikke tilladelse til at udføre denne handling.",notFound:"Den anmodede ressource blev ikke fundet.",serverError:"Serverfejl. Prøv venligst igen senere.",validation:"Kontroller venligst din indtastning og prøv igen."},el={title:"Tastaturgenveje",toggleSidebar:"Skift sidebjælke",openSettings:"Åbn indstillinger",toggleDarkMode:"Skift mørk tilstand",showShortcuts:"Vis tastaturgenveje",closeModals:"Luk dialogbokse",groups:{navigation:"Navigation",settings:"Indstillinger",general:"Generelt",chat:"Chat"},actions:{sendMessage:"Send besked",newLine:"Ny linje i besked"},footer:"Tryk {{key1}} eller {{key2}} for at vise denne hjælp",tooltip:"Tastaturgenveje"},al={title:"Modeller",loading:"Indlæser modeller...",systemStatus:{online:"Ollama online",offline:"Ollama offline",models:"model",models_plural:"modeller",running:"kører",vram:"VRAM"},sections:{pull:"Hent ny model",library:"Gennemse bibliotek",running:"Kørende modeller",local:"Lokale modeller",advanced:"Avancerede handlinger"},pull:{placeholder:"Indtast modelnavn (f.eks. llama3.2:3b, deepseek-r1:14b)",button:"Hent",cancel:"Annuller",popular:"Populære modeller:",browseAll:"Gennemse alle modeller på ollama.com",success:"Model {{name}} hentet",cancelled:"Modelhentning annulleret",failed:"Kunne ikke hente model",enterName:"Indtast venligst et modelnavn"},progress:{starting:"Initialiserer...",pulling:"Downloader model...",verifying:"Verificerer integritet...",writing:"Skriver manifest...",cleaning:"Rydder op..."},library:{available:"tilgængelig",search:"Søg modeller...",noResults:"Ingen modeller fundet, der matcher dine kriterier",installed:"Installeret",more:"+{{count}} mere",refresh:"Opdater bibliotek"},local:{noModels:"Ingen modeller installeret endnu",pullToStart:"Hent en model ovenfor for at komme i gang",installed:"installeret",running:"Kører",info:"Info",copy:"Kopier",delete:"Slet",deleteConfirm:'Er du sikker på, at du vil slette modellen "{{name}}"?',deleteSuccess:"Model {{name}} slettet",deleteFailed:"Kunne ikke slette model"},advanced:{createModel:"Opret model",fromModelfile:"Fra Modelfile",copyModel:"Kopier model",duplicateExisting:"Dupliker eksisterende",testEmbeddings:"Test embeddings",generateVectors:"Generer vektorer",healthCheck:"Sundhedstjek",testConnection:"Test forbindelse",healthy:"Ollama er sund!"},modals:{details:{title:"Modeldetaljer",info:"Modelinformation",family:"Familie",parameters:"Parametre",quantization:"Kvantisering",format:"Format",systemPrompt:"System-prompt",template:"Skabelon",license:"Licens",modelfile:"Modelfile",noDetails:"Ingen detaljer tilgængelige"},copy:{title:"Kopier model",source:"Kildemodel",selectModel:"Vælg en model...",newName:"Nyt modelnavn",placeholder:"f.eks. min-tilpassede-model",copying:"Kopierer...",button:"Kopier model",success:"Model kopieret til {{name}}",failed:"Kunne ikke kopiere model",enterBoth:"Indtast venligst både kilde- og destinationsnavn"},create:{title:"Opret tilpasset model",name:"Modelnavn",namePlaceholder:"f.eks. min-assistent",modelfile:"Modelfile",modelfilePlaceholder:`FROM llama3.2
@@ -24,8 +24,8 @@ SYSTEM You are a helpful assistant.`,docs:"เอกสาร Modelfile",docsLin
24
24
  SYSTEM Yardımcı bir asistansınız.`,docs:"Modelfile belgeleri",docsLink:"söz dizimi referansı için",creating:"Oluşturuluyor...",button:"Model Oluştur",success:"{{name}} modeli başarıyla oluşturuldu",failed:"Model oluşturulamadı",enterBoth:"Lütfen model adını ve Modelfile içeriğini girin"},embeddings:{title:"Gömmeleri Test Et",model:"Gömme Modeli",selectModel:"Bir model seçin...",recommended:"Önerilen: nomic-embed-text, mxbai-embed-large",input:"Giriş Metni",placeholder:"Gömme oluşturmak için metin girin...",generating:"Oluşturuluyor...",button:"Gömme Oluştur",result:"Sonuç ({{count}} boyut)",success:"{{count}} boyutlu gömme vektörü oluşturuldu",failed:"Gömme oluşturulamadı",enterBoth:"Lütfen bir model seçin ve metin girin"}}},tk={title:"Personalar",subtitle:"Özel kişilikler, anılar ve davranışlarla yapay zeka personaları oluşturun ve yönetin",loading:"Personalar yükleniyor...",createButton:"Persona Oluştur",importExport:"İçe/Dışa Aktar",stats:{title:"Personalarınız",count:"{{count}} persona oluşturuldu",count_plural:"{{count}} persona oluşturuldu"},empty:{title:"Henüz persona yok",description:"Kişiselleştirilmiş yapay zeka etkileşimleri için ilk personanızı oluşturun",button:"İlk Personanızı Oluşturun"},deleteConfirm:'"{{name}}" personasını silmek istediğinizden emin misiniz?',deleteSuccess:'"{{name}}" personası başarıyla silindi',downloadSuccess:'"{{name}}" personası başarıyla indirildi',failed:"Persona {{action}} işlemi başarısız"},nk={title:{create:"Yeni Persona Oluştur",edit:"Personayı Düzenle"},subtitle:{create:"Özel kişilik, bellek sistemleri ve uyarlanabilir öğrenme yetenekleriyle yeni bir yapay zeka personası oluşturun",edit:"Gelişmiş bellek, uyarlanabilir öğrenme ve akıllı parametrelerle yapay zeka personanızı özelleştirin"},loading:"Form yükleniyor...",saved:"Kaydedildi",tabs:{basic:"Temel",parameters:"Parametreler",memory:"Bellek ve Öğrenme",advanced:"Gelişmiş"},basic:{name:"Ad",namePlaceholder:"Persona adını girin",model:"Model",selectModel:"Bir model seçin",description:"Açıklama",descriptionPlaceholder:"Personanızı tanımlayın...",systemPrompt:"Sistem Mesajı",systemPromptPlaceholder:"Persona davranışını tanımlayan sistem mesajını girin...",systemPromptHint:"Sistem mesajı, personanızın nasıl davranacağını ve yanıt vereceğini tanımlar."},parameters:{temperature:"Sıcaklık",temperatureHint:"Yaratıcılık ve tutarlılığı kontrol eder",topP:"Top-P",topPHint:"Yanıt çeşitliliğini kontrol eder",topK:"Top-K",topKHint:"Kelime dağarcığını en iyi k tokena sınırlar",contextWindow:"Bağlam Penceresi",contextWindowHint:"Maksimum konuşma geçmişi uzunluğu",maxTokens:"Maksimum Token",maxTokensHint:"Maksimum yanıt uzunluğu",repeatPenalty:"Tekrar Cezası",repeatPenaltyHint:"Tekrarlayan yanıtları azaltır"},memory:{title:"Bellek Sistemi",subtitle:"Persona zaman içinde konuşmaları hatırlar",enableHint:"Personanızın konuşmaları hatırlaması ve zaman içinde bağlam oluşturması için bellek sistemini etkinleştirin.",loading:"Bellek durumu yükleniyor...",noData:"Henüz bellek verisi yok",memories:"Anılar",mbUsed:"MB Kullanıldı",lastBackup:"Son Yedekleme",never:"Hiçbir zaman",maxMemories:"Maksimum Anı",maxMemoriesHint:"Bu personanın kaç anı saklayabileceği",retention:"Bellek Saklama",retentionHint:"Temizlemeden önce anıları saklama günü",autoCleanup:"Eski anıları otomatik temizle",wipeAll:"Tüm Anıları Sil",wipeCannot:"Bu geri alınamaz",wipeButton:"Sil",wiping:"Siliniyor...",wipeConfirm:"Tüm anıları silmek istediğinizden emin misiniz? Bu geri alınamaz.",wipeSuccess:"{{count}} anı silindi"},learning:{title:"Uyarlanabilir Öğrenme",subtitle:"Persona etkileşimlere göre gelişir",enableHint:"Personanızın etkileşimlerinize göre gelişmesi ve yanıtları kişiselleştirmesi için uyarlanabilir öğrenmeyi etkinleştirin.",speed:"Öğrenme Hızı",slow:"Yavaş",slowDesc:"Kademeli değişiklikler",balanced:"Dengeli",balancedDesc:"Orta hız",fast:"Hızlı",fastDesc:"Hızlı adaptasyon",autoAdapt:"Kullanıcı tercihlerine otomatik uyum",whatLearns:"Personanın öğrendikleri:",conversationTone:"Konuşma tonu",responseStyle:"Yanıt stili",userPreferences:"Kullanıcı tercihleri",topicInterests:"Konu ilgi alanları"},advanced:{embeddingModel:"Gömme Modeli",embeddingHint:"Bellek kodlama ve semantik arama için kullanılan modeli seçin. Gömme modelleri önce, ardından diğer mevcut modeller gösterilir.",noModels:"Model bulunamadı",embeddingModels:"Gömme Modelleri",otherModels:"Diğer Modeller",installHint:"Bir gömme modeli yükleyin:",recommended:"Önerilen: nomic-embed-text, mxbai-embed-large, bge-m3, snowflake-arctic-embed",aboutTitle:"Gelişmiş Ayarlar Hakkında",aboutDescription:"Gömme modeli, bellek sistemi tarafından semantik anlamı anlamak ve konuşmalar sırasında ilgili anıları bulmak için kullanılır. Kullanım durumunuza ve mevcut kaynaklarınıza uygun bir model seçin."},actions:{cancel:"İptal",save:"Kaydet",saving:"Kaydediliyor...",saveClose:"Kaydet ve Kapat",create:"Oluştur"},success:{created:"Persona oluşturuldu",updated:"Persona güncellendi"},error:{saveFailed:"Kaydetme başarısız"}},rk={enhanced:"Gelişmiş",systemPrompt:"Sistem Mesajı",memories:"anı",use:"Kullan",editTooltip:"Personayı düzenle",downloadTooltip:"Personayı indir",backup:"Yedekle",exportDNA:"DNA'yı Dışa Aktar",wipeMemories:"Anıları Sil",wipeConfirm:"Bu personanın tüm anılarını silmek istediğinizden emin misiniz? Bu işlem geri alınamaz.",wipeSuccess:"{{count}} anı silindi",backupSuccess:"Persona yedeği başarıyla indirildi",dnaSuccess:"Persona DNA'sı başarıyla dışa aktarıldı",failed:"{{action}} işlemi başarısız"},ik={title:"Kullanıcı Yönetimi",subtitle:"Kullanıcı hesaplarını ve izinlerini yönetin",loading:"Kullanıcılar yükleniyor...",createUser:"Kullanıcı Oluştur",search:"Kullanıcı ara...",noUsers:"Kullanıcı bulunamadı",noUsersMatching:"Aramanıza uyan kullanıcı yok",columns:{user:"Kullanıcı",email:"E-posta",role:"Rol",created:"Oluşturulma",actions:"İşlemler"},roles:{admin:"Yönetici",user:"Kullanıcı"},noEmail:"E-posta yok",deleteConfirm:'"{{name}}" kullanıcısını silmek istediğinizden emin misiniz?',deleteSuccess:"Kullanıcı başarıyla silindi",deleteFailed:"Kullanıcı silinemedi",cannotDeleteSelf:"Kendi hesabınızı silemezsiniz",form:{title:{create:"Kullanıcı Oluştur",edit:"Kullanıcıyı Düzenle"},username:"Kullanıcı Adı",usernamePlaceholder:"Kullanıcı adını girin",email:"E-posta",emailPlaceholder:"E-posta girin (isteğe bağlı)",password:"Şifre",passwordPlaceholder:"Şifre girin",passwordHint:"Mevcut şifreyi korumak için boş bırakın",role:"Rol",creating:"Oluşturuluyor...",updating:"Güncelleniyor...",createButton:"Kullanıcı Oluştur",updateButton:"Kullanıcıyı Güncelle",createSuccess:"Kullanıcı başarıyla oluşturuldu",updateSuccess:"Kullanıcı başarıyla güncellendi",createFailed:"Kullanıcı oluşturulamadı",updateFailed:"Kullanıcı güncellenemedi"}},ok={you:"Siz",assistant:"Asistan",system:"Sistem",copy:"Kopyala",copyMessage:"Mesajı kopyala",copied:"Kopyalandı!",regenerate:"Yeniden Oluştur",regenerateResponse:"Yanıtı yeniden oluştur",edit:"Düzenle",editSystemMessage:"Sistem mesajını düzenle",saveChanges:"Değişiklikleri kaydet",cancelEditing:"Düzenlemeyi iptal et",delete:"Sil",deleteConfirm:"Bu mesajı silmek istiyor musunuz?",branch:"Dallandır",speaking:"Konuşuluyor...",speakMessage:"Mesajı seslendir",stopSpeaking:"Seslendirmeyi durdur",showMore:"Daha fazla göster",showLess:"Daha az göster",thinking:"Düşünüyor",systemMessagePlaceholder:"Sistem mesajınızı girin...",fullSizeImage:"Tam boyut görsel",startConversation:"Bir konuşma başlatın",startConversationDescription:"Yapay zeka asistanınızla sohbet etmeye başlamak için bir mesaj gönderin. Soru sorun, kod konusunda yardım alın veya doğal bir konuşma yapın.",scrollToBottom:"En alta kaydır",newMessages:"Yeni mesajlar"},sk={title:"Görsel Galerisi",noImages:"Henüz görsel yok",noImagesHint:"Sağdaki paneli kullanarak ilk görselinizi oluşturun",delete:"Sil",download:"İndir",deleteConfirm:"Bu görseli silmek istediğinizden emin misiniz?",deleteSuccess:"Görsel silindi",deleteFailed:"Görsel silinemedi",downloadFailed:"Görsel indirilemedi",loadMore:"Daha Fazla Yükle ({{current}}/{{total}})",loadFailed:"Galeri yüklenemedi"},lk={title:"Görsel Oluştur",prompt:"Komut",promptPlaceholder:"Oluşturmak istediğiniz görseli tanımlayın...",model:"Model",selectModel:"Model seçin",noModels:"Görsel üretim modeli mevcut değil",configurePlugin:"Görsel üretim destekli bir eklenti yapılandırın",size:"Boyut",quality:"Kalite",style:"Stil",generate:"Oluştur",generating:"Oluşturuluyor...",success:"Görsel başarıyla oluşturuldu",failed:"Görsel oluşturulamadı",enterPrompt:"Lütfen bir komut girin"},dk={title:"Bir şeyler yanlış gitti",description:"Beklenmedik bir hatayla karşılaştık. Lütfen sayfayı yenilemeyi deneyin.",tryAgain:"Sayfayı Yenile",goHome:"Ana Sayfaya Git",errorDetails:"Hata Detayları (Geliştirme)"},ck={title:"Belgeler",upload:"Belge Yükle",uploading:"Yükleniyor...",noDocuments:"Yüklü belge yok",uploadHint:"Konuşmalarınızda kullanmak için belge yükleyin",delete:"Sil",deleteConfirm:"Bu belgeyi silmek istediğinizden emin misiniz?",deleteSuccess:"Belge silindi",deleteFailed:"Belge silinemedi",uploadSuccess:"Belge başarıyla yüklendi",uploadFailed:"Belge yüklenemedi",types:"Desteklenen: PDF, TXT, MD, DOCX",unsupportedFileType:"Yalnızca PDF ve TXT dosyaları desteklenir",fileSizeTooLarge:"Dosya boyutu 10MB'dan küçük olmalıdır",uploadSuccessWithName:'"{{name}}" belgesi başarıyla yüklendi',removeSuccess:"Belge başarıyla kaldırıldı",removeFailed:"Belge kaldırılamadı",removeError:"Belge kaldırılırken bir hata oluştu",clickToUpload:"Yüklemek için tıklayın",orDragAndDrop:"veya sürükleyip bırakın",fileTypesAndSize:"10MB'a kadar PDF veya TXT dosyaları",uploadedDocuments:"Yüklenen Belgeler",removeDocument:"Belgeyi kaldır"},uk={speak:"Seslendir",stop:"Durdur",speaking:"Seslendiriliyor...",generateFailed:"Konuşma oluşturulamadı",playbackFailed:"Ses oynatma başarısız",stopSpeaking:"Seslendirmeyi durdur",generatingSpeech:"Konuşma oluşturuluyor...",readAloud:"Sesli oku"},mk={title:"Yapıtlar",code:"Kod",preview:"Önizleme",copy:"Kodu kopyala",copied:"Kopyalandı!",download:"İndir",expand:"Genişlet",collapse:"Daralt",openInNewTab:"Yeni sekmede aç",invalidSvg:"Geçersiz SVG içeriği",invalidJson:"Geçersiz JSON içeriği",previewMode:"Önizleme modu",codeMode:"Kod modu",copyContent:"İçeriği kopyala",openInPanel:"Panelde aç",openInNewWindow:"Yeni pencerede aç",created:"Oluşturulma",closePanelEsc:"Paneli kapat (Esc)",copyButton:"Kopyala",open:"Aç",dragEdgeToResize:"Yeniden boyutlandırmak için kenarı sürükleyin"},pk={title:"Personaları İçe ve Dışa Aktar",description:"Personalarınızı paylaşmak için dışa aktarın veya başkalarından persona içe aktarın",exportPersonas:"Personaları Dışa Aktar",importPersonas:"Personaları İçe Aktar",noPersonasToExport:"Dışa aktarılacak persona yok",personasAvailable:"{{count}} persona mevcut",personasAvailable_plural:"{{count}} persona mevcut",exportAll:"Tümünü Dışa Aktar",uploadJsonFile:"JSON Dosyası Yükle",pasteJsonLabel:"JSON Verisi Yapıştır",pasteJsonPlaceholder:"Persona JSON verisini buraya yapıştırın...",importing:"İçe aktarılıyor...",importButton:"Persona(ları) İçe Aktar",expectedFormat:"Beklenen JSON Formatı:",exportSuccess:'"{{name}}" personası başarıyla dışa aktarıldı',exportFailed:"Persona dışa aktarılamadı",exportAllSuccess:"Tüm {{count}} persona başarıyla dışa aktarıldı",exportAllFailed:"Personalar dışa aktarılamadı",pasteJsonData:"Lütfen persona JSON verisini yapıştırın",importMultipleSuccess:"{{count}} persona başarıyla içe aktarıldı",importMultipleFailed:"{{count}} persona içe aktarılamadı",importNoneFailed:"Hiçbir persona içe aktarılamadı",importSuccess:"Persona başarıyla içe aktarıldı",importFailed:"Persona içe aktarılamadı"},gk={common:Rb,brand:Ub,auth:$b,setup:Vb,chat:Wb,sidebar:qb,user:Jb,settings:_b,models:Yb,personas:Zb,gallery:Xb,errors:Qb,keyboard:ek,modelManager:ak,personaManager:tk,personaForm:nk,personaCard:rk,userManager:ik,chatMessage:ok,imageGallery:sk,imageGeneration:lk,errorBoundary:dk,documents:ck,ttsButton:uk,artifacts:mk,personaImportExport:pk},hk={loading:"Завантаження...",save:"Зберегти",saving:"Збереження...",cancel:"Скасувати",delete:"Видалити",edit:"Редагувати",close:"Закрити",back:"Назад",next:"Далі",confirm:"Підтвердити",error:"Помилка",success:"Успіх",warning:"Попередження",or:"або",optional:"необов'язково",enabled:"Увімкнено",disabled:"Вимкнено",on:"Увімк.",off:"Вимк.",yes:"Так",no:"Ні",search:"Пошук",noResults:"Результатів не знайдено",retry:"Повторити",refresh:"Оновити",download:"Завантажити",upload:"Вивантажити",export:"Експорт",import:"Імпорт",reset:"Скинути",apply:"Застосувати",clear:"Очистити",all:"Усі",none:"Жодного",default:"За замовчуванням",custom:"Власний",mode:"Режим",multiUser:"Багатокористувацький",remove:"Видалити"},bk={name:"Libre WebUI",shortName:"Libre"},kk={login:{title:"З поверненням",subtitle:"Увійдіть до свого облікового запису, щоб продовжити",username:"Ім'я користувача",usernamePlaceholder:"Введіть ім'я користувача",password:"Пароль",passwordPlaceholder:"Введіть пароль",signIn:"Увійти",signingIn:"Вхід...",noAccount:"Немає облікового запису?",signUpHere:"Зареєструйтеся тут",loginSuccess:"Вхід успішний!",loginFailed:"Помилка входу",checkCredentials:"Помилка входу. Перевірте свої облікові дані.",enterBoth:"Введіть ім'я користувача та пароль",githubSuccess:"Вхід через GitHub успішний!",githubFailed:"Помилка автентифікації GitHub",githubVerifyFailed:"Не вдалося перевірити автентифікацію GitHub"},signup:{title:"Створити обліковий запис",subtitle:"Зареєструйте новий обліковий запис",username:"Ім'я користувача",usernamePlaceholder:"Виберіть ім'я користувача",email:"Електронна пошта",emailPlaceholder:"ваша@пошта.com",password:"Пароль",passwordPlaceholder:"Виберіть пароль",confirmPassword:"Підтвердіть пароль",confirmPasswordPlaceholder:"Підтвердіть пароль",createAccount:"Створити обліковий запис",creatingAccount:"Створення облікового запису...",hasAccount:"Вже є обліковий запис?",signInHere:"Увійдіть тут",signupSuccess:"Обліковий запис успішно створено!",signupFailed:"Помилка реєстрації",tryAgain:"Помилка реєстрації. Спробуйте ще раз.",usernameRequired:"Ім'я користувача та пароль обов'язкові",passwordMismatch:"Паролі не збігаються",passwordTooShort:"Пароль має містити щонайменше 6 символів"},logout:{button:"Вийти",success:"Ви успішно вийшли"},oauth:{continueWith:"Продовжити з {{provider}}",connectingTo:"Підключення до {{provider}}...",github:"GitHub",huggingFace:"Hugging Face"}},fk={welcome:{title:"Ласкаво просимо до Libre WebUI",subtitle:"Почнімо",description:"Налаштуйте Libre WebUI за кілька простих кроків",createAdmin:"Створити обліковий запис адміністратора",features:{secure:{title:"Безпечний і приватний",description:"Ваші розмови залишаються на вашому пристрої"},fast:{title:"Швидкий і чутливий",description:"Оптимізовано для швидкості та продуктивності"},openSource:{title:"Відкритий код",description:"Безкоштовне програмне забезпечення з відкритим кодом"}}},admin:{title:"Створити обліковий запис адміністратора",subtitle:"Налаштування адміністратора",description:"Створіть перший обліковий запис адміністратора для вашого екземпляра Libre WebUI",usernamePlaceholder:"Введіть ім'я адміністратора",passwordPlaceholder:"Введіть пароль (мін. 6 символів)",confirmPlaceholder:"Підтвердіть пароль",creating:"Створення...",createAdmin:"Створити адміністратора",success:"Обліковий запис адміністратора успішно створено!",failed:"Не вдалося створити обліковий запис адміністратора",fillAllFields:"Заповніть усі поля",note:"Це буде основний обліковий запис адміністратора для вашого екземпляра Libre WebUI"},encryptionKey:{title:"Збережіть ключ шифрування",subtitle:"Важливо: збережіть цей ключ",description:"Цей ключ шифрування захищає ваші конфіденційні дані. Зберігайте його надійно - він знадобиться для відновлення бази даних.",warning:"Попередження",warningText:"Якщо ви втратите цей ключ і вам потрібно буде відновити базу даних, ваші зашифровані дані (API-ключі, налаштування) будуть безповоротно втрачені.",label:"Ваш ключ шифрування",loading:"Завантаження...",copyToClipboard:"Копіювати в буфер обміну",copied:"Ключ шифрування скопійовано!",copyFailed:"Не вдалося скопіювати ключ",envNote:"Цей ключ також збережено у файлі backend/.env як ENCRYPTION_KEY",acknowledgment:"Я зберіг ключ шифрування в надійному місці та розумію, що його втрата може призвести до втрати даних.",confirmRequired:"Підтвердіть, що ви зберегли ключ шифрування",continue:"Продовжити до Libre WebUI"}},yk={greeting:{morning:"Доброго ранку",afternoon:"Доброго дня",evening:"Доброго вечора",night:"Доброї ночі"},welcome:{helpToday:"Чим можу допомогти сьогодні?",helpTonight:"Чим можу допомогти сьогодні ввечері?"},input:{placeholder:"Надіслати повідомлення",messagePlaceholder:"Повідомлення...",attachImages:"Прикріпити зображення",attachments:"Вкладення та розширені функції",sendMessage:"Надіслати повідомлення",stopGeneration:"Зупинити генерацію"},session:{new:"Новий чат",private:"Приватний",privateMode:"Приватний режим",privateDescription:"Ця розмова не буде збережена",privateTooltip:"Почати приватну розмову, яка не буде збережена",deleteConfirm:"Ви впевнені, що хочете видалити цей чат?",generatingTitle:"Генерація заголовка",noChats:"Чатів ще немає",createFirst:"Створіть свій перший чат вище",chats:"Чати",renameChat:"Перейменувати чат",deleteChat:"Видалити чат"},persona:{applied:"Персону застосовано",label:"Персона"},model:{updated:"Модель оновлено",noModels:"Моделі недоступні",noModelsDescription:"Моделі недоступні. Переконайтеся, що Ollama працює та моделі встановлені.",pullCommand:"ollama pull llama3.2:3b",noModelsTooltip:"Моделі недоступні. Переконайтеся, що Ollama працює та моделі встановлені."},footer:{disclaimer:"LLM може помилятися - перевіряйте важливу інформацію",images:"{{count}} зображення",images_plural:"{{count}} зображень",structuredOutput:"Структурований вивід"},mediaUpload:{dropImagesHere:"Перетягніть зображення сюди або",supportedFormats:"Підтримується: JPG, PNG, GIF, WebP (макс. 10 МБ кожне)",browse:"оберіть"},structuredOutput:{title:"Формат відповіді",none:"Без формату (природна мова)",noneDescription:"Стандартна відповідь природною мовою",json:"JSON",jsonDescription:"Структурований формат JSON",list:"Список",listDescription:"Масив елементів",summary:"Підсумок",summaryDescription:"Підсумок документа з ключовими пунктами",analysis:"Аналіз",analysisDescription:"Структурований аналіз з перевагами/недоліками",custom:"Власна схема",customDescription:"Визначте власну JSON-схему",customSchema:"Власна JSON-схема",schemaPreview:"Попередній перегляд схеми",applySchema:"Застосувати схему",cancel:"Скасувати",enabled:"Структурований вивід увімкнено"}},vk={navigation:{chat:"Чат",models:"Моделі",personas:"Персони",imagine:"Генерація",settings:"Налаштування",userManagement:"Керування користувачами",signOut:"Вийти"},toggleSize:"Змінити розмір бічної панелі",expandSidebar:"Розгорнути бічну панель"},xk={menu:{changePicture:"Змінити зображення",settings:"Налаштування",userManagement:"Керування користувачами",logout:"Вийти"},avatar:{title:"Змінити фото профілю",updated:"Фото профілю оновлено",updateFailed:"Не вдалося оновити фото профілю",saving:"Збереження..."},profile:{noEmail:"Електронна пошта не вказана"}},Sk={title:"Налаштування",tabs:{appearance:"Зовнішній вигляд",model:"Модель",systemMessage:"Системне повідомлення",plugins:"Плагіни",generation:"Генерація",documents:"Документи",tts:"Текст у мовлення",imageGen:"Генерація зображень",system:"Система",data:"Дані",about:"Про програму"},appearance:{title:"Зовнішній вигляд",language:{title:"Мова",description:"Виберіть бажану мову"},theme:{title:"Тема",light:"Світла",dark:"Темна",amoled:"AMOLED",system:"Системна"},chatInterface:{title:"Інтерфейс чату",showUsername:"Показувати ім'я користувача",showUsernameDescription:"Відображати ім'я користувача в повідомленнях чату"},background:{title:"Фонове зображення",enable:"Увімкнути фонове зображення",enableDescription:"Показувати власний фон з ефектом розмиття",blur:"Розмиття",opacity:"Прозорість",upload:"Завантажити фонове зображення",dragDrop:"Перетягніть зображення або клацніть для вибору",chooseImage:"Вибрати зображення"}},system:{title:"Система",currentModel:"Поточна модель",notSet:"Не встановлено"},saveSettings:"Зберегти налаштування",model:{title:"Налаштування моделі",defaultModel:"Модель за замовчуванням",defaultModelDescription:"Ця модель буде використовуватися за замовчуванням для нових розмов",selectModel:"Виберіть модель",updateAll:"Оновити всі моделі",updateAllDescription:"Перевірити оновлення та завантажити останні версії всіх встановлених моделей",updateAllButton:"Оновити всі",updating:"Оновлення моделей...",currentModelInfo:"Інформація про поточну модель",name:"Назва",size:"Розмір",family:"Сімейство",format:"Формат",status:"Статус",statusStarting:"Запуск...",statusComplete:"Завершено",statusError:"Помилка",bulkOperations:"Масові операції",autoTitle:{title:"Автоматична генерація заголовків",enable:"Увімкнути автозаголовки",enableDescription:"Автоматично генерувати заголовки для нових розмов",taskModel:"Модель для завдань",selectTaskModel:"Виберіть модель для завдань",taskModelDescription:"Модель, що використовується для генерації заголовків розмов"}},systemMessage:{title:"Системне повідомлення",description:"Встановіть власне системне повідомлення, яке буде використовуватися для всіх нових розмов.",placeholder:"Введіть системне повідомлення...",saved:"Системне повідомлення збережено",saveFailed:"Не вдалося зберегти системне повідомлення"},plugins:{title:"Плагіни",description:"Керуйте встановленими плагінами",addNew:"Додати новий плагін",upload:"Завантажити плагін",addJson:"Додати JSON",uploading:"Завантаження...",jsonPlaceholder:"Вставте JSON-конфігурацію плагіна...",install:"Встановити плагін",noPlugins:"Плагіни не встановлено",noPluginsDescription:"Додайте плагін для розширення функціональності",loading:"Завантаження плагінів...",installed:"Встановлені плагіни",active:"Активні плагіни",activeLabel:"Активний",inactive:"Неактивний",activate:"Активувати",deactivate:"Деактивувати",models:"моделей",apiKeySet:"API-ключ встановлено",apiKeyConfiguration:"Налаштування API-ключа",apiKeyEnvAlternative:"Або встановіть",environmentVariable:"змінну середовища",apiKeyConfigured:"API-ключ налаштовано",apiKeyPlaceholder:"Введіть API-ключ...",saveApiKey:"Зберегти API-ключ",apiKey:{title:"API-ключ",placeholder:"Введіть API-ключ",save:"Зберегти ключ",remove:"Видалити ключ",configured:"API-ключ налаштовано",notConfigured:"Потрібен API-ключ",saved:"API-ключ успішно збережено",removed:"API-ключ видалено",saveFailed:"Не вдалося зберегти API-ключ",removeFailed:"Не вдалося видалити API-ключ",enterKey:"Введіть API-ключ"}},generation:{title:"Параметри генерації",description:"Налаштуйте, як AI генерує відповіді",coreParameters:"Основні параметри",temperature:"Температура",temperatureDescription:"Контролює випадковість. Нижчі значення більш зосереджені, вищі — більш креативні.",topP:"Top P",topPDescription:"Контролює різноманітність через nucleus sampling. Нижчі значення фокусуються на ймовірних токенах.",topK:"Top K",topKDescription:"Обмежує вибір токенів до K найімовірніших. Встановіть 0 для вимкнення.",minP:"Min P",minPDescription:"Мінімальний поріг ймовірності для вибору токенів.",generationControl:"Контроль генерації",maxTokens:"Макс. токенів",maxTokensDescription:"Максимальна кількість токенів для генерації у відповіді.",repeatPenalty:"Штраф за повторення",repeatPenaltyDescription:"Штрафує повторювані токени. Вищі значення зменшують повторення.",contextLength:"Довжина контексту",contextLengthDescription:"Максимальний розмір контекстного вікна для розмов.",seed:"Seed",optional:"необов'язково",random:"Випадковий",seedDescription:"Встановіть конкретний seed для відтворюваних результатів.",advancedOptions:"Розширені параметри",presencePenalty:"Штраф за присутність",presencePenaltyDescription:"Штрафує токени, що з'являються в контексті.",frequencyPenalty:"Штраф за частоту",frequencyPenaltyDescription:"Штрафує часто використовувані токени.",stopSequences:"Стоп-послідовності",commaSeparated:"через кому",stopSequencesDescription:"Власні токени, які зупинять генерацію при зустрічі.",resetDefaults:"Скинути до стандартних",saveOptions:"Зберегти параметри",embeddingSettings:"Налаштування ембедингів",enableEmbeddings:"Увімкнути ембединги документів"},documents:{title:"Налаштування документів",embeddings:{title:"Ембединги",enable:"Увімкнути ембединги документів",model:"Модель ембедингів",modelDescription:"Виберіть модель для ембедингу документів",chunkSize:"Розмір частини",chunkSizeInTokens:"(у токенах)",chunkSizeDescription:"Розмір текстових частин для ембедингу",chunkOverlap:"Перекриття частин",chunkOverlapInTokens:"(у токенах)",chunkOverlapDescription:"Перекриття між послідовними частинами",similarityThreshold:"Поріг схожості",similarityDescription:"Мінімальний бал схожості для включення результатів",status:"Статус ембедингів",statusLabel:"Статус",available:"Доступно",unavailable:"Недоступно",chunksWithEmbeddings:"Частини з ембедингами",coverage:"Покриття",regenerate:"Перегенерувати ембединги",regenerating:"Перегенерація..."}},tts:{title:"Текст у мовлення",description:"Налаштуйте параметри синтезу мовлення для озвучення повідомлень",loadingProviders:"Завантаження провайдерів TTS...",noProviders:"Немає провайдерів TTS",noProvidersDescription:"Налаштуйте плагін з підтримкою TTS, щоб увімкнути синтез мовлення",enable:"Увімкнути TTS",enableDescription:"Дозволити синтез мовлення для повідомлень асистента",autoPlay:"Автовідтворення відповідей",autoPlayDescription:"Автоматично озвучувати нові повідомлення асистента",voiceConfiguration:"Налаштування голосу",model:"Модель TTS",modelDescription:"Виберіть модель для синтезу мовлення",voice:"Голос",selectVoice:"Виберіть голос",voiceDescription:"Виберіть голос для синтезу мовлення",speed:"Швидкість",speedSlow:"0.5x",speedNormal:"1.0x",speedFast:"2.0x",availableProviders:"Доступні провайдери",models:"моделей",test:"Тест",testing:"Тестування...",stop:"Зупинити"},imageGen:{title:"Генерація зображень",description:"Налаштуйте параметри та провайдерів генерації зображень",loadingProviders:"Завантаження провайдерів генерації зображень...",noProviders:"Немає провайдерів генерації зображень",noProvidersDescription:"Налаштуйте плагін з підтримкою генерації зображень",enable:"Увімкнути генерацію зображень",enableDescription:"Дозволити AI-генерацію зображень у розмовах",configuration:"Налаштування",model:"Модель",modelDescription:"Виберіть модель для генерації зображень",size:"Розмір",sizeDescription:"Роздільна здатність згенерованих зображень",quality:"Якість",qualityDescription:"Рівень якості згенерованих зображень",style:"Стиль",styleDescription:"Пресет стилю для згенерованих зображень",availableProviders:"Доступні провайдери",models:"моделей"},data:{title:"Керування даними",export:"Експорт даних",exportDescription:"Завантажте всі ваші дані, включаючи налаштування, сесії та документи.",exportAll:"Експортувати всі дані",import:"Імпорт даних",importDescription:"Імпортуйте дані з попереднього експорту.",importData:"Імпортувати дані",importing:"Імпорт...",clearSessions:"Очистити сесії",clearSessionsDescription:"Видалити всі сесії чату. Цю дію неможливо скасувати.",clearAll:"Очистити все",clearing:"Очищення...",importOptions:"Параметри імпорту",importOptionsDescription:"Виберіть, як обробляти існуючі дані",skipDuplicates:"Пропустити дублікати",overwrite:"Перезаписати існуючі",importResults:"Результати імпорту",preferences:"Налаштування",imported:"Імпортовано",failed:"Помилка",sessions:"Сесії",importedLabel:"імпортовано",skipped:"пропущено",documents:"Документи",errors:"Помилки"},about:{title:"Про програму",versionLabel:"Версія",ollama:{title:"Статус Ollama",version:"Версія",healthy:"Працює",unhealthy:"Не працює"},stats:{models:"Моделі",sessions:"Сесії"},features:{privacy:{title:"Приватність перш за все",description:"Ваші дані залишаються на вашому пристрої"},openSource:{title:"Відкритий код",description:"Безкоштовне програмне забезпечення з відкритим кодом"},localInference:{title:"Локальний інференс",description:"Запускайте AI-моделі локально з Ollama"}},openSourceBy:"Відкритий код від {{company}}",links:{title:"Посилання",github:"GitHub",githubDescription:"Переглянути вихідний код та зробити внесок",website:"Веб-сайт",websiteDescription:"Відвідайте наш веб-сайт",ollama:"Ollama",ollamaDescription:"Дізнайтеся більше про Ollama",documentation:"Документація",reportIssue:"Повідомити про проблему",reportIssueDescription:"Звіти про помилки та запити функцій"},version:"Версія {{version}}"}},wk={title:"Моделі",subtitle:"Завантажуйте, керуйте та моніторте ваші моделі Ollama",installed:"Встановлені моделі",available:"Доступні моделі",pull:"Завантажити модель",pulling:"Завантаження...",delete:"Видалити модель",deleting:"Видалення...",size:"Розмір",modified:"Змінено",family:"Сімейство",parameters:"Параметри",quantization:"Квантизація",noModels:"Моделі не встановлено",pullFirst:"Завантажте модель, щоб почати"},Pk={title:"Персони",create:"Створити персону",edit:"Редагувати персону",delete:"Видалити персону",name:"Назва",description:"Опис",systemPrompt:"Системний промпт",model:"Модель",avatar:"Аватар",background:"Фон",noPersonas:"Персони не створено",createFirst:"Створіть свою першу персону, щоб налаштувати досвід чату"},Mk={title:"Галерея",subtitle:"Ваша галерея зображень, згенерованих AI",imageCount:"{{count}} зображень",generate:"Згенерувати зображення",generateDescription:"Створюйте зображення за допомогою AI",generating:"Генерація...",prompt:"Промпт",promptPlaceholder:"Опишіть зображення, яке хочете згенерувати...",noImages:"Зображення ще не згенеровано",download:"Завантажити",delete:"Видалити",regenerate:"Перегенерувати",model:"Модель",size:"Розмір",quality:"Якість",created:"Створено"},Dk={generic:"Сталася помилка",network:"Помилка мережі. Перевірте підключення.",unauthorized:"У вас немає дозволу на виконання цієї дії.",notFound:"Запитуваний ресурс не знайдено.",serverError:"Помилка сервера. Спробуйте пізніше.",validation:"Перевірте введені дані та спробуйте ще раз."},jk={title:"Гарячі клавіші",toggleSidebar:"Перемкнути бічну панель",openSettings:"Відкрити налаштування",toggleDarkMode:"Перемкнути темний режим",showShortcuts:"Показати гарячі клавіші",closeModals:"Закрити модальні вікна",groups:{navigation:"Навігація",settings:"Налаштування",general:"Загальні",chat:"Чат"},actions:{sendMessage:"Надіслати повідомлення",newLine:"Новий рядок у повідомленні"},footer:"Натисніть {{key1}} або {{key2}}, щоб показати цю довідку",tooltip:"Гарячі клавіші"},Ak={title:"Моделі",loading:"Завантаження моделей...",systemStatus:{online:"Ollama онлайн",offline:"Ollama офлайн",models:"модель",models_plural:"моделей",running:"працює",vram:"VRAM"},sections:{pull:"Завантажити нову модель",library:"Переглянути бібліотеку",running:"Запущені моделі",local:"Локальні моделі",advanced:"Розширені дії"},pull:{placeholder:"Введіть назву моделі (напр., llama3.2:3b, deepseek-r1:14b)",button:"Завантажити",cancel:"Скасувати",popular:"Популярні моделі:",browseAll:"Переглянути всі моделі на ollama.com",success:"Модель {{name}} успішно завантажено",cancelled:"Завантаження моделі скасовано",failed:"Не вдалося завантажити модель",enterName:"Введіть назву моделі"},progress:{starting:"Ініціалізація...",pulling:"Завантаження моделі...",verifying:"Перевірка цілісності...",writing:"Запис маніфесту...",cleaning:"Очищення..."},library:{available:"доступно",search:"Пошук моделей...",noResults:"Моделі, що відповідають критеріям, не знайдено",installed:"Встановлено",more:"+{{count}} ще",refresh:"Оновити бібліотеку"},local:{noModels:"Моделі ще не встановлено",pullToStart:"Завантажте модель вище, щоб почати",installed:"встановлено",running:"Працює",info:"Інфо",copy:"Копіювати",delete:"Видалити",deleteConfirm:'Ви впевнені, що хочете видалити модель "{{name}}"?',deleteSuccess:"Модель {{name}} успішно видалено",deleteFailed:"Не вдалося видалити модель"},advanced:{createModel:"Створити модель",fromModelfile:"З Modelfile",copyModel:"Копіювати модель",duplicateExisting:"Дублювати існуючу",testEmbeddings:"Тестувати ембединги",generateVectors:"Генерувати вектори",healthCheck:"Перевірка справності",testConnection:"Тест підключення",healthy:"Ollama справний!"},modals:{details:{title:"Деталі моделі",info:"Інформація про модель",family:"Сімейство",parameters:"Параметри",quantization:"Квантизація",format:"Формат",systemPrompt:"Системний промпт",template:"Шаблон",license:"Ліцензія",modelfile:"Modelfile",noDetails:"Деталі недоступні"},copy:{title:"Копіювати модель",source:"Вихідна модель",selectModel:"Виберіть модель...",newName:"Нова назва моделі",placeholder:"напр., my-custom-model",copying:"Копіювання...",button:"Копіювати модель",success:"Модель скопійовано як {{name}}",failed:"Не вдалося скопіювати модель",enterBoth:"Введіть назву вихідної та цільової моделі"},create:{title:"Створити власну модель",name:"Назва моделі",namePlaceholder:"напр., my-assistant",modelfile:"Modelfile",modelfilePlaceholder:`FROM llama3.2
25
25
  SYSTEM You are a helpful assistant.`,docs:"Документація Modelfile",docsLink:"для довідки з синтаксису",creating:"Створення...",button:"Створити модель",success:"Модель {{name}} успішно створено",failed:"Не вдалося створити модель",enterBoth:"Введіть назву моделі та вміст Modelfile"},embeddings:{title:"Тестувати ембединги",model:"Модель ембедингів",selectModel:"Виберіть модель...",recommended:"Рекомендовано: nomic-embed-text, mxbai-embed-large",input:"Вхідний текст",placeholder:"Введіть текст для генерації ембедингів...",generating:"Генерація...",button:"Згенерувати ембединги",result:"Результат ({{count}} вимірів)",success:"Згенеровано {{count}}-вимірний вектор ембедингу",failed:"Не вдалося згенерувати ембединги",enterBoth:"Виберіть модель та введіть текст"}}},zk={title:"Персони",subtitle:"Створюйте та керуйте AI-персонами з унікальними особистостями, пам'яттю та поведінкою",loading:"Завантаження персон...",createButton:"Створити персону",importExport:"Імпорт/Експорт",stats:{title:"Ваші персони",count:"{{count}} персона створена",count_plural:"{{count}} персон створено"},empty:{title:"Персон ще немає",description:"Створіть свою першу персону, щоб почати персоналізовану взаємодію з AI",button:"Створити першу персону"},deleteConfirm:'Ви впевнені, що хочете видалити "{{name}}"?',deleteSuccess:'Персону "{{name}}" успішно видалено',downloadSuccess:'Персону "{{name}}" успішно завантажено',failed:"Не вдалося {{action}} персону"},Nk={title:{create:"Створити нову персону",edit:"Редагувати персону"},subtitle:{create:"Створіть нову AI-персону з унікальною особистістю, системою пам'яті та адаптивним навчанням",edit:"Налаштуйте вашу AI-персону з розширеною пам'яттю, адаптивним навчанням та інтелектуальними параметрами"},loading:"Завантаження форми...",saved:"Збережено",tabs:{basic:"Основне",parameters:"Параметри",memory:"Пам'ять і навчання",advanced:"Розширене"},basic:{name:"Назва",namePlaceholder:"Введіть назву персони",model:"Модель",selectModel:"Виберіть модель",description:"Опис",descriptionPlaceholder:"Опишіть вашу персону...",systemPrompt:"Системний промпт",systemPromptPlaceholder:"Введіть системний промпт, який визначає поведінку персони...",systemPromptHint:"Системний промпт визначає, як ваша персона буде поводитися та відповідати."},parameters:{temperature:"Температура",temperatureHint:"Контролює креативність vs послідовність",topP:"Top-P",topPHint:"Контролює різноманітність відповідей",topK:"Top-K",topKHint:"Обмежує словник до top-k токенів",contextWindow:"Контекстне вікно",contextWindowHint:"Максимальна довжина історії розмови",maxTokens:"Макс. токенів",maxTokensHint:"Максимальна довжина відповіді",repeatPenalty:"Штраф за повторення",repeatPenaltyHint:"Зменшує повторювані відповіді"},memory:{title:"Система пам'яті",subtitle:"Персона запам'ятовує розмови з часом",enableHint:"Увімкніть систему пам'яті, щоб ваша персона запам'ятовувала розмови та будувала контекст з часом.",loading:"Завантаження статусу пам'яті...",noData:"Даних пам'яті ще немає",memories:"Спогади",mbUsed:"МБ використано",lastBackup:"Останній бекап",never:"Ніколи",maxMemories:"Максимум спогадів",maxMemoriesHint:"Скільки спогадів може зберігати персона",retention:"Збереження пам'яті",retentionHint:"Днів зберігання спогадів до очищення",autoCleanup:"Автоочищення старих спогадів",wipeAll:"Очистити всі спогади",wipeCannot:"Цю дію неможливо скасувати",wipeButton:"Очистити",wiping:"Очищення...",wipeConfirm:"Ви впевнені, що хочете очистити всі спогади? Цю дію неможливо скасувати.",wipeSuccess:"Очищено {{count}} спогадів"},learning:{title:"Адаптивне навчання",subtitle:"Персона еволюціонує на основі взаємодій",enableHint:"Увімкніть адаптивне навчання, щоб персона еволюціонувала та персоналізувала відповіді на основі ваших взаємодій.",speed:"Швидкість навчання",slow:"Повільна",slowDesc:"Поступові зміни",balanced:"Збалансована",balancedDesc:"Помірний темп",fast:"Швидка",fastDesc:"Швидка адаптація",autoAdapt:"Автоадаптація до вподобань користувача",whatLearns:"Що вивчає персона:",conversationTone:"Тон розмови",responseStyle:"Стиль відповідей",userPreferences:"Вподобання користувача",topicInterests:"Інтереси щодо тем"},advanced:{embeddingModel:"Модель ембедингів",embeddingHint:"Виберіть модель для кодування пам'яті та семантичного пошуку. Моделі ембедингів показані першими, потім інші доступні моделі.",noModels:"Моделі не знайдено",embeddingModels:"Моделі ембедингів",otherModels:"Інші моделі",installHint:"Встановіть модель ембедингів:",recommended:"Рекомендовано: nomic-embed-text, mxbai-embed-large, bge-m3, snowflake-arctic-embed",aboutTitle:"Про розширені налаштування",aboutDescription:"Модель ембедингів використовується системою пам'яті для розуміння семантичного значення та пошуку релевантних спогадів під час розмов. Виберіть модель, що відповідає вашому випадку використання та доступним ресурсам."},actions:{cancel:"Скасувати",save:"Зберегти",saving:"Збереження...",saveClose:"Зберегти і закрити",create:"Створити"},success:{created:"Персону створено",updated:"Персону оновлено"},error:{saveFailed:"Не вдалося зберегти"}},Tk={enhanced:"Покращена",systemPrompt:"Системний промпт",memories:"спогадів",use:"Використати",editTooltip:"Редагувати персону",downloadTooltip:"Завантажити персону",backup:"Бекап",exportDNA:"Експорт ДНК",wipeMemories:"Очистити спогади",wipeConfirm:"Ви впевнені, що хочете очистити всі спогади цієї персони? Цю дію неможливо скасувати.",wipeSuccess:"Очищено {{count}} спогадів",backupSuccess:"Бекап персони успішно завантажено",dnaSuccess:"ДНК персони успішно експортовано",failed:"Не вдалося {{action}}"},Ik={title:"Керування користувачами",subtitle:"Керуйте обліковими записами та дозволами користувачів",loading:"Завантаження користувачів...",createUser:"Створити користувача",search:"Пошук користувачів...",noUsers:"Користувачів не знайдено",noUsersMatching:"Користувачів, що відповідають пошуку, не знайдено",columns:{user:"Користувач",email:"Електронна пошта",role:"Роль",created:"Створено",actions:"Дії"},roles:{admin:"Адміністратор",user:"Користувач"},noEmail:"Пошта не вказана",deleteConfirm:'Ви впевнені, що хочете видалити користувача "{{name}}"?',deleteSuccess:"Користувача успішно видалено",deleteFailed:"Не вдалося видалити користувача",cannotDeleteSelf:"Ви не можете видалити власний обліковий запис",form:{title:{create:"Створити користувача",edit:"Редагувати користувача"},username:"Ім'я користувача",usernamePlaceholder:"Введіть ім'я користувача",email:"Електронна пошта",emailPlaceholder:"Введіть пошту (необов'язково)",password:"Пароль",passwordPlaceholder:"Введіть пароль",passwordHint:"Залиште порожнім, щоб зберегти поточний пароль",role:"Роль",creating:"Створення...",updating:"Оновлення...",createButton:"Створити користувача",updateButton:"Оновити користувача",createSuccess:"Користувача успішно створено",updateSuccess:"Користувача успішно оновлено",createFailed:"Не вдалося створити користувача",updateFailed:"Не вдалося оновити користувача"}},Ck={you:"Ви",assistant:"Асистент",system:"Система",copy:"Копіювати",copyMessage:"Копіювати повідомлення",copied:"Скопійовано!",regenerate:"Перегенерувати",regenerateResponse:"Перегенерувати відповідь",edit:"Редагувати",editSystemMessage:"Редагувати системне повідомлення",saveChanges:"Зберегти зміни",cancelEditing:"Скасувати редагування",delete:"Видалити",deleteConfirm:"Видалити це повідомлення?",branch:"Гілка",speaking:"Озвучення...",speakMessage:"Озвучити повідомлення",stopSpeaking:"Зупинити озвучення",showMore:"Показати більше",showLess:"Показати менше",thinking:"Обмірковує",systemMessagePlaceholder:"Введіть системне повідомлення...",fullSizeImage:"Повнорозмірне зображення",startConversation:"Почати розмову",startConversationDescription:"Надішліть повідомлення, щоб почати спілкування з AI-асистентом. Ставте запитання, отримуйте допомогу з кодом або ведіть звичайну розмову.",scrollToBottom:"Прокрутити донизу",newMessages:"Нові повідомлення"},Fk={title:"Галерея зображень",noImages:"Зображень ще немає",noImagesHint:"Згенеруйте перше зображення за допомогою панелі праворуч",delete:"Видалити",download:"Завантажити",deleteConfirm:"Ви впевнені, що хочете видалити це зображення?",deleteSuccess:"Зображення видалено",deleteFailed:"Не вдалося видалити зображення",downloadFailed:"Не вдалося завантажити зображення",loadMore:"Завантажити ще ({{current}} з {{total}})",loadFailed:"Не вдалося завантажити галерею"},Ek={title:"Згенерувати зображення",prompt:"Промпт",promptPlaceholder:"Опишіть зображення, яке хочете створити...",model:"Модель",selectModel:"Виберіть модель",noModels:"Моделі генерації зображень недоступні",configurePlugin:"Налаштуйте плагін з підтримкою генерації зображень",size:"Розмір",quality:"Якість",style:"Стиль",generate:"Згенерувати",generating:"Генерація...",success:"Зображення успішно згенеровано",failed:"Не вдалося згенерувати зображення",enterPrompt:"Введіть промпт"},Ok={title:"Щось пішло не так",description:"Виникла неочікувана помилка. Спробуйте оновити сторінку.",tryAgain:"Оновити сторінку",goHome:"На головну",errorDetails:"Деталі помилки (розробка)"},Lk={title:"Документи",upload:"Завантажити документ",uploading:"Завантаження...",noDocuments:"Документи не завантажено",uploadHint:"Завантажте документи для використання в розмовах",delete:"Видалити",deleteConfirm:"Ви впевнені, що хочете видалити цей документ?",deleteSuccess:"Документ видалено",deleteFailed:"Не вдалося видалити документ",uploadSuccess:"Документ успішно завантажено",uploadFailed:"Не вдалося завантажити документ",types:"Підтримується: PDF, TXT, MD, DOCX",unsupportedFileType:"Підтримуються лише файли PDF та TXT",fileSizeTooLarge:"Розмір файлу має бути менше 10 МБ",uploadSuccessWithName:'Документ "{{name}}" успішно завантажено',removeSuccess:"Документ успішно видалено",removeFailed:"Не вдалося видалити документ",removeError:"Сталася помилка при видаленні документа",clickToUpload:"Натисніть, щоб завантажити",orDragAndDrop:"або перетягніть",fileTypesAndSize:"PDF або TXT файли до 10 МБ",uploadedDocuments:"Завантажені документи",removeDocument:"Видалити документ"},Kk={speak:"Озвучити",stop:"Зупинити",speaking:"Озвучення...",generateFailed:"Не вдалося згенерувати мовлення",playbackFailed:"Помилка відтворення аудіо",stopSpeaking:"Зупинити озвучення",generatingSpeech:"Генерація мовлення...",readAloud:"Прочитати вголос"},Bk={title:"Артефакти",code:"Код",preview:"Попередній перегляд",copy:"Копіювати код",copied:"Скопійовано!",download:"Завантажити",expand:"Розгорнути",collapse:"Згорнути",openInNewTab:"Відкрити в новій вкладці",invalidSvg:"Недійсний SVG-вміст",invalidJson:"Недійсний JSON-вміст",previewMode:"Режим перегляду",codeMode:"Режим коду",copyContent:"Копіювати вміст",openInPanel:"Відкрити в панелі",openInNewWindow:"Відкрити в новому вікні",created:"Створено",closePanelEsc:"Закрити панель (Esc)",copyButton:"Копіювати",open:"Відкрити",dragEdgeToResize:"Перетягніть край для зміни розміру"},Gk={title:"Імпорт та експорт персон",description:"Експортуйте персони, щоб поділитися ними, або імпортуйте персони інших",exportPersonas:"Експорт персон",importPersonas:"Імпорт персон",noPersonasToExport:"Немає персон для експорту",personasAvailable:"{{count}} персона доступна",personasAvailable_plural:"{{count}} персон доступно",exportAll:"Експортувати всі",uploadJsonFile:"Завантажити JSON-файл",pasteJsonLabel:"Вставити JSON-дані",pasteJsonPlaceholder:"Вставте JSON-дані персони сюди...",importing:"Імпорт...",importButton:"Імпортувати персону(и)",expectedFormat:"Очікуваний формат JSON:",exportSuccess:'Персону "{{name}}" успішно експортовано',exportFailed:"Не вдалося експортувати персону",exportAllSuccess:"Усі {{count}} персон успішно експортовано",exportAllFailed:"Не вдалося експортувати персони",pasteJsonData:"Вставте JSON-дані персони",importMultipleSuccess:"Успішно імпортовано {{count}} персон",importMultipleFailed:"Не вдалося імпортувати {{count}} персон",importNoneFailed:"Не вдалося імпортувати жодної персони",importSuccess:"Персону успішно імпортовано",importFailed:"Не вдалося імпортувати персону"},Hk={common:hk,brand:bk,auth:kk,setup:fk,chat:yk,sidebar:vk,user:xk,settings:Sk,models:wk,personas:Pk,gallery:Mk,errors:Dk,keyboard:jk,modelManager:Ak,personaManager:zk,personaForm:Nk,personaCard:Tk,userManager:Ik,chatMessage:Ck,imageGallery:Fk,imageGeneration:Ek,errorBoundary:Ok,documents:Lk,ttsButton:Kk,artifacts:Bk,personaImportExport:Gk},Rk={loading:"Đang tải...",save:"Lưu",saving:"Đang lưu...",cancel:"Hủy",delete:"Xóa",edit:"Chỉnh sửa",close:"Đóng",back:"Quay lại",next:"Tiếp theo",confirm:"Xác nhận",error:"Lỗi",success:"Thành công",warning:"Cảnh báo",or:"hoặc",optional:"tùy chọn",enabled:"Đã bật",disabled:"Đã tắt",on:"Bật",off:"Tắt",yes:"Có",no:"Không",search:"Tìm kiếm",noResults:"Không tìm thấy kết quả",retry:"Thử lại",refresh:"Làm mới",download:"Tải xuống",upload:"Tải lên",export:"Xuất",import:"Nhập",reset:"Đặt lại",apply:"Áp dụng",clear:"Xóa",all:"Tất cả",none:"Không có",default:"Mặc định",custom:"Tùy chỉnh",mode:"Chế độ",multiUser:"Nhiều người dùng",remove:"Xóa"},Uk={name:"Libre WebUI",shortName:"Libre"},$k={login:{title:"Chào mừng trở lại",subtitle:"Đăng nhập vào tài khoản của bạn để tiếp tục",username:"Tên người dùng",usernamePlaceholder:"Nhập tên người dùng",password:"Mật khẩu",passwordPlaceholder:"Nhập mật khẩu",signIn:"Đăng nhập",signingIn:"Đang đăng nhập...",noAccount:"Chưa có tài khoản?",signUpHere:"Đăng ký tại đây",loginSuccess:"Đăng nhập thành công!",loginFailed:"Đăng nhập thất bại",checkCredentials:"Đăng nhập thất bại. Vui lòng kiểm tra thông tin đăng nhập.",enterBoth:"Vui lòng nhập cả tên người dùng và mật khẩu",githubSuccess:"Đăng nhập GitHub thành công!",githubFailed:"Xác thực GitHub thất bại",githubVerifyFailed:"Không thể xác minh xác thực GitHub"},signup:{title:"Tạo tài khoản",subtitle:"Đăng ký tài khoản mới",username:"Tên người dùng",usernamePlaceholder:"Chọn tên người dùng",email:"Email",emailPlaceholder:"email@example.com",password:"Mật khẩu",passwordPlaceholder:"Chọn mật khẩu",confirmPassword:"Xác nhận mật khẩu",confirmPasswordPlaceholder:"Xác nhận mật khẩu của bạn",createAccount:"Tạo tài khoản",creatingAccount:"Đang tạo tài khoản...",hasAccount:"Đã có tài khoản?",signInHere:"Đăng nhập tại đây",signupSuccess:"Tạo tài khoản thành công!",signupFailed:"Đăng ký thất bại",tryAgain:"Đăng ký thất bại. Vui lòng thử lại.",usernameRequired:"Tên người dùng và mật khẩu là bắt buộc",passwordMismatch:"Mật khẩu không khớp",passwordTooShort:"Mật khẩu phải có ít nhất 6 ký tự"},logout:{button:"Đăng xuất",success:"Đăng xuất thành công"},oauth:{continueWith:"Tiếp tục với {{provider}}",connectingTo:"Đang kết nối đến {{provider}}...",github:"GitHub",huggingFace:"Hugging Face"}},Vk={welcome:{title:"Chào mừng đến với Libre WebUI",subtitle:"Hãy bắt đầu",description:"Thiết lập phiên bản Libre WebUI của bạn chỉ trong vài bước",createAdmin:"Tạo tài khoản quản trị",features:{secure:{title:"An toàn & Riêng tư",description:"Cuộc trò chuyện của bạn được lưu trên thiết bị của bạn"},fast:{title:"Nhanh & Phản hồi tốt",description:"Tối ưu hóa cho tốc độ và hiệu suất"},openSource:{title:"Mã nguồn mở",description:"Phần mềm miễn phí và mã nguồn mở"}}},admin:{title:"Tạo tài khoản quản trị",subtitle:"Thiết lập quản trị viên",description:"Tạo tài khoản quản trị đầu tiên cho phiên bản Libre WebUI của bạn",usernamePlaceholder:"Nhập tên người dùng quản trị",passwordPlaceholder:"Nhập mật khẩu (tối thiểu 6 ký tự)",confirmPlaceholder:"Xác nhận mật khẩu của bạn",creating:"Đang tạo...",createAdmin:"Tạo quản trị viên",success:"Tạo tài khoản quản trị thành công!",failed:"Không thể tạo tài khoản quản trị",fillAllFields:"Vui lòng điền tất cả các trường",note:"Đây sẽ là tài khoản quản trị chính cho phiên bản Libre WebUI của bạn"},encryptionKey:{title:"Lưu khóa mã hóa của bạn",subtitle:"Quan trọng: Lưu khóa này",description:"Khóa mã hóa này bảo vệ dữ liệu nhạy cảm của bạn. Lưu trữ nó một cách an toàn - bạn sẽ cần nó nếu bạn cần khôi phục cơ sở dữ liệu.",warning:"Cảnh báo",warningText:"Nếu bạn mất khóa này và cần khôi phục cơ sở dữ liệu, dữ liệu được mã hóa của bạn (khóa API, tùy chọn) sẽ không thể khôi phục.",label:"Khóa mã hóa của bạn",loading:"Đang tải...",copyToClipboard:"Sao chép vào clipboard",copied:"Đã sao chép khóa mã hóa vào clipboard!",copyFailed:"Không thể sao chép khóa vào clipboard",envNote:"Khóa này cũng được lưu trong tệp backend/.env của bạn dưới dạng ENCRYPTION_KEY",acknowledgment:"Tôi đã lưu khóa mã hóa của tôi ở nơi an toàn và hiểu rằng việc mất nó có thể dẫn đến mất dữ liệu.",confirmRequired:"Vui lòng xác nhận rằng bạn đã lưu khóa mã hóa",continue:"Tiếp tục đến Libre WebUI"}},Wk={greeting:{morning:"Chào buổi sáng",afternoon:"Chào buổi chiều",evening:"Chào buổi tối",night:"Chúc ngủ ngon"},welcome:{helpToday:"Tôi có thể giúp gì cho bạn hôm nay?",helpTonight:"Tôi có thể giúp gì cho bạn tối nay?"},input:{placeholder:"Gửi tin nhắn",messagePlaceholder:"Tin nhắn...",attachImages:"Đính kèm hình ảnh",attachments:"Tệp đính kèm và tính năng nâng cao",sendMessage:"Gửi tin nhắn",stopGeneration:"Dừng tạo"},session:{new:"Cuộc trò chuyện mới",private:"Riêng tư",privateMode:"Chế độ riêng tư",privateDescription:"Cuộc trò chuyện này sẽ không được lưu",privateTooltip:"Bắt đầu cuộc trò chuyện riêng tư sẽ không được lưu",deleteConfirm:"Bạn có chắc chắn muốn xóa cuộc trò chuyện này?",generatingTitle:"Đang tạo tiêu đề",noChats:"Chưa có cuộc trò chuyện nào",createFirst:"Tạo cuộc trò chuyện đầu tiên của bạn ở trên",chats:"Cuộc trò chuyện",renameChat:"Đổi tên cuộc trò chuyện",deleteChat:"Xóa cuộc trò chuyện"},persona:{applied:"Đã áp dụng persona",label:"Persona"},model:{updated:"Đã cập nhật mô hình",noModels:"Không có mô hình nào",noModelsDescription:"Không có mô hình nào. Hãy đảm bảo Ollama đang chạy và đã cài đặt các mô hình.",pullCommand:"ollama pull llama3.2:3b",noModelsTooltip:"Không có mô hình nào. Vui lòng đảm bảo Ollama đang chạy và các mô hình đã được cài đặt."},footer:{disclaimer:"LLM có thể mắc lỗi - hãy xác minh thông tin quan trọng",images:"{{count}} hình ảnh",images_plural:"{{count}} hình ảnh",structuredOutput:"Đầu ra có cấu trúc"},mediaUpload:{dropImagesHere:"Thả hình ảnh vào đây hoặc",supportedFormats:"Hỗ trợ: JPG, PNG, GIF, WebP (tối đa 10MB mỗi file)",browse:"duyệt"},structuredOutput:{title:"Định dạng phản hồi",none:"Không có (Ngôn ngữ tự nhiên)",noneDescription:"Phản hồi ngôn ngữ tự nhiên mặc định",json:"JSON",jsonDescription:"Định dạng JSON có cấu trúc",list:"Danh sách",listDescription:"Mảng các mục",summary:"Tóm tắt",summaryDescription:"Tóm tắt tài liệu với các điểm chính",analysis:"Phân tích",analysisDescription:"Phân tích có cấu trúc với ưu/nhược điểm",custom:"Schema tùy chỉnh",customDescription:"Định nghĩa JSON schema của riêng bạn",customSchema:"JSON schema tùy chỉnh",schemaPreview:"Xem trước Schema",applySchema:"Áp dụng Schema",cancel:"Hủy",enabled:"Đã bật đầu ra có cấu trúc"}},qk={navigation:{chat:"Trò chuyện",models:"Mô hình",personas:"Personas",imagine:"Tưởng tượng",settings:"Cài đặt",userManagement:"Quản lý người dùng",signOut:"Đăng xuất"},toggleSize:"Chuyển đổi kích thước thanh bên",expandSidebar:"Mở rộng thanh bên"},Jk={menu:{changePicture:"Đổi ảnh đại diện",settings:"Cài đặt",userManagement:"Quản lý người dùng",logout:"Đăng xuất"},avatar:{title:"Đổi ảnh hồ sơ",updated:"Đã cập nhật ảnh hồ sơ",updateFailed:"Không thể cập nhật ảnh hồ sơ",saving:"Đang lưu..."},profile:{noEmail:"Chưa cung cấp email"}},_k={title:"Cài đặt",tabs:{appearance:"Giao diện",model:"Mô hình",systemMessage:"Tin nhắn hệ thống",plugins:"Plugin",generation:"Tạo nội dung",documents:"Tài liệu",tts:"Chuyển văn bản thành giọng nói",imageGen:"Tạo hình ảnh",system:"Hệ thống",data:"Dữ liệu",about:"Giới thiệu"},appearance:{title:"Giao diện",language:{title:"Ngôn ngữ",description:"Chọn ngôn ngữ ưa thích của bạn"},theme:{title:"Chủ đề",light:"Sáng",dark:"Tối",amoled:"AMOLED",system:"Hệ thống"},chatInterface:{title:"Giao diện trò chuyện",showUsername:"Hiển thị tên người dùng",showUsernameDescription:"Hiển thị tên người dùng trong tin nhắn trò chuyện"},background:{title:"Hình nền",enable:"Bật hình nền",enableDescription:"Hiển thị hình nền tùy chỉnh với hiệu ứng mờ",blur:"Độ mờ",opacity:"Độ trong suốt",upload:"Tải lên hình nền",dragDrop:"Kéo và thả hình ảnh hoặc nhấp để duyệt",chooseImage:"Chọn hình ảnh"}},system:{title:"Hệ thống",currentModel:"Mô hình hiện tại",notSet:"Chưa đặt"},saveSettings:"Lưu cài đặt",model:{title:"Cài đặt mô hình",defaultModel:"Mô hình mặc định",defaultModelDescription:"Mô hình này sẽ được sử dụng mặc định cho các cuộc trò chuyện mới",selectModel:"Chọn mô hình",updateAll:"Cập nhật tất cả mô hình",updateAllDescription:"Kiểm tra cập nhật và tải phiên bản mới nhất của tất cả mô hình đã cài đặt",updateAllButton:"Cập nhật tất cả",updating:"Đang cập nhật mô hình...",currentModelInfo:"Thông tin mô hình hiện tại",name:"Tên",size:"Kích thước",family:"Họ",format:"Định dạng",status:"Trạng thái",statusStarting:"Đang khởi động...",statusComplete:"Hoàn tất",statusError:"Lỗi",bulkOperations:"Thao tác hàng loạt",autoTitle:{title:"Tự động tạo tiêu đề",enable:"Bật tự động tạo tiêu đề",enableDescription:"Tự động tạo tiêu đề cho các cuộc trò chuyện mới",taskModel:"Mô hình tác vụ",selectTaskModel:"Chọn mô hình tác vụ",taskModelDescription:"Mô hình được sử dụng để tạo tiêu đề cuộc trò chuyện"}},systemMessage:{title:"Tin nhắn hệ thống",description:"Đặt tin nhắn hệ thống tùy chỉnh sẽ được sử dụng cho tất cả cuộc trò chuyện mới.",placeholder:"Nhập tin nhắn hệ thống...",saved:"Đã lưu tin nhắn hệ thống",saveFailed:"Không thể lưu tin nhắn hệ thống"},plugins:{title:"Plugin",description:"Quản lý các plugin đã cài đặt của bạn",addNew:"Thêm plugin mới",upload:"Tải lên plugin",addJson:"Thêm JSON",uploading:"Đang tải lên...",jsonPlaceholder:"Dán cấu hình JSON của plugin...",install:"Cài đặt plugin",noPlugins:"Chưa có plugin nào được cài đặt",noPluginsDescription:"Thêm plugin để mở rộng chức năng",loading:"Đang tải plugin...",installed:"Plugin đã cài đặt",active:"Plugin đang hoạt động",activeLabel:"Đang hoạt động",inactive:"Không hoạt động",activate:"Kích hoạt",deactivate:"Vô hiệu hóa",models:"mô hình",apiKeySet:"Đã đặt khóa API",apiKeyConfiguration:"Cấu hình khóa API",apiKeyEnvAlternative:"Hoặc, đặt biến",environmentVariable:"biến môi trường",apiKeyConfigured:"Đã cấu hình khóa API",apiKeyPlaceholder:"Nhập khóa API của bạn...",saveApiKey:"Lưu khóa API",apiKey:{title:"Khóa API",placeholder:"Nhập khóa API",save:"Lưu khóa",remove:"Xóa khóa",configured:"Đã cấu hình khóa API",notConfigured:"Cần khóa API",saved:"Đã lưu khóa API thành công",removed:"Đã xóa khóa API",saveFailed:"Không thể lưu khóa API",removeFailed:"Không thể xóa khóa API",enterKey:"Vui lòng nhập khóa API"}},generation:{title:"Tùy chọn tạo nội dung",description:"Cấu hình cách AI tạo phản hồi",coreParameters:"Tham số cốt lõi",temperature:"Nhiệt độ",temperatureDescription:"Kiểm soát tính ngẫu nhiên. Giá trị thấp hơn tập trung hơn, giá trị cao hơn sáng tạo hơn.",topP:"Top P",topPDescription:"Kiểm soát sự đa dạng thông qua lấy mẫu hạt nhân. Giá trị thấp hơn tập trung vào các token có khả năng cao.",topK:"Top K",topKDescription:"Giới hạn lựa chọn token ở K token có khả năng cao nhất. Đặt 0 để vô hiệu hóa.",minP:"Min P",minPDescription:"Ngưỡng xác suất tối thiểu để lựa chọn token.",generationControl:"Kiểm soát tạo nội dung",maxTokens:"Số token tối đa",maxTokensDescription:"Số token tối đa để tạo trong phản hồi.",repeatPenalty:"Hình phạt lặp lại",repeatPenaltyDescription:"Phạt các token lặp lại. Giá trị cao hơn giảm sự lặp lại.",contextLength:"Độ dài ngữ cảnh",contextLengthDescription:"Kích thước cửa sổ ngữ cảnh tối đa cho cuộc trò chuyện.",seed:"Seed",optional:"tùy chọn",random:"Ngẫu nhiên",seedDescription:"Đặt seed cụ thể cho đầu ra có thể tái tạo.",advancedOptions:"Tùy chọn nâng cao",presencePenalty:"Hình phạt hiện diện",presencePenaltyDescription:"Phạt các token xuất hiện trong ngữ cảnh.",frequencyPenalty:"Hình phạt tần suất",frequencyPenaltyDescription:"Phạt các token được sử dụng thường xuyên.",stopSequences:"Chuỗi dừng",commaSeparated:"phân cách bằng dấu phẩy",stopSequencesDescription:"Các token tùy chỉnh sẽ dừng tạo khi gặp phải.",resetDefaults:"Đặt lại mặc định",saveOptions:"Lưu tùy chọn",embeddingSettings:"Cài đặt nhúng",enableEmbeddings:"Bật nhúng tài liệu"},documents:{title:"Cài đặt tài liệu",embeddings:{title:"Nhúng",enable:"Bật nhúng tài liệu",model:"Mô hình nhúng",modelDescription:"Chọn mô hình được sử dụng để nhúng tài liệu",chunkSize:"Kích thước đoạn",chunkSizeInTokens:"(tính bằng token)",chunkSizeDescription:"Kích thước các đoạn văn bản để nhúng",chunkOverlap:"Độ chồng chéo đoạn",chunkOverlapInTokens:"(tính bằng token)",chunkOverlapDescription:"Độ chồng chéo giữa các đoạn liên tiếp",similarityThreshold:"Ngưỡng tương đồng",similarityDescription:"Điểm tương đồng tối thiểu để bao gồm kết quả",status:"Trạng thái nhúng",statusLabel:"Trạng thái",available:"Khả dụng",unavailable:"Không khả dụng",chunksWithEmbeddings:"Đoạn có nhúng",coverage:"Độ phủ",regenerate:"Tạo lại nhúng",regenerating:"Đang tạo lại..."}},tts:{title:"Chuyển văn bản thành giọng nói",description:"Cấu hình cài đặt chuyển văn bản thành giọng nói để đọc to tin nhắn",loadingProviders:"Đang tải nhà cung cấp TTS...",noProviders:"Không có nhà cung cấp TTS",noProvidersDescription:"Cấu hình plugin hỗ trợ TTS để bật chuyển văn bản thành giọng nói",enable:"Bật TTS",enableDescription:"Cho phép chuyển văn bản thành giọng nói cho tin nhắn trợ lý",autoPlay:"Tự động phát phản hồi",autoPlayDescription:"Tự động đọc to các tin nhắn trợ lý mới",voiceConfiguration:"Cấu hình giọng nói",model:"Mô hình TTS",modelDescription:"Chọn mô hình để chuyển văn bản thành giọng nói",voice:"Giọng nói",selectVoice:"Chọn giọng nói",voiceDescription:"Chọn giọng nói để chuyển văn bản thành giọng nói",speed:"Tốc độ",speedSlow:"0.5x",speedNormal:"1.0x",speedFast:"2.0x",availableProviders:"Nhà cung cấp khả dụng",models:"mô hình",test:"Kiểm tra",testing:"Đang kiểm tra...",stop:"Dừng"},imageGen:{title:"Tạo hình ảnh",description:"Cấu hình cài đặt và nhà cung cấp tạo hình ảnh",loadingProviders:"Đang tải nhà cung cấp tạo hình ảnh...",noProviders:"Không có nhà cung cấp tạo hình ảnh",noProvidersDescription:"Cấu hình plugin hỗ trợ tạo hình ảnh",enable:"Bật tạo hình ảnh",enableDescription:"Cho phép tạo hình ảnh AI trong cuộc trò chuyện",configuration:"Cấu hình",model:"Mô hình",modelDescription:"Chọn mô hình để tạo hình ảnh",size:"Kích thước",sizeDescription:"Độ phân giải của hình ảnh được tạo",quality:"Chất lượng",qualityDescription:"Mức chất lượng của hình ảnh được tạo",style:"Phong cách",styleDescription:"Preset phong cách cho hình ảnh được tạo",availableProviders:"Nhà cung cấp khả dụng",models:"mô hình"},data:{title:"Quản lý dữ liệu",export:"Xuất dữ liệu",exportDescription:"Tải xuống tất cả dữ liệu của bạn bao gồm tùy chọn, phiên và tài liệu.",exportAll:"Xuất tất cả dữ liệu",import:"Nhập dữ liệu",importDescription:"Nhập dữ liệu từ bản xuất trước đó.",importData:"Nhập dữ liệu",importing:"Đang nhập...",clearSessions:"Xóa phiên",clearSessionsDescription:"Xóa tất cả phiên trò chuyện. Hành động này không thể hoàn tác.",clearAll:"Xóa tất cả",clearing:"Đang xóa...",importOptions:"Tùy chọn nhập",importOptionsDescription:"Chọn cách xử lý dữ liệu hiện có",skipDuplicates:"Bỏ qua bản sao",overwrite:"Ghi đè hiện có",importResults:"Kết quả nhập",preferences:"Tùy chọn",imported:"Đã nhập",failed:"Thất bại",sessions:"Phiên",importedLabel:"đã nhập",skipped:"đã bỏ qua",documents:"Tài liệu",errors:"Lỗi"},about:{title:"Giới thiệu",versionLabel:"Phiên bản",ollama:{title:"Trạng thái Ollama",version:"Phiên bản",healthy:"Khỏe mạnh",unhealthy:"Không khỏe mạnh"},stats:{models:"Mô hình",sessions:"Phiên"},features:{privacy:{title:"Ưu tiên quyền riêng tư",description:"Dữ liệu của bạn được lưu trên thiết bị của bạn"},openSource:{title:"Mã nguồn mở",description:"Phần mềm miễn phí và mã nguồn mở"},localInference:{title:"Suy luận cục bộ",description:"Chạy mô hình AI cục bộ với Ollama"}},openSourceBy:"Mã nguồn mở bởi {{company}}",links:{title:"Liên kết",github:"GitHub",githubDescription:"Xem mã nguồn và đóng góp",website:"Website",websiteDescription:"Truy cập website của chúng tôi",ollama:"Ollama",ollamaDescription:"Tìm hiểu thêm về Ollama",documentation:"Tài liệu",reportIssue:"Báo cáo vấn đề",reportIssueDescription:"Báo lỗi & yêu cầu tính năng"},version:"Phiên bản {{version}}"}},Yk={title:"Mô hình",subtitle:"Tải, quản lý và giám sát mô hình Ollama của bạn",installed:"Mô hình đã cài đặt",available:"Mô hình khả dụng",pull:"Tải mô hình",pulling:"Đang tải...",delete:"Xóa mô hình",deleting:"Đang xóa...",size:"Kích thước",modified:"Đã sửa đổi",family:"Họ",parameters:"Tham số",quantization:"Lượng tử hóa",noModels:"Chưa có mô hình nào được cài đặt",pullFirst:"Tải mô hình để bắt đầu"},Zk={title:"Personas",create:"Tạo Persona",edit:"Chỉnh sửa Persona",delete:"Xóa Persona",name:"Tên",description:"Mô tả",systemPrompt:"Prompt hệ thống",model:"Mô hình",avatar:"Ảnh đại diện",background:"Hình nền",noPersonas:"Chưa có persona nào được tạo",createFirst:"Tạo persona đầu tiên của bạn để tùy chỉnh trải nghiệm trò chuyện"},Xk={title:"Thư viện",subtitle:"Thư viện hình ảnh do AI tạo của bạn",imageCount:"{{count}} hình ảnh",generate:"Tạo hình ảnh",generateDescription:"Tạo hình ảnh với AI",generating:"Đang tạo...",prompt:"Prompt",promptPlaceholder:"Mô tả hình ảnh bạn muốn tạo...",noImages:"Chưa có hình ảnh nào được tạo",download:"Tải xuống",delete:"Xóa",regenerate:"Tạo lại",model:"Mô hình",size:"Kích thước",quality:"Chất lượng",created:"Đã tạo"},Qk={generic:"Đã xảy ra lỗi",network:"Lỗi mạng. Vui lòng kiểm tra kết nối của bạn.",unauthorized:"Bạn không được phép thực hiện hành động này.",notFound:"Không tìm thấy tài nguyên được yêu cầu.",serverError:"Lỗi máy chủ. Vui lòng thử lại sau.",validation:"Vui lòng kiểm tra đầu vào của bạn và thử lại."},ef={title:"Phím tắt",toggleSidebar:"Chuyển đổi thanh bên",openSettings:"Mở cài đặt",toggleDarkMode:"Chuyển đổi chế độ tối",showShortcuts:"Hiển thị phím tắt",closeModals:"Đóng hộp thoại",groups:{navigation:"Điều hướng",settings:"Cài đặt",general:"Chung",chat:"Trò chuyện"},actions:{sendMessage:"Gửi tin nhắn",newLine:"Dòng mới trong tin nhắn"},footer:"Nhấn {{key1}} hoặc {{key2}} để hiển thị trợ giúp này",tooltip:"Phím tắt"},af={title:"Mô hình",loading:"Đang tải mô hình...",systemStatus:{online:"Ollama trực tuyến",offline:"Ollama ngoại tuyến",models:"mô hình",models_plural:"mô hình",running:"đang chạy",vram:"VRAM"},sections:{pull:"Tải mô hình mới",library:"Duyệt thư viện",running:"Mô hình đang chạy",local:"Mô hình cục bộ",advanced:"Hành động nâng cao"},pull:{placeholder:"Nhập tên mô hình (vd: llama3.2:3b, deepseek-r1:14b)",button:"Tải",cancel:"Hủy",popular:"Mô hình phổ biến:",browseAll:"Duyệt tất cả mô hình trên ollama.com",success:"Đã tải mô hình {{name}} thành công",cancelled:"Đã hủy tải mô hình",failed:"Không thể tải mô hình",enterName:"Vui lòng nhập tên mô hình"},progress:{starting:"Đang khởi tạo...",pulling:"Đang tải mô hình...",verifying:"Đang xác minh tính toàn vẹn...",writing:"Đang ghi manifest...",cleaning:"Đang dọn dẹp..."},library:{available:"khả dụng",search:"Tìm kiếm mô hình...",noResults:"Không tìm thấy mô hình nào phù hợp với tiêu chí của bạn",installed:"Đã cài đặt",more:"+{{count}} thêm",refresh:"Làm mới thư viện"},local:{noModels:"Chưa có mô hình nào được cài đặt",pullToStart:"Tải mô hình ở trên để bắt đầu",installed:"đã cài đặt",running:"Đang chạy",info:"Thông tin",copy:"Sao chép",delete:"Xóa",deleteConfirm:'Bạn có chắc chắn muốn xóa mô hình "{{name}}"?',deleteSuccess:"Đã xóa mô hình {{name}} thành công",deleteFailed:"Không thể xóa mô hình"},advanced:{createModel:"Tạo mô hình",fromModelfile:"Từ Modelfile",copyModel:"Sao chép mô hình",duplicateExisting:"Nhân đôi hiện có",testEmbeddings:"Kiểm tra nhúng",generateVectors:"Tạo vector",healthCheck:"Kiểm tra sức khỏe",testConnection:"Kiểm tra kết nối",healthy:"Ollama đang hoạt động tốt!"},modals:{details:{title:"Chi tiết mô hình",info:"Thông tin mô hình",family:"Họ",parameters:"Tham số",quantization:"Lượng tử hóa",format:"Định dạng",systemPrompt:"Prompt hệ thống",template:"Mẫu",license:"Giấy phép",modelfile:"Modelfile",noDetails:"Không có chi tiết"},copy:{title:"Sao chép mô hình",source:"Mô hình nguồn",selectModel:"Chọn mô hình...",newName:"Tên mô hình mới",placeholder:"vd: my-custom-model",copying:"Đang sao chép...",button:"Sao chép mô hình",success:"Đã sao chép mô hình sang {{name}}",failed:"Không thể sao chép mô hình",enterBoth:"Vui lòng nhập cả tên nguồn và tên đích"},create:{title:"Tạo mô hình tùy chỉnh",name:"Tên mô hình",namePlaceholder:"vd: my-assistant",modelfile:"Modelfile",modelfilePlaceholder:`FROM llama3.2
26
26
  SYSTEM You are a helpful assistant.`,docs:"Tài liệu Modelfile",docsLink:"để tham khảo cú pháp",creating:"Đang tạo...",button:"Tạo mô hình",success:"Đã tạo mô hình {{name}} thành công",failed:"Không thể tạo mô hình",enterBoth:"Vui lòng nhập tên mô hình và nội dung Modelfile"},embeddings:{title:"Kiểm tra nhúng",model:"Mô hình nhúng",selectModel:"Chọn mô hình...",recommended:"Khuyến nghị: nomic-embed-text, mxbai-embed-large",input:"Văn bản đầu vào",placeholder:"Nhập văn bản để tạo nhúng cho...",generating:"Đang tạo...",button:"Tạo nhúng",result:"Kết quả ({{count}} chiều)",success:"Đã tạo vector nhúng {{count}} chiều",failed:"Không thể tạo nhúng",enterBoth:"Vui lòng chọn mô hình và nhập văn bản"}}},tf={title:"Personas",subtitle:"Tạo và quản lý các persona AI với tính cách, bộ nhớ và hành vi tùy chỉnh",loading:"Đang tải personas...",createButton:"Tạo Persona",importExport:"Nhập/Xuất",stats:{title:"Personas của bạn",count:"{{count}} persona đã tạo",count_plural:"{{count}} personas đã tạo"},empty:{title:"Chưa có persona nào",description:"Tạo persona đầu tiên của bạn để bắt đầu với tương tác AI được cá nhân hóa",button:"Tạo Persona đầu tiên của bạn"},deleteConfirm:'Bạn có chắc chắn muốn xóa "{{name}}"?',deleteSuccess:'Đã xóa persona "{{name}}" thành công',downloadSuccess:'Đã tải xuống persona "{{name}}" thành công',failed:"Không thể {{action}} persona"},nf={title:{create:"Tạo Persona mới",edit:"Chỉnh sửa Persona"},subtitle:{create:"Tạo một persona AI mới với tính cách tùy chỉnh, hệ thống bộ nhớ và khả năng học thích ứng",edit:"Tùy chỉnh persona AI của bạn với bộ nhớ nâng cao, học thích ứng và tham số thông minh"},loading:"Đang tải form...",saved:"Đã lưu",tabs:{basic:"Cơ bản",parameters:"Tham số",memory:"Bộ nhớ & Học tập",advanced:"Nâng cao"},basic:{name:"Tên",namePlaceholder:"Nhập tên persona",model:"Mô hình",selectModel:"Chọn mô hình",description:"Mô tả",descriptionPlaceholder:"Mô tả persona của bạn...",systemPrompt:"Prompt hệ thống",systemPromptPlaceholder:"Nhập prompt hệ thống định nghĩa hành vi persona của bạn...",systemPromptHint:"Prompt hệ thống định nghĩa cách persona của bạn sẽ hành xử và phản hồi."},parameters:{temperature:"Nhiệt độ",temperatureHint:"Kiểm soát sự sáng tạo vs nhất quán",topP:"Top-P",topPHint:"Kiểm soát sự đa dạng phản hồi",topK:"Top-K",topKHint:"Giới hạn từ vựng ở top-k token",contextWindow:"Cửa sổ ngữ cảnh",contextWindowHint:"Độ dài lịch sử hội thoại tối đa",maxTokens:"Số token tối đa",maxTokensHint:"Độ dài phản hồi tối đa",repeatPenalty:"Hình phạt lặp lại",repeatPenaltyHint:"Giảm phản hồi lặp lại"},memory:{title:"Hệ thống bộ nhớ",subtitle:"Persona ghi nhớ các cuộc trò chuyện theo thời gian",enableHint:"Bật hệ thống bộ nhớ để cho phép persona của bạn ghi nhớ các cuộc trò chuyện và xây dựng ngữ cảnh theo thời gian.",loading:"Đang tải trạng thái bộ nhớ...",noData:"Chưa có dữ liệu bộ nhớ",memories:"Ký ức",mbUsed:"MB đã dùng",lastBackup:"Sao lưu lần cuối",never:"Chưa bao giờ",maxMemories:"Số ký ức tối đa",maxMemoriesHint:"Số lượng ký ức persona này có thể lưu trữ",retention:"Thời gian giữ ký ức",retentionHint:"Số ngày giữ ký ức trước khi dọn dẹp",autoCleanup:"Tự động dọn dẹp ký ức cũ",wipeAll:"Xóa tất cả ký ức",wipeCannot:"Không thể hoàn tác",wipeButton:"Xóa",wiping:"Đang xóa...",wipeConfirm:"Bạn có chắc chắn muốn xóa tất cả ký ức? Không thể hoàn tác.",wipeSuccess:"Đã xóa {{count}} ký ức"},learning:{title:"Học thích ứng",subtitle:"Persona phát triển dựa trên tương tác",enableHint:"Bật học thích ứng để cho phép persona của bạn phát triển và cá nhân hóa phản hồi dựa trên tương tác của bạn.",speed:"Tốc độ học",slow:"Chậm",slowDesc:"Thay đổi dần dần",balanced:"Cân bằng",balancedDesc:"Tốc độ vừa phải",fast:"Nhanh",fastDesc:"Thích ứng nhanh",autoAdapt:"Tự động thích ứng với sở thích người dùng",whatLearns:"Những gì persona học:",conversationTone:"Giọng điệu hội thoại",responseStyle:"Phong cách phản hồi",userPreferences:"Sở thích người dùng",topicInterests:"Chủ đề quan tâm"},advanced:{embeddingModel:"Mô hình nhúng",embeddingHint:"Chọn mô hình được sử dụng để mã hóa bộ nhớ và tìm kiếm ngữ nghĩa. Các mô hình nhúng được hiển thị trước, sau đó là các mô hình khả dụng khác.",noModels:"Không tìm thấy mô hình",embeddingModels:"Mô hình nhúng",otherModels:"Mô hình khác",installHint:"Cài đặt mô hình nhúng:",recommended:"Khuyến nghị: nomic-embed-text, mxbai-embed-large, bge-m3, snowflake-arctic-embed",aboutTitle:"Về cài đặt nâng cao",aboutDescription:"Mô hình nhúng được sử dụng bởi hệ thống bộ nhớ để hiểu ý nghĩa ngữ nghĩa và tìm các ký ức liên quan trong cuộc trò chuyện. Chọn mô hình phù hợp với trường hợp sử dụng và tài nguyên khả dụng của bạn."},actions:{cancel:"Hủy",save:"Lưu",saving:"Đang lưu...",saveClose:"Lưu & Đóng",create:"Tạo"},success:{created:"Đã tạo persona",updated:"Đã cập nhật persona"},error:{saveFailed:"Không thể lưu"}},rf={enhanced:"Nâng cao",systemPrompt:"Prompt hệ thống",memories:"ký ức",use:"Sử dụng",editTooltip:"Chỉnh sửa persona",downloadTooltip:"Tải xuống persona",backup:"Sao lưu",exportDNA:"Xuất DNA",wipeMemories:"Xóa ký ức",wipeConfirm:"Bạn có chắc chắn muốn xóa tất cả ký ức của persona này? Hành động này không thể hoàn tác.",wipeSuccess:"Đã xóa {{count}} ký ức",backupSuccess:"Đã tải xuống bản sao lưu persona thành công",dnaSuccess:"Đã xuất DNA persona thành công",failed:"Không thể {{action}}"},of={title:"Quản lý người dùng",subtitle:"Quản lý tài khoản và quyền hạn người dùng",loading:"Đang tải người dùng...",createUser:"Tạo người dùng",search:"Tìm kiếm người dùng...",noUsers:"Không tìm thấy người dùng",noUsersMatching:"Không có người dùng nào khớp với tìm kiếm của bạn",columns:{user:"Người dùng",email:"Email",role:"Vai trò",created:"Đã tạo",actions:"Hành động"},roles:{admin:"Quản trị viên",user:"Người dùng"},noEmail:"Không có email",deleteConfirm:'Bạn có chắc chắn muốn xóa người dùng "{{name}}"?',deleteSuccess:"Đã xóa người dùng thành công",deleteFailed:"Không thể xóa người dùng",cannotDeleteSelf:"Bạn không thể xóa tài khoản của chính mình",form:{title:{create:"Tạo người dùng",edit:"Chỉnh sửa người dùng"},username:"Tên người dùng",usernamePlaceholder:"Nhập tên người dùng",email:"Email",emailPlaceholder:"Nhập email (tùy chọn)",password:"Mật khẩu",passwordPlaceholder:"Nhập mật khẩu",passwordHint:"Để trống để giữ mật khẩu hiện tại",role:"Vai trò",creating:"Đang tạo...",updating:"Đang cập nhật...",createButton:"Tạo người dùng",updateButton:"Cập nhật người dùng",createSuccess:"Đã tạo người dùng thành công",updateSuccess:"Đã cập nhật người dùng thành công",createFailed:"Không thể tạo người dùng",updateFailed:"Không thể cập nhật người dùng"}},sf={you:"Bạn",assistant:"Trợ lý",system:"Hệ thống",copy:"Sao chép",copyMessage:"Sao chép tin nhắn",copied:"Đã sao chép!",regenerate:"Tạo lại",regenerateResponse:"Tạo lại phản hồi",edit:"Chỉnh sửa",editSystemMessage:"Chỉnh sửa tin nhắn hệ thống",saveChanges:"Lưu thay đổi",cancelEditing:"Hủy chỉnh sửa",delete:"Xóa",deleteConfirm:"Xóa tin nhắn này?",branch:"Nhánh",speaking:"Đang nói...",speakMessage:"Đọc tin nhắn",stopSpeaking:"Dừng đọc",showMore:"Hiển thị thêm",showLess:"Hiển thị ít hơn",thinking:"Đang suy nghĩ",systemMessagePlaceholder:"Nhập tin nhắn hệ thống của bạn...",fullSizeImage:"Hình ảnh kích thước đầy đủ",startConversation:"Bắt đầu cuộc trò chuyện",startConversationDescription:"Gửi tin nhắn để bắt đầu trò chuyện với trợ lý AI của bạn. Đặt câu hỏi, nhờ giúp đỡ về code, hoặc có một cuộc trò chuyện tự nhiên.",scrollToBottom:"Cuộn xuống dưới",newMessages:"Tin nhắn mới"},lf={title:"Thư viện hình ảnh",noImages:"Chưa có hình ảnh nào",noImagesHint:"Tạo hình ảnh đầu tiên của bạn bằng bảng điều khiển bên phải",delete:"Xóa",download:"Tải xuống",deleteConfirm:"Bạn có chắc chắn muốn xóa hình ảnh này?",deleteSuccess:"Đã xóa hình ảnh",deleteFailed:"Không thể xóa hình ảnh",downloadFailed:"Không thể tải xuống hình ảnh",loadMore:"Tải thêm ({{current}} trong số {{total}})",loadFailed:"Không thể tải thư viện"},df={title:"Tạo hình ảnh",prompt:"Prompt",promptPlaceholder:"Mô tả hình ảnh bạn muốn tạo...",model:"Mô hình",selectModel:"Chọn mô hình",noModels:"Không có mô hình tạo hình ảnh nào khả dụng",configurePlugin:"Cấu hình plugin hỗ trợ tạo hình ảnh",size:"Kích thước",quality:"Chất lượng",style:"Phong cách",generate:"Tạo",generating:"Đang tạo...",success:"Đã tạo hình ảnh thành công",failed:"Không thể tạo hình ảnh",enterPrompt:"Vui lòng nhập prompt"},cf={title:"Đã xảy ra lỗi",description:"Chúng tôi gặp phải lỗi không mong muốn. Vui lòng thử làm mới trang.",tryAgain:"Làm mới trang",goHome:"Về trang chủ",errorDetails:"Chi tiết lỗi (Phát triển)"},uf={title:"Tài liệu",upload:"Tải lên tài liệu",uploading:"Đang tải lên...",noDocuments:"Chưa có tài liệu nào được tải lên",uploadHint:"Tải lên tài liệu để sử dụng trong cuộc trò chuyện của bạn",delete:"Xóa",deleteConfirm:"Bạn có chắc chắn muốn xóa tài liệu này?",deleteSuccess:"Đã xóa tài liệu",deleteFailed:"Không thể xóa tài liệu",uploadSuccess:"Đã tải lên tài liệu thành công",uploadFailed:"Không thể tải lên tài liệu",types:"Hỗ trợ: PDF, TXT, MD, DOCX",unsupportedFileType:"Chỉ hỗ trợ file PDF và TXT",fileSizeTooLarge:"Kích thước file phải nhỏ hơn 10MB",uploadSuccessWithName:'Đã tải lên tài liệu "{{name}}" thành công',removeSuccess:"Đã xóa tài liệu thành công",removeFailed:"Không thể xóa tài liệu",removeError:"Đã xảy ra lỗi khi xóa tài liệu",clickToUpload:"Nhấp để tải lên",orDragAndDrop:"hoặc kéo và thả",fileTypesAndSize:"File PDF hoặc TXT tối đa 10MB",uploadedDocuments:"Tài liệu đã tải lên",removeDocument:"Xóa tài liệu"},mf={speak:"Đọc",stop:"Dừng",speaking:"Đang đọc...",generateFailed:"Không thể tạo giọng nói",playbackFailed:"Phát lại âm thanh thất bại",stopSpeaking:"Dừng đọc",generatingSpeech:"Đang tạo giọng nói...",readAloud:"Đọc to"},pf={title:"Artifact",code:"Code",preview:"Xem trước",copy:"Sao chép code",copied:"Đã sao chép!",download:"Tải xuống",expand:"Mở rộng",collapse:"Thu gọn",openInNewTab:"Mở trong tab mới",invalidSvg:"Nội dung SVG không hợp lệ",invalidJson:"Nội dung JSON không hợp lệ",previewMode:"Chế độ xem trước",codeMode:"Chế độ code",copyContent:"Sao chép nội dung",openInPanel:"Mở trong bảng điều khiển",openInNewWindow:"Mở trong cửa sổ mới",created:"Đã tạo",closePanelEsc:"Đóng bảng điều khiển (Esc)",copyButton:"Sao chép",open:"Mở",dragEdgeToResize:"Kéo cạnh để thay đổi kích thước"},gf={title:"Nhập & Xuất Personas",description:"Xuất personas của bạn để chia sẻ hoặc nhập personas từ người khác",exportPersonas:"Xuất Personas",importPersonas:"Nhập Personas",noPersonasToExport:"Không có personas để xuất",personasAvailable:"{{count}} persona khả dụng",personasAvailable_plural:"{{count}} personas khả dụng",exportAll:"Xuất tất cả",uploadJsonFile:"Tải lên file JSON",pasteJsonLabel:"Dán dữ liệu JSON",pasteJsonPlaceholder:"Dán dữ liệu JSON persona vào đây...",importing:"Đang nhập...",importButton:"Nhập Persona(s)",expectedFormat:"Định dạng JSON mong đợi:",exportSuccess:'Đã xuất persona "{{name}}" thành công',exportFailed:"Không thể xuất persona",exportAllSuccess:"Đã xuất tất cả {{count}} personas thành công",exportAllFailed:"Không thể xuất personas",pasteJsonData:"Vui lòng dán dữ liệu JSON persona",importMultipleSuccess:"Đã nhập thành công {{count}} personas",importMultipleFailed:"Không thể nhập {{count}} personas",importNoneFailed:"Không thể nhập bất kỳ personas nào",importSuccess:"Đã nhập persona thành công",importFailed:"Không thể nhập persona"},hf={common:Rk,brand:Uk,auth:$k,setup:Vk,chat:Wk,sidebar:qk,user:Jk,settings:_k,models:Yk,personas:Zk,gallery:Xk,errors:Qk,keyboard:ef,modelManager:af,personaManager:tf,personaForm:nf,personaCard:rf,userManager:of,chatMessage:sf,imageGallery:lf,imageGeneration:df,errorBoundary:cf,documents:uf,ttsButton:mf,artifacts:pf,personaImportExport:gf},bf={loading:"加载中...",save:"保存",saving:"保存中...",cancel:"取消",delete:"删除",edit:"编辑",close:"关闭",back:"返回",next:"下一步",confirm:"确认",error:"错误",success:"成功",warning:"警告",or:"或",optional:"可选",enabled:"已启用",disabled:"已禁用",on:"开",off:"关",yes:"是",no:"否",search:"搜索",noResults:"未找到结果",retry:"重试",refresh:"刷新",download:"下载",upload:"上传",export:"导出",import:"导入",reset:"重置",apply:"应用",clear:"清除",all:"全部",none:"无",default:"默认",custom:"自定义",mode:"模式",multiUser:"多用户",remove:"移除"},kf={name:"Libre WebUI",shortName:"Libre"},ff={login:{title:"欢迎回来",subtitle:"登录您的账户以继续",username:"用户名",usernamePlaceholder:"请输入用户名",password:"密码",passwordPlaceholder:"请输入密码",signIn:"登录",signingIn:"登录中...",noAccount:"还没有账户?",signUpHere:"点击注册",loginSuccess:"登录成功!",loginFailed:"登录失败",checkCredentials:"登录失败,请检查您的凭据。",enterBoth:"请输入用户名和密码",githubSuccess:"GitHub 登录成功!",githubFailed:"GitHub 认证失败",githubVerifyFailed:"GitHub 认证验证失败"},signup:{title:"创建账户",subtitle:"注册新账户",username:"用户名",usernamePlaceholder:"请选择用户名",email:"电子邮箱",emailPlaceholder:"your@email.com",password:"密码",passwordPlaceholder:"请选择密码",confirmPassword:"确认密码",confirmPasswordPlaceholder:"请再次输入密码",createAccount:"创建账户",creatingAccount:"创建账户中...",hasAccount:"已有账户?",signInHere:"点击登录",signupSuccess:"账户创建成功!",signupFailed:"注册失败",tryAgain:"注册失败,请重试。",usernameRequired:"用户名和密码为必填项",passwordMismatch:"两次输入的密码不一致",passwordTooShort:"密码长度至少为6个字符"},logout:{button:"退出登录",success:"已成功退出登录"},oauth:{continueWith:"使用 {{provider}} 继续",connectingTo:"正在连接 {{provider}}...",github:"GitHub",huggingFace:"Hugging Face"}},yf={welcome:{title:"欢迎使用 Libre WebUI",subtitle:"开始使用",description:"只需几步即可设置您的 Libre WebUI 实例",createAdmin:"创建管理员账户",features:{secure:{title:"安全私密",description:"您的对话保存在本地设备上"},fast:{title:"快速响应",description:"针对速度和性能进行了优化"},openSource:{title:"开源软件",description:"免费且开源的软件"}}},admin:{title:"创建管理员账户",subtitle:"管理员设置",description:"为您的 Libre WebUI 实例创建第一个管理员账户",usernamePlaceholder:"请输入管理员用户名",passwordPlaceholder:"请输入密码(至少6个字符)",confirmPlaceholder:"请确认密码",creating:"创建中...",createAdmin:"创建管理员",success:"管理员账户创建成功!",failed:"创建管理员账户失败",fillAllFields:"请填写所有字段",note:"这将是您 Libre WebUI 实例的主管理员账户"},encryptionKey:{title:"保存您的加密密钥",subtitle:"重要:请保存此密钥",description:"此加密密钥用于保护您的敏感数据。请妥善保存——如果需要恢复数据库,您将需要它。",warning:"警告",warningText:"如果您丢失此密钥且需要恢复数据库,您的加密数据(API 密钥、偏好设置)将无法恢复。",label:"您的加密密钥",loading:"加载中...",copyToClipboard:"复制到剪贴板",copied:"加密密钥已复制到剪贴板!",copyFailed:"复制密钥到剪贴板失败",envNote:"此密钥也保存在您的 backend/.env 文件中,名为 ENCRYPTION_KEY",acknowledgment:"我已将加密密钥保存在安全的位置,并了解丢失它可能导致数据丢失。",confirmRequired:"请确认您已保存加密密钥",continue:"继续使用 Libre WebUI"}},vf={greeting:{morning:"早上好",afternoon:"下午好",evening:"晚上好",night:"夜深了"},welcome:{helpToday:"今天我能帮您什么?",helpTonight:"今晚我能帮您什么?"},input:{placeholder:"发送消息",messagePlaceholder:"消息...",attachImages:"添加图片",attachments:"附件和高级功能",sendMessage:"发送消息",stopGeneration:"停止生成"},session:{new:"新对话",private:"私密",privateMode:"私密模式",privateDescription:"此对话不会被保存",privateTooltip:"开始一个不会被保存的私密对话",deleteConfirm:"确定要删除此对话吗?",generatingTitle:"正在生成标题",noChats:"暂无对话",createFirst:"在上方创建您的第一个对话",chats:"对话",renameChat:"重命名对话",deleteChat:"删除对话"},persona:{applied:"已应用角色",label:"角色"},model:{updated:"模型已更新",noModels:"没有可用的模型",noModelsDescription:"没有可用的模型。请确保 Ollama 正在运行并已安装模型。",pullCommand:"ollama pull llama3.2:3b",noModelsTooltip:"没有可用的模型。请确保 Ollama 正在运行并已安装模型。"},footer:{disclaimer:"大语言模型可能会犯错——请核实重要信息",images:"{{count}} 张图片",images_plural:"{{count}} 张图片",structuredOutput:"结构化输出"},mediaUpload:{dropImagesHere:"将图片拖放到此处或",supportedFormats:"支持格式:JPG、PNG、GIF、WebP(每张最大10MB)",browse:"浏览"},structuredOutput:{title:"响应格式",none:"无(自然语言)",noneDescription:"默认自然语言响应",json:"JSON",jsonDescription:"结构化 JSON 格式",list:"列表",listDescription:"项目数组",summary:"摘要",summaryDescription:"包含要点的文档摘要",analysis:"分析",analysisDescription:"包含优缺点的结构化分析",custom:"自定义模式",customDescription:"定义您自己的 JSON 模式",customSchema:"自定义 JSON 模式",schemaPreview:"模式预览",applySchema:"应用模式",cancel:"取消",enabled:"已启用结构化输出"}},xf={navigation:{chat:"对话",models:"模型",personas:"角色",imagine:"创意",settings:"设置",userManagement:"用户管理",signOut:"退出登录"},toggleSize:"切换侧边栏大小",expandSidebar:"展开侧边栏"},Sf={menu:{changePicture:"更换头像",settings:"设置",userManagement:"用户管理",logout:"退出登录"},avatar:{title:"更换头像",updated:"头像已更新",updateFailed:"更新头像失败",saving:"保存中..."},profile:{noEmail:"未提供邮箱"}},wf={title:"设置",tabs:{appearance:"外观",model:"模型",systemMessage:"系统消息",plugins:"插件",generation:"生成",documents:"文档",tts:"语音合成",imageGen:"图像生成",system:"系统",data:"数据",about:"关于"},appearance:{title:"外观",language:{title:"语言",description:"选择您偏好的语言"},theme:{title:"主题",light:"浅色",dark:"深色",amoled:"AMOLED",system:"跟随系统"},chatInterface:{title:"聊天界面",showUsername:"显示用户名",showUsernameDescription:"在聊天消息中显示用户名"},background:{title:"背景图片",enable:"启用背景图片",enableDescription:"显示带模糊效果的自定义背景",blur:"模糊度",opacity:"不透明度",upload:"上传背景图片",dragDrop:"拖放图片或点击浏览",chooseImage:"选择图片"}},system:{title:"系统",currentModel:"当前模型",notSet:"未设置"},saveSettings:"保存设置",model:{title:"模型设置",defaultModel:"默认模型",defaultModelDescription:"此模型将默认用于新对话",selectModel:"选择模型",updateAll:"更新所有模型",updateAllDescription:"检查更新并拉取所有已安装模型的最新版本",updateAllButton:"全部更新",updating:"正在更新模型...",currentModelInfo:"当前模型信息",name:"名称",size:"大小",family:"系列",format:"格式",status:"状态",statusStarting:"启动中...",statusComplete:"完成",statusError:"错误",bulkOperations:"批量操作",autoTitle:{title:"自动生成标题",enable:"启用自动标题",enableDescription:"自动为新对话生成标题",taskModel:"任务模型",selectTaskModel:"选择任务模型",taskModelDescription:"用于生成对话标题的模型"}},systemMessage:{title:"系统消息",description:"设置将用于所有新对话的自定义系统消息。",placeholder:"输入系统消息...",saved:"系统消息已保存",saveFailed:"保存系统消息失败"},plugins:{title:"插件",description:"管理已安装的插件",addNew:"添加新插件",upload:"上传插件",addJson:"添加 JSON",uploading:"上传中...",jsonPlaceholder:"粘贴插件 JSON 配置...",install:"安装插件",noPlugins:"未安装插件",noPluginsDescription:"添加插件以扩展功能",loading:"加载插件中...",installed:"已安装插件",active:"已激活插件",activeLabel:"已激活",inactive:"未激活",activate:"激活",deactivate:"停用",models:"模型",apiKeySet:"API 密钥已设置",apiKeyConfiguration:"API 密钥配置",apiKeyEnvAlternative:"或者设置",environmentVariable:"环境变量",apiKeyConfigured:"API 密钥已配置",apiKeyPlaceholder:"输入您的 API 密钥...",saveApiKey:"保存 API 密钥",apiKey:{title:"API 密钥",placeholder:"输入 API 密钥",save:"保存密钥",remove:"移除密钥",configured:"API 密钥已配置",notConfigured:"需要 API 密钥",saved:"API 密钥保存成功",removed:"API 密钥已移除",saveFailed:"保存 API 密钥失败",removeFailed:"移除 API 密钥失败",enterKey:"请输入 API 密钥"}},generation:{title:"生成选项",description:"配置 AI 如何生成响应",coreParameters:"核心参数",temperature:"温度",temperatureDescription:"控制随机性。较低的值更专注,较高的值更有创意。",topP:"Top P",topPDescription:"通过核采样控制多样性。较低的值专注于更可能的词元。",topK:"Top K",topKDescription:"将词元选择限制为最可能的 K 个。设置为 0 以禁用。",minP:"Min P",minPDescription:"词元选择的最小概率阈值。",generationControl:"生成控制",maxTokens:"最大词元数",maxTokensDescription:"响应中生成的最大词元数。",repeatPenalty:"重复惩罚",repeatPenaltyDescription:"惩罚重复的词元。较高的值减少重复。",contextLength:"上下文长度",contextLengthDescription:"对话的最大上下文窗口大小。",seed:"种子",optional:"可选",random:"随机",seedDescription:"设置特定种子以获得可重复的输出。",advancedOptions:"高级选项",presencePenalty:"存在惩罚",presencePenaltyDescription:"惩罚出现在上下文中的词元。",frequencyPenalty:"频率惩罚",frequencyPenaltyDescription:"惩罚频繁使用的词元。",stopSequences:"停止序列",commaSeparated:"逗号分隔",stopSequencesDescription:"遇到时将停止生成的自定义词元。",resetDefaults:"重置为默认值",saveOptions:"保存选项",embeddingSettings:"嵌入设置",enableEmbeddings:"启用文档嵌入"},documents:{title:"文档设置",embeddings:{title:"嵌入",enable:"启用文档嵌入",model:"嵌入模型",modelDescription:"选择用于文档嵌入的模型",chunkSize:"分块大小",chunkSizeInTokens:"(词元数)",chunkSizeDescription:"嵌入的文本块大小",chunkOverlap:"分块重叠",chunkOverlapInTokens:"(词元数)",chunkOverlapDescription:"连续块之间的重叠",similarityThreshold:"相似度阈值",similarityDescription:"包含结果的最小相似度分数",status:"嵌入状态",statusLabel:"状态",available:"可用",unavailable:"不可用",chunksWithEmbeddings:"带嵌入的分块",coverage:"覆盖率",regenerate:"重新生成嵌入",regenerating:"重新生成中..."}},tts:{title:"语音合成",description:"配置语音合成设置以朗读消息",loadingProviders:"加载 TTS 提供商中...",noProviders:"无 TTS 提供商",noProvidersDescription:"配置支持 TTS 的插件以启用语音合成",enable:"启用 TTS",enableDescription:"允许对助手消息进行语音合成",autoPlay:"自动播放响应",autoPlayDescription:"自动朗读新的助手消息",voiceConfiguration:"语音配置",model:"TTS 模型",modelDescription:"选择用于语音合成的模型",voice:"声音",selectVoice:"选择声音",voiceDescription:"选择语音合成的声音",speed:"速度",speedSlow:"0.5x",speedNormal:"1.0x",speedFast:"2.0x",availableProviders:"可用提供商",models:"模型",test:"测试",testing:"测试中...",stop:"停止"},imageGen:{title:"图像生成",description:"配置图像生成设置和提供商",loadingProviders:"加载图像生成提供商中...",noProviders:"无图像生成提供商",noProvidersDescription:"配置支持图像生成的插件",enable:"启用图像生成",enableDescription:"允许在对话中进行 AI 图像生成",configuration:"配置",model:"模型",modelDescription:"选择用于图像生成的模型",size:"尺寸",sizeDescription:"生成图像的分辨率",quality:"质量",qualityDescription:"生成图像的质量级别",style:"风格",styleDescription:"生成图像的风格预设",availableProviders:"可用提供商",models:"模型"},data:{title:"数据管理",export:"导出数据",exportDescription:"下载所有数据,包括偏好设置、会话和文档。",exportAll:"导出所有数据",import:"导入数据",importDescription:"从之前的导出导入数据。",importData:"导入数据",importing:"导入中...",clearSessions:"清除会话",clearSessionsDescription:"删除所有聊天会话。此操作无法撤销。",clearAll:"全部清除",clearing:"清除中...",importOptions:"导入选项",importOptionsDescription:"选择如何处理现有数据",skipDuplicates:"跳过重复项",overwrite:"覆盖现有项",importResults:"导入结果",preferences:"偏好设置",imported:"已导入",failed:"失败",sessions:"会话",importedLabel:"已导入",skipped:"已跳过",documents:"文档",errors:"错误"},about:{title:"关于",versionLabel:"版本",ollama:{title:"Ollama 状态",version:"版本",healthy:"正常",unhealthy:"异常"},stats:{models:"模型",sessions:"会话"},features:{privacy:{title:"隐私优先",description:"您的数据保存在本地设备"},openSource:{title:"开源软件",description:"免费且开源的软件"},localInference:{title:"本地推理",description:"使用 Ollama 在本地运行 AI 模型"}},openSourceBy:"由 {{company}} 开源",links:{title:"链接",github:"GitHub",githubDescription:"查看源代码并贡献",website:"网站",websiteDescription:"访问我们的网站",ollama:"Ollama",ollamaDescription:"了解更多关于 Ollama",documentation:"文档",reportIssue:"报告问题",reportIssueDescription:"错误报告和功能请求"},version:"版本 {{version}}"}},Pf={title:"模型",subtitle:"拉取、管理和监控您的 Ollama 模型",installed:"已安装模型",available:"可用模型",pull:"拉取模型",pulling:"拉取中...",delete:"删除模型",deleting:"删除中...",size:"大小",modified:"修改时间",family:"系列",parameters:"参数",quantization:"量化",noModels:"未安装模型",pullFirst:"拉取模型以开始使用"},Mf={title:"角色",create:"创建角色",edit:"编辑角色",delete:"删除角色",name:"名称",description:"描述",systemPrompt:"系统提示词",model:"模型",avatar:"头像",background:"背景",noPersonas:"未创建角色",createFirst:"创建您的第一个角色以自定义聊天体验"},Df={title:"图库",subtitle:"您的 AI 生成图像库",imageCount:"{{count}} 张图片",generate:"生成图像",generateDescription:"使用 AI 创建图像",generating:"生成中...",prompt:"提示词",promptPlaceholder:"描述您想要生成的图像...",noImages:"尚未生成图像",download:"下载",delete:"删除",regenerate:"重新生成",model:"模型",size:"尺寸",quality:"质量",created:"创建时间"},jf={generic:"发生错误",network:"网络错误。请检查您的连接。",unauthorized:"您无权执行此操作。",notFound:"未找到请求的资源。",serverError:"服务器错误。请稍后重试。",validation:"请检查您的输入并重试。"},Af={title:"键盘快捷键",toggleSidebar:"切换侧边栏",openSettings:"打开设置",toggleDarkMode:"切换深色模式",showShortcuts:"显示键盘快捷键",closeModals:"关闭弹窗",groups:{navigation:"导航",settings:"设置",general:"通用",chat:"聊天"},actions:{sendMessage:"发送消息",newLine:"消息中换行"},footer:"按 {{key1}} 或 {{key2}} 显示此帮助",tooltip:"键盘快捷键"},zf={title:"模型",loading:"加载模型中...",systemStatus:{online:"Ollama 在线",offline:"Ollama 离线",models:"模型",models_plural:"模型",running:"运行中",vram:"显存"},sections:{pull:"拉取新模型",library:"浏览模型库",running:"运行中的模型",local:"本地模型",advanced:"高级操作"},pull:{placeholder:"输入模型名称(例如:llama3.2:3b、deepseek-r1:14b)",button:"拉取",cancel:"取消",popular:"热门模型:",browseAll:"在 ollama.com 浏览所有模型",success:"模型 {{name}} 拉取成功",cancelled:"模型拉取已取消",failed:"拉取模型失败",enterName:"请输入模型名称"},progress:{starting:"初始化中...",pulling:"下载模型中...",verifying:"验证完整性...",writing:"写入清单...",cleaning:"清理中..."},library:{available:"可用",search:"搜索模型...",noResults:"未找到符合条件的模型",installed:"已安装",more:"+{{count}} 更多",refresh:"刷新模型库"},local:{noModels:"尚未安装模型",pullToStart:"拉取上方的模型以开始使用",installed:"已安装",running:"运行中",info:"信息",copy:"复制",delete:"删除",deleteConfirm:'确定要删除模型 "{{name}}" 吗?',deleteSuccess:"模型 {{name}} 删除成功",deleteFailed:"删除模型失败"},advanced:{createModel:"创建模型",fromModelfile:"从 Modelfile",copyModel:"复制模型",duplicateExisting:"复制现有模型",testEmbeddings:"测试嵌入",generateVectors:"生成向量",healthCheck:"健康检查",testConnection:"测试连接",healthy:"Ollama 运行正常!"},modals:{details:{title:"模型详情",info:"模型信息",family:"系列",parameters:"参数",quantization:"量化",format:"格式",systemPrompt:"系统提示词",template:"模板",license:"许可证",modelfile:"Modelfile",noDetails:"无可用详情"},copy:{title:"复制模型",source:"源模型",selectModel:"选择模型...",newName:"新模型名称",placeholder:"例如:my-custom-model",copying:"复制中...",button:"复制模型",success:"模型已复制到 {{name}}",failed:"复制模型失败",enterBoth:"请输入源名称和目标名称"},create:{title:"创建自定义模型",name:"模型名称",namePlaceholder:"例如:my-assistant",modelfile:"Modelfile",modelfilePlaceholder:`FROM llama3.2
27
- SYSTEM You are a helpful assistant.`,docs:"Modelfile 文档",docsLink:"语法参考",creating:"创建中...",button:"创建模型",success:"模型 {{name}} 创建成功",failed:"创建模型失败",enterBoth:"请输入模型名称和 Modelfile 内容"},embeddings:{title:"测试嵌入",model:"嵌入模型",selectModel:"选择模型...",recommended:"推荐:nomic-embed-text、mxbai-embed-large",input:"输入文本",placeholder:"输入要生成嵌入的文本...",generating:"生成中...",button:"生成嵌入",result:"结果({{count}} 维)",success:"生成了 {{count}} 维嵌入向量",failed:"生成嵌入失败",enterBoth:"请选择模型并输入文本"}}},Nf={title:"角色",subtitle:"创建和管理具有自定义个性、记忆和行为的 AI 角色",loading:"加载角色中...",createButton:"创建角色",importExport:"导入/导出",stats:{title:"您的角色",count:"已创建 {{count}} 个角色",count_plural:"已创建 {{count}} 个角色"},empty:{title:"暂无角色",description:"创建您的第一个角色以开始个性化 AI 交互",button:"创建您的第一个角色"},deleteConfirm:'确定要删除 "{{name}}" 吗?',deleteSuccess:'角色 "{{name}}" 删除成功',downloadSuccess:'角色 "{{name}}" 下载成功',failed:"{{action}}角色失败"},Tf={title:{create:"创建新角色",edit:"编辑角色"},subtitle:{create:"创建具有自定义个性、记忆系统和自适应学习能力的新 AI 角色",edit:"使用高级记忆、自适应学习和智能参数自定义您的 AI 角色"},loading:"加载表单中...",saved:"已保存",tabs:{basic:"基础",parameters:"参数",memory:"记忆与学习",advanced:"高级"},basic:{name:"名称",namePlaceholder:"输入角色名称",model:"模型",selectModel:"选择模型",description:"描述",descriptionPlaceholder:"描述您的角色...",systemPrompt:"系统提示词",systemPromptPlaceholder:"输入定义角色行为的系统提示词...",systemPromptHint:"系统提示词定义了您的角色如何行为和响应。"},parameters:{temperature:"温度",temperatureHint:"控制创意性与一致性",topP:"Top-P",topPHint:"控制响应多样性",topK:"Top-K",topKHint:"将词汇限制为前 K 个词元",contextWindow:"上下文窗口",contextWindowHint:"最大对话历史长度",maxTokens:"最大词元数",maxTokensHint:"最大响应长度",repeatPenalty:"重复惩罚",repeatPenaltyHint:"减少重复响应"},memory:{title:"记忆系统",subtitle:"角色会随时间记住对话",enableHint:"启用记忆系统让您的角色记住对话并随时间建立上下文。",loading:"加载记忆状态中...",noData:"暂无记忆数据",memories:"记忆",mbUsed:"已用 MB",lastBackup:"上次备份",never:"从未",maxMemories:"最大记忆数",maxMemoriesHint:"此角色可以存储的记忆数量",retention:"记忆保留",retentionHint:"清理前保留记忆的天数",autoCleanup:"自动清理旧记忆",wipeAll:"清除所有记忆",wipeCannot:"此操作无法撤销",wipeButton:"清除",wiping:"清除中...",wipeConfirm:"确定要清除所有记忆吗?此操作无法撤销。",wipeSuccess:"已清除 {{count}} 条记忆"},learning:{title:"自适应学习",subtitle:"角色根据交互进化",enableHint:"启用自适应学习让您的角色根据交互进化和个性化响应。",speed:"学习速度",slow:"慢",slowDesc:"渐进变化",balanced:"平衡",balancedDesc:"适中节奏",fast:"快",fastDesc:"快速适应",autoAdapt:"自动适应用户偏好",whatLearns:"角色学习的内容:",conversationTone:"对话语气",responseStyle:"响应风格",userPreferences:"用户偏好",topicInterests:"话题兴趣"},advanced:{embeddingModel:"嵌入模型",embeddingHint:"选择用于记忆编码和语义搜索的模型。嵌入模型优先显示,其次是其他可用模型。",noModels:"未找到模型",embeddingModels:"嵌入模型",otherModels:"其他模型",installHint:"安装嵌入模型:",recommended:"推荐:nomic-embed-text、mxbai-embed-large、bge-m3、snowflake-arctic-embed",aboutTitle:"关于高级设置",aboutDescription:"嵌入模型被记忆系统用来理解语义含义并在对话中查找相关记忆。请选择适合您用例和可用资源的模型。"},actions:{cancel:"取消",save:"保存",saving:"保存中...",saveClose:"保存并关闭",create:"创建"},success:{created:"角色已创建",updated:"角色已更新"},error:{saveFailed:"保存失败"}},If={enhanced:"增强",systemPrompt:"系统提示词",memories:"记忆",use:"使用",editTooltip:"编辑角色",downloadTooltip:"下载角色",backup:"备份",exportDNA:"导出 DNA",wipeMemories:"清除记忆",wipeConfirm:"确定要清除此角色的所有记忆吗?此操作无法撤销。",wipeSuccess:"已清除 {{count}} 条记忆",backupSuccess:"角色备份下载成功",dnaSuccess:"角色 DNA 导出成功",failed:"{{action}}失败"},Cf={title:"用户管理",subtitle:"管理用户账户和权限",loading:"加载用户中...",createUser:"创建用户",search:"搜索用户...",noUsers:"未找到用户",noUsersMatching:"未找到符合搜索条件的用户",columns:{user:"用户",email:"邮箱",role:"角色",created:"创建时间",actions:"操作"},roles:{admin:"管理员",user:"用户"},noEmail:"无邮箱",deleteConfirm:'确定要删除用户 "{{name}}" 吗?',deleteSuccess:"用户删除成功",deleteFailed:"删除用户失败",cannotDeleteSelf:"您无法删除自己的账户",form:{title:{create:"创建用户",edit:"编辑用户"},username:"用户名",usernamePlaceholder:"输入用户名",email:"邮箱",emailPlaceholder:"输入邮箱(可选)",password:"密码",passwordPlaceholder:"输入密码",passwordHint:"留空以保持当前密码",role:"角色",creating:"创建中...",updating:"更新中...",createButton:"创建用户",updateButton:"更新用户",createSuccess:"用户创建成功",updateSuccess:"用户更新成功",createFailed:"创建用户失败",updateFailed:"更新用户失败"}},Ff={you:"您",assistant:"助手",system:"系统",copy:"复制",copyMessage:"复制消息",copied:"已复制!",regenerate:"重新生成",regenerateResponse:"重新生成响应",edit:"编辑",editSystemMessage:"编辑系统消息",saveChanges:"保存更改",cancelEditing:"取消编辑",delete:"删除",deleteConfirm:"删除此消息?",branch:"分支",speaking:"朗读中...",speakMessage:"朗读消息",stopSpeaking:"停止朗读",showMore:"显示更多",showLess:"显示更少",thinking:"思考中",systemMessagePlaceholder:"输入系统消息...",fullSizeImage:"全尺寸图像",startConversation:"开始对话",startConversationDescription:"发送消息开始与 AI 助手聊天。提问、获取代码帮助或进行自然对话。",scrollToBottom:"滚动到底部",newMessages:"新消息"},Ef={title:"图像库",noImages:"暂无图像",noImagesHint:"使用右侧面板生成您的第一张图像",delete:"删除",download:"下载",deleteConfirm:"确定要删除此图像吗?",deleteSuccess:"图像已删除",deleteFailed:"删除图像失败",downloadFailed:"下载图像失败",loadMore:"加载更多({{current}} / {{total}})",loadFailed:"加载图库失败"},Of={title:"生成图像",prompt:"提示词",promptPlaceholder:"描述您想要创建的图像...",model:"模型",selectModel:"选择模型",noModels:"没有可用的图像生成模型",configurePlugin:"配置支持图像生成的插件",size:"尺寸",quality:"质量",style:"风格",generate:"生成",generating:"生成中...",success:"图像生成成功",failed:"图像生成失败",enterPrompt:"请输入提示词"},Lf={title:"出错了",description:"我们遇到了意外错误。请尝试刷新页面。",tryAgain:"刷新页面",goHome:"返回首页",errorDetails:"错误详情(开发环境)"},Kf={title:"文档",upload:"上传文档",uploading:"上传中...",noDocuments:"未上传文档",uploadHint:"上传文档以在对话中使用",delete:"删除",deleteConfirm:"确定要删除此文档吗?",deleteSuccess:"文档已删除",deleteFailed:"删除文档失败",uploadSuccess:"文档上传成功",uploadFailed:"上传文档失败",types:"支持格式:PDF、TXT、MD、DOCX",unsupportedFileType:"仅支持 PDF 和 TXT 文件",fileSizeTooLarge:"文件大小必须小于 10MB",uploadSuccessWithName:'文档 "{{name}}" 上传成功',removeSuccess:"文档移除成功",removeFailed:"移除文档失败",removeError:"移除文档时发生错误",clickToUpload:"点击上传",orDragAndDrop:"或拖放文件",fileTypesAndSize:"PDF 或 TXT 文件,最大 10MB",uploadedDocuments:"已上传文档",removeDocument:"移除文档"},Bf={speak:"朗读",stop:"停止",speaking:"朗读中...",generateFailed:"生成语音失败",playbackFailed:"音频播放失败",stopSpeaking:"停止朗读",generatingSpeech:"生成语音中...",readAloud:"朗读"},Gf={title:"制品",code:"代码",preview:"预览",copy:"复制代码",copied:"已复制!",download:"下载",expand:"展开",collapse:"折叠",openInNewTab:"在新标签页打开",invalidSvg:"无效的 SVG 内容",invalidJson:"无效的 JSON 内容",previewMode:"预览模式",codeMode:"代码模式",copyContent:"复制内容",openInPanel:"在面板中打开",openInNewWindow:"在新窗口中打开",created:"创建时间",closePanelEsc:"关闭面板(Esc)",copyButton:"复制",open:"打开",dragEdgeToResize:"拖动边缘调整大小"},Hf={title:"导入和导出角色",description:"导出您的角色以分享,或从他人导入角色",exportPersonas:"导出角色",importPersonas:"导入角色",noPersonasToExport:"没有可导出的角色",personasAvailable:"{{count}} 个角色可用",personasAvailable_plural:"{{count}} 个角色可用",exportAll:"全部导出",uploadJsonFile:"上传 JSON 文件",pasteJsonLabel:"粘贴 JSON 数据",pasteJsonPlaceholder:"在此粘贴角色 JSON 数据...",importing:"导入中...",importButton:"导入角色",expectedFormat:"预期 JSON 格式:",exportSuccess:'角色 "{{name}}" 导出成功',exportFailed:"导出角色失败",exportAllSuccess:"全部 {{count}} 个角色导出成功",exportAllFailed:"导出角色失败",pasteJsonData:"请粘贴角色 JSON 数据",importMultipleSuccess:"成功导入 {{count}} 个角色",importMultipleFailed:"导入 {{count}} 个角色失败",importNoneFailed:"未能导入任何角色",importSuccess:"角色导入成功",importFailed:"导入角色失败"},Rf={common:bf,brand:kf,auth:ff,setup:yf,chat:vf,sidebar:xf,user:Sf,settings:wf,models:Pf,personas:Mf,gallery:Df,errors:jf,keyboard:Af,modelManager:zf,personaManager:Nf,personaForm:Tf,personaCard:If,userManager:Cf,chatMessage:Ff,imageGallery:Ef,imageGeneration:Of,errorBoundary:Lf,documents:Kf,ttsButton:Bf,artifacts:Gf,personaImportExport:Hf},Uf={ar:{translation:Ho},bn:{translation:gs},cs:{translation:Hs},da:{translation:gl},de:{translation:Hl},en:{translation:gd},es:{translation:Hd},fr:{translation:gc},hi:{translation:Hc},id:{translation:gu},is:{translation:Hu},it:{translation:gm},ja:{translation:Hm},ko:{translation:gp},ms:{translation:Hp},nl:{translation:gg},pl:{translation:Hg},pt:{translation:gh},ru:{translation:Hh},sv:{translation:gb},th:{translation:Hb},tr:{translation:gk},uk:{translation:Hk},vi:{translation:hf},zh:{translation:Rf}},$f=[{code:"ar",name:"Arabic",nativeName:"العربية",dir:"rtl"},{code:"bn",name:"Bengali",nativeName:"বাংলা",dir:"ltr"},{code:"cs",name:"Czech",nativeName:"Čeština",dir:"ltr"},{code:"da",name:"Danish",nativeName:"Dansk",dir:"ltr"},{code:"de",name:"German",nativeName:"Deutsch",dir:"ltr"},{code:"en",name:"English",nativeName:"English",dir:"ltr"},{code:"es",name:"Spanish",nativeName:"Español",dir:"ltr"},{code:"fr",name:"French",nativeName:"Français",dir:"ltr"},{code:"hi",name:"Hindi",nativeName:"हिन्दी",dir:"ltr"},{code:"id",name:"Indonesian",nativeName:"Bahasa Indonesia",dir:"ltr"},{code:"is",name:"Icelandic",nativeName:"Íslenska",dir:"ltr"},{code:"it",name:"Italian",nativeName:"Italiano",dir:"ltr"},{code:"ja",name:"Japanese",nativeName:"日本語",dir:"ltr"},{code:"ko",name:"Korean",nativeName:"한국어",dir:"ltr"},{code:"ms",name:"Malay",nativeName:"Bahasa Melayu",dir:"ltr"},{code:"nl",name:"Dutch",nativeName:"Nederlands",dir:"ltr"},{code:"pl",name:"Polish",nativeName:"Polski",dir:"ltr"},{code:"pt",name:"Portuguese",nativeName:"Português",dir:"ltr"},{code:"ru",name:"Russian",nativeName:"Русский",dir:"ltr"},{code:"sv",name:"Swedish",nativeName:"Svenska",dir:"ltr"},{code:"th",name:"Thai",nativeName:"ไทย",dir:"ltr"},{code:"tr",name:"Turkish",nativeName:"Türkçe",dir:"ltr"},{code:"uk",name:"Ukrainian",nativeName:"Українська",dir:"ltr"},{code:"vi",name:"Vietnamese",nativeName:"Tiếng Việt",dir:"ltr"},{code:"zh",name:"Chinese",nativeName:"中文",dir:"ltr"}],Vf=["ar","he","fa","ur"],Wf=n=>Vf.includes(n);de.use(Un).use($i).init({resources:Uf,fallbackLng:"en",debug:!1,interpolation:{escapeValue:!1},detection:{order:["localStorage","navigator","htmlTag"],caches:["localStorage"],lookupLocalStorage:"i18nextLng"}});const v=()=>{if(typeof window<"u"){const n=window.location.hostname,a=o=>o.some(s=>n===s||n.endsWith("."+s));if(a(["vercel.app","vercel.dev"])||a(["netlify.app","netlify.com"])||a(["github.io"])||n.startsWith("demo.")||n.startsWith("preview."))return!0}return!1},mn=()=>({isDemo:v(),message:"This is a demo version for presentation purposes only. The Ollama backend is not connected.",showBanner:!0,allowInteraction:!1});function R(...n){return di(ci(n))}function qf(n){const a=new Date(n),r=new Date().getTime()-a.getTime(),i=Math.floor(r/(1e3*60)),o=Math.floor(r/(1e3*60*60)),s=Math.floor(r/(1e3*60*60*24));return i<1?"Just now":i<60?`${i}m ago`:o<24?`${o}h ago`:s<7?`${s}d ago`:a.toLocaleDateString()}function Jf(){return Math.random().toString(36).substring(2)+Date.now().toString(36)}function _f(n,a){return n.length<=a?n:n.substring(0,a)+"..."}function Uy(n){const a=/^\[Thinking:\s*([\s\S]*?)\]\s*/i,t=/^<thinking>([\s\S]*?)<\/thinking>\s*/i,r=n.match(a);if(r)return{thinking:r[1].trim(),content:n.slice(r[0].length).trim()};const i=n.match(t);return i?{thinking:i[1].trim(),content:n.slice(i[0].length).trim()}:{thinking:null,content:n}}const I=({variant:n="primary",size:a="md",loading:t=!1,disabled:r,children:i,className:o,...s})=>{const d="inline-flex items-center justify-center rounded-xl font-medium transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed active:scale-[0.98] relative overflow-hidden",u={primary:"bg-primary-600 text-white shadow-sm hover:bg-primary-700 hover:shadow-md focus:ring-primary-500 dark:bg-primary-500 dark:hover:bg-primary-600 dark:focus:ring-primary-400",secondary:"bg-gray-50 text-gray-700 border border-gray-200 shadow-sm hover:bg-gray-100 hover:border-gray-300 hover:shadow-md focus:ring-gray-500 dark:bg-dark-200 dark:text-dark-700 dark:border-dark-300 dark:hover:bg-dark-300 dark:hover:border-dark-400",outline:"border border-gray-300 text-gray-700 bg-white shadow-sm hover:bg-gray-50 hover:border-gray-400 focus:ring-gray-500 dark:border-dark-300 dark:text-dark-700 dark:bg-dark-50 dark:hover:bg-dark-100 dark:hover:border-dark-400",ghost:"text-gray-600 hover:bg-gray-100 hover:text-gray-900 focus:ring-gray-500 dark:text-dark-500 dark:hover:bg-dark-200 dark:hover:text-dark-800",danger:"bg-error-500 text-white shadow-sm hover:bg-error-600 hover:shadow-md focus:ring-error-500 dark:bg-error-600 dark:hover:bg-error-700"},m={sm:"px-3 py-1.5 text-sm gap-1.5",md:"px-4 py-2.5 text-sm gap-2",lg:"px-6 py-3 text-base gap-2.5"};return e.jsxs("button",{className:R(d,u[n],m[a],o),disabled:r||t,...s,children:[t&&e.jsxs("svg",{className:"mr-2 h-4 w-4 animate-spin",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),i]})},Yf=({label:n,error:a,helper:t,className:r,id:i,...o})=>{const s=h.useId(),d=i||`input-${s}`;return e.jsxs("div",{className:"space-y-1",children:[n&&e.jsx("label",{htmlFor:d,className:"block text-sm font-medium text-gray-700 dark:text-dark-700",children:n}),e.jsx("input",{id:d,className:R("block w-full rounded-xl border border-gray-200 px-4 py-3 text-sm placeholder-gray-500 shadow-sm transition-all duration-200 bg-white text-gray-900","focus:border-primary-500 focus:ring-2 focus:ring-primary-500/20 focus:outline-none focus:shadow-md","dark:border-dark-300 dark:bg-dark-100 dark:text-dark-800 dark:placeholder-dark-500","dark:focus:border-primary-400 dark:focus:ring-primary-400/20",a&&"border-error-500 focus:border-error-500 focus:ring-error-500/20",r),...o}),a&&e.jsx("p",{className:"text-sm text-error-600 dark:text-error-400",children:a}),t&&!a&&e.jsx("p",{className:"text-sm text-gray-500 dark:text-dark-500",children:t})]})},$n=le.forwardRef(({label:n,error:a,helper:t,className:r,id:i,...o},s)=>{const d=h.useId(),u=i||`textarea-${d}`;return e.jsxs("div",{className:"space-y-1",children:[n&&e.jsx("label",{htmlFor:u,className:"block text-sm font-medium text-gray-700 dark:text-dark-700",children:n}),e.jsx("textarea",{ref:s,id:u,className:R("block w-full rounded-xl border border-gray-200 px-4 py-3 text-sm placeholder-gray-500 shadow-sm transition-all duration-200 resize-none bg-white text-gray-900","focus:border-primary-500 focus:ring-2 focus:ring-primary-500/20 focus:outline-none focus:shadow-md","dark:border-dark-300 dark:bg-dark-100 dark:text-dark-800 dark:placeholder-dark-500","dark:focus:border-primary-400 dark:focus:ring-primary-400/20",a&&"border-error-500 focus:border-error-500 focus:ring-error-500/20",r),...o}),a&&e.jsx("p",{className:"text-sm text-error-600 dark:text-error-400",children:a}),t&&!a&&e.jsx("p",{className:"text-sm text-gray-500 dark:text-dark-500",children:t})]})});$n.displayName="Textarea";const xe=({label:n,error:a,helper:t,options:r,className:i,id:o,...s})=>{const d=h.useId(),u=o||`select-${d}`;return e.jsxs("div",{className:"space-y-1",children:[n&&e.jsx("label",{htmlFor:u,className:"block text-sm font-medium text-gray-700 dark:text-dark-700",children:n}),e.jsx("select",{id:u,className:R("block w-full rounded-xl border border-gray-200 px-4 py-3 text-sm shadow-sm transition-all duration-200 bg-white text-gray-900","focus:border-primary-500 focus:ring-2 focus:ring-primary-500/20 focus:outline-none focus:shadow-md","dark:border-dark-300 dark:bg-dark-100 dark:text-dark-800","dark:focus:border-primary-400 dark:focus:ring-primary-400/20",a&&"border-error-500 focus:border-error-500 focus:ring-error-500/20",i),...s,children:r.map(m=>e.jsx("option",{value:m.value,children:m.label},m.value))}),a&&e.jsx("p",{className:"text-sm text-error-600 dark:text-error-400",children:a}),t&&!a&&e.jsx("p",{className:"text-sm text-gray-500 dark:text-dark-600",children:t})]})},Zf={'code[class*="language-"]':{background:"hsl(220, 13%, 18%)",color:"hsl(220, 14%, 71%)",textShadow:"0 1px rgba(0, 0, 0, 0.3)",fontFamily:'"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"2",OTabSize:"2",tabSize:"2",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none"},'pre[class*="language-"]':{background:"hsl(220, 13%, 18%)",color:"hsl(220, 14%, 71%)",textShadow:"0 1px rgba(0, 0, 0, 0.3)",fontFamily:'"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"2",OTabSize:"2",tabSize:"2",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",padding:"1em",margin:"0.5em 0",overflow:"auto",borderRadius:"0.3em"},'code[class*="language-"]::-moz-selection':{background:"hsl(220, 13%, 28%)",color:"inherit",textShadow:"none"},'code[class*="language-"] *::-moz-selection':{background:"hsl(220, 13%, 28%)",color:"inherit",textShadow:"none"},'pre[class*="language-"] *::-moz-selection':{background:"hsl(220, 13%, 28%)",color:"inherit",textShadow:"none"},'code[class*="language-"]::selection':{background:"hsl(220, 13%, 28%)",color:"inherit",textShadow:"none"},'code[class*="language-"] *::selection':{background:"hsl(220, 13%, 28%)",color:"inherit",textShadow:"none"},'pre[class*="language-"] *::selection':{background:"hsl(220, 13%, 28%)",color:"inherit",textShadow:"none"},':not(pre) > code[class*="language-"]':{padding:"0.2em 0.3em",borderRadius:"0.3em",whiteSpace:"normal"},comment:{color:"hsl(220, 10%, 40%)",fontStyle:"italic"},prolog:{color:"hsl(220, 10%, 40%)"},cdata:{color:"hsl(220, 10%, 40%)"},doctype:{color:"hsl(220, 14%, 71%)"},punctuation:{color:"hsl(220, 14%, 71%)"},entity:{color:"hsl(220, 14%, 71%)",cursor:"help"},"attr-name":{color:"hsl(29, 54%, 61%)"},"class-name":{color:"hsl(29, 54%, 61%)"},boolean:{color:"hsl(29, 54%, 61%)"},constant:{color:"hsl(29, 54%, 61%)"},number:{color:"hsl(29, 54%, 61%)"},atrule:{color:"hsl(29, 54%, 61%)"},keyword:{color:"hsl(286, 60%, 67%)"},property:{color:"hsl(355, 65%, 65%)"},tag:{color:"hsl(355, 65%, 65%)"},symbol:{color:"hsl(355, 65%, 65%)"},deleted:{color:"hsl(355, 65%, 65%)"},important:{color:"hsl(355, 65%, 65%)"},selector:{color:"hsl(95, 38%, 62%)"},string:{color:"hsl(95, 38%, 62%)"},char:{color:"hsl(95, 38%, 62%)"},builtin:{color:"hsl(95, 38%, 62%)"},inserted:{color:"hsl(95, 38%, 62%)"},regex:{color:"hsl(95, 38%, 62%)"},"attr-value":{color:"hsl(95, 38%, 62%)"},"attr-value > .token.punctuation":{color:"hsl(95, 38%, 62%)"},variable:{color:"hsl(207, 82%, 66%)"},operator:{color:"hsl(207, 82%, 66%)"},function:{color:"hsl(207, 82%, 66%)"},url:{color:"hsl(187, 47%, 55%)"},"attr-value > .token.punctuation.attr-equals":{color:"hsl(220, 14%, 71%)"},"special-attr > .token.attr-value > .token.value.css":{color:"hsl(220, 14%, 71%)"},".language-css .token.selector":{color:"hsl(355, 65%, 65%)"},".language-css .token.property":{color:"hsl(220, 14%, 71%)"},".language-css .token.function":{color:"hsl(187, 47%, 55%)"},".language-css .token.url > .token.function":{color:"hsl(187, 47%, 55%)"},".language-css .token.url > .token.string.url":{color:"hsl(95, 38%, 62%)"},".language-css .token.important":{color:"hsl(286, 60%, 67%)"},".language-css .token.atrule .token.rule":{color:"hsl(286, 60%, 67%)"},".language-javascript .token.operator":{color:"hsl(286, 60%, 67%)"},".language-javascript .token.template-string > .token.interpolation > .token.interpolation-punctuation.punctuation":{color:"hsl(5, 48%, 51%)"},".language-json .token.operator":{color:"hsl(220, 14%, 71%)"},".language-json .token.null.keyword":{color:"hsl(29, 54%, 61%)"},".language-markdown .token.url":{color:"hsl(220, 14%, 71%)"},".language-markdown .token.url > .token.operator":{color:"hsl(220, 14%, 71%)"},".language-markdown .token.url-reference.url > .token.string":{color:"hsl(220, 14%, 71%)"},".language-markdown .token.url > .token.content":{color:"hsl(207, 82%, 66%)"},".language-markdown .token.url > .token.url":{color:"hsl(187, 47%, 55%)"},".language-markdown .token.url-reference.url":{color:"hsl(187, 47%, 55%)"},".language-markdown .token.blockquote.punctuation":{color:"hsl(220, 10%, 40%)",fontStyle:"italic"},".language-markdown .token.hr.punctuation":{color:"hsl(220, 10%, 40%)",fontStyle:"italic"},".language-markdown .token.code-snippet":{color:"hsl(95, 38%, 62%)"},".language-markdown .token.bold .token.content":{color:"hsl(29, 54%, 61%)"},".language-markdown .token.italic .token.content":{color:"hsl(286, 60%, 67%)"},".language-markdown .token.strike .token.content":{color:"hsl(355, 65%, 65%)"},".language-markdown .token.strike .token.punctuation":{color:"hsl(355, 65%, 65%)"},".language-markdown .token.list.punctuation":{color:"hsl(355, 65%, 65%)"},".language-markdown .token.title.important > .token.punctuation":{color:"hsl(355, 65%, 65%)"},bold:{fontWeight:"bold"},italic:{fontStyle:"italic"},namespace:{Opacity:"0.8"},"token.tab:not(:empty):before":{color:"hsla(220, 14%, 71%, 0.15)",textShadow:"none"},"token.cr:before":{color:"hsla(220, 14%, 71%, 0.15)",textShadow:"none"},"token.lf:before":{color:"hsla(220, 14%, 71%, 0.15)",textShadow:"none"},"token.space:before":{color:"hsla(220, 14%, 71%, 0.15)",textShadow:"none"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item":{marginRight:"0.4em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button":{background:"hsl(220, 13%, 26%)",color:"hsl(220, 9%, 55%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a":{background:"hsl(220, 13%, 26%)",color:"hsl(220, 9%, 55%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span":{background:"hsl(220, 13%, 26%)",color:"hsl(220, 9%, 55%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:hover":{background:"hsl(220, 13%, 28%)",color:"hsl(220, 14%, 71%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:focus":{background:"hsl(220, 13%, 28%)",color:"hsl(220, 14%, 71%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:hover":{background:"hsl(220, 13%, 28%)",color:"hsl(220, 14%, 71%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:focus":{background:"hsl(220, 13%, 28%)",color:"hsl(220, 14%, 71%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:hover":{background:"hsl(220, 13%, 28%)",color:"hsl(220, 14%, 71%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:focus":{background:"hsl(220, 13%, 28%)",color:"hsl(220, 14%, 71%)"},".line-highlight.line-highlight":{background:"hsla(220, 100%, 80%, 0.04)"},".line-highlight.line-highlight:before":{background:"hsl(220, 13%, 26%)",color:"hsl(220, 14%, 71%)",padding:"0.1em 0.6em",borderRadius:"0.3em",boxShadow:"0 2px 0 0 rgba(0, 0, 0, 0.2)"},".line-highlight.line-highlight[data-end]:after":{background:"hsl(220, 13%, 26%)",color:"hsl(220, 14%, 71%)",padding:"0.1em 0.6em",borderRadius:"0.3em",boxShadow:"0 2px 0 0 rgba(0, 0, 0, 0.2)"},"pre[id].linkable-line-numbers.linkable-line-numbers span.line-numbers-rows > span:hover:before":{backgroundColor:"hsla(220, 100%, 80%, 0.04)"},".line-numbers.line-numbers .line-numbers-rows":{borderRightColor:"hsla(220, 14%, 71%, 0.15)"},".command-line .command-line-prompt":{borderRightColor:"hsla(220, 14%, 71%, 0.15)"},".line-numbers .line-numbers-rows > span:before":{color:"hsl(220, 14%, 45%)"},".command-line .command-line-prompt > span:before":{color:"hsl(220, 14%, 45%)"},".rainbow-braces .token.token.punctuation.brace-level-1":{color:"hsl(355, 65%, 65%)"},".rainbow-braces .token.token.punctuation.brace-level-5":{color:"hsl(355, 65%, 65%)"},".rainbow-braces .token.token.punctuation.brace-level-9":{color:"hsl(355, 65%, 65%)"},".rainbow-braces .token.token.punctuation.brace-level-2":{color:"hsl(95, 38%, 62%)"},".rainbow-braces .token.token.punctuation.brace-level-6":{color:"hsl(95, 38%, 62%)"},".rainbow-braces .token.token.punctuation.brace-level-10":{color:"hsl(95, 38%, 62%)"},".rainbow-braces .token.token.punctuation.brace-level-3":{color:"hsl(207, 82%, 66%)"},".rainbow-braces .token.token.punctuation.brace-level-7":{color:"hsl(207, 82%, 66%)"},".rainbow-braces .token.token.punctuation.brace-level-11":{color:"hsl(207, 82%, 66%)"},".rainbow-braces .token.token.punctuation.brace-level-4":{color:"hsl(286, 60%, 67%)"},".rainbow-braces .token.token.punctuation.brace-level-8":{color:"hsl(286, 60%, 67%)"},".rainbow-braces .token.token.punctuation.brace-level-12":{color:"hsl(286, 60%, 67%)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)":{backgroundColor:"hsla(353, 100%, 66%, 0.15)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)":{backgroundColor:"hsla(353, 100%, 66%, 0.15)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)":{backgroundColor:"hsla(137, 100%, 55%, 0.15)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)":{backgroundColor:"hsla(137, 100%, 55%, 0.15)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},".prism-previewer.prism-previewer:before":{borderColor:"hsl(224, 13%, 17%)"},".prism-previewer-gradient.prism-previewer-gradient div":{borderColor:"hsl(224, 13%, 17%)",borderRadius:"0.3em"},".prism-previewer-color.prism-previewer-color:before":{borderRadius:"0.3em"},".prism-previewer-easing.prism-previewer-easing:before":{borderRadius:"0.3em"},".prism-previewer.prism-previewer:after":{borderTopColor:"hsl(224, 13%, 17%)"},".prism-previewer-flipped.prism-previewer-flipped.after":{borderBottomColor:"hsl(224, 13%, 17%)"},".prism-previewer-angle.prism-previewer-angle:before":{background:"hsl(219, 13%, 22%)"},".prism-previewer-time.prism-previewer-time:before":{background:"hsl(219, 13%, 22%)"},".prism-previewer-easing.prism-previewer-easing":{background:"hsl(219, 13%, 22%)"},".prism-previewer-angle.prism-previewer-angle circle":{stroke:"hsl(220, 14%, 71%)",strokeOpacity:"1"},".prism-previewer-time.prism-previewer-time circle":{stroke:"hsl(220, 14%, 71%)",strokeOpacity:"1"},".prism-previewer-easing.prism-previewer-easing circle":{stroke:"hsl(220, 14%, 71%)",fill:"transparent"},".prism-previewer-easing.prism-previewer-easing path":{stroke:"hsl(220, 14%, 71%)"},".prism-previewer-easing.prism-previewer-easing line":{stroke:"hsl(220, 14%, 71%)"}},Xf={'code[class*="language-"]':{background:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)",fontFamily:'"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"2",OTabSize:"2",tabSize:"2",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none"},'pre[class*="language-"]':{background:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)",fontFamily:'"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"2",OTabSize:"2",tabSize:"2",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",padding:"1em",margin:"0.5em 0",overflow:"auto",borderRadius:"0.3em"},'code[class*="language-"]::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"] *::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'pre[class*="language-"] *::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"]::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"] *::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'pre[class*="language-"] *::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},':not(pre) > code[class*="language-"]':{padding:"0.2em 0.3em",borderRadius:"0.3em",whiteSpace:"normal"},comment:{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},prolog:{color:"hsl(230, 4%, 64%)"},cdata:{color:"hsl(230, 4%, 64%)"},doctype:{color:"hsl(230, 8%, 24%)"},punctuation:{color:"hsl(230, 8%, 24%)"},entity:{color:"hsl(230, 8%, 24%)",cursor:"help"},"attr-name":{color:"hsl(35, 99%, 36%)"},"class-name":{color:"hsl(35, 99%, 36%)"},boolean:{color:"hsl(35, 99%, 36%)"},constant:{color:"hsl(35, 99%, 36%)"},number:{color:"hsl(35, 99%, 36%)"},atrule:{color:"hsl(35, 99%, 36%)"},keyword:{color:"hsl(301, 63%, 40%)"},property:{color:"hsl(5, 74%, 59%)"},tag:{color:"hsl(5, 74%, 59%)"},symbol:{color:"hsl(5, 74%, 59%)"},deleted:{color:"hsl(5, 74%, 59%)"},important:{color:"hsl(5, 74%, 59%)"},selector:{color:"hsl(119, 34%, 47%)"},string:{color:"hsl(119, 34%, 47%)"},char:{color:"hsl(119, 34%, 47%)"},builtin:{color:"hsl(119, 34%, 47%)"},inserted:{color:"hsl(119, 34%, 47%)"},regex:{color:"hsl(119, 34%, 47%)"},"attr-value":{color:"hsl(119, 34%, 47%)"},"attr-value > .token.punctuation":{color:"hsl(119, 34%, 47%)"},variable:{color:"hsl(221, 87%, 60%)"},operator:{color:"hsl(221, 87%, 60%)"},function:{color:"hsl(221, 87%, 60%)"},url:{color:"hsl(198, 99%, 37%)"},"attr-value > .token.punctuation.attr-equals":{color:"hsl(230, 8%, 24%)"},"special-attr > .token.attr-value > .token.value.css":{color:"hsl(230, 8%, 24%)"},".language-css .token.selector":{color:"hsl(5, 74%, 59%)"},".language-css .token.property":{color:"hsl(230, 8%, 24%)"},".language-css .token.function":{color:"hsl(198, 99%, 37%)"},".language-css .token.url > .token.function":{color:"hsl(198, 99%, 37%)"},".language-css .token.url > .token.string.url":{color:"hsl(119, 34%, 47%)"},".language-css .token.important":{color:"hsl(301, 63%, 40%)"},".language-css .token.atrule .token.rule":{color:"hsl(301, 63%, 40%)"},".language-javascript .token.operator":{color:"hsl(301, 63%, 40%)"},".language-javascript .token.template-string > .token.interpolation > .token.interpolation-punctuation.punctuation":{color:"hsl(344, 84%, 43%)"},".language-json .token.operator":{color:"hsl(230, 8%, 24%)"},".language-json .token.null.keyword":{color:"hsl(35, 99%, 36%)"},".language-markdown .token.url":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url > .token.operator":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url-reference.url > .token.string":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url > .token.content":{color:"hsl(221, 87%, 60%)"},".language-markdown .token.url > .token.url":{color:"hsl(198, 99%, 37%)"},".language-markdown .token.url-reference.url":{color:"hsl(198, 99%, 37%)"},".language-markdown .token.blockquote.punctuation":{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},".language-markdown .token.hr.punctuation":{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},".language-markdown .token.code-snippet":{color:"hsl(119, 34%, 47%)"},".language-markdown .token.bold .token.content":{color:"hsl(35, 99%, 36%)"},".language-markdown .token.italic .token.content":{color:"hsl(301, 63%, 40%)"},".language-markdown .token.strike .token.content":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.strike .token.punctuation":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.list.punctuation":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.title.important > .token.punctuation":{color:"hsl(5, 74%, 59%)"},bold:{fontWeight:"bold"},italic:{fontStyle:"italic"},namespace:{Opacity:"0.8"},"token.tab:not(:empty):before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.cr:before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.lf:before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.space:before":{color:"hsla(230, 8%, 24%, 0.2)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item":{marginRight:"0.4em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},".line-highlight.line-highlight":{background:"hsla(230, 8%, 24%, 0.05)"},".line-highlight.line-highlight:before":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 8%, 24%)",padding:"0.1em 0.6em",borderRadius:"0.3em",boxShadow:"0 2px 0 0 rgba(0, 0, 0, 0.2)"},".line-highlight.line-highlight[data-end]:after":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 8%, 24%)",padding:"0.1em 0.6em",borderRadius:"0.3em",boxShadow:"0 2px 0 0 rgba(0, 0, 0, 0.2)"},"pre[id].linkable-line-numbers.linkable-line-numbers span.line-numbers-rows > span:hover:before":{backgroundColor:"hsla(230, 8%, 24%, 0.05)"},".line-numbers.line-numbers .line-numbers-rows":{borderRightColor:"hsla(230, 8%, 24%, 0.2)"},".command-line .command-line-prompt":{borderRightColor:"hsla(230, 8%, 24%, 0.2)"},".line-numbers .line-numbers-rows > span:before":{color:"hsl(230, 1%, 62%)"},".command-line .command-line-prompt > span:before":{color:"hsl(230, 1%, 62%)"},".rainbow-braces .token.token.punctuation.brace-level-1":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-5":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-9":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-2":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-6":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-10":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-3":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-7":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-11":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-4":{color:"hsl(301, 63%, 40%)"},".rainbow-braces .token.token.punctuation.brace-level-8":{color:"hsl(301, 63%, 40%)"},".rainbow-braces .token.token.punctuation.brace-level-12":{color:"hsl(301, 63%, 40%)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)":{backgroundColor:"hsla(353, 100%, 66%, 0.15)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)":{backgroundColor:"hsla(353, 100%, 66%, 0.15)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)":{backgroundColor:"hsla(137, 100%, 55%, 0.15)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)":{backgroundColor:"hsla(137, 100%, 55%, 0.15)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},".prism-previewer.prism-previewer:before":{borderColor:"hsl(0, 0, 95%)"},".prism-previewer-gradient.prism-previewer-gradient div":{borderColor:"hsl(0, 0, 95%)",borderRadius:"0.3em"},".prism-previewer-color.prism-previewer-color:before":{borderRadius:"0.3em"},".prism-previewer-easing.prism-previewer-easing:before":{borderRadius:"0.3em"},".prism-previewer.prism-previewer:after":{borderTopColor:"hsl(0, 0, 95%)"},".prism-previewer-flipped.prism-previewer-flipped.after":{borderBottomColor:"hsl(0, 0, 95%)"},".prism-previewer-angle.prism-previewer-angle:before":{background:"hsl(0, 0%, 100%)"},".prism-previewer-time.prism-previewer-time:before":{background:"hsl(0, 0%, 100%)"},".prism-previewer-easing.prism-previewer-easing":{background:"hsl(0, 0%, 100%)"},".prism-previewer-angle.prism-previewer-angle circle":{stroke:"hsl(230, 8%, 24%)",strokeOpacity:"1"},".prism-previewer-time.prism-previewer-time circle":{stroke:"hsl(230, 8%, 24%)",strokeOpacity:"1"},".prism-previewer-easing.prism-previewer-easing circle":{stroke:"hsl(230, 8%, 24%)",fill:"transparent"},".prism-previewer-easing.prism-previewer-easing path":{stroke:"hsl(230, 8%, 24%)"},".prism-previewer-easing.prism-previewer-easing line":{stroke:"hsl(230, 8%, 24%)"}};function Qf(n,a){let t;try{t=n()}catch{return}return{getItem:i=>{var o;const s=u=>u===null?null:JSON.parse(u,void 0),d=(o=t.getItem(i))!=null?o:null;return d instanceof Promise?d.then(s):s(d)},setItem:(i,o)=>t.setItem(i,JSON.stringify(o,void 0)),removeItem:i=>t.removeItem(i)}}const lt=n=>a=>{try{const t=n(a);return t instanceof Promise?t:{then(r){return lt(r)(t)},catch(r){return this}}}catch(t){return{then(r){return this},catch(r){return lt(r)(t)}}}},ey=(n,a)=>(t,r,i)=>{let o={storage:Qf(()=>localStorage),partialize:S=>S,version:0,merge:(S,F)=>({...F,...S}),...a},s=!1,d=0;const u=new Set,m=new Set;let g=o.storage;if(!g)return n((...S)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),t(...S)},r,i);const p=()=>{const S=o.partialize({...r()});return g.setItem(o.name,{state:S,version:o.version})},k=i.setState;i.setState=(S,F)=>(k(S,F),p());const x=n((...S)=>(t(...S),p()),r,i);i.getInitialState=()=>x;let b;const w=()=>{var S,F;if(!g)return;const L=++d;s=!1,u.forEach(A=>{var N;return A((N=r())!=null?N:x)});const D=((F=o.onRehydrateStorage)==null?void 0:F.call(o,(S=r())!=null?S:x))||void 0;return lt(g.getItem.bind(g))(o.name).then(A=>{if(A)if(typeof A.version=="number"&&A.version!==o.version){if(o.migrate){const N=o.migrate(A.state,A.version);return N instanceof Promise?N.then(P=>[!0,P]):[!0,N]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,A.state];return[!1,void 0]}).then(A=>{var N;if(L!==d)return;const[P,U]=A;if(b=o.merge(U,(N=r())!=null?N:x),t(b,!0),P)return p()}).then(()=>{L===d&&(D?.(b,void 0),b=r(),s=!0,m.forEach(A=>A(b)))}).catch(A=>{L===d&&D?.(void 0,A)})};return i.persist={setOptions:S=>{o={...o,...S},S.storage&&(g=S.storage)},clearStorage:()=>{g?.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>w(),hasHydrated:()=>s,onHydrate:S=>(u.add(S),()=>{u.delete(S)}),onFinishHydration:S=>(m.add(S),()=>{m.delete(S)})},o.skipHydration||w(),b||x},Vn=ey,be=Ca()(Vn((n,a)=>({theme:{mode:"light"},setTheme:t=>{n({theme:t}),document.documentElement.classList.remove("dark","ophelia"),t.mode==="dark"?document.documentElement.classList.add("dark"):t.mode==="ophelia"&&document.documentElement.classList.add("ophelia")},toggleTheme:()=>{const t=a().theme,r=["light","dark","ophelia"],o=(r.indexOf(t.mode)+1)%r.length;a().setTheme({mode:r[o]})},sidebarOpen:!0,sidebarCompact:!1,setSidebarOpen:t=>n({sidebarOpen:t}),setSidebarCompact:t=>n({sidebarCompact:t}),toggleSidebar:()=>n(t=>({sidebarOpen:!t.sidebarOpen})),toggleSidebarCompact:()=>n(t=>({sidebarCompact:!t.sidebarCompact})),artifactPanelOpen:!1,artifactPanelArtifact:null,openArtifactPanel:t=>n({artifactPanelOpen:!0,artifactPanelArtifact:t}),closeArtifactPanel:()=>n({artifactPanelOpen:!1,artifactPanelArtifact:null}),preferences:{theme:{mode:"light"},defaultModel:"",systemMessage:"",generationOptions:{temperature:.7,top_p:.9,top_k:40,num_predict:1024},embeddingSettings:{enabled:!1,model:"nomic-embed-text",chunkSize:1e3,chunkOverlap:200,similarityThreshold:.3},titleSettings:{autoTitle:!1,taskModel:""},showUsername:!1,backgroundSettings:{enabled:!1,imageUrl:"",blurAmount:10,opacity:.6}},setPreferences:t=>n(r=>({preferences:{...r.preferences,...t}})),loadPreferences:async()=>{try{const{preferencesApi:t}=await he(async()=>{const{preferencesApi:i}=await Promise.resolve().then(()=>Ma);return{preferencesApi:i}},void 0),r=await t.getPreferences();if(r.success&&r.data){const i=r.data;n(o=>({preferences:{...o.preferences,...i},backgroundImage:i.backgroundSettings?.imageUrl||null}))}}catch(t){console.warn("Failed to load preferences from backend:",t)}},isGenerating:!1,setIsGenerating:t=>n({isGenerating:t}),hasSeenSettingsNotification:!1,markSettingsNotificationAsSeen:()=>n({hasSeenSettingsNotification:!0}),isDemoMode:v(),demoConfig:mn(),setDemoMode:t=>{n({isDemoMode:t,demoConfig:mn()})},backgroundImage:null,setBackgroundImage:async t=>{if(n({backgroundImage:t}),t){const r=a(),i={...r.preferences,backgroundSettings:{enabled:!0,imageUrl:t,blurAmount:r.preferences.backgroundSettings?.blurAmount||10,opacity:r.preferences.backgroundSettings?.opacity||.6}};r.setPreferences(i);try{const{preferencesApi:o}=await he(async()=>{const{preferencesApi:s}=await Promise.resolve().then(()=>Ma);return{preferencesApi:s}},void 0);await o.updatePreferences({backgroundSettings:i.backgroundSettings})}catch(o){console.warn("Failed to save background settings to backend:",o)}}},uploadBackgroundImage:async t=>{try{const r=new FileReader;return new Promise((i,o)=>{r.onload=async s=>{try{const d=s.target?.result;await a().setBackgroundImage(d),i()}catch(d){o(d)}},r.onerror=o,r.readAsDataURL(t)})}catch(r){throw console.error("Failed to upload background image:",r),r}},removeBackgroundImage:async()=>{n({backgroundImage:null});const t=a(),r={enabled:!1,imageUrl:"",blurAmount:t.preferences.backgroundSettings?.blurAmount||10,opacity:t.preferences.backgroundSettings?.opacity||.6};t.setPreferences({backgroundSettings:r});try{const{preferencesApi:i}=await he(async()=>{const{preferencesApi:o}=await Promise.resolve().then(()=>Ma);return{preferencesApi:o}},void 0);await i.updatePreferences({backgroundSettings:r})}catch(i){console.warn("Failed to save background removal to backend:",i)}},clearUserState:()=>{n({backgroundImage:null,preferences:{theme:{mode:"light"},defaultModel:"",systemMessage:"",generationOptions:{temperature:.7,top_p:.9,top_k:40,num_predict:1024},embeddingSettings:{enabled:!1,model:"nomic-embed-text",chunkSize:1e3,chunkOverlap:200,similarityThreshold:.3},titleSettings:{autoTitle:!1,taskModel:""},showUsername:!1,backgroundSettings:{enabled:!1,imageUrl:"",blurAmount:10,opacity:.6}}})}}),{name:"libre-webui-app-state",partialize:n=>{const{backgroundSettings:a,...t}=n.preferences;return{theme:n.theme,sidebarOpen:n.sidebarOpen,sidebarCompact:n.sidebarCompact,preferences:t,hasSeenSettingsNotification:n.hasSeenSettingsNotification}}})),ay=()=>{const{theme:n,setTheme:a}=be.getState();a(n)};typeof window<"u"&&ay();const ty={'code[class*="language-"]':{color:"#f8f8f2",background:"none",textShadow:"none",fontFamily:"'JetBrains Mono', Consolas, Monaco, 'Andale Mono', monospace",fontSize:"1em",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",wordWrap:"normal",lineHeight:"1.5",tabSize:4,hyphens:"none"},'pre[class*="language-"]':{color:"#f8f8f2",background:"#1a1b26",textShadow:"none",fontFamily:"'JetBrains Mono', Consolas, Monaco, 'Andale Mono', monospace",fontSize:"1em",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",wordWrap:"normal",lineHeight:"1.5",tabSize:4,hyphens:"none",padding:"1em",margin:".5em 0",overflow:"auto",borderRadius:"0.5rem"},comment:{color:"#6272a4"},prolog:{color:"#6272a4"},doctype:{color:"#6272a4"},cdata:{color:"#6272a4"},punctuation:{color:"#f8f8f2"},property:{color:"#ff79c6"},tag:{color:"#ff79c6"},boolean:{color:"#bd93f9"},number:{color:"#bd93f9"},constant:{color:"#bd93f9"},symbol:{color:"#bd93f9"},deleted:{color:"#ff5555"},selector:{color:"#50fa7b"},"attr-name":{color:"#50fa7b"},string:{color:"#f1fa8c"},char:{color:"#f1fa8c"},builtin:{color:"#8be9fd"},inserted:{color:"#50fa7b"},operator:{color:"#ff79c6"},entity:{color:"#f8f8f2",cursor:"help"},url:{color:"#8be9fd"},".language-css .token.string":{color:"#f1fa8c"},".style .token.string":{color:"#f1fa8c"},atrule:{color:"#ff79c6"},"attr-value":{color:"#f1fa8c"},keyword:{color:"#ff79c6"},function:{color:"#50fa7b"},"class-name":{color:"#8be9fd"},regex:{color:"#f1fa8c"},important:{color:"#ff5555",fontWeight:"bold"},variable:{color:"#f8f8f2"}},ny={js:"javascript",ts:"typescript",py:"python",sh:"bash",shell:"bash",c:"cpp","c++":"cpp"},ry=["javascript","typescript","python","java","cpp","bash","json","markdown","css","html","jsx","xml"],pn=({children:n,language:a,isDark:t=!1,className:r=""})=>{const{theme:i}=be(),o=i.mode==="ophelia",s=ny[a.toLowerCase()]||a.toLowerCase();if(!ry.includes(s))return e.jsx("pre",{className:`bg-gray-100 dark:bg-dark-200 ophelia:bg-[#1a1b26] p-3 rounded-lg overflow-x-auto text-sm font-mono ${r}`,children:e.jsx("code",{className:"ophelia:text-[#f8f8f2]",children:n})});const d=o?ty:t?Zf:Xf;return e.jsx(Kr,{language:s,style:d,className:r,customStyle:{margin:0,padding:"0.75rem",borderRadius:"0.5rem",fontSize:"0.875rem",...o&&{background:"#1a1b26"}},showLineNumbers:!1,children:n})},iy={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_APP_VERSION:"0.3.4"},oy=()=>window.location.protocol==="file:"?"http://localhost:3001/api":`${window.location.origin}/api`,ke=oy(),sy=()=>{console.log("🚀 API_BASE_URL configured as:",ke),console.log("🌐 Window location:",window.location),console.log("🔧 Environment variables:",iy)};sy();console.log("📱 User agent:",navigator.userAgent);console.log("🎭 Demo mode detected:",v());const j=(n,a=!0)=>new Promise(t=>{setTimeout(()=>{t({success:a,data:n,error:a?void 0:"Demo mode: Backend not available"})},500)}),Pa=[{name:"llama3.2:3b",size:2048e6,digest:"demo-digest-1",modified_at:new Date().toISOString(),details:{format:"gguf",family:"llama",families:["llama"],parameter_size:"3B",quantization_level:"Q4_0"}},{name:"qwen2.5:7b",size:4096e6,digest:"demo-digest-2",modified_at:new Date().toISOString(),details:{format:"gguf",family:"qwen",families:["qwen"],parameter_size:"7B",quantization_level:"Q4_0"}}],Wn=()=>[{id:"demo-session-1",title:"Demo Chat Session",model:Pa[0].name,messages:[{id:"demo-msg-1",role:"user",content:"Hello! Can you tell me about this demo?",timestamp:Date.now()},{id:"demo-msg-2",role:"assistant",content:"This is a demo of Libre WebUI! In a real deployment, I would be powered by Ollama running locally on your machine. This demo shows the beautiful interface and features without the backend connection.",timestamp:Date.now()}],createdAt:Date.now(),updatedAt:Date.now()}],ly=Wn(),dy=3e5,y=nt.create({baseURL:ke,timeout:dy});y.interceptors.request.use(n=>{const a=localStorage.getItem("auth-token");return a&&(n.headers.Authorization=`Bearer ${a}`),n},n=>Promise.reject(n));y.interceptors.response.use(n=>n,n=>n.response?.status===401?(console.warn("🔒 Session expired or unauthorized, logging out..."),localStorage.removeItem("auth-token"),he(async()=>{const{useAuthStore:a}=await Promise.resolve().then(()=>gy);return{useAuthStore:a}},void 0).then(({useAuthStore:a})=>{a.getState().logout()}),window.location.pathname!=="/login"&&(window.location.href="/login"),Promise.reject(new Error("Session expired"))):(console.error("API Error:",n),Promise.reject(n)));const ze={getSessions:()=>y.get("/chat/sessions").then(n=>n.data),createSession:(n,a,t)=>y.post("/chat/sessions",{model:n,title:a,personaId:t}).then(r=>r.data),getSession:n=>{if(v()){const a=Wn().find(t=>t.id===n);return a?j(a):Promise.resolve({success:!1,error:"Session not found in demo mode"})}return y.get(`/chat/sessions/${n}`).then(a=>a.data)},updateSession:(n,a)=>{if(v()){const t=ly.find(r=>r.id===n);if(t){const r={...t,...a,updatedAt:Date.now()};return j(r)}return Promise.resolve({success:!1,error:"Session not found in demo mode"})}return y.put(`/chat/sessions/${n}`,a).then(t=>t.data)},deleteSession:n=>v()?j(null):y.delete(`/chat/sessions/${n}`).then(a=>a.data),clearAllSessions:()=>y.delete("/chat/sessions").then(n=>n.data),generateTitle:(n,a,t)=>{if(v()){const r=t.substring(0,30)+(t.length>30?"...":"");return j({title:r})}return y.post(`/chat/sessions/${n}/generate-title`,{model:a,message:t}).then(r=>r.data)},sendMessage:(n,a,t)=>y.post(`/chat/sessions/${n}/messages`,{content:a,options:t}).then(r=>r.data),saveMessage:(n,a)=>y.post(`/chat/sessions/${n}/messages`,a).then(t=>t.data),updateMessage:(n,a,t)=>v()?j({}):y.put(`/chat/sessions/${n}/messages/${a}`,t).then(r=>r.data),generateChatResponse:(n,a,t)=>y.post(`/chat/sessions/${n}/generate`,{message:a,options:t}).then(r=>r.data),generateChatStreamResponse:(n,a,t)=>({subscribe:async(r,i,o)=>{try{const s=await fetch(`${ke}/chat/sessions/${n}/generate/stream`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:a,options:t})});if(!s.ok)throw new Error(`HTTP error! status: ${s.status}`);const d=s.body?.getReader();if(!d)throw new Error("No response body reader available");const u=new TextDecoder;let m="";const g=()=>{d.read().then(({done:p,value:k})=>{if(p){o?.();return}m+=u.decode(k,{stream:!0});const x=m.split(`
28
- `);m=x.pop()||"";for(const b of x){const w=b.trim();if(w.startsWith("data: ")){const S=w.slice(6);if(S==="[DONE]"){o?.();return}try{const F=JSON.parse(S);if(r(F),F.type==="done"||F.type==="error"){F.type==="error"?i?.(F.error):o?.();return}}catch(F){console.error("Failed to parse SSE data:",F)}}}g()}).catch(p=>{i?.(p instanceof Error?p:new Error(String(p)))})};return g(),()=>d.cancel()}catch(s){return i?.(s instanceof Error?s:new Error(String(s))),()=>{}}}}),getMessageBranches:(n,a)=>v()?j([]):y.get(`/chat/sessions/${n}/messages/${a}/branches`).then(t=>t.data),switchMessageBranch:(n,a,t)=>v()?j({}):y.post(`/chat/sessions/${n}/messages/${a}/branch`,{branchIndex:t}).then(r=>r.data),createMessageBranch:(n,a,t)=>v()?j({}):y.post(`/chat/sessions/${n}/messages/${a}/branches`,{...t}).then(r=>r.data)},Fe={checkHealth:()=>v()?j({status:"offline"},!1):y.get("/ollama/health").then(n=>n.data),getModels:()=>v()?j(Pa):y.get("/ollama/models").then(n=>n.data),pullModel:n=>v()?j(null,!1):y.post(`/ollama/models/${n}/pull`).then(a=>a.data),pullModelStream:(n,a,t,r)=>{if(v()){let o=0;const s=setInterval(()=>{o+=Math.random()*20,o>=100?(o=100,a({status:"success",total:100,completed:100,percent:100}),clearInterval(s),setTimeout(t,500)):a({status:"pulling",total:100,completed:o,percent:Math.round(o)})},1e3);return()=>clearInterval(s)}const i=new EventSource(`${ke}/ollama/models/${n}/pull/stream`);return i.onmessage=o=>{const s=JSON.parse(o.data);switch(s.type){case"progress":a({status:s.status,digest:s.digest,total:s.total,completed:s.completed,percent:s.percent});break;case"complete":i.close(),t();break;case"error":i.close(),r(s.error);break}},i.onerror=()=>{i.close(),r("Connection to server lost")},()=>{i.close()}},deleteModel:n=>v()?j(null,!1):y.delete(`/ollama/models/${n}`).then(a=>a.data),showModel:(n,a=!1)=>{if(v()){const t=Pa.find(r=>r.name===n);return j(t||null,!!t)}return y.get(`/ollama/models/${n}`,{params:{verbose:a}}).then(t=>t.data)},createModel:n=>v()?j(null,!1):y.post("/ollama/models",n).then(a=>a.data),copyModel:(n,a)=>v()?j(null,!1):y.post("/ollama/models/copy",{source:n,destination:a}).then(t=>t.data),pushModel:n=>v()?j(null,!1):y.post(`/ollama/models/${n}/push`).then(a=>a.data),pullAllModels:()=>v()?j(null,!1):y.post("/ollama/models/pull-all").then(n=>n.data),pullAllModelsStream:(n,a,t)=>{if(v()){const i=Pa;let o=0;const s=setInterval(()=>{o++,o<=i.length&&n({current:o,total:i.length,modelName:i[o-1]?.name||"demo-model",status:Math.random()>.1?"success":"error",error:Math.random()>.1?void 0:"Demo error"}),o>=i.length&&(clearInterval(s),setTimeout(a,500))},1e3);return}const r=new EventSource(`${ke}/ollama/models/pull-all/stream`);r.onmessage=i=>{const o=JSON.parse(i.data);switch(o.type){case"progress":n({current:o.current,total:o.total,modelName:o.modelName,status:o.status,error:o.error});break;case"complete":r.close(),a();break;case"error":r.close(),t(o.error);break}},r.onerror=()=>{r.close(),t("Connection to server lost")}},generateEmbeddings:n=>v()?j({embeddings:[[]]},!1):y.post("/ollama/embed",n).then(a=>a.data),listRunningModels:()=>v()?j([]):y.get("/ollama/running").then(n=>n.data),getVersion:()=>v()?j({version:"demo-mode"},!1):y.get("/ollama/version").then(n=>n.data),chatCompletion:n=>v()?j({message:{content:"Demo response",role:"assistant"}},!1):y.post("/ollama/chat",n).then(a=>a.data),checkBlobExists:n=>v()?Promise.resolve(!1):y.head(`/ollama/blobs/${n}`).then(()=>!0).catch(()=>!1),pushBlob:(n,a)=>v()?j(null,!1):y.post(`/ollama/blobs/${n}`,a,{headers:{"Content-Type":"application/octet-stream"}}).then(t=>t.data),generateLegacyEmbeddings:n=>v()?j({embedding:[]},!1):y.post("/ollama/embeddings",n).then(a=>a.data),getLibraryModels:()=>v()?j([{name:"llama3.2",description:"Meta's latest Llama model",category:"general",sizes:["1b","3b"],pulls:"50M+",tags:["general"]},{name:"deepseek-r1",description:"Open reasoning model",category:"reasoning",sizes:["7b","14b","32b"],pulls:"200M+",tags:["reasoning"]}]):y.get("/ollama/library").then(n=>n.data)},se={getAllPlugins:()=>v()?j([]):y.get("/plugins").then(n=>n.data),uploadPlugin:n=>{if(v())return j({},!1);const a=new FormData;return a.append("plugin",n),y.post("/plugins/upload",a).then(t=>t.data)},installPlugin:n=>v()?j({},!1):y.post("/plugins/install",n).then(a=>a.data),updatePlugin:(n,a)=>v()?j({},!1):y.put(`/plugins/${n}`,a).then(t=>t.data),deletePlugin:n=>v()?j(void 0):y.delete(`/plugins/${n}`).then(a=>a.data),activatePlugin:n=>v()?j({},!1):y.post(`/plugins/activate/${n}`).then(a=>a.data),deactivatePlugin:n=>{if(v())return j(void 0);const a=n?`/plugins/deactivate/${n}`:"/plugins/deactivate";return y.post(a).then(t=>t.data)},getActivePlugin:()=>v()?j(null):y.get("/plugins/active").then(n=>n.data),getPluginStatus:()=>v()?j([]):y.get("/plugins/status").then(n=>n.data),exportPlugin:n=>v()?Promise.resolve(new Blob(["{}"],{type:"application/json"})):y.get(`/plugins/${n}/export`,{responseType:"blob"}).then(a=>a.data),getCredentials:()=>v()?j([]):y.get("/plugins/credentials/all").then(n=>n.data),setApiKey:(n,a)=>v()?j(!1,!1):y.post(`/plugins/${n}/credentials`,{api_key:a}).then(t=>t.data),deleteApiKey:n=>v()?j(!1,!1):y.delete(`/plugins/${n}/credentials`).then(a=>a.data),checkApiKey:n=>v()?j(!1):y.get(`/plugins/${n}/credentials/check`).then(a=>a.data)},te={getPreferences:()=>y.get("/preferences").then(n=>n.data),updatePreferences:n=>y.put("/preferences",n).then(a=>a.data),setDefaultModel:n=>y.put("/preferences/default-model",{model:n}).then(a=>a.data),setSystemMessage:n=>y.put("/preferences/system-message",{message:n}).then(a=>a.data),setGenerationOptions:n=>y.put("/preferences/generation-options",n).then(a=>a.data),resetGenerationOptions:()=>y.post("/preferences/generation-options/reset").then(n=>n.data),setEmbeddingSettings:n=>y.put("/preferences/embedding-settings",n).then(a=>a.data),resetEmbeddingSettings:()=>y.post("/preferences/embedding-settings/reset").then(n=>n.data),importData:(n,a="replace")=>v()?j({theme:{mode:"dark"},defaultModel:"llama3.2",systemMessage:"You are a helpful assistant.",generationOptions:{},embeddingSettings:{enabled:!1,model:"nomic-embed-text",chunkSize:1e3,chunkOverlap:200,similarityThreshold:.7},showUsername:!1}):y.post("/preferences/import",{data:n,mergeStrategy:a}).then(t=>t.data)},dt={uploadDocument:(n,a)=>{if(v())return j({id:"demo-doc-"+Date.now(),filename:n.name,fileType:n.name.endsWith(".pdf")?"pdf":"txt",size:n.size,sessionId:a,uploadedAt:Date.now()});const t=new FormData;return t.append("document",n),a&&t.append("sessionId",a),y.post("/documents/upload",t).then(r=>r.data)},getDocuments:n=>{if(v())return j([]);const a=n?`/documents/session/${n}`:"/documents";return y.get(a).then(t=>t.data)},getDocument:n=>v()?j({id:n,filename:"demo-document.pdf",fileType:"pdf",size:1024,content:"Demo document content...",uploadedAt:Date.now()}):y.get(`/documents/${n}`).then(a=>a.data),searchDocuments:(n,a,t)=>v()?j([]):y.post("/documents/search",{query:n,sessionId:a,limit:t}).then(r=>r.data),deleteDocument:n=>v()?j(void 0):y.delete(`/documents/${n}`).then(a=>a.data),getEmbeddingStatus:()=>v()?j({available:!1,model:"nomic-embed-text",chunksWithEmbeddings:0,totalChunks:0}):y.get("/documents/embeddings/status").then(n=>n.data),regenerateEmbeddings:()=>v()?j(void 0):y.post("/documents/embeddings/regenerate").then(n=>n.data)},Te={login:n=>v()?j({user:{id:"demo-user",username:"demo",email:"demo@example.com",role:"admin",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()},token:"demo-token",systemInfo:{requiresAuth:!0,singleUserMode:!1,hasUsers:!0,version:"0.1.0"}}):y.post("/auth/login",n).then(a=>a.data),signup:n=>v()?j({user:{id:"demo-user-new",username:n.username,email:n.email||"",role:"user",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()},token:"demo-token-new",systemInfo:{requiresAuth:!0,singleUserMode:!1,hasUsers:!0,version:"0.1.0"}}):y.post("/auth/signup",n).then(a=>a.data),logout:()=>v()?j(void 0):y.post("/auth/logout").then(n=>n.data),getSystemInfo:()=>(console.log("getSystemInfo called, demo mode:",v()),v()?j({requiresAuth:!0,singleUserMode:!1,hasUsers:!0,version:"0.1.0"}):(console.log("🔍 Making API call to:",ke+"/auth/system-info"),console.log("🌐 Full URL from:",window.location.origin,"-> API:",ke+"/auth/system-info"),y.get("/auth/system-info").then(n=>(console.log("✅ getSystemInfo response:",n.data),n.data)).catch(n=>{throw console.error("❌ getSystemInfo error:",n),n.response&&(console.error("📄 Error response data:",n.response.data),console.error("🔢 Error status:",n.response.status),console.error("🔧 Error headers:",n.response.headers)),n.request&&console.error("📡 Network error - no response received:",n.request),console.error("🎯 Error config:",n.config),n}))),verifyToken:()=>v()?j({id:"demo-user",username:"demo",email:"demo@example.com",role:"admin",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}):y.get("/auth/verify").then(n=>n.data),getEncryptionKey:()=>v()?j({encryptionKey:"demo-encryption-key-not-real"}):y.get("/auth/encryption-key").then(n=>n.data)},qn={getUsers:()=>v()?j([{id:"demo-user",username:"demo",email:"demo@example.com",role:"admin",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}]):y.get("/users").then(n=>n.data),createUser:n=>v()?j({id:"new-user-"+Date.now(),username:n.username,email:n.email,role:n.role,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}):y.post("/users",n).then(a=>a.data),updateUser:(n,a)=>v()?j({id:n,username:a.username||"demo",email:a.email||"demo@example.com",role:a.role||"user",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}):y.patch(`/users/${n}`,a).then(t=>t.data),deleteUser:n=>v()?j(void 0):y.delete(`/users/${n}`).then(a=>a.data),updateMyAvatar:n=>v()?j({id:"demo-user",username:"demo",email:"demo@example.com",role:"admin",avatar:n,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}):y.patch("/users/me/avatar",{avatar:n}).then(a=>a.data)},pt={getPersonas:()=>{if(v()){const n=[{id:"demo-1",user_id:"default",name:"Creative Assistant",description:"Helpful assistant for creative tasks",model:"llama3.3:latest",parameters:{temperature:.8,top_p:.9,context_window:4096,system_prompt:"You are a creative and helpful assistant. Provide thoughtful and engaging responses."},avatar:"/images/creative-avatar.png",background:"/backgrounds/creative-bg.png",created_at:Date.now()-864e5,updated_at:Date.now()-864e5},{id:"demo-2",user_id:"default",name:"Research Assistant",description:"Academic assistant for research and learning",model:"qwen3:7b",parameters:{temperature:.3,top_p:.8,context_window:8192,system_prompt:"You are a knowledgeable research assistant. Provide detailed, informative explanations."},created_at:Date.now()-1728e5,updated_at:Date.now()-1728e5}];return j(n)}return y.get("/personas").then(n=>n.data)},getPersona:n=>{if(v()){const a={id:n,user_id:"default",name:"Sample Assistant",description:"A sample assistant for demonstration",model:"llama3.2:latest",parameters:{temperature:.7,top_p:.9,context_window:4096,system_prompt:"You are a helpful assistant."},created_at:Date.now(),updated_at:Date.now()};return j(a)}return y.get(`/personas/${n}`).then(a=>a.data)},createPersona:n=>{if(v()){const a={id:"demo-"+Date.now(),user_id:"default",...n,created_at:Date.now(),updated_at:Date.now()};return j(a)}return y.post("/personas",n).then(a=>a.data)},updatePersona:(n,a)=>{if(v()){const t={id:n,user_id:"default",name:a.name||"Updated Sample Assistant",description:a.description,model:a.model||"llama3.2:latest",parameters:a.parameters||{temperature:.7,top_p:.9,context_window:4096,system_prompt:"You are a helpful assistant."},avatar:a.avatar,background:a.background,created_at:Date.now()-864e5,updated_at:Date.now()};return j(t)}return y.put(`/personas/${n}`,a).then(t=>t.data)},deletePersona:n=>v()?j(void 0):y.delete(`/personas/${n}`).then(a=>a.data),exportPersona:n=>{if(v()){const a={name:"Sample Assistant",description:"A sample assistant for demonstration",model:"llama3.2:latest",params:{temperature:.7,top_p:.9,context_window:4096,system_prompt:"You are a helpful assistant."},exportedAt:Date.now(),version:"1.0.0"};return Promise.resolve(a)}return y.get(`/personas/${n}/export`).then(a=>a.data)},importPersona:n=>{if(v()){const a={id:"demo-imported-"+Date.now(),user_id:"default",name:n.name,description:n.description,model:n.model,parameters:n.params,avatar:n.avatar,background:n.background,created_at:Date.now(),updated_at:Date.now(),embedding_model:n.embedding_model,memory_settings:n.memory_settings,mutation_settings:n.mutation_settings};return j(a)}return y.post("/personas/import",n).then(a=>a.data)},getPersonasCount:()=>v()?j({count:2}):y.get("/personas/stats/count").then(n=>n.data),getDefaultParameters:()=>v()?j({temperature:.7,top_p:.9,top_k:40,context_window:4096,max_tokens:1024,system_prompt:"",repeat_penalty:1.1,presence_penalty:0,frequency_penalty:0}):y.get("/personas/defaults/parameters").then(n=>n.data),getMemoryStatus:n=>v()?j({status:"active",memory_count:42,last_backup:Date.now()-864e5,size_mb:2.3}):y.get(`/personas/${n}/memory/status`).then(a=>a.data),wipeMemories:n=>v()?j({deleted_count:42}):y.delete(`/personas/${n}/memory`).then(a=>a.data),backupPersona:n=>{if(v()){const a=JSON.stringify({persona_id:n,backup_date:new Date().toISOString(),data:"demo backup data"});return Promise.resolve(new Blob([a],{type:"application/json"}))}return y.get(`/personas/${n}/backup`,{responseType:"blob"}).then(a=>a.data)},exportPersonaDNA:n=>{if(v()){const a=JSON.stringify({persona_id:n,export_date:new Date().toISOString(),dna:"demo DNA data",memories:[],learned_behaviors:{}});return Promise.resolve(new Blob([a],{type:"application/json"}))}return y.get(`/personas/${n}/export/dna`,{responseType:"blob"}).then(a=>a.data)},importPersonaDNA:n=>{if(v()){const t={id:"demo-dna-"+Date.now(),user_id:"default",name:"Imported Persona",description:"Persona imported from DNA",model:"llama3.2:latest",parameters:{temperature:.7,top_p:.9,context_window:4096,system_prompt:"You are a helpful assistant."},created_at:Date.now(),updated_at:Date.now()};return j(t)}const a=new FormData;return a.append("dnaFile",n),y.post("/personas/import/dna",a).then(t=>t.data)},downloadPersona:async(n,a)=>{try{const t=await pt.exportPersona(n),r=new Blob([JSON.stringify(t,null,2)],{type:"application/json"}),i=URL.createObjectURL(r),o=document.createElement("a");o.href=i,o.download=`${a}.json`,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(i)}catch(t){throw console.error("Error while downloading persona:",t),new Error(`Failed to download persona: ${t instanceof Error?t.message:String(t)}`)}}},la={getModels:()=>v()?j([{model:"tts-1",plugin:"openai",config:{voices:["alloy","echo","fable","onyx","nova","shimmer"],default_voice:"alloy",formats:["mp3","opus","aac","flac","wav"],default_format:"mp3",max_characters:4096}}]):y.get("/tts/models").then(n=>n.data),getPlugins:()=>v()?j([{id:"openai",name:"OpenAI GPT",models:["tts-1","tts-1-hd"],config:{voices:["alloy","echo","fable","onyx","nova","shimmer"],default_voice:"alloy"}}]):y.get("/tts/plugins").then(n=>n.data),getVoices:n=>v()?j({voices:["alloy","echo","fable","onyx","nova","shimmer"],default_voice:"alloy",formats:["mp3","opus","aac","flac","wav"],default_format:"mp3",max_characters:4096,supports_streaming:!1}):y.get(`/tts/voices/${n}`).then(a=>a.data),generateBase64:n=>v()?j({audio:"",format:n.response_format||"mp3",mimeType:"audio/mpeg",size:0}):y.post("/tts/generate-base64",n).then(a=>a.data),generate:async n=>v()?new Blob([],{type:"audio/mpeg"}):(await y.post("/tts/generate",n,{responseType:"blob"})).data,speak:async(n,a={})=>{try{a.onStart?.();const t=await la.generateBase64({model:a.model||"tts-1",input:n,voice:a.voice,speed:a.speed,response_format:"mp3"});if(!t.success||!t.data?.audio)throw new Error(t.message||"Failed to generate speech");const r=`data:${t.data.mimeType};base64,${t.data.audio}`,i=new Audio(r);return i.onended=()=>a.onEnd?.(),i.onerror=()=>a.onError?.(new Error("Audio playback failed")),await i.play(),i}catch(t){const r=t instanceof Error?t:new Error("Unknown error");return a.onError?.(r),null}}},ct={getModels:()=>v()?j([{model:"dall-e-3",plugin:"openai",config:{sizes:["1024x1024","1792x1024","1024x1792"],default_size:"1024x1024",qualities:["standard","hd"],default_quality:"standard",styles:["vivid","natural"],default_style:"vivid",max_prompt_length:4e3}}]):y.get("/image-gen/models").then(n=>n.data),getPlugins:()=>v()?j([{id:"openai",name:"OpenAI DALL-E",models:["dall-e-3","dall-e-2"],config:{sizes:["1024x1024","1792x1024","1024x1792"],default_size:"1024x1024",qualities:["standard","hd"],default_quality:"standard"}}]):y.get("/image-gen/plugins").then(n=>n.data),getConfig:n=>v()?j({sizes:["1024x1024","1792x1024","1024x1792"],default_size:"1024x1024",qualities:["standard","hd"],default_quality:"standard",styles:["vivid","natural"],default_style:"vivid",max_prompt_length:4e3}):y.get(`/image-gen/config/${n}`).then(a=>a.data),generate:n=>v()?j({images:[{url:"https://placehold.co/1024x1024/purple/white?text=Demo+Image",revised_prompt:n.prompt}]}):y.post("/image-gen/generate",n).then(a=>a.data),getGallery:n=>v()?j({images:[],total:0}):y.get("/image-gen/gallery",{params:n}).then(a=>a.data),getGalleryImage:n=>v()?j({id:n,userId:"demo",prompt:"Demo image prompt",model:"dall-e-3",imageData:"https://placehold.co/1024x1024/purple/white?text=Demo",createdAt:Date.now()}):y.get(`/image-gen/gallery/${n}`).then(a=>a.data),deleteGalleryImage:n=>v()?j(void 0):y.delete(`/image-gen/gallery/${n}`).then(a=>a.data)},Ma=Object.freeze(Object.defineProperty({__proto__:null,authApi:Te,chatApi:ze,documentsApi:dt,imageGenApi:ct,ollamaApi:Fe,personaApi:pt,pluginApi:se,preferencesApi:te,ttsApi:la,usersApi:qn},Symbol.toStringTag,{value:"Module"})),cy=({className:n=""})=>{const{t:a}=ce(),{preferences:t,setPreferences:r,backgroundImage:i,uploadBackgroundImage:o,removeBackgroundImage:s}=be(),d=h.useRef(null),[u,m]=h.useState(!1),[g,p]=h.useState(!1),k=t.backgroundSettings||{enabled:!1,imageUrl:"",blurAmount:10,opacity:.6},x=async P=>{if(!P.type.startsWith("image/")){z.error("Please select a valid image file");return}if(P.size>5*1024*1024){z.error("Image file size must be less than 5MB");return}m(!0);try{await o(P),z.success("Background image uploaded successfully")}catch(U){console.error("Failed to upload background:",U),z.error("Failed to upload background image")}finally{m(!1)}},b=P=>{const U=P.target.files?.[0];U&&x(U)},w=P=>{P.preventDefault(),p(!0)},S=P=>{P.preventDefault(),p(!1)},F=P=>{P.preventDefault(),p(!1);const U=P.dataTransfer.files?.[0];U&&x(U)},L=()=>{s(),z.success("Background image removed")},D=async P=>{const U=i||k.imageUrl||"",q={...k,imageUrl:U,enabled:P};if(r({backgroundSettings:q}),U||!P)try{await te.updatePreferences({backgroundSettings:q})}catch(K){console.error("Failed to update preferences:",K)}},A=async P=>{const U=i||k.imageUrl||"",q={...k,imageUrl:U,blurAmount:P};if(r({backgroundSettings:q}),U)try{await te.updatePreferences({backgroundSettings:q})}catch(K){console.error("Failed to update preferences:",K)}},N=async P=>{const U=i||k.imageUrl||"",q={...k,imageUrl:U,opacity:P};if(r({backgroundSettings:q}),U)try{await te.updatePreferences({backgroundSettings:q})}catch(K){console.error("Failed to update preferences:",K)}};return e.jsx("div",{className:`space-y-4 ${n}`,children:e.jsxs("div",{children:[e.jsx("h4",{className:"text-md font-medium text-gray-900 dark:text-gray-100 mb-3",children:a("settings.appearance.background.title")}),e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:a("settings.appearance.background.enable")}),e.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:a("settings.appearance.background.enableDescription")})]}),e.jsxs("label",{className:"relative inline-flex items-center cursor-pointer",children:[e.jsx("input",{type:"checkbox",className:"sr-only peer",checked:k.enabled,onChange:P=>D(P.target.checked)}),e.jsx("div",{className:"w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-primary-300 dark:peer-focus:ring-primary-800 rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-primary-600"})]})]}),e.jsxs("div",{className:"space-y-4",children:[i?e.jsx("div",{className:"relative",children:e.jsxs("div",{className:"flex items-center gap-3 p-3 bg-gray-50 dark:bg-dark-200 rounded-lg",children:[e.jsx("div",{className:"flex-shrink-0",children:e.jsx("img",{src:i,alt:"Background preview",className:"w-12 h-12 object-cover rounded-md"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-gray-100 truncate",children:"Custom background image"}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"Click to change or remove"})]}),e.jsx(I,{variant:"ghost",size:"sm",onClick:L,className:"text-red-600 hover:text-red-700 hover:bg-red-50 dark:text-red-400 dark:hover:text-red-300 dark:hover:bg-red-900/20",children:e.jsx(Me,{className:"h-4 w-4"})})]})}):e.jsxs("div",{className:`border-2 border-dashed rounded-lg p-6 text-center cursor-pointer transition-colors ${g?"border-primary-500 bg-primary-50 dark:bg-primary-900/20":"border-gray-300 dark:border-gray-600 hover:border-gray-400 dark:hover:border-gray-500"}`,onDragOver:w,onDragLeave:S,onDrop:F,onClick:()=>d.current?.click(),children:[e.jsx(et,{className:"h-12 w-12 mx-auto text-gray-400 dark:text-gray-500 mb-4"}),e.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-gray-100 mb-2",children:a("settings.appearance.background.upload")}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-4",children:a("settings.appearance.background.dragDrop")}),e.jsxs(I,{variant:"outline",size:"sm",disabled:u,className:"mx-auto",children:[e.jsx(ja,{className:"h-4 w-4 mr-2"}),a(u?"common.loading":"settings.appearance.background.chooseImage")]})]}),e.jsx("input",{ref:d,type:"file",accept:"image/*",onChange:b,className:"hidden"})]}),i&&e.jsxs("div",{className:"space-y-4 mt-4",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:[a("settings.appearance.background.blur"),":"," ",k.blurAmount,"px"]}),e.jsx("input",{type:"range",min:"0",max:"30",step:"1",value:k.blurAmount,onChange:P=>A(parseInt(P.target.value)),className:"w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:[a("settings.appearance.background.opacity"),":"," ",Math.round(k.opacity*100),"%"]}),e.jsx("input",{type:"range",min:"0.1",max:"1",step:"0.1",value:k.opacity,onChange:P=>N(parseFloat(P.target.value)),className:"w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"})]})]})]})})},uy=()=>{const{t:n,i18n:a}=ce(),t=r=>{const i=r.target.value;a.changeLanguage(i)};return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(mt,{className:"h-4 w-4 text-gray-500 dark:text-gray-400"}),e.jsx("h4",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:n("settings.appearance.language.title")})]}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:n("settings.appearance.language.description")}),e.jsx("select",{value:a.language,onChange:t,className:"w-full px-3 py-2 text-sm border border-gray-200 dark:border-dark-300 rounded-lg bg-white dark:bg-dark-100 text-gray-900 dark:text-gray-100 focus:outline-none focus:ring-2 focus:ring-primary-500",children:$f.map(r=>e.jsxs("option",{value:r.code,children:[r.nativeName," (",r.name,")"]},r.code))})]})},Ae=(n,a)=>{if(n&&typeof n=="object"&&"response"in n){const t=n;if(t.response?.data?.error)return t.response.data.error}return n instanceof Error?n.message:a},Ne=Ca((n,a)=>({sessions:[],currentSession:null,setCurrentSession:t=>{n({currentSession:t})},createSession:async(t,r,i)=>{try{n({loading:!0,error:null});const o=await ze.createSession(t,r,i);if(o.success&&o.data){const s=o.data;return n(d=>({sessions:[s,...d.sessions],currentSession:s,loading:!1})),z.success("New chat created"),s}}catch(o){const s=Ae(o,"Failed to create session");n({error:s,loading:!1}),z.error(s)}},loadSessions:async()=>{try{n({loading:!0,error:null});const t=await ze.getSessions();t.success&&t.data&&n(r=>{const i=t.data||[],o=i.map(d=>d.id);let s=null;return r.currentSession&&o.includes(r.currentSession.id)?s=i.find(d=>d.id===r.currentSession.id)||null:i.length>0&&(s=i[0],r.currentSession&&console.warn("Previous currentSession not found in backend sessions:",r.currentSession.id)),{sessions:i,currentSession:s,loading:!1}})}catch(t){const r=Ae(t,"Failed to load sessions");n({error:r,loading:!1}),z.error(r)}},deleteSession:async t=>{try{const r=await ze.deleteSession(t);r.success?(n(i=>{const o=i.sessions.filter(d=>d.id!==t),s=i.currentSession?.id===t?o[0]||null:i.currentSession;return console.log("Store: Updating state, sessions count:",o.length),{sessions:o,currentSession:s}}),z.success("Chat deleted")):(console.error("Store: deleteSession failed:",r),z.error("Failed to delete chat"))}catch(r){console.error("Store: deleteSession error:",r);const i=Ae(r,"Failed to delete session");z.error(i)}},clearAllSessions:async()=>{try{n({loading:!0,error:null});const t=await ze.clearAllSessions();t.success?(n({sessions:[],currentSession:null,loading:!1}),z.success("All chat history cleared")):(console.error("Store: clearAllSessions failed:",t),z.error("Failed to clear chat history"),n({loading:!1}))}catch(t){console.error("Store: clearAllSessions error:",t);const r=Ae(t,"Failed to clear chat history");z.error(r),n({loading:!1})}},clearAllState:()=>{n({sessions:[],currentSession:null,models:[],selectedModel:"",systemMessage:"",loading:!1,error:null})},updateSessionTitle:async(t,r)=>{try{const i=await ze.updateSession(t,{title:r});i.success&&i.data&&(n(o=>({sessions:o.sessions.map(s=>s.id===t?i.data:s),currentSession:o.currentSession?.id===t?i.data:o.currentSession})),z.success("Chat title updated"))}catch(i){const o=Ae(i,"Failed to update session");z.error(o)}},addMessage:(t,r)=>{const i=a(),o=i.currentSession?.isPrivate&&i.currentSession?.id===t;if(!i.currentSession||!o&&!i.sessions.find(d=>d.id===i.currentSession?.id)){z.error("No valid chat session. Please create or select a chat."),console.error("addMessage blocked: currentSession is not valid",i.currentSession?.id);return}if(!o&&!i.sessions.find(d=>d.id===t)){z.error("Session not found or invalid. Please select or create a valid chat session."),console.error("addMessage blocked: sessionId not found in sessions",t);return}const s={...r,id:r.id||Jf(),timestamp:Date.now()};n(d=>{if(d.currentSession?.isPrivate&&d.currentSession?.id===t)return d.currentSession.messages.find(p=>p.id===s.id)?d:{...d,currentSession:{...d.currentSession,messages:[...d.currentSession.messages,s],updatedAt:Date.now()}};const u=d.sessions.find(g=>g.id===t);if(u&&u.messages.find(p=>p.id===s.id))return d;const m=d.sessions.map(g=>{if(g.id===t){let p=[...g.messages];if(s.parentId){const k=s.parentId;p=p.map(x=>x.id===k||x.parentId===k?{...x,isActive:!1,branchIndex:x.branchIndex??0,siblingCount:(s.branchIndex||0)+1}:x)}return p.push(s),{...g,messages:p,updatedAt:Date.now()}}return g});return{sessions:m,currentSession:d.currentSession?.id===t&&m.find(p=>p.id===t)||d.currentSession}})},updateMessage:(t,r,i)=>{n(o=>{if(o.currentSession?.id!==t)return o;if(o.currentSession?.isPrivate){const g=o.currentSession.messages.find(k=>k.id===r);if(!g||g.content===i)return o;const p=o.currentSession.messages.map(k=>k.id===r?{...k,content:i}:k);return{...o,currentSession:{...o.currentSession,messages:p,updatedAt:Date.now()}}}const s=o.sessions.find(g=>g.id===t);if(!s)return o;const d=s.messages.find(g=>g.id===r);if(!d||d.content===i)return o;const u=o.sessions.map(g=>{if(g.id===t){const p=g.messages.map(k=>k.id===r?{...k,content:i}:k);return{...g,messages:p,updatedAt:Date.now()}}return g}),m=o.currentSession?.id===t&&u.find(g=>g.id===t)||o.currentSession;return{sessions:u,currentSession:m}})},updateMessageWithStatistics:(t,r,i,o)=>{n(s=>{if(s.currentSession?.id!==t)return s;if(s.currentSession?.isPrivate){const m=s.currentSession.messages.map(g=>g.id===r?{...g,content:i,statistics:o}:g);return{...s,currentSession:{...s.currentSession,messages:m,updatedAt:Date.now()}}}const d=s.sessions.map(m=>{if(m.id===t){const g=m.messages.map(p=>p.id===r?{...p,content:i,statistics:o}:p);return{...m,messages:g,updatedAt:Date.now()}}return m}),u=s.currentSession&&s.currentSession.id===t&&d.find(m=>m.id===t)||s.currentSession;return{sessions:d,currentSession:u}})},models:[],loadModels:async()=>{try{n({loading:!0,error:null}),console.log("Loading models from API...");const t=await Fe.getModels();let r=[];t.success&&t.data&&(r=[...t.data],console.log("Ollama models loaded:",t.data.length));try{const i=await se.getAllPlugins();if(i.success&&i.data){const o=i.data.filter(s=>s.active&&s.type!=="tts"&&s.type!=="image");console.log("🔌 Active plugins found:",o.map(s=>s.name));for(const s of o)if(s.model_map){const d=s.model_map.map(u=>({name:u,model:u,size:0,digest:"",details:{parent_model:"",format:"",family:"",families:[],parameter_size:"",quantization_level:""},modified_at:new Date().toISOString(),expires_at:new Date().toISOString(),size_vram:0,isPlugin:!0,pluginName:s.name}));r.push(...d),console.log("Plugin models added:",d.length,"from",s.name)}}}catch(i){console.error("❌ Failed to load plugin models:",i),i instanceof Error&&console.error("❌ Plugin error details:",{message:i.message,response:i.response?.data,status:i.response?.status,url:i.config?.url})}try{const{personaApi:i}=await he(async()=>{const{personaApi:s}=await Promise.resolve().then(()=>Ma);return{personaApi:s}},void 0),o=await i.getPersonas();if(o.success&&o.data){const s=o.data.reduce((u,m)=>(u[m.id]=m,u),{}),d=o.data.map(u=>({name:`persona:${u.id}`,model:u.model,size:0,digest:"",details:{parent_model:u.model,format:"persona",family:"persona",families:["persona"],parameter_size:"",quantization_level:""},modified_at:new Date(u.updated_at).toISOString(),expires_at:new Date().toISOString(),size_vram:0,isPersona:!0,personaName:u.name,personaDescription:u.description}));r.push(...d),n(u=>({...u,personas:s}))}}catch(i){console.error("❌ Failed to load personas:",i)}console.log("Total models loaded:",r.length),n({models:r,loading:!1})}catch(t){console.error("Error loading models:",t);const r=Ae(t,"Failed to load models");n({error:r,loading:!1}),z.error(r)}},loadPreferences:async()=>{try{const t=await te.getPreferences();if(t.success&&t.data){const{defaultModel:r,systemMessage:i}=t.data;r&&(n({selectedModel:r}),console.log("✅ Loaded default model from backend:",r)),i!==void 0&&(n({systemMessage:i}),console.log("✅ Loaded system message from backend"))}}catch(t){console.warn("❌ Failed to load preferences from backend:",t)}},selectedModel:"",setSelectedModel:t=>{n({selectedModel:t}),te.setDefaultModel(t).catch(r=>{console.warn("Failed to save default model to backend:",r)})},updateCurrentSessionModel:async t=>{const r=a();if(!r.currentSession)throw new Error("No current session to update");try{const i=await ze.updateSession(r.currentSession.id,{model:t});i.success&&i.data&&(n(o=>({sessions:o.sessions.map(s=>s.id===o.currentSession?.id?i.data:s),currentSession:i.data,selectedModel:t})),z.success("Model updated for current chat"))}catch(i){const o=Ae(i,"Failed to update session model");throw z.error(o),i}},personas:{},loadPersonas:async()=>{try{n({loading:!0,error:null});const t=await pt.getPersonas();if(t.success&&t.data){const r=t.data;n({personas:r.reduce((i,o)=>(i[o.id]=o,i),{}),loading:!1}),console.log("✅ Personas loaded:",r.length)}}catch(t){const r=Ae(t,"Failed to load personas");n({error:r,loading:!1}),console.error("❌ Failed to load personas:",r)}},getCurrentPersona:()=>{const t=a();if(!t.currentSession||!t.currentSession.model?.startsWith("persona:"))return null;const r=t.currentSession.model.replace("persona:","");return t.personas[r]||null},systemMessage:"",setSystemMessage:t=>{const r=a();if(n({systemMessage:t}),te.setSystemMessage(t).catch(i=>{console.warn("Failed to save system message to backend:",i)}),r.currentSession){const i=r.currentSession.messages.findIndex(o=>o.role==="system");if(i!==-1){n(s=>{const d=s.sessions.map(m=>{if(m.id===s.currentSession?.id){const g=m.messages.map((p,k)=>k===i&&p.role==="system"?{...p,content:t,timestamp:Date.now()}:p);return{...m,messages:g,updatedAt:Date.now()}}return m}),u=s.currentSession?d.find(m=>m.id===s.currentSession.id)||s.currentSession:null;return{sessions:d,currentSession:u}});const o=r.currentSession.messages[i];ze.updateMessage(r.currentSession.id,o.id,{content:t}).catch(s=>{console.warn("Failed to sync system message update to backend:",s)}),console.log("✅ Updated system message in current session")}}},loading:!1,error:null,setError:t=>n({error:t}),generatingTitleForSession:null,setGeneratingTitleForSession:t=>n({generatingTitleForSession:t}),...typeof window<"u"&&{testPluginApi:async()=>{try{console.log("🧪 Testing plugin API...");const t=await se.getAllPlugins();return console.log("✅ Plugin API test result:",t),t}catch(t){return console.error("❌ Plugin API test failed:",t),{error:t}}}}})),gt=Ca((n,a)=>({plugins:[],pluginStatus:[],isLoading:!1,isUploading:!1,error:null,loadPlugins:async()=>{n({isLoading:!0,error:null});try{const t=await se.getAllPlugins();t.success&&t.data?n({plugins:t.data}):n({error:t.error||"Failed to load plugins"})}catch(t){n({error:t instanceof Error?t.message:"Failed to load plugins"})}finally{n({isLoading:!1})}},uploadPlugin:async t=>{n({isUploading:!0,error:null});try{const r=await se.uploadPlugin(t);r.success&&r.data?await a().loadPlugins():n({error:r.error||"Failed to upload plugin"})}catch(r){n({error:r instanceof Error?r.message:"Failed to upload plugin"})}finally{n({isUploading:!1})}},installPlugin:async t=>{n({isLoading:!0,error:null});try{const r=await se.installPlugin(t);r.success&&r.data?await a().loadPlugins():n({error:r.error||"Failed to install plugin"})}catch(r){n({error:r instanceof Error?r.message:"Failed to install plugin"})}finally{n({isLoading:!1})}},updatePlugin:async(t,r)=>{n({isLoading:!0,error:null});try{const i=await se.updatePlugin(t,r);i.success&&i.data?await a().loadPlugins():n({error:i.error||"Failed to update plugin"})}catch(i){n({error:i instanceof Error?i.message:"Failed to update plugin"})}finally{n({isLoading:!1})}},deletePlugin:async t=>{n({isLoading:!0,error:null});try{const r=await se.deletePlugin(t);r.success?await a().loadPlugins():n({error:r.error||"Failed to delete plugin"})}catch(r){n({error:r instanceof Error?r.message:"Failed to delete plugin"})}finally{n({isLoading:!1})}},activatePlugin:async t=>{n({isLoading:!0,error:null});try{const r=await se.activatePlugin(t);r.success?await a().loadPlugins():n({error:r.error||"Failed to activate plugin"})}catch(r){n({error:r instanceof Error?r.message:"Failed to activate plugin"})}finally{n({isLoading:!1})}},deactivatePlugin:async t=>{n({isLoading:!0,error:null});try{const r=await se.deactivatePlugin(t);r.success?await a().loadPlugins():n({error:r.error||"Failed to deactivate plugin"})}catch(r){n({error:r instanceof Error?r.message:"Failed to deactivate plugin"})}finally{n({isLoading:!1})}},loadPluginStatus:async()=>{try{const t=await se.getPluginStatus();t.success&&t.data&&n({pluginStatus:t.data})}catch(t){console.error("Failed to load plugin status:",t)}},exportPlugin:async t=>{n({isLoading:!0,error:null});try{const r=await se.exportPlugin(t),i=window.URL.createObjectURL(r),o=document.createElement("a");o.href=i,o.download=`${t}.json`,document.body.appendChild(o),o.click(),document.body.removeChild(o),window.URL.revokeObjectURL(i)}catch(r){n({error:r instanceof Error?r.message:"Failed to export plugin"})}finally{n({isLoading:!1})}},clearError:()=>n({error:null}),setError:t=>n({error:t})})),gn="0.3.4",Jn=({isOpen:n,onClose:a})=>{const{models:t,selectedModel:r,setSelectedModel:i,systemMessage:o,setSystemMessage:s,clearAllSessions:d,loading:u,sessions:m,loadModels:g,loadSessions:p}=Ne(),{theme:k,setTheme:x,preferences:b,setPreferences:w,loadPreferences:S}=be(),{plugins:F,isLoading:L,isUploading:D,error:A,loadPlugins:N,uploadPlugin:P,deletePlugin:U,activatePlugin:q,deactivatePlugin:K,exportPlugin:O,clearError:E,installPlugin:G}=gt(),{t:c}=ce(),[$,ue]=h.useState("appearance"),[V,Y]=h.useState(o),[J,me]=h.useState({modelsCount:0,sessionsCount:0,isHealthy:!1}),[ne,T]=h.useState(!1),[H,_]=h.useState(null),[Pe,De]=h.useState(!1),[ua,_e]=h.useState(!1),[Ye,Le]=h.useState(""),Ke=h.useRef(null),[Be,Ze]=h.useState(null),[C,ee]=h.useState({}),[W,Ge]=h.useState({}),[ma,ht]=h.useState({}),[pa,ga]=h.useState(null),[ge,Ea]=h.useState(b.generationOptions||{}),[Z,Oa]=h.useState(b.embeddingSettings||{enabled:!1,model:"nomic-embed-text",chunkSize:1e3,chunkOverlap:200,similarityThreshold:.7}),[re,Zn]=h.useState(null),[bt,kt]=h.useState(!1),[X,Xe]=h.useState(b.ttsSettings||{enabled:!1,autoPlay:!1,model:"",voice:"",speed:1,pluginId:""}),[He,Xn]=h.useState([]),[ft,Qn]=h.useState([]),[yt,La]=h.useState([]),[er,vt]=h.useState(!1),[xt,Qe]=h.useState(!1),[Ka,ha]=h.useState(null),[oe,ea]=h.useState(b.imageGenSettings||{enabled:!1,model:"",size:"1024x1024",quality:"standard",style:"vivid",pluginId:""}),[je,ar]=h.useState([]),[St,tr]=h.useState([]),[Ba,Ga]=h.useState([]),[wt,Ha]=h.useState([]),[Pt,Ra]=h.useState([]),[nr,Mt]=h.useState(!1),[ba,Dt]=h.useState(!1),[rr,Ua]=h.useState(!1),[$a,jt]=h.useState("skip"),[ye,aa]=h.useState(null),[At,Va]=h.useState(null),Re=h.useRef(null);h.useEffect(()=>{n&&(ka(),zt(),lr(),Y(o),Ea(b.generationOptions||{}),Oa(b.embeddingSettings||{enabled:!1,model:"nomic-embed-text",chunkSize:1e3,chunkOverlap:200,similarityThreshold:.7}),Xe(b.ttsSettings||{enabled:!1,autoPlay:!1,model:"",voice:"",speed:1,pluginId:""}),ea(b.imageGenSettings||{enabled:!1,model:"",size:"1024x1024",quality:"standard",style:"vivid",pluginId:""}),cr(),N(),ir(),g())},[n,o]);const ka=async()=>{try{const[l,f]=await Promise.all([Fe.checkHealth().catch(()=>({success:!1})),Fe.getVersion().catch(()=>({success:!1,data:null}))]);me({ollamaVersion:f.success&&f.data?f.data.version:void 0,modelsCount:t.length,sessionsCount:m.length,isHealthy:l.success})}catch(l){console.error("Failed to load system info:",l)}},ir=async()=>{try{const l=await se.getCredentials();if(l.success&&l.data){const f={};for(const M of l.data)f[M.plugin_id]=M.has_api_key;Ge(f)}}catch(l){console.error("Failed to load plugin credentials:",l)}},or=async l=>{const f=C[l];if(!f?.trim()){z.error("Please enter an API key");return}ga(l);try{const M=await se.setApiKey(l,f.trim());M.success?(z.success("API key saved successfully"),Ge(ae=>({...ae,[l]:!0})),ee(ae=>({...ae,[l]:""})),ht(ae=>({...ae,[l]:!1})),Ze(null)):z.error(M.error||"Failed to save API key")}catch{z.error("Failed to save API key")}finally{ga(null)}},sr=async l=>{ga(l);try{const f=await se.deleteApiKey(l);f.success?(z.success("API key removed"),Ge(M=>({...M,[l]:!1})),ee(M=>({...M,[l]:""}))):z.error(f.error||"Failed to remove API key")}catch{z.error("Failed to remove API key")}finally{ga(null)}},zt=async()=>{try{const l=await dt.getEmbeddingStatus();l.success&&l.data&&Zn(l.data)}catch(l){console.error("Failed to load embedding status:",l)}},lr=async()=>{vt(!0);try{const[l,f]=await Promise.all([la.getModels(),la.getPlugins()]);if(l.success&&l.data){if(Xn(l.data),!X.model&&l.data.length>0){const M=l.data[0];Xe(ae=>({...ae,model:M.model,pluginId:M.plugin,voice:M.config?.default_voice||""})),M.config?.voices&&La(M.config.voices)}else if(X.model){const M=l.data.find(ae=>ae.model===X.model);M?.config?.voices&&La(M.config.voices)}}f.success&&f.data&&Qn(f.data)}catch(l){console.error("Failed to load TTS data:",l)}finally{vt(!1)}},dr=async l=>{const f=He.find(M=>M.model===l);f&&(Xe(M=>({...M,model:l,pluginId:f.plugin,voice:f.config?.default_voice||M.voice})),f.config?.voices&&La(f.config.voices))},cr=async()=>{Mt(!0);try{const[l,f]=await Promise.all([ct.getModels(),ct.getPlugins()]);if(l.success&&l.data){if(ar(l.data),!oe.model&&l.data.length>0){const M=l.data[0];ea(ae=>({...ae,model:M.model,pluginId:M.plugin,size:M.config?.default_size||"1024x1024",quality:M.config?.default_quality||"standard",style:M.config?.default_style||"vivid"})),M.config?.sizes&&Ga(M.config.sizes),M.config?.qualities&&Ha(M.config.qualities),M.config?.styles&&Ra(M.config.styles)}else if(oe.model){const M=l.data.find(ae=>ae.model===oe.model);M?.config&&(M.config.sizes&&Ga(M.config.sizes),M.config.qualities&&Ha(M.config.qualities),M.config.styles&&Ra(M.config.styles))}}f.success&&f.data&&tr(f.data)}catch(l){console.error("Failed to load image generation data:",l)}finally{Mt(!1)}},ur=async l=>{const f=je.find(M=>M.model===l);f&&(ea(M=>({...M,model:l,pluginId:f.plugin,size:f.config?.default_size||M.size,quality:f.config?.default_quality||M.quality,style:f.config?.default_style||M.style})),f.config?.sizes&&Ga(f.config.sizes),f.config?.qualities&&Ha(f.config.qualities),f.config?.styles&&Ra(f.config.styles))},fa=(l,f)=>{Xe(M=>({...M,[l]:f}))},mr=async()=>{try{const l=await te.updatePreferences({ttsSettings:X});l.success&&l.data&&(w(l.data),z.success("TTS settings saved successfully"))}catch(l){const f=l instanceof Error?l.message:String(l);z.error("Failed to save TTS settings: "+f)}},pr=async()=>{if(xt){Ka&&(Ka.pause(),Ka.currentTime=0,ha(null)),Qe(!1);return}Qe(!0);try{const l=await la.generateBase64({model:X.model||"tts-1",input:"Hello! This is a test of the text-to-speech system.",voice:X.voice||"alloy",speed:X.speed||1,response_format:"mp3"});if(l.success&&l.data?.audio){const f=`data:${l.data.mimeType};base64,${l.data.audio}`,M=new Audio(f);ha(M),M.onended=()=>{Qe(!1),ha(null)},M.onerror=()=>{z.error("Failed to play audio"),Qe(!1),ha(null)},await M.play()}else throw new Error(l.message||"Failed to generate speech")}catch(l){const f=l instanceof Error?l.message:String(l);z.error("TTS test failed: "+f),Qe(!1)}},gr=()=>{Xe({enabled:!1,autoPlay:!1,model:He[0]?.model||"",voice:He[0]?.config?.default_voice||"",speed:1,pluginId:He[0]?.plugin||""})},ya=(l,f)=>{ea(M=>({...M,[l]:f}))},hr=async()=>{try{const l=await te.updatePreferences({imageGenSettings:oe});l.success&&l.data&&(w(l.data),z.success("Image generation settings saved successfully"))}catch(l){const f=l instanceof Error?l.message:String(l);z.error("Failed to save image generation settings: "+f)}},br=()=>{ea({enabled:!1,model:je[0]?.model||"",size:je[0]?.config?.default_size||"1024x1024",quality:je[0]?.config?.default_quality||"standard",style:je[0]?.config?.default_style||"vivid",pluginId:je[0]?.plugin||""})},kr=async()=>{try{kt(!0),(await dt.regenerateEmbeddings()).success&&(z.success("Embeddings regenerated successfully"),await zt())}catch(l){const f=l instanceof Error?l.message:String(l);z.error("Failed to regenerate embeddings: "+f)}finally{kt(!1)}},Wa=async l=>{try{const f=await te.updatePreferences(l);f.success&&f.data&&(w(f.data),z.success("Settings updated successfully"))}catch(f){const M=f instanceof Error?f.message:String(f);z.error("Failed to update settings: "+M)}},fr=async l=>{const f=l.target.files?.[0];f&&(await P(f),De(!1),Ke.current&&(Ke.current.value=""),await g())},yr=async()=>{try{const l=JSON.parse(Ye);await G(l),_e(!1),Le(""),await g()}catch{E(),z.error("Invalid JSON format")}},vr=async l=>{F.find(M=>M.id===l)?.active?await K(l):await q(l),await g()},xr=async l=>{window.confirm("Are you sure you want to delete this plugin?")&&(await U(l),await g())},Sr=async l=>{await O(l)};if(!n)return null;const qa=l=>{const f={mode:l};x(f),Wa({theme:f})},wr=l=>{const f=l.target.value;i(f),Wa({defaultModel:f}),z.success("Default model updated")},Pr=l=>{Y(l.target.value)},Mr=()=>{s(V),Wa({systemMessage:V}),z.success("System message updated")},Dr=async()=>{window.confirm("Are you sure you want to delete all chat history? This action cannot be undone.")&&(await d(),ka(),z.success("All chat sessions deleted"))},jr=()=>{const l={format:"libre-webui-export",version:"1.0",preferences:b,sessions:m,documents:[],exportedAt:new Date().toISOString()},f=new Blob([JSON.stringify(l,null,2)],{type:"application/json"}),M=URL.createObjectURL(f),ae=document.createElement("a");ae.href=M,ae.download=`libre-webui-export-${new Date().toISOString().split("T")[0]}.json`,document.body.appendChild(ae),ae.click(),document.body.removeChild(ae),URL.revokeObjectURL(M),z.success("Data exported successfully")},Ar=l=>{const f=l.target.files?.[0];f&&(Va(f),Ua(!0),aa(null))},zr=async()=>{if(At){Dt(!0);try{const l=await At.text(),f=JSON.parse(l);if(!f.format||f.format!=="libre-webui-export")throw new Error("Invalid export format. Please use a valid Libre WebUI export file.");const M=await te.importData(f,$a==="overwrite"?"replace":"merge");if(M.success&&M.data)aa({preferences:{imported:!0,error:null},sessions:{imported:0,skipped:0,errors:[]},documents:{imported:0,skipped:0,errors:[]}}),z.success("Data imported successfully"),await S(),await p();else throw new Error(M.error||"Import failed")}catch(l){z.error(l instanceof Error?l.message:"Import failed"),aa(null)}finally{Dt(!1),Ua(!1),Va(null),Re.current&&(Re.current.value="")}}},Nr=()=>{Ua(!1),Va(null),aa(null),Re.current&&(Re.current.value="")},Tr=async()=>{T(!0),_(null),Fe.pullAllModelsStream(l=>{_(l)},()=>{T(!1),_(null),z.success("All models updated successfully!"),ka()},l=>{T(!1),_(null),z.error("Failed to update models: "+l)})},fe=(l,f)=>{Ea(M=>({...M,[l]:f}))},Ir=async()=>{try{const l=await te.setGenerationOptions(ge);l.success&&l.data&&(w(l.data),z.success("Generation options updated successfully"))}catch(l){const f=l instanceof Error?l.message:String(l);z.error("Failed to update generation options: "+f)}},Cr=async()=>{try{const l=await te.resetGenerationOptions();l.success&&l.data&&(w(l.data),Ea(l.data.generationOptions||{}),z.success("Generation options reset to defaults"))}catch(l){const f=l instanceof Error?l.message:String(l);z.error("Failed to reset generation options: "+f)}},ve=(l,f)=>{Oa(M=>({...M,[l]:f}))},Nt=async()=>{try{const l=await te.setEmbeddingSettings(Z);l.success&&l.data&&(w(l.data),z.success("Embedding settings updated successfully"))}catch(l){const f=l instanceof Error?l.message:String(l);z.error("Failed to update embedding settings: "+f)}},Tt=async()=>{try{const l=await te.resetEmbeddingSettings();l.success&&l.data&&(w(l.data),Oa(l.data.embeddingSettings||{}),z.success("Embedding settings reset to defaults"))}catch(l){const f=l instanceof Error?l.message:String(l);z.error("Failed to reset embedding settings: "+f)}},Fr=[{id:"appearance",label:c("settings.tabs.appearance"),icon:Vr},{id:"models",label:c("settings.tabs.model"),icon:Ct},{id:"generation",label:c("settings.tabs.generation"),icon:Wr},{id:"tts",label:c("settings.tabs.tts"),icon:Ft},{id:"image-gen",label:c("settings.tabs.imageGen"),icon:et},{id:"documents",label:c("settings.tabs.documents"),icon:ia},{id:"plugins",label:c("settings.tabs.plugins"),icon:Et},{id:"system",label:c("settings.tabs.system"),icon:qr},{id:"data",label:c("settings.tabs.data"),icon:ia},{id:"about",label:c("settings.tabs.about"),icon:Dn}],Er=()=>{switch($){case"appearance":return e.jsxs("div",{className:"space-y-6",children:[e.jsx(uy,{}),e.jsx("div",{className:"border-t border-gray-200 dark:border-dark-300 pt-6",children:e.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 mb-4",children:c("settings.appearance.title")})}),e.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[e.jsxs("button",{onClick:()=>qa("light"),className:`flex items-center justify-center gap-2 h-12 px-3 py-2.5 text-sm font-medium rounded-xl transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 ${k.mode==="light"?"bg-primary-600 text-white shadow-sm hover:bg-primary-700 hover:shadow-md focus:ring-primary-500":"border border-gray-300 text-gray-700 bg-white shadow-sm hover:bg-gray-50 hover:border-gray-400 focus:ring-gray-500 dark:border-dark-300 dark:text-dark-700 dark:bg-dark-25 dark:hover:bg-dark-200 dark:hover:border-dark-400 ophelia:border-[#262626] ophelia:text-[#e5e5e5] ophelia:bg-[#0a0a0a] ophelia:hover:bg-[#121212]"}`,children:[e.jsx(Qr,{className:"h-4 w-4"}),c("settings.appearance.theme.light")]}),e.jsxs("button",{onClick:()=>qa("dark"),className:`flex items-center justify-center gap-2 h-12 px-3 py-2.5 text-sm font-medium rounded-xl transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 ${k.mode==="dark"?"bg-dark-300 text-dark-800 border border-dark-400 shadow-sm hover:bg-dark-400 focus:ring-dark-500":"border border-gray-300 text-gray-700 bg-white shadow-sm hover:bg-gray-50 hover:border-gray-400 focus:ring-gray-500 dark:border-dark-300 dark:text-dark-700 dark:bg-dark-25 dark:hover:bg-dark-200 dark:hover:border-dark-400 ophelia:border-[#262626] ophelia:text-[#e5e5e5] ophelia:bg-[#0a0a0a] ophelia:hover:bg-[#121212]"}`,children:[e.jsx(ei,{className:"h-4 w-4"}),c("settings.appearance.theme.dark")]}),e.jsxs("button",{onClick:()=>qa("ophelia"),className:`flex items-center justify-center gap-2 h-12 px-3 py-2.5 text-sm font-medium rounded-xl transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 ${k.mode==="ophelia"?"bg-purple-600 text-white shadow-sm hover:bg-purple-700 hover:shadow-md focus:ring-purple-500 border border-purple-500":"border border-gray-300 text-gray-700 bg-white shadow-sm hover:bg-gray-50 hover:border-gray-400 focus:ring-gray-500 dark:border-dark-300 dark:text-dark-700 dark:bg-dark-25 dark:hover:bg-dark-200 dark:hover:border-dark-400"}`,children:[e.jsx(Nn,{className:"h-4 w-4"}),c("settings.appearance.theme.amoled")]})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-md font-medium text-gray-900 dark:text-gray-100 mb-3",children:c("settings.appearance.chatInterface.title")}),e.jsx("div",{className:"space-y-3",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:c("settings.appearance.chatInterface.showUsername")}),e.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:c("settings.appearance.chatInterface.showUsernameDescription")})]}),e.jsxs("label",{className:"relative inline-flex items-center cursor-pointer",children:[e.jsx("input",{type:"checkbox",className:"sr-only peer",checked:b.showUsername,onChange:l=>{const f=l.target.checked;w({showUsername:f}),te.updatePreferences({showUsername:f})}}),e.jsx("div",{className:"w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-primary-300 dark:peer-focus:ring-primary-800 rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-primary-600"})]})]})})]}),e.jsx(cy,{})]});case"system":return e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 mb-4",children:c("settings.system.title")}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mb-6",children:[e.jsxs("div",{className:"bg-white dark:bg-dark-100 rounded-lg p-4 border border-gray-200 dark:border-dark-300",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx("div",{className:`w-3 h-3 rounded-full ${J.isHealthy?"bg-green-500":"bg-red-500"}`}),e.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:c("settings.about.ollama.title")})]}),e.jsx("p",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100",children:J.isHealthy?c("settings.about.ollama.healthy"):c("settings.about.ollama.unhealthy")}),J.ollamaVersion&&e.jsxs("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:["v",J.ollamaVersion]})]}),e.jsxs("div",{className:"bg-white dark:bg-dark-100 rounded-lg p-4 border border-gray-200 dark:border-dark-300",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(Xr,{className:"h-3 w-3 text-gray-500 dark:text-dark-500"}),e.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:c("settings.about.stats.models")})]}),e.jsx("p",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100",children:J.modelsCount})]}),e.jsxs("div",{className:"bg-white dark:bg-dark-100 rounded-lg p-4 border border-gray-200 dark:border-dark-300",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(Aa,{className:"h-3 w-3 text-green-500"}),e.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:c("settings.about.stats.sessions")})]}),e.jsx("p",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100",children:J.sessionsCount})]}),e.jsxs("div",{className:"bg-white dark:bg-dark-100 rounded-lg p-4 border border-gray-200 dark:border-dark-300",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(ia,{className:"h-3 w-3 text-purple-500"}),e.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:c("settings.system.currentModel")})]}),e.jsx("p",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100 truncate",children:r||c("settings.system.notSet")})]})]}),e.jsx(I,{onClick:ka,variant:"outline",size:"sm",children:c("common.refresh")})]})});case"models":return e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 mb-4",children:c("settings.model.title")}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"bg-white dark:bg-dark-100 rounded-lg p-4 border border-gray-200 dark:border-dark-300",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-3",children:c("settings.model.defaultModel")}),e.jsx(xe,{value:r||"",onChange:wr,options:[{value:"",label:c("settings.model.selectModel")},...t.map(l=>({value:l.name,label:l.name}))]}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-2",children:c("settings.model.defaultModelDescription")})]}),r&&e.jsxs("div",{className:"bg-white dark:bg-dark-100 rounded-lg p-4 border border-gray-200 dark:border-dark-300",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-3",children:c("settings.model.currentModelInfo")}),e.jsx("div",{className:"bg-gray-50 dark:bg-dark-50 rounded-lg p-4 border border-gray-200 dark:border-dark-300",children:e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[e.jsxs("div",{className:"flex items-center justify-between p-3 bg-white dark:bg-dark-100 rounded-md border border-gray-200 dark:border-dark-300",children:[e.jsxs("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:[c("settings.model.name"),":"]}),e.jsx("span",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100 truncate ml-2",children:r})]}),(()=>{const l=t.find(f=>f.name===r);return l?.details?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center justify-between p-3 bg-white dark:bg-dark-100 rounded-md border border-gray-200 dark:border-dark-300",children:[e.jsxs("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:[c("settings.model.size"),":"]}),e.jsx("span",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100",children:l.details.parameter_size})]}),e.jsxs("div",{className:"flex items-center justify-between p-3 bg-white dark:bg-dark-100 rounded-md border border-gray-200 dark:border-dark-300",children:[e.jsxs("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:[c("settings.model.family"),":"]}),e.jsx("span",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100",children:l.details.family})]}),e.jsxs("div",{className:"flex items-center justify-between p-3 bg-white dark:bg-dark-100 rounded-md border border-gray-200 dark:border-dark-300",children:[e.jsxs("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:[c("settings.model.format"),":"]}),e.jsx("span",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100",children:l.details.format})]})]}):null})()]})})]}),e.jsxs("div",{className:"bg-white dark:bg-dark-100 rounded-lg p-4 border border-gray-200 dark:border-dark-300",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-3",children:c("settings.systemMessage.title")}),e.jsx($n,{value:V,onChange:Pr,placeholder:c("settings.systemMessage.placeholder"),className:"w-full min-h-[100px] bg-gray-50 dark:bg-dark-50 border-gray-200 dark:border-dark-300 text-gray-900 dark:text-gray-100",rows:4}),e.jsxs("div",{className:"flex items-center justify-between mt-3",children:[e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:c("settings.systemMessage.description")}),e.jsx(I,{onClick:Mr,size:"sm",disabled:u||V===o,children:c("common.save")})]})]})]}),e.jsx("div",{className:"mt-6",children:e.jsxs("div",{className:"bg-white dark:bg-dark-100 rounded-lg p-4 border border-gray-200 dark:border-dark-300",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-3",children:c("settings.model.autoTitle.title")}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:c("settings.model.autoTitle.enable")}),e.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:c("settings.model.autoTitle.enableDescription")})]}),e.jsxs("label",{className:"relative inline-flex items-center cursor-pointer",children:[e.jsx("input",{type:"checkbox",className:"sr-only peer",checked:b.titleSettings?.autoTitle||!1,onChange:l=>{const f=l.target.checked,M={...b.titleSettings,autoTitle:f,taskModel:b.titleSettings?.taskModel||""};w({titleSettings:M}),te.updatePreferences({titleSettings:M})}}),e.jsx("div",{className:"w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-primary-300 dark:peer-focus:ring-primary-800 rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-primary-600"})]})]}),b.titleSettings?.autoTitle&&e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:c("settings.model.autoTitle.taskModel")}),e.jsx(xe,{value:b.titleSettings?.taskModel||"",onChange:l=>{const f=l.target.value,M={...b.titleSettings,autoTitle:b.titleSettings?.autoTitle||!1,taskModel:f};w({titleSettings:M}),te.updatePreferences({titleSettings:M})},options:[{value:"",label:c("settings.model.autoTitle.selectTaskModel")},...t.map(l=>({value:l.name,label:l.name}))]}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-2",children:c("settings.model.autoTitle.taskModelDescription")})]})]})]})}),e.jsx("div",{className:"mt-6",children:e.jsxs("div",{className:"bg-white dark:bg-dark-100 rounded-lg p-4 border border-gray-200 dark:border-dark-300",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-3",children:c("settings.model.bulkOperations")}),e.jsx("div",{className:"space-y-3",children:e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:c("settings.model.updateAll")}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-3",children:c("settings.model.updateAllDescription")}),ne&&H&&e.jsxs("div",{className:"mb-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsx("span",{className:"text-gray-600 dark:text-dark-600 font-medium",children:c("settings.model.updatingModel",{name:H.modelName,current:H.current,total:H.total})}),e.jsxs("span",{className:"text-primary-600 dark:text-primary-400 font-semibold",children:[Math.round(H.current/H.total*100),"%"]})]}),e.jsx("div",{className:"w-full bg-gray-200 dark:bg-dark-300 rounded-full h-3 shadow-subtle",children:e.jsx("div",{className:"bg-gradient-to-r from-primary-500 to-primary-600 dark:from-primary-400 dark:to-primary-500 h-3 rounded-full transition-all duration-500 ease-out shadow-glow",style:{width:`${H.current/H.total*100}%`}})}),e.jsxs("div",{className:"text-xs flex items-center justify-between",children:[e.jsxs("span",{className:"text-gray-500 dark:text-dark-500",children:[c("settings.model.status"),":"," ",H.status==="starting"?e.jsx("span",{className:"text-accent-500 dark:text-accent-400",children:c("settings.model.statusStarting")}):H.status==="success"?e.jsx("span",{className:"text-success-600 dark:text-success-500",children:c("settings.model.statusComplete")}):H.status==="error"?e.jsxs("span",{className:"text-error-600 dark:text-error-500",children:[c("settings.model.statusError"),":"," ",H.error]}):""]}),e.jsx("span",{className:"text-gray-400 dark:text-dark-600 text-[10px]",children:c("settings.model.modelsProgress",{current:H.current,total:H.total})})]})]}),e.jsx(I,{onClick:Tr,variant:"outline",size:"sm",className:"w-full",disabled:ne||u||t.length===0,children:ne?c("settings.model.updating"):c("settings.model.updateAllButton",{count:t.length})})]})})]})})]})});case"tts":return e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 mb-4",children:c("settings.tts.title")}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-6",children:c("settings.tts.description")}),er?e.jsxs("div",{className:"flex items-center justify-center py-8",children:[e.jsx(qe,{className:"h-8 w-8 animate-spin text-primary-500"}),e.jsx("span",{className:"ml-3 text-gray-600 dark:text-gray-400",children:c("settings.tts.loadingProviders")})]}):He.length===0?e.jsx("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(Ft,{className:"h-5 w-5 text-yellow-600 dark:text-yellow-400 mt-0.5"}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium text-yellow-800 dark:text-yellow-200",children:c("settings.tts.noProviders")}),e.jsx("p",{className:"text-sm text-yellow-700 dark:text-yellow-300 mt-1",children:c("settings.tts.noProvidersDescription")})]})]})}):e.jsxs("div",{className:"space-y-6",children:[e.jsx("div",{className:"bg-white dark:bg-dark-100 rounded-lg p-4 border border-gray-200 dark:border-dark-300",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:c("settings.tts.enable")}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:c("settings.tts.enableDescription")})]}),e.jsxs("label",{className:"flex items-center cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:X.enabled,onChange:l=>fa("enabled",l.target.checked),className:"sr-only"}),e.jsx("div",{className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2 ${X.enabled?"bg-primary-600 dark:bg-primary-500":"bg-gray-200 dark:bg-dark-300"}`,children:e.jsx("span",{className:`inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${X.enabled?"translate-x-6":"translate-x-1"}`})})]})]})}),e.jsx("div",{className:"bg-white dark:bg-dark-100 rounded-lg p-4 border border-gray-200 dark:border-dark-300",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:c("settings.tts.autoPlay")}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:c("settings.tts.autoPlayDescription")})]}),e.jsxs("label",{className:"flex items-center cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:X.autoPlay,onChange:l=>fa("autoPlay",l.target.checked),disabled:!X.enabled,className:"sr-only"}),e.jsx("div",{className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2 ${X.enabled?X.autoPlay?"bg-primary-600 dark:bg-primary-500":"bg-gray-200 dark:bg-dark-300":"bg-gray-100 dark:bg-dark-200 opacity-50 cursor-not-allowed"}`,children:e.jsx("span",{className:`inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${X.autoPlay?"translate-x-6":"translate-x-1"}`})})]})]})}),e.jsxs("div",{className:"bg-white dark:bg-dark-100 rounded-lg p-4 border border-gray-200 dark:border-dark-300",children:[e.jsx("h4",{className:"text-sm font-medium text-gray-900 dark:text-gray-100 mb-4",children:c("settings.tts.voiceConfiguration")}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:c("settings.tts.model")}),e.jsx(xe,{value:X.model,onChange:l=>dr(l.target.value),disabled:!X.enabled,options:[{value:"",label:c("settings.model.selectModel")},...He.map(l=>({value:l.model,label:`${l.model} (${l.plugin})`}))]}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:c("settings.tts.modelDescription")})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:c("settings.tts.voice")}),e.jsx(xe,{value:X.voice,onChange:l=>fa("voice",l.target.value),disabled:!X.enabled||yt.length===0,options:[{value:"",label:c("settings.tts.selectVoice")},...yt.map(l=>({value:l,label:l.charAt(0).toUpperCase()+l.slice(1)}))]}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:c("settings.tts.voiceDescription")})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:[c("settings.tts.speed"),":"," ",X.speed.toFixed(1),"x"]}),e.jsx("input",{type:"range",min:"0.25",max:"4.0",step:"0.25",value:X.speed,onChange:l=>fa("speed",parseFloat(l.target.value)),disabled:!X.enabled,className:"w-full range-slider"}),e.jsxs("div",{className:"flex justify-between text-xs text-gray-500 mt-1",children:[e.jsx("span",{children:c("settings.tts.speedSlow")}),e.jsx("span",{children:c("settings.tts.speedNormal")}),e.jsx("span",{children:c("settings.tts.speedFast")})]})]})]})]}),ft.length>0&&e.jsxs("div",{className:"bg-gray-50 dark:bg-dark-50 rounded-lg p-4 border border-gray-200 dark:border-dark-300",children:[e.jsx("h4",{className:"text-sm font-medium text-gray-700 dark:text-gray-300 mb-3",children:c("settings.tts.availableProviders")}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:ft.map(l=>e.jsxs("div",{className:"flex items-center gap-2 p-2 bg-white dark:bg-dark-100 rounded border border-gray-200 dark:border-dark-300",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-green-500"}),e.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:l.name}),e.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:["(",l.models?.length||0," ",c("settings.tts.models"),")"]})]},l.id))})]}),e.jsxs("div",{className:"flex justify-between items-center pt-4 border-t border-gray-200 dark:border-dark-300",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(I,{onClick:gr,variant:"outline",className:"flex items-center gap-2",children:[e.jsx(na,{size:16}),c("common.reset")]}),e.jsx(I,{onClick:pr,variant:"outline",disabled:!X.enabled||!X.model,className:"flex items-center gap-2",children:xt?e.jsxs(e.Fragment,{children:[e.jsx(Yr,{size:16}),c("settings.tts.stop")]}):e.jsxs(e.Fragment,{children:[e.jsx(Zr,{size:16}),c("settings.tts.test")]})})]}),e.jsxs(I,{onClick:mr,className:"flex items-center gap-2",children:[e.jsx(Se,{size:16}),c("settings.saveSettings")]})]})]})]})});case"image-gen":return e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 mb-4",children:c("settings.imageGen.title")}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-6",children:c("settings.imageGen.description")}),nr?e.jsxs("div",{className:"flex items-center justify-center py-8",children:[e.jsx(qe,{className:"h-8 w-8 animate-spin text-primary-500"}),e.jsx("span",{className:"ml-3 text-gray-600 dark:text-gray-400",children:c("settings.imageGen.loadingProviders")})]}):je.length===0?e.jsx("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(et,{className:"h-5 w-5 text-yellow-600 dark:text-yellow-400 mt-0.5"}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium text-yellow-800 dark:text-yellow-200",children:c("settings.imageGen.noProviders")}),e.jsx("p",{className:"text-sm text-yellow-700 dark:text-yellow-300 mt-1",children:c("settings.imageGen.noProvidersDescription")})]})]})}):e.jsxs("div",{className:"space-y-6",children:[e.jsx("div",{className:"bg-white dark:bg-dark-100 rounded-lg p-4 border border-gray-200 dark:border-dark-300",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:c("settings.imageGen.enable")}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:c("settings.imageGen.enableDescription")})]}),e.jsxs("label",{className:"flex items-center cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:oe.enabled,onChange:l=>ya("enabled",l.target.checked),className:"sr-only"}),e.jsx("div",{className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2 ${oe.enabled?"bg-primary-600 dark:bg-primary-500":"bg-gray-200 dark:bg-dark-300"}`,children:e.jsx("span",{className:`inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${oe.enabled?"translate-x-6":"translate-x-1"}`})})]})]})}),e.jsxs("div",{className:"bg-white dark:bg-dark-100 rounded-lg p-4 border border-gray-200 dark:border-dark-300",children:[e.jsx("h4",{className:"text-sm font-medium text-gray-900 dark:text-gray-100 mb-4",children:c("settings.imageGen.configuration")}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:c("settings.imageGen.model")}),e.jsx(xe,{value:oe.model,onChange:l=>ur(l.target.value),disabled:!oe.enabled,options:[{value:"",label:c("settings.model.selectModel")},...je.map(l=>({value:l.model,label:`${l.model} (${l.plugin})`}))]}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:c("settings.imageGen.modelDescription")})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:c("settings.imageGen.size")}),e.jsx(xe,{value:oe.size,onChange:l=>ya("size",l.target.value),disabled:!oe.enabled||Ba.length===0,options:[...Ba.length>0?Ba.map(l=>({value:l,label:l})):[{value:"1024x1024",label:"1024x1024"},{value:"1792x1024",label:"1792x1024"},{value:"1024x1792",label:"1024x1792"}]]}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:c("settings.imageGen.sizeDescription")})]}),wt.length>0&&e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:c("settings.imageGen.quality")}),e.jsx(xe,{value:oe.quality,onChange:l=>ya("quality",l.target.value),disabled:!oe.enabled,options:wt.map(l=>({value:l,label:l.charAt(0).toUpperCase()+l.slice(1)}))}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:c("settings.imageGen.qualityDescription")})]}),Pt.length>0&&e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:c("settings.imageGen.style")}),e.jsx(xe,{value:oe.style,onChange:l=>ya("style",l.target.value),disabled:!oe.enabled,options:Pt.map(l=>({value:l,label:l.charAt(0).toUpperCase()+l.slice(1)}))}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:c("settings.imageGen.styleDescription")})]})]})]}),St.length>0&&e.jsxs("div",{className:"bg-gray-50 dark:bg-dark-50 rounded-lg p-4 border border-gray-200 dark:border-dark-300",children:[e.jsx("h4",{className:"text-sm font-medium text-gray-700 dark:text-gray-300 mb-3",children:c("settings.imageGen.availableProviders")}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:St.map(l=>e.jsxs("div",{className:"flex items-center gap-2 p-2 bg-white dark:bg-dark-100 rounded border border-gray-200 dark:border-dark-300",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-green-500"}),e.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:l.name}),e.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:["(",l.models?.length||0," ",c("settings.imageGen.models"),")"]})]},l.id))})]}),e.jsxs("div",{className:"flex justify-between items-center pt-4 border-t border-gray-200 dark:border-dark-300",children:[e.jsxs(I,{onClick:br,variant:"outline",className:"flex items-center gap-2",children:[e.jsx(na,{size:16}),c("common.reset")]}),e.jsxs(I,{onClick:hr,className:"flex items-center gap-2",children:[e.jsx(Se,{size:16}),c("settings.saveSettings")]})]})]})]})});case"documents":return e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 mb-4",children:c("settings.documents.title")}),e.jsxs("div",{className:"bg-gray-50 dark:bg-dark-50 p-4 rounded-lg border border-gray-200 dark:border-dark-300 space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:c("settings.documents.embeddings.title")}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:c("settings.documents.embeddings.enable")})]}),e.jsxs("label",{className:"flex items-center cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:Z.enabled,onChange:l=>ve("enabled",l.target.checked),className:"sr-only"}),e.jsx("div",{className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2 ${Z.enabled?"bg-primary-600 dark:bg-primary-500":"bg-gray-200 dark:bg-dark-300"}`,children:e.jsx("span",{className:`inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${Z.enabled?"translate-x-6":"translate-x-1"}`})})]})]}),Z.enabled&&e.jsxs("div",{className:"space-y-4 pt-4 border-t border-gray-200 dark:border-dark-300",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:c("settings.documents.embeddings.model")}),e.jsx(xe,{value:Z.model,onChange:l=>ve("model",l.target.value),options:[{value:"nomic-embed-text",label:"nomic-embed-text"},{value:"all-minilm",label:"all-minilm"},{value:"sentence-transformers",label:"sentence-transformers"}]}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:c("settings.documents.embeddings.modelDescription")})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:[c("settings.documents.embeddings.chunkSize"),":"," ",Z.chunkSize]}),e.jsx("input",{type:"range",min:"500",max:"2000",step:"100",value:Z.chunkSize,onChange:l=>ve("chunkSize",parseInt(l.target.value)),className:"w-full range-slider"}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:c("settings.documents.embeddings.chunkSizeDescription")})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:[c("settings.documents.embeddings.chunkOverlap"),":"," ",Z.chunkOverlap]}),e.jsx("input",{type:"range",min:"50",max:"500",step:"50",value:Z.chunkOverlap,onChange:l=>ve("chunkOverlap",parseInt(l.target.value)),className:"w-full range-slider"}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:c("settings.documents.embeddings.chunkOverlapDescription")})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:[c("settings.documents.embeddings.similarityThreshold"),": ",Z.similarityThreshold.toFixed(2)]}),e.jsx("input",{type:"range",min:"0.3",max:"0.9",step:"0.05",value:Z.similarityThreshold,onChange:l=>ve("similarityThreshold",parseFloat(l.target.value)),className:"w-full range-slider"}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:c("settings.documents.embeddings.similarityDescription")})]})]})]}),re&&e.jsxs("div",{className:"bg-gray-50 dark:bg-dark-100 p-4 rounded-lg border border-gray-200 dark:border-dark-300",children:[e.jsx("h4",{className:"text-sm font-medium text-gray-900 dark:text-gray-100 mb-2",children:c("settings.documents.embeddings.status")}),e.jsxs("div",{className:"text-sm text-gray-700 dark:text-gray-300 space-y-1",children:[e.jsxs("div",{children:[c("settings.documents.embeddings.statusLabel"),":"," ",e.jsx("span",{className:`font-medium ${re.available?"text-green-600 dark:text-green-400":"text-red-600 dark:text-red-400"}`,children:re.available?c("settings.documents.embeddings.available"):c("settings.documents.embeddings.unavailable")})]}),e.jsxs("div",{children:[c("settings.documents.embeddings.model"),":"," ",e.jsx("span",{className:"font-medium",children:re.model})]}),e.jsxs("div",{children:[c("settings.documents.embeddings.chunksWithEmbeddings"),":"," ",e.jsxs("span",{className:"font-medium",children:[re.chunksWithEmbeddings," /"," ",re.totalChunks]})]}),re.totalChunks>0&&e.jsxs("div",{children:[c("settings.documents.embeddings.coverage"),":"," ",e.jsxs("span",{className:"font-medium",children:[Math.round(re.chunksWithEmbeddings/re.totalChunks*100),"%"]})]})]})]}),e.jsxs("div",{className:"flex justify-between items-center pt-4 border-t border-gray-200 dark:border-dark-300",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(I,{onClick:Tt,variant:"outline",className:"flex items-center gap-2",children:[e.jsx(na,{size:16}),c("settings.generation.resetDefaults")]}),Z.enabled&&re&&re.totalChunks>0&&e.jsxs(I,{onClick:kr,disabled:bt,variant:"outline",className:"flex items-center gap-2 text-orange-600 dark:text-orange-400 border-orange-200 dark:border-orange-600 hover:bg-orange-50 dark:hover:bg-orange-900/20",children:[e.jsx(ia,{size:16}),c(bt?"settings.documents.embeddings.regenerating":"settings.documents.embeddings.regenerate")]})]}),e.jsxs(I,{onClick:Nt,className:"flex items-center gap-2",children:[e.jsx(Se,{size:16}),c("settings.saveSettings")]})]})]})});case"plugins":return e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 mb-4",children:c("settings.plugins.title")}),A&&e.jsx("div",{className:"p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg mb-4",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("p",{className:"text-red-800 dark:text-red-200",children:A}),e.jsx(I,{variant:"ghost",size:"sm",onClick:E,className:"text-red-600 hover:text-red-800",children:e.jsx(Me,{className:"h-4 w-4"})})]})}),e.jsxs("div",{className:"bg-white dark:bg-dark-100 rounded-lg p-4 border border-gray-200 dark:border-dark-300 mb-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("h4",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:c("settings.plugins.addNew")}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsxs(I,{variant:"outline",size:"sm",onClick:()=>De(!Pe),disabled:L||D,children:[e.jsx(ja,{className:"h-4 w-4 mr-2"}),c("settings.plugins.upload")]}),e.jsx(I,{variant:"outline",size:"sm",onClick:()=>_e(!ua),disabled:L,children:c("settings.plugins.addJson")})]})]}),Pe&&e.jsxs("div",{className:"bg-gray-50 dark:bg-dark-50 rounded-lg p-4 border border-gray-200 dark:border-dark-300 mb-4",children:[e.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsx("input",{ref:Ke,type:"file",accept:".json,.zip",onChange:fr,className:"flex-1 p-2 border border-gray-300 dark:border-dark-300 rounded-md bg-white dark:bg-dark-100 text-gray-900 dark:text-dark-800 file:mr-4 file:py-2 file:px-4 file:rounded-md file:border-0 file:text-sm file:font-medium file:bg-gray-100 file:text-gray-700 dark:file:bg-dark-200 dark:file:text-dark-700 hover:file:bg-gray-200 dark:hover:file:bg-dark-300",disabled:D}),e.jsx(I,{variant:"outline",size:"sm",onClick:()=>De(!1),disabled:D,children:c("common.cancel")})]}),D&&e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mt-2",children:c("settings.plugins.uploading")})]}),ua&&e.jsx("div",{className:"bg-gray-50 dark:bg-dark-50 rounded-lg p-4 border border-gray-200 dark:border-dark-300",children:e.jsxs("div",{className:"space-y-3",children:[e.jsx("textarea",{value:Ye,onChange:l=>Le(l.target.value),placeholder:c("settings.plugins.jsonPlaceholder"),className:"w-full h-32 p-3 border border-gray-300 dark:border-dark-300 rounded-md bg-white dark:bg-dark-100 text-gray-900 dark:text-dark-800 placeholder:text-gray-400 dark:placeholder:text-dark-500 font-mono text-sm",disabled:L}),e.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[e.jsx(I,{variant:"outline",size:"sm",onClick:()=>{_e(!1),Le("")},children:c("common.cancel")}),e.jsx(I,{size:"sm",onClick:yr,disabled:!Ye.trim()||L,children:c("settings.plugins.install")})]})]})})]}),F.filter(l=>l.active).length>0&&e.jsxs("div",{className:"bg-white dark:bg-dark-100 rounded-lg p-4 border border-gray-200 dark:border-dark-300 mb-6",children:[e.jsxs("h4",{className:"text-sm font-medium text-gray-700 dark:text-gray-300 mb-3",children:[c("settings.plugins.active")," (",F.filter(l=>l.active).length,")"]}),e.jsx("div",{className:"space-y-2",children:F.filter(l=>l.active).map(l=>e.jsxs("div",{className:"flex items-center justify-between p-3 bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800 rounded-lg",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-green-800 dark:text-green-200",children:l.name}),e.jsxs("p",{className:"text-xs text-green-600 dark:text-green-300",children:[l.type," • ",l.model_map?.length||0," ",c("settings.plugins.models")]})]}),e.jsx(I,{variant:"outline",size:"sm",onClick:async()=>{await K(l.id),await g()},className:"text-green-600 border-green-300 hover:bg-green-100",children:c("settings.plugins.deactivate")})]},l.id))})]}),e.jsxs("div",{className:"bg-white dark:bg-dark-100 rounded-lg border border-gray-200 dark:border-dark-300",children:[e.jsx("div",{className:"p-4 border-b border-gray-200 dark:border-dark-300",children:e.jsxs("h4",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:[c("settings.plugins.installed")," (",F.length,")"]})}),L?e.jsx("div",{className:"p-8 text-center",children:e.jsx("p",{className:"text-gray-500 dark:text-gray-400",children:c("settings.plugins.loading")})}):F.length===0?e.jsxs("div",{className:"p-8 text-center",children:[e.jsx(Et,{className:"h-12 w-12 text-gray-400 mx-auto mb-4"}),e.jsx("p",{className:"text-gray-500 dark:text-gray-400 mb-2",children:c("settings.plugins.noPlugins")}),e.jsx("p",{className:"text-xs text-gray-400 dark:text-gray-500",children:c("settings.plugins.noPluginsDescription")})]}):e.jsx("div",{className:"divide-y divide-gray-200 dark:divide-dark-300",children:F.map(l=>e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx("div",{className:`w-3 h-3 rounded-full flex-shrink-0 ${l.active?"bg-green-500":"bg-gray-400 dark:bg-gray-500"}`}),e.jsxs("div",{children:[e.jsx("h5",{className:"font-medium text-gray-900 dark:text-gray-100",children:l.name}),e.jsxs("div",{className:"flex items-center space-x-2 text-xs text-gray-500 dark:text-gray-400",children:[e.jsx("span",{children:l.type}),e.jsx("span",{children:"•"}),e.jsxs("span",{children:[l.model_map?.length||0," ",c("settings.plugins.models")]}),l.endpoint&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"•"}),e.jsx("span",{className:"truncate max-w-32",children:l.endpoint})]}),W[l.id]&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"•"}),e.jsx("span",{className:"text-green-600",children:c("settings.plugins.apiKeySet")})]})]})]})]})}),e.jsxs("div",{className:"flex items-center space-x-1 flex-shrink-0",children:[e.jsxs(I,{variant:"ghost",size:"sm",onClick:()=>Ze(Be===l.id?null:l.id),title:"Configure API key",className:W[l.id]?"text-green-600":"text-amber-600",children:[e.jsx(at,{className:"h-4 w-4"}),Be===l.id?e.jsx(Jr,{className:"h-3 w-3"}):e.jsx(_r,{className:"h-3 w-3"})]}),e.jsx(I,{variant:"outline",size:"sm",onClick:()=>vr(l.id),disabled:L,className:l.active?"text-green-600 border-green-300":"",children:l.active?e.jsxs(e.Fragment,{children:[e.jsx(Se,{className:"h-4 w-4 mr-1"}),c("settings.plugins.activeLabel")]}):c("settings.plugins.activate")}),e.jsx(I,{variant:"ghost",size:"sm",onClick:()=>Sr(l.id),disabled:L,title:"Export plugin",children:e.jsx(An,{className:"h-4 w-4"})}),e.jsx(I,{variant:"ghost",size:"sm",onClick:()=>xr(l.id),disabled:L,className:"text-red-600 hover:text-red-700 hover:bg-red-50",title:"Delete plugin",children:e.jsx(zn,{className:"h-4 w-4"})})]})]}),Be===l.id&&e.jsxs("div",{className:"mt-4 p-4 bg-gray-50 dark:bg-dark-50 rounded-lg border border-gray-200 dark:border-dark-300",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(at,{className:"h-4 w-4 text-gray-500"}),e.jsx("h6",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:c("settings.plugins.apiKeyConfiguration")})]}),e.jsxs("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-3",children:[c("settings.plugins.apiKeyDescription",{name:l.name}),l.auth?.key_env&&e.jsxs("span",{className:"block mt-1",children:[c("settings.plugins.apiKeyEnvAlternative")," ",e.jsx("code",{className:"bg-gray-200 dark:bg-dark-200 px-1 rounded",children:l.auth.key_env})," ",c("settings.plugins.environmentVariable"),"."]})]}),W[l.id]?e.jsxs("div",{className:"flex items-center justify-between p-3 bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800 rounded-lg",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Se,{className:"h-4 w-4 text-green-600"}),e.jsx("span",{className:"text-sm text-green-700 dark:text-green-300",children:c("settings.plugins.apiKeyConfigured")})]}),e.jsx(I,{variant:"outline",size:"sm",onClick:()=>sr(l.id),disabled:pa===l.id,className:"text-red-600 border-red-300 hover:bg-red-50",children:pa===l.id?e.jsx(qe,{className:"h-4 w-4 animate-spin"}):c("common.remove")})]}):e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:ma[l.id]?"text":"password",value:C[l.id]||"",onChange:f=>ee(M=>({...M,[l.id]:f.target.value})),placeholder:c("settings.plugins.apiKeyPlaceholder"),className:"w-full p-2 pr-10 border border-gray-300 dark:border-dark-300 rounded-md bg-white dark:bg-dark-100 text-gray-900 dark:text-dark-800 placeholder:text-gray-400 dark:placeholder:text-dark-500"}),e.jsx("button",{type:"button",onClick:()=>ht(f=>({...f,[l.id]:!f[l.id]})),className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600",children:ma[l.id]?e.jsx(Je,{className:"h-4 w-4"}):e.jsx(Ee,{className:"h-4 w-4"})})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(I,{size:"sm",onClick:()=>or(l.id),disabled:pa===l.id||!C[l.id]?.trim(),children:pa===l.id?e.jsxs(e.Fragment,{children:[e.jsx(qe,{className:"h-4 w-4 mr-2 animate-spin"}),c("common.saving")]}):c("settings.plugins.saveApiKey")})})]})]})]},l.id))})]})]})});case"data":return e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 mb-4",children:c("settings.data.title")}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx("h4",{className:"text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:c("settings.data.export")}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-3 flex-1",children:c("settings.data.exportDescription")}),e.jsx(I,{onClick:jr,variant:"outline",size:"sm",className:"w-full",children:c("settings.data.exportAll")})]}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("h4",{className:"text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:c("settings.data.import")}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-3 flex-1",children:c("settings.data.importDescription")}),e.jsx("input",{ref:Re,type:"file",accept:".json",onChange:Ar,className:"hidden"}),e.jsx(I,{onClick:()=>Re.current?.click(),variant:"outline",size:"sm",className:"w-full",disabled:ba,children:c(ba?"settings.data.importing":"settings.data.importData")})]}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("h4",{className:"text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:c("settings.data.clearSessions")}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-3 flex-1",children:c("settings.data.clearSessionsDescription")}),e.jsx(I,{onClick:Dr,variant:"outline",size:"sm",className:"w-full text-red-600 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300 border-red-200 hover:border-red-300 dark:border-red-800 dark:hover:border-red-700",disabled:m.length===0||u,children:u?c("settings.data.clearing"):c("settings.data.clearAll",{count:m.length})})]})]}),rr&&e.jsxs("div",{className:"mt-4 p-4 bg-gray-50 dark:bg-dark-100 border border-gray-200 dark:border-dark-300 rounded-lg",children:[e.jsx("h5",{className:"text-sm font-medium text-gray-900 dark:text-gray-100 mb-3",children:c("settings.data.importOptions")}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-3",children:c("settings.data.importOptionsDescription")}),e.jsxs("div",{className:"space-y-2 mb-4",children:[e.jsxs("label",{className:"flex items-center",children:[e.jsx("input",{type:"radio",name:"mergeStrategy",value:"skip",checked:$a==="skip",onChange:l=>jt(l.target.value),className:"mr-2"}),e.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:c("settings.data.skipDuplicates")})]}),e.jsxs("label",{className:"flex items-center",children:[e.jsx("input",{type:"radio",name:"mergeStrategy",value:"overwrite",checked:$a==="overwrite",onChange:l=>jt(l.target.value),className:"mr-2"}),e.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:c("settings.data.overwrite")})]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(I,{onClick:zr,size:"sm",disabled:ba,children:c(ba?"settings.data.importing":"settings.data.import")}),e.jsx(I,{onClick:Nr,variant:"outline",size:"sm",children:c("common.cancel")})]})]}),ye&&e.jsxs("div",{className:"mt-4 p-4 bg-gray-50 dark:bg-dark-100 border border-gray-200 dark:border-dark-300 rounded-lg",children:[e.jsx("h5",{className:"text-sm font-medium text-gray-900 dark:text-gray-100 mb-2",children:c("settings.data.importResults")}),e.jsxs("div",{className:"text-xs text-gray-700 dark:text-gray-300 space-y-1",children:[e.jsxs("div",{children:[c("settings.data.preferences"),":"," ",ye.preferences.imported?c("settings.data.imported"):c("settings.data.failed")]}),e.jsxs("div",{children:[c("settings.data.sessions"),":"," ",ye.sessions.imported," ",c("settings.data.importedLabel"),",",ye.sessions.skipped," ",c("settings.data.skipped")]}),e.jsxs("div",{children:[c("settings.data.documents"),":"," ",ye.documents.imported," ",c("settings.data.importedLabel"),","," ",ye.documents.skipped," ",c("settings.data.skipped")]}),(ye.sessions.errors.length>0||ye.documents.errors.length>0)&&e.jsxs("div",{className:"mt-2",children:[e.jsxs("p",{className:"font-medium",children:[c("settings.data.errors"),":"]}),ye.sessions.errors.map((l,f)=>e.jsxs("p",{className:"text-red-600 dark:text-red-400",children:["• ",l]},f)),ye.documents.errors.map((l,f)=>e.jsxs("p",{className:"text-red-600 dark:text-red-400",children:["• ",l]},f))]})]}),e.jsx(I,{onClick:()=>aa(null),variant:"outline",size:"sm",className:"mt-2",children:c("common.close")})]})]})]})});case"about":return e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{children:[e.jsx("h3",{className:"libre-brand text-2xl sm:text-3xl font-normal text-gray-900 dark:text-gray-100 mb-4",style:{fontWeight:300,letterSpacing:"0.01em"},children:"Libre WebUI"}),e.jsx("div",{className:"text-sm text-gray-700 dark:text-gray-300 mb-6",children:e.jsx("span",{children:c("settings.about.title")})}),e.jsx("div",{className:"bg-gray-50 dark:bg-dark-100 rounded-lg p-6 border border-gray-200 dark:border-dark-300",children:e.jsxs("div",{className:"space-y-4 text-sm text-gray-700 dark:text-gray-300",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full mt-2 flex-shrink-0"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-gray-900 dark:text-gray-100 mb-1",children:c("settings.about.features.privacy.title")}),e.jsx("p",{children:c("settings.about.features.privacy.description")})]})]}),e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-2 h-2 bg-primary-500 rounded-full mt-2 flex-shrink-0"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-gray-900 dark:text-gray-100 mb-1",children:c("settings.about.features.openSource.title")}),e.jsx("p",{children:c("settings.about.features.openSource.description")})]})]}),e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-2 h-2 bg-purple-500 rounded-full mt-2 flex-shrink-0"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-gray-900 dark:text-gray-100 mb-1",children:c("settings.about.features.localInference.title")}),e.jsx("p",{children:c("settings.about.features.localInference.description")})]})]})]})}),e.jsxs("div",{className:"mt-6 space-y-4",children:[e.jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100",children:c("settings.about.links.title")}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[e.jsxs("a",{href:"https://github.com/libre-webui/libre-webui",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-3 p-3 bg-white dark:bg-dark-100 border border-gray-200 dark:border-dark-300 rounded-lg hover:bg-gray-50 dark:hover:bg-dark-200 hover:border-gray-300 dark:hover:border-dark-400 transition-all duration-200 group",children:[e.jsx(jn,{className:"h-5 w-5 text-gray-600 dark:text-gray-400 group-hover:text-gray-900 dark:group-hover:text-gray-200"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:c("settings.about.links.github")}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:c("settings.about.links.githubDescription")})]}),e.jsx(Ce,{className:"h-4 w-4 text-gray-400 ml-auto opacity-0 group-hover:opacity-100 transition-opacity"})]}),e.jsxs("a",{href:"https://librewebui.org",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-3 p-3 bg-white dark:bg-dark-100 border border-gray-200 dark:border-dark-300 rounded-lg hover:bg-gray-50 dark:hover:bg-dark-200 hover:border-gray-300 dark:hover:border-dark-400 transition-all duration-200 group",children:[e.jsx(Ce,{className:"h-5 w-5 text-gray-600 dark:text-gray-400 group-hover:text-gray-900 dark:group-hover:text-gray-200"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:c("settings.about.links.website")}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:c("settings.about.links.websiteDescription")})]}),e.jsx(Ce,{className:"h-4 w-4 text-gray-400 ml-auto opacity-0 group-hover:opacity-100 transition-opacity"})]}),e.jsxs("a",{href:"https://ollama.ai",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-3 p-3 bg-white dark:bg-dark-100 border border-gray-200 dark:border-dark-300 rounded-lg hover:bg-gray-50 dark:hover:bg-dark-200 hover:border-gray-300 dark:hover:border-dark-400 transition-all duration-200 group",children:[e.jsx(Ct,{className:"h-5 w-5 text-gray-600 dark:text-gray-400 group-hover:text-gray-900 dark:group-hover:text-gray-200"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:c("settings.about.links.ollama")}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:c("settings.about.links.ollamaDescription")})]}),e.jsx(Ce,{className:"h-4 w-4 text-gray-400 ml-auto opacity-0 group-hover:opacity-100 transition-opacity"})]}),e.jsxs("a",{href:"https://github.com/libre-webui/libre-webui/issues",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-3 p-3 bg-white dark:bg-dark-100 border border-gray-200 dark:border-dark-300 rounded-lg hover:bg-gray-50 dark:hover:bg-dark-200 hover:border-gray-300 dark:hover:border-dark-400 transition-all duration-200 group",children:[e.jsx(Aa,{className:"h-5 w-5 text-gray-600 dark:text-gray-400 group-hover:text-gray-900 dark:group-hover:text-gray-200"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:c("settings.about.links.reportIssue")}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:c("settings.about.links.reportIssueDescription")})]}),e.jsx(Ce,{className:"h-4 w-4 text-gray-400 ml-auto opacity-0 group-hover:opacity-100 transition-opacity"})]})]})]}),e.jsx("div",{className:"mt-6 p-4 bg-gray-50 dark:bg-dark-100 border border-gray-200 dark:border-dark-300 rounded-lg",children:e.jsxs("div",{className:"flex items-center justify-between text-xs text-gray-500 dark:text-gray-400",children:[e.jsx("a",{href:`https://github.com/libre-webui/libre-webui/releases/tag/v${gn}`,target:"_blank",rel:"noopener noreferrer",className:"hover:text-primary-600 dark:hover:text-primary-400 transition-colors",children:c("settings.about.version",{version:gn})}),e.jsxs("span",{children:[c("settings.about.openSourceBy",{company:""}),e.jsx("a",{href:"https://kroonen.ai",target:"_blank",rel:"noopener noreferrer",className:"text-primary-600 dark:text-primary-400 hover:text-primary-700 dark:hover:text-primary-300 transition-colors",children:"Kroonen AI"})]})]})})]})});case"generation":return e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 mb-4",children:c("settings.generation.title")}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-6",children:c("settings.generation.description")}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"bg-white dark:bg-dark-100 rounded-lg p-4 border border-gray-200 dark:border-dark-300",children:[e.jsx("h4",{className:"text-md font-medium text-gray-900 dark:text-gray-100 mb-4",children:c("settings.generation.coreParameters")}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:[c("settings.generation.temperature"),e.jsx("span",{className:"text-xs text-gray-500 ml-1",children:"(0.0-2.0)"})]}),e.jsx("input",{type:"number",min:"0",max:"2",step:"0.1",value:ge.temperature??"",placeholder:"0.8",onChange:l=>fe("temperature",l.target.value?parseFloat(l.target.value):void 0),className:"w-full px-3 py-2 border border-gray-300 dark:border-dark-300 rounded-md focus:ring-2 focus:ring-primary-500 focus:border-transparent bg-white dark:bg-dark-200 text-gray-900 dark:text-gray-100"}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:c("settings.generation.temperatureDescription")})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:[c("settings.generation.topP"),e.jsx("span",{className:"text-xs text-gray-500 ml-1",children:"(0.0-1.0)"})]}),e.jsx("input",{type:"number",min:"0",max:"1",step:"0.05",value:ge.top_p??"",placeholder:"0.9",onChange:l=>fe("top_p",l.target.value?parseFloat(l.target.value):void 0),className:"w-full px-3 py-2 border border-gray-300 dark:border-dark-300 rounded-md focus:ring-2 focus:ring-primary-500 focus:border-transparent bg-white dark:bg-dark-200 text-gray-900 dark:text-gray-100"}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:c("settings.generation.topPDescription")})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:[c("settings.generation.topK"),e.jsx("span",{className:"text-xs text-gray-500 ml-1",children:"(1-100)"})]}),e.jsx("input",{type:"number",min:"1",max:"100",value:ge.top_k??"",placeholder:"40",onChange:l=>fe("top_k",l.target.value?parseInt(l.target.value):void 0),className:"w-full px-3 py-2 border border-gray-300 dark:border-dark-300 rounded-md focus:ring-2 focus:ring-primary-500 focus:border-transparent bg-white dark:bg-dark-200 text-gray-900 dark:text-gray-100"}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:c("settings.generation.topKDescription")})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:[c("settings.generation.minP"),e.jsx("span",{className:"text-xs text-gray-500 ml-1",children:"(0.0-1.0)"})]}),e.jsx("input",{type:"number",min:"0",max:"1",step:"0.05",value:ge.min_p??"",placeholder:"0.0",onChange:l=>fe("min_p",l.target.value?parseFloat(l.target.value):void 0),className:"w-full px-3 py-2 border border-gray-300 dark:border-dark-300 rounded-md focus:ring-2 focus:ring-primary-500 focus:border-transparent bg-white dark:bg-dark-200 text-gray-900 dark:text-gray-100"}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:c("settings.generation.minPDescription")})]})]})]}),e.jsxs("div",{className:"bg-white dark:bg-dark-100 rounded-lg p-4 border border-gray-200 dark:border-dark-300",children:[e.jsx("h4",{className:"text-md font-medium text-gray-900 dark:text-gray-100 mb-4",children:c("settings.generation.generationControl")}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:c("settings.generation.maxTokens")}),e.jsx("input",{type:"number",min:"-1",max:"4096",value:ge.num_predict??"",placeholder:"128",onChange:l=>fe("num_predict",l.target.value?parseInt(l.target.value):void 0),className:"w-full px-3 py-2 border border-gray-300 dark:border-dark-300 rounded-md focus:ring-2 focus:ring-primary-500 focus:border-transparent bg-white dark:bg-dark-200 text-gray-900 dark:text-gray-100"}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:c("settings.generation.maxTokensDescription")})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:[c("settings.generation.repeatPenalty"),e.jsx("span",{className:"text-xs text-gray-500 ml-1",children:"(0.0-2.0)"})]}),e.jsx("input",{type:"number",min:"0",max:"2",step:"0.1",value:ge.repeat_penalty??"",placeholder:"1.1",onChange:l=>fe("repeat_penalty",l.target.value?parseFloat(l.target.value):void 0),className:"w-full px-3 py-2 border border-gray-300 dark:border-dark-300 rounded-md focus:ring-2 focus:ring-primary-500 focus:border-transparent bg-white dark:bg-dark-200 text-gray-900 dark:text-gray-100"}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:c("settings.generation.repeatPenaltyDescription")})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:c("settings.generation.contextLength")}),e.jsx("input",{type:"number",min:"512",max:"32768",step:"512",value:ge.num_ctx??"",placeholder:"2048",onChange:l=>fe("num_ctx",l.target.value?parseInt(l.target.value):void 0),className:"w-full px-3 py-2 border border-gray-300 dark:border-dark-300 rounded-md focus:ring-2 focus:ring-primary-500 focus:border-transparent bg-white dark:bg-dark-200 text-gray-900 dark:text-gray-100"}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:c("settings.generation.contextLengthDescription")})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:[c("settings.generation.seed"),e.jsxs("span",{className:"text-xs text-gray-500 ml-1",children:["(",c("settings.generation.optional"),")"]})]}),e.jsx("input",{type:"number",value:ge.seed||"",onChange:l=>fe("seed",l.target.value?parseInt(l.target.value):void 0),className:"w-full px-3 py-2 border border-gray-300 dark:border-dark-300 rounded-md focus:ring-2 focus:ring-primary-500 focus:border-transparent bg-white dark:bg-dark-200 text-gray-900 dark:text-gray-100",placeholder:c("settings.generation.random")}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:c("settings.generation.seedDescription")})]})]})]}),e.jsxs("div",{className:"bg-white dark:bg-dark-100 rounded-lg p-4 border border-gray-200 dark:border-dark-300",children:[e.jsx("h4",{className:"text-md font-medium text-gray-900 dark:text-gray-100 mb-4",children:c("settings.generation.advancedOptions")}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:[c("settings.generation.presencePenalty"),e.jsx("span",{className:"text-xs text-gray-500 ml-1",children:"(-2.0-2.0)"})]}),e.jsx("input",{type:"number",min:"-2",max:"2",step:"0.1",value:ge.presence_penalty??"",placeholder:"0.0",onChange:l=>fe("presence_penalty",l.target.value?parseFloat(l.target.value):void 0),className:"w-full px-3 py-2 border border-gray-300 dark:border-dark-300 rounded-md focus:ring-2 focus:ring-primary-500 focus:border-transparent bg-white dark:bg-dark-200 text-gray-900 dark:text-gray-100"}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:c("settings.generation.presencePenaltyDescription")})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:[c("settings.generation.frequencyPenalty"),e.jsx("span",{className:"text-xs text-gray-500 ml-1",children:"(-2.0-2.0)"})]}),e.jsx("input",{type:"number",min:"-2",max:"2",step:"0.1",value:ge.frequency_penalty??"",placeholder:"0.0",onChange:l=>fe("frequency_penalty",l.target.value?parseFloat(l.target.value):void 0),className:"w-full px-3 py-2 border border-gray-300 dark:border-dark-300 rounded-md focus:ring-2 focus:ring-primary-500 focus:border-transparent bg-white dark:bg-dark-200 text-gray-900 dark:text-gray-100"}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:c("settings.generation.frequencyPenaltyDescription")})]})]}),e.jsxs("div",{className:"mt-4",children:[e.jsxs("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:[c("settings.generation.stopSequences"),e.jsxs("span",{className:"text-xs text-gray-500 ml-1",children:["(",c("settings.generation.commaSeparated"),")"]})]}),e.jsx("input",{type:"text",value:ge.stop?ge.stop.join(", "):"",onChange:l=>fe("stop",l.target.value?l.target.value.split(",").map(f=>f.trim()).filter(f=>f):void 0),className:"w-full px-3 py-2 border border-gray-300 dark:border-dark-300 rounded-md focus:ring-2 focus:ring-primary-500 focus:border-transparent bg-white dark:bg-dark-200 text-gray-900 dark:text-gray-100",placeholder:"\\\\n, ###, STOP"}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:c("settings.generation.stopSequencesDescription")})]})]}),e.jsxs("div",{className:"flex justify-between items-center pt-4 border-t border-gray-200 dark:border-dark-300",children:[e.jsxs(I,{onClick:Cr,variant:"outline",className:"flex items-center gap-2",children:[e.jsx(na,{size:16}),c("settings.generation.resetDefaults")]}),e.jsxs(I,{onClick:Ir,className:"flex items-center gap-2",children:[e.jsx(Se,{size:16}),c("settings.generation.saveOptions")]})]})]}),e.jsx("div",{className:"mt-6",children:e.jsxs("div",{className:"bg-white dark:bg-dark-100 rounded-lg p-4 border border-gray-200 dark:border-dark-300",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-3",children:c("settings.generation.embeddingSettings")}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:c("settings.generation.enableEmbeddings")}),e.jsxs("label",{className:"flex items-center cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:Z.enabled,onChange:l=>ve("enabled",l.target.checked),className:"sr-only"}),e.jsx("div",{className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2 ${Z.enabled?"bg-primary-600 dark:bg-primary-500":"bg-gray-200 dark:bg-dark-300"}`,children:e.jsx("span",{className:`inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${Z.enabled?"translate-x-6":"translate-x-1"}`})})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:c("settings.documents.embeddings.model")}),e.jsx(xe,{value:Z.model,onChange:l=>ve("model",l.target.value),options:[{value:"nomic-embed-text",label:"Nomic Embed Text"},{value:"openai-embedding",label:"OpenAI Embedding"}],disabled:!Z.enabled})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:[c("settings.documents.embeddings.chunkSize"),e.jsx("span",{className:"text-xs text-gray-500 ml-1",children:c("settings.documents.embeddings.chunkSizeInTokens")})]}),e.jsx("input",{type:"number",min:"1",value:Z.chunkSize,onChange:l=>ve("chunkSize",parseInt(l.target.value)),className:"w-full px-3 py-2 border border-gray-300 dark:border-dark-300 rounded-md focus:ring-2 focus:ring-primary-500 focus:border-transparent bg-white dark:bg-dark-200 text-gray-900 dark:text-gray-100",disabled:!Z.enabled})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:[c("settings.documents.embeddings.chunkOverlap"),e.jsx("span",{className:"text-xs text-gray-500 ml-1",children:c("settings.documents.embeddings.chunkOverlapInTokens")})]}),e.jsx("input",{type:"number",min:"0",value:Z.chunkOverlap,onChange:l=>ve("chunkOverlap",parseInt(l.target.value)),className:"w-full px-3 py-2 border border-gray-300 dark:border-dark-300 rounded-md focus:ring-2 focus:ring-primary-500 focus:border-transparent bg-white dark:bg-dark-200 text-gray-900 dark:text-gray-100",disabled:!Z.enabled})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:c("settings.documents.embeddings.similarityThreshold")}),e.jsx("input",{type:"number",min:"0",max:"1",step:"0.01",value:Z.similarityThreshold,onChange:l=>ve("similarityThreshold",parseFloat(l.target.value)),className:"w-full px-3 py-2 border border-gray-300 dark:border-dark-300 rounded-md focus:ring-2 focus:ring-primary-500 focus:border-transparent bg-white dark:bg-dark-200 text-gray-900 dark:text-gray-100",disabled:!Z.enabled})]})]}),re&&e.jsxs("div",{className:"mt-4",children:[e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsxs("span",{className:"text-gray-700 dark:text-gray-300",children:[c("settings.documents.embeddings.status"),":"]}),e.jsx("span",{className:"font-medium text-gray-900 dark:text-gray-100",children:re.available?c("settings.documents.embeddings.available"):c("settings.documents.embeddings.unavailable")})]}),re.available&&e.jsxs("div",{className:"flex items-center justify-between text-sm mt-1",children:[e.jsxs("span",{className:"text-gray-700 dark:text-gray-300",children:[c("settings.documents.embeddings.chunksWithEmbeddings"),":"]}),e.jsxs("span",{className:"font-medium text-gray-900 dark:text-gray-100",children:[re.chunksWithEmbeddings," /"," ",re.totalChunks]})]})]}),e.jsxs("div",{className:"flex justify-between items-center mt-4",children:[e.jsxs(I,{onClick:Tt,variant:"outline",className:"flex items-center gap-2",children:[e.jsx(na,{size:16}),c("settings.generation.resetDefaults")]}),e.jsxs(I,{onClick:Nt,className:"flex items-center gap-2",children:[e.jsx(Se,{size:16}),c("settings.saveSettings")]})]})]})})]})});default:return null}};return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-50 transition-opacity duration-200",onClick:a}),e.jsx("div",{className:"fixed inset-0 lg:top-1/2 lg:left-1/2 lg:-translate-x-1/2 lg:-translate-y-1/2 z-50 w-full lg:max-w-4xl lg:mx-4 h-full lg:h-[85vh] p-0 lg:p-4",children:e.jsxs("div",{className:"bg-white dark:bg-dark-25 rounded-2xl shadow-2xl border border-gray-200 dark:border-dark-200 animate-scale-in flex flex-col h-full overscroll-behavior-contain",children:[e.jsxs("div",{className:"flex items-center justify-between p-4 sm:p-6 border-b border-gray-100 dark:border-dark-200 sticky top-0 z-10 rounded-t-2xl",children:[e.jsx("h2",{className:"text-lg sm:text-xl font-semibold text-gray-900 dark:text-gray-100",children:c("settings.title")}),e.jsx(I,{variant:"ghost",size:"sm",onClick:a,className:"h-9 w-9 sm:h-8 sm:w-8 p-0 hover:bg-gray-100 dark:hover:bg-gray-700 active:bg-gray-200 dark:active:bg-dark-100 touch-manipulation",title:"Close",children:e.jsx(Me,{className:"h-5 w-5 sm:h-4 sm:w-4"})})]}),e.jsxs("div",{className:"flex flex-1 min-h-0 overscroll-behavior-contain",children:[e.jsx("div",{className:"w-40 xs:w-48 sm:w-64 border-r border-gray-100 dark:border-dark-200 p-2 xs:p-3 sm:p-4 overflow-y-auto scrollbar-thin",style:{WebkitOverflowScrolling:"touch"},children:e.jsx("nav",{className:"space-y-1",children:Fr.map(l=>{const f=l.icon;return e.jsxs("button",{onClick:()=>ue(l.id),className:`w-full flex items-center gap-2 sm:gap-3 px-2 sm:px-3 py-2.5 sm:py-2.5 text-left rounded-lg transition-colors duration-200 touch-manipulation ${$===l.id?"bg-gray-100 dark:bg-dark-100 ophelia:bg-[#0a0a0a] text-gray-900 dark:text-white ophelia:text-[#fafafa] border border-gray-200 dark:border-dark-300 ophelia:border-[rgba(38,38,38,0.3)]":"text-gray-700 dark:text-gray-300 ophelia:text-[#a3a3a3] hover:bg-gray-50 dark:hover:bg-dark-200 ophelia:hover:bg-[#0a0a0a] active:bg-gray-100 dark:active:bg-dark-100 ophelia:active:bg-[#121212]"}`,children:[e.jsx(f,{className:"h-4 w-4 flex-shrink-0"}),e.jsx("span",{className:"text-xs sm:text-sm font-medium truncate",children:l.label})]},l.id)})})}),e.jsx("div",{className:"flex-1 p-3 xs:p-4 sm:p-6 overflow-auto overscroll-behavior-contain",style:{WebkitOverflowScrolling:"touch"},children:Er()})]})]})})]})},my=({value:n,onChange:a,className:t=""})=>{const r=h.useRef(null),[i,o]=h.useState(!1),[s,d]=h.useState(!1),u=async w=>{if(!w.type.startsWith("image/")){z.error("Please select a valid image file");return}if(w.size>2*1024*1024){z.error("Avatar image size must be less than 2MB");return}o(!0);try{const S=new FileReader;S.onload=F=>{const L=F.target?.result;a(L),z.success("Avatar uploaded successfully")},S.onerror=()=>{z.error("Failed to read image file")},S.readAsDataURL(w)}catch(S){console.error("Failed to upload avatar:",S),z.error("Failed to upload avatar image")}finally{o(!1)}},m=w=>{const S=w.target.files?.[0];S&&u(S)},g=w=>{w.preventDefault(),d(!0)},p=w=>{w.preventDefault(),d(!1)},k=w=>{w.preventDefault(),d(!1);const S=w.dataTransfer.files?.[0];S&&u(S)},x=()=>{a(""),z.success("Avatar removed")},b=()=>n||null;return e.jsx("div",{className:`space-y-4 ${t}`,children:e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-dark-600 mb-2",children:"Avatar"}),e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"flex-shrink-0",children:e.jsx("div",{className:"w-20 h-20 rounded-full overflow-hidden bg-gray-100 dark:bg-dark-200 border-2 border-gray-300 dark:border-dark-300 flex items-center justify-center",children:b()?e.jsx("img",{src:b(),alt:"Avatar preview",className:"w-full h-full object-cover"}):e.jsx(wa,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})})}),e.jsxs("div",{className:"flex-1 space-y-3",children:[n?e.jsxs("div",{className:"flex items-center gap-3 p-3 bg-gray-50 dark:bg-dark-200 rounded-lg",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-gray-100 truncate",children:"Custom avatar image"}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"Click to change or remove"})]}),e.jsx(I,{variant:"ghost",size:"sm",onClick:x,className:"text-red-600 hover:text-red-700 hover:bg-red-50 dark:text-red-400 dark:hover:text-red-300 dark:hover:bg-red-900/20",children:e.jsx(Me,{className:"h-4 w-4"})})]}):e.jsxs("div",{className:`border-2 border-dashed rounded-lg p-4 text-center cursor-pointer transition-colors ${s?"border-primary-500 bg-primary-50 dark:bg-primary-900/20":"border-gray-300 dark:border-gray-600 hover:border-gray-400 dark:hover:border-gray-500"}`,onDragOver:g,onDragLeave:p,onDrop:k,onClick:()=>r.current?.click(),children:[e.jsx(ja,{className:"h-8 w-8 mx-auto text-gray-400 dark:text-gray-500 mb-2"}),e.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-gray-100 mb-2",children:"Upload avatar image"}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-2",children:"Drag and drop an image or click to browse"}),e.jsxs(I,{variant:"outline",size:"sm",disabled:i,className:"mx-auto",children:[e.jsx(ja,{className:"h-4 w-4 mr-2"}),i?"Uploading...":"Choose Image"]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-gray-600 dark:text-gray-400 mb-1",children:"Or enter image URL"}),e.jsx("input",{type:"url",value:n,onChange:w=>a(w.target.value),className:"w-full px-3 py-2 text-sm border border-gray-300 dark:border-dark-300 rounded-md bg-white dark:bg-dark-50 text-gray-900 dark:text-dark-800",placeholder:"https://example.com/avatar.jpg"})]})]})]}),e.jsx("input",{ref:r,type:"file",accept:"image/*",onChange:m,className:"hidden"}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-2",children:"Supports: JPG, PNG, GIF, WebP (max 2MB). Square images work best."})]})})};class py{constructor(){Ie(this,"ws",null);Ie(this,"url");Ie(this,"reconnectAttempts",0);Ie(this,"maxReconnectAttempts",5);Ie(this,"reconnectDelay",1e3);Ie(this,"messageHandlers",new Map);let a;window.location.protocol==="file:"?a="ws://localhost:3001":a=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}`,this.url=`${a}/ws`,console.log("WebSocket URL constructed:",this.url)}connect(){return v()?(console.log("Demo mode active: skipping WebSocket connection."),Promise.resolve()):(console.log("WebSocket: Attempting to connect to:",this.url),new Promise((a,t)=>{try{const r=localStorage.getItem("auth-token"),i=r?`${this.url}?token=${encodeURIComponent(r)}`:this.url;console.log("WebSocket: Connecting to:",i.replace(/token=[^&]+/,"token=***")),this.ws=new WebSocket(i),this.ws.onopen=()=>{console.log("WebSocket connected successfully"),this.reconnectAttempts=0,a()},this.ws.onmessage=o=>{try{const s=JSON.parse(o.data);console.log("WebSocket: Received message:",s);const d=this.messageHandlers.get(s.type);d?d(s.data):console.warn("WebSocket: No handler for message type:",s.type)}catch(s){console.error("Failed to parse WebSocket message:",s)}},this.ws.onclose=()=>{console.log("WebSocket disconnected"),this.ws=null,this.attemptReconnect()},this.ws.onerror=o=>{console.error("WebSocket error:",o),t(o)}}catch(r){t(r)}}))}disconnect(){this.ws&&(this.ws.close(),this.ws=null)}send(a){this.ws&&this.ws.readyState===WebSocket.OPEN?(console.log("WebSocket: Sending message:",a),this.ws.send(JSON.stringify(a))):console.warn("WebSocket is not connected. ReadyState:",this.ws?.readyState)}onMessage(a,t){this.messageHandlers.delete(a),this.messageHandlers.set(a,t)}offMessage(a){this.messageHandlers.delete(a)}attemptReconnect(){if(v()){console.log("Demo mode active: skipping WebSocket reconnection.");return}this.reconnectAttempts<this.maxReconnectAttempts?(this.reconnectAttempts++,console.log(`Attempting to reconnect... (${this.reconnectAttempts}/${this.maxReconnectAttempts})`),setTimeout(()=>{this.connect().catch(()=>{})},this.reconnectDelay*this.reconnectAttempts)):console.error("Max reconnection attempts reached")}get isConnected(){return this.ws?.readyState===WebSocket.OPEN}}const da=new py,pe=Ca()(Vn((n,a)=>({user:null,token:null,systemInfo:null,isAuthenticated:!1,isLoading:!1,login:(t,r,i)=>{localStorage.setItem("auth-token",r);const o=Ne.getState();o.clearAllState&&o.clearAllState(),be.getState().clearUserState(),n({user:t,token:r,systemInfo:i,isAuthenticated:!0,isLoading:!1}),setTimeout(async()=>{try{const d=gt.getState();console.log("🔄 Reinitializing app after login..."),console.log("🔌 Reconnecting WebSocket with auth token..."),da.disconnect(),await da.connect(),!(await Fe.checkHealth()).success&&!v()&&console.warn("Ollama service not available after login");const m=be.getState();await Promise.all([o.loadModels(),o.loadSessions(),o.loadPreferences(),m.loadPreferences(),d.loadPlugins()]),console.log("✅ Reinitialized app after login")}catch(d){console.error("Failed to reinitialize app after login:",d)}},100)},logout:()=>{localStorage.removeItem("auth-token"),console.log("🔌 Disconnecting WebSocket on logout..."),da.disconnect();const t=Ne.getState();t.clearAllState&&t.clearAllState(),be.getState().clearUserState(),n({user:null,token:null,isAuthenticated:!1,isLoading:!1})},setUser:t=>{n({user:t})},setSystemInfo:t=>{n({systemInfo:t})},setLoading:t=>{n({isLoading:t})},isAdmin:()=>{const{user:t}=a();return t?.role==="admin"},requiresAuth:()=>{const{systemInfo:t}=a();return t?.requiresAuth??!1}}),{name:"auth-store",partialize:n=>({user:n.user,token:n.token,systemInfo:n.systemInfo,isAuthenticated:n.isAuthenticated})})),gy=Object.freeze(Object.defineProperty({__proto__:null,useAuthStore:pe},Symbol.toStringTag,{value:"Module"})),hn=({isOpen:n,onClose:a,className:t})=>{const{t:r}=ce(),i=ut(),o=Ia(),{sessions:s,deleteSession:d,updateSessionTitle:u,selectedModel:m,models:g,currentSession:p,generatingTitleForSession:k,personas:x}=Ne(),{user:b,isAdmin:w,systemInfo:S,setUser:F}=pe(),{backgroundImage:L,sidebarCompact:D,toggleSidebarCompact:A}=be(),[N,P]=h.useState(null),[U,q]=h.useState(""),[K,O]=h.useState(!1),[E,G]=h.useState(!1),[c,$]=h.useState(!1),[ue,V]=h.useState(""),[Y,J]=h.useState(!1),me=h.useRef(null),ne=h.useRef(null),{sessionId:T}=Br(),H=T||null,_=p?.id||H;h.useEffect(()=>{const C=ee=>{me.current&&!me.current.contains(ee.target)&&G(!1)};if(E)return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[E]),h.useEffect(()=>{const C=ee=>{ne.current&&!ne.current.contains(ee.target)&&window.innerWidth<768&&n&&!D&&A()};if(n&&!D&&window.innerWidth<768)return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[n,D,A]),h.useEffect(()=>{b?.avatar&&V(b.avatar)},[b?.avatar]);const Pe=async()=>{J(!0);try{const C=await qn.updateMyAvatar(ue||null);C.success&&C.data?(F(C.data),Q.success(r("user.avatar.updated")),$(!1)):Q.error(C.message||r("user.avatar.updateFailed"))}catch(C){console.error("Failed to update avatar:",C),Q.error(r("user.avatar.updateFailed"))}finally{J(!1)}},De=()=>{const{setCurrentSession:C}=Ne.getState();C(null),sessionStorage.setItem("forceWelcomeScreen","true"),o("/chat",{replace:!0}),window.innerWidth<768&&!D&&A()},ua=C=>{o(`/c/${C.id}`,{replace:!0}),window.innerWidth<768&&!D&&A()},_e=async(C,ee)=>{if(ee.stopPropagation(),window.confirm(r("chat.session.deleteConfirm")))try{const W=_===C;if(await d(C),W){const Ge=s.filter(ma=>ma.id!==C);Ge.length>0?o(`/c/${Ge[0].id}`,{replace:!0}):o("/",{replace:!0})}}catch(W){console.error("Error deleting session:",W)}},Ye=(C,ee)=>{ee.stopPropagation(),P(C.id),q(C.title)},Le=async C=>{U.trim()&&await u(C,U.trim()),P(null),q("")},Ke=()=>{P(null),q("")},Be=async()=>{try{await Te.logout();const{logout:C}=pe.getState();C(),o("/login"),Q.success(r("auth.logout.success"))}catch(C){console.error("Logout error:",C);const{logout:ee}=pe.getState();ee(),o("/login")}},Ze=window.location.protocol==="file:";return e.jsxs(e.Fragment,{children:[e.jsxs("div",{ref:ne,className:R("fixed inset-y-0 left-0 z-50 border-r border-gray-200 dark:border-dark-200 transform transition-all duration-300 ease-in-out shadow-xl",D?"w-18":"w-80 max-sm:w-64",n?"translate-x-0":"-translate-x-full","lg:shadow-none",L?"bg-gray-50/70 dark:bg-dark-25/70 backdrop-blur-sm":"bg-gray-50 dark:bg-dark-25","overscroll-behavior-contain",t),style:{WebkitOverflowScrolling:"touch"},children:[Ze&&e.jsx("div",{className:"absolute top-0 left-16 right-0 h-8 z-[60]",style:{WebkitAppRegion:"drag"}}),e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:R("border-b border-gray-200/60 dark:border-dark-200/60",D?"p-2":"p-3",Ze&&"pt-10"),children:[e.jsx("div",{className:R("flex items-center",D?"justify-center mb-2":"justify-between mb-2"),children:D?e.jsxs("div",{className:"flex flex-col items-center gap-1.5",children:[e.jsx("span",{className:"libre-brand text-xl text-gray-900 dark:text-dark-800 ophelia:text-[#fafafa]",children:"Libre"}),e.jsx(I,{variant:"ghost",size:"sm",onClick:A,className:"h-7 w-7 p-0 hover:bg-gray-100 dark:hover:bg-dark-200 ophelia:hover:bg-[rgba(147,51,234,0.15)] active:bg-gray-200 dark:active:bg-dark-100 ophelia:active:bg-[rgba(147,51,234,0.25)] touch-manipulation ophelia:text-[#a3a3a3] ophelia:hover:text-[#c084fc]",title:r("sidebar.expandSidebar"),children:e.jsx(Ot,{className:"h-4 w-4"})})]}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"libre-brand text-xl text-gray-900 dark:text-dark-800 ophelia:text-[#fafafa]",children:"Libre WebUI"}),e.jsx("div",{className:"flex items-center gap-1",children:e.jsx(I,{variant:"ghost",size:"sm",onClick:A,className:"h-7 w-7 p-0 hover:bg-gray-100 dark:hover:bg-dark-200 ophelia:hover:bg-[rgba(147,51,234,0.15)] active:bg-gray-200 dark:active:bg-dark-100 ophelia:active:bg-[rgba(147,51,234,0.25)] touch-manipulation ophelia:text-[#a3a3a3] ophelia:hover:text-[#c084fc]",title:r("sidebar.toggleSize"),children:e.jsx(ai,{className:"h-4 w-4"})})})]})}),!D&&e.jsxs(I,{onClick:De,disabled:!m||g.length===0,className:"w-full bg-primary-600 hover:bg-primary-700 active:bg-primary-800 text-white shadow-sm hover:shadow-md active:shadow-lg transition-all duration-200 border-0 touch-manipulation",size:"sm",title:!m||g.length===0?r("chat.model.noModelsTooltip"):"",children:[e.jsx(Lt,{className:"h-4 w-4 mr-2"}),r("chat.session.new")]}),D&&e.jsx(I,{onClick:De,disabled:!m||g.length===0,className:"w-full h-9 bg-primary-600 hover:bg-primary-700 active:bg-primary-800 text-white shadow-sm hover:shadow-md active:shadow-lg transition-all duration-200 border-0 touch-manipulation p-0",title:!m||g.length===0?r("chat.model.noModelsTooltip"):r("chat.session.new"),children:e.jsx(Lt,{className:"h-4 w-4"})})]}),e.jsx("div",{className:R("py-1.5",D?"px-1":"px-2.5"),children:e.jsxs("nav",{className:R("space-y-0.5",D&&"flex flex-col items-center"),children:[e.jsxs("button",{onClick:()=>{const{setCurrentSession:C}=Ne.getState();C(null),sessionStorage.setItem("forceWelcomeScreen","true"),o("/chat",{replace:!0}),window.innerWidth<768&&!D&&A()},className:R("flex items-center gap-2.5 rounded-lg text-sm font-medium transition-all duration-200 text-left touch-manipulation",D?"w-11 h-11 justify-center p-0":"w-full px-2.5 py-2",i.pathname==="/chat"||i.pathname==="/"?"bg-primary-100 dark:bg-primary-900/30 ophelia:bg-[rgba(147,51,234,0.25)] text-primary-800 dark:text-primary-200 ophelia:text-[#e9d5ff] shadow-sm":"text-gray-700 dark:text-gray-300 ophelia:text-[#a3a3a3] hover:bg-gray-50 dark:hover:bg-dark-200/50 ophelia:hover:bg-[rgba(147,51,234,0.1)] hover:text-gray-900 dark:hover:text-gray-100 ophelia:hover:text-[#e9d5ff] active:bg-gray-100 dark:active:bg-dark-200 ophelia:active:bg-[rgba(147,51,234,0.15)]"),title:D?r("sidebar.navigation.chat"):void 0,children:[e.jsx(Aa,{className:"h-4 w-4 shrink-0"}),!D&&r("sidebar.navigation.chat")]}),e.jsxs(ta,{to:"/models",onClick:()=>window.innerWidth<768&&!D&&A(),className:R("flex items-center gap-2.5 rounded-lg text-sm font-medium transition-all duration-200 touch-manipulation",D?"w-11 h-11 justify-center p-0":"w-full px-2.5 py-2",i.pathname==="/models"?"bg-primary-100 dark:bg-primary-900/30 ophelia:bg-[rgba(147,51,234,0.25)] text-primary-800 dark:text-primary-200 ophelia:text-[#e9d5ff] shadow-sm":"text-gray-700 dark:text-gray-300 ophelia:text-[#a3a3a3] hover:bg-gray-50 dark:hover:bg-dark-200/50 ophelia:hover:bg-[rgba(147,51,234,0.1)] hover:text-gray-900 dark:hover:text-gray-100 ophelia:hover:text-[#e9d5ff] active:bg-gray-100 dark:active:bg-dark-200 ophelia:active:bg-[rgba(147,51,234,0.15)]"),title:D?r("sidebar.navigation.models"):void 0,children:[e.jsx(ia,{className:"h-4 w-4 shrink-0"}),!D&&r("sidebar.navigation.models")]}),e.jsxs(ta,{to:"/personas",onClick:()=>window.innerWidth<768&&!D&&A(),className:R("flex items-center gap-2.5 rounded-lg text-sm font-medium transition-all duration-200 touch-manipulation",D?"w-11 h-11 justify-center p-0":"w-full px-2.5 py-2",i.pathname==="/personas"?"bg-primary-100 dark:bg-primary-900/30 ophelia:bg-[rgba(147,51,234,0.25)] text-primary-800 dark:text-primary-200 ophelia:text-[#e9d5ff] shadow-sm":"text-gray-700 dark:text-gray-300 ophelia:text-[#a3a3a3] hover:bg-gray-50 dark:hover:bg-dark-200/50 ophelia:hover:bg-[rgba(147,51,234,0.1)] hover:text-gray-900 dark:hover:text-gray-100 ophelia:hover:text-[#e9d5ff] active:bg-gray-100 dark:active:bg-dark-200 ophelia:active:bg-[rgba(147,51,234,0.15)]"),title:D?r("sidebar.navigation.personas"):void 0,children:[e.jsx(wa,{className:"h-4 w-4 shrink-0"}),!D&&r("sidebar.navigation.personas")]}),e.jsxs(ta,{to:"/gallery",onClick:()=>window.innerWidth<768&&!D&&A(),className:R("flex items-center gap-2.5 rounded-lg text-sm font-medium transition-all duration-200 touch-manipulation",D?"w-11 h-11 justify-center p-0":"w-full px-2.5 py-2",i.pathname==="/gallery"?"bg-primary-100 dark:bg-primary-900/30 ophelia:bg-[rgba(147,51,234,0.25)] text-primary-800 dark:text-primary-200 ophelia:text-[#e9d5ff] shadow-sm":"text-gray-700 dark:text-gray-300 ophelia:text-[#a3a3a3] hover:bg-gray-50 dark:hover:bg-dark-200/50 ophelia:hover:bg-[rgba(147,51,234,0.1)] hover:text-gray-900 dark:hover:text-gray-100 ophelia:hover:text-[#e9d5ff] active:bg-gray-100 dark:active:bg-dark-200 ophelia:active:bg-[rgba(147,51,234,0.15)]"),title:D?r("sidebar.navigation.imagine"):void 0,children:[e.jsx(Nn,{className:"h-4 w-4 shrink-0"}),!D&&r("sidebar.navigation.imagine")]})]})}),e.jsx("div",{className:"flex-1 overflow-y-auto scrollbar-thin border-t border-gray-200/60 dark:border-dark-200/60",style:{WebkitOverflowScrolling:"touch",overscrollBehavior:"contain",willChange:"scroll-position"},children:e.jsxs("div",{className:R("p-2.5",D&&"px-1"),children:[!D&&s.length>0&&e.jsxs("div",{className:"flex items-center justify-between mb-1.5 px-1",children:[e.jsx("h3",{className:"text-xs font-semibold text-gray-700 dark:text-gray-300 uppercase tracking-wide",children:r("chat.session.chats")}),e.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-500 font-medium",children:s.length})]}),s.length===0?e.jsxs("div",{className:R("text-center py-8",D?"px-1":"px-2"),children:[e.jsx("div",{className:R("mx-auto mb-3 bg-gray-100 dark:bg-dark-300 rounded-xl flex items-center justify-center",D?"w-8 h-8":"w-12 h-12"),children:e.jsx(Aa,{className:R("text-gray-400 dark:text-gray-500",D?"h-4 w-4":"h-5 w-5")})}),!D&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-sm font-medium text-gray-600 dark:text-gray-400",children:r("chat.session.noChats")}),e.jsx("p",{className:"text-xs mt-1 text-gray-500 dark:text-gray-500",children:r("chat.session.createFirst")})]})]}):e.jsx("div",{className:R("space-y-0.5",D&&"space-y-1"),children:s.map(C=>{const ee=_===C.id;return e.jsx("div",{className:R("group relative cursor-pointer transition-all duration-200 touch-manipulation",D?"rounded-lg p-2 flex items-center justify-center":"rounded-lg px-2.5 py-2",ee?"bg-gray-100 dark:bg-dark-200":"hover:bg-gray-50 dark:hover:bg-dark-200/50"),onClick:()=>ua(C),title:D?`${C.title} - ${C.model}`:void 0,children:D?e.jsx("div",{className:"flex items-center justify-center w-full h-8",children:e.jsx("div",{className:R("w-3 h-3 rounded-full",k===C.id?"bg-primary-400 animate-pulse":ee?"bg-primary-500":"bg-gray-300 dark:bg-gray-600")})}):N===C.id?e.jsxs("div",{className:"flex items-center gap-2",onClick:W=>W.stopPropagation(),children:[e.jsx(Yf,{value:U,onChange:W=>q(W.target.value),onKeyDown:W=>{W.key==="Enter"?Le(C.id):W.key==="Escape"&&Ke()},className:"text-sm h-8 ophelia:bg-[#0a0a0a] ophelia:border-[#9333ea] ophelia:text-[#fafafa] ophelia:focus:ring-[#a855f7] ophelia:focus:border-[#a855f7]",autoFocus:!0}),e.jsx(I,{variant:"ghost",size:"sm",onClick:()=>Le(C.id),className:"h-8 w-8 p-0 shrink-0 hover:bg-gray-100 dark:hover:bg-dark-300 ophelia:hover:bg-[rgba(147,51,234,0.2)] active:bg-gray-200 dark:active:bg-dark-400 ophelia:active:bg-[rgba(147,51,234,0.3)] touch-manipulation ophelia:text-[#a855f7] ophelia:hover:text-[#c084fc]",children:e.jsx(Se,{className:"h-3 w-3"})}),e.jsx(I,{variant:"ghost",size:"sm",onClick:Ke,className:"h-8 w-8 p-0 shrink-0 hover:bg-gray-100 dark:hover:bg-dark-300 ophelia:hover:bg-[rgba(239,68,68,0.15)] active:bg-gray-200 dark:active:bg-dark-400 ophelia:active:bg-[rgba(239,68,68,0.25)] touch-manipulation ophelia:text-[#737373] ophelia:hover:text-[#f87171]",children:e.jsx(Me,{className:"h-3 w-3"})})]}):e.jsxs("div",{className:"flex items-center justify-between w-full",children:[e.jsxs("div",{className:"flex-1 min-w-0 mr-2",children:[e.jsx("h3",{className:R("text-sm font-medium truncate leading-tight","text-gray-900 dark:text-gray-100"),children:k===C.id?e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx("span",{className:"animate-pulse",children:r("chat.session.generatingTitle")}),e.jsxs("span",{className:"inline-flex",children:[e.jsx("span",{className:"animate-bounce",style:{animationDelay:"0ms"},children:"."}),e.jsx("span",{className:"animate-bounce",style:{animationDelay:"150ms"},children:"."}),e.jsx("span",{className:"animate-bounce",style:{animationDelay:"300ms"},children:"."})]})]}):_f(C.title,32)}),e.jsxs("div",{className:"flex items-center gap-1.5 mt-0.5",children:[e.jsx("span",{className:R("text-xs",ee?"text-gray-600 dark:text-gray-400":"text-gray-500 dark:text-gray-500"),children:qf(C.updatedAt)}),e.jsx("span",{className:"text-gray-400 dark:text-gray-600",children:"•"}),C.personaId?(()=>{const W=x[C.personaId];return W?e.jsxs("span",{className:R("flex items-center gap-1 text-xs font-medium",ee?"text-primary-600 dark:text-primary-400":"text-primary-500 dark:text-primary-500"),title:W.description||W.name,children:[W.avatar&&!W.avatar.startsWith("data:")&&e.jsx("span",{className:"text-[10px]",children:W.avatar}),e.jsx("span",{className:"truncate max-w-[100px]",children:W.name})]}):e.jsx("span",{className:R("text-xs font-medium italic",ee?"text-gray-500 dark:text-gray-500":"text-gray-400 dark:text-gray-600"),children:"Persona"})})():e.jsx("span",{className:R("text-xs font-medium truncate max-w-[120px]",ee?"text-gray-700 dark:text-gray-300":"text-gray-600 dark:text-gray-400"),title:C.model,children:C.model})]})]}),e.jsxs("div",{className:"flex items-center gap-0.5 opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-all duration-200 shrink-0",children:[e.jsx(I,{variant:"ghost",size:"sm",onClick:W=>Ye(C,W),className:"h-7 w-7 sm:h-6 sm:w-6 p-0 hover:bg-gray-200 dark:hover:bg-gray-700 active:bg-gray-300 dark:active:bg-gray-600 rounded-md touch-manipulation",title:r("chat.session.renameChat"),children:e.jsx(ti,{className:"h-3 w-3"})}),e.jsx(I,{variant:"ghost",size:"sm",onClick:W=>_e(C.id,W),className:"h-7 w-7 sm:h-6 sm:w-6 p-0 text-red-500 hover:text-red-600 hover:bg-red-50 dark:hover:bg-red-900/20 active:bg-red-100 dark:active:bg-red-900/30 rounded-md touch-manipulation",title:r("chat.session.deleteChat"),children:e.jsx(zn,{className:"h-3 w-3"})})]})]})},C.id)})})]})}),S?.requiresAuth&&b&&e.jsx("div",{className:R("border-t border-gray-200/60 dark:border-dark-200/60",D?"p-1.5":"p-2.5"),children:D?e.jsxs("div",{className:"flex flex-col items-center space-y-1.5",children:[b.avatar?e.jsx("img",{src:b.avatar,alt:b.username,className:"w-7 h-7 rounded-full object-cover",title:`${b.username} (${b.role})`}):e.jsx("div",{className:"w-7 h-7 bg-primary-500 rounded-full flex items-center justify-center",title:`${b.username} (${b.role})`,children:e.jsx("span",{className:"text-white text-xs font-medium",children:b.username.charAt(0).toUpperCase()})}),e.jsx("button",{onClick:()=>{O(!0),window.innerWidth<768&&!D&&A()},className:"w-9 h-9 flex items-center justify-center rounded-lg text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-dark-200/50 active:bg-gray-100 dark:active:bg-dark-200 touch-manipulation transition-all duration-200",title:r("sidebar.navigation.settings"),children:e.jsx(Kt,{className:"h-4 w-4"})}),w()&&e.jsx(ta,{to:"/users",onClick:()=>window.innerWidth<768&&!D&&A(),className:"w-9 h-9 flex items-center justify-center rounded-lg text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-dark-200/50 active:bg-gray-100 dark:active:bg-dark-200 touch-manipulation transition-all duration-200",title:r("sidebar.navigation.userManagement"),children:e.jsx(wa,{className:"h-4 w-4"})}),e.jsx("button",{onClick:Be,className:"w-9 h-9 flex items-center justify-center rounded-lg text-red-600 dark:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20 active:bg-red-100 dark:active:bg-red-900/30 touch-manipulation transition-all duration-200",title:r("sidebar.navigation.signOut"),children:e.jsx(Bt,{className:"h-4 w-4"})})]}):e.jsxs("div",{className:"relative",ref:me,children:[e.jsx("button",{onClick:()=>G(!E),className:"w-full p-2.5 rounded-xl bg-white/50 dark:bg-dark-200/50 ophelia:bg-[rgba(10,10,10,0.6)] border border-gray-200/30 dark:border-dark-300/30 ophelia:border-[rgba(38,38,38,0.2)] hover:bg-white/70 dark:hover:bg-dark-200/70 ophelia:hover:bg-[rgba(18,18,18,0.7)] transition-all duration-200 text-left touch-manipulation",children:e.jsxs("div",{className:"flex items-center gap-2.5",children:[b.avatar?e.jsx("img",{src:b.avatar,alt:b.username,className:"w-7 h-7 rounded-full object-cover"}):e.jsx("div",{className:"w-7 h-7 bg-primary-500 rounded-full flex items-center justify-center",children:e.jsx("span",{className:"text-white text-xs font-medium",children:b.username.charAt(0).toUpperCase()})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-gray-100 truncate",children:b.username}),e.jsxs("div",{className:"flex items-center mt-0.5",children:[b.role==="admin"&&e.jsx(Tn,{size:10,className:"text-primary-500 mr-1"}),e.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400 capitalize",children:b.role})]})]}),e.jsx(Ot,{className:R("h-4 w-4 text-gray-400 dark:text-gray-500 transition-transform duration-200",E&&"rotate-90")})]})}),E&&e.jsxs("div",{className:"absolute bottom-full left-0 right-0 mb-2 py-2 bg-white dark:bg-dark-100 rounded-xl shadow-lg border border-gray-200/50 dark:border-dark-200/50 backdrop-blur-sm z-50",children:[e.jsx("div",{className:"px-3 py-2 border-b border-gray-100 dark:border-dark-200/50",children:e.jsxs("div",{className:"flex items-center gap-2.5",children:[b.avatar?e.jsx("img",{src:b.avatar,alt:b.username,className:"w-8 h-8 rounded-full object-cover"}):e.jsx("div",{className:"w-8 h-8 bg-primary-500 rounded-full flex items-center justify-center",children:e.jsx("span",{className:"text-white text-sm font-medium",children:b.username.charAt(0).toUpperCase()})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-gray-100 truncate",children:b.username}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 truncate",children:b.email||r("user.profile.noEmail")})]})]})}),e.jsxs("div",{className:"py-1",children:[e.jsxs("button",{onClick:()=>{$(!0),G(!1)},className:"w-full flex items-center gap-3 px-3 py-2.5 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-dark-200/50 transition-colors duration-200 text-left",children:[e.jsx(ni,{className:"h-4 w-4 shrink-0"}),r("user.menu.changePicture")]}),e.jsxs("button",{onClick:()=>{O(!0),G(!1),window.innerWidth<768&&!D&&A()},className:"w-full flex items-center gap-3 px-3 py-2.5 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-dark-200/50 transition-colors duration-200 text-left",children:[e.jsx(Kt,{className:"h-4 w-4 shrink-0"}),r("user.menu.settings")]}),w()&&e.jsxs(ta,{to:"/users",onClick:()=>{G(!1),window.innerWidth<768&&!D&&A()},className:"w-full flex items-center gap-3 px-3 py-2.5 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-dark-200/50 transition-colors duration-200",children:[e.jsx(wa,{className:"h-4 w-4 shrink-0"}),r("user.menu.userManagement")]}),e.jsx("div",{className:"border-t border-gray-100 dark:border-dark-200/50 my-1"}),e.jsxs("button",{onClick:()=>{Be(),G(!1)},className:"w-full flex items-center gap-3 px-3 py-2.5 text-sm text-red-600 dark:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20 transition-colors duration-200 text-left",children:[e.jsx(Bt,{className:"h-4 w-4 shrink-0"}),r("user.menu.logout")]})]})]})]})})]})]}),e.jsx(Jn,{isOpen:K,onClose:()=>O(!1)}),c&&Mn.createPortal(e.jsx("div",{className:"fixed inset-0 z-[2147483647] flex items-center justify-center bg-black/50",onClick:()=>$(!1),children:e.jsxs("div",{className:"bg-white dark:bg-dark-100 rounded-xl shadow-2xl p-6 w-full max-w-md mx-4",onClick:C=>C.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100",children:r("user.avatar.title")}),e.jsx("button",{onClick:()=>$(!1),className:"p-1 hover:bg-gray-100 dark:hover:bg-dark-200 rounded-lg transition-colors",children:e.jsx(Me,{size:20,className:"text-gray-500"})})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx(my,{value:ue,onChange:V}),e.jsxs("div",{className:"flex justify-end gap-3 pt-4 border-t border-gray-200 dark:border-dark-300",children:[e.jsx("button",{onClick:()=>$(!1),className:"px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-dark-200 rounded-lg transition-colors",children:"Cancel"}),e.jsx("button",{onClick:Pe,disabled:Y,className:"px-4 py-2 text-sm font-medium text-white bg-primary-600 hover:bg-primary-700 disabled:opacity-50 disabled:cursor-not-allowed rounded-lg transition-colors",children:Y?"Saving...":"Save"})]})]})]})}),document.body)]})},bn=({children:n,requireAuth:a=!0,requireAdmin:t=!1})=>{const{isAuthenticated:r,user:i,systemInfo:o,isLoading:s}=pe();return ut(),s?e.jsx("div",{className:"min-h-screen flex items-center justify-center",children:e.jsx("div",{className:"w-8 h-8 border-4 border-gray-200 border-t-blue-500 rounded-full animate-spin"})}):o&&!o.requiresAuth?e.jsx(e.Fragment,{children:n}):a&&!r?e.jsx(It,{to:"/login",replace:!0}):t&&(!i||i.role!=="admin")?e.jsx(It,{to:"/",replace:!0}):e.jsx(e.Fragment,{children:n})},hy=({error:n})=>{const{t:a}=ce();return e.jsx("div",{className:"min-h-screen bg-gray-50 dark:bg-gray-900 flex items-center justify-center p-4",children:e.jsx("div",{className:"max-w-md w-full bg-white dark:bg-gray-800 rounded-lg shadow-lg p-6",children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-red-500 mb-4",children:e.jsx("svg",{className:"mx-auto h-12 w-12",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.732-.833-2.464 0L4.35 16.5c-.77.833.192 2.5 1.732 2.5z"})})}),e.jsx("h1",{className:"text-xl font-bold text-gray-900 dark:text-white mb-2",children:a("errorBoundary.title")}),e.jsx("p",{className:"text-gray-600 dark:text-gray-400 mb-4",children:a("errorBoundary.description")}),e.jsx("button",{onClick:()=>window.location.reload(),className:"bg-blue-500 hover:bg-blue-600 text-white font-medium py-2 px-4 rounded-lg transition-colors",children:a("errorBoundary.tryAgain")}),!1]})})})};class Sa extends h.Component{constructor(a){super(a),this.state={hasError:!1}}static getDerivedStateFromError(a){return{hasError:!0,error:a}}componentDidCatch(a,t){console.error("ErrorBoundary caught an error:",a,t)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:e.jsx(hy,{error:this.state.error}):this.props.children}}const by=(n,a=!0)=>{const t=h.useCallback(r=>{if(!a)return;const i=r.target;if(i.tagName==="INPUT"||i.tagName==="TEXTAREA"||i.contentEditable==="true"||i.isContentEditable)return;if(r.key==="?"||r.key==="/"&&r.shiftKey){const s=n.find(d=>d.key==="?"||d.key==="h");if(s){r.preventDefault(),r.stopPropagation(),s.action();return}}const o=n.find(s=>{const d=s.key.toLowerCase()===r.key.toLowerCase(),u=!!s.metaKey,m=r.metaKey||r.ctrlKey,g=u?m:!0,p=s.ctrlKey?r.ctrlKey:!0,k=!!s.shiftKey===r.shiftKey,x=!!s.altKey===r.altKey;return d&&g&&p&&k&&x});o&&(r.preventDefault(),r.stopPropagation(),o.action())},[n,a]);h.useEffect(()=>{if(a)return document.addEventListener("keydown",t),()=>{document.removeEventListener("keydown",t)}},[t,a])},ky=n=>{const a=[];n.metaKey&&a.push(navigator.platform.includes("Mac")?"⌘":"Ctrl"),n.ctrlKey&&a.push("Ctrl"),n.shiftKey&&a.push("⇧"),n.altKey&&a.push(navigator.platform.includes("Mac")?"⌥":"Alt");let t=n.key.toUpperCase();return n.key===","&&(t=","),n.key===" "&&(t="Space"),n.key==="Enter"&&(t="↩"),n.key==="Escape"&&(t="Esc"),a.push(t),a.join("+")},fy=({isOpen:n,onClose:a,shortcuts:t})=>{const{t:r}=ce();if(!n)return null;const i={navigation:t.filter(o=>o.description.includes("sidebar")||o.description.includes("Toggle")),settings:t.filter(o=>o.description.includes("settings")||o.description.includes("dark mode")),general:t.filter(o=>!o.description.includes("sidebar")&&!o.description.includes("settings")&&!o.description.includes("dark mode")&&!o.description.includes("Toggle"))};return e.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm z-50 flex items-center justify-center p-4",children:e.jsxs("div",{className:"bg-white dark:bg-dark-100 ophelia:bg-[#050505] rounded-xl shadow-2xl w-full max-w-md max-h-[80vh] overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-gray-200 dark:border-dark-300 ophelia:border-[#1a1a1a]",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(In,{className:"h-5 w-5 text-gray-700 dark:text-dark-600 ophelia:text-[#a3a3a3]"}),e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-dark-800 ophelia:text-[#fafafa]",children:r("keyboard.title")})]}),e.jsx(I,{variant:"ghost",size:"sm",onClick:a,className:"h-8 w-8 p-0 hover:bg-gray-100 dark:hover:bg-dark-200",children:e.jsx(Me,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"p-6 space-y-6 overflow-y-auto max-h-[60vh]",children:[Object.entries(i).map(([o,s])=>s.length===0?null:e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium text-gray-700 dark:text-dark-600 mb-3",children:r(`keyboard.groups.${o}`)}),e.jsx("div",{className:"space-y-2",children:s.map((d,u)=>e.jsxs("div",{className:"flex items-center justify-between py-2",children:[e.jsx("span",{className:"text-sm text-gray-600 dark:text-dark-500",children:d.description}),e.jsx("kbd",{className:"px-2 py-1 text-xs font-mono bg-gray-100 dark:bg-dark-200 ophelia:bg-[#121212] text-gray-700 dark:text-dark-600 ophelia:text-[#a3a3a3] rounded border border-gray-300 dark:border-dark-400 ophelia:border-[#262626]",children:ky(d)})]},u))})]},o)),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium text-gray-700 dark:text-dark-600 mb-3",children:r("keyboard.groups.chat")}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between py-2",children:[e.jsx("span",{className:"text-sm text-gray-600 dark:text-dark-500",children:r("keyboard.actions.sendMessage")}),e.jsx("kbd",{className:"px-2 py-1 text-xs font-mono bg-gray-100 dark:bg-dark-200 ophelia:bg-[#121212] text-gray-700 dark:text-dark-600 ophelia:text-[#a3a3a3] rounded border border-gray-300 dark:border-dark-400 ophelia:border-[#262626]",children:"Enter"})]}),e.jsxs("div",{className:"flex items-center justify-between py-2",children:[e.jsx("span",{className:"text-sm text-gray-600 dark:text-dark-500",children:r("keyboard.actions.newLine")}),e.jsx("kbd",{className:"px-2 py-1 text-xs font-mono bg-gray-100 dark:bg-dark-200 ophelia:bg-[#121212] text-gray-700 dark:text-dark-600 ophelia:text-[#a3a3a3] rounded border border-gray-300 dark:border-dark-400 ophelia:border-[#262626]",children:"Shift+Enter"})]})]})]})]}),e.jsx("div",{className:"px-6 py-4 bg-gray-50 dark:bg-dark-200 ophelia:bg-[#0a0a0a] border-t border-gray-200 dark:border-dark-300 ophelia:border-[#1a1a1a]",children:e.jsxs("p",{className:"text-xs text-gray-500 dark:text-dark-400 ophelia:text-[#737373] text-center",children:[r("keyboard.footer",{key1:"?",key2:"H"}).split("?")[0],e.jsx("kbd",{className:"px-1 py-0.5 text-xs font-mono bg-gray-200 dark:bg-dark-300 ophelia:bg-[#1a1a1a] rounded",children:"?"}),r("keyboard.footer",{key1:"?",key2:"H"}).split("?")[1].split("H")[0],e.jsx("kbd",{className:"px-1 py-0.5 text-xs font-mono bg-gray-200 dark:bg-dark-300 ophelia:bg-[#1a1a1a] rounded",children:"H"}),r("keyboard.footer",{key1:"?",key2:"H"}).split("H")[1]]})})]})})},yy=({onClick:n,className:a})=>{const{t}=ce(),[r,i]=h.useState(!1);return e.jsxs(I,{variant:"ghost",size:"sm",onClick:n,onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),className:R("fixed bottom-4 right-4 h-10 w-10 p-0 bg-white/80 dark:bg-dark-100/80 ophelia:bg-[rgba(10,10,10,0.9)] backdrop-blur-sm border border-gray-200 dark:border-dark-300 ophelia:border-[#1a1a1a] shadow-lg hover:shadow-xl transition-all duration-200 z-50","hover:bg-white dark:hover:bg-dark-100 ophelia:hover:bg-[#121212]",a),title:t("keyboard.tooltip"),children:[e.jsx(In,{className:"h-4 w-4"}),r&&e.jsx("div",{className:"absolute bottom-full mb-2 right-0 px-2 py-1 text-xs bg-gray-900 text-white rounded whitespace-nowrap",children:t("keyboard.tooltip")})]})},kn=({message:n="This is a demo version for presentation purposes only. The Ollama backend is not connected.",onDismiss:a,className:t})=>{const[r,i]=h.useState(!1),o=()=>{i(!0),a?.()};return r?null:e.jsx("div",{className:R("bg-gradient-to-r from-amber-50 to-orange-50 dark:from-amber-900/20 dark:to-orange-900/20","border-b border-amber-200 dark:border-amber-800","px-4 py-3",t),children:e.jsxs("div",{className:"flex items-center justify-between max-w-7xl mx-auto",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex-shrink-0",children:e.jsx(Dn,{className:"h-5 w-5 text-amber-600 dark:text-amber-400"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium text-amber-800 dark:text-amber-200",children:"Demo Mode"}),e.jsx("p",{className:"text-xs text-amber-700 dark:text-amber-300 mt-0.5",children:n})]})]}),e.jsxs("div",{className:"flex items-center gap-2 ml-4",children:[e.jsxs(I,{variant:"ghost",size:"sm",className:"text-amber-700 dark:text-amber-300 hover:text-amber-900 dark:hover:text-amber-100 h-8 px-2",onClick:()=>window.open("https://github.com/libre-webui/libre-webui","_blank"),title:"View on GitHub",children:[e.jsx(Ce,{className:"h-4 w-4"}),e.jsx("span",{className:"ml-1 hidden sm:inline",children:"GitHub"})]}),e.jsx(I,{variant:"ghost",size:"sm",onClick:o,className:"text-amber-700 dark:text-amber-300 hover:text-amber-900 dark:hover:text-amber-100 h-8 w-8 p-0",title:"Dismiss",children:e.jsx(Me,{className:"h-4 w-4"})})]})]})})},fn=()=>{const{preferences:n,backgroundImage:a}=be(),t=n.backgroundSettings||{enabled:!1,imageUrl:"",blurAmount:10,opacity:.6},r=a||t.imageUrl;return!t.enabled||!r?null:e.jsx("div",{className:"fixed inset-0 pointer-events-none z-0",style:{backgroundImage:`url(${r})`,backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat",filter:`blur(${t.blurAmount}px)`,opacity:t.opacity,transform:"scale(1.1)"}})},vy=320,yn=.9,xy=600,Sy=()=>{const{t:n}=ce(),{artifactPanelOpen:a,artifactPanelArtifact:t,closeArtifactPanel:r,theme:i}=be(),[o,s]=h.useState(!1),[d,u]=h.useState("preview"),[m,g]=h.useState(xy),[p,k]=h.useState(!1),x=h.useRef(null),b=h.useRef(null),w=h.useRef(null),S=h.useRef(0),F=h.useRef(0),L=t?.id??null;L!==w.current&&(w.current=L,d!=="preview"&&u("preview"));const D=h.useCallback(T=>{T.preventDefault(),k(!0),F.current=m,S.current="touches"in T?T.touches[0].clientX:T.clientX},[m]),A=h.useCallback(T=>{if(!p)return;const H="touches"in T?T.touches[0].clientX:T.clientX,_=S.current-H,Pe=window.innerWidth*yn,De=Math.min(Pe,Math.max(vy,F.current+_));g(De)},[p]),N=h.useCallback(()=>{k(!1)},[]);if(h.useEffect(()=>(p&&(window.addEventListener("mousemove",A),window.addEventListener("mouseup",N),window.addEventListener("touchmove",A),window.addEventListener("touchend",N),document.body.style.userSelect="none",document.body.style.cursor="col-resize"),()=>{window.removeEventListener("mousemove",A),window.removeEventListener("mouseup",N),window.removeEventListener("touchmove",A),window.removeEventListener("touchend",N),document.body.style.userSelect="",document.body.style.cursor=""}),[p,A,N]),h.useEffect(()=>{const T=()=>{const H=window.innerWidth*yn;m>H&&g(H)};return window.addEventListener("resize",T),()=>window.removeEventListener("resize",T)},[m]),h.useEffect(()=>{const T=H=>{H.key==="Escape"&&a&&r()};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[a,r]),h.useEffect(()=>{const T=_=>{p||b.current&&!b.current.contains(_.target)&&a&&r()},H=setTimeout(()=>{window.addEventListener("mousedown",T)},100);return()=>{clearTimeout(H),window.removeEventListener("mousedown",T)}},[a,r,p]),!t)return null;const P=t,U=async T=>{try{await navigator.clipboard.writeText(T),s(!0),setTimeout(()=>s(!1),2e3)}catch(H){console.error("Failed to copy:",H)}},q=()=>{const T=new Blob([P.content],{type:K(P.type)}),H=URL.createObjectURL(T),_=document.createElement("a");_.href=H,_.download=`${P.title}.${O(P.type)}`,document.body.appendChild(_),_.click(),document.body.removeChild(_),URL.revokeObjectURL(H)},K=T=>{switch(T){case"html":return"text/html";case"react":return"text/javascript";case"svg":return"image/svg+xml";case"css":return"text/css";case"json":return"application/json";default:return"text/plain"}},O=T=>{switch(T){case"html":return"html";case"react":return"jsx";case"svg":return"svg";case"css":return"css";case"json":return"json";default:return"txt"}},E=()=>{switch(P.type){case"html":return e.jsx(mt,{className:"h-5 w-5"});case"react":return e.jsx(Ht,{className:"h-5 w-5"});case"svg":return e.jsx(Gt,{className:"h-5 w-5"});case"code":return e.jsx(Ht,{className:"h-5 w-5"});default:return e.jsx(Gt,{className:"h-5 w-5"})}},G=()=>{const T=`
27
+ SYSTEM You are a helpful assistant.`,docs:"Modelfile 文档",docsLink:"语法参考",creating:"创建中...",button:"创建模型",success:"模型 {{name}} 创建成功",failed:"创建模型失败",enterBoth:"请输入模型名称和 Modelfile 内容"},embeddings:{title:"测试嵌入",model:"嵌入模型",selectModel:"选择模型...",recommended:"推荐:nomic-embed-text、mxbai-embed-large",input:"输入文本",placeholder:"输入要生成嵌入的文本...",generating:"生成中...",button:"生成嵌入",result:"结果({{count}} 维)",success:"生成了 {{count}} 维嵌入向量",failed:"生成嵌入失败",enterBoth:"请选择模型并输入文本"}}},Nf={title:"角色",subtitle:"创建和管理具有自定义个性、记忆和行为的 AI 角色",loading:"加载角色中...",createButton:"创建角色",importExport:"导入/导出",stats:{title:"您的角色",count:"已创建 {{count}} 个角色",count_plural:"已创建 {{count}} 个角色"},empty:{title:"暂无角色",description:"创建您的第一个角色以开始个性化 AI 交互",button:"创建您的第一个角色"},deleteConfirm:'确定要删除 "{{name}}" 吗?',deleteSuccess:'角色 "{{name}}" 删除成功',downloadSuccess:'角色 "{{name}}" 下载成功',failed:"{{action}}角色失败"},Tf={title:{create:"创建新角色",edit:"编辑角色"},subtitle:{create:"创建具有自定义个性、记忆系统和自适应学习能力的新 AI 角色",edit:"使用高级记忆、自适应学习和智能参数自定义您的 AI 角色"},loading:"加载表单中...",saved:"已保存",tabs:{basic:"基础",parameters:"参数",memory:"记忆与学习",advanced:"高级"},basic:{name:"名称",namePlaceholder:"输入角色名称",model:"模型",selectModel:"选择模型",description:"描述",descriptionPlaceholder:"描述您的角色...",systemPrompt:"系统提示词",systemPromptPlaceholder:"输入定义角色行为的系统提示词...",systemPromptHint:"系统提示词定义了您的角色如何行为和响应。"},parameters:{temperature:"温度",temperatureHint:"控制创意性与一致性",topP:"Top-P",topPHint:"控制响应多样性",topK:"Top-K",topKHint:"将词汇限制为前 K 个词元",contextWindow:"上下文窗口",contextWindowHint:"最大对话历史长度",maxTokens:"最大词元数",maxTokensHint:"最大响应长度",repeatPenalty:"重复惩罚",repeatPenaltyHint:"减少重复响应"},memory:{title:"记忆系统",subtitle:"角色会随时间记住对话",enableHint:"启用记忆系统让您的角色记住对话并随时间建立上下文。",loading:"加载记忆状态中...",noData:"暂无记忆数据",memories:"记忆",mbUsed:"已用 MB",lastBackup:"上次备份",never:"从未",maxMemories:"最大记忆数",maxMemoriesHint:"此角色可以存储的记忆数量",retention:"记忆保留",retentionHint:"清理前保留记忆的天数",autoCleanup:"自动清理旧记忆",wipeAll:"清除所有记忆",wipeCannot:"此操作无法撤销",wipeButton:"清除",wiping:"清除中...",wipeConfirm:"确定要清除所有记忆吗?此操作无法撤销。",wipeSuccess:"已清除 {{count}} 条记忆"},learning:{title:"自适应学习",subtitle:"角色根据交互进化",enableHint:"启用自适应学习让您的角色根据交互进化和个性化响应。",speed:"学习速度",slow:"慢",slowDesc:"渐进变化",balanced:"平衡",balancedDesc:"适中节奏",fast:"快",fastDesc:"快速适应",autoAdapt:"自动适应用户偏好",whatLearns:"角色学习的内容:",conversationTone:"对话语气",responseStyle:"响应风格",userPreferences:"用户偏好",topicInterests:"话题兴趣"},advanced:{embeddingModel:"嵌入模型",embeddingHint:"选择用于记忆编码和语义搜索的模型。嵌入模型优先显示,其次是其他可用模型。",noModels:"未找到模型",embeddingModels:"嵌入模型",otherModels:"其他模型",installHint:"安装嵌入模型:",recommended:"推荐:nomic-embed-text、mxbai-embed-large、bge-m3、snowflake-arctic-embed",aboutTitle:"关于高级设置",aboutDescription:"嵌入模型被记忆系统用来理解语义含义并在对话中查找相关记忆。请选择适合您用例和可用资源的模型。"},actions:{cancel:"取消",save:"保存",saving:"保存中...",saveClose:"保存并关闭",create:"创建"},success:{created:"角色已创建",updated:"角色已更新"},error:{saveFailed:"保存失败"}},If={enhanced:"增强",systemPrompt:"系统提示词",memories:"记忆",use:"使用",editTooltip:"编辑角色",downloadTooltip:"下载角色",backup:"备份",exportDNA:"导出 DNA",wipeMemories:"清除记忆",wipeConfirm:"确定要清除此角色的所有记忆吗?此操作无法撤销。",wipeSuccess:"已清除 {{count}} 条记忆",backupSuccess:"角色备份下载成功",dnaSuccess:"角色 DNA 导出成功",failed:"{{action}}失败"},Cf={title:"用户管理",subtitle:"管理用户账户和权限",loading:"加载用户中...",createUser:"创建用户",search:"搜索用户...",noUsers:"未找到用户",noUsersMatching:"未找到符合搜索条件的用户",columns:{user:"用户",email:"邮箱",role:"角色",created:"创建时间",actions:"操作"},roles:{admin:"管理员",user:"用户"},noEmail:"无邮箱",deleteConfirm:'确定要删除用户 "{{name}}" 吗?',deleteSuccess:"用户删除成功",deleteFailed:"删除用户失败",cannotDeleteSelf:"您无法删除自己的账户",form:{title:{create:"创建用户",edit:"编辑用户"},username:"用户名",usernamePlaceholder:"输入用户名",email:"邮箱",emailPlaceholder:"输入邮箱(可选)",password:"密码",passwordPlaceholder:"输入密码",passwordHint:"留空以保持当前密码",role:"角色",creating:"创建中...",updating:"更新中...",createButton:"创建用户",updateButton:"更新用户",createSuccess:"用户创建成功",updateSuccess:"用户更新成功",createFailed:"创建用户失败",updateFailed:"更新用户失败"}},Ff={you:"您",assistant:"助手",system:"系统",copy:"复制",copyMessage:"复制消息",copied:"已复制!",regenerate:"重新生成",regenerateResponse:"重新生成响应",edit:"编辑",editSystemMessage:"编辑系统消息",saveChanges:"保存更改",cancelEditing:"取消编辑",delete:"删除",deleteConfirm:"删除此消息?",branch:"分支",speaking:"朗读中...",speakMessage:"朗读消息",stopSpeaking:"停止朗读",showMore:"显示更多",showLess:"显示更少",thinking:"思考中",systemMessagePlaceholder:"输入系统消息...",fullSizeImage:"全尺寸图像",startConversation:"开始对话",startConversationDescription:"发送消息开始与 AI 助手聊天。提问、获取代码帮助或进行自然对话。",scrollToBottom:"滚动到底部",newMessages:"新消息"},Ef={title:"图像库",noImages:"暂无图像",noImagesHint:"使用右侧面板生成您的第一张图像",delete:"删除",download:"下载",deleteConfirm:"确定要删除此图像吗?",deleteSuccess:"图像已删除",deleteFailed:"删除图像失败",downloadFailed:"下载图像失败",loadMore:"加载更多({{current}} / {{total}})",loadFailed:"加载图库失败"},Of={title:"生成图像",prompt:"提示词",promptPlaceholder:"描述您想要创建的图像...",model:"模型",selectModel:"选择模型",noModels:"没有可用的图像生成模型",configurePlugin:"配置支持图像生成的插件",size:"尺寸",quality:"质量",style:"风格",generate:"生成",generating:"生成中...",success:"图像生成成功",failed:"图像生成失败",enterPrompt:"请输入提示词"},Lf={title:"出错了",description:"我们遇到了意外错误。请尝试刷新页面。",tryAgain:"刷新页面",goHome:"返回首页",errorDetails:"错误详情(开发环境)"},Kf={title:"文档",upload:"上传文档",uploading:"上传中...",noDocuments:"未上传文档",uploadHint:"上传文档以在对话中使用",delete:"删除",deleteConfirm:"确定要删除此文档吗?",deleteSuccess:"文档已删除",deleteFailed:"删除文档失败",uploadSuccess:"文档上传成功",uploadFailed:"上传文档失败",types:"支持格式:PDF、TXT、MD、DOCX",unsupportedFileType:"仅支持 PDF 和 TXT 文件",fileSizeTooLarge:"文件大小必须小于 10MB",uploadSuccessWithName:'文档 "{{name}}" 上传成功',removeSuccess:"文档移除成功",removeFailed:"移除文档失败",removeError:"移除文档时发生错误",clickToUpload:"点击上传",orDragAndDrop:"或拖放文件",fileTypesAndSize:"PDF 或 TXT 文件,最大 10MB",uploadedDocuments:"已上传文档",removeDocument:"移除文档"},Bf={speak:"朗读",stop:"停止",speaking:"朗读中...",generateFailed:"生成语音失败",playbackFailed:"音频播放失败",stopSpeaking:"停止朗读",generatingSpeech:"生成语音中...",readAloud:"朗读"},Gf={title:"制品",code:"代码",preview:"预览",copy:"复制代码",copied:"已复制!",download:"下载",expand:"展开",collapse:"折叠",openInNewTab:"在新标签页打开",invalidSvg:"无效的 SVG 内容",invalidJson:"无效的 JSON 内容",previewMode:"预览模式",codeMode:"代码模式",copyContent:"复制内容",openInPanel:"在面板中打开",openInNewWindow:"在新窗口中打开",created:"创建时间",closePanelEsc:"关闭面板(Esc)",copyButton:"复制",open:"打开",dragEdgeToResize:"拖动边缘调整大小"},Hf={title:"导入和导出角色",description:"导出您的角色以分享,或从他人导入角色",exportPersonas:"导出角色",importPersonas:"导入角色",noPersonasToExport:"没有可导出的角色",personasAvailable:"{{count}} 个角色可用",personasAvailable_plural:"{{count}} 个角色可用",exportAll:"全部导出",uploadJsonFile:"上传 JSON 文件",pasteJsonLabel:"粘贴 JSON 数据",pasteJsonPlaceholder:"在此粘贴角色 JSON 数据...",importing:"导入中...",importButton:"导入角色",expectedFormat:"预期 JSON 格式:",exportSuccess:'角色 "{{name}}" 导出成功',exportFailed:"导出角色失败",exportAllSuccess:"全部 {{count}} 个角色导出成功",exportAllFailed:"导出角色失败",pasteJsonData:"请粘贴角色 JSON 数据",importMultipleSuccess:"成功导入 {{count}} 个角色",importMultipleFailed:"导入 {{count}} 个角色失败",importNoneFailed:"未能导入任何角色",importSuccess:"角色导入成功",importFailed:"导入角色失败"},Rf={common:bf,brand:kf,auth:ff,setup:yf,chat:vf,sidebar:xf,user:Sf,settings:wf,models:Pf,personas:Mf,gallery:Df,errors:jf,keyboard:Af,modelManager:zf,personaManager:Nf,personaForm:Tf,personaCard:If,userManager:Cf,chatMessage:Ff,imageGallery:Ef,imageGeneration:Of,errorBoundary:Lf,documents:Kf,ttsButton:Bf,artifacts:Gf,personaImportExport:Hf},Uf={ar:{translation:Ho},bn:{translation:gs},cs:{translation:Hs},da:{translation:gl},de:{translation:Hl},en:{translation:gd},es:{translation:Hd},fr:{translation:gc},hi:{translation:Hc},id:{translation:gu},is:{translation:Hu},it:{translation:gm},ja:{translation:Hm},ko:{translation:gp},ms:{translation:Hp},nl:{translation:gg},pl:{translation:Hg},pt:{translation:gh},ru:{translation:Hh},sv:{translation:gb},th:{translation:Hb},tr:{translation:gk},uk:{translation:Hk},vi:{translation:hf},zh:{translation:Rf}},$f=[{code:"ar",name:"Arabic",nativeName:"العربية",dir:"rtl"},{code:"bn",name:"Bengali",nativeName:"বাংলা",dir:"ltr"},{code:"cs",name:"Czech",nativeName:"Čeština",dir:"ltr"},{code:"da",name:"Danish",nativeName:"Dansk",dir:"ltr"},{code:"de",name:"German",nativeName:"Deutsch",dir:"ltr"},{code:"en",name:"English",nativeName:"English",dir:"ltr"},{code:"es",name:"Spanish",nativeName:"Español",dir:"ltr"},{code:"fr",name:"French",nativeName:"Français",dir:"ltr"},{code:"hi",name:"Hindi",nativeName:"हिन्दी",dir:"ltr"},{code:"id",name:"Indonesian",nativeName:"Bahasa Indonesia",dir:"ltr"},{code:"is",name:"Icelandic",nativeName:"Íslenska",dir:"ltr"},{code:"it",name:"Italian",nativeName:"Italiano",dir:"ltr"},{code:"ja",name:"Japanese",nativeName:"日本語",dir:"ltr"},{code:"ko",name:"Korean",nativeName:"한국어",dir:"ltr"},{code:"ms",name:"Malay",nativeName:"Bahasa Melayu",dir:"ltr"},{code:"nl",name:"Dutch",nativeName:"Nederlands",dir:"ltr"},{code:"pl",name:"Polish",nativeName:"Polski",dir:"ltr"},{code:"pt",name:"Portuguese",nativeName:"Português",dir:"ltr"},{code:"ru",name:"Russian",nativeName:"Русский",dir:"ltr"},{code:"sv",name:"Swedish",nativeName:"Svenska",dir:"ltr"},{code:"th",name:"Thai",nativeName:"ไทย",dir:"ltr"},{code:"tr",name:"Turkish",nativeName:"Türkçe",dir:"ltr"},{code:"uk",name:"Ukrainian",nativeName:"Українська",dir:"ltr"},{code:"vi",name:"Vietnamese",nativeName:"Tiếng Việt",dir:"ltr"},{code:"zh",name:"Chinese",nativeName:"中文",dir:"ltr"}],Vf=["ar","he","fa","ur"],Wf=n=>Vf.includes(n);de.use(Un).use($i).init({resources:Uf,fallbackLng:"en",debug:!1,interpolation:{escapeValue:!1},detection:{order:["localStorage","navigator","htmlTag"],caches:["localStorage"],lookupLocalStorage:"i18nextLng"}});const v=()=>{if(typeof window<"u"){const n=window.location.hostname,a=o=>o.some(s=>n===s||n.endsWith("."+s));if(a(["vercel.app","vercel.dev"])||a(["netlify.app","netlify.com"])||a(["github.io"])||n.startsWith("demo.")||n.startsWith("preview."))return!0}return!1},mn=()=>({isDemo:v(),message:"This is a demo version for presentation purposes only. The Ollama backend is not connected.",showBanner:!0,allowInteraction:!1});function R(...n){return di(ci(n))}function qf(n){const a=new Date(n),r=new Date().getTime()-a.getTime(),i=Math.floor(r/(1e3*60)),o=Math.floor(r/(1e3*60*60)),s=Math.floor(r/(1e3*60*60*24));return i<1?"Just now":i<60?`${i}m ago`:o<24?`${o}h ago`:s<7?`${s}d ago`:a.toLocaleDateString()}function Jf(){return Math.random().toString(36).substring(2)+Date.now().toString(36)}function _f(n,a){return n.length<=a?n:n.substring(0,a)+"..."}function Ry(n){const a=/^\[Thinking:\s*([\s\S]*?)\]\s*/i,t=/^<thinking>([\s\S]*?)<\/thinking>\s*/i,r=n.match(a);if(r)return{thinking:r[1].trim(),content:n.slice(r[0].length).trim()};const i=n.match(t);return i?{thinking:i[1].trim(),content:n.slice(i[0].length).trim()}:{thinking:null,content:n}}const I=({variant:n="primary",size:a="md",loading:t=!1,disabled:r,children:i,className:o,...s})=>{const d="inline-flex items-center justify-center rounded-xl font-medium transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed active:scale-[0.98] relative overflow-hidden",u={primary:"bg-primary-600 text-white shadow-sm hover:bg-primary-700 hover:shadow-md focus:ring-primary-500 dark:bg-primary-500 dark:hover:bg-primary-600 dark:focus:ring-primary-400",secondary:"bg-gray-50 text-gray-700 border border-gray-200 shadow-sm hover:bg-gray-100 hover:border-gray-300 hover:shadow-md focus:ring-gray-500 dark:bg-dark-200 dark:text-dark-700 dark:border-dark-300 dark:hover:bg-dark-300 dark:hover:border-dark-400",outline:"border border-gray-300 text-gray-700 bg-white shadow-sm hover:bg-gray-50 hover:border-gray-400 focus:ring-gray-500 dark:border-dark-300 dark:text-dark-700 dark:bg-dark-50 dark:hover:bg-dark-100 dark:hover:border-dark-400",ghost:"text-gray-600 hover:bg-gray-100 hover:text-gray-900 focus:ring-gray-500 dark:text-dark-500 dark:hover:bg-dark-200 dark:hover:text-dark-800",danger:"bg-error-500 text-white shadow-sm hover:bg-error-600 hover:shadow-md focus:ring-error-500 dark:bg-error-600 dark:hover:bg-error-700"},m={sm:"px-3 py-1.5 text-sm gap-1.5",md:"px-4 py-2.5 text-sm gap-2",lg:"px-6 py-3 text-base gap-2.5"};return e.jsxs("button",{className:R(d,u[n],m[a],o),disabled:r||t,...s,children:[t&&e.jsxs("svg",{className:"mr-2 h-4 w-4 animate-spin",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),i]})},Yf=({label:n,error:a,helper:t,className:r,id:i,...o})=>{const s=h.useId(),d=i||`input-${s}`;return e.jsxs("div",{className:"space-y-1",children:[n&&e.jsx("label",{htmlFor:d,className:"block text-sm font-medium text-gray-700 dark:text-dark-700",children:n}),e.jsx("input",{id:d,className:R("block w-full rounded-xl border border-gray-200 px-4 py-3 text-sm placeholder-gray-500 shadow-sm transition-all duration-200 bg-white text-gray-900","focus:border-primary-500 focus:ring-2 focus:ring-primary-500/20 focus:outline-none focus:shadow-md","dark:border-dark-300 dark:bg-dark-100 dark:text-dark-800 dark:placeholder-dark-500","dark:focus:border-primary-400 dark:focus:ring-primary-400/20",a&&"border-error-500 focus:border-error-500 focus:ring-error-500/20",r),...o}),a&&e.jsx("p",{className:"text-sm text-error-600 dark:text-error-400",children:a}),t&&!a&&e.jsx("p",{className:"text-sm text-gray-500 dark:text-dark-500",children:t})]})},$n=le.forwardRef(({label:n,error:a,helper:t,className:r,id:i,...o},s)=>{const d=h.useId(),u=i||`textarea-${d}`;return e.jsxs("div",{className:"space-y-1",children:[n&&e.jsx("label",{htmlFor:u,className:"block text-sm font-medium text-gray-700 dark:text-dark-700",children:n}),e.jsx("textarea",{ref:s,id:u,className:R("block w-full rounded-xl border border-gray-200 px-4 py-3 text-sm placeholder-gray-500 shadow-sm transition-all duration-200 resize-none bg-white text-gray-900","focus:border-primary-500 focus:ring-2 focus:ring-primary-500/20 focus:outline-none focus:shadow-md","dark:border-dark-300 dark:bg-dark-100 dark:text-dark-800 dark:placeholder-dark-500","dark:focus:border-primary-400 dark:focus:ring-primary-400/20",a&&"border-error-500 focus:border-error-500 focus:ring-error-500/20",r),...o}),a&&e.jsx("p",{className:"text-sm text-error-600 dark:text-error-400",children:a}),t&&!a&&e.jsx("p",{className:"text-sm text-gray-500 dark:text-dark-500",children:t})]})});$n.displayName="Textarea";const xe=({label:n,error:a,helper:t,options:r,className:i,id:o,...s})=>{const d=h.useId(),u=o||`select-${d}`;return e.jsxs("div",{className:"space-y-1",children:[n&&e.jsx("label",{htmlFor:u,className:"block text-sm font-medium text-gray-700 dark:text-dark-700",children:n}),e.jsx("select",{id:u,className:R("block w-full rounded-xl border border-gray-200 px-4 py-3 text-sm shadow-sm transition-all duration-200 bg-white text-gray-900","focus:border-primary-500 focus:ring-2 focus:ring-primary-500/20 focus:outline-none focus:shadow-md","dark:border-dark-300 dark:bg-dark-100 dark:text-dark-800","dark:focus:border-primary-400 dark:focus:ring-primary-400/20",a&&"border-error-500 focus:border-error-500 focus:ring-error-500/20",i),...s,children:r.map(m=>e.jsx("option",{value:m.value,children:m.label},m.value))}),a&&e.jsx("p",{className:"text-sm text-error-600 dark:text-error-400",children:a}),t&&!a&&e.jsx("p",{className:"text-sm text-gray-500 dark:text-dark-600",children:t})]})},Zf={'code[class*="language-"]':{background:"hsl(220, 13%, 18%)",color:"hsl(220, 14%, 71%)",textShadow:"0 1px rgba(0, 0, 0, 0.3)",fontFamily:'"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"2",OTabSize:"2",tabSize:"2",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none"},'pre[class*="language-"]':{background:"hsl(220, 13%, 18%)",color:"hsl(220, 14%, 71%)",textShadow:"0 1px rgba(0, 0, 0, 0.3)",fontFamily:'"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"2",OTabSize:"2",tabSize:"2",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",padding:"1em",margin:"0.5em 0",overflow:"auto",borderRadius:"0.3em"},'code[class*="language-"]::-moz-selection':{background:"hsl(220, 13%, 28%)",color:"inherit",textShadow:"none"},'code[class*="language-"] *::-moz-selection':{background:"hsl(220, 13%, 28%)",color:"inherit",textShadow:"none"},'pre[class*="language-"] *::-moz-selection':{background:"hsl(220, 13%, 28%)",color:"inherit",textShadow:"none"},'code[class*="language-"]::selection':{background:"hsl(220, 13%, 28%)",color:"inherit",textShadow:"none"},'code[class*="language-"] *::selection':{background:"hsl(220, 13%, 28%)",color:"inherit",textShadow:"none"},'pre[class*="language-"] *::selection':{background:"hsl(220, 13%, 28%)",color:"inherit",textShadow:"none"},':not(pre) > code[class*="language-"]':{padding:"0.2em 0.3em",borderRadius:"0.3em",whiteSpace:"normal"},comment:{color:"hsl(220, 10%, 40%)",fontStyle:"italic"},prolog:{color:"hsl(220, 10%, 40%)"},cdata:{color:"hsl(220, 10%, 40%)"},doctype:{color:"hsl(220, 14%, 71%)"},punctuation:{color:"hsl(220, 14%, 71%)"},entity:{color:"hsl(220, 14%, 71%)",cursor:"help"},"attr-name":{color:"hsl(29, 54%, 61%)"},"class-name":{color:"hsl(29, 54%, 61%)"},boolean:{color:"hsl(29, 54%, 61%)"},constant:{color:"hsl(29, 54%, 61%)"},number:{color:"hsl(29, 54%, 61%)"},atrule:{color:"hsl(29, 54%, 61%)"},keyword:{color:"hsl(286, 60%, 67%)"},property:{color:"hsl(355, 65%, 65%)"},tag:{color:"hsl(355, 65%, 65%)"},symbol:{color:"hsl(355, 65%, 65%)"},deleted:{color:"hsl(355, 65%, 65%)"},important:{color:"hsl(355, 65%, 65%)"},selector:{color:"hsl(95, 38%, 62%)"},string:{color:"hsl(95, 38%, 62%)"},char:{color:"hsl(95, 38%, 62%)"},builtin:{color:"hsl(95, 38%, 62%)"},inserted:{color:"hsl(95, 38%, 62%)"},regex:{color:"hsl(95, 38%, 62%)"},"attr-value":{color:"hsl(95, 38%, 62%)"},"attr-value > .token.punctuation":{color:"hsl(95, 38%, 62%)"},variable:{color:"hsl(207, 82%, 66%)"},operator:{color:"hsl(207, 82%, 66%)"},function:{color:"hsl(207, 82%, 66%)"},url:{color:"hsl(187, 47%, 55%)"},"attr-value > .token.punctuation.attr-equals":{color:"hsl(220, 14%, 71%)"},"special-attr > .token.attr-value > .token.value.css":{color:"hsl(220, 14%, 71%)"},".language-css .token.selector":{color:"hsl(355, 65%, 65%)"},".language-css .token.property":{color:"hsl(220, 14%, 71%)"},".language-css .token.function":{color:"hsl(187, 47%, 55%)"},".language-css .token.url > .token.function":{color:"hsl(187, 47%, 55%)"},".language-css .token.url > .token.string.url":{color:"hsl(95, 38%, 62%)"},".language-css .token.important":{color:"hsl(286, 60%, 67%)"},".language-css .token.atrule .token.rule":{color:"hsl(286, 60%, 67%)"},".language-javascript .token.operator":{color:"hsl(286, 60%, 67%)"},".language-javascript .token.template-string > .token.interpolation > .token.interpolation-punctuation.punctuation":{color:"hsl(5, 48%, 51%)"},".language-json .token.operator":{color:"hsl(220, 14%, 71%)"},".language-json .token.null.keyword":{color:"hsl(29, 54%, 61%)"},".language-markdown .token.url":{color:"hsl(220, 14%, 71%)"},".language-markdown .token.url > .token.operator":{color:"hsl(220, 14%, 71%)"},".language-markdown .token.url-reference.url > .token.string":{color:"hsl(220, 14%, 71%)"},".language-markdown .token.url > .token.content":{color:"hsl(207, 82%, 66%)"},".language-markdown .token.url > .token.url":{color:"hsl(187, 47%, 55%)"},".language-markdown .token.url-reference.url":{color:"hsl(187, 47%, 55%)"},".language-markdown .token.blockquote.punctuation":{color:"hsl(220, 10%, 40%)",fontStyle:"italic"},".language-markdown .token.hr.punctuation":{color:"hsl(220, 10%, 40%)",fontStyle:"italic"},".language-markdown .token.code-snippet":{color:"hsl(95, 38%, 62%)"},".language-markdown .token.bold .token.content":{color:"hsl(29, 54%, 61%)"},".language-markdown .token.italic .token.content":{color:"hsl(286, 60%, 67%)"},".language-markdown .token.strike .token.content":{color:"hsl(355, 65%, 65%)"},".language-markdown .token.strike .token.punctuation":{color:"hsl(355, 65%, 65%)"},".language-markdown .token.list.punctuation":{color:"hsl(355, 65%, 65%)"},".language-markdown .token.title.important > .token.punctuation":{color:"hsl(355, 65%, 65%)"},bold:{fontWeight:"bold"},italic:{fontStyle:"italic"},namespace:{Opacity:"0.8"},"token.tab:not(:empty):before":{color:"hsla(220, 14%, 71%, 0.15)",textShadow:"none"},"token.cr:before":{color:"hsla(220, 14%, 71%, 0.15)",textShadow:"none"},"token.lf:before":{color:"hsla(220, 14%, 71%, 0.15)",textShadow:"none"},"token.space:before":{color:"hsla(220, 14%, 71%, 0.15)",textShadow:"none"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item":{marginRight:"0.4em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button":{background:"hsl(220, 13%, 26%)",color:"hsl(220, 9%, 55%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a":{background:"hsl(220, 13%, 26%)",color:"hsl(220, 9%, 55%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span":{background:"hsl(220, 13%, 26%)",color:"hsl(220, 9%, 55%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:hover":{background:"hsl(220, 13%, 28%)",color:"hsl(220, 14%, 71%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:focus":{background:"hsl(220, 13%, 28%)",color:"hsl(220, 14%, 71%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:hover":{background:"hsl(220, 13%, 28%)",color:"hsl(220, 14%, 71%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:focus":{background:"hsl(220, 13%, 28%)",color:"hsl(220, 14%, 71%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:hover":{background:"hsl(220, 13%, 28%)",color:"hsl(220, 14%, 71%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:focus":{background:"hsl(220, 13%, 28%)",color:"hsl(220, 14%, 71%)"},".line-highlight.line-highlight":{background:"hsla(220, 100%, 80%, 0.04)"},".line-highlight.line-highlight:before":{background:"hsl(220, 13%, 26%)",color:"hsl(220, 14%, 71%)",padding:"0.1em 0.6em",borderRadius:"0.3em",boxShadow:"0 2px 0 0 rgba(0, 0, 0, 0.2)"},".line-highlight.line-highlight[data-end]:after":{background:"hsl(220, 13%, 26%)",color:"hsl(220, 14%, 71%)",padding:"0.1em 0.6em",borderRadius:"0.3em",boxShadow:"0 2px 0 0 rgba(0, 0, 0, 0.2)"},"pre[id].linkable-line-numbers.linkable-line-numbers span.line-numbers-rows > span:hover:before":{backgroundColor:"hsla(220, 100%, 80%, 0.04)"},".line-numbers.line-numbers .line-numbers-rows":{borderRightColor:"hsla(220, 14%, 71%, 0.15)"},".command-line .command-line-prompt":{borderRightColor:"hsla(220, 14%, 71%, 0.15)"},".line-numbers .line-numbers-rows > span:before":{color:"hsl(220, 14%, 45%)"},".command-line .command-line-prompt > span:before":{color:"hsl(220, 14%, 45%)"},".rainbow-braces .token.token.punctuation.brace-level-1":{color:"hsl(355, 65%, 65%)"},".rainbow-braces .token.token.punctuation.brace-level-5":{color:"hsl(355, 65%, 65%)"},".rainbow-braces .token.token.punctuation.brace-level-9":{color:"hsl(355, 65%, 65%)"},".rainbow-braces .token.token.punctuation.brace-level-2":{color:"hsl(95, 38%, 62%)"},".rainbow-braces .token.token.punctuation.brace-level-6":{color:"hsl(95, 38%, 62%)"},".rainbow-braces .token.token.punctuation.brace-level-10":{color:"hsl(95, 38%, 62%)"},".rainbow-braces .token.token.punctuation.brace-level-3":{color:"hsl(207, 82%, 66%)"},".rainbow-braces .token.token.punctuation.brace-level-7":{color:"hsl(207, 82%, 66%)"},".rainbow-braces .token.token.punctuation.brace-level-11":{color:"hsl(207, 82%, 66%)"},".rainbow-braces .token.token.punctuation.brace-level-4":{color:"hsl(286, 60%, 67%)"},".rainbow-braces .token.token.punctuation.brace-level-8":{color:"hsl(286, 60%, 67%)"},".rainbow-braces .token.token.punctuation.brace-level-12":{color:"hsl(286, 60%, 67%)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)":{backgroundColor:"hsla(353, 100%, 66%, 0.15)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)":{backgroundColor:"hsla(353, 100%, 66%, 0.15)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)":{backgroundColor:"hsla(137, 100%, 55%, 0.15)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)":{backgroundColor:"hsla(137, 100%, 55%, 0.15)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},".prism-previewer.prism-previewer:before":{borderColor:"hsl(224, 13%, 17%)"},".prism-previewer-gradient.prism-previewer-gradient div":{borderColor:"hsl(224, 13%, 17%)",borderRadius:"0.3em"},".prism-previewer-color.prism-previewer-color:before":{borderRadius:"0.3em"},".prism-previewer-easing.prism-previewer-easing:before":{borderRadius:"0.3em"},".prism-previewer.prism-previewer:after":{borderTopColor:"hsl(224, 13%, 17%)"},".prism-previewer-flipped.prism-previewer-flipped.after":{borderBottomColor:"hsl(224, 13%, 17%)"},".prism-previewer-angle.prism-previewer-angle:before":{background:"hsl(219, 13%, 22%)"},".prism-previewer-time.prism-previewer-time:before":{background:"hsl(219, 13%, 22%)"},".prism-previewer-easing.prism-previewer-easing":{background:"hsl(219, 13%, 22%)"},".prism-previewer-angle.prism-previewer-angle circle":{stroke:"hsl(220, 14%, 71%)",strokeOpacity:"1"},".prism-previewer-time.prism-previewer-time circle":{stroke:"hsl(220, 14%, 71%)",strokeOpacity:"1"},".prism-previewer-easing.prism-previewer-easing circle":{stroke:"hsl(220, 14%, 71%)",fill:"transparent"},".prism-previewer-easing.prism-previewer-easing path":{stroke:"hsl(220, 14%, 71%)"},".prism-previewer-easing.prism-previewer-easing line":{stroke:"hsl(220, 14%, 71%)"}},Xf={'code[class*="language-"]':{background:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)",fontFamily:'"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"2",OTabSize:"2",tabSize:"2",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none"},'pre[class*="language-"]':{background:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)",fontFamily:'"Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace',direction:"ltr",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",lineHeight:"1.5",MozTabSize:"2",OTabSize:"2",tabSize:"2",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",padding:"1em",margin:"0.5em 0",overflow:"auto",borderRadius:"0.3em"},'code[class*="language-"]::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"] *::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'pre[class*="language-"] *::-moz-selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"]::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'code[class*="language-"] *::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},'pre[class*="language-"] *::selection':{background:"hsl(230, 1%, 90%)",color:"inherit"},':not(pre) > code[class*="language-"]':{padding:"0.2em 0.3em",borderRadius:"0.3em",whiteSpace:"normal"},comment:{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},prolog:{color:"hsl(230, 4%, 64%)"},cdata:{color:"hsl(230, 4%, 64%)"},doctype:{color:"hsl(230, 8%, 24%)"},punctuation:{color:"hsl(230, 8%, 24%)"},entity:{color:"hsl(230, 8%, 24%)",cursor:"help"},"attr-name":{color:"hsl(35, 99%, 36%)"},"class-name":{color:"hsl(35, 99%, 36%)"},boolean:{color:"hsl(35, 99%, 36%)"},constant:{color:"hsl(35, 99%, 36%)"},number:{color:"hsl(35, 99%, 36%)"},atrule:{color:"hsl(35, 99%, 36%)"},keyword:{color:"hsl(301, 63%, 40%)"},property:{color:"hsl(5, 74%, 59%)"},tag:{color:"hsl(5, 74%, 59%)"},symbol:{color:"hsl(5, 74%, 59%)"},deleted:{color:"hsl(5, 74%, 59%)"},important:{color:"hsl(5, 74%, 59%)"},selector:{color:"hsl(119, 34%, 47%)"},string:{color:"hsl(119, 34%, 47%)"},char:{color:"hsl(119, 34%, 47%)"},builtin:{color:"hsl(119, 34%, 47%)"},inserted:{color:"hsl(119, 34%, 47%)"},regex:{color:"hsl(119, 34%, 47%)"},"attr-value":{color:"hsl(119, 34%, 47%)"},"attr-value > .token.punctuation":{color:"hsl(119, 34%, 47%)"},variable:{color:"hsl(221, 87%, 60%)"},operator:{color:"hsl(221, 87%, 60%)"},function:{color:"hsl(221, 87%, 60%)"},url:{color:"hsl(198, 99%, 37%)"},"attr-value > .token.punctuation.attr-equals":{color:"hsl(230, 8%, 24%)"},"special-attr > .token.attr-value > .token.value.css":{color:"hsl(230, 8%, 24%)"},".language-css .token.selector":{color:"hsl(5, 74%, 59%)"},".language-css .token.property":{color:"hsl(230, 8%, 24%)"},".language-css .token.function":{color:"hsl(198, 99%, 37%)"},".language-css .token.url > .token.function":{color:"hsl(198, 99%, 37%)"},".language-css .token.url > .token.string.url":{color:"hsl(119, 34%, 47%)"},".language-css .token.important":{color:"hsl(301, 63%, 40%)"},".language-css .token.atrule .token.rule":{color:"hsl(301, 63%, 40%)"},".language-javascript .token.operator":{color:"hsl(301, 63%, 40%)"},".language-javascript .token.template-string > .token.interpolation > .token.interpolation-punctuation.punctuation":{color:"hsl(344, 84%, 43%)"},".language-json .token.operator":{color:"hsl(230, 8%, 24%)"},".language-json .token.null.keyword":{color:"hsl(35, 99%, 36%)"},".language-markdown .token.url":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url > .token.operator":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url-reference.url > .token.string":{color:"hsl(230, 8%, 24%)"},".language-markdown .token.url > .token.content":{color:"hsl(221, 87%, 60%)"},".language-markdown .token.url > .token.url":{color:"hsl(198, 99%, 37%)"},".language-markdown .token.url-reference.url":{color:"hsl(198, 99%, 37%)"},".language-markdown .token.blockquote.punctuation":{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},".language-markdown .token.hr.punctuation":{color:"hsl(230, 4%, 64%)",fontStyle:"italic"},".language-markdown .token.code-snippet":{color:"hsl(119, 34%, 47%)"},".language-markdown .token.bold .token.content":{color:"hsl(35, 99%, 36%)"},".language-markdown .token.italic .token.content":{color:"hsl(301, 63%, 40%)"},".language-markdown .token.strike .token.content":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.strike .token.punctuation":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.list.punctuation":{color:"hsl(5, 74%, 59%)"},".language-markdown .token.title.important > .token.punctuation":{color:"hsl(5, 74%, 59%)"},bold:{fontWeight:"bold"},italic:{fontStyle:"italic"},namespace:{Opacity:"0.8"},"token.tab:not(:empty):before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.cr:before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.lf:before":{color:"hsla(230, 8%, 24%, 0.2)"},"token.space:before":{color:"hsla(230, 8%, 24%, 0.2)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item":{marginRight:"0.4em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 6%, 44%)",padding:"0.1em 0.4em",borderRadius:"0.3em"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:hover":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},"div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:focus":{background:"hsl(230, 1%, 78%)",color:"hsl(230, 8%, 24%)"},".line-highlight.line-highlight":{background:"hsla(230, 8%, 24%, 0.05)"},".line-highlight.line-highlight:before":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 8%, 24%)",padding:"0.1em 0.6em",borderRadius:"0.3em",boxShadow:"0 2px 0 0 rgba(0, 0, 0, 0.2)"},".line-highlight.line-highlight[data-end]:after":{background:"hsl(230, 1%, 90%)",color:"hsl(230, 8%, 24%)",padding:"0.1em 0.6em",borderRadius:"0.3em",boxShadow:"0 2px 0 0 rgba(0, 0, 0, 0.2)"},"pre[id].linkable-line-numbers.linkable-line-numbers span.line-numbers-rows > span:hover:before":{backgroundColor:"hsla(230, 8%, 24%, 0.05)"},".line-numbers.line-numbers .line-numbers-rows":{borderRightColor:"hsla(230, 8%, 24%, 0.2)"},".command-line .command-line-prompt":{borderRightColor:"hsla(230, 8%, 24%, 0.2)"},".line-numbers .line-numbers-rows > span:before":{color:"hsl(230, 1%, 62%)"},".command-line .command-line-prompt > span:before":{color:"hsl(230, 1%, 62%)"},".rainbow-braces .token.token.punctuation.brace-level-1":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-5":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-9":{color:"hsl(5, 74%, 59%)"},".rainbow-braces .token.token.punctuation.brace-level-2":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-6":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-10":{color:"hsl(119, 34%, 47%)"},".rainbow-braces .token.token.punctuation.brace-level-3":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-7":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-11":{color:"hsl(221, 87%, 60%)"},".rainbow-braces .token.token.punctuation.brace-level-4":{color:"hsl(301, 63%, 40%)"},".rainbow-braces .token.token.punctuation.brace-level-8":{color:"hsl(301, 63%, 40%)"},".rainbow-braces .token.token.punctuation.brace-level-12":{color:"hsl(301, 63%, 40%)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)":{backgroundColor:"hsla(353, 100%, 66%, 0.15)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)":{backgroundColor:"hsla(353, 100%, 66%, 0.15)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix)::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.deleted:not(.prefix) *::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix)::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre > code.diff-highlight .token.token.deleted:not(.prefix) *::selection":{backgroundColor:"hsla(353, 95%, 66%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)":{backgroundColor:"hsla(137, 100%, 55%, 0.15)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)":{backgroundColor:"hsla(137, 100%, 55%, 0.15)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::-moz-selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix)::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre.diff-highlight > code .token.token.inserted:not(.prefix) *::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix)::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},"pre > code.diff-highlight .token.token.inserted:not(.prefix) *::selection":{backgroundColor:"hsla(135, 73%, 55%, 0.25)"},".prism-previewer.prism-previewer:before":{borderColor:"hsl(0, 0, 95%)"},".prism-previewer-gradient.prism-previewer-gradient div":{borderColor:"hsl(0, 0, 95%)",borderRadius:"0.3em"},".prism-previewer-color.prism-previewer-color:before":{borderRadius:"0.3em"},".prism-previewer-easing.prism-previewer-easing:before":{borderRadius:"0.3em"},".prism-previewer.prism-previewer:after":{borderTopColor:"hsl(0, 0, 95%)"},".prism-previewer-flipped.prism-previewer-flipped.after":{borderBottomColor:"hsl(0, 0, 95%)"},".prism-previewer-angle.prism-previewer-angle:before":{background:"hsl(0, 0%, 100%)"},".prism-previewer-time.prism-previewer-time:before":{background:"hsl(0, 0%, 100%)"},".prism-previewer-easing.prism-previewer-easing":{background:"hsl(0, 0%, 100%)"},".prism-previewer-angle.prism-previewer-angle circle":{stroke:"hsl(230, 8%, 24%)",strokeOpacity:"1"},".prism-previewer-time.prism-previewer-time circle":{stroke:"hsl(230, 8%, 24%)",strokeOpacity:"1"},".prism-previewer-easing.prism-previewer-easing circle":{stroke:"hsl(230, 8%, 24%)",fill:"transparent"},".prism-previewer-easing.prism-previewer-easing path":{stroke:"hsl(230, 8%, 24%)"},".prism-previewer-easing.prism-previewer-easing line":{stroke:"hsl(230, 8%, 24%)"}};function Qf(n,a){let t;try{t=n()}catch{return}return{getItem:i=>{var o;const s=u=>u===null?null:JSON.parse(u,void 0),d=(o=t.getItem(i))!=null?o:null;return d instanceof Promise?d.then(s):s(d)},setItem:(i,o)=>t.setItem(i,JSON.stringify(o,void 0)),removeItem:i=>t.removeItem(i)}}const lt=n=>a=>{try{const t=n(a);return t instanceof Promise?t:{then(r){return lt(r)(t)},catch(r){return this}}}catch(t){return{then(r){return this},catch(r){return lt(r)(t)}}}},ey=(n,a)=>(t,r,i)=>{let o={storage:Qf(()=>localStorage),partialize:S=>S,version:0,merge:(S,F)=>({...F,...S}),...a},s=!1,d=0;const u=new Set,m=new Set;let g=o.storage;if(!g)return n((...S)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),t(...S)},r,i);const p=()=>{const S=o.partialize({...r()});return g.setItem(o.name,{state:S,version:o.version})},k=i.setState;i.setState=(S,F)=>(k(S,F),p());const x=n((...S)=>(t(...S),p()),r,i);i.getInitialState=()=>x;let b;const w=()=>{var S,F;if(!g)return;const L=++d;s=!1,u.forEach(A=>{var N;return A((N=r())!=null?N:x)});const D=((F=o.onRehydrateStorage)==null?void 0:F.call(o,(S=r())!=null?S:x))||void 0;return lt(g.getItem.bind(g))(o.name).then(A=>{if(A)if(typeof A.version=="number"&&A.version!==o.version){if(o.migrate){const N=o.migrate(A.state,A.version);return N instanceof Promise?N.then(P=>[!0,P]):[!0,N]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,A.state];return[!1,void 0]}).then(A=>{var N;if(L!==d)return;const[P,U]=A;if(b=o.merge(U,(N=r())!=null?N:x),t(b,!0),P)return p()}).then(()=>{L===d&&(D?.(b,void 0),b=r(),s=!0,m.forEach(A=>A(b)))}).catch(A=>{L===d&&D?.(void 0,A)})};return i.persist={setOptions:S=>{o={...o,...S},S.storage&&(g=S.storage)},clearStorage:()=>{g?.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>w(),hasHydrated:()=>s,onHydrate:S=>(u.add(S),()=>{u.delete(S)}),onFinishHydration:S=>(m.add(S),()=>{m.delete(S)})},o.skipHydration||w(),b||x},Vn=ey,be=Ca()(Vn((n,a)=>({theme:{mode:"light"},setTheme:t=>{n({theme:t}),document.documentElement.classList.remove("dark","ophelia"),t.mode==="dark"?document.documentElement.classList.add("dark"):t.mode==="ophelia"&&document.documentElement.classList.add("ophelia")},toggleTheme:()=>{const t=a().theme,r=["light","dark","ophelia"],o=(r.indexOf(t.mode)+1)%r.length;a().setTheme({mode:r[o]})},sidebarOpen:!0,sidebarCompact:!1,setSidebarOpen:t=>n({sidebarOpen:t}),setSidebarCompact:t=>n({sidebarCompact:t}),toggleSidebar:()=>n(t=>({sidebarOpen:!t.sidebarOpen})),toggleSidebarCompact:()=>n(t=>({sidebarCompact:!t.sidebarCompact})),artifactPanelOpen:!1,artifactPanelArtifact:null,openArtifactPanel:t=>n({artifactPanelOpen:!0,artifactPanelArtifact:t}),closeArtifactPanel:()=>n({artifactPanelOpen:!1,artifactPanelArtifact:null}),preferences:{theme:{mode:"light"},defaultModel:"",systemMessage:"",generationOptions:{temperature:.7,top_p:.9,top_k:40,num_predict:1024},embeddingSettings:{enabled:!1,model:"nomic-embed-text",chunkSize:1e3,chunkOverlap:200,similarityThreshold:.3},titleSettings:{autoTitle:!1,taskModel:""},showUsername:!1,backgroundSettings:{enabled:!1,imageUrl:"",blurAmount:10,opacity:.6}},setPreferences:t=>n(r=>({preferences:{...r.preferences,...t}})),loadPreferences:async()=>{try{const{preferencesApi:t}=await he(async()=>{const{preferencesApi:i}=await Promise.resolve().then(()=>Ma);return{preferencesApi:i}},void 0),r=await t.getPreferences();if(r.success&&r.data){const i=r.data;n(o=>({preferences:{...o.preferences,...i},backgroundImage:i.backgroundSettings?.imageUrl||null}))}}catch(t){console.warn("Failed to load preferences from backend:",t)}},isGenerating:!1,setIsGenerating:t=>n({isGenerating:t}),hasSeenSettingsNotification:!1,markSettingsNotificationAsSeen:()=>n({hasSeenSettingsNotification:!0}),isDemoMode:v(),demoConfig:mn(),setDemoMode:t=>{n({isDemoMode:t,demoConfig:mn()})},backgroundImage:null,setBackgroundImage:async t=>{if(n({backgroundImage:t}),t){const r=a(),i={...r.preferences,backgroundSettings:{enabled:!0,imageUrl:t,blurAmount:r.preferences.backgroundSettings?.blurAmount||10,opacity:r.preferences.backgroundSettings?.opacity||.6}};r.setPreferences(i);try{const{preferencesApi:o}=await he(async()=>{const{preferencesApi:s}=await Promise.resolve().then(()=>Ma);return{preferencesApi:s}},void 0);await o.updatePreferences({backgroundSettings:i.backgroundSettings})}catch(o){console.warn("Failed to save background settings to backend:",o)}}},uploadBackgroundImage:async t=>{try{const r=new FileReader;return new Promise((i,o)=>{r.onload=async s=>{try{const d=s.target?.result;await a().setBackgroundImage(d),i()}catch(d){o(d)}},r.onerror=o,r.readAsDataURL(t)})}catch(r){throw console.error("Failed to upload background image:",r),r}},removeBackgroundImage:async()=>{n({backgroundImage:null});const t=a(),r={enabled:!1,imageUrl:"",blurAmount:t.preferences.backgroundSettings?.blurAmount||10,opacity:t.preferences.backgroundSettings?.opacity||.6};t.setPreferences({backgroundSettings:r});try{const{preferencesApi:i}=await he(async()=>{const{preferencesApi:o}=await Promise.resolve().then(()=>Ma);return{preferencesApi:o}},void 0);await i.updatePreferences({backgroundSettings:r})}catch(i){console.warn("Failed to save background removal to backend:",i)}},clearUserState:()=>{n({backgroundImage:null,preferences:{theme:{mode:"light"},defaultModel:"",systemMessage:"",generationOptions:{temperature:.7,top_p:.9,top_k:40,num_predict:1024},embeddingSettings:{enabled:!1,model:"nomic-embed-text",chunkSize:1e3,chunkOverlap:200,similarityThreshold:.3},titleSettings:{autoTitle:!1,taskModel:""},showUsername:!1,backgroundSettings:{enabled:!1,imageUrl:"",blurAmount:10,opacity:.6}}})}}),{name:"libre-webui-app-state",partialize:n=>{const{backgroundSettings:a,...t}=n.preferences;return{theme:n.theme,sidebarOpen:n.sidebarOpen,sidebarCompact:n.sidebarCompact,preferences:t,hasSeenSettingsNotification:n.hasSeenSettingsNotification}}})),ay=()=>{const{theme:n,setTheme:a}=be.getState();a(n)};typeof window<"u"&&ay();const ty={'code[class*="language-"]':{color:"#f8f8f2",background:"none",textShadow:"none",fontFamily:"'JetBrains Mono', Consolas, Monaco, 'Andale Mono', monospace",fontSize:"1em",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",wordWrap:"normal",lineHeight:"1.5",tabSize:4,hyphens:"none"},'pre[class*="language-"]':{color:"#f8f8f2",background:"#1a1b26",textShadow:"none",fontFamily:"'JetBrains Mono', Consolas, Monaco, 'Andale Mono', monospace",fontSize:"1em",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",wordWrap:"normal",lineHeight:"1.5",tabSize:4,hyphens:"none",padding:"1em",margin:".5em 0",overflow:"auto",borderRadius:"0.5rem"},comment:{color:"#6272a4"},prolog:{color:"#6272a4"},doctype:{color:"#6272a4"},cdata:{color:"#6272a4"},punctuation:{color:"#f8f8f2"},property:{color:"#ff79c6"},tag:{color:"#ff79c6"},boolean:{color:"#bd93f9"},number:{color:"#bd93f9"},constant:{color:"#bd93f9"},symbol:{color:"#bd93f9"},deleted:{color:"#ff5555"},selector:{color:"#50fa7b"},"attr-name":{color:"#50fa7b"},string:{color:"#f1fa8c"},char:{color:"#f1fa8c"},builtin:{color:"#8be9fd"},inserted:{color:"#50fa7b"},operator:{color:"#ff79c6"},entity:{color:"#f8f8f2",cursor:"help"},url:{color:"#8be9fd"},".language-css .token.string":{color:"#f1fa8c"},".style .token.string":{color:"#f1fa8c"},atrule:{color:"#ff79c6"},"attr-value":{color:"#f1fa8c"},keyword:{color:"#ff79c6"},function:{color:"#50fa7b"},"class-name":{color:"#8be9fd"},regex:{color:"#f1fa8c"},important:{color:"#ff5555",fontWeight:"bold"},variable:{color:"#f8f8f2"}},ny={js:"javascript",ts:"typescript",py:"python",sh:"bash",shell:"bash",c:"cpp","c++":"cpp"},ry=["javascript","typescript","python","java","cpp","bash","json","markdown","css","html","jsx","xml"],pn=({children:n,language:a,isDark:t=!1,className:r=""})=>{const{theme:i}=be(),o=i.mode==="ophelia",s=ny[a.toLowerCase()]||a.toLowerCase();if(!ry.includes(s))return e.jsx("pre",{className:`bg-gray-100 dark:bg-dark-200 ophelia:bg-[#1a1b26] p-3 rounded-lg overflow-x-auto text-sm font-mono ${r}`,children:e.jsx("code",{className:"ophelia:text-[#f8f8f2]",children:n})});const d=o?ty:t?Zf:Xf;return e.jsx(Kr,{language:s,style:d,className:r,customStyle:{margin:0,padding:"0.75rem",borderRadius:"0.5rem",fontSize:"0.875rem",...o&&{background:"#1a1b26"}},showLineNumbers:!1,children:n})},iy={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_APP_VERSION:"0.4.3"},oy=()=>window.location.protocol==="file:"?"http://localhost:3001/api":`${window.location.origin}/api`,ke=oy(),sy=()=>{console.log("🚀 API_BASE_URL configured as:",ke),console.log("🌐 Window location:",window.location),console.log("🔧 Environment variables:",iy)};sy();console.log("📱 User agent:",navigator.userAgent);console.log("🎭 Demo mode detected:",v());const j=(n,a=!0)=>new Promise(t=>{setTimeout(()=>{t({success:a,data:n,error:a?void 0:"Demo mode: Backend not available"})},500)}),Pa=[{name:"llama3.2:3b",size:2048e6,digest:"demo-digest-1",modified_at:new Date().toISOString(),details:{format:"gguf",family:"llama",families:["llama"],parameter_size:"3B",quantization_level:"Q4_0"}},{name:"qwen2.5:7b",size:4096e6,digest:"demo-digest-2",modified_at:new Date().toISOString(),details:{format:"gguf",family:"qwen",families:["qwen"],parameter_size:"7B",quantization_level:"Q4_0"}}],Wn=()=>[{id:"demo-session-1",title:"Demo Chat Session",model:Pa[0].name,messages:[{id:"demo-msg-1",role:"user",content:"Hello! Can you tell me about this demo?",timestamp:Date.now()},{id:"demo-msg-2",role:"assistant",content:"This is a demo of Libre WebUI! In a real deployment, I would be powered by Ollama running locally on your machine. This demo shows the beautiful interface and features without the backend connection.",timestamp:Date.now()}],createdAt:Date.now(),updatedAt:Date.now()}],ly=Wn(),dy=3e5,y=nt.create({baseURL:ke,timeout:dy});y.interceptors.request.use(n=>{const a=localStorage.getItem("auth-token");return a&&(n.headers.Authorization=`Bearer ${a}`),n},n=>Promise.reject(n));y.interceptors.response.use(n=>n,n=>n.response?.status===401?(console.warn("🔒 Session expired or unauthorized, logging out..."),localStorage.removeItem("auth-token"),he(async()=>{const{useAuthStore:a}=await Promise.resolve().then(()=>gy);return{useAuthStore:a}},void 0).then(({useAuthStore:a})=>{a.getState().logout()}),window.location.pathname!=="/login"&&(window.location.href="/login"),Promise.reject(new Error("Session expired"))):(console.error("API Error:",n),Promise.reject(n)));const ze={getSessions:()=>y.get("/chat/sessions").then(n=>n.data),createSession:(n,a,t)=>y.post("/chat/sessions",{model:n,title:a,personaId:t}).then(r=>r.data),getSession:n=>{if(v()){const a=Wn().find(t=>t.id===n);return a?j(a):Promise.resolve({success:!1,error:"Session not found in demo mode"})}return y.get(`/chat/sessions/${n}`).then(a=>a.data)},updateSession:(n,a)=>{if(v()){const t=ly.find(r=>r.id===n);if(t){const r={...t,...a,updatedAt:Date.now()};return j(r)}return Promise.resolve({success:!1,error:"Session not found in demo mode"})}return y.put(`/chat/sessions/${n}`,a).then(t=>t.data)},deleteSession:n=>v()?j(null):y.delete(`/chat/sessions/${n}`).then(a=>a.data),clearAllSessions:()=>y.delete("/chat/sessions").then(n=>n.data),generateTitle:(n,a,t)=>{if(v()){const r=t.substring(0,30)+(t.length>30?"...":"");return j({title:r})}return y.post(`/chat/sessions/${n}/generate-title`,{model:a,message:t}).then(r=>r.data)},sendMessage:(n,a,t)=>y.post(`/chat/sessions/${n}/messages`,{content:a,options:t}).then(r=>r.data),saveMessage:(n,a)=>y.post(`/chat/sessions/${n}/messages`,a).then(t=>t.data),updateMessage:(n,a,t)=>v()?j({}):y.put(`/chat/sessions/${n}/messages/${a}`,t).then(r=>r.data),generateChatResponse:(n,a,t)=>y.post(`/chat/sessions/${n}/generate`,{message:a,options:t}).then(r=>r.data),generateChatStreamResponse:(n,a,t)=>({subscribe:async(r,i,o)=>{try{const s=await fetch(`${ke}/chat/sessions/${n}/generate/stream`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:a,options:t})});if(!s.ok)throw new Error(`HTTP error! status: ${s.status}`);const d=s.body?.getReader();if(!d)throw new Error("No response body reader available");const u=new TextDecoder;let m="";const g=()=>{d.read().then(({done:p,value:k})=>{if(p){o?.();return}m+=u.decode(k,{stream:!0});const x=m.split(`
28
+ `);m=x.pop()||"";for(const b of x){const w=b.trim();if(w.startsWith("data: ")){const S=w.slice(6);if(S==="[DONE]"){o?.();return}try{const F=JSON.parse(S);if(r(F),F.type==="done"||F.type==="error"){F.type==="error"?i?.(F.error):o?.();return}}catch(F){console.error("Failed to parse SSE data:",F)}}}g()}).catch(p=>{i?.(p instanceof Error?p:new Error(String(p)))})};return g(),()=>d.cancel()}catch(s){return i?.(s instanceof Error?s:new Error(String(s))),()=>{}}}}),getMessageBranches:(n,a)=>v()?j([]):y.get(`/chat/sessions/${n}/messages/${a}/branches`).then(t=>t.data),switchMessageBranch:(n,a,t)=>v()?j({}):y.post(`/chat/sessions/${n}/messages/${a}/branch`,{branchIndex:t}).then(r=>r.data),createMessageBranch:(n,a,t)=>v()?j({}):y.post(`/chat/sessions/${n}/messages/${a}/branches`,{...t}).then(r=>r.data)},Fe={checkHealth:()=>v()?j({status:"offline"},!1):y.get("/ollama/health").then(n=>n.data),getModels:()=>v()?j(Pa):y.get("/ollama/models").then(n=>n.data),pullModel:n=>v()?j(null,!1):y.post(`/ollama/models/${n}/pull`).then(a=>a.data),pullModelStream:(n,a,t,r)=>{if(v()){let o=0;const s=setInterval(()=>{o+=Math.random()*20,o>=100?(o=100,a({status:"success",total:100,completed:100,percent:100}),clearInterval(s),setTimeout(t,500)):a({status:"pulling",total:100,completed:o,percent:Math.round(o)})},1e3);return()=>clearInterval(s)}const i=new EventSource(`${ke}/ollama/models/${n}/pull/stream`);return i.onmessage=o=>{const s=JSON.parse(o.data);switch(s.type){case"progress":a({status:s.status,digest:s.digest,total:s.total,completed:s.completed,percent:s.percent});break;case"complete":i.close(),t();break;case"error":i.close(),r(s.error);break}},i.onerror=()=>{i.close(),r("Connection to server lost")},()=>{i.close()}},deleteModel:n=>v()?j(null,!1):y.delete(`/ollama/models/${n}`).then(a=>a.data),showModel:(n,a=!1)=>{if(v()){const t=Pa.find(r=>r.name===n);return j(t||null,!!t)}return y.get(`/ollama/models/${n}`,{params:{verbose:a}}).then(t=>t.data)},createModel:n=>v()?j(null,!1):y.post("/ollama/models",n).then(a=>a.data),copyModel:(n,a)=>v()?j(null,!1):y.post("/ollama/models/copy",{source:n,destination:a}).then(t=>t.data),pushModel:n=>v()?j(null,!1):y.post(`/ollama/models/${n}/push`).then(a=>a.data),pullAllModels:()=>v()?j(null,!1):y.post("/ollama/models/pull-all").then(n=>n.data),pullAllModelsStream:(n,a,t)=>{if(v()){const i=Pa;let o=0;const s=setInterval(()=>{o++,o<=i.length&&n({current:o,total:i.length,modelName:i[o-1]?.name||"demo-model",status:Math.random()>.1?"success":"error",error:Math.random()>.1?void 0:"Demo error"}),o>=i.length&&(clearInterval(s),setTimeout(a,500))},1e3);return}const r=new EventSource(`${ke}/ollama/models/pull-all/stream`);r.onmessage=i=>{const o=JSON.parse(i.data);switch(o.type){case"progress":n({current:o.current,total:o.total,modelName:o.modelName,status:o.status,error:o.error});break;case"complete":r.close(),a();break;case"error":r.close(),t(o.error);break}},r.onerror=()=>{r.close(),t("Connection to server lost")}},generateEmbeddings:n=>v()?j({embeddings:[[]]},!1):y.post("/ollama/embed",n).then(a=>a.data),listRunningModels:()=>v()?j([]):y.get("/ollama/running").then(n=>n.data),getVersion:()=>v()?j({version:"demo-mode"},!1):y.get("/ollama/version").then(n=>n.data),chatCompletion:n=>v()?j({message:{content:"Demo response",role:"assistant"}},!1):y.post("/ollama/chat",n).then(a=>a.data),checkBlobExists:n=>v()?Promise.resolve(!1):y.head(`/ollama/blobs/${n}`).then(()=>!0).catch(()=>!1),pushBlob:(n,a)=>v()?j(null,!1):y.post(`/ollama/blobs/${n}`,a,{headers:{"Content-Type":"application/octet-stream"}}).then(t=>t.data),generateLegacyEmbeddings:n=>v()?j({embedding:[]},!1):y.post("/ollama/embeddings",n).then(a=>a.data),getLibraryModels:()=>v()?j([{name:"llama3.2",description:"Meta's latest Llama model",category:"general",sizes:["1b","3b"],pulls:"50M+",tags:["general"]},{name:"deepseek-r1",description:"Open reasoning model",category:"reasoning",sizes:["7b","14b","32b"],pulls:"200M+",tags:["reasoning"]}]):y.get("/ollama/library").then(n=>n.data)},se={getAllPlugins:()=>v()?j([]):y.get("/plugins").then(n=>n.data),uploadPlugin:n=>{if(v())return j({},!1);const a=new FormData;return a.append("plugin",n),y.post("/plugins/upload",a).then(t=>t.data)},installPlugin:n=>v()?j({},!1):y.post("/plugins/install",n).then(a=>a.data),updatePlugin:(n,a)=>v()?j({},!1):y.put(`/plugins/${n}`,a).then(t=>t.data),deletePlugin:n=>v()?j(void 0):y.delete(`/plugins/${n}`).then(a=>a.data),activatePlugin:n=>v()?j({},!1):y.post(`/plugins/activate/${n}`).then(a=>a.data),deactivatePlugin:n=>{if(v())return j(void 0);const a=n?`/plugins/deactivate/${n}`:"/plugins/deactivate";return y.post(a).then(t=>t.data)},getActivePlugin:()=>v()?j(null):y.get("/plugins/active").then(n=>n.data),getPluginStatus:()=>v()?j([]):y.get("/plugins/status").then(n=>n.data),exportPlugin:n=>v()?Promise.resolve(new Blob(["{}"],{type:"application/json"})):y.get(`/plugins/${n}/export`,{responseType:"blob"}).then(a=>a.data),getCredentials:()=>v()?j([]):y.get("/plugins/credentials/all").then(n=>n.data),setApiKey:(n,a)=>v()?j(!1,!1):y.post(`/plugins/${n}/credentials`,{api_key:a}).then(t=>t.data),deleteApiKey:n=>v()?j(!1,!1):y.delete(`/plugins/${n}/credentials`).then(a=>a.data),checkApiKey:n=>v()?j(!1):y.get(`/plugins/${n}/credentials/check`).then(a=>a.data)},te={getPreferences:()=>y.get("/preferences").then(n=>n.data),updatePreferences:n=>y.put("/preferences",n).then(a=>a.data),setDefaultModel:n=>y.put("/preferences/default-model",{model:n}).then(a=>a.data),setSystemMessage:n=>y.put("/preferences/system-message",{message:n}).then(a=>a.data),setGenerationOptions:n=>y.put("/preferences/generation-options",n).then(a=>a.data),resetGenerationOptions:()=>y.post("/preferences/generation-options/reset").then(n=>n.data),setEmbeddingSettings:n=>y.put("/preferences/embedding-settings",n).then(a=>a.data),resetEmbeddingSettings:()=>y.post("/preferences/embedding-settings/reset").then(n=>n.data),importData:(n,a="replace")=>v()?j({theme:{mode:"dark"},defaultModel:"llama3.2",systemMessage:"You are a helpful assistant.",generationOptions:{},embeddingSettings:{enabled:!1,model:"nomic-embed-text",chunkSize:1e3,chunkOverlap:200,similarityThreshold:.7},showUsername:!1}):y.post("/preferences/import",{data:n,mergeStrategy:a}).then(t=>t.data)},dt={uploadDocument:(n,a)=>{if(v())return j({id:"demo-doc-"+Date.now(),filename:n.name,fileType:n.name.endsWith(".pdf")?"pdf":"txt",size:n.size,sessionId:a,uploadedAt:Date.now()});const t=new FormData;return t.append("document",n),a&&t.append("sessionId",a),y.post("/documents/upload",t).then(r=>r.data)},getDocuments:n=>{if(v())return j([]);const a=n?`/documents/session/${n}`:"/documents";return y.get(a).then(t=>t.data)},getDocument:n=>v()?j({id:n,filename:"demo-document.pdf",fileType:"pdf",size:1024,content:"Demo document content...",uploadedAt:Date.now()}):y.get(`/documents/${n}`).then(a=>a.data),searchDocuments:(n,a,t)=>v()?j([]):y.post("/documents/search",{query:n,sessionId:a,limit:t}).then(r=>r.data),deleteDocument:n=>v()?j(void 0):y.delete(`/documents/${n}`).then(a=>a.data),getEmbeddingStatus:()=>v()?j({available:!1,model:"nomic-embed-text",chunksWithEmbeddings:0,totalChunks:0}):y.get("/documents/embeddings/status").then(n=>n.data),regenerateEmbeddings:()=>v()?j(void 0):y.post("/documents/embeddings/regenerate").then(n=>n.data)},Te={login:n=>v()?j({user:{id:"demo-user",username:"demo",email:"demo@example.com",role:"admin",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()},token:"demo-token",systemInfo:{requiresAuth:!0,singleUserMode:!1,hasUsers:!0,version:"0.1.0"}}):y.post("/auth/login",n).then(a=>a.data),signup:n=>v()?j({user:{id:"demo-user-new",username:n.username,email:n.email||"",role:"user",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()},token:"demo-token-new",systemInfo:{requiresAuth:!0,singleUserMode:!1,hasUsers:!0,version:"0.1.0"}}):y.post("/auth/signup",n).then(a=>a.data),logout:()=>v()?j(void 0):y.post("/auth/logout").then(n=>n.data),getSystemInfo:()=>(console.log("getSystemInfo called, demo mode:",v()),v()?j({requiresAuth:!0,singleUserMode:!1,hasUsers:!0,version:"0.1.0"}):(console.log("🔍 Making API call to:",ke+"/auth/system-info"),console.log("🌐 Full URL from:",window.location.origin,"-> API:",ke+"/auth/system-info"),y.get("/auth/system-info").then(n=>(console.log("✅ getSystemInfo response:",n.data),n.data)).catch(n=>{throw console.error("❌ getSystemInfo error:",n),n.response&&(console.error("📄 Error response data:",n.response.data),console.error("🔢 Error status:",n.response.status),console.error("🔧 Error headers:",n.response.headers)),n.request&&console.error("📡 Network error - no response received:",n.request),console.error("🎯 Error config:",n.config),n}))),verifyToken:()=>v()?j({id:"demo-user",username:"demo",email:"demo@example.com",role:"admin",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}):y.get("/auth/verify").then(n=>n.data),getEncryptionKey:()=>v()?j({encryptionKey:"demo-encryption-key-not-real"}):y.get("/auth/encryption-key").then(n=>n.data)},qn={getUsers:()=>v()?j([{id:"demo-user",username:"demo",email:"demo@example.com",role:"admin",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}]):y.get("/users").then(n=>n.data),createUser:n=>v()?j({id:"new-user-"+Date.now(),username:n.username,email:n.email,role:n.role,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}):y.post("/users",n).then(a=>a.data),updateUser:(n,a)=>v()?j({id:n,username:a.username||"demo",email:a.email||"demo@example.com",role:a.role||"user",createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}):y.patch(`/users/${n}`,a).then(t=>t.data),deleteUser:n=>v()?j(void 0):y.delete(`/users/${n}`).then(a=>a.data),updateMyAvatar:n=>v()?j({id:"demo-user",username:"demo",email:"demo@example.com",role:"admin",avatar:n,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}):y.patch("/users/me/avatar",{avatar:n}).then(a=>a.data)},pt={getPersonas:()=>{if(v()){const n=[{id:"demo-1",user_id:"default",name:"Creative Assistant",description:"Helpful assistant for creative tasks",model:"llama3.3:latest",parameters:{temperature:.8,top_p:.9,context_window:4096,system_prompt:"You are a creative and helpful assistant. Provide thoughtful and engaging responses."},avatar:"/images/creative-avatar.png",background:"/backgrounds/creative-bg.png",created_at:Date.now()-864e5,updated_at:Date.now()-864e5},{id:"demo-2",user_id:"default",name:"Research Assistant",description:"Academic assistant for research and learning",model:"qwen3:7b",parameters:{temperature:.3,top_p:.8,context_window:8192,system_prompt:"You are a knowledgeable research assistant. Provide detailed, informative explanations."},created_at:Date.now()-1728e5,updated_at:Date.now()-1728e5}];return j(n)}return y.get("/personas").then(n=>n.data)},getPersona:n=>{if(v()){const a={id:n,user_id:"default",name:"Sample Assistant",description:"A sample assistant for demonstration",model:"llama3.2:latest",parameters:{temperature:.7,top_p:.9,context_window:4096,system_prompt:"You are a helpful assistant."},created_at:Date.now(),updated_at:Date.now()};return j(a)}return y.get(`/personas/${n}`).then(a=>a.data)},createPersona:n=>{if(v()){const a={id:"demo-"+Date.now(),user_id:"default",...n,created_at:Date.now(),updated_at:Date.now()};return j(a)}return y.post("/personas",n).then(a=>a.data)},updatePersona:(n,a)=>{if(v()){const t={id:n,user_id:"default",name:a.name||"Updated Sample Assistant",description:a.description,model:a.model||"llama3.2:latest",parameters:a.parameters||{temperature:.7,top_p:.9,context_window:4096,system_prompt:"You are a helpful assistant."},avatar:a.avatar,background:a.background,created_at:Date.now()-864e5,updated_at:Date.now()};return j(t)}return y.put(`/personas/${n}`,a).then(t=>t.data)},deletePersona:n=>v()?j(void 0):y.delete(`/personas/${n}`).then(a=>a.data),exportPersona:n=>{if(v()){const a={name:"Sample Assistant",description:"A sample assistant for demonstration",model:"llama3.2:latest",params:{temperature:.7,top_p:.9,context_window:4096,system_prompt:"You are a helpful assistant."},exportedAt:Date.now(),version:"1.0.0"};return Promise.resolve(a)}return y.get(`/personas/${n}/export`).then(a=>a.data)},importPersona:n=>{if(v()){const a={id:"demo-imported-"+Date.now(),user_id:"default",name:n.name,description:n.description,model:n.model,parameters:n.params,avatar:n.avatar,background:n.background,created_at:Date.now(),updated_at:Date.now(),embedding_model:n.embedding_model,memory_settings:n.memory_settings,mutation_settings:n.mutation_settings};return j(a)}return y.post("/personas/import",n).then(a=>a.data)},getPersonasCount:()=>v()?j({count:2}):y.get("/personas/stats/count").then(n=>n.data),getDefaultParameters:()=>v()?j({temperature:.7,top_p:.9,top_k:40,context_window:4096,max_tokens:1024,system_prompt:"",repeat_penalty:1.1,presence_penalty:0,frequency_penalty:0}):y.get("/personas/defaults/parameters").then(n=>n.data),getMemoryStatus:n=>v()?j({status:"active",memory_count:42,last_backup:Date.now()-864e5,size_mb:2.3}):y.get(`/personas/${n}/memory/status`).then(a=>a.data),wipeMemories:n=>v()?j({deleted_count:42}):y.delete(`/personas/${n}/memory`).then(a=>a.data),backupPersona:n=>{if(v()){const a=JSON.stringify({persona_id:n,backup_date:new Date().toISOString(),data:"demo backup data"});return Promise.resolve(new Blob([a],{type:"application/json"}))}return y.get(`/personas/${n}/backup`,{responseType:"blob"}).then(a=>a.data)},exportPersonaDNA:n=>{if(v()){const a=JSON.stringify({persona_id:n,export_date:new Date().toISOString(),dna:"demo DNA data",memories:[],learned_behaviors:{}});return Promise.resolve(new Blob([a],{type:"application/json"}))}return y.get(`/personas/${n}/export/dna`,{responseType:"blob"}).then(a=>a.data)},importPersonaDNA:n=>{if(v()){const t={id:"demo-dna-"+Date.now(),user_id:"default",name:"Imported Persona",description:"Persona imported from DNA",model:"llama3.2:latest",parameters:{temperature:.7,top_p:.9,context_window:4096,system_prompt:"You are a helpful assistant."},created_at:Date.now(),updated_at:Date.now()};return j(t)}const a=new FormData;return a.append("dnaFile",n),y.post("/personas/import/dna",a).then(t=>t.data)},downloadPersona:async(n,a)=>{try{const t=await pt.exportPersona(n),r=new Blob([JSON.stringify(t,null,2)],{type:"application/json"}),i=URL.createObjectURL(r),o=document.createElement("a");o.href=i,o.download=`${a}.json`,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(i)}catch(t){throw console.error("Error while downloading persona:",t),new Error(`Failed to download persona: ${t instanceof Error?t.message:String(t)}`)}}},la={getModels:()=>v()?j([{model:"tts-1",plugin:"openai",config:{voices:["alloy","echo","fable","onyx","nova","shimmer"],default_voice:"alloy",formats:["mp3","opus","aac","flac","wav"],default_format:"mp3",max_characters:4096}}]):y.get("/tts/models").then(n=>n.data),getPlugins:()=>v()?j([{id:"openai",name:"OpenAI GPT",models:["tts-1","tts-1-hd"],config:{voices:["alloy","echo","fable","onyx","nova","shimmer"],default_voice:"alloy"}}]):y.get("/tts/plugins").then(n=>n.data),getVoices:n=>v()?j({voices:["alloy","echo","fable","onyx","nova","shimmer"],default_voice:"alloy",formats:["mp3","opus","aac","flac","wav"],default_format:"mp3",max_characters:4096,supports_streaming:!1}):y.get(`/tts/voices/${n}`).then(a=>a.data),generateBase64:n=>v()?j({audio:"",format:n.response_format||"mp3",mimeType:"audio/mpeg",size:0}):y.post("/tts/generate-base64",n).then(a=>a.data),generate:async n=>v()?new Blob([],{type:"audio/mpeg"}):(await y.post("/tts/generate",n,{responseType:"blob"})).data,speak:async(n,a={})=>{try{a.onStart?.();const t=await la.generateBase64({model:a.model||"tts-1",input:n,voice:a.voice,speed:a.speed,response_format:"mp3"});if(!t.success||!t.data?.audio)throw new Error(t.message||"Failed to generate speech");const r=`data:${t.data.mimeType};base64,${t.data.audio}`,i=new Audio(r);return i.onended=()=>a.onEnd?.(),i.onerror=()=>a.onError?.(new Error("Audio playback failed")),await i.play(),i}catch(t){const r=t instanceof Error?t:new Error("Unknown error");return a.onError?.(r),null}}},ct={getModels:()=>v()?j([{model:"dall-e-3",plugin:"openai",config:{sizes:["1024x1024","1792x1024","1024x1792"],default_size:"1024x1024",qualities:["standard","hd"],default_quality:"standard",styles:["vivid","natural"],default_style:"vivid",max_prompt_length:4e3}}]):y.get("/image-gen/models").then(n=>n.data),getPlugins:()=>v()?j([{id:"openai",name:"OpenAI DALL-E",models:["dall-e-3","dall-e-2"],config:{sizes:["1024x1024","1792x1024","1024x1792"],default_size:"1024x1024",qualities:["standard","hd"],default_quality:"standard"}}]):y.get("/image-gen/plugins").then(n=>n.data),getConfig:n=>v()?j({sizes:["1024x1024","1792x1024","1024x1792"],default_size:"1024x1024",qualities:["standard","hd"],default_quality:"standard",styles:["vivid","natural"],default_style:"vivid",max_prompt_length:4e3}):y.get(`/image-gen/config/${n}`).then(a=>a.data),generate:n=>v()?j({images:[{url:"https://placehold.co/1024x1024/purple/white?text=Demo+Image",revised_prompt:n.prompt}]}):y.post("/image-gen/generate",n).then(a=>a.data),getGallery:n=>v()?j({images:[],total:0}):y.get("/image-gen/gallery",{params:n}).then(a=>a.data),getGalleryImage:n=>v()?j({id:n,userId:"demo",prompt:"Demo image prompt",model:"dall-e-3",imageData:"https://placehold.co/1024x1024/purple/white?text=Demo",createdAt:Date.now()}):y.get(`/image-gen/gallery/${n}`).then(a=>a.data),deleteGalleryImage:n=>v()?j(void 0):y.delete(`/image-gen/gallery/${n}`).then(a=>a.data)},Ma=Object.freeze(Object.defineProperty({__proto__:null,authApi:Te,chatApi:ze,documentsApi:dt,imageGenApi:ct,ollamaApi:Fe,personaApi:pt,pluginApi:se,preferencesApi:te,ttsApi:la,usersApi:qn},Symbol.toStringTag,{value:"Module"})),cy=({className:n=""})=>{const{t:a}=ce(),{preferences:t,setPreferences:r,backgroundImage:i,uploadBackgroundImage:o,removeBackgroundImage:s}=be(),d=h.useRef(null),[u,m]=h.useState(!1),[g,p]=h.useState(!1),k=t.backgroundSettings||{enabled:!1,imageUrl:"",blurAmount:10,opacity:.6},x=async P=>{if(!P.type.startsWith("image/")){z.error("Please select a valid image file");return}if(P.size>5*1024*1024){z.error("Image file size must be less than 5MB");return}m(!0);try{await o(P),z.success("Background image uploaded successfully")}catch(U){console.error("Failed to upload background:",U),z.error("Failed to upload background image")}finally{m(!1)}},b=P=>{const U=P.target.files?.[0];U&&x(U)},w=P=>{P.preventDefault(),p(!0)},S=P=>{P.preventDefault(),p(!1)},F=P=>{P.preventDefault(),p(!1);const U=P.dataTransfer.files?.[0];U&&x(U)},L=()=>{s(),z.success("Background image removed")},D=async P=>{const U=i||k.imageUrl||"",q={...k,imageUrl:U,enabled:P};if(r({backgroundSettings:q}),U||!P)try{await te.updatePreferences({backgroundSettings:q})}catch(K){console.error("Failed to update preferences:",K)}},A=async P=>{const U=i||k.imageUrl||"",q={...k,imageUrl:U,blurAmount:P};if(r({backgroundSettings:q}),U)try{await te.updatePreferences({backgroundSettings:q})}catch(K){console.error("Failed to update preferences:",K)}},N=async P=>{const U=i||k.imageUrl||"",q={...k,imageUrl:U,opacity:P};if(r({backgroundSettings:q}),U)try{await te.updatePreferences({backgroundSettings:q})}catch(K){console.error("Failed to update preferences:",K)}};return e.jsx("div",{className:`space-y-4 ${n}`,children:e.jsxs("div",{children:[e.jsx("h4",{className:"text-md font-medium text-gray-900 dark:text-gray-100 mb-3",children:a("settings.appearance.background.title")}),e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:a("settings.appearance.background.enable")}),e.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:a("settings.appearance.background.enableDescription")})]}),e.jsxs("label",{className:"relative inline-flex items-center cursor-pointer",children:[e.jsx("input",{type:"checkbox",className:"sr-only peer",checked:k.enabled,onChange:P=>D(P.target.checked)}),e.jsx("div",{className:"w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-primary-300 dark:peer-focus:ring-primary-800 rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-primary-600"})]})]}),e.jsxs("div",{className:"space-y-4",children:[i?e.jsx("div",{className:"relative",children:e.jsxs("div",{className:"flex items-center gap-3 p-3 bg-gray-50 dark:bg-dark-200 rounded-lg",children:[e.jsx("div",{className:"flex-shrink-0",children:e.jsx("img",{src:i,alt:"Background preview",className:"w-12 h-12 object-cover rounded-md"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-gray-100 truncate",children:"Custom background image"}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"Click to change or remove"})]}),e.jsx(I,{variant:"ghost",size:"sm",onClick:L,className:"text-red-600 hover:text-red-700 hover:bg-red-50 dark:text-red-400 dark:hover:text-red-300 dark:hover:bg-red-900/20",children:e.jsx(Me,{className:"h-4 w-4"})})]})}):e.jsxs("div",{className:`border-2 border-dashed rounded-lg p-6 text-center cursor-pointer transition-colors ${g?"border-primary-500 bg-primary-50 dark:bg-primary-900/20":"border-gray-300 dark:border-gray-600 hover:border-gray-400 dark:hover:border-gray-500"}`,onDragOver:w,onDragLeave:S,onDrop:F,onClick:()=>d.current?.click(),children:[e.jsx(et,{className:"h-12 w-12 mx-auto text-gray-400 dark:text-gray-500 mb-4"}),e.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-gray-100 mb-2",children:a("settings.appearance.background.upload")}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-4",children:a("settings.appearance.background.dragDrop")}),e.jsxs(I,{variant:"outline",size:"sm",disabled:u,className:"mx-auto",children:[e.jsx(ja,{className:"h-4 w-4 mr-2"}),a(u?"common.loading":"settings.appearance.background.chooseImage")]})]}),e.jsx("input",{ref:d,type:"file",accept:"image/*",onChange:b,className:"hidden"})]}),i&&e.jsxs("div",{className:"space-y-4 mt-4",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:[a("settings.appearance.background.blur"),":"," ",k.blurAmount,"px"]}),e.jsx("input",{type:"range",min:"0",max:"30",step:"1",value:k.blurAmount,onChange:P=>A(parseInt(P.target.value)),className:"w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:[a("settings.appearance.background.opacity"),":"," ",Math.round(k.opacity*100),"%"]}),e.jsx("input",{type:"range",min:"0.1",max:"1",step:"0.1",value:k.opacity,onChange:P=>N(parseFloat(P.target.value)),className:"w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"})]})]})]})})},uy=()=>{const{t:n,i18n:a}=ce(),t=r=>{const i=r.target.value;a.changeLanguage(i)};return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(mt,{className:"h-4 w-4 text-gray-500 dark:text-gray-400"}),e.jsx("h4",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:n("settings.appearance.language.title")})]}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:n("settings.appearance.language.description")}),e.jsx("select",{value:a.language,onChange:t,className:"w-full px-3 py-2 text-sm border border-gray-200 dark:border-dark-300 rounded-lg bg-white dark:bg-dark-100 text-gray-900 dark:text-gray-100 focus:outline-none focus:ring-2 focus:ring-primary-500",children:$f.map(r=>e.jsxs("option",{value:r.code,children:[r.nativeName," (",r.name,")"]},r.code))})]})},Ae=(n,a)=>{if(n&&typeof n=="object"&&"response"in n){const t=n;if(t.response?.data?.error)return t.response.data.error}return n instanceof Error?n.message:a},Ne=Ca((n,a)=>({sessions:[],currentSession:null,setCurrentSession:t=>{n({currentSession:t})},createSession:async(t,r,i)=>{try{n({loading:!0,error:null});const o=await ze.createSession(t,r,i);if(o.success&&o.data){const s=o.data;return n(d=>({sessions:[s,...d.sessions],currentSession:s,loading:!1})),z.success("New chat created"),s}}catch(o){const s=Ae(o,"Failed to create session");n({error:s,loading:!1}),z.error(s)}},loadSessions:async()=>{try{n({loading:!0,error:null});const t=await ze.getSessions();t.success&&t.data&&n(r=>{const i=t.data||[],o=i.map(d=>d.id);let s=null;return r.currentSession&&o.includes(r.currentSession.id)?s=i.find(d=>d.id===r.currentSession.id)||null:i.length>0&&(s=i[0],r.currentSession&&console.warn("Previous currentSession not found in backend sessions:",r.currentSession.id)),{sessions:i,currentSession:s,loading:!1}})}catch(t){const r=Ae(t,"Failed to load sessions");n({error:r,loading:!1}),z.error(r)}},deleteSession:async t=>{try{const r=await ze.deleteSession(t);r.success?(n(i=>{const o=i.sessions.filter(d=>d.id!==t),s=i.currentSession?.id===t?o[0]||null:i.currentSession;return console.log("Store: Updating state, sessions count:",o.length),{sessions:o,currentSession:s}}),z.success("Chat deleted")):(console.error("Store: deleteSession failed:",r),z.error("Failed to delete chat"))}catch(r){console.error("Store: deleteSession error:",r);const i=Ae(r,"Failed to delete session");z.error(i)}},clearAllSessions:async()=>{try{n({loading:!0,error:null});const t=await ze.clearAllSessions();t.success?(n({sessions:[],currentSession:null,loading:!1}),z.success("All chat history cleared")):(console.error("Store: clearAllSessions failed:",t),z.error("Failed to clear chat history"),n({loading:!1}))}catch(t){console.error("Store: clearAllSessions error:",t);const r=Ae(t,"Failed to clear chat history");z.error(r),n({loading:!1})}},clearAllState:()=>{n({sessions:[],currentSession:null,models:[],selectedModel:"",systemMessage:"",loading:!1,error:null})},updateSessionTitle:async(t,r)=>{try{const i=await ze.updateSession(t,{title:r});i.success&&i.data&&(n(o=>({sessions:o.sessions.map(s=>s.id===t?i.data:s),currentSession:o.currentSession?.id===t?i.data:o.currentSession})),z.success("Chat title updated"))}catch(i){const o=Ae(i,"Failed to update session");z.error(o)}},addMessage:(t,r)=>{const i=a(),o=i.currentSession?.isPrivate&&i.currentSession?.id===t;if(!i.currentSession||!o&&!i.sessions.find(d=>d.id===i.currentSession?.id)){z.error("No valid chat session. Please create or select a chat."),console.error("addMessage blocked: currentSession is not valid",i.currentSession?.id);return}if(!o&&!i.sessions.find(d=>d.id===t)){z.error("Session not found or invalid. Please select or create a valid chat session."),console.error("addMessage blocked: sessionId not found in sessions",t);return}const s={...r,id:r.id||Jf(),timestamp:Date.now()};n(d=>{if(d.currentSession?.isPrivate&&d.currentSession?.id===t)return d.currentSession.messages.find(p=>p.id===s.id)?d:{...d,currentSession:{...d.currentSession,messages:[...d.currentSession.messages,s],updatedAt:Date.now()}};const u=d.sessions.find(g=>g.id===t);if(u&&u.messages.find(p=>p.id===s.id))return d;const m=d.sessions.map(g=>{if(g.id===t){let p=[...g.messages];if(s.parentId){const k=s.parentId;p=p.map(x=>x.id===k||x.parentId===k?{...x,isActive:!1,branchIndex:x.branchIndex??0,siblingCount:(s.branchIndex||0)+1}:x)}return p.push(s),{...g,messages:p,updatedAt:Date.now()}}return g});return{sessions:m,currentSession:d.currentSession?.id===t&&m.find(p=>p.id===t)||d.currentSession}})},updateMessage:(t,r,i)=>{n(o=>{if(o.currentSession?.id!==t)return o;if(o.currentSession?.isPrivate){const g=o.currentSession.messages.find(k=>k.id===r);if(!g||g.content===i)return o;const p=o.currentSession.messages.map(k=>k.id===r?{...k,content:i}:k);return{...o,currentSession:{...o.currentSession,messages:p,updatedAt:Date.now()}}}const s=o.sessions.find(g=>g.id===t);if(!s)return o;const d=s.messages.find(g=>g.id===r);if(!d||d.content===i)return o;const u=o.sessions.map(g=>{if(g.id===t){const p=g.messages.map(k=>k.id===r?{...k,content:i}:k);return{...g,messages:p,updatedAt:Date.now()}}return g}),m=o.currentSession?.id===t&&u.find(g=>g.id===t)||o.currentSession;return{sessions:u,currentSession:m}})},updateMessageWithStatistics:(t,r,i,o)=>{n(s=>{if(s.currentSession?.id!==t)return s;if(s.currentSession?.isPrivate){const m=s.currentSession.messages.map(g=>g.id===r?{...g,content:i,statistics:o}:g);return{...s,currentSession:{...s.currentSession,messages:m,updatedAt:Date.now()}}}const d=s.sessions.map(m=>{if(m.id===t){const g=m.messages.map(p=>p.id===r?{...p,content:i,statistics:o}:p);return{...m,messages:g,updatedAt:Date.now()}}return m}),u=s.currentSession&&s.currentSession.id===t&&d.find(m=>m.id===t)||s.currentSession;return{sessions:d,currentSession:u}})},models:[],loadModels:async()=>{try{n({loading:!0,error:null}),console.log("Loading models from API...");const t=await Fe.getModels();let r=[];t.success&&t.data&&(r=[...t.data],console.log("Ollama models loaded:",t.data.length));try{const i=await se.getAllPlugins();if(i.success&&i.data){const o=i.data.filter(s=>s.active&&s.type!=="tts"&&s.type!=="image");console.log("🔌 Active plugins found:",o.map(s=>s.name));for(const s of o)if(s.model_map){const d=s.model_map.map(u=>({name:u,model:u,size:0,digest:"",details:{parent_model:"",format:"",family:"",families:[],parameter_size:"",quantization_level:""},modified_at:new Date().toISOString(),expires_at:new Date().toISOString(),size_vram:0,isPlugin:!0,pluginName:s.name}));r.push(...d),console.log("Plugin models added:",d.length,"from",s.name)}}}catch(i){console.error("❌ Failed to load plugin models:",i),i instanceof Error&&console.error("❌ Plugin error details:",{message:i.message,response:i.response?.data,status:i.response?.status,url:i.config?.url})}try{const{personaApi:i}=await he(async()=>{const{personaApi:s}=await Promise.resolve().then(()=>Ma);return{personaApi:s}},void 0),o=await i.getPersonas();if(o.success&&o.data){const s=o.data.reduce((u,m)=>(u[m.id]=m,u),{}),d=o.data.map(u=>({name:`persona:${u.id}`,model:u.model,size:0,digest:"",details:{parent_model:u.model,format:"persona",family:"persona",families:["persona"],parameter_size:"",quantization_level:""},modified_at:new Date(u.updated_at).toISOString(),expires_at:new Date().toISOString(),size_vram:0,isPersona:!0,personaName:u.name,personaDescription:u.description}));r.push(...d),n(u=>({...u,personas:s}))}}catch(i){console.error("❌ Failed to load personas:",i)}console.log("Total models loaded:",r.length),n({models:r,loading:!1})}catch(t){console.error("Error loading models:",t);const r=Ae(t,"Failed to load models");n({error:r,loading:!1}),z.error(r)}},loadPreferences:async()=>{try{const t=await te.getPreferences();if(t.success&&t.data){const{defaultModel:r,systemMessage:i}=t.data;r&&(n({selectedModel:r}),console.log("✅ Loaded default model from backend:",r)),i!==void 0&&(n({systemMessage:i}),console.log("✅ Loaded system message from backend"))}}catch(t){console.warn("❌ Failed to load preferences from backend:",t)}},selectedModel:"",setSelectedModel:t=>{n({selectedModel:t}),te.setDefaultModel(t).catch(r=>{console.warn("Failed to save default model to backend:",r)})},updateCurrentSessionModel:async t=>{const r=a();if(!r.currentSession)throw new Error("No current session to update");try{const i=await ze.updateSession(r.currentSession.id,{model:t});i.success&&i.data&&(n(o=>({sessions:o.sessions.map(s=>s.id===o.currentSession?.id?i.data:s),currentSession:i.data,selectedModel:t})),z.success("Model updated for current chat"))}catch(i){const o=Ae(i,"Failed to update session model");throw z.error(o),i}},personas:{},loadPersonas:async()=>{try{n({loading:!0,error:null});const t=await pt.getPersonas();if(t.success&&t.data){const r=t.data;n({personas:r.reduce((i,o)=>(i[o.id]=o,i),{}),loading:!1}),console.log("✅ Personas loaded:",r.length)}}catch(t){const r=Ae(t,"Failed to load personas");n({error:r,loading:!1}),console.error("❌ Failed to load personas:",r)}},getCurrentPersona:()=>{const t=a();if(!t.currentSession||!t.currentSession.model?.startsWith("persona:"))return null;const r=t.currentSession.model.replace("persona:","");return t.personas[r]||null},systemMessage:"",setSystemMessage:t=>{const r=a();if(n({systemMessage:t}),te.setSystemMessage(t).catch(i=>{console.warn("Failed to save system message to backend:",i)}),r.currentSession){const i=r.currentSession.messages.findIndex(o=>o.role==="system");if(i!==-1){n(s=>{const d=s.sessions.map(m=>{if(m.id===s.currentSession?.id){const g=m.messages.map((p,k)=>k===i&&p.role==="system"?{...p,content:t,timestamp:Date.now()}:p);return{...m,messages:g,updatedAt:Date.now()}}return m}),u=s.currentSession?d.find(m=>m.id===s.currentSession.id)||s.currentSession:null;return{sessions:d,currentSession:u}});const o=r.currentSession.messages[i];ze.updateMessage(r.currentSession.id,o.id,{content:t}).catch(s=>{console.warn("Failed to sync system message update to backend:",s)}),console.log("✅ Updated system message in current session")}}},loading:!1,error:null,setError:t=>n({error:t}),generatingTitleForSession:null,setGeneratingTitleForSession:t=>n({generatingTitleForSession:t}),...typeof window<"u"&&{testPluginApi:async()=>{try{console.log("🧪 Testing plugin API...");const t=await se.getAllPlugins();return console.log("✅ Plugin API test result:",t),t}catch(t){return console.error("❌ Plugin API test failed:",t),{error:t}}}}})),gt=Ca((n,a)=>({plugins:[],pluginStatus:[],isLoading:!1,isUploading:!1,error:null,loadPlugins:async()=>{n({isLoading:!0,error:null});try{const t=await se.getAllPlugins();t.success&&t.data?n({plugins:t.data}):n({error:t.error||"Failed to load plugins"})}catch(t){n({error:t instanceof Error?t.message:"Failed to load plugins"})}finally{n({isLoading:!1})}},uploadPlugin:async t=>{n({isUploading:!0,error:null});try{const r=await se.uploadPlugin(t);r.success&&r.data?await a().loadPlugins():n({error:r.error||"Failed to upload plugin"})}catch(r){n({error:r instanceof Error?r.message:"Failed to upload plugin"})}finally{n({isUploading:!1})}},installPlugin:async t=>{n({isLoading:!0,error:null});try{const r=await se.installPlugin(t);r.success&&r.data?await a().loadPlugins():n({error:r.error||"Failed to install plugin"})}catch(r){n({error:r instanceof Error?r.message:"Failed to install plugin"})}finally{n({isLoading:!1})}},updatePlugin:async(t,r)=>{n({isLoading:!0,error:null});try{const i=await se.updatePlugin(t,r);i.success&&i.data?await a().loadPlugins():n({error:i.error||"Failed to update plugin"})}catch(i){n({error:i instanceof Error?i.message:"Failed to update plugin"})}finally{n({isLoading:!1})}},deletePlugin:async t=>{n({isLoading:!0,error:null});try{const r=await se.deletePlugin(t);r.success?await a().loadPlugins():n({error:r.error||"Failed to delete plugin"})}catch(r){n({error:r instanceof Error?r.message:"Failed to delete plugin"})}finally{n({isLoading:!1})}},activatePlugin:async t=>{n({isLoading:!0,error:null});try{const r=await se.activatePlugin(t);r.success?await a().loadPlugins():n({error:r.error||"Failed to activate plugin"})}catch(r){n({error:r instanceof Error?r.message:"Failed to activate plugin"})}finally{n({isLoading:!1})}},deactivatePlugin:async t=>{n({isLoading:!0,error:null});try{const r=await se.deactivatePlugin(t);r.success?await a().loadPlugins():n({error:r.error||"Failed to deactivate plugin"})}catch(r){n({error:r instanceof Error?r.message:"Failed to deactivate plugin"})}finally{n({isLoading:!1})}},loadPluginStatus:async()=>{try{const t=await se.getPluginStatus();t.success&&t.data&&n({pluginStatus:t.data})}catch(t){console.error("Failed to load plugin status:",t)}},exportPlugin:async t=>{n({isLoading:!0,error:null});try{const r=await se.exportPlugin(t),i=window.URL.createObjectURL(r),o=document.createElement("a");o.href=i,o.download=`${t}.json`,document.body.appendChild(o),o.click(),document.body.removeChild(o),window.URL.revokeObjectURL(i)}catch(r){n({error:r instanceof Error?r.message:"Failed to export plugin"})}finally{n({isLoading:!1})}},clearError:()=>n({error:null}),setError:t=>n({error:t})})),gn="0.4.3",Jn=({isOpen:n,onClose:a})=>{const{models:t,selectedModel:r,setSelectedModel:i,systemMessage:o,setSystemMessage:s,clearAllSessions:d,loading:u,sessions:m,loadModels:g,loadSessions:p}=Ne(),{theme:k,setTheme:x,preferences:b,setPreferences:w,loadPreferences:S}=be(),{plugins:F,isLoading:L,isUploading:D,error:A,loadPlugins:N,uploadPlugin:P,deletePlugin:U,activatePlugin:q,deactivatePlugin:K,exportPlugin:O,clearError:E,installPlugin:G}=gt(),{t:c}=ce(),[$,ue]=h.useState("appearance"),[V,Y]=h.useState(o),[J,me]=h.useState({modelsCount:0,sessionsCount:0,isHealthy:!1}),[ne,T]=h.useState(!1),[H,_]=h.useState(null),[Pe,De]=h.useState(!1),[ua,_e]=h.useState(!1),[Ye,Le]=h.useState(""),Ke=h.useRef(null),[Be,Ze]=h.useState(null),[C,ee]=h.useState({}),[W,Ge]=h.useState({}),[ma,ht]=h.useState({}),[pa,ga]=h.useState(null),[ge,Ea]=h.useState(b.generationOptions||{}),[Z,Oa]=h.useState(b.embeddingSettings||{enabled:!1,model:"nomic-embed-text",chunkSize:1e3,chunkOverlap:200,similarityThreshold:.7}),[re,Zn]=h.useState(null),[bt,kt]=h.useState(!1),[X,Xe]=h.useState(b.ttsSettings||{enabled:!1,autoPlay:!1,model:"",voice:"",speed:1,pluginId:""}),[He,Xn]=h.useState([]),[ft,Qn]=h.useState([]),[yt,La]=h.useState([]),[er,vt]=h.useState(!1),[xt,Qe]=h.useState(!1),[Ka,ha]=h.useState(null),[oe,ea]=h.useState(b.imageGenSettings||{enabled:!1,model:"",size:"1024x1024",quality:"standard",style:"vivid",pluginId:""}),[je,ar]=h.useState([]),[St,tr]=h.useState([]),[Ba,Ga]=h.useState([]),[wt,Ha]=h.useState([]),[Pt,Ra]=h.useState([]),[nr,Mt]=h.useState(!1),[ba,Dt]=h.useState(!1),[rr,Ua]=h.useState(!1),[$a,jt]=h.useState("skip"),[ye,aa]=h.useState(null),[At,Va]=h.useState(null),Re=h.useRef(null);h.useEffect(()=>{n&&(ka(),zt(),lr(),Y(o),Ea(b.generationOptions||{}),Oa(b.embeddingSettings||{enabled:!1,model:"nomic-embed-text",chunkSize:1e3,chunkOverlap:200,similarityThreshold:.7}),Xe(b.ttsSettings||{enabled:!1,autoPlay:!1,model:"",voice:"",speed:1,pluginId:""}),ea(b.imageGenSettings||{enabled:!1,model:"",size:"1024x1024",quality:"standard",style:"vivid",pluginId:""}),cr(),N(),ir(),g())},[n,o]);const ka=async()=>{try{const[l,f]=await Promise.all([Fe.checkHealth().catch(()=>({success:!1})),Fe.getVersion().catch(()=>({success:!1,data:null}))]);me({ollamaVersion:f.success&&f.data?f.data.version:void 0,modelsCount:t.length,sessionsCount:m.length,isHealthy:l.success})}catch(l){console.error("Failed to load system info:",l)}},ir=async()=>{try{const l=await se.getCredentials();if(l.success&&l.data){const f={};for(const M of l.data)f[M.plugin_id]=M.has_api_key;Ge(f)}}catch(l){console.error("Failed to load plugin credentials:",l)}},or=async l=>{const f=C[l];if(!f?.trim()){z.error("Please enter an API key");return}ga(l);try{const M=await se.setApiKey(l,f.trim());M.success?(z.success("API key saved successfully"),Ge(ae=>({...ae,[l]:!0})),ee(ae=>({...ae,[l]:""})),ht(ae=>({...ae,[l]:!1})),Ze(null)):z.error(M.error||"Failed to save API key")}catch{z.error("Failed to save API key")}finally{ga(null)}},sr=async l=>{ga(l);try{const f=await se.deleteApiKey(l);f.success?(z.success("API key removed"),Ge(M=>({...M,[l]:!1})),ee(M=>({...M,[l]:""}))):z.error(f.error||"Failed to remove API key")}catch{z.error("Failed to remove API key")}finally{ga(null)}},zt=async()=>{try{const l=await dt.getEmbeddingStatus();l.success&&l.data&&Zn(l.data)}catch(l){console.error("Failed to load embedding status:",l)}},lr=async()=>{vt(!0);try{const[l,f]=await Promise.all([la.getModels(),la.getPlugins()]);if(l.success&&l.data){if(Xn(l.data),!X.model&&l.data.length>0){const M=l.data[0];Xe(ae=>({...ae,model:M.model,pluginId:M.plugin,voice:M.config?.default_voice||""})),M.config?.voices&&La(M.config.voices)}else if(X.model){const M=l.data.find(ae=>ae.model===X.model);M?.config?.voices&&La(M.config.voices)}}f.success&&f.data&&Qn(f.data)}catch(l){console.error("Failed to load TTS data:",l)}finally{vt(!1)}},dr=async l=>{const f=He.find(M=>M.model===l);f&&(Xe(M=>({...M,model:l,pluginId:f.plugin,voice:f.config?.default_voice||M.voice})),f.config?.voices&&La(f.config.voices))},cr=async()=>{Mt(!0);try{const[l,f]=await Promise.all([ct.getModels(),ct.getPlugins()]);if(l.success&&l.data){if(ar(l.data),!oe.model&&l.data.length>0){const M=l.data[0];ea(ae=>({...ae,model:M.model,pluginId:M.plugin,size:M.config?.default_size||"1024x1024",quality:M.config?.default_quality||"standard",style:M.config?.default_style||"vivid"})),M.config?.sizes&&Ga(M.config.sizes),M.config?.qualities&&Ha(M.config.qualities),M.config?.styles&&Ra(M.config.styles)}else if(oe.model){const M=l.data.find(ae=>ae.model===oe.model);M?.config&&(M.config.sizes&&Ga(M.config.sizes),M.config.qualities&&Ha(M.config.qualities),M.config.styles&&Ra(M.config.styles))}}f.success&&f.data&&tr(f.data)}catch(l){console.error("Failed to load image generation data:",l)}finally{Mt(!1)}},ur=async l=>{const f=je.find(M=>M.model===l);f&&(ea(M=>({...M,model:l,pluginId:f.plugin,size:f.config?.default_size||M.size,quality:f.config?.default_quality||M.quality,style:f.config?.default_style||M.style})),f.config?.sizes&&Ga(f.config.sizes),f.config?.qualities&&Ha(f.config.qualities),f.config?.styles&&Ra(f.config.styles))},fa=(l,f)=>{Xe(M=>({...M,[l]:f}))},mr=async()=>{try{const l=await te.updatePreferences({ttsSettings:X});l.success&&l.data&&(w(l.data),z.success("TTS settings saved successfully"))}catch(l){const f=l instanceof Error?l.message:String(l);z.error("Failed to save TTS settings: "+f)}},pr=async()=>{if(xt){Ka&&(Ka.pause(),Ka.currentTime=0,ha(null)),Qe(!1);return}Qe(!0);try{const l=await la.generateBase64({model:X.model||"tts-1",input:"Hello! This is a test of the text-to-speech system.",voice:X.voice||"alloy",speed:X.speed||1,response_format:"mp3"});if(l.success&&l.data?.audio){const f=`data:${l.data.mimeType};base64,${l.data.audio}`,M=new Audio(f);ha(M),M.onended=()=>{Qe(!1),ha(null)},M.onerror=()=>{z.error("Failed to play audio"),Qe(!1),ha(null)},await M.play()}else throw new Error(l.message||"Failed to generate speech")}catch(l){const f=l instanceof Error?l.message:String(l);z.error("TTS test failed: "+f),Qe(!1)}},gr=()=>{Xe({enabled:!1,autoPlay:!1,model:He[0]?.model||"",voice:He[0]?.config?.default_voice||"",speed:1,pluginId:He[0]?.plugin||""})},ya=(l,f)=>{ea(M=>({...M,[l]:f}))},hr=async()=>{try{const l=await te.updatePreferences({imageGenSettings:oe});l.success&&l.data&&(w(l.data),z.success("Image generation settings saved successfully"))}catch(l){const f=l instanceof Error?l.message:String(l);z.error("Failed to save image generation settings: "+f)}},br=()=>{ea({enabled:!1,model:je[0]?.model||"",size:je[0]?.config?.default_size||"1024x1024",quality:je[0]?.config?.default_quality||"standard",style:je[0]?.config?.default_style||"vivid",pluginId:je[0]?.plugin||""})},kr=async()=>{try{kt(!0),(await dt.regenerateEmbeddings()).success&&(z.success("Embeddings regenerated successfully"),await zt())}catch(l){const f=l instanceof Error?l.message:String(l);z.error("Failed to regenerate embeddings: "+f)}finally{kt(!1)}},Wa=async l=>{try{const f=await te.updatePreferences(l);f.success&&f.data&&(w(f.data),z.success("Settings updated successfully"))}catch(f){const M=f instanceof Error?f.message:String(f);z.error("Failed to update settings: "+M)}},fr=async l=>{const f=l.target.files?.[0];f&&(await P(f),De(!1),Ke.current&&(Ke.current.value=""),await g())},yr=async()=>{try{const l=JSON.parse(Ye);await G(l),_e(!1),Le(""),await g()}catch{E(),z.error("Invalid JSON format")}},vr=async l=>{F.find(M=>M.id===l)?.active?await K(l):await q(l),await g()},xr=async l=>{window.confirm("Are you sure you want to delete this plugin?")&&(await U(l),await g())},Sr=async l=>{await O(l)};if(!n)return null;const qa=l=>{const f={mode:l};x(f),Wa({theme:f})},wr=l=>{const f=l.target.value;i(f),Wa({defaultModel:f}),z.success("Default model updated")},Pr=l=>{Y(l.target.value)},Mr=()=>{s(V),Wa({systemMessage:V}),z.success("System message updated")},Dr=async()=>{window.confirm("Are you sure you want to delete all chat history? This action cannot be undone.")&&(await d(),ka(),z.success("All chat sessions deleted"))},jr=()=>{const l={format:"libre-webui-export",version:"1.0",preferences:b,sessions:m,documents:[],exportedAt:new Date().toISOString()},f=new Blob([JSON.stringify(l,null,2)],{type:"application/json"}),M=URL.createObjectURL(f),ae=document.createElement("a");ae.href=M,ae.download=`libre-webui-export-${new Date().toISOString().split("T")[0]}.json`,document.body.appendChild(ae),ae.click(),document.body.removeChild(ae),URL.revokeObjectURL(M),z.success("Data exported successfully")},Ar=l=>{const f=l.target.files?.[0];f&&(Va(f),Ua(!0),aa(null))},zr=async()=>{if(At){Dt(!0);try{const l=await At.text(),f=JSON.parse(l);if(!f.format||f.format!=="libre-webui-export")throw new Error("Invalid export format. Please use a valid Libre WebUI export file.");const M=await te.importData(f,$a==="overwrite"?"replace":"merge");if(M.success&&M.data)aa({preferences:{imported:!0,error:null},sessions:{imported:0,skipped:0,errors:[]},documents:{imported:0,skipped:0,errors:[]}}),z.success("Data imported successfully"),await S(),await p();else throw new Error(M.error||"Import failed")}catch(l){z.error(l instanceof Error?l.message:"Import failed"),aa(null)}finally{Dt(!1),Ua(!1),Va(null),Re.current&&(Re.current.value="")}}},Nr=()=>{Ua(!1),Va(null),aa(null),Re.current&&(Re.current.value="")},Tr=async()=>{T(!0),_(null),Fe.pullAllModelsStream(l=>{_(l)},()=>{T(!1),_(null),z.success("All models updated successfully!"),ka()},l=>{T(!1),_(null),z.error("Failed to update models: "+l)})},fe=(l,f)=>{Ea(M=>({...M,[l]:f}))},Ir=async()=>{try{const l=await te.setGenerationOptions(ge);l.success&&l.data&&(w(l.data),z.success("Generation options updated successfully"))}catch(l){const f=l instanceof Error?l.message:String(l);z.error("Failed to update generation options: "+f)}},Cr=async()=>{try{const l=await te.resetGenerationOptions();l.success&&l.data&&(w(l.data),Ea(l.data.generationOptions||{}),z.success("Generation options reset to defaults"))}catch(l){const f=l instanceof Error?l.message:String(l);z.error("Failed to reset generation options: "+f)}},ve=(l,f)=>{Oa(M=>({...M,[l]:f}))},Nt=async()=>{try{const l=await te.setEmbeddingSettings(Z);l.success&&l.data&&(w(l.data),z.success("Embedding settings updated successfully"))}catch(l){const f=l instanceof Error?l.message:String(l);z.error("Failed to update embedding settings: "+f)}},Tt=async()=>{try{const l=await te.resetEmbeddingSettings();l.success&&l.data&&(w(l.data),Oa(l.data.embeddingSettings||{}),z.success("Embedding settings reset to defaults"))}catch(l){const f=l instanceof Error?l.message:String(l);z.error("Failed to reset embedding settings: "+f)}},Fr=[{id:"appearance",label:c("settings.tabs.appearance"),icon:Vr},{id:"models",label:c("settings.tabs.model"),icon:Ct},{id:"generation",label:c("settings.tabs.generation"),icon:Wr},{id:"tts",label:c("settings.tabs.tts"),icon:Ft},{id:"image-gen",label:c("settings.tabs.imageGen"),icon:et},{id:"documents",label:c("settings.tabs.documents"),icon:ia},{id:"plugins",label:c("settings.tabs.plugins"),icon:Et},{id:"system",label:c("settings.tabs.system"),icon:qr},{id:"data",label:c("settings.tabs.data"),icon:ia},{id:"about",label:c("settings.tabs.about"),icon:Dn}],Er=()=>{switch($){case"appearance":return e.jsxs("div",{className:"space-y-6",children:[e.jsx(uy,{}),e.jsx("div",{className:"border-t border-gray-200 dark:border-dark-300 pt-6",children:e.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 mb-4",children:c("settings.appearance.title")})}),e.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[e.jsxs("button",{onClick:()=>qa("light"),className:`flex items-center justify-center gap-2 h-12 px-3 py-2.5 text-sm font-medium rounded-xl transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 ${k.mode==="light"?"bg-primary-600 text-white shadow-sm hover:bg-primary-700 hover:shadow-md focus:ring-primary-500":"border border-gray-300 text-gray-700 bg-white shadow-sm hover:bg-gray-50 hover:border-gray-400 focus:ring-gray-500 dark:border-dark-300 dark:text-dark-700 dark:bg-dark-25 dark:hover:bg-dark-200 dark:hover:border-dark-400 ophelia:border-[#262626] ophelia:text-[#e5e5e5] ophelia:bg-[#0a0a0a] ophelia:hover:bg-[#121212]"}`,children:[e.jsx(Qr,{className:"h-4 w-4"}),c("settings.appearance.theme.light")]}),e.jsxs("button",{onClick:()=>qa("dark"),className:`flex items-center justify-center gap-2 h-12 px-3 py-2.5 text-sm font-medium rounded-xl transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 ${k.mode==="dark"?"bg-dark-300 text-dark-800 border border-dark-400 shadow-sm hover:bg-dark-400 focus:ring-dark-500":"border border-gray-300 text-gray-700 bg-white shadow-sm hover:bg-gray-50 hover:border-gray-400 focus:ring-gray-500 dark:border-dark-300 dark:text-dark-700 dark:bg-dark-25 dark:hover:bg-dark-200 dark:hover:border-dark-400 ophelia:border-[#262626] ophelia:text-[#e5e5e5] ophelia:bg-[#0a0a0a] ophelia:hover:bg-[#121212]"}`,children:[e.jsx(ei,{className:"h-4 w-4"}),c("settings.appearance.theme.dark")]}),e.jsxs("button",{onClick:()=>qa("ophelia"),className:`flex items-center justify-center gap-2 h-12 px-3 py-2.5 text-sm font-medium rounded-xl transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 ${k.mode==="ophelia"?"bg-purple-600 text-white shadow-sm hover:bg-purple-700 hover:shadow-md focus:ring-purple-500 border border-purple-500":"border border-gray-300 text-gray-700 bg-white shadow-sm hover:bg-gray-50 hover:border-gray-400 focus:ring-gray-500 dark:border-dark-300 dark:text-dark-700 dark:bg-dark-25 dark:hover:bg-dark-200 dark:hover:border-dark-400"}`,children:[e.jsx(Nn,{className:"h-4 w-4"}),c("settings.appearance.theme.amoled")]})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-md font-medium text-gray-900 dark:text-gray-100 mb-3",children:c("settings.appearance.chatInterface.title")}),e.jsx("div",{className:"space-y-3",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:c("settings.appearance.chatInterface.showUsername")}),e.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:c("settings.appearance.chatInterface.showUsernameDescription")})]}),e.jsxs("label",{className:"relative inline-flex items-center cursor-pointer",children:[e.jsx("input",{type:"checkbox",className:"sr-only peer",checked:b.showUsername,onChange:l=>{const f=l.target.checked;w({showUsername:f}),te.updatePreferences({showUsername:f})}}),e.jsx("div",{className:"w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-primary-300 dark:peer-focus:ring-primary-800 rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-primary-600"})]})]})})]}),e.jsx(cy,{})]});case"system":return e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 mb-4",children:c("settings.system.title")}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mb-6",children:[e.jsxs("div",{className:"bg-white dark:bg-dark-100 rounded-lg p-4 border border-gray-200 dark:border-dark-300",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx("div",{className:`w-3 h-3 rounded-full ${J.isHealthy?"bg-green-500":"bg-red-500"}`}),e.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:c("settings.about.ollama.title")})]}),e.jsx("p",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100",children:J.isHealthy?c("settings.about.ollama.healthy"):c("settings.about.ollama.unhealthy")}),J.ollamaVersion&&e.jsxs("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:["v",J.ollamaVersion]})]}),e.jsxs("div",{className:"bg-white dark:bg-dark-100 rounded-lg p-4 border border-gray-200 dark:border-dark-300",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(Xr,{className:"h-3 w-3 text-gray-500 dark:text-dark-500"}),e.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:c("settings.about.stats.models")})]}),e.jsx("p",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100",children:J.modelsCount})]}),e.jsxs("div",{className:"bg-white dark:bg-dark-100 rounded-lg p-4 border border-gray-200 dark:border-dark-300",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(Aa,{className:"h-3 w-3 text-green-500"}),e.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:c("settings.about.stats.sessions")})]}),e.jsx("p",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100",children:J.sessionsCount})]}),e.jsxs("div",{className:"bg-white dark:bg-dark-100 rounded-lg p-4 border border-gray-200 dark:border-dark-300",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(ia,{className:"h-3 w-3 text-purple-500"}),e.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:c("settings.system.currentModel")})]}),e.jsx("p",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100 truncate",children:r||c("settings.system.notSet")})]})]}),e.jsx(I,{onClick:ka,variant:"outline",size:"sm",children:c("common.refresh")})]})});case"models":return e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 mb-4",children:c("settings.model.title")}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"bg-white dark:bg-dark-100 rounded-lg p-4 border border-gray-200 dark:border-dark-300",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-3",children:c("settings.model.defaultModel")}),e.jsx(xe,{value:r||"",onChange:wr,options:[{value:"",label:c("settings.model.selectModel")},...t.map(l=>({value:l.name,label:l.name}))]}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-2",children:c("settings.model.defaultModelDescription")})]}),r&&e.jsxs("div",{className:"bg-white dark:bg-dark-100 rounded-lg p-4 border border-gray-200 dark:border-dark-300",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-3",children:c("settings.model.currentModelInfo")}),e.jsx("div",{className:"bg-gray-50 dark:bg-dark-50 rounded-lg p-4 border border-gray-200 dark:border-dark-300",children:e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[e.jsxs("div",{className:"flex items-center justify-between p-3 bg-white dark:bg-dark-100 rounded-md border border-gray-200 dark:border-dark-300",children:[e.jsxs("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:[c("settings.model.name"),":"]}),e.jsx("span",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100 truncate ml-2",children:r})]}),(()=>{const l=t.find(f=>f.name===r);return l?.details?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center justify-between p-3 bg-white dark:bg-dark-100 rounded-md border border-gray-200 dark:border-dark-300",children:[e.jsxs("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:[c("settings.model.size"),":"]}),e.jsx("span",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100",children:l.details.parameter_size})]}),e.jsxs("div",{className:"flex items-center justify-between p-3 bg-white dark:bg-dark-100 rounded-md border border-gray-200 dark:border-dark-300",children:[e.jsxs("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:[c("settings.model.family"),":"]}),e.jsx("span",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100",children:l.details.family})]}),e.jsxs("div",{className:"flex items-center justify-between p-3 bg-white dark:bg-dark-100 rounded-md border border-gray-200 dark:border-dark-300",children:[e.jsxs("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:[c("settings.model.format"),":"]}),e.jsx("span",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100",children:l.details.format})]})]}):null})()]})})]}),e.jsxs("div",{className:"bg-white dark:bg-dark-100 rounded-lg p-4 border border-gray-200 dark:border-dark-300",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-3",children:c("settings.systemMessage.title")}),e.jsx($n,{value:V,onChange:Pr,placeholder:c("settings.systemMessage.placeholder"),className:"w-full min-h-[100px] bg-gray-50 dark:bg-dark-50 border-gray-200 dark:border-dark-300 text-gray-900 dark:text-gray-100",rows:4}),e.jsxs("div",{className:"flex items-center justify-between mt-3",children:[e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:c("settings.systemMessage.description")}),e.jsx(I,{onClick:Mr,size:"sm",disabled:u||V===o,children:c("common.save")})]})]})]}),e.jsx("div",{className:"mt-6",children:e.jsxs("div",{className:"bg-white dark:bg-dark-100 rounded-lg p-4 border border-gray-200 dark:border-dark-300",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-3",children:c("settings.model.autoTitle.title")}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:c("settings.model.autoTitle.enable")}),e.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:c("settings.model.autoTitle.enableDescription")})]}),e.jsxs("label",{className:"relative inline-flex items-center cursor-pointer",children:[e.jsx("input",{type:"checkbox",className:"sr-only peer",checked:b.titleSettings?.autoTitle||!1,onChange:l=>{const f=l.target.checked,M={...b.titleSettings,autoTitle:f,taskModel:b.titleSettings?.taskModel||""};w({titleSettings:M}),te.updatePreferences({titleSettings:M})}}),e.jsx("div",{className:"w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-primary-300 dark:peer-focus:ring-primary-800 rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-primary-600"})]})]}),b.titleSettings?.autoTitle&&e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:c("settings.model.autoTitle.taskModel")}),e.jsx(xe,{value:b.titleSettings?.taskModel||"",onChange:l=>{const f=l.target.value,M={...b.titleSettings,autoTitle:b.titleSettings?.autoTitle||!1,taskModel:f};w({titleSettings:M}),te.updatePreferences({titleSettings:M})},options:[{value:"",label:c("settings.model.autoTitle.selectTaskModel")},...t.map(l=>({value:l.name,label:l.name}))]}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-2",children:c("settings.model.autoTitle.taskModelDescription")})]})]})]})}),e.jsx("div",{className:"mt-6",children:e.jsxs("div",{className:"bg-white dark:bg-dark-100 rounded-lg p-4 border border-gray-200 dark:border-dark-300",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-3",children:c("settings.model.bulkOperations")}),e.jsx("div",{className:"space-y-3",children:e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:c("settings.model.updateAll")}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-3",children:c("settings.model.updateAllDescription")}),ne&&H&&e.jsxs("div",{className:"mb-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsx("span",{className:"text-gray-600 dark:text-dark-600 font-medium",children:c("settings.model.updatingModel",{name:H.modelName,current:H.current,total:H.total})}),e.jsxs("span",{className:"text-primary-600 dark:text-primary-400 font-semibold",children:[Math.round(H.current/H.total*100),"%"]})]}),e.jsx("div",{className:"w-full bg-gray-200 dark:bg-dark-300 rounded-full h-3 shadow-subtle",children:e.jsx("div",{className:"bg-gradient-to-r from-primary-500 to-primary-600 dark:from-primary-400 dark:to-primary-500 h-3 rounded-full transition-all duration-500 ease-out shadow-glow",style:{width:`${H.current/H.total*100}%`}})}),e.jsxs("div",{className:"text-xs flex items-center justify-between",children:[e.jsxs("span",{className:"text-gray-500 dark:text-dark-500",children:[c("settings.model.status"),":"," ",H.status==="starting"?e.jsx("span",{className:"text-accent-500 dark:text-accent-400",children:c("settings.model.statusStarting")}):H.status==="success"?e.jsx("span",{className:"text-success-600 dark:text-success-500",children:c("settings.model.statusComplete")}):H.status==="error"?e.jsxs("span",{className:"text-error-600 dark:text-error-500",children:[c("settings.model.statusError"),":"," ",H.error]}):""]}),e.jsx("span",{className:"text-gray-400 dark:text-dark-600 text-[10px]",children:c("settings.model.modelsProgress",{current:H.current,total:H.total})})]})]}),e.jsx(I,{onClick:Tr,variant:"outline",size:"sm",className:"w-full",disabled:ne||u||t.length===0,children:ne?c("settings.model.updating"):c("settings.model.updateAllButton",{count:t.length})})]})})]})})]})});case"tts":return e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 mb-4",children:c("settings.tts.title")}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-6",children:c("settings.tts.description")}),er?e.jsxs("div",{className:"flex items-center justify-center py-8",children:[e.jsx(qe,{className:"h-8 w-8 animate-spin text-primary-500"}),e.jsx("span",{className:"ml-3 text-gray-600 dark:text-gray-400",children:c("settings.tts.loadingProviders")})]}):He.length===0?e.jsx("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(Ft,{className:"h-5 w-5 text-yellow-600 dark:text-yellow-400 mt-0.5"}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium text-yellow-800 dark:text-yellow-200",children:c("settings.tts.noProviders")}),e.jsx("p",{className:"text-sm text-yellow-700 dark:text-yellow-300 mt-1",children:c("settings.tts.noProvidersDescription")})]})]})}):e.jsxs("div",{className:"space-y-6",children:[e.jsx("div",{className:"bg-white dark:bg-dark-100 rounded-lg p-4 border border-gray-200 dark:border-dark-300",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:c("settings.tts.enable")}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:c("settings.tts.enableDescription")})]}),e.jsxs("label",{className:"flex items-center cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:X.enabled,onChange:l=>fa("enabled",l.target.checked),className:"sr-only"}),e.jsx("div",{className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2 ${X.enabled?"bg-primary-600 dark:bg-primary-500":"bg-gray-200 dark:bg-dark-300"}`,children:e.jsx("span",{className:`inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${X.enabled?"translate-x-6":"translate-x-1"}`})})]})]})}),e.jsx("div",{className:"bg-white dark:bg-dark-100 rounded-lg p-4 border border-gray-200 dark:border-dark-300",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:c("settings.tts.autoPlay")}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:c("settings.tts.autoPlayDescription")})]}),e.jsxs("label",{className:"flex items-center cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:X.autoPlay,onChange:l=>fa("autoPlay",l.target.checked),disabled:!X.enabled,className:"sr-only"}),e.jsx("div",{className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2 ${X.enabled?X.autoPlay?"bg-primary-600 dark:bg-primary-500":"bg-gray-200 dark:bg-dark-300":"bg-gray-100 dark:bg-dark-200 opacity-50 cursor-not-allowed"}`,children:e.jsx("span",{className:`inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${X.autoPlay?"translate-x-6":"translate-x-1"}`})})]})]})}),e.jsxs("div",{className:"bg-white dark:bg-dark-100 rounded-lg p-4 border border-gray-200 dark:border-dark-300",children:[e.jsx("h4",{className:"text-sm font-medium text-gray-900 dark:text-gray-100 mb-4",children:c("settings.tts.voiceConfiguration")}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:c("settings.tts.model")}),e.jsx(xe,{value:X.model,onChange:l=>dr(l.target.value),disabled:!X.enabled,options:[{value:"",label:c("settings.model.selectModel")},...He.map(l=>({value:l.model,label:`${l.model} (${l.plugin})`}))]}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:c("settings.tts.modelDescription")})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:c("settings.tts.voice")}),e.jsx(xe,{value:X.voice,onChange:l=>fa("voice",l.target.value),disabled:!X.enabled||yt.length===0,options:[{value:"",label:c("settings.tts.selectVoice")},...yt.map(l=>({value:l,label:l.charAt(0).toUpperCase()+l.slice(1)}))]}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:c("settings.tts.voiceDescription")})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:[c("settings.tts.speed"),":"," ",X.speed.toFixed(1),"x"]}),e.jsx("input",{type:"range",min:"0.25",max:"4.0",step:"0.25",value:X.speed,onChange:l=>fa("speed",parseFloat(l.target.value)),disabled:!X.enabled,className:"w-full range-slider"}),e.jsxs("div",{className:"flex justify-between text-xs text-gray-500 mt-1",children:[e.jsx("span",{children:c("settings.tts.speedSlow")}),e.jsx("span",{children:c("settings.tts.speedNormal")}),e.jsx("span",{children:c("settings.tts.speedFast")})]})]})]})]}),ft.length>0&&e.jsxs("div",{className:"bg-gray-50 dark:bg-dark-50 rounded-lg p-4 border border-gray-200 dark:border-dark-300",children:[e.jsx("h4",{className:"text-sm font-medium text-gray-700 dark:text-gray-300 mb-3",children:c("settings.tts.availableProviders")}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:ft.map(l=>e.jsxs("div",{className:"flex items-center gap-2 p-2 bg-white dark:bg-dark-100 rounded border border-gray-200 dark:border-dark-300",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-green-500"}),e.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:l.name}),e.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:["(",l.models?.length||0," ",c("settings.tts.models"),")"]})]},l.id))})]}),e.jsxs("div",{className:"flex justify-between items-center pt-4 border-t border-gray-200 dark:border-dark-300",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(I,{onClick:gr,variant:"outline",className:"flex items-center gap-2",children:[e.jsx(na,{size:16}),c("common.reset")]}),e.jsx(I,{onClick:pr,variant:"outline",disabled:!X.enabled||!X.model,className:"flex items-center gap-2",children:xt?e.jsxs(e.Fragment,{children:[e.jsx(Yr,{size:16}),c("settings.tts.stop")]}):e.jsxs(e.Fragment,{children:[e.jsx(Zr,{size:16}),c("settings.tts.test")]})})]}),e.jsxs(I,{onClick:mr,className:"flex items-center gap-2",children:[e.jsx(Se,{size:16}),c("settings.saveSettings")]})]})]})]})});case"image-gen":return e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 mb-4",children:c("settings.imageGen.title")}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-6",children:c("settings.imageGen.description")}),nr?e.jsxs("div",{className:"flex items-center justify-center py-8",children:[e.jsx(qe,{className:"h-8 w-8 animate-spin text-primary-500"}),e.jsx("span",{className:"ml-3 text-gray-600 dark:text-gray-400",children:c("settings.imageGen.loadingProviders")})]}):je.length===0?e.jsx("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(et,{className:"h-5 w-5 text-yellow-600 dark:text-yellow-400 mt-0.5"}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium text-yellow-800 dark:text-yellow-200",children:c("settings.imageGen.noProviders")}),e.jsx("p",{className:"text-sm text-yellow-700 dark:text-yellow-300 mt-1",children:c("settings.imageGen.noProvidersDescription")})]})]})}):e.jsxs("div",{className:"space-y-6",children:[e.jsx("div",{className:"bg-white dark:bg-dark-100 rounded-lg p-4 border border-gray-200 dark:border-dark-300",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:c("settings.imageGen.enable")}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:c("settings.imageGen.enableDescription")})]}),e.jsxs("label",{className:"flex items-center cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:oe.enabled,onChange:l=>ya("enabled",l.target.checked),className:"sr-only"}),e.jsx("div",{className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2 ${oe.enabled?"bg-primary-600 dark:bg-primary-500":"bg-gray-200 dark:bg-dark-300"}`,children:e.jsx("span",{className:`inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${oe.enabled?"translate-x-6":"translate-x-1"}`})})]})]})}),e.jsxs("div",{className:"bg-white dark:bg-dark-100 rounded-lg p-4 border border-gray-200 dark:border-dark-300",children:[e.jsx("h4",{className:"text-sm font-medium text-gray-900 dark:text-gray-100 mb-4",children:c("settings.imageGen.configuration")}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:c("settings.imageGen.model")}),e.jsx(xe,{value:oe.model,onChange:l=>ur(l.target.value),disabled:!oe.enabled,options:[{value:"",label:c("settings.model.selectModel")},...je.map(l=>({value:l.model,label:`${l.model} (${l.plugin})`}))]}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:c("settings.imageGen.modelDescription")})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:c("settings.imageGen.size")}),e.jsx(xe,{value:oe.size,onChange:l=>ya("size",l.target.value),disabled:!oe.enabled||Ba.length===0,options:[...Ba.length>0?Ba.map(l=>({value:l,label:l})):[{value:"1024x1024",label:"1024x1024"},{value:"1792x1024",label:"1792x1024"},{value:"1024x1792",label:"1024x1792"}]]}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:c("settings.imageGen.sizeDescription")})]}),wt.length>0&&e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:c("settings.imageGen.quality")}),e.jsx(xe,{value:oe.quality,onChange:l=>ya("quality",l.target.value),disabled:!oe.enabled,options:wt.map(l=>({value:l,label:l.charAt(0).toUpperCase()+l.slice(1)}))}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:c("settings.imageGen.qualityDescription")})]}),Pt.length>0&&e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:c("settings.imageGen.style")}),e.jsx(xe,{value:oe.style,onChange:l=>ya("style",l.target.value),disabled:!oe.enabled,options:Pt.map(l=>({value:l,label:l.charAt(0).toUpperCase()+l.slice(1)}))}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:c("settings.imageGen.styleDescription")})]})]})]}),St.length>0&&e.jsxs("div",{className:"bg-gray-50 dark:bg-dark-50 rounded-lg p-4 border border-gray-200 dark:border-dark-300",children:[e.jsx("h4",{className:"text-sm font-medium text-gray-700 dark:text-gray-300 mb-3",children:c("settings.imageGen.availableProviders")}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:St.map(l=>e.jsxs("div",{className:"flex items-center gap-2 p-2 bg-white dark:bg-dark-100 rounded border border-gray-200 dark:border-dark-300",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-green-500"}),e.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:l.name}),e.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:["(",l.models?.length||0," ",c("settings.imageGen.models"),")"]})]},l.id))})]}),e.jsxs("div",{className:"flex justify-between items-center pt-4 border-t border-gray-200 dark:border-dark-300",children:[e.jsxs(I,{onClick:br,variant:"outline",className:"flex items-center gap-2",children:[e.jsx(na,{size:16}),c("common.reset")]}),e.jsxs(I,{onClick:hr,className:"flex items-center gap-2",children:[e.jsx(Se,{size:16}),c("settings.saveSettings")]})]})]})]})});case"documents":return e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 mb-4",children:c("settings.documents.title")}),e.jsxs("div",{className:"bg-gray-50 dark:bg-dark-50 p-4 rounded-lg border border-gray-200 dark:border-dark-300 space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:c("settings.documents.embeddings.title")}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:c("settings.documents.embeddings.enable")})]}),e.jsxs("label",{className:"flex items-center cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:Z.enabled,onChange:l=>ve("enabled",l.target.checked),className:"sr-only"}),e.jsx("div",{className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2 ${Z.enabled?"bg-primary-600 dark:bg-primary-500":"bg-gray-200 dark:bg-dark-300"}`,children:e.jsx("span",{className:`inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${Z.enabled?"translate-x-6":"translate-x-1"}`})})]})]}),Z.enabled&&e.jsxs("div",{className:"space-y-4 pt-4 border-t border-gray-200 dark:border-dark-300",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:c("settings.documents.embeddings.model")}),e.jsx(xe,{value:Z.model,onChange:l=>ve("model",l.target.value),options:[{value:"nomic-embed-text",label:"nomic-embed-text"},{value:"all-minilm",label:"all-minilm"},{value:"sentence-transformers",label:"sentence-transformers"}]}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:c("settings.documents.embeddings.modelDescription")})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:[c("settings.documents.embeddings.chunkSize"),":"," ",Z.chunkSize]}),e.jsx("input",{type:"range",min:"500",max:"2000",step:"100",value:Z.chunkSize,onChange:l=>ve("chunkSize",parseInt(l.target.value)),className:"w-full range-slider"}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:c("settings.documents.embeddings.chunkSizeDescription")})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:[c("settings.documents.embeddings.chunkOverlap"),":"," ",Z.chunkOverlap]}),e.jsx("input",{type:"range",min:"50",max:"500",step:"50",value:Z.chunkOverlap,onChange:l=>ve("chunkOverlap",parseInt(l.target.value)),className:"w-full range-slider"}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:c("settings.documents.embeddings.chunkOverlapDescription")})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:[c("settings.documents.embeddings.similarityThreshold"),": ",Z.similarityThreshold.toFixed(2)]}),e.jsx("input",{type:"range",min:"0.3",max:"0.9",step:"0.05",value:Z.similarityThreshold,onChange:l=>ve("similarityThreshold",parseFloat(l.target.value)),className:"w-full range-slider"}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:c("settings.documents.embeddings.similarityDescription")})]})]})]}),re&&e.jsxs("div",{className:"bg-gray-50 dark:bg-dark-100 p-4 rounded-lg border border-gray-200 dark:border-dark-300",children:[e.jsx("h4",{className:"text-sm font-medium text-gray-900 dark:text-gray-100 mb-2",children:c("settings.documents.embeddings.status")}),e.jsxs("div",{className:"text-sm text-gray-700 dark:text-gray-300 space-y-1",children:[e.jsxs("div",{children:[c("settings.documents.embeddings.statusLabel"),":"," ",e.jsx("span",{className:`font-medium ${re.available?"text-green-600 dark:text-green-400":"text-red-600 dark:text-red-400"}`,children:re.available?c("settings.documents.embeddings.available"):c("settings.documents.embeddings.unavailable")})]}),e.jsxs("div",{children:[c("settings.documents.embeddings.model"),":"," ",e.jsx("span",{className:"font-medium",children:re.model})]}),e.jsxs("div",{children:[c("settings.documents.embeddings.chunksWithEmbeddings"),":"," ",e.jsxs("span",{className:"font-medium",children:[re.chunksWithEmbeddings," /"," ",re.totalChunks]})]}),re.totalChunks>0&&e.jsxs("div",{children:[c("settings.documents.embeddings.coverage"),":"," ",e.jsxs("span",{className:"font-medium",children:[Math.round(re.chunksWithEmbeddings/re.totalChunks*100),"%"]})]})]})]}),e.jsxs("div",{className:"flex justify-between items-center pt-4 border-t border-gray-200 dark:border-dark-300",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(I,{onClick:Tt,variant:"outline",className:"flex items-center gap-2",children:[e.jsx(na,{size:16}),c("settings.generation.resetDefaults")]}),Z.enabled&&re&&re.totalChunks>0&&e.jsxs(I,{onClick:kr,disabled:bt,variant:"outline",className:"flex items-center gap-2 text-orange-600 dark:text-orange-400 border-orange-200 dark:border-orange-600 hover:bg-orange-50 dark:hover:bg-orange-900/20",children:[e.jsx(ia,{size:16}),c(bt?"settings.documents.embeddings.regenerating":"settings.documents.embeddings.regenerate")]})]}),e.jsxs(I,{onClick:Nt,className:"flex items-center gap-2",children:[e.jsx(Se,{size:16}),c("settings.saveSettings")]})]})]})});case"plugins":return e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 mb-4",children:c("settings.plugins.title")}),A&&e.jsx("div",{className:"p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg mb-4",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("p",{className:"text-red-800 dark:text-red-200",children:A}),e.jsx(I,{variant:"ghost",size:"sm",onClick:E,className:"text-red-600 hover:text-red-800",children:e.jsx(Me,{className:"h-4 w-4"})})]})}),e.jsxs("div",{className:"bg-white dark:bg-dark-100 rounded-lg p-4 border border-gray-200 dark:border-dark-300 mb-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("h4",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:c("settings.plugins.addNew")}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsxs(I,{variant:"outline",size:"sm",onClick:()=>De(!Pe),disabled:L||D,children:[e.jsx(ja,{className:"h-4 w-4 mr-2"}),c("settings.plugins.upload")]}),e.jsx(I,{variant:"outline",size:"sm",onClick:()=>_e(!ua),disabled:L,children:c("settings.plugins.addJson")})]})]}),Pe&&e.jsxs("div",{className:"bg-gray-50 dark:bg-dark-50 rounded-lg p-4 border border-gray-200 dark:border-dark-300 mb-4",children:[e.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsx("input",{ref:Ke,type:"file",accept:".json,.zip",onChange:fr,className:"flex-1 p-2 border border-gray-300 dark:border-dark-300 rounded-md bg-white dark:bg-dark-100 text-gray-900 dark:text-dark-800 file:mr-4 file:py-2 file:px-4 file:rounded-md file:border-0 file:text-sm file:font-medium file:bg-gray-100 file:text-gray-700 dark:file:bg-dark-200 dark:file:text-dark-700 hover:file:bg-gray-200 dark:hover:file:bg-dark-300",disabled:D}),e.jsx(I,{variant:"outline",size:"sm",onClick:()=>De(!1),disabled:D,children:c("common.cancel")})]}),D&&e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mt-2",children:c("settings.plugins.uploading")})]}),ua&&e.jsx("div",{className:"bg-gray-50 dark:bg-dark-50 rounded-lg p-4 border border-gray-200 dark:border-dark-300",children:e.jsxs("div",{className:"space-y-3",children:[e.jsx("textarea",{value:Ye,onChange:l=>Le(l.target.value),placeholder:c("settings.plugins.jsonPlaceholder"),className:"w-full h-32 p-3 border border-gray-300 dark:border-dark-300 rounded-md bg-white dark:bg-dark-100 text-gray-900 dark:text-dark-800 placeholder:text-gray-400 dark:placeholder:text-dark-500 font-mono text-sm",disabled:L}),e.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[e.jsx(I,{variant:"outline",size:"sm",onClick:()=>{_e(!1),Le("")},children:c("common.cancel")}),e.jsx(I,{size:"sm",onClick:yr,disabled:!Ye.trim()||L,children:c("settings.plugins.install")})]})]})})]}),F.filter(l=>l.active).length>0&&e.jsxs("div",{className:"bg-white dark:bg-dark-100 rounded-lg p-4 border border-gray-200 dark:border-dark-300 mb-6",children:[e.jsxs("h4",{className:"text-sm font-medium text-gray-700 dark:text-gray-300 mb-3",children:[c("settings.plugins.active")," (",F.filter(l=>l.active).length,")"]}),e.jsx("div",{className:"space-y-2",children:F.filter(l=>l.active).map(l=>e.jsxs("div",{className:"flex items-center justify-between p-3 bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800 rounded-lg",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-green-800 dark:text-green-200",children:l.name}),e.jsxs("p",{className:"text-xs text-green-600 dark:text-green-300",children:[l.type," • ",l.model_map?.length||0," ",c("settings.plugins.models")]})]}),e.jsx(I,{variant:"outline",size:"sm",onClick:async()=>{await K(l.id),await g()},className:"text-green-600 border-green-300 hover:bg-green-100",children:c("settings.plugins.deactivate")})]},l.id))})]}),e.jsxs("div",{className:"bg-white dark:bg-dark-100 rounded-lg border border-gray-200 dark:border-dark-300",children:[e.jsx("div",{className:"p-4 border-b border-gray-200 dark:border-dark-300",children:e.jsxs("h4",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:[c("settings.plugins.installed")," (",F.length,")"]})}),L?e.jsx("div",{className:"p-8 text-center",children:e.jsx("p",{className:"text-gray-500 dark:text-gray-400",children:c("settings.plugins.loading")})}):F.length===0?e.jsxs("div",{className:"p-8 text-center",children:[e.jsx(Et,{className:"h-12 w-12 text-gray-400 mx-auto mb-4"}),e.jsx("p",{className:"text-gray-500 dark:text-gray-400 mb-2",children:c("settings.plugins.noPlugins")}),e.jsx("p",{className:"text-xs text-gray-400 dark:text-gray-500",children:c("settings.plugins.noPluginsDescription")})]}):e.jsx("div",{className:"divide-y divide-gray-200 dark:divide-dark-300",children:F.map(l=>e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx("div",{className:`w-3 h-3 rounded-full flex-shrink-0 ${l.active?"bg-green-500":"bg-gray-400 dark:bg-gray-500"}`}),e.jsxs("div",{children:[e.jsx("h5",{className:"font-medium text-gray-900 dark:text-gray-100",children:l.name}),e.jsxs("div",{className:"flex items-center space-x-2 text-xs text-gray-500 dark:text-gray-400",children:[e.jsx("span",{children:l.type}),e.jsx("span",{children:"•"}),e.jsxs("span",{children:[l.model_map?.length||0," ",c("settings.plugins.models")]}),l.endpoint&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"•"}),e.jsx("span",{className:"truncate max-w-32",children:l.endpoint})]}),W[l.id]&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"•"}),e.jsx("span",{className:"text-green-600",children:c("settings.plugins.apiKeySet")})]})]})]})]})}),e.jsxs("div",{className:"flex items-center space-x-1 flex-shrink-0",children:[e.jsxs(I,{variant:"ghost",size:"sm",onClick:()=>Ze(Be===l.id?null:l.id),title:"Configure API key",className:W[l.id]?"text-green-600":"text-amber-600",children:[e.jsx(at,{className:"h-4 w-4"}),Be===l.id?e.jsx(Jr,{className:"h-3 w-3"}):e.jsx(_r,{className:"h-3 w-3"})]}),e.jsx(I,{variant:"outline",size:"sm",onClick:()=>vr(l.id),disabled:L,className:l.active?"text-green-600 border-green-300":"",children:l.active?e.jsxs(e.Fragment,{children:[e.jsx(Se,{className:"h-4 w-4 mr-1"}),c("settings.plugins.activeLabel")]}):c("settings.plugins.activate")}),e.jsx(I,{variant:"ghost",size:"sm",onClick:()=>Sr(l.id),disabled:L,title:"Export plugin",children:e.jsx(An,{className:"h-4 w-4"})}),e.jsx(I,{variant:"ghost",size:"sm",onClick:()=>xr(l.id),disabled:L,className:"text-red-600 hover:text-red-700 hover:bg-red-50",title:"Delete plugin",children:e.jsx(zn,{className:"h-4 w-4"})})]})]}),Be===l.id&&e.jsxs("div",{className:"mt-4 p-4 bg-gray-50 dark:bg-dark-50 rounded-lg border border-gray-200 dark:border-dark-300",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(at,{className:"h-4 w-4 text-gray-500"}),e.jsx("h6",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:c("settings.plugins.apiKeyConfiguration")})]}),e.jsxs("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-3",children:[c("settings.plugins.apiKeyDescription",{name:l.name}),l.auth?.key_env&&e.jsxs("span",{className:"block mt-1",children:[c("settings.plugins.apiKeyEnvAlternative")," ",e.jsx("code",{className:"bg-gray-200 dark:bg-dark-200 px-1 rounded",children:l.auth.key_env})," ",c("settings.plugins.environmentVariable"),"."]})]}),W[l.id]?e.jsxs("div",{className:"flex items-center justify-between p-3 bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800 rounded-lg",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Se,{className:"h-4 w-4 text-green-600"}),e.jsx("span",{className:"text-sm text-green-700 dark:text-green-300",children:c("settings.plugins.apiKeyConfigured")})]}),e.jsx(I,{variant:"outline",size:"sm",onClick:()=>sr(l.id),disabled:pa===l.id,className:"text-red-600 border-red-300 hover:bg-red-50",children:pa===l.id?e.jsx(qe,{className:"h-4 w-4 animate-spin"}):c("common.remove")})]}):e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:ma[l.id]?"text":"password",value:C[l.id]||"",onChange:f=>ee(M=>({...M,[l.id]:f.target.value})),placeholder:c("settings.plugins.apiKeyPlaceholder"),className:"w-full p-2 pr-10 border border-gray-300 dark:border-dark-300 rounded-md bg-white dark:bg-dark-100 text-gray-900 dark:text-dark-800 placeholder:text-gray-400 dark:placeholder:text-dark-500"}),e.jsx("button",{type:"button",onClick:()=>ht(f=>({...f,[l.id]:!f[l.id]})),className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600",children:ma[l.id]?e.jsx(Je,{className:"h-4 w-4"}):e.jsx(Ee,{className:"h-4 w-4"})})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(I,{size:"sm",onClick:()=>or(l.id),disabled:pa===l.id||!C[l.id]?.trim(),children:pa===l.id?e.jsxs(e.Fragment,{children:[e.jsx(qe,{className:"h-4 w-4 mr-2 animate-spin"}),c("common.saving")]}):c("settings.plugins.saveApiKey")})})]})]})]},l.id))})]})]})});case"data":return e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 mb-4",children:c("settings.data.title")}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx("h4",{className:"text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:c("settings.data.export")}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-3 flex-1",children:c("settings.data.exportDescription")}),e.jsx(I,{onClick:jr,variant:"outline",size:"sm",className:"w-full",children:c("settings.data.exportAll")})]}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("h4",{className:"text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:c("settings.data.import")}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-3 flex-1",children:c("settings.data.importDescription")}),e.jsx("input",{ref:Re,type:"file",accept:".json",onChange:Ar,className:"hidden"}),e.jsx(I,{onClick:()=>Re.current?.click(),variant:"outline",size:"sm",className:"w-full",disabled:ba,children:c(ba?"settings.data.importing":"settings.data.importData")})]}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("h4",{className:"text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:c("settings.data.clearSessions")}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-3 flex-1",children:c("settings.data.clearSessionsDescription")}),e.jsx(I,{onClick:Dr,variant:"outline",size:"sm",className:"w-full text-red-600 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300 border-red-200 hover:border-red-300 dark:border-red-800 dark:hover:border-red-700",disabled:m.length===0||u,children:u?c("settings.data.clearing"):c("settings.data.clearAll",{count:m.length})})]})]}),rr&&e.jsxs("div",{className:"mt-4 p-4 bg-gray-50 dark:bg-dark-100 border border-gray-200 dark:border-dark-300 rounded-lg",children:[e.jsx("h5",{className:"text-sm font-medium text-gray-900 dark:text-gray-100 mb-3",children:c("settings.data.importOptions")}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-3",children:c("settings.data.importOptionsDescription")}),e.jsxs("div",{className:"space-y-2 mb-4",children:[e.jsxs("label",{className:"flex items-center",children:[e.jsx("input",{type:"radio",name:"mergeStrategy",value:"skip",checked:$a==="skip",onChange:l=>jt(l.target.value),className:"mr-2"}),e.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:c("settings.data.skipDuplicates")})]}),e.jsxs("label",{className:"flex items-center",children:[e.jsx("input",{type:"radio",name:"mergeStrategy",value:"overwrite",checked:$a==="overwrite",onChange:l=>jt(l.target.value),className:"mr-2"}),e.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:c("settings.data.overwrite")})]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(I,{onClick:zr,size:"sm",disabled:ba,children:c(ba?"settings.data.importing":"settings.data.import")}),e.jsx(I,{onClick:Nr,variant:"outline",size:"sm",children:c("common.cancel")})]})]}),ye&&e.jsxs("div",{className:"mt-4 p-4 bg-gray-50 dark:bg-dark-100 border border-gray-200 dark:border-dark-300 rounded-lg",children:[e.jsx("h5",{className:"text-sm font-medium text-gray-900 dark:text-gray-100 mb-2",children:c("settings.data.importResults")}),e.jsxs("div",{className:"text-xs text-gray-700 dark:text-gray-300 space-y-1",children:[e.jsxs("div",{children:[c("settings.data.preferences"),":"," ",ye.preferences.imported?c("settings.data.imported"):c("settings.data.failed")]}),e.jsxs("div",{children:[c("settings.data.sessions"),":"," ",ye.sessions.imported," ",c("settings.data.importedLabel"),",",ye.sessions.skipped," ",c("settings.data.skipped")]}),e.jsxs("div",{children:[c("settings.data.documents"),":"," ",ye.documents.imported," ",c("settings.data.importedLabel"),","," ",ye.documents.skipped," ",c("settings.data.skipped")]}),(ye.sessions.errors.length>0||ye.documents.errors.length>0)&&e.jsxs("div",{className:"mt-2",children:[e.jsxs("p",{className:"font-medium",children:[c("settings.data.errors"),":"]}),ye.sessions.errors.map((l,f)=>e.jsxs("p",{className:"text-red-600 dark:text-red-400",children:["• ",l]},f)),ye.documents.errors.map((l,f)=>e.jsxs("p",{className:"text-red-600 dark:text-red-400",children:["• ",l]},f))]})]}),e.jsx(I,{onClick:()=>aa(null),variant:"outline",size:"sm",className:"mt-2",children:c("common.close")})]})]})]})});case"about":return e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{children:[e.jsx("h3",{className:"libre-brand text-2xl sm:text-3xl font-normal text-gray-900 dark:text-gray-100 mb-4",style:{fontWeight:300,letterSpacing:"0.01em"},children:"Libre WebUI"}),e.jsx("div",{className:"text-sm text-gray-700 dark:text-gray-300 mb-6",children:e.jsx("span",{children:c("settings.about.title")})}),e.jsx("div",{className:"bg-gray-50 dark:bg-dark-100 rounded-lg p-6 border border-gray-200 dark:border-dark-300",children:e.jsxs("div",{className:"space-y-4 text-sm text-gray-700 dark:text-gray-300",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full mt-2 flex-shrink-0"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-gray-900 dark:text-gray-100 mb-1",children:c("settings.about.features.privacy.title")}),e.jsx("p",{children:c("settings.about.features.privacy.description")})]})]}),e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-2 h-2 bg-primary-500 rounded-full mt-2 flex-shrink-0"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-gray-900 dark:text-gray-100 mb-1",children:c("settings.about.features.openSource.title")}),e.jsx("p",{children:c("settings.about.features.openSource.description")})]})]}),e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-2 h-2 bg-purple-500 rounded-full mt-2 flex-shrink-0"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-gray-900 dark:text-gray-100 mb-1",children:c("settings.about.features.localInference.title")}),e.jsx("p",{children:c("settings.about.features.localInference.description")})]})]})]})}),e.jsxs("div",{className:"mt-6 space-y-4",children:[e.jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100",children:c("settings.about.links.title")}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[e.jsxs("a",{href:"https://github.com/libre-webui/libre-webui",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-3 p-3 bg-white dark:bg-dark-100 border border-gray-200 dark:border-dark-300 rounded-lg hover:bg-gray-50 dark:hover:bg-dark-200 hover:border-gray-300 dark:hover:border-dark-400 transition-all duration-200 group",children:[e.jsx(jn,{className:"h-5 w-5 text-gray-600 dark:text-gray-400 group-hover:text-gray-900 dark:group-hover:text-gray-200"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:c("settings.about.links.github")}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:c("settings.about.links.githubDescription")})]}),e.jsx(Ce,{className:"h-4 w-4 text-gray-400 ml-auto opacity-0 group-hover:opacity-100 transition-opacity"})]}),e.jsxs("a",{href:"https://librewebui.org",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-3 p-3 bg-white dark:bg-dark-100 border border-gray-200 dark:border-dark-300 rounded-lg hover:bg-gray-50 dark:hover:bg-dark-200 hover:border-gray-300 dark:hover:border-dark-400 transition-all duration-200 group",children:[e.jsx(Ce,{className:"h-5 w-5 text-gray-600 dark:text-gray-400 group-hover:text-gray-900 dark:group-hover:text-gray-200"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:c("settings.about.links.website")}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:c("settings.about.links.websiteDescription")})]}),e.jsx(Ce,{className:"h-4 w-4 text-gray-400 ml-auto opacity-0 group-hover:opacity-100 transition-opacity"})]}),e.jsxs("a",{href:"https://ollama.ai",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-3 p-3 bg-white dark:bg-dark-100 border border-gray-200 dark:border-dark-300 rounded-lg hover:bg-gray-50 dark:hover:bg-dark-200 hover:border-gray-300 dark:hover:border-dark-400 transition-all duration-200 group",children:[e.jsx(Ct,{className:"h-5 w-5 text-gray-600 dark:text-gray-400 group-hover:text-gray-900 dark:group-hover:text-gray-200"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:c("settings.about.links.ollama")}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:c("settings.about.links.ollamaDescription")})]}),e.jsx(Ce,{className:"h-4 w-4 text-gray-400 ml-auto opacity-0 group-hover:opacity-100 transition-opacity"})]}),e.jsxs("a",{href:"https://github.com/libre-webui/libre-webui/issues",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-3 p-3 bg-white dark:bg-dark-100 border border-gray-200 dark:border-dark-300 rounded-lg hover:bg-gray-50 dark:hover:bg-dark-200 hover:border-gray-300 dark:hover:border-dark-400 transition-all duration-200 group",children:[e.jsx(Aa,{className:"h-5 w-5 text-gray-600 dark:text-gray-400 group-hover:text-gray-900 dark:group-hover:text-gray-200"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:c("settings.about.links.reportIssue")}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:c("settings.about.links.reportIssueDescription")})]}),e.jsx(Ce,{className:"h-4 w-4 text-gray-400 ml-auto opacity-0 group-hover:opacity-100 transition-opacity"})]})]})]}),e.jsx("div",{className:"mt-6 p-4 bg-gray-50 dark:bg-dark-100 border border-gray-200 dark:border-dark-300 rounded-lg",children:e.jsxs("div",{className:"flex items-center justify-between text-xs text-gray-500 dark:text-gray-400",children:[e.jsx("a",{href:`https://github.com/libre-webui/libre-webui/releases/tag/v${gn}`,target:"_blank",rel:"noopener noreferrer",className:"hover:text-primary-600 dark:hover:text-primary-400 transition-colors",children:c("settings.about.version",{version:gn})}),e.jsxs("span",{children:[c("settings.about.openSourceBy",{company:""}),e.jsx("a",{href:"https://kroonen.ai",target:"_blank",rel:"noopener noreferrer",className:"text-primary-600 dark:text-primary-400 hover:text-primary-700 dark:hover:text-primary-300 transition-colors",children:"Kroonen AI"})]})]})})]})});case"generation":return e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 mb-4",children:c("settings.generation.title")}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-6",children:c("settings.generation.description")}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"bg-white dark:bg-dark-100 rounded-lg p-4 border border-gray-200 dark:border-dark-300",children:[e.jsx("h4",{className:"text-md font-medium text-gray-900 dark:text-gray-100 mb-4",children:c("settings.generation.coreParameters")}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:[c("settings.generation.temperature"),e.jsx("span",{className:"text-xs text-gray-500 ml-1",children:"(0.0-2.0)"})]}),e.jsx("input",{type:"number",min:"0",max:"2",step:"0.1",value:ge.temperature??"",placeholder:"0.8",onChange:l=>fe("temperature",l.target.value?parseFloat(l.target.value):void 0),className:"w-full px-3 py-2 border border-gray-300 dark:border-dark-300 rounded-md focus:ring-2 focus:ring-primary-500 focus:border-transparent bg-white dark:bg-dark-200 text-gray-900 dark:text-gray-100"}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:c("settings.generation.temperatureDescription")})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:[c("settings.generation.topP"),e.jsx("span",{className:"text-xs text-gray-500 ml-1",children:"(0.0-1.0)"})]}),e.jsx("input",{type:"number",min:"0",max:"1",step:"0.05",value:ge.top_p??"",placeholder:"0.9",onChange:l=>fe("top_p",l.target.value?parseFloat(l.target.value):void 0),className:"w-full px-3 py-2 border border-gray-300 dark:border-dark-300 rounded-md focus:ring-2 focus:ring-primary-500 focus:border-transparent bg-white dark:bg-dark-200 text-gray-900 dark:text-gray-100"}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:c("settings.generation.topPDescription")})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:[c("settings.generation.topK"),e.jsx("span",{className:"text-xs text-gray-500 ml-1",children:"(1-100)"})]}),e.jsx("input",{type:"number",min:"1",max:"100",value:ge.top_k??"",placeholder:"40",onChange:l=>fe("top_k",l.target.value?parseInt(l.target.value):void 0),className:"w-full px-3 py-2 border border-gray-300 dark:border-dark-300 rounded-md focus:ring-2 focus:ring-primary-500 focus:border-transparent bg-white dark:bg-dark-200 text-gray-900 dark:text-gray-100"}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:c("settings.generation.topKDescription")})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:[c("settings.generation.minP"),e.jsx("span",{className:"text-xs text-gray-500 ml-1",children:"(0.0-1.0)"})]}),e.jsx("input",{type:"number",min:"0",max:"1",step:"0.05",value:ge.min_p??"",placeholder:"0.0",onChange:l=>fe("min_p",l.target.value?parseFloat(l.target.value):void 0),className:"w-full px-3 py-2 border border-gray-300 dark:border-dark-300 rounded-md focus:ring-2 focus:ring-primary-500 focus:border-transparent bg-white dark:bg-dark-200 text-gray-900 dark:text-gray-100"}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:c("settings.generation.minPDescription")})]})]})]}),e.jsxs("div",{className:"bg-white dark:bg-dark-100 rounded-lg p-4 border border-gray-200 dark:border-dark-300",children:[e.jsx("h4",{className:"text-md font-medium text-gray-900 dark:text-gray-100 mb-4",children:c("settings.generation.generationControl")}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:c("settings.generation.maxTokens")}),e.jsx("input",{type:"number",min:"-1",max:"4096",value:ge.num_predict??"",placeholder:"128",onChange:l=>fe("num_predict",l.target.value?parseInt(l.target.value):void 0),className:"w-full px-3 py-2 border border-gray-300 dark:border-dark-300 rounded-md focus:ring-2 focus:ring-primary-500 focus:border-transparent bg-white dark:bg-dark-200 text-gray-900 dark:text-gray-100"}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:c("settings.generation.maxTokensDescription")})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:[c("settings.generation.repeatPenalty"),e.jsx("span",{className:"text-xs text-gray-500 ml-1",children:"(0.0-2.0)"})]}),e.jsx("input",{type:"number",min:"0",max:"2",step:"0.1",value:ge.repeat_penalty??"",placeholder:"1.1",onChange:l=>fe("repeat_penalty",l.target.value?parseFloat(l.target.value):void 0),className:"w-full px-3 py-2 border border-gray-300 dark:border-dark-300 rounded-md focus:ring-2 focus:ring-primary-500 focus:border-transparent bg-white dark:bg-dark-200 text-gray-900 dark:text-gray-100"}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:c("settings.generation.repeatPenaltyDescription")})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:c("settings.generation.contextLength")}),e.jsx("input",{type:"number",min:"512",max:"32768",step:"512",value:ge.num_ctx??"",placeholder:"2048",onChange:l=>fe("num_ctx",l.target.value?parseInt(l.target.value):void 0),className:"w-full px-3 py-2 border border-gray-300 dark:border-dark-300 rounded-md focus:ring-2 focus:ring-primary-500 focus:border-transparent bg-white dark:bg-dark-200 text-gray-900 dark:text-gray-100"}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:c("settings.generation.contextLengthDescription")})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:[c("settings.generation.seed"),e.jsxs("span",{className:"text-xs text-gray-500 ml-1",children:["(",c("settings.generation.optional"),")"]})]}),e.jsx("input",{type:"number",value:ge.seed||"",onChange:l=>fe("seed",l.target.value?parseInt(l.target.value):void 0),className:"w-full px-3 py-2 border border-gray-300 dark:border-dark-300 rounded-md focus:ring-2 focus:ring-primary-500 focus:border-transparent bg-white dark:bg-dark-200 text-gray-900 dark:text-gray-100",placeholder:c("settings.generation.random")}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:c("settings.generation.seedDescription")})]})]})]}),e.jsxs("div",{className:"bg-white dark:bg-dark-100 rounded-lg p-4 border border-gray-200 dark:border-dark-300",children:[e.jsx("h4",{className:"text-md font-medium text-gray-900 dark:text-gray-100 mb-4",children:c("settings.generation.advancedOptions")}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:[c("settings.generation.presencePenalty"),e.jsx("span",{className:"text-xs text-gray-500 ml-1",children:"(-2.0-2.0)"})]}),e.jsx("input",{type:"number",min:"-2",max:"2",step:"0.1",value:ge.presence_penalty??"",placeholder:"0.0",onChange:l=>fe("presence_penalty",l.target.value?parseFloat(l.target.value):void 0),className:"w-full px-3 py-2 border border-gray-300 dark:border-dark-300 rounded-md focus:ring-2 focus:ring-primary-500 focus:border-transparent bg-white dark:bg-dark-200 text-gray-900 dark:text-gray-100"}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:c("settings.generation.presencePenaltyDescription")})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:[c("settings.generation.frequencyPenalty"),e.jsx("span",{className:"text-xs text-gray-500 ml-1",children:"(-2.0-2.0)"})]}),e.jsx("input",{type:"number",min:"-2",max:"2",step:"0.1",value:ge.frequency_penalty??"",placeholder:"0.0",onChange:l=>fe("frequency_penalty",l.target.value?parseFloat(l.target.value):void 0),className:"w-full px-3 py-2 border border-gray-300 dark:border-dark-300 rounded-md focus:ring-2 focus:ring-primary-500 focus:border-transparent bg-white dark:bg-dark-200 text-gray-900 dark:text-gray-100"}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:c("settings.generation.frequencyPenaltyDescription")})]})]}),e.jsxs("div",{className:"mt-4",children:[e.jsxs("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:[c("settings.generation.stopSequences"),e.jsxs("span",{className:"text-xs text-gray-500 ml-1",children:["(",c("settings.generation.commaSeparated"),")"]})]}),e.jsx("input",{type:"text",value:ge.stop?ge.stop.join(", "):"",onChange:l=>fe("stop",l.target.value?l.target.value.split(",").map(f=>f.trim()).filter(f=>f):void 0),className:"w-full px-3 py-2 border border-gray-300 dark:border-dark-300 rounded-md focus:ring-2 focus:ring-primary-500 focus:border-transparent bg-white dark:bg-dark-200 text-gray-900 dark:text-gray-100",placeholder:"\\\\n, ###, STOP"}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:c("settings.generation.stopSequencesDescription")})]})]}),e.jsxs("div",{className:"flex justify-between items-center pt-4 border-t border-gray-200 dark:border-dark-300",children:[e.jsxs(I,{onClick:Cr,variant:"outline",className:"flex items-center gap-2",children:[e.jsx(na,{size:16}),c("settings.generation.resetDefaults")]}),e.jsxs(I,{onClick:Ir,className:"flex items-center gap-2",children:[e.jsx(Se,{size:16}),c("settings.generation.saveOptions")]})]})]}),e.jsx("div",{className:"mt-6",children:e.jsxs("div",{className:"bg-white dark:bg-dark-100 rounded-lg p-4 border border-gray-200 dark:border-dark-300",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-3",children:c("settings.generation.embeddingSettings")}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:c("settings.generation.enableEmbeddings")}),e.jsxs("label",{className:"flex items-center cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:Z.enabled,onChange:l=>ve("enabled",l.target.checked),className:"sr-only"}),e.jsx("div",{className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2 ${Z.enabled?"bg-primary-600 dark:bg-primary-500":"bg-gray-200 dark:bg-dark-300"}`,children:e.jsx("span",{className:`inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${Z.enabled?"translate-x-6":"translate-x-1"}`})})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:c("settings.documents.embeddings.model")}),e.jsx(xe,{value:Z.model,onChange:l=>ve("model",l.target.value),options:[{value:"nomic-embed-text",label:"Nomic Embed Text"},{value:"openai-embedding",label:"OpenAI Embedding"}],disabled:!Z.enabled})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:[c("settings.documents.embeddings.chunkSize"),e.jsx("span",{className:"text-xs text-gray-500 ml-1",children:c("settings.documents.embeddings.chunkSizeInTokens")})]}),e.jsx("input",{type:"number",min:"1",value:Z.chunkSize,onChange:l=>ve("chunkSize",parseInt(l.target.value)),className:"w-full px-3 py-2 border border-gray-300 dark:border-dark-300 rounded-md focus:ring-2 focus:ring-primary-500 focus:border-transparent bg-white dark:bg-dark-200 text-gray-900 dark:text-gray-100",disabled:!Z.enabled})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:[c("settings.documents.embeddings.chunkOverlap"),e.jsx("span",{className:"text-xs text-gray-500 ml-1",children:c("settings.documents.embeddings.chunkOverlapInTokens")})]}),e.jsx("input",{type:"number",min:"0",value:Z.chunkOverlap,onChange:l=>ve("chunkOverlap",parseInt(l.target.value)),className:"w-full px-3 py-2 border border-gray-300 dark:border-dark-300 rounded-md focus:ring-2 focus:ring-primary-500 focus:border-transparent bg-white dark:bg-dark-200 text-gray-900 dark:text-gray-100",disabled:!Z.enabled})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:c("settings.documents.embeddings.similarityThreshold")}),e.jsx("input",{type:"number",min:"0",max:"1",step:"0.01",value:Z.similarityThreshold,onChange:l=>ve("similarityThreshold",parseFloat(l.target.value)),className:"w-full px-3 py-2 border border-gray-300 dark:border-dark-300 rounded-md focus:ring-2 focus:ring-primary-500 focus:border-transparent bg-white dark:bg-dark-200 text-gray-900 dark:text-gray-100",disabled:!Z.enabled})]})]}),re&&e.jsxs("div",{className:"mt-4",children:[e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsxs("span",{className:"text-gray-700 dark:text-gray-300",children:[c("settings.documents.embeddings.status"),":"]}),e.jsx("span",{className:"font-medium text-gray-900 dark:text-gray-100",children:re.available?c("settings.documents.embeddings.available"):c("settings.documents.embeddings.unavailable")})]}),re.available&&e.jsxs("div",{className:"flex items-center justify-between text-sm mt-1",children:[e.jsxs("span",{className:"text-gray-700 dark:text-gray-300",children:[c("settings.documents.embeddings.chunksWithEmbeddings"),":"]}),e.jsxs("span",{className:"font-medium text-gray-900 dark:text-gray-100",children:[re.chunksWithEmbeddings," /"," ",re.totalChunks]})]})]}),e.jsxs("div",{className:"flex justify-between items-center mt-4",children:[e.jsxs(I,{onClick:Tt,variant:"outline",className:"flex items-center gap-2",children:[e.jsx(na,{size:16}),c("settings.generation.resetDefaults")]}),e.jsxs(I,{onClick:Nt,className:"flex items-center gap-2",children:[e.jsx(Se,{size:16}),c("settings.saveSettings")]})]})]})})]})});default:return null}};return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-50 transition-opacity duration-200",onClick:a}),e.jsx("div",{className:"fixed inset-0 lg:top-1/2 lg:left-1/2 lg:-translate-x-1/2 lg:-translate-y-1/2 z-50 w-full lg:max-w-4xl lg:mx-4 h-full lg:h-[85vh] p-0 lg:p-4",children:e.jsxs("div",{className:"bg-white dark:bg-dark-25 rounded-2xl shadow-2xl border border-gray-200 dark:border-dark-200 animate-scale-in flex flex-col h-full overscroll-behavior-contain",children:[e.jsxs("div",{className:"flex items-center justify-between p-4 sm:p-6 border-b border-gray-100 dark:border-dark-200 sticky top-0 z-10 rounded-t-2xl",children:[e.jsx("h2",{className:"text-lg sm:text-xl font-semibold text-gray-900 dark:text-gray-100",children:c("settings.title")}),e.jsx(I,{variant:"ghost",size:"sm",onClick:a,className:"h-9 w-9 sm:h-8 sm:w-8 p-0 hover:bg-gray-100 dark:hover:bg-gray-700 active:bg-gray-200 dark:active:bg-dark-100 touch-manipulation",title:"Close",children:e.jsx(Me,{className:"h-5 w-5 sm:h-4 sm:w-4"})})]}),e.jsxs("div",{className:"flex flex-1 min-h-0 overscroll-behavior-contain",children:[e.jsx("div",{className:"w-40 xs:w-48 sm:w-64 border-r border-gray-100 dark:border-dark-200 p-2 xs:p-3 sm:p-4 overflow-y-auto scrollbar-thin",style:{WebkitOverflowScrolling:"touch"},children:e.jsx("nav",{className:"space-y-1",children:Fr.map(l=>{const f=l.icon;return e.jsxs("button",{onClick:()=>ue(l.id),className:`w-full flex items-center gap-2 sm:gap-3 px-2 sm:px-3 py-2.5 sm:py-2.5 text-left rounded-lg transition-colors duration-200 touch-manipulation ${$===l.id?"bg-gray-100 dark:bg-dark-100 ophelia:bg-[#0a0a0a] text-gray-900 dark:text-white ophelia:text-[#fafafa] border border-gray-200 dark:border-dark-300 ophelia:border-[rgba(38,38,38,0.3)]":"text-gray-700 dark:text-gray-300 ophelia:text-[#a3a3a3] hover:bg-gray-50 dark:hover:bg-dark-200 ophelia:hover:bg-[#0a0a0a] active:bg-gray-100 dark:active:bg-dark-100 ophelia:active:bg-[#121212]"}`,children:[e.jsx(f,{className:"h-4 w-4 flex-shrink-0"}),e.jsx("span",{className:"text-xs sm:text-sm font-medium truncate",children:l.label})]},l.id)})})}),e.jsx("div",{className:"flex-1 p-3 xs:p-4 sm:p-6 overflow-auto overscroll-behavior-contain",style:{WebkitOverflowScrolling:"touch"},children:Er()})]})]})})]})},my=({value:n,onChange:a,className:t=""})=>{const r=h.useRef(null),[i,o]=h.useState(!1),[s,d]=h.useState(!1),u=async w=>{if(!w.type.startsWith("image/")){z.error("Please select a valid image file");return}if(w.size>2*1024*1024){z.error("Avatar image size must be less than 2MB");return}o(!0);try{const S=new FileReader;S.onload=F=>{const L=F.target?.result;a(L),z.success("Avatar uploaded successfully")},S.onerror=()=>{z.error("Failed to read image file")},S.readAsDataURL(w)}catch(S){console.error("Failed to upload avatar:",S),z.error("Failed to upload avatar image")}finally{o(!1)}},m=w=>{const S=w.target.files?.[0];S&&u(S)},g=w=>{w.preventDefault(),d(!0)},p=w=>{w.preventDefault(),d(!1)},k=w=>{w.preventDefault(),d(!1);const S=w.dataTransfer.files?.[0];S&&u(S)},x=()=>{a(""),z.success("Avatar removed")},b=()=>n||null;return e.jsx("div",{className:`space-y-4 ${t}`,children:e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-dark-600 mb-2",children:"Avatar"}),e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"flex-shrink-0",children:e.jsx("div",{className:"w-20 h-20 rounded-full overflow-hidden bg-gray-100 dark:bg-dark-200 border-2 border-gray-300 dark:border-dark-300 flex items-center justify-center",children:b()?e.jsx("img",{src:b(),alt:"Avatar preview",className:"w-full h-full object-cover"}):e.jsx(wa,{className:"h-8 w-8 text-gray-400 dark:text-gray-500"})})}),e.jsxs("div",{className:"flex-1 space-y-3",children:[n?e.jsxs("div",{className:"flex items-center gap-3 p-3 bg-gray-50 dark:bg-dark-200 rounded-lg",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-gray-100 truncate",children:"Custom avatar image"}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"Click to change or remove"})]}),e.jsx(I,{variant:"ghost",size:"sm",onClick:x,className:"text-red-600 hover:text-red-700 hover:bg-red-50 dark:text-red-400 dark:hover:text-red-300 dark:hover:bg-red-900/20",children:e.jsx(Me,{className:"h-4 w-4"})})]}):e.jsxs("div",{className:`border-2 border-dashed rounded-lg p-4 text-center cursor-pointer transition-colors ${s?"border-primary-500 bg-primary-50 dark:bg-primary-900/20":"border-gray-300 dark:border-gray-600 hover:border-gray-400 dark:hover:border-gray-500"}`,onDragOver:g,onDragLeave:p,onDrop:k,onClick:()=>r.current?.click(),children:[e.jsx(ja,{className:"h-8 w-8 mx-auto text-gray-400 dark:text-gray-500 mb-2"}),e.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-gray-100 mb-2",children:"Upload avatar image"}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-2",children:"Drag and drop an image or click to browse"}),e.jsxs(I,{variant:"outline",size:"sm",disabled:i,className:"mx-auto",children:[e.jsx(ja,{className:"h-4 w-4 mr-2"}),i?"Uploading...":"Choose Image"]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-gray-600 dark:text-gray-400 mb-1",children:"Or enter image URL"}),e.jsx("input",{type:"url",value:n,onChange:w=>a(w.target.value),className:"w-full px-3 py-2 text-sm border border-gray-300 dark:border-dark-300 rounded-md bg-white dark:bg-dark-50 text-gray-900 dark:text-dark-800",placeholder:"https://example.com/avatar.jpg"})]})]})]}),e.jsx("input",{ref:r,type:"file",accept:"image/*",onChange:m,className:"hidden"}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-2",children:"Supports: JPG, PNG, GIF, WebP (max 2MB). Square images work best."})]})})};class py{constructor(){Ie(this,"ws",null);Ie(this,"url");Ie(this,"reconnectAttempts",0);Ie(this,"maxReconnectAttempts",5);Ie(this,"reconnectDelay",1e3);Ie(this,"messageHandlers",new Map);let a;window.location.protocol==="file:"?a="ws://localhost:3001":a=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}`,this.url=`${a}/ws`,console.log("WebSocket URL constructed:",this.url)}connect(){return v()?(console.log("Demo mode active: skipping WebSocket connection."),Promise.resolve()):(console.log("WebSocket: Attempting to connect to:",this.url),new Promise((a,t)=>{try{const r=localStorage.getItem("auth-token"),i=r?`${this.url}?token=${encodeURIComponent(r)}`:this.url;console.log("WebSocket: Connecting to:",i.replace(/token=[^&]+/,"token=***")),this.ws=new WebSocket(i),this.ws.onopen=()=>{console.log("WebSocket connected successfully"),this.reconnectAttempts=0,a()},this.ws.onmessage=o=>{try{const s=JSON.parse(o.data);console.log("WebSocket: Received message:",s);const d=this.messageHandlers.get(s.type);d?d(s.data):console.warn("WebSocket: No handler for message type:",s.type)}catch(s){console.error("Failed to parse WebSocket message:",s)}},this.ws.onclose=()=>{console.log("WebSocket disconnected"),this.ws=null,this.attemptReconnect()},this.ws.onerror=o=>{console.error("WebSocket error:",o),t(o)}}catch(r){t(r)}}))}disconnect(){this.ws&&(this.ws.close(),this.ws=null)}send(a){this.ws&&this.ws.readyState===WebSocket.OPEN?(console.log("WebSocket: Sending message:",a),this.ws.send(JSON.stringify(a))):console.warn("WebSocket is not connected. ReadyState:",this.ws?.readyState)}onMessage(a,t){this.messageHandlers.delete(a),this.messageHandlers.set(a,t)}offMessage(a){this.messageHandlers.delete(a)}attemptReconnect(){if(v()){console.log("Demo mode active: skipping WebSocket reconnection.");return}this.reconnectAttempts<this.maxReconnectAttempts?(this.reconnectAttempts++,console.log(`Attempting to reconnect... (${this.reconnectAttempts}/${this.maxReconnectAttempts})`),setTimeout(()=>{this.connect().catch(()=>{})},this.reconnectDelay*this.reconnectAttempts)):console.error("Max reconnection attempts reached")}get isConnected(){return this.ws?.readyState===WebSocket.OPEN}}const da=new py,pe=Ca()(Vn((n,a)=>({user:null,token:null,systemInfo:null,isAuthenticated:!1,isLoading:!1,login:(t,r,i)=>{localStorage.setItem("auth-token",r);const o=Ne.getState();o.clearAllState&&o.clearAllState(),be.getState().clearUserState(),n({user:t,token:r,systemInfo:i,isAuthenticated:!0,isLoading:!1}),setTimeout(async()=>{try{const d=gt.getState();console.log("🔄 Reinitializing app after login..."),console.log("🔌 Reconnecting WebSocket with auth token..."),da.disconnect(),await da.connect(),!(await Fe.checkHealth()).success&&!v()&&console.warn("Ollama service not available after login");const m=be.getState();await Promise.all([o.loadModels(),o.loadSessions(),o.loadPreferences(),m.loadPreferences(),d.loadPlugins()]),console.log("✅ Reinitialized app after login")}catch(d){console.error("Failed to reinitialize app after login:",d)}},100)},logout:()=>{localStorage.removeItem("auth-token"),console.log("🔌 Disconnecting WebSocket on logout..."),da.disconnect();const t=Ne.getState();t.clearAllState&&t.clearAllState(),be.getState().clearUserState(),n({user:null,token:null,isAuthenticated:!1,isLoading:!1})},setUser:t=>{n({user:t})},setSystemInfo:t=>{n({systemInfo:t})},setLoading:t=>{n({isLoading:t})},isAdmin:()=>{const{user:t}=a();return t?.role==="admin"},requiresAuth:()=>{const{systemInfo:t}=a();return t?.requiresAuth??!1}}),{name:"auth-store",partialize:n=>({user:n.user,token:n.token,systemInfo:n.systemInfo,isAuthenticated:n.isAuthenticated})})),gy=Object.freeze(Object.defineProperty({__proto__:null,useAuthStore:pe},Symbol.toStringTag,{value:"Module"})),hn=({isOpen:n,onClose:a,className:t})=>{const{t:r}=ce(),i=ut(),o=Ia(),{sessions:s,deleteSession:d,updateSessionTitle:u,selectedModel:m,models:g,currentSession:p,generatingTitleForSession:k,personas:x}=Ne(),{user:b,isAdmin:w,systemInfo:S,setUser:F}=pe(),{backgroundImage:L,sidebarCompact:D,toggleSidebarCompact:A}=be(),[N,P]=h.useState(null),[U,q]=h.useState(""),[K,O]=h.useState(!1),[E,G]=h.useState(!1),[c,$]=h.useState(!1),[ue,V]=h.useState(""),[Y,J]=h.useState(!1),me=h.useRef(null),ne=h.useRef(null),{sessionId:T}=Rr(),H=T||null,_=p?.id||H;h.useEffect(()=>{const C=ee=>{me.current&&!me.current.contains(ee.target)&&G(!1)};if(E)return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[E]),h.useEffect(()=>{const C=ee=>{ne.current&&!ne.current.contains(ee.target)&&window.innerWidth<768&&n&&!D&&A()};if(n&&!D&&window.innerWidth<768)return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[n,D,A]),h.useEffect(()=>{b?.avatar&&V(b.avatar)},[b?.avatar]);const Pe=async()=>{J(!0);try{const C=await qn.updateMyAvatar(ue||null);C.success&&C.data?(F(C.data),Q.success(r("user.avatar.updated")),$(!1)):Q.error(C.message||r("user.avatar.updateFailed"))}catch(C){console.error("Failed to update avatar:",C),Q.error(r("user.avatar.updateFailed"))}finally{J(!1)}},De=()=>{const{setCurrentSession:C}=Ne.getState();C(null),sessionStorage.setItem("forceWelcomeScreen","true"),o("/chat",{replace:!0}),window.innerWidth<768&&!D&&A()},ua=C=>{o(`/c/${C.id}`,{replace:!0}),window.innerWidth<768&&!D&&A()},_e=async(C,ee)=>{if(ee.stopPropagation(),window.confirm(r("chat.session.deleteConfirm")))try{const W=_===C;if(await d(C),W){const Ge=s.filter(ma=>ma.id!==C);Ge.length>0?o(`/c/${Ge[0].id}`,{replace:!0}):o("/",{replace:!0})}}catch(W){console.error("Error deleting session:",W)}},Ye=(C,ee)=>{ee.stopPropagation(),P(C.id),q(C.title)},Le=async C=>{U.trim()&&await u(C,U.trim()),P(null),q("")},Ke=()=>{P(null),q("")},Be=async()=>{try{await Te.logout();const{logout:C}=pe.getState();C(),o("/login"),Q.success(r("auth.logout.success"))}catch(C){console.error("Logout error:",C);const{logout:ee}=pe.getState();ee(),o("/login")}},Ze=window.location.protocol==="file:";return e.jsxs(e.Fragment,{children:[e.jsxs("div",{ref:ne,className:R("fixed inset-y-0 left-0 z-50 border-r border-gray-200 dark:border-dark-200 transform transition-all duration-300 ease-in-out shadow-xl",D?"w-18":"w-80 max-sm:w-64",n?"translate-x-0":"-translate-x-full","lg:shadow-none",L?"bg-gray-50/70 dark:bg-dark-25/70 backdrop-blur-sm":"bg-gray-50 dark:bg-dark-25","overscroll-behavior-contain",t),style:{WebkitOverflowScrolling:"touch"},children:[Ze&&e.jsx("div",{className:"absolute top-0 left-16 right-0 h-8 z-[60]",style:{WebkitAppRegion:"drag"}}),e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:R("border-b border-gray-200/60 dark:border-dark-200/60",D?"p-2":"p-3",Ze&&"pt-10"),children:[e.jsx("div",{className:R("flex items-center",D?"justify-center mb-2":"justify-between mb-2"),children:D?e.jsxs("div",{className:"flex flex-col items-center gap-1.5",children:[e.jsx("span",{className:"libre-brand text-xl text-gray-900 dark:text-dark-800 ophelia:text-[#fafafa]",children:"Libre"}),e.jsx(I,{variant:"ghost",size:"sm",onClick:A,className:"h-7 w-7 p-0 hover:bg-gray-100 dark:hover:bg-dark-200 ophelia:hover:bg-[rgba(147,51,234,0.15)] active:bg-gray-200 dark:active:bg-dark-100 ophelia:active:bg-[rgba(147,51,234,0.25)] touch-manipulation ophelia:text-[#a3a3a3] ophelia:hover:text-[#c084fc]",title:r("sidebar.expandSidebar"),children:e.jsx(Ot,{className:"h-4 w-4"})})]}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"libre-brand text-xl text-gray-900 dark:text-dark-800 ophelia:text-[#fafafa]",children:"Libre WebUI"}),e.jsx("div",{className:"flex items-center gap-1",children:e.jsx(I,{variant:"ghost",size:"sm",onClick:A,className:"h-7 w-7 p-0 hover:bg-gray-100 dark:hover:bg-dark-200 ophelia:hover:bg-[rgba(147,51,234,0.15)] active:bg-gray-200 dark:active:bg-dark-100 ophelia:active:bg-[rgba(147,51,234,0.25)] touch-manipulation ophelia:text-[#a3a3a3] ophelia:hover:text-[#c084fc]",title:r("sidebar.toggleSize"),children:e.jsx(ai,{className:"h-4 w-4"})})})]})}),!D&&e.jsxs(I,{onClick:De,disabled:!m||g.length===0,className:"w-full bg-primary-600 hover:bg-primary-700 active:bg-primary-800 text-white shadow-sm hover:shadow-md active:shadow-lg transition-all duration-200 border-0 touch-manipulation",size:"sm",title:!m||g.length===0?r("chat.model.noModelsTooltip"):"",children:[e.jsx(Lt,{className:"h-4 w-4 mr-2"}),r("chat.session.new")]}),D&&e.jsx(I,{onClick:De,disabled:!m||g.length===0,className:"w-full h-9 bg-primary-600 hover:bg-primary-700 active:bg-primary-800 text-white shadow-sm hover:shadow-md active:shadow-lg transition-all duration-200 border-0 touch-manipulation p-0",title:!m||g.length===0?r("chat.model.noModelsTooltip"):r("chat.session.new"),children:e.jsx(Lt,{className:"h-4 w-4"})})]}),e.jsx("div",{className:R("py-1.5",D?"px-1":"px-2.5"),children:e.jsxs("nav",{className:R("space-y-0.5",D&&"flex flex-col items-center"),children:[e.jsxs("button",{onClick:()=>{const{setCurrentSession:C}=Ne.getState();C(null),sessionStorage.setItem("forceWelcomeScreen","true"),o("/chat",{replace:!0}),window.innerWidth<768&&!D&&A()},className:R("flex items-center gap-2.5 rounded-lg text-sm font-medium transition-all duration-200 text-left touch-manipulation",D?"w-11 h-11 justify-center p-0":"w-full px-2.5 py-2",i.pathname==="/chat"||i.pathname==="/"?"bg-primary-100 dark:bg-primary-900/30 ophelia:bg-[rgba(147,51,234,0.25)] text-primary-800 dark:text-primary-200 ophelia:text-[#e9d5ff] shadow-sm":"text-gray-700 dark:text-gray-300 ophelia:text-[#a3a3a3] hover:bg-gray-50 dark:hover:bg-dark-200/50 ophelia:hover:bg-[rgba(147,51,234,0.1)] hover:text-gray-900 dark:hover:text-gray-100 ophelia:hover:text-[#e9d5ff] active:bg-gray-100 dark:active:bg-dark-200 ophelia:active:bg-[rgba(147,51,234,0.15)]"),title:D?r("sidebar.navigation.chat"):void 0,children:[e.jsx(Aa,{className:"h-4 w-4 shrink-0"}),!D&&r("sidebar.navigation.chat")]}),e.jsxs(ta,{to:"/models",onClick:()=>window.innerWidth<768&&!D&&A(),className:R("flex items-center gap-2.5 rounded-lg text-sm font-medium transition-all duration-200 touch-manipulation",D?"w-11 h-11 justify-center p-0":"w-full px-2.5 py-2",i.pathname==="/models"?"bg-primary-100 dark:bg-primary-900/30 ophelia:bg-[rgba(147,51,234,0.25)] text-primary-800 dark:text-primary-200 ophelia:text-[#e9d5ff] shadow-sm":"text-gray-700 dark:text-gray-300 ophelia:text-[#a3a3a3] hover:bg-gray-50 dark:hover:bg-dark-200/50 ophelia:hover:bg-[rgba(147,51,234,0.1)] hover:text-gray-900 dark:hover:text-gray-100 ophelia:hover:text-[#e9d5ff] active:bg-gray-100 dark:active:bg-dark-200 ophelia:active:bg-[rgba(147,51,234,0.15)]"),title:D?r("sidebar.navigation.models"):void 0,children:[e.jsx(ia,{className:"h-4 w-4 shrink-0"}),!D&&r("sidebar.navigation.models")]}),e.jsxs(ta,{to:"/personas",onClick:()=>window.innerWidth<768&&!D&&A(),className:R("flex items-center gap-2.5 rounded-lg text-sm font-medium transition-all duration-200 touch-manipulation",D?"w-11 h-11 justify-center p-0":"w-full px-2.5 py-2",i.pathname==="/personas"?"bg-primary-100 dark:bg-primary-900/30 ophelia:bg-[rgba(147,51,234,0.25)] text-primary-800 dark:text-primary-200 ophelia:text-[#e9d5ff] shadow-sm":"text-gray-700 dark:text-gray-300 ophelia:text-[#a3a3a3] hover:bg-gray-50 dark:hover:bg-dark-200/50 ophelia:hover:bg-[rgba(147,51,234,0.1)] hover:text-gray-900 dark:hover:text-gray-100 ophelia:hover:text-[#e9d5ff] active:bg-gray-100 dark:active:bg-dark-200 ophelia:active:bg-[rgba(147,51,234,0.15)]"),title:D?r("sidebar.navigation.personas"):void 0,children:[e.jsx(wa,{className:"h-4 w-4 shrink-0"}),!D&&r("sidebar.navigation.personas")]}),e.jsxs(ta,{to:"/gallery",onClick:()=>window.innerWidth<768&&!D&&A(),className:R("flex items-center gap-2.5 rounded-lg text-sm font-medium transition-all duration-200 touch-manipulation",D?"w-11 h-11 justify-center p-0":"w-full px-2.5 py-2",i.pathname==="/gallery"?"bg-primary-100 dark:bg-primary-900/30 ophelia:bg-[rgba(147,51,234,0.25)] text-primary-800 dark:text-primary-200 ophelia:text-[#e9d5ff] shadow-sm":"text-gray-700 dark:text-gray-300 ophelia:text-[#a3a3a3] hover:bg-gray-50 dark:hover:bg-dark-200/50 ophelia:hover:bg-[rgba(147,51,234,0.1)] hover:text-gray-900 dark:hover:text-gray-100 ophelia:hover:text-[#e9d5ff] active:bg-gray-100 dark:active:bg-dark-200 ophelia:active:bg-[rgba(147,51,234,0.15)]"),title:D?r("sidebar.navigation.imagine"):void 0,children:[e.jsx(Nn,{className:"h-4 w-4 shrink-0"}),!D&&r("sidebar.navigation.imagine")]})]})}),e.jsx("div",{className:"flex-1 overflow-y-auto scrollbar-thin border-t border-gray-200/60 dark:border-dark-200/60",style:{WebkitOverflowScrolling:"touch",overscrollBehavior:"contain",willChange:"scroll-position"},children:e.jsxs("div",{className:R("p-2.5",D&&"px-1"),children:[!D&&s.length>0&&e.jsxs("div",{className:"flex items-center justify-between mb-1.5 px-1",children:[e.jsx("h3",{className:"text-xs font-semibold text-gray-700 dark:text-gray-300 uppercase tracking-wide",children:r("chat.session.chats")}),e.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-500 font-medium",children:s.length})]}),s.length===0?e.jsxs("div",{className:R("text-center py-8",D?"px-1":"px-2"),children:[e.jsx("div",{className:R("mx-auto mb-3 bg-gray-100 dark:bg-dark-300 rounded-xl flex items-center justify-center",D?"w-8 h-8":"w-12 h-12"),children:e.jsx(Aa,{className:R("text-gray-400 dark:text-gray-500",D?"h-4 w-4":"h-5 w-5")})}),!D&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-sm font-medium text-gray-600 dark:text-gray-400",children:r("chat.session.noChats")}),e.jsx("p",{className:"text-xs mt-1 text-gray-500 dark:text-gray-500",children:r("chat.session.createFirst")})]})]}):e.jsx("div",{className:R("space-y-0.5",D&&"space-y-1"),children:s.map(C=>{const ee=_===C.id;return e.jsx("div",{className:R("group relative cursor-pointer transition-all duration-200 touch-manipulation",D?"rounded-lg p-2 flex items-center justify-center":"rounded-lg px-2.5 py-2",ee?"bg-gray-100 dark:bg-dark-200":"hover:bg-gray-50 dark:hover:bg-dark-200/50"),onClick:()=>ua(C),title:D?`${C.title} - ${C.model}`:void 0,children:D?e.jsx("div",{className:"flex items-center justify-center w-full h-8",children:e.jsx("div",{className:R("w-3 h-3 rounded-full",k===C.id?"bg-primary-400 animate-pulse":ee?"bg-primary-500":"bg-gray-300 dark:bg-gray-600")})}):N===C.id?e.jsxs("div",{className:"flex items-center gap-2",onClick:W=>W.stopPropagation(),children:[e.jsx(Yf,{value:U,onChange:W=>q(W.target.value),onKeyDown:W=>{W.key==="Enter"?Le(C.id):W.key==="Escape"&&Ke()},className:"text-sm h-8 ophelia:bg-[#0a0a0a] ophelia:border-[#9333ea] ophelia:text-[#fafafa] ophelia:focus:ring-[#a855f7] ophelia:focus:border-[#a855f7]",autoFocus:!0}),e.jsx(I,{variant:"ghost",size:"sm",onClick:()=>Le(C.id),className:"h-8 w-8 p-0 shrink-0 hover:bg-gray-100 dark:hover:bg-dark-300 ophelia:hover:bg-[rgba(147,51,234,0.2)] active:bg-gray-200 dark:active:bg-dark-400 ophelia:active:bg-[rgba(147,51,234,0.3)] touch-manipulation ophelia:text-[#a855f7] ophelia:hover:text-[#c084fc]",children:e.jsx(Se,{className:"h-3 w-3"})}),e.jsx(I,{variant:"ghost",size:"sm",onClick:Ke,className:"h-8 w-8 p-0 shrink-0 hover:bg-gray-100 dark:hover:bg-dark-300 ophelia:hover:bg-[rgba(239,68,68,0.15)] active:bg-gray-200 dark:active:bg-dark-400 ophelia:active:bg-[rgba(239,68,68,0.25)] touch-manipulation ophelia:text-[#737373] ophelia:hover:text-[#f87171]",children:e.jsx(Me,{className:"h-3 w-3"})})]}):e.jsxs("div",{className:"flex items-center justify-between w-full",children:[e.jsxs("div",{className:"flex-1 min-w-0 mr-2",children:[e.jsx("h3",{className:R("text-sm font-medium truncate leading-tight","text-gray-900 dark:text-gray-100"),children:k===C.id?e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx("span",{className:"animate-pulse",children:r("chat.session.generatingTitle")}),e.jsxs("span",{className:"inline-flex",children:[e.jsx("span",{className:"animate-bounce",style:{animationDelay:"0ms"},children:"."}),e.jsx("span",{className:"animate-bounce",style:{animationDelay:"150ms"},children:"."}),e.jsx("span",{className:"animate-bounce",style:{animationDelay:"300ms"},children:"."})]})]}):_f(C.title,32)}),e.jsxs("div",{className:"flex items-center gap-1.5 mt-0.5",children:[e.jsx("span",{className:R("text-xs",ee?"text-gray-600 dark:text-gray-400":"text-gray-500 dark:text-gray-500"),children:qf(C.updatedAt)}),e.jsx("span",{className:"text-gray-400 dark:text-gray-600",children:"•"}),C.personaId?(()=>{const W=x[C.personaId];return W?e.jsxs("span",{className:R("flex items-center gap-1 text-xs font-medium",ee?"text-primary-600 dark:text-primary-400":"text-primary-500 dark:text-primary-500"),title:W.description||W.name,children:[W.avatar&&!W.avatar.startsWith("data:")&&e.jsx("span",{className:"text-[10px]",children:W.avatar}),e.jsx("span",{className:"truncate max-w-[100px]",children:W.name})]}):e.jsx("span",{className:R("text-xs font-medium italic",ee?"text-gray-500 dark:text-gray-500":"text-gray-400 dark:text-gray-600"),children:"Persona"})})():e.jsx("span",{className:R("text-xs font-medium truncate max-w-[120px]",ee?"text-gray-700 dark:text-gray-300":"text-gray-600 dark:text-gray-400"),title:C.model,children:C.model})]})]}),e.jsxs("div",{className:"flex items-center gap-0.5 opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-all duration-200 shrink-0",children:[e.jsx(I,{variant:"ghost",size:"sm",onClick:W=>Ye(C,W),className:"h-7 w-7 sm:h-6 sm:w-6 p-0 hover:bg-gray-200 dark:hover:bg-gray-700 active:bg-gray-300 dark:active:bg-gray-600 rounded-md touch-manipulation",title:r("chat.session.renameChat"),children:e.jsx(ti,{className:"h-3 w-3"})}),e.jsx(I,{variant:"ghost",size:"sm",onClick:W=>_e(C.id,W),className:"h-7 w-7 sm:h-6 sm:w-6 p-0 text-red-500 hover:text-red-600 hover:bg-red-50 dark:hover:bg-red-900/20 active:bg-red-100 dark:active:bg-red-900/30 rounded-md touch-manipulation",title:r("chat.session.deleteChat"),children:e.jsx(zn,{className:"h-3 w-3"})})]})]})},C.id)})})]})}),S?.requiresAuth&&b&&e.jsx("div",{className:R("border-t border-gray-200/60 dark:border-dark-200/60",D?"p-1.5":"p-2.5"),children:D?e.jsxs("div",{className:"flex flex-col items-center space-y-1.5",children:[b.avatar?e.jsx("img",{src:b.avatar,alt:b.username,className:"w-7 h-7 rounded-full object-cover",title:`${b.username} (${b.role})`}):e.jsx("div",{className:"w-7 h-7 bg-primary-500 rounded-full flex items-center justify-center",title:`${b.username} (${b.role})`,children:e.jsx("span",{className:"text-white text-xs font-medium",children:b.username.charAt(0).toUpperCase()})}),e.jsx("button",{onClick:()=>{O(!0),window.innerWidth<768&&!D&&A()},className:"w-9 h-9 flex items-center justify-center rounded-lg text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-dark-200/50 active:bg-gray-100 dark:active:bg-dark-200 touch-manipulation transition-all duration-200",title:r("sidebar.navigation.settings"),children:e.jsx(Kt,{className:"h-4 w-4"})}),w()&&e.jsx(ta,{to:"/users",onClick:()=>window.innerWidth<768&&!D&&A(),className:"w-9 h-9 flex items-center justify-center rounded-lg text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-dark-200/50 active:bg-gray-100 dark:active:bg-dark-200 touch-manipulation transition-all duration-200",title:r("sidebar.navigation.userManagement"),children:e.jsx(wa,{className:"h-4 w-4"})}),e.jsx("button",{onClick:Be,className:"w-9 h-9 flex items-center justify-center rounded-lg text-red-600 dark:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20 active:bg-red-100 dark:active:bg-red-900/30 touch-manipulation transition-all duration-200",title:r("sidebar.navigation.signOut"),children:e.jsx(Bt,{className:"h-4 w-4"})})]}):e.jsxs("div",{className:"relative",ref:me,children:[e.jsx("button",{onClick:()=>G(!E),className:"w-full p-2.5 rounded-xl bg-white/50 dark:bg-dark-200/50 ophelia:bg-[rgba(10,10,10,0.6)] border border-gray-200/30 dark:border-dark-300/30 ophelia:border-[rgba(38,38,38,0.2)] hover:bg-white/70 dark:hover:bg-dark-200/70 ophelia:hover:bg-[rgba(18,18,18,0.7)] transition-all duration-200 text-left touch-manipulation",children:e.jsxs("div",{className:"flex items-center gap-2.5",children:[b.avatar?e.jsx("img",{src:b.avatar,alt:b.username,className:"w-7 h-7 rounded-full object-cover"}):e.jsx("div",{className:"w-7 h-7 bg-primary-500 rounded-full flex items-center justify-center",children:e.jsx("span",{className:"text-white text-xs font-medium",children:b.username.charAt(0).toUpperCase()})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-gray-100 truncate",children:b.username}),e.jsxs("div",{className:"flex items-center mt-0.5",children:[b.role==="admin"&&e.jsx(Tn,{size:10,className:"text-primary-500 mr-1"}),e.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400 capitalize",children:b.role})]})]}),e.jsx(Ot,{className:R("h-4 w-4 text-gray-400 dark:text-gray-500 transition-transform duration-200",E&&"rotate-90")})]})}),E&&e.jsxs("div",{className:"absolute bottom-full left-0 right-0 mb-2 py-2 bg-white dark:bg-dark-100 rounded-xl shadow-lg border border-gray-200/50 dark:border-dark-200/50 backdrop-blur-sm z-50",children:[e.jsx("div",{className:"px-3 py-2 border-b border-gray-100 dark:border-dark-200/50",children:e.jsxs("div",{className:"flex items-center gap-2.5",children:[b.avatar?e.jsx("img",{src:b.avatar,alt:b.username,className:"w-8 h-8 rounded-full object-cover"}):e.jsx("div",{className:"w-8 h-8 bg-primary-500 rounded-full flex items-center justify-center",children:e.jsx("span",{className:"text-white text-sm font-medium",children:b.username.charAt(0).toUpperCase()})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-gray-100 truncate",children:b.username}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 truncate",children:b.email||r("user.profile.noEmail")})]})]})}),e.jsxs("div",{className:"py-1",children:[e.jsxs("button",{onClick:()=>{$(!0),G(!1)},className:"w-full flex items-center gap-3 px-3 py-2.5 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-dark-200/50 transition-colors duration-200 text-left",children:[e.jsx(ni,{className:"h-4 w-4 shrink-0"}),r("user.menu.changePicture")]}),e.jsxs("button",{onClick:()=>{O(!0),G(!1),window.innerWidth<768&&!D&&A()},className:"w-full flex items-center gap-3 px-3 py-2.5 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-dark-200/50 transition-colors duration-200 text-left",children:[e.jsx(Kt,{className:"h-4 w-4 shrink-0"}),r("user.menu.settings")]}),w()&&e.jsxs(ta,{to:"/users",onClick:()=>{G(!1),window.innerWidth<768&&!D&&A()},className:"w-full flex items-center gap-3 px-3 py-2.5 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-dark-200/50 transition-colors duration-200",children:[e.jsx(wa,{className:"h-4 w-4 shrink-0"}),r("user.menu.userManagement")]}),e.jsx("div",{className:"border-t border-gray-100 dark:border-dark-200/50 my-1"}),e.jsxs("button",{onClick:()=>{Be(),G(!1)},className:"w-full flex items-center gap-3 px-3 py-2.5 text-sm text-red-600 dark:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20 transition-colors duration-200 text-left",children:[e.jsx(Bt,{className:"h-4 w-4 shrink-0"}),r("user.menu.logout")]})]})]})]})})]})]}),e.jsx(Jn,{isOpen:K,onClose:()=>O(!1)}),c&&Mn.createPortal(e.jsx("div",{className:"fixed inset-0 z-[2147483647] flex items-center justify-center bg-black/50",onClick:()=>$(!1),children:e.jsxs("div",{className:"bg-white dark:bg-dark-100 rounded-xl shadow-2xl p-6 w-full max-w-md mx-4",onClick:C=>C.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100",children:r("user.avatar.title")}),e.jsx("button",{onClick:()=>$(!1),className:"p-1 hover:bg-gray-100 dark:hover:bg-dark-200 rounded-lg transition-colors",children:e.jsx(Me,{size:20,className:"text-gray-500"})})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx(my,{value:ue,onChange:V}),e.jsxs("div",{className:"flex justify-end gap-3 pt-4 border-t border-gray-200 dark:border-dark-300",children:[e.jsx("button",{onClick:()=>$(!1),className:"px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-dark-200 rounded-lg transition-colors",children:"Cancel"}),e.jsx("button",{onClick:Pe,disabled:Y,className:"px-4 py-2 text-sm font-medium text-white bg-primary-600 hover:bg-primary-700 disabled:opacity-50 disabled:cursor-not-allowed rounded-lg transition-colors",children:Y?"Saving...":"Save"})]})]})]})}),document.body)]})},bn=({children:n,requireAuth:a=!0,requireAdmin:t=!1})=>{const{isAuthenticated:r,user:i,systemInfo:o,isLoading:s}=pe();return ut(),s?e.jsx("div",{className:"min-h-screen flex items-center justify-center",children:e.jsx("div",{className:"w-8 h-8 border-4 border-gray-200 border-t-blue-500 rounded-full animate-spin"})}):o&&!o.requiresAuth?e.jsx(e.Fragment,{children:n}):a&&!r?e.jsx(It,{to:"/login",replace:!0}):t&&(!i||i.role!=="admin")?e.jsx(It,{to:"/",replace:!0}):e.jsx(e.Fragment,{children:n})},hy=({error:n})=>{const{t:a}=ce();return e.jsx("div",{className:"min-h-screen bg-gray-50 dark:bg-gray-900 flex items-center justify-center p-4",children:e.jsx("div",{className:"max-w-md w-full bg-white dark:bg-gray-800 rounded-lg shadow-lg p-6",children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-red-500 mb-4",children:e.jsx("svg",{className:"mx-auto h-12 w-12",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.732-.833-2.464 0L4.35 16.5c-.77.833.192 2.5 1.732 2.5z"})})}),e.jsx("h1",{className:"text-xl font-bold text-gray-900 dark:text-white mb-2",children:a("errorBoundary.title")}),e.jsx("p",{className:"text-gray-600 dark:text-gray-400 mb-4",children:a("errorBoundary.description")}),e.jsx("button",{onClick:()=>window.location.reload(),className:"bg-blue-500 hover:bg-blue-600 text-white font-medium py-2 px-4 rounded-lg transition-colors",children:a("errorBoundary.tryAgain")}),!1]})})})};class Sa extends h.Component{constructor(a){super(a),this.state={hasError:!1}}static getDerivedStateFromError(a){return{hasError:!0,error:a}}componentDidCatch(a,t){console.error("ErrorBoundary caught an error:",a,t)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:e.jsx(hy,{error:this.state.error}):this.props.children}}const by=(n,a=!0)=>{const t=h.useCallback(r=>{if(!a)return;const i=r.target;if(i.tagName==="INPUT"||i.tagName==="TEXTAREA"||i.contentEditable==="true"||i.isContentEditable)return;if(r.key==="?"||r.key==="/"&&r.shiftKey){const s=n.find(d=>d.key==="?"||d.key==="h");if(s){r.preventDefault(),r.stopPropagation(),s.action();return}}const o=n.find(s=>{const d=s.key.toLowerCase()===r.key.toLowerCase(),u=!!s.metaKey,m=r.metaKey||r.ctrlKey,g=u?m:!0,p=s.ctrlKey?r.ctrlKey:!0,k=!!s.shiftKey===r.shiftKey,x=!!s.altKey===r.altKey;return d&&g&&p&&k&&x});o&&(r.preventDefault(),r.stopPropagation(),o.action())},[n,a]);h.useEffect(()=>{if(a)return document.addEventListener("keydown",t),()=>{document.removeEventListener("keydown",t)}},[t,a])},ky=n=>{const a=[];n.metaKey&&a.push(navigator.platform.includes("Mac")?"⌘":"Ctrl"),n.ctrlKey&&a.push("Ctrl"),n.shiftKey&&a.push("⇧"),n.altKey&&a.push(navigator.platform.includes("Mac")?"⌥":"Alt");let t=n.key.toUpperCase();return n.key===","&&(t=","),n.key===" "&&(t="Space"),n.key==="Enter"&&(t="↩"),n.key==="Escape"&&(t="Esc"),a.push(t),a.join("+")},fy=({isOpen:n,onClose:a,shortcuts:t})=>{const{t:r}=ce();if(!n)return null;const i={navigation:t.filter(o=>o.description.includes("sidebar")||o.description.includes("Toggle")),settings:t.filter(o=>o.description.includes("settings")||o.description.includes("dark mode")),general:t.filter(o=>!o.description.includes("sidebar")&&!o.description.includes("settings")&&!o.description.includes("dark mode")&&!o.description.includes("Toggle"))};return e.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm z-50 flex items-center justify-center p-4",children:e.jsxs("div",{className:"bg-white dark:bg-dark-100 ophelia:bg-[#050505] rounded-xl shadow-2xl w-full max-w-md max-h-[80vh] overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-gray-200 dark:border-dark-300 ophelia:border-[#1a1a1a]",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(In,{className:"h-5 w-5 text-gray-700 dark:text-dark-600 ophelia:text-[#a3a3a3]"}),e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-dark-800 ophelia:text-[#fafafa]",children:r("keyboard.title")})]}),e.jsx(I,{variant:"ghost",size:"sm",onClick:a,className:"h-8 w-8 p-0 hover:bg-gray-100 dark:hover:bg-dark-200",children:e.jsx(Me,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"p-6 space-y-6 overflow-y-auto max-h-[60vh]",children:[Object.entries(i).map(([o,s])=>s.length===0?null:e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium text-gray-700 dark:text-dark-600 mb-3",children:r(`keyboard.groups.${o}`)}),e.jsx("div",{className:"space-y-2",children:s.map((d,u)=>e.jsxs("div",{className:"flex items-center justify-between py-2",children:[e.jsx("span",{className:"text-sm text-gray-600 dark:text-dark-500",children:d.description}),e.jsx("kbd",{className:"px-2 py-1 text-xs font-mono bg-gray-100 dark:bg-dark-200 ophelia:bg-[#121212] text-gray-700 dark:text-dark-600 ophelia:text-[#a3a3a3] rounded border border-gray-300 dark:border-dark-400 ophelia:border-[#262626]",children:ky(d)})]},u))})]},o)),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium text-gray-700 dark:text-dark-600 mb-3",children:r("keyboard.groups.chat")}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between py-2",children:[e.jsx("span",{className:"text-sm text-gray-600 dark:text-dark-500",children:r("keyboard.actions.sendMessage")}),e.jsx("kbd",{className:"px-2 py-1 text-xs font-mono bg-gray-100 dark:bg-dark-200 ophelia:bg-[#121212] text-gray-700 dark:text-dark-600 ophelia:text-[#a3a3a3] rounded border border-gray-300 dark:border-dark-400 ophelia:border-[#262626]",children:"Enter"})]}),e.jsxs("div",{className:"flex items-center justify-between py-2",children:[e.jsx("span",{className:"text-sm text-gray-600 dark:text-dark-500",children:r("keyboard.actions.newLine")}),e.jsx("kbd",{className:"px-2 py-1 text-xs font-mono bg-gray-100 dark:bg-dark-200 ophelia:bg-[#121212] text-gray-700 dark:text-dark-600 ophelia:text-[#a3a3a3] rounded border border-gray-300 dark:border-dark-400 ophelia:border-[#262626]",children:"Shift+Enter"})]})]})]})]}),e.jsx("div",{className:"px-6 py-4 bg-gray-50 dark:bg-dark-200 ophelia:bg-[#0a0a0a] border-t border-gray-200 dark:border-dark-300 ophelia:border-[#1a1a1a]",children:e.jsxs("p",{className:"text-xs text-gray-500 dark:text-dark-400 ophelia:text-[#737373] text-center",children:[r("keyboard.footer",{key1:"?",key2:"H"}).split("?")[0],e.jsx("kbd",{className:"px-1 py-0.5 text-xs font-mono bg-gray-200 dark:bg-dark-300 ophelia:bg-[#1a1a1a] rounded",children:"?"}),r("keyboard.footer",{key1:"?",key2:"H"}).split("?")[1].split("H")[0],e.jsx("kbd",{className:"px-1 py-0.5 text-xs font-mono bg-gray-200 dark:bg-dark-300 ophelia:bg-[#1a1a1a] rounded",children:"H"}),r("keyboard.footer",{key1:"?",key2:"H"}).split("H")[1]]})})]})})},yy=({onClick:n,className:a})=>{const{t}=ce(),[r,i]=h.useState(!1);return e.jsxs(I,{variant:"ghost",size:"sm",onClick:n,onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),className:R("fixed bottom-4 right-4 h-10 w-10 p-0 bg-white/80 dark:bg-dark-100/80 ophelia:bg-[rgba(10,10,10,0.9)] backdrop-blur-sm border border-gray-200 dark:border-dark-300 ophelia:border-[#1a1a1a] shadow-lg hover:shadow-xl transition-all duration-200 z-50","hover:bg-white dark:hover:bg-dark-100 ophelia:hover:bg-[#121212]",a),title:t("keyboard.tooltip"),children:[e.jsx(In,{className:"h-4 w-4"}),r&&e.jsx("div",{className:"absolute bottom-full mb-2 right-0 px-2 py-1 text-xs bg-gray-900 text-white rounded whitespace-nowrap",children:t("keyboard.tooltip")})]})},kn=({message:n="This is a demo version for presentation purposes only. The Ollama backend is not connected.",onDismiss:a,className:t})=>{const[r,i]=h.useState(!1),o=()=>{i(!0),a?.()};return r?null:e.jsx("div",{className:R("bg-gradient-to-r from-amber-50 to-orange-50 dark:from-amber-900/20 dark:to-orange-900/20","border-b border-amber-200 dark:border-amber-800","px-4 py-3",t),children:e.jsxs("div",{className:"flex items-center justify-between max-w-7xl mx-auto",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex-shrink-0",children:e.jsx(Dn,{className:"h-5 w-5 text-amber-600 dark:text-amber-400"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium text-amber-800 dark:text-amber-200",children:"Demo Mode"}),e.jsx("p",{className:"text-xs text-amber-700 dark:text-amber-300 mt-0.5",children:n})]})]}),e.jsxs("div",{className:"flex items-center gap-2 ml-4",children:[e.jsxs(I,{variant:"ghost",size:"sm",className:"text-amber-700 dark:text-amber-300 hover:text-amber-900 dark:hover:text-amber-100 h-8 px-2",onClick:()=>window.open("https://github.com/libre-webui/libre-webui","_blank"),title:"View on GitHub",children:[e.jsx(Ce,{className:"h-4 w-4"}),e.jsx("span",{className:"ml-1 hidden sm:inline",children:"GitHub"})]}),e.jsx(I,{variant:"ghost",size:"sm",onClick:o,className:"text-amber-700 dark:text-amber-300 hover:text-amber-900 dark:hover:text-amber-100 h-8 w-8 p-0",title:"Dismiss",children:e.jsx(Me,{className:"h-4 w-4"})})]})]})})},fn=()=>{const{preferences:n,backgroundImage:a}=be(),t=n.backgroundSettings||{enabled:!1,imageUrl:"",blurAmount:10,opacity:.6},r=a||t.imageUrl;return!t.enabled||!r?null:e.jsx("div",{className:"fixed inset-0 pointer-events-none z-0",style:{backgroundImage:`url(${r})`,backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat",filter:`blur(${t.blurAmount}px)`,opacity:t.opacity,transform:"scale(1.1)"}})},vy=320,yn=.9,xy=600,Sy=()=>{const{t:n}=ce(),{artifactPanelOpen:a,artifactPanelArtifact:t,closeArtifactPanel:r,theme:i}=be(),[o,s]=h.useState(!1),[d,u]=h.useState("preview"),[m,g]=h.useState(xy),[p,k]=h.useState(!1),x=h.useRef(null),b=h.useRef(null),w=h.useRef(null),S=h.useRef(0),F=h.useRef(0),L=t?.id??null;L!==w.current&&(w.current=L,d!=="preview"&&u("preview"));const D=h.useCallback(T=>{T.preventDefault(),k(!0),F.current=m,S.current="touches"in T?T.touches[0].clientX:T.clientX},[m]),A=h.useCallback(T=>{if(!p)return;const H="touches"in T?T.touches[0].clientX:T.clientX,_=S.current-H,Pe=window.innerWidth*yn,De=Math.min(Pe,Math.max(vy,F.current+_));g(De)},[p]),N=h.useCallback(()=>{k(!1)},[]);if(h.useEffect(()=>(p&&(window.addEventListener("mousemove",A),window.addEventListener("mouseup",N),window.addEventListener("touchmove",A),window.addEventListener("touchend",N),document.body.style.userSelect="none",document.body.style.cursor="col-resize"),()=>{window.removeEventListener("mousemove",A),window.removeEventListener("mouseup",N),window.removeEventListener("touchmove",A),window.removeEventListener("touchend",N),document.body.style.userSelect="",document.body.style.cursor=""}),[p,A,N]),h.useEffect(()=>{const T=()=>{const H=window.innerWidth*yn;m>H&&g(H)};return window.addEventListener("resize",T),()=>window.removeEventListener("resize",T)},[m]),h.useEffect(()=>{const T=H=>{H.key==="Escape"&&a&&r()};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[a,r]),h.useEffect(()=>{const T=_=>{p||b.current&&!b.current.contains(_.target)&&a&&r()},H=setTimeout(()=>{window.addEventListener("mousedown",T)},100);return()=>{clearTimeout(H),window.removeEventListener("mousedown",T)}},[a,r,p]),!t)return null;const P=t,U=async T=>{try{await navigator.clipboard.writeText(T),s(!0),setTimeout(()=>s(!1),2e3)}catch(H){console.error("Failed to copy:",H)}},q=()=>{const T=new Blob([P.content],{type:K(P.type)}),H=URL.createObjectURL(T),_=document.createElement("a");_.href=H,_.download=`${P.title}.${O(P.type)}`,document.body.appendChild(_),_.click(),document.body.removeChild(_),URL.revokeObjectURL(H)},K=T=>{switch(T){case"html":return"text/html";case"react":return"text/javascript";case"svg":return"image/svg+xml";case"css":return"text/css";case"json":return"application/json";default:return"text/plain"}},O=T=>{switch(T){case"html":return"html";case"react":return"jsx";case"svg":return"svg";case"css":return"css";case"json":return"json";default:return"txt"}},E=()=>{switch(P.type){case"html":return e.jsx(mt,{className:"h-5 w-5"});case"react":return e.jsx(Ht,{className:"h-5 w-5"});case"svg":return e.jsx(Gt,{className:"h-5 w-5"});case"code":return e.jsx(Ht,{className:"h-5 w-5"});default:return e.jsx(Gt,{className:"h-5 w-5"})}},G=()=>{const T=`
29
29
  <!DOCTYPE html>
30
30
  <html>
31
31
  <head>
@@ -48,4 +48,4 @@ SYSTEM You are a helpful assistant.`,docs:"Modelfile 文档",docsLink:"语法参
48
48
  ${P.content}
49
49
  </body>
50
50
  </html>
51
- `;return e.jsx("iframe",{ref:x,srcDoc:T,className:"w-full h-full border-0 rounded-lg bg-white",sandbox:"allow-scripts allow-same-origin",title:P.title})},c=()=>{try{return e.jsx("div",{className:"w-full h-full flex items-center justify-center bg-gray-50 dark:bg-dark-100 ophelia:bg-[#0a0a0a] rounded-lg overflow-auto p-4",dangerouslySetInnerHTML:{__html:P.content}})}catch{return e.jsx("div",{className:"w-full h-full flex items-center justify-center bg-gray-50 dark:bg-dark-100 ophelia:bg-[#0a0a0a] rounded-lg",children:e.jsxs("div",{className:"text-center",children:[e.jsx(tt,{className:"h-8 w-8 text-red-500 mx-auto mb-2"}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 ophelia:text-[#a3a3a3]",children:n("artifacts.invalidSvg")})]})})}},$=()=>{const T=()=>{if(P.language)return P.language;switch(P.type){case"html":return"html";case"react":return"jsx";case"svg":return"xml";case"json":return"json";default:return"text"}};return e.jsx("div",{className:"h-full overflow-auto",children:e.jsx(pn,{language:T(),isDark:i.mode==="dark"||i.mode==="ophelia",className:"!m-0 !rounded-lg !h-full",children:P.content})})},ue=()=>{try{const T=JSON.parse(P.content),H=JSON.stringify(T,null,2);return e.jsx("div",{className:"h-full overflow-auto",children:e.jsx(pn,{language:"json",isDark:i.mode==="dark"||i.mode==="ophelia",className:"!m-0 !rounded-lg !h-full",children:H})})}catch{return e.jsx("div",{className:"w-full h-full flex items-center justify-center bg-gray-50 dark:bg-dark-100 ophelia:bg-[#0a0a0a] rounded-lg",children:e.jsxs("div",{className:"text-center",children:[e.jsx(tt,{className:"h-8 w-8 text-red-500 mx-auto mb-2"}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 ophelia:text-[#a3a3a3]",children:n("artifacts.invalidJson")})]})})}},V=()=>{if(d==="code")return $();switch(P.type){case"html":return G();case"svg":return c();case"json":return ue();default:return $()}},Y=()=>P.type==="html"||P.type==="svg"||P.type==="react",J=typeof window<"u"&&window.innerWidth<640,me=J?"100%":`${m}px`,ne=e.jsxs(e.Fragment,{children:[e.jsx("div",{className:R("fixed inset-0 bg-black/30 dark:bg-black/50 ophelia:bg-black/60 z-40 transition-opacity duration-300",a?"opacity-100":"opacity-0 pointer-events-none")}),e.jsxs("div",{ref:b,style:{width:me},className:R("fixed top-0 right-0 h-full z-50","bg-white dark:bg-dark-25 ophelia:bg-[#050505]","shadow-2xl border-l border-gray-200 dark:border-dark-200 ophelia:border-[#1a1a1a]","flex flex-col","transform transition-transform duration-300 ease-out",a?"translate-x-0":"translate-x-full"),children:[!J&&e.jsxs("div",{onMouseDown:D,onTouchStart:D,className:R("absolute left-0 top-0 bottom-0 w-4 -ml-2 cursor-col-resize z-10","flex items-center justify-center","group"),children:[e.jsx("div",{className:R("w-1 h-16 rounded-full transition-all duration-200","bg-gray-300 dark:bg-dark-300 ophelia:bg-[#262626]","group-hover:bg-primary-500 group-hover:h-24",p&&"bg-primary-500 h-24")}),e.jsx("div",{className:R("absolute left-1/2 -translate-x-1/2 opacity-0 group-hover:opacity-100 transition-opacity","text-gray-400 dark:text-dark-500 ophelia:text-[#525252]",p&&"opacity-100"),children:e.jsx(ri,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-gray-200 dark:border-dark-200 ophelia:border-[#1a1a1a]",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[e.jsx("div",{className:"text-gray-600 dark:text-gray-400 ophelia:text-[#a3a3a3] flex-shrink-0",children:E()}),e.jsx("h2",{className:"font-semibold text-gray-900 dark:text-gray-100 ophelia:text-[#fafafa] truncate",children:P.title}),e.jsx("span",{className:"text-xs bg-primary-50 dark:bg-primary-900/20 ophelia:bg-[rgba(147,51,234,0.2)] text-primary-700 dark:text-primary-300 ophelia:text-[#c084fc] px-2 py-1 rounded-full font-medium flex-shrink-0",children:P.type.toUpperCase()})]}),e.jsx(I,{variant:"ghost",size:"sm",onClick:r,className:"h-8 w-8 p-0 hover:bg-gray-100 dark:hover:bg-dark-200 ophelia:hover:bg-[#121212] flex-shrink-0",title:n("artifacts.closePanelEsc"),children:e.jsx(Me,{className:"h-5 w-5"})})]}),e.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b border-gray-100 dark:border-dark-200 ophelia:border-[#1a1a1a] bg-gray-50 dark:bg-dark-100/50 ophelia:bg-[#0a0a0a]",children:[e.jsx("div",{className:"flex items-center gap-1",children:Y()&&e.jsxs(e.Fragment,{children:[e.jsxs(I,{variant:d==="preview"?"primary":"ghost",size:"sm",onClick:()=>u("preview"),className:"h-8 px-3 text-xs",title:n("artifacts.previewMode"),children:[e.jsx(Ee,{className:"h-3.5 w-3.5 mr-1.5"}),n("artifacts.preview")]}),e.jsxs(I,{variant:d==="code"?"primary":"ghost",size:"sm",onClick:()=>u("code"),className:"h-8 px-3 text-xs",title:n("artifacts.codeMode"),children:[e.jsx(ii,{className:"h-3.5 w-3.5 mr-1.5"}),n("artifacts.code")]})]})}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(I,{variant:"ghost",size:"sm",onClick:()=>U(P.content),className:"h-8 px-3 text-xs hover:bg-gray-100 dark:hover:bg-dark-200 ophelia:hover:bg-[#121212]",title:n("artifacts.copyContent"),children:o?e.jsxs(e.Fragment,{children:[e.jsx(Se,{className:"h-3.5 w-3.5 mr-1.5 text-green-500"}),n("artifacts.copied")]}):e.jsxs(e.Fragment,{children:[e.jsx(Cn,{className:"h-3.5 w-3.5 mr-1.5"}),n("artifacts.copyButton")]})}),e.jsxs(I,{variant:"ghost",size:"sm",onClick:q,className:"h-8 px-3 text-xs hover:bg-gray-100 dark:hover:bg-dark-200 ophelia:hover:bg-[#121212]",title:n("artifacts.download"),children:[e.jsx(An,{className:"h-3.5 w-3.5 mr-1.5"}),n("artifacts.download")]}),(P.type==="html"||P.type==="react")&&e.jsxs(I,{variant:"ghost",size:"sm",onClick:()=>{const T=window.open("","_blank");T&&(T.document.write(P.content),T.document.close())},className:"h-8 px-3 text-xs hover:bg-gray-100 dark:hover:bg-dark-200 ophelia:hover:bg-[#121212]",title:n("artifacts.openInNewWindow"),children:[e.jsx(Ce,{className:"h-3.5 w-3.5 mr-1.5"}),n("artifacts.open")]})]})]}),P.description&&e.jsx("div",{className:"px-4 py-3 border-b border-gray-100 dark:border-dark-200 ophelia:border-[#1a1a1a]",children:e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 ophelia:text-[#a3a3a3]",children:P.description})}),e.jsx("div",{className:"flex-1 p-4 overflow-hidden",children:V()}),e.jsx("div",{className:"px-4 py-2 border-t border-gray-100 dark:border-dark-200 ophelia:border-[#1a1a1a] bg-gray-50 dark:bg-dark-100/50 ophelia:bg-[#0a0a0a]",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"text-xs text-gray-500 dark:text-gray-400 ophelia:text-[#737373]",children:[n("artifacts.created"),":"," ",new Date(P.createdAt).toLocaleString()]}),!J&&e.jsx("div",{className:"text-xs text-gray-400 dark:text-dark-500 ophelia:text-[#525252]",children:n("artifacts.dragEdgeToResize")})]})})]})]});return Mn.createPortal(ne,document.body)},Da=({className:n,size:a="md"})=>{const t={sm:"text-xl",md:"text-3xl",lg:"text-5xl"};return e.jsx("span",{className:R("libre-brand text-gray-900 dark:text-gray-100 ophelia:text-[#fafafa]",t[a],n),children:"Libre"})};class _n{static async initializeAuth(){const{setLoading:a,setSystemInfo:t,login:r}=pe.getState();try{a(!0),console.log("🔐 Starting auth initialization..."),console.log("📡 Fetching system info...");const i=await Te.getSystemInfo();console.log("📡 System info response:",i),i.success&&i.data?(console.log("✅ Setting system info:",i.data),t(i.data)):console.error("❌ System info response failed:",i);const o=localStorage.getItem("auth-token");if(o)try{const s=(await he(async()=>{const{default:m}=await import("../js/utils-vendor-DEeF42mN.js").then(g=>g.i);return{default:m}},__vite__mapDeps([0,1,2]))).default,d=s.defaults.headers.common;s.defaults.headers.common.Authorization=`Bearer ${o}`;const u=await Te.verifyToken();if(u.success&&u.data){const m=pe.getState().systemInfo;m&&r(u.data,o,m)}s.defaults.headers.common=d}catch(s){console.error("Token verification failed:",s),localStorage.removeItem("auth-token")}}catch(i){console.error("Auth initialization error:",i)}finally{a(!1)}}}const wy=()=>{nt.interceptors.request.use(n=>{const a=localStorage.getItem("auth-token");return a&&(n.headers.Authorization=`Bearer ${a}`),n},n=>Promise.reject(n)),nt.interceptors.response.use(n=>n,n=>{if(n.response?.status===401){localStorage.removeItem("auth-token");const{logout:a}=pe.getState();a(),window.location.href="/login"}return Promise.reject(n)})};wy();const Py=Object.freeze(Object.defineProperty({__proto__:null,UserService:_n},Symbol.toStringTag,{value:"Module"})),My=()=>{const n=h.useRef(!1),{loadSessions:a,loadModels:t,loadPreferences:r,setSelectedModel:i,models:o}=Ne(),{loadPreferences:s}=be(),{loadPlugins:d,plugins:u}=gt();h.useEffect(()=>{if(n.current)return;(async()=>{try{if(n.current=!0,await _n.initializeAuth(),!(await Fe.checkHealth()).success)if(v()){await Promise.all([s(),r()]),await Promise.all([t(),a(),d()]);return}else{z.error("Ollama service is not available. Please make sure it's running.");return}await Promise.all([s(),r()]),await Promise.all([t(),a(),d()])}catch(g){v()?(await Promise.all([s(),r()]),await Promise.all([t(),a(),d()])):(console.error("Failed to initialize app:",g),z.error("Failed to connect to the backend service"))}})()},[s,r,t,a,d]),h.useEffect(()=>{if(o.length>0){const{selectedModel:m}=Ne.getState();m&&o.map(p=>p.name).includes(m)||i(o[0].name)}},[o,i]),h.useEffect(()=>{u.filter(g=>g.active).length>0&&t()},[u,t])},Yn=()=>{const{t:n}=ce(),[a,t]=h.useState(!1),[r,i]=h.useState(!1);h.useEffect(()=>{(async()=>{try{const d=await fetch(`${ke}/auth/oauth/github/status`,{method:"GET",credentials:"include"});if(d.ok){const u=await d.json();i(u.configured||!1),console.log("GitHub OAuth configured:",u.configured)}else console.log("GitHub OAuth status check failed"),i(!1)}catch(d){console.log("GitHub OAuth not configured:",d),i(!1)}})()},[]);const o=()=>{if(!r||a)return;t(!0);const s=`${ke}/auth/oauth/github`;window.location.href=s};return r?e.jsx("button",{type:"button",onClick:o,disabled:a,className:"w-full flex items-center justify-center px-4 py-2 border border-gray-300 dark:border-dark-300 rounded-lg shadow-sm bg-white dark:bg-dark-100 text-gray-700 dark:text-dark-700 hover:bg-gray-50 dark:hover:bg-dark-150 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 disabled:opacity-50 disabled:cursor-not-allowed transition-colors duration-200",children:a?e.jsxs("div",{className:"flex items-center",children:[e.jsx(qe,{size:16,className:"animate-spin mr-2"}),n("auth.oauth.connectingTo",{provider:n("auth.oauth.github")})]}):e.jsxs("div",{className:"flex items-center",children:[e.jsx(jn,{size:16,className:"mr-2"}),n("auth.oauth.continueWith",{provider:n("auth.oauth.github")})]})}):null},Dy=()=>{const{t:n}=ce(),[a,t]=h.useState(!1),[r,i]=h.useState(!1);h.useEffect(()=>{(async()=>{try{const d=await fetch(`${ke}/auth/oauth/huggingface/status`,{method:"GET",credentials:"include"});if(d.ok){const u=await d.json();i(u.configured||!1),console.log("Hugging Face OAuth configured:",u.configured)}else console.log("Hugging Face OAuth status check failed"),i(!1)}catch(d){console.log("Hugging Face OAuth not configured:",d),i(!1)}})()},[]);const o=()=>{if(!r||a)return;t(!0);const s=`${ke}/auth/oauth/huggingface`;window.location.href=s};return r?e.jsx("button",{type:"button",onClick:o,disabled:a,className:"w-full flex items-center justify-center px-4 py-2 border border-orange-300 dark:border-orange-600 rounded-lg shadow-sm bg-orange-50 dark:bg-orange-900/20 text-orange-700 dark:text-orange-300 hover:bg-orange-100 dark:hover:bg-orange-900/30 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-orange-500 disabled:opacity-50 disabled:cursor-not-allowed transition-colors duration-200",children:a?e.jsxs("div",{className:"flex items-center",children:[e.jsx(qe,{size:16,className:"animate-spin mr-2"}),n("auth.oauth.connectingTo",{provider:n("auth.oauth.huggingFace")})]}):e.jsxs("div",{className:"flex items-center",children:[e.jsx("span",{className:"mr-2 text-base",children:"🤗"}),n("auth.oauth.continueWith",{provider:n("auth.oauth.huggingFace")})]})}):null},jy=({onLogin:n,onShowSignup:a})=>{const{t}=ce(),[r,i]=h.useState(""),[o,s]=h.useState(""),[d,u]=h.useState(!1),[m,g]=h.useState(!1),p=Ia(),{login:k}=pe(),x=async w=>{if(w.preventDefault(),!r.trim()||!o.trim()){Q.error(t("auth.login.enterBoth"));return}g(!0);try{localStorage.removeItem("auth-token");const S=await Te.login({username:r,password:o});S.success&&S.data?(k(S.data.user,S.data.token,S.data.systemInfo),Q.success(t("auth.login.loginSuccess")),n?.(),p("/")):Q.error(S.message||t("auth.login.loginFailed"))}catch(S){console.error("Login error:",S),Q.error(t("auth.login.checkCredentials"))}finally{g(!1)}},b=w=>{if(w.key==="Enter"){const S=w.currentTarget.form;S&&S.requestSubmit()}};return e.jsxs("div",{className:"w-full max-w-md mx-auto bg-white dark:bg-dark-25 rounded-xl shadow-card hover:shadow-card-hover transition-shadow duration-200 p-6 border border-gray-200 dark:border-dark-200",children:[e.jsxs("div",{className:"text-center mb-6",children:[e.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-dark-950 mb-2",children:t("auth.login.title")}),e.jsx("p",{className:"text-gray-600 dark:text-dark-500",children:t("auth.login.subtitle")})]}),e.jsxs("form",{onSubmit:x,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"username",className:"block text-sm font-medium text-gray-700 dark:text-dark-700 mb-2",children:t("auth.login.username")}),e.jsx("input",{id:"username",type:"text",value:r,onChange:w=>i(w.target.value),onKeyDown:b,className:"w-full px-3 py-2 border border-gray-200 dark:border-dark-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-accent-500 focus:border-accent-500 bg-white dark:bg-dark-200 text-gray-900 dark:text-dark-800 placeholder:text-gray-400 dark:placeholder:text-dark-500 transition-colors duration-200",placeholder:t("auth.login.usernamePlaceholder"),required:!0,disabled:m})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"password",className:"block text-sm font-medium text-gray-700 dark:text-dark-700 mb-2",children:t("auth.login.password")}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{id:"password",type:d?"text":"password",value:o,onChange:w=>s(w.target.value),onKeyDown:b,className:"w-full px-3 py-2 pr-10 border border-gray-200 dark:border-dark-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-accent-500 focus:border-accent-500 bg-white dark:bg-dark-200 text-gray-900 dark:text-dark-800 placeholder:text-gray-400 dark:placeholder:text-dark-500 transition-colors duration-200",placeholder:t("auth.login.passwordPlaceholder"),required:!0,disabled:m}),e.jsx("button",{type:"button",onClick:()=>u(!d),className:"absolute inset-y-0 right-0 pr-3 flex items-center text-gray-400 hover:text-gray-600 dark:text-dark-500 dark:hover:text-dark-700",disabled:m,children:d?e.jsx(Je,{size:20}):e.jsx(Ee,{size:20})})]})]}),e.jsx("button",{type:"submit",disabled:m,className:"w-full flex items-center justify-center px-4 py-2 border border-transparent rounded-lg shadow-sm text-sm font-medium text-white bg-primary-600 hover:bg-primary-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 disabled:opacity-50 disabled:cursor-not-allowed transition-colors duration-200",children:m?e.jsxs("div",{className:"flex items-center",children:[e.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2"}),t("auth.login.signingIn")]}):e.jsxs("div",{className:"flex items-center",children:[e.jsx(oi,{size:16,className:"mr-2"}),t("auth.login.signIn")]})})]}),e.jsxs("div",{className:"mt-6",children:[e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute inset-0 flex items-center",children:e.jsx("div",{className:"w-full border-t border-gray-300 dark:border-dark-300"})}),e.jsx("div",{className:"relative flex justify-center text-sm",children:e.jsx("span",{className:"px-2 bg-white dark:bg-dark-25 text-gray-500 dark:text-dark-500",children:t("common.or")})})]}),e.jsxs("div",{className:"mt-6 space-y-3",children:[e.jsx(Yn,{}),e.jsx(Dy,{})]})]}),e.jsx("div",{className:"mt-6 text-center",children:e.jsxs("p",{className:"text-sm text-gray-600 dark:text-dark-500",children:[t("auth.login.noAccount")," ",e.jsx("button",{onClick:()=>a?.(),className:"text-primary-500 hover:text-primary-600 dark:text-primary-400 dark:hover:text-primary-300 font-medium transition-colors duration-200",children:t("auth.login.signUpHere")})]})}),e.jsx("div",{className:"mt-4 text-center",children:e.jsxs("p",{className:"text-xs text-gray-500 dark:text-dark-500",children:[t("common.mode"),": ",t("common.multiUser")]})})]})},Ay=({onSignup:n,onBackToLogin:a})=>{const{t}=ce(),[r,i]=h.useState(""),[o,s]=h.useState(""),[d,u]=h.useState(""),[m,g]=h.useState(""),[p,k]=h.useState(!1),[x,b]=h.useState(!1),[w,S]=h.useState(!1),F=Ia(),{login:L}=pe(),D=async N=>{if(N.preventDefault(),!r.trim()||!d.trim()){Q.error(t("auth.signup.usernameRequired"));return}if(d!==m){Q.error(t("auth.signup.passwordMismatch"));return}if(d.length<6){Q.error(t("auth.signup.passwordTooShort"));return}S(!0);try{const P=await Te.signup({username:r,password:d,email:o});P.success&&P.data?(L(P.data.user,P.data.token,P.data.systemInfo),Q.success(t("auth.signup.signupSuccess")),n?.(),F("/")):Q.error(P.message||t("auth.signup.signupFailed"))}catch(P){console.error("Signup error:",P),Q.error(t("auth.signup.tryAgain"))}finally{S(!1)}},A=N=>{if(N.key==="Enter"){const P=N.currentTarget.form;P&&P.requestSubmit()}};return e.jsxs("div",{className:"w-full max-w-md mx-auto bg-white dark:bg-dark-25 rounded-xl shadow-card hover:shadow-card-hover transition-shadow duration-200 p-6 border border-gray-200 dark:border-dark-200",children:[e.jsxs("div",{className:"text-center mb-6",children:[e.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-dark-950 mb-2",children:t("auth.signup.title")}),e.jsx("p",{className:"text-gray-600 dark:text-dark-500",children:t("auth.signup.subtitle")})]}),e.jsxs("form",{onSubmit:D,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"username",className:"block text-sm font-medium text-gray-700 dark:text-dark-700 mb-2",children:t("auth.signup.username")}),e.jsx("input",{id:"username",type:"text",value:r,onChange:N=>i(N.target.value),onKeyDown:A,className:"w-full px-3 py-2 border border-gray-200 dark:border-dark-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-accent-500 focus:border-accent-500 bg-white dark:bg-dark-200 text-gray-900 dark:text-dark-800 placeholder:text-gray-400 dark:placeholder:text-dark-500 transition-colors duration-200",placeholder:t("auth.signup.usernamePlaceholder"),required:!0,disabled:w})]}),e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"email",className:"block text-sm font-medium text-gray-700 dark:text-dark-700 mb-2",children:[t("auth.signup.email")," ",e.jsxs("span",{className:"text-gray-400",children:["(",t("common.optional"),")"]})]}),e.jsx("input",{id:"email",type:"email",value:o,onChange:N=>s(N.target.value),onKeyDown:A,className:"w-full px-3 py-2 border border-gray-200 dark:border-dark-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-accent-500 focus:border-accent-500 bg-white dark:bg-dark-200 text-gray-900 dark:text-dark-800 placeholder:text-gray-400 dark:placeholder:text-dark-500 transition-colors duration-200",placeholder:t("auth.signup.emailPlaceholder"),disabled:w})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"password",className:"block text-sm font-medium text-gray-700 dark:text-dark-700 mb-2",children:t("auth.signup.password")}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{id:"password",type:p?"text":"password",value:d,onChange:N=>u(N.target.value),onKeyDown:A,className:"w-full px-3 py-2 pr-10 border border-gray-200 dark:border-dark-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-accent-500 focus:border-accent-500 bg-white dark:bg-dark-200 text-gray-900 dark:text-dark-800 placeholder:text-gray-400 dark:placeholder:text-dark-500 transition-colors duration-200",placeholder:t("auth.signup.passwordPlaceholder"),required:!0,disabled:w}),e.jsx("button",{type:"button",onClick:()=>k(!p),className:"absolute inset-y-0 right-0 pr-3 flex items-center text-gray-400 hover:text-gray-600 dark:text-dark-500 dark:hover:text-dark-700",disabled:w,children:p?e.jsx(Je,{size:20}):e.jsx(Ee,{size:20})})]})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"confirmPassword",className:"block text-sm font-medium text-gray-700 dark:text-dark-700 mb-2",children:t("auth.signup.confirmPassword")}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{id:"confirmPassword",type:x?"text":"password",value:m,onChange:N=>g(N.target.value),onKeyDown:A,className:"w-full px-3 py-2 pr-10 border border-gray-200 dark:border-dark-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-accent-500 focus:border-accent-500 bg-white dark:bg-dark-200 text-gray-900 dark:text-dark-800 placeholder:text-gray-400 dark:placeholder:text-dark-500 transition-colors duration-200",placeholder:t("auth.signup.confirmPasswordPlaceholder"),required:!0,disabled:w}),e.jsx("button",{type:"button",onClick:()=>b(!x),className:"absolute inset-y-0 right-0 pr-3 flex items-center text-gray-400 hover:text-gray-600 dark:text-dark-500 dark:hover:text-dark-700",disabled:w,children:x?e.jsx(Je,{size:20}):e.jsx(Ee,{size:20})})]})]}),e.jsx("button",{type:"submit",disabled:w,className:"w-full flex items-center justify-center px-4 py-2 border border-transparent rounded-lg shadow-sm text-sm font-medium text-white bg-primary-600 hover:bg-primary-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 disabled:opacity-50 disabled:cursor-not-allowed transition-colors duration-200",children:w?e.jsxs("div",{className:"flex items-center",children:[e.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2"}),t("auth.signup.creatingAccount")]}):e.jsxs("div",{className:"flex items-center",children:[e.jsx(Fn,{size:16,className:"mr-2"}),t("auth.signup.createAccount")]})})]}),e.jsx(Yn,{}),e.jsx("div",{className:"mt-6 text-center",children:e.jsxs("p",{className:"text-sm text-gray-600 dark:text-dark-500",children:[t("auth.signup.hasAccount")," ",e.jsx("button",{onClick:a,className:"text-primary-500 hover:text-primary-600 dark:text-primary-400 dark:hover:text-primary-300 font-medium transition-colors duration-200",children:t("auth.signup.signInHere")})]})}),e.jsx("div",{className:"mt-4 text-center",children:e.jsxs("p",{className:"text-xs text-gray-500 dark:text-dark-500",children:[t("common.mode"),": ",t("common.multiUser")]})})]})},vn=()=>{const n=Ia(),{isAuthenticated:a,requiresAuth:t}=pe(),[r,i]=h.useState(!1);return h.useEffect(()=>{a&&n("/")},[a,n]),t()?e.jsxs("div",{className:"min-h-screen bg-gray-50 dark:bg-dark-50 flex flex-col justify-center py-12 sm:px-6 lg:px-8",children:[e.jsx("div",{className:"sm:mx-auto sm:w-full sm:max-w-md",children:e.jsx("h2",{className:"libre-brand text-center text-4xl sm:text-5xl font-normal text-gray-900 dark:text-gray-100",style:{fontWeight:400,letterSpacing:"0.01em"},children:"Libre WebUI"})}),e.jsx("div",{className:"mt-8 sm:mx-auto sm:w-full sm:max-w-md",children:r?e.jsx(Ay,{onBackToLogin:()=>i(!1),onSignup:()=>i(!1)}):e.jsx(jy,{onShowSignup:()=>i(!0)})})]}):(n("/"),null)},zy=({onComplete:n})=>{const{t:a}=ce(),[t,r]=h.useState("welcome"),[i,o]=h.useState(""),[s,d]=h.useState(""),[u,m]=h.useState(""),[g,p]=h.useState(!1),[k,x]=h.useState(!1),[b,w]=h.useState(!1),[S,F]=h.useState(null),[L,D]=h.useState(!1),[A,N]=h.useState(!1),{login:P}=pe();h.useEffect(()=>{t==="encryption-key"&&!S&&Te.getEncryptionKey().then(E=>{E.success&&E.data&&F(E.data.encryptionKey)})},[t,S]);const U=async E=>{if(E.preventDefault(),!i.trim()||!s.trim()||!u.trim()){Q.error(a("setup.admin.fillAllFields"));return}if(s!==u){Q.error(a("auth.signup.passwordMismatch"));return}if(s.length<6){Q.error(a("auth.signup.passwordTooShort"));return}w(!0);try{const G=await Te.signup({username:i,password:s,email:""});G.success&&G.data?(P(G.data.user,G.data.token,G.data.systemInfo),Q.success(a("setup.admin.success")),r("encryption-key")):Q.error(G.message||a("setup.admin.failed"))}catch(G){console.error("Admin creation error:",G),Q.error(a("setup.admin.failed"))}finally{w(!1)}},q=async()=>{if(S)try{await navigator.clipboard.writeText(S),D(!0),Q.success(a("setup.encryptionKey.copied")),setTimeout(()=>D(!1),3e3)}catch{Q.error(a("setup.encryptionKey.copyFailed"))}},K=()=>{if(!A){Q.error(a("setup.encryptionKey.confirmRequired"));return}n?.()},O=E=>{if(E.key==="Enter"){const G=E.currentTarget.form;G&&G.requestSubmit()}};return t==="welcome"?e.jsxs("div",{className:"min-h-screen bg-gray-50 dark:bg-dark-50 flex flex-col justify-center py-12 sm:px-6 lg:px-8",children:[e.jsxs("div",{className:"sm:mx-auto sm:w-full sm:max-w-md",children:[e.jsx("div",{className:"flex justify-center",children:e.jsx(Da,{})}),e.jsx("h2",{className:"libre-brand mt-6 text-center text-2xl sm:text-3xl font-normal text-gray-900 dark:text-gray-100",style:{fontWeight:300,letterSpacing:"0.01em"},children:a("setup.welcome.title")})]}),e.jsx("div",{className:"mt-8 sm:mx-auto sm:w-full sm:max-w-md",children:e.jsxs("div",{className:"w-full max-w-md mx-auto bg-white dark:bg-dark-25 rounded-xl shadow-card hover:shadow-card-hover transition-shadow duration-200 p-6 border border-gray-200 dark:border-dark-200",children:[e.jsxs("div",{className:"text-center mb-6",children:[e.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-dark-950 mb-2",children:a("setup.welcome.subtitle")}),e.jsx("p",{className:"text-gray-600 dark:text-dark-500",children:a("setup.welcome.description")})]}),e.jsxs("div",{className:"space-y-4 mb-6",children:[e.jsxs("div",{className:"flex items-start space-x-3",children:[e.jsx("div",{className:"flex-shrink-0 mt-1",children:e.jsx(Tn,{className:"h-5 w-5 text-primary-600 dark:text-primary-400"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium text-gray-900 dark:text-dark-950",children:a("setup.welcome.features.secure.title")}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-dark-500",children:a("setup.welcome.features.secure.description")})]})]}),e.jsxs("div",{className:"flex items-start space-x-3",children:[e.jsx("div",{className:"flex-shrink-0 mt-1",children:e.jsx(si,{className:"h-5 w-5 text-primary-600 dark:text-primary-400"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium text-gray-900 dark:text-dark-950",children:a("setup.welcome.features.fast.title")}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-dark-500",children:a("setup.welcome.features.fast.description")})]})]}),e.jsxs("div",{className:"flex items-start space-x-3",children:[e.jsx("div",{className:"flex-shrink-0 mt-1",children:e.jsx(mt,{className:"h-5 w-5 text-primary-600 dark:text-primary-400"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium text-gray-900 dark:text-dark-950",children:a("setup.welcome.features.openSource.title")}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-dark-500",children:a("setup.welcome.features.openSource.description")})]})]})]}),e.jsx("button",{onClick:()=>r("create-admin"),className:"w-full flex items-center justify-center px-4 py-2 border border-transparent rounded-lg shadow-sm text-sm font-medium text-white bg-primary-600 hover:bg-primary-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 transition-colors duration-200",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx("span",{children:a("setup.welcome.createAdmin")}),e.jsx(Rt,{size:16,className:"ml-2"})]})})]})})]}):t==="encryption-key"?e.jsxs("div",{className:"min-h-screen bg-gray-50 dark:bg-dark-50 flex flex-col justify-center py-12 sm:px-6 lg:px-8",children:[e.jsxs("div",{className:"sm:mx-auto sm:w-full sm:max-w-md",children:[e.jsx("div",{className:"flex justify-center",children:e.jsx(Da,{})}),e.jsx("h2",{className:"libre-brand mt-6 text-center text-2xl sm:text-3xl font-normal text-gray-900 dark:text-gray-100",style:{fontWeight:300,letterSpacing:"0.01em"},children:a("setup.encryptionKey.title")})]}),e.jsx("div",{className:"mt-8 sm:mx-auto sm:w-full sm:max-w-lg",children:e.jsxs("div",{className:"w-full max-w-lg mx-auto bg-white dark:bg-dark-25 rounded-xl shadow-card hover:shadow-card-hover transition-shadow duration-200 p-6 border border-gray-200 dark:border-dark-200",children:[e.jsxs("div",{className:"text-center mb-6",children:[e.jsx("div",{className:"flex justify-center mb-4",children:e.jsx("div",{className:"p-3 bg-amber-100 dark:bg-amber-900/30 rounded-full",children:e.jsx(at,{className:"h-8 w-8 text-amber-600 dark:text-amber-400"})})}),e.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-dark-950 mb-2",children:a("setup.encryptionKey.subtitle")}),e.jsx("p",{className:"text-gray-600 dark:text-dark-500",children:a("setup.encryptionKey.description")})]}),e.jsx("div",{className:"mb-6 p-4 bg-amber-50 dark:bg-amber-900/20 border border-amber-200 dark:border-amber-800 rounded-lg",children:e.jsxs("div",{className:"flex items-start space-x-3",children:[e.jsx(tt,{className:"h-5 w-5 text-amber-600 dark:text-amber-400 flex-shrink-0 mt-0.5"}),e.jsxs("div",{className:"text-sm text-amber-800 dark:text-amber-200",children:[e.jsx("p",{className:"font-medium mb-1",children:a("setup.encryptionKey.warning")}),e.jsx("p",{children:a("setup.encryptionKey.warningText")})]})]})}),e.jsxs("div",{className:"mb-6",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-dark-700 mb-2",children:a("setup.encryptionKey.label")}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"w-full px-3 py-3 pr-12 border border-gray-300 dark:border-dark-300 rounded-lg bg-gray-50 dark:bg-dark-100 font-mono text-sm text-gray-900 dark:text-dark-800 break-all",children:S||a("setup.encryptionKey.loading")}),e.jsx("button",{type:"button",onClick:q,disabled:!S,className:"absolute right-2 top-1/2 -translate-y-1/2 p-2 text-gray-500 hover:text-gray-700 dark:text-dark-500 dark:hover:text-dark-700 disabled:opacity-50",title:a("setup.encryptionKey.copyToClipboard"),children:L?e.jsx(Se,{className:"h-5 w-5 text-green-500"}):e.jsx(Cn,{className:"h-5 w-5"})})]}),e.jsx("p",{className:"mt-2 text-xs text-gray-500 dark:text-dark-500",children:a("setup.encryptionKey.envNote")})]}),e.jsx("div",{className:"mb-6",children:e.jsxs("label",{className:"flex items-start space-x-3 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:A,onChange:E=>N(E.target.checked),className:"mt-1 h-4 w-4 text-primary-600 focus:ring-primary-500 border-gray-300 dark:border-dark-300 rounded"}),e.jsx("span",{className:"text-sm text-gray-700 dark:text-dark-700",children:a("setup.encryptionKey.acknowledgment")})]})}),e.jsx("button",{onClick:K,disabled:!A,className:"w-full flex items-center justify-center px-4 py-2 border border-transparent rounded-lg shadow-sm text-sm font-medium text-white bg-primary-600 hover:bg-primary-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 disabled:opacity-50 disabled:cursor-not-allowed transition-colors duration-200",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx("span",{children:a("setup.encryptionKey.continue")}),e.jsx(Rt,{size:16,className:"ml-2"})]})})]})})]}):e.jsxs("div",{className:"min-h-screen bg-gray-50 dark:bg-dark-50 flex flex-col justify-center py-12 sm:px-6 lg:px-8",children:[e.jsxs("div",{className:"sm:mx-auto sm:w-full sm:max-w-md",children:[e.jsx("div",{className:"flex justify-center",children:e.jsx(Da,{})}),e.jsx("h2",{className:"libre-brand mt-6 text-center text-2xl sm:text-3xl font-normal text-gray-900 dark:text-gray-100",style:{fontWeight:300,letterSpacing:"0.01em"},children:a("setup.admin.title")})]}),e.jsx("div",{className:"mt-8 sm:mx-auto sm:w-full sm:max-w-md",children:e.jsxs("div",{className:"w-full max-w-md mx-auto bg-white dark:bg-dark-25 rounded-xl shadow-card hover:shadow-card-hover transition-shadow duration-200 p-6 border border-gray-200 dark:border-dark-200",children:[e.jsxs("div",{className:"text-center mb-6",children:[e.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-dark-950 mb-2",children:a("setup.admin.subtitle")}),e.jsx("p",{className:"text-gray-600 dark:text-dark-500",children:a("setup.admin.description")})]}),e.jsxs("form",{onSubmit:U,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"username",className:"block text-sm font-medium text-gray-700 dark:text-dark-700 mb-2",children:a("auth.login.username")}),e.jsx("input",{id:"username",type:"text",value:i,onChange:E=>o(E.target.value),onKeyDown:O,className:"w-full px-3 py-2 border border-gray-300 dark:border-dark-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500 bg-white dark:bg-dark-100 text-gray-900 dark:text-dark-800 transition-colors duration-200",placeholder:a("setup.admin.usernamePlaceholder"),required:!0,disabled:b})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"password",className:"block text-sm font-medium text-gray-700 dark:text-dark-700 mb-2",children:a("auth.login.password")}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{id:"password",type:g?"text":"password",value:s,onChange:E=>d(E.target.value),onKeyDown:O,className:"w-full px-3 py-2 pr-10 border border-gray-300 dark:border-dark-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500 bg-white dark:bg-dark-100 text-gray-900 dark:text-dark-800 transition-colors duration-200",placeholder:a("setup.admin.passwordPlaceholder"),required:!0,disabled:b}),e.jsx("button",{type:"button",onClick:()=>p(!g),className:"absolute inset-y-0 right-0 pr-3 flex items-center text-gray-400 hover:text-gray-600 dark:text-dark-500 dark:hover:text-dark-700",disabled:b,children:g?e.jsx(Je,{size:20}):e.jsx(Ee,{size:20})})]})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"confirmPassword",className:"block text-sm font-medium text-gray-700 dark:text-dark-700 mb-2",children:a("auth.signup.confirmPassword")}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{id:"confirmPassword",type:k?"text":"password",value:u,onChange:E=>m(E.target.value),onKeyDown:O,className:"w-full px-3 py-2 pr-10 border border-gray-300 dark:border-dark-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500 bg-white dark:bg-dark-100 text-gray-900 dark:text-dark-800 transition-colors duration-200",placeholder:a("setup.admin.confirmPlaceholder"),required:!0,disabled:b}),e.jsx("button",{type:"button",onClick:()=>x(!k),className:"absolute inset-y-0 right-0 pr-3 flex items-center text-gray-400 hover:text-gray-600 dark:text-dark-500 dark:hover:text-dark-700",disabled:b,children:k?e.jsx(Je,{size:20}):e.jsx(Ee,{size:20})})]})]}),e.jsxs("div",{className:"flex space-x-3",children:[e.jsx("button",{type:"button",onClick:()=>r("welcome"),disabled:b,className:"flex-1 px-4 py-2 border border-gray-300 dark:border-dark-300 rounded-lg shadow-sm text-sm font-medium text-gray-700 dark:text-dark-700 bg-white dark:bg-dark-100 hover:bg-gray-50 dark:hover:bg-dark-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 disabled:opacity-50 disabled:cursor-not-allowed transition-colors duration-200",children:a("common.back")}),e.jsx("button",{type:"submit",disabled:b,className:"flex-1 flex items-center justify-center px-4 py-2 border border-transparent rounded-lg shadow-sm text-sm font-medium text-white bg-primary-600 hover:bg-primary-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 disabled:opacity-50 disabled:cursor-not-allowed transition-colors duration-200",children:b?e.jsxs("div",{className:"flex items-center",children:[e.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2"}),a("setup.admin.creating")]}):e.jsxs("div",{className:"flex items-center",children:[e.jsx(Fn,{size:16,className:"mr-2"}),a("setup.admin.createAdmin")]})})]})]}),e.jsx("div",{className:"mt-6 text-center",children:e.jsx("p",{className:"text-xs text-gray-500 dark:text-dark-500",children:a("setup.admin.note")})})]})})]})},Ny=window.location.protocol==="file:"?Gr:Hr,Ty=window.location.protocol==="file:",xn=()=>Ty?e.jsx("div",{className:"absolute top-0 left-0 right-0 h-8 z-50",style:{WebkitAppRegion:"drag"}}):null,We=le.lazy(()=>he(()=>import("../js/ChatPage-BpA7Kkgb.js"),__vite__mapDeps([3,4,2,1,5,6,0]))),Sn=le.lazy(()=>he(()=>import("../js/ModelsPage-BPjn0auW.js"),__vite__mapDeps([7,4,2,1,5,0]))),wn=le.lazy(()=>he(()=>import("../js/PersonasPage-BR3S_Lfk.js"),__vite__mapDeps([8,4,2,1,5,0]))),Iy=le.lazy(()=>he(()=>import("../js/GalleryPage-MWy5qimI.js"),__vite__mapDeps([9,4,2,1,5,0]))),Cy=le.lazy(()=>he(()=>import("../js/UserManagementPage-DMYq0zvJ.js"),__vite__mapDeps([10,4,2,1,5,0]))),Fy=le.lazy(()=>he(()=>import("../js/ArtifactDemoPage-BlajO5pZ.js"),__vite__mapDeps([11,4,2,1,6,5,0]))),Pn=()=>{const{t:n}=ce();return e.jsx("div",{className:"flex items-center justify-center h-full min-h-screen",children:e.jsxs("div",{className:"flex flex-col items-center gap-3",children:[e.jsx("div",{className:"w-8 h-8 border-4 border-gray-200 border-t-blue-500 rounded-full animate-spin"}),e.jsx("div",{className:"text-gray-600 dark:text-dark-600",children:n("common.loading")})]})})},Ey=({onClick:n})=>{const a=ut();return a.pathname==="/"||a.pathname==="/chat"||a.pathname.startsWith("/c/")?e.jsx("div",{className:"hidden lg:block",children:e.jsx(yy,{onClick:n})}):null},Oy=()=>{const{t:n,i18n:a}=ce();le.useEffect(()=>{const V=Wf(a.language)?"rtl":"ltr";document.documentElement.dir=V,document.documentElement.lang=a.language},[a.language]);const[t,r]=h.useState(!1),[i,o]=h.useState(!1),[s,d]=h.useState(0),[u,m]=h.useState(!1),[g,p]=h.useState(!1),{sidebarOpen:k,sidebarCompact:x,setSidebarOpen:b,setSidebarCompact:w,toggleSidebar:S,toggleSidebarCompact:F,toggleTheme:L,backgroundImage:D,preferences:A}=be(),{systemInfo:N,isLoading:P,user:U,isAuthenticated:q}=pe(),{isDemoMode:K,demoConfig:O}=be(),[E,G]=le.useState(!1),c=le.useRef(!1);le.useEffect(()=>{(async()=>{if(c.current){console.log("OAuth already processing, skipping...");return}console.log("Starting OAuth callback processing..."),c.current=!0;const Y=new URLSearchParams(window.location.search),J=Y.get("token"),me=Y.get("auth");if(J&&me==="success"){try{const ne=await fetch(`${ke}/auth/me`,{headers:{Authorization:`Bearer ${J}`},credentials:"include"});if(ne.ok){const T=await ne.json();if(T.success&&T.data){const{login:H,systemInfo:_}=pe.getState();H(T.data,J,_||{requiresAuth:!0,singleUserMode:!1,hasUsers:!0,version:"0.1.6"}),console.log("OAuth login successful, showing toast"),z.success("GitHub login successful!")}else z.error("Failed to verify GitHub authentication")}else z.error("GitHub authentication verification failed")}catch(ne){console.error("OAuth processing error:",ne),z.error("GitHub authentication failed")}window.history.replaceState({},document.title,window.location.pathname)}console.log("OAuth processing completed"),G(!0),c.current=!1})()},[]),My();const $=()=>{if(D)return!0;const V=A.backgroundSettings;return V?.enabled&&V?.imageUrl},ue=[{key:"b",metaKey:!0,action:()=>{window.innerWidth>=1024?k?F():(w(!1),S()):(!k&&x&&w(!1),S())},description:n("keyboard.toggleSidebar")},{key:",",metaKey:!0,action:()=>r(!0),description:n("keyboard.openSettings")},{key:"d",metaKey:!0,action:L,description:n("keyboard.toggleDarkMode")},{key:"h",action:()=>o(!0),description:n("keyboard.showShortcuts")},{key:"Escape",action:()=>{r(!1),o(!1)},description:n("keyboard.closeModals")}];return by(ue),le.useEffect(()=>(da.connect().catch(console.error),()=>{da.disconnect()}),[]),le.useEffect(()=>{if(!N&&!P&&s<15){const V=setTimeout(async()=>{d(Y=>Y+1);try{const{UserService:Y}=await he(async()=>{const{UserService:J}=await Promise.resolve().then(()=>Py);return{UserService:J}},void 0);await Y.initializeAuth()}catch{}},2e3);return()=>clearTimeout(V)}},[N,P,s]),le.useEffect(()=>{N&&N.requiresAuth&&!N.hasUsers&&!u&&p(!0)},[N,u]),P?e.jsxs("div",{className:"min-h-screen bg-gray-50 dark:bg-dark-50 flex flex-col justify-center py-12 sm:px-6 lg:px-8",children:[e.jsxs("div",{className:"sm:mx-auto sm:w-full sm:max-w-md",children:[e.jsx("div",{className:"flex justify-center",children:e.jsx(Da,{})}),e.jsx("h2",{className:"libre-brand mt-6 text-center text-2xl sm:text-3xl font-normal text-gray-900 dark:text-gray-100",style:{fontWeight:300,letterSpacing:"0.01em"},children:"Libre WebUI"})]}),e.jsx("div",{className:"mt-8 flex flex-col items-center gap-4",children:e.jsx("div",{className:"w-8 h-8 border-4 border-gray-300 dark:border-gray-600 border-t-primary-500 dark:border-t-primary-400 rounded-full animate-spin"})})]}):N?g&&!u?e.jsx(Sa,{children:e.jsx(zy,{onComplete:()=>{m(!0),p(!1)}})}):E?e.jsx(Sa,{children:e.jsxs(Ny,{children:[N&&!N.requiresAuth?e.jsxs("div",{className:R("flex h-screen text-gray-900 dark:text-dark-800 relative",$()?"bg-white/40 dark:bg-dark-50/40":"bg-white dark:bg-dark-50"),children:[e.jsx(xn,{}),e.jsx(fn,{}),e.jsx(hn,{isOpen:k,onClose:()=>b(!1)}),e.jsxs("div",{className:R("flex-1 flex flex-col min-w-0 transition-all duration-300 ease-in-out relative z-10","w-full",k?x?"lg:ml-16":"lg:ml-80":"lg:ml-0",k&&x?"max-lg:ml-16":"max-lg:ml-0",$()?"bg-white/30 dark:bg-dark-50/30":"bg-white dark:bg-dark-50"),children:[K&&O.showBanner&&e.jsx(kn,{message:O.message}),e.jsx("main",{className:R("flex-1 overflow-hidden",$()?"bg-white/20 dark:bg-dark-50/20 backdrop-blur-sm":"bg-gray-50 dark:bg-dark-100"),children:e.jsx(Sa,{children:e.jsx(h.Suspense,{fallback:e.jsx(Pn,{}),children:e.jsxs(Ja,{children:[e.jsx(ie,{path:"/",element:e.jsx(We,{})}),e.jsx(ie,{path:"/chat",element:e.jsx(We,{})}),e.jsx(ie,{path:"/c/:sessionId",element:e.jsx(We,{})}),e.jsx(ie,{path:"/models",element:e.jsx(Sn,{})}),e.jsx(ie,{path:"/personas",element:e.jsx(wn,{})}),e.jsx(ie,{path:"/login",element:e.jsx(vn,{})})]})})})})]})]}):e.jsxs(Ja,{children:[e.jsx(ie,{path:"/login",element:e.jsx(vn,{})}),e.jsx(ie,{path:"/*",element:e.jsx(bn,{children:e.jsxs("div",{className:R("flex h-screen text-gray-900 dark:text-dark-800 relative",$()?"bg-white/40 dark:bg-dark-50/40":"bg-white dark:bg-dark-50"),children:[e.jsx(xn,{}),e.jsx(fn,{}),e.jsx(hn,{isOpen:k,onClose:()=>b(!1)}),e.jsxs("div",{className:R("flex-1 flex flex-col min-w-0 transition-all duration-300 ease-in-out relative z-10","w-full",k?x?"lg:ml-16":"lg:ml-80":"lg:ml-0",k&&x?"max-lg:ml-16":"max-lg:ml-0",$()?"bg-white/30 dark:bg-dark-50/30":"bg-white dark:bg-dark-50"),children:[K&&O.showBanner&&e.jsx(kn,{message:O.message}),e.jsx("main",{className:R("flex-1 overflow-hidden",$()?"bg-white/20 dark:bg-dark-50/20 backdrop-blur-sm":"bg-gray-50 dark:bg-dark-100"),children:e.jsx(Sa,{children:e.jsx(h.Suspense,{fallback:e.jsx(Pn,{}),children:e.jsxs(Ja,{children:[e.jsx(ie,{path:"/",element:e.jsx(We,{})}),e.jsx(ie,{path:"/chat",element:e.jsx(We,{})}),e.jsx(ie,{path:"/c/:sessionId",element:e.jsx(We,{})}),e.jsx(ie,{path:"/models",element:e.jsx(Sn,{})}),e.jsx(ie,{path:"/personas",element:e.jsx(wn,{})}),e.jsx(ie,{path:"/gallery",element:e.jsx(Iy,{})}),e.jsx(ie,{path:"/artifacts",element:e.jsx(Fy,{})}),e.jsx(ie,{path:"/users",element:e.jsx(bn,{requireAdmin:!0,children:e.jsx(Cy,{})})})]})})})})]})]})})})]}),e.jsx(Jn,{isOpen:t,onClose:()=>r(!1)}),e.jsx(fy,{isOpen:i,onClose:()=>o(!1),shortcuts:ue}),e.jsx(Ey,{onClick:()=>o(!0)}),e.jsx(Sy,{}),e.jsx(li,{position:"top-right",toastOptions:{duration:4e3,className:"animate-slide-up",style:{background:"var(--toast-bg)",color:"var(--toast-color)",border:"1px solid var(--toast-border)",borderRadius:"0.75rem",boxShadow:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",cursor:"pointer"},success:{iconTheme:{primary:"#16a34a",secondary:"#ffffff"}},error:{iconTheme:{primary:"#ef4444",secondary:"#ffffff"}}},containerStyle:{top:80,right:20}})]})}):e.jsx("div",{className:"min-h-screen bg-gray-50 dark:bg-dark-50 flex items-center justify-center",children:e.jsx("div",{className:"w-8 h-8 border-4 border-gray-300 dark:border-gray-600 border-t-primary-500 dark:border-t-primary-400 rounded-full animate-spin"})}):e.jsx("div",{className:"min-h-screen bg-dark-50 flex items-center justify-center p-4",children:e.jsxs("div",{className:"text-center",children:[e.jsx("h1",{className:"libre-brand text-5xl text-white mb-8",style:{fontWeight:400,letterSpacing:"0.02em"},children:"Libre"}),e.jsx("div",{className:"flex justify-center mb-4",children:e.jsx("div",{className:"w-8 h-8 border-3 border-gray-700 border-t-primary-500 rounded-full animate-spin"})}),e.jsx("p",{className:"text-gray-500 text-sm",children:s>0?`Connecting to backend... (${s}/15)`:"Starting up..."})]})})};pi.createRoot(document.getElementById("root")).render(e.jsx(le.StrictMode,{children:e.jsx(Oy,{})}));export{my as A,I as B,Yf as I,pn as O,xe as S,$n as T,ce as a,pe as b,R as c,Ne as d,dt as e,qf as f,pt as g,ze as h,ct as i,Jf as j,qn as k,Fe as o,Uy as p,la as t,be as u,da as w};
51
+ `;return e.jsx("iframe",{ref:x,srcDoc:T,className:"w-full h-full border-0 rounded-lg bg-white",sandbox:"allow-scripts allow-same-origin",title:P.title})},c=()=>{try{return e.jsx("div",{className:"w-full h-full flex items-center justify-center bg-gray-50 dark:bg-dark-100 ophelia:bg-[#0a0a0a] rounded-lg overflow-auto p-4",dangerouslySetInnerHTML:{__html:P.content}})}catch{return e.jsx("div",{className:"w-full h-full flex items-center justify-center bg-gray-50 dark:bg-dark-100 ophelia:bg-[#0a0a0a] rounded-lg",children:e.jsxs("div",{className:"text-center",children:[e.jsx(tt,{className:"h-8 w-8 text-red-500 mx-auto mb-2"}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 ophelia:text-[#a3a3a3]",children:n("artifacts.invalidSvg")})]})})}},$=()=>{const T=()=>{if(P.language)return P.language;switch(P.type){case"html":return"html";case"react":return"jsx";case"svg":return"xml";case"json":return"json";default:return"text"}};return e.jsx("div",{className:"h-full overflow-auto",children:e.jsx(pn,{language:T(),isDark:i.mode==="dark"||i.mode==="ophelia",className:"!m-0 !rounded-lg !h-full",children:P.content})})},ue=()=>{try{const T=JSON.parse(P.content),H=JSON.stringify(T,null,2);return e.jsx("div",{className:"h-full overflow-auto",children:e.jsx(pn,{language:"json",isDark:i.mode==="dark"||i.mode==="ophelia",className:"!m-0 !rounded-lg !h-full",children:H})})}catch{return e.jsx("div",{className:"w-full h-full flex items-center justify-center bg-gray-50 dark:bg-dark-100 ophelia:bg-[#0a0a0a] rounded-lg",children:e.jsxs("div",{className:"text-center",children:[e.jsx(tt,{className:"h-8 w-8 text-red-500 mx-auto mb-2"}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 ophelia:text-[#a3a3a3]",children:n("artifacts.invalidJson")})]})})}},V=()=>{if(d==="code")return $();switch(P.type){case"html":return G();case"svg":return c();case"json":return ue();default:return $()}},Y=()=>P.type==="html"||P.type==="svg"||P.type==="react",J=typeof window<"u"&&window.innerWidth<640,me=J?"100%":`${m}px`,ne=e.jsxs(e.Fragment,{children:[e.jsx("div",{className:R("fixed inset-0 bg-black/30 dark:bg-black/50 ophelia:bg-black/60 z-40 transition-opacity duration-300",a?"opacity-100":"opacity-0 pointer-events-none")}),e.jsxs("div",{ref:b,style:{width:me},className:R("fixed top-0 right-0 h-full z-50","bg-white dark:bg-dark-25 ophelia:bg-[#050505]","shadow-2xl border-l border-gray-200 dark:border-dark-200 ophelia:border-[#1a1a1a]","flex flex-col","transform transition-transform duration-300 ease-out",a?"translate-x-0":"translate-x-full"),children:[!J&&e.jsxs("div",{onMouseDown:D,onTouchStart:D,className:R("absolute left-0 top-0 bottom-0 w-4 -ml-2 cursor-col-resize z-10","flex items-center justify-center","group"),children:[e.jsx("div",{className:R("w-1 h-16 rounded-full transition-all duration-200","bg-gray-300 dark:bg-dark-300 ophelia:bg-[#262626]","group-hover:bg-primary-500 group-hover:h-24",p&&"bg-primary-500 h-24")}),e.jsx("div",{className:R("absolute left-1/2 -translate-x-1/2 opacity-0 group-hover:opacity-100 transition-opacity","text-gray-400 dark:text-dark-500 ophelia:text-[#525252]",p&&"opacity-100"),children:e.jsx(ri,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"flex items-center justify-between p-4 border-b border-gray-200 dark:border-dark-200 ophelia:border-[#1a1a1a]",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[e.jsx("div",{className:"text-gray-600 dark:text-gray-400 ophelia:text-[#a3a3a3] flex-shrink-0",children:E()}),e.jsx("h2",{className:"font-semibold text-gray-900 dark:text-gray-100 ophelia:text-[#fafafa] truncate",children:P.title}),e.jsx("span",{className:"text-xs bg-primary-50 dark:bg-primary-900/20 ophelia:bg-[rgba(147,51,234,0.2)] text-primary-700 dark:text-primary-300 ophelia:text-[#c084fc] px-2 py-1 rounded-full font-medium flex-shrink-0",children:P.type.toUpperCase()})]}),e.jsx(I,{variant:"ghost",size:"sm",onClick:r,className:"h-8 w-8 p-0 hover:bg-gray-100 dark:hover:bg-dark-200 ophelia:hover:bg-[#121212] flex-shrink-0",title:n("artifacts.closePanelEsc"),children:e.jsx(Me,{className:"h-5 w-5"})})]}),e.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b border-gray-100 dark:border-dark-200 ophelia:border-[#1a1a1a] bg-gray-50 dark:bg-dark-100/50 ophelia:bg-[#0a0a0a]",children:[e.jsx("div",{className:"flex items-center gap-1",children:Y()&&e.jsxs(e.Fragment,{children:[e.jsxs(I,{variant:d==="preview"?"primary":"ghost",size:"sm",onClick:()=>u("preview"),className:"h-8 px-3 text-xs",title:n("artifacts.previewMode"),children:[e.jsx(Ee,{className:"h-3.5 w-3.5 mr-1.5"}),n("artifacts.preview")]}),e.jsxs(I,{variant:d==="code"?"primary":"ghost",size:"sm",onClick:()=>u("code"),className:"h-8 px-3 text-xs",title:n("artifacts.codeMode"),children:[e.jsx(ii,{className:"h-3.5 w-3.5 mr-1.5"}),n("artifacts.code")]})]})}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(I,{variant:"ghost",size:"sm",onClick:()=>U(P.content),className:"h-8 px-3 text-xs hover:bg-gray-100 dark:hover:bg-dark-200 ophelia:hover:bg-[#121212]",title:n("artifacts.copyContent"),children:o?e.jsxs(e.Fragment,{children:[e.jsx(Se,{className:"h-3.5 w-3.5 mr-1.5 text-green-500"}),n("artifacts.copied")]}):e.jsxs(e.Fragment,{children:[e.jsx(Cn,{className:"h-3.5 w-3.5 mr-1.5"}),n("artifacts.copyButton")]})}),e.jsxs(I,{variant:"ghost",size:"sm",onClick:q,className:"h-8 px-3 text-xs hover:bg-gray-100 dark:hover:bg-dark-200 ophelia:hover:bg-[#121212]",title:n("artifacts.download"),children:[e.jsx(An,{className:"h-3.5 w-3.5 mr-1.5"}),n("artifacts.download")]}),(P.type==="html"||P.type==="react")&&e.jsxs(I,{variant:"ghost",size:"sm",onClick:()=>{const T=window.open("","_blank");T&&(T.document.write(P.content),T.document.close())},className:"h-8 px-3 text-xs hover:bg-gray-100 dark:hover:bg-dark-200 ophelia:hover:bg-[#121212]",title:n("artifacts.openInNewWindow"),children:[e.jsx(Ce,{className:"h-3.5 w-3.5 mr-1.5"}),n("artifacts.open")]})]})]}),P.description&&e.jsx("div",{className:"px-4 py-3 border-b border-gray-100 dark:border-dark-200 ophelia:border-[#1a1a1a]",children:e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 ophelia:text-[#a3a3a3]",children:P.description})}),e.jsx("div",{className:"flex-1 p-4 overflow-hidden",children:V()}),e.jsx("div",{className:"px-4 py-2 border-t border-gray-100 dark:border-dark-200 ophelia:border-[#1a1a1a] bg-gray-50 dark:bg-dark-100/50 ophelia:bg-[#0a0a0a]",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"text-xs text-gray-500 dark:text-gray-400 ophelia:text-[#737373]",children:[n("artifacts.created"),":"," ",new Date(P.createdAt).toLocaleString()]}),!J&&e.jsx("div",{className:"text-xs text-gray-400 dark:text-dark-500 ophelia:text-[#525252]",children:n("artifacts.dragEdgeToResize")})]})})]})]});return Mn.createPortal(ne,document.body)},Da=({className:n,size:a="md"})=>{const t={sm:"text-xl",md:"text-3xl",lg:"text-5xl"};return e.jsx("span",{className:R("libre-brand text-gray-900 dark:text-gray-100 ophelia:text-[#fafafa]",t[a],n),children:"Libre"})};class _n{static async initializeAuth(){const{setLoading:a,setSystemInfo:t,login:r}=pe.getState();try{a(!0),console.log("🔐 Starting auth initialization..."),console.log("📡 Fetching system info...");const i=await Te.getSystemInfo();console.log("📡 System info response:",i),i.success&&i.data?(console.log("✅ Setting system info:",i.data),t(i.data)):console.error("❌ System info response failed:",i);const o=localStorage.getItem("auth-token");if(o)try{const s=(await he(async()=>{const{default:m}=await import("../js/utils-vendor-COrKO_vV.js").then(g=>g.i);return{default:m}},__vite__mapDeps([0,1]))).default,d=s.defaults.headers.common;s.defaults.headers.common.Authorization=`Bearer ${o}`;const u=await Te.verifyToken();if(u.success&&u.data){const m=pe.getState().systemInfo;m&&r(u.data,o,m)}s.defaults.headers.common=d}catch(s){console.error("Token verification failed:",s),localStorage.removeItem("auth-token")}}catch(i){console.error("Auth initialization error:",i)}finally{a(!1)}}}const wy=()=>{nt.interceptors.request.use(n=>{const a=localStorage.getItem("auth-token");return a&&(n.headers.Authorization=`Bearer ${a}`),n},n=>Promise.reject(n)),nt.interceptors.response.use(n=>n,n=>{if(n.response?.status===401){localStorage.removeItem("auth-token");const{logout:a}=pe.getState();a(),window.location.href="/login"}return Promise.reject(n)})};wy();const Py=Object.freeze(Object.defineProperty({__proto__:null,UserService:_n},Symbol.toStringTag,{value:"Module"})),My=()=>{const n=h.useRef(!1),{loadSessions:a,loadModels:t,loadPreferences:r,setSelectedModel:i,models:o}=Ne(),{loadPreferences:s}=be(),{loadPlugins:d,plugins:u}=gt();h.useEffect(()=>{if(n.current)return;(async()=>{try{if(n.current=!0,await _n.initializeAuth(),!(await Fe.checkHealth()).success)if(v()){await Promise.all([s(),r()]),await Promise.all([t(),a(),d()]);return}else{z.error("Ollama service is not available. Please make sure it's running.");return}await Promise.all([s(),r()]),await Promise.all([t(),a(),d()])}catch(g){v()?(await Promise.all([s(),r()]),await Promise.all([t(),a(),d()])):(console.error("Failed to initialize app:",g),z.error("Failed to connect to the backend service"))}})()},[s,r,t,a,d]),h.useEffect(()=>{if(o.length>0){const{selectedModel:m}=Ne.getState();m&&o.map(p=>p.name).includes(m)||i(o[0].name)}},[o,i]),h.useEffect(()=>{u.filter(g=>g.active).length>0&&t()},[u,t])},Yn=()=>{const{t:n}=ce(),[a,t]=h.useState(!1),[r,i]=h.useState(!1);h.useEffect(()=>{(async()=>{try{const d=await fetch(`${ke}/auth/oauth/github/status`,{method:"GET",credentials:"include"});if(d.ok){const u=await d.json();i(u.configured||!1),console.log("GitHub OAuth configured:",u.configured)}else console.log("GitHub OAuth status check failed"),i(!1)}catch(d){console.log("GitHub OAuth not configured:",d),i(!1)}})()},[]);const o=()=>{if(!r||a)return;t(!0);const s=`${ke}/auth/oauth/github`;window.location.href=s};return r?e.jsx("button",{type:"button",onClick:o,disabled:a,className:"w-full flex items-center justify-center px-4 py-2 border border-gray-300 dark:border-dark-300 rounded-lg shadow-sm bg-white dark:bg-dark-100 text-gray-700 dark:text-dark-700 hover:bg-gray-50 dark:hover:bg-dark-150 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 disabled:opacity-50 disabled:cursor-not-allowed transition-colors duration-200",children:a?e.jsxs("div",{className:"flex items-center",children:[e.jsx(qe,{size:16,className:"animate-spin mr-2"}),n("auth.oauth.connectingTo",{provider:n("auth.oauth.github")})]}):e.jsxs("div",{className:"flex items-center",children:[e.jsx(jn,{size:16,className:"mr-2"}),n("auth.oauth.continueWith",{provider:n("auth.oauth.github")})]})}):null},Dy=()=>{const{t:n}=ce(),[a,t]=h.useState(!1),[r,i]=h.useState(!1);h.useEffect(()=>{(async()=>{try{const d=await fetch(`${ke}/auth/oauth/huggingface/status`,{method:"GET",credentials:"include"});if(d.ok){const u=await d.json();i(u.configured||!1),console.log("Hugging Face OAuth configured:",u.configured)}else console.log("Hugging Face OAuth status check failed"),i(!1)}catch(d){console.log("Hugging Face OAuth not configured:",d),i(!1)}})()},[]);const o=()=>{if(!r||a)return;t(!0);const s=`${ke}/auth/oauth/huggingface`;window.location.href=s};return r?e.jsx("button",{type:"button",onClick:o,disabled:a,className:"w-full flex items-center justify-center px-4 py-2 border border-orange-300 dark:border-orange-600 rounded-lg shadow-sm bg-orange-50 dark:bg-orange-900/20 text-orange-700 dark:text-orange-300 hover:bg-orange-100 dark:hover:bg-orange-900/30 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-orange-500 disabled:opacity-50 disabled:cursor-not-allowed transition-colors duration-200",children:a?e.jsxs("div",{className:"flex items-center",children:[e.jsx(qe,{size:16,className:"animate-spin mr-2"}),n("auth.oauth.connectingTo",{provider:n("auth.oauth.huggingFace")})]}):e.jsxs("div",{className:"flex items-center",children:[e.jsx("span",{className:"mr-2 text-base",children:"🤗"}),n("auth.oauth.continueWith",{provider:n("auth.oauth.huggingFace")})]})}):null},jy=({onLogin:n,onShowSignup:a})=>{const{t}=ce(),[r,i]=h.useState(""),[o,s]=h.useState(""),[d,u]=h.useState(!1),[m,g]=h.useState(!1),p=Ia(),{login:k}=pe(),x=async w=>{if(w.preventDefault(),!r.trim()||!o.trim()){Q.error(t("auth.login.enterBoth"));return}g(!0);try{localStorage.removeItem("auth-token");const S=await Te.login({username:r,password:o});S.success&&S.data?(k(S.data.user,S.data.token,S.data.systemInfo),Q.success(t("auth.login.loginSuccess")),n?.(),p("/")):Q.error(S.message||t("auth.login.loginFailed"))}catch(S){console.error("Login error:",S),Q.error(t("auth.login.checkCredentials"))}finally{g(!1)}},b=w=>{if(w.key==="Enter"){const S=w.currentTarget.form;S&&S.requestSubmit()}};return e.jsxs("div",{className:"w-full max-w-md mx-auto bg-white dark:bg-dark-25 rounded-xl shadow-card hover:shadow-card-hover transition-shadow duration-200 p-6 border border-gray-200 dark:border-dark-200",children:[e.jsxs("div",{className:"text-center mb-6",children:[e.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-dark-950 mb-2",children:t("auth.login.title")}),e.jsx("p",{className:"text-gray-600 dark:text-dark-500",children:t("auth.login.subtitle")})]}),e.jsxs("form",{onSubmit:x,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"username",className:"block text-sm font-medium text-gray-700 dark:text-dark-700 mb-2",children:t("auth.login.username")}),e.jsx("input",{id:"username",type:"text",value:r,onChange:w=>i(w.target.value),onKeyDown:b,className:"w-full px-3 py-2 border border-gray-200 dark:border-dark-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-accent-500 focus:border-accent-500 bg-white dark:bg-dark-200 text-gray-900 dark:text-dark-800 placeholder:text-gray-400 dark:placeholder:text-dark-500 transition-colors duration-200",placeholder:t("auth.login.usernamePlaceholder"),required:!0,disabled:m})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"password",className:"block text-sm font-medium text-gray-700 dark:text-dark-700 mb-2",children:t("auth.login.password")}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{id:"password",type:d?"text":"password",value:o,onChange:w=>s(w.target.value),onKeyDown:b,className:"w-full px-3 py-2 pr-10 border border-gray-200 dark:border-dark-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-accent-500 focus:border-accent-500 bg-white dark:bg-dark-200 text-gray-900 dark:text-dark-800 placeholder:text-gray-400 dark:placeholder:text-dark-500 transition-colors duration-200",placeholder:t("auth.login.passwordPlaceholder"),required:!0,disabled:m}),e.jsx("button",{type:"button",onClick:()=>u(!d),className:"absolute inset-y-0 right-0 pr-3 flex items-center text-gray-400 hover:text-gray-600 dark:text-dark-500 dark:hover:text-dark-700",disabled:m,children:d?e.jsx(Je,{size:20}):e.jsx(Ee,{size:20})})]})]}),e.jsx("button",{type:"submit",disabled:m,className:"w-full flex items-center justify-center px-4 py-2 border border-transparent rounded-lg shadow-sm text-sm font-medium text-white bg-primary-600 hover:bg-primary-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 disabled:opacity-50 disabled:cursor-not-allowed transition-colors duration-200",children:m?e.jsxs("div",{className:"flex items-center",children:[e.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2"}),t("auth.login.signingIn")]}):e.jsxs("div",{className:"flex items-center",children:[e.jsx(oi,{size:16,className:"mr-2"}),t("auth.login.signIn")]})})]}),e.jsxs("div",{className:"mt-6",children:[e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute inset-0 flex items-center",children:e.jsx("div",{className:"w-full border-t border-gray-300 dark:border-dark-300"})}),e.jsx("div",{className:"relative flex justify-center text-sm",children:e.jsx("span",{className:"px-2 bg-white dark:bg-dark-25 text-gray-500 dark:text-dark-500",children:t("common.or")})})]}),e.jsxs("div",{className:"mt-6 space-y-3",children:[e.jsx(Yn,{}),e.jsx(Dy,{})]})]}),e.jsx("div",{className:"mt-6 text-center",children:e.jsxs("p",{className:"text-sm text-gray-600 dark:text-dark-500",children:[t("auth.login.noAccount")," ",e.jsx("button",{onClick:()=>a?.(),className:"text-primary-500 hover:text-primary-600 dark:text-primary-400 dark:hover:text-primary-300 font-medium transition-colors duration-200",children:t("auth.login.signUpHere")})]})}),e.jsx("div",{className:"mt-4 text-center",children:e.jsxs("p",{className:"text-xs text-gray-500 dark:text-dark-500",children:[t("common.mode"),": ",t("common.multiUser")]})})]})},Ay=({onSignup:n,onBackToLogin:a})=>{const{t}=ce(),[r,i]=h.useState(""),[o,s]=h.useState(""),[d,u]=h.useState(""),[m,g]=h.useState(""),[p,k]=h.useState(!1),[x,b]=h.useState(!1),[w,S]=h.useState(!1),F=Ia(),{login:L}=pe(),D=async N=>{if(N.preventDefault(),!r.trim()||!d.trim()){Q.error(t("auth.signup.usernameRequired"));return}if(d!==m){Q.error(t("auth.signup.passwordMismatch"));return}if(d.length<6){Q.error(t("auth.signup.passwordTooShort"));return}S(!0);try{const P=await Te.signup({username:r,password:d,email:o});P.success&&P.data?(L(P.data.user,P.data.token,P.data.systemInfo),Q.success(t("auth.signup.signupSuccess")),n?.(),F("/")):Q.error(P.message||t("auth.signup.signupFailed"))}catch(P){console.error("Signup error:",P),Q.error(t("auth.signup.tryAgain"))}finally{S(!1)}},A=N=>{if(N.key==="Enter"){const P=N.currentTarget.form;P&&P.requestSubmit()}};return e.jsxs("div",{className:"w-full max-w-md mx-auto bg-white dark:bg-dark-25 rounded-xl shadow-card hover:shadow-card-hover transition-shadow duration-200 p-6 border border-gray-200 dark:border-dark-200",children:[e.jsxs("div",{className:"text-center mb-6",children:[e.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-dark-950 mb-2",children:t("auth.signup.title")}),e.jsx("p",{className:"text-gray-600 dark:text-dark-500",children:t("auth.signup.subtitle")})]}),e.jsxs("form",{onSubmit:D,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"username",className:"block text-sm font-medium text-gray-700 dark:text-dark-700 mb-2",children:t("auth.signup.username")}),e.jsx("input",{id:"username",type:"text",value:r,onChange:N=>i(N.target.value),onKeyDown:A,className:"w-full px-3 py-2 border border-gray-200 dark:border-dark-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-accent-500 focus:border-accent-500 bg-white dark:bg-dark-200 text-gray-900 dark:text-dark-800 placeholder:text-gray-400 dark:placeholder:text-dark-500 transition-colors duration-200",placeholder:t("auth.signup.usernamePlaceholder"),required:!0,disabled:w})]}),e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"email",className:"block text-sm font-medium text-gray-700 dark:text-dark-700 mb-2",children:[t("auth.signup.email")," ",e.jsxs("span",{className:"text-gray-400",children:["(",t("common.optional"),")"]})]}),e.jsx("input",{id:"email",type:"email",value:o,onChange:N=>s(N.target.value),onKeyDown:A,className:"w-full px-3 py-2 border border-gray-200 dark:border-dark-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-accent-500 focus:border-accent-500 bg-white dark:bg-dark-200 text-gray-900 dark:text-dark-800 placeholder:text-gray-400 dark:placeholder:text-dark-500 transition-colors duration-200",placeholder:t("auth.signup.emailPlaceholder"),disabled:w})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"password",className:"block text-sm font-medium text-gray-700 dark:text-dark-700 mb-2",children:t("auth.signup.password")}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{id:"password",type:p?"text":"password",value:d,onChange:N=>u(N.target.value),onKeyDown:A,className:"w-full px-3 py-2 pr-10 border border-gray-200 dark:border-dark-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-accent-500 focus:border-accent-500 bg-white dark:bg-dark-200 text-gray-900 dark:text-dark-800 placeholder:text-gray-400 dark:placeholder:text-dark-500 transition-colors duration-200",placeholder:t("auth.signup.passwordPlaceholder"),required:!0,disabled:w}),e.jsx("button",{type:"button",onClick:()=>k(!p),className:"absolute inset-y-0 right-0 pr-3 flex items-center text-gray-400 hover:text-gray-600 dark:text-dark-500 dark:hover:text-dark-700",disabled:w,children:p?e.jsx(Je,{size:20}):e.jsx(Ee,{size:20})})]})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"confirmPassword",className:"block text-sm font-medium text-gray-700 dark:text-dark-700 mb-2",children:t("auth.signup.confirmPassword")}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{id:"confirmPassword",type:x?"text":"password",value:m,onChange:N=>g(N.target.value),onKeyDown:A,className:"w-full px-3 py-2 pr-10 border border-gray-200 dark:border-dark-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-accent-500 focus:border-accent-500 bg-white dark:bg-dark-200 text-gray-900 dark:text-dark-800 placeholder:text-gray-400 dark:placeholder:text-dark-500 transition-colors duration-200",placeholder:t("auth.signup.confirmPasswordPlaceholder"),required:!0,disabled:w}),e.jsx("button",{type:"button",onClick:()=>b(!x),className:"absolute inset-y-0 right-0 pr-3 flex items-center text-gray-400 hover:text-gray-600 dark:text-dark-500 dark:hover:text-dark-700",disabled:w,children:x?e.jsx(Je,{size:20}):e.jsx(Ee,{size:20})})]})]}),e.jsx("button",{type:"submit",disabled:w,className:"w-full flex items-center justify-center px-4 py-2 border border-transparent rounded-lg shadow-sm text-sm font-medium text-white bg-primary-600 hover:bg-primary-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 disabled:opacity-50 disabled:cursor-not-allowed transition-colors duration-200",children:w?e.jsxs("div",{className:"flex items-center",children:[e.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2"}),t("auth.signup.creatingAccount")]}):e.jsxs("div",{className:"flex items-center",children:[e.jsx(Fn,{size:16,className:"mr-2"}),t("auth.signup.createAccount")]})})]}),e.jsx(Yn,{}),e.jsx("div",{className:"mt-6 text-center",children:e.jsxs("p",{className:"text-sm text-gray-600 dark:text-dark-500",children:[t("auth.signup.hasAccount")," ",e.jsx("button",{onClick:a,className:"text-primary-500 hover:text-primary-600 dark:text-primary-400 dark:hover:text-primary-300 font-medium transition-colors duration-200",children:t("auth.signup.signInHere")})]})}),e.jsx("div",{className:"mt-4 text-center",children:e.jsxs("p",{className:"text-xs text-gray-500 dark:text-dark-500",children:[t("common.mode"),": ",t("common.multiUser")]})})]})},vn=()=>{const n=Ia(),{isAuthenticated:a,requiresAuth:t}=pe(),[r,i]=h.useState(!1);return h.useEffect(()=>{a&&n("/")},[a,n]),t()?e.jsxs("div",{className:"min-h-screen bg-gray-50 dark:bg-dark-50 flex flex-col justify-center py-12 sm:px-6 lg:px-8",children:[e.jsx("div",{className:"sm:mx-auto sm:w-full sm:max-w-md",children:e.jsx("h2",{className:"libre-brand text-center text-4xl sm:text-5xl font-normal text-gray-900 dark:text-gray-100",style:{fontWeight:400,letterSpacing:"0.01em"},children:"Libre WebUI"})}),e.jsx("div",{className:"mt-8 sm:mx-auto sm:w-full sm:max-w-md",children:r?e.jsx(Ay,{onBackToLogin:()=>i(!1),onSignup:()=>i(!1)}):e.jsx(jy,{onShowSignup:()=>i(!0)})})]}):(n("/"),null)},zy=({onComplete:n})=>{const{t:a}=ce(),[t,r]=h.useState("welcome"),[i,o]=h.useState(""),[s,d]=h.useState(""),[u,m]=h.useState(""),[g,p]=h.useState(!1),[k,x]=h.useState(!1),[b,w]=h.useState(!1),[S,F]=h.useState(null),[L,D]=h.useState(!1),[A,N]=h.useState(!1),{login:P}=pe();h.useEffect(()=>{t==="encryption-key"&&!S&&Te.getEncryptionKey().then(E=>{E.success&&E.data&&F(E.data.encryptionKey)})},[t,S]);const U=async E=>{if(E.preventDefault(),!i.trim()||!s.trim()||!u.trim()){Q.error(a("setup.admin.fillAllFields"));return}if(s!==u){Q.error(a("auth.signup.passwordMismatch"));return}if(s.length<6){Q.error(a("auth.signup.passwordTooShort"));return}w(!0);try{const G=await Te.signup({username:i,password:s,email:""});G.success&&G.data?(P(G.data.user,G.data.token,G.data.systemInfo),Q.success(a("setup.admin.success")),r("encryption-key")):Q.error(G.message||a("setup.admin.failed"))}catch(G){console.error("Admin creation error:",G),Q.error(a("setup.admin.failed"))}finally{w(!1)}},q=async()=>{if(S)try{await navigator.clipboard.writeText(S),D(!0),Q.success(a("setup.encryptionKey.copied")),setTimeout(()=>D(!1),3e3)}catch{Q.error(a("setup.encryptionKey.copyFailed"))}},K=()=>{if(!A){Q.error(a("setup.encryptionKey.confirmRequired"));return}n?.()},O=E=>{if(E.key==="Enter"){const G=E.currentTarget.form;G&&G.requestSubmit()}};return t==="welcome"?e.jsxs("div",{className:"min-h-screen bg-gray-50 dark:bg-dark-50 flex flex-col justify-center py-12 sm:px-6 lg:px-8",children:[e.jsxs("div",{className:"sm:mx-auto sm:w-full sm:max-w-md",children:[e.jsx("div",{className:"flex justify-center",children:e.jsx(Da,{})}),e.jsx("h2",{className:"libre-brand mt-6 text-center text-2xl sm:text-3xl font-normal text-gray-900 dark:text-gray-100",style:{fontWeight:300,letterSpacing:"0.01em"},children:a("setup.welcome.title")})]}),e.jsx("div",{className:"mt-8 sm:mx-auto sm:w-full sm:max-w-md",children:e.jsxs("div",{className:"w-full max-w-md mx-auto bg-white dark:bg-dark-25 rounded-xl shadow-card hover:shadow-card-hover transition-shadow duration-200 p-6 border border-gray-200 dark:border-dark-200",children:[e.jsxs("div",{className:"text-center mb-6",children:[e.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-dark-950 mb-2",children:a("setup.welcome.subtitle")}),e.jsx("p",{className:"text-gray-600 dark:text-dark-500",children:a("setup.welcome.description")})]}),e.jsxs("div",{className:"space-y-4 mb-6",children:[e.jsxs("div",{className:"flex items-start space-x-3",children:[e.jsx("div",{className:"flex-shrink-0 mt-1",children:e.jsx(Tn,{className:"h-5 w-5 text-primary-600 dark:text-primary-400"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium text-gray-900 dark:text-dark-950",children:a("setup.welcome.features.secure.title")}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-dark-500",children:a("setup.welcome.features.secure.description")})]})]}),e.jsxs("div",{className:"flex items-start space-x-3",children:[e.jsx("div",{className:"flex-shrink-0 mt-1",children:e.jsx(si,{className:"h-5 w-5 text-primary-600 dark:text-primary-400"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium text-gray-900 dark:text-dark-950",children:a("setup.welcome.features.fast.title")}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-dark-500",children:a("setup.welcome.features.fast.description")})]})]}),e.jsxs("div",{className:"flex items-start space-x-3",children:[e.jsx("div",{className:"flex-shrink-0 mt-1",children:e.jsx(mt,{className:"h-5 w-5 text-primary-600 dark:text-primary-400"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium text-gray-900 dark:text-dark-950",children:a("setup.welcome.features.openSource.title")}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-dark-500",children:a("setup.welcome.features.openSource.description")})]})]})]}),e.jsx("button",{onClick:()=>r("create-admin"),className:"w-full flex items-center justify-center px-4 py-2 border border-transparent rounded-lg shadow-sm text-sm font-medium text-white bg-primary-600 hover:bg-primary-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 transition-colors duration-200",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx("span",{children:a("setup.welcome.createAdmin")}),e.jsx(Rt,{size:16,className:"ml-2"})]})})]})})]}):t==="encryption-key"?e.jsxs("div",{className:"min-h-screen bg-gray-50 dark:bg-dark-50 flex flex-col justify-center py-12 sm:px-6 lg:px-8",children:[e.jsxs("div",{className:"sm:mx-auto sm:w-full sm:max-w-md",children:[e.jsx("div",{className:"flex justify-center",children:e.jsx(Da,{})}),e.jsx("h2",{className:"libre-brand mt-6 text-center text-2xl sm:text-3xl font-normal text-gray-900 dark:text-gray-100",style:{fontWeight:300,letterSpacing:"0.01em"},children:a("setup.encryptionKey.title")})]}),e.jsx("div",{className:"mt-8 sm:mx-auto sm:w-full sm:max-w-lg",children:e.jsxs("div",{className:"w-full max-w-lg mx-auto bg-white dark:bg-dark-25 rounded-xl shadow-card hover:shadow-card-hover transition-shadow duration-200 p-6 border border-gray-200 dark:border-dark-200",children:[e.jsxs("div",{className:"text-center mb-6",children:[e.jsx("div",{className:"flex justify-center mb-4",children:e.jsx("div",{className:"p-3 bg-amber-100 dark:bg-amber-900/30 rounded-full",children:e.jsx(at,{className:"h-8 w-8 text-amber-600 dark:text-amber-400"})})}),e.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-dark-950 mb-2",children:a("setup.encryptionKey.subtitle")}),e.jsx("p",{className:"text-gray-600 dark:text-dark-500",children:a("setup.encryptionKey.description")})]}),e.jsx("div",{className:"mb-6 p-4 bg-amber-50 dark:bg-amber-900/20 border border-amber-200 dark:border-amber-800 rounded-lg",children:e.jsxs("div",{className:"flex items-start space-x-3",children:[e.jsx(tt,{className:"h-5 w-5 text-amber-600 dark:text-amber-400 flex-shrink-0 mt-0.5"}),e.jsxs("div",{className:"text-sm text-amber-800 dark:text-amber-200",children:[e.jsx("p",{className:"font-medium mb-1",children:a("setup.encryptionKey.warning")}),e.jsx("p",{children:a("setup.encryptionKey.warningText")})]})]})}),e.jsxs("div",{className:"mb-6",children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-dark-700 mb-2",children:a("setup.encryptionKey.label")}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"w-full px-3 py-3 pr-12 border border-gray-300 dark:border-dark-300 rounded-lg bg-gray-50 dark:bg-dark-100 font-mono text-sm text-gray-900 dark:text-dark-800 break-all",children:S||a("setup.encryptionKey.loading")}),e.jsx("button",{type:"button",onClick:q,disabled:!S,className:"absolute right-2 top-1/2 -translate-y-1/2 p-2 text-gray-500 hover:text-gray-700 dark:text-dark-500 dark:hover:text-dark-700 disabled:opacity-50",title:a("setup.encryptionKey.copyToClipboard"),children:L?e.jsx(Se,{className:"h-5 w-5 text-green-500"}):e.jsx(Cn,{className:"h-5 w-5"})})]}),e.jsx("p",{className:"mt-2 text-xs text-gray-500 dark:text-dark-500",children:a("setup.encryptionKey.envNote")})]}),e.jsx("div",{className:"mb-6",children:e.jsxs("label",{className:"flex items-start space-x-3 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:A,onChange:E=>N(E.target.checked),className:"mt-1 h-4 w-4 text-primary-600 focus:ring-primary-500 border-gray-300 dark:border-dark-300 rounded"}),e.jsx("span",{className:"text-sm text-gray-700 dark:text-dark-700",children:a("setup.encryptionKey.acknowledgment")})]})}),e.jsx("button",{onClick:K,disabled:!A,className:"w-full flex items-center justify-center px-4 py-2 border border-transparent rounded-lg shadow-sm text-sm font-medium text-white bg-primary-600 hover:bg-primary-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 disabled:opacity-50 disabled:cursor-not-allowed transition-colors duration-200",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx("span",{children:a("setup.encryptionKey.continue")}),e.jsx(Rt,{size:16,className:"ml-2"})]})})]})})]}):e.jsxs("div",{className:"min-h-screen bg-gray-50 dark:bg-dark-50 flex flex-col justify-center py-12 sm:px-6 lg:px-8",children:[e.jsxs("div",{className:"sm:mx-auto sm:w-full sm:max-w-md",children:[e.jsx("div",{className:"flex justify-center",children:e.jsx(Da,{})}),e.jsx("h2",{className:"libre-brand mt-6 text-center text-2xl sm:text-3xl font-normal text-gray-900 dark:text-gray-100",style:{fontWeight:300,letterSpacing:"0.01em"},children:a("setup.admin.title")})]}),e.jsx("div",{className:"mt-8 sm:mx-auto sm:w-full sm:max-w-md",children:e.jsxs("div",{className:"w-full max-w-md mx-auto bg-white dark:bg-dark-25 rounded-xl shadow-card hover:shadow-card-hover transition-shadow duration-200 p-6 border border-gray-200 dark:border-dark-200",children:[e.jsxs("div",{className:"text-center mb-6",children:[e.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-dark-950 mb-2",children:a("setup.admin.subtitle")}),e.jsx("p",{className:"text-gray-600 dark:text-dark-500",children:a("setup.admin.description")})]}),e.jsxs("form",{onSubmit:U,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"username",className:"block text-sm font-medium text-gray-700 dark:text-dark-700 mb-2",children:a("auth.login.username")}),e.jsx("input",{id:"username",type:"text",value:i,onChange:E=>o(E.target.value),onKeyDown:O,className:"w-full px-3 py-2 border border-gray-300 dark:border-dark-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500 bg-white dark:bg-dark-100 text-gray-900 dark:text-dark-800 transition-colors duration-200",placeholder:a("setup.admin.usernamePlaceholder"),required:!0,disabled:b})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"password",className:"block text-sm font-medium text-gray-700 dark:text-dark-700 mb-2",children:a("auth.login.password")}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{id:"password",type:g?"text":"password",value:s,onChange:E=>d(E.target.value),onKeyDown:O,className:"w-full px-3 py-2 pr-10 border border-gray-300 dark:border-dark-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500 bg-white dark:bg-dark-100 text-gray-900 dark:text-dark-800 transition-colors duration-200",placeholder:a("setup.admin.passwordPlaceholder"),required:!0,disabled:b}),e.jsx("button",{type:"button",onClick:()=>p(!g),className:"absolute inset-y-0 right-0 pr-3 flex items-center text-gray-400 hover:text-gray-600 dark:text-dark-500 dark:hover:text-dark-700",disabled:b,children:g?e.jsx(Je,{size:20}):e.jsx(Ee,{size:20})})]})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"confirmPassword",className:"block text-sm font-medium text-gray-700 dark:text-dark-700 mb-2",children:a("auth.signup.confirmPassword")}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{id:"confirmPassword",type:k?"text":"password",value:u,onChange:E=>m(E.target.value),onKeyDown:O,className:"w-full px-3 py-2 pr-10 border border-gray-300 dark:border-dark-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500 bg-white dark:bg-dark-100 text-gray-900 dark:text-dark-800 transition-colors duration-200",placeholder:a("setup.admin.confirmPlaceholder"),required:!0,disabled:b}),e.jsx("button",{type:"button",onClick:()=>x(!k),className:"absolute inset-y-0 right-0 pr-3 flex items-center text-gray-400 hover:text-gray-600 dark:text-dark-500 dark:hover:text-dark-700",disabled:b,children:k?e.jsx(Je,{size:20}):e.jsx(Ee,{size:20})})]})]}),e.jsxs("div",{className:"flex space-x-3",children:[e.jsx("button",{type:"button",onClick:()=>r("welcome"),disabled:b,className:"flex-1 px-4 py-2 border border-gray-300 dark:border-dark-300 rounded-lg shadow-sm text-sm font-medium text-gray-700 dark:text-dark-700 bg-white dark:bg-dark-100 hover:bg-gray-50 dark:hover:bg-dark-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 disabled:opacity-50 disabled:cursor-not-allowed transition-colors duration-200",children:a("common.back")}),e.jsx("button",{type:"submit",disabled:b,className:"flex-1 flex items-center justify-center px-4 py-2 border border-transparent rounded-lg shadow-sm text-sm font-medium text-white bg-primary-600 hover:bg-primary-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 disabled:opacity-50 disabled:cursor-not-allowed transition-colors duration-200",children:b?e.jsxs("div",{className:"flex items-center",children:[e.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2"}),a("setup.admin.creating")]}):e.jsxs("div",{className:"flex items-center",children:[e.jsx(Fn,{size:16,className:"mr-2"}),a("setup.admin.createAdmin")]})})]})]}),e.jsx("div",{className:"mt-6 text-center",children:e.jsx("p",{className:"text-xs text-gray-500 dark:text-dark-500",children:a("setup.admin.note")})})]})})]})},Ny=window.location.protocol==="file:"?Ur:$r,Ty=window.location.protocol==="file:",xn=()=>Ty?e.jsx("div",{className:"absolute top-0 left-0 right-0 h-8 z-50",style:{WebkitAppRegion:"drag"}}):null,We=le.lazy(()=>he(()=>import("../js/ChatPage-Bn4KhZ-P.js"),__vite__mapDeps([2,3,1,4,5,0]))),Sn=le.lazy(()=>he(()=>import("../js/ModelsPage-CV6HuX7C.js"),__vite__mapDeps([6,3,1,4,0]))),wn=le.lazy(()=>he(()=>import("../js/PersonasPage-xwvWxbMB.js"),__vite__mapDeps([7,3,1,4,0]))),Iy=le.lazy(()=>he(()=>import("../js/GalleryPage-SIBQzaiG.js"),__vite__mapDeps([8,3,1,4,0]))),Cy=le.lazy(()=>he(()=>import("../js/UserManagementPage-BoTkq4w4.js"),__vite__mapDeps([9,3,1,4,0]))),Fy=le.lazy(()=>he(()=>import("../js/ArtifactDemoPage-6lM9n9_9.js"),__vite__mapDeps([10,3,1,5,4,0]))),Pn=()=>{const{t:n}=ce();return e.jsx("div",{className:"flex items-center justify-center h-full min-h-screen",children:e.jsxs("div",{className:"flex flex-col items-center gap-3",children:[e.jsx("div",{className:"w-8 h-8 border-4 border-gray-200 border-t-blue-500 rounded-full animate-spin"}),e.jsx("div",{className:"text-gray-600 dark:text-dark-600",children:n("common.loading")})]})})},Ey=({onClick:n})=>{const a=ut();return a.pathname==="/"||a.pathname==="/chat"||a.pathname.startsWith("/c/")?e.jsx("div",{className:"hidden lg:block",children:e.jsx(yy,{onClick:n})}):null},Oy=()=>{const{t:n,i18n:a}=ce();le.useEffect(()=>{const V=Wf(a.language)?"rtl":"ltr";document.documentElement.dir=V,document.documentElement.lang=a.language},[a.language]);const[t,r]=h.useState(!1),[i,o]=h.useState(!1),[s,d]=h.useState(0),[u,m]=h.useState(!1),[g,p]=h.useState(!1),{sidebarOpen:k,sidebarCompact:x,setSidebarOpen:b,setSidebarCompact:w,toggleSidebar:S,toggleSidebarCompact:F,toggleTheme:L,backgroundImage:D,preferences:A}=be(),{systemInfo:N,isLoading:P,user:U,isAuthenticated:q}=pe(),{isDemoMode:K,demoConfig:O}=be(),[E,G]=le.useState(!1),c=le.useRef(!1);le.useEffect(()=>{(async()=>{if(c.current){console.log("OAuth already processing, skipping...");return}console.log("Starting OAuth callback processing..."),c.current=!0;const Y=new URLSearchParams(window.location.search),J=Y.get("token"),me=Y.get("auth");if(J&&me==="success"){try{const ne=await fetch(`${ke}/auth/me`,{headers:{Authorization:`Bearer ${J}`},credentials:"include"});if(ne.ok){const T=await ne.json();if(T.success&&T.data){const{login:H,systemInfo:_}=pe.getState();H(T.data,J,_||{requiresAuth:!0,singleUserMode:!1,hasUsers:!0,version:"0.1.6"}),console.log("OAuth login successful, showing toast"),z.success("GitHub login successful!")}else z.error("Failed to verify GitHub authentication")}else z.error("GitHub authentication verification failed")}catch(ne){console.error("OAuth processing error:",ne),z.error("GitHub authentication failed")}window.history.replaceState({},document.title,window.location.pathname)}console.log("OAuth processing completed"),G(!0),c.current=!1})()},[]),My();const $=()=>{if(D)return!0;const V=A.backgroundSettings;return V?.enabled&&V?.imageUrl},ue=[{key:"b",metaKey:!0,action:()=>{window.innerWidth>=1024?k?F():(w(!1),S()):(!k&&x&&w(!1),S())},description:n("keyboard.toggleSidebar")},{key:",",metaKey:!0,action:()=>r(!0),description:n("keyboard.openSettings")},{key:"d",metaKey:!0,action:L,description:n("keyboard.toggleDarkMode")},{key:"h",action:()=>o(!0),description:n("keyboard.showShortcuts")},{key:"Escape",action:()=>{r(!1),o(!1)},description:n("keyboard.closeModals")}];return by(ue),le.useEffect(()=>(da.connect().catch(console.error),()=>{da.disconnect()}),[]),le.useEffect(()=>{if(!N&&!P&&s<15){const V=setTimeout(async()=>{d(Y=>Y+1);try{const{UserService:Y}=await he(async()=>{const{UserService:J}=await Promise.resolve().then(()=>Py);return{UserService:J}},void 0);await Y.initializeAuth()}catch{}},2e3);return()=>clearTimeout(V)}},[N,P,s]),le.useEffect(()=>{N&&N.requiresAuth&&!N.hasUsers&&!u&&p(!0)},[N,u]),P?e.jsxs("div",{className:"min-h-screen bg-gray-50 dark:bg-dark-50 flex flex-col justify-center py-12 sm:px-6 lg:px-8",children:[e.jsxs("div",{className:"sm:mx-auto sm:w-full sm:max-w-md",children:[e.jsx("div",{className:"flex justify-center",children:e.jsx(Da,{})}),e.jsx("h2",{className:"libre-brand mt-6 text-center text-2xl sm:text-3xl font-normal text-gray-900 dark:text-gray-100",style:{fontWeight:300,letterSpacing:"0.01em"},children:"Libre WebUI"})]}),e.jsx("div",{className:"mt-8 flex flex-col items-center gap-4",children:e.jsx("div",{className:"w-8 h-8 border-4 border-gray-300 dark:border-gray-600 border-t-primary-500 dark:border-t-primary-400 rounded-full animate-spin"})})]}):N?g&&!u?e.jsx(Sa,{children:e.jsx(zy,{onComplete:()=>{m(!0),p(!1)}})}):E?e.jsx(Sa,{children:e.jsxs(Ny,{children:[N&&!N.requiresAuth?e.jsxs("div",{className:R("flex h-screen text-gray-900 dark:text-dark-800 relative",$()?"bg-white/40 dark:bg-dark-50/40":"bg-white dark:bg-dark-50"),children:[e.jsx(xn,{}),e.jsx(fn,{}),e.jsx(hn,{isOpen:k,onClose:()=>b(!1)}),e.jsxs("div",{className:R("flex-1 flex flex-col min-w-0 transition-all duration-300 ease-in-out relative z-10","w-full",k?x?"lg:ml-16":"lg:ml-80":"lg:ml-0",k&&x?"max-lg:ml-16":"max-lg:ml-0",$()?"bg-white/30 dark:bg-dark-50/30":"bg-white dark:bg-dark-50"),children:[K&&O.showBanner&&e.jsx(kn,{message:O.message}),e.jsx("main",{className:R("flex-1 overflow-hidden",$()?"bg-white/20 dark:bg-dark-50/20 backdrop-blur-sm":"bg-gray-50 dark:bg-dark-100"),children:e.jsx(Sa,{children:e.jsx(h.Suspense,{fallback:e.jsx(Pn,{}),children:e.jsxs(Ja,{children:[e.jsx(ie,{path:"/",element:e.jsx(We,{})}),e.jsx(ie,{path:"/chat",element:e.jsx(We,{})}),e.jsx(ie,{path:"/c/:sessionId",element:e.jsx(We,{})}),e.jsx(ie,{path:"/models",element:e.jsx(Sn,{})}),e.jsx(ie,{path:"/personas",element:e.jsx(wn,{})}),e.jsx(ie,{path:"/login",element:e.jsx(vn,{})})]})})})})]})]}):e.jsxs(Ja,{children:[e.jsx(ie,{path:"/login",element:e.jsx(vn,{})}),e.jsx(ie,{path:"/*",element:e.jsx(bn,{children:e.jsxs("div",{className:R("flex h-screen text-gray-900 dark:text-dark-800 relative",$()?"bg-white/40 dark:bg-dark-50/40":"bg-white dark:bg-dark-50"),children:[e.jsx(xn,{}),e.jsx(fn,{}),e.jsx(hn,{isOpen:k,onClose:()=>b(!1)}),e.jsxs("div",{className:R("flex-1 flex flex-col min-w-0 transition-all duration-300 ease-in-out relative z-10","w-full",k?x?"lg:ml-16":"lg:ml-80":"lg:ml-0",k&&x?"max-lg:ml-16":"max-lg:ml-0",$()?"bg-white/30 dark:bg-dark-50/30":"bg-white dark:bg-dark-50"),children:[K&&O.showBanner&&e.jsx(kn,{message:O.message}),e.jsx("main",{className:R("flex-1 overflow-hidden",$()?"bg-white/20 dark:bg-dark-50/20 backdrop-blur-sm":"bg-gray-50 dark:bg-dark-100"),children:e.jsx(Sa,{children:e.jsx(h.Suspense,{fallback:e.jsx(Pn,{}),children:e.jsxs(Ja,{children:[e.jsx(ie,{path:"/",element:e.jsx(We,{})}),e.jsx(ie,{path:"/chat",element:e.jsx(We,{})}),e.jsx(ie,{path:"/c/:sessionId",element:e.jsx(We,{})}),e.jsx(ie,{path:"/models",element:e.jsx(Sn,{})}),e.jsx(ie,{path:"/personas",element:e.jsx(wn,{})}),e.jsx(ie,{path:"/gallery",element:e.jsx(Iy,{})}),e.jsx(ie,{path:"/artifacts",element:e.jsx(Fy,{})}),e.jsx(ie,{path:"/users",element:e.jsx(bn,{requireAdmin:!0,children:e.jsx(Cy,{})})})]})})})})]})]})})})]}),e.jsx(Jn,{isOpen:t,onClose:()=>r(!1)}),e.jsx(fy,{isOpen:i,onClose:()=>o(!1),shortcuts:ue}),e.jsx(Ey,{onClick:()=>o(!0)}),e.jsx(Sy,{}),e.jsx(li,{position:"top-right",toastOptions:{duration:4e3,className:"animate-slide-up",style:{background:"var(--toast-bg)",color:"var(--toast-color)",border:"1px solid var(--toast-border)",borderRadius:"0.75rem",boxShadow:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",cursor:"pointer"},success:{iconTheme:{primary:"#16a34a",secondary:"#ffffff"}},error:{iconTheme:{primary:"#ef4444",secondary:"#ffffff"}}},containerStyle:{top:80,right:20}})]})}):e.jsx("div",{className:"min-h-screen bg-gray-50 dark:bg-dark-50 flex items-center justify-center",children:e.jsx("div",{className:"w-8 h-8 border-4 border-gray-300 dark:border-gray-600 border-t-primary-500 dark:border-t-primary-400 rounded-full animate-spin"})}):e.jsx("div",{className:"min-h-screen bg-dark-50 flex items-center justify-center p-4",children:e.jsxs("div",{className:"text-center",children:[e.jsx("h1",{className:"libre-brand text-5xl text-white mb-8",style:{fontWeight:400,letterSpacing:"0.02em"},children:"Libre"}),e.jsx("div",{className:"flex justify-center mb-4",children:e.jsx("div",{className:"w-8 h-8 border-3 border-gray-700 border-t-primary-500 rounded-full animate-spin"})}),e.jsx("p",{className:"text-gray-500 text-sm",children:s>0?`Connecting to backend... (${s}/15)`:"Starting up..."})]})})};pi.createRoot(document.getElementById("root")).render(e.jsx(le.StrictMode,{children:e.jsx(Oy,{})}));export{my as A,I as B,Yf as I,pn as O,xe as S,$n as T,ce as a,pe as b,R as c,Ne as d,dt as e,qf as f,pt as g,ze as h,ct as i,Jf as j,qn as k,Fe as o,Ry as p,la as t,be as u,da as w};