texlite 0.9.1 → 0.9.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.
- package/DESIGN.md +36 -6
- package/OPERATIONS.md +70 -3
- package/README.md +11 -3
- package/README.zh-CN.md +11 -2
- package/THIRD_PARTY_NOTICES.md +29 -0
- package/dist/client/assets/AdminUsers-huwQK7Ly.js +1 -0
- package/dist/client/assets/CitationLibraryDialog-C5C3sPdw.js +1 -0
- package/dist/client/assets/Dashboard-DtHSc55D.js +2 -0
- package/dist/client/assets/{GitDialog-C9Loz4Al.js → GitDialog-BI7QIMsh.js} +1 -1
- package/dist/client/assets/{HistoryDialog-3UNN_jhU.js → HistoryDialog-DA7O9aF2.js} +1 -1
- package/dist/client/assets/LatexEditor-BYWWx5Km.js +138 -0
- package/dist/client/assets/{PdfPreview-BKhcS-2c.js → PdfPreview-mO9WS01q.js} +1 -1
- package/dist/client/assets/ProjectIconPickerDialog-B0q_r5dX.js +1 -0
- package/dist/client/assets/{ProjectNavigationDialogs-CZKTnxrl.js → ProjectNavigationDialogs-DwWYbB1A.js} +1 -1
- package/dist/client/assets/ProjectSettings-BpPFgdoj.js +1 -0
- package/dist/client/assets/ProjectWorkspace-CI2zKon5.js +32 -0
- package/dist/client/assets/{SelectionHistoryDialog-D3dO83lg.js → SelectionHistoryDialog-pWMI5izu.js} +2 -2
- package/dist/client/assets/SystemMetricsDialog-BmlO7oNg.js +1 -0
- package/dist/client/assets/TagManagementDialog-h4Ves4FR.js +1 -0
- package/dist/client/assets/{WordCountDialog-TwpyAP3m.js → WordCountDialog-DlBSP4y7.js} +1 -1
- package/dist/client/assets/check-BAdi_Lxq.js +1 -0
- package/dist/client/assets/editor-DZS7-wrd.js +14 -0
- package/dist/client/assets/{hard-drive-XHSiS_A7.js → hard-drive-DP2OHKMC.js} +1 -1
- package/dist/client/assets/index-CBrIrzgg.css +1 -0
- package/dist/client/assets/{index-Cd6-F29b.js → index-i5IY_PMw.js} +1 -1
- package/dist/client/assets/index-teah8iB2.js +12 -0
- package/dist/client/assets/katex-D9PXdmFF.css +1 -0
- package/dist/client/assets/{key-round-C-CXCWnz.js → key-round-D8sCqL2b.js} +1 -1
- package/dist/client/assets/{latexFormatterWorker-DYkYtcFy.js → latexFormatterWorker-BRmsns8a.js} +2 -2
- package/dist/client/assets/{minimize-2-BMDPVaF-.js → minimize-2-6tf519Ts.js} +1 -1
- package/dist/client/assets/{minus-BIa7-KuM.js → minus-CqvESp9M.js} +1 -1
- package/dist/client/assets/{pdf-BB1XvBIF.js → pdf-DUYcbPMK.js} +1 -1
- package/dist/client/assets/{plus-BKDWy4Ui.js → plus-DIrweesj.js} +1 -1
- package/dist/client/assets/{refresh-cw-Bo7-a7-I.js → refresh-cw-BDcwKu_d.js} +1 -1
- package/dist/client/assets/{search-Bz9Ob5mT.js → search-C9_Jyrnx.js} +1 -1
- package/dist/client/assets/{sigma-DxlHf9gv.js → sigma-p9-fBP0d.js} +1 -1
- package/dist/client/assets/spellCheck-Y0RlmXbl.js +1 -0
- package/dist/client/assets/{tags-IMZehjzE.js → tags-DjF3z21M.js} +1 -1
- package/dist/client/assets/{type-DTWpFQNQ.js → type-CNrDJnzR.js} +1 -1
- package/dist/client/assets/{user-plus--aVpd8K6.js → user-plus-C7exNawX.js} +1 -1
- package/dist/client/assets/x-BEVz0wdw.js +1 -0
- package/dist/client/index.html +6 -4
- package/dist/server/app.js +130 -83
- package/dist/server/cli.js +4 -2
- package/dist/server/collaboration.js +6 -19
- package/dist/server/compileArtifacts.js +3 -2
- package/dist/server/config.js +27 -0
- package/dist/server/db.js +91 -10
- package/dist/server/index.js +4 -2
- package/dist/server/instanceLock.js +4 -2
- package/dist/server/latexCompletion.js +126 -63
- package/dist/server/latexDocumentGraph.js +217 -0
- package/dist/server/latexSpellMask.js +3 -4
- package/dist/server/pm2.js +3 -2
- package/dist/server/projectOutline.js +103 -91
- package/dist/server/projectReferences.js +109 -0
- package/dist/server/routes/auth.js +5 -2
- package/dist/server/routes/comments.js +10 -4
- package/dist/server/routes/compile.js +2 -2
- package/dist/server/routes/projectFiles.js +12 -3
- package/dist/server/routes/projectReferences.js +36 -0
- package/dist/server/routes/projectShared.js +33 -12
- package/dist/server/routes/projects.js +5 -0
- package/dist/server/routes/system.js +1 -0
- package/dist/server/zip.js +2 -16
- package/dist/shared/basePath.js +44 -0
- package/dist/shared/bibtexReferences.js +135 -0
- package/dist/shared/collaborationProtocol.js +31 -0
- package/dist/shared/latexCommandSnippets.js +91 -0
- package/dist/shared/latexDependencies.js +131 -0
- package/dist/shared/latexLiterals.js +215 -0
- package/dist/shared/latexReferenceCommands.js +75 -0
- package/dist/shared/latexReferences.js +193 -0
- package/dist/shared/latexRoot.js +21 -0
- package/dist/shared/latexScanner.js +183 -0
- package/dist/shared/writingChecks.js +4 -0
- package/package.json +11 -4
- package/texlite.config.example.json +2 -4
- package/dist/client/assets/AdminUsers-Dazar9cj.js +0 -1
- package/dist/client/assets/CitationLibraryDialog-VSUiSPgG.js +0 -1
- package/dist/client/assets/Dashboard-CoE5ESfb.js +0 -2
- package/dist/client/assets/LatexEditor-Bq76v8sO.js +0 -65
- package/dist/client/assets/ProjectIconPickerDialog-BoWMjQVm.js +0 -1
- package/dist/client/assets/ProjectSettings-DiOQVJ40.js +0 -1
- package/dist/client/assets/ProjectWorkspace-DqLwkGpT.js +0 -27
- package/dist/client/assets/SystemMetricsDialog-0zCwLtH_.js +0 -1
- package/dist/client/assets/TagManagementDialog-C6KDwtvd.js +0 -1
- package/dist/client/assets/check-sZxOOKtS.js +0 -1
- package/dist/client/assets/chevron-left-32SrOwa5.js +0 -1
- package/dist/client/assets/editor-CiK7TK0p.js +0 -14
- package/dist/client/assets/index-BRr3Kuxh.css +0 -1
- package/dist/client/assets/index-BjzELSQ-.js +0 -12
- package/dist/client/assets/katex-CEK31ho9.css +0 -1
- package/dist/client/assets/spellCheck-BfZEnpwY.js +0 -1
- package/dist/client/assets/x-Tbo3aA0J.js +0 -1
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PdfPreview-BKhcS-2c.js","assets/react-BVUjbTTn.js","assets/pdf-BB1XvBIF.js","assets/minus-BIa7-KuM.js","assets/plus-BKDWy4Ui.js","assets/ProjectWorkspace-DqLwkGpT.js","assets/check-sZxOOKtS.js","assets/x-Tbo3aA0J.js","assets/search-Bz9Ob5mT.js","assets/user-plus--aVpd8K6.js","assets/refresh-cw-Bo7-a7-I.js","assets/Dashboard-CoE5ESfb.js","assets/hard-drive-XHSiS_A7.js","assets/sigma-DxlHf9gv.js","assets/tags-IMZehjzE.js","assets/chevron-left-32SrOwa5.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{i as Go,u as z,j as f,r as p,R as be,a as zt,b as Ko,c as Yo}from"./react-BVUjbTTn.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))n(r);new MutationObserver(r=>{for(const i of r)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function t(r){const i={};return r.integrity&&(i.integrity=r.integrity),r.referrerPolicy&&(i.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?i.credentials="include":r.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(r){if(r.ep)return;r.ep=!0;const i=t(r);fetch(r.href,i)}})();const qo="modulepreload",Jo=function(o){return"/"+o},wt={},nt=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let c=function(l){return Promise.all(l.map(u=>Promise.resolve(u).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),a=s?.nonce||s?.getAttribute("nonce");r=c(t.map(l=>{if(l=Jo(l),l in wt)return;wt[l]=!0;const u=l.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${d}`))return;const h=document.createElement("link");if(h.rel=u?"stylesheet":qo,u||(h.as="script"),h.crossOrigin="",h.href=l,a&&h.setAttribute("nonce",a),document.head.appendChild(h),u)return new Promise((g,m)=>{h.addEventListener("load",g),h.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${l}`)))})}))}function i(s){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=s,window.dispatchEvent(a),!a.defaultPrevented)throw s}return r.then(s=>{for(const a of s||[])a.status==="rejected"&&i(a.reason);return e().catch(i)})};var Me={};const T=o=>typeof o=="string",fe=()=>{let o,e;const t=new Promise((n,r)=>{o=n,e=r});return t.resolve=o,t.reject=e,t},vt=o=>o==null?"":""+o,Zo=(o,e,t)=>{o.forEach(n=>{e[n]&&(t[n]=e[n])})},Qo=/###/g,bt=o=>o&&o.indexOf("###")>-1?o.replace(Qo,"."):o,Ct=o=>!o||T(o),me=(o,e,t)=>{const n=T(e)?e.split("."):e;let r=0;for(;r<n.length-1;){if(Ct(o))return{};const i=bt(n[r]);!o[i]&&t&&(o[i]=new t),Object.prototype.hasOwnProperty.call(o,i)?o=o[i]:o={},++r}return Ct(o)?{}:{obj:o,k:bt(n[r])}},Tt=(o,e,t)=>{const{obj:n,k:r}=me(o,e,Object);if(n!==void 0||e.length===1){n[r]=t;return}let i=e[e.length-1],s=e.slice(0,e.length-1),a=me(o,s,Object);for(;a.obj===void 0&&s.length;)i=`${s[s.length-1]}.${i}`,s=s.slice(0,s.length-1),a=me(o,s,Object),a?.obj&&typeof a.obj[`${a.k}.${i}`]<"u"&&(a.obj=void 0);a.obj[`${a.k}.${i}`]=t},en=(o,e,t,n)=>{const{obj:r,k:i}=me(o,e,Object);r[i]=r[i]||[],r[i].push(t)},Ne=(o,e)=>{const{obj:t,k:n}=me(o,e);if(t&&Object.prototype.hasOwnProperty.call(t,n))return t[n]},tn=(o,e,t)=>{const n=Ne(o,t);return n!==void 0?n:Ne(e,t)},Gt=(o,e,t)=>{for(const n in e)n!=="__proto__"&&n!=="constructor"&&(n in o?T(o[n])||o[n]instanceof String||T(e[n])||e[n]instanceof String?t&&(o[n]=e[n]):Gt(o[n],e[n],t):o[n]=e[n]);return o},q=o=>o.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var on={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const nn=o=>T(o)?o.replace(/[&<>"'\/]/g,e=>on[e]):o;class rn{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(t!==void 0)return t;const n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}const sn=[" ",",","?","!",";"],an=new rn(20),cn=(o,e,t)=>{e=e||"",t=t||"";const n=sn.filter(s=>e.indexOf(s)<0&&t.indexOf(s)<0);if(n.length===0)return!0;const r=an.getRegExp(`(${n.map(s=>s==="?"?"\\?":s).join("|")})`);let i=!r.test(o);if(!i){const s=o.indexOf(t);s>0&&!r.test(o.substring(0,s))&&(i=!0)}return i},ze=(o,e,t=".")=>{if(!o)return;if(o[e])return Object.prototype.hasOwnProperty.call(o,e)?o[e]:void 0;const n=e.split(t);let r=o;for(let i=0;i<n.length;){if(!r||typeof r!="object")return;let s,a="";for(let c=i;c<n.length;++c)if(c!==i&&(a+=t),a+=n[c],s=r[a],s!==void 0){if(["string","number","boolean"].indexOf(typeof s)>-1&&c<n.length-1)continue;i+=c-i+1;break}r=s}return r},we=o=>o?.replace(/_/g,"-"),ln={type:"logger",log(o){this.output("log",o)},warn(o){this.output("warn",o)},error(o){this.output("error",o)},output(o,e){console?.[o]?.apply?.(console,e)}};class Ie{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||ln,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,n,r){return r&&!this.debug?null:(T(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new Ie(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new Ie(this.logger,e)}}var H=new Ie;class Ae{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(n=>{this.observers[n]||(this.observers[n]=new Map);const r=this.observers[n].get(t)||0;this.observers[n].set(t,r+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([r,i])=>{for(let s=0;s<i;s++)r(...t)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([r,i])=>{for(let s=0;s<i;s++)r.apply(r,[e,...t])})}}class xt extends Ae{constructor(e,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,r={}){const i=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,s=r.ignoreJSONStructure!==void 0?r.ignoreJSONStructure:this.options.ignoreJSONStructure;let a;e.indexOf(".")>-1?a=e.split("."):(a=[e,t],n&&(Array.isArray(n)?a.push(...n):T(n)&&i?a.push(...n.split(i)):a.push(n)));const c=Ne(this.data,a);return!c&&!t&&!n&&e.indexOf(".")>-1&&(e=a[0],t=a[1],n=a.slice(2).join(".")),c||!s||!T(n)?c:ze(this.data?.[e]?.[t],n,i)}addResource(e,t,n,r,i={silent:!1}){const s=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator;let a=[e,t];n&&(a=a.concat(s?n.split(s):n)),e.indexOf(".")>-1&&(a=e.split("."),r=t,t=a[1]),this.addNamespaces(t),Tt(this.data,a,r),i.silent||this.emit("added",e,t,n,r)}addResources(e,t,n,r={silent:!1}){for(const i in n)(T(n[i])||Array.isArray(n[i]))&&this.addResource(e,t,i,n[i],{silent:!0});r.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,r,i,s={silent:!1,skipCopy:!1}){let a=[e,t];e.indexOf(".")>-1&&(a=e.split("."),r=n,n=t,t=a[1]),this.addNamespaces(t);let c=Ne(this.data,a)||{};s.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?Gt(c,n,i):c={...c,...n},Tt(this.data,a,c),s.silent||this.emit("added",e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(r=>t[r]&&Object.keys(t[r]).length>0)}toJSON(){return this.data}}var Kt={processors:{},addPostProcessor(o){this.processors[o.name]=o},handle(o,e,t,n,r){return o.forEach(i=>{e=this.processors[i]?.process(e,t,n,r)??e}),e}};const Yt=Symbol("i18next/PATH_KEY");function dn(){const o=[],e=Object.create(null);let t;return e.get=(n,r)=>(t?.revoke?.(),r===Yt?o:(o.push(r),t=Proxy.revocable(n,e),t.proxy)),Proxy.revocable(Object.create(null),e).proxy}function ie(o,e){const{[Yt]:t}=o(dn()),n=e?.keySeparator??".",r=e?.nsSeparator??":";if(t.length>1&&r){const i=e?.ns,s=Array.isArray(i)?i:null;if(s&&s.length>1&&s.slice(1).includes(t[0]))return`${t[0]}${r}${t.slice(1).join(n)}`}return t.join(n)}const Dt={},Ue=o=>!T(o)&&typeof o!="boolean"&&typeof o!="number";class je extends Ae{constructor(e,t={}){super(),Zo(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=H.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){const n={...t};if(e==null)return!1;const r=this.resolve(e,n);if(r?.res===void 0)return!1;const i=Ue(r.res);return!(n.returnObjects===!1&&i)}extractFromKey(e,t){let n=t.nsSeparator!==void 0?t.nsSeparator:this.options.nsSeparator;n===void 0&&(n=":");const r=t.keySeparator!==void 0?t.keySeparator:this.options.keySeparator;let i=t.ns||this.options.defaultNS||[];const s=n&&e.indexOf(n)>-1,a=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!cn(e,n,r);if(s&&!a){const c=e.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:e,namespaces:T(i)?[i]:i};const l=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(l[0])>-1)&&(i=l.shift()),e=l.join(r)}return{key:e,namespaces:T(i)?[i]:i}}translate(e,t,n){let r=typeof t=="object"?{...t}:t;if(typeof r!="object"&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),typeof r=="object"&&(r={...r}),r||(r={}),e==null)return"";typeof e=="function"&&(e=ie(e,{...this.options,...r})),Array.isArray(e)||(e=[String(e)]),e=e.map(O=>typeof O=="function"?ie(O,{...this.options,...r}):String(O));const i=r.returnDetails!==void 0?r.returnDetails:this.options.returnDetails,s=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,{key:a,namespaces:c}=this.extractFromKey(e[e.length-1],r),l=c[c.length-1];let u=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;u===void 0&&(u=":");const d=r.lng||this.language,h=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d?.toLowerCase()==="cimode")return h?i?{res:`${l}${u}${a}`,usedKey:a,exactUsedKey:a,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(r)}:`${l}${u}${a}`:i?{res:a,usedKey:a,exactUsedKey:a,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(r)}:a;const g=this.resolve(e,r);let m=g?.res;const x=g?.usedKey||a,v=g?.exactUsedKey||a,S=["[object Number]","[object Function]","[object RegExp]"],C=r.joinArrays!==void 0?r.joinArrays:this.options.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject,b=r.count!==void 0&&!T(r.count),w=je.hasDefaultValue(r),D=b?this.pluralResolver.getSuffix(d,r.count,r):"",k=r.ordinal&&b?this.pluralResolver.getSuffix(d,r.count,{ordinal:!1}):"",L=b&&!r.ordinal&&r.count===0,I=L&&r[`defaultValue${this.options.pluralSeparator}zero`]||r[`defaultValue${D}`]||r[`defaultValue${k}`]||r.defaultValue;let F=m;y&&!m&&w&&(F=I);const de=Ue(F),P=Object.prototype.toString.apply(F);if(y&&F&&de&&S.indexOf(P)<0&&!(T(C)&&Array.isArray(F))){if(!r.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const O=this.options.returnedObjectHandler?this.options.returnedObjectHandler(x,F,{...r,ns:c}):`key '${a} (${this.language})' returned an object instead of string.`;return i?(g.res=O,g.usedParams=this.getUsedParamsDetails(r),g):O}if(s){const O=Array.isArray(F),j=O?[]:{},Te=O?v:x;for(const $ in F)if(Object.prototype.hasOwnProperty.call(F,$)){const V=`${Te}${s}${$}`;w&&!m?j[$]=this.translate(V,{...r,defaultValue:Ue(I)?I[$]:void 0,joinArrays:!1,ns:c}):j[$]=this.translate(V,{...r,joinArrays:!1,ns:c}),j[$]===V&&(j[$]=F[$])}m=j}}else if(y&&T(C)&&Array.isArray(m))m=m.join(C),m&&(m=this.extendTranslation(m,e,r,n));else{let O=!1,j=!1;!this.isValidLookup(m)&&w&&(O=!0,m=I),this.isValidLookup(m)||(j=!0,m=a);const $=(r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&j?void 0:m,V=w&&I!==m&&this.options.updateMissing;if(j||O||V){if(this.logger.log(V?"updateKey":"missingKey",d,l,a,V?I:m),s){const A=this.resolve(a,{...r,keySeparator:!1});A&&A.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 ue=[];const xe=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if(this.options.saveMissingTo==="fallback"&&xe&&xe[0])for(let A=0;A<xe.length;A++)ue.push(xe[A]);else this.options.saveMissingTo==="all"?ue=this.languageUtils.toResolveHierarchy(r.lng||this.language):ue.push(r.lng||this.language);const gt=(A,Y,pe)=>{const yt=w&&pe!==m?pe:$;this.options.missingKeyHandler?this.options.missingKeyHandler(A,l,Y,yt,V,r):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(A,l,Y,yt,V,r),this.emit("missingKey",A,l,Y,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&b?ue.forEach(A=>{const Y=this.pluralResolver.getSuffixes(A,r);L&&r[`defaultValue${this.options.pluralSeparator}zero`]&&Y.indexOf(`${this.options.pluralSeparator}zero`)<0&&Y.push(`${this.options.pluralSeparator}zero`),Y.forEach(pe=>{gt([A],a+pe,r[`defaultValue${pe}`]||I)})}):gt(ue,a,I))}m=this.extendTranslation(m,e,r,g,n),j&&m===a&&this.options.appendNamespaceToMissingKey&&(m=`${l}${u}${a}`),(j||O)&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${u}${a}`:a,O?m:void 0,r))}return i?(g.res=m,g.usedParams=this.getUsedParamsDetails(r),g):m}extendTranslation(e,t,n,r,i){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const c=T(e)&&(n?.interpolation?.skipOnVariables!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let l;if(c){const d=e.match(this.interpolator.nestingRegexp);l=d&&d.length}let u=n.replace&&!T(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(u={...this.options.interpolation.defaultVariables,...u}),e=this.interpolator.interpolate(e,u,n.lng||this.language||r.usedLng,n),c){const d=e.match(this.interpolator.nestingRegexp),h=d&&d.length;l<h&&(n.nest=!1)}!n.lng&&r&&r.res&&(n.lng=this.language||r.usedLng),n.nest!==!1&&(e=this.interpolator.nest(e,(...d)=>i?.[0]===d[0]&&!n.context?(this.logger.warn(`It seems you are nesting recursively key: ${d[0]} in key: ${t[0]}`),null):this.translate(...d,t),n)),n.interpolation&&this.interpolator.reset()}const s=n.postProcess||this.options.postProcess,a=T(s)?[s]:s;return e!=null&&a?.length&&n.applyPostProcessor!==!1&&(e=Kt.handle(a,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,r,i,s,a;return T(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(c=>typeof c=="function"?ie(c,{...this.options,...t}):c)),e.forEach(c=>{if(this.isValidLookup(n))return;const l=this.extractFromKey(c,t),u=l.key;r=u;let d=l.namespaces;this.options.fallbackNS&&(d=d.concat(this.options.fallbackNS));const h=t.count!==void 0&&!T(t.count),g=h&&!t.ordinal&&t.count===0,m=t.context!==void 0&&(T(t.context)||typeof t.context=="number")&&t.context!=="",x=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);d.forEach(v=>{this.isValidLookup(n)||(a=v,!Dt[`${x[0]}-${v}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(a)&&(Dt[`${x[0]}-${v}`]=!0,this.logger.warn(`key "${r}" for languages "${x.join(", ")}" won't get resolved as namespace "${a}" 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!!!")),x.forEach(S=>{if(this.isValidLookup(n))return;s=S;const C=[u];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(C,u,S,v,t);else{let b;h&&(b=this.pluralResolver.getSuffix(S,t.count,t));const w=`${this.options.pluralSeparator}zero`,D=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(h&&(t.ordinal&&b.indexOf(D)===0&&C.push(u+b.replace(D,this.options.pluralSeparator)),C.push(u+b),g&&C.push(u+w)),m){const k=`${u}${this.options.contextSeparator||"_"}${t.context}`;C.push(k),h&&(t.ordinal&&b.indexOf(D)===0&&C.push(k+b.replace(D,this.options.pluralSeparator)),C.push(k+b),g&&C.push(k+w))}}let y;for(;y=C.pop();)this.isValidLookup(n)||(i=y,n=this.getResource(S,v,y,t))}))})}),{res:n,usedKey:r,exactUsedKey:i,usedLng:s,usedNS:a}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,t,n,r={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(e={}){const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!T(e.replace);let r=n?e.replace:e;if(n&&typeof e.count<"u"&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!n){r={...r};for(const i of t)delete r[i]}return r}static hasDefaultValue(e){const t="defaultValue";for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,t.length)&&e[n]!==void 0)return!0;return!1}}class St{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=H.create("languageUtils")}getScriptPartFromCode(e){if(e=we(e),!e||e.indexOf("-")<0)return null;const t=e.split("-");return t.length===2||(t.pop(),t[t.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(t.join("-"))}getLanguagePartFromCode(e){if(e=we(e),!e||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(T(e)&&e.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(n=>{if(t)return;const r=this.formatLanguageCode(n);(!this.options.supportedLngs||this.isSupportedCode(r))&&(t=r)}),!t&&this.options.supportedLngs&&e.forEach(n=>{if(t)return;const r=this.getScriptPartFromCode(n);if(this.isSupportedCode(r))return t=r;const i=this.getLanguagePartFromCode(n);if(this.isSupportedCode(i))return t=i;t=this.options.supportedLngs.find(s=>{if(s===i)return s;if(!(s.indexOf("-")<0&&i.indexOf("-")<0)&&(s.indexOf("-")>0&&i.indexOf("-")<0&&s.substring(0,s.indexOf("-"))===i||s.indexOf(i)===0&&i.length>1))return s})}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if(typeof e=="function"&&(e=e(t)),T(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){const n=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],e),r=[],i=s=>{s&&(this.isSupportedCode(s)?r.push(s):this.logger.warn(`rejecting language code not found in supportedLngs: ${s}`))};return T(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&i(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&i(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&i(this.getLanguagePartFromCode(e))):T(e)&&i(this.formatLanguageCode(e)),n.forEach(s=>{r.indexOf(s)<0&&i(this.formatLanguageCode(s))}),r}}const kt={zero:0,one:1,two:2,few:3,many:4,other:5},Et={select:o=>o===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class un{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=H.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const n=we(e==="dev"?"en":e),r=t.ordinal?"ordinal":"cardinal",i=JSON.stringify({cleanedCode:n,type:r});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let s;try{s=new Intl.PluralRules(n,{type:r})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),Et;if(!e.match(/-|_/))return Et;const c=this.languageUtils.getLanguagePartFromCode(e);s=this.getRule(c,t)}return this.pluralRulesCache[i]=s,s}needsPlural(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(r=>`${t}${r}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?n.resolvedOptions().pluralCategories.sort((r,i)=>kt[r]-kt[i]).map(r=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${r}`):[]}getSuffix(e,t,n={}){const r=this.getRule(e,n);return r?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${r.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,n))}}const Pt=(o,e,t,n=".",r=!0)=>{let i=tn(o,e,t);return!i&&r&&T(t)&&(i=ze(o,t,n),i===void 0&&(i=ze(e,t,n))),i},$e=o=>o.replace(/\$/g,"$$$$");class Ot{constructor(e={}){this.logger=H.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(t=>t),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:i,prefixEscaped:s,suffix:a,suffixEscaped:c,formatSeparator:l,unescapeSuffix:u,unescapePrefix:d,nestingPrefix:h,nestingPrefixEscaped:g,nestingSuffix:m,nestingSuffixEscaped:x,nestingOptionsSeparator:v,maxReplaces:S,alwaysFormat:C}=e.interpolation;this.escape=t!==void 0?t:nn,this.escapeValue=n!==void 0?n:!0,this.useRawValueToEscape=r!==void 0?r:!1,this.prefix=i?q(i):s||"{{",this.suffix=a?q(a):c||"}}",this.formatSeparator=l||",",this.unescapePrefix=u?"":d||"-",this.unescapeSuffix=this.unescapePrefix?"":u||"",this.nestingPrefix=h?q(h):g||q("$t("),this.nestingSuffix=m?q(m):x||q(")"),this.nestingOptionsSeparator=v||",",this.maxReplaces=S||1e3,this.alwaysFormat=C!==void 0?C:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(t,n)=>t?.source===n?(t.lastIndex=0,t):new RegExp(n,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,n,r){let i,s,a;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=g=>{if(g.indexOf(this.formatSeparator)<0){const S=Pt(t,c,g,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(S,void 0,n,{...r,...t,interpolationkey:g}):S}const m=g.split(this.formatSeparator),x=m.shift().trim(),v=m.join(this.formatSeparator).trim();return this.format(Pt(t,c,x,this.options.keySeparator,this.options.ignoreJSONStructure),v,n,{...r,...t,interpolationkey:x})};this.resetRegExp();const u=r?.missingInterpolationHandler||this.options.missingInterpolationHandler,d=r?.interpolation?.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:g=>$e(g)},{regex:this.regexp,safeValue:g=>this.escapeValue?$e(this.escape(g)):$e(g)}].forEach(g=>{for(a=0;i=g.regex.exec(e);){const m=i[1].trim();if(s=l(m),s===void 0)if(typeof u=="function"){const v=u(e,i,r);s=T(v)?v:""}else if(r&&Object.prototype.hasOwnProperty.call(r,m))s="";else if(d){s=i[0];continue}else this.logger.warn(`missed to pass in variable ${m} for interpolating ${e}`),s="";else!T(s)&&!this.useRawValueToEscape&&(s=vt(s));const x=g.safeValue(s);if(e=e.replace(i[0],x),d?(g.regex.lastIndex+=s.length,g.regex.lastIndex-=i[0].length):g.regex.lastIndex=0,a++,a>=this.maxReplaces)break}}),e}nest(e,t,n={}){let r,i,s;const a=(c,l)=>{const u=this.nestingOptionsSeparator;if(c.indexOf(u)<0)return c;const d=c.split(new RegExp(`${q(u)}[ ]*{`));let h=`{${d[1]}`;c=d[0],h=this.interpolate(h,s);const g=h.match(/'/g),m=h.match(/"/g);((g?.length??0)%2===0&&!m||(m?.length??0)%2!==0)&&(h=h.replace(/'/g,'"'));try{s=JSON.parse(h),l&&(s={...l,...s})}catch(x){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,x),`${c}${u}${h}`}return s.defaultValue&&s.defaultValue.indexOf(this.prefix)>-1&&delete s.defaultValue,c};for(;r=this.nestingRegexp.exec(e);){let c=[];s={...n},s=s.replace&&!T(s.replace)?s.replace:s,s.applyPostProcessor=!1,delete s.defaultValue;const l=/{.*}/.test(r[1])?r[1].lastIndexOf("}")+1:r[1].indexOf(this.formatSeparator);if(l!==-1&&(c=r[1].slice(l).split(this.formatSeparator).map(u=>u.trim()).filter(Boolean),r[1]=r[1].slice(0,l)),i=t(a.call(this,r[1].trim(),s),s),i&&r[0]===e&&!T(i))return i;T(i)||(i=vt(i)),i||(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),i=""),c.length&&(i=c.reduce((u,d)=>this.format(u,d,n.lng,{...n,interpolationkey:r[1].trim()}),i.trim())),e=e.replace(r[0],i),this.regexp.lastIndex=0}return e}}const pn=o=>{let e=o.toLowerCase().trim();const t={};if(o.indexOf("(")>-1){const n=o.split("(");e=n[0].toLowerCase().trim();const r=n[1].substring(0,n[1].length-1);e==="currency"&&r.indexOf(":")<0?t.currency||(t.currency=r.trim()):e==="relativetime"&&r.indexOf(":")<0?t.range||(t.range=r.trim()):r.split(";").forEach(s=>{if(s){const[a,...c]=s.split(":"),l=c.join(":").trim().replace(/^'+|'+$/g,""),u=a.trim();t[u]||(t[u]=l),l==="false"&&(t[u]=!1),l==="true"&&(t[u]=!0),isNaN(l)||(t[u]=parseInt(l,10))}})}return{formatName:e,formatOptions:t}},Rt=o=>{const e={};return(t,n,r)=>{let i=r;r&&r.interpolationkey&&r.formatParams&&r.formatParams[r.interpolationkey]&&r[r.interpolationkey]&&(i={...i,[r.interpolationkey]:void 0});const s=n+JSON.stringify(i);let a=e[s];return a||(a=o(we(n),r),e[s]=a),a(t)}},fn=o=>(e,t,n)=>o(we(t),n)(e);class hn{constructor(e={}){this.logger=H.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const n=t.cacheInBuiltFormats?Rt:fn;this.formats={number:n((r,i)=>{const s=new Intl.NumberFormat(r,{...i});return a=>s.format(a)}),currency:n((r,i)=>{const s=new Intl.NumberFormat(r,{...i,style:"currency"});return a=>s.format(a)}),datetime:n((r,i)=>{const s=new Intl.DateTimeFormat(r,{...i});return a=>s.format(a)}),relativetime:n((r,i)=>{const s=new Intl.RelativeTimeFormat(r,{...i});return a=>s.format(a,i.range||"day")}),list:n((r,i)=>{const s=new Intl.ListFormat(r,{...i});return a=>s.format(a)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=Rt(t)}format(e,t,n,r={}){const i=t.split(this.formatSeparator);if(i.length>1&&i[0].indexOf("(")>1&&i[0].indexOf(")")<0&&i.find(a=>a.indexOf(")")>-1)){const a=i.findIndex(c=>c.indexOf(")")>-1);i[0]=[i[0],...i.splice(1,a)].join(this.formatSeparator)}return i.reduce((a,c)=>{const{formatName:l,formatOptions:u}=pn(c);if(this.formats[l]){let d=a;try{const h=r?.formatParams?.[r.interpolationkey]||{},g=h.locale||h.lng||r.locale||r.lng||n;d=this.formats[l](a,g,{...u,...r,...h})}catch(h){this.logger.warn(h)}return d}else this.logger.warn(`there was no format function for ${l}`);return a},e)}}const mn=(o,e)=>{o.pending[e]!==void 0&&(delete o.pending[e],o.pendingCount--)};class gn extends Ae{constructor(e,t,n,r={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=H.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,r.backend,r)}queueLoad(e,t,n,r){const i={},s={},a={},c={};return e.forEach(l=>{let u=!0;t.forEach(d=>{const h=`${l}|${d}`;!n.reload&&this.store.hasResourceBundle(l,d)?this.state[h]=2:this.state[h]<0||(this.state[h]===1?s[h]===void 0&&(s[h]=!0):(this.state[h]=1,u=!1,s[h]===void 0&&(s[h]=!0),i[h]===void 0&&(i[h]=!0),c[d]===void 0&&(c[d]=!0)))}),u||(a[l]=!0)}),(Object.keys(i).length||Object.keys(s).length)&&this.queue.push({pending:s,pendingCount:Object.keys(s).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(s),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(c)}}loaded(e,t,n){const r=e.split("|"),i=r[0],s=r[1];t&&this.emit("failedLoading",i,s,t),!t&&n&&this.store.addResourceBundle(i,s,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);const a={};this.queue.forEach(c=>{en(c.loaded,[i],s),mn(c,e),t&&c.errors.push(t),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(l=>{a[l]||(a[l]={});const u=c.loaded[l];u.length&&u.forEach(d=>{a[l][d]===void 0&&(a[l][d]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(c=>!c.done)}read(e,t,n,r=0,i=this.retryTimeout,s){if(!e.length)return s(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:i,callback:s});return}this.readingCalls++;const a=(l,u)=>{if(this.readingCalls--,this.waitingReads.length>0){const d=this.waitingReads.shift();this.read(d.lng,d.ns,d.fcName,d.tried,d.wait,d.callback)}if(l&&u&&r<this.maxRetries){setTimeout(()=>{this.read.call(this,e,t,n,r+1,i*2,s)},i);return}s(l,u)},c=this.backend[n].bind(this.backend);if(c.length===2){try{const l=c(e,t);l&&typeof l.then=="function"?l.then(u=>a(null,u)).catch(a):a(null,l)}catch(l){a(l)}return}return c(e,t,a)}prepareLoading(e,t,n={},r){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();T(e)&&(e=this.languageUtils.toResolveHierarchy(e)),T(t)&&(t=[t]);const i=this.queueLoad(e,t,n,r);if(!i.toLoad.length)return i.pending.length||r(),null;i.toLoad.forEach(s=>{this.loadOne(s)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=""){const n=e.split("|"),r=n[0],i=n[1];this.read(r,i,"read",void 0,void 0,(s,a)=>{s&&this.logger.warn(`${t}loading namespace ${i} for language ${r} failed`,s),!s&&a&&this.logger.log(`${t}loaded namespace ${i} for language ${r}`,a),this.loaded(e,s,a)})}saveMissing(e,t,n,r,i,s={},a=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${n}" 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(!(n==null||n==="")){if(this.backend?.create){const c={...s,isUpdate:i},l=this.backend.create.bind(this.backend);if(l.length<6)try{let u;l.length===5?u=l(e,t,n,r,c):u=l(e,t,n,r),u&&typeof u.then=="function"?u.then(d=>a(null,d)).catch(a):a(null,u)}catch(u){a(u)}else l(e,t,n,r,a,c)}!e||!e[0]||this.store.addResource(e[0],t,n,r)}}}const He=()=>({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:o=>{let e={};if(typeof o[1]=="object"&&(e=o[1]),T(o[1])&&(e.defaultValue=o[1]),T(o[2])&&(e.tDescription=o[2]),typeof o[2]=="object"||typeof o[3]=="object"){const t=o[3]||o[2];Object.keys(t).forEach(n=>{e[n]=t[n]})}return e},interpolation:{escapeValue:!0,format:o=>o,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Lt=o=>(T(o.ns)&&(o.ns=[o.ns]),T(o.fallbackLng)&&(o.fallbackLng=[o.fallbackLng]),T(o.fallbackNS)&&(o.fallbackNS=[o.fallbackNS]),o.supportedLngs?.indexOf?.("cimode")<0&&(o.supportedLngs=o.supportedLngs.concat(["cimode"])),typeof o.initImmediate=="boolean"&&(o.initAsync=o.initImmediate),o),De=()=>{},yn=o=>{Object.getOwnPropertyNames(Object.getPrototypeOf(o)).forEach(t=>{typeof o[t]=="function"&&(o[t]=o[t].bind(o))})},qt="__i18next_supportNoticeShown",wn=()=>!!(typeof globalThis<"u"&&globalThis[qt]||typeof process<"u"&&Me&&Me.I18NEXT_NO_SUPPORT_NOTICE||typeof process<"u"&&Me),vn=()=>{typeof globalThis<"u"&&(globalThis[qt]=!0)},bn=o=>!!(o?.modules?.backend?.name?.indexOf("Locize")>0||o?.modules?.backend?.constructor?.name?.indexOf("Locize")>0||o?.options?.backend?.backends&&o.options.backend.backends.some(e=>e?.name?.indexOf("Locize")>0||e?.constructor?.name?.indexOf("Locize")>0)||o?.options?.backend?.projectId||o?.options?.backend?.backendOptions&&o.options.backend.backendOptions.some(e=>e?.projectId));class ge extends Ae{constructor(e={},t){if(super(),this.options=Lt(e),this.services={},this.logger=H,this.modules={external:[]},yn(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,typeof e=="function"&&(t=e,e={}),e.defaultNS==null&&e.ns&&(T(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const n=He();this.options={...n,...this.options,...Lt(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=n.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!bn(this)&&!wn()&&(typeof console<"u"&&typeof console.info<"u"&&console.info("🌐 i18next is made possible by our own product, Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙"),vn());const r=l=>l?typeof l=="function"?new l:l:null;if(!this.options.isClone){this.modules.logger?H.init(r(this.modules.logger),this.options):H.init(null,this.options);let l;this.modules.formatter?l=this.modules.formatter:l=hn;const u=new St(this.options);this.store=new xt(this.options.resources,this.options);const d=this.services;d.logger=H,d.resourceStore=this.store,d.languageUtils=u,d.pluralResolver=new un(u,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==n.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"),l&&(!this.options.interpolation.format||this.options.interpolation.format===n.interpolation.format)&&(d.formatter=r(l),d.formatter.init&&d.formatter.init(d,this.options),this.options.interpolation.format=d.formatter.format.bind(d.formatter)),d.interpolator=new Ot(this.options),d.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},d.backendConnector=new gn(r(this.modules.backend),d.resourceStore,d,this.options),d.backendConnector.on("*",(g,...m)=>{this.emit(g,...m)}),this.modules.languageDetector&&(d.languageDetector=r(this.modules.languageDetector),d.languageDetector.init&&d.languageDetector.init(d,this.options.detection,this.options)),this.modules.i18nFormat&&(d.i18nFormat=r(this.modules.i18nFormat),d.i18nFormat.init&&d.i18nFormat.init(this)),this.translator=new je(this.services,this.options),this.translator.on("*",(g,...m)=>{this.emit(g,...m)}),this.modules.external.forEach(g=>{g.init&&g.init(this)})}if(this.format=this.options.interpolation.format,t||(t=De),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const l=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);l.length>0&&l[0]!=="dev"&&(this.options.lng=l[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(l=>{this[l]=(...u)=>this.store[l](...u)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(l=>{this[l]=(...u)=>(this.store[l](...u),this)});const a=fe(),c=()=>{const l=(u,d)=>{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),a.resolve(d),t(u,d)};if(this.languages&&!this.isInitialized)return l(null,this.t.bind(this));this.changeLanguage(this.options.lng,l)};return this.options.resources||!this.options.initAsync?c():setTimeout(c,0),a}loadResources(e,t=De){let n=t;const r=T(e)?e:this.language;if(typeof e=="function"&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(r?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return n();const i=[],s=a=>{if(!a||a==="cimode")return;this.services.languageUtils.toResolveHierarchy(a).forEach(l=>{l!=="cimode"&&i.indexOf(l)<0&&i.push(l)})};r?s(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(c=>s(c)),this.options.preload?.forEach?.(a=>s(a)),this.services.backendConnector.load(i,this.options.ns,a=>{!a&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(a)})}else n(null)}reloadResources(e,t,n){const r=fe();return typeof e=="function"&&(n=e,e=void 0),typeof t=="function"&&(n=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),n||(n=De),this.services.backendConnector.reload(e,t,i=>{r.resolve(),n(i)}),r}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&Kt.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1)){for(let t=0;t<this.languages.length;t++){const n=this.languages[t];if(!(["cimode","dev"].indexOf(n)>-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;const n=fe();this.emit("languageChanging",e);const r=a=>{this.language=a,this.languages=this.services.languageUtils.toResolveHierarchy(a),this.resolvedLanguage=void 0,this.setResolvedLanguage(a)},i=(a,c)=>{c?this.isLanguageChangingTo===e&&(r(c),this.translator.changeLanguage(c),this.isLanguageChangingTo=void 0,this.emit("languageChanged",c),this.logger.log("languageChanged",c)):this.isLanguageChangingTo=void 0,n.resolve((...l)=>this.t(...l)),t&&t(a,(...l)=>this.t(...l))},s=a=>{!e&&!a&&this.services.languageDetector&&(a=[]);const c=T(a)?a:a&&a[0],l=this.store.hasLanguageSomeTranslations(c)?c:this.services.languageUtils.getBestMatchFromCodes(T(a)?[a]:a);l&&(this.language||r(l),this.translator.language||this.translator.changeLanguage(l),this.services.languageDetector?.cacheUserLanguage?.(l)),this.loadResources(l,u=>{i(u,l)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?s(this.services.languageDetector.detect()):!e&&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(e),n}getFixedT(e,t,n){const r=(i,s,...a)=>{let c;typeof s!="object"?c=this.options.overloadTranslationOptionHandler([i,s].concat(a)):c={...s},c.lng=c.lng||r.lng,c.lngs=c.lngs||r.lngs,c.ns=c.ns||r.ns,c.keyPrefix!==""&&(c.keyPrefix=c.keyPrefix||n||r.keyPrefix);const l={...this.options,...c};typeof c.keyPrefix=="function"&&(c.keyPrefix=ie(c.keyPrefix,l));const u=this.options.keySeparator||".";let d;return c.keyPrefix&&Array.isArray(i)?d=i.map(h=>(typeof h=="function"&&(h=ie(h,l)),`${c.keyPrefix}${u}${h}`)):(typeof i=="function"&&(i=ie(i,l)),d=c.keyPrefix?`${c.keyPrefix}${u}${i}`:i),this.t(d,c)};return T(e)?r.lng=e:r.lngs=e,r.ns=t,r.keyPrefix=n,r}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,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 n=t.lng||this.resolvedLanguage||this.languages[0],r=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(n.toLowerCase()==="cimode")return!0;const s=(a,c)=>{const l=this.services.backendConnector.state[`${a}|${c}`];return l===-1||l===0||l===2};if(t.precheck){const a=t.precheck(this,s);if(a!==void 0)return a}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||s(n,e)&&(!r||s(i,e)))}loadNamespaces(e,t){const n=fe();return this.options.ns?(T(e)&&(e=[e]),e.forEach(r=>{this.options.ns.indexOf(r)<0&&this.options.ns.push(r)}),this.loadResources(r=>{n.resolve(),t&&t(r)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){const n=fe();T(e)&&(e=[e]);const r=this.options.preload||[],i=e.filter(s=>r.indexOf(s)<0&&this.services.languageUtils.isSupportedCode(s));return i.length?(this.options.preload=r.concat(i),this.loadResources(s=>{n.resolve(),t&&t(s)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!e)return"rtl";try{const r=new Intl.Locale(e);if(r&&r.getTextInfo){const i=r.getTextInfo();if(i&&i.direction)return i.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"],n=this.services?.languageUtils||new St(He());return e.toLowerCase().indexOf("-latn")>1?"ltr":t.indexOf(n.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){const n=new ge(e,t);return n.createInstance=ge.createInstance,n}cloneInstance(e={},t=De){const n=e.forkResourceStore;n&&delete e.forkResourceStore;const r={...this.options,...e,isClone:!0},i=new ge(r);if((e.debug!==void 0||e.prefix!==void 0)&&(i.logger=i.logger.clone(e)),["store","services","language"].forEach(a=>{i[a]=this[a]}),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},n){const a=Object.keys(this.store.data).reduce((c,l)=>(c[l]={...this.store.data[l]},c[l]=Object.keys(c[l]).reduce((u,d)=>(u[d]={...c[l][d]},u),c[l]),c),{});i.store=new xt(a,r),i.services.resourceStore=i.store}if(e.interpolation){const c={...He().interpolation,...this.options.interpolation,...e.interpolation},l={...r,interpolation:c};i.services.interpolator=new Ot(l)}return i.translator=new je(i.services,r),i.translator.on("*",(a,...c)=>{i.emit(a,...c)}),i.init(r,t),i.translator.options=r,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const E=ge.createInstance();E.createInstance;E.dir;E.init;E.loadResources;E.reloadResources;E.use;E.changeLanguage;E.getFixedT;E.t;E.exists;E.setDefaultNamespace;E.hasLoadedNamespace;E.loadNamespaces;E.loadLanguages;const{slice:Cn,forEach:Tn}=[];function xn(o){return Tn.call(Cn.call(arguments,1),e=>{if(e)for(const t in e)o[t]===void 0&&(o[t]=e[t])}),o}function Dn(o){return typeof o!="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(o))}const Ft=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Sn=function(o,e){const n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},r=encodeURIComponent(e);let i=`${o}=${r}`;if(n.maxAge>0){const s=n.maxAge-0;if(Number.isNaN(s))throw new Error("maxAge should be a Number");i+=`; Max-Age=${Math.floor(s)}`}if(n.domain){if(!Ft.test(n.domain))throw new TypeError("option domain is invalid");i+=`; Domain=${n.domain}`}if(n.path){if(!Ft.test(n.path))throw new TypeError("option path is invalid");i+=`; Path=${n.path}`}if(n.expires){if(typeof n.expires.toUTCString!="function")throw new TypeError("option expires is invalid");i+=`; Expires=${n.expires.toUTCString()}`}if(n.httpOnly&&(i+="; HttpOnly"),n.secure&&(i+="; Secure"),n.sameSite)switch(typeof n.sameSite=="string"?n.sameSite.toLowerCase():n.sameSite){case!0:i+="; SameSite=Strict";break;case"lax":i+="; SameSite=Lax";break;case"strict":i+="; SameSite=Strict";break;case"none":i+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return n.partitioned&&(i+="; Partitioned"),i},Nt={create(o,e,t,n){let r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};t&&(r.expires=new Date,r.expires.setTime(r.expires.getTime()+t*60*1e3)),n&&(r.domain=n),document.cookie=Sn(o,e,r)},read(o){const e=`${o}=`,t=document.cookie.split(";");for(let n=0;n<t.length;n++){let r=t[n];for(;r.charAt(0)===" ";)r=r.substring(1,r.length);if(r.indexOf(e)===0)return r.substring(e.length,r.length)}return null},remove(o,e){this.create(o,"",-1,e)}};var kn={name:"cookie",lookup(o){let{lookupCookie:e}=o;if(e&&typeof document<"u")return Nt.read(e)||void 0},cacheUserLanguage(o,e){let{lookupCookie:t,cookieMinutes:n,cookieDomain:r,cookieOptions:i}=e;t&&typeof document<"u"&&Nt.create(t,o,n,r,i)}},En={name:"querystring",lookup(o){let{lookupQuerystring:e}=o,t;if(typeof window<"u"){let{search:n}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(n=window.location.hash.substring(window.location.hash.indexOf("?")));const i=n.substring(1).split("&");for(let s=0;s<i.length;s++){const a=i[s].indexOf("=");a>0&&i[s].substring(0,a)===e&&(t=i[s].substring(a+1))}}return t}},Pn={name:"hash",lookup(o){let{lookupHash:e,lookupFromHashIndex:t}=o,n;if(typeof window<"u"){const{hash:r}=window.location;if(r&&r.length>2){const i=r.substring(1);if(e){const s=i.split("&");for(let a=0;a<s.length;a++){const c=s[a].indexOf("=");c>0&&s[a].substring(0,c)===e&&(n=s[a].substring(c+1))}}if(n)return n;if(!n&&t>-1){const s=r.match(/\/([a-zA-Z-]*)/g);return Array.isArray(s)?s[typeof t=="number"?t:0]?.replace("/",""):void 0}}}return n}};let Q=null;const It=()=>{if(Q!==null)return Q;try{if(Q=typeof window<"u"&&window.localStorage!==null,!Q)return!1;const o="i18next.translate.boo";window.localStorage.setItem(o,"foo"),window.localStorage.removeItem(o)}catch{Q=!1}return Q};var On={name:"localStorage",lookup(o){let{lookupLocalStorage:e}=o;if(e&&It())return window.localStorage.getItem(e)||void 0},cacheUserLanguage(o,e){let{lookupLocalStorage:t}=e;t&&It()&&window.localStorage.setItem(t,o)}};let ee=null;const jt=()=>{if(ee!==null)return ee;try{if(ee=typeof window<"u"&&window.sessionStorage!==null,!ee)return!1;const o="i18next.translate.boo";window.sessionStorage.setItem(o,"foo"),window.sessionStorage.removeItem(o)}catch{ee=!1}return ee};var Rn={name:"sessionStorage",lookup(o){let{lookupSessionStorage:e}=o;if(e&&jt())return window.sessionStorage.getItem(e)||void 0},cacheUserLanguage(o,e){let{lookupSessionStorage:t}=e;t&&jt()&&window.sessionStorage.setItem(t,o)}},Ln={name:"navigator",lookup(o){const e=[];if(typeof navigator<"u"){const{languages:t,userLanguage:n,language:r}=navigator;if(t)for(let i=0;i<t.length;i++)e.push(t[i]);n&&e.push(n),r&&e.push(r)}return e.length>0?e:void 0}},Fn={name:"htmlTag",lookup(o){let{htmlTag:e}=o,t;const n=e||(typeof document<"u"?document.documentElement:null);return n&&typeof n.getAttribute=="function"&&(t=n.getAttribute("lang")),t}},Nn={name:"path",lookup(o){let{lookupFromPathIndex:e}=o;if(typeof window>"u")return;const t=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(t)?t[typeof e=="number"?e:0]?.replace("/",""):void 0}},In={name:"subdomain",lookup(o){let{lookupFromSubdomainIndex:e}=o;const t=typeof e=="number"?e+1:1,n=typeof window<"u"&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(n)return n[t]}};let Jt=!1;try{document.cookie,Jt=!0}catch{}const Zt=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];Jt||Zt.splice(1,1);const jn=()=>({order:Zt,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:o=>o});class Qt{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(e,t)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=e,this.options=xn(t,this.options||{},jn()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=r=>r.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=n,this.addDetector(kn),this.addDetector(En),this.addDetector(On),this.addDetector(Rn),this.addDetector(Ln),this.addDetector(Fn),this.addDetector(Nn),this.addDetector(In),this.addDetector(Pn)}addDetector(e){return this.detectors[e.name]=e,this}detect(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,t=[];return e.forEach(n=>{if(this.detectors[n]){let r=this.detectors[n].lookup(this.options);r&&typeof r=="string"&&(r=[r]),r&&(t=t.concat(r))}}),t=t.filter(n=>n!=null&&!Dn(n)).map(n=>this.options.convertDetectedLanguage(n)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?t:t.length>0?t[0]:null}cacheUserLanguage(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;t&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||t.forEach(n=>{this.detectors[n]&&this.detectors[n].cacheUserLanguage(e,this.options)}))}}Qt.type="languageDetector";const An={cancel:"Cancel",create:"Create",add:"Add",remove:"Remove",delete:"Delete",close:"Close",user:"User",permission:"Permission",readOnly:"Read only",readWrite:"Read & write",settings:"Settings",comments:"Comments",files:"Files",outline:"Outline",version:"Version",loading:"Loading…",enabled:"Enabled",disabled:"Disabled",normal:"Active",admin:"Administrator",language:"Language",save:"Save",edit:"Edit",retry:"Retry",reload:"Reload page",languageEnglish:"English",languageChinese:"中文"},_n={tagline:"A lightweight LaTeX writing environment",username:"Username",password:"Password",login:"Sign in",contact:"Need an account? Contact {{email}}",firstLogin:"Change your temporary password to continue",currentPassword:"Current password",newPassword:"New password",confirmPassword:"Confirm new password",updatePassword:"Update password",mismatch:"The new passwords do not match",passwordMinimum:"At least {{count}} characters",sessionExpired:"Your session has expired. Please sign in again.",logout:"Sign out"},Mn={title:"Projects",subtitle:"Create, edit and share LaTeX documents",restricted:"You can access projects shared with you. Project creation requires administrator permission.",new:"New project",newDescription:"The project will use the configured default LaTeX engine.",name:"Project name",emptyTitle:"Let’s build something great",emptyDescription:"Create a project or upload an existing LaTeX archive to get started.",emptyRestricted:"Projects shared with you will appear here.",noMatches:"No projects match the current search or tag filter.",upload:"Upload project",uploadDescription:"Upload a ZIP archive. A single top-level folder is removed automatically. Maximum file size: {{size}} MB.",zipFile:"ZIP archive",import:"Import project",importing:"Importing…",search:"Search projects…",grid:"Grid",list:"List",scope:"Project status",active:"Active",archived:"Archived",archive:"Archive",unarchive:"Restore",noArchived:"No archived projects.",allTags:"All tags",sortBy:"Sort",sortModified:"Last modified",sortCreated:"Created",pagination:"Project pages",pageOf:"Page {{page}} of {{totalPages}} · {{count}} projects",previousPage:"Previous",nextPage:"Next",owner:"Owner",created:"Created",modified:"Last modified",mentionsColumn:"@",actions:"Actions",openProject:"Open {{project}}",projectActions:"Actions for {{project}}",relativeHoursPast:"{{hours}}h ago",relativeHoursMinutesPast:"{{hours}}h {{minutes}}m ago",relativeHoursFuture:"in {{hours}}h",relativeHoursMinutesFuture:"in {{hours}}h {{minutes}}m",relativeDaysPast:"{{days}}d ago",relativeDaysHoursPast:"{{days}}d {{hours}}h ago",relativeDaysFuture:"in {{days}}d",relativeDaysHoursFuture:"in {{days}}d {{hours}}h",comments:"Comments",unresolvedComments:"{{count}} unresolved comments",unresolvedCommentsTooltip:"{{unresolved}} unresolved / {{total}} total comments",allResolved:"All resolved ({{count}})",allCommentsResolvedTooltip:"All {{count}} comments resolved",noComments:"No comments",unresolvedCount:"{{count}} unresolved",unreadMentions:"{{count}} messages",unreadMentionsTooltip:"{{count}} unread messages",modifiedBy:"Modified by",byUser:"By {{user}}",modifiedByUser:"{{time}} · By {{user}}",deletedUser:"Deleted user",filterTags:"Filter by tag",rename:"Rename",renameTitle:"Rename project",duplicate:"Duplicate",duplicating:"Duplicating…",duplicateTitle:"Duplicate project",duplicateDescription:"Create an independent copy of {{project}}. Files and project settings are copied; members, comments, Git history and compile output are not.",transfer:"Transfer",transferOwnership:"Transfer ownership",transferDescription:"Choose a new owner for {{project}}.",newOwner:"New owner",chooseNewOwner:"Choose a user",noTransferUsers:"No other active users",transferWarning:"You will keep read/write access. Source files, history, comments and members remain; the saved GitHub token is removed so the new owner can add their own credential.",transferForbidden:"Only the current project owner can transfer ownership.",transferTargetInvalid:"Choose a new project owner.",transferSelf:"You already own this project.",download:"Download",deleteTitle:"Delete project",deleteDescription:"Permanently delete {{project}} and all of its files? This cannot be undone.",chooseZip:"Choose a ZIP project",dropZip:"Drag and drop a ZIP archive here",browse:"Browse files",selectedFileSize:"Selected · {{size}}",clearFile:"Clear selected file"},Un={title:"Choose project icon",description:"Choose a visual marker for {{project}}. This shared setting can be changed by the project owner.",change:"Change project icon",search:"Search icons…",save:"Save icon",useInitial:"Use project initial",noMatches:"No icons match “{{query}}”.",advancedName:"Advanced: Lucide icon slug",advancedNamePlaceholder:"For example: file-text",advancedNameDescription:"Enter an official Lucide short name such as file-text. Values copied from Iconify as lucide:file-text also work. This is separate from the curated search above.",advancedPreview:"Advanced icon preview",browse:"Browse Lucide icons",icons:{"file-text":{name:"Document",keywords:"document paper manuscript article text"},"book-open":{name:"Book",keywords:"book reading reference literature"},"notebook-pen":{name:"Notebook",keywords:"notebook notes writing draft"},"book-marked":{name:"Bookmarked",keywords:"book bookmark reading literature"},"scroll-text":{name:"Scroll",keywords:"scroll text manuscript archive"},library:{name:"Library",keywords:"library references literature collection"},"graduation-cap":{name:"Thesis",keywords:"thesis dissertation degree academic"},presentation:{name:"Presentation",keywords:"presentation slides talk report"},image:{name:"Image",keywords:"image figure visual photo"},"folder-kanban":{name:"Project",keywords:"project board tasks planning"},microscope:{name:"Research",keywords:"research microscope experiment science"},"flask-conical":{name:"Experiment",keywords:"experiment chemistry laboratory flask"},"test-tube-diagonal":{name:"Chemistry",keywords:"chemistry test laboratory experiment"},atom:{name:"Physics",keywords:"physics atom science"},dna:{name:"Biology",keywords:"biology genetics dna life"},telescope:{name:"Astronomy",keywords:"astronomy telescope space"},earth:{name:"Earth",keywords:"earth global geography world"},map:{name:"Map",keywords:"map geography location spatial"},languages:{name:"Languages",keywords:"languages translation multilingual"},university:{name:"University",keywords:"university education academic"},landmark:{name:"Economics",keywords:"economics finance policy institution"},scale:{name:"Law",keywords:"law justice policy balance"},"code-2":{name:"Code",keywords:"code programming software development"},"file-code-2":{name:"Source code",keywords:"source code program file software"},database:{name:"Database",keywords:"database data storage"},server:{name:"Server",keywords:"server system infrastructure"},network:{name:"Network",keywords:"network graph connection"},"circuit-board":{name:"Engineering",keywords:"engineering circuit hardware electronics"},brain:{name:"Thinking",keywords:"thinking cognition mind"},"brain-circuit":{name:"AI",keywords:"artificial intelligence ai machine learning"},bot:{name:"Automation",keywords:"bot robot automation"},"shield-check":{name:"Security",keywords:"security protection privacy"},"lock-keyhole":{name:"Encryption",keywords:"lock encryption privacy security"},workflow:{name:"Workflow",keywords:"workflow process pipeline"},blocks:{name:"Modules",keywords:"modules blocks components build"},sigma:{name:"Mathematics",keywords:"mathematics formula statistics sigma"},calculator:{name:"Calculation",keywords:"calculation arithmetic mathematics"},"function-square":{name:"Function",keywords:"function mathematics formula"},"chart-no-axes-combined":{name:"Analysis",keywords:"analysis chart data"},"line-chart":{name:"Trend",keywords:"trend line chart data"},"bar-chart-3":{name:"Bar chart",keywords:"bar chart statistics data"},"pie-chart":{name:"Pie chart",keywords:"pie chart distribution data"},"chart-scatter":{name:"Scatter plot",keywords:"scatter plot data analysis"},"chart-spline":{name:"Curve",keywords:"curve spline data analysis"},"file-spreadsheet":{name:"Spreadsheet",keywords:"spreadsheet table data workbook"},"file-chart-column-increasing":{name:"Report",keywords:"report chart data results"},lightbulb:{name:"Idea",keywords:"idea inspiration creative"},rocket:{name:"Innovation",keywords:"innovation launch progress"},target:{name:"Goal",keywords:"goal target focus"},sparkles:{name:"General",keywords:"general sparkle highlight"},"wand-sparkles":{name:"Tools",keywords:"tools magic optimize utility"},"file-pen-line":{name:"Manuscript",keywords:"manuscript draft writing paper document"},"file-stack":{name:"File collection",keywords:"files stack documents collection"},folder:{name:"Folder",keywords:"folder directory files"},"folder-open":{name:"Open folder",keywords:"folder directory files open"},"folder-archive":{name:"Archived files",keywords:"folder archive files storage"},archive:{name:"Archive",keywords:"archive storage history"},book:{name:"Closed book",keywords:"book reading literature reference"},bookmark:{name:"Bookmark",keywords:"bookmark reference reading"},newspaper:{name:"Paper",keywords:"paper newspaper publication article"},"notepad-text":{name:"Notes",keywords:"notes notepad writing ideas"},"sticky-note":{name:"Sticky note",keywords:"note reminder idea"},"pen-tool":{name:"Writing",keywords:"writing pen author edit"},quote:{name:"Quotation",keywords:"quote citation reference text"},"list-tree":{name:"Outline",keywords:"outline structure chapters list tree"},"file-search":{name:"Search documents",keywords:"search documents research files"},beaker:{name:"Beaker",keywords:"beaker chemistry laboratory science"},"test-tubes":{name:"Tests",keywords:"test tubes laboratory experiment science"},syringe:{name:"Medicine",keywords:"medicine health clinical syringe"},radiation:{name:"Nuclear science",keywords:"radiation nuclear physics science"},satellite:{name:"Satellite",keywords:"satellite space remote sensing"},"map-pinned":{name:"Location",keywords:"location map pin geography"},route:{name:"Route",keywords:"route path transport geography"},"folder-git-2":{name:"Git repository",keywords:"git repository version control source"},"git-branch":{name:"Branch",keywords:"git branch version control"},"git-commit-horizontal":{name:"Commit",keywords:"git commit version control"},terminal:{name:"Terminal",keywords:"terminal command shell developer"},braces:{name:"Syntax",keywords:"syntax code programming braces"},regex:{name:"Regular expression",keywords:"regex regular expression search code"},binary:{name:"Binary",keywords:"binary bits data computing"},cpu:{name:"Computing",keywords:"cpu processor computing hardware"},"hard-drive":{name:"Storage",keywords:"storage disk drive data"},cloud:{name:"Cloud",keywords:"cloud infrastructure storage network"},wifi:{name:"Wireless",keywords:"wifi wireless network connection"},radar:{name:"Sensing",keywords:"radar sensing signal research"},"key-round":{name:"Access key",keywords:"key access authentication security"},fingerprint:{name:"Identity",keywords:"identity fingerprint authentication security"},shield:{name:"Protection",keywords:"protection security privacy shield"},bug:{name:"Debugging",keywords:"bug debugging software issue"},wrench:{name:"Maintenance",keywords:"maintenance tools repair engineering"},"chart-column":{name:"Column chart",keywords:"column chart data statistics"},"chart-candlestick":{name:"Candlestick chart",keywords:"candlestick chart finance data"},gauge:{name:"Metric",keywords:"metric gauge measurement performance"},activity:{name:"Activity",keywords:"activity signal monitoring health"},"table-2":{name:"Data table",keywords:"table data rows columns"},waypoints:{name:"Pipeline",keywords:"pipeline workflow waypoints process"},boxes:{name:"Components",keywords:"components boxes modules system"},package:{name:"Package",keywords:"package dependency software module"},"users-round":{name:"Team",keywords:"team users collaboration group"},"calendar-days":{name:"Schedule",keywords:"schedule calendar deadline planning"}}},$n={manage:"User management",back:"Back to projects",onlyAdmin:"Only administrators can create users",add:"Add user",role:"Role",createProjects:"Create projects",ownedProjects:"Owned projects",status:"Status",actions:"Actions",adminRequired:"Administrator permission is required.",allow:"Allow",deny:"Deny",enable:"Enable",disable:"Disable",promote:"Make administrator",demote:"Make user",allowCreate:"Allow creation",denyCreate:"Deny creation",resetPassword:"Reset password",initialPassword:"Login password",displayName:"Display name",addDescription:"Set a login password or generate a secure random one.",createUser:"Create user",randomPassword:"Random password",generatePassword:"Generate a random password",resetDescription:"Set a temporary password for {{username}}. Existing sessions will be signed out.",reset:"Reset",deleteTitle:"Delete user",deleteDescription:"Delete {{username}}? This cannot be undone.",ownedChoice:"{{count}} owned projects",transferProjects:"Transfer them to the current administrator",deleteProjects:"Permanently delete projects and files"},Hn=JSON.parse(`{"saved":"Saved","savedAt":"Saved to server at {{time}}","loading":"Loading","pending":"Waiting to save","saving":"Saving to server","saveFailed":"Save failed","offlineDraft":"Offline · local draft retained","harperRecoveryTitle":"Harper is unavailable.","harperFallbackHint":" The browser's built-in spellchecker is being used instead.","texFmtRecoveryTitle":"tex-fmt could not load.","texFmtOptionsRecoveryTitle":"tex-fmt rejected the source or options.","texFmtRuntimeRecoveryTitle":"tex-fmt returned an unexpected result.","clientToolRecoveryHint":" Retry now, or reload the page to use the latest browser assets.","resetFormatterOptions":"Clear options and retry","formattingBy":"{{name}} is formatting this file. Please wait…","compile":"Compile · {{engine}}","compiling":"Compiling…","compileQueued":"Compile queued…","compileFailedRetained":"Compilation failed; showing the last successful PDF from {{time}}.","compileFailedNoPdf":"Compilation failed and no successful PDF is available.","upToDate":"Files are up to date; no compilation was needed.","compileSnapshotStale":"PDF compiled from a consistent earlier snapshot; newer source changes are not included.","addComment":"Add comment","sourceComments":"Source comments","mentionUsers":"Mention project members","mentionedYou":"Mentioned you","markMentionRead":"Mark as read","markAllMentionsRead":"Mark all read","projectSettings":"Project settings","uploadAttachment":"Upload attachment","newFile":"New text file","binary":"The binary attachment is stored but cannot be opened in the text editor.","noOutline":"No sections in this file","wordCountTitle":"Word count","wordCountFull":"Full","wordCountSelection":"Selected","wordCountFullHint":"Count the current main document and included TeX files","wordCountSelectionHint":"Count the selected LaTeX source","wordCountLoading":"Running TeXcount…","wordCountTotal":"Total words","wordCountCharacters":"Characters","wordCountCharactersHint":"Excludes spaces and punctuation","wordCountText":"Body text","wordCountHeaders":"Headings","wordCountCaptions":"Captions","wordCountFloats":"Figures / tables","wordCountInlineMath":"Inline math","wordCountDisplayMath":"Displayed math","wordCountFiles":"Included files","wordCountWordsUnit":"words","wordCountItemsUnit":"items","wordCountExpressionsUnit":"expressions","wordCountParserErrors":"TeXcount reported {{count}} parsing issues.","wordCountSelectionEmpty":"Select LaTeX source before counting.","wordCountSaveRequired":"The latest editor changes could not be saved, so the count was cancelled.","wordCountFailed":"TeXcount could not count this source.","wordCountSourceInvalid":"Select LaTeX source text to count.","wordCountSourceTooLarge":"The selected source is too large to count.","wordCountUnavailable":"TeXcount is not available on this server. Install it from TeX Live and try again.","wordCountHelp":"About TeXcount","wordCountTemplateNote":"Custom %TC:newtemplate or %TC:template directives can override TexLite's report format and prevent a result.","preview":"PDF preview","previewHint":"Compile to generate the document","loadingPdf":"Loading PDF…","pdfCompiledAt":"Compiled successfully at {{time}}","pdfCompiledAtFor":"{{file}} compiled successfully at {{time}}","currentMainDocument":"Current document compiled as the root: {{path}}","mainDocumentCandidate":"LaTeX root document candidate: {{path}}","currentMainShort":"root","deletedUser":"Deleted User","orphaned":"Anchor lost","line":"Line {{line}}","reopen":"Reopen","resolve":"Mark resolved","noComments":"No comments in this file","newFileDescription":"Directories are allowed, for example chapters/introduction.tex.","filePath":"File path","commentDescription":"Selected {{count}} characters","pointComment":"No text selected; the comment will be anchored at the cursor.","commentContent":"Comment","backToProjects":"Back to projects","outputTabs":"Compile output","log":"Log","warnings":"Warnings","errors":"Errors","artifacts":"Artifacts","clean":"Recovery","noLog":"Compile to see the log.","noWarnings":"No warnings in the latest compile.","noErrors":"No errors in the latest compile.","projectRoot":"Project root","uploadTo":"Upload to {{folder}}","dropFiles":"Drop files to upload","newFolder":"New folder","folderName":"Folder name","noArtifacts":"Compile to see generated artifacts.","selectArtifact":"Select a text artifact to preview it.","viewArtifact":"View artifact","downloadArtifact":"Download artifact","downloadToView":"Download this artifact to view it","cleanTitle":"Compilation recovery","cleanDescription":"Use these advanced actions only when compilation is stuck, a previous error is left behind, or generated output is inconsistent. They do not change source files, project settings, comments, history, or Git data.","cleanCache":"Force a clean rebuild","cleanCacheDescription":"Use after a compilation failure or stale latexmk state. Removes the incremental cache while keeping the current successful PDF.","cleanArtifacts":"Remove generated output","cleanArtifactsDescription":"Use when generated files are inconsistent. Removes the PDF, SyncTeX, logs, and intermediate files for this root document.","cleanCacheConfirmTitle":"Force a clean rebuild?","cleanCacheConfirmDescription":"This recovery action removes the incremental latexmk cache. The current PDF remains visible, and the next compilation starts from a clean cache.","cleanArtifactsConfirmTitle":"Remove generated output?","cleanArtifactsConfirmDescription":"This recovery action removes the current PDF and all generated files for this root document. Source files are not affected.","cleanConfirm":"Run recovery","cleanCacheComplete":"Recovery cache cleared. The next compilation will be a full rebuild.","cleanArtifactsComplete":"Generated compilation output removed.","cleanBusy":"This root document is compiling. Try recovery again after it finishes.","folderDestination":"The folder will be created in {{folder}}.","uploadOverwriteTitle":"File already exists","uploadOverwriteDescription":"These files already exist: {{files}}. Replace them?","uploadOverwrite":"Replace files","collapseFiles":"Collapse file panel","showFileSizes":"Show file sizes","hideFileSizes":"Hide file sizes","move":"Move","moveTitle":"Move or rename {{name}}","moveDescription":"Choose a destination folder and name. Files, comments and project paths stay linked.","pathName":"Name","moveApply":"Move / rename","deletePath":"Delete file or folder","deletePathTitle":"Delete {{name}}","deletePathDescription":"Delete {{path}}? This cannot be undone.","deletePathActiveDescription":"Delete {{path}}? It is currently open for {{users}} and will close in those sessions.","deletePathWillClose":"Any late edits to this path will be rejected to prevent silent data loss.","fileDeletedByCollaborator":"{{path}} was deleted in another session. A safe fallback file has been opened.","destinationFolder":"Destination folder","compileShortcut":"Save and compile (Ctrl+S / Cmd+S)","compilingBy":"{{name}} is compiling","format":"Format","formatFile":"File","formatFileHint":"Format the current file","formatFileComplete":"Current file formatted.","formatFileFailed":"Unable to format the current file: {{message}}","formatSelected":"Selected","commentsAdd":"Add","commentsAll":"View","formatSelection":"Format selection","formatting":"Formatting…","formatSelectionHint":"Select LaTeX source to format","formatSelectionRequired":"Select LaTeX source before formatting.","formatSelectionComplete":"Selected LaTeX source formatted.","formatFailedContinue":"Formatting failed; compilation will continue: {{message}}","formatFailed":"Unable to format the selection: {{message}}","formatSourceChanged":"The source changed during formatting, so formatting was skipped.","formatSelectionChanged":"The selected source changed during formatting. Select it again and retry.","writingSuggestions":"Writing suggestions","noWritingSuggestions":"No suggestions available","removeText":"Remove text","replaceWith":"Replace with {{word}}","spellCheckReadOnly":"Read-only: choose a suggestion in an editor with write permission.","spellCheckSourceChanged":"The source changed before the writing correction could be applied.","mathPreview":"Math preview","mathPreviewLoading":"Rendering math…","mathPreviewUnavailable":"This formula cannot be previewed.","vimOn":"Vim ON","vimOnHint":"Vim keybindings are enabled for this editor.","reply":"Reply","replyPlaceholder":"Write a reply…","sendReply":"Send reply","editComment":"Edit comment","deleteComment":"Delete comment","saveChanges":"Save changes","deleteCommentTitle":"Delete comment","deleteCommentDescription":"Delete this comment and its {{count}} replies? This cannot be undone.","editReply":"Edit reply","deleteReply":"Delete reply","deleteReplyTitle":"Delete reply","deleteReplyDescription":"Delete this reply? This cannot be undone.","editedAt":"Edited {{time}}","outlineJump":"Go to source line {{line}} and locate it in the PDF","lineNumber":"line {{line}}","showInSource":"Show the visible PDF location in source","showInPdf":"Show the source cursor location in PDF","syncTexOnlyForTex":"PDF sync is only available for TeX (.tex) files","syncTexOnlyForMain":"PDF sync is only available for the current main TeX document","openFiles":"Open files","pdfLoadFailed":"The PDF preview could not be loaded","pdfZoomControls":"PDF zoom controls","downloadPdf":"Download PDF","downloadResource":"Download file","resourceTooLarge":"This file is {{size}} and exceeds the direct preview limit of {{limit}}.","resourceTooLargeTitle":"File is too large to preview","resourceTooLargeDescription":"Download the file to open it locally.","resourceUnsupportedTitle":"Preview unavailable","resourceUnsupportedDescription":"This file type cannot be rendered in the browser. Download it to open it locally.","resourcePreview":{"image":"Image preview","pdf":"PDF preview","text":"Text preview","unsupported":"File preview"},"pdfZoomOut":"Zoom out","pdfZoomIn":"Zoom in","pdfFitWidth":"Fit width","pdfLink":"PDF link","pdfLinks":"PDF links","layout":{"label":"Layout","choose":"Choose layout","current":"Current layout: {{layout}}","editor-pdf":{"name":"Editor & PDF","description":"Show the source editor and PDF preview side by side"},"editor-only":{"name":"Editor only","description":"Use the workspace for source editing"},"pdf-only":{"name":"PDF only","description":"Use the workspace for the PDF and compile output"}},"collaboration":{"connecting":"Connecting collaboration…","connected":"Live collaboration connected","disconnected":"Collaboration disconnected","editing":"Editing","viewing":"Viewing","joining":"Joining project","reconnect":"Reconnect","permissionDowngradeTitle":"Edit permission changed","permissionDowngradeDescription":"Your access changed from {{previous}} to read-only. Any unsaved local draft is still retained in this tab and cannot be saved. Keep it visible, or discard it and reload the latest server version.","permissionDowngradeKeep":"Keep local draft","permissionDowngradeDiscard":"Discard draft and reload","permissionDowngradeReload":"Reload server version","permissionDowngradeNoDraft":"Your access changed to read-only. Reload to use the latest server version, or continue viewing this tab.","permissionDowngradeOtherTab":"Your access changed to read-only. Another browser tab still has an unsaved draft; return to that tab to handle it. This page cannot clear the shared local draft safely.","permissionDowngradeMultipleDrafts":"Your access changed to read-only. This tab and another browser tab both have unsaved drafts. Handle the other tab first; this page will not clear shared local data.","permissionDowngradeOtherTabBlocked":"Another browser tab just created an unsaved draft, so cleanup was cancelled to protect it.","activeSessions":"{{count}} active sessions","showMoreSessions":"Show {{count}} more sessions","showFewerSessions":"Collapse session list","sessionTooltip":"{{name}} (@{{username}}) · {{file}} · {{activity}} · {{permission}}"},"search":{"button":"Find","title":"Find and replace (Ctrl+F / Cmd+F)","find":"Find","replace":"Replace","next":"Next","previous":"Previous","all":"Select all","matchCase":"Match case","regexp":"Regular expression","wholeWord":"Whole word","replaceNext":"Replace","replaceAll":"Replace all","currentMatch":"Current match","onLine":"on line","replacedMatchOnLine":"replaced match on line $","replacedMatches":"replaced $ matches","goToLine":"Go to line","go":"Go","matchCount":"{{count}} matches","noMatches":"No matches","invalidQuery":"Invalid regular expression"}}`),Bn={title:"Citation library",description:"Save references from {{file}} and import them into this BibTeX file. Your library and its tags are private to your account.",myLibrary:"My library",currentFile:"Current file",searchPlaceholder:"Search citations…",searchHint:"Search key, title, author, or year",emptyTitle:"Your library is empty",emptyDescription:"Open the current-file tab to save a BibTeX entry.",noEntries:"No BibTeX entries found",noEntriesDescription:"Add a valid @article, @inproceedings, or similar entry to this file.",currentFileTitle:"Entries from the current file",currentFileDescription:"Select an entry to save it to your citation library.",backToLibrary:"Back to library",save:"Save",update:"Update",saving:"Saving…",saved:"Citation saved to your library.",updated:"Citation updated.",deleted:"Citation deleted.",deleteTitle:"Delete citation",deleteDescription:"Delete the citation {{key}} from your private library? This cannot be undone.",fileTooLarge:"This BibTeX file exceeds the {{size}} limit.",fileTooLargeHint:"The file is too large to parse in the browser. Save individual entries from a smaller file or split it first.",fileInvalid:"The current BibTeX file contains syntax errors.",fileInvalidHint:"Fix the current file before formatting it or importing another citation.",savedLabel:"Saved",import:"Import",importToFile:"Import into the current BibTeX file",importRequiresWrite:"Import requires write permission for this project.",imported:"Imported {{key}} into the current file.",untitled:"Untitled citation",authorUnknown:"Author not specified",allTags:"All tags",noTags:"No tags yet",noTagMatches:"No citations match this tag.",newTagPlaceholder:"New tag name",tagColor:"Tag color",createTag:"Create tag",tagCreated:"Tag created.",tags:"Tags",tagsTitle:"Tags for {{key}}",noTagsToAssign:"Create a tag first.",saveTags:"Save tags",tagsUpdated:"Tags updated.",editTitle:"Edit {{key}}"},Vn={invalid:"Enter one valid BibTeX entry.",tooLarge:"This BibTeX entry is too large.",notFound:"The citation does not exist.",keyExists:"That citation key already exists. Review the existing entry before replacing it.",tagNotFound:"The citation tag does not exist.",conflict:"This citation changed elsewhere. Refresh the library and try again.",alreadyInFile:"{{key}} is already present in this BibTeX file."},Wn="Manage your private BibTeX references and tags from the homepage. Open a .bib file to save or import entries.",Xn={addEntry:"Add entry",addEntryTitle:"Add a BibTeX entry",addEntryDescription:"Paste one complete BibTeX entry. It will be validated before it is saved.",addEntryPlaceholder:`@article{key,
|
|
3
|
-
author = {Author},
|
|
4
|
-
title = {Title},
|
|
5
|
-
year = {2026}
|
|
6
|
-
}`,added:"Citation added to your library."},zn={pageOf:"Page {{page}} of {{totalPages}} · {{count}} entries",previous:"Previous",next:"Next"},Gn={quickOpen:"Quick open",quickOpenDescription:"Open a project file by name (Ctrl/Cmd+P).",filePlaceholder:"Type a file name…",noFiles:"No matching files.",projectSearch:"Project search",projectSearchDescription:"Search and replace across project source files (Ctrl/Cmd+Shift+F).",searchPlaceholder:"Search all source files…",replacePlaceholder:"Replace with…",matchSummary:"{{count}} matches",truncated:"Showing the first {{count}} matches.",replaceAll:"Replace all {{count}}",replaceConfirmTitle:"Replace across the project",replaceConfirmDescription:"Replace all {{count}} matches? Automatic history records every changed file first.",replaced:"Replaced {{count}} matches in {{files}} files."},Kn={saveWarning:"Source files were saved, but some history could not be saved. Recent failures are retried automatically; older history may be incomplete. Check server logs and available storage.",storageBreakdown:"Files {{objects}} · Metadata {{metadata}} · Protected {{protected}}",title:"History",projectSnapshots:"Project snapshots",projectSnapshotsButton:"Snapshots",description:"Browse automatic project snapshots, compare files and safely restore earlier work.",empty:"No project snapshots yet.",loadOlder:"Load older snapshots",changedCount:"{{count}} changed files",fileCount:"{{count}} files",changed:"changed",labelPlaceholder:"Name this version",saveLabel:"Save label",compareCurrent:"Compare with current",comparingCurrent:"Earlier snapshot compared with the current file",chooseFile:"Choose a file, then compare it with the current source.",changedFilesHeading:"Changed files ({{count}})",noChangedFiles:"No files were changed in this snapshot.",noDifferences:"This file is identical between the snapshot and current version.",noDifferencesInCommit:"This file was not changed in this edit.",historicalVersion:"Historical snapshot",currentVersion:"Current version",diffMode:"Diff mode",diffModeCommit:"This edit",diffModeCommitHint:"View changes made in this snapshot compared to previous",diffModeCurrent:"vs Current",diffModeCurrentHint:"Compare this snapshot with current project source",changedAt:"changed at {{time}}",createdAt:"created at {{time}}",previousVersion:"Previous snapshot",restore:"Restore",restoreFile:"Restore file",restoreProject:"Restore project",restoreFileTitle:"Restore this file",restoreProjectTitle:"Restore this project snapshot",restoreFileDescription:"Restore {{path}} from this snapshot? The current project is checkpointed first.",restoreProjectDescription:"Restore all source files and compiler settings from this snapshot? The current project is checkpointed first.",storage:"Snapshot storage",storageUsage:"{{used}} of {{limit}}",versionUsage:"{{count}} of {{limit}} ordinary snapshots",protectedVersions:"{{count}} labeled",storageExceeded:"Protected or current data exceeds the soft storage limit.",deleteVersion:"Delete snapshot",deleteVersionTitle:"Delete this project snapshot",deleteVersionDescription:"Permanently delete {{name}}? Current project files and selection history are not changed.",clearAll:"Clear snapshots",clearAllTitle:"Clear all project snapshots",clearAllDescription:"Permanently delete every project snapshot and its unreferenced stored data? Current project files and selection history are not changed.",reasons:{initial:"Project created",autosave:"Automatic save",file:"File operation",settings:"Compiler settings",git:"Git operation",restore:"Restored version",checkpoint:"Safety checkpoint"}},Yn={storageUsage:"Edit history: {{used}} / {{limit}} MiB · {{count}} segments",storageDescription:"Project-wide edit payload, separate from snapshots. Shared database overhead is excluded.",clearAll:"Clear project edit history",clearDescription:"Delete edit history for every file in this project? Source files and recovery snapshots will remain. New edits will continue to be recorded. This cannot be undone.",limited:"Showing the latest {{count}} editing windows. Older edits are not displayed.",sourceChanged:"The source changed. Wait for synchronization, then select the passage and open its history again.",title:"Selection history",buttonLabel:"Edits",selectSourceHint:"Select source text to inspect its edit history.",description:"Editing windows affecting {{path}} · {{count}} selected characters.",emptyTitle:"No saved edits for this selection",emptyDescription:"Continue editing and saving to build its edit history.",boundary:"This selection's history begins after a file replacement, restore, or older-record retention boundary.",changedBy:"Changed by",contentTab:"Content",diffTab:"Diff",view:"Selection history view",previousVersion:"Earlier state",currentVersion:"This state",noPrevious:"No earlier selected state is available for comparison.",diffUnavailable:"A comparison is unavailable because one selected state could not be reconstructed exactly.",noDiff:"No textual difference from the preceding selected state.",contentTruncated:"Selected content shortened.",contentUnavailable:"Selected content for this earlier state is unavailable because a very large change could not be reconstructed exactly."},qn={mainFile:"Main document",invalidMainFileOption:"{{path}} (not a root document)",engine:"Compiler",latexmkrc:"Project latexmkrc",save:"Save project settings",members:"Shared members",recentLog:"Latest compile log",share:"Share",shareDescription:"Projects can only be shared with users created by an administrator.",chooseUser:"Choose a user",latexmkrcPlaceholder:`# Empty disables the project rc file
|
|
7
|
-
$pdf_mode = 1;`,addMember:"Add member",noMembers:"This project has not been shared with anyone.",removeTitle:"Remove shared member",removeDescription:"Remove {{username}}? Their account and other projects are unaffected.",editorTab:"Editor appearance",compilerTab:"LaTeX compiler",compilerDescription:"Choose the main document and compiler options shared by everyone in this project.",editorAppearance:"Editor appearance",editorAppearanceDescription:"These preferences are private to this user and project on this browser. The project dictionary is shared.",browserTools:"Formatting tools",toolStatus:{loading:"Loading",working:"Working",error:"Error"},reloadTool:"Reload",saveAppearance:"Save appearance",saveCompiler:"Save compiler settings",writingCheckDescription:"TexLite uses the optional host-installed Harper CLI. If it is unavailable, the browser spellchecker takes over. Spelling issues use a red wavy underline; grammar issues use yellow. Right-click an issue for suggestions.",projectConfiguration:"Project configuration",fontFamily:"English font",fontSize:"Font size",lineHeight:"Line spacing",dictionary:"Project dictionary",dictionaryDescription:"Words added here are ignored after Harper returns this project's spelling diagnostics. Editors can maintain this list.",dictionaryPlaceholder:"Add a custom word",addWord:"Add word",dictionaryEmpty:"No custom words yet.",lineWrapping:"Wrap long lines",mathPreviewOnHover:"Preview math on hover",mathPreviewOnHoverDescription:"Render common LaTeX formulas when you hover over them in the editor.",spellCheck:"Spelling and grammar checking",vimMode:"Vim keybindings",vimModeDescription:"Use Vim normal/insert/visual modes in this editor.",vimHelp:"View help",formatOnCompile:"Format LaTeX before compiling",formatOnCompileDescription:"Off by default. Formatting runs before compilation.",formatRequiresWrite:"Formatting requires permission to edit this project.",formatterDescription:"Tex, cls, and sty files use the bundled browser-side tex-fmt WASM formatter; BibTeX files use browser-side bibtex-tidy.",formatterInstall:"View tex-fmt",bibtexTidyInstall:"View bibtex-tidy",texFmtOptions:"tex-fmt options (TOML)",texFmtOptionsPlaceholder:"wrap = false",texFmtOptionsDescription:"These options are stored only in this browser and isolated by the current user and project. They are passed directly to tex-fmt.",openFilesInTabs:"Open LaTeX files in editor tabs",openFilesInTabsDescription:"Open .tex, .bib, .sty and other source files in tabs at the top of the editor.",writingIssues:"{{count}} writing issues ({{uniqueCount}} unique)",noWritingIssues:"No spelling or grammar issues found.",spellCheckFirst:"First writing issue",spellCheckPrevious:"Previous writing issue",spellCheckNext:"Next writing issue",spellCheckLast:"Last writing issue",spellCheckPosition:"{{current}}/{{total}}",fontJetBrains:"JetBrains Mono",fontSourceCode:"Source Code Pro",fontIbmPlex:"IBM Plex Mono",fontFiraCode:"Fira Code",fontIosevka:"Iosevka",lineHeightCompact:"Compact",lineHeightNormal:"Normal",lineHeightRelaxed:"Relaxed"},Jn={title:"Git backup",description:"Manage the local Git history and its GitHub backup. Only the project owner can use these actions.",ownerOnly:"Only the project owner can use Git backup.",authentication:"GitHub authentication",authenticationHint:"Use a token with repository Administration and Contents write access. It is encrypted at rest and never written to the repository or remote URL.",recommendedAccessTitle:"Recommended repository access: All repositories",recommendedAccess:"texLite is intended for trusted users. Select All repositories so this token can create a repository and access repositories created later. Grant Administration and Contents read and write permissions.",token:"Personal access token",tokenPlaceholder:"Paste your GitHub token",replaceToken:"Replace personal access token",saveToken:"Save and verify token",createToken:"Create a fine-grained token",connectedAs:"Connected as @{{login}}",removeToken:"Remove token",tokenSaved:"GitHub token saved; the local repository is ready.",tokenRemoved:"GitHub token removed.",repository:"Repository",localReady:"The project source is managed by a local Git repository.",localPending:"Saving a valid token initializes the local Git repository.",repositoryName:"GitHub repository name",privateRepository:"Create as a private repository",createRepository:"Create GitHub repository",repositoryCreated:"GitHub repository created.",origin:"origin",openGitHub:"Open GitHub",clean:"Working tree clean",changedFiles:"{{count}} changed files",commitAndPush:"Commit and push",identity:"Commits use {{username}} <{{username}}@texlite.com> for this command only.",detachedHead:"Detached HEAD: return to the default branch before committing or pushing.",detachedAt:"detached at {{revision}}",commitMessage:"Commit message",commitPlaceholder:"Describe this backup…",commit:"Commit",committed:"Changes committed.",noChangesToCommit:"There are no new changes to commit.",push:"Push",pushed:"Push succeeded. The backup is up to date on GitHub.",pushFailed:"Push failed",workingDiff:"Working diff",refresh:"Refresh",diffTitle:"Diff",diffTruncated:"output truncated",diffFontSize:"Diff font size",diffFontDecrease:"Decrease diff font size",diffFontIncrease:"Increase diff font size",fullscreenDiff:"View diff full screen",exitFullscreenDiff:"Exit full screen",noChanges:"No differences to display.",history:"History",historyHint:"Up to 100 recent commits",noCommits:"No commits yet.",viewCommitDiff:"View this commit's diff",checkoutVersion:"Checkout this version",checkoutTitle:"Checkout version",checkout:"Checkout",checkoutDescription:"Checkout {{revision}} — {{message}}. By default Git preserves compatible uncommitted changes and refuses conflicts.",forceCheckout:"Force overwrite",forceCheckoutDescription:"Explicitly discard tracked and untracked working changes before checkout. This cannot be undone.",returnToBranch:"Return to {{branch}}",returnTitle:"Return to default branch",returnDescription:"Checkout {{branch}}. By default Git preserves compatible uncommitted changes and refuses conflicts.",discardChanges:"Discard changes",noChangesToDiscard:"There are no changes to discard.",discardTitle:"Discard uncommitted changes",discardDescription:"Restore all tracked files to the current HEAD commit. Untracked files are unaffected.",discardConfirm:"Discard changes"},Zn={title:"System status",description:"Live server health and recent operation latency. Values refresh every five seconds.",refresh:"Refresh",uptime:"Uptime",memory:"Memory",heap:"heap",compileQueue:"Compile jobs",pending:"{{count}} pending",collaboration:"Collaboration",sessions:"{{count}} sessions",roomsAndDirty:"{{rooms}} rooms · {{dirty}} dirty files",eventLoop:"Event-loop latency",latencySummary:"P50 {{p50Ms}} ms · P95 {{p95Ms}} ms · max {{maxMs}} ms",operationDurations:"Recent operation durations",noSamples:"No operation samples have been collected yet.",operation:"Operation",samples:"Samples",last:"Last",max:"Max",operations:{collaboration:{connect:"Open collaboration room",persist:"Save collaboration changes"},workspace:{project:"Load project metadata",files:"Load project files",compileState:"Load retained PDF state"},compile:{snapshot:"Prepare compile snapshot",request:"Compile request total",cacheSync:"Update compiler cache",latexmk:"Run latexmk",artifactCopy:"Publish compile artifacts"},outline:{build:"Build project outline"},search:{project:"Search project"},completions:{build:"Build completion index"}}},Qn={title:"Tags",add:"Add tag",create:"Create tag",createDescription:"Create a private reusable colored tag for organizing your projects.",manage:"Manage tags",manageDescription:"Create and organize private labels for your projects. Deleting a tag only removes its project associations.",createInManager:"Create tag",edit:"Edit",rename:"Rename",deleteTitle:"Delete tag",deleteDescription_one:"Delete {{tag}}? It will be removed from {{count}} project.",deleteDescription_other:"Delete {{tag}}? It will be removed from {{count}} projects.",projectCount_one:"{{count}} project",projectCount_other:"{{count}} projects",noTags:"No tags yet. Create one to organize your projects.",none:"No tags yet",assign:"Tags",assignTitle:"Tags for {{project}}",assignDescription:"Select your private tags for this project.",empty:"Create a tag first.",allAssigned:"All available tags are already assigned.",name:"Tag name",color:"Color",filter:"Filter",red:"Red",orange:"Orange",yellow:"Yellow",green:"Green",blue:"Blue",purple:"Purple",gray:"Gray"},er={generic:"Operation failed",request:"Request failed ({{status}})",upload:"Upload failed",boundaryTitle:"Something went wrong",boundaryDescription:"An unexpected error occurred while rendering the page. You can try recovering, or reload the page.",boundaryRetry:"Retry",boundaryReload:"Reload page",fileExists:"A file or folder with this name already exists.",pathConflict:"The destination path is already used by a folder or file.",duplicateUploadNames:"The selected files contain duplicate names: {{files}}.",fileTooLarge:"The file exceeds the {{size}} MB limit.",zipOnly:"Please choose a ZIP archive.",collaborationUnavailable:"Live collaboration is not connected. Reconnect before saving or compiling.",codes:{AUTH_INVALID:"The username or password is incorrect.",CURRENT_PASSWORD_INVALID:"The current password is incorrect.",USER_NOT_FOUND:"The user no longer exists.",LAST_ADMIN:"At least one administrator must remain active.",SELF_DELETE_FORBIDDEN:"You cannot delete the currently signed-in administrator.",PROJECT_CREATE_FORBIDDEN:"You do not have permission to create projects.",PROJECT_NOT_FOUND:"The project does not exist or is no longer accessible.",PROJECT_OWNER_ONLY:"Only the project owner can change this setting.",PROJECT_EDIT_FORBIDDEN:"You do not have edit permission for this project.",DICTIONARY_EDIT_FORBIDDEN:"You do not have permission to maintain this project's dictionary.",TAG_NOT_FOUND:"The selected tag does not exist.",GIT_TOKEN_INVALID:"Enter a GitHub token.",GIT_REPOSITORY_NAME_INVALID:"Enter a GitHub repository name.",GIT_REVISION_INVALID:"Choose a Git revision to check out.",PROJECT_DELETE_FORBIDDEN:"Only the project owner can delete this project.",MEMBERS_MANAGE_FORBIDDEN:"Only the project owner can manage project members.",OWNER_MEMBER_FORBIDDEN:"The project owner cannot be added as a member.",INVALID_PATH:"The file path is invalid.",RESERVED_PATH:"This path is reserved by TexLite.",PATH_EXISTS:"The destination path is already used by a file or folder.",FILE_EXISTS:"A file with this name already exists.",PATH_NOT_FOUND:"The file or folder does not exist.",FILE_NOT_FOUND:"The file does not exist.",DIRECTORY_NOT_FOUND:"The destination folder does not exist.",MOVE_INTO_SELF:"A folder cannot be moved into itself.",MAIN_FILE_DELETE_FORBIDDEN:"The main document cannot be deleted.",FILE_TOO_LARGE:"This file is too large to open or upload.",UPLOAD_EMPTY:"No file was selected for upload.",COMMENT_FILE_NOT_FOUND:"The file for this comment does not exist.",COMMENT_RANGE_INVALID:"The comment source range is invalid.",COMMENT_NOT_FOUND:"The comment does not exist.",COMMENT_EDIT_FORBIDDEN:"You can only edit your own comments.",COMMENT_DELETE_FORBIDDEN:"You can only delete your own comments.",REPLY_NOT_FOUND:"The reply does not exist.",REPLY_EDIT_FORBIDDEN:"You can only edit your own replies.",REPLY_DELETE_FORBIDDEN:"You can only delete your own replies.",COMMENT_UPDATE_EMPTY:"There is no comment content to update.",MAIN_FILE_NOT_FOUND:"The selected main document does not exist.",LATEXMKRC_DISABLED:"Project latexmkrc files are disabled by the administrator.",LATEXMKRC_NOT_FOUND:"The selected latexmkrc file does not exist.",COMPILE_ARTIFACTS_NOT_FOUND:"No compiled artifacts are available yet.",COMPILE_ARTIFACT_NOT_FOUND:"The compiled artifact does not exist.",ARTIFACT_PREVIEW_UNSUPPORTED:"This artifact cannot be previewed as text; download it instead.",SYNC_SOURCE_INVALID:"The source location is invalid.",SOURCE_FILE_NOT_FOUND:"The source file does not exist.",SYNCTEX_NOT_AVAILABLE:"No SyncTeX data is available. Compile the project again.",SYNC_PDF_INVALID:"The PDF location is invalid.",SYNCTEX_EXTERNAL_PATH:"SyncTeX returned a source path outside the project.",COMPILE_FORBIDDEN:"You do not have permission to compile this project.",PDF_NOT_FOUND:"No PDF has been generated yet.",API_NOT_FOUND:"The API endpoint does not exist.",SERVER_ERROR:"The server could not complete the request.",REQUEST_INVALID:"The request is invalid."}},tr={historyVersionNotFound:"The selected history version no longer exists.",historyFileNotFound:"This file does not exist in the selected history version.",historyObjectMissing:"A stored file for this snapshot is missing. It can no longer be viewed or restored.",historyTargetConflict:"The current restore target is a directory or another non-file path.",historyPreviewUnsupported:"This historical file cannot be compared as text.",searchInvalid:"Enter valid text to search for.",gitUnavailable:"Git integration is unavailable. Install Git on the host or correct git.binary in the configuration, then try again.",formatFailed:"tex-fmt could not format this source.",mainDocumentInvalid:"The selected file is not a valid LaTeX root document.",compileSnapshotBusy:"The source has not finished saving durably. Wait a moment and try compiling again."},or={requestFailed:"Network request failed. Check your connection and retry.",invalidResponse:"The server returned an invalid response. Please retry."},nr={protocolUpgrade:"This workspace needs an update. Your local draft is retained; refresh when you are ready to reconnect."},rr={disableTitle:"Disable user",disableDescription:"Disable @{{username}}? Their active sessions will end and they will no longer be able to sign in.",disableConfirm:"Disable user",demoteTitle:"Remove administrator access",demoteDescription:"Make @{{username}} a regular user? They will no longer be able to manage users.",demoteConfirm:"Make user",denyProjectCreationTitle:"Remove project creation",denyProjectCreationDescription:"Remove @{{username}}’s permission to create new projects? Their existing project access is unchanged.",denyProjectCreationConfirm:"Remove permission"},ir={cancel:"Cancel compile",cancelling:"Cancelling…",cancelled:"Compilation cancelled."},sr={tagline:"Self-hosted LaTeX collaboration for small research teams",copyright:"© {{year}}"},ar={section:"Section",subsection:"Subsection",bold:"Bold",emphasis:"Emphasis",citation:"Citation",reference:"Cross-reference",label:"Label",image:"Image",unordered:"Unordered list",ordered:"Ordered list",equation:"Equation",figure:"Figure",projectCommand:"Project command",projectCommandArgs:"Project command ({{count}} arguments)",projectMacro:"Project macro",expl3Command:"Expl3 project command",mathOperator:"Project math operator",mathDelimiter:"Project math delimiter",projectEnvironment:"Project environment",projectFile:"Project file",package:"Package",documentClass:"Document class",currentFile:"Current file",project:"Project",latex:"LaTeX",standard:"LaTeX command"},cr={common:An,auth:_n,projects:Mn,projectIcons:Un,users:$n,editor:Hn,citationLibrary:Bn,citationErrors:Vn,citationLibraryHomeDescription:Wn,citationLibraryActions:Xn,citationLibraryPagination:zn,navigation:Gn,history:Kn,selectionHistory:Yn,projectSettings:qn,git:Jn,metrics:Zn,tags:Qn,errors:er,apiErrors:tr,network:or,workspaceUpdates:nr,userConfirmations:rr,compileControls:ir,footer:sr,completions:ar},lr={cancel:"取消",create:"创建",add:"添加",remove:"移除",delete:"删除",close:"关闭",user:"用户",permission:"权限",readOnly:"只读",readWrite:"读写",settings:"设置",comments:"批注",files:"文件",outline:"大纲",version:"版本",loading:"正在载入…",enabled:"允许",disabled:"禁止",normal:"正常",admin:"管理员",language:"语言",save:"保存",edit:"编辑",retry:"重试",reload:"刷新页面",languageEnglish:"English",languageChinese:"中文"},dr={tagline:"轻量 LaTeX 写作环境",username:"用户名",password:"密码",login:"登录",contact:"需要账号?请联系 {{email}}",firstLogin:"首次登录,请修改初始密码",currentPassword:"当前密码",newPassword:"新密码",confirmPassword:"确认新密码",updatePassword:"更新密码",mismatch:"两次输入的新密码不一致",passwordMinimum:"至少 {{count}} 位",sessionExpired:"登录状态已过期,请重新登录。",logout:"退出"},ur={title:"项目",subtitle:"创建、编辑和分享 LaTeX 文档",restricted:"你可以访问别人共享给你的项目;创建权限由管理员授予",new:"新建项目",newDescription:"项目会使用配置文件中的默认 LaTeX 引擎。",name:"项目名称",emptyTitle:"一起创造出色的作品",emptyDescription:"创建新项目,或上传已有的 LaTeX 压缩包开始写作。",emptyRestricted:"共享给你的项目会显示在这里。",noMatches:"没有符合当前搜索或标签筛选条件的项目。",upload:"上传项目",uploadDescription:"上传 ZIP 压缩包;若只有一个顶层目录会自动去除。单文件最大 {{size}} MB。",zipFile:"ZIP 压缩包",import:"导入项目",importing:"正在导入…",search:"搜索项目…",grid:"网格",list:"列表",allTags:"全部标签",sortBy:"排序",sortModified:"最后修改时间",sortCreated:"创建时间",scope:"项目状态",active:"活跃项目",archived:"已归档",archive:"归档",unarchive:"取消归档",noArchived:"还没有归档项目。",pagination:"项目分页",pageOf:"第 {{page}} / {{totalPages}} 页 · 共 {{count}} 个项目",previousPage:"上一页",nextPage:"下一页",owner:"所有者",created:"创建时间",modified:"最后修改",mentionsColumn:"消息",actions:"操作",openProject:"打开“{{project}}”",projectActions:"“{{project}}”的操作",relativeHoursPast:"{{hours}}小时前",relativeHoursMinutesPast:"{{hours}}小时{{minutes}}分钟前",relativeHoursFuture:"{{hours}}小时后",relativeHoursMinutesFuture:"{{hours}}小时{{minutes}}分钟后",relativeDaysPast:"{{days}}天前",relativeDaysHoursPast:"{{days}}天{{hours}}小时前",relativeDaysFuture:"{{days}}天后",relativeDaysHoursFuture:"{{days}}天{{hours}}小时后",modifiedBy:"最后修改人",byUser:"由 {{user}} 修改",modifiedByUser:"{{time}} · 由 {{user}} 修改",deletedUser:"已删除用户",comments:"批注",unresolvedComments:"{{count}} 条未解决批注",unresolvedCommentsTooltip:"{{unresolved}} 条未解决批注 / 共 {{total}} 条",allResolved:"全部已解决 ({{count}})",allCommentsResolvedTooltip:"全部 {{count}} 条批注已解决",noComments:"暂无批注",unresolvedCount:"{{count}} 条待解决",unreadMentions:"{{count}} 条消息",unreadMentionsTooltip:"{{count}} 条未读消息",filterTags:"按标签过滤",rename:"重命名",renameTitle:"重命名项目",duplicate:"复制项目",duplicating:"正在复制…",duplicateTitle:"复制项目",duplicateDescription:"创建“{{project}}”的独立副本。会复制文件和项目设置,但不会复制成员、批注、Git 历史和编译产物。",download:"下载",transfer:"转让",transferOwnership:"转让项目",transferDescription:"为“{{project}}”选择新的所有者。",newOwner:"新所有者",chooseNewOwner:"请选择用户",noTransferUsers:"没有其他可用用户",transferWarning:"转让后你仍保留读写权限。源码、历史、批注和成员不会改变;已保存的 GitHub token 会被移除,由新所有者配置自己的凭据。",transferForbidden:"只有当前项目所有者可以转让项目。",transferTargetInvalid:"请选择新的项目所有者。",transferSelf:"你已经是该项目的所有者。",deleteTitle:"删除项目",deleteDescription:"确定永久删除“{{project}}”及其全部文件吗?此操作不可撤销。",chooseZip:"选择 ZIP 项目",dropZip:"将 ZIP 压缩包拖放到这里",browse:"浏览文件",selectedFileSize:"已选择 · {{size}}",clearFile:"清除已选文件"},pr={title:"选择项目图标",description:"为“{{project}}”选择一个视觉标识。该共享设置仅项目所有者可以修改。",change:"修改项目图标",search:"搜索图标…",save:"保存图标",useInitial:"使用项目首字",noMatches:"没有匹配“{{query}}”的图标。",advancedName:"高级:Lucide 图标短名称",advancedNamePlaceholder:"例如:file-text",advancedNameDescription:"请输入官方 Lucide 短名称,例如 file-text;从 Iconify 复制的 lucide:file-text 也可直接使用。它与上方精选图标搜索互不影响。",advancedPreview:"高级图标预览",browse:"浏览 Lucide 图标",icons:{"file-text":{name:"文档",keywords:"文档 论文 稿件 文章 文本"},"book-open":{name:"书籍",keywords:"书籍 阅读 参考 文献"},"notebook-pen":{name:"笔记",keywords:"笔记 写作 草稿"},"book-marked":{name:"书签",keywords:"书签 文献 阅读"},"scroll-text":{name:"卷轴",keywords:"卷轴 文本 稿件 档案"},library:{name:"文献库",keywords:"图书馆 文献库 参考"},"graduation-cap":{name:"学位论文",keywords:"学位论文 毕业论文 学术"},presentation:{name:"演示",keywords:"演示 幻灯片 汇报"},image:{name:"图片",keywords:"图片 图像 视觉 照片"},"folder-kanban":{name:"项目",keywords:"项目 看板 任务 规划"},microscope:{name:"研究",keywords:"研究 显微镜 实验 科学"},"flask-conical":{name:"实验",keywords:"实验 化学 实验室 烧瓶"},"test-tube-diagonal":{name:"化学",keywords:"化学 检验 实验室 实验"},atom:{name:"物理",keywords:"物理 原子 科学"},dna:{name:"生物",keywords:"生物 基因 DNA 生命"},telescope:{name:"天文",keywords:"天文 望远镜 太空"},earth:{name:"地球",keywords:"地球 全球 地理 世界"},map:{name:"地图",keywords:"地图 地理 位置 空间"},languages:{name:"语言",keywords:"语言 翻译 多语言"},university:{name:"大学",keywords:"大学 教育 学术"},landmark:{name:"经济",keywords:"经济 金融 政策 机构"},scale:{name:"法律",keywords:"法律 公平 政策 天平"},"code-2":{name:"代码",keywords:"代码 编程 软件 开发"},"file-code-2":{name:"源码",keywords:"源代码 程序 文件 软件"},database:{name:"数据库",keywords:"数据 数据库 存储"},server:{name:"服务器",keywords:"服务器 系统 基础设施"},network:{name:"网络",keywords:"网络 图 连接"},"circuit-board":{name:"工程",keywords:"工程 电路 硬件 电子"},brain:{name:"思考",keywords:"思考 认知 心智"},"brain-circuit":{name:"人工智能",keywords:"人工智能 AI 机器学习"},bot:{name:"自动化",keywords:"机器人 自动化"},"shield-check":{name:"安全",keywords:"安全 防护 隐私"},"lock-keyhole":{name:"加密",keywords:"锁 加密 隐私 安全"},workflow:{name:"工作流",keywords:"工作流 流程 管线"},blocks:{name:"模块",keywords:"模块 方块 组件 构建"},sigma:{name:"数学",keywords:"数学 公式 统计 西格玛"},calculator:{name:"计算",keywords:"计算 算术 数学"},"function-square":{name:"函数",keywords:"函数 数学 公式"},"chart-no-axes-combined":{name:"分析",keywords:"分析 图表 数据"},"line-chart":{name:"趋势",keywords:"趋势 曲线 图表 数据"},"bar-chart-3":{name:"柱状图",keywords:"柱状图 统计 数据"},"pie-chart":{name:"饼图",keywords:"饼图 分布 数据"},"chart-scatter":{name:"散点图",keywords:"散点图 数据 分析"},"chart-spline":{name:"曲线",keywords:"曲线 样条 数据 分析"},"file-spreadsheet":{name:"表格",keywords:"表格 数据 电子表格 工作簿"},"file-chart-column-increasing":{name:"报告",keywords:"报告 图表 数据 结果"},lightbulb:{name:"想法",keywords:"想法 创意 灵感"},rocket:{name:"创新",keywords:"创新 启动 前进"},target:{name:"目标",keywords:"目标 重点"},sparkles:{name:"通用",keywords:"通用 闪光 高亮"},"wand-sparkles":{name:"工具",keywords:"工具 魔法 优化 实用"},"file-pen-line":{name:"稿件",keywords:"稿件 草稿 写作 论文 文档"},"file-stack":{name:"文件集合",keywords:"文件 堆叠 文档 集合"},folder:{name:"文件夹",keywords:"文件夹 目录 文件"},"folder-open":{name:"打开文件夹",keywords:"文件夹 目录 文件 打开"},"folder-archive":{name:"归档文件",keywords:"文件夹 归档 文件 存储"},archive:{name:"归档",keywords:"归档 存储 历史"},book:{name:"合本书",keywords:"书籍 阅读 文献 参考"},bookmark:{name:"书签",keywords:"书签 参考 阅读"},newspaper:{name:"报刊",keywords:"报刊 论文 出版 文章"},"notepad-text":{name:"记事本",keywords:"笔记 记事本 写作 想法"},"sticky-note":{name:"便签",keywords:"便签 提醒 想法"},"pen-tool":{name:"写作",keywords:"写作 笔 作者 编辑"},quote:{name:"引文",keywords:"引文 引用 参考 文本"},"list-tree":{name:"大纲",keywords:"大纲 结构 章节 列表 树"},"file-search":{name:"搜索文档",keywords:"搜索 文档 研究 文件"},beaker:{name:"烧杯",keywords:"烧杯 化学 实验室 科学"},"test-tubes":{name:"试管",keywords:"试管 实验室 实验 科学"},syringe:{name:"医学",keywords:"医学 健康 临床 注射器"},radiation:{name:"核科学",keywords:"辐射 核 物理 科学"},satellite:{name:"卫星",keywords:"卫星 太空 遥感"},"map-pinned":{name:"地点",keywords:"地点 地图 标记 地理"},route:{name:"路线",keywords:"路线 路径 交通 地理"},"folder-git-2":{name:"Git 仓库",keywords:"Git 仓库 版本控制 源码"},"git-branch":{name:"分支",keywords:"Git 分支 版本控制"},"git-commit-horizontal":{name:"提交",keywords:"Git 提交 版本控制"},terminal:{name:"终端",keywords:"终端 命令 Shell 开发"},braces:{name:"语法",keywords:"语法 代码 编程 花括号"},regex:{name:"正则",keywords:"正则 正则表达式 搜索 代码"},binary:{name:"二进制",keywords:"二进制 位 数据 计算"},cpu:{name:"计算设备",keywords:"CPU 处理器 计算 硬件"},"hard-drive":{name:"存储",keywords:"存储 磁盘 驱动器 数据"},cloud:{name:"云",keywords:"云 基础设施 存储 网络"},wifi:{name:"无线",keywords:"无线 WiFi 网络 连接"},radar:{name:"感知",keywords:"雷达 感知 信号 研究"},"key-round":{name:"访问密钥",keywords:"密钥 访问 认证 安全"},fingerprint:{name:"身份",keywords:"身份 指纹 认证 安全"},shield:{name:"防护",keywords:"防护 安全 隐私 盾牌"},bug:{name:"调试",keywords:"错误 调试 软件 问题"},wrench:{name:"维护",keywords:"维护 工具 修复 工程"},"chart-column":{name:"柱形图",keywords:"柱形图 图表 数据 统计"},"chart-candlestick":{name:"K 线图",keywords:"K线图 图表 金融 数据"},gauge:{name:"指标",keywords:"指标 仪表 测量 性能"},activity:{name:"活动",keywords:"活动 信号 监测 健康"},"table-2":{name:"数据表",keywords:"表格 数据 行 列"},waypoints:{name:"管线",keywords:"管线 工作流 节点 流程"},boxes:{name:"组件",keywords:"组件 方块 模块 系统"},package:{name:"软件包",keywords:"软件包 依赖 软件 模块"},"users-round":{name:"团队",keywords:"团队 用户 协作 小组"},"calendar-days":{name:"日程",keywords:"日程 日历 截止日期 规划"}}},fr={manage:"用户管理",back:"返回项目",onlyAdmin:"仅管理员可以创建用户",add:"添加用户",role:"角色",createProjects:"创建项目",ownedProjects:"拥有项目",status:"状态",actions:"操作",adminRequired:"需要管理员权限。",allow:"允许",deny:"禁止",enable:"启用",disable:"禁用",promote:"设为管理员",demote:"降为用户",allowCreate:"允许创建",denyCreate:"禁止创建",resetPassword:"重置密码",initialPassword:"登录密码",displayName:"显示名称",addDescription:"设置登录密码,或生成一个安全的随机密码。",createUser:"创建用户",randomPassword:"随机密码",generatePassword:"生成随机密码",resetDescription:"为 {{username}} 设置初始密码;其现有会话会被注销。",reset:"重置",deleteTitle:"删除用户",deleteDescription:"确认删除 {{username}}?此操作不可撤销。",ownedChoice:"其拥有的 {{count}} 个项目",transferProjects:"转移给当前管理员",deleteProjects:"永久删除项目及全部文件"},hr={saved:"已保存",savedAt:"已于 {{time}} 保存到服务器",loading:"载入中",pending:"等待保存",saving:"正在保存到服务器",saveFailed:"保存失败",offlineDraft:"离线 · 本地草稿已保留",harperRecoveryTitle:"Harper 暂不可用。",harperFallbackHint:" 已自动改用浏览器内置拼写检查。",texFmtRecoveryTitle:"tex-fmt 无法加载。",texFmtOptionsRecoveryTitle:"tex-fmt 无法处理当前源码或参数。",texFmtRuntimeRecoveryTitle:"tex-fmt 返回了异常结果。",clientToolRecoveryHint:" 可立即重试;如果页面在系统更新前已经打开,请刷新页面加载最新资源。",resetFormatterOptions:"清空参数并重试",formattingBy:"{{name}} 正在格式化此文件,请稍候…",compile:"编译 · {{engine}}",compiling:"编译中…",compileQueued:"编译已排队…",compileFailedRetained:"编译失败,当前显示上一次成功生成的 PDF({{time}})。",compileFailedNoPdf:"编译失败,且没有可用的成功 PDF。",upToDate:"文件已是最新,无需重新编译。",compileSnapshotStale:"PDF 基于较早的一致快照编译,未包含之后的源码修改。",addComment:"添加批注",sourceComments:"源码批注",mentionUsers:"@ 项目成员",mentionedYou:"提到了你",markMentionRead:"标记已读",markAllMentionsRead:"全部标记已读",projectSettings:"项目设置",uploadAttachment:"上传附件",newFile:"新建文本文件",binary:"二进制附件已保存,但不能在文本编辑器中打开。",noOutline:"当前文件没有章节",wordCountTitle:"字数统计",wordCountFull:"全文",wordCountSelection:"所选",wordCountFullHint:"统计当前主文档及其引入的 TeX 文件",wordCountSelectionHint:"统计选中的 LaTeX 源码",wordCountLoading:"正在运行 TeXcount…",wordCountTotal:"总字数",wordCountCharacters:"字符数",wordCountCharactersHint:"不含空格和标点",wordCountText:"正文",wordCountHeaders:"标题",wordCountCaptions:"图注/表注",wordCountFloats:"图表数量",wordCountInlineMath:"行内公式",wordCountDisplayMath:"独立公式",wordCountFiles:"引入文件",wordCountWordsUnit:"字",wordCountItemsUnit:"个",wordCountExpressionsUnit:"个",wordCountParserErrors:"TeXcount 报告了 {{count}} 个解析问题。",wordCountSelectionEmpty:"请选择 LaTeX 源码后再统计。",wordCountSaveRequired:"最新编辑修改无法保存,已取消统计。",wordCountFailed:"TeXcount 无法统计这段源码。",wordCountSourceInvalid:"请选择 LaTeX 源码后再统计。",wordCountSourceTooLarge:"所选源码过大,无法统计。",wordCountUnavailable:"服务器未安装 TeXcount,请安装 TeX Live 后重试。",wordCountHelp:"TeXcount 说明",wordCountTemplateNote:"自定义 %TC:newtemplate 或 %TC:template 指令可能覆盖 TexLite 的统计格式,并导致统计失败。",preview:"PDF 预览",previewHint:"点击“编译”生成文档",loadingPdf:"正在加载 PDF…",pdfCompiledAt:"成功编译于 {{time}}",pdfCompiledAtFor:"{{file}} 成功编译于 {{time}}",currentMainDocument:"当前作为主文档编译:{{path}}",mainDocumentCandidate:"LaTeX 主文档候选:{{path}}",currentMainShort:"主文档",deletedUser:"已删除用户",orphaned:"锚点已丢失",line:"第 {{line}} 行",reopen:"重新打开",resolve:"标记为已解决",noComments:"当前文件没有批注",newFileDescription:"可以包含目录,例如 chapters/introduction.tex。",filePath:"文件路径",commentDescription:"已选择 {{count}} 个字符",pointComment:"未选择文本,将在当前光标位置添加批注。",commentContent:"批注内容",backToProjects:"返回项目列表",outputTabs:"编译输出",log:"日志",warnings:"警告",errors:"错误",artifacts:"产物",clean:"故障恢复",noLog:"编译后将在此显示日志。",noWarnings:"最近一次编译没有警告。",noErrors:"最近一次编译没有错误。",projectRoot:"项目根目录",uploadTo:"上传到 {{folder}}",dropFiles:"拖放文件以上传",newFolder:"新建文件夹",folderName:"文件夹名称",folderDestination:"文件夹将创建在 {{folder}} 中。",uploadOverwriteTitle:"文件已存在",uploadOverwriteDescription:"以下文件已经存在:{{files}}。要覆盖它们吗?",uploadOverwrite:"覆盖文件",noArtifacts:"编译后将在此显示输出产物。",selectArtifact:"选择一个文本产物进行预览。",viewArtifact:"查看产物",downloadArtifact:"下载产物",downloadToView:"该产物需要下载后查看",cleanTitle:"编译故障恢复",cleanDescription:"这里只提供高级故障恢复操作:仅在编译卡住、历史错误状态残留或生成产物异常时使用。不会修改源码、项目设置、批注、历史或 Git 数据。",cleanCache:"强制完整重编译",cleanCacheDescription:"仅在编译失败或 latexmk 缓存状态异常时使用。删除增量缓存,但保留当前成功的 PDF。",cleanArtifacts:"删除生成输出",cleanArtifactsDescription:"仅在生成产物状态异常时使用。删除该主文档的 PDF、SyncTeX、日志和中间文件。",cleanCacheConfirmTitle:"强制完整重编译?",cleanCacheConfirmDescription:"此故障恢复操作会删除 latexmk 增量缓存。当前 PDF 会保留,下一次编译将从干净缓存开始。",cleanArtifactsConfirmTitle:"删除生成输出?",cleanArtifactsConfirmDescription:"此故障恢复操作会删除当前 PDF 以及该主文档的全部生成文件,但不会影响源码。",cleanConfirm:"执行恢复",cleanCacheComplete:"故障恢复缓存已清理,下一次编译将完整执行。",cleanArtifactsComplete:"编译生成输出已删除。",cleanBusy:"当前主文档正在编译,请完成后再执行故障恢复。",collapseFiles:"折叠文件面板",showFileSizes:"显示文件大小",hideFileSizes:"隐藏文件大小",move:"移动",moveTitle:"移动或重命名 {{name}}",moveDescription:"选择目标文件夹和名称;源码、批注和项目路径会保持关联。",pathName:"名称",moveApply:"移动/重命名",destinationFolder:"目标文件夹",deletePath:"删除文件或文件夹",deletePathTitle:"删除 {{name}}",deletePathDescription:"确定删除 {{path}}?此操作不可撤销。",deletePathActiveDescription:"确定删除 {{path}}?{{users}} 当前正在打开它,删除后这些会话将关闭该文件。",deletePathWillClose:"系统会拒绝该路径上迟到的修改,避免内容被静默丢失。",fileDeletedByCollaborator:"{{path}} 已在其他会话中删除,现已打开安全的备用文件。",compileShortcut:"保存并编译(Ctrl+S / Cmd+S)",compilingBy:"{{name}} 正在编译",format:"格式化",formatFile:"文件",formatFileHint:"格式化当前文件",formatFileComplete:"当前文件已格式化。",formatFileFailed:"无法格式化当前文件:{{message}}",formatSelected:"选区",commentsAdd:"添加",commentsAll:"查看",formatSelection:"格式化选区",formatting:"正在格式化…",formatSelectionHint:"选择一段 LaTeX 源码后格式化",formatSelectionRequired:"请先选择 LaTeX 源码,再进行格式化。",formatSelectionComplete:"所选 LaTeX 源码已格式化。",formatFailedContinue:"格式化失败,仍将继续编译:{{message}}",formatFailed:"无法格式化选区:{{message}}",formatSourceChanged:"格式化期间源码已发生变化,已跳过本次格式化。",formatSelectionChanged:"格式化期间所选源码已发生变化,请重新选择后再试。",writingSuggestions:"写作建议",noWritingSuggestions:"没有可用的修改建议",removeText:"删除文本",replaceWith:"替换为 {{word}}",spellCheckReadOnly:"当前为只读,需要编辑权限才能替换。",spellCheckSourceChanged:"源码在应用写作修正前发生了变化。",mathPreview:"公式预览",mathPreviewLoading:"正在渲染公式…",mathPreviewUnavailable:"该公式暂时无法预览。",vimOn:"Vim 已开启",vimOnHint:"当前编辑器已启用 Vim 键位。",reply:"回复",replyPlaceholder:"输入回复内容…",sendReply:"发送回复",editComment:"编辑批注",deleteComment:"删除批注",saveChanges:"保存修改",deleteCommentTitle:"删除批注",deleteCommentDescription:"确定删除这条批注及其 {{count}} 条回复吗?此操作不可撤销。",editReply:"编辑回复",deleteReply:"删除回复",deleteReplyTitle:"删除回复",deleteReplyDescription:"确定删除这条回复吗?此操作不可撤销。",editedAt:"编辑于 {{time}}",outlineJump:"跳转到源码第 {{line}} 行并定位 PDF",lineNumber:"第 {{line}} 行",showInSource:"在源码中显示当前 PDF 位置",showInPdf:"在 PDF 中显示当前源码光标位置",syncTexOnlyForTex:"PDF 跳转仅支持 TeX 源文件(.tex)",syncTexOnlyForMain:"PDF 跳转仅支持当前主 TeX 文档",openFiles:"打开的文件",pdfLoadFailed:"无法载入 PDF 预览",pdfZoomControls:"PDF 缩放控件",downloadPdf:"下载 PDF",downloadResource:"下载文件",resourceTooLarge:"该文件大小为 {{size}},超过 {{limit}} 的直接预览上限。",resourceTooLargeTitle:"文件过大,无法直接预览",resourceTooLargeDescription:"请下载文件后在本地打开。",resourceUnsupportedTitle:"无法预览",resourceUnsupportedDescription:"浏览器不能直接渲染此文件类型,请下载后在本地打开。",resourcePreview:{image:"图片预览",pdf:"PDF 预览",text:"文本预览",unsupported:"文件预览"},pdfZoomOut:"缩小",pdfZoomIn:"放大",pdfFitWidth:"适合宽度",pdfLink:"PDF 链接",pdfLinks:"PDF 链接",layout:{label:"布局",choose:"选择布局",current:"当前布局:{{layout}}","editor-pdf":{name:"编辑器与 PDF",description:"并排显示源码编辑器和 PDF 预览"},"editor-only":{name:"仅编辑器",description:"将工作区用于源码编辑"},"pdf-only":{name:"仅 PDF",description:"将工作区用于 PDF 和编译输出"}},collaboration:{connecting:"正在连接协作服务…",connected:"实时协作已连接",disconnected:"实时协作连接已断开",editing:"正在编辑",viewing:"正在查看",joining:"正在进入项目",reconnect:"重新连接",permissionDowngradeTitle:"编辑权限已变更",permissionDowngradeDescription:"您的权限已从{{previous}}变为只读。任何尚未保存的本地草稿仍保留在当前标签页中,但无法保存。您可以继续查看草稿,或放弃草稿并重新加载服务器上的最新版本。",permissionDowngradeKeep:"保留本地草稿",permissionDowngradeDiscard:"放弃草稿并重新加载",permissionDowngradeReload:"重新加载服务器版本",permissionDowngradeNoDraft:"您的权限已变为只读。您可以继续查看当前标签页,或重新加载服务器上的最新版本。",permissionDowngradeOtherTab:"您的权限已变为只读。另一个浏览器标签页中仍有尚未保存的草稿,请返回该标签页处理。为避免误删,该页面不能清理共享的本地草稿。",permissionDowngradeMultipleDrafts:"您的权限已变为只读。当前标签页和其他浏览器标签页都存在尚未保存的草稿。请先在其他标签页中处理草稿;当前页面不会清理共享数据。",permissionDowngradeOtherTabBlocked:"另一个浏览器标签页刚刚产生了尚未保存的草稿,已取消清理以保护该草稿。",activeSessions:"{{count}} 个活跃会话",showMoreSessions:"展开另外 {{count}} 个会话",showFewerSessions:"收起会话列表",sessionTooltip:"{{name}}(@{{username}})· {{file}} · {{activity}} · {{permission}}"},search:{button:"查找",title:"查找和替换(Ctrl+F / Cmd+F)",find:"查找",replace:"替换为",next:"下一个",previous:"上一个",all:"选择全部",matchCase:"区分大小写",regexp:"正则表达式",wholeWord:"全字匹配",replaceNext:"替换",replaceAll:"全部替换",currentMatch:"当前匹配",onLine:"位于行",replacedMatchOnLine:"已替换第 $ 行的匹配项",replacedMatches:"已替换 $ 个匹配项",goToLine:"跳转到行",go:"跳转",matchCount:"共 {{count}} 个匹配",noMatches:"没有匹配项",invalidQuery:"正则表达式无效"}},mr={title:"引用库",description:"从 {{file}} 保存文献,并将它们导入当前 BibTeX 文件。引用库及其标签仅属于你自己。",myLibrary:"我的引用库",currentFile:"当前文件",searchPlaceholder:"搜索引用…",searchHint:"可搜索 key、标题、作者或年份",emptyTitle:"引用库还是空的",emptyDescription:"打开“当前文件”标签页,保存一个 BibTeX 文献条目。",noEntries:"没有找到 BibTeX 条目",noEntriesDescription:"请在当前文件中添加有效的 @article、@inproceedings 或其他文献条目。",currentFileTitle:"当前文件中的条目",currentFileDescription:"选择一个条目保存到你的引用库。",backToLibrary:"返回引用库",save:"保存",update:"更新",saving:"正在保存…",saved:"引用已保存到你的引用库。",updated:"引用已更新。",deleted:"引用已删除。",deleteTitle:"删除引用",deleteDescription:"确定从你的私有引用库中删除引用 {{key}}?此操作不可撤销。",fileTooLarge:"该 BibTeX 文件超过 {{size}} 限制。",fileTooLargeHint:"文件过大,浏览器不会解析其中的条目。请拆分文件后再保存单条引用。",fileInvalid:"当前 BibTeX 文件存在语法错误。",fileInvalidHint:"请先修复当前文件,再格式化或导入新的引用。",savedLabel:"已保存",import:"导入",importToFile:"导入到当前 BibTeX 文件",importRequiresWrite:"导入需要当前项目的写权限。",imported:"已将 {{key}} 导入当前文件。",untitled:"未命名引用",authorUnknown:"未填写作者",allTags:"全部标签",noTags:"还没有标签",noTagMatches:"没有匹配此标签的引用。",newTagPlaceholder:"新标签名称",tagColor:"标签颜色",createTag:"创建标签",tagCreated:"标签已创建。",tags:"标签",tagsTitle:"{{key}} 的标签",noTagsToAssign:"请先创建标签。",saveTags:"保存标签",tagsUpdated:"标签已更新。",editTitle:"编辑 {{key}}"},gr={invalid:"请输入一个有效的 BibTeX 条目。",tooLarge:"BibTeX 条目过大。",notFound:"引用条目不存在。",keyExists:"引用 key 已经存在,请检查现有条目后再决定是否替换。",tagNotFound:"引用标签不存在。",conflict:"该引用已在其他位置发生修改,请刷新引用库后重试。",alreadyInFile:"{{key}} 已经存在于当前 BibTeX 文件中。"},yr="在首页管理属于你自己的 BibTeX 文献和标签。打开 .bib 文件后即可保存或导入条目。",wr={addEntry:"添加条目",addEntryTitle:"添加 BibTeX 条目",addEntryDescription:"粘贴一个完整的 BibTeX 文献条目,保存前会进行校验。",addEntryPlaceholder:`@article{key,
|
|
8
|
-
author = {Author},
|
|
9
|
-
title = {Title},
|
|
10
|
-
year = {2026}
|
|
11
|
-
}`,added:"引用已添加到你的引用库。"},vr={pageOf:"第 {{page}} / {{totalPages}} 页 · {{count}} 条引用",previous:"上一页",next:"下一页"},br={quickOpen:"快速打开",quickOpenDescription:"按名称打开项目文件(Ctrl/Cmd+P)。",filePlaceholder:"输入文件名…",noFiles:"没有匹配的文件。",projectSearch:"项目搜索",projectSearchDescription:"在项目源码文件中搜索和替换(Ctrl/Cmd+Shift+F)。",searchPlaceholder:"搜索全部源码文件…",replacePlaceholder:"替换为…",matchSummary:"共 {{count}} 个匹配",truncated:"仅显示前 {{count}} 个匹配。",replaceAll:"替换全部 {{count}} 项",replaceConfirmTitle:"在项目中批量替换",replaceConfirmDescription:"确定替换全部 {{count}} 个匹配?自动历史会记录所有修改文件。",replaced:"已在 {{files}} 个文件中替换 {{count}} 项。"},Cr={saveWarning:"源码已保存,但部分历史未能保存。近期失败会自动重试,较早的历史可能不完整。请检查服务器日志及可用存储空间。",storageBreakdown:"文件 {{objects}} · 元数据 {{metadata}} · 受保护 {{protected}}",title:"历史",projectSnapshots:"项目快照",projectSnapshotsButton:"项目快照",description:"浏览自动项目快照、比较文件,并安全恢复较早的工作。",empty:"尚无项目快照。",loadOlder:"加载更早快照",changedCount:"{{count}} 个文件有变化",fileCount:"{{count}} 个文件",changed:"有修改",labelPlaceholder:"为此版本命名",saveLabel:"保存标签",compareCurrent:"与当前版本比较",comparingCurrent:"历史快照与当前文件的比较",chooseFile:"选择文件后,可与当前源码进行比较。",changedFilesHeading:"修改的文件 ({{count}})",noChangedFiles:"此快照没有修改的文件。",noDifferences:"文件在此快照与当前版本内容相同,没有差异。",noDifferencesInCommit:"此文件在本次修改中无内容变动。",historicalVersion:"历史快照",currentVersion:"当前版本",diffMode:"对比模式",diffModeCommit:"本次修改",diffModeCommitHint:"查看此快照相比上一快照的改动",diffModeCurrent:"与当前对比",diffModeCurrentHint:"查看此快照与当前工作区源码的差异",changedAt:"修改于 {{time}}",createdAt:"创建于 {{time}}",previousVersion:"上一快照",restore:"恢复",restoreFile:"恢复文件",restoreProject:"恢复项目",restoreFileTitle:"恢复此文件",restoreProjectTitle:"恢复此项目快照",restoreFileDescription:"从此快照恢复 {{path}}?系统会先为当前项目创建安全检查点。",restoreProjectDescription:"恢复此快照的全部源码和编译器设置?系统会先为当前项目创建安全检查点。",storage:"快照存储",storageUsage:"已使用 {{used}},上限 {{limit}}",versionUsage:"普通快照 {{count}} / {{limit}}",protectedVersions:"{{count}} 个已标记快照",storageExceeded:"受保护快照或当前基线已超过存储软上限。",deleteVersion:"删除快照",deleteVersionTitle:"删除此项目快照",deleteVersionDescription:"永久删除“{{name}}”?当前项目文件和选区历史不会改变。",clearAll:"清空项目快照",clearAllTitle:"清空全部项目快照",clearAllDescription:"永久删除全部项目快照及不再引用的存储数据?当前项目文件和选区历史不会改变。",reasons:{initial:"项目创建",autosave:"自动保存",file:"文件操作",settings:"编译器设置",git:"Git 操作",restore:"恢复版本",checkpoint:"安全检查点"}},Tr={storageUsage:"选区历史:{{used}} / {{limit}} MiB · {{count}} 个片段",storageDescription:"统计整个项目的修改数据,与项目快照独立;不包含共享数据库开销。",clearAll:"清空项目选区历史",clearDescription:"删除本项目所有文件的修改记录?源码和项目快照将保留,后续修改仍会继续记录。此操作不可撤销。",limited:"仅显示最近 {{count}} 个编辑窗口,更早的记录未展示。",sourceChanged:"源码已发生变化。请等待同步完成,重新选择文本后再打开历史。",title:"选区历史",buttonLabel:"编辑记录",selectSourceHint:"请先选中源码,再查看其编辑历史。",description:"{{path}} 中所选 {{count}} 个字符的编辑记录。",emptyTitle:"此选区还没有已保存的编辑记录",emptyDescription:"继续编辑并保存后,这里会显示相关的编辑记录。",boundary:"由于文件替换、恢复操作或较早记录已清理,此选区的历史从这里开始。",changedBy:"修改者:",contentTab:"内容",diffTab:"差异",view:"选区历史展示方式",previousVersion:"上一状态",currentVersion:"当前状态",noPrevious:"没有更早的选区状态可供比较。",diffUnavailable:"其中一个选区状态无法精确还原,暂无法比较。",noDiff:"与上一选区状态没有文本差异。",contentTruncated:"选区内容已缩短。",contentUnavailable:"由于一次过大的修改无法精确还原,无法显示这个较早状态的选区内容。"},xr={mainFile:"主文档",invalidMainFileOption:"{{path}}(不是主文档)",engine:"编译引擎",latexmkrc:"项目 latexmkrc",save:"保存项目设置",members:"共享成员",recentLog:"最近编译日志",share:"共享",shareDescription:"仅可共享给管理员已创建的用户。",chooseUser:"请选择用户",latexmkrcPlaceholder:`# 留空表示不使用项目 rc 文件
|
|
12
|
-
$pdf_mode = 1;`,addMember:"添加成员",noMembers:"该项目尚未分享给其他成员。",removeTitle:"移除共享成员",removeDescription:"确认移除 {{username}}?其账号和其他项目不会受到影响。",editorTab:"编辑器外观",compilerTab:"LaTeX 编译器",compilerDescription:"选择本项目所有成员共享的主文档和 LaTeX 编译选项。",editorAppearance:"编辑器外观",editorAppearanceDescription:"这些偏好仅作用于当前浏览器中的当前用户和项目;项目词典是共享的。",browserTools:"格式化工具",toolStatus:{loading:"加载中",working:"运行正常",error:"错误"},reloadTool:"重新加载",saveAppearance:"保存外观设置",saveCompiler:"保存编译器设置",writingCheckDescription:"TexLite 使用宿主机上可选的 Harper CLI。若其不可用,将自动改用浏览器内置拼写检查。拼写问题使用红色波浪线,语法问题使用黄色波浪线;右键问题可以查看修改建议。",projectConfiguration:"项目配置",fontFamily:"英文字体",fontSize:"字体大小",lineHeight:"行间距",dictionary:"项目词典",dictionaryDescription:"添加到这里的词会在 Harper 返回本项目诊断后被忽略;具有编辑权限的用户可以维护此列表。",dictionaryPlaceholder:"添加自定义词",addWord:"添加词",dictionaryEmpty:"暂未添加自定义词。",lineWrapping:"自动换行",mathPreviewOnHover:"悬停预览数学公式",mathPreviewOnHoverDescription:"在编辑器中悬停常见 LaTeX 公式时显示渲染预览。",spellCheck:"拼写和语法检查",vimMode:"Vim 键位",vimModeDescription:"在当前编辑器中使用 Vim 的普通、插入和可视模式。",vimHelp:"查看帮助",formatOnCompile:"编译前自动格式化 LaTeX",formatOnCompileDescription:"默认关闭;格式化会在编译前执行。",formatRequiresWrite:"需要项目编辑权限才能使用格式化。",formatterDescription:"tex、cls、sty 使用内置的浏览器 tex-fmt WASM 格式化器;BibTeX 使用浏览器中的 bibtex-tidy。",formatterInstall:"查看 tex-fmt",bibtexTidyInstall:"查看 bibtex-tidy",texFmtOptions:"tex-fmt 参数(TOML)",texFmtOptionsPlaceholder:"wrap = false",texFmtOptionsDescription:"这些参数仅保存在当前浏览器中,并按当前用户和项目隔离;它们会直接传递给 tex-fmt。",openFilesInTabs:"使用新 Tab 打开 LaTeX 文件",openFilesInTabsDescription:"在编辑器顶部通过标签页管理打开的 .tex、.bib、.sty 等源码文件。",writingIssues:"发现 {{count}} 个写作问题(去重后 {{uniqueCount}} 个)",noWritingIssues:"未发现拼写或语法问题。",spellCheckFirst:"第一个写作问题",spellCheckPrevious:"上一个写作问题",spellCheckNext:"下一个写作问题",spellCheckLast:"最后一个写作问题",spellCheckPosition:"第 {{current}}/{{total}} 个",fontJetBrains:"JetBrains Mono",fontSourceCode:"Source Code Pro",fontIbmPlex:"IBM Plex Mono",fontFiraCode:"Fira Code",fontIosevka:"Iosevka",lineHeightCompact:"紧凑",lineHeightNormal:"标准",lineHeightRelaxed:"宽松"},Dr={title:"Git 备份",description:"管理本地 Git 历史及 GitHub 备份;只有项目创建者可以执行这些操作。",ownerOnly:"只有项目所有者可以使用 Git 备份。",authentication:"GitHub 身份验证",authenticationHint:"token 需要仓库 Administration 与 Contents 写权限;它会加密保存,不会写入项目仓库或远程地址。",recommendedAccessTitle:"建议的仓库访问范围:All repositories(所有仓库)",recommendedAccess:"texLite 面向相互信任的用户。请选择 All repositories,使该 token 能创建仓库,并访问之后新建的仓库;同时授予 Administration 和 Contents 的 Read and write 权限。",token:"个人访问 token",tokenPlaceholder:"在此粘贴 GitHub token",replaceToken:"替换个人访问 token",saveToken:"保存并验证 token",createToken:"创建细粒度 token",connectedAs:"已连接为 @{{login}}",removeToken:"移除 token",tokenSaved:"GitHub token 已保存,本地仓库已就绪。",tokenRemoved:"GitHub token 已移除。",repository:"仓库",localReady:"项目源码已由本地 Git 仓库管理。",localPending:"保存有效 token 后将自动初始化本地 Git 仓库。",repositoryName:"GitHub 仓库名称",privateRepository:"创建为私有仓库",createRepository:"创建 GitHub 仓库",repositoryCreated:"GitHub 仓库创建成功。",origin:"远程仓库",openGitHub:"打开 GitHub",clean:"工作区干净",changedFiles:"{{count}} 个文件有修改",commitAndPush:"提交与推送",identity:"本次提交临时使用 {{username}} <{{username}}@texlite.com>,不会写入 Git 配置。",detachedHead:"当前处于 detached HEAD;请先返回默认分支再提交或推送。",detachedAt:"detached 于 {{revision}}",commitMessage:"提交说明",commitPlaceholder:"说明本次备份的内容…",commit:"提交",committed:"修改已提交。",noChangesToCommit:"当前没有新的修改可以提交。",push:"推送",pushed:"推送成功,GitHub 备份已是最新。",pushFailed:"推送失败",workingDiff:"当前差异",refresh:"刷新",diffTitle:"差异",diffTruncated:"输出已截断",diffFontSize:"差异字体大小",diffFontDecrease:"减小差异字体",diffFontIncrease:"增大差异字体",fullscreenDiff:"全屏查看差异",exitFullscreenDiff:"退出全屏",noChanges:"没有可显示的差异。",history:"提交历史",historyHint:"最多显示最近 100 次提交",noCommits:"尚无提交。",viewCommitDiff:"查看该提交的差异",checkoutVersion:"checkout 到该版本",checkoutTitle:"Checkout 版本",checkout:"Checkout",checkoutDescription:"将 checkout 到 {{revision}} — {{message}}。默认由 Git 保留兼容的未提交修改,发生冲突时拒绝操作。",forceCheckout:"强制覆盖",forceCheckoutDescription:"明确丢弃所有已跟踪及未跟踪的工作区修改后再 checkout;此操作不可撤销。",returnToBranch:"返回 {{branch}}",returnTitle:"返回默认分支",returnDescription:"将 checkout 到 {{branch}}。默认由 Git 保留兼容的未提交修改,发生冲突时拒绝操作。",discardChanges:"撤销修改",noChangesToDiscard:"当前没有可以撤销的修改。",discardTitle:"撤销未提交修改",discardDescription:"把所有已跟踪文件恢复到当前 HEAD(上次 commit)。未跟踪文件不受影响。",discardConfirm:"确认撤销"},Sr={title:"系统状态",description:"服务器实时健康状态和近期操作耗时,每五秒自动刷新。",refresh:"刷新",uptime:"运行时间",memory:"内存",heap:"堆内存",compileQueue:"编译任务",pending:"{{count}} 个等待中",collaboration:"协作",sessions:"{{count}} 个会话",roomsAndDirty:"{{rooms}} 个房间 · {{dirty}} 个待保存文件",eventLoop:"事件循环延迟",latencySummary:"P50 {{p50Ms}} ms · P95 {{p95Ms}} ms · 最大 {{maxMs}} ms",operationDurations:"近期操作耗时",noSamples:"尚未采集到操作样本。",operation:"操作",samples:"样本",last:"最近",max:"最大",operations:{collaboration:{connect:"打开协作房间",persist:"保存协作修改"},workspace:{project:"加载项目元数据",files:"加载项目文件",compileState:"加载保留的 PDF 状态"},compile:{snapshot:"准备编译快照",request:"编译请求总耗时",cacheSync:"更新编译缓存",latexmk:"运行 latexmk",artifactCopy:"发布编译产物"},outline:{build:"生成项目大纲"},search:{project:"项目内搜索"},completions:{build:"生成补全索引"}}},kr={title:"标签",add:"添加标签",create:"新建标签",createDescription:"创建仅自己可见的可复用彩色标签,用于整理项目。",manage:"管理标签",manageDescription:"创建和整理仅自己可见的项目标签。删除标签只会解除它与项目的关联。",createInManager:"新建标签",edit:"编辑",rename:"重命名",deleteTitle:"删除标签",deleteDescription_one:"确定删除“{{tag}}”吗?它将从 {{count}} 个项目中移除。",deleteDescription_other:"确定删除“{{tag}}”吗?它将从 {{count}} 个项目中移除。",projectCount_one:"{{count}} 个项目",projectCount_other:"{{count}} 个项目",noTags:"还没有标签。创建一个标签来整理项目。",none:"暂无标签",assign:"标签",assignTitle:"“{{project}}”的标签",assignDescription:"勾选你为此项目设置的私有标签;其他用户拥有各自的标签。",empty:"请先创建标签。",allAssigned:"所有可用标签均已添加。",name:"标签名称",color:"颜色",filter:"筛选",red:"红色",orange:"橙色",yellow:"黄色",green:"绿色",blue:"蓝色",purple:"紫色",gray:"灰色"},Er={generic:"操作失败",request:"请求失败({{status}})",upload:"上传失败",boundaryTitle:"页面遇到问题",boundaryDescription:"渲染组件时发生异常。你可以尝试恢复,或刷新页面重新载入。",boundaryRetry:"重试",boundaryReload:"刷新页面",fileExists:"同名文件或文件夹已经存在。",pathConflict:"目标路径已经被文件或文件夹占用。",duplicateUploadNames:"所选文件中存在重复名称:{{files}}。",fileTooLarge:"文件超过 {{size}} MB 限制。",zipOnly:"请选择 ZIP 压缩包。",collaborationUnavailable:"实时协作尚未连接,请在重新连接后保存或编译。",codes:{AUTH_INVALID:"用户名或密码错误。",CURRENT_PASSWORD_INVALID:"当前密码错误。",USER_NOT_FOUND:"用户不存在或已被删除。",LAST_ADMIN:"系统必须保留至少一名可用管理员。",SELF_DELETE_FORBIDDEN:"不能删除当前登录的管理员。",PROJECT_CREATE_FORBIDDEN:"管理员尚未授予你创建项目的权限。",PROJECT_NOT_FOUND:"项目不存在或你已无法访问。",PROJECT_OWNER_ONLY:"只有项目所有者可以修改此设置。",PROJECT_EDIT_FORBIDDEN:"你没有此项目的编辑权限。",DICTIONARY_EDIT_FORBIDDEN:"你没有维护本项目词典的权限。",TAG_NOT_FOUND:"所选标签不存在。",GIT_TOKEN_INVALID:"请输入 GitHub token。",GIT_REPOSITORY_NAME_INVALID:"请输入 GitHub 仓库名称。",GIT_REVISION_INVALID:"请选择要 checkout 的 Git 版本。",PROJECT_DELETE_FORBIDDEN:"只有项目所有者可以删除项目。",MEMBERS_MANAGE_FORBIDDEN:"只有项目所有者可以管理项目成员。",OWNER_MEMBER_FORBIDDEN:"项目所有者不能作为成员添加。",INVALID_PATH:"文件路径无效。",RESERVED_PATH:"此路径由 TexLite 保留。",PATH_EXISTS:"目标路径已被文件或文件夹占用。",FILE_EXISTS:"同名文件已经存在。",PATH_NOT_FOUND:"文件或文件夹不存在。",FILE_NOT_FOUND:"文件不存在。",DIRECTORY_NOT_FOUND:"目标文件夹不存在。",MOVE_INTO_SELF:"不能把文件夹移动到自身内部。",MAIN_FILE_DELETE_FORBIDDEN:"不能删除主文档。",FILE_TOO_LARGE:"文件过大,无法打开或上传。",UPLOAD_EMPTY:"没有选择要上传的文件。",COMMENT_FILE_NOT_FOUND:"批注对应的文件不存在。",COMMENT_RANGE_INVALID:"批注的源码区间无效。",COMMENT_NOT_FOUND:"批注不存在。",COMMENT_EDIT_FORBIDDEN:"只能编辑自己的批注。",COMMENT_DELETE_FORBIDDEN:"只能删除自己的批注。",REPLY_NOT_FOUND:"回复不存在。",REPLY_EDIT_FORBIDDEN:"只能编辑自己的回复。",REPLY_DELETE_FORBIDDEN:"只能删除自己的回复。",COMMENT_UPDATE_EMPTY:"没有可更新的批注内容。",MAIN_FILE_NOT_FOUND:"所选主文档不存在。",LATEXMKRC_DISABLED:"管理员已禁用项目级 latexmkrc。",LATEXMKRC_NOT_FOUND:"所选 latexmkrc 文件不存在。",COMPILE_ARTIFACTS_NOT_FOUND:"尚无可用的编译产物。",COMPILE_ARTIFACT_NOT_FOUND:"编译产物不存在。",ARTIFACT_PREVIEW_UNSUPPORTED:"该产物不能作为文本预览,请下载后查看。",SYNC_SOURCE_INVALID:"源码位置无效。",SOURCE_FILE_NOT_FOUND:"源码文件不存在。",SYNCTEX_NOT_AVAILABLE:"尚无可用的 SyncTeX 数据,请重新编译。",SYNC_PDF_INVALID:"PDF 位置无效。",SYNCTEX_EXTERNAL_PATH:"SyncTeX 返回了项目外部的源码路径。",COMPILE_FORBIDDEN:"你没有编译此项目的权限。",PDF_NOT_FOUND:"尚未生成 PDF。",API_NOT_FOUND:"接口不存在。",SERVER_ERROR:"服务器无法完成请求。",REQUEST_INVALID:"请求格式无效。"}},Pr={historyVersionNotFound:"所选历史版本已不存在。",historyFileNotFound:"所选历史版本中没有这个文件。",historyObjectMissing:"该快照的已存储文件缺失,无法再查看或恢复。",historyTargetConflict:"当前恢复目标是目录或其他非普通文件路径。",historyPreviewUnsupported:"这个历史文件不能作为文本比较。",searchInvalid:"请输入有效的搜索内容。",gitUnavailable:"Git 集成功能不可用。请在宿主机安装 Git,或修正配置中的 git.binary 后重试。",formatFailed:"tex-fmt 无法格式化这段源码。",mainDocumentInvalid:"所选文件不是有效的 LaTeX 主文档。",compileSnapshotBusy:"源码尚未完成稳定保存,请稍后再试编译。"},Or={requestFailed:"网络请求失败,请检查连接后重试。",invalidResponse:"服务器返回了无效响应,请重试。"},Rr={protocolUpgrade:"工作区需要更新。本地草稿已保留;请在准备好重新连接时刷新页面。"},Lr={disableTitle:"禁用用户",disableDescription:"确定禁用 @{{username}} 吗?其活跃会话将结束,且无法再登录。",disableConfirm:"禁用用户",demoteTitle:"移除管理员权限",demoteDescription:"确定将 @{{username}} 降为普通用户吗?其将无法再管理用户。",demoteConfirm:"设为普通用户",denyProjectCreationTitle:"移除项目创建权限",denyProjectCreationDescription:"确定移除 @{{username}} 创建新项目的权限吗?其已有项目访问权限不受影响。",denyProjectCreationConfirm:"移除权限"},Fr={cancel:"取消编译",cancelling:"正在取消…",cancelled:"编译已取消。"},Nr={tagline:"面向小型研究团队的自托管 LaTeX 协作平台",copyright:"© {{year}}"},Ir={section:"章节",subsection:"小节",bold:"粗体",emphasis:"强调",citation:"引用文献",reference:"交叉引用",label:"标签",image:"插入图片",unordered:"无序列表",ordered:"有序列表",equation:"公式",figure:"图片环境",projectCommand:"项目命令",projectCommandArgs:"项目命令({{count}} 个参数)",projectMacro:"项目宏",expl3Command:"Expl3 项目命令",mathOperator:"项目数学算子",mathDelimiter:"项目数学定界符",projectEnvironment:"项目环境",projectFile:"项目文件",package:"宏包",documentClass:"文档类",currentFile:"当前文件",project:"项目",latex:"LaTeX",standard:"LaTeX 命令"},jr={common:lr,auth:dr,projects:ur,projectIcons:pr,users:fr,editor:hr,citationLibrary:mr,citationErrors:gr,citationLibraryHomeDescription:yr,citationLibraryActions:wr,citationLibraryPagination:vr,navigation:br,history:Cr,selectionHistory:Tr,projectSettings:xr,git:Dr,metrics:Sr,tags:kr,errors:Er,apiErrors:Pr,network:Or,workspaceUpdates:Rr,userConfirmations:Lr,compileControls:Fr,footer:Nr,completions:Ir};E.use(Qt).use(Go).init({resources:{en:{translation:cr},zh:{translation:jr}},fallbackLng:"en",supportedLngs:["en","zh"],nonExplicitSupportedLngs:!0,interpolation:{escapeValue:!1},detection:{order:["localStorage","navigator"],caches:["localStorage"]}});class ye extends Error{constructor(e,t,n=null){super(e),this.status=t,this.code=n}status;code}function eo(o){return o instanceof Error&&o.name==="AbortError"}function Ar(o){return eo(o)||o instanceof ye?o:new ye(E.t("network.requestFailed"),0,"NETWORK_ERROR")}function _r(o){return typeof FormData<"u"&&o instanceof FormData}async function se(o,e={}){const{suppressSessionExpired:t=!1,...n}=e,r=new Headers(n.headers);r.has("Accept-Language")||r.set("Accept-Language",E.resolvedLanguage?.startsWith("zh")?"zh":"en"),n.body&&!_r(n.body)&&!r.has("Content-Type")&&r.set("Content-Type","application/json");let i;try{i=await fetch(o,{...n,headers:r})}catch(c){throw Ar(c)}const s=i.headers.get("content-type")??"";let a=null;if(s.includes("application/json"))try{a=await i.json()}catch(c){throw eo(c)?c:new ye(E.t("network.invalidResponse"),i.status,"INVALID_RESPONSE")}else if(i.ok)throw new ye(E.t("network.invalidResponse"),i.status,"INVALID_RESPONSE");if(!i.ok)throw i.status===401&&!t&&typeof window<"u"&&window.dispatchEvent(new Event("texlite:session-expired")),new ye(Mr(a,i.status),i.status,to(a));return a}function Mr(o,e,t="errors.request"){const n=typeof o=="object"&&o!==null&&"error"in o&&typeof o.error=="string"?o.error:"",r=to(o);if(r){const i={AUTH_REQUIRED:"auth.sessionExpired",ADMIN_REQUIRED:"users.adminRequired",HISTORY_VERSION_NOT_FOUND:"apiErrors.historyVersionNotFound",HISTORY_FILE_NOT_FOUND:"apiErrors.historyFileNotFound",HISTORY_OBJECT_MISSING:"apiErrors.historyObjectMissing",HISTORY_TARGET_CONFLICT:"apiErrors.historyTargetConflict",HISTORY_FILE_PREVIEW_UNSUPPORTED:"apiErrors.historyPreviewUnsupported",SEARCH_QUERY_INVALID:"apiErrors.searchInvalid",GIT_UNAVAILABLE:"apiErrors.gitUnavailable",FORMAT_FAILED:"apiErrors.formatFailed",PROJECT_TRANSFER_FORBIDDEN:"projects.transferForbidden",PROJECT_TRANSFER_TARGET_INVALID:"projects.transferTargetInvalid",PROJECT_TRANSFER_SELF:"projects.transferSelf",MAIN_DOCUMENT_INVALID:"apiErrors.mainDocumentInvalid",COMPILE_SNAPSHOT_BUSY:"apiErrors.compileSnapshotBusy",COMPILE_CLEAN_BUSY:"editor.cleanBusy",CITATION_INVALID:"citationErrors.invalid",CITATION_TOO_LARGE:"citationErrors.tooLarge",CITATION_NOT_FOUND:"citationErrors.notFound",CITATION_KEY_EXISTS:"citationErrors.keyExists",CITATION_TAG_NOT_FOUND:"citationErrors.tagNotFound",CITATION_CONFLICT:"citationErrors.conflict",WORD_COUNT_FAILED:"editor.wordCountFailed",WORD_COUNT_SOURCE_INVALID:"editor.wordCountSourceInvalid",WORD_COUNT_SOURCE_TOO_LARGE:"editor.wordCountSourceTooLarge",WORD_COUNT_UNAVAILABLE:"editor.wordCountUnavailable"}[r]??`errors.codes.${r}`;if(E.exists(i))return E.t(i,{status:e,...typeof o=="object"&&o!==null?o:{}})}return n||E.t(t,{status:e})}function to(o){return typeof o!="object"||o===null||!("code"in o)||typeof o.code!="string"?null:o.code}const Ur=/^\/projects?\/([^/]+)\/?$/;function ne(o,e){const t=`/project/${encodeURIComponent(o)}`;return e?`${t}?${new URLSearchParams({mention:e}).toString()}`:t}function he(o){const e=new URLSearchParams(o).get("mention");return e&&e.length<=128?e:null}function J(o){const e=Ur.exec(o);if(!e)return null;try{const t=decodeURIComponent(e[1]);return t&&!t.includes("/")?t:null}catch{return null}}function $r(o,e){return"/?"+new URLSearchParams({return:ne(o,e)}).toString()}function oo(o){const e=new URLSearchParams(o).get("return");if(!e||!e.startsWith("/")||e.startsWith("//"))return null;try{return new URL(e,"https://texlite.invalid")}catch{return null}}function Hr(o){const e=oo(o);return e?J(e.pathname):null}function Br(o){const e=oo(o);return e?he(e.search):null}function At(o){if(!o||typeof o!="object")return!1;const e=o;return e.texliteRoute==="project"&&typeof e.projectId=="string"&&typeof e.fromDashboard=="boolean"}const no=()=>nt(()=>import("./PdfPreview-BKhcS-2c.js"),__vite__mapDeps([0,1,2,3,4])),Le=()=>nt(()=>import("./ProjectWorkspace-DqLwkGpT.js").then(o=>o.P),__vite__mapDeps([5,1,6,7,8,9,10])),Se=new Map,_t=2e3;function Be(o,e={}){const t=Date.now(),n=Se.get(o);if(!e.force&&n&&t-n.createdAt<_t)return n.preload;const r=se(`/api/projects/${o}`,{suppressSessionExpired:!0}),i=se(`/api/projects/${o}/compile/latest`,{suppressSessionExpired:!0}),s=no(),a={projectId:o,project:r,latestCompile:i};return Se.set(o,{preload:a,createdAt:t}),r.catch(()=>{}),Promise.all([s,i]).then(([c,l])=>{l.pdfUrl&&c.preloadPdf(l.pdfUrl,l.pdfLoadingMode??"full")}).catch(()=>{}),window.setTimeout(()=>{Se.get(o)?.preload===a&&Se.delete(o)},_t),a}function ro(o){return o instanceof Error?o.message:E.t("errors.generic")}function io({compact:o=!1}){const{i18n:e,t}=z(),n=e.resolvedLanguage?.startsWith("zh")?"zh":"en";return f.jsxs("label",{className:`language-switcher${o?" compact":""}`,title:t("common.language"),children:[f.jsx("span",{children:"文/A"}),f.jsxs("select",{value:n,"aria-label":t("common.language"),onChange:r=>{e.changeLanguage(r.target.value)},children:[f.jsx("option",{value:"en",children:t("common.languageEnglish")}),f.jsx("option",{value:"zh",children:t("common.languageChinese")})]})]})}const Vr="0.9.1";function so({siteName:o,compact:e=!1,auth:t=!1}){return f.jsx("span",{className:`site-logo${e?" compact":""}${t?" auth-logo":""}`,children:f.jsx("img",{src:"/logo.svg",alt:o})})}function ao(){const{t:o}=z();return f.jsxs("footer",{className:"site-footer",children:[f.jsx("span",{className:"site-footer-tagline",children:o("footer.tagline")}),f.jsxs("span",{children:[o("footer.copyright",{year:new Date().getFullYear()})," ",f.jsxs("a",{href:"https://github.com/SWUFE-DB-Group/TexLite",target:"_blank",rel:"noreferrer",children:["TexLite v",Vr]})]})]})}function Wr({site:o,user:e,onChanged:t}){const{t:n}=z(),[r,i]=p.useState(""),[s,a]=p.useState(""),[c,l]=p.useState(""),[u,d]=p.useState(""),h=async g=>{if(g.preventDefault(),s!==c)return d(n("auth.mismatch"));if(s.length<o.minPasswordLength)return d(n("auth.passwordMinimum",{count:o.minPasswordLength}));try{await se("/api/me/password",{method:"PUT",body:JSON.stringify({currentPassword:r,newPassword:s})}),t({...e,mustChangePassword:!1})}catch(m){d(ro(m))}};return f.jsxs("main",{className:"login-page",children:[f.jsx(io,{}),f.jsxs("form",{className:"login-card",onSubmit:h,children:[f.jsx(so,{siteName:o.siteName,auth:!0}),f.jsx("h1",{className:"sr-only",children:o.siteName}),f.jsx("p",{className:"muted",children:n("auth.firstLogin")}),f.jsxs("label",{children:[n("auth.currentPassword"),f.jsx("input",{type:"password",value:r,onChange:g=>i(g.target.value)})]}),f.jsxs("label",{children:[n("auth.newPassword"),f.jsx("input",{type:"password",minLength:o.minPasswordLength,autoComplete:"new-password",value:s,onChange:g=>a(g.target.value)}),f.jsx("small",{className:"field-hint",children:n("auth.passwordMinimum",{count:o.minPasswordLength})})]}),f.jsxs("label",{children:[n("auth.confirmPassword"),f.jsx("input",{type:"password",minLength:o.minPasswordLength,autoComplete:"new-password",value:c,onChange:g=>l(g.target.value)})]}),u&&f.jsx("p",{className:"error",children:u}),f.jsx("button",{className:"primary",children:n("auth.updatePassword")})]}),f.jsx(ao,{})]})}function Xr({site:o,onLogin:e}){const{t}=z(),[n,r]=p.useState(""),[i,s]=p.useState(""),[a,c]=p.useState(""),l=async u=>{u.preventDefault(),c("");try{const d=await se("/api/auth/login",{method:"POST",body:JSON.stringify({username:n,password:i}),suppressSessionExpired:!0});e(d.user)}catch(d){c(ro(d))}};return f.jsxs("main",{className:"login-page",children:[f.jsx(io,{}),f.jsxs("form",{className:"login-card",onSubmit:l,children:[f.jsx(so,{siteName:o.siteName,auth:!0}),f.jsx("h1",{className:"sr-only",children:o.siteName}),f.jsx("p",{className:"muted",children:t("auth.tagline")}),f.jsxs("label",{children:[t("auth.username"),f.jsx("input",{autoFocus:!0,value:n,onChange:u=>r(u.target.value)})]}),f.jsxs("label",{children:[t("auth.password"),f.jsx("input",{type:"password",value:i,onChange:u=>s(u.target.value)})]}),a&&f.jsx("p",{className:"error",children:a}),f.jsx("button",{className:"primary",type:"submit",children:t("auth.login")}),o.adminEmail&&f.jsx("small",{className:"support",children:t("auth.contact",{email:o.adminEmail})})]}),f.jsx(ao,{})]})}const zr=o=>o.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),co=(...o)=>o.filter((e,t,n)=>!!e&&e.trim()!==""&&n.indexOf(e)===t).join(" ").trim();var Gr={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const Kr=p.forwardRef(({color:o="currentColor",size:e=24,strokeWidth:t=2,absoluteStrokeWidth:n,className:r="",children:i,iconNode:s,...a},c)=>p.createElement("svg",{ref:c,...Gr,width:e,height:e,stroke:o,strokeWidth:n?Number(t)*24/Number(e):t,className:co("lucide",r),...a},[...s.map(([l,u])=>p.createElement(l,u)),...Array.isArray(i)?i:[i]]));const Yr=(o,e)=>{const t=p.forwardRef(({className:n,...r},i)=>p.createElement(Kr,{ref:i,iconNode:e,className:co(`lucide-${zr(o)}`,n),...r}));return t.displayName=`${o}`,t};const lo=Yr("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);var qr=Object.defineProperty,ce=(o,e)=>qr(o,"name",{value:e,configurable:!0}),uo=!!(typeof window<"u"&&window.document&&window.document.createElement);function G(o,e,{checkForDefaultPrevented:t=!0}={}){return ce(function(r){if(o?.(r),t===!1||!r||!r.defaultPrevented)return e?.(r)},"handleEvent")}ce(G,"composeEventHandlers");function Jr(o){if(!uo)throw new Error("Cannot access window outside of the DOM");return o?.ownerDocument?.defaultView??window}ce(Jr,"getOwnerWindow");function Ge(o){if(!uo)throw new Error("Cannot access document outside of the DOM");return o?.ownerDocument??document}ce(Ge,"getOwnerDocument");function po(o,e=!1){const{activeElement:t}=Ge(o);if(!t?.nodeName)return null;if(fo(t)&&t.contentDocument)return po(t.contentDocument.body,e);if(e){const n=t.getAttribute("aria-activedescendant");if(n){const r=Ge(t).getElementById(n);if(r)return r}}return t}ce(po,"getActiveElement");function fo(o){return o.tagName==="IFRAME"}ce(fo,"isFrame");var Zr=Object.defineProperty,rt=(o,e)=>Zr(o,"name",{value:e,configurable:!0});function Ke(o,e){if(typeof o=="function")return o(e);o!=null&&(o.current=e)}rt(Ke,"setRef");function ho(...o){return e=>{let t=!1;const n=o.map(r=>{const i=Ke(r,e);return!t&&typeof i=="function"&&(t=!0),i});if(t)return()=>{for(let r=0;r<n.length;r++){const i=n[r];typeof i=="function"?i():Ke(o[r],null)}}}}rt(ho,"composeRefs");function le(...o){return p.useCallback(ho(...o),o)}rt(le,"useComposedRefs");var Qr=Object.defineProperty,_=(o,e)=>Qr(o,"name",{value:e,configurable:!0});function ei(o,e){const t=p.createContext(e);t.displayName=o+"Context";const n=_(i=>{const{children:s,...a}=i,c=p.useMemo(()=>a,Object.values(a));return f.jsx(t.Provider,{value:c,children:s})},"Provider");n.displayName=o+"Provider";function r(i,s={}){const{optional:a=!1}=s,c=p.useContext(t);if(c)return c;if(e!==void 0)return e;if(!a)throw new Error(`\`${i}\` must be used within \`${o}\``)}return _(r,"useContext"),[n,r]}_(ei,"createContext");function mo(o,e=[]){let t=[];function n(i,s){const a=p.createContext(s);a.displayName=i+"Context";const c=t.length;t=[...t,s];const l=_(d=>{const{scope:h,children:g,...m}=d,x=h?.[o]?.[c]||a,v=p.useMemo(()=>m,Object.values(m));return f.jsx(x.Provider,{value:v,children:g})},"Provider");l.displayName=i+"Provider";function u(d,h,g={}){const{optional:m=!1}=g,x=h?.[o]?.[c]||a,v=p.useContext(x);if(v)return v;if(s!==void 0)return s;if(!m)throw new Error(`\`${d}\` must be used within \`${i}\``)}return _(u,"useContext"),[l,u]}_(n,"createContext");const r=_(()=>{const i=t.map(s=>p.createContext(s));return _(function(a){const c=a?.[o]||i;return p.useMemo(()=>({[`__scope${o}`]:{...a,[o]:c}}),[a,c])},"useScope")},"createScope");return r.scopeName=o,[n,go(r,...e)]}_(mo,"createContextScope");function go(...o){const e=o[0];if(o.length===1)return e;const t=_(()=>{const n=o.map(r=>({useScope:r(),scopeName:r.scopeName}));return _(function(i){const s=n.reduce((a,{useScope:c,scopeName:l})=>{const d=c(i)[`__scope${l}`];return{...a,...d}},{});return p.useMemo(()=>({[`__scope${e.scopeName}`]:s}),[s])},"useComposedScopes")},"createScope");return t.scopeName=e.scopeName,t}_(go,"composeContextScopes");var K=globalThis?.document?p.useLayoutEffect:()=>{},ti=Object.defineProperty,oi=(o,e)=>ti(o,"name",{value:e,configurable:!0}),ni=be[" useId ".trim().toString()]||(()=>{}),ri=0;function Fe(o){const[e,t]=p.useState(ni());return K(()=>{o||t(n=>n??String(ri++))},[o]),o||(e?`radix-${e}`:"")}oi(Fe,"useId");var ii=Object.defineProperty,si=(o,e)=>ii(o,"name",{value:e,configurable:!0}),Mt=be[" useEffectEvent ".trim().toString()],Ut=be[" useInsertionEffect ".trim().toString()];function yo(o){if(typeof Mt=="function")return Mt(o);const e=p.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof Ut=="function"?Ut(()=>{e.current=o}):K(()=>{e.current=o}),p.useMemo(()=>((...t)=>e.current?.(...t)),[])}si(yo,"useEffectEvent");var ai=Object.defineProperty,Ce=(o,e)=>ai(o,"name",{value:e,configurable:!0}),ci=be[" useInsertionEffect ".trim().toString()]||K;function wo({prop:o,defaultProp:e,onChange:t=Ce(()=>{},"onChange"),caller:n}){const[r,i,s]=vo({defaultProp:e,onChange:t}),a=o!==void 0,c=a?o:r,l=p.useCallback(u=>{if(a){const d=bo(u)?u(o):u;d!==o&&s.current?.(d)}else i(u)},[a,o,i,s]);return[c,l]}Ce(wo,"useControllableState");function vo({defaultProp:o,onChange:e}){const[t,n]=p.useState(o),r=p.useRef(t),i=p.useRef(e);return ci(()=>{i.current=e},[e]),p.useEffect(()=>{r.current!==t&&(i.current?.(t),r.current=t)},[t,r]),[t,n,i]}Ce(vo,"useUncontrolledState");function bo(o){return typeof o=="function"}Ce(bo,"isFunction");var $t=Symbol("RADIX:SYNC_STATE");function li(o,e,t,n){const{prop:r,defaultProp:i,onChange:s,caller:a}=e,c=r!==void 0,l=yo(s),u=[{...t,state:i}];n&&u.push(n);const[d,h]=p.useReducer((v,S)=>{if(S.type===$t)return{...v,state:S.state};const C=o(v,S);return c&&!Object.is(C.state,v.state)&&l(C.state),C},...u),g=d.state,m=p.useRef(g);p.useEffect(()=>{m.current!==g&&(m.current=g,c||l(g))},[g,m,c]);const x=p.useMemo(()=>r!==void 0?{...d,state:r}:d,[d,r]);return p.useEffect(()=>{c&&!Object.is(r,d.state)&&h({type:$t,state:r})},[r,d.state,c]),[x,h]}Ce(li,"useControllableStateReducer");var di=Object.defineProperty,U=(o,e)=>di(o,"name",{value:e,configurable:!0});function it(o){const e=p.forwardRef((t,n)=>{let{children:r,...i}=t,s=null,a=!1;const c=[];Ye(r)&&typeof ke=="function"&&(r=ke(r._payload)),p.Children.forEach(r,h=>{if(Do(h)){a=!0;const g=h;let m="child"in g.props?g.props.child:g.props.children;Ye(m)&&typeof ke=="function"&&(m=ke(m._payload)),s=pi(g,m),c.push(s?.props?.children)}else c.push(h)}),s?s=p.cloneElement(s,void 0,c):!a&&p.Children.count(r)===1&&p.isValidElement(r)&&(s=r);const l=s?xo(s):void 0,u=le(n,l);if(!s){if(r||r===0)throw new Error(a?mi(o):hi(o));return r}const d=To(i,s.props??{});return s.type!==p.Fragment&&(d.ref=n?u:l),p.cloneElement(s,d)});return e.displayName=`${o}.Slot`,e}U(it,"createSlot");var Co=Symbol.for("radix.slottable");function ui(o){const e=U(t=>"child"in t?t.children(t.child):t.children,"Slottable");return e.displayName=`${o}.Slottable`,e.__radixId=Co,e}U(ui,"createSlottable");var pi=U((o,e)=>{if("child"in o.props){const t=o.props.child;return p.isValidElement(t)?p.cloneElement(t,void 0,o.props.children(t.props.children)):null}return p.isValidElement(e)?e:null},"getSlottableElementFromSlottable");function To(o,e){const t={...e};for(const n in e){const r=o[n],i=e[n];/^on[A-Z]/.test(n)?r&&i?t[n]=(...a)=>{const c=i(...a);return r(...a),c}:r&&(t[n]=r):n==="style"?t[n]={...r,...i}:n==="className"&&(t[n]=[r,i].filter(Boolean).join(" "))}return{...o,...t}}U(To,"mergeProps");function xo(o){let e=Object.getOwnPropertyDescriptor(o.props,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning;return t?o.ref:(e=Object.getOwnPropertyDescriptor(o,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning,t?o.props.ref:o.props.ref||o.ref)}U(xo,"getElementRef");function Do(o){return p.isValidElement(o)&&typeof o.type=="function"&&"__radixId"in o.type&&o.type.__radixId===Co}U(Do,"isSlottable");var fi=Symbol.for("react.lazy");function Ye(o){return o!=null&&typeof o=="object"&&"$$typeof"in o&&o.$$typeof===fi&&"_payload"in o&&So(o._payload)}U(Ye,"isLazyComponent");function So(o){return typeof o=="object"&&o!==null&&"then"in o}U(So,"isPromiseLike");var hi=U(o=>`${o} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),mi=U(o=>`${o} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),ke=be[" use ".trim().toString()],gi=Object.defineProperty,yi=(o,e)=>gi(o,"name",{value:e,configurable:!0}),wi=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Z=wi.reduce((o,e)=>{const t=it(`Primitive.${e}`),n=p.forwardRef((r,i)=>{const{asChild:s,...a}=r,c=s?t:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),f.jsx(c,{...a,ref:i})});return n.displayName=`Primitive.${e}`,{...o,[e]:n}},{});function ko(o,e){o&&zt.flushSync(()=>o.dispatchEvent(e))}yi(ko,"dispatchDiscreteCustomEvent");var vi=Object.defineProperty,bi=(o,e)=>vi(o,"name",{value:e,configurable:!0});function ae(o){const e=p.useRef(o);return p.useEffect(()=>{e.current=o}),p.useMemo(()=>((...t)=>e.current?.(...t)),[])}bi(ae,"useCallbackRef");var Ci=Object.defineProperty,R=(o,e)=>Ci(o,"name",{value:e,configurable:!0}),qe="dismissableLayer.update",Ti="dismissableLayer.pointerDownOutside",xi="dismissableLayer.focusOutside",Ht,Eo=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Di=p.forwardRef(R(function(e,t){const{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:c,onDismiss:l,...u}=e,d=p.useContext(Eo),[h,g]=p.useState(null),m=h?.ownerDocument??globalThis?.document,[,x]=p.useState({}),v=le(t,g),S=Array.from(d.layers),[C]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),y=C?S.indexOf(C):-1,b=h?S.indexOf(h):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,D=b>=y,k=p.useRef(!1),L=Oo(P=>{s?.(P),c?.(P),P.defaultPrevented||l?.()},{ownerDocument:m,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:k,dismissableSurfaces:d.dismissableSurfaces,shouldHandlePointerDownOutside:p.useCallback(P=>{if(!(P instanceof Node))return!1;const O=[...d.branches].some(j=>j.contains(P));return D&&!O},[d.branches,D])}),I=Ro(P=>{if(r&&k.current)return;const O=P.target;[...d.branches].some(Te=>Te.contains(O))||(a?.(P),c?.(P),P.defaultPrevented||l?.())},m),F=h?b===S.length-1:!1,de=ae(P=>{P.key==="Escape"&&(i?.(P),!P.defaultPrevented&&l&&(P.preventDefault(),l()))});return p.useEffect(()=>{if(F)return m.addEventListener("keydown",de,{capture:!0}),()=>m.removeEventListener("keydown",de,{capture:!0})},[m,F,de]),p.useEffect(()=>{if(h)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Ht=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),Je(),()=>{n&&(d.layersWithOutsidePointerEventsDisabled.delete(h),d.layersWithOutsidePointerEventsDisabled.size===0&&(m.body.style.pointerEvents=Ht))}},[h,m,n,d]),p.useEffect(()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),Je())},[h,d]),p.useEffect(()=>{const P=R(()=>x({}),"handleUpdate");return document.addEventListener(qe,P),()=>document.removeEventListener(qe,P)},[]),f.jsx(Z.div,{...u,ref:v,style:{pointerEvents:w?D?"auto":"none":void 0,...e.style},onFocusCapture:G(e.onFocusCapture,I.onFocusCapture),onBlurCapture:G(e.onBlurCapture,I.onBlurCapture),onPointerDownCapture:G(e.onPointerDownCapture,L.onPointerDownCapture)})},"DismissableLayer"));function Po(){const o=p.useContext(Eo),[e,t]=p.useState(null);return p.useEffect(()=>{if(e)return o.dismissableSurfaces.add(e),()=>{o.dismissableSurfaces.delete(e)}},[e,o.dismissableSurfaces]),t}R(Po,"useDismissableLayerSurface");var Si=R(()=>!0,"IS_TRUE");function Oo(o,e){const{ownerDocument:t=globalThis?.document,deferPointerDownOutside:n=!1,isDeferredPointerDownOutsideRef:r,dismissableSurfaces:i,shouldHandlePointerDownOutside:s=Si}=e,a=ae(o),c=p.useRef(!1),l=p.useRef(!1),u=p.useRef(new Map),d=p.useRef(()=>{});return p.useEffect(()=>{function h(){l.current=!1,r.current=!1,u.current.clear()}R(h,"resetOutsideInteraction");function g(){return Array.from(u.current.values()).some(Boolean)}R(g,"isOutsideInteractionIntercepted");function m(y){if(!l.current)return;const b=y.target;b instanceof Node&&[...i].some(D=>D.contains(b))||u.current.set(y.type,!0),y.type==="click"&&window.setTimeout(()=>{l.current&&d.current()},0)}R(m,"handleInteractionCapture");function x(y){l.current&&u.current.set(y.type,!1)}R(x,"handleInteractionBubble");const v=R(y=>{if(y.target&&!c.current){let b=function(){t.removeEventListener("click",d.current);const D=g();h(),D||st(Ti,a,w,{discrete:!0})};if(R(b,"handleAndDispatchPointerDownOutsideEvent"),!s(y.target)){t.removeEventListener("click",d.current),h(),c.current=!1;return}const w={originalEvent:y};l.current=!0,r.current=n&&y.button===0,u.current.clear(),!n||y.button!==0?b():(t.removeEventListener("click",d.current),d.current=b,t.addEventListener("click",d.current,{once:!0}))}else t.removeEventListener("click",d.current),h();c.current=!1},"handlePointerDown"),S=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const y of S)t.addEventListener(y,m,!0),t.addEventListener(y,x);const C=window.setTimeout(()=>{t.addEventListener("pointerdown",v)},0);return()=>{window.clearTimeout(C),t.removeEventListener("pointerdown",v),t.removeEventListener("click",d.current);for(const y of S)t.removeEventListener(y,m,!0),t.removeEventListener(y,x)}},[t,a,n,r,i,s]),{onPointerDownCapture:R(()=>c.current=!0,"onPointerDownCapture")}}R(Oo,"usePointerDownOutside");function Ro(o,e=globalThis?.document){const t=ae(o),n=p.useRef(!1);return p.useEffect(()=>{const r=R(i=>{i.target&&!n.current&&st(xi,t,{originalEvent:i},{discrete:!1})},"handleFocus");return e.addEventListener("focusin",r),()=>e.removeEventListener("focusin",r)},[e,t]),{onFocusCapture:R(()=>n.current=!0,"onFocusCapture"),onBlurCapture:R(()=>n.current=!1,"onBlurCapture")}}R(Ro,"useFocusOutside");function Je(){const o=new CustomEvent(qe);document.dispatchEvent(o)}R(Je,"dispatchUpdate");function st(o,e,t,{discrete:n}){const r=t.originalEvent.target,i=new CustomEvent(o,{bubbles:!1,cancelable:!0,detail:t});e&&r.addEventListener(o,e,{once:!0}),n?ko(r,i):r.dispatchEvent(i)}R(st,"handleAndDispatchCustomEvent");var ki=Object.defineProperty,N=(o,e)=>ki(o,"name",{value:e,configurable:!0}),Ve="focusScope.autoFocusOnMount",We="focusScope.autoFocusOnUnmount",Bt={bubbles:!1,cancelable:!0},Ei=p.forwardRef(N(function(e,t){const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...a}=e,[c,l]=p.useState(null),u=ae(i),d=ae(s),h=p.useRef(null),g=le(t,l),m=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(r){let v=function(b){if(m.paused||!c)return;const w=b.target;c.contains(w)?h.current=w:W(h.current,{select:!0})},S=function(b){if(m.paused||!c)return;const w=b.relatedTarget;w!==null&&(c.contains(w)||W(h.current,{select:!0}))},C=function(b){if(document.activeElement===document.body)for(const D of b)D.removedNodes.length>0&&W(c)};N(v,"handleFocusIn"),N(S,"handleFocusOut"),N(C,"handleMutations"),document.addEventListener("focusin",v),document.addEventListener("focusout",S);const y=new MutationObserver(C);return c&&y.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",S),y.disconnect()}}},[r,c,m.paused]),p.useEffect(()=>{if(c){Vt.add(m);const v=document.activeElement;if(!c.contains(v)){const C=new CustomEvent(Ve,Bt);c.addEventListener(Ve,u),c.dispatchEvent(C),C.defaultPrevented||(Lo(Ao(at(c)),{select:!0}),document.activeElement===v&&W(c))}return()=>{c.removeEventListener(Ve,u),setTimeout(()=>{const C=new CustomEvent(We,Bt);c.addEventListener(We,d),c.dispatchEvent(C),C.defaultPrevented||W(v??document.body,{select:!0}),c.removeEventListener(We,d),Vt.remove(m)},0)}}},[c,u,d,m]);const x=p.useCallback(v=>{if(!n&&!r||m.paused)return;const S=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,C=document.activeElement;if(S&&C){const y=v.currentTarget,[b,w]=Fo(y);b&&w?!v.shiftKey&&C===w?(v.preventDefault(),n&&W(b,{select:!0})):v.shiftKey&&C===b&&(v.preventDefault(),n&&W(w,{select:!0})):C===y&&v.preventDefault()}},[n,r,m.paused]);return f.jsx(Z.div,{tabIndex:-1,...a,ref:g,onKeyDown:x})},"FocusScope"));function Lo(o,{select:e=!1}={}){const t=document.activeElement;for(const n of o)if(W(n,{select:e}),document.activeElement!==t)return}N(Lo,"focusFirst");function Fo(o){const e=at(o),t=Ze(e,o),n=Ze(e.reverse(),o);return[t,n]}N(Fo,"getTabbableEdges");function at(o){const e=[],t=document.createTreeWalker(o,NodeFilter.SHOW_ELEMENT,{acceptNode:N(n=>{const r=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||r?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;t.nextNode();)e.push(t.currentNode);return e}N(at,"getTabbableCandidates");function Ze(o,e){const t=typeof e.checkVisibility=="function"&&e.checkVisibility({checkVisibilityCSS:!0});for(const n of o)if(!(t?!n.checkVisibility({checkVisibilityCSS:!0}):No(n,{upTo:e})))return n}N(Ze,"findVisible");function No(o,{upTo:e}){if(getComputedStyle(o).visibility==="hidden")return!0;for(;o;){if(e!==void 0&&o===e)return!1;if(getComputedStyle(o).display==="none")return!0;o=o.parentElement}return!1}N(No,"isHidden");function Io(o){return o instanceof HTMLInputElement&&"select"in o}N(Io,"isSelectableInput");function W(o,{select:e=!1}={}){if(o&&o.focus){const t=document.activeElement;o.focus({preventScroll:!0}),o!==t&&Io(o)&&e&&o.select()}}N(W,"focus");var Vt=jo();function jo(){let o=[];return{add(e){const t=o[0];e!==t&&t?.pause(),o=Qe(o,e),o.unshift(e)},remove(e){o=Qe(o,e),o[0]?.resume()}}}N(jo,"createFocusScopesStack");function Qe(o,e){const t=[...o],n=t.indexOf(e);return n!==-1&&t.splice(n,1),t}N(Qe,"arrayRemove");function Ao(o){return o.filter(e=>e.tagName!=="A")}N(Ao,"removeLinks");var Pi=Object.defineProperty,Oi=(o,e)=>Pi(o,"name",{value:e,configurable:!0}),Ri=p.forwardRef(Oi(function(e,t){const{container:n,...r}=e,[i,s]=p.useState(!1);K(()=>s(!0),[]);const a=n||i&&globalThis?.document?.body;return a?zt.createPortal(f.jsx(Z.div,{...r,ref:t}),a):null},"Portal")),Li=Object.defineProperty,X=(o,e)=>Li(o,"name",{value:e,configurable:!0});function _o(o,e){return p.useReducer((t,n)=>e[t][n]??t,o)}X(_o,"useStateMachine");var ct=X(o=>{const{present:e,children:t}=o,n=Mo(e),r=typeof t=="function"?t({present:n.isPresent}):p.Children.only(t),i=Uo(n.ref,$o(r));return typeof t=="function"||n.isPresent?p.cloneElement(r,{ref:i}):null},"Presence");function Mo(o){const[e,t]=p.useState(),n=p.useRef(null),r=p.useRef(o),i=p.useRef("none"),s=p.useRef(void 0),a=o?"mounted":"unmounted",[c,l]=_o(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{c==="mounted"?(i.current=s.current??re(n.current),s.current=void 0):i.current="none"},[c]),K(()=>{const u=n.current,d=r.current;if(d!==o){const g=i.current,m=re(u);o?(s.current=m,l("MOUNT")):m==="none"||u?.display==="none"?l("UNMOUNT"):l(d&&g!==m?"ANIMATION_OUT":"UNMOUNT"),r.current=o}},[o,l]),K(()=>{if(e){let u;const d=e.ownerDocument.defaultView??window,h=X(m=>{const v=re(n.current).includes(CSS.escape(m.animationName));if(m.target===e&&v&&(l("ANIMATION_END"),!r.current)){const S=e.style.animationFillMode;e.style.animationFillMode="forwards",u=d.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=S)})}},"handleAnimationEnd"),g=X(m=>{m.target===e&&(i.current=re(n.current))},"handleAnimationStart");return e.addEventListener("animationstart",g),e.addEventListener("animationcancel",h),e.addEventListener("animationend",h),()=>{d.clearTimeout(u),e.removeEventListener("animationstart",g),e.removeEventListener("animationcancel",h),e.removeEventListener("animationend",h)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:p.useCallback(u=>{if(u){const d=getComputedStyle(u);n.current=d,s.current=re(d)}else n.current=null;t(u)},[])}}X(Mo,"usePresence");function et(o,e){if(typeof o=="function")return o(e);o!=null&&(o.current=e)}X(et,"setRef");function Uo(...o){const e=p.useRef(o);return e.current=o,p.useCallback(t=>{const n=e.current;let r=!1;const i=n.map(s=>{const a=et(s,t);return!r&&typeof a=="function"&&(r=!0),a});if(r)return()=>{for(let s=0;s<i.length;s++){const a=i[s];typeof a=="function"?a():et(n[s],null)}}},[])}X(Uo,"useStableComposedRefs");function re(o){return o?.animationName||"none"}X(re,"getAnimationName");function $o(o){let e=Object.getOwnPropertyDescriptor(o.props,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning;return t?o.ref:(e=Object.getOwnPropertyDescriptor(o,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning,t?o.props.ref:o.props.ref||o.ref)}X($o,"getElementRef");var Fi=Object.defineProperty,lt=(o,e)=>Fi(o,"name",{value:e,configurable:!0}),Ee=0,te=null;function Ni(o){return dt(),o.children}lt(Ni,"FocusGuards");function dt(){p.useEffect(()=>{te||(te={start:tt(),end:tt()});const{start:o,end:e}=te;return document.body.firstElementChild!==o&&document.body.insertAdjacentElement("afterbegin",o),document.body.lastElementChild!==e&&document.body.insertAdjacentElement("beforeend",e),Ee++,()=>{Ee===1&&(te?.start.remove(),te?.end.remove(),te=null),Ee=Math.max(0,Ee-1)}},[])}lt(dt,"useFocusGuards");function tt(){const o=document.createElement("span");return o.setAttribute("data-radix-focus-guard",""),o.tabIndex=0,o.style.outline="none",o.style.opacity="0",o.style.position="fixed",o.style.pointerEvents="none",o}lt(tt,"createFocusGuard");var Ii=function(o){if(typeof document>"u")return null;var e=Array.isArray(o)?o[0]:o;return e.ownerDocument.body},oe=new WeakMap,Pe=new WeakMap,Oe={},Xe=0,Ho=function(o){return o&&(o.host||Ho(o.parentNode))},ji=function(o,e){return e.map(function(t){if(o.contains(t))return t;var n=Ho(t);return n&&o.contains(n)?n:(console.error("aria-hidden",t,"in not contained inside",o,". Doing nothing"),null)}).filter(function(t){return!!t})},Ai=function(o,e,t,n){var r=ji(e,Array.isArray(o)?o:[o]);Oe[t]||(Oe[t]=new WeakMap);var i=Oe[t],s=[],a=new Set,c=new Set(r),l=function(d){!d||a.has(d)||(a.add(d),l(d.parentNode))};r.forEach(l);var u=function(d){!d||c.has(d)||Array.prototype.forEach.call(d.children,function(h){if(a.has(h))u(h);else try{var g=h.getAttribute(n),m=g!==null&&g!=="false",x=(oe.get(h)||0)+1,v=(i.get(h)||0)+1;oe.set(h,x),i.set(h,v),s.push(h),x===1&&m&&Pe.set(h,!0),v===1&&h.setAttribute(t,"true"),m||h.setAttribute(n,"true")}catch(S){console.error("aria-hidden: cannot operate on ",h,S)}})};return u(e),a.clear(),Xe++,function(){s.forEach(function(d){var h=oe.get(d)-1,g=i.get(d)-1;oe.set(d,h),i.set(d,g),h||(Pe.has(d)||d.removeAttribute(n),Pe.delete(d)),g||d.removeAttribute(t)}),Xe--,Xe||(oe=new WeakMap,oe=new WeakMap,Pe=new WeakMap,Oe={})}},_i=function(o,e,t){t===void 0&&(t="data-aria-hidden");var n=Array.from(Array.isArray(o)?o:[o]),r=Ii(o);return r?(n.push.apply(n,Array.from(r.querySelectorAll("[aria-live], script"))),Ai(n,r,t,"aria-hidden")):function(){return null}},Mi=Object.defineProperty,M=(o,e)=>Mi(o,"name",{value:e,configurable:!0}),ut="Dialog",[Bo,as]=mo(ut),[Ui,B]=Bo(ut),$i=M(o=>{const{__scopeDialog:e,children:t,open:n,defaultOpen:r,onOpenChange:i,modal:s=!0}=o,a=p.useRef(null),c=p.useRef(null),[l,u]=wo({prop:n,defaultProp:r??!1,onChange:i,caller:ut}),[d,h]=p.useState(0),[g,m]=p.useState(0);return f.jsx(Ui,{scope:e,triggerRef:a,contentRef:c,contentId:Fe(),titleId:Fe(),descriptionId:Fe(),titlePresent:d>0,descriptionPresent:g>0,setTitleCount:h,setDescriptionCount:m,open:l,onOpenChange:u,onOpenToggle:p.useCallback(()=>u(x=>!x),[u]),modal:s,children:t})},"Dialog"),Vo="DialogPortal",[Hi,Wo]=Bo(Vo,{forceMount:void 0}),Bi=M(o=>{const{__scopeDialog:e,forceMount:t,children:n,container:r}=o,i=B(Vo,e);return f.jsx(Hi,{scope:e,forceMount:t,children:p.Children.map(n,s=>f.jsx(ct,{present:t||i.open,children:f.jsx(Ri,{asChild:!0,container:r,children:s})}))})},"DialogPortal"),ot="DialogOverlay",Vi=p.forwardRef(M(function(e,t){const n=Wo(ot,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,s=B(ot,e.__scopeDialog);return s.modal?f.jsx(ct,{present:r||s.open,children:f.jsx(Xi,{...i,ref:t})}):null},"DialogOverlay")),Wi=it("DialogOverlay.RemoveScroll"),Xi=p.forwardRef(M(function(e,t){const{__scopeDialog:n,...r}=e,i=B(ot,n),s=Po(),a=le(t,s);return f.jsx(Ko,{as:Wi,allowPinchZoom:!0,shards:[i.contentRef],children:f.jsx(Z.div,{"data-state":pt(i.open),...r,ref:a,style:{pointerEvents:"auto",...r.style}})})},"DialogOverlayImpl")),ve="DialogContent",zi=p.forwardRef(M(function(e,t){const n=Wo(ve,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,s=B(ve,e.__scopeDialog);return f.jsx(ct,{present:r||s.open,children:s.modal?f.jsx(Gi,{...i,ref:t}):f.jsx(Ki,{...i,ref:t})})},"DialogContent")),Gi=p.forwardRef(M(function(e,t){const n=B(ve,e.__scopeDialog),r=p.useRef(null),i=le(t,n.contentRef,r);return p.useEffect(()=>{const s=r.current;if(s)return _i(s)},[]),f.jsx(Xo,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:G(e.onCloseAutoFocus,s=>{s.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:G(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0;(a.button===2||c)&&s.preventDefault()}),onFocusOutside:G(e.onFocusOutside,s=>s.preventDefault())})},"DialogContentModal")),Ki=p.forwardRef(M(function(e,t){const n=B(ve,e.__scopeDialog),r=p.useRef(!1),i=p.useRef(!1);return f.jsx(Xo,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(r.current||n.triggerRef.current?.focus(),s.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const a=s.target;n.triggerRef.current?.contains(a)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})},"DialogContentNonModal")),Xo=p.forwardRef(M(function(e,t){const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,...a}=e,c=B(ve,n);return dt(),f.jsx(f.Fragment,{children:f.jsx(Ei,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s,children:f.jsx(Di,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionPresent?c.descriptionId:void 0,"aria-labelledby":c.titlePresent?c.titleId:void 0,"data-state":pt(c.open),...a,ref:t,deferPointerDownOutside:!0,onDismiss:()=>c.onOpenChange(!1)})})})},"DialogContentImpl")),Yi="DialogTitle",qi=p.forwardRef(M(function(e,t){const{__scopeDialog:n,...r}=e,i=B(Yi,n),{setTitleCount:s}=i;return K(()=>(s(a=>a+1),()=>s(a=>a-1)),[s]),f.jsx(Z.h2,{id:i.titleId,...r,ref:t})},"DialogTitle")),Ji="DialogDescription",Zi=p.forwardRef(M(function(e,t){const{__scopeDialog:n,...r}=e,i=B(Ji,n),{setDescriptionCount:s}=i;return K(()=>(s(a=>a+1),()=>s(a=>a-1)),[s]),f.jsx(Z.p,{id:i.descriptionId,...r,ref:t})},"DialogDescription")),Qi="DialogClose",es=p.forwardRef(M(function(e,t){const{__scopeDialog:n,...r}=e,i=B(Qi,n);return f.jsx(Z.button,{type:"button",...r,ref:t,onClick:G(e.onClick,()=>i.onOpenChange(!1))})},"DialogClose"));function pt(o){return o?"open":"closed"}M(pt,"getState");function ft({open:o,title:e,description:t,onOpenChange:n,children:r,footer:i,wide:s,extraWide:a,className:c,draggable:l=!1}){const{t:u}=z(),d=p.useRef(null),h=p.useRef(null),[g,m]=p.useState({x:0,y:0}),[x,v]=p.useState(!1);p.useEffect(()=>{o||(h.current=null,v(!1),m({x:0,y:0}))},[o]);const S=w=>{!l||w.button!==0||w.pointerType==="touch"||ts(w.target)||(h.current={pointerId:w.pointerId,clientX:w.clientX,clientY:w.clientY,...g},w.currentTarget.setPointerCapture(w.pointerId),v(!0),w.preventDefault())},C=w=>{const D=h.current;if(!D||D.pointerId!==w.pointerId)return;const k=d.current;if(!k)return;const L=k.getBoundingClientRect(),I=Math.max(0,(window.innerWidth-L.width)/2-12),F=Math.max(0,(window.innerHeight-L.height)/2-12);m({x:Wt(D.x+w.clientX-D.clientX,-I,I),y:Wt(D.y+w.clientY-D.clientY,-F,F)})},y=w=>{h.current?.pointerId===w.pointerId&&(h.current=null,v(!1),w.currentTarget.hasPointerCapture(w.pointerId)&&w.currentTarget.releasePointerCapture(w.pointerId))},b=l?{"--dialog-drag-x":`${g.x}px`,"--dialog-drag-y":`${g.y}px`}:void 0;return f.jsx($i,{open:o,onOpenChange:n,children:f.jsxs(Bi,{children:[f.jsx(Vi,{className:"dialog-overlay"}),f.jsxs(zi,{ref:d,style:b,"data-dragging":x||void 0,className:`dialog-content${s?" dialog-wide":""}${a?" dialog-extra-wide":""}${l?" dialog-draggable":""}${c?` ${c}`:""}`,children:[f.jsxs("div",{className:`dialog-header${l?" dialog-drag-handle":""}`,onPointerDown:S,onPointerMove:C,onPointerUp:y,onPointerCancel:y,onLostPointerCapture:y,children:[f.jsxs("div",{children:[f.jsx(qi,{children:e}),t&&f.jsx(Zi,{children:t})]}),f.jsx(es,{className:"dialog-close","aria-label":u("common.close"),children:"×"})]}),f.jsx("div",{className:"dialog-body",children:r}),i&&f.jsx("div",{className:"dialog-footer",children:i})]})]})})}function ts(o){return o instanceof Element&&!!o.closest("button, a, input, select, textarea, [data-dialog-no-drag]")}function Wt(o,e,t){return Math.max(e,Math.min(t,o))}function cs({open:o,title:e,description:t,confirmLabel:n,danger:r,onCancel:i,onConfirm:s,error:a,busy:c=!1}){const{t:l}=z();return f.jsx(ft,{open:o,title:e,description:t,onOpenChange:u=>{!u&&!c&&i()},footer:f.jsxs(f.Fragment,{children:[f.jsx("button",{disabled:c,onClick:i,children:l("common.cancel")}),f.jsxs("button",{className:r?"danger":"primary",disabled:c,"aria-busy":c,onClick:s,children:[c&&f.jsx(lo,{className:"spin",size:14}),n??l("common.remove")]})]}),children:f.jsxs(f.Fragment,{children:[a&&f.jsx("p",{className:"error dialog-error",children:a}),f.jsx("div",{})]})})}class _e extends p.Component{constructor(e){super(e),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){console.error("Uncaught error in component tree:",e,t)}handleReset=()=>{this.setState({hasError:!1,error:null}),this.props.onReset?.()};render(){return this.state.hasError?typeof this.props.fallback=="function"?this.props.fallback(this.state.error??new Error("Unknown error"),this.handleReset):this.props.fallback?this.props.fallback:f.jsxs("div",{role:"alert",style:{padding:"2rem",margin:"1rem",borderRadius:"8px",backgroundColor:"var(--bg-secondary, #f8f9fa)",border:"1px solid var(--border-color, #e9ecef)",color:"var(--text-primary, #212529)",fontFamily:"system-ui, -apple-system, sans-serif"},children:[f.jsx("h2",{style:{fontSize:"1.25rem",fontWeight:600,marginBottom:"0.5rem",color:"#dc3545"},children:this.props.title??E.t("errors.boundaryTitle")}),f.jsx("p",{style:{fontSize:"0.9rem",color:"var(--text-secondary, #6c757d)",marginBottom:"1rem"},children:E.t("errors.boundaryDescription")}),f.jsxs("div",{style:{display:"flex",gap:"0.5rem"},children:[f.jsx("button",{type:"button",onClick:this.handleReset,className:"primary",style:{padding:"0.4rem 0.8rem",borderRadius:"4px",cursor:"pointer"},children:E.t("errors.boundaryRetry")}),f.jsx("button",{type:"button",onClick:()=>window.location.reload(),style:{padding:"0.4rem 0.8rem",borderRadius:"4px",cursor:"pointer"},children:E.t("errors.boundaryReload")})]})]}):this.props.children}}function ht({compact:o=!1}){const{t:e}=z();return f.jsxs("div",{className:`lazy-load-state${o?" compact":""}`,role:"status","aria-live":"polite",children:[f.jsx(lo,{className:"spin",size:o?15:18}),f.jsx("span",{children:e("common.loading")})]})}function mt({onClose:o,compact:e=!1}){const{t}=z();return f.jsxs("div",{className:`lazy-load-state lazy-load-error${e?" compact":""}`,role:"alert",children:[f.jsx("span",{children:t("errors.boundaryDescription")}),f.jsxs("div",{className:"lazy-load-actions",children:[o&&f.jsx("button",{type:"button",onClick:o,children:t("common.close")}),f.jsx("button",{type:"button",className:"primary",onClick:()=>window.location.reload(),children:t("common.reload")})]})]})}function os({title:o,onClose:e}){return f.jsx(ft,{open:!0,title:o,onOpenChange:t=>{t||e()},children:f.jsx(mt,{onClose:e})})}function Xt({children:o,onClose:e}){return f.jsx(_e,{fallback:f.jsx(mt,{onClose:e}),children:f.jsx(p.Suspense,{fallback:f.jsx(ht,{}),children:o})})}function ls({title:o,onClose:e,children:t}){const n=f.jsx(ft,{open:!0,title:o,onOpenChange:i=>{i||e()},children:f.jsx(ht,{})}),r=f.jsx(os,{title:o,onClose:e});return f.jsx(_e,{fallback:r,children:f.jsx(p.Suspense,{fallback:n,children:t})})}function ds({children:o,onClose:e}){return f.jsx(_e,{fallback:f.jsx(mt,{onClose:e,compact:!0}),children:f.jsx(p.Suspense,{fallback:f.jsx(ht,{compact:!0}),children:o})})}const zo=()=>nt(()=>import("./Dashboard-CoE5ESfb.js").then(o=>o.D),__vite__mapDeps([11,1,12,7,13,14,15])),ns=p.lazy(()=>zo().then(o=>({default:o.Dashboard}))),rs=p.lazy(()=>Le().then(o=>({default:o.ProjectWorkspace})));function Re(o){o().catch(()=>{})}function is(){const{t:o}=z(),[e,t]=p.useState(null),[n,r]=p.useState(),i=p.useRef(n);i.current=n;const[s,a]=p.useState(()=>typeof window>"u"?null:J(window.location.pathname)),[c,l]=p.useState(()=>typeof window>"u"?null:he(window.location.search)),[u,d]=p.useState(null),[h,g]=p.useState(null),m=()=>{const y=J(window.location.pathname);if(!y)return;const b={texliteRoute:"dashboard"};window.history.replaceState(b,"",$r(y,he(window.location.search))),a(null),l(null),d(null)},x=y=>{const b=!y.mustChangePassword,w=Hr(window.location.search),D=Br(window.location.search);let k=null;if(w){const L={texliteRoute:"project",projectId:w,fromDashboard:!1};window.history.replaceState(L,"",ne(w,D)),a(w),l(D),k=w}else if(new URLSearchParams(window.location.search).has("return")){const L={texliteRoute:"dashboard"};window.history.replaceState(L,"","/"),a(null),l(null)}else J(window.location.pathname)&&(k=J(window.location.pathname));b&&k?(Re(Le),d(Be(k))):b?Re(zo):d(null),r(y)};p.useEffect(()=>{const y=J(window.location.pathname),b=he(window.location.search);if(y&&`${window.location.pathname}${window.location.search}`!==ne(y,b)){const k={texliteRoute:"project",projectId:y,fromDashboard:!1};window.history.replaceState(k,"",ne(y,b))}const w=()=>{const k=J(window.location.pathname);a(k),l(k?he(window.location.search):null);const L=i.current;k&&L&&!L.mustChangePassword?(Re(Le),d(Be(k))):d(null)},D=()=>{g(null),r(null),m()};return window.addEventListener("popstate",w),window.addEventListener("texlite:session-expired",D),()=>{window.removeEventListener("popstate",w),window.removeEventListener("texlite:session-expired",D)}},[]);const v=(y,b)=>{const w=ne(y,b);if(`${window.location.pathname}${window.location.search}`!==w){const D={texliteRoute:"project",projectId:y,fromDashboard:!0};window.history.pushState(D,"",w)}Re(Le),d(Be(y)),a(y),l(b??null)},S=()=>{const y=window.history.state;if(At(y)&&y.fromDashboard){window.history.back();return}const b={texliteRoute:"dashboard"};window.history.replaceState(b,"","/"),a(null),l(null),d(null)};if(p.useEffect(()=>{se("/api/config").then(y=>{t(y),document.title=y.siteName}),se("/api/me",{suppressSessionExpired:!0}).then(({user:y})=>x(y)).catch(()=>{m(),r(null)})},[]),p.useEffect(()=>{if(!n||n.mustChangePassword||s)return;let y=!1,b=null,w=null;const D=()=>{y||no().then(L=>L.preloadPdfRuntime()).catch(()=>{})},k=window;return k.requestIdleCallback?w=k.requestIdleCallback(D,{timeout:1200}):b=window.setTimeout(D,400),()=>{y=!0,b!==null&&window.clearTimeout(b),w!==null&&k.cancelIdleCallback?.(w)}},[n?.id,n?.mustChangePassword,s]),n===void 0||!e)return f.jsx("div",{className:"center-card",children:o("common.loading")});if(!n)return f.jsx(Xr,{site:e,onLogin:x});if(n.mustChangePassword)return f.jsx(Wr,{site:e,user:n,onChanged:y=>r(y)});if(s)return f.jsx(Xt,{onClose:S,children:f.jsx(rs,{site:e,user:n,projectId:s,preload:u?.projectId===s?u:null,mentionId:c,onMentionTargeted:()=>{const y=window.history.state,b=At(y)?{...y,projectId:s}:{texliteRoute:"project",projectId:s,fromDashboard:!1};window.history.replaceState(b,"",ne(s)),l(null)},onMentionsRead:(y,b)=>g(w=>w&&w.userId===n.id?{...w,projects:w.projects.map(D=>D.id===s?{...D,unreadMentionCount:b?0:Math.max(0,(D.unreadMentionCount??0)-y)}:D)}:w),onBack:S},s)},`project:${s}`);const C=h?.userId===n.id?h:null;return f.jsx(Xt,{children:f.jsx(ns,{site:e,user:n,initialData:C?{projects:C.projects,tags:C.tags,pagination:C.pagination}:null,onDataChange:(y,b,w)=>g({userId:n.id,projects:y,tags:b,pagination:w}),onUser:y=>{(!y||y.id!==n.id)&&g(null),r(y),y||S()},onOpenProject:v})},"dashboard")}Yo.createRoot(document.getElementById("root")).render(f.jsx(p.StrictMode,{children:f.jsx(_e,{children:f.jsx(is,{})})}));export{ye as A,cs as C,io as L,ft as M,so as S,nt as _,Xt as a,lo as b,Yr as c,ls as d,ao as e,se as f,ro as g,no as h,E as i,ds as j,Mr as l,Ar as n,to as r};
|